##// END OF EJS Templates
Return ValueError catching to raw_input to (kinda) fix sys.stdin.close()i
vivainio -
Show More
@@ -1,2370 +1,2379 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.3 or newer.
5 Requires Python 2.3 or newer.
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 1788 2006-09-27 07:15:44Z fperez $
9 $Id: iplib.py 1803 2006-10-03 16:29:50Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pdb
50 import pdb
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
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.ipstruct import Struct
72 from IPython.ipstruct 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 import IPython.ipapi
76 import IPython.ipapi
77
77
78 # Globals
78 # Globals
79
79
80 # store the builtin raw_input globally, and use this always, in case user code
80 # store the builtin raw_input globally, and use this always, in case user code
81 # overwrites it (like wx.py.PyShell does)
81 # overwrites it (like wx.py.PyShell does)
82 raw_input_original = raw_input
82 raw_input_original = raw_input
83
83
84 # compiled regexps for autoindent management
84 # compiled regexps for autoindent management
85 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
85 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
86
86
87
87
88 #****************************************************************************
88 #****************************************************************************
89 # Some utility function definitions
89 # Some utility function definitions
90
90
91 ini_spaces_re = re.compile(r'^(\s+)')
91 ini_spaces_re = re.compile(r'^(\s+)')
92
92
93 def num_ini_spaces(strng):
93 def num_ini_spaces(strng):
94 """Return the number of initial spaces in a string"""
94 """Return the number of initial spaces in a string"""
95
95
96 ini_spaces = ini_spaces_re.match(strng)
96 ini_spaces = ini_spaces_re.match(strng)
97 if ini_spaces:
97 if ini_spaces:
98 return ini_spaces.end()
98 return ini_spaces.end()
99 else:
99 else:
100 return 0
100 return 0
101
101
102 def softspace(file, newvalue):
102 def softspace(file, newvalue):
103 """Copied from code.py, to remove the dependency"""
103 """Copied from code.py, to remove the dependency"""
104
104
105 oldvalue = 0
105 oldvalue = 0
106 try:
106 try:
107 oldvalue = file.softspace
107 oldvalue = file.softspace
108 except AttributeError:
108 except AttributeError:
109 pass
109 pass
110 try:
110 try:
111 file.softspace = newvalue
111 file.softspace = newvalue
112 except (AttributeError, TypeError):
112 except (AttributeError, TypeError):
113 # "attribute-less object" or "read-only attributes"
113 # "attribute-less object" or "read-only attributes"
114 pass
114 pass
115 return oldvalue
115 return oldvalue
116
116
117
117
118 #****************************************************************************
118 #****************************************************************************
119 # Local use exceptions
119 # Local use exceptions
120 class SpaceInInput(exceptions.Exception): pass
120 class SpaceInInput(exceptions.Exception): pass
121
121
122
122
123 #****************************************************************************
123 #****************************************************************************
124 # Local use classes
124 # Local use classes
125 class Bunch: pass
125 class Bunch: pass
126
126
127 class Undefined: pass
127 class Undefined: pass
128
128
129 class Quitter(object):
129 class Quitter(object):
130 """Simple class to handle exit, similar to Python 2.5's.
130 """Simple class to handle exit, similar to Python 2.5's.
131
131
132 It handles exiting in an ipython-safe manner, which the one in Python 2.5
132 It handles exiting in an ipython-safe manner, which the one in Python 2.5
133 doesn't do (obviously, since it doesn't know about ipython)."""
133 doesn't do (obviously, since it doesn't know about ipython)."""
134
134
135 def __init__(self,shell,name):
135 def __init__(self,shell,name):
136 self.shell = shell
136 self.shell = shell
137 self.name = name
137 self.name = name
138
138
139 def __repr__(self):
139 def __repr__(self):
140 return 'Type %s() to exit.' % self.name
140 return 'Type %s() to exit.' % self.name
141 __str__ = __repr__
141 __str__ = __repr__
142
142
143 def __call__(self):
143 def __call__(self):
144 self.shell.exit()
144 self.shell.exit()
145
145
146 class InputList(list):
146 class InputList(list):
147 """Class to store user input.
147 """Class to store user input.
148
148
149 It's basically a list, but slices return a string instead of a list, thus
149 It's basically a list, but slices return a string instead of a list, thus
150 allowing things like (assuming 'In' is an instance):
150 allowing things like (assuming 'In' is an instance):
151
151
152 exec In[4:7]
152 exec In[4:7]
153
153
154 or
154 or
155
155
156 exec In[5:9] + In[14] + In[21:25]"""
156 exec In[5:9] + In[14] + In[21:25]"""
157
157
158 def __getslice__(self,i,j):
158 def __getslice__(self,i,j):
159 return ''.join(list.__getslice__(self,i,j))
159 return ''.join(list.__getslice__(self,i,j))
160
160
161 class SyntaxTB(ultraTB.ListTB):
161 class SyntaxTB(ultraTB.ListTB):
162 """Extension which holds some state: the last exception value"""
162 """Extension which holds some state: the last exception value"""
163
163
164 def __init__(self,color_scheme = 'NoColor'):
164 def __init__(self,color_scheme = 'NoColor'):
165 ultraTB.ListTB.__init__(self,color_scheme)
165 ultraTB.ListTB.__init__(self,color_scheme)
166 self.last_syntax_error = None
166 self.last_syntax_error = None
167
167
168 def __call__(self, etype, value, elist):
168 def __call__(self, etype, value, elist):
169 self.last_syntax_error = value
169 self.last_syntax_error = value
170 ultraTB.ListTB.__call__(self,etype,value,elist)
170 ultraTB.ListTB.__call__(self,etype,value,elist)
171
171
172 def clear_err_state(self):
172 def clear_err_state(self):
173 """Return the current error state and clear it"""
173 """Return the current error state and clear it"""
174 e = self.last_syntax_error
174 e = self.last_syntax_error
175 self.last_syntax_error = None
175 self.last_syntax_error = None
176 return e
176 return e
177
177
178 #****************************************************************************
178 #****************************************************************************
179 # Main IPython class
179 # Main IPython class
180
180
181 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
181 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
182 # until a full rewrite is made. I've cleaned all cross-class uses of
182 # until a full rewrite is made. I've cleaned all cross-class uses of
183 # attributes and methods, but too much user code out there relies on the
183 # attributes and methods, but too much user code out there relies on the
184 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
184 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
185 #
185 #
186 # But at least now, all the pieces have been separated and we could, in
186 # But at least now, all the pieces have been separated and we could, in
187 # principle, stop using the mixin. This will ease the transition to the
187 # principle, stop using the mixin. This will ease the transition to the
188 # chainsaw branch.
188 # chainsaw branch.
189
189
190 # For reference, the following is the list of 'self.foo' uses in the Magic
190 # For reference, the following is the list of 'self.foo' uses in the Magic
191 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
191 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
192 # class, to prevent clashes.
192 # class, to prevent clashes.
193
193
194 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
194 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
195 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
195 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
196 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
196 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
197 # 'self.value']
197 # 'self.value']
198
198
199 class InteractiveShell(object,Magic):
199 class InteractiveShell(object,Magic):
200 """An enhanced console for Python."""
200 """An enhanced console for Python."""
201
201
202 # class attribute to indicate whether the class supports threads or not.
202 # class attribute to indicate whether the class supports threads or not.
203 # Subclasses with thread support should override this as needed.
203 # Subclasses with thread support should override this as needed.
204 isthreaded = False
204 isthreaded = False
205
205
206 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
206 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
207 user_ns = None,user_global_ns=None,banner2='',
207 user_ns = None,user_global_ns=None,banner2='',
208 custom_exceptions=((),None),embedded=False):
208 custom_exceptions=((),None),embedded=False):
209
209
210 # log system
210 # log system
211 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
211 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
212
212
213 # some minimal strict typechecks. For some core data structures, I
213 # some minimal strict typechecks. For some core data structures, I
214 # want actual basic python types, not just anything that looks like
214 # want actual basic python types, not just anything that looks like
215 # one. This is especially true for namespaces.
215 # one. This is especially true for namespaces.
216 for ns in (user_ns,user_global_ns):
216 for ns in (user_ns,user_global_ns):
217 if ns is not None and type(ns) != types.DictType:
217 if ns is not None and type(ns) != types.DictType:
218 raise TypeError,'namespace must be a dictionary'
218 raise TypeError,'namespace must be a dictionary'
219
219
220 # Job manager (for jobs run as background threads)
220 # Job manager (for jobs run as background threads)
221 self.jobs = BackgroundJobManager()
221 self.jobs = BackgroundJobManager()
222
222
223 # Store the actual shell's name
223 # Store the actual shell's name
224 self.name = name
224 self.name = name
225
225
226 # We need to know whether the instance is meant for embedding, since
226 # We need to know whether the instance is meant for embedding, since
227 # global/local namespaces need to be handled differently in that case
227 # global/local namespaces need to be handled differently in that case
228 self.embedded = embedded
228 self.embedded = embedded
229
229
230 # command compiler
230 # command compiler
231 self.compile = codeop.CommandCompiler()
231 self.compile = codeop.CommandCompiler()
232
232
233 # User input buffer
233 # User input buffer
234 self.buffer = []
234 self.buffer = []
235
235
236 # Default name given in compilation of code
236 # Default name given in compilation of code
237 self.filename = '<ipython console>'
237 self.filename = '<ipython console>'
238
238
239 # Install our own quitter instead of the builtins. For python2.3-2.4,
239 # Install our own quitter instead of the builtins. For python2.3-2.4,
240 # this brings in behavior like 2.5, and for 2.5 it's identical.
240 # this brings in behavior like 2.5, and for 2.5 it's identical.
241 __builtin__.exit = Quitter(self,'exit')
241 __builtin__.exit = Quitter(self,'exit')
242 __builtin__.quit = Quitter(self,'quit')
242 __builtin__.quit = Quitter(self,'quit')
243
243
244 # Make an empty namespace, which extension writers can rely on both
244 # Make an empty namespace, which extension writers can rely on both
245 # existing and NEVER being used by ipython itself. This gives them a
245 # existing and NEVER being used by ipython itself. This gives them a
246 # convenient location for storing additional information and state
246 # convenient location for storing additional information and state
247 # their extensions may require, without fear of collisions with other
247 # their extensions may require, without fear of collisions with other
248 # ipython names that may develop later.
248 # ipython names that may develop later.
249 self.meta = Struct()
249 self.meta = Struct()
250
250
251 # Create the namespace where the user will operate. user_ns is
251 # Create the namespace where the user will operate. user_ns is
252 # normally the only one used, and it is passed to the exec calls as
252 # normally the only one used, and it is passed to the exec calls as
253 # the locals argument. But we do carry a user_global_ns namespace
253 # the locals argument. But we do carry a user_global_ns namespace
254 # given as the exec 'globals' argument, This is useful in embedding
254 # given as the exec 'globals' argument, This is useful in embedding
255 # situations where the ipython shell opens in a context where the
255 # situations where the ipython shell opens in a context where the
256 # distinction between locals and globals is meaningful.
256 # distinction between locals and globals is meaningful.
257
257
258 # FIXME. For some strange reason, __builtins__ is showing up at user
258 # FIXME. For some strange reason, __builtins__ is showing up at user
259 # level as a dict instead of a module. This is a manual fix, but I
259 # level as a dict instead of a module. This is a manual fix, but I
260 # should really track down where the problem is coming from. Alex
260 # should really track down where the problem is coming from. Alex
261 # Schmolck reported this problem first.
261 # Schmolck reported this problem first.
262
262
263 # A useful post by Alex Martelli on this topic:
263 # A useful post by Alex Martelli on this topic:
264 # Re: inconsistent value from __builtins__
264 # Re: inconsistent value from __builtins__
265 # Von: Alex Martelli <aleaxit@yahoo.com>
265 # Von: Alex Martelli <aleaxit@yahoo.com>
266 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
266 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
267 # Gruppen: comp.lang.python
267 # Gruppen: comp.lang.python
268
268
269 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
269 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
270 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
270 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
271 # > <type 'dict'>
271 # > <type 'dict'>
272 # > >>> print type(__builtins__)
272 # > >>> print type(__builtins__)
273 # > <type 'module'>
273 # > <type 'module'>
274 # > Is this difference in return value intentional?
274 # > Is this difference in return value intentional?
275
275
276 # Well, it's documented that '__builtins__' can be either a dictionary
276 # Well, it's documented that '__builtins__' can be either a dictionary
277 # or a module, and it's been that way for a long time. Whether it's
277 # or a module, and it's been that way for a long time. Whether it's
278 # intentional (or sensible), I don't know. In any case, the idea is
278 # intentional (or sensible), I don't know. In any case, the idea is
279 # that if you need to access the built-in namespace directly, you
279 # that if you need to access the built-in namespace directly, you
280 # should start with "import __builtin__" (note, no 's') which will
280 # should start with "import __builtin__" (note, no 's') which will
281 # definitely give you a module. Yeah, it's somewhat confusing:-(.
281 # definitely give you a module. Yeah, it's somewhat confusing:-(.
282
282
283 # These routines return properly built dicts as needed by the rest of
283 # These routines return properly built dicts as needed by the rest of
284 # the code, and can also be used by extension writers to generate
284 # the code, and can also be used by extension writers to generate
285 # properly initialized namespaces.
285 # properly initialized namespaces.
286 user_ns = IPython.ipapi.make_user_ns(user_ns)
286 user_ns = IPython.ipapi.make_user_ns(user_ns)
287 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
287 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
288
288
289 # Assign namespaces
289 # Assign namespaces
290 # This is the namespace where all normal user variables live
290 # This is the namespace where all normal user variables live
291 self.user_ns = user_ns
291 self.user_ns = user_ns
292 # Embedded instances require a separate namespace for globals.
292 # Embedded instances require a separate namespace for globals.
293 # Normally this one is unused by non-embedded instances.
293 # Normally this one is unused by non-embedded instances.
294 self.user_global_ns = user_global_ns
294 self.user_global_ns = user_global_ns
295 # A namespace to keep track of internal data structures to prevent
295 # A namespace to keep track of internal data structures to prevent
296 # them from cluttering user-visible stuff. Will be updated later
296 # them from cluttering user-visible stuff. Will be updated later
297 self.internal_ns = {}
297 self.internal_ns = {}
298
298
299 # Namespace of system aliases. Each entry in the alias
299 # Namespace of system aliases. Each entry in the alias
300 # table must be a 2-tuple of the form (N,name), where N is the number
300 # table must be a 2-tuple of the form (N,name), where N is the number
301 # of positional arguments of the alias.
301 # of positional arguments of the alias.
302 self.alias_table = {}
302 self.alias_table = {}
303
303
304 # A table holding all the namespaces IPython deals with, so that
304 # A table holding all the namespaces IPython deals with, so that
305 # introspection facilities can search easily.
305 # introspection facilities can search easily.
306 self.ns_table = {'user':user_ns,
306 self.ns_table = {'user':user_ns,
307 'user_global':user_global_ns,
307 'user_global':user_global_ns,
308 'alias':self.alias_table,
308 'alias':self.alias_table,
309 'internal':self.internal_ns,
309 'internal':self.internal_ns,
310 'builtin':__builtin__.__dict__
310 'builtin':__builtin__.__dict__
311 }
311 }
312
312
313 # The user namespace MUST have a pointer to the shell itself.
313 # The user namespace MUST have a pointer to the shell itself.
314 self.user_ns[name] = self
314 self.user_ns[name] = self
315
315
316 # We need to insert into sys.modules something that looks like a
316 # We need to insert into sys.modules something that looks like a
317 # module but which accesses the IPython namespace, for shelve and
317 # module but which accesses the IPython namespace, for shelve and
318 # pickle to work interactively. Normally they rely on getting
318 # pickle to work interactively. Normally they rely on getting
319 # everything out of __main__, but for embedding purposes each IPython
319 # everything out of __main__, but for embedding purposes each IPython
320 # instance has its own private namespace, so we can't go shoving
320 # instance has its own private namespace, so we can't go shoving
321 # everything into __main__.
321 # everything into __main__.
322
322
323 # note, however, that we should only do this for non-embedded
323 # note, however, that we should only do this for non-embedded
324 # ipythons, which really mimic the __main__.__dict__ with their own
324 # ipythons, which really mimic the __main__.__dict__ with their own
325 # namespace. Embedded instances, on the other hand, should not do
325 # namespace. Embedded instances, on the other hand, should not do
326 # this because they need to manage the user local/global namespaces
326 # this because they need to manage the user local/global namespaces
327 # only, but they live within a 'normal' __main__ (meaning, they
327 # only, but they live within a 'normal' __main__ (meaning, they
328 # shouldn't overtake the execution environment of the script they're
328 # shouldn't overtake the execution environment of the script they're
329 # embedded in).
329 # embedded in).
330
330
331 if not embedded:
331 if not embedded:
332 try:
332 try:
333 main_name = self.user_ns['__name__']
333 main_name = self.user_ns['__name__']
334 except KeyError:
334 except KeyError:
335 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
335 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
336 else:
336 else:
337 #print "pickle hack in place" # dbg
337 #print "pickle hack in place" # dbg
338 #print 'main_name:',main_name # dbg
338 #print 'main_name:',main_name # dbg
339 sys.modules[main_name] = FakeModule(self.user_ns)
339 sys.modules[main_name] = FakeModule(self.user_ns)
340
340
341 # List of input with multi-line handling.
341 # List of input with multi-line handling.
342 # Fill its zero entry, user counter starts at 1
342 # Fill its zero entry, user counter starts at 1
343 self.input_hist = InputList(['\n'])
343 self.input_hist = InputList(['\n'])
344 # This one will hold the 'raw' input history, without any
344 # This one will hold the 'raw' input history, without any
345 # pre-processing. This will allow users to retrieve the input just as
345 # pre-processing. This will allow users to retrieve the input just as
346 # it was exactly typed in by the user, with %hist -r.
346 # it was exactly typed in by the user, with %hist -r.
347 self.input_hist_raw = InputList(['\n'])
347 self.input_hist_raw = InputList(['\n'])
348
348
349 # list of visited directories
349 # list of visited directories
350 try:
350 try:
351 self.dir_hist = [os.getcwd()]
351 self.dir_hist = [os.getcwd()]
352 except IOError, e:
352 except IOError, e:
353 self.dir_hist = []
353 self.dir_hist = []
354
354
355 # dict of output history
355 # dict of output history
356 self.output_hist = {}
356 self.output_hist = {}
357
357
358 # dict of things NOT to alias (keywords, builtins and some magics)
358 # dict of things NOT to alias (keywords, builtins and some magics)
359 no_alias = {}
359 no_alias = {}
360 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
360 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
361 for key in keyword.kwlist + no_alias_magics:
361 for key in keyword.kwlist + no_alias_magics:
362 no_alias[key] = 1
362 no_alias[key] = 1
363 no_alias.update(__builtin__.__dict__)
363 no_alias.update(__builtin__.__dict__)
364 self.no_alias = no_alias
364 self.no_alias = no_alias
365
365
366 # make global variables for user access to these
366 # make global variables for user access to these
367 self.user_ns['_ih'] = self.input_hist
367 self.user_ns['_ih'] = self.input_hist
368 self.user_ns['_oh'] = self.output_hist
368 self.user_ns['_oh'] = self.output_hist
369 self.user_ns['_dh'] = self.dir_hist
369 self.user_ns['_dh'] = self.dir_hist
370
370
371 # user aliases to input and output histories
371 # user aliases to input and output histories
372 self.user_ns['In'] = self.input_hist
372 self.user_ns['In'] = self.input_hist
373 self.user_ns['Out'] = self.output_hist
373 self.user_ns['Out'] = self.output_hist
374
374
375 # Object variable to store code object waiting execution. This is
375 # Object variable to store code object waiting execution. This is
376 # used mainly by the multithreaded shells, but it can come in handy in
376 # used mainly by the multithreaded shells, but it can come in handy in
377 # other situations. No need to use a Queue here, since it's a single
377 # other situations. No need to use a Queue here, since it's a single
378 # item which gets cleared once run.
378 # item which gets cleared once run.
379 self.code_to_run = None
379 self.code_to_run = None
380
380
381 # escapes for automatic behavior on the command line
381 # escapes for automatic behavior on the command line
382 self.ESC_SHELL = '!'
382 self.ESC_SHELL = '!'
383 self.ESC_HELP = '?'
383 self.ESC_HELP = '?'
384 self.ESC_MAGIC = '%'
384 self.ESC_MAGIC = '%'
385 self.ESC_QUOTE = ','
385 self.ESC_QUOTE = ','
386 self.ESC_QUOTE2 = ';'
386 self.ESC_QUOTE2 = ';'
387 self.ESC_PAREN = '/'
387 self.ESC_PAREN = '/'
388
388
389 # And their associated handlers
389 # And their associated handlers
390 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
390 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
391 self.ESC_QUOTE : self.handle_auto,
391 self.ESC_QUOTE : self.handle_auto,
392 self.ESC_QUOTE2 : self.handle_auto,
392 self.ESC_QUOTE2 : self.handle_auto,
393 self.ESC_MAGIC : self.handle_magic,
393 self.ESC_MAGIC : self.handle_magic,
394 self.ESC_HELP : self.handle_help,
394 self.ESC_HELP : self.handle_help,
395 self.ESC_SHELL : self.handle_shell_escape,
395 self.ESC_SHELL : self.handle_shell_escape,
396 }
396 }
397
397
398 # class initializations
398 # class initializations
399 Magic.__init__(self,self)
399 Magic.__init__(self,self)
400
400
401 # Python source parser/formatter for syntax highlighting
401 # Python source parser/formatter for syntax highlighting
402 pyformat = PyColorize.Parser().format
402 pyformat = PyColorize.Parser().format
403 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
403 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
404
404
405 # hooks holds pointers used for user-side customizations
405 # hooks holds pointers used for user-side customizations
406 self.hooks = Struct()
406 self.hooks = Struct()
407
407
408 # Set all default hooks, defined in the IPython.hooks module.
408 # Set all default hooks, defined in the IPython.hooks module.
409 hooks = IPython.hooks
409 hooks = IPython.hooks
410 for hook_name in hooks.__all__:
410 for hook_name in hooks.__all__:
411 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
411 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
412 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
412 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
413 #print "bound hook",hook_name
413 #print "bound hook",hook_name
414
414
415 # Flag to mark unconditional exit
415 # Flag to mark unconditional exit
416 self.exit_now = False
416 self.exit_now = False
417
417
418 self.usage_min = """\
418 self.usage_min = """\
419 An enhanced console for Python.
419 An enhanced console for Python.
420 Some of its features are:
420 Some of its features are:
421 - Readline support if the readline library is present.
421 - Readline support if the readline library is present.
422 - Tab completion in the local namespace.
422 - Tab completion in the local namespace.
423 - Logging of input, see command-line options.
423 - Logging of input, see command-line options.
424 - System shell escape via ! , eg !ls.
424 - System shell escape via ! , eg !ls.
425 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
425 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
426 - Keeps track of locally defined variables via %who, %whos.
426 - Keeps track of locally defined variables via %who, %whos.
427 - Show object information with a ? eg ?x or x? (use ?? for more info).
427 - Show object information with a ? eg ?x or x? (use ?? for more info).
428 """
428 """
429 if usage: self.usage = usage
429 if usage: self.usage = usage
430 else: self.usage = self.usage_min
430 else: self.usage = self.usage_min
431
431
432 # Storage
432 # Storage
433 self.rc = rc # This will hold all configuration information
433 self.rc = rc # This will hold all configuration information
434 self.pager = 'less'
434 self.pager = 'less'
435 # temporary files used for various purposes. Deleted at exit.
435 # temporary files used for various purposes. Deleted at exit.
436 self.tempfiles = []
436 self.tempfiles = []
437
437
438 # Keep track of readline usage (later set by init_readline)
438 # Keep track of readline usage (later set by init_readline)
439 self.has_readline = False
439 self.has_readline = False
440
440
441 # template for logfile headers. It gets resolved at runtime by the
441 # template for logfile headers. It gets resolved at runtime by the
442 # logstart method.
442 # logstart method.
443 self.loghead_tpl = \
443 self.loghead_tpl = \
444 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
444 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
445 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
445 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
446 #log# opts = %s
446 #log# opts = %s
447 #log# args = %s
447 #log# args = %s
448 #log# It is safe to make manual edits below here.
448 #log# It is safe to make manual edits below here.
449 #log#-----------------------------------------------------------------------
449 #log#-----------------------------------------------------------------------
450 """
450 """
451 # for pushd/popd management
451 # for pushd/popd management
452 try:
452 try:
453 self.home_dir = get_home_dir()
453 self.home_dir = get_home_dir()
454 except HomeDirError,msg:
454 except HomeDirError,msg:
455 fatal(msg)
455 fatal(msg)
456
456
457 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
457 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
458
458
459 # Functions to call the underlying shell.
459 # Functions to call the underlying shell.
460
460
461 # utility to expand user variables via Itpl
461 # utility to expand user variables via Itpl
462 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
462 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
463 self.user_ns))
463 self.user_ns))
464 # The first is similar to os.system, but it doesn't return a value,
464 # The first is similar to os.system, but it doesn't return a value,
465 # and it allows interpolation of variables in the user's namespace.
465 # and it allows interpolation of variables in the user's namespace.
466 self.system = lambda cmd: shell(self.var_expand(cmd),
466 self.system = lambda cmd: shell(self.var_expand(cmd),
467 header='IPython system call: ',
467 header='IPython system call: ',
468 verbose=self.rc.system_verbose)
468 verbose=self.rc.system_verbose)
469 # These are for getoutput and getoutputerror:
469 # These are for getoutput and getoutputerror:
470 self.getoutput = lambda cmd: \
470 self.getoutput = lambda cmd: \
471 getoutput(self.var_expand(cmd),
471 getoutput(self.var_expand(cmd),
472 header='IPython system call: ',
472 header='IPython system call: ',
473 verbose=self.rc.system_verbose)
473 verbose=self.rc.system_verbose)
474 self.getoutputerror = lambda cmd: \
474 self.getoutputerror = lambda cmd: \
475 getoutputerror(self.var_expand(cmd),
475 getoutputerror(self.var_expand(cmd),
476 header='IPython system call: ',
476 header='IPython system call: ',
477 verbose=self.rc.system_verbose)
477 verbose=self.rc.system_verbose)
478
478
479 # RegExp for splitting line contents into pre-char//first
479 # RegExp for splitting line contents into pre-char//first
480 # word-method//rest. For clarity, each group in on one line.
480 # word-method//rest. For clarity, each group in on one line.
481
481
482 # WARNING: update the regexp if the above escapes are changed, as they
482 # WARNING: update the regexp if the above escapes are changed, as they
483 # are hardwired in.
483 # are hardwired in.
484
484
485 # Don't get carried away with trying to make the autocalling catch too
485 # Don't get carried away with trying to make the autocalling catch too
486 # much: it's better to be conservative rather than to trigger hidden
486 # much: it's better to be conservative rather than to trigger hidden
487 # evals() somewhere and end up causing side effects.
487 # evals() somewhere and end up causing side effects.
488
488
489 self.line_split = re.compile(r'^([\s*,;/])'
489 self.line_split = re.compile(r'^([\s*,;/])'
490 r'([\?\w\.]+\w*\s*)'
490 r'([\?\w\.]+\w*\s*)'
491 r'(\(?.*$)')
491 r'(\(?.*$)')
492
492
493 # Original re, keep around for a while in case changes break something
493 # Original re, keep around for a while in case changes break something
494 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
494 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
495 # r'(\s*[\?\w\.]+\w*\s*)'
495 # r'(\s*[\?\w\.]+\w*\s*)'
496 # r'(\(?.*$)')
496 # r'(\(?.*$)')
497
497
498 # RegExp to identify potential function names
498 # RegExp to identify potential function names
499 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
499 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
500
500
501 # RegExp to exclude strings with this start from autocalling. In
501 # RegExp to exclude strings with this start from autocalling. In
502 # particular, all binary operators should be excluded, so that if foo
502 # particular, all binary operators should be excluded, so that if foo
503 # is callable, foo OP bar doesn't become foo(OP bar), which is
503 # is callable, foo OP bar doesn't become foo(OP bar), which is
504 # invalid. The characters '!=()' don't need to be checked for, as the
504 # invalid. The characters '!=()' don't need to be checked for, as the
505 # _prefilter routine explicitely does so, to catch direct calls and
505 # _prefilter routine explicitely does so, to catch direct calls and
506 # rebindings of existing names.
506 # rebindings of existing names.
507
507
508 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
508 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
509 # it affects the rest of the group in square brackets.
509 # it affects the rest of the group in square brackets.
510 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
510 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
511 '|^is |^not |^in |^and |^or ')
511 '|^is |^not |^in |^and |^or ')
512
512
513 # try to catch also methods for stuff in lists/tuples/dicts: off
513 # try to catch also methods for stuff in lists/tuples/dicts: off
514 # (experimental). For this to work, the line_split regexp would need
514 # (experimental). For this to work, the line_split regexp would need
515 # to be modified so it wouldn't break things at '['. That line is
515 # to be modified so it wouldn't break things at '['. That line is
516 # nasty enough that I shouldn't change it until I can test it _well_.
516 # nasty enough that I shouldn't change it until I can test it _well_.
517 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
517 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
518
518
519 # keep track of where we started running (mainly for crash post-mortem)
519 # keep track of where we started running (mainly for crash post-mortem)
520 self.starting_dir = os.getcwd()
520 self.starting_dir = os.getcwd()
521
521
522 # Various switches which can be set
522 # Various switches which can be set
523 self.CACHELENGTH = 5000 # this is cheap, it's just text
523 self.CACHELENGTH = 5000 # this is cheap, it's just text
524 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
524 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
525 self.banner2 = banner2
525 self.banner2 = banner2
526
526
527 # TraceBack handlers:
527 # TraceBack handlers:
528
528
529 # Syntax error handler.
529 # Syntax error handler.
530 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
530 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
531
531
532 # The interactive one is initialized with an offset, meaning we always
532 # The interactive one is initialized with an offset, meaning we always
533 # want to remove the topmost item in the traceback, which is our own
533 # want to remove the topmost item in the traceback, which is our own
534 # internal code. Valid modes: ['Plain','Context','Verbose']
534 # internal code. Valid modes: ['Plain','Context','Verbose']
535 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
535 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
536 color_scheme='NoColor',
536 color_scheme='NoColor',
537 tb_offset = 1)
537 tb_offset = 1)
538
538
539 # IPython itself shouldn't crash. This will produce a detailed
539 # IPython itself shouldn't crash. This will produce a detailed
540 # post-mortem if it does. But we only install the crash handler for
540 # post-mortem if it does. But we only install the crash handler for
541 # non-threaded shells, the threaded ones use a normal verbose reporter
541 # non-threaded shells, the threaded ones use a normal verbose reporter
542 # and lose the crash handler. This is because exceptions in the main
542 # and lose the crash handler. This is because exceptions in the main
543 # thread (such as in GUI code) propagate directly to sys.excepthook,
543 # thread (such as in GUI code) propagate directly to sys.excepthook,
544 # and there's no point in printing crash dumps for every user exception.
544 # and there's no point in printing crash dumps for every user exception.
545 if self.isthreaded:
545 if self.isthreaded:
546 sys.excepthook = ultraTB.FormattedTB()
546 sys.excepthook = ultraTB.FormattedTB()
547 else:
547 else:
548 from IPython import CrashHandler
548 from IPython import CrashHandler
549 sys.excepthook = CrashHandler.CrashHandler(self)
549 sys.excepthook = CrashHandler.CrashHandler(self)
550
550
551 # The instance will store a pointer to this, so that runtime code
551 # The instance will store a pointer to this, so that runtime code
552 # (such as magics) can access it. This is because during the
552 # (such as magics) can access it. This is because during the
553 # read-eval loop, it gets temporarily overwritten (to deal with GUI
553 # read-eval loop, it gets temporarily overwritten (to deal with GUI
554 # frameworks).
554 # frameworks).
555 self.sys_excepthook = sys.excepthook
555 self.sys_excepthook = sys.excepthook
556
556
557 # and add any custom exception handlers the user may have specified
557 # and add any custom exception handlers the user may have specified
558 self.set_custom_exc(*custom_exceptions)
558 self.set_custom_exc(*custom_exceptions)
559
559
560 # indentation management
560 # indentation management
561 self.autoindent = False
561 self.autoindent = False
562 self.indent_current_nsp = 0
562 self.indent_current_nsp = 0
563
563
564 # Make some aliases automatically
564 # Make some aliases automatically
565 # Prepare list of shell aliases to auto-define
565 # Prepare list of shell aliases to auto-define
566 if os.name == 'posix':
566 if os.name == 'posix':
567 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
567 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
568 'mv mv -i','rm rm -i','cp cp -i',
568 'mv mv -i','rm rm -i','cp cp -i',
569 'cat cat','less less','clear clear',
569 'cat cat','less less','clear clear',
570 # a better ls
570 # a better ls
571 'ls ls -F',
571 'ls ls -F',
572 # long ls
572 # long ls
573 'll ls -lF')
573 'll ls -lF')
574 # Extra ls aliases with color, which need special treatment on BSD
574 # Extra ls aliases with color, which need special treatment on BSD
575 # variants
575 # variants
576 ls_extra = ( # color ls
576 ls_extra = ( # color ls
577 'lc ls -F -o --color',
577 'lc ls -F -o --color',
578 # ls normal files only
578 # ls normal files only
579 'lf ls -F -o --color %l | grep ^-',
579 'lf ls -F -o --color %l | grep ^-',
580 # ls symbolic links
580 # ls symbolic links
581 'lk ls -F -o --color %l | grep ^l',
581 'lk ls -F -o --color %l | grep ^l',
582 # directories or links to directories,
582 # directories or links to directories,
583 'ldir ls -F -o --color %l | grep /$',
583 'ldir ls -F -o --color %l | grep /$',
584 # things which are executable
584 # things which are executable
585 'lx ls -F -o --color %l | grep ^-..x',
585 'lx ls -F -o --color %l | grep ^-..x',
586 )
586 )
587 # The BSDs don't ship GNU ls, so they don't understand the
587 # The BSDs don't ship GNU ls, so they don't understand the
588 # --color switch out of the box
588 # --color switch out of the box
589 if 'bsd' in sys.platform:
589 if 'bsd' in sys.platform:
590 ls_extra = ( # ls normal files only
590 ls_extra = ( # ls normal files only
591 'lf ls -lF | grep ^-',
591 'lf ls -lF | grep ^-',
592 # ls symbolic links
592 # ls symbolic links
593 'lk ls -lF | grep ^l',
593 'lk ls -lF | grep ^l',
594 # directories or links to directories,
594 # directories or links to directories,
595 'ldir ls -lF | grep /$',
595 'ldir ls -lF | grep /$',
596 # things which are executable
596 # things which are executable
597 'lx ls -lF | grep ^-..x',
597 'lx ls -lF | grep ^-..x',
598 )
598 )
599 auto_alias = auto_alias + ls_extra
599 auto_alias = auto_alias + ls_extra
600 elif os.name in ['nt','dos']:
600 elif os.name in ['nt','dos']:
601 auto_alias = ('dir dir /on', 'ls dir /on',
601 auto_alias = ('dir dir /on', 'ls dir /on',
602 'ddir dir /ad /on', 'ldir dir /ad /on',
602 'ddir dir /ad /on', 'ldir dir /ad /on',
603 'mkdir mkdir','rmdir rmdir','echo echo',
603 'mkdir mkdir','rmdir rmdir','echo echo',
604 'ren ren','cls cls','copy copy')
604 'ren ren','cls cls','copy copy')
605 else:
605 else:
606 auto_alias = ()
606 auto_alias = ()
607 self.auto_alias = [s.split(None,1) for s in auto_alias]
607 self.auto_alias = [s.split(None,1) for s in auto_alias]
608 # Call the actual (public) initializer
608 # Call the actual (public) initializer
609 self.init_auto_alias()
609 self.init_auto_alias()
610
610
611 # Produce a public API instance
611 # Produce a public API instance
612 self.api = IPython.ipapi.IPApi(self)
612 self.api = IPython.ipapi.IPApi(self)
613
613
614 # track which builtins we add, so we can clean up later
614 # track which builtins we add, so we can clean up later
615 self.builtins_added = {}
615 self.builtins_added = {}
616 # This method will add the necessary builtins for operation, but
616 # This method will add the necessary builtins for operation, but
617 # tracking what it did via the builtins_added dict.
617 # tracking what it did via the builtins_added dict.
618 self.add_builtins()
618 self.add_builtins()
619
619
620 # end __init__
620 # end __init__
621
621
622 def pre_config_initialization(self):
622 def pre_config_initialization(self):
623 """Pre-configuration init method
623 """Pre-configuration init method
624
624
625 This is called before the configuration files are processed to
625 This is called before the configuration files are processed to
626 prepare the services the config files might need.
626 prepare the services the config files might need.
627
627
628 self.rc already has reasonable default values at this point.
628 self.rc already has reasonable default values at this point.
629 """
629 """
630 rc = self.rc
630 rc = self.rc
631
631
632 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
632 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
633
633
634 def post_config_initialization(self):
634 def post_config_initialization(self):
635 """Post configuration init method
635 """Post configuration init method
636
636
637 This is called after the configuration files have been processed to
637 This is called after the configuration files have been processed to
638 'finalize' the initialization."""
638 'finalize' the initialization."""
639
639
640 rc = self.rc
640 rc = self.rc
641
641
642 # Object inspector
642 # Object inspector
643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
644 PyColorize.ANSICodeColors,
644 PyColorize.ANSICodeColors,
645 'NoColor',
645 'NoColor',
646 rc.object_info_string_level)
646 rc.object_info_string_level)
647
647
648 # Load readline proper
648 # Load readline proper
649 if rc.readline:
649 if rc.readline:
650 self.init_readline()
650 self.init_readline()
651
651
652 # local shortcut, this is used a LOT
652 # local shortcut, this is used a LOT
653 self.log = self.logger.log
653 self.log = self.logger.log
654
654
655 # Initialize cache, set in/out prompts and printing system
655 # Initialize cache, set in/out prompts and printing system
656 self.outputcache = CachedOutput(self,
656 self.outputcache = CachedOutput(self,
657 rc.cache_size,
657 rc.cache_size,
658 rc.pprint,
658 rc.pprint,
659 input_sep = rc.separate_in,
659 input_sep = rc.separate_in,
660 output_sep = rc.separate_out,
660 output_sep = rc.separate_out,
661 output_sep2 = rc.separate_out2,
661 output_sep2 = rc.separate_out2,
662 ps1 = rc.prompt_in1,
662 ps1 = rc.prompt_in1,
663 ps2 = rc.prompt_in2,
663 ps2 = rc.prompt_in2,
664 ps_out = rc.prompt_out,
664 ps_out = rc.prompt_out,
665 pad_left = rc.prompts_pad_left)
665 pad_left = rc.prompts_pad_left)
666
666
667 # user may have over-ridden the default print hook:
667 # user may have over-ridden the default print hook:
668 try:
668 try:
669 self.outputcache.__class__.display = self.hooks.display
669 self.outputcache.__class__.display = self.hooks.display
670 except AttributeError:
670 except AttributeError:
671 pass
671 pass
672
672
673 # I don't like assigning globally to sys, because it means when embedding
673 # I don't like assigning globally to sys, because it means when embedding
674 # instances, each embedded instance overrides the previous choice. But
674 # instances, each embedded instance overrides the previous choice. But
675 # sys.displayhook seems to be called internally by exec, so I don't see a
675 # sys.displayhook seems to be called internally by exec, so I don't see a
676 # way around it.
676 # way around it.
677 sys.displayhook = self.outputcache
677 sys.displayhook = self.outputcache
678
678
679 # Set user colors (don't do it in the constructor above so that it
679 # Set user colors (don't do it in the constructor above so that it
680 # doesn't crash if colors option is invalid)
680 # doesn't crash if colors option is invalid)
681 self.magic_colors(rc.colors)
681 self.magic_colors(rc.colors)
682
682
683 # Set calling of pdb on exceptions
683 # Set calling of pdb on exceptions
684 self.call_pdb = rc.pdb
684 self.call_pdb = rc.pdb
685
685
686 # Load user aliases
686 # Load user aliases
687 for alias in rc.alias:
687 for alias in rc.alias:
688 self.magic_alias(alias)
688 self.magic_alias(alias)
689 self.hooks.late_startup_hook()
689 self.hooks.late_startup_hook()
690
690
691 batchrun = False
691 batchrun = False
692 for batchfile in [path(arg) for arg in self.rc.args
692 for batchfile in [path(arg) for arg in self.rc.args
693 if arg.lower().endswith('.ipy')]:
693 if arg.lower().endswith('.ipy')]:
694 if not batchfile.isfile():
694 if not batchfile.isfile():
695 print "No such batch file:", batchfile
695 print "No such batch file:", batchfile
696 continue
696 continue
697 self.api.runlines(batchfile.text())
697 self.api.runlines(batchfile.text())
698 batchrun = True
698 batchrun = True
699 if batchrun:
699 if batchrun:
700 self.exit_now = True
700 self.exit_now = True
701
701
702 def add_builtins(self):
702 def add_builtins(self):
703 """Store ipython references into the builtin namespace.
703 """Store ipython references into the builtin namespace.
704
704
705 Some parts of ipython operate via builtins injected here, which hold a
705 Some parts of ipython operate via builtins injected here, which hold a
706 reference to IPython itself."""
706 reference to IPython itself."""
707
707
708 # TODO: deprecate all except _ip; 'jobs' should be installed
708 # TODO: deprecate all except _ip; 'jobs' should be installed
709 # by an extension and the rest are under _ip, ipalias is redundant
709 # by an extension and the rest are under _ip, ipalias is redundant
710 builtins_new = dict(__IPYTHON__ = self,
710 builtins_new = dict(__IPYTHON__ = self,
711 ip_set_hook = self.set_hook,
711 ip_set_hook = self.set_hook,
712 jobs = self.jobs,
712 jobs = self.jobs,
713 ipmagic = self.ipmagic,
713 ipmagic = self.ipmagic,
714 ipalias = self.ipalias,
714 ipalias = self.ipalias,
715 ipsystem = self.ipsystem,
715 ipsystem = self.ipsystem,
716 _ip = self.api
716 _ip = self.api
717 )
717 )
718 for biname,bival in builtins_new.items():
718 for biname,bival in builtins_new.items():
719 try:
719 try:
720 # store the orignal value so we can restore it
720 # store the orignal value so we can restore it
721 self.builtins_added[biname] = __builtin__.__dict__[biname]
721 self.builtins_added[biname] = __builtin__.__dict__[biname]
722 except KeyError:
722 except KeyError:
723 # or mark that it wasn't defined, and we'll just delete it at
723 # or mark that it wasn't defined, and we'll just delete it at
724 # cleanup
724 # cleanup
725 self.builtins_added[biname] = Undefined
725 self.builtins_added[biname] = Undefined
726 __builtin__.__dict__[biname] = bival
726 __builtin__.__dict__[biname] = bival
727
727
728 # Keep in the builtins a flag for when IPython is active. We set it
728 # Keep in the builtins a flag for when IPython is active. We set it
729 # with setdefault so that multiple nested IPythons don't clobber one
729 # with setdefault so that multiple nested IPythons don't clobber one
730 # another. Each will increase its value by one upon being activated,
730 # another. Each will increase its value by one upon being activated,
731 # which also gives us a way to determine the nesting level.
731 # which also gives us a way to determine the nesting level.
732 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
732 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
733
733
734 def clean_builtins(self):
734 def clean_builtins(self):
735 """Remove any builtins which might have been added by add_builtins, or
735 """Remove any builtins which might have been added by add_builtins, or
736 restore overwritten ones to their previous values."""
736 restore overwritten ones to their previous values."""
737 for biname,bival in self.builtins_added.items():
737 for biname,bival in self.builtins_added.items():
738 if bival is Undefined:
738 if bival is Undefined:
739 del __builtin__.__dict__[biname]
739 del __builtin__.__dict__[biname]
740 else:
740 else:
741 __builtin__.__dict__[biname] = bival
741 __builtin__.__dict__[biname] = bival
742 self.builtins_added.clear()
742 self.builtins_added.clear()
743
743
744 def set_hook(self,name,hook, priority = 50):
744 def set_hook(self,name,hook, priority = 50):
745 """set_hook(name,hook) -> sets an internal IPython hook.
745 """set_hook(name,hook) -> sets an internal IPython hook.
746
746
747 IPython exposes some of its internal API as user-modifiable hooks. By
747 IPython exposes some of its internal API as user-modifiable hooks. By
748 adding your function to one of these hooks, you can modify IPython's
748 adding your function to one of these hooks, you can modify IPython's
749 behavior to call at runtime your own routines."""
749 behavior to call at runtime your own routines."""
750
750
751 # At some point in the future, this should validate the hook before it
751 # At some point in the future, this should validate the hook before it
752 # accepts it. Probably at least check that the hook takes the number
752 # accepts it. Probably at least check that the hook takes the number
753 # of args it's supposed to.
753 # of args it's supposed to.
754 dp = getattr(self.hooks, name, None)
754 dp = getattr(self.hooks, name, None)
755 if name not in IPython.hooks.__all__:
755 if name not in IPython.hooks.__all__:
756 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
756 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
757 if not dp:
757 if not dp:
758 dp = IPython.hooks.CommandChainDispatcher()
758 dp = IPython.hooks.CommandChainDispatcher()
759
759
760 f = new.instancemethod(hook,self,self.__class__)
760 f = new.instancemethod(hook,self,self.__class__)
761 try:
761 try:
762 dp.add(f,priority)
762 dp.add(f,priority)
763 except AttributeError:
763 except AttributeError:
764 # it was not commandchain, plain old func - replace
764 # it was not commandchain, plain old func - replace
765 dp = f
765 dp = f
766
766
767 setattr(self.hooks,name, dp)
767 setattr(self.hooks,name, dp)
768
768
769
769
770 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
770 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
771
771
772 def set_custom_exc(self,exc_tuple,handler):
772 def set_custom_exc(self,exc_tuple,handler):
773 """set_custom_exc(exc_tuple,handler)
773 """set_custom_exc(exc_tuple,handler)
774
774
775 Set a custom exception handler, which will be called if any of the
775 Set a custom exception handler, which will be called if any of the
776 exceptions in exc_tuple occur in the mainloop (specifically, in the
776 exceptions in exc_tuple occur in the mainloop (specifically, in the
777 runcode() method.
777 runcode() method.
778
778
779 Inputs:
779 Inputs:
780
780
781 - exc_tuple: a *tuple* of valid exceptions to call the defined
781 - exc_tuple: a *tuple* of valid exceptions to call the defined
782 handler for. It is very important that you use a tuple, and NOT A
782 handler for. It is very important that you use a tuple, and NOT A
783 LIST here, because of the way Python's except statement works. If
783 LIST here, because of the way Python's except statement works. If
784 you only want to trap a single exception, use a singleton tuple:
784 you only want to trap a single exception, use a singleton tuple:
785
785
786 exc_tuple == (MyCustomException,)
786 exc_tuple == (MyCustomException,)
787
787
788 - handler: this must be defined as a function with the following
788 - handler: this must be defined as a function with the following
789 basic interface: def my_handler(self,etype,value,tb).
789 basic interface: def my_handler(self,etype,value,tb).
790
790
791 This will be made into an instance method (via new.instancemethod)
791 This will be made into an instance method (via new.instancemethod)
792 of IPython itself, and it will be called if any of the exceptions
792 of IPython itself, and it will be called if any of the exceptions
793 listed in the exc_tuple are caught. If the handler is None, an
793 listed in the exc_tuple are caught. If the handler is None, an
794 internal basic one is used, which just prints basic info.
794 internal basic one is used, which just prints basic info.
795
795
796 WARNING: by putting in your own exception handler into IPython's main
796 WARNING: by putting in your own exception handler into IPython's main
797 execution loop, you run a very good chance of nasty crashes. This
797 execution loop, you run a very good chance of nasty crashes. This
798 facility should only be used if you really know what you are doing."""
798 facility should only be used if you really know what you are doing."""
799
799
800 assert type(exc_tuple)==type(()) , \
800 assert type(exc_tuple)==type(()) , \
801 "The custom exceptions must be given AS A TUPLE."
801 "The custom exceptions must be given AS A TUPLE."
802
802
803 def dummy_handler(self,etype,value,tb):
803 def dummy_handler(self,etype,value,tb):
804 print '*** Simple custom exception handler ***'
804 print '*** Simple custom exception handler ***'
805 print 'Exception type :',etype
805 print 'Exception type :',etype
806 print 'Exception value:',value
806 print 'Exception value:',value
807 print 'Traceback :',tb
807 print 'Traceback :',tb
808 print 'Source code :','\n'.join(self.buffer)
808 print 'Source code :','\n'.join(self.buffer)
809
809
810 if handler is None: handler = dummy_handler
810 if handler is None: handler = dummy_handler
811
811
812 self.CustomTB = new.instancemethod(handler,self,self.__class__)
812 self.CustomTB = new.instancemethod(handler,self,self.__class__)
813 self.custom_exceptions = exc_tuple
813 self.custom_exceptions = exc_tuple
814
814
815 def set_custom_completer(self,completer,pos=0):
815 def set_custom_completer(self,completer,pos=0):
816 """set_custom_completer(completer,pos=0)
816 """set_custom_completer(completer,pos=0)
817
817
818 Adds a new custom completer function.
818 Adds a new custom completer function.
819
819
820 The position argument (defaults to 0) is the index in the completers
820 The position argument (defaults to 0) is the index in the completers
821 list where you want the completer to be inserted."""
821 list where you want the completer to be inserted."""
822
822
823 newcomp = new.instancemethod(completer,self.Completer,
823 newcomp = new.instancemethod(completer,self.Completer,
824 self.Completer.__class__)
824 self.Completer.__class__)
825 self.Completer.matchers.insert(pos,newcomp)
825 self.Completer.matchers.insert(pos,newcomp)
826
826
827 def _get_call_pdb(self):
827 def _get_call_pdb(self):
828 return self._call_pdb
828 return self._call_pdb
829
829
830 def _set_call_pdb(self,val):
830 def _set_call_pdb(self,val):
831
831
832 if val not in (0,1,False,True):
832 if val not in (0,1,False,True):
833 raise ValueError,'new call_pdb value must be boolean'
833 raise ValueError,'new call_pdb value must be boolean'
834
834
835 # store value in instance
835 # store value in instance
836 self._call_pdb = val
836 self._call_pdb = val
837
837
838 # notify the actual exception handlers
838 # notify the actual exception handlers
839 self.InteractiveTB.call_pdb = val
839 self.InteractiveTB.call_pdb = val
840 if self.isthreaded:
840 if self.isthreaded:
841 try:
841 try:
842 self.sys_excepthook.call_pdb = val
842 self.sys_excepthook.call_pdb = val
843 except:
843 except:
844 warn('Failed to activate pdb for threaded exception handler')
844 warn('Failed to activate pdb for threaded exception handler')
845
845
846 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
846 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
847 'Control auto-activation of pdb at exceptions')
847 'Control auto-activation of pdb at exceptions')
848
848
849
849
850 # These special functions get installed in the builtin namespace, to
850 # These special functions get installed in the builtin namespace, to
851 # provide programmatic (pure python) access to magics, aliases and system
851 # provide programmatic (pure python) access to magics, aliases and system
852 # calls. This is important for logging, user scripting, and more.
852 # calls. This is important for logging, user scripting, and more.
853
853
854 # We are basically exposing, via normal python functions, the three
854 # We are basically exposing, via normal python functions, the three
855 # mechanisms in which ipython offers special call modes (magics for
855 # mechanisms in which ipython offers special call modes (magics for
856 # internal control, aliases for direct system access via pre-selected
856 # internal control, aliases for direct system access via pre-selected
857 # names, and !cmd for calling arbitrary system commands).
857 # names, and !cmd for calling arbitrary system commands).
858
858
859 def ipmagic(self,arg_s):
859 def ipmagic(self,arg_s):
860 """Call a magic function by name.
860 """Call a magic function by name.
861
861
862 Input: a string containing the name of the magic function to call and any
862 Input: a string containing the name of the magic function to call and any
863 additional arguments to be passed to the magic.
863 additional arguments to be passed to the magic.
864
864
865 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
865 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
866 prompt:
866 prompt:
867
867
868 In[1]: %name -opt foo bar
868 In[1]: %name -opt foo bar
869
869
870 To call a magic without arguments, simply use ipmagic('name').
870 To call a magic without arguments, simply use ipmagic('name').
871
871
872 This provides a proper Python function to call IPython's magics in any
872 This provides a proper Python function to call IPython's magics in any
873 valid Python code you can type at the interpreter, including loops and
873 valid Python code you can type at the interpreter, including loops and
874 compound statements. It is added by IPython to the Python builtin
874 compound statements. It is added by IPython to the Python builtin
875 namespace upon initialization."""
875 namespace upon initialization."""
876
876
877 args = arg_s.split(' ',1)
877 args = arg_s.split(' ',1)
878 magic_name = args[0]
878 magic_name = args[0]
879 magic_name = magic_name.lstrip(self.ESC_MAGIC)
879 magic_name = magic_name.lstrip(self.ESC_MAGIC)
880
880
881 try:
881 try:
882 magic_args = args[1]
882 magic_args = args[1]
883 except IndexError:
883 except IndexError:
884 magic_args = ''
884 magic_args = ''
885 fn = getattr(self,'magic_'+magic_name,None)
885 fn = getattr(self,'magic_'+magic_name,None)
886 if fn is None:
886 if fn is None:
887 error("Magic function `%s` not found." % magic_name)
887 error("Magic function `%s` not found." % magic_name)
888 else:
888 else:
889 magic_args = self.var_expand(magic_args)
889 magic_args = self.var_expand(magic_args)
890 return fn(magic_args)
890 return fn(magic_args)
891
891
892 def ipalias(self,arg_s):
892 def ipalias(self,arg_s):
893 """Call an alias by name.
893 """Call an alias by name.
894
894
895 Input: a string containing the name of the alias to call and any
895 Input: a string containing the name of the alias to call and any
896 additional arguments to be passed to the magic.
896 additional arguments to be passed to the magic.
897
897
898 ipalias('name -opt foo bar') is equivalent to typing at the ipython
898 ipalias('name -opt foo bar') is equivalent to typing at the ipython
899 prompt:
899 prompt:
900
900
901 In[1]: name -opt foo bar
901 In[1]: name -opt foo bar
902
902
903 To call an alias without arguments, simply use ipalias('name').
903 To call an alias without arguments, simply use ipalias('name').
904
904
905 This provides a proper Python function to call IPython's aliases in any
905 This provides a proper Python function to call IPython's aliases in any
906 valid Python code you can type at the interpreter, including loops and
906 valid Python code you can type at the interpreter, including loops and
907 compound statements. It is added by IPython to the Python builtin
907 compound statements. It is added by IPython to the Python builtin
908 namespace upon initialization."""
908 namespace upon initialization."""
909
909
910 args = arg_s.split(' ',1)
910 args = arg_s.split(' ',1)
911 alias_name = args[0]
911 alias_name = args[0]
912 try:
912 try:
913 alias_args = args[1]
913 alias_args = args[1]
914 except IndexError:
914 except IndexError:
915 alias_args = ''
915 alias_args = ''
916 if alias_name in self.alias_table:
916 if alias_name in self.alias_table:
917 self.call_alias(alias_name,alias_args)
917 self.call_alias(alias_name,alias_args)
918 else:
918 else:
919 error("Alias `%s` not found." % alias_name)
919 error("Alias `%s` not found." % alias_name)
920
920
921 def ipsystem(self,arg_s):
921 def ipsystem(self,arg_s):
922 """Make a system call, using IPython."""
922 """Make a system call, using IPython."""
923
923
924 self.system(arg_s)
924 self.system(arg_s)
925
925
926 def complete(self,text):
926 def complete(self,text):
927 """Return a sorted list of all possible completions on text.
927 """Return a sorted list of all possible completions on text.
928
928
929 Inputs:
929 Inputs:
930
930
931 - text: a string of text to be completed on.
931 - text: a string of text to be completed on.
932
932
933 This is a wrapper around the completion mechanism, similar to what
933 This is a wrapper around the completion mechanism, similar to what
934 readline does at the command line when the TAB key is hit. By
934 readline does at the command line when the TAB key is hit. By
935 exposing it as a method, it can be used by other non-readline
935 exposing it as a method, it can be used by other non-readline
936 environments (such as GUIs) for text completion.
936 environments (such as GUIs) for text completion.
937
937
938 Simple usage example:
938 Simple usage example:
939
939
940 In [1]: x = 'hello'
940 In [1]: x = 'hello'
941
941
942 In [2]: __IP.complete('x.l')
942 In [2]: __IP.complete('x.l')
943 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
943 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
944
944
945 complete = self.Completer.complete
945 complete = self.Completer.complete
946 state = 0
946 state = 0
947 # use a dict so we get unique keys, since ipyhton's multiple
947 # use a dict so we get unique keys, since ipyhton's multiple
948 # completers can return duplicates.
948 # completers can return duplicates.
949 comps = {}
949 comps = {}
950 while True:
950 while True:
951 newcomp = complete(text,state)
951 newcomp = complete(text,state)
952 if newcomp is None:
952 if newcomp is None:
953 break
953 break
954 comps[newcomp] = 1
954 comps[newcomp] = 1
955 state += 1
955 state += 1
956 outcomps = comps.keys()
956 outcomps = comps.keys()
957 outcomps.sort()
957 outcomps.sort()
958 return outcomps
958 return outcomps
959
959
960 def set_completer_frame(self, frame=None):
960 def set_completer_frame(self, frame=None):
961 if frame:
961 if frame:
962 self.Completer.namespace = frame.f_locals
962 self.Completer.namespace = frame.f_locals
963 self.Completer.global_namespace = frame.f_globals
963 self.Completer.global_namespace = frame.f_globals
964 else:
964 else:
965 self.Completer.namespace = self.user_ns
965 self.Completer.namespace = self.user_ns
966 self.Completer.global_namespace = self.user_global_ns
966 self.Completer.global_namespace = self.user_global_ns
967
967
968 def init_auto_alias(self):
968 def init_auto_alias(self):
969 """Define some aliases automatically.
969 """Define some aliases automatically.
970
970
971 These are ALL parameter-less aliases"""
971 These are ALL parameter-less aliases"""
972
972
973 for alias,cmd in self.auto_alias:
973 for alias,cmd in self.auto_alias:
974 self.alias_table[alias] = (0,cmd)
974 self.alias_table[alias] = (0,cmd)
975
975
976 def alias_table_validate(self,verbose=0):
976 def alias_table_validate(self,verbose=0):
977 """Update information about the alias table.
977 """Update information about the alias table.
978
978
979 In particular, make sure no Python keywords/builtins are in it."""
979 In particular, make sure no Python keywords/builtins are in it."""
980
980
981 no_alias = self.no_alias
981 no_alias = self.no_alias
982 for k in self.alias_table.keys():
982 for k in self.alias_table.keys():
983 if k in no_alias:
983 if k in no_alias:
984 del self.alias_table[k]
984 del self.alias_table[k]
985 if verbose:
985 if verbose:
986 print ("Deleting alias <%s>, it's a Python "
986 print ("Deleting alias <%s>, it's a Python "
987 "keyword or builtin." % k)
987 "keyword or builtin." % k)
988
988
989 def set_autoindent(self,value=None):
989 def set_autoindent(self,value=None):
990 """Set the autoindent flag, checking for readline support.
990 """Set the autoindent flag, checking for readline support.
991
991
992 If called with no arguments, it acts as a toggle."""
992 If called with no arguments, it acts as a toggle."""
993
993
994 if not self.has_readline:
994 if not self.has_readline:
995 if os.name == 'posix':
995 if os.name == 'posix':
996 warn("The auto-indent feature requires the readline library")
996 warn("The auto-indent feature requires the readline library")
997 self.autoindent = 0
997 self.autoindent = 0
998 return
998 return
999 if value is None:
999 if value is None:
1000 self.autoindent = not self.autoindent
1000 self.autoindent = not self.autoindent
1001 else:
1001 else:
1002 self.autoindent = value
1002 self.autoindent = value
1003
1003
1004 def rc_set_toggle(self,rc_field,value=None):
1004 def rc_set_toggle(self,rc_field,value=None):
1005 """Set or toggle a field in IPython's rc config. structure.
1005 """Set or toggle a field in IPython's rc config. structure.
1006
1006
1007 If called with no arguments, it acts as a toggle.
1007 If called with no arguments, it acts as a toggle.
1008
1008
1009 If called with a non-existent field, the resulting AttributeError
1009 If called with a non-existent field, the resulting AttributeError
1010 exception will propagate out."""
1010 exception will propagate out."""
1011
1011
1012 rc_val = getattr(self.rc,rc_field)
1012 rc_val = getattr(self.rc,rc_field)
1013 if value is None:
1013 if value is None:
1014 value = not rc_val
1014 value = not rc_val
1015 setattr(self.rc,rc_field,value)
1015 setattr(self.rc,rc_field,value)
1016
1016
1017 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1017 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1018 """Install the user configuration directory.
1018 """Install the user configuration directory.
1019
1019
1020 Can be called when running for the first time or to upgrade the user's
1020 Can be called when running for the first time or to upgrade the user's
1021 .ipython/ directory with the mode parameter. Valid modes are 'install'
1021 .ipython/ directory with the mode parameter. Valid modes are 'install'
1022 and 'upgrade'."""
1022 and 'upgrade'."""
1023
1023
1024 def wait():
1024 def wait():
1025 try:
1025 try:
1026 raw_input("Please press <RETURN> to start IPython.")
1026 raw_input("Please press <RETURN> to start IPython.")
1027 except EOFError:
1027 except EOFError:
1028 print >> Term.cout
1028 print >> Term.cout
1029 print '*'*70
1029 print '*'*70
1030
1030
1031 cwd = os.getcwd() # remember where we started
1031 cwd = os.getcwd() # remember where we started
1032 glb = glob.glob
1032 glb = glob.glob
1033 print '*'*70
1033 print '*'*70
1034 if mode == 'install':
1034 if mode == 'install':
1035 print \
1035 print \
1036 """Welcome to IPython. I will try to create a personal configuration directory
1036 """Welcome to IPython. I will try to create a personal configuration directory
1037 where you can customize many aspects of IPython's functionality in:\n"""
1037 where you can customize many aspects of IPython's functionality in:\n"""
1038 else:
1038 else:
1039 print 'I am going to upgrade your configuration in:'
1039 print 'I am going to upgrade your configuration in:'
1040
1040
1041 print ipythondir
1041 print ipythondir
1042
1042
1043 rcdirend = os.path.join('IPython','UserConfig')
1043 rcdirend = os.path.join('IPython','UserConfig')
1044 cfg = lambda d: os.path.join(d,rcdirend)
1044 cfg = lambda d: os.path.join(d,rcdirend)
1045 try:
1045 try:
1046 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1046 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1047 except IOError:
1047 except IOError:
1048 warning = """
1048 warning = """
1049 Installation error. IPython's directory was not found.
1049 Installation error. IPython's directory was not found.
1050
1050
1051 Check the following:
1051 Check the following:
1052
1052
1053 The ipython/IPython directory should be in a directory belonging to your
1053 The ipython/IPython directory should be in a directory belonging to your
1054 PYTHONPATH environment variable (that is, it should be in a directory
1054 PYTHONPATH environment variable (that is, it should be in a directory
1055 belonging to sys.path). You can copy it explicitly there or just link to it.
1055 belonging to sys.path). You can copy it explicitly there or just link to it.
1056
1056
1057 IPython will proceed with builtin defaults.
1057 IPython will proceed with builtin defaults.
1058 """
1058 """
1059 warn(warning)
1059 warn(warning)
1060 wait()
1060 wait()
1061 return
1061 return
1062
1062
1063 if mode == 'install':
1063 if mode == 'install':
1064 try:
1064 try:
1065 shutil.copytree(rcdir,ipythondir)
1065 shutil.copytree(rcdir,ipythondir)
1066 os.chdir(ipythondir)
1066 os.chdir(ipythondir)
1067 rc_files = glb("ipythonrc*")
1067 rc_files = glb("ipythonrc*")
1068 for rc_file in rc_files:
1068 for rc_file in rc_files:
1069 os.rename(rc_file,rc_file+rc_suffix)
1069 os.rename(rc_file,rc_file+rc_suffix)
1070 except:
1070 except:
1071 warning = """
1071 warning = """
1072
1072
1073 There was a problem with the installation:
1073 There was a problem with the installation:
1074 %s
1074 %s
1075 Try to correct it or contact the developers if you think it's a bug.
1075 Try to correct it or contact the developers if you think it's a bug.
1076 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1076 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1077 warn(warning)
1077 warn(warning)
1078 wait()
1078 wait()
1079 return
1079 return
1080
1080
1081 elif mode == 'upgrade':
1081 elif mode == 'upgrade':
1082 try:
1082 try:
1083 os.chdir(ipythondir)
1083 os.chdir(ipythondir)
1084 except:
1084 except:
1085 print """
1085 print """
1086 Can not upgrade: changing to directory %s failed. Details:
1086 Can not upgrade: changing to directory %s failed. Details:
1087 %s
1087 %s
1088 """ % (ipythondir,sys.exc_info()[1])
1088 """ % (ipythondir,sys.exc_info()[1])
1089 wait()
1089 wait()
1090 return
1090 return
1091 else:
1091 else:
1092 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1092 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1093 for new_full_path in sources:
1093 for new_full_path in sources:
1094 new_filename = os.path.basename(new_full_path)
1094 new_filename = os.path.basename(new_full_path)
1095 if new_filename.startswith('ipythonrc'):
1095 if new_filename.startswith('ipythonrc'):
1096 new_filename = new_filename + rc_suffix
1096 new_filename = new_filename + rc_suffix
1097 # The config directory should only contain files, skip any
1097 # The config directory should only contain files, skip any
1098 # directories which may be there (like CVS)
1098 # directories which may be there (like CVS)
1099 if os.path.isdir(new_full_path):
1099 if os.path.isdir(new_full_path):
1100 continue
1100 continue
1101 if os.path.exists(new_filename):
1101 if os.path.exists(new_filename):
1102 old_file = new_filename+'.old'
1102 old_file = new_filename+'.old'
1103 if os.path.exists(old_file):
1103 if os.path.exists(old_file):
1104 os.remove(old_file)
1104 os.remove(old_file)
1105 os.rename(new_filename,old_file)
1105 os.rename(new_filename,old_file)
1106 shutil.copy(new_full_path,new_filename)
1106 shutil.copy(new_full_path,new_filename)
1107 else:
1107 else:
1108 raise ValueError,'unrecognized mode for install:',`mode`
1108 raise ValueError,'unrecognized mode for install:',`mode`
1109
1109
1110 # Fix line-endings to those native to each platform in the config
1110 # Fix line-endings to those native to each platform in the config
1111 # directory.
1111 # directory.
1112 try:
1112 try:
1113 os.chdir(ipythondir)
1113 os.chdir(ipythondir)
1114 except:
1114 except:
1115 print """
1115 print """
1116 Problem: changing to directory %s failed.
1116 Problem: changing to directory %s failed.
1117 Details:
1117 Details:
1118 %s
1118 %s
1119
1119
1120 Some configuration files may have incorrect line endings. This should not
1120 Some configuration files may have incorrect line endings. This should not
1121 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1121 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1122 wait()
1122 wait()
1123 else:
1123 else:
1124 for fname in glb('ipythonrc*'):
1124 for fname in glb('ipythonrc*'):
1125 try:
1125 try:
1126 native_line_ends(fname,backup=0)
1126 native_line_ends(fname,backup=0)
1127 except IOError:
1127 except IOError:
1128 pass
1128 pass
1129
1129
1130 if mode == 'install':
1130 if mode == 'install':
1131 print """
1131 print """
1132 Successful installation!
1132 Successful installation!
1133
1133
1134 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1134 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1135 IPython manual (there are both HTML and PDF versions supplied with the
1135 IPython manual (there are both HTML and PDF versions supplied with the
1136 distribution) to make sure that your system environment is properly configured
1136 distribution) to make sure that your system environment is properly configured
1137 to take advantage of IPython's features.
1137 to take advantage of IPython's features.
1138
1138
1139 Important note: the configuration system has changed! The old system is
1139 Important note: the configuration system has changed! The old system is
1140 still in place, but its setting may be partly overridden by the settings in
1140 still in place, but its setting may be partly overridden by the settings in
1141 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1141 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1142 if some of the new settings bother you.
1142 if some of the new settings bother you.
1143
1143
1144 """
1144 """
1145 else:
1145 else:
1146 print """
1146 print """
1147 Successful upgrade!
1147 Successful upgrade!
1148
1148
1149 All files in your directory:
1149 All files in your directory:
1150 %(ipythondir)s
1150 %(ipythondir)s
1151 which would have been overwritten by the upgrade were backed up with a .old
1151 which would have been overwritten by the upgrade were backed up with a .old
1152 extension. If you had made particular customizations in those files you may
1152 extension. If you had made particular customizations in those files you may
1153 want to merge them back into the new files.""" % locals()
1153 want to merge them back into the new files.""" % locals()
1154 wait()
1154 wait()
1155 os.chdir(cwd)
1155 os.chdir(cwd)
1156 # end user_setup()
1156 # end user_setup()
1157
1157
1158 def atexit_operations(self):
1158 def atexit_operations(self):
1159 """This will be executed at the time of exit.
1159 """This will be executed at the time of exit.
1160
1160
1161 Saving of persistent data should be performed here. """
1161 Saving of persistent data should be performed here. """
1162
1162
1163 #print '*** IPython exit cleanup ***' # dbg
1163 #print '*** IPython exit cleanup ***' # dbg
1164 # input history
1164 # input history
1165 self.savehist()
1165 self.savehist()
1166
1166
1167 # Cleanup all tempfiles left around
1167 # Cleanup all tempfiles left around
1168 for tfile in self.tempfiles:
1168 for tfile in self.tempfiles:
1169 try:
1169 try:
1170 os.unlink(tfile)
1170 os.unlink(tfile)
1171 except OSError:
1171 except OSError:
1172 pass
1172 pass
1173
1173
1174 # save the "persistent data" catch-all dictionary
1174 # save the "persistent data" catch-all dictionary
1175 self.hooks.shutdown_hook()
1175 self.hooks.shutdown_hook()
1176
1176
1177 def savehist(self):
1177 def savehist(self):
1178 """Save input history to a file (via readline library)."""
1178 """Save input history to a file (via readline library)."""
1179 try:
1179 try:
1180 self.readline.write_history_file(self.histfile)
1180 self.readline.write_history_file(self.histfile)
1181 except:
1181 except:
1182 print 'Unable to save IPython command history to file: ' + \
1182 print 'Unable to save IPython command history to file: ' + \
1183 `self.histfile`
1183 `self.histfile`
1184
1184
1185 def pre_readline(self):
1185 def pre_readline(self):
1186 """readline hook to be used at the start of each line.
1186 """readline hook to be used at the start of each line.
1187
1187
1188 Currently it handles auto-indent only."""
1188 Currently it handles auto-indent only."""
1189
1189
1190 #debugx('self.indent_current_nsp','pre_readline:')
1190 #debugx('self.indent_current_nsp','pre_readline:')
1191 self.readline.insert_text(self.indent_current_str())
1191 self.readline.insert_text(self.indent_current_str())
1192
1192
1193 def init_readline(self):
1193 def init_readline(self):
1194 """Command history completion/saving/reloading."""
1194 """Command history completion/saving/reloading."""
1195
1195
1196 import IPython.rlineimpl as readline
1196 import IPython.rlineimpl as readline
1197 if not readline.have_readline:
1197 if not readline.have_readline:
1198 self.has_readline = 0
1198 self.has_readline = 0
1199 self.readline = None
1199 self.readline = None
1200 # no point in bugging windows users with this every time:
1200 # no point in bugging windows users with this every time:
1201 warn('Readline services not available on this platform.')
1201 warn('Readline services not available on this platform.')
1202 else:
1202 else:
1203 sys.modules['readline'] = readline
1203 sys.modules['readline'] = readline
1204 import atexit
1204 import atexit
1205 from IPython.completer import IPCompleter
1205 from IPython.completer import IPCompleter
1206 self.Completer = IPCompleter(self,
1206 self.Completer = IPCompleter(self,
1207 self.user_ns,
1207 self.user_ns,
1208 self.user_global_ns,
1208 self.user_global_ns,
1209 self.rc.readline_omit__names,
1209 self.rc.readline_omit__names,
1210 self.alias_table)
1210 self.alias_table)
1211
1211
1212 # Platform-specific configuration
1212 # Platform-specific configuration
1213 if os.name == 'nt':
1213 if os.name == 'nt':
1214 self.readline_startup_hook = readline.set_pre_input_hook
1214 self.readline_startup_hook = readline.set_pre_input_hook
1215 else:
1215 else:
1216 self.readline_startup_hook = readline.set_startup_hook
1216 self.readline_startup_hook = readline.set_startup_hook
1217
1217
1218 # Load user's initrc file (readline config)
1218 # Load user's initrc file (readline config)
1219 inputrc_name = os.environ.get('INPUTRC')
1219 inputrc_name = os.environ.get('INPUTRC')
1220 if inputrc_name is None:
1220 if inputrc_name is None:
1221 home_dir = get_home_dir()
1221 home_dir = get_home_dir()
1222 if home_dir is not None:
1222 if home_dir is not None:
1223 inputrc_name = os.path.join(home_dir,'.inputrc')
1223 inputrc_name = os.path.join(home_dir,'.inputrc')
1224 if os.path.isfile(inputrc_name):
1224 if os.path.isfile(inputrc_name):
1225 try:
1225 try:
1226 readline.read_init_file(inputrc_name)
1226 readline.read_init_file(inputrc_name)
1227 except:
1227 except:
1228 warn('Problems reading readline initialization file <%s>'
1228 warn('Problems reading readline initialization file <%s>'
1229 % inputrc_name)
1229 % inputrc_name)
1230
1230
1231 self.has_readline = 1
1231 self.has_readline = 1
1232 self.readline = readline
1232 self.readline = readline
1233 # save this in sys so embedded copies can restore it properly
1233 # save this in sys so embedded copies can restore it properly
1234 sys.ipcompleter = self.Completer.complete
1234 sys.ipcompleter = self.Completer.complete
1235 readline.set_completer(self.Completer.complete)
1235 readline.set_completer(self.Completer.complete)
1236
1236
1237 # Configure readline according to user's prefs
1237 # Configure readline according to user's prefs
1238 for rlcommand in self.rc.readline_parse_and_bind:
1238 for rlcommand in self.rc.readline_parse_and_bind:
1239 readline.parse_and_bind(rlcommand)
1239 readline.parse_and_bind(rlcommand)
1240
1240
1241 # remove some chars from the delimiters list
1241 # remove some chars from the delimiters list
1242 delims = readline.get_completer_delims()
1242 delims = readline.get_completer_delims()
1243 delims = delims.translate(string._idmap,
1243 delims = delims.translate(string._idmap,
1244 self.rc.readline_remove_delims)
1244 self.rc.readline_remove_delims)
1245 readline.set_completer_delims(delims)
1245 readline.set_completer_delims(delims)
1246 # otherwise we end up with a monster history after a while:
1246 # otherwise we end up with a monster history after a while:
1247 readline.set_history_length(1000)
1247 readline.set_history_length(1000)
1248 try:
1248 try:
1249 #print '*** Reading readline history' # dbg
1249 #print '*** Reading readline history' # dbg
1250 readline.read_history_file(self.histfile)
1250 readline.read_history_file(self.histfile)
1251 except IOError:
1251 except IOError:
1252 pass # It doesn't exist yet.
1252 pass # It doesn't exist yet.
1253
1253
1254 atexit.register(self.atexit_operations)
1254 atexit.register(self.atexit_operations)
1255 del atexit
1255 del atexit
1256
1256
1257 # Configure auto-indent for all platforms
1257 # Configure auto-indent for all platforms
1258 self.set_autoindent(self.rc.autoindent)
1258 self.set_autoindent(self.rc.autoindent)
1259
1259
1260 def ask_yes_no(self,prompt,default=True):
1260 def ask_yes_no(self,prompt,default=True):
1261 if self.rc.quiet:
1261 if self.rc.quiet:
1262 return True
1262 return True
1263 return ask_yes_no(prompt,default)
1263 return ask_yes_no(prompt,default)
1264
1264
1265 def _should_recompile(self,e):
1265 def _should_recompile(self,e):
1266 """Utility routine for edit_syntax_error"""
1266 """Utility routine for edit_syntax_error"""
1267
1267
1268 if e.filename in ('<ipython console>','<input>','<string>',
1268 if e.filename in ('<ipython console>','<input>','<string>',
1269 '<console>','<BackgroundJob compilation>',
1269 '<console>','<BackgroundJob compilation>',
1270 None):
1270 None):
1271
1271
1272 return False
1272 return False
1273 try:
1273 try:
1274 if (self.rc.autoedit_syntax and
1274 if (self.rc.autoedit_syntax and
1275 not self.ask_yes_no('Return to editor to correct syntax error? '
1275 not self.ask_yes_no('Return to editor to correct syntax error? '
1276 '[Y/n] ','y')):
1276 '[Y/n] ','y')):
1277 return False
1277 return False
1278 except EOFError:
1278 except EOFError:
1279 return False
1279 return False
1280
1280
1281 def int0(x):
1281 def int0(x):
1282 try:
1282 try:
1283 return int(x)
1283 return int(x)
1284 except TypeError:
1284 except TypeError:
1285 return 0
1285 return 0
1286 # always pass integer line and offset values to editor hook
1286 # always pass integer line and offset values to editor hook
1287 self.hooks.fix_error_editor(e.filename,
1287 self.hooks.fix_error_editor(e.filename,
1288 int0(e.lineno),int0(e.offset),e.msg)
1288 int0(e.lineno),int0(e.offset),e.msg)
1289 return True
1289 return True
1290
1290
1291 def edit_syntax_error(self):
1291 def edit_syntax_error(self):
1292 """The bottom half of the syntax error handler called in the main loop.
1292 """The bottom half of the syntax error handler called in the main loop.
1293
1293
1294 Loop until syntax error is fixed or user cancels.
1294 Loop until syntax error is fixed or user cancels.
1295 """
1295 """
1296
1296
1297 while self.SyntaxTB.last_syntax_error:
1297 while self.SyntaxTB.last_syntax_error:
1298 # copy and clear last_syntax_error
1298 # copy and clear last_syntax_error
1299 err = self.SyntaxTB.clear_err_state()
1299 err = self.SyntaxTB.clear_err_state()
1300 if not self._should_recompile(err):
1300 if not self._should_recompile(err):
1301 return
1301 return
1302 try:
1302 try:
1303 # may set last_syntax_error again if a SyntaxError is raised
1303 # may set last_syntax_error again if a SyntaxError is raised
1304 self.safe_execfile(err.filename,self.user_ns)
1304 self.safe_execfile(err.filename,self.user_ns)
1305 except:
1305 except:
1306 self.showtraceback()
1306 self.showtraceback()
1307 else:
1307 else:
1308 try:
1308 try:
1309 f = file(err.filename)
1309 f = file(err.filename)
1310 try:
1310 try:
1311 sys.displayhook(f.read())
1311 sys.displayhook(f.read())
1312 finally:
1312 finally:
1313 f.close()
1313 f.close()
1314 except:
1314 except:
1315 self.showtraceback()
1315 self.showtraceback()
1316
1316
1317 def showsyntaxerror(self, filename=None):
1317 def showsyntaxerror(self, filename=None):
1318 """Display the syntax error that just occurred.
1318 """Display the syntax error that just occurred.
1319
1319
1320 This doesn't display a stack trace because there isn't one.
1320 This doesn't display a stack trace because there isn't one.
1321
1321
1322 If a filename is given, it is stuffed in the exception instead
1322 If a filename is given, it is stuffed in the exception instead
1323 of what was there before (because Python's parser always uses
1323 of what was there before (because Python's parser always uses
1324 "<string>" when reading from a string).
1324 "<string>" when reading from a string).
1325 """
1325 """
1326 etype, value, last_traceback = sys.exc_info()
1326 etype, value, last_traceback = sys.exc_info()
1327
1327
1328 # See note about these variables in showtraceback() below
1328 # See note about these variables in showtraceback() below
1329 sys.last_type = etype
1329 sys.last_type = etype
1330 sys.last_value = value
1330 sys.last_value = value
1331 sys.last_traceback = last_traceback
1331 sys.last_traceback = last_traceback
1332
1332
1333 if filename and etype is SyntaxError:
1333 if filename and etype is SyntaxError:
1334 # Work hard to stuff the correct filename in the exception
1334 # Work hard to stuff the correct filename in the exception
1335 try:
1335 try:
1336 msg, (dummy_filename, lineno, offset, line) = value
1336 msg, (dummy_filename, lineno, offset, line) = value
1337 except:
1337 except:
1338 # Not the format we expect; leave it alone
1338 # Not the format we expect; leave it alone
1339 pass
1339 pass
1340 else:
1340 else:
1341 # Stuff in the right filename
1341 # Stuff in the right filename
1342 try:
1342 try:
1343 # Assume SyntaxError is a class exception
1343 # Assume SyntaxError is a class exception
1344 value = SyntaxError(msg, (filename, lineno, offset, line))
1344 value = SyntaxError(msg, (filename, lineno, offset, line))
1345 except:
1345 except:
1346 # If that failed, assume SyntaxError is a string
1346 # If that failed, assume SyntaxError is a string
1347 value = msg, (filename, lineno, offset, line)
1347 value = msg, (filename, lineno, offset, line)
1348 self.SyntaxTB(etype,value,[])
1348 self.SyntaxTB(etype,value,[])
1349
1349
1350 def debugger(self):
1350 def debugger(self):
1351 """Call the pdb debugger."""
1351 """Call the pdb debugger."""
1352
1352
1353 if not self.rc.pdb:
1353 if not self.rc.pdb:
1354 return
1354 return
1355 pdb.pm()
1355 pdb.pm()
1356
1356
1357 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1357 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1358 """Display the exception that just occurred.
1358 """Display the exception that just occurred.
1359
1359
1360 If nothing is known about the exception, this is the method which
1360 If nothing is known about the exception, this is the method which
1361 should be used throughout the code for presenting user tracebacks,
1361 should be used throughout the code for presenting user tracebacks,
1362 rather than directly invoking the InteractiveTB object.
1362 rather than directly invoking the InteractiveTB object.
1363
1363
1364 A specific showsyntaxerror() also exists, but this method can take
1364 A specific showsyntaxerror() also exists, but this method can take
1365 care of calling it if needed, so unless you are explicitly catching a
1365 care of calling it if needed, so unless you are explicitly catching a
1366 SyntaxError exception, don't try to analyze the stack manually and
1366 SyntaxError exception, don't try to analyze the stack manually and
1367 simply call this method."""
1367 simply call this method."""
1368
1368
1369 # Though this won't be called by syntax errors in the input line,
1369 # Though this won't be called by syntax errors in the input line,
1370 # there may be SyntaxError cases whith imported code.
1370 # there may be SyntaxError cases whith imported code.
1371 if exc_tuple is None:
1371 if exc_tuple is None:
1372 etype, value, tb = sys.exc_info()
1372 etype, value, tb = sys.exc_info()
1373 else:
1373 else:
1374 etype, value, tb = exc_tuple
1374 etype, value, tb = exc_tuple
1375 if etype is SyntaxError:
1375 if etype is SyntaxError:
1376 self.showsyntaxerror(filename)
1376 self.showsyntaxerror(filename)
1377 else:
1377 else:
1378 # WARNING: these variables are somewhat deprecated and not
1378 # WARNING: these variables are somewhat deprecated and not
1379 # necessarily safe to use in a threaded environment, but tools
1379 # necessarily safe to use in a threaded environment, but tools
1380 # like pdb depend on their existence, so let's set them. If we
1380 # like pdb depend on their existence, so let's set them. If we
1381 # find problems in the field, we'll need to revisit their use.
1381 # find problems in the field, we'll need to revisit their use.
1382 sys.last_type = etype
1382 sys.last_type = etype
1383 sys.last_value = value
1383 sys.last_value = value
1384 sys.last_traceback = tb
1384 sys.last_traceback = tb
1385
1385
1386 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1386 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1387 if self.InteractiveTB.call_pdb and self.has_readline:
1387 if self.InteractiveTB.call_pdb and self.has_readline:
1388 # pdb mucks up readline, fix it back
1388 # pdb mucks up readline, fix it back
1389 self.readline.set_completer(self.Completer.complete)
1389 self.readline.set_completer(self.Completer.complete)
1390
1390
1391 def mainloop(self,banner=None):
1391 def mainloop(self,banner=None):
1392 """Creates the local namespace and starts the mainloop.
1392 """Creates the local namespace and starts the mainloop.
1393
1393
1394 If an optional banner argument is given, it will override the
1394 If an optional banner argument is given, it will override the
1395 internally created default banner."""
1395 internally created default banner."""
1396
1396
1397 if self.rc.c: # Emulate Python's -c option
1397 if self.rc.c: # Emulate Python's -c option
1398 self.exec_init_cmd()
1398 self.exec_init_cmd()
1399 if banner is None:
1399 if banner is None:
1400 if not self.rc.banner:
1400 if not self.rc.banner:
1401 banner = ''
1401 banner = ''
1402 # banner is string? Use it directly!
1402 # banner is string? Use it directly!
1403 elif isinstance(self.rc.banner,basestring):
1403 elif isinstance(self.rc.banner,basestring):
1404 banner = self.rc.banner
1404 banner = self.rc.banner
1405 else:
1405 else:
1406 banner = self.BANNER+self.banner2
1406 banner = self.BANNER+self.banner2
1407
1407
1408 self.interact(banner)
1408 self.interact(banner)
1409
1409
1410 def exec_init_cmd(self):
1410 def exec_init_cmd(self):
1411 """Execute a command given at the command line.
1411 """Execute a command given at the command line.
1412
1412
1413 This emulates Python's -c option."""
1413 This emulates Python's -c option."""
1414
1414
1415 #sys.argv = ['-c']
1415 #sys.argv = ['-c']
1416 self.push(self.rc.c)
1416 self.push(self.rc.c)
1417
1417
1418 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1418 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1419 """Embeds IPython into a running python program.
1419 """Embeds IPython into a running python program.
1420
1420
1421 Input:
1421 Input:
1422
1422
1423 - header: An optional header message can be specified.
1423 - header: An optional header message can be specified.
1424
1424
1425 - local_ns, global_ns: working namespaces. If given as None, the
1425 - local_ns, global_ns: working namespaces. If given as None, the
1426 IPython-initialized one is updated with __main__.__dict__, so that
1426 IPython-initialized one is updated with __main__.__dict__, so that
1427 program variables become visible but user-specific configuration
1427 program variables become visible but user-specific configuration
1428 remains possible.
1428 remains possible.
1429
1429
1430 - stack_depth: specifies how many levels in the stack to go to
1430 - stack_depth: specifies how many levels in the stack to go to
1431 looking for namespaces (when local_ns and global_ns are None). This
1431 looking for namespaces (when local_ns and global_ns are None). This
1432 allows an intermediate caller to make sure that this function gets
1432 allows an intermediate caller to make sure that this function gets
1433 the namespace from the intended level in the stack. By default (0)
1433 the namespace from the intended level in the stack. By default (0)
1434 it will get its locals and globals from the immediate caller.
1434 it will get its locals and globals from the immediate caller.
1435
1435
1436 Warning: it's possible to use this in a program which is being run by
1436 Warning: it's possible to use this in a program which is being run by
1437 IPython itself (via %run), but some funny things will happen (a few
1437 IPython itself (via %run), but some funny things will happen (a few
1438 globals get overwritten). In the future this will be cleaned up, as
1438 globals get overwritten). In the future this will be cleaned up, as
1439 there is no fundamental reason why it can't work perfectly."""
1439 there is no fundamental reason why it can't work perfectly."""
1440
1440
1441 # Get locals and globals from caller
1441 # Get locals and globals from caller
1442 if local_ns is None or global_ns is None:
1442 if local_ns is None or global_ns is None:
1443 call_frame = sys._getframe(stack_depth).f_back
1443 call_frame = sys._getframe(stack_depth).f_back
1444
1444
1445 if local_ns is None:
1445 if local_ns is None:
1446 local_ns = call_frame.f_locals
1446 local_ns = call_frame.f_locals
1447 if global_ns is None:
1447 if global_ns is None:
1448 global_ns = call_frame.f_globals
1448 global_ns = call_frame.f_globals
1449
1449
1450 # Update namespaces and fire up interpreter
1450 # Update namespaces and fire up interpreter
1451
1451
1452 # The global one is easy, we can just throw it in
1452 # The global one is easy, we can just throw it in
1453 self.user_global_ns = global_ns
1453 self.user_global_ns = global_ns
1454
1454
1455 # but the user/local one is tricky: ipython needs it to store internal
1455 # but the user/local one is tricky: ipython needs it to store internal
1456 # data, but we also need the locals. We'll copy locals in the user
1456 # data, but we also need the locals. We'll copy locals in the user
1457 # one, but will track what got copied so we can delete them at exit.
1457 # one, but will track what got copied so we can delete them at exit.
1458 # This is so that a later embedded call doesn't see locals from a
1458 # This is so that a later embedded call doesn't see locals from a
1459 # previous call (which most likely existed in a separate scope).
1459 # previous call (which most likely existed in a separate scope).
1460 local_varnames = local_ns.keys()
1460 local_varnames = local_ns.keys()
1461 self.user_ns.update(local_ns)
1461 self.user_ns.update(local_ns)
1462
1462
1463 # Patch for global embedding to make sure that things don't overwrite
1463 # Patch for global embedding to make sure that things don't overwrite
1464 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1464 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1465 # FIXME. Test this a bit more carefully (the if.. is new)
1465 # FIXME. Test this a bit more carefully (the if.. is new)
1466 if local_ns is None and global_ns is None:
1466 if local_ns is None and global_ns is None:
1467 self.user_global_ns.update(__main__.__dict__)
1467 self.user_global_ns.update(__main__.__dict__)
1468
1468
1469 # make sure the tab-completer has the correct frame information, so it
1469 # make sure the tab-completer has the correct frame information, so it
1470 # actually completes using the frame's locals/globals
1470 # actually completes using the frame's locals/globals
1471 self.set_completer_frame()
1471 self.set_completer_frame()
1472
1472
1473 # before activating the interactive mode, we need to make sure that
1473 # before activating the interactive mode, we need to make sure that
1474 # all names in the builtin namespace needed by ipython point to
1474 # all names in the builtin namespace needed by ipython point to
1475 # ourselves, and not to other instances.
1475 # ourselves, and not to other instances.
1476 self.add_builtins()
1476 self.add_builtins()
1477
1477
1478 self.interact(header)
1478 self.interact(header)
1479
1479
1480 # now, purge out the user namespace from anything we might have added
1480 # now, purge out the user namespace from anything we might have added
1481 # from the caller's local namespace
1481 # from the caller's local namespace
1482 delvar = self.user_ns.pop
1482 delvar = self.user_ns.pop
1483 for var in local_varnames:
1483 for var in local_varnames:
1484 delvar(var,None)
1484 delvar(var,None)
1485 # and clean builtins we may have overridden
1485 # and clean builtins we may have overridden
1486 self.clean_builtins()
1486 self.clean_builtins()
1487
1487
1488 def interact(self, banner=None):
1488 def interact(self, banner=None):
1489 """Closely emulate the interactive Python console.
1489 """Closely emulate the interactive Python console.
1490
1490
1491 The optional banner argument specify the banner to print
1491 The optional banner argument specify the banner to print
1492 before the first interaction; by default it prints a banner
1492 before the first interaction; by default it prints a banner
1493 similar to the one printed by the real Python interpreter,
1493 similar to the one printed by the real Python interpreter,
1494 followed by the current class name in parentheses (so as not
1494 followed by the current class name in parentheses (so as not
1495 to confuse this with the real interpreter -- since it's so
1495 to confuse this with the real interpreter -- since it's so
1496 close!).
1496 close!).
1497
1497
1498 """
1498 """
1499
1499
1500 if self.exit_now:
1500 if self.exit_now:
1501 # batch run -> do not interact
1501 # batch run -> do not interact
1502 return
1502 return
1503 cprt = 'Type "copyright", "credits" or "license" for more information.'
1503 cprt = 'Type "copyright", "credits" or "license" for more information.'
1504 if banner is None:
1504 if banner is None:
1505 self.write("Python %s on %s\n%s\n(%s)\n" %
1505 self.write("Python %s on %s\n%s\n(%s)\n" %
1506 (sys.version, sys.platform, cprt,
1506 (sys.version, sys.platform, cprt,
1507 self.__class__.__name__))
1507 self.__class__.__name__))
1508 else:
1508 else:
1509 self.write(banner)
1509 self.write(banner)
1510
1510
1511 more = 0
1511 more = 0
1512
1512
1513 # Mark activity in the builtins
1513 # Mark activity in the builtins
1514 __builtin__.__dict__['__IPYTHON__active'] += 1
1514 __builtin__.__dict__['__IPYTHON__active'] += 1
1515
1515
1516 # exit_now is set by a call to %Exit or %Quit
1516 # exit_now is set by a call to %Exit or %Quit
1517 while not self.exit_now:
1517 while not self.exit_now:
1518 if more:
1518 if more:
1519 prompt = self.hooks.generate_prompt(True)
1519 prompt = self.hooks.generate_prompt(True)
1520 if self.autoindent:
1520 if self.autoindent:
1521 self.readline_startup_hook(self.pre_readline)
1521 self.readline_startup_hook(self.pre_readline)
1522 else:
1522 else:
1523 prompt = self.hooks.generate_prompt(False)
1523 prompt = self.hooks.generate_prompt(False)
1524 try:
1524 try:
1525 line = self.raw_input(prompt,more)
1525 line = self.raw_input(prompt,more)
1526 if self.exit_now:
1527 # quick exit on sys.std[in|out] close
1528 break
1526 if self.autoindent:
1529 if self.autoindent:
1527 self.readline_startup_hook(None)
1530 self.readline_startup_hook(None)
1528 except KeyboardInterrupt:
1531 except KeyboardInterrupt:
1529 self.write('\nKeyboardInterrupt\n')
1532 self.write('\nKeyboardInterrupt\n')
1530 self.resetbuffer()
1533 self.resetbuffer()
1531 # keep cache in sync with the prompt counter:
1534 # keep cache in sync with the prompt counter:
1532 self.outputcache.prompt_count -= 1
1535 self.outputcache.prompt_count -= 1
1533
1536
1534 if self.autoindent:
1537 if self.autoindent:
1535 self.indent_current_nsp = 0
1538 self.indent_current_nsp = 0
1536 more = 0
1539 more = 0
1537 except EOFError:
1540 except EOFError:
1538 if self.autoindent:
1541 if self.autoindent:
1539 self.readline_startup_hook(None)
1542 self.readline_startup_hook(None)
1540 self.write('\n')
1543 self.write('\n')
1541 self.exit()
1544 self.exit()
1542 except bdb.BdbQuit:
1545 except bdb.BdbQuit:
1543 warn('The Python debugger has exited with a BdbQuit exception.\n'
1546 warn('The Python debugger has exited with a BdbQuit exception.\n'
1544 'Because of how pdb handles the stack, it is impossible\n'
1547 'Because of how pdb handles the stack, it is impossible\n'
1545 'for IPython to properly format this particular exception.\n'
1548 'for IPython to properly format this particular exception.\n'
1546 'IPython will resume normal operation.')
1549 'IPython will resume normal operation.')
1547 except:
1550 except:
1548 # exceptions here are VERY RARE, but they can be triggered
1551 # exceptions here are VERY RARE, but they can be triggered
1549 # asynchronously by signal handlers, for example.
1552 # asynchronously by signal handlers, for example.
1550 self.showtraceback()
1553 self.showtraceback()
1551 else:
1554 else:
1552 more = self.push(line)
1555 more = self.push(line)
1553 if (self.SyntaxTB.last_syntax_error and
1556 if (self.SyntaxTB.last_syntax_error and
1554 self.rc.autoedit_syntax):
1557 self.rc.autoedit_syntax):
1555 self.edit_syntax_error()
1558 self.edit_syntax_error()
1556
1559
1557 # We are off again...
1560 # We are off again...
1558 __builtin__.__dict__['__IPYTHON__active'] -= 1
1561 __builtin__.__dict__['__IPYTHON__active'] -= 1
1559
1562
1560 def excepthook(self, etype, value, tb):
1563 def excepthook(self, etype, value, tb):
1561 """One more defense for GUI apps that call sys.excepthook.
1564 """One more defense for GUI apps that call sys.excepthook.
1562
1565
1563 GUI frameworks like wxPython trap exceptions and call
1566 GUI frameworks like wxPython trap exceptions and call
1564 sys.excepthook themselves. I guess this is a feature that
1567 sys.excepthook themselves. I guess this is a feature that
1565 enables them to keep running after exceptions that would
1568 enables them to keep running after exceptions that would
1566 otherwise kill their mainloop. This is a bother for IPython
1569 otherwise kill their mainloop. This is a bother for IPython
1567 which excepts to catch all of the program exceptions with a try:
1570 which excepts to catch all of the program exceptions with a try:
1568 except: statement.
1571 except: statement.
1569
1572
1570 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1573 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1571 any app directly invokes sys.excepthook, it will look to the user like
1574 any app directly invokes sys.excepthook, it will look to the user like
1572 IPython crashed. In order to work around this, we can disable the
1575 IPython crashed. In order to work around this, we can disable the
1573 CrashHandler and replace it with this excepthook instead, which prints a
1576 CrashHandler and replace it with this excepthook instead, which prints a
1574 regular traceback using our InteractiveTB. In this fashion, apps which
1577 regular traceback using our InteractiveTB. In this fashion, apps which
1575 call sys.excepthook will generate a regular-looking exception from
1578 call sys.excepthook will generate a regular-looking exception from
1576 IPython, and the CrashHandler will only be triggered by real IPython
1579 IPython, and the CrashHandler will only be triggered by real IPython
1577 crashes.
1580 crashes.
1578
1581
1579 This hook should be used sparingly, only in places which are not likely
1582 This hook should be used sparingly, only in places which are not likely
1580 to be true IPython errors.
1583 to be true IPython errors.
1581 """
1584 """
1582 self.showtraceback((etype,value,tb),tb_offset=0)
1585 self.showtraceback((etype,value,tb),tb_offset=0)
1583
1586
1584 def transform_alias(self, alias,rest=''):
1587 def transform_alias(self, alias,rest=''):
1585 """ Transform alias to system command string.
1588 """ Transform alias to system command string.
1586 """
1589 """
1587 nargs,cmd = self.alias_table[alias]
1590 nargs,cmd = self.alias_table[alias]
1588 if ' ' in cmd and os.path.isfile(cmd):
1591 if ' ' in cmd and os.path.isfile(cmd):
1589 cmd = '"%s"' % cmd
1592 cmd = '"%s"' % cmd
1590
1593
1591 # Expand the %l special to be the user's input line
1594 # Expand the %l special to be the user's input line
1592 if cmd.find('%l') >= 0:
1595 if cmd.find('%l') >= 0:
1593 cmd = cmd.replace('%l',rest)
1596 cmd = cmd.replace('%l',rest)
1594 rest = ''
1597 rest = ''
1595 if nargs==0:
1598 if nargs==0:
1596 # Simple, argument-less aliases
1599 # Simple, argument-less aliases
1597 cmd = '%s %s' % (cmd,rest)
1600 cmd = '%s %s' % (cmd,rest)
1598 else:
1601 else:
1599 # Handle aliases with positional arguments
1602 # Handle aliases with positional arguments
1600 args = rest.split(None,nargs)
1603 args = rest.split(None,nargs)
1601 if len(args)< nargs:
1604 if len(args)< nargs:
1602 error('Alias <%s> requires %s arguments, %s given.' %
1605 error('Alias <%s> requires %s arguments, %s given.' %
1603 (alias,nargs,len(args)))
1606 (alias,nargs,len(args)))
1604 return None
1607 return None
1605 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1608 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1606 # Now call the macro, evaluating in the user's namespace
1609 # Now call the macro, evaluating in the user's namespace
1607 #print 'new command: <%r>' % cmd # dbg
1610 #print 'new command: <%r>' % cmd # dbg
1608 return cmd
1611 return cmd
1609
1612
1610 def call_alias(self,alias,rest=''):
1613 def call_alias(self,alias,rest=''):
1611 """Call an alias given its name and the rest of the line.
1614 """Call an alias given its name and the rest of the line.
1612
1615
1613 This is only used to provide backwards compatibility for users of
1616 This is only used to provide backwards compatibility for users of
1614 ipalias(), use of which is not recommended for anymore."""
1617 ipalias(), use of which is not recommended for anymore."""
1615
1618
1616 # Now call the macro, evaluating in the user's namespace
1619 # Now call the macro, evaluating in the user's namespace
1617 cmd = self.transform_alias(alias, rest)
1620 cmd = self.transform_alias(alias, rest)
1618 try:
1621 try:
1619 self.system(cmd)
1622 self.system(cmd)
1620 except:
1623 except:
1621 self.showtraceback()
1624 self.showtraceback()
1622
1625
1623 def indent_current_str(self):
1626 def indent_current_str(self):
1624 """return the current level of indentation as a string"""
1627 """return the current level of indentation as a string"""
1625 return self.indent_current_nsp * ' '
1628 return self.indent_current_nsp * ' '
1626
1629
1627 def autoindent_update(self,line):
1630 def autoindent_update(self,line):
1628 """Keep track of the indent level."""
1631 """Keep track of the indent level."""
1629
1632
1630 #debugx('line')
1633 #debugx('line')
1631 #debugx('self.indent_current_nsp')
1634 #debugx('self.indent_current_nsp')
1632 if self.autoindent:
1635 if self.autoindent:
1633 if line:
1636 if line:
1634 inisp = num_ini_spaces(line)
1637 inisp = num_ini_spaces(line)
1635 if inisp < self.indent_current_nsp:
1638 if inisp < self.indent_current_nsp:
1636 self.indent_current_nsp = inisp
1639 self.indent_current_nsp = inisp
1637
1640
1638 if line[-1] == ':':
1641 if line[-1] == ':':
1639 self.indent_current_nsp += 4
1642 self.indent_current_nsp += 4
1640 elif dedent_re.match(line):
1643 elif dedent_re.match(line):
1641 self.indent_current_nsp -= 4
1644 self.indent_current_nsp -= 4
1642 else:
1645 else:
1643 self.indent_current_nsp = 0
1646 self.indent_current_nsp = 0
1644
1647
1645 def runlines(self,lines):
1648 def runlines(self,lines):
1646 """Run a string of one or more lines of source.
1649 """Run a string of one or more lines of source.
1647
1650
1648 This method is capable of running a string containing multiple source
1651 This method is capable of running a string containing multiple source
1649 lines, as if they had been entered at the IPython prompt. Since it
1652 lines, as if they had been entered at the IPython prompt. Since it
1650 exposes IPython's processing machinery, the given strings can contain
1653 exposes IPython's processing machinery, the given strings can contain
1651 magic calls (%magic), special shell access (!cmd), etc."""
1654 magic calls (%magic), special shell access (!cmd), etc."""
1652
1655
1653 # We must start with a clean buffer, in case this is run from an
1656 # We must start with a clean buffer, in case this is run from an
1654 # interactive IPython session (via a magic, for example).
1657 # interactive IPython session (via a magic, for example).
1655 self.resetbuffer()
1658 self.resetbuffer()
1656 lines = lines.split('\n')
1659 lines = lines.split('\n')
1657 more = 0
1660 more = 0
1658 for line in lines:
1661 for line in lines:
1659 # skip blank lines so we don't mess up the prompt counter, but do
1662 # skip blank lines so we don't mess up the prompt counter, but do
1660 # NOT skip even a blank line if we are in a code block (more is
1663 # NOT skip even a blank line if we are in a code block (more is
1661 # true)
1664 # true)
1662 if line or more:
1665 if line or more:
1663 more = self.push(self.prefilter(line,more))
1666 more = self.push(self.prefilter(line,more))
1664 # IPython's runsource returns None if there was an error
1667 # IPython's runsource returns None if there was an error
1665 # compiling the code. This allows us to stop processing right
1668 # compiling the code. This allows us to stop processing right
1666 # away, so the user gets the error message at the right place.
1669 # away, so the user gets the error message at the right place.
1667 if more is None:
1670 if more is None:
1668 break
1671 break
1669 # final newline in case the input didn't have it, so that the code
1672 # final newline in case the input didn't have it, so that the code
1670 # actually does get executed
1673 # actually does get executed
1671 if more:
1674 if more:
1672 self.push('\n')
1675 self.push('\n')
1673
1676
1674 def runsource(self, source, filename='<input>', symbol='single'):
1677 def runsource(self, source, filename='<input>', symbol='single'):
1675 """Compile and run some source in the interpreter.
1678 """Compile and run some source in the interpreter.
1676
1679
1677 Arguments are as for compile_command().
1680 Arguments are as for compile_command().
1678
1681
1679 One several things can happen:
1682 One several things can happen:
1680
1683
1681 1) The input is incorrect; compile_command() raised an
1684 1) The input is incorrect; compile_command() raised an
1682 exception (SyntaxError or OverflowError). A syntax traceback
1685 exception (SyntaxError or OverflowError). A syntax traceback
1683 will be printed by calling the showsyntaxerror() method.
1686 will be printed by calling the showsyntaxerror() method.
1684
1687
1685 2) The input is incomplete, and more input is required;
1688 2) The input is incomplete, and more input is required;
1686 compile_command() returned None. Nothing happens.
1689 compile_command() returned None. Nothing happens.
1687
1690
1688 3) The input is complete; compile_command() returned a code
1691 3) The input is complete; compile_command() returned a code
1689 object. The code is executed by calling self.runcode() (which
1692 object. The code is executed by calling self.runcode() (which
1690 also handles run-time exceptions, except for SystemExit).
1693 also handles run-time exceptions, except for SystemExit).
1691
1694
1692 The return value is:
1695 The return value is:
1693
1696
1694 - True in case 2
1697 - True in case 2
1695
1698
1696 - False in the other cases, unless an exception is raised, where
1699 - False in the other cases, unless an exception is raised, where
1697 None is returned instead. This can be used by external callers to
1700 None is returned instead. This can be used by external callers to
1698 know whether to continue feeding input or not.
1701 know whether to continue feeding input or not.
1699
1702
1700 The return value can be used to decide whether to use sys.ps1 or
1703 The return value can be used to decide whether to use sys.ps1 or
1701 sys.ps2 to prompt the next line."""
1704 sys.ps2 to prompt the next line."""
1702
1705
1703 try:
1706 try:
1704 code = self.compile(source,filename,symbol)
1707 code = self.compile(source,filename,symbol)
1705 except (OverflowError, SyntaxError, ValueError):
1708 except (OverflowError, SyntaxError, ValueError):
1706 # Case 1
1709 # Case 1
1707 self.showsyntaxerror(filename)
1710 self.showsyntaxerror(filename)
1708 return None
1711 return None
1709
1712
1710 if code is None:
1713 if code is None:
1711 # Case 2
1714 # Case 2
1712 return True
1715 return True
1713
1716
1714 # Case 3
1717 # Case 3
1715 # We store the code object so that threaded shells and
1718 # We store the code object so that threaded shells and
1716 # custom exception handlers can access all this info if needed.
1719 # custom exception handlers can access all this info if needed.
1717 # The source corresponding to this can be obtained from the
1720 # The source corresponding to this can be obtained from the
1718 # buffer attribute as '\n'.join(self.buffer).
1721 # buffer attribute as '\n'.join(self.buffer).
1719 self.code_to_run = code
1722 self.code_to_run = code
1720 # now actually execute the code object
1723 # now actually execute the code object
1721 if self.runcode(code) == 0:
1724 if self.runcode(code) == 0:
1722 return False
1725 return False
1723 else:
1726 else:
1724 return None
1727 return None
1725
1728
1726 def runcode(self,code_obj):
1729 def runcode(self,code_obj):
1727 """Execute a code object.
1730 """Execute a code object.
1728
1731
1729 When an exception occurs, self.showtraceback() is called to display a
1732 When an exception occurs, self.showtraceback() is called to display a
1730 traceback.
1733 traceback.
1731
1734
1732 Return value: a flag indicating whether the code to be run completed
1735 Return value: a flag indicating whether the code to be run completed
1733 successfully:
1736 successfully:
1734
1737
1735 - 0: successful execution.
1738 - 0: successful execution.
1736 - 1: an error occurred.
1739 - 1: an error occurred.
1737 """
1740 """
1738
1741
1739 # Set our own excepthook in case the user code tries to call it
1742 # Set our own excepthook in case the user code tries to call it
1740 # directly, so that the IPython crash handler doesn't get triggered
1743 # directly, so that the IPython crash handler doesn't get triggered
1741 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1744 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1742
1745
1743 # we save the original sys.excepthook in the instance, in case config
1746 # we save the original sys.excepthook in the instance, in case config
1744 # code (such as magics) needs access to it.
1747 # code (such as magics) needs access to it.
1745 self.sys_excepthook = old_excepthook
1748 self.sys_excepthook = old_excepthook
1746 outflag = 1 # happens in more places, so it's easier as default
1749 outflag = 1 # happens in more places, so it's easier as default
1747 try:
1750 try:
1748 try:
1751 try:
1749 # Embedded instances require separate global/local namespaces
1752 # Embedded instances require separate global/local namespaces
1750 # so they can see both the surrounding (local) namespace and
1753 # so they can see both the surrounding (local) namespace and
1751 # the module-level globals when called inside another function.
1754 # the module-level globals when called inside another function.
1752 if self.embedded:
1755 if self.embedded:
1753 exec code_obj in self.user_global_ns, self.user_ns
1756 exec code_obj in self.user_global_ns, self.user_ns
1754 # Normal (non-embedded) instances should only have a single
1757 # Normal (non-embedded) instances should only have a single
1755 # namespace for user code execution, otherwise functions won't
1758 # namespace for user code execution, otherwise functions won't
1756 # see interactive top-level globals.
1759 # see interactive top-level globals.
1757 else:
1760 else:
1758 exec code_obj in self.user_ns
1761 exec code_obj in self.user_ns
1759 finally:
1762 finally:
1760 # Reset our crash handler in place
1763 # Reset our crash handler in place
1761 sys.excepthook = old_excepthook
1764 sys.excepthook = old_excepthook
1762 except SystemExit:
1765 except SystemExit:
1763 self.resetbuffer()
1766 self.resetbuffer()
1764 self.showtraceback()
1767 self.showtraceback()
1765 warn("Type %exit or %quit to exit IPython "
1768 warn("Type %exit or %quit to exit IPython "
1766 "(%Exit or %Quit do so unconditionally).",level=1)
1769 "(%Exit or %Quit do so unconditionally).",level=1)
1767 except self.custom_exceptions:
1770 except self.custom_exceptions:
1768 etype,value,tb = sys.exc_info()
1771 etype,value,tb = sys.exc_info()
1769 self.CustomTB(etype,value,tb)
1772 self.CustomTB(etype,value,tb)
1770 except:
1773 except:
1771 self.showtraceback()
1774 self.showtraceback()
1772 else:
1775 else:
1773 outflag = 0
1776 outflag = 0
1774 if softspace(sys.stdout, 0):
1777 if softspace(sys.stdout, 0):
1775 print
1778 print
1776 # Flush out code object which has been run (and source)
1779 # Flush out code object which has been run (and source)
1777 self.code_to_run = None
1780 self.code_to_run = None
1778 return outflag
1781 return outflag
1779
1782
1780 def push(self, line):
1783 def push(self, line):
1781 """Push a line to the interpreter.
1784 """Push a line to the interpreter.
1782
1785
1783 The line should not have a trailing newline; it may have
1786 The line should not have a trailing newline; it may have
1784 internal newlines. The line is appended to a buffer and the
1787 internal newlines. The line is appended to a buffer and the
1785 interpreter's runsource() method is called with the
1788 interpreter's runsource() method is called with the
1786 concatenated contents of the buffer as source. If this
1789 concatenated contents of the buffer as source. If this
1787 indicates that the command was executed or invalid, the buffer
1790 indicates that the command was executed or invalid, the buffer
1788 is reset; otherwise, the command is incomplete, and the buffer
1791 is reset; otherwise, the command is incomplete, and the buffer
1789 is left as it was after the line was appended. The return
1792 is left as it was after the line was appended. The return
1790 value is 1 if more input is required, 0 if the line was dealt
1793 value is 1 if more input is required, 0 if the line was dealt
1791 with in some way (this is the same as runsource()).
1794 with in some way (this is the same as runsource()).
1792 """
1795 """
1793
1796
1794 # autoindent management should be done here, and not in the
1797 # autoindent management should be done here, and not in the
1795 # interactive loop, since that one is only seen by keyboard input. We
1798 # interactive loop, since that one is only seen by keyboard input. We
1796 # need this done correctly even for code run via runlines (which uses
1799 # need this done correctly even for code run via runlines (which uses
1797 # push).
1800 # push).
1798
1801
1799 #print 'push line: <%s>' % line # dbg
1802 #print 'push line: <%s>' % line # dbg
1800 for subline in line.splitlines():
1803 for subline in line.splitlines():
1801 self.autoindent_update(subline)
1804 self.autoindent_update(subline)
1802 self.buffer.append(line)
1805 self.buffer.append(line)
1803 more = self.runsource('\n'.join(self.buffer), self.filename)
1806 more = self.runsource('\n'.join(self.buffer), self.filename)
1804 if not more:
1807 if not more:
1805 self.resetbuffer()
1808 self.resetbuffer()
1806 return more
1809 return more
1807
1810
1808 def resetbuffer(self):
1811 def resetbuffer(self):
1809 """Reset the input buffer."""
1812 """Reset the input buffer."""
1810 self.buffer[:] = []
1813 self.buffer[:] = []
1811
1814
1812 def raw_input(self,prompt='',continue_prompt=False):
1815 def raw_input(self,prompt='',continue_prompt=False):
1813 """Write a prompt and read a line.
1816 """Write a prompt and read a line.
1814
1817
1815 The returned line does not include the trailing newline.
1818 The returned line does not include the trailing newline.
1816 When the user enters the EOF key sequence, EOFError is raised.
1819 When the user enters the EOF key sequence, EOFError is raised.
1817
1820
1818 Optional inputs:
1821 Optional inputs:
1819
1822
1820 - prompt(''): a string to be printed to prompt the user.
1823 - prompt(''): a string to be printed to prompt the user.
1821
1824
1822 - continue_prompt(False): whether this line is the first one or a
1825 - continue_prompt(False): whether this line is the first one or a
1823 continuation in a sequence of inputs.
1826 continuation in a sequence of inputs.
1824 """
1827 """
1825
1828
1826 line = raw_input_original(prompt)
1829 try:
1830 line = raw_input_original(prompt)
1831 except ValueError:
1832 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1833 self.exit_now = True
1834 return ""
1835
1827
1836
1828 # Try to be reasonably smart about not re-indenting pasted input more
1837 # Try to be reasonably smart about not re-indenting pasted input more
1829 # than necessary. We do this by trimming out the auto-indent initial
1838 # than necessary. We do this by trimming out the auto-indent initial
1830 # spaces, if the user's actual input started itself with whitespace.
1839 # spaces, if the user's actual input started itself with whitespace.
1831 #debugx('self.buffer[-1]')
1840 #debugx('self.buffer[-1]')
1832
1841
1833 if self.autoindent:
1842 if self.autoindent:
1834 if num_ini_spaces(line) > self.indent_current_nsp:
1843 if num_ini_spaces(line) > self.indent_current_nsp:
1835 line = line[self.indent_current_nsp:]
1844 line = line[self.indent_current_nsp:]
1836 self.indent_current_nsp = 0
1845 self.indent_current_nsp = 0
1837
1846
1838 # store the unfiltered input before the user has any chance to modify
1847 # store the unfiltered input before the user has any chance to modify
1839 # it.
1848 # it.
1840 if line.strip():
1849 if line.strip():
1841 if continue_prompt:
1850 if continue_prompt:
1842 self.input_hist_raw[-1] += '%s\n' % line
1851 self.input_hist_raw[-1] += '%s\n' % line
1843 if self.has_readline: # and some config option is set?
1852 if self.has_readline: # and some config option is set?
1844 try:
1853 try:
1845 histlen = self.readline.get_current_history_length()
1854 histlen = self.readline.get_current_history_length()
1846 newhist = self.input_hist_raw[-1].rstrip()
1855 newhist = self.input_hist_raw[-1].rstrip()
1847 self.readline.remove_history_item(histlen-1)
1856 self.readline.remove_history_item(histlen-1)
1848 self.readline.replace_history_item(histlen-2,newhist)
1857 self.readline.replace_history_item(histlen-2,newhist)
1849 except AttributeError:
1858 except AttributeError:
1850 pass # re{move,place}_history_item are new in 2.4.
1859 pass # re{move,place}_history_item are new in 2.4.
1851 else:
1860 else:
1852 self.input_hist_raw.append('%s\n' % line)
1861 self.input_hist_raw.append('%s\n' % line)
1853
1862
1854 try:
1863 try:
1855 lineout = self.prefilter(line,continue_prompt)
1864 lineout = self.prefilter(line,continue_prompt)
1856 except:
1865 except:
1857 # blanket except, in case a user-defined prefilter crashes, so it
1866 # blanket except, in case a user-defined prefilter crashes, so it
1858 # can't take all of ipython with it.
1867 # can't take all of ipython with it.
1859 self.showtraceback()
1868 self.showtraceback()
1860 return ''
1869 return ''
1861 else:
1870 else:
1862 return lineout
1871 return lineout
1863
1872
1864 def split_user_input(self,line):
1873 def split_user_input(self,line):
1865 """Split user input into pre-char, function part and rest."""
1874 """Split user input into pre-char, function part and rest."""
1866
1875
1867 lsplit = self.line_split.match(line)
1876 lsplit = self.line_split.match(line)
1868 if lsplit is None: # no regexp match returns None
1877 if lsplit is None: # no regexp match returns None
1869 try:
1878 try:
1870 iFun,theRest = line.split(None,1)
1879 iFun,theRest = line.split(None,1)
1871 except ValueError:
1880 except ValueError:
1872 iFun,theRest = line,''
1881 iFun,theRest = line,''
1873 pre = re.match('^(\s*)(.*)',line).groups()[0]
1882 pre = re.match('^(\s*)(.*)',line).groups()[0]
1874 else:
1883 else:
1875 pre,iFun,theRest = lsplit.groups()
1884 pre,iFun,theRest = lsplit.groups()
1876
1885
1877 #print 'line:<%s>' % line # dbg
1886 #print 'line:<%s>' % line # dbg
1878 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1887 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1879 return pre,iFun.strip(),theRest
1888 return pre,iFun.strip(),theRest
1880
1889
1881 def _prefilter(self, line, continue_prompt):
1890 def _prefilter(self, line, continue_prompt):
1882 """Calls different preprocessors, depending on the form of line."""
1891 """Calls different preprocessors, depending on the form of line."""
1883
1892
1884 # All handlers *must* return a value, even if it's blank ('').
1893 # All handlers *must* return a value, even if it's blank ('').
1885
1894
1886 # Lines are NOT logged here. Handlers should process the line as
1895 # Lines are NOT logged here. Handlers should process the line as
1887 # needed, update the cache AND log it (so that the input cache array
1896 # needed, update the cache AND log it (so that the input cache array
1888 # stays synced).
1897 # stays synced).
1889
1898
1890 # This function is _very_ delicate, and since it's also the one which
1899 # This function is _very_ delicate, and since it's also the one which
1891 # determines IPython's response to user input, it must be as efficient
1900 # determines IPython's response to user input, it must be as efficient
1892 # as possible. For this reason it has _many_ returns in it, trying
1901 # as possible. For this reason it has _many_ returns in it, trying
1893 # always to exit as quickly as it can figure out what it needs to do.
1902 # always to exit as quickly as it can figure out what it needs to do.
1894
1903
1895 # This function is the main responsible for maintaining IPython's
1904 # This function is the main responsible for maintaining IPython's
1896 # behavior respectful of Python's semantics. So be _very_ careful if
1905 # behavior respectful of Python's semantics. So be _very_ careful if
1897 # making changes to anything here.
1906 # making changes to anything here.
1898
1907
1899 #.....................................................................
1908 #.....................................................................
1900 # Code begins
1909 # Code begins
1901
1910
1902 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1911 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1903
1912
1904 # save the line away in case we crash, so the post-mortem handler can
1913 # save the line away in case we crash, so the post-mortem handler can
1905 # record it
1914 # record it
1906 self._last_input_line = line
1915 self._last_input_line = line
1907
1916
1908 #print '***line: <%s>' % line # dbg
1917 #print '***line: <%s>' % line # dbg
1909
1918
1910 # the input history needs to track even empty lines
1919 # the input history needs to track even empty lines
1911 stripped = line.strip()
1920 stripped = line.strip()
1912
1921
1913 if not stripped:
1922 if not stripped:
1914 if not continue_prompt:
1923 if not continue_prompt:
1915 self.outputcache.prompt_count -= 1
1924 self.outputcache.prompt_count -= 1
1916 return self.handle_normal(line,continue_prompt)
1925 return self.handle_normal(line,continue_prompt)
1917 #return self.handle_normal('',continue_prompt)
1926 #return self.handle_normal('',continue_prompt)
1918
1927
1919 # print '***cont',continue_prompt # dbg
1928 # print '***cont',continue_prompt # dbg
1920 # special handlers are only allowed for single line statements
1929 # special handlers are only allowed for single line statements
1921 if continue_prompt and not self.rc.multi_line_specials:
1930 if continue_prompt and not self.rc.multi_line_specials:
1922 return self.handle_normal(line,continue_prompt)
1931 return self.handle_normal(line,continue_prompt)
1923
1932
1924
1933
1925 # For the rest, we need the structure of the input
1934 # For the rest, we need the structure of the input
1926 pre,iFun,theRest = self.split_user_input(line)
1935 pre,iFun,theRest = self.split_user_input(line)
1927
1936
1928 # See whether any pre-existing handler can take care of it
1937 # See whether any pre-existing handler can take care of it
1929
1938
1930 rewritten = self.hooks.input_prefilter(stripped)
1939 rewritten = self.hooks.input_prefilter(stripped)
1931 if rewritten != stripped: # ok, some prefilter did something
1940 if rewritten != stripped: # ok, some prefilter did something
1932 rewritten = pre + rewritten # add indentation
1941 rewritten = pre + rewritten # add indentation
1933 return self.handle_normal(rewritten)
1942 return self.handle_normal(rewritten)
1934
1943
1935 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1944 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1936
1945
1937 # First check for explicit escapes in the last/first character
1946 # First check for explicit escapes in the last/first character
1938 handler = None
1947 handler = None
1939 if line[-1] == self.ESC_HELP:
1948 if line[-1] == self.ESC_HELP:
1940 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1949 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1941 if handler is None:
1950 if handler is None:
1942 # look at the first character of iFun, NOT of line, so we skip
1951 # look at the first character of iFun, NOT of line, so we skip
1943 # leading whitespace in multiline input
1952 # leading whitespace in multiline input
1944 handler = self.esc_handlers.get(iFun[0:1])
1953 handler = self.esc_handlers.get(iFun[0:1])
1945 if handler is not None:
1954 if handler is not None:
1946 return handler(line,continue_prompt,pre,iFun,theRest)
1955 return handler(line,continue_prompt,pre,iFun,theRest)
1947 # Emacs ipython-mode tags certain input lines
1956 # Emacs ipython-mode tags certain input lines
1948 if line.endswith('# PYTHON-MODE'):
1957 if line.endswith('# PYTHON-MODE'):
1949 return self.handle_emacs(line,continue_prompt)
1958 return self.handle_emacs(line,continue_prompt)
1950
1959
1951 # Next, check if we can automatically execute this thing
1960 # Next, check if we can automatically execute this thing
1952
1961
1953 # Allow ! in multi-line statements if multi_line_specials is on:
1962 # Allow ! in multi-line statements if multi_line_specials is on:
1954 if continue_prompt and self.rc.multi_line_specials and \
1963 if continue_prompt and self.rc.multi_line_specials and \
1955 iFun.startswith(self.ESC_SHELL):
1964 iFun.startswith(self.ESC_SHELL):
1956 return self.handle_shell_escape(line,continue_prompt,
1965 return self.handle_shell_escape(line,continue_prompt,
1957 pre=pre,iFun=iFun,
1966 pre=pre,iFun=iFun,
1958 theRest=theRest)
1967 theRest=theRest)
1959
1968
1960 # Let's try to find if the input line is a magic fn
1969 # Let's try to find if the input line is a magic fn
1961 oinfo = None
1970 oinfo = None
1962 if hasattr(self,'magic_'+iFun):
1971 if hasattr(self,'magic_'+iFun):
1963 # WARNING: _ofind uses getattr(), so it can consume generators and
1972 # WARNING: _ofind uses getattr(), so it can consume generators and
1964 # cause other side effects.
1973 # cause other side effects.
1965 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1974 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1966 if oinfo['ismagic']:
1975 if oinfo['ismagic']:
1967 # Be careful not to call magics when a variable assignment is
1976 # Be careful not to call magics when a variable assignment is
1968 # being made (ls='hi', for example)
1977 # being made (ls='hi', for example)
1969 if self.rc.automagic and \
1978 if self.rc.automagic and \
1970 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1979 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1971 (self.rc.multi_line_specials or not continue_prompt):
1980 (self.rc.multi_line_specials or not continue_prompt):
1972 return self.handle_magic(line,continue_prompt,
1981 return self.handle_magic(line,continue_prompt,
1973 pre,iFun,theRest)
1982 pre,iFun,theRest)
1974 else:
1983 else:
1975 return self.handle_normal(line,continue_prompt)
1984 return self.handle_normal(line,continue_prompt)
1976
1985
1977 # If the rest of the line begins with an (in)equality, assginment or
1986 # If the rest of the line begins with an (in)equality, assginment or
1978 # function call, we should not call _ofind but simply execute it.
1987 # function call, we should not call _ofind but simply execute it.
1979 # This avoids spurious geattr() accesses on objects upon assignment.
1988 # This avoids spurious geattr() accesses on objects upon assignment.
1980 #
1989 #
1981 # It also allows users to assign to either alias or magic names true
1990 # It also allows users to assign to either alias or magic names true
1982 # python variables (the magic/alias systems always take second seat to
1991 # python variables (the magic/alias systems always take second seat to
1983 # true python code).
1992 # true python code).
1984 if theRest and theRest[0] in '!=()':
1993 if theRest and theRest[0] in '!=()':
1985 return self.handle_normal(line,continue_prompt)
1994 return self.handle_normal(line,continue_prompt)
1986
1995
1987 if oinfo is None:
1996 if oinfo is None:
1988 # let's try to ensure that _oinfo is ONLY called when autocall is
1997 # let's try to ensure that _oinfo is ONLY called when autocall is
1989 # on. Since it has inevitable potential side effects, at least
1998 # on. Since it has inevitable potential side effects, at least
1990 # having autocall off should be a guarantee to the user that no
1999 # having autocall off should be a guarantee to the user that no
1991 # weird things will happen.
2000 # weird things will happen.
1992
2001
1993 if self.rc.autocall:
2002 if self.rc.autocall:
1994 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2003 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1995 else:
2004 else:
1996 # in this case, all that's left is either an alias or
2005 # in this case, all that's left is either an alias or
1997 # processing the line normally.
2006 # processing the line normally.
1998 if iFun in self.alias_table:
2007 if iFun in self.alias_table:
1999 # if autocall is off, by not running _ofind we won't know
2008 # if autocall is off, by not running _ofind we won't know
2000 # whether the given name may also exist in one of the
2009 # whether the given name may also exist in one of the
2001 # user's namespace. At this point, it's best to do a
2010 # user's namespace. At this point, it's best to do a
2002 # quick check just to be sure that we don't let aliases
2011 # quick check just to be sure that we don't let aliases
2003 # shadow variables.
2012 # shadow variables.
2004 head = iFun.split('.',1)[0]
2013 head = iFun.split('.',1)[0]
2005 if head in self.user_ns or head in self.internal_ns \
2014 if head in self.user_ns or head in self.internal_ns \
2006 or head in __builtin__.__dict__:
2015 or head in __builtin__.__dict__:
2007 return self.handle_normal(line,continue_prompt)
2016 return self.handle_normal(line,continue_prompt)
2008 else:
2017 else:
2009 return self.handle_alias(line,continue_prompt,
2018 return self.handle_alias(line,continue_prompt,
2010 pre,iFun,theRest)
2019 pre,iFun,theRest)
2011
2020
2012 else:
2021 else:
2013 return self.handle_normal(line,continue_prompt)
2022 return self.handle_normal(line,continue_prompt)
2014
2023
2015 if not oinfo['found']:
2024 if not oinfo['found']:
2016 return self.handle_normal(line,continue_prompt)
2025 return self.handle_normal(line,continue_prompt)
2017 else:
2026 else:
2018 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2027 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2019 if oinfo['isalias']:
2028 if oinfo['isalias']:
2020 return self.handle_alias(line,continue_prompt,
2029 return self.handle_alias(line,continue_prompt,
2021 pre,iFun,theRest)
2030 pre,iFun,theRest)
2022
2031
2023 if (self.rc.autocall
2032 if (self.rc.autocall
2024 and
2033 and
2025 (
2034 (
2026 #only consider exclusion re if not "," or ";" autoquoting
2035 #only consider exclusion re if not "," or ";" autoquoting
2027 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2036 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2028 or pre == self.ESC_PAREN) or
2037 or pre == self.ESC_PAREN) or
2029 (not self.re_exclude_auto.match(theRest)))
2038 (not self.re_exclude_auto.match(theRest)))
2030 and
2039 and
2031 self.re_fun_name.match(iFun) and
2040 self.re_fun_name.match(iFun) and
2032 callable(oinfo['obj'])) :
2041 callable(oinfo['obj'])) :
2033 #print 'going auto' # dbg
2042 #print 'going auto' # dbg
2034 return self.handle_auto(line,continue_prompt,
2043 return self.handle_auto(line,continue_prompt,
2035 pre,iFun,theRest,oinfo['obj'])
2044 pre,iFun,theRest,oinfo['obj'])
2036 else:
2045 else:
2037 #print 'was callable?', callable(oinfo['obj']) # dbg
2046 #print 'was callable?', callable(oinfo['obj']) # dbg
2038 return self.handle_normal(line,continue_prompt)
2047 return self.handle_normal(line,continue_prompt)
2039
2048
2040 # If we get here, we have a normal Python line. Log and return.
2049 # If we get here, we have a normal Python line. Log and return.
2041 return self.handle_normal(line,continue_prompt)
2050 return self.handle_normal(line,continue_prompt)
2042
2051
2043 def _prefilter_dumb(self, line, continue_prompt):
2052 def _prefilter_dumb(self, line, continue_prompt):
2044 """simple prefilter function, for debugging"""
2053 """simple prefilter function, for debugging"""
2045 return self.handle_normal(line,continue_prompt)
2054 return self.handle_normal(line,continue_prompt)
2046
2055
2047
2056
2048 def multiline_prefilter(self, line, continue_prompt):
2057 def multiline_prefilter(self, line, continue_prompt):
2049 """ Run _prefilter for each line of input
2058 """ Run _prefilter for each line of input
2050
2059
2051 Covers cases where there are multiple lines in the user entry,
2060 Covers cases where there are multiple lines in the user entry,
2052 which is the case when the user goes back to a multiline history
2061 which is the case when the user goes back to a multiline history
2053 entry and presses enter.
2062 entry and presses enter.
2054
2063
2055 """
2064 """
2056 out = []
2065 out = []
2057 for l in line.rstrip('\n').split('\n'):
2066 for l in line.rstrip('\n').split('\n'):
2058 out.append(self._prefilter(l, continue_prompt))
2067 out.append(self._prefilter(l, continue_prompt))
2059 return '\n'.join(out)
2068 return '\n'.join(out)
2060
2069
2061 # Set the default prefilter() function (this can be user-overridden)
2070 # Set the default prefilter() function (this can be user-overridden)
2062 prefilter = multiline_prefilter
2071 prefilter = multiline_prefilter
2063
2072
2064 def handle_normal(self,line,continue_prompt=None,
2073 def handle_normal(self,line,continue_prompt=None,
2065 pre=None,iFun=None,theRest=None):
2074 pre=None,iFun=None,theRest=None):
2066 """Handle normal input lines. Use as a template for handlers."""
2075 """Handle normal input lines. Use as a template for handlers."""
2067
2076
2068 # With autoindent on, we need some way to exit the input loop, and I
2077 # With autoindent on, we need some way to exit the input loop, and I
2069 # don't want to force the user to have to backspace all the way to
2078 # don't want to force the user to have to backspace all the way to
2070 # clear the line. The rule will be in this case, that either two
2079 # clear the line. The rule will be in this case, that either two
2071 # lines of pure whitespace in a row, or a line of pure whitespace but
2080 # lines of pure whitespace in a row, or a line of pure whitespace but
2072 # of a size different to the indent level, will exit the input loop.
2081 # of a size different to the indent level, will exit the input loop.
2073
2082
2074 if (continue_prompt and self.autoindent and line.isspace() and
2083 if (continue_prompt and self.autoindent and line.isspace() and
2075 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2084 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2076 (self.buffer[-1]).isspace() )):
2085 (self.buffer[-1]).isspace() )):
2077 line = ''
2086 line = ''
2078
2087
2079 self.log(line,line,continue_prompt)
2088 self.log(line,line,continue_prompt)
2080 return line
2089 return line
2081
2090
2082 def handle_alias(self,line,continue_prompt=None,
2091 def handle_alias(self,line,continue_prompt=None,
2083 pre=None,iFun=None,theRest=None):
2092 pre=None,iFun=None,theRest=None):
2084 """Handle alias input lines. """
2093 """Handle alias input lines. """
2085
2094
2086 # pre is needed, because it carries the leading whitespace. Otherwise
2095 # pre is needed, because it carries the leading whitespace. Otherwise
2087 # aliases won't work in indented sections.
2096 # aliases won't work in indented sections.
2088 transformed = self.transform_alias(iFun, theRest)
2097 transformed = self.transform_alias(iFun, theRest)
2089 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2098 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2090 self.log(line,line_out,continue_prompt)
2099 self.log(line,line_out,continue_prompt)
2091 #print 'line out:',line_out # dbg
2100 #print 'line out:',line_out # dbg
2092 return line_out
2101 return line_out
2093
2102
2094 def handle_shell_escape(self, line, continue_prompt=None,
2103 def handle_shell_escape(self, line, continue_prompt=None,
2095 pre=None,iFun=None,theRest=None):
2104 pre=None,iFun=None,theRest=None):
2096 """Execute the line in a shell, empty return value"""
2105 """Execute the line in a shell, empty return value"""
2097
2106
2098 #print 'line in :', `line` # dbg
2107 #print 'line in :', `line` # dbg
2099 # Example of a special handler. Others follow a similar pattern.
2108 # Example of a special handler. Others follow a similar pattern.
2100 if line.lstrip().startswith('!!'):
2109 if line.lstrip().startswith('!!'):
2101 # rewrite iFun/theRest to properly hold the call to %sx and
2110 # rewrite iFun/theRest to properly hold the call to %sx and
2102 # the actual command to be executed, so handle_magic can work
2111 # the actual command to be executed, so handle_magic can work
2103 # correctly
2112 # correctly
2104 theRest = '%s %s' % (iFun[2:],theRest)
2113 theRest = '%s %s' % (iFun[2:],theRest)
2105 iFun = 'sx'
2114 iFun = 'sx'
2106 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2115 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2107 line.lstrip()[2:]),
2116 line.lstrip()[2:]),
2108 continue_prompt,pre,iFun,theRest)
2117 continue_prompt,pre,iFun,theRest)
2109 else:
2118 else:
2110 cmd=line.lstrip().lstrip('!')
2119 cmd=line.lstrip().lstrip('!')
2111 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2120 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2112 # update cache/log and return
2121 # update cache/log and return
2113 self.log(line,line_out,continue_prompt)
2122 self.log(line,line_out,continue_prompt)
2114 return line_out
2123 return line_out
2115
2124
2116 def handle_magic(self, line, continue_prompt=None,
2125 def handle_magic(self, line, continue_prompt=None,
2117 pre=None,iFun=None,theRest=None):
2126 pre=None,iFun=None,theRest=None):
2118 """Execute magic functions."""
2127 """Execute magic functions."""
2119
2128
2120
2129
2121 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2130 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2122 self.log(line,cmd,continue_prompt)
2131 self.log(line,cmd,continue_prompt)
2123 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2132 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2124 return cmd
2133 return cmd
2125
2134
2126 def handle_auto(self, line, continue_prompt=None,
2135 def handle_auto(self, line, continue_prompt=None,
2127 pre=None,iFun=None,theRest=None,obj=None):
2136 pre=None,iFun=None,theRest=None,obj=None):
2128 """Hande lines which can be auto-executed, quoting if requested."""
2137 """Hande lines which can be auto-executed, quoting if requested."""
2129
2138
2130 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2139 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2131
2140
2132 # This should only be active for single-line input!
2141 # This should only be active for single-line input!
2133 if continue_prompt:
2142 if continue_prompt:
2134 self.log(line,line,continue_prompt)
2143 self.log(line,line,continue_prompt)
2135 return line
2144 return line
2136
2145
2137 auto_rewrite = True
2146 auto_rewrite = True
2138
2147
2139 if pre == self.ESC_QUOTE:
2148 if pre == self.ESC_QUOTE:
2140 # Auto-quote splitting on whitespace
2149 # Auto-quote splitting on whitespace
2141 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2150 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2142 elif pre == self.ESC_QUOTE2:
2151 elif pre == self.ESC_QUOTE2:
2143 # Auto-quote whole string
2152 # Auto-quote whole string
2144 newcmd = '%s("%s")' % (iFun,theRest)
2153 newcmd = '%s("%s")' % (iFun,theRest)
2145 elif pre == self.ESC_PAREN:
2154 elif pre == self.ESC_PAREN:
2146 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2155 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2147 else:
2156 else:
2148 # Auto-paren.
2157 # Auto-paren.
2149 # We only apply it to argument-less calls if the autocall
2158 # We only apply it to argument-less calls if the autocall
2150 # parameter is set to 2. We only need to check that autocall is <
2159 # parameter is set to 2. We only need to check that autocall is <
2151 # 2, since this function isn't called unless it's at least 1.
2160 # 2, since this function isn't called unless it's at least 1.
2152 if not theRest and (self.rc.autocall < 2):
2161 if not theRest and (self.rc.autocall < 2):
2153 newcmd = '%s %s' % (iFun,theRest)
2162 newcmd = '%s %s' % (iFun,theRest)
2154 auto_rewrite = False
2163 auto_rewrite = False
2155 else:
2164 else:
2156 if theRest.startswith('['):
2165 if theRest.startswith('['):
2157 if hasattr(obj,'__getitem__'):
2166 if hasattr(obj,'__getitem__'):
2158 # Don't autocall in this case: item access for an object
2167 # Don't autocall in this case: item access for an object
2159 # which is BOTH callable and implements __getitem__.
2168 # which is BOTH callable and implements __getitem__.
2160 newcmd = '%s %s' % (iFun,theRest)
2169 newcmd = '%s %s' % (iFun,theRest)
2161 auto_rewrite = False
2170 auto_rewrite = False
2162 else:
2171 else:
2163 # if the object doesn't support [] access, go ahead and
2172 # if the object doesn't support [] access, go ahead and
2164 # autocall
2173 # autocall
2165 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2174 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2166 elif theRest.endswith(';'):
2175 elif theRest.endswith(';'):
2167 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2176 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2168 else:
2177 else:
2169 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2178 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2170
2179
2171 if auto_rewrite:
2180 if auto_rewrite:
2172 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2181 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2173 # log what is now valid Python, not the actual user input (without the
2182 # log what is now valid Python, not the actual user input (without the
2174 # final newline)
2183 # final newline)
2175 self.log(line,newcmd,continue_prompt)
2184 self.log(line,newcmd,continue_prompt)
2176 return newcmd
2185 return newcmd
2177
2186
2178 def handle_help(self, line, continue_prompt=None,
2187 def handle_help(self, line, continue_prompt=None,
2179 pre=None,iFun=None,theRest=None):
2188 pre=None,iFun=None,theRest=None):
2180 """Try to get some help for the object.
2189 """Try to get some help for the object.
2181
2190
2182 obj? or ?obj -> basic information.
2191 obj? or ?obj -> basic information.
2183 obj?? or ??obj -> more details.
2192 obj?? or ??obj -> more details.
2184 """
2193 """
2185
2194
2186 # We need to make sure that we don't process lines which would be
2195 # We need to make sure that we don't process lines which would be
2187 # otherwise valid python, such as "x=1 # what?"
2196 # otherwise valid python, such as "x=1 # what?"
2188 try:
2197 try:
2189 codeop.compile_command(line)
2198 codeop.compile_command(line)
2190 except SyntaxError:
2199 except SyntaxError:
2191 # We should only handle as help stuff which is NOT valid syntax
2200 # We should only handle as help stuff which is NOT valid syntax
2192 if line[0]==self.ESC_HELP:
2201 if line[0]==self.ESC_HELP:
2193 line = line[1:]
2202 line = line[1:]
2194 elif line[-1]==self.ESC_HELP:
2203 elif line[-1]==self.ESC_HELP:
2195 line = line[:-1]
2204 line = line[:-1]
2196 self.log(line,'#?'+line,continue_prompt)
2205 self.log(line,'#?'+line,continue_prompt)
2197 if line:
2206 if line:
2198 self.magic_pinfo(line)
2207 self.magic_pinfo(line)
2199 else:
2208 else:
2200 page(self.usage,screen_lines=self.rc.screen_length)
2209 page(self.usage,screen_lines=self.rc.screen_length)
2201 return '' # Empty string is needed here!
2210 return '' # Empty string is needed here!
2202 except:
2211 except:
2203 # Pass any other exceptions through to the normal handler
2212 # Pass any other exceptions through to the normal handler
2204 return self.handle_normal(line,continue_prompt)
2213 return self.handle_normal(line,continue_prompt)
2205 else:
2214 else:
2206 # If the code compiles ok, we should handle it normally
2215 # If the code compiles ok, we should handle it normally
2207 return self.handle_normal(line,continue_prompt)
2216 return self.handle_normal(line,continue_prompt)
2208
2217
2209 def getapi(self):
2218 def getapi(self):
2210 """ Get an IPApi object for this shell instance
2219 """ Get an IPApi object for this shell instance
2211
2220
2212 Getting an IPApi object is always preferable to accessing the shell
2221 Getting an IPApi object is always preferable to accessing the shell
2213 directly, but this holds true especially for extensions.
2222 directly, but this holds true especially for extensions.
2214
2223
2215 It should always be possible to implement an extension with IPApi
2224 It should always be possible to implement an extension with IPApi
2216 alone. If not, contact maintainer to request an addition.
2225 alone. If not, contact maintainer to request an addition.
2217
2226
2218 """
2227 """
2219 return self.api
2228 return self.api
2220
2229
2221 def handle_emacs(self,line,continue_prompt=None,
2230 def handle_emacs(self,line,continue_prompt=None,
2222 pre=None,iFun=None,theRest=None):
2231 pre=None,iFun=None,theRest=None):
2223 """Handle input lines marked by python-mode."""
2232 """Handle input lines marked by python-mode."""
2224
2233
2225 # Currently, nothing is done. Later more functionality can be added
2234 # Currently, nothing is done. Later more functionality can be added
2226 # here if needed.
2235 # here if needed.
2227
2236
2228 # The input cache shouldn't be updated
2237 # The input cache shouldn't be updated
2229
2238
2230 return line
2239 return line
2231
2240
2232 def mktempfile(self,data=None):
2241 def mktempfile(self,data=None):
2233 """Make a new tempfile and return its filename.
2242 """Make a new tempfile and return its filename.
2234
2243
2235 This makes a call to tempfile.mktemp, but it registers the created
2244 This makes a call to tempfile.mktemp, but it registers the created
2236 filename internally so ipython cleans it up at exit time.
2245 filename internally so ipython cleans it up at exit time.
2237
2246
2238 Optional inputs:
2247 Optional inputs:
2239
2248
2240 - data(None): if data is given, it gets written out to the temp file
2249 - data(None): if data is given, it gets written out to the temp file
2241 immediately, and the file is closed again."""
2250 immediately, and the file is closed again."""
2242
2251
2243 filename = tempfile.mktemp('.py','ipython_edit_')
2252 filename = tempfile.mktemp('.py','ipython_edit_')
2244 self.tempfiles.append(filename)
2253 self.tempfiles.append(filename)
2245
2254
2246 if data:
2255 if data:
2247 tmp_file = open(filename,'w')
2256 tmp_file = open(filename,'w')
2248 tmp_file.write(data)
2257 tmp_file.write(data)
2249 tmp_file.close()
2258 tmp_file.close()
2250 return filename
2259 return filename
2251
2260
2252 def write(self,data):
2261 def write(self,data):
2253 """Write a string to the default output"""
2262 """Write a string to the default output"""
2254 Term.cout.write(data)
2263 Term.cout.write(data)
2255
2264
2256 def write_err(self,data):
2265 def write_err(self,data):
2257 """Write a string to the default error output"""
2266 """Write a string to the default error output"""
2258 Term.cerr.write(data)
2267 Term.cerr.write(data)
2259
2268
2260 def exit(self):
2269 def exit(self):
2261 """Handle interactive exit.
2270 """Handle interactive exit.
2262
2271
2263 This method sets the exit_now attribute."""
2272 This method sets the exit_now attribute."""
2264
2273
2265 if self.rc.confirm_exit:
2274 if self.rc.confirm_exit:
2266 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2275 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2267 self.exit_now = True
2276 self.exit_now = True
2268 else:
2277 else:
2269 self.exit_now = True
2278 self.exit_now = True
2270
2279
2271 def safe_execfile(self,fname,*where,**kw):
2280 def safe_execfile(self,fname,*where,**kw):
2272 fname = os.path.expanduser(fname)
2281 fname = os.path.expanduser(fname)
2273
2282
2274 # find things also in current directory
2283 # find things also in current directory
2275 dname = os.path.dirname(fname)
2284 dname = os.path.dirname(fname)
2276 if not sys.path.count(dname):
2285 if not sys.path.count(dname):
2277 sys.path.append(dname)
2286 sys.path.append(dname)
2278
2287
2279 try:
2288 try:
2280 xfile = open(fname)
2289 xfile = open(fname)
2281 except:
2290 except:
2282 print >> Term.cerr, \
2291 print >> Term.cerr, \
2283 'Could not open file <%s> for safe execution.' % fname
2292 'Could not open file <%s> for safe execution.' % fname
2284 return None
2293 return None
2285
2294
2286 kw.setdefault('islog',0)
2295 kw.setdefault('islog',0)
2287 kw.setdefault('quiet',1)
2296 kw.setdefault('quiet',1)
2288 kw.setdefault('exit_ignore',0)
2297 kw.setdefault('exit_ignore',0)
2289 first = xfile.readline()
2298 first = xfile.readline()
2290 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2299 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2291 xfile.close()
2300 xfile.close()
2292 # line by line execution
2301 # line by line execution
2293 if first.startswith(loghead) or kw['islog']:
2302 if first.startswith(loghead) or kw['islog']:
2294 print 'Loading log file <%s> one line at a time...' % fname
2303 print 'Loading log file <%s> one line at a time...' % fname
2295 if kw['quiet']:
2304 if kw['quiet']:
2296 stdout_save = sys.stdout
2305 stdout_save = sys.stdout
2297 sys.stdout = StringIO.StringIO()
2306 sys.stdout = StringIO.StringIO()
2298 try:
2307 try:
2299 globs,locs = where[0:2]
2308 globs,locs = where[0:2]
2300 except:
2309 except:
2301 try:
2310 try:
2302 globs = locs = where[0]
2311 globs = locs = where[0]
2303 except:
2312 except:
2304 globs = locs = globals()
2313 globs = locs = globals()
2305 badblocks = []
2314 badblocks = []
2306
2315
2307 # we also need to identify indented blocks of code when replaying
2316 # we also need to identify indented blocks of code when replaying
2308 # logs and put them together before passing them to an exec
2317 # logs and put them together before passing them to an exec
2309 # statement. This takes a bit of regexp and look-ahead work in the
2318 # statement. This takes a bit of regexp and look-ahead work in the
2310 # file. It's easiest if we swallow the whole thing in memory
2319 # file. It's easiest if we swallow the whole thing in memory
2311 # first, and manually walk through the lines list moving the
2320 # first, and manually walk through the lines list moving the
2312 # counter ourselves.
2321 # counter ourselves.
2313 indent_re = re.compile('\s+\S')
2322 indent_re = re.compile('\s+\S')
2314 xfile = open(fname)
2323 xfile = open(fname)
2315 filelines = xfile.readlines()
2324 filelines = xfile.readlines()
2316 xfile.close()
2325 xfile.close()
2317 nlines = len(filelines)
2326 nlines = len(filelines)
2318 lnum = 0
2327 lnum = 0
2319 while lnum < nlines:
2328 while lnum < nlines:
2320 line = filelines[lnum]
2329 line = filelines[lnum]
2321 lnum += 1
2330 lnum += 1
2322 # don't re-insert logger status info into cache
2331 # don't re-insert logger status info into cache
2323 if line.startswith('#log#'):
2332 if line.startswith('#log#'):
2324 continue
2333 continue
2325 else:
2334 else:
2326 # build a block of code (maybe a single line) for execution
2335 # build a block of code (maybe a single line) for execution
2327 block = line
2336 block = line
2328 try:
2337 try:
2329 next = filelines[lnum] # lnum has already incremented
2338 next = filelines[lnum] # lnum has already incremented
2330 except:
2339 except:
2331 next = None
2340 next = None
2332 while next and indent_re.match(next):
2341 while next and indent_re.match(next):
2333 block += next
2342 block += next
2334 lnum += 1
2343 lnum += 1
2335 try:
2344 try:
2336 next = filelines[lnum]
2345 next = filelines[lnum]
2337 except:
2346 except:
2338 next = None
2347 next = None
2339 # now execute the block of one or more lines
2348 # now execute the block of one or more lines
2340 try:
2349 try:
2341 exec block in globs,locs
2350 exec block in globs,locs
2342 except SystemExit:
2351 except SystemExit:
2343 pass
2352 pass
2344 except:
2353 except:
2345 badblocks.append(block.rstrip())
2354 badblocks.append(block.rstrip())
2346 if kw['quiet']: # restore stdout
2355 if kw['quiet']: # restore stdout
2347 sys.stdout.close()
2356 sys.stdout.close()
2348 sys.stdout = stdout_save
2357 sys.stdout = stdout_save
2349 print 'Finished replaying log file <%s>' % fname
2358 print 'Finished replaying log file <%s>' % fname
2350 if badblocks:
2359 if badblocks:
2351 print >> sys.stderr, ('\nThe following lines/blocks in file '
2360 print >> sys.stderr, ('\nThe following lines/blocks in file '
2352 '<%s> reported errors:' % fname)
2361 '<%s> reported errors:' % fname)
2353
2362
2354 for badline in badblocks:
2363 for badline in badblocks:
2355 print >> sys.stderr, badline
2364 print >> sys.stderr, badline
2356 else: # regular file execution
2365 else: # regular file execution
2357 try:
2366 try:
2358 execfile(fname,*where)
2367 execfile(fname,*where)
2359 except SyntaxError:
2368 except SyntaxError:
2360 self.showsyntaxerror()
2369 self.showsyntaxerror()
2361 warn('Failure executing file: <%s>' % fname)
2370 warn('Failure executing file: <%s>' % fname)
2362 except SystemExit,status:
2371 except SystemExit,status:
2363 if not kw['exit_ignore']:
2372 if not kw['exit_ignore']:
2364 self.showtraceback()
2373 self.showtraceback()
2365 warn('Failure executing file: <%s>' % fname)
2374 warn('Failure executing file: <%s>' % fname)
2366 except:
2375 except:
2367 self.showtraceback()
2376 self.showtraceback()
2368 warn('Failure executing file: <%s>' % fname)
2377 warn('Failure executing file: <%s>' % fname)
2369
2378
2370 #************************* end of file <iplib.py> *****************************
2379 #************************* end of file <iplib.py> *****************************
@@ -1,5753 +1,5759 b''
1 2006-10-03 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py (raw_input, interact): Return ValueError catching for
4 raw_input. Fixes infinite loop for sys.stdin.close() or
5 sys.stdout.close().
6
1 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
7 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2
8
3 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
9 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
4 to help in handling doctests. irunner is now pretty useful for
10 to help in handling doctests. irunner is now pretty useful for
5 running standalone scripts and simulate a full interactive session
11 running standalone scripts and simulate a full interactive session
6 in a format that can be then pasted as a doctest.
12 in a format that can be then pasted as a doctest.
7
13
8 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
14 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
9 on top of the default (useless) ones. This also fixes the nasty
15 on top of the default (useless) ones. This also fixes the nasty
10 way in which 2.5's Quitter() exits (reverted [1785]).
16 way in which 2.5's Quitter() exits (reverted [1785]).
11
17
12 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
18 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
13 2.5.
19 2.5.
14
20
15 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
21 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
16 color scheme is updated as well when color scheme is changed
22 color scheme is updated as well when color scheme is changed
17 interactively.
23 interactively.
18
24
19 2006-09-27 Ville Vainio <vivainio@gmail.com>
25 2006-09-27 Ville Vainio <vivainio@gmail.com>
20
26
21 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
27 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
22 infinite loop and just exit. It's a hack, but will do for a while.
28 infinite loop and just exit. It's a hack, but will do for a while.
23
29
24 2006-08-25 Walter Doerwald <walter@livinglogic.de>
30 2006-08-25 Walter Doerwald <walter@livinglogic.de>
25
31
26 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
32 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
27 the constructor, this makes it possible to get a list of only directories
33 the constructor, this makes it possible to get a list of only directories
28 or only files.
34 or only files.
29
35
30 2006-08-12 Ville Vainio <vivainio@gmail.com>
36 2006-08-12 Ville Vainio <vivainio@gmail.com>
31
37
32 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
38 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
33 they broke unittest
39 they broke unittest
34
40
35 2006-08-11 Ville Vainio <vivainio@gmail.com>
41 2006-08-11 Ville Vainio <vivainio@gmail.com>
36
42
37 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
43 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
38 by resolving issue properly, i.e. by inheriting FakeModule
44 by resolving issue properly, i.e. by inheriting FakeModule
39 from types.ModuleType. Pickling ipython interactive data
45 from types.ModuleType. Pickling ipython interactive data
40 should still work as usual (testing appreciated).
46 should still work as usual (testing appreciated).
41
47
42 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
48 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
43
49
44 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
50 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
45 running under python 2.3 with code from 2.4 to fix a bug with
51 running under python 2.3 with code from 2.4 to fix a bug with
46 help(). Reported by the Debian maintainers, Norbert Tretkowski
52 help(). Reported by the Debian maintainers, Norbert Tretkowski
47 <norbert-AT-tretkowski.de> and Alexandre Fayolle
53 <norbert-AT-tretkowski.de> and Alexandre Fayolle
48 <afayolle-AT-debian.org>.
54 <afayolle-AT-debian.org>.
49
55
50 2006-08-04 Walter Doerwald <walter@livinglogic.de>
56 2006-08-04 Walter Doerwald <walter@livinglogic.de>
51
57
52 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
58 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
53 (which was displaying "quit" twice).
59 (which was displaying "quit" twice).
54
60
55 2006-07-28 Walter Doerwald <walter@livinglogic.de>
61 2006-07-28 Walter Doerwald <walter@livinglogic.de>
56
62
57 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
63 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
58 the mode argument).
64 the mode argument).
59
65
60 2006-07-27 Walter Doerwald <walter@livinglogic.de>
66 2006-07-27 Walter Doerwald <walter@livinglogic.de>
61
67
62 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
68 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
63 not running under IPython.
69 not running under IPython.
64
70
65 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
71 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
66 and make it iterable (iterating over the attribute itself). Add two new
72 and make it iterable (iterating over the attribute itself). Add two new
67 magic strings for __xattrs__(): If the string starts with "-", the attribute
73 magic strings for __xattrs__(): If the string starts with "-", the attribute
68 will not be displayed in ibrowse's detail view (but it can still be
74 will not be displayed in ibrowse's detail view (but it can still be
69 iterated over). This makes it possible to add attributes that are large
75 iterated over). This makes it possible to add attributes that are large
70 lists or generator methods to the detail view. Replace magic attribute names
76 lists or generator methods to the detail view. Replace magic attribute names
71 and _attrname() and _getattr() with "descriptors": For each type of magic
77 and _attrname() and _getattr() with "descriptors": For each type of magic
72 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
78 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
73 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
79 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
74 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
80 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
75 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
81 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
76 are still supported.
82 are still supported.
77
83
78 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
84 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
79 fails in ibrowse.fetch(), the exception object is added as the last item
85 fails in ibrowse.fetch(), the exception object is added as the last item
80 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
86 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
81 a generator throws an exception midway through execution.
87 a generator throws an exception midway through execution.
82
88
83 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
89 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
84 encoding into methods.
90 encoding into methods.
85
91
86 2006-07-26 Ville Vainio <vivainio@gmail.com>
92 2006-07-26 Ville Vainio <vivainio@gmail.com>
87
93
88 * iplib.py: history now stores multiline input as single
94 * iplib.py: history now stores multiline input as single
89 history entries. Patch by Jorgen Cederlof.
95 history entries. Patch by Jorgen Cederlof.
90
96
91 2006-07-18 Walter Doerwald <walter@livinglogic.de>
97 2006-07-18 Walter Doerwald <walter@livinglogic.de>
92
98
93 * IPython/Extensions/ibrowse.py: Make cursor visible over
99 * IPython/Extensions/ibrowse.py: Make cursor visible over
94 non existing attributes.
100 non existing attributes.
95
101
96 2006-07-14 Walter Doerwald <walter@livinglogic.de>
102 2006-07-14 Walter Doerwald <walter@livinglogic.de>
97
103
98 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
104 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
99 error output of the running command doesn't mess up the screen.
105 error output of the running command doesn't mess up the screen.
100
106
101 2006-07-13 Walter Doerwald <walter@livinglogic.de>
107 2006-07-13 Walter Doerwald <walter@livinglogic.de>
102
108
103 * IPython/Extensions/ipipe.py (isort): Make isort usable without
109 * IPython/Extensions/ipipe.py (isort): Make isort usable without
104 argument. This sorts the items themselves.
110 argument. This sorts the items themselves.
105
111
106 2006-07-12 Walter Doerwald <walter@livinglogic.de>
112 2006-07-12 Walter Doerwald <walter@livinglogic.de>
107
113
108 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
114 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
109 Compile expression strings into code objects. This should speed
115 Compile expression strings into code objects. This should speed
110 up ifilter and friends somewhat.
116 up ifilter and friends somewhat.
111
117
112 2006-07-08 Ville Vainio <vivainio@gmail.com>
118 2006-07-08 Ville Vainio <vivainio@gmail.com>
113
119
114 * Magic.py: %cpaste now strips > from the beginning of lines
120 * Magic.py: %cpaste now strips > from the beginning of lines
115 to ease pasting quoted code from emails. Contributed by
121 to ease pasting quoted code from emails. Contributed by
116 Stefan van der Walt.
122 Stefan van der Walt.
117
123
118 2006-06-29 Ville Vainio <vivainio@gmail.com>
124 2006-06-29 Ville Vainio <vivainio@gmail.com>
119
125
120 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
126 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
121 mode, patch contributed by Darren Dale. NEEDS TESTING!
127 mode, patch contributed by Darren Dale. NEEDS TESTING!
122
128
123 2006-06-28 Walter Doerwald <walter@livinglogic.de>
129 2006-06-28 Walter Doerwald <walter@livinglogic.de>
124
130
125 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
131 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
126 a blue background. Fix fetching new display rows when the browser
132 a blue background. Fix fetching new display rows when the browser
127 scrolls more than a screenful (e.g. by using the goto command).
133 scrolls more than a screenful (e.g. by using the goto command).
128
134
129 2006-06-27 Ville Vainio <vivainio@gmail.com>
135 2006-06-27 Ville Vainio <vivainio@gmail.com>
130
136
131 * Magic.py (_inspect, _ofind) Apply David Huard's
137 * Magic.py (_inspect, _ofind) Apply David Huard's
132 patch for displaying the correct docstring for 'property'
138 patch for displaying the correct docstring for 'property'
133 attributes.
139 attributes.
134
140
135 2006-06-23 Walter Doerwald <walter@livinglogic.de>
141 2006-06-23 Walter Doerwald <walter@livinglogic.de>
136
142
137 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
143 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
138 commands into the methods implementing them.
144 commands into the methods implementing them.
139
145
140 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
146 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
141
147
142 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
148 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
143 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
149 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
144 autoindent support was authored by Jin Liu.
150 autoindent support was authored by Jin Liu.
145
151
146 2006-06-22 Walter Doerwald <walter@livinglogic.de>
152 2006-06-22 Walter Doerwald <walter@livinglogic.de>
147
153
148 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
154 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
149 for keymaps with a custom class that simplifies handling.
155 for keymaps with a custom class that simplifies handling.
150
156
151 2006-06-19 Walter Doerwald <walter@livinglogic.de>
157 2006-06-19 Walter Doerwald <walter@livinglogic.de>
152
158
153 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
159 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
154 resizing. This requires Python 2.5 to work.
160 resizing. This requires Python 2.5 to work.
155
161
156 2006-06-16 Walter Doerwald <walter@livinglogic.de>
162 2006-06-16 Walter Doerwald <walter@livinglogic.de>
157
163
158 * IPython/Extensions/ibrowse.py: Add two new commands to
164 * IPython/Extensions/ibrowse.py: Add two new commands to
159 ibrowse: "hideattr" (mapped to "h") hides the attribute under
165 ibrowse: "hideattr" (mapped to "h") hides the attribute under
160 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
166 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
161 attributes again. Remapped the help command to "?". Display
167 attributes again. Remapped the help command to "?". Display
162 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
168 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
163 as keys for the "home" and "end" commands. Add three new commands
169 as keys for the "home" and "end" commands. Add three new commands
164 to the input mode for "find" and friends: "delend" (CTRL-K)
170 to the input mode for "find" and friends: "delend" (CTRL-K)
165 deletes to the end of line. "incsearchup" searches upwards in the
171 deletes to the end of line. "incsearchup" searches upwards in the
166 command history for an input that starts with the text before the cursor.
172 command history for an input that starts with the text before the cursor.
167 "incsearchdown" does the same downwards. Removed a bogus mapping of
173 "incsearchdown" does the same downwards. Removed a bogus mapping of
168 the x key to "delete".
174 the x key to "delete".
169
175
170 2006-06-15 Ville Vainio <vivainio@gmail.com>
176 2006-06-15 Ville Vainio <vivainio@gmail.com>
171
177
172 * iplib.py, hooks.py: Added new generate_prompt hook that can be
178 * iplib.py, hooks.py: Added new generate_prompt hook that can be
173 used to create prompts dynamically, instead of the "old" way of
179 used to create prompts dynamically, instead of the "old" way of
174 assigning "magic" strings to prompt_in1 and prompt_in2. The old
180 assigning "magic" strings to prompt_in1 and prompt_in2. The old
175 way still works (it's invoked by the default hook), of course.
181 way still works (it's invoked by the default hook), of course.
176
182
177 * Prompts.py: added generate_output_prompt hook for altering output
183 * Prompts.py: added generate_output_prompt hook for altering output
178 prompt
184 prompt
179
185
180 * Release.py: Changed version string to 0.7.3.svn.
186 * Release.py: Changed version string to 0.7.3.svn.
181
187
182 2006-06-15 Walter Doerwald <walter@livinglogic.de>
188 2006-06-15 Walter Doerwald <walter@livinglogic.de>
183
189
184 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
190 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
185 the call to fetch() always tries to fetch enough data for at least one
191 the call to fetch() always tries to fetch enough data for at least one
186 full screen. This makes it possible to simply call moveto(0,0,True) in
192 full screen. This makes it possible to simply call moveto(0,0,True) in
187 the constructor. Fix typos and removed the obsolete goto attribute.
193 the constructor. Fix typos and removed the obsolete goto attribute.
188
194
189 2006-06-12 Ville Vainio <vivainio@gmail.com>
195 2006-06-12 Ville Vainio <vivainio@gmail.com>
190
196
191 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
197 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
192 allowing $variable interpolation within multiline statements,
198 allowing $variable interpolation within multiline statements,
193 though so far only with "sh" profile for a testing period.
199 though so far only with "sh" profile for a testing period.
194 The patch also enables splitting long commands with \ but it
200 The patch also enables splitting long commands with \ but it
195 doesn't work properly yet.
201 doesn't work properly yet.
196
202
197 2006-06-12 Walter Doerwald <walter@livinglogic.de>
203 2006-06-12 Walter Doerwald <walter@livinglogic.de>
198
204
199 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
205 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
200 input history and the position of the cursor in the input history for
206 input history and the position of the cursor in the input history for
201 the find, findbackwards and goto command.
207 the find, findbackwards and goto command.
202
208
203 2006-06-10 Walter Doerwald <walter@livinglogic.de>
209 2006-06-10 Walter Doerwald <walter@livinglogic.de>
204
210
205 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
211 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
206 implements the basic functionality of browser commands that require
212 implements the basic functionality of browser commands that require
207 input. Reimplement the goto, find and findbackwards commands as
213 input. Reimplement the goto, find and findbackwards commands as
208 subclasses of _CommandInput. Add an input history and keymaps to those
214 subclasses of _CommandInput. Add an input history and keymaps to those
209 commands. Add "\r" as a keyboard shortcut for the enterdefault and
215 commands. Add "\r" as a keyboard shortcut for the enterdefault and
210 execute commands.
216 execute commands.
211
217
212 2006-06-07 Ville Vainio <vivainio@gmail.com>
218 2006-06-07 Ville Vainio <vivainio@gmail.com>
213
219
214 * iplib.py: ipython mybatch.ipy exits ipython immediately after
220 * iplib.py: ipython mybatch.ipy exits ipython immediately after
215 running the batch files instead of leaving the session open.
221 running the batch files instead of leaving the session open.
216
222
217 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
223 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
218
224
219 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
225 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
220 the original fix was incomplete. Patch submitted by W. Maier.
226 the original fix was incomplete. Patch submitted by W. Maier.
221
227
222 2006-06-07 Ville Vainio <vivainio@gmail.com>
228 2006-06-07 Ville Vainio <vivainio@gmail.com>
223
229
224 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
230 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
225 Confirmation prompts can be supressed by 'quiet' option.
231 Confirmation prompts can be supressed by 'quiet' option.
226 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
232 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
227
233
228 2006-06-06 *** Released version 0.7.2
234 2006-06-06 *** Released version 0.7.2
229
235
230 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
236 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
231
237
232 * IPython/Release.py (version): Made 0.7.2 final for release.
238 * IPython/Release.py (version): Made 0.7.2 final for release.
233 Repo tagged and release cut.
239 Repo tagged and release cut.
234
240
235 2006-06-05 Ville Vainio <vivainio@gmail.com>
241 2006-06-05 Ville Vainio <vivainio@gmail.com>
236
242
237 * Magic.py (magic_rehashx): Honor no_alias list earlier in
243 * Magic.py (magic_rehashx): Honor no_alias list earlier in
238 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
244 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
239
245
240 * upgrade_dir.py: try import 'path' module a bit harder
246 * upgrade_dir.py: try import 'path' module a bit harder
241 (for %upgrade)
247 (for %upgrade)
242
248
243 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
249 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
244
250
245 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
251 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
246 instead of looping 20 times.
252 instead of looping 20 times.
247
253
248 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
254 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
249 correctly at initialization time. Bug reported by Krishna Mohan
255 correctly at initialization time. Bug reported by Krishna Mohan
250 Gundu <gkmohan-AT-gmail.com> on the user list.
256 Gundu <gkmohan-AT-gmail.com> on the user list.
251
257
252 * IPython/Release.py (version): Mark 0.7.2 version to start
258 * IPython/Release.py (version): Mark 0.7.2 version to start
253 testing for release on 06/06.
259 testing for release on 06/06.
254
260
255 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
261 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
256
262
257 * scripts/irunner: thin script interface so users don't have to
263 * scripts/irunner: thin script interface so users don't have to
258 find the module and call it as an executable, since modules rarely
264 find the module and call it as an executable, since modules rarely
259 live in people's PATH.
265 live in people's PATH.
260
266
261 * IPython/irunner.py (InteractiveRunner.__init__): added
267 * IPython/irunner.py (InteractiveRunner.__init__): added
262 delaybeforesend attribute to control delays with newer versions of
268 delaybeforesend attribute to control delays with newer versions of
263 pexpect. Thanks to detailed help from pexpect's author, Noah
269 pexpect. Thanks to detailed help from pexpect's author, Noah
264 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
270 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
265 correctly (it works in NoColor mode).
271 correctly (it works in NoColor mode).
266
272
267 * IPython/iplib.py (handle_normal): fix nasty crash reported on
273 * IPython/iplib.py (handle_normal): fix nasty crash reported on
268 SAGE list, from improper log() calls.
274 SAGE list, from improper log() calls.
269
275
270 2006-05-31 Ville Vainio <vivainio@gmail.com>
276 2006-05-31 Ville Vainio <vivainio@gmail.com>
271
277
272 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
278 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
273 with args in parens to work correctly with dirs that have spaces.
279 with args in parens to work correctly with dirs that have spaces.
274
280
275 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
281 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
276
282
277 * IPython/Logger.py (Logger.logstart): add option to log raw input
283 * IPython/Logger.py (Logger.logstart): add option to log raw input
278 instead of the processed one. A -r flag was added to the
284 instead of the processed one. A -r flag was added to the
279 %logstart magic used for controlling logging.
285 %logstart magic used for controlling logging.
280
286
281 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
287 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
282
288
283 * IPython/iplib.py (InteractiveShell.__init__): add check for the
289 * IPython/iplib.py (InteractiveShell.__init__): add check for the
284 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
290 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
285 recognize the option. After a bug report by Will Maier. This
291 recognize the option. After a bug report by Will Maier. This
286 closes #64 (will do it after confirmation from W. Maier).
292 closes #64 (will do it after confirmation from W. Maier).
287
293
288 * IPython/irunner.py: New module to run scripts as if manually
294 * IPython/irunner.py: New module to run scripts as if manually
289 typed into an interactive environment, based on pexpect. After a
295 typed into an interactive environment, based on pexpect. After a
290 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
296 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
291 ipython-user list. Simple unittests in the tests/ directory.
297 ipython-user list. Simple unittests in the tests/ directory.
292
298
293 * tools/release: add Will Maier, OpenBSD port maintainer, to
299 * tools/release: add Will Maier, OpenBSD port maintainer, to
294 recepients list. We are now officially part of the OpenBSD ports:
300 recepients list. We are now officially part of the OpenBSD ports:
295 http://www.openbsd.org/ports.html ! Many thanks to Will for the
301 http://www.openbsd.org/ports.html ! Many thanks to Will for the
296 work.
302 work.
297
303
298 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
304 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
299
305
300 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
306 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
301 so that it doesn't break tkinter apps.
307 so that it doesn't break tkinter apps.
302
308
303 * IPython/iplib.py (_prefilter): fix bug where aliases would
309 * IPython/iplib.py (_prefilter): fix bug where aliases would
304 shadow variables when autocall was fully off. Reported by SAGE
310 shadow variables when autocall was fully off. Reported by SAGE
305 author William Stein.
311 author William Stein.
306
312
307 * IPython/OInspect.py (Inspector.__init__): add a flag to control
313 * IPython/OInspect.py (Inspector.__init__): add a flag to control
308 at what detail level strings are computed when foo? is requested.
314 at what detail level strings are computed when foo? is requested.
309 This allows users to ask for example that the string form of an
315 This allows users to ask for example that the string form of an
310 object is only computed when foo?? is called, or even never, by
316 object is only computed when foo?? is called, or even never, by
311 setting the object_info_string_level >= 2 in the configuration
317 setting the object_info_string_level >= 2 in the configuration
312 file. This new option has been added and documented. After a
318 file. This new option has been added and documented. After a
313 request by SAGE to be able to control the printing of very large
319 request by SAGE to be able to control the printing of very large
314 objects more easily.
320 objects more easily.
315
321
316 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
322 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
317
323
318 * IPython/ipmaker.py (make_IPython): remove the ipython call path
324 * IPython/ipmaker.py (make_IPython): remove the ipython call path
319 from sys.argv, to be 100% consistent with how Python itself works
325 from sys.argv, to be 100% consistent with how Python itself works
320 (as seen for example with python -i file.py). After a bug report
326 (as seen for example with python -i file.py). After a bug report
321 by Jeffrey Collins.
327 by Jeffrey Collins.
322
328
323 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
329 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
324 nasty bug which was preventing custom namespaces with -pylab,
330 nasty bug which was preventing custom namespaces with -pylab,
325 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
331 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
326 compatibility (long gone from mpl).
332 compatibility (long gone from mpl).
327
333
328 * IPython/ipapi.py (make_session): name change: create->make. We
334 * IPython/ipapi.py (make_session): name change: create->make. We
329 use make in other places (ipmaker,...), it's shorter and easier to
335 use make in other places (ipmaker,...), it's shorter and easier to
330 type and say, etc. I'm trying to clean things before 0.7.2 so
336 type and say, etc. I'm trying to clean things before 0.7.2 so
331 that I can keep things stable wrt to ipapi in the chainsaw branch.
337 that I can keep things stable wrt to ipapi in the chainsaw branch.
332
338
333 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
339 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
334 python-mode recognizes our debugger mode. Add support for
340 python-mode recognizes our debugger mode. Add support for
335 autoindent inside (X)emacs. After a patch sent in by Jin Liu
341 autoindent inside (X)emacs. After a patch sent in by Jin Liu
336 <m.liu.jin-AT-gmail.com> originally written by
342 <m.liu.jin-AT-gmail.com> originally written by
337 doxgen-AT-newsmth.net (with minor modifications for xemacs
343 doxgen-AT-newsmth.net (with minor modifications for xemacs
338 compatibility)
344 compatibility)
339
345
340 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
346 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
341 tracebacks when walking the stack so that the stack tracking system
347 tracebacks when walking the stack so that the stack tracking system
342 in emacs' python-mode can identify the frames correctly.
348 in emacs' python-mode can identify the frames correctly.
343
349
344 * IPython/ipmaker.py (make_IPython): make the internal (and
350 * IPython/ipmaker.py (make_IPython): make the internal (and
345 default config) autoedit_syntax value false by default. Too many
351 default config) autoedit_syntax value false by default. Too many
346 users have complained to me (both on and off-list) about problems
352 users have complained to me (both on and off-list) about problems
347 with this option being on by default, so I'm making it default to
353 with this option being on by default, so I'm making it default to
348 off. It can still be enabled by anyone via the usual mechanisms.
354 off. It can still be enabled by anyone via the usual mechanisms.
349
355
350 * IPython/completer.py (Completer.attr_matches): add support for
356 * IPython/completer.py (Completer.attr_matches): add support for
351 PyCrust-style _getAttributeNames magic method. Patch contributed
357 PyCrust-style _getAttributeNames magic method. Patch contributed
352 by <mscott-AT-goldenspud.com>. Closes #50.
358 by <mscott-AT-goldenspud.com>. Closes #50.
353
359
354 * IPython/iplib.py (InteractiveShell.__init__): remove the
360 * IPython/iplib.py (InteractiveShell.__init__): remove the
355 deletion of exit/quit from __builtin__, which can break
361 deletion of exit/quit from __builtin__, which can break
356 third-party tools like the Zope debugging console. The
362 third-party tools like the Zope debugging console. The
357 %exit/%quit magics remain. In general, it's probably a good idea
363 %exit/%quit magics remain. In general, it's probably a good idea
358 not to delete anything from __builtin__, since we never know what
364 not to delete anything from __builtin__, since we never know what
359 that will break. In any case, python now (for 2.5) will support
365 that will break. In any case, python now (for 2.5) will support
360 'real' exit/quit, so this issue is moot. Closes #55.
366 'real' exit/quit, so this issue is moot. Closes #55.
361
367
362 * IPython/genutils.py (with_obj): rename the 'with' function to
368 * IPython/genutils.py (with_obj): rename the 'with' function to
363 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
369 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
364 becomes a language keyword. Closes #53.
370 becomes a language keyword. Closes #53.
365
371
366 * IPython/FakeModule.py (FakeModule.__init__): add a proper
372 * IPython/FakeModule.py (FakeModule.__init__): add a proper
367 __file__ attribute to this so it fools more things into thinking
373 __file__ attribute to this so it fools more things into thinking
368 it is a real module. Closes #59.
374 it is a real module. Closes #59.
369
375
370 * IPython/Magic.py (magic_edit): add -n option to open the editor
376 * IPython/Magic.py (magic_edit): add -n option to open the editor
371 at a specific line number. After a patch by Stefan van der Walt.
377 at a specific line number. After a patch by Stefan van der Walt.
372
378
373 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
379 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
374
380
375 * IPython/iplib.py (edit_syntax_error): fix crash when for some
381 * IPython/iplib.py (edit_syntax_error): fix crash when for some
376 reason the file could not be opened. After automatic crash
382 reason the file could not be opened. After automatic crash
377 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
383 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
378 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
384 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
379 (_should_recompile): Don't fire editor if using %bg, since there
385 (_should_recompile): Don't fire editor if using %bg, since there
380 is no file in the first place. From the same report as above.
386 is no file in the first place. From the same report as above.
381 (raw_input): protect against faulty third-party prefilters. After
387 (raw_input): protect against faulty third-party prefilters. After
382 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
388 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
383 while running under SAGE.
389 while running under SAGE.
384
390
385 2006-05-23 Ville Vainio <vivainio@gmail.com>
391 2006-05-23 Ville Vainio <vivainio@gmail.com>
386
392
387 * ipapi.py: Stripped down ip.to_user_ns() to work only as
393 * ipapi.py: Stripped down ip.to_user_ns() to work only as
388 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
394 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
389 now returns None (again), unless dummy is specifically allowed by
395 now returns None (again), unless dummy is specifically allowed by
390 ipapi.get(allow_dummy=True).
396 ipapi.get(allow_dummy=True).
391
397
392 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
398 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
393
399
394 * IPython: remove all 2.2-compatibility objects and hacks from
400 * IPython: remove all 2.2-compatibility objects and hacks from
395 everywhere, since we only support 2.3 at this point. Docs
401 everywhere, since we only support 2.3 at this point. Docs
396 updated.
402 updated.
397
403
398 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
404 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
399 Anything requiring extra validation can be turned into a Python
405 Anything requiring extra validation can be turned into a Python
400 property in the future. I used a property for the db one b/c
406 property in the future. I used a property for the db one b/c
401 there was a nasty circularity problem with the initialization
407 there was a nasty circularity problem with the initialization
402 order, which right now I don't have time to clean up.
408 order, which right now I don't have time to clean up.
403
409
404 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
410 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
405 another locking bug reported by Jorgen. I'm not 100% sure though,
411 another locking bug reported by Jorgen. I'm not 100% sure though,
406 so more testing is needed...
412 so more testing is needed...
407
413
408 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
414 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
409
415
410 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
416 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
411 local variables from any routine in user code (typically executed
417 local variables from any routine in user code (typically executed
412 with %run) directly into the interactive namespace. Very useful
418 with %run) directly into the interactive namespace. Very useful
413 when doing complex debugging.
419 when doing complex debugging.
414 (IPythonNotRunning): Changed the default None object to a dummy
420 (IPythonNotRunning): Changed the default None object to a dummy
415 whose attributes can be queried as well as called without
421 whose attributes can be queried as well as called without
416 exploding, to ease writing code which works transparently both in
422 exploding, to ease writing code which works transparently both in
417 and out of ipython and uses some of this API.
423 and out of ipython and uses some of this API.
418
424
419 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
425 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
420
426
421 * IPython/hooks.py (result_display): Fix the fact that our display
427 * IPython/hooks.py (result_display): Fix the fact that our display
422 hook was using str() instead of repr(), as the default python
428 hook was using str() instead of repr(), as the default python
423 console does. This had gone unnoticed b/c it only happened if
429 console does. This had gone unnoticed b/c it only happened if
424 %Pprint was off, but the inconsistency was there.
430 %Pprint was off, but the inconsistency was there.
425
431
426 2006-05-15 Ville Vainio <vivainio@gmail.com>
432 2006-05-15 Ville Vainio <vivainio@gmail.com>
427
433
428 * Oinspect.py: Only show docstring for nonexisting/binary files
434 * Oinspect.py: Only show docstring for nonexisting/binary files
429 when doing object??, closing ticket #62
435 when doing object??, closing ticket #62
430
436
431 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
437 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
432
438
433 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
439 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
434 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
440 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
435 was being released in a routine which hadn't checked if it had
441 was being released in a routine which hadn't checked if it had
436 been the one to acquire it.
442 been the one to acquire it.
437
443
438 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
444 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
439
445
440 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
446 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
441
447
442 2006-04-11 Ville Vainio <vivainio@gmail.com>
448 2006-04-11 Ville Vainio <vivainio@gmail.com>
443
449
444 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
450 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
445 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
451 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
446 prefilters, allowing stuff like magics and aliases in the file.
452 prefilters, allowing stuff like magics and aliases in the file.
447
453
448 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
454 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
449 added. Supported now are "%clear in" and "%clear out" (clear input and
455 added. Supported now are "%clear in" and "%clear out" (clear input and
450 output history, respectively). Also fixed CachedOutput.flush to
456 output history, respectively). Also fixed CachedOutput.flush to
451 properly flush the output cache.
457 properly flush the output cache.
452
458
453 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
459 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
454 half-success (and fail explicitly).
460 half-success (and fail explicitly).
455
461
456 2006-03-28 Ville Vainio <vivainio@gmail.com>
462 2006-03-28 Ville Vainio <vivainio@gmail.com>
457
463
458 * iplib.py: Fix quoting of aliases so that only argless ones
464 * iplib.py: Fix quoting of aliases so that only argless ones
459 are quoted
465 are quoted
460
466
461 2006-03-28 Ville Vainio <vivainio@gmail.com>
467 2006-03-28 Ville Vainio <vivainio@gmail.com>
462
468
463 * iplib.py: Quote aliases with spaces in the name.
469 * iplib.py: Quote aliases with spaces in the name.
464 "c:\program files\blah\bin" is now legal alias target.
470 "c:\program files\blah\bin" is now legal alias target.
465
471
466 * ext_rehashdir.py: Space no longer allowed as arg
472 * ext_rehashdir.py: Space no longer allowed as arg
467 separator, since space is legal in path names.
473 separator, since space is legal in path names.
468
474
469 2006-03-16 Ville Vainio <vivainio@gmail.com>
475 2006-03-16 Ville Vainio <vivainio@gmail.com>
470
476
471 * upgrade_dir.py: Take path.py from Extensions, correcting
477 * upgrade_dir.py: Take path.py from Extensions, correcting
472 %upgrade magic
478 %upgrade magic
473
479
474 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
480 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
475
481
476 * hooks.py: Only enclose editor binary in quotes if legal and
482 * hooks.py: Only enclose editor binary in quotes if legal and
477 necessary (space in the name, and is an existing file). Fixes a bug
483 necessary (space in the name, and is an existing file). Fixes a bug
478 reported by Zachary Pincus.
484 reported by Zachary Pincus.
479
485
480 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
486 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
481
487
482 * Manual: thanks to a tip on proper color handling for Emacs, by
488 * Manual: thanks to a tip on proper color handling for Emacs, by
483 Eric J Haywiser <ejh1-AT-MIT.EDU>.
489 Eric J Haywiser <ejh1-AT-MIT.EDU>.
484
490
485 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
491 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
486 by applying the provided patch. Thanks to Liu Jin
492 by applying the provided patch. Thanks to Liu Jin
487 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
493 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
488 XEmacs/Linux, I'm trusting the submitter that it actually helps
494 XEmacs/Linux, I'm trusting the submitter that it actually helps
489 under win32/GNU Emacs. Will revisit if any problems are reported.
495 under win32/GNU Emacs. Will revisit if any problems are reported.
490
496
491 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
497 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
492
498
493 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
499 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
494 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
500 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
495
501
496 2006-03-12 Ville Vainio <vivainio@gmail.com>
502 2006-03-12 Ville Vainio <vivainio@gmail.com>
497
503
498 * Magic.py (magic_timeit): Added %timeit magic, contributed by
504 * Magic.py (magic_timeit): Added %timeit magic, contributed by
499 Torsten Marek.
505 Torsten Marek.
500
506
501 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
507 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
502
508
503 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
509 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
504 line ranges works again.
510 line ranges works again.
505
511
506 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
512 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
507
513
508 * IPython/iplib.py (showtraceback): add back sys.last_traceback
514 * IPython/iplib.py (showtraceback): add back sys.last_traceback
509 and friends, after a discussion with Zach Pincus on ipython-user.
515 and friends, after a discussion with Zach Pincus on ipython-user.
510 I'm not 100% sure, but after thinking about it quite a bit, it may
516 I'm not 100% sure, but after thinking about it quite a bit, it may
511 be OK. Testing with the multithreaded shells didn't reveal any
517 be OK. Testing with the multithreaded shells didn't reveal any
512 problems, but let's keep an eye out.
518 problems, but let's keep an eye out.
513
519
514 In the process, I fixed a few things which were calling
520 In the process, I fixed a few things which were calling
515 self.InteractiveTB() directly (like safe_execfile), which is a
521 self.InteractiveTB() directly (like safe_execfile), which is a
516 mistake: ALL exception reporting should be done by calling
522 mistake: ALL exception reporting should be done by calling
517 self.showtraceback(), which handles state and tab-completion and
523 self.showtraceback(), which handles state and tab-completion and
518 more.
524 more.
519
525
520 2006-03-01 Ville Vainio <vivainio@gmail.com>
526 2006-03-01 Ville Vainio <vivainio@gmail.com>
521
527
522 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
528 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
523 To use, do "from ipipe import *".
529 To use, do "from ipipe import *".
524
530
525 2006-02-24 Ville Vainio <vivainio@gmail.com>
531 2006-02-24 Ville Vainio <vivainio@gmail.com>
526
532
527 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
533 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
528 "cleanly" and safely than the older upgrade mechanism.
534 "cleanly" and safely than the older upgrade mechanism.
529
535
530 2006-02-21 Ville Vainio <vivainio@gmail.com>
536 2006-02-21 Ville Vainio <vivainio@gmail.com>
531
537
532 * Magic.py: %save works again.
538 * Magic.py: %save works again.
533
539
534 2006-02-15 Ville Vainio <vivainio@gmail.com>
540 2006-02-15 Ville Vainio <vivainio@gmail.com>
535
541
536 * Magic.py: %Pprint works again
542 * Magic.py: %Pprint works again
537
543
538 * Extensions/ipy_sane_defaults.py: Provide everything provided
544 * Extensions/ipy_sane_defaults.py: Provide everything provided
539 in default ipythonrc, to make it possible to have a completely empty
545 in default ipythonrc, to make it possible to have a completely empty
540 ipythonrc (and thus completely rc-file free configuration)
546 ipythonrc (and thus completely rc-file free configuration)
541
547
542 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
548 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
543
549
544 * IPython/hooks.py (editor): quote the call to the editor command,
550 * IPython/hooks.py (editor): quote the call to the editor command,
545 to allow commands with spaces in them. Problem noted by watching
551 to allow commands with spaces in them. Problem noted by watching
546 Ian Oswald's video about textpad under win32 at
552 Ian Oswald's video about textpad under win32 at
547 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
553 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
548
554
549 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
555 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
550 describing magics (we haven't used @ for a loong time).
556 describing magics (we haven't used @ for a loong time).
551
557
552 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
558 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
553 contributed by marienz to close
559 contributed by marienz to close
554 http://www.scipy.net/roundup/ipython/issue53.
560 http://www.scipy.net/roundup/ipython/issue53.
555
561
556 2006-02-10 Ville Vainio <vivainio@gmail.com>
562 2006-02-10 Ville Vainio <vivainio@gmail.com>
557
563
558 * genutils.py: getoutput now works in win32 too
564 * genutils.py: getoutput now works in win32 too
559
565
560 * completer.py: alias and magic completion only invoked
566 * completer.py: alias and magic completion only invoked
561 at the first "item" in the line, to avoid "cd %store"
567 at the first "item" in the line, to avoid "cd %store"
562 nonsense.
568 nonsense.
563
569
564 2006-02-09 Ville Vainio <vivainio@gmail.com>
570 2006-02-09 Ville Vainio <vivainio@gmail.com>
565
571
566 * test/*: Added a unit testing framework (finally).
572 * test/*: Added a unit testing framework (finally).
567 '%run runtests.py' to run test_*.
573 '%run runtests.py' to run test_*.
568
574
569 * ipapi.py: Exposed runlines and set_custom_exc
575 * ipapi.py: Exposed runlines and set_custom_exc
570
576
571 2006-02-07 Ville Vainio <vivainio@gmail.com>
577 2006-02-07 Ville Vainio <vivainio@gmail.com>
572
578
573 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
579 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
574 instead use "f(1 2)" as before.
580 instead use "f(1 2)" as before.
575
581
576 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
582 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
577
583
578 * IPython/demo.py (IPythonDemo): Add new classes to the demo
584 * IPython/demo.py (IPythonDemo): Add new classes to the demo
579 facilities, for demos processed by the IPython input filter
585 facilities, for demos processed by the IPython input filter
580 (IPythonDemo), and for running a script one-line-at-a-time as a
586 (IPythonDemo), and for running a script one-line-at-a-time as a
581 demo, both for pure Python (LineDemo) and for IPython-processed
587 demo, both for pure Python (LineDemo) and for IPython-processed
582 input (IPythonLineDemo). After a request by Dave Kohel, from the
588 input (IPythonLineDemo). After a request by Dave Kohel, from the
583 SAGE team.
589 SAGE team.
584 (Demo.edit): added an edit() method to the demo objects, to edit
590 (Demo.edit): added an edit() method to the demo objects, to edit
585 the in-memory copy of the last executed block.
591 the in-memory copy of the last executed block.
586
592
587 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
593 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
588 processing to %edit, %macro and %save. These commands can now be
594 processing to %edit, %macro and %save. These commands can now be
589 invoked on the unprocessed input as it was typed by the user
595 invoked on the unprocessed input as it was typed by the user
590 (without any prefilters applied). After requests by the SAGE team
596 (without any prefilters applied). After requests by the SAGE team
591 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
597 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
592
598
593 2006-02-01 Ville Vainio <vivainio@gmail.com>
599 2006-02-01 Ville Vainio <vivainio@gmail.com>
594
600
595 * setup.py, eggsetup.py: easy_install ipython==dev works
601 * setup.py, eggsetup.py: easy_install ipython==dev works
596 correctly now (on Linux)
602 correctly now (on Linux)
597
603
598 * ipy_user_conf,ipmaker: user config changes, removed spurious
604 * ipy_user_conf,ipmaker: user config changes, removed spurious
599 warnings
605 warnings
600
606
601 * iplib: if rc.banner is string, use it as is.
607 * iplib: if rc.banner is string, use it as is.
602
608
603 * Magic: %pycat accepts a string argument and pages it's contents.
609 * Magic: %pycat accepts a string argument and pages it's contents.
604
610
605
611
606 2006-01-30 Ville Vainio <vivainio@gmail.com>
612 2006-01-30 Ville Vainio <vivainio@gmail.com>
607
613
608 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
614 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
609 Now %store and bookmarks work through PickleShare, meaning that
615 Now %store and bookmarks work through PickleShare, meaning that
610 concurrent access is possible and all ipython sessions see the
616 concurrent access is possible and all ipython sessions see the
611 same database situation all the time, instead of snapshot of
617 same database situation all the time, instead of snapshot of
612 the situation when the session was started. Hence, %bookmark
618 the situation when the session was started. Hence, %bookmark
613 results are immediately accessible from othes sessions. The database
619 results are immediately accessible from othes sessions. The database
614 is also available for use by user extensions. See:
620 is also available for use by user extensions. See:
615 http://www.python.org/pypi/pickleshare
621 http://www.python.org/pypi/pickleshare
616
622
617 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
623 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
618
624
619 * aliases can now be %store'd
625 * aliases can now be %store'd
620
626
621 * path.py moved to Extensions so that pickleshare does not need
627 * path.py moved to Extensions so that pickleshare does not need
622 IPython-specific import. Extensions added to pythonpath right
628 IPython-specific import. Extensions added to pythonpath right
623 at __init__.
629 at __init__.
624
630
625 * iplib.py: ipalias deprecated/redundant; aliases are converted and
631 * iplib.py: ipalias deprecated/redundant; aliases are converted and
626 called with _ip.system and the pre-transformed command string.
632 called with _ip.system and the pre-transformed command string.
627
633
628 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
634 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
629
635
630 * IPython/iplib.py (interact): Fix that we were not catching
636 * IPython/iplib.py (interact): Fix that we were not catching
631 KeyboardInterrupt exceptions properly. I'm not quite sure why the
637 KeyboardInterrupt exceptions properly. I'm not quite sure why the
632 logic here had to change, but it's fixed now.
638 logic here had to change, but it's fixed now.
633
639
634 2006-01-29 Ville Vainio <vivainio@gmail.com>
640 2006-01-29 Ville Vainio <vivainio@gmail.com>
635
641
636 * iplib.py: Try to import pyreadline on Windows.
642 * iplib.py: Try to import pyreadline on Windows.
637
643
638 2006-01-27 Ville Vainio <vivainio@gmail.com>
644 2006-01-27 Ville Vainio <vivainio@gmail.com>
639
645
640 * iplib.py: Expose ipapi as _ip in builtin namespace.
646 * iplib.py: Expose ipapi as _ip in builtin namespace.
641 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
647 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
642 and ip_set_hook (-> _ip.set_hook) redundant. % and !
648 and ip_set_hook (-> _ip.set_hook) redundant. % and !
643 syntax now produce _ip.* variant of the commands.
649 syntax now produce _ip.* variant of the commands.
644
650
645 * "_ip.options().autoedit_syntax = 2" automatically throws
651 * "_ip.options().autoedit_syntax = 2" automatically throws
646 user to editor for syntax error correction without prompting.
652 user to editor for syntax error correction without prompting.
647
653
648 2006-01-27 Ville Vainio <vivainio@gmail.com>
654 2006-01-27 Ville Vainio <vivainio@gmail.com>
649
655
650 * ipmaker.py: Give "realistic" sys.argv for scripts (without
656 * ipmaker.py: Give "realistic" sys.argv for scripts (without
651 'ipython' at argv[0]) executed through command line.
657 'ipython' at argv[0]) executed through command line.
652 NOTE: this DEPRECATES calling ipython with multiple scripts
658 NOTE: this DEPRECATES calling ipython with multiple scripts
653 ("ipython a.py b.py c.py")
659 ("ipython a.py b.py c.py")
654
660
655 * iplib.py, hooks.py: Added configurable input prefilter,
661 * iplib.py, hooks.py: Added configurable input prefilter,
656 named 'input_prefilter'. See ext_rescapture.py for example
662 named 'input_prefilter'. See ext_rescapture.py for example
657 usage.
663 usage.
658
664
659 * ext_rescapture.py, Magic.py: Better system command output capture
665 * ext_rescapture.py, Magic.py: Better system command output capture
660 through 'var = !ls' (deprecates user-visible %sc). Same notation
666 through 'var = !ls' (deprecates user-visible %sc). Same notation
661 applies for magics, 'var = %alias' assigns alias list to var.
667 applies for magics, 'var = %alias' assigns alias list to var.
662
668
663 * ipapi.py: added meta() for accessing extension-usable data store.
669 * ipapi.py: added meta() for accessing extension-usable data store.
664
670
665 * iplib.py: added InteractiveShell.getapi(). New magics should be
671 * iplib.py: added InteractiveShell.getapi(). New magics should be
666 written doing self.getapi() instead of using the shell directly.
672 written doing self.getapi() instead of using the shell directly.
667
673
668 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
674 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
669 %store foo >> ~/myfoo.txt to store variables to files (in clean
675 %store foo >> ~/myfoo.txt to store variables to files (in clean
670 textual form, not a restorable pickle).
676 textual form, not a restorable pickle).
671
677
672 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
678 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
673
679
674 * usage.py, Magic.py: added %quickref
680 * usage.py, Magic.py: added %quickref
675
681
676 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
682 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
677
683
678 * GetoptErrors when invoking magics etc. with wrong args
684 * GetoptErrors when invoking magics etc. with wrong args
679 are now more helpful:
685 are now more helpful:
680 GetoptError: option -l not recognized (allowed: "qb" )
686 GetoptError: option -l not recognized (allowed: "qb" )
681
687
682 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
688 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
683
689
684 * IPython/demo.py (Demo.show): Flush stdout after each block, so
690 * IPython/demo.py (Demo.show): Flush stdout after each block, so
685 computationally intensive blocks don't appear to stall the demo.
691 computationally intensive blocks don't appear to stall the demo.
686
692
687 2006-01-24 Ville Vainio <vivainio@gmail.com>
693 2006-01-24 Ville Vainio <vivainio@gmail.com>
688
694
689 * iplib.py, hooks.py: 'result_display' hook can return a non-None
695 * iplib.py, hooks.py: 'result_display' hook can return a non-None
690 value to manipulate resulting history entry.
696 value to manipulate resulting history entry.
691
697
692 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
698 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
693 to instance methods of IPApi class, to make extending an embedded
699 to instance methods of IPApi class, to make extending an embedded
694 IPython feasible. See ext_rehashdir.py for example usage.
700 IPython feasible. See ext_rehashdir.py for example usage.
695
701
696 * Merged 1071-1076 from branches/0.7.1
702 * Merged 1071-1076 from branches/0.7.1
697
703
698
704
699 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
705 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
700
706
701 * tools/release (daystamp): Fix build tools to use the new
707 * tools/release (daystamp): Fix build tools to use the new
702 eggsetup.py script to build lightweight eggs.
708 eggsetup.py script to build lightweight eggs.
703
709
704 * Applied changesets 1062 and 1064 before 0.7.1 release.
710 * Applied changesets 1062 and 1064 before 0.7.1 release.
705
711
706 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
712 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
707 see the raw input history (without conversions like %ls ->
713 see the raw input history (without conversions like %ls ->
708 ipmagic("ls")). After a request from W. Stein, SAGE
714 ipmagic("ls")). After a request from W. Stein, SAGE
709 (http://modular.ucsd.edu/sage) developer. This information is
715 (http://modular.ucsd.edu/sage) developer. This information is
710 stored in the input_hist_raw attribute of the IPython instance, so
716 stored in the input_hist_raw attribute of the IPython instance, so
711 developers can access it if needed (it's an InputList instance).
717 developers can access it if needed (it's an InputList instance).
712
718
713 * Versionstring = 0.7.2.svn
719 * Versionstring = 0.7.2.svn
714
720
715 * eggsetup.py: A separate script for constructing eggs, creates
721 * eggsetup.py: A separate script for constructing eggs, creates
716 proper launch scripts even on Windows (an .exe file in
722 proper launch scripts even on Windows (an .exe file in
717 \python24\scripts).
723 \python24\scripts).
718
724
719 * ipapi.py: launch_new_instance, launch entry point needed for the
725 * ipapi.py: launch_new_instance, launch entry point needed for the
720 egg.
726 egg.
721
727
722 2006-01-23 Ville Vainio <vivainio@gmail.com>
728 2006-01-23 Ville Vainio <vivainio@gmail.com>
723
729
724 * Added %cpaste magic for pasting python code
730 * Added %cpaste magic for pasting python code
725
731
726 2006-01-22 Ville Vainio <vivainio@gmail.com>
732 2006-01-22 Ville Vainio <vivainio@gmail.com>
727
733
728 * Merge from branches/0.7.1 into trunk, revs 1052-1057
734 * Merge from branches/0.7.1 into trunk, revs 1052-1057
729
735
730 * Versionstring = 0.7.2.svn
736 * Versionstring = 0.7.2.svn
731
737
732 * eggsetup.py: A separate script for constructing eggs, creates
738 * eggsetup.py: A separate script for constructing eggs, creates
733 proper launch scripts even on Windows (an .exe file in
739 proper launch scripts even on Windows (an .exe file in
734 \python24\scripts).
740 \python24\scripts).
735
741
736 * ipapi.py: launch_new_instance, launch entry point needed for the
742 * ipapi.py: launch_new_instance, launch entry point needed for the
737 egg.
743 egg.
738
744
739 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
745 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
740
746
741 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
747 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
742 %pfile foo would print the file for foo even if it was a binary.
748 %pfile foo would print the file for foo even if it was a binary.
743 Now, extensions '.so' and '.dll' are skipped.
749 Now, extensions '.so' and '.dll' are skipped.
744
750
745 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
751 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
746 bug, where macros would fail in all threaded modes. I'm not 100%
752 bug, where macros would fail in all threaded modes. I'm not 100%
747 sure, so I'm going to put out an rc instead of making a release
753 sure, so I'm going to put out an rc instead of making a release
748 today, and wait for feedback for at least a few days.
754 today, and wait for feedback for at least a few days.
749
755
750 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
756 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
751 it...) the handling of pasting external code with autoindent on.
757 it...) the handling of pasting external code with autoindent on.
752 To get out of a multiline input, the rule will appear for most
758 To get out of a multiline input, the rule will appear for most
753 users unchanged: two blank lines or change the indent level
759 users unchanged: two blank lines or change the indent level
754 proposed by IPython. But there is a twist now: you can
760 proposed by IPython. But there is a twist now: you can
755 add/subtract only *one or two spaces*. If you add/subtract three
761 add/subtract only *one or two spaces*. If you add/subtract three
756 or more (unless you completely delete the line), IPython will
762 or more (unless you completely delete the line), IPython will
757 accept that line, and you'll need to enter a second one of pure
763 accept that line, and you'll need to enter a second one of pure
758 whitespace. I know it sounds complicated, but I can't find a
764 whitespace. I know it sounds complicated, but I can't find a
759 different solution that covers all the cases, with the right
765 different solution that covers all the cases, with the right
760 heuristics. Hopefully in actual use, nobody will really notice
766 heuristics. Hopefully in actual use, nobody will really notice
761 all these strange rules and things will 'just work'.
767 all these strange rules and things will 'just work'.
762
768
763 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
769 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
764
770
765 * IPython/iplib.py (interact): catch exceptions which can be
771 * IPython/iplib.py (interact): catch exceptions which can be
766 triggered asynchronously by signal handlers. Thanks to an
772 triggered asynchronously by signal handlers. Thanks to an
767 automatic crash report, submitted by Colin Kingsley
773 automatic crash report, submitted by Colin Kingsley
768 <tercel-AT-gentoo.org>.
774 <tercel-AT-gentoo.org>.
769
775
770 2006-01-20 Ville Vainio <vivainio@gmail.com>
776 2006-01-20 Ville Vainio <vivainio@gmail.com>
771
777
772 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
778 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
773 (%rehashdir, very useful, try it out) of how to extend ipython
779 (%rehashdir, very useful, try it out) of how to extend ipython
774 with new magics. Also added Extensions dir to pythonpath to make
780 with new magics. Also added Extensions dir to pythonpath to make
775 importing extensions easy.
781 importing extensions easy.
776
782
777 * %store now complains when trying to store interactively declared
783 * %store now complains when trying to store interactively declared
778 classes / instances of those classes.
784 classes / instances of those classes.
779
785
780 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
786 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
781 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
787 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
782 if they exist, and ipy_user_conf.py with some defaults is created for
788 if they exist, and ipy_user_conf.py with some defaults is created for
783 the user.
789 the user.
784
790
785 * Startup rehashing done by the config file, not InterpreterExec.
791 * Startup rehashing done by the config file, not InterpreterExec.
786 This means system commands are available even without selecting the
792 This means system commands are available even without selecting the
787 pysh profile. It's the sensible default after all.
793 pysh profile. It's the sensible default after all.
788
794
789 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
795 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
790
796
791 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
797 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
792 multiline code with autoindent on working. But I am really not
798 multiline code with autoindent on working. But I am really not
793 sure, so this needs more testing. Will commit a debug-enabled
799 sure, so this needs more testing. Will commit a debug-enabled
794 version for now, while I test it some more, so that Ville and
800 version for now, while I test it some more, so that Ville and
795 others may also catch any problems. Also made
801 others may also catch any problems. Also made
796 self.indent_current_str() a method, to ensure that there's no
802 self.indent_current_str() a method, to ensure that there's no
797 chance of the indent space count and the corresponding string
803 chance of the indent space count and the corresponding string
798 falling out of sync. All code needing the string should just call
804 falling out of sync. All code needing the string should just call
799 the method.
805 the method.
800
806
801 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
807 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
802
808
803 * IPython/Magic.py (magic_edit): fix check for when users don't
809 * IPython/Magic.py (magic_edit): fix check for when users don't
804 save their output files, the try/except was in the wrong section.
810 save their output files, the try/except was in the wrong section.
805
811
806 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
812 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
807
813
808 * IPython/Magic.py (magic_run): fix __file__ global missing from
814 * IPython/Magic.py (magic_run): fix __file__ global missing from
809 script's namespace when executed via %run. After a report by
815 script's namespace when executed via %run. After a report by
810 Vivian.
816 Vivian.
811
817
812 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
818 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
813 when using python 2.4. The parent constructor changed in 2.4, and
819 when using python 2.4. The parent constructor changed in 2.4, and
814 we need to track it directly (we can't call it, as it messes up
820 we need to track it directly (we can't call it, as it messes up
815 readline and tab-completion inside our pdb would stop working).
821 readline and tab-completion inside our pdb would stop working).
816 After a bug report by R. Bernstein <rocky-AT-panix.com>.
822 After a bug report by R. Bernstein <rocky-AT-panix.com>.
817
823
818 2006-01-16 Ville Vainio <vivainio@gmail.com>
824 2006-01-16 Ville Vainio <vivainio@gmail.com>
819
825
820 * Ipython/magic.py: Reverted back to old %edit functionality
826 * Ipython/magic.py: Reverted back to old %edit functionality
821 that returns file contents on exit.
827 that returns file contents on exit.
822
828
823 * IPython/path.py: Added Jason Orendorff's "path" module to
829 * IPython/path.py: Added Jason Orendorff's "path" module to
824 IPython tree, http://www.jorendorff.com/articles/python/path/.
830 IPython tree, http://www.jorendorff.com/articles/python/path/.
825 You can get path objects conveniently through %sc, and !!, e.g.:
831 You can get path objects conveniently through %sc, and !!, e.g.:
826 sc files=ls
832 sc files=ls
827 for p in files.paths: # or files.p
833 for p in files.paths: # or files.p
828 print p,p.mtime
834 print p,p.mtime
829
835
830 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
836 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
831 now work again without considering the exclusion regexp -
837 now work again without considering the exclusion regexp -
832 hence, things like ',foo my/path' turn to 'foo("my/path")'
838 hence, things like ',foo my/path' turn to 'foo("my/path")'
833 instead of syntax error.
839 instead of syntax error.
834
840
835
841
836 2006-01-14 Ville Vainio <vivainio@gmail.com>
842 2006-01-14 Ville Vainio <vivainio@gmail.com>
837
843
838 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
844 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
839 ipapi decorators for python 2.4 users, options() provides access to rc
845 ipapi decorators for python 2.4 users, options() provides access to rc
840 data.
846 data.
841
847
842 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
848 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
843 as path separators (even on Linux ;-). Space character after
849 as path separators (even on Linux ;-). Space character after
844 backslash (as yielded by tab completer) is still space;
850 backslash (as yielded by tab completer) is still space;
845 "%cd long\ name" works as expected.
851 "%cd long\ name" works as expected.
846
852
847 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
853 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
848 as "chain of command", with priority. API stays the same,
854 as "chain of command", with priority. API stays the same,
849 TryNext exception raised by a hook function signals that
855 TryNext exception raised by a hook function signals that
850 current hook failed and next hook should try handling it, as
856 current hook failed and next hook should try handling it, as
851 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
857 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
852 requested configurable display hook, which is now implemented.
858 requested configurable display hook, which is now implemented.
853
859
854 2006-01-13 Ville Vainio <vivainio@gmail.com>
860 2006-01-13 Ville Vainio <vivainio@gmail.com>
855
861
856 * IPython/platutils*.py: platform specific utility functions,
862 * IPython/platutils*.py: platform specific utility functions,
857 so far only set_term_title is implemented (change terminal
863 so far only set_term_title is implemented (change terminal
858 label in windowing systems). %cd now changes the title to
864 label in windowing systems). %cd now changes the title to
859 current dir.
865 current dir.
860
866
861 * IPython/Release.py: Added myself to "authors" list,
867 * IPython/Release.py: Added myself to "authors" list,
862 had to create new files.
868 had to create new files.
863
869
864 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
870 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
865 shell escape; not a known bug but had potential to be one in the
871 shell escape; not a known bug but had potential to be one in the
866 future.
872 future.
867
873
868 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
874 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
869 extension API for IPython! See the module for usage example. Fix
875 extension API for IPython! See the module for usage example. Fix
870 OInspect for docstring-less magic functions.
876 OInspect for docstring-less magic functions.
871
877
872
878
873 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
879 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
874
880
875 * IPython/iplib.py (raw_input): temporarily deactivate all
881 * IPython/iplib.py (raw_input): temporarily deactivate all
876 attempts at allowing pasting of code with autoindent on. It
882 attempts at allowing pasting of code with autoindent on. It
877 introduced bugs (reported by Prabhu) and I can't seem to find a
883 introduced bugs (reported by Prabhu) and I can't seem to find a
878 robust combination which works in all cases. Will have to revisit
884 robust combination which works in all cases. Will have to revisit
879 later.
885 later.
880
886
881 * IPython/genutils.py: remove isspace() function. We've dropped
887 * IPython/genutils.py: remove isspace() function. We've dropped
882 2.2 compatibility, so it's OK to use the string method.
888 2.2 compatibility, so it's OK to use the string method.
883
889
884 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
890 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
885
891
886 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
892 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
887 matching what NOT to autocall on, to include all python binary
893 matching what NOT to autocall on, to include all python binary
888 operators (including things like 'and', 'or', 'is' and 'in').
894 operators (including things like 'and', 'or', 'is' and 'in').
889 Prompted by a bug report on 'foo & bar', but I realized we had
895 Prompted by a bug report on 'foo & bar', but I realized we had
890 many more potential bug cases with other operators. The regexp is
896 many more potential bug cases with other operators. The regexp is
891 self.re_exclude_auto, it's fairly commented.
897 self.re_exclude_auto, it's fairly commented.
892
898
893 2006-01-12 Ville Vainio <vivainio@gmail.com>
899 2006-01-12 Ville Vainio <vivainio@gmail.com>
894
900
895 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
901 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
896 Prettified and hardened string/backslash quoting with ipsystem(),
902 Prettified and hardened string/backslash quoting with ipsystem(),
897 ipalias() and ipmagic(). Now even \ characters are passed to
903 ipalias() and ipmagic(). Now even \ characters are passed to
898 %magics, !shell escapes and aliases exactly as they are in the
904 %magics, !shell escapes and aliases exactly as they are in the
899 ipython command line. Should improve backslash experience,
905 ipython command line. Should improve backslash experience,
900 particularly in Windows (path delimiter for some commands that
906 particularly in Windows (path delimiter for some commands that
901 won't understand '/'), but Unix benefits as well (regexps). %cd
907 won't understand '/'), but Unix benefits as well (regexps). %cd
902 magic still doesn't support backslash path delimiters, though. Also
908 magic still doesn't support backslash path delimiters, though. Also
903 deleted all pretense of supporting multiline command strings in
909 deleted all pretense of supporting multiline command strings in
904 !system or %magic commands. Thanks to Jerry McRae for suggestions.
910 !system or %magic commands. Thanks to Jerry McRae for suggestions.
905
911
906 * doc/build_doc_instructions.txt added. Documentation on how to
912 * doc/build_doc_instructions.txt added. Documentation on how to
907 use doc/update_manual.py, added yesterday. Both files contributed
913 use doc/update_manual.py, added yesterday. Both files contributed
908 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
914 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
909 doc/*.sh for deprecation at a later date.
915 doc/*.sh for deprecation at a later date.
910
916
911 * /ipython.py Added ipython.py to root directory for
917 * /ipython.py Added ipython.py to root directory for
912 zero-installation (tar xzvf ipython.tgz; cd ipython; python
918 zero-installation (tar xzvf ipython.tgz; cd ipython; python
913 ipython.py) and development convenience (no need to keep doing
919 ipython.py) and development convenience (no need to keep doing
914 "setup.py install" between changes).
920 "setup.py install" between changes).
915
921
916 * Made ! and !! shell escapes work (again) in multiline expressions:
922 * Made ! and !! shell escapes work (again) in multiline expressions:
917 if 1:
923 if 1:
918 !ls
924 !ls
919 !!ls
925 !!ls
920
926
921 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
927 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
922
928
923 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
929 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
924 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
930 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
925 module in case-insensitive installation. Was causing crashes
931 module in case-insensitive installation. Was causing crashes
926 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
932 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
927
933
928 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
934 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
929 <marienz-AT-gentoo.org>, closes
935 <marienz-AT-gentoo.org>, closes
930 http://www.scipy.net/roundup/ipython/issue51.
936 http://www.scipy.net/roundup/ipython/issue51.
931
937
932 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
938 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
933
939
934 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
940 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
935 problem of excessive CPU usage under *nix and keyboard lag under
941 problem of excessive CPU usage under *nix and keyboard lag under
936 win32.
942 win32.
937
943
938 2006-01-10 *** Released version 0.7.0
944 2006-01-10 *** Released version 0.7.0
939
945
940 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
946 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
941
947
942 * IPython/Release.py (revision): tag version number to 0.7.0,
948 * IPython/Release.py (revision): tag version number to 0.7.0,
943 ready for release.
949 ready for release.
944
950
945 * IPython/Magic.py (magic_edit): Add print statement to %edit so
951 * IPython/Magic.py (magic_edit): Add print statement to %edit so
946 it informs the user of the name of the temp. file used. This can
952 it informs the user of the name of the temp. file used. This can
947 help if you decide later to reuse that same file, so you know
953 help if you decide later to reuse that same file, so you know
948 where to copy the info from.
954 where to copy the info from.
949
955
950 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
956 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
951
957
952 * setup_bdist_egg.py: little script to build an egg. Added
958 * setup_bdist_egg.py: little script to build an egg. Added
953 support in the release tools as well.
959 support in the release tools as well.
954
960
955 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
961 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
956
962
957 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
963 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
958 version selection (new -wxversion command line and ipythonrc
964 version selection (new -wxversion command line and ipythonrc
959 parameter). Patch contributed by Arnd Baecker
965 parameter). Patch contributed by Arnd Baecker
960 <arnd.baecker-AT-web.de>.
966 <arnd.baecker-AT-web.de>.
961
967
962 * IPython/iplib.py (embed_mainloop): fix tab-completion in
968 * IPython/iplib.py (embed_mainloop): fix tab-completion in
963 embedded instances, for variables defined at the interactive
969 embedded instances, for variables defined at the interactive
964 prompt of the embedded ipython. Reported by Arnd.
970 prompt of the embedded ipython. Reported by Arnd.
965
971
966 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
972 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
967 it can be used as a (stateful) toggle, or with a direct parameter.
973 it can be used as a (stateful) toggle, or with a direct parameter.
968
974
969 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
975 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
970 could be triggered in certain cases and cause the traceback
976 could be triggered in certain cases and cause the traceback
971 printer not to work.
977 printer not to work.
972
978
973 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
979 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
974
980
975 * IPython/iplib.py (_should_recompile): Small fix, closes
981 * IPython/iplib.py (_should_recompile): Small fix, closes
976 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
982 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
977
983
978 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
984 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
979
985
980 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
986 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
981 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
987 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
982 Moad for help with tracking it down.
988 Moad for help with tracking it down.
983
989
984 * IPython/iplib.py (handle_auto): fix autocall handling for
990 * IPython/iplib.py (handle_auto): fix autocall handling for
985 objects which support BOTH __getitem__ and __call__ (so that f [x]
991 objects which support BOTH __getitem__ and __call__ (so that f [x]
986 is left alone, instead of becoming f([x]) automatically).
992 is left alone, instead of becoming f([x]) automatically).
987
993
988 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
994 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
989 Ville's patch.
995 Ville's patch.
990
996
991 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
997 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
992
998
993 * IPython/iplib.py (handle_auto): changed autocall semantics to
999 * IPython/iplib.py (handle_auto): changed autocall semantics to
994 include 'smart' mode, where the autocall transformation is NOT
1000 include 'smart' mode, where the autocall transformation is NOT
995 applied if there are no arguments on the line. This allows you to
1001 applied if there are no arguments on the line. This allows you to
996 just type 'foo' if foo is a callable to see its internal form,
1002 just type 'foo' if foo is a callable to see its internal form,
997 instead of having it called with no arguments (typically a
1003 instead of having it called with no arguments (typically a
998 mistake). The old 'full' autocall still exists: for that, you
1004 mistake). The old 'full' autocall still exists: for that, you
999 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1005 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1000
1006
1001 * IPython/completer.py (Completer.attr_matches): add
1007 * IPython/completer.py (Completer.attr_matches): add
1002 tab-completion support for Enthoughts' traits. After a report by
1008 tab-completion support for Enthoughts' traits. After a report by
1003 Arnd and a patch by Prabhu.
1009 Arnd and a patch by Prabhu.
1004
1010
1005 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1011 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1006
1012
1007 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1013 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1008 Schmolck's patch to fix inspect.getinnerframes().
1014 Schmolck's patch to fix inspect.getinnerframes().
1009
1015
1010 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1016 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1011 for embedded instances, regarding handling of namespaces and items
1017 for embedded instances, regarding handling of namespaces and items
1012 added to the __builtin__ one. Multiple embedded instances and
1018 added to the __builtin__ one. Multiple embedded instances and
1013 recursive embeddings should work better now (though I'm not sure
1019 recursive embeddings should work better now (though I'm not sure
1014 I've got all the corner cases fixed, that code is a bit of a brain
1020 I've got all the corner cases fixed, that code is a bit of a brain
1015 twister).
1021 twister).
1016
1022
1017 * IPython/Magic.py (magic_edit): added support to edit in-memory
1023 * IPython/Magic.py (magic_edit): added support to edit in-memory
1018 macros (automatically creates the necessary temp files). %edit
1024 macros (automatically creates the necessary temp files). %edit
1019 also doesn't return the file contents anymore, it's just noise.
1025 also doesn't return the file contents anymore, it's just noise.
1020
1026
1021 * IPython/completer.py (Completer.attr_matches): revert change to
1027 * IPython/completer.py (Completer.attr_matches): revert change to
1022 complete only on attributes listed in __all__. I realized it
1028 complete only on attributes listed in __all__. I realized it
1023 cripples the tab-completion system as a tool for exploring the
1029 cripples the tab-completion system as a tool for exploring the
1024 internals of unknown libraries (it renders any non-__all__
1030 internals of unknown libraries (it renders any non-__all__
1025 attribute off-limits). I got bit by this when trying to see
1031 attribute off-limits). I got bit by this when trying to see
1026 something inside the dis module.
1032 something inside the dis module.
1027
1033
1028 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1034 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1029
1035
1030 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1036 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1031 namespace for users and extension writers to hold data in. This
1037 namespace for users and extension writers to hold data in. This
1032 follows the discussion in
1038 follows the discussion in
1033 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1039 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1034
1040
1035 * IPython/completer.py (IPCompleter.complete): small patch to help
1041 * IPython/completer.py (IPCompleter.complete): small patch to help
1036 tab-completion under Emacs, after a suggestion by John Barnard
1042 tab-completion under Emacs, after a suggestion by John Barnard
1037 <barnarj-AT-ccf.org>.
1043 <barnarj-AT-ccf.org>.
1038
1044
1039 * IPython/Magic.py (Magic.extract_input_slices): added support for
1045 * IPython/Magic.py (Magic.extract_input_slices): added support for
1040 the slice notation in magics to use N-M to represent numbers N...M
1046 the slice notation in magics to use N-M to represent numbers N...M
1041 (closed endpoints). This is used by %macro and %save.
1047 (closed endpoints). This is used by %macro and %save.
1042
1048
1043 * IPython/completer.py (Completer.attr_matches): for modules which
1049 * IPython/completer.py (Completer.attr_matches): for modules which
1044 define __all__, complete only on those. After a patch by Jeffrey
1050 define __all__, complete only on those. After a patch by Jeffrey
1045 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1051 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1046 speed up this routine.
1052 speed up this routine.
1047
1053
1048 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1054 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1049 don't know if this is the end of it, but the behavior now is
1055 don't know if this is the end of it, but the behavior now is
1050 certainly much more correct. Note that coupled with macros,
1056 certainly much more correct. Note that coupled with macros,
1051 slightly surprising (at first) behavior may occur: a macro will in
1057 slightly surprising (at first) behavior may occur: a macro will in
1052 general expand to multiple lines of input, so upon exiting, the
1058 general expand to multiple lines of input, so upon exiting, the
1053 in/out counters will both be bumped by the corresponding amount
1059 in/out counters will both be bumped by the corresponding amount
1054 (as if the macro's contents had been typed interactively). Typing
1060 (as if the macro's contents had been typed interactively). Typing
1055 %hist will reveal the intermediate (silently processed) lines.
1061 %hist will reveal the intermediate (silently processed) lines.
1056
1062
1057 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1063 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1058 pickle to fail (%run was overwriting __main__ and not restoring
1064 pickle to fail (%run was overwriting __main__ and not restoring
1059 it, but pickle relies on __main__ to operate).
1065 it, but pickle relies on __main__ to operate).
1060
1066
1061 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1067 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1062 using properties, but forgot to make the main InteractiveShell
1068 using properties, but forgot to make the main InteractiveShell
1063 class a new-style class. Properties fail silently, and
1069 class a new-style class. Properties fail silently, and
1064 mysteriously, with old-style class (getters work, but
1070 mysteriously, with old-style class (getters work, but
1065 setters don't do anything).
1071 setters don't do anything).
1066
1072
1067 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1073 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1068
1074
1069 * IPython/Magic.py (magic_history): fix history reporting bug (I
1075 * IPython/Magic.py (magic_history): fix history reporting bug (I
1070 know some nasties are still there, I just can't seem to find a
1076 know some nasties are still there, I just can't seem to find a
1071 reproducible test case to track them down; the input history is
1077 reproducible test case to track them down; the input history is
1072 falling out of sync...)
1078 falling out of sync...)
1073
1079
1074 * IPython/iplib.py (handle_shell_escape): fix bug where both
1080 * IPython/iplib.py (handle_shell_escape): fix bug where both
1075 aliases and system accesses where broken for indented code (such
1081 aliases and system accesses where broken for indented code (such
1076 as loops).
1082 as loops).
1077
1083
1078 * IPython/genutils.py (shell): fix small but critical bug for
1084 * IPython/genutils.py (shell): fix small but critical bug for
1079 win32 system access.
1085 win32 system access.
1080
1086
1081 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1087 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1082
1088
1083 * IPython/iplib.py (showtraceback): remove use of the
1089 * IPython/iplib.py (showtraceback): remove use of the
1084 sys.last_{type/value/traceback} structures, which are non
1090 sys.last_{type/value/traceback} structures, which are non
1085 thread-safe.
1091 thread-safe.
1086 (_prefilter): change control flow to ensure that we NEVER
1092 (_prefilter): change control flow to ensure that we NEVER
1087 introspect objects when autocall is off. This will guarantee that
1093 introspect objects when autocall is off. This will guarantee that
1088 having an input line of the form 'x.y', where access to attribute
1094 having an input line of the form 'x.y', where access to attribute
1089 'y' has side effects, doesn't trigger the side effect TWICE. It
1095 'y' has side effects, doesn't trigger the side effect TWICE. It
1090 is important to note that, with autocall on, these side effects
1096 is important to note that, with autocall on, these side effects
1091 can still happen.
1097 can still happen.
1092 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1098 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1093 trio. IPython offers these three kinds of special calls which are
1099 trio. IPython offers these three kinds of special calls which are
1094 not python code, and it's a good thing to have their call method
1100 not python code, and it's a good thing to have their call method
1095 be accessible as pure python functions (not just special syntax at
1101 be accessible as pure python functions (not just special syntax at
1096 the command line). It gives us a better internal implementation
1102 the command line). It gives us a better internal implementation
1097 structure, as well as exposing these for user scripting more
1103 structure, as well as exposing these for user scripting more
1098 cleanly.
1104 cleanly.
1099
1105
1100 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1106 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1101 file. Now that they'll be more likely to be used with the
1107 file. Now that they'll be more likely to be used with the
1102 persistance system (%store), I want to make sure their module path
1108 persistance system (%store), I want to make sure their module path
1103 doesn't change in the future, so that we don't break things for
1109 doesn't change in the future, so that we don't break things for
1104 users' persisted data.
1110 users' persisted data.
1105
1111
1106 * IPython/iplib.py (autoindent_update): move indentation
1112 * IPython/iplib.py (autoindent_update): move indentation
1107 management into the _text_ processing loop, not the keyboard
1113 management into the _text_ processing loop, not the keyboard
1108 interactive one. This is necessary to correctly process non-typed
1114 interactive one. This is necessary to correctly process non-typed
1109 multiline input (such as macros).
1115 multiline input (such as macros).
1110
1116
1111 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1117 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1112 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1118 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1113 which was producing problems in the resulting manual.
1119 which was producing problems in the resulting manual.
1114 (magic_whos): improve reporting of instances (show their class,
1120 (magic_whos): improve reporting of instances (show their class,
1115 instead of simply printing 'instance' which isn't terribly
1121 instead of simply printing 'instance' which isn't terribly
1116 informative).
1122 informative).
1117
1123
1118 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1124 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1119 (minor mods) to support network shares under win32.
1125 (minor mods) to support network shares under win32.
1120
1126
1121 * IPython/winconsole.py (get_console_size): add new winconsole
1127 * IPython/winconsole.py (get_console_size): add new winconsole
1122 module and fixes to page_dumb() to improve its behavior under
1128 module and fixes to page_dumb() to improve its behavior under
1123 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1129 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1124
1130
1125 * IPython/Magic.py (Macro): simplified Macro class to just
1131 * IPython/Magic.py (Macro): simplified Macro class to just
1126 subclass list. We've had only 2.2 compatibility for a very long
1132 subclass list. We've had only 2.2 compatibility for a very long
1127 time, yet I was still avoiding subclassing the builtin types. No
1133 time, yet I was still avoiding subclassing the builtin types. No
1128 more (I'm also starting to use properties, though I won't shift to
1134 more (I'm also starting to use properties, though I won't shift to
1129 2.3-specific features quite yet).
1135 2.3-specific features quite yet).
1130 (magic_store): added Ville's patch for lightweight variable
1136 (magic_store): added Ville's patch for lightweight variable
1131 persistence, after a request on the user list by Matt Wilkie
1137 persistence, after a request on the user list by Matt Wilkie
1132 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1138 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1133 details.
1139 details.
1134
1140
1135 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1141 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1136 changed the default logfile name from 'ipython.log' to
1142 changed the default logfile name from 'ipython.log' to
1137 'ipython_log.py'. These logs are real python files, and now that
1143 'ipython_log.py'. These logs are real python files, and now that
1138 we have much better multiline support, people are more likely to
1144 we have much better multiline support, people are more likely to
1139 want to use them as such. Might as well name them correctly.
1145 want to use them as such. Might as well name them correctly.
1140
1146
1141 * IPython/Magic.py: substantial cleanup. While we can't stop
1147 * IPython/Magic.py: substantial cleanup. While we can't stop
1142 using magics as mixins, due to the existing customizations 'out
1148 using magics as mixins, due to the existing customizations 'out
1143 there' which rely on the mixin naming conventions, at least I
1149 there' which rely on the mixin naming conventions, at least I
1144 cleaned out all cross-class name usage. So once we are OK with
1150 cleaned out all cross-class name usage. So once we are OK with
1145 breaking compatibility, the two systems can be separated.
1151 breaking compatibility, the two systems can be separated.
1146
1152
1147 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1153 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1148 anymore, and the class is a fair bit less hideous as well. New
1154 anymore, and the class is a fair bit less hideous as well. New
1149 features were also introduced: timestamping of input, and logging
1155 features were also introduced: timestamping of input, and logging
1150 of output results. These are user-visible with the -t and -o
1156 of output results. These are user-visible with the -t and -o
1151 options to %logstart. Closes
1157 options to %logstart. Closes
1152 http://www.scipy.net/roundup/ipython/issue11 and a request by
1158 http://www.scipy.net/roundup/ipython/issue11 and a request by
1153 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1159 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1154
1160
1155 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1161 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1156
1162
1157 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1163 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1158 better handle backslashes in paths. See the thread 'More Windows
1164 better handle backslashes in paths. See the thread 'More Windows
1159 questions part 2 - \/ characters revisited' on the iypthon user
1165 questions part 2 - \/ characters revisited' on the iypthon user
1160 list:
1166 list:
1161 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1167 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1162
1168
1163 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1169 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1164
1170
1165 (InteractiveShell.__init__): change threaded shells to not use the
1171 (InteractiveShell.__init__): change threaded shells to not use the
1166 ipython crash handler. This was causing more problems than not,
1172 ipython crash handler. This was causing more problems than not,
1167 as exceptions in the main thread (GUI code, typically) would
1173 as exceptions in the main thread (GUI code, typically) would
1168 always show up as a 'crash', when they really weren't.
1174 always show up as a 'crash', when they really weren't.
1169
1175
1170 The colors and exception mode commands (%colors/%xmode) have been
1176 The colors and exception mode commands (%colors/%xmode) have been
1171 synchronized to also take this into account, so users can get
1177 synchronized to also take this into account, so users can get
1172 verbose exceptions for their threaded code as well. I also added
1178 verbose exceptions for their threaded code as well. I also added
1173 support for activating pdb inside this exception handler as well,
1179 support for activating pdb inside this exception handler as well,
1174 so now GUI authors can use IPython's enhanced pdb at runtime.
1180 so now GUI authors can use IPython's enhanced pdb at runtime.
1175
1181
1176 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1182 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1177 true by default, and add it to the shipped ipythonrc file. Since
1183 true by default, and add it to the shipped ipythonrc file. Since
1178 this asks the user before proceeding, I think it's OK to make it
1184 this asks the user before proceeding, I think it's OK to make it
1179 true by default.
1185 true by default.
1180
1186
1181 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1187 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1182 of the previous special-casing of input in the eval loop. I think
1188 of the previous special-casing of input in the eval loop. I think
1183 this is cleaner, as they really are commands and shouldn't have
1189 this is cleaner, as they really are commands and shouldn't have
1184 a special role in the middle of the core code.
1190 a special role in the middle of the core code.
1185
1191
1186 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1192 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1187
1193
1188 * IPython/iplib.py (edit_syntax_error): added support for
1194 * IPython/iplib.py (edit_syntax_error): added support for
1189 automatically reopening the editor if the file had a syntax error
1195 automatically reopening the editor if the file had a syntax error
1190 in it. Thanks to scottt who provided the patch at:
1196 in it. Thanks to scottt who provided the patch at:
1191 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1197 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1192 version committed).
1198 version committed).
1193
1199
1194 * IPython/iplib.py (handle_normal): add suport for multi-line
1200 * IPython/iplib.py (handle_normal): add suport for multi-line
1195 input with emtpy lines. This fixes
1201 input with emtpy lines. This fixes
1196 http://www.scipy.net/roundup/ipython/issue43 and a similar
1202 http://www.scipy.net/roundup/ipython/issue43 and a similar
1197 discussion on the user list.
1203 discussion on the user list.
1198
1204
1199 WARNING: a behavior change is necessarily introduced to support
1205 WARNING: a behavior change is necessarily introduced to support
1200 blank lines: now a single blank line with whitespace does NOT
1206 blank lines: now a single blank line with whitespace does NOT
1201 break the input loop, which means that when autoindent is on, by
1207 break the input loop, which means that when autoindent is on, by
1202 default hitting return on the next (indented) line does NOT exit.
1208 default hitting return on the next (indented) line does NOT exit.
1203
1209
1204 Instead, to exit a multiline input you can either have:
1210 Instead, to exit a multiline input you can either have:
1205
1211
1206 - TWO whitespace lines (just hit return again), or
1212 - TWO whitespace lines (just hit return again), or
1207 - a single whitespace line of a different length than provided
1213 - a single whitespace line of a different length than provided
1208 by the autoindent (add or remove a space).
1214 by the autoindent (add or remove a space).
1209
1215
1210 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1216 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1211 module to better organize all readline-related functionality.
1217 module to better organize all readline-related functionality.
1212 I've deleted FlexCompleter and put all completion clases here.
1218 I've deleted FlexCompleter and put all completion clases here.
1213
1219
1214 * IPython/iplib.py (raw_input): improve indentation management.
1220 * IPython/iplib.py (raw_input): improve indentation management.
1215 It is now possible to paste indented code with autoindent on, and
1221 It is now possible to paste indented code with autoindent on, and
1216 the code is interpreted correctly (though it still looks bad on
1222 the code is interpreted correctly (though it still looks bad on
1217 screen, due to the line-oriented nature of ipython).
1223 screen, due to the line-oriented nature of ipython).
1218 (MagicCompleter.complete): change behavior so that a TAB key on an
1224 (MagicCompleter.complete): change behavior so that a TAB key on an
1219 otherwise empty line actually inserts a tab, instead of completing
1225 otherwise empty line actually inserts a tab, instead of completing
1220 on the entire global namespace. This makes it easier to use the
1226 on the entire global namespace. This makes it easier to use the
1221 TAB key for indentation. After a request by Hans Meine
1227 TAB key for indentation. After a request by Hans Meine
1222 <hans_meine-AT-gmx.net>
1228 <hans_meine-AT-gmx.net>
1223 (_prefilter): add support so that typing plain 'exit' or 'quit'
1229 (_prefilter): add support so that typing plain 'exit' or 'quit'
1224 does a sensible thing. Originally I tried to deviate as little as
1230 does a sensible thing. Originally I tried to deviate as little as
1225 possible from the default python behavior, but even that one may
1231 possible from the default python behavior, but even that one may
1226 change in this direction (thread on python-dev to that effect).
1232 change in this direction (thread on python-dev to that effect).
1227 Regardless, ipython should do the right thing even if CPython's
1233 Regardless, ipython should do the right thing even if CPython's
1228 '>>>' prompt doesn't.
1234 '>>>' prompt doesn't.
1229 (InteractiveShell): removed subclassing code.InteractiveConsole
1235 (InteractiveShell): removed subclassing code.InteractiveConsole
1230 class. By now we'd overridden just about all of its methods: I've
1236 class. By now we'd overridden just about all of its methods: I've
1231 copied the remaining two over, and now ipython is a standalone
1237 copied the remaining two over, and now ipython is a standalone
1232 class. This will provide a clearer picture for the chainsaw
1238 class. This will provide a clearer picture for the chainsaw
1233 branch refactoring.
1239 branch refactoring.
1234
1240
1235 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1241 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1236
1242
1237 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1243 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1238 failures for objects which break when dir() is called on them.
1244 failures for objects which break when dir() is called on them.
1239
1245
1240 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1246 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1241 distinct local and global namespaces in the completer API. This
1247 distinct local and global namespaces in the completer API. This
1242 change allows us to properly handle completion with distinct
1248 change allows us to properly handle completion with distinct
1243 scopes, including in embedded instances (this had never really
1249 scopes, including in embedded instances (this had never really
1244 worked correctly).
1250 worked correctly).
1245
1251
1246 Note: this introduces a change in the constructor for
1252 Note: this introduces a change in the constructor for
1247 MagicCompleter, as a new global_namespace parameter is now the
1253 MagicCompleter, as a new global_namespace parameter is now the
1248 second argument (the others were bumped one position).
1254 second argument (the others were bumped one position).
1249
1255
1250 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1256 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1251
1257
1252 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1258 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1253 embedded instances (which can be done now thanks to Vivian's
1259 embedded instances (which can be done now thanks to Vivian's
1254 frame-handling fixes for pdb).
1260 frame-handling fixes for pdb).
1255 (InteractiveShell.__init__): Fix namespace handling problem in
1261 (InteractiveShell.__init__): Fix namespace handling problem in
1256 embedded instances. We were overwriting __main__ unconditionally,
1262 embedded instances. We were overwriting __main__ unconditionally,
1257 and this should only be done for 'full' (non-embedded) IPython;
1263 and this should only be done for 'full' (non-embedded) IPython;
1258 embedded instances must respect the caller's __main__. Thanks to
1264 embedded instances must respect the caller's __main__. Thanks to
1259 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1265 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1260
1266
1261 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1267 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1262
1268
1263 * setup.py: added download_url to setup(). This registers the
1269 * setup.py: added download_url to setup(). This registers the
1264 download address at PyPI, which is not only useful to humans
1270 download address at PyPI, which is not only useful to humans
1265 browsing the site, but is also picked up by setuptools (the Eggs
1271 browsing the site, but is also picked up by setuptools (the Eggs
1266 machinery). Thanks to Ville and R. Kern for the info/discussion
1272 machinery). Thanks to Ville and R. Kern for the info/discussion
1267 on this.
1273 on this.
1268
1274
1269 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1275 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1270
1276
1271 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1277 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1272 This brings a lot of nice functionality to the pdb mode, which now
1278 This brings a lot of nice functionality to the pdb mode, which now
1273 has tab-completion, syntax highlighting, and better stack handling
1279 has tab-completion, syntax highlighting, and better stack handling
1274 than before. Many thanks to Vivian De Smedt
1280 than before. Many thanks to Vivian De Smedt
1275 <vivian-AT-vdesmedt.com> for the original patches.
1281 <vivian-AT-vdesmedt.com> for the original patches.
1276
1282
1277 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1283 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1278
1284
1279 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1285 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1280 sequence to consistently accept the banner argument. The
1286 sequence to consistently accept the banner argument. The
1281 inconsistency was tripping SAGE, thanks to Gary Zablackis
1287 inconsistency was tripping SAGE, thanks to Gary Zablackis
1282 <gzabl-AT-yahoo.com> for the report.
1288 <gzabl-AT-yahoo.com> for the report.
1283
1289
1284 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1290 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1285
1291
1286 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1292 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1287 Fix bug where a naked 'alias' call in the ipythonrc file would
1293 Fix bug where a naked 'alias' call in the ipythonrc file would
1288 cause a crash. Bug reported by Jorgen Stenarson.
1294 cause a crash. Bug reported by Jorgen Stenarson.
1289
1295
1290 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1296 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1291
1297
1292 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1298 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1293 startup time.
1299 startup time.
1294
1300
1295 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1301 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1296 instances had introduced a bug with globals in normal code. Now
1302 instances had introduced a bug with globals in normal code. Now
1297 it's working in all cases.
1303 it's working in all cases.
1298
1304
1299 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1305 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1300 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1306 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1301 has been introduced to set the default case sensitivity of the
1307 has been introduced to set the default case sensitivity of the
1302 searches. Users can still select either mode at runtime on a
1308 searches. Users can still select either mode at runtime on a
1303 per-search basis.
1309 per-search basis.
1304
1310
1305 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1311 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1306
1312
1307 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1313 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1308 attributes in wildcard searches for subclasses. Modified version
1314 attributes in wildcard searches for subclasses. Modified version
1309 of a patch by Jorgen.
1315 of a patch by Jorgen.
1310
1316
1311 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1317 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1312
1318
1313 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1319 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1314 embedded instances. I added a user_global_ns attribute to the
1320 embedded instances. I added a user_global_ns attribute to the
1315 InteractiveShell class to handle this.
1321 InteractiveShell class to handle this.
1316
1322
1317 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1323 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1318
1324
1319 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1325 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1320 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1326 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1321 (reported under win32, but may happen also in other platforms).
1327 (reported under win32, but may happen also in other platforms).
1322 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1328 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1323
1329
1324 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1330 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1325
1331
1326 * IPython/Magic.py (magic_psearch): new support for wildcard
1332 * IPython/Magic.py (magic_psearch): new support for wildcard
1327 patterns. Now, typing ?a*b will list all names which begin with a
1333 patterns. Now, typing ?a*b will list all names which begin with a
1328 and end in b, for example. The %psearch magic has full
1334 and end in b, for example. The %psearch magic has full
1329 docstrings. Many thanks to JΓΆrgen Stenarson
1335 docstrings. Many thanks to JΓΆrgen Stenarson
1330 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1336 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1331 implementing this functionality.
1337 implementing this functionality.
1332
1338
1333 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1339 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1334
1340
1335 * Manual: fixed long-standing annoyance of double-dashes (as in
1341 * Manual: fixed long-standing annoyance of double-dashes (as in
1336 --prefix=~, for example) being stripped in the HTML version. This
1342 --prefix=~, for example) being stripped in the HTML version. This
1337 is a latex2html bug, but a workaround was provided. Many thanks
1343 is a latex2html bug, but a workaround was provided. Many thanks
1338 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1344 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1339 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1345 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1340 rolling. This seemingly small issue had tripped a number of users
1346 rolling. This seemingly small issue had tripped a number of users
1341 when first installing, so I'm glad to see it gone.
1347 when first installing, so I'm glad to see it gone.
1342
1348
1343 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1349 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1344
1350
1345 * IPython/Extensions/numeric_formats.py: fix missing import,
1351 * IPython/Extensions/numeric_formats.py: fix missing import,
1346 reported by Stephen Walton.
1352 reported by Stephen Walton.
1347
1353
1348 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1354 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1349
1355
1350 * IPython/demo.py: finish demo module, fully documented now.
1356 * IPython/demo.py: finish demo module, fully documented now.
1351
1357
1352 * IPython/genutils.py (file_read): simple little utility to read a
1358 * IPython/genutils.py (file_read): simple little utility to read a
1353 file and ensure it's closed afterwards.
1359 file and ensure it's closed afterwards.
1354
1360
1355 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1361 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1356
1362
1357 * IPython/demo.py (Demo.__init__): added support for individually
1363 * IPython/demo.py (Demo.__init__): added support for individually
1358 tagging blocks for automatic execution.
1364 tagging blocks for automatic execution.
1359
1365
1360 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1366 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1361 syntax-highlighted python sources, requested by John.
1367 syntax-highlighted python sources, requested by John.
1362
1368
1363 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1369 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1364
1370
1365 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1371 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1366 finishing.
1372 finishing.
1367
1373
1368 * IPython/genutils.py (shlex_split): moved from Magic to here,
1374 * IPython/genutils.py (shlex_split): moved from Magic to here,
1369 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1375 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1370
1376
1371 * IPython/demo.py (Demo.__init__): added support for silent
1377 * IPython/demo.py (Demo.__init__): added support for silent
1372 blocks, improved marks as regexps, docstrings written.
1378 blocks, improved marks as regexps, docstrings written.
1373 (Demo.__init__): better docstring, added support for sys.argv.
1379 (Demo.__init__): better docstring, added support for sys.argv.
1374
1380
1375 * IPython/genutils.py (marquee): little utility used by the demo
1381 * IPython/genutils.py (marquee): little utility used by the demo
1376 code, handy in general.
1382 code, handy in general.
1377
1383
1378 * IPython/demo.py (Demo.__init__): new class for interactive
1384 * IPython/demo.py (Demo.__init__): new class for interactive
1379 demos. Not documented yet, I just wrote it in a hurry for
1385 demos. Not documented yet, I just wrote it in a hurry for
1380 scipy'05. Will docstring later.
1386 scipy'05. Will docstring later.
1381
1387
1382 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1388 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1383
1389
1384 * IPython/Shell.py (sigint_handler): Drastic simplification which
1390 * IPython/Shell.py (sigint_handler): Drastic simplification which
1385 also seems to make Ctrl-C work correctly across threads! This is
1391 also seems to make Ctrl-C work correctly across threads! This is
1386 so simple, that I can't beleive I'd missed it before. Needs more
1392 so simple, that I can't beleive I'd missed it before. Needs more
1387 testing, though.
1393 testing, though.
1388 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1394 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1389 like this before...
1395 like this before...
1390
1396
1391 * IPython/genutils.py (get_home_dir): add protection against
1397 * IPython/genutils.py (get_home_dir): add protection against
1392 non-dirs in win32 registry.
1398 non-dirs in win32 registry.
1393
1399
1394 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1400 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1395 bug where dict was mutated while iterating (pysh crash).
1401 bug where dict was mutated while iterating (pysh crash).
1396
1402
1397 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1403 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1398
1404
1399 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1405 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1400 spurious newlines added by this routine. After a report by
1406 spurious newlines added by this routine. After a report by
1401 F. Mantegazza.
1407 F. Mantegazza.
1402
1408
1403 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1409 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1404
1410
1405 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1411 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1406 calls. These were a leftover from the GTK 1.x days, and can cause
1412 calls. These were a leftover from the GTK 1.x days, and can cause
1407 problems in certain cases (after a report by John Hunter).
1413 problems in certain cases (after a report by John Hunter).
1408
1414
1409 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1415 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1410 os.getcwd() fails at init time. Thanks to patch from David Remahl
1416 os.getcwd() fails at init time. Thanks to patch from David Remahl
1411 <chmod007-AT-mac.com>.
1417 <chmod007-AT-mac.com>.
1412 (InteractiveShell.__init__): prevent certain special magics from
1418 (InteractiveShell.__init__): prevent certain special magics from
1413 being shadowed by aliases. Closes
1419 being shadowed by aliases. Closes
1414 http://www.scipy.net/roundup/ipython/issue41.
1420 http://www.scipy.net/roundup/ipython/issue41.
1415
1421
1416 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1422 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1417
1423
1418 * IPython/iplib.py (InteractiveShell.complete): Added new
1424 * IPython/iplib.py (InteractiveShell.complete): Added new
1419 top-level completion method to expose the completion mechanism
1425 top-level completion method to expose the completion mechanism
1420 beyond readline-based environments.
1426 beyond readline-based environments.
1421
1427
1422 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1428 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1423
1429
1424 * tools/ipsvnc (svnversion): fix svnversion capture.
1430 * tools/ipsvnc (svnversion): fix svnversion capture.
1425
1431
1426 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1432 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1427 attribute to self, which was missing. Before, it was set by a
1433 attribute to self, which was missing. Before, it was set by a
1428 routine which in certain cases wasn't being called, so the
1434 routine which in certain cases wasn't being called, so the
1429 instance could end up missing the attribute. This caused a crash.
1435 instance could end up missing the attribute. This caused a crash.
1430 Closes http://www.scipy.net/roundup/ipython/issue40.
1436 Closes http://www.scipy.net/roundup/ipython/issue40.
1431
1437
1432 2005-08-16 Fernando Perez <fperez@colorado.edu>
1438 2005-08-16 Fernando Perez <fperez@colorado.edu>
1433
1439
1434 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1440 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1435 contains non-string attribute. Closes
1441 contains non-string attribute. Closes
1436 http://www.scipy.net/roundup/ipython/issue38.
1442 http://www.scipy.net/roundup/ipython/issue38.
1437
1443
1438 2005-08-14 Fernando Perez <fperez@colorado.edu>
1444 2005-08-14 Fernando Perez <fperez@colorado.edu>
1439
1445
1440 * tools/ipsvnc: Minor improvements, to add changeset info.
1446 * tools/ipsvnc: Minor improvements, to add changeset info.
1441
1447
1442 2005-08-12 Fernando Perez <fperez@colorado.edu>
1448 2005-08-12 Fernando Perez <fperez@colorado.edu>
1443
1449
1444 * IPython/iplib.py (runsource): remove self.code_to_run_src
1450 * IPython/iplib.py (runsource): remove self.code_to_run_src
1445 attribute. I realized this is nothing more than
1451 attribute. I realized this is nothing more than
1446 '\n'.join(self.buffer), and having the same data in two different
1452 '\n'.join(self.buffer), and having the same data in two different
1447 places is just asking for synchronization bugs. This may impact
1453 places is just asking for synchronization bugs. This may impact
1448 people who have custom exception handlers, so I need to warn
1454 people who have custom exception handlers, so I need to warn
1449 ipython-dev about it (F. Mantegazza may use them).
1455 ipython-dev about it (F. Mantegazza may use them).
1450
1456
1451 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1457 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1452
1458
1453 * IPython/genutils.py: fix 2.2 compatibility (generators)
1459 * IPython/genutils.py: fix 2.2 compatibility (generators)
1454
1460
1455 2005-07-18 Fernando Perez <fperez@colorado.edu>
1461 2005-07-18 Fernando Perez <fperez@colorado.edu>
1456
1462
1457 * IPython/genutils.py (get_home_dir): fix to help users with
1463 * IPython/genutils.py (get_home_dir): fix to help users with
1458 invalid $HOME under win32.
1464 invalid $HOME under win32.
1459
1465
1460 2005-07-17 Fernando Perez <fperez@colorado.edu>
1466 2005-07-17 Fernando Perez <fperez@colorado.edu>
1461
1467
1462 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1468 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1463 some old hacks and clean up a bit other routines; code should be
1469 some old hacks and clean up a bit other routines; code should be
1464 simpler and a bit faster.
1470 simpler and a bit faster.
1465
1471
1466 * IPython/iplib.py (interact): removed some last-resort attempts
1472 * IPython/iplib.py (interact): removed some last-resort attempts
1467 to survive broken stdout/stderr. That code was only making it
1473 to survive broken stdout/stderr. That code was only making it
1468 harder to abstract out the i/o (necessary for gui integration),
1474 harder to abstract out the i/o (necessary for gui integration),
1469 and the crashes it could prevent were extremely rare in practice
1475 and the crashes it could prevent were extremely rare in practice
1470 (besides being fully user-induced in a pretty violent manner).
1476 (besides being fully user-induced in a pretty violent manner).
1471
1477
1472 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1478 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1473 Nothing major yet, but the code is simpler to read; this should
1479 Nothing major yet, but the code is simpler to read; this should
1474 make it easier to do more serious modifications in the future.
1480 make it easier to do more serious modifications in the future.
1475
1481
1476 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1482 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1477 which broke in .15 (thanks to a report by Ville).
1483 which broke in .15 (thanks to a report by Ville).
1478
1484
1479 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1485 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1480 be quite correct, I know next to nothing about unicode). This
1486 be quite correct, I know next to nothing about unicode). This
1481 will allow unicode strings to be used in prompts, amongst other
1487 will allow unicode strings to be used in prompts, amongst other
1482 cases. It also will prevent ipython from crashing when unicode
1488 cases. It also will prevent ipython from crashing when unicode
1483 shows up unexpectedly in many places. If ascii encoding fails, we
1489 shows up unexpectedly in many places. If ascii encoding fails, we
1484 assume utf_8. Currently the encoding is not a user-visible
1490 assume utf_8. Currently the encoding is not a user-visible
1485 setting, though it could be made so if there is demand for it.
1491 setting, though it could be made so if there is demand for it.
1486
1492
1487 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1493 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1488
1494
1489 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1495 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1490
1496
1491 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1497 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1492
1498
1493 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1499 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1494 code can work transparently for 2.2/2.3.
1500 code can work transparently for 2.2/2.3.
1495
1501
1496 2005-07-16 Fernando Perez <fperez@colorado.edu>
1502 2005-07-16 Fernando Perez <fperez@colorado.edu>
1497
1503
1498 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1504 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1499 out of the color scheme table used for coloring exception
1505 out of the color scheme table used for coloring exception
1500 tracebacks. This allows user code to add new schemes at runtime.
1506 tracebacks. This allows user code to add new schemes at runtime.
1501 This is a minimally modified version of the patch at
1507 This is a minimally modified version of the patch at
1502 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1508 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1503 for the contribution.
1509 for the contribution.
1504
1510
1505 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1511 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1506 slightly modified version of the patch in
1512 slightly modified version of the patch in
1507 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1513 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1508 to remove the previous try/except solution (which was costlier).
1514 to remove the previous try/except solution (which was costlier).
1509 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1515 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1510
1516
1511 2005-06-08 Fernando Perez <fperez@colorado.edu>
1517 2005-06-08 Fernando Perez <fperez@colorado.edu>
1512
1518
1513 * IPython/iplib.py (write/write_err): Add methods to abstract all
1519 * IPython/iplib.py (write/write_err): Add methods to abstract all
1514 I/O a bit more.
1520 I/O a bit more.
1515
1521
1516 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1522 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1517 warning, reported by Aric Hagberg, fix by JD Hunter.
1523 warning, reported by Aric Hagberg, fix by JD Hunter.
1518
1524
1519 2005-06-02 *** Released version 0.6.15
1525 2005-06-02 *** Released version 0.6.15
1520
1526
1521 2005-06-01 Fernando Perez <fperez@colorado.edu>
1527 2005-06-01 Fernando Perez <fperez@colorado.edu>
1522
1528
1523 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1529 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1524 tab-completion of filenames within open-quoted strings. Note that
1530 tab-completion of filenames within open-quoted strings. Note that
1525 this requires that in ~/.ipython/ipythonrc, users change the
1531 this requires that in ~/.ipython/ipythonrc, users change the
1526 readline delimiters configuration to read:
1532 readline delimiters configuration to read:
1527
1533
1528 readline_remove_delims -/~
1534 readline_remove_delims -/~
1529
1535
1530
1536
1531 2005-05-31 *** Released version 0.6.14
1537 2005-05-31 *** Released version 0.6.14
1532
1538
1533 2005-05-29 Fernando Perez <fperez@colorado.edu>
1539 2005-05-29 Fernando Perez <fperez@colorado.edu>
1534
1540
1535 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1541 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1536 with files not on the filesystem. Reported by Eliyahu Sandler
1542 with files not on the filesystem. Reported by Eliyahu Sandler
1537 <eli@gondolin.net>
1543 <eli@gondolin.net>
1538
1544
1539 2005-05-22 Fernando Perez <fperez@colorado.edu>
1545 2005-05-22 Fernando Perez <fperez@colorado.edu>
1540
1546
1541 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1547 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1542 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1548 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1543
1549
1544 2005-05-19 Fernando Perez <fperez@colorado.edu>
1550 2005-05-19 Fernando Perez <fperez@colorado.edu>
1545
1551
1546 * IPython/iplib.py (safe_execfile): close a file which could be
1552 * IPython/iplib.py (safe_execfile): close a file which could be
1547 left open (causing problems in win32, which locks open files).
1553 left open (causing problems in win32, which locks open files).
1548 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1554 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1549
1555
1550 2005-05-18 Fernando Perez <fperez@colorado.edu>
1556 2005-05-18 Fernando Perez <fperez@colorado.edu>
1551
1557
1552 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1558 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1553 keyword arguments correctly to safe_execfile().
1559 keyword arguments correctly to safe_execfile().
1554
1560
1555 2005-05-13 Fernando Perez <fperez@colorado.edu>
1561 2005-05-13 Fernando Perez <fperez@colorado.edu>
1556
1562
1557 * ipython.1: Added info about Qt to manpage, and threads warning
1563 * ipython.1: Added info about Qt to manpage, and threads warning
1558 to usage page (invoked with --help).
1564 to usage page (invoked with --help).
1559
1565
1560 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1566 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1561 new matcher (it goes at the end of the priority list) to do
1567 new matcher (it goes at the end of the priority list) to do
1562 tab-completion on named function arguments. Submitted by George
1568 tab-completion on named function arguments. Submitted by George
1563 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1569 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1564 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1570 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1565 for more details.
1571 for more details.
1566
1572
1567 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1573 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1568 SystemExit exceptions in the script being run. Thanks to a report
1574 SystemExit exceptions in the script being run. Thanks to a report
1569 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1575 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1570 producing very annoying behavior when running unit tests.
1576 producing very annoying behavior when running unit tests.
1571
1577
1572 2005-05-12 Fernando Perez <fperez@colorado.edu>
1578 2005-05-12 Fernando Perez <fperez@colorado.edu>
1573
1579
1574 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1580 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1575 which I'd broken (again) due to a changed regexp. In the process,
1581 which I'd broken (again) due to a changed regexp. In the process,
1576 added ';' as an escape to auto-quote the whole line without
1582 added ';' as an escape to auto-quote the whole line without
1577 splitting its arguments. Thanks to a report by Jerry McRae
1583 splitting its arguments. Thanks to a report by Jerry McRae
1578 <qrs0xyc02-AT-sneakemail.com>.
1584 <qrs0xyc02-AT-sneakemail.com>.
1579
1585
1580 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1586 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1581 possible crashes caused by a TokenError. Reported by Ed Schofield
1587 possible crashes caused by a TokenError. Reported by Ed Schofield
1582 <schofield-AT-ftw.at>.
1588 <schofield-AT-ftw.at>.
1583
1589
1584 2005-05-06 Fernando Perez <fperez@colorado.edu>
1590 2005-05-06 Fernando Perez <fperez@colorado.edu>
1585
1591
1586 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1592 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1587
1593
1588 2005-04-29 Fernando Perez <fperez@colorado.edu>
1594 2005-04-29 Fernando Perez <fperez@colorado.edu>
1589
1595
1590 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1596 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1591 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1597 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1592 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1598 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1593 which provides support for Qt interactive usage (similar to the
1599 which provides support for Qt interactive usage (similar to the
1594 existing one for WX and GTK). This had been often requested.
1600 existing one for WX and GTK). This had been often requested.
1595
1601
1596 2005-04-14 *** Released version 0.6.13
1602 2005-04-14 *** Released version 0.6.13
1597
1603
1598 2005-04-08 Fernando Perez <fperez@colorado.edu>
1604 2005-04-08 Fernando Perez <fperez@colorado.edu>
1599
1605
1600 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1606 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1601 from _ofind, which gets called on almost every input line. Now,
1607 from _ofind, which gets called on almost every input line. Now,
1602 we only try to get docstrings if they are actually going to be
1608 we only try to get docstrings if they are actually going to be
1603 used (the overhead of fetching unnecessary docstrings can be
1609 used (the overhead of fetching unnecessary docstrings can be
1604 noticeable for certain objects, such as Pyro proxies).
1610 noticeable for certain objects, such as Pyro proxies).
1605
1611
1606 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1612 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1607 for completers. For some reason I had been passing them the state
1613 for completers. For some reason I had been passing them the state
1608 variable, which completers never actually need, and was in
1614 variable, which completers never actually need, and was in
1609 conflict with the rlcompleter API. Custom completers ONLY need to
1615 conflict with the rlcompleter API. Custom completers ONLY need to
1610 take the text parameter.
1616 take the text parameter.
1611
1617
1612 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1618 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1613 work correctly in pysh. I've also moved all the logic which used
1619 work correctly in pysh. I've also moved all the logic which used
1614 to be in pysh.py here, which will prevent problems with future
1620 to be in pysh.py here, which will prevent problems with future
1615 upgrades. However, this time I must warn users to update their
1621 upgrades. However, this time I must warn users to update their
1616 pysh profile to include the line
1622 pysh profile to include the line
1617
1623
1618 import_all IPython.Extensions.InterpreterExec
1624 import_all IPython.Extensions.InterpreterExec
1619
1625
1620 because otherwise things won't work for them. They MUST also
1626 because otherwise things won't work for them. They MUST also
1621 delete pysh.py and the line
1627 delete pysh.py and the line
1622
1628
1623 execfile pysh.py
1629 execfile pysh.py
1624
1630
1625 from their ipythonrc-pysh.
1631 from their ipythonrc-pysh.
1626
1632
1627 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1633 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1628 robust in the face of objects whose dir() returns non-strings
1634 robust in the face of objects whose dir() returns non-strings
1629 (which it shouldn't, but some broken libs like ITK do). Thanks to
1635 (which it shouldn't, but some broken libs like ITK do). Thanks to
1630 a patch by John Hunter (implemented differently, though). Also
1636 a patch by John Hunter (implemented differently, though). Also
1631 minor improvements by using .extend instead of + on lists.
1637 minor improvements by using .extend instead of + on lists.
1632
1638
1633 * pysh.py:
1639 * pysh.py:
1634
1640
1635 2005-04-06 Fernando Perez <fperez@colorado.edu>
1641 2005-04-06 Fernando Perez <fperez@colorado.edu>
1636
1642
1637 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1643 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1638 by default, so that all users benefit from it. Those who don't
1644 by default, so that all users benefit from it. Those who don't
1639 want it can still turn it off.
1645 want it can still turn it off.
1640
1646
1641 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1647 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1642 config file, I'd forgotten about this, so users were getting it
1648 config file, I'd forgotten about this, so users were getting it
1643 off by default.
1649 off by default.
1644
1650
1645 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1651 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1646 consistency. Now magics can be called in multiline statements,
1652 consistency. Now magics can be called in multiline statements,
1647 and python variables can be expanded in magic calls via $var.
1653 and python variables can be expanded in magic calls via $var.
1648 This makes the magic system behave just like aliases or !system
1654 This makes the magic system behave just like aliases or !system
1649 calls.
1655 calls.
1650
1656
1651 2005-03-28 Fernando Perez <fperez@colorado.edu>
1657 2005-03-28 Fernando Perez <fperez@colorado.edu>
1652
1658
1653 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1659 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1654 expensive string additions for building command. Add support for
1660 expensive string additions for building command. Add support for
1655 trailing ';' when autocall is used.
1661 trailing ';' when autocall is used.
1656
1662
1657 2005-03-26 Fernando Perez <fperez@colorado.edu>
1663 2005-03-26 Fernando Perez <fperez@colorado.edu>
1658
1664
1659 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1665 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1660 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1666 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1661 ipython.el robust against prompts with any number of spaces
1667 ipython.el robust against prompts with any number of spaces
1662 (including 0) after the ':' character.
1668 (including 0) after the ':' character.
1663
1669
1664 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1670 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1665 continuation prompt, which misled users to think the line was
1671 continuation prompt, which misled users to think the line was
1666 already indented. Closes debian Bug#300847, reported to me by
1672 already indented. Closes debian Bug#300847, reported to me by
1667 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1673 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1668
1674
1669 2005-03-23 Fernando Perez <fperez@colorado.edu>
1675 2005-03-23 Fernando Perez <fperez@colorado.edu>
1670
1676
1671 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1677 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1672 properly aligned if they have embedded newlines.
1678 properly aligned if they have embedded newlines.
1673
1679
1674 * IPython/iplib.py (runlines): Add a public method to expose
1680 * IPython/iplib.py (runlines): Add a public method to expose
1675 IPython's code execution machinery, so that users can run strings
1681 IPython's code execution machinery, so that users can run strings
1676 as if they had been typed at the prompt interactively.
1682 as if they had been typed at the prompt interactively.
1677 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1683 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1678 methods which can call the system shell, but with python variable
1684 methods which can call the system shell, but with python variable
1679 expansion. The three such methods are: __IPYTHON__.system,
1685 expansion. The three such methods are: __IPYTHON__.system,
1680 .getoutput and .getoutputerror. These need to be documented in a
1686 .getoutput and .getoutputerror. These need to be documented in a
1681 'public API' section (to be written) of the manual.
1687 'public API' section (to be written) of the manual.
1682
1688
1683 2005-03-20 Fernando Perez <fperez@colorado.edu>
1689 2005-03-20 Fernando Perez <fperez@colorado.edu>
1684
1690
1685 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1691 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1686 for custom exception handling. This is quite powerful, and it
1692 for custom exception handling. This is quite powerful, and it
1687 allows for user-installable exception handlers which can trap
1693 allows for user-installable exception handlers which can trap
1688 custom exceptions at runtime and treat them separately from
1694 custom exceptions at runtime and treat them separately from
1689 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1695 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1690 Mantegazza <mantegazza-AT-ill.fr>.
1696 Mantegazza <mantegazza-AT-ill.fr>.
1691 (InteractiveShell.set_custom_completer): public API function to
1697 (InteractiveShell.set_custom_completer): public API function to
1692 add new completers at runtime.
1698 add new completers at runtime.
1693
1699
1694 2005-03-19 Fernando Perez <fperez@colorado.edu>
1700 2005-03-19 Fernando Perez <fperez@colorado.edu>
1695
1701
1696 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1702 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1697 allow objects which provide their docstrings via non-standard
1703 allow objects which provide their docstrings via non-standard
1698 mechanisms (like Pyro proxies) to still be inspected by ipython's
1704 mechanisms (like Pyro proxies) to still be inspected by ipython's
1699 ? system.
1705 ? system.
1700
1706
1701 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1707 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1702 automatic capture system. I tried quite hard to make it work
1708 automatic capture system. I tried quite hard to make it work
1703 reliably, and simply failed. I tried many combinations with the
1709 reliably, and simply failed. I tried many combinations with the
1704 subprocess module, but eventually nothing worked in all needed
1710 subprocess module, but eventually nothing worked in all needed
1705 cases (not blocking stdin for the child, duplicating stdout
1711 cases (not blocking stdin for the child, duplicating stdout
1706 without blocking, etc). The new %sc/%sx still do capture to these
1712 without blocking, etc). The new %sc/%sx still do capture to these
1707 magical list/string objects which make shell use much more
1713 magical list/string objects which make shell use much more
1708 conveninent, so not all is lost.
1714 conveninent, so not all is lost.
1709
1715
1710 XXX - FIX MANUAL for the change above!
1716 XXX - FIX MANUAL for the change above!
1711
1717
1712 (runsource): I copied code.py's runsource() into ipython to modify
1718 (runsource): I copied code.py's runsource() into ipython to modify
1713 it a bit. Now the code object and source to be executed are
1719 it a bit. Now the code object and source to be executed are
1714 stored in ipython. This makes this info accessible to third-party
1720 stored in ipython. This makes this info accessible to third-party
1715 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1721 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1716 Mantegazza <mantegazza-AT-ill.fr>.
1722 Mantegazza <mantegazza-AT-ill.fr>.
1717
1723
1718 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1724 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1719 history-search via readline (like C-p/C-n). I'd wanted this for a
1725 history-search via readline (like C-p/C-n). I'd wanted this for a
1720 long time, but only recently found out how to do it. For users
1726 long time, but only recently found out how to do it. For users
1721 who already have their ipythonrc files made and want this, just
1727 who already have their ipythonrc files made and want this, just
1722 add:
1728 add:
1723
1729
1724 readline_parse_and_bind "\e[A": history-search-backward
1730 readline_parse_and_bind "\e[A": history-search-backward
1725 readline_parse_and_bind "\e[B": history-search-forward
1731 readline_parse_and_bind "\e[B": history-search-forward
1726
1732
1727 2005-03-18 Fernando Perez <fperez@colorado.edu>
1733 2005-03-18 Fernando Perez <fperez@colorado.edu>
1728
1734
1729 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1735 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1730 LSString and SList classes which allow transparent conversions
1736 LSString and SList classes which allow transparent conversions
1731 between list mode and whitespace-separated string.
1737 between list mode and whitespace-separated string.
1732 (magic_r): Fix recursion problem in %r.
1738 (magic_r): Fix recursion problem in %r.
1733
1739
1734 * IPython/genutils.py (LSString): New class to be used for
1740 * IPython/genutils.py (LSString): New class to be used for
1735 automatic storage of the results of all alias/system calls in _o
1741 automatic storage of the results of all alias/system calls in _o
1736 and _e (stdout/err). These provide a .l/.list attribute which
1742 and _e (stdout/err). These provide a .l/.list attribute which
1737 does automatic splitting on newlines. This means that for most
1743 does automatic splitting on newlines. This means that for most
1738 uses, you'll never need to do capturing of output with %sc/%sx
1744 uses, you'll never need to do capturing of output with %sc/%sx
1739 anymore, since ipython keeps this always done for you. Note that
1745 anymore, since ipython keeps this always done for you. Note that
1740 only the LAST results are stored, the _o/e variables are
1746 only the LAST results are stored, the _o/e variables are
1741 overwritten on each call. If you need to save their contents
1747 overwritten on each call. If you need to save their contents
1742 further, simply bind them to any other name.
1748 further, simply bind them to any other name.
1743
1749
1744 2005-03-17 Fernando Perez <fperez@colorado.edu>
1750 2005-03-17 Fernando Perez <fperez@colorado.edu>
1745
1751
1746 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1752 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1747 prompt namespace handling.
1753 prompt namespace handling.
1748
1754
1749 2005-03-16 Fernando Perez <fperez@colorado.edu>
1755 2005-03-16 Fernando Perez <fperez@colorado.edu>
1750
1756
1751 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1757 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1752 classic prompts to be '>>> ' (final space was missing, and it
1758 classic prompts to be '>>> ' (final space was missing, and it
1753 trips the emacs python mode).
1759 trips the emacs python mode).
1754 (BasePrompt.__str__): Added safe support for dynamic prompt
1760 (BasePrompt.__str__): Added safe support for dynamic prompt
1755 strings. Now you can set your prompt string to be '$x', and the
1761 strings. Now you can set your prompt string to be '$x', and the
1756 value of x will be printed from your interactive namespace. The
1762 value of x will be printed from your interactive namespace. The
1757 interpolation syntax includes the full Itpl support, so
1763 interpolation syntax includes the full Itpl support, so
1758 ${foo()+x+bar()} is a valid prompt string now, and the function
1764 ${foo()+x+bar()} is a valid prompt string now, and the function
1759 calls will be made at runtime.
1765 calls will be made at runtime.
1760
1766
1761 2005-03-15 Fernando Perez <fperez@colorado.edu>
1767 2005-03-15 Fernando Perez <fperez@colorado.edu>
1762
1768
1763 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1769 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1764 avoid name clashes in pylab. %hist still works, it just forwards
1770 avoid name clashes in pylab. %hist still works, it just forwards
1765 the call to %history.
1771 the call to %history.
1766
1772
1767 2005-03-02 *** Released version 0.6.12
1773 2005-03-02 *** Released version 0.6.12
1768
1774
1769 2005-03-02 Fernando Perez <fperez@colorado.edu>
1775 2005-03-02 Fernando Perez <fperez@colorado.edu>
1770
1776
1771 * IPython/iplib.py (handle_magic): log magic calls properly as
1777 * IPython/iplib.py (handle_magic): log magic calls properly as
1772 ipmagic() function calls.
1778 ipmagic() function calls.
1773
1779
1774 * IPython/Magic.py (magic_time): Improved %time to support
1780 * IPython/Magic.py (magic_time): Improved %time to support
1775 statements and provide wall-clock as well as CPU time.
1781 statements and provide wall-clock as well as CPU time.
1776
1782
1777 2005-02-27 Fernando Perez <fperez@colorado.edu>
1783 2005-02-27 Fernando Perez <fperez@colorado.edu>
1778
1784
1779 * IPython/hooks.py: New hooks module, to expose user-modifiable
1785 * IPython/hooks.py: New hooks module, to expose user-modifiable
1780 IPython functionality in a clean manner. For now only the editor
1786 IPython functionality in a clean manner. For now only the editor
1781 hook is actually written, and other thigns which I intend to turn
1787 hook is actually written, and other thigns which I intend to turn
1782 into proper hooks aren't yet there. The display and prefilter
1788 into proper hooks aren't yet there. The display and prefilter
1783 stuff, for example, should be hooks. But at least now the
1789 stuff, for example, should be hooks. But at least now the
1784 framework is in place, and the rest can be moved here with more
1790 framework is in place, and the rest can be moved here with more
1785 time later. IPython had had a .hooks variable for a long time for
1791 time later. IPython had had a .hooks variable for a long time for
1786 this purpose, but I'd never actually used it for anything.
1792 this purpose, but I'd never actually used it for anything.
1787
1793
1788 2005-02-26 Fernando Perez <fperez@colorado.edu>
1794 2005-02-26 Fernando Perez <fperez@colorado.edu>
1789
1795
1790 * IPython/ipmaker.py (make_IPython): make the default ipython
1796 * IPython/ipmaker.py (make_IPython): make the default ipython
1791 directory be called _ipython under win32, to follow more the
1797 directory be called _ipython under win32, to follow more the
1792 naming peculiarities of that platform (where buggy software like
1798 naming peculiarities of that platform (where buggy software like
1793 Visual Sourcesafe breaks with .named directories). Reported by
1799 Visual Sourcesafe breaks with .named directories). Reported by
1794 Ville Vainio.
1800 Ville Vainio.
1795
1801
1796 2005-02-23 Fernando Perez <fperez@colorado.edu>
1802 2005-02-23 Fernando Perez <fperez@colorado.edu>
1797
1803
1798 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1804 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1799 auto_aliases for win32 which were causing problems. Users can
1805 auto_aliases for win32 which were causing problems. Users can
1800 define the ones they personally like.
1806 define the ones they personally like.
1801
1807
1802 2005-02-21 Fernando Perez <fperez@colorado.edu>
1808 2005-02-21 Fernando Perez <fperez@colorado.edu>
1803
1809
1804 * IPython/Magic.py (magic_time): new magic to time execution of
1810 * IPython/Magic.py (magic_time): new magic to time execution of
1805 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1811 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1806
1812
1807 2005-02-19 Fernando Perez <fperez@colorado.edu>
1813 2005-02-19 Fernando Perez <fperez@colorado.edu>
1808
1814
1809 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1815 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1810 into keys (for prompts, for example).
1816 into keys (for prompts, for example).
1811
1817
1812 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1818 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1813 prompts in case users want them. This introduces a small behavior
1819 prompts in case users want them. This introduces a small behavior
1814 change: ipython does not automatically add a space to all prompts
1820 change: ipython does not automatically add a space to all prompts
1815 anymore. To get the old prompts with a space, users should add it
1821 anymore. To get the old prompts with a space, users should add it
1816 manually to their ipythonrc file, so for example prompt_in1 should
1822 manually to their ipythonrc file, so for example prompt_in1 should
1817 now read 'In [\#]: ' instead of 'In [\#]:'.
1823 now read 'In [\#]: ' instead of 'In [\#]:'.
1818 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1824 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1819 file) to control left-padding of secondary prompts.
1825 file) to control left-padding of secondary prompts.
1820
1826
1821 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1827 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1822 the profiler can't be imported. Fix for Debian, which removed
1828 the profiler can't be imported. Fix for Debian, which removed
1823 profile.py because of License issues. I applied a slightly
1829 profile.py because of License issues. I applied a slightly
1824 modified version of the original Debian patch at
1830 modified version of the original Debian patch at
1825 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1831 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1826
1832
1827 2005-02-17 Fernando Perez <fperez@colorado.edu>
1833 2005-02-17 Fernando Perez <fperez@colorado.edu>
1828
1834
1829 * IPython/genutils.py (native_line_ends): Fix bug which would
1835 * IPython/genutils.py (native_line_ends): Fix bug which would
1830 cause improper line-ends under win32 b/c I was not opening files
1836 cause improper line-ends under win32 b/c I was not opening files
1831 in binary mode. Bug report and fix thanks to Ville.
1837 in binary mode. Bug report and fix thanks to Ville.
1832
1838
1833 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1839 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1834 trying to catch spurious foo[1] autocalls. My fix actually broke
1840 trying to catch spurious foo[1] autocalls. My fix actually broke
1835 ',/' autoquote/call with explicit escape (bad regexp).
1841 ',/' autoquote/call with explicit escape (bad regexp).
1836
1842
1837 2005-02-15 *** Released version 0.6.11
1843 2005-02-15 *** Released version 0.6.11
1838
1844
1839 2005-02-14 Fernando Perez <fperez@colorado.edu>
1845 2005-02-14 Fernando Perez <fperez@colorado.edu>
1840
1846
1841 * IPython/background_jobs.py: New background job management
1847 * IPython/background_jobs.py: New background job management
1842 subsystem. This is implemented via a new set of classes, and
1848 subsystem. This is implemented via a new set of classes, and
1843 IPython now provides a builtin 'jobs' object for background job
1849 IPython now provides a builtin 'jobs' object for background job
1844 execution. A convenience %bg magic serves as a lightweight
1850 execution. A convenience %bg magic serves as a lightweight
1845 frontend for starting the more common type of calls. This was
1851 frontend for starting the more common type of calls. This was
1846 inspired by discussions with B. Granger and the BackgroundCommand
1852 inspired by discussions with B. Granger and the BackgroundCommand
1847 class described in the book Python Scripting for Computational
1853 class described in the book Python Scripting for Computational
1848 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1854 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1849 (although ultimately no code from this text was used, as IPython's
1855 (although ultimately no code from this text was used, as IPython's
1850 system is a separate implementation).
1856 system is a separate implementation).
1851
1857
1852 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1858 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1853 to control the completion of single/double underscore names
1859 to control the completion of single/double underscore names
1854 separately. As documented in the example ipytonrc file, the
1860 separately. As documented in the example ipytonrc file, the
1855 readline_omit__names variable can now be set to 2, to omit even
1861 readline_omit__names variable can now be set to 2, to omit even
1856 single underscore names. Thanks to a patch by Brian Wong
1862 single underscore names. Thanks to a patch by Brian Wong
1857 <BrianWong-AT-AirgoNetworks.Com>.
1863 <BrianWong-AT-AirgoNetworks.Com>.
1858 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1864 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1859 be autocalled as foo([1]) if foo were callable. A problem for
1865 be autocalled as foo([1]) if foo were callable. A problem for
1860 things which are both callable and implement __getitem__.
1866 things which are both callable and implement __getitem__.
1861 (init_readline): Fix autoindentation for win32. Thanks to a patch
1867 (init_readline): Fix autoindentation for win32. Thanks to a patch
1862 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1868 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1863
1869
1864 2005-02-12 Fernando Perez <fperez@colorado.edu>
1870 2005-02-12 Fernando Perez <fperez@colorado.edu>
1865
1871
1866 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1872 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1867 which I had written long ago to sort out user error messages which
1873 which I had written long ago to sort out user error messages which
1868 may occur during startup. This seemed like a good idea initially,
1874 may occur during startup. This seemed like a good idea initially,
1869 but it has proven a disaster in retrospect. I don't want to
1875 but it has proven a disaster in retrospect. I don't want to
1870 change much code for now, so my fix is to set the internal 'debug'
1876 change much code for now, so my fix is to set the internal 'debug'
1871 flag to true everywhere, whose only job was precisely to control
1877 flag to true everywhere, whose only job was precisely to control
1872 this subsystem. This closes issue 28 (as well as avoiding all
1878 this subsystem. This closes issue 28 (as well as avoiding all
1873 sorts of strange hangups which occur from time to time).
1879 sorts of strange hangups which occur from time to time).
1874
1880
1875 2005-02-07 Fernando Perez <fperez@colorado.edu>
1881 2005-02-07 Fernando Perez <fperez@colorado.edu>
1876
1882
1877 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1883 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1878 previous call produced a syntax error.
1884 previous call produced a syntax error.
1879
1885
1880 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1886 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1881 classes without constructor.
1887 classes without constructor.
1882
1888
1883 2005-02-06 Fernando Perez <fperez@colorado.edu>
1889 2005-02-06 Fernando Perez <fperez@colorado.edu>
1884
1890
1885 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1891 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1886 completions with the results of each matcher, so we return results
1892 completions with the results of each matcher, so we return results
1887 to the user from all namespaces. This breaks with ipython
1893 to the user from all namespaces. This breaks with ipython
1888 tradition, but I think it's a nicer behavior. Now you get all
1894 tradition, but I think it's a nicer behavior. Now you get all
1889 possible completions listed, from all possible namespaces (python,
1895 possible completions listed, from all possible namespaces (python,
1890 filesystem, magics...) After a request by John Hunter
1896 filesystem, magics...) After a request by John Hunter
1891 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1897 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1892
1898
1893 2005-02-05 Fernando Perez <fperez@colorado.edu>
1899 2005-02-05 Fernando Perez <fperez@colorado.edu>
1894
1900
1895 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1901 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1896 the call had quote characters in it (the quotes were stripped).
1902 the call had quote characters in it (the quotes were stripped).
1897
1903
1898 2005-01-31 Fernando Perez <fperez@colorado.edu>
1904 2005-01-31 Fernando Perez <fperez@colorado.edu>
1899
1905
1900 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1906 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1901 Itpl.itpl() to make the code more robust against psyco
1907 Itpl.itpl() to make the code more robust against psyco
1902 optimizations.
1908 optimizations.
1903
1909
1904 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1910 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1905 of causing an exception. Quicker, cleaner.
1911 of causing an exception. Quicker, cleaner.
1906
1912
1907 2005-01-28 Fernando Perez <fperez@colorado.edu>
1913 2005-01-28 Fernando Perez <fperez@colorado.edu>
1908
1914
1909 * scripts/ipython_win_post_install.py (install): hardcode
1915 * scripts/ipython_win_post_install.py (install): hardcode
1910 sys.prefix+'python.exe' as the executable path. It turns out that
1916 sys.prefix+'python.exe' as the executable path. It turns out that
1911 during the post-installation run, sys.executable resolves to the
1917 during the post-installation run, sys.executable resolves to the
1912 name of the binary installer! I should report this as a distutils
1918 name of the binary installer! I should report this as a distutils
1913 bug, I think. I updated the .10 release with this tiny fix, to
1919 bug, I think. I updated the .10 release with this tiny fix, to
1914 avoid annoying the lists further.
1920 avoid annoying the lists further.
1915
1921
1916 2005-01-27 *** Released version 0.6.10
1922 2005-01-27 *** Released version 0.6.10
1917
1923
1918 2005-01-27 Fernando Perez <fperez@colorado.edu>
1924 2005-01-27 Fernando Perez <fperez@colorado.edu>
1919
1925
1920 * IPython/numutils.py (norm): Added 'inf' as optional name for
1926 * IPython/numutils.py (norm): Added 'inf' as optional name for
1921 L-infinity norm, included references to mathworld.com for vector
1927 L-infinity norm, included references to mathworld.com for vector
1922 norm definitions.
1928 norm definitions.
1923 (amin/amax): added amin/amax for array min/max. Similar to what
1929 (amin/amax): added amin/amax for array min/max. Similar to what
1924 pylab ships with after the recent reorganization of names.
1930 pylab ships with after the recent reorganization of names.
1925 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1931 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1926
1932
1927 * ipython.el: committed Alex's recent fixes and improvements.
1933 * ipython.el: committed Alex's recent fixes and improvements.
1928 Tested with python-mode from CVS, and it looks excellent. Since
1934 Tested with python-mode from CVS, and it looks excellent. Since
1929 python-mode hasn't released anything in a while, I'm temporarily
1935 python-mode hasn't released anything in a while, I'm temporarily
1930 putting a copy of today's CVS (v 4.70) of python-mode in:
1936 putting a copy of today's CVS (v 4.70) of python-mode in:
1931 http://ipython.scipy.org/tmp/python-mode.el
1937 http://ipython.scipy.org/tmp/python-mode.el
1932
1938
1933 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1939 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1934 sys.executable for the executable name, instead of assuming it's
1940 sys.executable for the executable name, instead of assuming it's
1935 called 'python.exe' (the post-installer would have produced broken
1941 called 'python.exe' (the post-installer would have produced broken
1936 setups on systems with a differently named python binary).
1942 setups on systems with a differently named python binary).
1937
1943
1938 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1944 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1939 references to os.linesep, to make the code more
1945 references to os.linesep, to make the code more
1940 platform-independent. This is also part of the win32 coloring
1946 platform-independent. This is also part of the win32 coloring
1941 fixes.
1947 fixes.
1942
1948
1943 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1949 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1944 lines, which actually cause coloring bugs because the length of
1950 lines, which actually cause coloring bugs because the length of
1945 the line is very difficult to correctly compute with embedded
1951 the line is very difficult to correctly compute with embedded
1946 escapes. This was the source of all the coloring problems under
1952 escapes. This was the source of all the coloring problems under
1947 Win32. I think that _finally_, Win32 users have a properly
1953 Win32. I think that _finally_, Win32 users have a properly
1948 working ipython in all respects. This would never have happened
1954 working ipython in all respects. This would never have happened
1949 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1955 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1950
1956
1951 2005-01-26 *** Released version 0.6.9
1957 2005-01-26 *** Released version 0.6.9
1952
1958
1953 2005-01-25 Fernando Perez <fperez@colorado.edu>
1959 2005-01-25 Fernando Perez <fperez@colorado.edu>
1954
1960
1955 * setup.py: finally, we have a true Windows installer, thanks to
1961 * setup.py: finally, we have a true Windows installer, thanks to
1956 the excellent work of Viktor Ransmayr
1962 the excellent work of Viktor Ransmayr
1957 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1963 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1958 Windows users. The setup routine is quite a bit cleaner thanks to
1964 Windows users. The setup routine is quite a bit cleaner thanks to
1959 this, and the post-install script uses the proper functions to
1965 this, and the post-install script uses the proper functions to
1960 allow a clean de-installation using the standard Windows Control
1966 allow a clean de-installation using the standard Windows Control
1961 Panel.
1967 Panel.
1962
1968
1963 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1969 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1964 environment variable under all OSes (including win32) if
1970 environment variable under all OSes (including win32) if
1965 available. This will give consistency to win32 users who have set
1971 available. This will give consistency to win32 users who have set
1966 this variable for any reason. If os.environ['HOME'] fails, the
1972 this variable for any reason. If os.environ['HOME'] fails, the
1967 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1973 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1968
1974
1969 2005-01-24 Fernando Perez <fperez@colorado.edu>
1975 2005-01-24 Fernando Perez <fperez@colorado.edu>
1970
1976
1971 * IPython/numutils.py (empty_like): add empty_like(), similar to
1977 * IPython/numutils.py (empty_like): add empty_like(), similar to
1972 zeros_like() but taking advantage of the new empty() Numeric routine.
1978 zeros_like() but taking advantage of the new empty() Numeric routine.
1973
1979
1974 2005-01-23 *** Released version 0.6.8
1980 2005-01-23 *** Released version 0.6.8
1975
1981
1976 2005-01-22 Fernando Perez <fperez@colorado.edu>
1982 2005-01-22 Fernando Perez <fperez@colorado.edu>
1977
1983
1978 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1984 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1979 automatic show() calls. After discussing things with JDH, it
1985 automatic show() calls. After discussing things with JDH, it
1980 turns out there are too many corner cases where this can go wrong.
1986 turns out there are too many corner cases where this can go wrong.
1981 It's best not to try to be 'too smart', and simply have ipython
1987 It's best not to try to be 'too smart', and simply have ipython
1982 reproduce as much as possible the default behavior of a normal
1988 reproduce as much as possible the default behavior of a normal
1983 python shell.
1989 python shell.
1984
1990
1985 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1991 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1986 line-splitting regexp and _prefilter() to avoid calling getattr()
1992 line-splitting regexp and _prefilter() to avoid calling getattr()
1987 on assignments. This closes
1993 on assignments. This closes
1988 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1994 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1989 readline uses getattr(), so a simple <TAB> keypress is still
1995 readline uses getattr(), so a simple <TAB> keypress is still
1990 enough to trigger getattr() calls on an object.
1996 enough to trigger getattr() calls on an object.
1991
1997
1992 2005-01-21 Fernando Perez <fperez@colorado.edu>
1998 2005-01-21 Fernando Perez <fperez@colorado.edu>
1993
1999
1994 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2000 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1995 docstring under pylab so it doesn't mask the original.
2001 docstring under pylab so it doesn't mask the original.
1996
2002
1997 2005-01-21 *** Released version 0.6.7
2003 2005-01-21 *** Released version 0.6.7
1998
2004
1999 2005-01-21 Fernando Perez <fperez@colorado.edu>
2005 2005-01-21 Fernando Perez <fperez@colorado.edu>
2000
2006
2001 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2007 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2002 signal handling for win32 users in multithreaded mode.
2008 signal handling for win32 users in multithreaded mode.
2003
2009
2004 2005-01-17 Fernando Perez <fperez@colorado.edu>
2010 2005-01-17 Fernando Perez <fperez@colorado.edu>
2005
2011
2006 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2012 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2007 instances with no __init__. After a crash report by Norbert Nemec
2013 instances with no __init__. After a crash report by Norbert Nemec
2008 <Norbert-AT-nemec-online.de>.
2014 <Norbert-AT-nemec-online.de>.
2009
2015
2010 2005-01-14 Fernando Perez <fperez@colorado.edu>
2016 2005-01-14 Fernando Perez <fperez@colorado.edu>
2011
2017
2012 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2018 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2013 names for verbose exceptions, when multiple dotted names and the
2019 names for verbose exceptions, when multiple dotted names and the
2014 'parent' object were present on the same line.
2020 'parent' object were present on the same line.
2015
2021
2016 2005-01-11 Fernando Perez <fperez@colorado.edu>
2022 2005-01-11 Fernando Perez <fperez@colorado.edu>
2017
2023
2018 * IPython/genutils.py (flag_calls): new utility to trap and flag
2024 * IPython/genutils.py (flag_calls): new utility to trap and flag
2019 calls in functions. I need it to clean up matplotlib support.
2025 calls in functions. I need it to clean up matplotlib support.
2020 Also removed some deprecated code in genutils.
2026 Also removed some deprecated code in genutils.
2021
2027
2022 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2028 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2023 that matplotlib scripts called with %run, which don't call show()
2029 that matplotlib scripts called with %run, which don't call show()
2024 themselves, still have their plotting windows open.
2030 themselves, still have their plotting windows open.
2025
2031
2026 2005-01-05 Fernando Perez <fperez@colorado.edu>
2032 2005-01-05 Fernando Perez <fperez@colorado.edu>
2027
2033
2028 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2034 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2029 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2035 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2030
2036
2031 2004-12-19 Fernando Perez <fperez@colorado.edu>
2037 2004-12-19 Fernando Perez <fperez@colorado.edu>
2032
2038
2033 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2039 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2034 parent_runcode, which was an eyesore. The same result can be
2040 parent_runcode, which was an eyesore. The same result can be
2035 obtained with Python's regular superclass mechanisms.
2041 obtained with Python's regular superclass mechanisms.
2036
2042
2037 2004-12-17 Fernando Perez <fperez@colorado.edu>
2043 2004-12-17 Fernando Perez <fperez@colorado.edu>
2038
2044
2039 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2045 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2040 reported by Prabhu.
2046 reported by Prabhu.
2041 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2047 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2042 sys.stderr) instead of explicitly calling sys.stderr. This helps
2048 sys.stderr) instead of explicitly calling sys.stderr. This helps
2043 maintain our I/O abstractions clean, for future GUI embeddings.
2049 maintain our I/O abstractions clean, for future GUI embeddings.
2044
2050
2045 * IPython/genutils.py (info): added new utility for sys.stderr
2051 * IPython/genutils.py (info): added new utility for sys.stderr
2046 unified info message handling (thin wrapper around warn()).
2052 unified info message handling (thin wrapper around warn()).
2047
2053
2048 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2054 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2049 composite (dotted) names on verbose exceptions.
2055 composite (dotted) names on verbose exceptions.
2050 (VerboseTB.nullrepr): harden against another kind of errors which
2056 (VerboseTB.nullrepr): harden against another kind of errors which
2051 Python's inspect module can trigger, and which were crashing
2057 Python's inspect module can trigger, and which were crashing
2052 IPython. Thanks to a report by Marco Lombardi
2058 IPython. Thanks to a report by Marco Lombardi
2053 <mlombard-AT-ma010192.hq.eso.org>.
2059 <mlombard-AT-ma010192.hq.eso.org>.
2054
2060
2055 2004-12-13 *** Released version 0.6.6
2061 2004-12-13 *** Released version 0.6.6
2056
2062
2057 2004-12-12 Fernando Perez <fperez@colorado.edu>
2063 2004-12-12 Fernando Perez <fperez@colorado.edu>
2058
2064
2059 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2065 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2060 generated by pygtk upon initialization if it was built without
2066 generated by pygtk upon initialization if it was built without
2061 threads (for matplotlib users). After a crash reported by
2067 threads (for matplotlib users). After a crash reported by
2062 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2068 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2063
2069
2064 * IPython/ipmaker.py (make_IPython): fix small bug in the
2070 * IPython/ipmaker.py (make_IPython): fix small bug in the
2065 import_some parameter for multiple imports.
2071 import_some parameter for multiple imports.
2066
2072
2067 * IPython/iplib.py (ipmagic): simplified the interface of
2073 * IPython/iplib.py (ipmagic): simplified the interface of
2068 ipmagic() to take a single string argument, just as it would be
2074 ipmagic() to take a single string argument, just as it would be
2069 typed at the IPython cmd line.
2075 typed at the IPython cmd line.
2070 (ipalias): Added new ipalias() with an interface identical to
2076 (ipalias): Added new ipalias() with an interface identical to
2071 ipmagic(). This completes exposing a pure python interface to the
2077 ipmagic(). This completes exposing a pure python interface to the
2072 alias and magic system, which can be used in loops or more complex
2078 alias and magic system, which can be used in loops or more complex
2073 code where IPython's automatic line mangling is not active.
2079 code where IPython's automatic line mangling is not active.
2074
2080
2075 * IPython/genutils.py (timing): changed interface of timing to
2081 * IPython/genutils.py (timing): changed interface of timing to
2076 simply run code once, which is the most common case. timings()
2082 simply run code once, which is the most common case. timings()
2077 remains unchanged, for the cases where you want multiple runs.
2083 remains unchanged, for the cases where you want multiple runs.
2078
2084
2079 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2085 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2080 bug where Python2.2 crashes with exec'ing code which does not end
2086 bug where Python2.2 crashes with exec'ing code which does not end
2081 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2087 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2082 before.
2088 before.
2083
2089
2084 2004-12-10 Fernando Perez <fperez@colorado.edu>
2090 2004-12-10 Fernando Perez <fperez@colorado.edu>
2085
2091
2086 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2092 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2087 -t to -T, to accomodate the new -t flag in %run (the %run and
2093 -t to -T, to accomodate the new -t flag in %run (the %run and
2088 %prun options are kind of intermixed, and it's not easy to change
2094 %prun options are kind of intermixed, and it's not easy to change
2089 this with the limitations of python's getopt).
2095 this with the limitations of python's getopt).
2090
2096
2091 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2097 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2092 the execution of scripts. It's not as fine-tuned as timeit.py,
2098 the execution of scripts. It's not as fine-tuned as timeit.py,
2093 but it works from inside ipython (and under 2.2, which lacks
2099 but it works from inside ipython (and under 2.2, which lacks
2094 timeit.py). Optionally a number of runs > 1 can be given for
2100 timeit.py). Optionally a number of runs > 1 can be given for
2095 timing very short-running code.
2101 timing very short-running code.
2096
2102
2097 * IPython/genutils.py (uniq_stable): new routine which returns a
2103 * IPython/genutils.py (uniq_stable): new routine which returns a
2098 list of unique elements in any iterable, but in stable order of
2104 list of unique elements in any iterable, but in stable order of
2099 appearance. I needed this for the ultraTB fixes, and it's a handy
2105 appearance. I needed this for the ultraTB fixes, and it's a handy
2100 utility.
2106 utility.
2101
2107
2102 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2108 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2103 dotted names in Verbose exceptions. This had been broken since
2109 dotted names in Verbose exceptions. This had been broken since
2104 the very start, now x.y will properly be printed in a Verbose
2110 the very start, now x.y will properly be printed in a Verbose
2105 traceback, instead of x being shown and y appearing always as an
2111 traceback, instead of x being shown and y appearing always as an
2106 'undefined global'. Getting this to work was a bit tricky,
2112 'undefined global'. Getting this to work was a bit tricky,
2107 because by default python tokenizers are stateless. Saved by
2113 because by default python tokenizers are stateless. Saved by
2108 python's ability to easily add a bit of state to an arbitrary
2114 python's ability to easily add a bit of state to an arbitrary
2109 function (without needing to build a full-blown callable object).
2115 function (without needing to build a full-blown callable object).
2110
2116
2111 Also big cleanup of this code, which had horrendous runtime
2117 Also big cleanup of this code, which had horrendous runtime
2112 lookups of zillions of attributes for colorization. Moved all
2118 lookups of zillions of attributes for colorization. Moved all
2113 this code into a few templates, which make it cleaner and quicker.
2119 this code into a few templates, which make it cleaner and quicker.
2114
2120
2115 Printout quality was also improved for Verbose exceptions: one
2121 Printout quality was also improved for Verbose exceptions: one
2116 variable per line, and memory addresses are printed (this can be
2122 variable per line, and memory addresses are printed (this can be
2117 quite handy in nasty debugging situations, which is what Verbose
2123 quite handy in nasty debugging situations, which is what Verbose
2118 is for).
2124 is for).
2119
2125
2120 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2126 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2121 the command line as scripts to be loaded by embedded instances.
2127 the command line as scripts to be loaded by embedded instances.
2122 Doing so has the potential for an infinite recursion if there are
2128 Doing so has the potential for an infinite recursion if there are
2123 exceptions thrown in the process. This fixes a strange crash
2129 exceptions thrown in the process. This fixes a strange crash
2124 reported by Philippe MULLER <muller-AT-irit.fr>.
2130 reported by Philippe MULLER <muller-AT-irit.fr>.
2125
2131
2126 2004-12-09 Fernando Perez <fperez@colorado.edu>
2132 2004-12-09 Fernando Perez <fperez@colorado.edu>
2127
2133
2128 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2134 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2129 to reflect new names in matplotlib, which now expose the
2135 to reflect new names in matplotlib, which now expose the
2130 matlab-compatible interface via a pylab module instead of the
2136 matlab-compatible interface via a pylab module instead of the
2131 'matlab' name. The new code is backwards compatible, so users of
2137 'matlab' name. The new code is backwards compatible, so users of
2132 all matplotlib versions are OK. Patch by J. Hunter.
2138 all matplotlib versions are OK. Patch by J. Hunter.
2133
2139
2134 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2140 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2135 of __init__ docstrings for instances (class docstrings are already
2141 of __init__ docstrings for instances (class docstrings are already
2136 automatically printed). Instances with customized docstrings
2142 automatically printed). Instances with customized docstrings
2137 (indep. of the class) are also recognized and all 3 separate
2143 (indep. of the class) are also recognized and all 3 separate
2138 docstrings are printed (instance, class, constructor). After some
2144 docstrings are printed (instance, class, constructor). After some
2139 comments/suggestions by J. Hunter.
2145 comments/suggestions by J. Hunter.
2140
2146
2141 2004-12-05 Fernando Perez <fperez@colorado.edu>
2147 2004-12-05 Fernando Perez <fperez@colorado.edu>
2142
2148
2143 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2149 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2144 warnings when tab-completion fails and triggers an exception.
2150 warnings when tab-completion fails and triggers an exception.
2145
2151
2146 2004-12-03 Fernando Perez <fperez@colorado.edu>
2152 2004-12-03 Fernando Perez <fperez@colorado.edu>
2147
2153
2148 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2154 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2149 be triggered when using 'run -p'. An incorrect option flag was
2155 be triggered when using 'run -p'. An incorrect option flag was
2150 being set ('d' instead of 'D').
2156 being set ('d' instead of 'D').
2151 (manpage): fix missing escaped \- sign.
2157 (manpage): fix missing escaped \- sign.
2152
2158
2153 2004-11-30 *** Released version 0.6.5
2159 2004-11-30 *** Released version 0.6.5
2154
2160
2155 2004-11-30 Fernando Perez <fperez@colorado.edu>
2161 2004-11-30 Fernando Perez <fperez@colorado.edu>
2156
2162
2157 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2163 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2158 setting with -d option.
2164 setting with -d option.
2159
2165
2160 * setup.py (docfiles): Fix problem where the doc glob I was using
2166 * setup.py (docfiles): Fix problem where the doc glob I was using
2161 was COMPLETELY BROKEN. It was giving the right files by pure
2167 was COMPLETELY BROKEN. It was giving the right files by pure
2162 accident, but failed once I tried to include ipython.el. Note:
2168 accident, but failed once I tried to include ipython.el. Note:
2163 glob() does NOT allow you to do exclusion on multiple endings!
2169 glob() does NOT allow you to do exclusion on multiple endings!
2164
2170
2165 2004-11-29 Fernando Perez <fperez@colorado.edu>
2171 2004-11-29 Fernando Perez <fperez@colorado.edu>
2166
2172
2167 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2173 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2168 the manpage as the source. Better formatting & consistency.
2174 the manpage as the source. Better formatting & consistency.
2169
2175
2170 * IPython/Magic.py (magic_run): Added new -d option, to run
2176 * IPython/Magic.py (magic_run): Added new -d option, to run
2171 scripts under the control of the python pdb debugger. Note that
2177 scripts under the control of the python pdb debugger. Note that
2172 this required changing the %prun option -d to -D, to avoid a clash
2178 this required changing the %prun option -d to -D, to avoid a clash
2173 (since %run must pass options to %prun, and getopt is too dumb to
2179 (since %run must pass options to %prun, and getopt is too dumb to
2174 handle options with string values with embedded spaces). Thanks
2180 handle options with string values with embedded spaces). Thanks
2175 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2181 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2176 (magic_who_ls): added type matching to %who and %whos, so that one
2182 (magic_who_ls): added type matching to %who and %whos, so that one
2177 can filter their output to only include variables of certain
2183 can filter their output to only include variables of certain
2178 types. Another suggestion by Matthew.
2184 types. Another suggestion by Matthew.
2179 (magic_whos): Added memory summaries in kb and Mb for arrays.
2185 (magic_whos): Added memory summaries in kb and Mb for arrays.
2180 (magic_who): Improve formatting (break lines every 9 vars).
2186 (magic_who): Improve formatting (break lines every 9 vars).
2181
2187
2182 2004-11-28 Fernando Perez <fperez@colorado.edu>
2188 2004-11-28 Fernando Perez <fperez@colorado.edu>
2183
2189
2184 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2190 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2185 cache when empty lines were present.
2191 cache when empty lines were present.
2186
2192
2187 2004-11-24 Fernando Perez <fperez@colorado.edu>
2193 2004-11-24 Fernando Perez <fperez@colorado.edu>
2188
2194
2189 * IPython/usage.py (__doc__): document the re-activated threading
2195 * IPython/usage.py (__doc__): document the re-activated threading
2190 options for WX and GTK.
2196 options for WX and GTK.
2191
2197
2192 2004-11-23 Fernando Perez <fperez@colorado.edu>
2198 2004-11-23 Fernando Perez <fperez@colorado.edu>
2193
2199
2194 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2200 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2195 the -wthread and -gthread options, along with a new -tk one to try
2201 the -wthread and -gthread options, along with a new -tk one to try
2196 and coordinate Tk threading with wx/gtk. The tk support is very
2202 and coordinate Tk threading with wx/gtk. The tk support is very
2197 platform dependent, since it seems to require Tcl and Tk to be
2203 platform dependent, since it seems to require Tcl and Tk to be
2198 built with threads (Fedora1/2 appears NOT to have it, but in
2204 built with threads (Fedora1/2 appears NOT to have it, but in
2199 Prabhu's Debian boxes it works OK). But even with some Tk
2205 Prabhu's Debian boxes it works OK). But even with some Tk
2200 limitations, this is a great improvement.
2206 limitations, this is a great improvement.
2201
2207
2202 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2208 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2203 info in user prompts. Patch by Prabhu.
2209 info in user prompts. Patch by Prabhu.
2204
2210
2205 2004-11-18 Fernando Perez <fperez@colorado.edu>
2211 2004-11-18 Fernando Perez <fperez@colorado.edu>
2206
2212
2207 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2213 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2208 EOFErrors and bail, to avoid infinite loops if a non-terminating
2214 EOFErrors and bail, to avoid infinite loops if a non-terminating
2209 file is fed into ipython. Patch submitted in issue 19 by user,
2215 file is fed into ipython. Patch submitted in issue 19 by user,
2210 many thanks.
2216 many thanks.
2211
2217
2212 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2218 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2213 autoquote/parens in continuation prompts, which can cause lots of
2219 autoquote/parens in continuation prompts, which can cause lots of
2214 problems. Closes roundup issue 20.
2220 problems. Closes roundup issue 20.
2215
2221
2216 2004-11-17 Fernando Perez <fperez@colorado.edu>
2222 2004-11-17 Fernando Perez <fperez@colorado.edu>
2217
2223
2218 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2224 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2219 reported as debian bug #280505. I'm not sure my local changelog
2225 reported as debian bug #280505. I'm not sure my local changelog
2220 entry has the proper debian format (Jack?).
2226 entry has the proper debian format (Jack?).
2221
2227
2222 2004-11-08 *** Released version 0.6.4
2228 2004-11-08 *** Released version 0.6.4
2223
2229
2224 2004-11-08 Fernando Perez <fperez@colorado.edu>
2230 2004-11-08 Fernando Perez <fperez@colorado.edu>
2225
2231
2226 * IPython/iplib.py (init_readline): Fix exit message for Windows
2232 * IPython/iplib.py (init_readline): Fix exit message for Windows
2227 when readline is active. Thanks to a report by Eric Jones
2233 when readline is active. Thanks to a report by Eric Jones
2228 <eric-AT-enthought.com>.
2234 <eric-AT-enthought.com>.
2229
2235
2230 2004-11-07 Fernando Perez <fperez@colorado.edu>
2236 2004-11-07 Fernando Perez <fperez@colorado.edu>
2231
2237
2232 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2238 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2233 sometimes seen by win2k/cygwin users.
2239 sometimes seen by win2k/cygwin users.
2234
2240
2235 2004-11-06 Fernando Perez <fperez@colorado.edu>
2241 2004-11-06 Fernando Perez <fperez@colorado.edu>
2236
2242
2237 * IPython/iplib.py (interact): Change the handling of %Exit from
2243 * IPython/iplib.py (interact): Change the handling of %Exit from
2238 trying to propagate a SystemExit to an internal ipython flag.
2244 trying to propagate a SystemExit to an internal ipython flag.
2239 This is less elegant than using Python's exception mechanism, but
2245 This is less elegant than using Python's exception mechanism, but
2240 I can't get that to work reliably with threads, so under -pylab
2246 I can't get that to work reliably with threads, so under -pylab
2241 %Exit was hanging IPython. Cross-thread exception handling is
2247 %Exit was hanging IPython. Cross-thread exception handling is
2242 really a bitch. Thaks to a bug report by Stephen Walton
2248 really a bitch. Thaks to a bug report by Stephen Walton
2243 <stephen.walton-AT-csun.edu>.
2249 <stephen.walton-AT-csun.edu>.
2244
2250
2245 2004-11-04 Fernando Perez <fperez@colorado.edu>
2251 2004-11-04 Fernando Perez <fperez@colorado.edu>
2246
2252
2247 * IPython/iplib.py (raw_input_original): store a pointer to the
2253 * IPython/iplib.py (raw_input_original): store a pointer to the
2248 true raw_input to harden against code which can modify it
2254 true raw_input to harden against code which can modify it
2249 (wx.py.PyShell does this and would otherwise crash ipython).
2255 (wx.py.PyShell does this and would otherwise crash ipython).
2250 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2256 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2251
2257
2252 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2258 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2253 Ctrl-C problem, which does not mess up the input line.
2259 Ctrl-C problem, which does not mess up the input line.
2254
2260
2255 2004-11-03 Fernando Perez <fperez@colorado.edu>
2261 2004-11-03 Fernando Perez <fperez@colorado.edu>
2256
2262
2257 * IPython/Release.py: Changed licensing to BSD, in all files.
2263 * IPython/Release.py: Changed licensing to BSD, in all files.
2258 (name): lowercase name for tarball/RPM release.
2264 (name): lowercase name for tarball/RPM release.
2259
2265
2260 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2266 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2261 use throughout ipython.
2267 use throughout ipython.
2262
2268
2263 * IPython/Magic.py (Magic._ofind): Switch to using the new
2269 * IPython/Magic.py (Magic._ofind): Switch to using the new
2264 OInspect.getdoc() function.
2270 OInspect.getdoc() function.
2265
2271
2266 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2272 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2267 of the line currently being canceled via Ctrl-C. It's extremely
2273 of the line currently being canceled via Ctrl-C. It's extremely
2268 ugly, but I don't know how to do it better (the problem is one of
2274 ugly, but I don't know how to do it better (the problem is one of
2269 handling cross-thread exceptions).
2275 handling cross-thread exceptions).
2270
2276
2271 2004-10-28 Fernando Perez <fperez@colorado.edu>
2277 2004-10-28 Fernando Perez <fperez@colorado.edu>
2272
2278
2273 * IPython/Shell.py (signal_handler): add signal handlers to trap
2279 * IPython/Shell.py (signal_handler): add signal handlers to trap
2274 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2280 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2275 report by Francesc Alted.
2281 report by Francesc Alted.
2276
2282
2277 2004-10-21 Fernando Perez <fperez@colorado.edu>
2283 2004-10-21 Fernando Perez <fperez@colorado.edu>
2278
2284
2279 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2285 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2280 to % for pysh syntax extensions.
2286 to % for pysh syntax extensions.
2281
2287
2282 2004-10-09 Fernando Perez <fperez@colorado.edu>
2288 2004-10-09 Fernando Perez <fperez@colorado.edu>
2283
2289
2284 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2290 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2285 arrays to print a more useful summary, without calling str(arr).
2291 arrays to print a more useful summary, without calling str(arr).
2286 This avoids the problem of extremely lengthy computations which
2292 This avoids the problem of extremely lengthy computations which
2287 occur if arr is large, and appear to the user as a system lockup
2293 occur if arr is large, and appear to the user as a system lockup
2288 with 100% cpu activity. After a suggestion by Kristian Sandberg
2294 with 100% cpu activity. After a suggestion by Kristian Sandberg
2289 <Kristian.Sandberg@colorado.edu>.
2295 <Kristian.Sandberg@colorado.edu>.
2290 (Magic.__init__): fix bug in global magic escapes not being
2296 (Magic.__init__): fix bug in global magic escapes not being
2291 correctly set.
2297 correctly set.
2292
2298
2293 2004-10-08 Fernando Perez <fperez@colorado.edu>
2299 2004-10-08 Fernando Perez <fperez@colorado.edu>
2294
2300
2295 * IPython/Magic.py (__license__): change to absolute imports of
2301 * IPython/Magic.py (__license__): change to absolute imports of
2296 ipython's own internal packages, to start adapting to the absolute
2302 ipython's own internal packages, to start adapting to the absolute
2297 import requirement of PEP-328.
2303 import requirement of PEP-328.
2298
2304
2299 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2305 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2300 files, and standardize author/license marks through the Release
2306 files, and standardize author/license marks through the Release
2301 module instead of having per/file stuff (except for files with
2307 module instead of having per/file stuff (except for files with
2302 particular licenses, like the MIT/PSF-licensed codes).
2308 particular licenses, like the MIT/PSF-licensed codes).
2303
2309
2304 * IPython/Debugger.py: remove dead code for python 2.1
2310 * IPython/Debugger.py: remove dead code for python 2.1
2305
2311
2306 2004-10-04 Fernando Perez <fperez@colorado.edu>
2312 2004-10-04 Fernando Perez <fperez@colorado.edu>
2307
2313
2308 * IPython/iplib.py (ipmagic): New function for accessing magics
2314 * IPython/iplib.py (ipmagic): New function for accessing magics
2309 via a normal python function call.
2315 via a normal python function call.
2310
2316
2311 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2317 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2312 from '@' to '%', to accomodate the new @decorator syntax of python
2318 from '@' to '%', to accomodate the new @decorator syntax of python
2313 2.4.
2319 2.4.
2314
2320
2315 2004-09-29 Fernando Perez <fperez@colorado.edu>
2321 2004-09-29 Fernando Perez <fperez@colorado.edu>
2316
2322
2317 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2323 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2318 matplotlib.use to prevent running scripts which try to switch
2324 matplotlib.use to prevent running scripts which try to switch
2319 interactive backends from within ipython. This will just crash
2325 interactive backends from within ipython. This will just crash
2320 the python interpreter, so we can't allow it (but a detailed error
2326 the python interpreter, so we can't allow it (but a detailed error
2321 is given to the user).
2327 is given to the user).
2322
2328
2323 2004-09-28 Fernando Perez <fperez@colorado.edu>
2329 2004-09-28 Fernando Perez <fperez@colorado.edu>
2324
2330
2325 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2331 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2326 matplotlib-related fixes so that using @run with non-matplotlib
2332 matplotlib-related fixes so that using @run with non-matplotlib
2327 scripts doesn't pop up spurious plot windows. This requires
2333 scripts doesn't pop up spurious plot windows. This requires
2328 matplotlib >= 0.63, where I had to make some changes as well.
2334 matplotlib >= 0.63, where I had to make some changes as well.
2329
2335
2330 * IPython/ipmaker.py (make_IPython): update version requirement to
2336 * IPython/ipmaker.py (make_IPython): update version requirement to
2331 python 2.2.
2337 python 2.2.
2332
2338
2333 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2339 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2334 banner arg for embedded customization.
2340 banner arg for embedded customization.
2335
2341
2336 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2342 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2337 explicit uses of __IP as the IPython's instance name. Now things
2343 explicit uses of __IP as the IPython's instance name. Now things
2338 are properly handled via the shell.name value. The actual code
2344 are properly handled via the shell.name value. The actual code
2339 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2345 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2340 is much better than before. I'll clean things completely when the
2346 is much better than before. I'll clean things completely when the
2341 magic stuff gets a real overhaul.
2347 magic stuff gets a real overhaul.
2342
2348
2343 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2349 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2344 minor changes to debian dir.
2350 minor changes to debian dir.
2345
2351
2346 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2352 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2347 pointer to the shell itself in the interactive namespace even when
2353 pointer to the shell itself in the interactive namespace even when
2348 a user-supplied dict is provided. This is needed for embedding
2354 a user-supplied dict is provided. This is needed for embedding
2349 purposes (found by tests with Michel Sanner).
2355 purposes (found by tests with Michel Sanner).
2350
2356
2351 2004-09-27 Fernando Perez <fperez@colorado.edu>
2357 2004-09-27 Fernando Perez <fperez@colorado.edu>
2352
2358
2353 * IPython/UserConfig/ipythonrc: remove []{} from
2359 * IPython/UserConfig/ipythonrc: remove []{} from
2354 readline_remove_delims, so that things like [modname.<TAB> do
2360 readline_remove_delims, so that things like [modname.<TAB> do
2355 proper completion. This disables [].TAB, but that's a less common
2361 proper completion. This disables [].TAB, but that's a less common
2356 case than module names in list comprehensions, for example.
2362 case than module names in list comprehensions, for example.
2357 Thanks to a report by Andrea Riciputi.
2363 Thanks to a report by Andrea Riciputi.
2358
2364
2359 2004-09-09 Fernando Perez <fperez@colorado.edu>
2365 2004-09-09 Fernando Perez <fperez@colorado.edu>
2360
2366
2361 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2367 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2362 blocking problems in win32 and osx. Fix by John.
2368 blocking problems in win32 and osx. Fix by John.
2363
2369
2364 2004-09-08 Fernando Perez <fperez@colorado.edu>
2370 2004-09-08 Fernando Perez <fperez@colorado.edu>
2365
2371
2366 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2372 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2367 for Win32 and OSX. Fix by John Hunter.
2373 for Win32 and OSX. Fix by John Hunter.
2368
2374
2369 2004-08-30 *** Released version 0.6.3
2375 2004-08-30 *** Released version 0.6.3
2370
2376
2371 2004-08-30 Fernando Perez <fperez@colorado.edu>
2377 2004-08-30 Fernando Perez <fperez@colorado.edu>
2372
2378
2373 * setup.py (isfile): Add manpages to list of dependent files to be
2379 * setup.py (isfile): Add manpages to list of dependent files to be
2374 updated.
2380 updated.
2375
2381
2376 2004-08-27 Fernando Perez <fperez@colorado.edu>
2382 2004-08-27 Fernando Perez <fperez@colorado.edu>
2377
2383
2378 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2384 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2379 for now. They don't really work with standalone WX/GTK code
2385 for now. They don't really work with standalone WX/GTK code
2380 (though matplotlib IS working fine with both of those backends).
2386 (though matplotlib IS working fine with both of those backends).
2381 This will neeed much more testing. I disabled most things with
2387 This will neeed much more testing. I disabled most things with
2382 comments, so turning it back on later should be pretty easy.
2388 comments, so turning it back on later should be pretty easy.
2383
2389
2384 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2390 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2385 autocalling of expressions like r'foo', by modifying the line
2391 autocalling of expressions like r'foo', by modifying the line
2386 split regexp. Closes
2392 split regexp. Closes
2387 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2393 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2388 Riley <ipythonbugs-AT-sabi.net>.
2394 Riley <ipythonbugs-AT-sabi.net>.
2389 (InteractiveShell.mainloop): honor --nobanner with banner
2395 (InteractiveShell.mainloop): honor --nobanner with banner
2390 extensions.
2396 extensions.
2391
2397
2392 * IPython/Shell.py: Significant refactoring of all classes, so
2398 * IPython/Shell.py: Significant refactoring of all classes, so
2393 that we can really support ALL matplotlib backends and threading
2399 that we can really support ALL matplotlib backends and threading
2394 models (John spotted a bug with Tk which required this). Now we
2400 models (John spotted a bug with Tk which required this). Now we
2395 should support single-threaded, WX-threads and GTK-threads, both
2401 should support single-threaded, WX-threads and GTK-threads, both
2396 for generic code and for matplotlib.
2402 for generic code and for matplotlib.
2397
2403
2398 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2404 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2399 -pylab, to simplify things for users. Will also remove the pylab
2405 -pylab, to simplify things for users. Will also remove the pylab
2400 profile, since now all of matplotlib configuration is directly
2406 profile, since now all of matplotlib configuration is directly
2401 handled here. This also reduces startup time.
2407 handled here. This also reduces startup time.
2402
2408
2403 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2409 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2404 shell wasn't being correctly called. Also in IPShellWX.
2410 shell wasn't being correctly called. Also in IPShellWX.
2405
2411
2406 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2412 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2407 fine-tune banner.
2413 fine-tune banner.
2408
2414
2409 * IPython/numutils.py (spike): Deprecate these spike functions,
2415 * IPython/numutils.py (spike): Deprecate these spike functions,
2410 delete (long deprecated) gnuplot_exec handler.
2416 delete (long deprecated) gnuplot_exec handler.
2411
2417
2412 2004-08-26 Fernando Perez <fperez@colorado.edu>
2418 2004-08-26 Fernando Perez <fperez@colorado.edu>
2413
2419
2414 * ipython.1: Update for threading options, plus some others which
2420 * ipython.1: Update for threading options, plus some others which
2415 were missing.
2421 were missing.
2416
2422
2417 * IPython/ipmaker.py (__call__): Added -wthread option for
2423 * IPython/ipmaker.py (__call__): Added -wthread option for
2418 wxpython thread handling. Make sure threading options are only
2424 wxpython thread handling. Make sure threading options are only
2419 valid at the command line.
2425 valid at the command line.
2420
2426
2421 * scripts/ipython: moved shell selection into a factory function
2427 * scripts/ipython: moved shell selection into a factory function
2422 in Shell.py, to keep the starter script to a minimum.
2428 in Shell.py, to keep the starter script to a minimum.
2423
2429
2424 2004-08-25 Fernando Perez <fperez@colorado.edu>
2430 2004-08-25 Fernando Perez <fperez@colorado.edu>
2425
2431
2426 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2432 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2427 John. Along with some recent changes he made to matplotlib, the
2433 John. Along with some recent changes he made to matplotlib, the
2428 next versions of both systems should work very well together.
2434 next versions of both systems should work very well together.
2429
2435
2430 2004-08-24 Fernando Perez <fperez@colorado.edu>
2436 2004-08-24 Fernando Perez <fperez@colorado.edu>
2431
2437
2432 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2438 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2433 tried to switch the profiling to using hotshot, but I'm getting
2439 tried to switch the profiling to using hotshot, but I'm getting
2434 strange errors from prof.runctx() there. I may be misreading the
2440 strange errors from prof.runctx() there. I may be misreading the
2435 docs, but it looks weird. For now the profiling code will
2441 docs, but it looks weird. For now the profiling code will
2436 continue to use the standard profiler.
2442 continue to use the standard profiler.
2437
2443
2438 2004-08-23 Fernando Perez <fperez@colorado.edu>
2444 2004-08-23 Fernando Perez <fperez@colorado.edu>
2439
2445
2440 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2446 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2441 threaded shell, by John Hunter. It's not quite ready yet, but
2447 threaded shell, by John Hunter. It's not quite ready yet, but
2442 close.
2448 close.
2443
2449
2444 2004-08-22 Fernando Perez <fperez@colorado.edu>
2450 2004-08-22 Fernando Perez <fperez@colorado.edu>
2445
2451
2446 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2452 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2447 in Magic and ultraTB.
2453 in Magic and ultraTB.
2448
2454
2449 * ipython.1: document threading options in manpage.
2455 * ipython.1: document threading options in manpage.
2450
2456
2451 * scripts/ipython: Changed name of -thread option to -gthread,
2457 * scripts/ipython: Changed name of -thread option to -gthread,
2452 since this is GTK specific. I want to leave the door open for a
2458 since this is GTK specific. I want to leave the door open for a
2453 -wthread option for WX, which will most likely be necessary. This
2459 -wthread option for WX, which will most likely be necessary. This
2454 change affects usage and ipmaker as well.
2460 change affects usage and ipmaker as well.
2455
2461
2456 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2462 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2457 handle the matplotlib shell issues. Code by John Hunter
2463 handle the matplotlib shell issues. Code by John Hunter
2458 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2464 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2459 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2465 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2460 broken (and disabled for end users) for now, but it puts the
2466 broken (and disabled for end users) for now, but it puts the
2461 infrastructure in place.
2467 infrastructure in place.
2462
2468
2463 2004-08-21 Fernando Perez <fperez@colorado.edu>
2469 2004-08-21 Fernando Perez <fperez@colorado.edu>
2464
2470
2465 * ipythonrc-pylab: Add matplotlib support.
2471 * ipythonrc-pylab: Add matplotlib support.
2466
2472
2467 * matplotlib_config.py: new files for matplotlib support, part of
2473 * matplotlib_config.py: new files for matplotlib support, part of
2468 the pylab profile.
2474 the pylab profile.
2469
2475
2470 * IPython/usage.py (__doc__): documented the threading options.
2476 * IPython/usage.py (__doc__): documented the threading options.
2471
2477
2472 2004-08-20 Fernando Perez <fperez@colorado.edu>
2478 2004-08-20 Fernando Perez <fperez@colorado.edu>
2473
2479
2474 * ipython: Modified the main calling routine to handle the -thread
2480 * ipython: Modified the main calling routine to handle the -thread
2475 and -mpthread options. This needs to be done as a top-level hack,
2481 and -mpthread options. This needs to be done as a top-level hack,
2476 because it determines which class to instantiate for IPython
2482 because it determines which class to instantiate for IPython
2477 itself.
2483 itself.
2478
2484
2479 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2485 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2480 classes to support multithreaded GTK operation without blocking,
2486 classes to support multithreaded GTK operation without blocking,
2481 and matplotlib with all backends. This is a lot of still very
2487 and matplotlib with all backends. This is a lot of still very
2482 experimental code, and threads are tricky. So it may still have a
2488 experimental code, and threads are tricky. So it may still have a
2483 few rough edges... This code owes a lot to
2489 few rough edges... This code owes a lot to
2484 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2490 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2485 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2491 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2486 to John Hunter for all the matplotlib work.
2492 to John Hunter for all the matplotlib work.
2487
2493
2488 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2494 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2489 options for gtk thread and matplotlib support.
2495 options for gtk thread and matplotlib support.
2490
2496
2491 2004-08-16 Fernando Perez <fperez@colorado.edu>
2497 2004-08-16 Fernando Perez <fperez@colorado.edu>
2492
2498
2493 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2499 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2494 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2500 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2495 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2501 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2496
2502
2497 2004-08-11 Fernando Perez <fperez@colorado.edu>
2503 2004-08-11 Fernando Perez <fperez@colorado.edu>
2498
2504
2499 * setup.py (isfile): Fix build so documentation gets updated for
2505 * setup.py (isfile): Fix build so documentation gets updated for
2500 rpms (it was only done for .tgz builds).
2506 rpms (it was only done for .tgz builds).
2501
2507
2502 2004-08-10 Fernando Perez <fperez@colorado.edu>
2508 2004-08-10 Fernando Perez <fperez@colorado.edu>
2503
2509
2504 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2510 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2505
2511
2506 * iplib.py : Silence syntax error exceptions in tab-completion.
2512 * iplib.py : Silence syntax error exceptions in tab-completion.
2507
2513
2508 2004-08-05 Fernando Perez <fperez@colorado.edu>
2514 2004-08-05 Fernando Perez <fperez@colorado.edu>
2509
2515
2510 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2516 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2511 'color off' mark for continuation prompts. This was causing long
2517 'color off' mark for continuation prompts. This was causing long
2512 continuation lines to mis-wrap.
2518 continuation lines to mis-wrap.
2513
2519
2514 2004-08-01 Fernando Perez <fperez@colorado.edu>
2520 2004-08-01 Fernando Perez <fperez@colorado.edu>
2515
2521
2516 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2522 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2517 for building ipython to be a parameter. All this is necessary
2523 for building ipython to be a parameter. All this is necessary
2518 right now to have a multithreaded version, but this insane
2524 right now to have a multithreaded version, but this insane
2519 non-design will be cleaned up soon. For now, it's a hack that
2525 non-design will be cleaned up soon. For now, it's a hack that
2520 works.
2526 works.
2521
2527
2522 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2528 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2523 args in various places. No bugs so far, but it's a dangerous
2529 args in various places. No bugs so far, but it's a dangerous
2524 practice.
2530 practice.
2525
2531
2526 2004-07-31 Fernando Perez <fperez@colorado.edu>
2532 2004-07-31 Fernando Perez <fperez@colorado.edu>
2527
2533
2528 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2534 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2529 fix completion of files with dots in their names under most
2535 fix completion of files with dots in their names under most
2530 profiles (pysh was OK because the completion order is different).
2536 profiles (pysh was OK because the completion order is different).
2531
2537
2532 2004-07-27 Fernando Perez <fperez@colorado.edu>
2538 2004-07-27 Fernando Perez <fperez@colorado.edu>
2533
2539
2534 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2540 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2535 keywords manually, b/c the one in keyword.py was removed in python
2541 keywords manually, b/c the one in keyword.py was removed in python
2536 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2542 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2537 This is NOT a bug under python 2.3 and earlier.
2543 This is NOT a bug under python 2.3 and earlier.
2538
2544
2539 2004-07-26 Fernando Perez <fperez@colorado.edu>
2545 2004-07-26 Fernando Perez <fperez@colorado.edu>
2540
2546
2541 * IPython/ultraTB.py (VerboseTB.text): Add another
2547 * IPython/ultraTB.py (VerboseTB.text): Add another
2542 linecache.checkcache() call to try to prevent inspect.py from
2548 linecache.checkcache() call to try to prevent inspect.py from
2543 crashing under python 2.3. I think this fixes
2549 crashing under python 2.3. I think this fixes
2544 http://www.scipy.net/roundup/ipython/issue17.
2550 http://www.scipy.net/roundup/ipython/issue17.
2545
2551
2546 2004-07-26 *** Released version 0.6.2
2552 2004-07-26 *** Released version 0.6.2
2547
2553
2548 2004-07-26 Fernando Perez <fperez@colorado.edu>
2554 2004-07-26 Fernando Perez <fperez@colorado.edu>
2549
2555
2550 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2556 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2551 fail for any number.
2557 fail for any number.
2552 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2558 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2553 empty bookmarks.
2559 empty bookmarks.
2554
2560
2555 2004-07-26 *** Released version 0.6.1
2561 2004-07-26 *** Released version 0.6.1
2556
2562
2557 2004-07-26 Fernando Perez <fperez@colorado.edu>
2563 2004-07-26 Fernando Perez <fperez@colorado.edu>
2558
2564
2559 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2565 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2560
2566
2561 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2567 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2562 escaping '()[]{}' in filenames.
2568 escaping '()[]{}' in filenames.
2563
2569
2564 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2570 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2565 Python 2.2 users who lack a proper shlex.split.
2571 Python 2.2 users who lack a proper shlex.split.
2566
2572
2567 2004-07-19 Fernando Perez <fperez@colorado.edu>
2573 2004-07-19 Fernando Perez <fperez@colorado.edu>
2568
2574
2569 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2575 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2570 for reading readline's init file. I follow the normal chain:
2576 for reading readline's init file. I follow the normal chain:
2571 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2577 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2572 report by Mike Heeter. This closes
2578 report by Mike Heeter. This closes
2573 http://www.scipy.net/roundup/ipython/issue16.
2579 http://www.scipy.net/roundup/ipython/issue16.
2574
2580
2575 2004-07-18 Fernando Perez <fperez@colorado.edu>
2581 2004-07-18 Fernando Perez <fperez@colorado.edu>
2576
2582
2577 * IPython/iplib.py (__init__): Add better handling of '\' under
2583 * IPython/iplib.py (__init__): Add better handling of '\' under
2578 Win32 for filenames. After a patch by Ville.
2584 Win32 for filenames. After a patch by Ville.
2579
2585
2580 2004-07-17 Fernando Perez <fperez@colorado.edu>
2586 2004-07-17 Fernando Perez <fperez@colorado.edu>
2581
2587
2582 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2588 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2583 autocalling would be triggered for 'foo is bar' if foo is
2589 autocalling would be triggered for 'foo is bar' if foo is
2584 callable. I also cleaned up the autocall detection code to use a
2590 callable. I also cleaned up the autocall detection code to use a
2585 regexp, which is faster. Bug reported by Alexander Schmolck.
2591 regexp, which is faster. Bug reported by Alexander Schmolck.
2586
2592
2587 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2593 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2588 '?' in them would confuse the help system. Reported by Alex
2594 '?' in them would confuse the help system. Reported by Alex
2589 Schmolck.
2595 Schmolck.
2590
2596
2591 2004-07-16 Fernando Perez <fperez@colorado.edu>
2597 2004-07-16 Fernando Perez <fperez@colorado.edu>
2592
2598
2593 * IPython/GnuplotInteractive.py (__all__): added plot2.
2599 * IPython/GnuplotInteractive.py (__all__): added plot2.
2594
2600
2595 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2601 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2596 plotting dictionaries, lists or tuples of 1d arrays.
2602 plotting dictionaries, lists or tuples of 1d arrays.
2597
2603
2598 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2604 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2599 optimizations.
2605 optimizations.
2600
2606
2601 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2607 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2602 the information which was there from Janko's original IPP code:
2608 the information which was there from Janko's original IPP code:
2603
2609
2604 03.05.99 20:53 porto.ifm.uni-kiel.de
2610 03.05.99 20:53 porto.ifm.uni-kiel.de
2605 --Started changelog.
2611 --Started changelog.
2606 --make clear do what it say it does
2612 --make clear do what it say it does
2607 --added pretty output of lines from inputcache
2613 --added pretty output of lines from inputcache
2608 --Made Logger a mixin class, simplifies handling of switches
2614 --Made Logger a mixin class, simplifies handling of switches
2609 --Added own completer class. .string<TAB> expands to last history
2615 --Added own completer class. .string<TAB> expands to last history
2610 line which starts with string. The new expansion is also present
2616 line which starts with string. The new expansion is also present
2611 with Ctrl-r from the readline library. But this shows, who this
2617 with Ctrl-r from the readline library. But this shows, who this
2612 can be done for other cases.
2618 can be done for other cases.
2613 --Added convention that all shell functions should accept a
2619 --Added convention that all shell functions should accept a
2614 parameter_string This opens the door for different behaviour for
2620 parameter_string This opens the door for different behaviour for
2615 each function. @cd is a good example of this.
2621 each function. @cd is a good example of this.
2616
2622
2617 04.05.99 12:12 porto.ifm.uni-kiel.de
2623 04.05.99 12:12 porto.ifm.uni-kiel.de
2618 --added logfile rotation
2624 --added logfile rotation
2619 --added new mainloop method which freezes first the namespace
2625 --added new mainloop method which freezes first the namespace
2620
2626
2621 07.05.99 21:24 porto.ifm.uni-kiel.de
2627 07.05.99 21:24 porto.ifm.uni-kiel.de
2622 --added the docreader classes. Now there is a help system.
2628 --added the docreader classes. Now there is a help system.
2623 -This is only a first try. Currently it's not easy to put new
2629 -This is only a first try. Currently it's not easy to put new
2624 stuff in the indices. But this is the way to go. Info would be
2630 stuff in the indices. But this is the way to go. Info would be
2625 better, but HTML is every where and not everybody has an info
2631 better, but HTML is every where and not everybody has an info
2626 system installed and it's not so easy to change html-docs to info.
2632 system installed and it's not so easy to change html-docs to info.
2627 --added global logfile option
2633 --added global logfile option
2628 --there is now a hook for object inspection method pinfo needs to
2634 --there is now a hook for object inspection method pinfo needs to
2629 be provided for this. Can be reached by two '??'.
2635 be provided for this. Can be reached by two '??'.
2630
2636
2631 08.05.99 20:51 porto.ifm.uni-kiel.de
2637 08.05.99 20:51 porto.ifm.uni-kiel.de
2632 --added a README
2638 --added a README
2633 --bug in rc file. Something has changed so functions in the rc
2639 --bug in rc file. Something has changed so functions in the rc
2634 file need to reference the shell and not self. Not clear if it's a
2640 file need to reference the shell and not self. Not clear if it's a
2635 bug or feature.
2641 bug or feature.
2636 --changed rc file for new behavior
2642 --changed rc file for new behavior
2637
2643
2638 2004-07-15 Fernando Perez <fperez@colorado.edu>
2644 2004-07-15 Fernando Perez <fperez@colorado.edu>
2639
2645
2640 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2646 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2641 cache was falling out of sync in bizarre manners when multi-line
2647 cache was falling out of sync in bizarre manners when multi-line
2642 input was present. Minor optimizations and cleanup.
2648 input was present. Minor optimizations and cleanup.
2643
2649
2644 (Logger): Remove old Changelog info for cleanup. This is the
2650 (Logger): Remove old Changelog info for cleanup. This is the
2645 information which was there from Janko's original code:
2651 information which was there from Janko's original code:
2646
2652
2647 Changes to Logger: - made the default log filename a parameter
2653 Changes to Logger: - made the default log filename a parameter
2648
2654
2649 - put a check for lines beginning with !@? in log(). Needed
2655 - put a check for lines beginning with !@? in log(). Needed
2650 (even if the handlers properly log their lines) for mid-session
2656 (even if the handlers properly log their lines) for mid-session
2651 logging activation to work properly. Without this, lines logged
2657 logging activation to work properly. Without this, lines logged
2652 in mid session, which get read from the cache, would end up
2658 in mid session, which get read from the cache, would end up
2653 'bare' (with !@? in the open) in the log. Now they are caught
2659 'bare' (with !@? in the open) in the log. Now they are caught
2654 and prepended with a #.
2660 and prepended with a #.
2655
2661
2656 * IPython/iplib.py (InteractiveShell.init_readline): added check
2662 * IPython/iplib.py (InteractiveShell.init_readline): added check
2657 in case MagicCompleter fails to be defined, so we don't crash.
2663 in case MagicCompleter fails to be defined, so we don't crash.
2658
2664
2659 2004-07-13 Fernando Perez <fperez@colorado.edu>
2665 2004-07-13 Fernando Perez <fperez@colorado.edu>
2660
2666
2661 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2667 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2662 of EPS if the requested filename ends in '.eps'.
2668 of EPS if the requested filename ends in '.eps'.
2663
2669
2664 2004-07-04 Fernando Perez <fperez@colorado.edu>
2670 2004-07-04 Fernando Perez <fperez@colorado.edu>
2665
2671
2666 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2672 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2667 escaping of quotes when calling the shell.
2673 escaping of quotes when calling the shell.
2668
2674
2669 2004-07-02 Fernando Perez <fperez@colorado.edu>
2675 2004-07-02 Fernando Perez <fperez@colorado.edu>
2670
2676
2671 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2677 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2672 gettext not working because we were clobbering '_'. Fixes
2678 gettext not working because we were clobbering '_'. Fixes
2673 http://www.scipy.net/roundup/ipython/issue6.
2679 http://www.scipy.net/roundup/ipython/issue6.
2674
2680
2675 2004-07-01 Fernando Perez <fperez@colorado.edu>
2681 2004-07-01 Fernando Perez <fperez@colorado.edu>
2676
2682
2677 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2683 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2678 into @cd. Patch by Ville.
2684 into @cd. Patch by Ville.
2679
2685
2680 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2686 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2681 new function to store things after ipmaker runs. Patch by Ville.
2687 new function to store things after ipmaker runs. Patch by Ville.
2682 Eventually this will go away once ipmaker is removed and the class
2688 Eventually this will go away once ipmaker is removed and the class
2683 gets cleaned up, but for now it's ok. Key functionality here is
2689 gets cleaned up, but for now it's ok. Key functionality here is
2684 the addition of the persistent storage mechanism, a dict for
2690 the addition of the persistent storage mechanism, a dict for
2685 keeping data across sessions (for now just bookmarks, but more can
2691 keeping data across sessions (for now just bookmarks, but more can
2686 be implemented later).
2692 be implemented later).
2687
2693
2688 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2694 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2689 persistent across sections. Patch by Ville, I modified it
2695 persistent across sections. Patch by Ville, I modified it
2690 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2696 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2691 added a '-l' option to list all bookmarks.
2697 added a '-l' option to list all bookmarks.
2692
2698
2693 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2699 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2694 center for cleanup. Registered with atexit.register(). I moved
2700 center for cleanup. Registered with atexit.register(). I moved
2695 here the old exit_cleanup(). After a patch by Ville.
2701 here the old exit_cleanup(). After a patch by Ville.
2696
2702
2697 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2703 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2698 characters in the hacked shlex_split for python 2.2.
2704 characters in the hacked shlex_split for python 2.2.
2699
2705
2700 * IPython/iplib.py (file_matches): more fixes to filenames with
2706 * IPython/iplib.py (file_matches): more fixes to filenames with
2701 whitespace in them. It's not perfect, but limitations in python's
2707 whitespace in them. It's not perfect, but limitations in python's
2702 readline make it impossible to go further.
2708 readline make it impossible to go further.
2703
2709
2704 2004-06-29 Fernando Perez <fperez@colorado.edu>
2710 2004-06-29 Fernando Perez <fperez@colorado.edu>
2705
2711
2706 * IPython/iplib.py (file_matches): escape whitespace correctly in
2712 * IPython/iplib.py (file_matches): escape whitespace correctly in
2707 filename completions. Bug reported by Ville.
2713 filename completions. Bug reported by Ville.
2708
2714
2709 2004-06-28 Fernando Perez <fperez@colorado.edu>
2715 2004-06-28 Fernando Perez <fperez@colorado.edu>
2710
2716
2711 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2717 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2712 the history file will be called 'history-PROFNAME' (or just
2718 the history file will be called 'history-PROFNAME' (or just
2713 'history' if no profile is loaded). I was getting annoyed at
2719 'history' if no profile is loaded). I was getting annoyed at
2714 getting my Numerical work history clobbered by pysh sessions.
2720 getting my Numerical work history clobbered by pysh sessions.
2715
2721
2716 * IPython/iplib.py (InteractiveShell.__init__): Internal
2722 * IPython/iplib.py (InteractiveShell.__init__): Internal
2717 getoutputerror() function so that we can honor the system_verbose
2723 getoutputerror() function so that we can honor the system_verbose
2718 flag for _all_ system calls. I also added escaping of #
2724 flag for _all_ system calls. I also added escaping of #
2719 characters here to avoid confusing Itpl.
2725 characters here to avoid confusing Itpl.
2720
2726
2721 * IPython/Magic.py (shlex_split): removed call to shell in
2727 * IPython/Magic.py (shlex_split): removed call to shell in
2722 parse_options and replaced it with shlex.split(). The annoying
2728 parse_options and replaced it with shlex.split(). The annoying
2723 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2729 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2724 to backport it from 2.3, with several frail hacks (the shlex
2730 to backport it from 2.3, with several frail hacks (the shlex
2725 module is rather limited in 2.2). Thanks to a suggestion by Ville
2731 module is rather limited in 2.2). Thanks to a suggestion by Ville
2726 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2732 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2727 problem.
2733 problem.
2728
2734
2729 (Magic.magic_system_verbose): new toggle to print the actual
2735 (Magic.magic_system_verbose): new toggle to print the actual
2730 system calls made by ipython. Mainly for debugging purposes.
2736 system calls made by ipython. Mainly for debugging purposes.
2731
2737
2732 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2738 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2733 doesn't support persistence. Reported (and fix suggested) by
2739 doesn't support persistence. Reported (and fix suggested) by
2734 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2740 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2735
2741
2736 2004-06-26 Fernando Perez <fperez@colorado.edu>
2742 2004-06-26 Fernando Perez <fperez@colorado.edu>
2737
2743
2738 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2744 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2739 continue prompts.
2745 continue prompts.
2740
2746
2741 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2747 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2742 function (basically a big docstring) and a few more things here to
2748 function (basically a big docstring) and a few more things here to
2743 speedup startup. pysh.py is now very lightweight. We want because
2749 speedup startup. pysh.py is now very lightweight. We want because
2744 it gets execfile'd, while InterpreterExec gets imported, so
2750 it gets execfile'd, while InterpreterExec gets imported, so
2745 byte-compilation saves time.
2751 byte-compilation saves time.
2746
2752
2747 2004-06-25 Fernando Perez <fperez@colorado.edu>
2753 2004-06-25 Fernando Perez <fperez@colorado.edu>
2748
2754
2749 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2755 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2750 -NUM', which was recently broken.
2756 -NUM', which was recently broken.
2751
2757
2752 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2758 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2753 in multi-line input (but not !!, which doesn't make sense there).
2759 in multi-line input (but not !!, which doesn't make sense there).
2754
2760
2755 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2761 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2756 It's just too useful, and people can turn it off in the less
2762 It's just too useful, and people can turn it off in the less
2757 common cases where it's a problem.
2763 common cases where it's a problem.
2758
2764
2759 2004-06-24 Fernando Perez <fperez@colorado.edu>
2765 2004-06-24 Fernando Perez <fperez@colorado.edu>
2760
2766
2761 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2767 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2762 special syntaxes (like alias calling) is now allied in multi-line
2768 special syntaxes (like alias calling) is now allied in multi-line
2763 input. This is still _very_ experimental, but it's necessary for
2769 input. This is still _very_ experimental, but it's necessary for
2764 efficient shell usage combining python looping syntax with system
2770 efficient shell usage combining python looping syntax with system
2765 calls. For now it's restricted to aliases, I don't think it
2771 calls. For now it's restricted to aliases, I don't think it
2766 really even makes sense to have this for magics.
2772 really even makes sense to have this for magics.
2767
2773
2768 2004-06-23 Fernando Perez <fperez@colorado.edu>
2774 2004-06-23 Fernando Perez <fperez@colorado.edu>
2769
2775
2770 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2776 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2771 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2777 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2772
2778
2773 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2779 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2774 extensions under Windows (after code sent by Gary Bishop). The
2780 extensions under Windows (after code sent by Gary Bishop). The
2775 extensions considered 'executable' are stored in IPython's rc
2781 extensions considered 'executable' are stored in IPython's rc
2776 structure as win_exec_ext.
2782 structure as win_exec_ext.
2777
2783
2778 * IPython/genutils.py (shell): new function, like system() but
2784 * IPython/genutils.py (shell): new function, like system() but
2779 without return value. Very useful for interactive shell work.
2785 without return value. Very useful for interactive shell work.
2780
2786
2781 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2787 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2782 delete aliases.
2788 delete aliases.
2783
2789
2784 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2790 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2785 sure that the alias table doesn't contain python keywords.
2791 sure that the alias table doesn't contain python keywords.
2786
2792
2787 2004-06-21 Fernando Perez <fperez@colorado.edu>
2793 2004-06-21 Fernando Perez <fperez@colorado.edu>
2788
2794
2789 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2795 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2790 non-existent items are found in $PATH. Reported by Thorsten.
2796 non-existent items are found in $PATH. Reported by Thorsten.
2791
2797
2792 2004-06-20 Fernando Perez <fperez@colorado.edu>
2798 2004-06-20 Fernando Perez <fperez@colorado.edu>
2793
2799
2794 * IPython/iplib.py (complete): modified the completer so that the
2800 * IPython/iplib.py (complete): modified the completer so that the
2795 order of priorities can be easily changed at runtime.
2801 order of priorities can be easily changed at runtime.
2796
2802
2797 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2803 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2798 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2804 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2799
2805
2800 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2806 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2801 expand Python variables prepended with $ in all system calls. The
2807 expand Python variables prepended with $ in all system calls. The
2802 same was done to InteractiveShell.handle_shell_escape. Now all
2808 same was done to InteractiveShell.handle_shell_escape. Now all
2803 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2809 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2804 expansion of python variables and expressions according to the
2810 expansion of python variables and expressions according to the
2805 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2811 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2806
2812
2807 Though PEP-215 has been rejected, a similar (but simpler) one
2813 Though PEP-215 has been rejected, a similar (but simpler) one
2808 seems like it will go into Python 2.4, PEP-292 -
2814 seems like it will go into Python 2.4, PEP-292 -
2809 http://www.python.org/peps/pep-0292.html.
2815 http://www.python.org/peps/pep-0292.html.
2810
2816
2811 I'll keep the full syntax of PEP-215, since IPython has since the
2817 I'll keep the full syntax of PEP-215, since IPython has since the
2812 start used Ka-Ping Yee's reference implementation discussed there
2818 start used Ka-Ping Yee's reference implementation discussed there
2813 (Itpl), and I actually like the powerful semantics it offers.
2819 (Itpl), and I actually like the powerful semantics it offers.
2814
2820
2815 In order to access normal shell variables, the $ has to be escaped
2821 In order to access normal shell variables, the $ has to be escaped
2816 via an extra $. For example:
2822 via an extra $. For example:
2817
2823
2818 In [7]: PATH='a python variable'
2824 In [7]: PATH='a python variable'
2819
2825
2820 In [8]: !echo $PATH
2826 In [8]: !echo $PATH
2821 a python variable
2827 a python variable
2822
2828
2823 In [9]: !echo $$PATH
2829 In [9]: !echo $$PATH
2824 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2830 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2825
2831
2826 (Magic.parse_options): escape $ so the shell doesn't evaluate
2832 (Magic.parse_options): escape $ so the shell doesn't evaluate
2827 things prematurely.
2833 things prematurely.
2828
2834
2829 * IPython/iplib.py (InteractiveShell.call_alias): added the
2835 * IPython/iplib.py (InteractiveShell.call_alias): added the
2830 ability for aliases to expand python variables via $.
2836 ability for aliases to expand python variables via $.
2831
2837
2832 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2838 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2833 system, now there's a @rehash/@rehashx pair of magics. These work
2839 system, now there's a @rehash/@rehashx pair of magics. These work
2834 like the csh rehash command, and can be invoked at any time. They
2840 like the csh rehash command, and can be invoked at any time. They
2835 build a table of aliases to everything in the user's $PATH
2841 build a table of aliases to everything in the user's $PATH
2836 (@rehash uses everything, @rehashx is slower but only adds
2842 (@rehash uses everything, @rehashx is slower but only adds
2837 executable files). With this, the pysh.py-based shell profile can
2843 executable files). With this, the pysh.py-based shell profile can
2838 now simply call rehash upon startup, and full access to all
2844 now simply call rehash upon startup, and full access to all
2839 programs in the user's path is obtained.
2845 programs in the user's path is obtained.
2840
2846
2841 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2847 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2842 functionality is now fully in place. I removed the old dynamic
2848 functionality is now fully in place. I removed the old dynamic
2843 code generation based approach, in favor of a much lighter one
2849 code generation based approach, in favor of a much lighter one
2844 based on a simple dict. The advantage is that this allows me to
2850 based on a simple dict. The advantage is that this allows me to
2845 now have thousands of aliases with negligible cost (unthinkable
2851 now have thousands of aliases with negligible cost (unthinkable
2846 with the old system).
2852 with the old system).
2847
2853
2848 2004-06-19 Fernando Perez <fperez@colorado.edu>
2854 2004-06-19 Fernando Perez <fperez@colorado.edu>
2849
2855
2850 * IPython/iplib.py (__init__): extended MagicCompleter class to
2856 * IPython/iplib.py (__init__): extended MagicCompleter class to
2851 also complete (last in priority) on user aliases.
2857 also complete (last in priority) on user aliases.
2852
2858
2853 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2859 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2854 call to eval.
2860 call to eval.
2855 (ItplNS.__init__): Added a new class which functions like Itpl,
2861 (ItplNS.__init__): Added a new class which functions like Itpl,
2856 but allows configuring the namespace for the evaluation to occur
2862 but allows configuring the namespace for the evaluation to occur
2857 in.
2863 in.
2858
2864
2859 2004-06-18 Fernando Perez <fperez@colorado.edu>
2865 2004-06-18 Fernando Perez <fperez@colorado.edu>
2860
2866
2861 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2867 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2862 better message when 'exit' or 'quit' are typed (a common newbie
2868 better message when 'exit' or 'quit' are typed (a common newbie
2863 confusion).
2869 confusion).
2864
2870
2865 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2871 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2866 check for Windows users.
2872 check for Windows users.
2867
2873
2868 * IPython/iplib.py (InteractiveShell.user_setup): removed
2874 * IPython/iplib.py (InteractiveShell.user_setup): removed
2869 disabling of colors for Windows. I'll test at runtime and issue a
2875 disabling of colors for Windows. I'll test at runtime and issue a
2870 warning if Gary's readline isn't found, as to nudge users to
2876 warning if Gary's readline isn't found, as to nudge users to
2871 download it.
2877 download it.
2872
2878
2873 2004-06-16 Fernando Perez <fperez@colorado.edu>
2879 2004-06-16 Fernando Perez <fperez@colorado.edu>
2874
2880
2875 * IPython/genutils.py (Stream.__init__): changed to print errors
2881 * IPython/genutils.py (Stream.__init__): changed to print errors
2876 to sys.stderr. I had a circular dependency here. Now it's
2882 to sys.stderr. I had a circular dependency here. Now it's
2877 possible to run ipython as IDLE's shell (consider this pre-alpha,
2883 possible to run ipython as IDLE's shell (consider this pre-alpha,
2878 since true stdout things end up in the starting terminal instead
2884 since true stdout things end up in the starting terminal instead
2879 of IDLE's out).
2885 of IDLE's out).
2880
2886
2881 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2887 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2882 users who haven't # updated their prompt_in2 definitions. Remove
2888 users who haven't # updated their prompt_in2 definitions. Remove
2883 eventually.
2889 eventually.
2884 (multiple_replace): added credit to original ASPN recipe.
2890 (multiple_replace): added credit to original ASPN recipe.
2885
2891
2886 2004-06-15 Fernando Perez <fperez@colorado.edu>
2892 2004-06-15 Fernando Perez <fperez@colorado.edu>
2887
2893
2888 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2894 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2889 list of auto-defined aliases.
2895 list of auto-defined aliases.
2890
2896
2891 2004-06-13 Fernando Perez <fperez@colorado.edu>
2897 2004-06-13 Fernando Perez <fperez@colorado.edu>
2892
2898
2893 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2899 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2894 install was really requested (so setup.py can be used for other
2900 install was really requested (so setup.py can be used for other
2895 things under Windows).
2901 things under Windows).
2896
2902
2897 2004-06-10 Fernando Perez <fperez@colorado.edu>
2903 2004-06-10 Fernando Perez <fperez@colorado.edu>
2898
2904
2899 * IPython/Logger.py (Logger.create_log): Manually remove any old
2905 * IPython/Logger.py (Logger.create_log): Manually remove any old
2900 backup, since os.remove may fail under Windows. Fixes bug
2906 backup, since os.remove may fail under Windows. Fixes bug
2901 reported by Thorsten.
2907 reported by Thorsten.
2902
2908
2903 2004-06-09 Fernando Perez <fperez@colorado.edu>
2909 2004-06-09 Fernando Perez <fperez@colorado.edu>
2904
2910
2905 * examples/example-embed.py: fixed all references to %n (replaced
2911 * examples/example-embed.py: fixed all references to %n (replaced
2906 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2912 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2907 for all examples and the manual as well.
2913 for all examples and the manual as well.
2908
2914
2909 2004-06-08 Fernando Perez <fperez@colorado.edu>
2915 2004-06-08 Fernando Perez <fperez@colorado.edu>
2910
2916
2911 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2917 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2912 alignment and color management. All 3 prompt subsystems now
2918 alignment and color management. All 3 prompt subsystems now
2913 inherit from BasePrompt.
2919 inherit from BasePrompt.
2914
2920
2915 * tools/release: updates for windows installer build and tag rpms
2921 * tools/release: updates for windows installer build and tag rpms
2916 with python version (since paths are fixed).
2922 with python version (since paths are fixed).
2917
2923
2918 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2924 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2919 which will become eventually obsolete. Also fixed the default
2925 which will become eventually obsolete. Also fixed the default
2920 prompt_in2 to use \D, so at least new users start with the correct
2926 prompt_in2 to use \D, so at least new users start with the correct
2921 defaults.
2927 defaults.
2922 WARNING: Users with existing ipythonrc files will need to apply
2928 WARNING: Users with existing ipythonrc files will need to apply
2923 this fix manually!
2929 this fix manually!
2924
2930
2925 * setup.py: make windows installer (.exe). This is finally the
2931 * setup.py: make windows installer (.exe). This is finally the
2926 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2932 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2927 which I hadn't included because it required Python 2.3 (or recent
2933 which I hadn't included because it required Python 2.3 (or recent
2928 distutils).
2934 distutils).
2929
2935
2930 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2936 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2931 usage of new '\D' escape.
2937 usage of new '\D' escape.
2932
2938
2933 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2939 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2934 lacks os.getuid())
2940 lacks os.getuid())
2935 (CachedOutput.set_colors): Added the ability to turn coloring
2941 (CachedOutput.set_colors): Added the ability to turn coloring
2936 on/off with @colors even for manually defined prompt colors. It
2942 on/off with @colors even for manually defined prompt colors. It
2937 uses a nasty global, but it works safely and via the generic color
2943 uses a nasty global, but it works safely and via the generic color
2938 handling mechanism.
2944 handling mechanism.
2939 (Prompt2.__init__): Introduced new escape '\D' for continuation
2945 (Prompt2.__init__): Introduced new escape '\D' for continuation
2940 prompts. It represents the counter ('\#') as dots.
2946 prompts. It represents the counter ('\#') as dots.
2941 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2947 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2942 need to update their ipythonrc files and replace '%n' with '\D' in
2948 need to update their ipythonrc files and replace '%n' with '\D' in
2943 their prompt_in2 settings everywhere. Sorry, but there's
2949 their prompt_in2 settings everywhere. Sorry, but there's
2944 otherwise no clean way to get all prompts to properly align. The
2950 otherwise no clean way to get all prompts to properly align. The
2945 ipythonrc shipped with IPython has been updated.
2951 ipythonrc shipped with IPython has been updated.
2946
2952
2947 2004-06-07 Fernando Perez <fperez@colorado.edu>
2953 2004-06-07 Fernando Perez <fperez@colorado.edu>
2948
2954
2949 * setup.py (isfile): Pass local_icons option to latex2html, so the
2955 * setup.py (isfile): Pass local_icons option to latex2html, so the
2950 resulting HTML file is self-contained. Thanks to
2956 resulting HTML file is self-contained. Thanks to
2951 dryice-AT-liu.com.cn for the tip.
2957 dryice-AT-liu.com.cn for the tip.
2952
2958
2953 * pysh.py: I created a new profile 'shell', which implements a
2959 * pysh.py: I created a new profile 'shell', which implements a
2954 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2960 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2955 system shell, nor will it become one anytime soon. It's mainly
2961 system shell, nor will it become one anytime soon. It's mainly
2956 meant to illustrate the use of the new flexible bash-like prompts.
2962 meant to illustrate the use of the new flexible bash-like prompts.
2957 I guess it could be used by hardy souls for true shell management,
2963 I guess it could be used by hardy souls for true shell management,
2958 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2964 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2959 profile. This uses the InterpreterExec extension provided by
2965 profile. This uses the InterpreterExec extension provided by
2960 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2966 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2961
2967
2962 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2968 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2963 auto-align itself with the length of the previous input prompt
2969 auto-align itself with the length of the previous input prompt
2964 (taking into account the invisible color escapes).
2970 (taking into account the invisible color escapes).
2965 (CachedOutput.__init__): Large restructuring of this class. Now
2971 (CachedOutput.__init__): Large restructuring of this class. Now
2966 all three prompts (primary1, primary2, output) are proper objects,
2972 all three prompts (primary1, primary2, output) are proper objects,
2967 managed by the 'parent' CachedOutput class. The code is still a
2973 managed by the 'parent' CachedOutput class. The code is still a
2968 bit hackish (all prompts share state via a pointer to the cache),
2974 bit hackish (all prompts share state via a pointer to the cache),
2969 but it's overall far cleaner than before.
2975 but it's overall far cleaner than before.
2970
2976
2971 * IPython/genutils.py (getoutputerror): modified to add verbose,
2977 * IPython/genutils.py (getoutputerror): modified to add verbose,
2972 debug and header options. This makes the interface of all getout*
2978 debug and header options. This makes the interface of all getout*
2973 functions uniform.
2979 functions uniform.
2974 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2980 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2975
2981
2976 * IPython/Magic.py (Magic.default_option): added a function to
2982 * IPython/Magic.py (Magic.default_option): added a function to
2977 allow registering default options for any magic command. This
2983 allow registering default options for any magic command. This
2978 makes it easy to have profiles which customize the magics globally
2984 makes it easy to have profiles which customize the magics globally
2979 for a certain use. The values set through this function are
2985 for a certain use. The values set through this function are
2980 picked up by the parse_options() method, which all magics should
2986 picked up by the parse_options() method, which all magics should
2981 use to parse their options.
2987 use to parse their options.
2982
2988
2983 * IPython/genutils.py (warn): modified the warnings framework to
2989 * IPython/genutils.py (warn): modified the warnings framework to
2984 use the Term I/O class. I'm trying to slowly unify all of
2990 use the Term I/O class. I'm trying to slowly unify all of
2985 IPython's I/O operations to pass through Term.
2991 IPython's I/O operations to pass through Term.
2986
2992
2987 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2993 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2988 the secondary prompt to correctly match the length of the primary
2994 the secondary prompt to correctly match the length of the primary
2989 one for any prompt. Now multi-line code will properly line up
2995 one for any prompt. Now multi-line code will properly line up
2990 even for path dependent prompts, such as the new ones available
2996 even for path dependent prompts, such as the new ones available
2991 via the prompt_specials.
2997 via the prompt_specials.
2992
2998
2993 2004-06-06 Fernando Perez <fperez@colorado.edu>
2999 2004-06-06 Fernando Perez <fperez@colorado.edu>
2994
3000
2995 * IPython/Prompts.py (prompt_specials): Added the ability to have
3001 * IPython/Prompts.py (prompt_specials): Added the ability to have
2996 bash-like special sequences in the prompts, which get
3002 bash-like special sequences in the prompts, which get
2997 automatically expanded. Things like hostname, current working
3003 automatically expanded. Things like hostname, current working
2998 directory and username are implemented already, but it's easy to
3004 directory and username are implemented already, but it's easy to
2999 add more in the future. Thanks to a patch by W.J. van der Laan
3005 add more in the future. Thanks to a patch by W.J. van der Laan
3000 <gnufnork-AT-hetdigitalegat.nl>
3006 <gnufnork-AT-hetdigitalegat.nl>
3001 (prompt_specials): Added color support for prompt strings, so
3007 (prompt_specials): Added color support for prompt strings, so
3002 users can define arbitrary color setups for their prompts.
3008 users can define arbitrary color setups for their prompts.
3003
3009
3004 2004-06-05 Fernando Perez <fperez@colorado.edu>
3010 2004-06-05 Fernando Perez <fperez@colorado.edu>
3005
3011
3006 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3012 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3007 code to load Gary Bishop's readline and configure it
3013 code to load Gary Bishop's readline and configure it
3008 automatically. Thanks to Gary for help on this.
3014 automatically. Thanks to Gary for help on this.
3009
3015
3010 2004-06-01 Fernando Perez <fperez@colorado.edu>
3016 2004-06-01 Fernando Perez <fperez@colorado.edu>
3011
3017
3012 * IPython/Logger.py (Logger.create_log): fix bug for logging
3018 * IPython/Logger.py (Logger.create_log): fix bug for logging
3013 with no filename (previous fix was incomplete).
3019 with no filename (previous fix was incomplete).
3014
3020
3015 2004-05-25 Fernando Perez <fperez@colorado.edu>
3021 2004-05-25 Fernando Perez <fperez@colorado.edu>
3016
3022
3017 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3023 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3018 parens would get passed to the shell.
3024 parens would get passed to the shell.
3019
3025
3020 2004-05-20 Fernando Perez <fperez@colorado.edu>
3026 2004-05-20 Fernando Perez <fperez@colorado.edu>
3021
3027
3022 * IPython/Magic.py (Magic.magic_prun): changed default profile
3028 * IPython/Magic.py (Magic.magic_prun): changed default profile
3023 sort order to 'time' (the more common profiling need).
3029 sort order to 'time' (the more common profiling need).
3024
3030
3025 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3031 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3026 so that source code shown is guaranteed in sync with the file on
3032 so that source code shown is guaranteed in sync with the file on
3027 disk (also changed in psource). Similar fix to the one for
3033 disk (also changed in psource). Similar fix to the one for
3028 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3034 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3029 <yann.ledu-AT-noos.fr>.
3035 <yann.ledu-AT-noos.fr>.
3030
3036
3031 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3037 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3032 with a single option would not be correctly parsed. Closes
3038 with a single option would not be correctly parsed. Closes
3033 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3039 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3034 introduced in 0.6.0 (on 2004-05-06).
3040 introduced in 0.6.0 (on 2004-05-06).
3035
3041
3036 2004-05-13 *** Released version 0.6.0
3042 2004-05-13 *** Released version 0.6.0
3037
3043
3038 2004-05-13 Fernando Perez <fperez@colorado.edu>
3044 2004-05-13 Fernando Perez <fperez@colorado.edu>
3039
3045
3040 * debian/: Added debian/ directory to CVS, so that debian support
3046 * debian/: Added debian/ directory to CVS, so that debian support
3041 is publicly accessible. The debian package is maintained by Jack
3047 is publicly accessible. The debian package is maintained by Jack
3042 Moffit <jack-AT-xiph.org>.
3048 Moffit <jack-AT-xiph.org>.
3043
3049
3044 * Documentation: included the notes about an ipython-based system
3050 * Documentation: included the notes about an ipython-based system
3045 shell (the hypothetical 'pysh') into the new_design.pdf document,
3051 shell (the hypothetical 'pysh') into the new_design.pdf document,
3046 so that these ideas get distributed to users along with the
3052 so that these ideas get distributed to users along with the
3047 official documentation.
3053 official documentation.
3048
3054
3049 2004-05-10 Fernando Perez <fperez@colorado.edu>
3055 2004-05-10 Fernando Perez <fperez@colorado.edu>
3050
3056
3051 * IPython/Logger.py (Logger.create_log): fix recently introduced
3057 * IPython/Logger.py (Logger.create_log): fix recently introduced
3052 bug (misindented line) where logstart would fail when not given an
3058 bug (misindented line) where logstart would fail when not given an
3053 explicit filename.
3059 explicit filename.
3054
3060
3055 2004-05-09 Fernando Perez <fperez@colorado.edu>
3061 2004-05-09 Fernando Perez <fperez@colorado.edu>
3056
3062
3057 * IPython/Magic.py (Magic.parse_options): skip system call when
3063 * IPython/Magic.py (Magic.parse_options): skip system call when
3058 there are no options to look for. Faster, cleaner for the common
3064 there are no options to look for. Faster, cleaner for the common
3059 case.
3065 case.
3060
3066
3061 * Documentation: many updates to the manual: describing Windows
3067 * Documentation: many updates to the manual: describing Windows
3062 support better, Gnuplot updates, credits, misc small stuff. Also
3068 support better, Gnuplot updates, credits, misc small stuff. Also
3063 updated the new_design doc a bit.
3069 updated the new_design doc a bit.
3064
3070
3065 2004-05-06 *** Released version 0.6.0.rc1
3071 2004-05-06 *** Released version 0.6.0.rc1
3066
3072
3067 2004-05-06 Fernando Perez <fperez@colorado.edu>
3073 2004-05-06 Fernando Perez <fperez@colorado.edu>
3068
3074
3069 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3075 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3070 operations to use the vastly more efficient list/''.join() method.
3076 operations to use the vastly more efficient list/''.join() method.
3071 (FormattedTB.text): Fix
3077 (FormattedTB.text): Fix
3072 http://www.scipy.net/roundup/ipython/issue12 - exception source
3078 http://www.scipy.net/roundup/ipython/issue12 - exception source
3073 extract not updated after reload. Thanks to Mike Salib
3079 extract not updated after reload. Thanks to Mike Salib
3074 <msalib-AT-mit.edu> for pinning the source of the problem.
3080 <msalib-AT-mit.edu> for pinning the source of the problem.
3075 Fortunately, the solution works inside ipython and doesn't require
3081 Fortunately, the solution works inside ipython and doesn't require
3076 any changes to python proper.
3082 any changes to python proper.
3077
3083
3078 * IPython/Magic.py (Magic.parse_options): Improved to process the
3084 * IPython/Magic.py (Magic.parse_options): Improved to process the
3079 argument list as a true shell would (by actually using the
3085 argument list as a true shell would (by actually using the
3080 underlying system shell). This way, all @magics automatically get
3086 underlying system shell). This way, all @magics automatically get
3081 shell expansion for variables. Thanks to a comment by Alex
3087 shell expansion for variables. Thanks to a comment by Alex
3082 Schmolck.
3088 Schmolck.
3083
3089
3084 2004-04-04 Fernando Perez <fperez@colorado.edu>
3090 2004-04-04 Fernando Perez <fperez@colorado.edu>
3085
3091
3086 * IPython/iplib.py (InteractiveShell.interact): Added a special
3092 * IPython/iplib.py (InteractiveShell.interact): Added a special
3087 trap for a debugger quit exception, which is basically impossible
3093 trap for a debugger quit exception, which is basically impossible
3088 to handle by normal mechanisms, given what pdb does to the stack.
3094 to handle by normal mechanisms, given what pdb does to the stack.
3089 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3095 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3090
3096
3091 2004-04-03 Fernando Perez <fperez@colorado.edu>
3097 2004-04-03 Fernando Perez <fperez@colorado.edu>
3092
3098
3093 * IPython/genutils.py (Term): Standardized the names of the Term
3099 * IPython/genutils.py (Term): Standardized the names of the Term
3094 class streams to cin/cout/cerr, following C++ naming conventions
3100 class streams to cin/cout/cerr, following C++ naming conventions
3095 (I can't use in/out/err because 'in' is not a valid attribute
3101 (I can't use in/out/err because 'in' is not a valid attribute
3096 name).
3102 name).
3097
3103
3098 * IPython/iplib.py (InteractiveShell.interact): don't increment
3104 * IPython/iplib.py (InteractiveShell.interact): don't increment
3099 the prompt if there's no user input. By Daniel 'Dang' Griffith
3105 the prompt if there's no user input. By Daniel 'Dang' Griffith
3100 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3106 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3101 Francois Pinard.
3107 Francois Pinard.
3102
3108
3103 2004-04-02 Fernando Perez <fperez@colorado.edu>
3109 2004-04-02 Fernando Perez <fperez@colorado.edu>
3104
3110
3105 * IPython/genutils.py (Stream.__init__): Modified to survive at
3111 * IPython/genutils.py (Stream.__init__): Modified to survive at
3106 least importing in contexts where stdin/out/err aren't true file
3112 least importing in contexts where stdin/out/err aren't true file
3107 objects, such as PyCrust (they lack fileno() and mode). However,
3113 objects, such as PyCrust (they lack fileno() and mode). However,
3108 the recovery facilities which rely on these things existing will
3114 the recovery facilities which rely on these things existing will
3109 not work.
3115 not work.
3110
3116
3111 2004-04-01 Fernando Perez <fperez@colorado.edu>
3117 2004-04-01 Fernando Perez <fperez@colorado.edu>
3112
3118
3113 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3119 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3114 use the new getoutputerror() function, so it properly
3120 use the new getoutputerror() function, so it properly
3115 distinguishes stdout/err.
3121 distinguishes stdout/err.
3116
3122
3117 * IPython/genutils.py (getoutputerror): added a function to
3123 * IPython/genutils.py (getoutputerror): added a function to
3118 capture separately the standard output and error of a command.
3124 capture separately the standard output and error of a command.
3119 After a comment from dang on the mailing lists. This code is
3125 After a comment from dang on the mailing lists. This code is
3120 basically a modified version of commands.getstatusoutput(), from
3126 basically a modified version of commands.getstatusoutput(), from
3121 the standard library.
3127 the standard library.
3122
3128
3123 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3129 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3124 '!!' as a special syntax (shorthand) to access @sx.
3130 '!!' as a special syntax (shorthand) to access @sx.
3125
3131
3126 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3132 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3127 command and return its output as a list split on '\n'.
3133 command and return its output as a list split on '\n'.
3128
3134
3129 2004-03-31 Fernando Perez <fperez@colorado.edu>
3135 2004-03-31 Fernando Perez <fperez@colorado.edu>
3130
3136
3131 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3137 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3132 method to dictionaries used as FakeModule instances if they lack
3138 method to dictionaries used as FakeModule instances if they lack
3133 it. At least pydoc in python2.3 breaks for runtime-defined
3139 it. At least pydoc in python2.3 breaks for runtime-defined
3134 functions without this hack. At some point I need to _really_
3140 functions without this hack. At some point I need to _really_
3135 understand what FakeModule is doing, because it's a gross hack.
3141 understand what FakeModule is doing, because it's a gross hack.
3136 But it solves Arnd's problem for now...
3142 But it solves Arnd's problem for now...
3137
3143
3138 2004-02-27 Fernando Perez <fperez@colorado.edu>
3144 2004-02-27 Fernando Perez <fperez@colorado.edu>
3139
3145
3140 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3146 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3141 mode would behave erratically. Also increased the number of
3147 mode would behave erratically. Also increased the number of
3142 possible logs in rotate mod to 999. Thanks to Rod Holland
3148 possible logs in rotate mod to 999. Thanks to Rod Holland
3143 <rhh@StructureLABS.com> for the report and fixes.
3149 <rhh@StructureLABS.com> for the report and fixes.
3144
3150
3145 2004-02-26 Fernando Perez <fperez@colorado.edu>
3151 2004-02-26 Fernando Perez <fperez@colorado.edu>
3146
3152
3147 * IPython/genutils.py (page): Check that the curses module really
3153 * IPython/genutils.py (page): Check that the curses module really
3148 has the initscr attribute before trying to use it. For some
3154 has the initscr attribute before trying to use it. For some
3149 reason, the Solaris curses module is missing this. I think this
3155 reason, the Solaris curses module is missing this. I think this
3150 should be considered a Solaris python bug, but I'm not sure.
3156 should be considered a Solaris python bug, but I'm not sure.
3151
3157
3152 2004-01-17 Fernando Perez <fperez@colorado.edu>
3158 2004-01-17 Fernando Perez <fperez@colorado.edu>
3153
3159
3154 * IPython/genutils.py (Stream.__init__): Changes to try to make
3160 * IPython/genutils.py (Stream.__init__): Changes to try to make
3155 ipython robust against stdin/out/err being closed by the user.
3161 ipython robust against stdin/out/err being closed by the user.
3156 This is 'user error' (and blocks a normal python session, at least
3162 This is 'user error' (and blocks a normal python session, at least
3157 the stdout case). However, Ipython should be able to survive such
3163 the stdout case). However, Ipython should be able to survive such
3158 instances of abuse as gracefully as possible. To simplify the
3164 instances of abuse as gracefully as possible. To simplify the
3159 coding and maintain compatibility with Gary Bishop's Term
3165 coding and maintain compatibility with Gary Bishop's Term
3160 contributions, I've made use of classmethods for this. I think
3166 contributions, I've made use of classmethods for this. I think
3161 this introduces a dependency on python 2.2.
3167 this introduces a dependency on python 2.2.
3162
3168
3163 2004-01-13 Fernando Perez <fperez@colorado.edu>
3169 2004-01-13 Fernando Perez <fperez@colorado.edu>
3164
3170
3165 * IPython/numutils.py (exp_safe): simplified the code a bit and
3171 * IPython/numutils.py (exp_safe): simplified the code a bit and
3166 removed the need for importing the kinds module altogether.
3172 removed the need for importing the kinds module altogether.
3167
3173
3168 2004-01-06 Fernando Perez <fperez@colorado.edu>
3174 2004-01-06 Fernando Perez <fperez@colorado.edu>
3169
3175
3170 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3176 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3171 a magic function instead, after some community feedback. No
3177 a magic function instead, after some community feedback. No
3172 special syntax will exist for it, but its name is deliberately
3178 special syntax will exist for it, but its name is deliberately
3173 very short.
3179 very short.
3174
3180
3175 2003-12-20 Fernando Perez <fperez@colorado.edu>
3181 2003-12-20 Fernando Perez <fperez@colorado.edu>
3176
3182
3177 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3183 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3178 new functionality, to automagically assign the result of a shell
3184 new functionality, to automagically assign the result of a shell
3179 command to a variable. I'll solicit some community feedback on
3185 command to a variable. I'll solicit some community feedback on
3180 this before making it permanent.
3186 this before making it permanent.
3181
3187
3182 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3188 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3183 requested about callables for which inspect couldn't obtain a
3189 requested about callables for which inspect couldn't obtain a
3184 proper argspec. Thanks to a crash report sent by Etienne
3190 proper argspec. Thanks to a crash report sent by Etienne
3185 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3191 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3186
3192
3187 2003-12-09 Fernando Perez <fperez@colorado.edu>
3193 2003-12-09 Fernando Perez <fperez@colorado.edu>
3188
3194
3189 * IPython/genutils.py (page): patch for the pager to work across
3195 * IPython/genutils.py (page): patch for the pager to work across
3190 various versions of Windows. By Gary Bishop.
3196 various versions of Windows. By Gary Bishop.
3191
3197
3192 2003-12-04 Fernando Perez <fperez@colorado.edu>
3198 2003-12-04 Fernando Perez <fperez@colorado.edu>
3193
3199
3194 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3200 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3195 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3201 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3196 While I tested this and it looks ok, there may still be corner
3202 While I tested this and it looks ok, there may still be corner
3197 cases I've missed.
3203 cases I've missed.
3198
3204
3199 2003-12-01 Fernando Perez <fperez@colorado.edu>
3205 2003-12-01 Fernando Perez <fperez@colorado.edu>
3200
3206
3201 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3207 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3202 where a line like 'p,q=1,2' would fail because the automagic
3208 where a line like 'p,q=1,2' would fail because the automagic
3203 system would be triggered for @p.
3209 system would be triggered for @p.
3204
3210
3205 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3211 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3206 cleanups, code unmodified.
3212 cleanups, code unmodified.
3207
3213
3208 * IPython/genutils.py (Term): added a class for IPython to handle
3214 * IPython/genutils.py (Term): added a class for IPython to handle
3209 output. In most cases it will just be a proxy for stdout/err, but
3215 output. In most cases it will just be a proxy for stdout/err, but
3210 having this allows modifications to be made for some platforms,
3216 having this allows modifications to be made for some platforms,
3211 such as handling color escapes under Windows. All of this code
3217 such as handling color escapes under Windows. All of this code
3212 was contributed by Gary Bishop, with minor modifications by me.
3218 was contributed by Gary Bishop, with minor modifications by me.
3213 The actual changes affect many files.
3219 The actual changes affect many files.
3214
3220
3215 2003-11-30 Fernando Perez <fperez@colorado.edu>
3221 2003-11-30 Fernando Perez <fperez@colorado.edu>
3216
3222
3217 * IPython/iplib.py (file_matches): new completion code, courtesy
3223 * IPython/iplib.py (file_matches): new completion code, courtesy
3218 of Jeff Collins. This enables filename completion again under
3224 of Jeff Collins. This enables filename completion again under
3219 python 2.3, which disabled it at the C level.
3225 python 2.3, which disabled it at the C level.
3220
3226
3221 2003-11-11 Fernando Perez <fperez@colorado.edu>
3227 2003-11-11 Fernando Perez <fperez@colorado.edu>
3222
3228
3223 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3229 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3224 for Numeric.array(map(...)), but often convenient.
3230 for Numeric.array(map(...)), but often convenient.
3225
3231
3226 2003-11-05 Fernando Perez <fperez@colorado.edu>
3232 2003-11-05 Fernando Perez <fperez@colorado.edu>
3227
3233
3228 * IPython/numutils.py (frange): Changed a call from int() to
3234 * IPython/numutils.py (frange): Changed a call from int() to
3229 int(round()) to prevent a problem reported with arange() in the
3235 int(round()) to prevent a problem reported with arange() in the
3230 numpy list.
3236 numpy list.
3231
3237
3232 2003-10-06 Fernando Perez <fperez@colorado.edu>
3238 2003-10-06 Fernando Perez <fperez@colorado.edu>
3233
3239
3234 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3240 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3235 prevent crashes if sys lacks an argv attribute (it happens with
3241 prevent crashes if sys lacks an argv attribute (it happens with
3236 embedded interpreters which build a bare-bones sys module).
3242 embedded interpreters which build a bare-bones sys module).
3237 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3243 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3238
3244
3239 2003-09-24 Fernando Perez <fperez@colorado.edu>
3245 2003-09-24 Fernando Perez <fperez@colorado.edu>
3240
3246
3241 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3247 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3242 to protect against poorly written user objects where __getattr__
3248 to protect against poorly written user objects where __getattr__
3243 raises exceptions other than AttributeError. Thanks to a bug
3249 raises exceptions other than AttributeError. Thanks to a bug
3244 report by Oliver Sander <osander-AT-gmx.de>.
3250 report by Oliver Sander <osander-AT-gmx.de>.
3245
3251
3246 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3252 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3247 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3253 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3248
3254
3249 2003-09-09 Fernando Perez <fperez@colorado.edu>
3255 2003-09-09 Fernando Perez <fperez@colorado.edu>
3250
3256
3251 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3257 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3252 unpacking a list whith a callable as first element would
3258 unpacking a list whith a callable as first element would
3253 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3259 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3254 Collins.
3260 Collins.
3255
3261
3256 2003-08-25 *** Released version 0.5.0
3262 2003-08-25 *** Released version 0.5.0
3257
3263
3258 2003-08-22 Fernando Perez <fperez@colorado.edu>
3264 2003-08-22 Fernando Perez <fperez@colorado.edu>
3259
3265
3260 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3266 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3261 improperly defined user exceptions. Thanks to feedback from Mark
3267 improperly defined user exceptions. Thanks to feedback from Mark
3262 Russell <mrussell-AT-verio.net>.
3268 Russell <mrussell-AT-verio.net>.
3263
3269
3264 2003-08-20 Fernando Perez <fperez@colorado.edu>
3270 2003-08-20 Fernando Perez <fperez@colorado.edu>
3265
3271
3266 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3272 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3267 printing so that it would print multi-line string forms starting
3273 printing so that it would print multi-line string forms starting
3268 with a new line. This way the formatting is better respected for
3274 with a new line. This way the formatting is better respected for
3269 objects which work hard to make nice string forms.
3275 objects which work hard to make nice string forms.
3270
3276
3271 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3277 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3272 autocall would overtake data access for objects with both
3278 autocall would overtake data access for objects with both
3273 __getitem__ and __call__.
3279 __getitem__ and __call__.
3274
3280
3275 2003-08-19 *** Released version 0.5.0-rc1
3281 2003-08-19 *** Released version 0.5.0-rc1
3276
3282
3277 2003-08-19 Fernando Perez <fperez@colorado.edu>
3283 2003-08-19 Fernando Perez <fperez@colorado.edu>
3278
3284
3279 * IPython/deep_reload.py (load_tail): single tiny change here
3285 * IPython/deep_reload.py (load_tail): single tiny change here
3280 seems to fix the long-standing bug of dreload() failing to work
3286 seems to fix the long-standing bug of dreload() failing to work
3281 for dotted names. But this module is pretty tricky, so I may have
3287 for dotted names. But this module is pretty tricky, so I may have
3282 missed some subtlety. Needs more testing!.
3288 missed some subtlety. Needs more testing!.
3283
3289
3284 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3290 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3285 exceptions which have badly implemented __str__ methods.
3291 exceptions which have badly implemented __str__ methods.
3286 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3292 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3287 which I've been getting reports about from Python 2.3 users. I
3293 which I've been getting reports about from Python 2.3 users. I
3288 wish I had a simple test case to reproduce the problem, so I could
3294 wish I had a simple test case to reproduce the problem, so I could
3289 either write a cleaner workaround or file a bug report if
3295 either write a cleaner workaround or file a bug report if
3290 necessary.
3296 necessary.
3291
3297
3292 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3298 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3293 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3299 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3294 a bug report by Tjabo Kloppenburg.
3300 a bug report by Tjabo Kloppenburg.
3295
3301
3296 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3302 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3297 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3303 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3298 seems rather unstable. Thanks to a bug report by Tjabo
3304 seems rather unstable. Thanks to a bug report by Tjabo
3299 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3305 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3300
3306
3301 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3307 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3302 this out soon because of the critical fixes in the inner loop for
3308 this out soon because of the critical fixes in the inner loop for
3303 generators.
3309 generators.
3304
3310
3305 * IPython/Magic.py (Magic.getargspec): removed. This (and
3311 * IPython/Magic.py (Magic.getargspec): removed. This (and
3306 _get_def) have been obsoleted by OInspect for a long time, I
3312 _get_def) have been obsoleted by OInspect for a long time, I
3307 hadn't noticed that they were dead code.
3313 hadn't noticed that they were dead code.
3308 (Magic._ofind): restored _ofind functionality for a few literals
3314 (Magic._ofind): restored _ofind functionality for a few literals
3309 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3315 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3310 for things like "hello".capitalize?, since that would require a
3316 for things like "hello".capitalize?, since that would require a
3311 potentially dangerous eval() again.
3317 potentially dangerous eval() again.
3312
3318
3313 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3319 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3314 logic a bit more to clean up the escapes handling and minimize the
3320 logic a bit more to clean up the escapes handling and minimize the
3315 use of _ofind to only necessary cases. The interactive 'feel' of
3321 use of _ofind to only necessary cases. The interactive 'feel' of
3316 IPython should have improved quite a bit with the changes in
3322 IPython should have improved quite a bit with the changes in
3317 _prefilter and _ofind (besides being far safer than before).
3323 _prefilter and _ofind (besides being far safer than before).
3318
3324
3319 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3325 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3320 obscure, never reported). Edit would fail to find the object to
3326 obscure, never reported). Edit would fail to find the object to
3321 edit under some circumstances.
3327 edit under some circumstances.
3322 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3328 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3323 which were causing double-calling of generators. Those eval calls
3329 which were causing double-calling of generators. Those eval calls
3324 were _very_ dangerous, since code with side effects could be
3330 were _very_ dangerous, since code with side effects could be
3325 triggered. As they say, 'eval is evil'... These were the
3331 triggered. As they say, 'eval is evil'... These were the
3326 nastiest evals in IPython. Besides, _ofind is now far simpler,
3332 nastiest evals in IPython. Besides, _ofind is now far simpler,
3327 and it should also be quite a bit faster. Its use of inspect is
3333 and it should also be quite a bit faster. Its use of inspect is
3328 also safer, so perhaps some of the inspect-related crashes I've
3334 also safer, so perhaps some of the inspect-related crashes I've
3329 seen lately with Python 2.3 might be taken care of. That will
3335 seen lately with Python 2.3 might be taken care of. That will
3330 need more testing.
3336 need more testing.
3331
3337
3332 2003-08-17 Fernando Perez <fperez@colorado.edu>
3338 2003-08-17 Fernando Perez <fperez@colorado.edu>
3333
3339
3334 * IPython/iplib.py (InteractiveShell._prefilter): significant
3340 * IPython/iplib.py (InteractiveShell._prefilter): significant
3335 simplifications to the logic for handling user escapes. Faster
3341 simplifications to the logic for handling user escapes. Faster
3336 and simpler code.
3342 and simpler code.
3337
3343
3338 2003-08-14 Fernando Perez <fperez@colorado.edu>
3344 2003-08-14 Fernando Perez <fperez@colorado.edu>
3339
3345
3340 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3346 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3341 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3347 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3342 but it should be quite a bit faster. And the recursive version
3348 but it should be quite a bit faster. And the recursive version
3343 generated O(log N) intermediate storage for all rank>1 arrays,
3349 generated O(log N) intermediate storage for all rank>1 arrays,
3344 even if they were contiguous.
3350 even if they were contiguous.
3345 (l1norm): Added this function.
3351 (l1norm): Added this function.
3346 (norm): Added this function for arbitrary norms (including
3352 (norm): Added this function for arbitrary norms (including
3347 l-infinity). l1 and l2 are still special cases for convenience
3353 l-infinity). l1 and l2 are still special cases for convenience
3348 and speed.
3354 and speed.
3349
3355
3350 2003-08-03 Fernando Perez <fperez@colorado.edu>
3356 2003-08-03 Fernando Perez <fperez@colorado.edu>
3351
3357
3352 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3358 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3353 exceptions, which now raise PendingDeprecationWarnings in Python
3359 exceptions, which now raise PendingDeprecationWarnings in Python
3354 2.3. There were some in Magic and some in Gnuplot2.
3360 2.3. There were some in Magic and some in Gnuplot2.
3355
3361
3356 2003-06-30 Fernando Perez <fperez@colorado.edu>
3362 2003-06-30 Fernando Perez <fperez@colorado.edu>
3357
3363
3358 * IPython/genutils.py (page): modified to call curses only for
3364 * IPython/genutils.py (page): modified to call curses only for
3359 terminals where TERM=='xterm'. After problems under many other
3365 terminals where TERM=='xterm'. After problems under many other
3360 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3366 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3361
3367
3362 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3368 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3363 would be triggered when readline was absent. This was just an old
3369 would be triggered when readline was absent. This was just an old
3364 debugging statement I'd forgotten to take out.
3370 debugging statement I'd forgotten to take out.
3365
3371
3366 2003-06-20 Fernando Perez <fperez@colorado.edu>
3372 2003-06-20 Fernando Perez <fperez@colorado.edu>
3367
3373
3368 * IPython/genutils.py (clock): modified to return only user time
3374 * IPython/genutils.py (clock): modified to return only user time
3369 (not counting system time), after a discussion on scipy. While
3375 (not counting system time), after a discussion on scipy. While
3370 system time may be a useful quantity occasionally, it may much
3376 system time may be a useful quantity occasionally, it may much
3371 more easily be skewed by occasional swapping or other similar
3377 more easily be skewed by occasional swapping or other similar
3372 activity.
3378 activity.
3373
3379
3374 2003-06-05 Fernando Perez <fperez@colorado.edu>
3380 2003-06-05 Fernando Perez <fperez@colorado.edu>
3375
3381
3376 * IPython/numutils.py (identity): new function, for building
3382 * IPython/numutils.py (identity): new function, for building
3377 arbitrary rank Kronecker deltas (mostly backwards compatible with
3383 arbitrary rank Kronecker deltas (mostly backwards compatible with
3378 Numeric.identity)
3384 Numeric.identity)
3379
3385
3380 2003-06-03 Fernando Perez <fperez@colorado.edu>
3386 2003-06-03 Fernando Perez <fperez@colorado.edu>
3381
3387
3382 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3388 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3383 arguments passed to magics with spaces, to allow trailing '\' to
3389 arguments passed to magics with spaces, to allow trailing '\' to
3384 work normally (mainly for Windows users).
3390 work normally (mainly for Windows users).
3385
3391
3386 2003-05-29 Fernando Perez <fperez@colorado.edu>
3392 2003-05-29 Fernando Perez <fperez@colorado.edu>
3387
3393
3388 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3394 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3389 instead of pydoc.help. This fixes a bizarre behavior where
3395 instead of pydoc.help. This fixes a bizarre behavior where
3390 printing '%s' % locals() would trigger the help system. Now
3396 printing '%s' % locals() would trigger the help system. Now
3391 ipython behaves like normal python does.
3397 ipython behaves like normal python does.
3392
3398
3393 Note that if one does 'from pydoc import help', the bizarre
3399 Note that if one does 'from pydoc import help', the bizarre
3394 behavior returns, but this will also happen in normal python, so
3400 behavior returns, but this will also happen in normal python, so
3395 it's not an ipython bug anymore (it has to do with how pydoc.help
3401 it's not an ipython bug anymore (it has to do with how pydoc.help
3396 is implemented).
3402 is implemented).
3397
3403
3398 2003-05-22 Fernando Perez <fperez@colorado.edu>
3404 2003-05-22 Fernando Perez <fperez@colorado.edu>
3399
3405
3400 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3406 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3401 return [] instead of None when nothing matches, also match to end
3407 return [] instead of None when nothing matches, also match to end
3402 of line. Patch by Gary Bishop.
3408 of line. Patch by Gary Bishop.
3403
3409
3404 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3410 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3405 protection as before, for files passed on the command line. This
3411 protection as before, for files passed on the command line. This
3406 prevents the CrashHandler from kicking in if user files call into
3412 prevents the CrashHandler from kicking in if user files call into
3407 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3413 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3408 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3414 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3409
3415
3410 2003-05-20 *** Released version 0.4.0
3416 2003-05-20 *** Released version 0.4.0
3411
3417
3412 2003-05-20 Fernando Perez <fperez@colorado.edu>
3418 2003-05-20 Fernando Perez <fperez@colorado.edu>
3413
3419
3414 * setup.py: added support for manpages. It's a bit hackish b/c of
3420 * setup.py: added support for manpages. It's a bit hackish b/c of
3415 a bug in the way the bdist_rpm distutils target handles gzipped
3421 a bug in the way the bdist_rpm distutils target handles gzipped
3416 manpages, but it works. After a patch by Jack.
3422 manpages, but it works. After a patch by Jack.
3417
3423
3418 2003-05-19 Fernando Perez <fperez@colorado.edu>
3424 2003-05-19 Fernando Perez <fperez@colorado.edu>
3419
3425
3420 * IPython/numutils.py: added a mockup of the kinds module, since
3426 * IPython/numutils.py: added a mockup of the kinds module, since
3421 it was recently removed from Numeric. This way, numutils will
3427 it was recently removed from Numeric. This way, numutils will
3422 work for all users even if they are missing kinds.
3428 work for all users even if they are missing kinds.
3423
3429
3424 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3430 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3425 failure, which can occur with SWIG-wrapped extensions. After a
3431 failure, which can occur with SWIG-wrapped extensions. After a
3426 crash report from Prabhu.
3432 crash report from Prabhu.
3427
3433
3428 2003-05-16 Fernando Perez <fperez@colorado.edu>
3434 2003-05-16 Fernando Perez <fperez@colorado.edu>
3429
3435
3430 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3436 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3431 protect ipython from user code which may call directly
3437 protect ipython from user code which may call directly
3432 sys.excepthook (this looks like an ipython crash to the user, even
3438 sys.excepthook (this looks like an ipython crash to the user, even
3433 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3439 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3434 This is especially important to help users of WxWindows, but may
3440 This is especially important to help users of WxWindows, but may
3435 also be useful in other cases.
3441 also be useful in other cases.
3436
3442
3437 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3443 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3438 an optional tb_offset to be specified, and to preserve exception
3444 an optional tb_offset to be specified, and to preserve exception
3439 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3445 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3440
3446
3441 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3447 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3442
3448
3443 2003-05-15 Fernando Perez <fperez@colorado.edu>
3449 2003-05-15 Fernando Perez <fperez@colorado.edu>
3444
3450
3445 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3451 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3446 installing for a new user under Windows.
3452 installing for a new user under Windows.
3447
3453
3448 2003-05-12 Fernando Perez <fperez@colorado.edu>
3454 2003-05-12 Fernando Perez <fperez@colorado.edu>
3449
3455
3450 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3456 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3451 handler for Emacs comint-based lines. Currently it doesn't do
3457 handler for Emacs comint-based lines. Currently it doesn't do
3452 much (but importantly, it doesn't update the history cache). In
3458 much (but importantly, it doesn't update the history cache). In
3453 the future it may be expanded if Alex needs more functionality
3459 the future it may be expanded if Alex needs more functionality
3454 there.
3460 there.
3455
3461
3456 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3462 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3457 info to crash reports.
3463 info to crash reports.
3458
3464
3459 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3465 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3460 just like Python's -c. Also fixed crash with invalid -color
3466 just like Python's -c. Also fixed crash with invalid -color
3461 option value at startup. Thanks to Will French
3467 option value at startup. Thanks to Will French
3462 <wfrench-AT-bestweb.net> for the bug report.
3468 <wfrench-AT-bestweb.net> for the bug report.
3463
3469
3464 2003-05-09 Fernando Perez <fperez@colorado.edu>
3470 2003-05-09 Fernando Perez <fperez@colorado.edu>
3465
3471
3466 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3472 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3467 to EvalDict (it's a mapping, after all) and simplified its code
3473 to EvalDict (it's a mapping, after all) and simplified its code
3468 quite a bit, after a nice discussion on c.l.py where Gustavo
3474 quite a bit, after a nice discussion on c.l.py where Gustavo
3469 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3475 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3470
3476
3471 2003-04-30 Fernando Perez <fperez@colorado.edu>
3477 2003-04-30 Fernando Perez <fperez@colorado.edu>
3472
3478
3473 * IPython/genutils.py (timings_out): modified it to reduce its
3479 * IPython/genutils.py (timings_out): modified it to reduce its
3474 overhead in the common reps==1 case.
3480 overhead in the common reps==1 case.
3475
3481
3476 2003-04-29 Fernando Perez <fperez@colorado.edu>
3482 2003-04-29 Fernando Perez <fperez@colorado.edu>
3477
3483
3478 * IPython/genutils.py (timings_out): Modified to use the resource
3484 * IPython/genutils.py (timings_out): Modified to use the resource
3479 module, which avoids the wraparound problems of time.clock().
3485 module, which avoids the wraparound problems of time.clock().
3480
3486
3481 2003-04-17 *** Released version 0.2.15pre4
3487 2003-04-17 *** Released version 0.2.15pre4
3482
3488
3483 2003-04-17 Fernando Perez <fperez@colorado.edu>
3489 2003-04-17 Fernando Perez <fperez@colorado.edu>
3484
3490
3485 * setup.py (scriptfiles): Split windows-specific stuff over to a
3491 * setup.py (scriptfiles): Split windows-specific stuff over to a
3486 separate file, in an attempt to have a Windows GUI installer.
3492 separate file, in an attempt to have a Windows GUI installer.
3487 That didn't work, but part of the groundwork is done.
3493 That didn't work, but part of the groundwork is done.
3488
3494
3489 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3495 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3490 indent/unindent with 4 spaces. Particularly useful in combination
3496 indent/unindent with 4 spaces. Particularly useful in combination
3491 with the new auto-indent option.
3497 with the new auto-indent option.
3492
3498
3493 2003-04-16 Fernando Perez <fperez@colorado.edu>
3499 2003-04-16 Fernando Perez <fperez@colorado.edu>
3494
3500
3495 * IPython/Magic.py: various replacements of self.rc for
3501 * IPython/Magic.py: various replacements of self.rc for
3496 self.shell.rc. A lot more remains to be done to fully disentangle
3502 self.shell.rc. A lot more remains to be done to fully disentangle
3497 this class from the main Shell class.
3503 this class from the main Shell class.
3498
3504
3499 * IPython/GnuplotRuntime.py: added checks for mouse support so
3505 * IPython/GnuplotRuntime.py: added checks for mouse support so
3500 that we don't try to enable it if the current gnuplot doesn't
3506 that we don't try to enable it if the current gnuplot doesn't
3501 really support it. Also added checks so that we don't try to
3507 really support it. Also added checks so that we don't try to
3502 enable persist under Windows (where Gnuplot doesn't recognize the
3508 enable persist under Windows (where Gnuplot doesn't recognize the
3503 option).
3509 option).
3504
3510
3505 * IPython/iplib.py (InteractiveShell.interact): Added optional
3511 * IPython/iplib.py (InteractiveShell.interact): Added optional
3506 auto-indenting code, after a patch by King C. Shu
3512 auto-indenting code, after a patch by King C. Shu
3507 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3513 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3508 get along well with pasting indented code. If I ever figure out
3514 get along well with pasting indented code. If I ever figure out
3509 how to make that part go well, it will become on by default.
3515 how to make that part go well, it will become on by default.
3510
3516
3511 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3517 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3512 crash ipython if there was an unmatched '%' in the user's prompt
3518 crash ipython if there was an unmatched '%' in the user's prompt
3513 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3519 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3514
3520
3515 * IPython/iplib.py (InteractiveShell.interact): removed the
3521 * IPython/iplib.py (InteractiveShell.interact): removed the
3516 ability to ask the user whether he wants to crash or not at the
3522 ability to ask the user whether he wants to crash or not at the
3517 'last line' exception handler. Calling functions at that point
3523 'last line' exception handler. Calling functions at that point
3518 changes the stack, and the error reports would have incorrect
3524 changes the stack, and the error reports would have incorrect
3519 tracebacks.
3525 tracebacks.
3520
3526
3521 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3527 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3522 pass through a peger a pretty-printed form of any object. After a
3528 pass through a peger a pretty-printed form of any object. After a
3523 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3529 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3524
3530
3525 2003-04-14 Fernando Perez <fperez@colorado.edu>
3531 2003-04-14 Fernando Perez <fperez@colorado.edu>
3526
3532
3527 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3533 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3528 all files in ~ would be modified at first install (instead of
3534 all files in ~ would be modified at first install (instead of
3529 ~/.ipython). This could be potentially disastrous, as the
3535 ~/.ipython). This could be potentially disastrous, as the
3530 modification (make line-endings native) could damage binary files.
3536 modification (make line-endings native) could damage binary files.
3531
3537
3532 2003-04-10 Fernando Perez <fperez@colorado.edu>
3538 2003-04-10 Fernando Perez <fperez@colorado.edu>
3533
3539
3534 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3540 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3535 handle only lines which are invalid python. This now means that
3541 handle only lines which are invalid python. This now means that
3536 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3542 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3537 for the bug report.
3543 for the bug report.
3538
3544
3539 2003-04-01 Fernando Perez <fperez@colorado.edu>
3545 2003-04-01 Fernando Perez <fperez@colorado.edu>
3540
3546
3541 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3547 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3542 where failing to set sys.last_traceback would crash pdb.pm().
3548 where failing to set sys.last_traceback would crash pdb.pm().
3543 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3549 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3544 report.
3550 report.
3545
3551
3546 2003-03-25 Fernando Perez <fperez@colorado.edu>
3552 2003-03-25 Fernando Perez <fperez@colorado.edu>
3547
3553
3548 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3554 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3549 before printing it (it had a lot of spurious blank lines at the
3555 before printing it (it had a lot of spurious blank lines at the
3550 end).
3556 end).
3551
3557
3552 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3558 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3553 output would be sent 21 times! Obviously people don't use this
3559 output would be sent 21 times! Obviously people don't use this
3554 too often, or I would have heard about it.
3560 too often, or I would have heard about it.
3555
3561
3556 2003-03-24 Fernando Perez <fperez@colorado.edu>
3562 2003-03-24 Fernando Perez <fperez@colorado.edu>
3557
3563
3558 * setup.py (scriptfiles): renamed the data_files parameter from
3564 * setup.py (scriptfiles): renamed the data_files parameter from
3559 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3565 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3560 for the patch.
3566 for the patch.
3561
3567
3562 2003-03-20 Fernando Perez <fperez@colorado.edu>
3568 2003-03-20 Fernando Perez <fperez@colorado.edu>
3563
3569
3564 * IPython/genutils.py (error): added error() and fatal()
3570 * IPython/genutils.py (error): added error() and fatal()
3565 functions.
3571 functions.
3566
3572
3567 2003-03-18 *** Released version 0.2.15pre3
3573 2003-03-18 *** Released version 0.2.15pre3
3568
3574
3569 2003-03-18 Fernando Perez <fperez@colorado.edu>
3575 2003-03-18 Fernando Perez <fperez@colorado.edu>
3570
3576
3571 * setupext/install_data_ext.py
3577 * setupext/install_data_ext.py
3572 (install_data_ext.initialize_options): Class contributed by Jack
3578 (install_data_ext.initialize_options): Class contributed by Jack
3573 Moffit for fixing the old distutils hack. He is sending this to
3579 Moffit for fixing the old distutils hack. He is sending this to
3574 the distutils folks so in the future we may not need it as a
3580 the distutils folks so in the future we may not need it as a
3575 private fix.
3581 private fix.
3576
3582
3577 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3583 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3578 changes for Debian packaging. See his patch for full details.
3584 changes for Debian packaging. See his patch for full details.
3579 The old distutils hack of making the ipythonrc* files carry a
3585 The old distutils hack of making the ipythonrc* files carry a
3580 bogus .py extension is gone, at last. Examples were moved to a
3586 bogus .py extension is gone, at last. Examples were moved to a
3581 separate subdir under doc/, and the separate executable scripts
3587 separate subdir under doc/, and the separate executable scripts
3582 now live in their own directory. Overall a great cleanup. The
3588 now live in their own directory. Overall a great cleanup. The
3583 manual was updated to use the new files, and setup.py has been
3589 manual was updated to use the new files, and setup.py has been
3584 fixed for this setup.
3590 fixed for this setup.
3585
3591
3586 * IPython/PyColorize.py (Parser.usage): made non-executable and
3592 * IPython/PyColorize.py (Parser.usage): made non-executable and
3587 created a pycolor wrapper around it to be included as a script.
3593 created a pycolor wrapper around it to be included as a script.
3588
3594
3589 2003-03-12 *** Released version 0.2.15pre2
3595 2003-03-12 *** Released version 0.2.15pre2
3590
3596
3591 2003-03-12 Fernando Perez <fperez@colorado.edu>
3597 2003-03-12 Fernando Perez <fperez@colorado.edu>
3592
3598
3593 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3599 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3594 long-standing problem with garbage characters in some terminals.
3600 long-standing problem with garbage characters in some terminals.
3595 The issue was really that the \001 and \002 escapes must _only_ be
3601 The issue was really that the \001 and \002 escapes must _only_ be
3596 passed to input prompts (which call readline), but _never_ to
3602 passed to input prompts (which call readline), but _never_ to
3597 normal text to be printed on screen. I changed ColorANSI to have
3603 normal text to be printed on screen. I changed ColorANSI to have
3598 two classes: TermColors and InputTermColors, each with the
3604 two classes: TermColors and InputTermColors, each with the
3599 appropriate escapes for input prompts or normal text. The code in
3605 appropriate escapes for input prompts or normal text. The code in
3600 Prompts.py got slightly more complicated, but this very old and
3606 Prompts.py got slightly more complicated, but this very old and
3601 annoying bug is finally fixed.
3607 annoying bug is finally fixed.
3602
3608
3603 All the credit for nailing down the real origin of this problem
3609 All the credit for nailing down the real origin of this problem
3604 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3610 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3605 *Many* thanks to him for spending quite a bit of effort on this.
3611 *Many* thanks to him for spending quite a bit of effort on this.
3606
3612
3607 2003-03-05 *** Released version 0.2.15pre1
3613 2003-03-05 *** Released version 0.2.15pre1
3608
3614
3609 2003-03-03 Fernando Perez <fperez@colorado.edu>
3615 2003-03-03 Fernando Perez <fperez@colorado.edu>
3610
3616
3611 * IPython/FakeModule.py: Moved the former _FakeModule to a
3617 * IPython/FakeModule.py: Moved the former _FakeModule to a
3612 separate file, because it's also needed by Magic (to fix a similar
3618 separate file, because it's also needed by Magic (to fix a similar
3613 pickle-related issue in @run).
3619 pickle-related issue in @run).
3614
3620
3615 2003-03-02 Fernando Perez <fperez@colorado.edu>
3621 2003-03-02 Fernando Perez <fperez@colorado.edu>
3616
3622
3617 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3623 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3618 the autocall option at runtime.
3624 the autocall option at runtime.
3619 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3625 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3620 across Magic.py to start separating Magic from InteractiveShell.
3626 across Magic.py to start separating Magic from InteractiveShell.
3621 (Magic._ofind): Fixed to return proper namespace for dotted
3627 (Magic._ofind): Fixed to return proper namespace for dotted
3622 names. Before, a dotted name would always return 'not currently
3628 names. Before, a dotted name would always return 'not currently
3623 defined', because it would find the 'parent'. s.x would be found,
3629 defined', because it would find the 'parent'. s.x would be found,
3624 but since 'x' isn't defined by itself, it would get confused.
3630 but since 'x' isn't defined by itself, it would get confused.
3625 (Magic.magic_run): Fixed pickling problems reported by Ralf
3631 (Magic.magic_run): Fixed pickling problems reported by Ralf
3626 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3632 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3627 that I'd used when Mike Heeter reported similar issues at the
3633 that I'd used when Mike Heeter reported similar issues at the
3628 top-level, but now for @run. It boils down to injecting the
3634 top-level, but now for @run. It boils down to injecting the
3629 namespace where code is being executed with something that looks
3635 namespace where code is being executed with something that looks
3630 enough like a module to fool pickle.dump(). Since a pickle stores
3636 enough like a module to fool pickle.dump(). Since a pickle stores
3631 a named reference to the importing module, we need this for
3637 a named reference to the importing module, we need this for
3632 pickles to save something sensible.
3638 pickles to save something sensible.
3633
3639
3634 * IPython/ipmaker.py (make_IPython): added an autocall option.
3640 * IPython/ipmaker.py (make_IPython): added an autocall option.
3635
3641
3636 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3642 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3637 the auto-eval code. Now autocalling is an option, and the code is
3643 the auto-eval code. Now autocalling is an option, and the code is
3638 also vastly safer. There is no more eval() involved at all.
3644 also vastly safer. There is no more eval() involved at all.
3639
3645
3640 2003-03-01 Fernando Perez <fperez@colorado.edu>
3646 2003-03-01 Fernando Perez <fperez@colorado.edu>
3641
3647
3642 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3648 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3643 dict with named keys instead of a tuple.
3649 dict with named keys instead of a tuple.
3644
3650
3645 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3651 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3646
3652
3647 * setup.py (make_shortcut): Fixed message about directories
3653 * setup.py (make_shortcut): Fixed message about directories
3648 created during Windows installation (the directories were ok, just
3654 created during Windows installation (the directories were ok, just
3649 the printed message was misleading). Thanks to Chris Liechti
3655 the printed message was misleading). Thanks to Chris Liechti
3650 <cliechti-AT-gmx.net> for the heads up.
3656 <cliechti-AT-gmx.net> for the heads up.
3651
3657
3652 2003-02-21 Fernando Perez <fperez@colorado.edu>
3658 2003-02-21 Fernando Perez <fperez@colorado.edu>
3653
3659
3654 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3660 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3655 of ValueError exception when checking for auto-execution. This
3661 of ValueError exception when checking for auto-execution. This
3656 one is raised by things like Numeric arrays arr.flat when the
3662 one is raised by things like Numeric arrays arr.flat when the
3657 array is non-contiguous.
3663 array is non-contiguous.
3658
3664
3659 2003-01-31 Fernando Perez <fperez@colorado.edu>
3665 2003-01-31 Fernando Perez <fperez@colorado.edu>
3660
3666
3661 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3667 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3662 not return any value at all (even though the command would get
3668 not return any value at all (even though the command would get
3663 executed).
3669 executed).
3664 (xsys): Flush stdout right after printing the command to ensure
3670 (xsys): Flush stdout right after printing the command to ensure
3665 proper ordering of commands and command output in the total
3671 proper ordering of commands and command output in the total
3666 output.
3672 output.
3667 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3673 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3668 system/getoutput as defaults. The old ones are kept for
3674 system/getoutput as defaults. The old ones are kept for
3669 compatibility reasons, so no code which uses this library needs
3675 compatibility reasons, so no code which uses this library needs
3670 changing.
3676 changing.
3671
3677
3672 2003-01-27 *** Released version 0.2.14
3678 2003-01-27 *** Released version 0.2.14
3673
3679
3674 2003-01-25 Fernando Perez <fperez@colorado.edu>
3680 2003-01-25 Fernando Perez <fperez@colorado.edu>
3675
3681
3676 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3682 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3677 functions defined in previous edit sessions could not be re-edited
3683 functions defined in previous edit sessions could not be re-edited
3678 (because the temp files were immediately removed). Now temp files
3684 (because the temp files were immediately removed). Now temp files
3679 are removed only at IPython's exit.
3685 are removed only at IPython's exit.
3680 (Magic.magic_run): Improved @run to perform shell-like expansions
3686 (Magic.magic_run): Improved @run to perform shell-like expansions
3681 on its arguments (~users and $VARS). With this, @run becomes more
3687 on its arguments (~users and $VARS). With this, @run becomes more
3682 like a normal command-line.
3688 like a normal command-line.
3683
3689
3684 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3690 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3685 bugs related to embedding and cleaned up that code. A fairly
3691 bugs related to embedding and cleaned up that code. A fairly
3686 important one was the impossibility to access the global namespace
3692 important one was the impossibility to access the global namespace
3687 through the embedded IPython (only local variables were visible).
3693 through the embedded IPython (only local variables were visible).
3688
3694
3689 2003-01-14 Fernando Perez <fperez@colorado.edu>
3695 2003-01-14 Fernando Perez <fperez@colorado.edu>
3690
3696
3691 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3697 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3692 auto-calling to be a bit more conservative. Now it doesn't get
3698 auto-calling to be a bit more conservative. Now it doesn't get
3693 triggered if any of '!=()<>' are in the rest of the input line, to
3699 triggered if any of '!=()<>' are in the rest of the input line, to
3694 allow comparing callables. Thanks to Alex for the heads up.
3700 allow comparing callables. Thanks to Alex for the heads up.
3695
3701
3696 2003-01-07 Fernando Perez <fperez@colorado.edu>
3702 2003-01-07 Fernando Perez <fperez@colorado.edu>
3697
3703
3698 * IPython/genutils.py (page): fixed estimation of the number of
3704 * IPython/genutils.py (page): fixed estimation of the number of
3699 lines in a string to be paged to simply count newlines. This
3705 lines in a string to be paged to simply count newlines. This
3700 prevents over-guessing due to embedded escape sequences. A better
3706 prevents over-guessing due to embedded escape sequences. A better
3701 long-term solution would involve stripping out the control chars
3707 long-term solution would involve stripping out the control chars
3702 for the count, but it's potentially so expensive I just don't
3708 for the count, but it's potentially so expensive I just don't
3703 think it's worth doing.
3709 think it's worth doing.
3704
3710
3705 2002-12-19 *** Released version 0.2.14pre50
3711 2002-12-19 *** Released version 0.2.14pre50
3706
3712
3707 2002-12-19 Fernando Perez <fperez@colorado.edu>
3713 2002-12-19 Fernando Perez <fperez@colorado.edu>
3708
3714
3709 * tools/release (version): Changed release scripts to inform
3715 * tools/release (version): Changed release scripts to inform
3710 Andrea and build a NEWS file with a list of recent changes.
3716 Andrea and build a NEWS file with a list of recent changes.
3711
3717
3712 * IPython/ColorANSI.py (__all__): changed terminal detection
3718 * IPython/ColorANSI.py (__all__): changed terminal detection
3713 code. Seems to work better for xterms without breaking
3719 code. Seems to work better for xterms without breaking
3714 konsole. Will need more testing to determine if WinXP and Mac OSX
3720 konsole. Will need more testing to determine if WinXP and Mac OSX
3715 also work ok.
3721 also work ok.
3716
3722
3717 2002-12-18 *** Released version 0.2.14pre49
3723 2002-12-18 *** Released version 0.2.14pre49
3718
3724
3719 2002-12-18 Fernando Perez <fperez@colorado.edu>
3725 2002-12-18 Fernando Perez <fperez@colorado.edu>
3720
3726
3721 * Docs: added new info about Mac OSX, from Andrea.
3727 * Docs: added new info about Mac OSX, from Andrea.
3722
3728
3723 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3729 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3724 allow direct plotting of python strings whose format is the same
3730 allow direct plotting of python strings whose format is the same
3725 of gnuplot data files.
3731 of gnuplot data files.
3726
3732
3727 2002-12-16 Fernando Perez <fperez@colorado.edu>
3733 2002-12-16 Fernando Perez <fperez@colorado.edu>
3728
3734
3729 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3735 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3730 value of exit question to be acknowledged.
3736 value of exit question to be acknowledged.
3731
3737
3732 2002-12-03 Fernando Perez <fperez@colorado.edu>
3738 2002-12-03 Fernando Perez <fperez@colorado.edu>
3733
3739
3734 * IPython/ipmaker.py: removed generators, which had been added
3740 * IPython/ipmaker.py: removed generators, which had been added
3735 by mistake in an earlier debugging run. This was causing trouble
3741 by mistake in an earlier debugging run. This was causing trouble
3736 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3742 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3737 for pointing this out.
3743 for pointing this out.
3738
3744
3739 2002-11-17 Fernando Perez <fperez@colorado.edu>
3745 2002-11-17 Fernando Perez <fperez@colorado.edu>
3740
3746
3741 * Manual: updated the Gnuplot section.
3747 * Manual: updated the Gnuplot section.
3742
3748
3743 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3749 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3744 a much better split of what goes in Runtime and what goes in
3750 a much better split of what goes in Runtime and what goes in
3745 Interactive.
3751 Interactive.
3746
3752
3747 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3753 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3748 being imported from iplib.
3754 being imported from iplib.
3749
3755
3750 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3756 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3751 for command-passing. Now the global Gnuplot instance is called
3757 for command-passing. Now the global Gnuplot instance is called
3752 'gp' instead of 'g', which was really a far too fragile and
3758 'gp' instead of 'g', which was really a far too fragile and
3753 common name.
3759 common name.
3754
3760
3755 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3761 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3756 bounding boxes generated by Gnuplot for square plots.
3762 bounding boxes generated by Gnuplot for square plots.
3757
3763
3758 * IPython/genutils.py (popkey): new function added. I should
3764 * IPython/genutils.py (popkey): new function added. I should
3759 suggest this on c.l.py as a dict method, it seems useful.
3765 suggest this on c.l.py as a dict method, it seems useful.
3760
3766
3761 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3767 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3762 to transparently handle PostScript generation. MUCH better than
3768 to transparently handle PostScript generation. MUCH better than
3763 the previous plot_eps/replot_eps (which I removed now). The code
3769 the previous plot_eps/replot_eps (which I removed now). The code
3764 is also fairly clean and well documented now (including
3770 is also fairly clean and well documented now (including
3765 docstrings).
3771 docstrings).
3766
3772
3767 2002-11-13 Fernando Perez <fperez@colorado.edu>
3773 2002-11-13 Fernando Perez <fperez@colorado.edu>
3768
3774
3769 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3775 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3770 (inconsistent with options).
3776 (inconsistent with options).
3771
3777
3772 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3778 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3773 manually disabled, I don't know why. Fixed it.
3779 manually disabled, I don't know why. Fixed it.
3774 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3780 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3775 eps output.
3781 eps output.
3776
3782
3777 2002-11-12 Fernando Perez <fperez@colorado.edu>
3783 2002-11-12 Fernando Perez <fperez@colorado.edu>
3778
3784
3779 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3785 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3780 don't propagate up to caller. Fixes crash reported by François
3786 don't propagate up to caller. Fixes crash reported by François
3781 Pinard.
3787 Pinard.
3782
3788
3783 2002-11-09 Fernando Perez <fperez@colorado.edu>
3789 2002-11-09 Fernando Perez <fperez@colorado.edu>
3784
3790
3785 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3791 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3786 history file for new users.
3792 history file for new users.
3787 (make_IPython): fixed bug where initial install would leave the
3793 (make_IPython): fixed bug where initial install would leave the
3788 user running in the .ipython dir.
3794 user running in the .ipython dir.
3789 (make_IPython): fixed bug where config dir .ipython would be
3795 (make_IPython): fixed bug where config dir .ipython would be
3790 created regardless of the given -ipythondir option. Thanks to Cory
3796 created regardless of the given -ipythondir option. Thanks to Cory
3791 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3797 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3792
3798
3793 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3799 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3794 type confirmations. Will need to use it in all of IPython's code
3800 type confirmations. Will need to use it in all of IPython's code
3795 consistently.
3801 consistently.
3796
3802
3797 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3803 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3798 context to print 31 lines instead of the default 5. This will make
3804 context to print 31 lines instead of the default 5. This will make
3799 the crash reports extremely detailed in case the problem is in
3805 the crash reports extremely detailed in case the problem is in
3800 libraries I don't have access to.
3806 libraries I don't have access to.
3801
3807
3802 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3808 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3803 line of defense' code to still crash, but giving users fair
3809 line of defense' code to still crash, but giving users fair
3804 warning. I don't want internal errors to go unreported: if there's
3810 warning. I don't want internal errors to go unreported: if there's
3805 an internal problem, IPython should crash and generate a full
3811 an internal problem, IPython should crash and generate a full
3806 report.
3812 report.
3807
3813
3808 2002-11-08 Fernando Perez <fperez@colorado.edu>
3814 2002-11-08 Fernando Perez <fperez@colorado.edu>
3809
3815
3810 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3816 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3811 otherwise uncaught exceptions which can appear if people set
3817 otherwise uncaught exceptions which can appear if people set
3812 sys.stdout to something badly broken. Thanks to a crash report
3818 sys.stdout to something badly broken. Thanks to a crash report
3813 from henni-AT-mail.brainbot.com.
3819 from henni-AT-mail.brainbot.com.
3814
3820
3815 2002-11-04 Fernando Perez <fperez@colorado.edu>
3821 2002-11-04 Fernando Perez <fperez@colorado.edu>
3816
3822
3817 * IPython/iplib.py (InteractiveShell.interact): added
3823 * IPython/iplib.py (InteractiveShell.interact): added
3818 __IPYTHON__active to the builtins. It's a flag which goes on when
3824 __IPYTHON__active to the builtins. It's a flag which goes on when
3819 the interaction starts and goes off again when it stops. This
3825 the interaction starts and goes off again when it stops. This
3820 allows embedding code to detect being inside IPython. Before this
3826 allows embedding code to detect being inside IPython. Before this
3821 was done via __IPYTHON__, but that only shows that an IPython
3827 was done via __IPYTHON__, but that only shows that an IPython
3822 instance has been created.
3828 instance has been created.
3823
3829
3824 * IPython/Magic.py (Magic.magic_env): I realized that in a
3830 * IPython/Magic.py (Magic.magic_env): I realized that in a
3825 UserDict, instance.data holds the data as a normal dict. So I
3831 UserDict, instance.data holds the data as a normal dict. So I
3826 modified @env to return os.environ.data instead of rebuilding a
3832 modified @env to return os.environ.data instead of rebuilding a
3827 dict by hand.
3833 dict by hand.
3828
3834
3829 2002-11-02 Fernando Perez <fperez@colorado.edu>
3835 2002-11-02 Fernando Perez <fperez@colorado.edu>
3830
3836
3831 * IPython/genutils.py (warn): changed so that level 1 prints no
3837 * IPython/genutils.py (warn): changed so that level 1 prints no
3832 header. Level 2 is now the default (with 'WARNING' header, as
3838 header. Level 2 is now the default (with 'WARNING' header, as
3833 before). I think I tracked all places where changes were needed in
3839 before). I think I tracked all places where changes were needed in
3834 IPython, but outside code using the old level numbering may have
3840 IPython, but outside code using the old level numbering may have
3835 broken.
3841 broken.
3836
3842
3837 * IPython/iplib.py (InteractiveShell.runcode): added this to
3843 * IPython/iplib.py (InteractiveShell.runcode): added this to
3838 handle the tracebacks in SystemExit traps correctly. The previous
3844 handle the tracebacks in SystemExit traps correctly. The previous
3839 code (through interact) was printing more of the stack than
3845 code (through interact) was printing more of the stack than
3840 necessary, showing IPython internal code to the user.
3846 necessary, showing IPython internal code to the user.
3841
3847
3842 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3848 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3843 default. Now that the default at the confirmation prompt is yes,
3849 default. Now that the default at the confirmation prompt is yes,
3844 it's not so intrusive. François' argument that ipython sessions
3850 it's not so intrusive. François' argument that ipython sessions
3845 tend to be complex enough not to lose them from an accidental C-d,
3851 tend to be complex enough not to lose them from an accidental C-d,
3846 is a valid one.
3852 is a valid one.
3847
3853
3848 * IPython/iplib.py (InteractiveShell.interact): added a
3854 * IPython/iplib.py (InteractiveShell.interact): added a
3849 showtraceback() call to the SystemExit trap, and modified the exit
3855 showtraceback() call to the SystemExit trap, and modified the exit
3850 confirmation to have yes as the default.
3856 confirmation to have yes as the default.
3851
3857
3852 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3858 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3853 this file. It's been gone from the code for a long time, this was
3859 this file. It's been gone from the code for a long time, this was
3854 simply leftover junk.
3860 simply leftover junk.
3855
3861
3856 2002-11-01 Fernando Perez <fperez@colorado.edu>
3862 2002-11-01 Fernando Perez <fperez@colorado.edu>
3857
3863
3858 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3864 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3859 added. If set, IPython now traps EOF and asks for
3865 added. If set, IPython now traps EOF and asks for
3860 confirmation. After a request by François Pinard.
3866 confirmation. After a request by François Pinard.
3861
3867
3862 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3868 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3863 of @abort, and with a new (better) mechanism for handling the
3869 of @abort, and with a new (better) mechanism for handling the
3864 exceptions.
3870 exceptions.
3865
3871
3866 2002-10-27 Fernando Perez <fperez@colorado.edu>
3872 2002-10-27 Fernando Perez <fperez@colorado.edu>
3867
3873
3868 * IPython/usage.py (__doc__): updated the --help information and
3874 * IPython/usage.py (__doc__): updated the --help information and
3869 the ipythonrc file to indicate that -log generates
3875 the ipythonrc file to indicate that -log generates
3870 ./ipython.log. Also fixed the corresponding info in @logstart.
3876 ./ipython.log. Also fixed the corresponding info in @logstart.
3871 This and several other fixes in the manuals thanks to reports by
3877 This and several other fixes in the manuals thanks to reports by
3872 François Pinard <pinard-AT-iro.umontreal.ca>.
3878 François Pinard <pinard-AT-iro.umontreal.ca>.
3873
3879
3874 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3880 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3875 refer to @logstart (instead of @log, which doesn't exist).
3881 refer to @logstart (instead of @log, which doesn't exist).
3876
3882
3877 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3883 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3878 AttributeError crash. Thanks to Christopher Armstrong
3884 AttributeError crash. Thanks to Christopher Armstrong
3879 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3885 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3880 introduced recently (in 0.2.14pre37) with the fix to the eval
3886 introduced recently (in 0.2.14pre37) with the fix to the eval
3881 problem mentioned below.
3887 problem mentioned below.
3882
3888
3883 2002-10-17 Fernando Perez <fperez@colorado.edu>
3889 2002-10-17 Fernando Perez <fperez@colorado.edu>
3884
3890
3885 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3891 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3886 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3892 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3887
3893
3888 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3894 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3889 this function to fix a problem reported by Alex Schmolck. He saw
3895 this function to fix a problem reported by Alex Schmolck. He saw
3890 it with list comprehensions and generators, which were getting
3896 it with list comprehensions and generators, which were getting
3891 called twice. The real problem was an 'eval' call in testing for
3897 called twice. The real problem was an 'eval' call in testing for
3892 automagic which was evaluating the input line silently.
3898 automagic which was evaluating the input line silently.
3893
3899
3894 This is a potentially very nasty bug, if the input has side
3900 This is a potentially very nasty bug, if the input has side
3895 effects which must not be repeated. The code is much cleaner now,
3901 effects which must not be repeated. The code is much cleaner now,
3896 without any blanket 'except' left and with a regexp test for
3902 without any blanket 'except' left and with a regexp test for
3897 actual function names.
3903 actual function names.
3898
3904
3899 But an eval remains, which I'm not fully comfortable with. I just
3905 But an eval remains, which I'm not fully comfortable with. I just
3900 don't know how to find out if an expression could be a callable in
3906 don't know how to find out if an expression could be a callable in
3901 the user's namespace without doing an eval on the string. However
3907 the user's namespace without doing an eval on the string. However
3902 that string is now much more strictly checked so that no code
3908 that string is now much more strictly checked so that no code
3903 slips by, so the eval should only happen for things that can
3909 slips by, so the eval should only happen for things that can
3904 really be only function/method names.
3910 really be only function/method names.
3905
3911
3906 2002-10-15 Fernando Perez <fperez@colorado.edu>
3912 2002-10-15 Fernando Perez <fperez@colorado.edu>
3907
3913
3908 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3914 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3909 OSX information to main manual, removed README_Mac_OSX file from
3915 OSX information to main manual, removed README_Mac_OSX file from
3910 distribution. Also updated credits for recent additions.
3916 distribution. Also updated credits for recent additions.
3911
3917
3912 2002-10-10 Fernando Perez <fperez@colorado.edu>
3918 2002-10-10 Fernando Perez <fperez@colorado.edu>
3913
3919
3914 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3920 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3915 terminal-related issues. Many thanks to Andrea Riciputi
3921 terminal-related issues. Many thanks to Andrea Riciputi
3916 <andrea.riciputi-AT-libero.it> for writing it.
3922 <andrea.riciputi-AT-libero.it> for writing it.
3917
3923
3918 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3924 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3919 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3925 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3920
3926
3921 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3927 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3922 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3928 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3923 <syver-en-AT-online.no> who both submitted patches for this problem.
3929 <syver-en-AT-online.no> who both submitted patches for this problem.
3924
3930
3925 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3931 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3926 global embedding to make sure that things don't overwrite user
3932 global embedding to make sure that things don't overwrite user
3927 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3933 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3928
3934
3929 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3935 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3930 compatibility. Thanks to Hayden Callow
3936 compatibility. Thanks to Hayden Callow
3931 <h.callow-AT-elec.canterbury.ac.nz>
3937 <h.callow-AT-elec.canterbury.ac.nz>
3932
3938
3933 2002-10-04 Fernando Perez <fperez@colorado.edu>
3939 2002-10-04 Fernando Perez <fperez@colorado.edu>
3934
3940
3935 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3941 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3936 Gnuplot.File objects.
3942 Gnuplot.File objects.
3937
3943
3938 2002-07-23 Fernando Perez <fperez@colorado.edu>
3944 2002-07-23 Fernando Perez <fperez@colorado.edu>
3939
3945
3940 * IPython/genutils.py (timing): Added timings() and timing() for
3946 * IPython/genutils.py (timing): Added timings() and timing() for
3941 quick access to the most commonly needed data, the execution
3947 quick access to the most commonly needed data, the execution
3942 times. Old timing() renamed to timings_out().
3948 times. Old timing() renamed to timings_out().
3943
3949
3944 2002-07-18 Fernando Perez <fperez@colorado.edu>
3950 2002-07-18 Fernando Perez <fperez@colorado.edu>
3945
3951
3946 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3952 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3947 bug with nested instances disrupting the parent's tab completion.
3953 bug with nested instances disrupting the parent's tab completion.
3948
3954
3949 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3955 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3950 all_completions code to begin the emacs integration.
3956 all_completions code to begin the emacs integration.
3951
3957
3952 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3958 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3953 argument to allow titling individual arrays when plotting.
3959 argument to allow titling individual arrays when plotting.
3954
3960
3955 2002-07-15 Fernando Perez <fperez@colorado.edu>
3961 2002-07-15 Fernando Perez <fperez@colorado.edu>
3956
3962
3957 * setup.py (make_shortcut): changed to retrieve the value of
3963 * setup.py (make_shortcut): changed to retrieve the value of
3958 'Program Files' directory from the registry (this value changes in
3964 'Program Files' directory from the registry (this value changes in
3959 non-english versions of Windows). Thanks to Thomas Fanslau
3965 non-english versions of Windows). Thanks to Thomas Fanslau
3960 <tfanslau-AT-gmx.de> for the report.
3966 <tfanslau-AT-gmx.de> for the report.
3961
3967
3962 2002-07-10 Fernando Perez <fperez@colorado.edu>
3968 2002-07-10 Fernando Perez <fperez@colorado.edu>
3963
3969
3964 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3970 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3965 a bug in pdb, which crashes if a line with only whitespace is
3971 a bug in pdb, which crashes if a line with only whitespace is
3966 entered. Bug report submitted to sourceforge.
3972 entered. Bug report submitted to sourceforge.
3967
3973
3968 2002-07-09 Fernando Perez <fperez@colorado.edu>
3974 2002-07-09 Fernando Perez <fperez@colorado.edu>
3969
3975
3970 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3976 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3971 reporting exceptions (it's a bug in inspect.py, I just set a
3977 reporting exceptions (it's a bug in inspect.py, I just set a
3972 workaround).
3978 workaround).
3973
3979
3974 2002-07-08 Fernando Perez <fperez@colorado.edu>
3980 2002-07-08 Fernando Perez <fperez@colorado.edu>
3975
3981
3976 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3982 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3977 __IPYTHON__ in __builtins__ to show up in user_ns.
3983 __IPYTHON__ in __builtins__ to show up in user_ns.
3978
3984
3979 2002-07-03 Fernando Perez <fperez@colorado.edu>
3985 2002-07-03 Fernando Perez <fperez@colorado.edu>
3980
3986
3981 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3987 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3982 name from @gp_set_instance to @gp_set_default.
3988 name from @gp_set_instance to @gp_set_default.
3983
3989
3984 * IPython/ipmaker.py (make_IPython): default editor value set to
3990 * IPython/ipmaker.py (make_IPython): default editor value set to
3985 '0' (a string), to match the rc file. Otherwise will crash when
3991 '0' (a string), to match the rc file. Otherwise will crash when
3986 .strip() is called on it.
3992 .strip() is called on it.
3987
3993
3988
3994
3989 2002-06-28 Fernando Perez <fperez@colorado.edu>
3995 2002-06-28 Fernando Perez <fperez@colorado.edu>
3990
3996
3991 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3997 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3992 of files in current directory when a file is executed via
3998 of files in current directory when a file is executed via
3993 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3999 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3994
4000
3995 * setup.py (manfiles): fix for rpm builds, submitted by RA
4001 * setup.py (manfiles): fix for rpm builds, submitted by RA
3996 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4002 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3997
4003
3998 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4004 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3999 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4005 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4000 string!). A. Schmolck caught this one.
4006 string!). A. Schmolck caught this one.
4001
4007
4002 2002-06-27 Fernando Perez <fperez@colorado.edu>
4008 2002-06-27 Fernando Perez <fperez@colorado.edu>
4003
4009
4004 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4010 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4005 defined files at the cmd line. __name__ wasn't being set to
4011 defined files at the cmd line. __name__ wasn't being set to
4006 __main__.
4012 __main__.
4007
4013
4008 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4014 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4009 regular lists and tuples besides Numeric arrays.
4015 regular lists and tuples besides Numeric arrays.
4010
4016
4011 * IPython/Prompts.py (CachedOutput.__call__): Added output
4017 * IPython/Prompts.py (CachedOutput.__call__): Added output
4012 supression for input ending with ';'. Similar to Mathematica and
4018 supression for input ending with ';'. Similar to Mathematica and
4013 Matlab. The _* vars and Out[] list are still updated, just like
4019 Matlab. The _* vars and Out[] list are still updated, just like
4014 Mathematica behaves.
4020 Mathematica behaves.
4015
4021
4016 2002-06-25 Fernando Perez <fperez@colorado.edu>
4022 2002-06-25 Fernando Perez <fperez@colorado.edu>
4017
4023
4018 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4024 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4019 .ini extensions for profiels under Windows.
4025 .ini extensions for profiels under Windows.
4020
4026
4021 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4027 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4022 string form. Fix contributed by Alexander Schmolck
4028 string form. Fix contributed by Alexander Schmolck
4023 <a.schmolck-AT-gmx.net>
4029 <a.schmolck-AT-gmx.net>
4024
4030
4025 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4031 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4026 pre-configured Gnuplot instance.
4032 pre-configured Gnuplot instance.
4027
4033
4028 2002-06-21 Fernando Perez <fperez@colorado.edu>
4034 2002-06-21 Fernando Perez <fperez@colorado.edu>
4029
4035
4030 * IPython/numutils.py (exp_safe): new function, works around the
4036 * IPython/numutils.py (exp_safe): new function, works around the
4031 underflow problems in Numeric.
4037 underflow problems in Numeric.
4032 (log2): New fn. Safe log in base 2: returns exact integer answer
4038 (log2): New fn. Safe log in base 2: returns exact integer answer
4033 for exact integer powers of 2.
4039 for exact integer powers of 2.
4034
4040
4035 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4041 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4036 properly.
4042 properly.
4037
4043
4038 2002-06-20 Fernando Perez <fperez@colorado.edu>
4044 2002-06-20 Fernando Perez <fperez@colorado.edu>
4039
4045
4040 * IPython/genutils.py (timing): new function like
4046 * IPython/genutils.py (timing): new function like
4041 Mathematica's. Similar to time_test, but returns more info.
4047 Mathematica's. Similar to time_test, but returns more info.
4042
4048
4043 2002-06-18 Fernando Perez <fperez@colorado.edu>
4049 2002-06-18 Fernando Perez <fperez@colorado.edu>
4044
4050
4045 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4051 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4046 according to Mike Heeter's suggestions.
4052 according to Mike Heeter's suggestions.
4047
4053
4048 2002-06-16 Fernando Perez <fperez@colorado.edu>
4054 2002-06-16 Fernando Perez <fperez@colorado.edu>
4049
4055
4050 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4056 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4051 system. GnuplotMagic is gone as a user-directory option. New files
4057 system. GnuplotMagic is gone as a user-directory option. New files
4052 make it easier to use all the gnuplot stuff both from external
4058 make it easier to use all the gnuplot stuff both from external
4053 programs as well as from IPython. Had to rewrite part of
4059 programs as well as from IPython. Had to rewrite part of
4054 hardcopy() b/c of a strange bug: often the ps files simply don't
4060 hardcopy() b/c of a strange bug: often the ps files simply don't
4055 get created, and require a repeat of the command (often several
4061 get created, and require a repeat of the command (often several
4056 times).
4062 times).
4057
4063
4058 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4064 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4059 resolve output channel at call time, so that if sys.stderr has
4065 resolve output channel at call time, so that if sys.stderr has
4060 been redirected by user this gets honored.
4066 been redirected by user this gets honored.
4061
4067
4062 2002-06-13 Fernando Perez <fperez@colorado.edu>
4068 2002-06-13 Fernando Perez <fperez@colorado.edu>
4063
4069
4064 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4070 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4065 IPShell. Kept a copy with the old names to avoid breaking people's
4071 IPShell. Kept a copy with the old names to avoid breaking people's
4066 embedded code.
4072 embedded code.
4067
4073
4068 * IPython/ipython: simplified it to the bare minimum after
4074 * IPython/ipython: simplified it to the bare minimum after
4069 Holger's suggestions. Added info about how to use it in
4075 Holger's suggestions. Added info about how to use it in
4070 PYTHONSTARTUP.
4076 PYTHONSTARTUP.
4071
4077
4072 * IPython/Shell.py (IPythonShell): changed the options passing
4078 * IPython/Shell.py (IPythonShell): changed the options passing
4073 from a string with funky %s replacements to a straight list. Maybe
4079 from a string with funky %s replacements to a straight list. Maybe
4074 a bit more typing, but it follows sys.argv conventions, so there's
4080 a bit more typing, but it follows sys.argv conventions, so there's
4075 less special-casing to remember.
4081 less special-casing to remember.
4076
4082
4077 2002-06-12 Fernando Perez <fperez@colorado.edu>
4083 2002-06-12 Fernando Perez <fperez@colorado.edu>
4078
4084
4079 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4085 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4080 command. Thanks to a suggestion by Mike Heeter.
4086 command. Thanks to a suggestion by Mike Heeter.
4081 (Magic.magic_pfile): added behavior to look at filenames if given
4087 (Magic.magic_pfile): added behavior to look at filenames if given
4082 arg is not a defined object.
4088 arg is not a defined object.
4083 (Magic.magic_save): New @save function to save code snippets. Also
4089 (Magic.magic_save): New @save function to save code snippets. Also
4084 a Mike Heeter idea.
4090 a Mike Heeter idea.
4085
4091
4086 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4092 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4087 plot() and replot(). Much more convenient now, especially for
4093 plot() and replot(). Much more convenient now, especially for
4088 interactive use.
4094 interactive use.
4089
4095
4090 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4096 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4091 filenames.
4097 filenames.
4092
4098
4093 2002-06-02 Fernando Perez <fperez@colorado.edu>
4099 2002-06-02 Fernando Perez <fperez@colorado.edu>
4094
4100
4095 * IPython/Struct.py (Struct.__init__): modified to admit
4101 * IPython/Struct.py (Struct.__init__): modified to admit
4096 initialization via another struct.
4102 initialization via another struct.
4097
4103
4098 * IPython/genutils.py (SystemExec.__init__): New stateful
4104 * IPython/genutils.py (SystemExec.__init__): New stateful
4099 interface to xsys and bq. Useful for writing system scripts.
4105 interface to xsys and bq. Useful for writing system scripts.
4100
4106
4101 2002-05-30 Fernando Perez <fperez@colorado.edu>
4107 2002-05-30 Fernando Perez <fperez@colorado.edu>
4102
4108
4103 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4109 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4104 documents. This will make the user download smaller (it's getting
4110 documents. This will make the user download smaller (it's getting
4105 too big).
4111 too big).
4106
4112
4107 2002-05-29 Fernando Perez <fperez@colorado.edu>
4113 2002-05-29 Fernando Perez <fperez@colorado.edu>
4108
4114
4109 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4115 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4110 fix problems with shelve and pickle. Seems to work, but I don't
4116 fix problems with shelve and pickle. Seems to work, but I don't
4111 know if corner cases break it. Thanks to Mike Heeter
4117 know if corner cases break it. Thanks to Mike Heeter
4112 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4118 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4113
4119
4114 2002-05-24 Fernando Perez <fperez@colorado.edu>
4120 2002-05-24 Fernando Perez <fperez@colorado.edu>
4115
4121
4116 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4122 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4117 macros having broken.
4123 macros having broken.
4118
4124
4119 2002-05-21 Fernando Perez <fperez@colorado.edu>
4125 2002-05-21 Fernando Perez <fperez@colorado.edu>
4120
4126
4121 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4127 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4122 introduced logging bug: all history before logging started was
4128 introduced logging bug: all history before logging started was
4123 being written one character per line! This came from the redesign
4129 being written one character per line! This came from the redesign
4124 of the input history as a special list which slices to strings,
4130 of the input history as a special list which slices to strings,
4125 not to lists.
4131 not to lists.
4126
4132
4127 2002-05-20 Fernando Perez <fperez@colorado.edu>
4133 2002-05-20 Fernando Perez <fperez@colorado.edu>
4128
4134
4129 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4135 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4130 be an attribute of all classes in this module. The design of these
4136 be an attribute of all classes in this module. The design of these
4131 classes needs some serious overhauling.
4137 classes needs some serious overhauling.
4132
4138
4133 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4139 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4134 which was ignoring '_' in option names.
4140 which was ignoring '_' in option names.
4135
4141
4136 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4142 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4137 'Verbose_novars' to 'Context' and made it the new default. It's a
4143 'Verbose_novars' to 'Context' and made it the new default. It's a
4138 bit more readable and also safer than verbose.
4144 bit more readable and also safer than verbose.
4139
4145
4140 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4146 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4141 triple-quoted strings.
4147 triple-quoted strings.
4142
4148
4143 * IPython/OInspect.py (__all__): new module exposing the object
4149 * IPython/OInspect.py (__all__): new module exposing the object
4144 introspection facilities. Now the corresponding magics are dummy
4150 introspection facilities. Now the corresponding magics are dummy
4145 wrappers around this. Having this module will make it much easier
4151 wrappers around this. Having this module will make it much easier
4146 to put these functions into our modified pdb.
4152 to put these functions into our modified pdb.
4147 This new object inspector system uses the new colorizing module,
4153 This new object inspector system uses the new colorizing module,
4148 so source code and other things are nicely syntax highlighted.
4154 so source code and other things are nicely syntax highlighted.
4149
4155
4150 2002-05-18 Fernando Perez <fperez@colorado.edu>
4156 2002-05-18 Fernando Perez <fperez@colorado.edu>
4151
4157
4152 * IPython/ColorANSI.py: Split the coloring tools into a separate
4158 * IPython/ColorANSI.py: Split the coloring tools into a separate
4153 module so I can use them in other code easier (they were part of
4159 module so I can use them in other code easier (they were part of
4154 ultraTB).
4160 ultraTB).
4155
4161
4156 2002-05-17 Fernando Perez <fperez@colorado.edu>
4162 2002-05-17 Fernando Perez <fperez@colorado.edu>
4157
4163
4158 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4164 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4159 fixed it to set the global 'g' also to the called instance, as
4165 fixed it to set the global 'g' also to the called instance, as
4160 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4166 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4161 user's 'g' variables).
4167 user's 'g' variables).
4162
4168
4163 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4169 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4164 global variables (aliases to _ih,_oh) so that users which expect
4170 global variables (aliases to _ih,_oh) so that users which expect
4165 In[5] or Out[7] to work aren't unpleasantly surprised.
4171 In[5] or Out[7] to work aren't unpleasantly surprised.
4166 (InputList.__getslice__): new class to allow executing slices of
4172 (InputList.__getslice__): new class to allow executing slices of
4167 input history directly. Very simple class, complements the use of
4173 input history directly. Very simple class, complements the use of
4168 macros.
4174 macros.
4169
4175
4170 2002-05-16 Fernando Perez <fperez@colorado.edu>
4176 2002-05-16 Fernando Perez <fperez@colorado.edu>
4171
4177
4172 * setup.py (docdirbase): make doc directory be just doc/IPython
4178 * setup.py (docdirbase): make doc directory be just doc/IPython
4173 without version numbers, it will reduce clutter for users.
4179 without version numbers, it will reduce clutter for users.
4174
4180
4175 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4181 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4176 execfile call to prevent possible memory leak. See for details:
4182 execfile call to prevent possible memory leak. See for details:
4177 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4183 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4178
4184
4179 2002-05-15 Fernando Perez <fperez@colorado.edu>
4185 2002-05-15 Fernando Perez <fperez@colorado.edu>
4180
4186
4181 * IPython/Magic.py (Magic.magic_psource): made the object
4187 * IPython/Magic.py (Magic.magic_psource): made the object
4182 introspection names be more standard: pdoc, pdef, pfile and
4188 introspection names be more standard: pdoc, pdef, pfile and
4183 psource. They all print/page their output, and it makes
4189 psource. They all print/page their output, and it makes
4184 remembering them easier. Kept old names for compatibility as
4190 remembering them easier. Kept old names for compatibility as
4185 aliases.
4191 aliases.
4186
4192
4187 2002-05-14 Fernando Perez <fperez@colorado.edu>
4193 2002-05-14 Fernando Perez <fperez@colorado.edu>
4188
4194
4189 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4195 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4190 what the mouse problem was. The trick is to use gnuplot with temp
4196 what the mouse problem was. The trick is to use gnuplot with temp
4191 files and NOT with pipes (for data communication), because having
4197 files and NOT with pipes (for data communication), because having
4192 both pipes and the mouse on is bad news.
4198 both pipes and the mouse on is bad news.
4193
4199
4194 2002-05-13 Fernando Perez <fperez@colorado.edu>
4200 2002-05-13 Fernando Perez <fperez@colorado.edu>
4195
4201
4196 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4202 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4197 bug. Information would be reported about builtins even when
4203 bug. Information would be reported about builtins even when
4198 user-defined functions overrode them.
4204 user-defined functions overrode them.
4199
4205
4200 2002-05-11 Fernando Perez <fperez@colorado.edu>
4206 2002-05-11 Fernando Perez <fperez@colorado.edu>
4201
4207
4202 * IPython/__init__.py (__all__): removed FlexCompleter from
4208 * IPython/__init__.py (__all__): removed FlexCompleter from
4203 __all__ so that things don't fail in platforms without readline.
4209 __all__ so that things don't fail in platforms without readline.
4204
4210
4205 2002-05-10 Fernando Perez <fperez@colorado.edu>
4211 2002-05-10 Fernando Perez <fperez@colorado.edu>
4206
4212
4207 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4213 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4208 it requires Numeric, effectively making Numeric a dependency for
4214 it requires Numeric, effectively making Numeric a dependency for
4209 IPython.
4215 IPython.
4210
4216
4211 * Released 0.2.13
4217 * Released 0.2.13
4212
4218
4213 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4219 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4214 profiler interface. Now all the major options from the profiler
4220 profiler interface. Now all the major options from the profiler
4215 module are directly supported in IPython, both for single
4221 module are directly supported in IPython, both for single
4216 expressions (@prun) and for full programs (@run -p).
4222 expressions (@prun) and for full programs (@run -p).
4217
4223
4218 2002-05-09 Fernando Perez <fperez@colorado.edu>
4224 2002-05-09 Fernando Perez <fperez@colorado.edu>
4219
4225
4220 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4226 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4221 magic properly formatted for screen.
4227 magic properly formatted for screen.
4222
4228
4223 * setup.py (make_shortcut): Changed things to put pdf version in
4229 * setup.py (make_shortcut): Changed things to put pdf version in
4224 doc/ instead of doc/manual (had to change lyxport a bit).
4230 doc/ instead of doc/manual (had to change lyxport a bit).
4225
4231
4226 * IPython/Magic.py (Profile.string_stats): made profile runs go
4232 * IPython/Magic.py (Profile.string_stats): made profile runs go
4227 through pager (they are long and a pager allows searching, saving,
4233 through pager (they are long and a pager allows searching, saving,
4228 etc.)
4234 etc.)
4229
4235
4230 2002-05-08 Fernando Perez <fperez@colorado.edu>
4236 2002-05-08 Fernando Perez <fperez@colorado.edu>
4231
4237
4232 * Released 0.2.12
4238 * Released 0.2.12
4233
4239
4234 2002-05-06 Fernando Perez <fperez@colorado.edu>
4240 2002-05-06 Fernando Perez <fperez@colorado.edu>
4235
4241
4236 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4242 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4237 introduced); 'hist n1 n2' was broken.
4243 introduced); 'hist n1 n2' was broken.
4238 (Magic.magic_pdb): added optional on/off arguments to @pdb
4244 (Magic.magic_pdb): added optional on/off arguments to @pdb
4239 (Magic.magic_run): added option -i to @run, which executes code in
4245 (Magic.magic_run): added option -i to @run, which executes code in
4240 the IPython namespace instead of a clean one. Also added @irun as
4246 the IPython namespace instead of a clean one. Also added @irun as
4241 an alias to @run -i.
4247 an alias to @run -i.
4242
4248
4243 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4249 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4244 fixed (it didn't really do anything, the namespaces were wrong).
4250 fixed (it didn't really do anything, the namespaces were wrong).
4245
4251
4246 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4252 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4247
4253
4248 * IPython/__init__.py (__all__): Fixed package namespace, now
4254 * IPython/__init__.py (__all__): Fixed package namespace, now
4249 'import IPython' does give access to IPython.<all> as
4255 'import IPython' does give access to IPython.<all> as
4250 expected. Also renamed __release__ to Release.
4256 expected. Also renamed __release__ to Release.
4251
4257
4252 * IPython/Debugger.py (__license__): created new Pdb class which
4258 * IPython/Debugger.py (__license__): created new Pdb class which
4253 functions like a drop-in for the normal pdb.Pdb but does NOT
4259 functions like a drop-in for the normal pdb.Pdb but does NOT
4254 import readline by default. This way it doesn't muck up IPython's
4260 import readline by default. This way it doesn't muck up IPython's
4255 readline handling, and now tab-completion finally works in the
4261 readline handling, and now tab-completion finally works in the
4256 debugger -- sort of. It completes things globally visible, but the
4262 debugger -- sort of. It completes things globally visible, but the
4257 completer doesn't track the stack as pdb walks it. That's a bit
4263 completer doesn't track the stack as pdb walks it. That's a bit
4258 tricky, and I'll have to implement it later.
4264 tricky, and I'll have to implement it later.
4259
4265
4260 2002-05-05 Fernando Perez <fperez@colorado.edu>
4266 2002-05-05 Fernando Perez <fperez@colorado.edu>
4261
4267
4262 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4268 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4263 magic docstrings when printed via ? (explicit \'s were being
4269 magic docstrings when printed via ? (explicit \'s were being
4264 printed).
4270 printed).
4265
4271
4266 * IPython/ipmaker.py (make_IPython): fixed namespace
4272 * IPython/ipmaker.py (make_IPython): fixed namespace
4267 identification bug. Now variables loaded via logs or command-line
4273 identification bug. Now variables loaded via logs or command-line
4268 files are recognized in the interactive namespace by @who.
4274 files are recognized in the interactive namespace by @who.
4269
4275
4270 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4276 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4271 log replay system stemming from the string form of Structs.
4277 log replay system stemming from the string form of Structs.
4272
4278
4273 * IPython/Magic.py (Macro.__init__): improved macros to properly
4279 * IPython/Magic.py (Macro.__init__): improved macros to properly
4274 handle magic commands in them.
4280 handle magic commands in them.
4275 (Magic.magic_logstart): usernames are now expanded so 'logstart
4281 (Magic.magic_logstart): usernames are now expanded so 'logstart
4276 ~/mylog' now works.
4282 ~/mylog' now works.
4277
4283
4278 * IPython/iplib.py (complete): fixed bug where paths starting with
4284 * IPython/iplib.py (complete): fixed bug where paths starting with
4279 '/' would be completed as magic names.
4285 '/' would be completed as magic names.
4280
4286
4281 2002-05-04 Fernando Perez <fperez@colorado.edu>
4287 2002-05-04 Fernando Perez <fperez@colorado.edu>
4282
4288
4283 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4289 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4284 allow running full programs under the profiler's control.
4290 allow running full programs under the profiler's control.
4285
4291
4286 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4292 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4287 mode to report exceptions verbosely but without formatting
4293 mode to report exceptions verbosely but without formatting
4288 variables. This addresses the issue of ipython 'freezing' (it's
4294 variables. This addresses the issue of ipython 'freezing' (it's
4289 not frozen, but caught in an expensive formatting loop) when huge
4295 not frozen, but caught in an expensive formatting loop) when huge
4290 variables are in the context of an exception.
4296 variables are in the context of an exception.
4291 (VerboseTB.text): Added '--->' markers at line where exception was
4297 (VerboseTB.text): Added '--->' markers at line where exception was
4292 triggered. Much clearer to read, especially in NoColor modes.
4298 triggered. Much clearer to read, especially in NoColor modes.
4293
4299
4294 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4300 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4295 implemented in reverse when changing to the new parse_options().
4301 implemented in reverse when changing to the new parse_options().
4296
4302
4297 2002-05-03 Fernando Perez <fperez@colorado.edu>
4303 2002-05-03 Fernando Perez <fperez@colorado.edu>
4298
4304
4299 * IPython/Magic.py (Magic.parse_options): new function so that
4305 * IPython/Magic.py (Magic.parse_options): new function so that
4300 magics can parse options easier.
4306 magics can parse options easier.
4301 (Magic.magic_prun): new function similar to profile.run(),
4307 (Magic.magic_prun): new function similar to profile.run(),
4302 suggested by Chris Hart.
4308 suggested by Chris Hart.
4303 (Magic.magic_cd): fixed behavior so that it only changes if
4309 (Magic.magic_cd): fixed behavior so that it only changes if
4304 directory actually is in history.
4310 directory actually is in history.
4305
4311
4306 * IPython/usage.py (__doc__): added information about potential
4312 * IPython/usage.py (__doc__): added information about potential
4307 slowness of Verbose exception mode when there are huge data
4313 slowness of Verbose exception mode when there are huge data
4308 structures to be formatted (thanks to Archie Paulson).
4314 structures to be formatted (thanks to Archie Paulson).
4309
4315
4310 * IPython/ipmaker.py (make_IPython): Changed default logging
4316 * IPython/ipmaker.py (make_IPython): Changed default logging
4311 (when simply called with -log) to use curr_dir/ipython.log in
4317 (when simply called with -log) to use curr_dir/ipython.log in
4312 rotate mode. Fixed crash which was occuring with -log before
4318 rotate mode. Fixed crash which was occuring with -log before
4313 (thanks to Jim Boyle).
4319 (thanks to Jim Boyle).
4314
4320
4315 2002-05-01 Fernando Perez <fperez@colorado.edu>
4321 2002-05-01 Fernando Perez <fperez@colorado.edu>
4316
4322
4317 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4323 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4318 was nasty -- though somewhat of a corner case).
4324 was nasty -- though somewhat of a corner case).
4319
4325
4320 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4326 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4321 text (was a bug).
4327 text (was a bug).
4322
4328
4323 2002-04-30 Fernando Perez <fperez@colorado.edu>
4329 2002-04-30 Fernando Perez <fperez@colorado.edu>
4324
4330
4325 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4331 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4326 a print after ^D or ^C from the user so that the In[] prompt
4332 a print after ^D or ^C from the user so that the In[] prompt
4327 doesn't over-run the gnuplot one.
4333 doesn't over-run the gnuplot one.
4328
4334
4329 2002-04-29 Fernando Perez <fperez@colorado.edu>
4335 2002-04-29 Fernando Perez <fperez@colorado.edu>
4330
4336
4331 * Released 0.2.10
4337 * Released 0.2.10
4332
4338
4333 * IPython/__release__.py (version): get date dynamically.
4339 * IPython/__release__.py (version): get date dynamically.
4334
4340
4335 * Misc. documentation updates thanks to Arnd's comments. Also ran
4341 * Misc. documentation updates thanks to Arnd's comments. Also ran
4336 a full spellcheck on the manual (hadn't been done in a while).
4342 a full spellcheck on the manual (hadn't been done in a while).
4337
4343
4338 2002-04-27 Fernando Perez <fperez@colorado.edu>
4344 2002-04-27 Fernando Perez <fperez@colorado.edu>
4339
4345
4340 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4346 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4341 starting a log in mid-session would reset the input history list.
4347 starting a log in mid-session would reset the input history list.
4342
4348
4343 2002-04-26 Fernando Perez <fperez@colorado.edu>
4349 2002-04-26 Fernando Perez <fperez@colorado.edu>
4344
4350
4345 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4351 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4346 all files were being included in an update. Now anything in
4352 all files were being included in an update. Now anything in
4347 UserConfig that matches [A-Za-z]*.py will go (this excludes
4353 UserConfig that matches [A-Za-z]*.py will go (this excludes
4348 __init__.py)
4354 __init__.py)
4349
4355
4350 2002-04-25 Fernando Perez <fperez@colorado.edu>
4356 2002-04-25 Fernando Perez <fperez@colorado.edu>
4351
4357
4352 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4358 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4353 to __builtins__ so that any form of embedded or imported code can
4359 to __builtins__ so that any form of embedded or imported code can
4354 test for being inside IPython.
4360 test for being inside IPython.
4355
4361
4356 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4362 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4357 changed to GnuplotMagic because it's now an importable module,
4363 changed to GnuplotMagic because it's now an importable module,
4358 this makes the name follow that of the standard Gnuplot module.
4364 this makes the name follow that of the standard Gnuplot module.
4359 GnuplotMagic can now be loaded at any time in mid-session.
4365 GnuplotMagic can now be loaded at any time in mid-session.
4360
4366
4361 2002-04-24 Fernando Perez <fperez@colorado.edu>
4367 2002-04-24 Fernando Perez <fperez@colorado.edu>
4362
4368
4363 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4369 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4364 the globals (IPython has its own namespace) and the
4370 the globals (IPython has its own namespace) and the
4365 PhysicalQuantity stuff is much better anyway.
4371 PhysicalQuantity stuff is much better anyway.
4366
4372
4367 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4373 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4368 embedding example to standard user directory for
4374 embedding example to standard user directory for
4369 distribution. Also put it in the manual.
4375 distribution. Also put it in the manual.
4370
4376
4371 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4377 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4372 instance as first argument (so it doesn't rely on some obscure
4378 instance as first argument (so it doesn't rely on some obscure
4373 hidden global).
4379 hidden global).
4374
4380
4375 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4381 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4376 delimiters. While it prevents ().TAB from working, it allows
4382 delimiters. While it prevents ().TAB from working, it allows
4377 completions in open (... expressions. This is by far a more common
4383 completions in open (... expressions. This is by far a more common
4378 case.
4384 case.
4379
4385
4380 2002-04-23 Fernando Perez <fperez@colorado.edu>
4386 2002-04-23 Fernando Perez <fperez@colorado.edu>
4381
4387
4382 * IPython/Extensions/InterpreterPasteInput.py: new
4388 * IPython/Extensions/InterpreterPasteInput.py: new
4383 syntax-processing module for pasting lines with >>> or ... at the
4389 syntax-processing module for pasting lines with >>> or ... at the
4384 start.
4390 start.
4385
4391
4386 * IPython/Extensions/PhysicalQ_Interactive.py
4392 * IPython/Extensions/PhysicalQ_Interactive.py
4387 (PhysicalQuantityInteractive.__int__): fixed to work with either
4393 (PhysicalQuantityInteractive.__int__): fixed to work with either
4388 Numeric or math.
4394 Numeric or math.
4389
4395
4390 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4396 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4391 provided profiles. Now we have:
4397 provided profiles. Now we have:
4392 -math -> math module as * and cmath with its own namespace.
4398 -math -> math module as * and cmath with its own namespace.
4393 -numeric -> Numeric as *, plus gnuplot & grace
4399 -numeric -> Numeric as *, plus gnuplot & grace
4394 -physics -> same as before
4400 -physics -> same as before
4395
4401
4396 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4402 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4397 user-defined magics wouldn't be found by @magic if they were
4403 user-defined magics wouldn't be found by @magic if they were
4398 defined as class methods. Also cleaned up the namespace search
4404 defined as class methods. Also cleaned up the namespace search
4399 logic and the string building (to use %s instead of many repeated
4405 logic and the string building (to use %s instead of many repeated
4400 string adds).
4406 string adds).
4401
4407
4402 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4408 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4403 of user-defined magics to operate with class methods (cleaner, in
4409 of user-defined magics to operate with class methods (cleaner, in
4404 line with the gnuplot code).
4410 line with the gnuplot code).
4405
4411
4406 2002-04-22 Fernando Perez <fperez@colorado.edu>
4412 2002-04-22 Fernando Perez <fperez@colorado.edu>
4407
4413
4408 * setup.py: updated dependency list so that manual is updated when
4414 * setup.py: updated dependency list so that manual is updated when
4409 all included files change.
4415 all included files change.
4410
4416
4411 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4417 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4412 the delimiter removal option (the fix is ugly right now).
4418 the delimiter removal option (the fix is ugly right now).
4413
4419
4414 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4420 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4415 all of the math profile (quicker loading, no conflict between
4421 all of the math profile (quicker loading, no conflict between
4416 g-9.8 and g-gnuplot).
4422 g-9.8 and g-gnuplot).
4417
4423
4418 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4424 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4419 name of post-mortem files to IPython_crash_report.txt.
4425 name of post-mortem files to IPython_crash_report.txt.
4420
4426
4421 * Cleanup/update of the docs. Added all the new readline info and
4427 * Cleanup/update of the docs. Added all the new readline info and
4422 formatted all lists as 'real lists'.
4428 formatted all lists as 'real lists'.
4423
4429
4424 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4430 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4425 tab-completion options, since the full readline parse_and_bind is
4431 tab-completion options, since the full readline parse_and_bind is
4426 now accessible.
4432 now accessible.
4427
4433
4428 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4434 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4429 handling of readline options. Now users can specify any string to
4435 handling of readline options. Now users can specify any string to
4430 be passed to parse_and_bind(), as well as the delimiters to be
4436 be passed to parse_and_bind(), as well as the delimiters to be
4431 removed.
4437 removed.
4432 (InteractiveShell.__init__): Added __name__ to the global
4438 (InteractiveShell.__init__): Added __name__ to the global
4433 namespace so that things like Itpl which rely on its existence
4439 namespace so that things like Itpl which rely on its existence
4434 don't crash.
4440 don't crash.
4435 (InteractiveShell._prefilter): Defined the default with a _ so
4441 (InteractiveShell._prefilter): Defined the default with a _ so
4436 that prefilter() is easier to override, while the default one
4442 that prefilter() is easier to override, while the default one
4437 remains available.
4443 remains available.
4438
4444
4439 2002-04-18 Fernando Perez <fperez@colorado.edu>
4445 2002-04-18 Fernando Perez <fperez@colorado.edu>
4440
4446
4441 * Added information about pdb in the docs.
4447 * Added information about pdb in the docs.
4442
4448
4443 2002-04-17 Fernando Perez <fperez@colorado.edu>
4449 2002-04-17 Fernando Perez <fperez@colorado.edu>
4444
4450
4445 * IPython/ipmaker.py (make_IPython): added rc_override option to
4451 * IPython/ipmaker.py (make_IPython): added rc_override option to
4446 allow passing config options at creation time which may override
4452 allow passing config options at creation time which may override
4447 anything set in the config files or command line. This is
4453 anything set in the config files or command line. This is
4448 particularly useful for configuring embedded instances.
4454 particularly useful for configuring embedded instances.
4449
4455
4450 2002-04-15 Fernando Perez <fperez@colorado.edu>
4456 2002-04-15 Fernando Perez <fperez@colorado.edu>
4451
4457
4452 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4458 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4453 crash embedded instances because of the input cache falling out of
4459 crash embedded instances because of the input cache falling out of
4454 sync with the output counter.
4460 sync with the output counter.
4455
4461
4456 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4462 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4457 mode which calls pdb after an uncaught exception in IPython itself.
4463 mode which calls pdb after an uncaught exception in IPython itself.
4458
4464
4459 2002-04-14 Fernando Perez <fperez@colorado.edu>
4465 2002-04-14 Fernando Perez <fperez@colorado.edu>
4460
4466
4461 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4467 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4462 readline, fix it back after each call.
4468 readline, fix it back after each call.
4463
4469
4464 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4470 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4465 method to force all access via __call__(), which guarantees that
4471 method to force all access via __call__(), which guarantees that
4466 traceback references are properly deleted.
4472 traceback references are properly deleted.
4467
4473
4468 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4474 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4469 improve printing when pprint is in use.
4475 improve printing when pprint is in use.
4470
4476
4471 2002-04-13 Fernando Perez <fperez@colorado.edu>
4477 2002-04-13 Fernando Perez <fperez@colorado.edu>
4472
4478
4473 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4479 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4474 exceptions aren't caught anymore. If the user triggers one, he
4480 exceptions aren't caught anymore. If the user triggers one, he
4475 should know why he's doing it and it should go all the way up,
4481 should know why he's doing it and it should go all the way up,
4476 just like any other exception. So now @abort will fully kill the
4482 just like any other exception. So now @abort will fully kill the
4477 embedded interpreter and the embedding code (unless that happens
4483 embedded interpreter and the embedding code (unless that happens
4478 to catch SystemExit).
4484 to catch SystemExit).
4479
4485
4480 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4486 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4481 and a debugger() method to invoke the interactive pdb debugger
4487 and a debugger() method to invoke the interactive pdb debugger
4482 after printing exception information. Also added the corresponding
4488 after printing exception information. Also added the corresponding
4483 -pdb option and @pdb magic to control this feature, and updated
4489 -pdb option and @pdb magic to control this feature, and updated
4484 the docs. After a suggestion from Christopher Hart
4490 the docs. After a suggestion from Christopher Hart
4485 (hart-AT-caltech.edu).
4491 (hart-AT-caltech.edu).
4486
4492
4487 2002-04-12 Fernando Perez <fperez@colorado.edu>
4493 2002-04-12 Fernando Perez <fperez@colorado.edu>
4488
4494
4489 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4495 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4490 the exception handlers defined by the user (not the CrashHandler)
4496 the exception handlers defined by the user (not the CrashHandler)
4491 so that user exceptions don't trigger an ipython bug report.
4497 so that user exceptions don't trigger an ipython bug report.
4492
4498
4493 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4499 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4494 configurable (it should have always been so).
4500 configurable (it should have always been so).
4495
4501
4496 2002-03-26 Fernando Perez <fperez@colorado.edu>
4502 2002-03-26 Fernando Perez <fperez@colorado.edu>
4497
4503
4498 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4504 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4499 and there to fix embedding namespace issues. This should all be
4505 and there to fix embedding namespace issues. This should all be
4500 done in a more elegant way.
4506 done in a more elegant way.
4501
4507
4502 2002-03-25 Fernando Perez <fperez@colorado.edu>
4508 2002-03-25 Fernando Perez <fperez@colorado.edu>
4503
4509
4504 * IPython/genutils.py (get_home_dir): Try to make it work under
4510 * IPython/genutils.py (get_home_dir): Try to make it work under
4505 win9x also.
4511 win9x also.
4506
4512
4507 2002-03-20 Fernando Perez <fperez@colorado.edu>
4513 2002-03-20 Fernando Perez <fperez@colorado.edu>
4508
4514
4509 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4515 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4510 sys.displayhook untouched upon __init__.
4516 sys.displayhook untouched upon __init__.
4511
4517
4512 2002-03-19 Fernando Perez <fperez@colorado.edu>
4518 2002-03-19 Fernando Perez <fperez@colorado.edu>
4513
4519
4514 * Released 0.2.9 (for embedding bug, basically).
4520 * Released 0.2.9 (for embedding bug, basically).
4515
4521
4516 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4522 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4517 exceptions so that enclosing shell's state can be restored.
4523 exceptions so that enclosing shell's state can be restored.
4518
4524
4519 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4525 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4520 naming conventions in the .ipython/ dir.
4526 naming conventions in the .ipython/ dir.
4521
4527
4522 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4528 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4523 from delimiters list so filenames with - in them get expanded.
4529 from delimiters list so filenames with - in them get expanded.
4524
4530
4525 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4531 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4526 sys.displayhook not being properly restored after an embedded call.
4532 sys.displayhook not being properly restored after an embedded call.
4527
4533
4528 2002-03-18 Fernando Perez <fperez@colorado.edu>
4534 2002-03-18 Fernando Perez <fperez@colorado.edu>
4529
4535
4530 * Released 0.2.8
4536 * Released 0.2.8
4531
4537
4532 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4538 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4533 some files weren't being included in a -upgrade.
4539 some files weren't being included in a -upgrade.
4534 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4540 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4535 on' so that the first tab completes.
4541 on' so that the first tab completes.
4536 (InteractiveShell.handle_magic): fixed bug with spaces around
4542 (InteractiveShell.handle_magic): fixed bug with spaces around
4537 quotes breaking many magic commands.
4543 quotes breaking many magic commands.
4538
4544
4539 * setup.py: added note about ignoring the syntax error messages at
4545 * setup.py: added note about ignoring the syntax error messages at
4540 installation.
4546 installation.
4541
4547
4542 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4548 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4543 streamlining the gnuplot interface, now there's only one magic @gp.
4549 streamlining the gnuplot interface, now there's only one magic @gp.
4544
4550
4545 2002-03-17 Fernando Perez <fperez@colorado.edu>
4551 2002-03-17 Fernando Perez <fperez@colorado.edu>
4546
4552
4547 * IPython/UserConfig/magic_gnuplot.py: new name for the
4553 * IPython/UserConfig/magic_gnuplot.py: new name for the
4548 example-magic_pm.py file. Much enhanced system, now with a shell
4554 example-magic_pm.py file. Much enhanced system, now with a shell
4549 for communicating directly with gnuplot, one command at a time.
4555 for communicating directly with gnuplot, one command at a time.
4550
4556
4551 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4557 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4552 setting __name__=='__main__'.
4558 setting __name__=='__main__'.
4553
4559
4554 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4560 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4555 mini-shell for accessing gnuplot from inside ipython. Should
4561 mini-shell for accessing gnuplot from inside ipython. Should
4556 extend it later for grace access too. Inspired by Arnd's
4562 extend it later for grace access too. Inspired by Arnd's
4557 suggestion.
4563 suggestion.
4558
4564
4559 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4565 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4560 calling magic functions with () in their arguments. Thanks to Arnd
4566 calling magic functions with () in their arguments. Thanks to Arnd
4561 Baecker for pointing this to me.
4567 Baecker for pointing this to me.
4562
4568
4563 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4569 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4564 infinitely for integer or complex arrays (only worked with floats).
4570 infinitely for integer or complex arrays (only worked with floats).
4565
4571
4566 2002-03-16 Fernando Perez <fperez@colorado.edu>
4572 2002-03-16 Fernando Perez <fperez@colorado.edu>
4567
4573
4568 * setup.py: Merged setup and setup_windows into a single script
4574 * setup.py: Merged setup and setup_windows into a single script
4569 which properly handles things for windows users.
4575 which properly handles things for windows users.
4570
4576
4571 2002-03-15 Fernando Perez <fperez@colorado.edu>
4577 2002-03-15 Fernando Perez <fperez@colorado.edu>
4572
4578
4573 * Big change to the manual: now the magics are all automatically
4579 * Big change to the manual: now the magics are all automatically
4574 documented. This information is generated from their docstrings
4580 documented. This information is generated from their docstrings
4575 and put in a latex file included by the manual lyx file. This way
4581 and put in a latex file included by the manual lyx file. This way
4576 we get always up to date information for the magics. The manual
4582 we get always up to date information for the magics. The manual
4577 now also has proper version information, also auto-synced.
4583 now also has proper version information, also auto-synced.
4578
4584
4579 For this to work, an undocumented --magic_docstrings option was added.
4585 For this to work, an undocumented --magic_docstrings option was added.
4580
4586
4581 2002-03-13 Fernando Perez <fperez@colorado.edu>
4587 2002-03-13 Fernando Perez <fperez@colorado.edu>
4582
4588
4583 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4589 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4584 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4590 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4585
4591
4586 2002-03-12 Fernando Perez <fperez@colorado.edu>
4592 2002-03-12 Fernando Perez <fperez@colorado.edu>
4587
4593
4588 * IPython/ultraTB.py (TermColors): changed color escapes again to
4594 * IPython/ultraTB.py (TermColors): changed color escapes again to
4589 fix the (old, reintroduced) line-wrapping bug. Basically, if
4595 fix the (old, reintroduced) line-wrapping bug. Basically, if
4590 \001..\002 aren't given in the color escapes, lines get wrapped
4596 \001..\002 aren't given in the color escapes, lines get wrapped
4591 weirdly. But giving those screws up old xterms and emacs terms. So
4597 weirdly. But giving those screws up old xterms and emacs terms. So
4592 I added some logic for emacs terms to be ok, but I can't identify old
4598 I added some logic for emacs terms to be ok, but I can't identify old
4593 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4599 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4594
4600
4595 2002-03-10 Fernando Perez <fperez@colorado.edu>
4601 2002-03-10 Fernando Perez <fperez@colorado.edu>
4596
4602
4597 * IPython/usage.py (__doc__): Various documentation cleanups and
4603 * IPython/usage.py (__doc__): Various documentation cleanups and
4598 updates, both in usage docstrings and in the manual.
4604 updates, both in usage docstrings and in the manual.
4599
4605
4600 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4606 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4601 handling of caching. Set minimum acceptabe value for having a
4607 handling of caching. Set minimum acceptabe value for having a
4602 cache at 20 values.
4608 cache at 20 values.
4603
4609
4604 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4610 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4605 install_first_time function to a method, renamed it and added an
4611 install_first_time function to a method, renamed it and added an
4606 'upgrade' mode. Now people can update their config directory with
4612 'upgrade' mode. Now people can update their config directory with
4607 a simple command line switch (-upgrade, also new).
4613 a simple command line switch (-upgrade, also new).
4608
4614
4609 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4615 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4610 @file (convenient for automagic users under Python >= 2.2).
4616 @file (convenient for automagic users under Python >= 2.2).
4611 Removed @files (it seemed more like a plural than an abbrev. of
4617 Removed @files (it seemed more like a plural than an abbrev. of
4612 'file show').
4618 'file show').
4613
4619
4614 * IPython/iplib.py (install_first_time): Fixed crash if there were
4620 * IPython/iplib.py (install_first_time): Fixed crash if there were
4615 backup files ('~') in .ipython/ install directory.
4621 backup files ('~') in .ipython/ install directory.
4616
4622
4617 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4623 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4618 system. Things look fine, but these changes are fairly
4624 system. Things look fine, but these changes are fairly
4619 intrusive. Test them for a few days.
4625 intrusive. Test them for a few days.
4620
4626
4621 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4627 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4622 the prompts system. Now all in/out prompt strings are user
4628 the prompts system. Now all in/out prompt strings are user
4623 controllable. This is particularly useful for embedding, as one
4629 controllable. This is particularly useful for embedding, as one
4624 can tag embedded instances with particular prompts.
4630 can tag embedded instances with particular prompts.
4625
4631
4626 Also removed global use of sys.ps1/2, which now allows nested
4632 Also removed global use of sys.ps1/2, which now allows nested
4627 embeddings without any problems. Added command-line options for
4633 embeddings without any problems. Added command-line options for
4628 the prompt strings.
4634 the prompt strings.
4629
4635
4630 2002-03-08 Fernando Perez <fperez@colorado.edu>
4636 2002-03-08 Fernando Perez <fperez@colorado.edu>
4631
4637
4632 * IPython/UserConfig/example-embed-short.py (ipshell): added
4638 * IPython/UserConfig/example-embed-short.py (ipshell): added
4633 example file with the bare minimum code for embedding.
4639 example file with the bare minimum code for embedding.
4634
4640
4635 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4641 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4636 functionality for the embeddable shell to be activated/deactivated
4642 functionality for the embeddable shell to be activated/deactivated
4637 either globally or at each call.
4643 either globally or at each call.
4638
4644
4639 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4645 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4640 rewriting the prompt with '--->' for auto-inputs with proper
4646 rewriting the prompt with '--->' for auto-inputs with proper
4641 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4647 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4642 this is handled by the prompts class itself, as it should.
4648 this is handled by the prompts class itself, as it should.
4643
4649
4644 2002-03-05 Fernando Perez <fperez@colorado.edu>
4650 2002-03-05 Fernando Perez <fperez@colorado.edu>
4645
4651
4646 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4652 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4647 @logstart to avoid name clashes with the math log function.
4653 @logstart to avoid name clashes with the math log function.
4648
4654
4649 * Big updates to X/Emacs section of the manual.
4655 * Big updates to X/Emacs section of the manual.
4650
4656
4651 * Removed ipython_emacs. Milan explained to me how to pass
4657 * Removed ipython_emacs. Milan explained to me how to pass
4652 arguments to ipython through Emacs. Some day I'm going to end up
4658 arguments to ipython through Emacs. Some day I'm going to end up
4653 learning some lisp...
4659 learning some lisp...
4654
4660
4655 2002-03-04 Fernando Perez <fperez@colorado.edu>
4661 2002-03-04 Fernando Perez <fperez@colorado.edu>
4656
4662
4657 * IPython/ipython_emacs: Created script to be used as the
4663 * IPython/ipython_emacs: Created script to be used as the
4658 py-python-command Emacs variable so we can pass IPython
4664 py-python-command Emacs variable so we can pass IPython
4659 parameters. I can't figure out how to tell Emacs directly to pass
4665 parameters. I can't figure out how to tell Emacs directly to pass
4660 parameters to IPython, so a dummy shell script will do it.
4666 parameters to IPython, so a dummy shell script will do it.
4661
4667
4662 Other enhancements made for things to work better under Emacs'
4668 Other enhancements made for things to work better under Emacs'
4663 various types of terminals. Many thanks to Milan Zamazal
4669 various types of terminals. Many thanks to Milan Zamazal
4664 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4670 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4665
4671
4666 2002-03-01 Fernando Perez <fperez@colorado.edu>
4672 2002-03-01 Fernando Perez <fperez@colorado.edu>
4667
4673
4668 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4674 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4669 that loading of readline is now optional. This gives better
4675 that loading of readline is now optional. This gives better
4670 control to emacs users.
4676 control to emacs users.
4671
4677
4672 * IPython/ultraTB.py (__date__): Modified color escape sequences
4678 * IPython/ultraTB.py (__date__): Modified color escape sequences
4673 and now things work fine under xterm and in Emacs' term buffers
4679 and now things work fine under xterm and in Emacs' term buffers
4674 (though not shell ones). Well, in emacs you get colors, but all
4680 (though not shell ones). Well, in emacs you get colors, but all
4675 seem to be 'light' colors (no difference between dark and light
4681 seem to be 'light' colors (no difference between dark and light
4676 ones). But the garbage chars are gone, and also in xterms. It
4682 ones). But the garbage chars are gone, and also in xterms. It
4677 seems that now I'm using 'cleaner' ansi sequences.
4683 seems that now I'm using 'cleaner' ansi sequences.
4678
4684
4679 2002-02-21 Fernando Perez <fperez@colorado.edu>
4685 2002-02-21 Fernando Perez <fperez@colorado.edu>
4680
4686
4681 * Released 0.2.7 (mainly to publish the scoping fix).
4687 * Released 0.2.7 (mainly to publish the scoping fix).
4682
4688
4683 * IPython/Logger.py (Logger.logstate): added. A corresponding
4689 * IPython/Logger.py (Logger.logstate): added. A corresponding
4684 @logstate magic was created.
4690 @logstate magic was created.
4685
4691
4686 * IPython/Magic.py: fixed nested scoping problem under Python
4692 * IPython/Magic.py: fixed nested scoping problem under Python
4687 2.1.x (automagic wasn't working).
4693 2.1.x (automagic wasn't working).
4688
4694
4689 2002-02-20 Fernando Perez <fperez@colorado.edu>
4695 2002-02-20 Fernando Perez <fperez@colorado.edu>
4690
4696
4691 * Released 0.2.6.
4697 * Released 0.2.6.
4692
4698
4693 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4699 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4694 option so that logs can come out without any headers at all.
4700 option so that logs can come out without any headers at all.
4695
4701
4696 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4702 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4697 SciPy.
4703 SciPy.
4698
4704
4699 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4705 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4700 that embedded IPython calls don't require vars() to be explicitly
4706 that embedded IPython calls don't require vars() to be explicitly
4701 passed. Now they are extracted from the caller's frame (code
4707 passed. Now they are extracted from the caller's frame (code
4702 snatched from Eric Jones' weave). Added better documentation to
4708 snatched from Eric Jones' weave). Added better documentation to
4703 the section on embedding and the example file.
4709 the section on embedding and the example file.
4704
4710
4705 * IPython/genutils.py (page): Changed so that under emacs, it just
4711 * IPython/genutils.py (page): Changed so that under emacs, it just
4706 prints the string. You can then page up and down in the emacs
4712 prints the string. You can then page up and down in the emacs
4707 buffer itself. This is how the builtin help() works.
4713 buffer itself. This is how the builtin help() works.
4708
4714
4709 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4715 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4710 macro scoping: macros need to be executed in the user's namespace
4716 macro scoping: macros need to be executed in the user's namespace
4711 to work as if they had been typed by the user.
4717 to work as if they had been typed by the user.
4712
4718
4713 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4719 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4714 execute automatically (no need to type 'exec...'). They then
4720 execute automatically (no need to type 'exec...'). They then
4715 behave like 'true macros'. The printing system was also modified
4721 behave like 'true macros'. The printing system was also modified
4716 for this to work.
4722 for this to work.
4717
4723
4718 2002-02-19 Fernando Perez <fperez@colorado.edu>
4724 2002-02-19 Fernando Perez <fperez@colorado.edu>
4719
4725
4720 * IPython/genutils.py (page_file): new function for paging files
4726 * IPython/genutils.py (page_file): new function for paging files
4721 in an OS-independent way. Also necessary for file viewing to work
4727 in an OS-independent way. Also necessary for file viewing to work
4722 well inside Emacs buffers.
4728 well inside Emacs buffers.
4723 (page): Added checks for being in an emacs buffer.
4729 (page): Added checks for being in an emacs buffer.
4724 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4730 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4725 same bug in iplib.
4731 same bug in iplib.
4726
4732
4727 2002-02-18 Fernando Perez <fperez@colorado.edu>
4733 2002-02-18 Fernando Perez <fperez@colorado.edu>
4728
4734
4729 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4735 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4730 of readline so that IPython can work inside an Emacs buffer.
4736 of readline so that IPython can work inside an Emacs buffer.
4731
4737
4732 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4738 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4733 method signatures (they weren't really bugs, but it looks cleaner
4739 method signatures (they weren't really bugs, but it looks cleaner
4734 and keeps PyChecker happy).
4740 and keeps PyChecker happy).
4735
4741
4736 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4742 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4737 for implementing various user-defined hooks. Currently only
4743 for implementing various user-defined hooks. Currently only
4738 display is done.
4744 display is done.
4739
4745
4740 * IPython/Prompts.py (CachedOutput._display): changed display
4746 * IPython/Prompts.py (CachedOutput._display): changed display
4741 functions so that they can be dynamically changed by users easily.
4747 functions so that they can be dynamically changed by users easily.
4742
4748
4743 * IPython/Extensions/numeric_formats.py (num_display): added an
4749 * IPython/Extensions/numeric_formats.py (num_display): added an
4744 extension for printing NumPy arrays in flexible manners. It
4750 extension for printing NumPy arrays in flexible manners. It
4745 doesn't do anything yet, but all the structure is in
4751 doesn't do anything yet, but all the structure is in
4746 place. Ultimately the plan is to implement output format control
4752 place. Ultimately the plan is to implement output format control
4747 like in Octave.
4753 like in Octave.
4748
4754
4749 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4755 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4750 methods are found at run-time by all the automatic machinery.
4756 methods are found at run-time by all the automatic machinery.
4751
4757
4752 2002-02-17 Fernando Perez <fperez@colorado.edu>
4758 2002-02-17 Fernando Perez <fperez@colorado.edu>
4753
4759
4754 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4760 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4755 whole file a little.
4761 whole file a little.
4756
4762
4757 * ToDo: closed this document. Now there's a new_design.lyx
4763 * ToDo: closed this document. Now there's a new_design.lyx
4758 document for all new ideas. Added making a pdf of it for the
4764 document for all new ideas. Added making a pdf of it for the
4759 end-user distro.
4765 end-user distro.
4760
4766
4761 * IPython/Logger.py (Logger.switch_log): Created this to replace
4767 * IPython/Logger.py (Logger.switch_log): Created this to replace
4762 logon() and logoff(). It also fixes a nasty crash reported by
4768 logon() and logoff(). It also fixes a nasty crash reported by
4763 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4769 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4764
4770
4765 * IPython/iplib.py (complete): got auto-completion to work with
4771 * IPython/iplib.py (complete): got auto-completion to work with
4766 automagic (I had wanted this for a long time).
4772 automagic (I had wanted this for a long time).
4767
4773
4768 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4774 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4769 to @file, since file() is now a builtin and clashes with automagic
4775 to @file, since file() is now a builtin and clashes with automagic
4770 for @file.
4776 for @file.
4771
4777
4772 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4778 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4773 of this was previously in iplib, which had grown to more than 2000
4779 of this was previously in iplib, which had grown to more than 2000
4774 lines, way too long. No new functionality, but it makes managing
4780 lines, way too long. No new functionality, but it makes managing
4775 the code a bit easier.
4781 the code a bit easier.
4776
4782
4777 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4783 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4778 information to crash reports.
4784 information to crash reports.
4779
4785
4780 2002-02-12 Fernando Perez <fperez@colorado.edu>
4786 2002-02-12 Fernando Perez <fperez@colorado.edu>
4781
4787
4782 * Released 0.2.5.
4788 * Released 0.2.5.
4783
4789
4784 2002-02-11 Fernando Perez <fperez@colorado.edu>
4790 2002-02-11 Fernando Perez <fperez@colorado.edu>
4785
4791
4786 * Wrote a relatively complete Windows installer. It puts
4792 * Wrote a relatively complete Windows installer. It puts
4787 everything in place, creates Start Menu entries and fixes the
4793 everything in place, creates Start Menu entries and fixes the
4788 color issues. Nothing fancy, but it works.
4794 color issues. Nothing fancy, but it works.
4789
4795
4790 2002-02-10 Fernando Perez <fperez@colorado.edu>
4796 2002-02-10 Fernando Perez <fperez@colorado.edu>
4791
4797
4792 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4798 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4793 os.path.expanduser() call so that we can type @run ~/myfile.py and
4799 os.path.expanduser() call so that we can type @run ~/myfile.py and
4794 have thigs work as expected.
4800 have thigs work as expected.
4795
4801
4796 * IPython/genutils.py (page): fixed exception handling so things
4802 * IPython/genutils.py (page): fixed exception handling so things
4797 work both in Unix and Windows correctly. Quitting a pager triggers
4803 work both in Unix and Windows correctly. Quitting a pager triggers
4798 an IOError/broken pipe in Unix, and in windows not finding a pager
4804 an IOError/broken pipe in Unix, and in windows not finding a pager
4799 is also an IOError, so I had to actually look at the return value
4805 is also an IOError, so I had to actually look at the return value
4800 of the exception, not just the exception itself. Should be ok now.
4806 of the exception, not just the exception itself. Should be ok now.
4801
4807
4802 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4808 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4803 modified to allow case-insensitive color scheme changes.
4809 modified to allow case-insensitive color scheme changes.
4804
4810
4805 2002-02-09 Fernando Perez <fperez@colorado.edu>
4811 2002-02-09 Fernando Perez <fperez@colorado.edu>
4806
4812
4807 * IPython/genutils.py (native_line_ends): new function to leave
4813 * IPython/genutils.py (native_line_ends): new function to leave
4808 user config files with os-native line-endings.
4814 user config files with os-native line-endings.
4809
4815
4810 * README and manual updates.
4816 * README and manual updates.
4811
4817
4812 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4818 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4813 instead of StringType to catch Unicode strings.
4819 instead of StringType to catch Unicode strings.
4814
4820
4815 * IPython/genutils.py (filefind): fixed bug for paths with
4821 * IPython/genutils.py (filefind): fixed bug for paths with
4816 embedded spaces (very common in Windows).
4822 embedded spaces (very common in Windows).
4817
4823
4818 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4824 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4819 files under Windows, so that they get automatically associated
4825 files under Windows, so that they get automatically associated
4820 with a text editor. Windows makes it a pain to handle
4826 with a text editor. Windows makes it a pain to handle
4821 extension-less files.
4827 extension-less files.
4822
4828
4823 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4829 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4824 warning about readline only occur for Posix. In Windows there's no
4830 warning about readline only occur for Posix. In Windows there's no
4825 way to get readline, so why bother with the warning.
4831 way to get readline, so why bother with the warning.
4826
4832
4827 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4833 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4828 for __str__ instead of dir(self), since dir() changed in 2.2.
4834 for __str__ instead of dir(self), since dir() changed in 2.2.
4829
4835
4830 * Ported to Windows! Tested on XP, I suspect it should work fine
4836 * Ported to Windows! Tested on XP, I suspect it should work fine
4831 on NT/2000, but I don't think it will work on 98 et al. That
4837 on NT/2000, but I don't think it will work on 98 et al. That
4832 series of Windows is such a piece of junk anyway that I won't try
4838 series of Windows is such a piece of junk anyway that I won't try
4833 porting it there. The XP port was straightforward, showed a few
4839 porting it there. The XP port was straightforward, showed a few
4834 bugs here and there (fixed all), in particular some string
4840 bugs here and there (fixed all), in particular some string
4835 handling stuff which required considering Unicode strings (which
4841 handling stuff which required considering Unicode strings (which
4836 Windows uses). This is good, but hasn't been too tested :) No
4842 Windows uses). This is good, but hasn't been too tested :) No
4837 fancy installer yet, I'll put a note in the manual so people at
4843 fancy installer yet, I'll put a note in the manual so people at
4838 least make manually a shortcut.
4844 least make manually a shortcut.
4839
4845
4840 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4846 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4841 into a single one, "colors". This now controls both prompt and
4847 into a single one, "colors". This now controls both prompt and
4842 exception color schemes, and can be changed both at startup
4848 exception color schemes, and can be changed both at startup
4843 (either via command-line switches or via ipythonrc files) and at
4849 (either via command-line switches or via ipythonrc files) and at
4844 runtime, with @colors.
4850 runtime, with @colors.
4845 (Magic.magic_run): renamed @prun to @run and removed the old
4851 (Magic.magic_run): renamed @prun to @run and removed the old
4846 @run. The two were too similar to warrant keeping both.
4852 @run. The two were too similar to warrant keeping both.
4847
4853
4848 2002-02-03 Fernando Perez <fperez@colorado.edu>
4854 2002-02-03 Fernando Perez <fperez@colorado.edu>
4849
4855
4850 * IPython/iplib.py (install_first_time): Added comment on how to
4856 * IPython/iplib.py (install_first_time): Added comment on how to
4851 configure the color options for first-time users. Put a <return>
4857 configure the color options for first-time users. Put a <return>
4852 request at the end so that small-terminal users get a chance to
4858 request at the end so that small-terminal users get a chance to
4853 read the startup info.
4859 read the startup info.
4854
4860
4855 2002-01-23 Fernando Perez <fperez@colorado.edu>
4861 2002-01-23 Fernando Perez <fperez@colorado.edu>
4856
4862
4857 * IPython/iplib.py (CachedOutput.update): Changed output memory
4863 * IPython/iplib.py (CachedOutput.update): Changed output memory
4858 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4864 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4859 input history we still use _i. Did this b/c these variable are
4865 input history we still use _i. Did this b/c these variable are
4860 very commonly used in interactive work, so the less we need to
4866 very commonly used in interactive work, so the less we need to
4861 type the better off we are.
4867 type the better off we are.
4862 (Magic.magic_prun): updated @prun to better handle the namespaces
4868 (Magic.magic_prun): updated @prun to better handle the namespaces
4863 the file will run in, including a fix for __name__ not being set
4869 the file will run in, including a fix for __name__ not being set
4864 before.
4870 before.
4865
4871
4866 2002-01-20 Fernando Perez <fperez@colorado.edu>
4872 2002-01-20 Fernando Perez <fperez@colorado.edu>
4867
4873
4868 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4874 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4869 extra garbage for Python 2.2. Need to look more carefully into
4875 extra garbage for Python 2.2. Need to look more carefully into
4870 this later.
4876 this later.
4871
4877
4872 2002-01-19 Fernando Perez <fperez@colorado.edu>
4878 2002-01-19 Fernando Perez <fperez@colorado.edu>
4873
4879
4874 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4880 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4875 display SyntaxError exceptions properly formatted when they occur
4881 display SyntaxError exceptions properly formatted when they occur
4876 (they can be triggered by imported code).
4882 (they can be triggered by imported code).
4877
4883
4878 2002-01-18 Fernando Perez <fperez@colorado.edu>
4884 2002-01-18 Fernando Perez <fperez@colorado.edu>
4879
4885
4880 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4886 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4881 SyntaxError exceptions are reported nicely formatted, instead of
4887 SyntaxError exceptions are reported nicely formatted, instead of
4882 spitting out only offset information as before.
4888 spitting out only offset information as before.
4883 (Magic.magic_prun): Added the @prun function for executing
4889 (Magic.magic_prun): Added the @prun function for executing
4884 programs with command line args inside IPython.
4890 programs with command line args inside IPython.
4885
4891
4886 2002-01-16 Fernando Perez <fperez@colorado.edu>
4892 2002-01-16 Fernando Perez <fperez@colorado.edu>
4887
4893
4888 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4894 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4889 to *not* include the last item given in a range. This brings their
4895 to *not* include the last item given in a range. This brings their
4890 behavior in line with Python's slicing:
4896 behavior in line with Python's slicing:
4891 a[n1:n2] -> a[n1]...a[n2-1]
4897 a[n1:n2] -> a[n1]...a[n2-1]
4892 It may be a bit less convenient, but I prefer to stick to Python's
4898 It may be a bit less convenient, but I prefer to stick to Python's
4893 conventions *everywhere*, so users never have to wonder.
4899 conventions *everywhere*, so users never have to wonder.
4894 (Magic.magic_macro): Added @macro function to ease the creation of
4900 (Magic.magic_macro): Added @macro function to ease the creation of
4895 macros.
4901 macros.
4896
4902
4897 2002-01-05 Fernando Perez <fperez@colorado.edu>
4903 2002-01-05 Fernando Perez <fperez@colorado.edu>
4898
4904
4899 * Released 0.2.4.
4905 * Released 0.2.4.
4900
4906
4901 * IPython/iplib.py (Magic.magic_pdef):
4907 * IPython/iplib.py (Magic.magic_pdef):
4902 (InteractiveShell.safe_execfile): report magic lines and error
4908 (InteractiveShell.safe_execfile): report magic lines and error
4903 lines without line numbers so one can easily copy/paste them for
4909 lines without line numbers so one can easily copy/paste them for
4904 re-execution.
4910 re-execution.
4905
4911
4906 * Updated manual with recent changes.
4912 * Updated manual with recent changes.
4907
4913
4908 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4914 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4909 docstring printing when class? is called. Very handy for knowing
4915 docstring printing when class? is called. Very handy for knowing
4910 how to create class instances (as long as __init__ is well
4916 how to create class instances (as long as __init__ is well
4911 documented, of course :)
4917 documented, of course :)
4912 (Magic.magic_doc): print both class and constructor docstrings.
4918 (Magic.magic_doc): print both class and constructor docstrings.
4913 (Magic.magic_pdef): give constructor info if passed a class and
4919 (Magic.magic_pdef): give constructor info if passed a class and
4914 __call__ info for callable object instances.
4920 __call__ info for callable object instances.
4915
4921
4916 2002-01-04 Fernando Perez <fperez@colorado.edu>
4922 2002-01-04 Fernando Perez <fperez@colorado.edu>
4917
4923
4918 * Made deep_reload() off by default. It doesn't always work
4924 * Made deep_reload() off by default. It doesn't always work
4919 exactly as intended, so it's probably safer to have it off. It's
4925 exactly as intended, so it's probably safer to have it off. It's
4920 still available as dreload() anyway, so nothing is lost.
4926 still available as dreload() anyway, so nothing is lost.
4921
4927
4922 2002-01-02 Fernando Perez <fperez@colorado.edu>
4928 2002-01-02 Fernando Perez <fperez@colorado.edu>
4923
4929
4924 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4930 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4925 so I wanted an updated release).
4931 so I wanted an updated release).
4926
4932
4927 2001-12-27 Fernando Perez <fperez@colorado.edu>
4933 2001-12-27 Fernando Perez <fperez@colorado.edu>
4928
4934
4929 * IPython/iplib.py (InteractiveShell.interact): Added the original
4935 * IPython/iplib.py (InteractiveShell.interact): Added the original
4930 code from 'code.py' for this module in order to change the
4936 code from 'code.py' for this module in order to change the
4931 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4937 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4932 the history cache would break when the user hit Ctrl-C, and
4938 the history cache would break when the user hit Ctrl-C, and
4933 interact() offers no way to add any hooks to it.
4939 interact() offers no way to add any hooks to it.
4934
4940
4935 2001-12-23 Fernando Perez <fperez@colorado.edu>
4941 2001-12-23 Fernando Perez <fperez@colorado.edu>
4936
4942
4937 * setup.py: added check for 'MANIFEST' before trying to remove
4943 * setup.py: added check for 'MANIFEST' before trying to remove
4938 it. Thanks to Sean Reifschneider.
4944 it. Thanks to Sean Reifschneider.
4939
4945
4940 2001-12-22 Fernando Perez <fperez@colorado.edu>
4946 2001-12-22 Fernando Perez <fperez@colorado.edu>
4941
4947
4942 * Released 0.2.2.
4948 * Released 0.2.2.
4943
4949
4944 * Finished (reasonably) writing the manual. Later will add the
4950 * Finished (reasonably) writing the manual. Later will add the
4945 python-standard navigation stylesheets, but for the time being
4951 python-standard navigation stylesheets, but for the time being
4946 it's fairly complete. Distribution will include html and pdf
4952 it's fairly complete. Distribution will include html and pdf
4947 versions.
4953 versions.
4948
4954
4949 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4955 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4950 (MayaVi author).
4956 (MayaVi author).
4951
4957
4952 2001-12-21 Fernando Perez <fperez@colorado.edu>
4958 2001-12-21 Fernando Perez <fperez@colorado.edu>
4953
4959
4954 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4960 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4955 good public release, I think (with the manual and the distutils
4961 good public release, I think (with the manual and the distutils
4956 installer). The manual can use some work, but that can go
4962 installer). The manual can use some work, but that can go
4957 slowly. Otherwise I think it's quite nice for end users. Next
4963 slowly. Otherwise I think it's quite nice for end users. Next
4958 summer, rewrite the guts of it...
4964 summer, rewrite the guts of it...
4959
4965
4960 * Changed format of ipythonrc files to use whitespace as the
4966 * Changed format of ipythonrc files to use whitespace as the
4961 separator instead of an explicit '='. Cleaner.
4967 separator instead of an explicit '='. Cleaner.
4962
4968
4963 2001-12-20 Fernando Perez <fperez@colorado.edu>
4969 2001-12-20 Fernando Perez <fperez@colorado.edu>
4964
4970
4965 * Started a manual in LyX. For now it's just a quick merge of the
4971 * Started a manual in LyX. For now it's just a quick merge of the
4966 various internal docstrings and READMEs. Later it may grow into a
4972 various internal docstrings and READMEs. Later it may grow into a
4967 nice, full-blown manual.
4973 nice, full-blown manual.
4968
4974
4969 * Set up a distutils based installer. Installation should now be
4975 * Set up a distutils based installer. Installation should now be
4970 trivially simple for end-users.
4976 trivially simple for end-users.
4971
4977
4972 2001-12-11 Fernando Perez <fperez@colorado.edu>
4978 2001-12-11 Fernando Perez <fperez@colorado.edu>
4973
4979
4974 * Released 0.2.0. First public release, announced it at
4980 * Released 0.2.0. First public release, announced it at
4975 comp.lang.python. From now on, just bugfixes...
4981 comp.lang.python. From now on, just bugfixes...
4976
4982
4977 * Went through all the files, set copyright/license notices and
4983 * Went through all the files, set copyright/license notices and
4978 cleaned up things. Ready for release.
4984 cleaned up things. Ready for release.
4979
4985
4980 2001-12-10 Fernando Perez <fperez@colorado.edu>
4986 2001-12-10 Fernando Perez <fperez@colorado.edu>
4981
4987
4982 * Changed the first-time installer not to use tarfiles. It's more
4988 * Changed the first-time installer not to use tarfiles. It's more
4983 robust now and less unix-dependent. Also makes it easier for
4989 robust now and less unix-dependent. Also makes it easier for
4984 people to later upgrade versions.
4990 people to later upgrade versions.
4985
4991
4986 * Changed @exit to @abort to reflect the fact that it's pretty
4992 * Changed @exit to @abort to reflect the fact that it's pretty
4987 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4993 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4988 becomes significant only when IPyhton is embedded: in that case,
4994 becomes significant only when IPyhton is embedded: in that case,
4989 C-D closes IPython only, but @abort kills the enclosing program
4995 C-D closes IPython only, but @abort kills the enclosing program
4990 too (unless it had called IPython inside a try catching
4996 too (unless it had called IPython inside a try catching
4991 SystemExit).
4997 SystemExit).
4992
4998
4993 * Created Shell module which exposes the actuall IPython Shell
4999 * Created Shell module which exposes the actuall IPython Shell
4994 classes, currently the normal and the embeddable one. This at
5000 classes, currently the normal and the embeddable one. This at
4995 least offers a stable interface we won't need to change when
5001 least offers a stable interface we won't need to change when
4996 (later) the internals are rewritten. That rewrite will be confined
5002 (later) the internals are rewritten. That rewrite will be confined
4997 to iplib and ipmaker, but the Shell interface should remain as is.
5003 to iplib and ipmaker, but the Shell interface should remain as is.
4998
5004
4999 * Added embed module which offers an embeddable IPShell object,
5005 * Added embed module which offers an embeddable IPShell object,
5000 useful to fire up IPython *inside* a running program. Great for
5006 useful to fire up IPython *inside* a running program. Great for
5001 debugging or dynamical data analysis.
5007 debugging or dynamical data analysis.
5002
5008
5003 2001-12-08 Fernando Perez <fperez@colorado.edu>
5009 2001-12-08 Fernando Perez <fperez@colorado.edu>
5004
5010
5005 * Fixed small bug preventing seeing info from methods of defined
5011 * Fixed small bug preventing seeing info from methods of defined
5006 objects (incorrect namespace in _ofind()).
5012 objects (incorrect namespace in _ofind()).
5007
5013
5008 * Documentation cleanup. Moved the main usage docstrings to a
5014 * Documentation cleanup. Moved the main usage docstrings to a
5009 separate file, usage.py (cleaner to maintain, and hopefully in the
5015 separate file, usage.py (cleaner to maintain, and hopefully in the
5010 future some perlpod-like way of producing interactive, man and
5016 future some perlpod-like way of producing interactive, man and
5011 html docs out of it will be found).
5017 html docs out of it will be found).
5012
5018
5013 * Added @profile to see your profile at any time.
5019 * Added @profile to see your profile at any time.
5014
5020
5015 * Added @p as an alias for 'print'. It's especially convenient if
5021 * Added @p as an alias for 'print'. It's especially convenient if
5016 using automagic ('p x' prints x).
5022 using automagic ('p x' prints x).
5017
5023
5018 * Small cleanups and fixes after a pychecker run.
5024 * Small cleanups and fixes after a pychecker run.
5019
5025
5020 * Changed the @cd command to handle @cd - and @cd -<n> for
5026 * Changed the @cd command to handle @cd - and @cd -<n> for
5021 visiting any directory in _dh.
5027 visiting any directory in _dh.
5022
5028
5023 * Introduced _dh, a history of visited directories. @dhist prints
5029 * Introduced _dh, a history of visited directories. @dhist prints
5024 it out with numbers.
5030 it out with numbers.
5025
5031
5026 2001-12-07 Fernando Perez <fperez@colorado.edu>
5032 2001-12-07 Fernando Perez <fperez@colorado.edu>
5027
5033
5028 * Released 0.1.22
5034 * Released 0.1.22
5029
5035
5030 * Made initialization a bit more robust against invalid color
5036 * Made initialization a bit more robust against invalid color
5031 options in user input (exit, not traceback-crash).
5037 options in user input (exit, not traceback-crash).
5032
5038
5033 * Changed the bug crash reporter to write the report only in the
5039 * Changed the bug crash reporter to write the report only in the
5034 user's .ipython directory. That way IPython won't litter people's
5040 user's .ipython directory. That way IPython won't litter people's
5035 hard disks with crash files all over the place. Also print on
5041 hard disks with crash files all over the place. Also print on
5036 screen the necessary mail command.
5042 screen the necessary mail command.
5037
5043
5038 * With the new ultraTB, implemented LightBG color scheme for light
5044 * With the new ultraTB, implemented LightBG color scheme for light
5039 background terminals. A lot of people like white backgrounds, so I
5045 background terminals. A lot of people like white backgrounds, so I
5040 guess we should at least give them something readable.
5046 guess we should at least give them something readable.
5041
5047
5042 2001-12-06 Fernando Perez <fperez@colorado.edu>
5048 2001-12-06 Fernando Perez <fperez@colorado.edu>
5043
5049
5044 * Modified the structure of ultraTB. Now there's a proper class
5050 * Modified the structure of ultraTB. Now there's a proper class
5045 for tables of color schemes which allow adding schemes easily and
5051 for tables of color schemes which allow adding schemes easily and
5046 switching the active scheme without creating a new instance every
5052 switching the active scheme without creating a new instance every
5047 time (which was ridiculous). The syntax for creating new schemes
5053 time (which was ridiculous). The syntax for creating new schemes
5048 is also cleaner. I think ultraTB is finally done, with a clean
5054 is also cleaner. I think ultraTB is finally done, with a clean
5049 class structure. Names are also much cleaner (now there's proper
5055 class structure. Names are also much cleaner (now there's proper
5050 color tables, no need for every variable to also have 'color' in
5056 color tables, no need for every variable to also have 'color' in
5051 its name).
5057 its name).
5052
5058
5053 * Broke down genutils into separate files. Now genutils only
5059 * Broke down genutils into separate files. Now genutils only
5054 contains utility functions, and classes have been moved to their
5060 contains utility functions, and classes have been moved to their
5055 own files (they had enough independent functionality to warrant
5061 own files (they had enough independent functionality to warrant
5056 it): ConfigLoader, OutputTrap, Struct.
5062 it): ConfigLoader, OutputTrap, Struct.
5057
5063
5058 2001-12-05 Fernando Perez <fperez@colorado.edu>
5064 2001-12-05 Fernando Perez <fperez@colorado.edu>
5059
5065
5060 * IPython turns 21! Released version 0.1.21, as a candidate for
5066 * IPython turns 21! Released version 0.1.21, as a candidate for
5061 public consumption. If all goes well, release in a few days.
5067 public consumption. If all goes well, release in a few days.
5062
5068
5063 * Fixed path bug (files in Extensions/ directory wouldn't be found
5069 * Fixed path bug (files in Extensions/ directory wouldn't be found
5064 unless IPython/ was explicitly in sys.path).
5070 unless IPython/ was explicitly in sys.path).
5065
5071
5066 * Extended the FlexCompleter class as MagicCompleter to allow
5072 * Extended the FlexCompleter class as MagicCompleter to allow
5067 completion of @-starting lines.
5073 completion of @-starting lines.
5068
5074
5069 * Created __release__.py file as a central repository for release
5075 * Created __release__.py file as a central repository for release
5070 info that other files can read from.
5076 info that other files can read from.
5071
5077
5072 * Fixed small bug in logging: when logging was turned on in
5078 * Fixed small bug in logging: when logging was turned on in
5073 mid-session, old lines with special meanings (!@?) were being
5079 mid-session, old lines with special meanings (!@?) were being
5074 logged without the prepended comment, which is necessary since
5080 logged without the prepended comment, which is necessary since
5075 they are not truly valid python syntax. This should make session
5081 they are not truly valid python syntax. This should make session
5076 restores produce less errors.
5082 restores produce less errors.
5077
5083
5078 * The namespace cleanup forced me to make a FlexCompleter class
5084 * The namespace cleanup forced me to make a FlexCompleter class
5079 which is nothing but a ripoff of rlcompleter, but with selectable
5085 which is nothing but a ripoff of rlcompleter, but with selectable
5080 namespace (rlcompleter only works in __main__.__dict__). I'll try
5086 namespace (rlcompleter only works in __main__.__dict__). I'll try
5081 to submit a note to the authors to see if this change can be
5087 to submit a note to the authors to see if this change can be
5082 incorporated in future rlcompleter releases (Dec.6: done)
5088 incorporated in future rlcompleter releases (Dec.6: done)
5083
5089
5084 * More fixes to namespace handling. It was a mess! Now all
5090 * More fixes to namespace handling. It was a mess! Now all
5085 explicit references to __main__.__dict__ are gone (except when
5091 explicit references to __main__.__dict__ are gone (except when
5086 really needed) and everything is handled through the namespace
5092 really needed) and everything is handled through the namespace
5087 dicts in the IPython instance. We seem to be getting somewhere
5093 dicts in the IPython instance. We seem to be getting somewhere
5088 with this, finally...
5094 with this, finally...
5089
5095
5090 * Small documentation updates.
5096 * Small documentation updates.
5091
5097
5092 * Created the Extensions directory under IPython (with an
5098 * Created the Extensions directory under IPython (with an
5093 __init__.py). Put the PhysicalQ stuff there. This directory should
5099 __init__.py). Put the PhysicalQ stuff there. This directory should
5094 be used for all special-purpose extensions.
5100 be used for all special-purpose extensions.
5095
5101
5096 * File renaming:
5102 * File renaming:
5097 ipythonlib --> ipmaker
5103 ipythonlib --> ipmaker
5098 ipplib --> iplib
5104 ipplib --> iplib
5099 This makes a bit more sense in terms of what these files actually do.
5105 This makes a bit more sense in terms of what these files actually do.
5100
5106
5101 * Moved all the classes and functions in ipythonlib to ipplib, so
5107 * Moved all the classes and functions in ipythonlib to ipplib, so
5102 now ipythonlib only has make_IPython(). This will ease up its
5108 now ipythonlib only has make_IPython(). This will ease up its
5103 splitting in smaller functional chunks later.
5109 splitting in smaller functional chunks later.
5104
5110
5105 * Cleaned up (done, I think) output of @whos. Better column
5111 * Cleaned up (done, I think) output of @whos. Better column
5106 formatting, and now shows str(var) for as much as it can, which is
5112 formatting, and now shows str(var) for as much as it can, which is
5107 typically what one gets with a 'print var'.
5113 typically what one gets with a 'print var'.
5108
5114
5109 2001-12-04 Fernando Perez <fperez@colorado.edu>
5115 2001-12-04 Fernando Perez <fperez@colorado.edu>
5110
5116
5111 * Fixed namespace problems. Now builtin/IPyhton/user names get
5117 * Fixed namespace problems. Now builtin/IPyhton/user names get
5112 properly reported in their namespace. Internal namespace handling
5118 properly reported in their namespace. Internal namespace handling
5113 is finally getting decent (not perfect yet, but much better than
5119 is finally getting decent (not perfect yet, but much better than
5114 the ad-hoc mess we had).
5120 the ad-hoc mess we had).
5115
5121
5116 * Removed -exit option. If people just want to run a python
5122 * Removed -exit option. If people just want to run a python
5117 script, that's what the normal interpreter is for. Less
5123 script, that's what the normal interpreter is for. Less
5118 unnecessary options, less chances for bugs.
5124 unnecessary options, less chances for bugs.
5119
5125
5120 * Added a crash handler which generates a complete post-mortem if
5126 * Added a crash handler which generates a complete post-mortem if
5121 IPython crashes. This will help a lot in tracking bugs down the
5127 IPython crashes. This will help a lot in tracking bugs down the
5122 road.
5128 road.
5123
5129
5124 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5130 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5125 which were boud to functions being reassigned would bypass the
5131 which were boud to functions being reassigned would bypass the
5126 logger, breaking the sync of _il with the prompt counter. This
5132 logger, breaking the sync of _il with the prompt counter. This
5127 would then crash IPython later when a new line was logged.
5133 would then crash IPython later when a new line was logged.
5128
5134
5129 2001-12-02 Fernando Perez <fperez@colorado.edu>
5135 2001-12-02 Fernando Perez <fperez@colorado.edu>
5130
5136
5131 * Made IPython a package. This means people don't have to clutter
5137 * Made IPython a package. This means people don't have to clutter
5132 their sys.path with yet another directory. Changed the INSTALL
5138 their sys.path with yet another directory. Changed the INSTALL
5133 file accordingly.
5139 file accordingly.
5134
5140
5135 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5141 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5136 sorts its output (so @who shows it sorted) and @whos formats the
5142 sorts its output (so @who shows it sorted) and @whos formats the
5137 table according to the width of the first column. Nicer, easier to
5143 table according to the width of the first column. Nicer, easier to
5138 read. Todo: write a generic table_format() which takes a list of
5144 read. Todo: write a generic table_format() which takes a list of
5139 lists and prints it nicely formatted, with optional row/column
5145 lists and prints it nicely formatted, with optional row/column
5140 separators and proper padding and justification.
5146 separators and proper padding and justification.
5141
5147
5142 * Released 0.1.20
5148 * Released 0.1.20
5143
5149
5144 * Fixed bug in @log which would reverse the inputcache list (a
5150 * Fixed bug in @log which would reverse the inputcache list (a
5145 copy operation was missing).
5151 copy operation was missing).
5146
5152
5147 * Code cleanup. @config was changed to use page(). Better, since
5153 * Code cleanup. @config was changed to use page(). Better, since
5148 its output is always quite long.
5154 its output is always quite long.
5149
5155
5150 * Itpl is back as a dependency. I was having too many problems
5156 * Itpl is back as a dependency. I was having too many problems
5151 getting the parametric aliases to work reliably, and it's just
5157 getting the parametric aliases to work reliably, and it's just
5152 easier to code weird string operations with it than playing %()s
5158 easier to code weird string operations with it than playing %()s
5153 games. It's only ~6k, so I don't think it's too big a deal.
5159 games. It's only ~6k, so I don't think it's too big a deal.
5154
5160
5155 * Found (and fixed) a very nasty bug with history. !lines weren't
5161 * Found (and fixed) a very nasty bug with history. !lines weren't
5156 getting cached, and the out of sync caches would crash
5162 getting cached, and the out of sync caches would crash
5157 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5163 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5158 division of labor a bit better. Bug fixed, cleaner structure.
5164 division of labor a bit better. Bug fixed, cleaner structure.
5159
5165
5160 2001-12-01 Fernando Perez <fperez@colorado.edu>
5166 2001-12-01 Fernando Perez <fperez@colorado.edu>
5161
5167
5162 * Released 0.1.19
5168 * Released 0.1.19
5163
5169
5164 * Added option -n to @hist to prevent line number printing. Much
5170 * Added option -n to @hist to prevent line number printing. Much
5165 easier to copy/paste code this way.
5171 easier to copy/paste code this way.
5166
5172
5167 * Created global _il to hold the input list. Allows easy
5173 * Created global _il to hold the input list. Allows easy
5168 re-execution of blocks of code by slicing it (inspired by Janko's
5174 re-execution of blocks of code by slicing it (inspired by Janko's
5169 comment on 'macros').
5175 comment on 'macros').
5170
5176
5171 * Small fixes and doc updates.
5177 * Small fixes and doc updates.
5172
5178
5173 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5179 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5174 much too fragile with automagic. Handles properly multi-line
5180 much too fragile with automagic. Handles properly multi-line
5175 statements and takes parameters.
5181 statements and takes parameters.
5176
5182
5177 2001-11-30 Fernando Perez <fperez@colorado.edu>
5183 2001-11-30 Fernando Perez <fperez@colorado.edu>
5178
5184
5179 * Version 0.1.18 released.
5185 * Version 0.1.18 released.
5180
5186
5181 * Fixed nasty namespace bug in initial module imports.
5187 * Fixed nasty namespace bug in initial module imports.
5182
5188
5183 * Added copyright/license notes to all code files (except
5189 * Added copyright/license notes to all code files (except
5184 DPyGetOpt). For the time being, LGPL. That could change.
5190 DPyGetOpt). For the time being, LGPL. That could change.
5185
5191
5186 * Rewrote a much nicer README, updated INSTALL, cleaned up
5192 * Rewrote a much nicer README, updated INSTALL, cleaned up
5187 ipythonrc-* samples.
5193 ipythonrc-* samples.
5188
5194
5189 * Overall code/documentation cleanup. Basically ready for
5195 * Overall code/documentation cleanup. Basically ready for
5190 release. Only remaining thing: licence decision (LGPL?).
5196 release. Only remaining thing: licence decision (LGPL?).
5191
5197
5192 * Converted load_config to a class, ConfigLoader. Now recursion
5198 * Converted load_config to a class, ConfigLoader. Now recursion
5193 control is better organized. Doesn't include the same file twice.
5199 control is better organized. Doesn't include the same file twice.
5194
5200
5195 2001-11-29 Fernando Perez <fperez@colorado.edu>
5201 2001-11-29 Fernando Perez <fperez@colorado.edu>
5196
5202
5197 * Got input history working. Changed output history variables from
5203 * Got input history working. Changed output history variables from
5198 _p to _o so that _i is for input and _o for output. Just cleaner
5204 _p to _o so that _i is for input and _o for output. Just cleaner
5199 convention.
5205 convention.
5200
5206
5201 * Implemented parametric aliases. This pretty much allows the
5207 * Implemented parametric aliases. This pretty much allows the
5202 alias system to offer full-blown shell convenience, I think.
5208 alias system to offer full-blown shell convenience, I think.
5203
5209
5204 * Version 0.1.17 released, 0.1.18 opened.
5210 * Version 0.1.17 released, 0.1.18 opened.
5205
5211
5206 * dot_ipython/ipythonrc (alias): added documentation.
5212 * dot_ipython/ipythonrc (alias): added documentation.
5207 (xcolor): Fixed small bug (xcolors -> xcolor)
5213 (xcolor): Fixed small bug (xcolors -> xcolor)
5208
5214
5209 * Changed the alias system. Now alias is a magic command to define
5215 * Changed the alias system. Now alias is a magic command to define
5210 aliases just like the shell. Rationale: the builtin magics should
5216 aliases just like the shell. Rationale: the builtin magics should
5211 be there for things deeply connected to IPython's
5217 be there for things deeply connected to IPython's
5212 architecture. And this is a much lighter system for what I think
5218 architecture. And this is a much lighter system for what I think
5213 is the really important feature: allowing users to define quickly
5219 is the really important feature: allowing users to define quickly
5214 magics that will do shell things for them, so they can customize
5220 magics that will do shell things for them, so they can customize
5215 IPython easily to match their work habits. If someone is really
5221 IPython easily to match their work habits. If someone is really
5216 desperate to have another name for a builtin alias, they can
5222 desperate to have another name for a builtin alias, they can
5217 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5223 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5218 works.
5224 works.
5219
5225
5220 2001-11-28 Fernando Perez <fperez@colorado.edu>
5226 2001-11-28 Fernando Perez <fperez@colorado.edu>
5221
5227
5222 * Changed @file so that it opens the source file at the proper
5228 * Changed @file so that it opens the source file at the proper
5223 line. Since it uses less, if your EDITOR environment is
5229 line. Since it uses less, if your EDITOR environment is
5224 configured, typing v will immediately open your editor of choice
5230 configured, typing v will immediately open your editor of choice
5225 right at the line where the object is defined. Not as quick as
5231 right at the line where the object is defined. Not as quick as
5226 having a direct @edit command, but for all intents and purposes it
5232 having a direct @edit command, but for all intents and purposes it
5227 works. And I don't have to worry about writing @edit to deal with
5233 works. And I don't have to worry about writing @edit to deal with
5228 all the editors, less does that.
5234 all the editors, less does that.
5229
5235
5230 * Version 0.1.16 released, 0.1.17 opened.
5236 * Version 0.1.16 released, 0.1.17 opened.
5231
5237
5232 * Fixed some nasty bugs in the page/page_dumb combo that could
5238 * Fixed some nasty bugs in the page/page_dumb combo that could
5233 crash IPython.
5239 crash IPython.
5234
5240
5235 2001-11-27 Fernando Perez <fperez@colorado.edu>
5241 2001-11-27 Fernando Perez <fperez@colorado.edu>
5236
5242
5237 * Version 0.1.15 released, 0.1.16 opened.
5243 * Version 0.1.15 released, 0.1.16 opened.
5238
5244
5239 * Finally got ? and ?? to work for undefined things: now it's
5245 * Finally got ? and ?? to work for undefined things: now it's
5240 possible to type {}.get? and get information about the get method
5246 possible to type {}.get? and get information about the get method
5241 of dicts, or os.path? even if only os is defined (so technically
5247 of dicts, or os.path? even if only os is defined (so technically
5242 os.path isn't). Works at any level. For example, after import os,
5248 os.path isn't). Works at any level. For example, after import os,
5243 os?, os.path?, os.path.abspath? all work. This is great, took some
5249 os?, os.path?, os.path.abspath? all work. This is great, took some
5244 work in _ofind.
5250 work in _ofind.
5245
5251
5246 * Fixed more bugs with logging. The sanest way to do it was to add
5252 * Fixed more bugs with logging. The sanest way to do it was to add
5247 to @log a 'mode' parameter. Killed two in one shot (this mode
5253 to @log a 'mode' parameter. Killed two in one shot (this mode
5248 option was a request of Janko's). I think it's finally clean
5254 option was a request of Janko's). I think it's finally clean
5249 (famous last words).
5255 (famous last words).
5250
5256
5251 * Added a page_dumb() pager which does a decent job of paging on
5257 * Added a page_dumb() pager which does a decent job of paging on
5252 screen, if better things (like less) aren't available. One less
5258 screen, if better things (like less) aren't available. One less
5253 unix dependency (someday maybe somebody will port this to
5259 unix dependency (someday maybe somebody will port this to
5254 windows).
5260 windows).
5255
5261
5256 * Fixed problem in magic_log: would lock of logging out if log
5262 * Fixed problem in magic_log: would lock of logging out if log
5257 creation failed (because it would still think it had succeeded).
5263 creation failed (because it would still think it had succeeded).
5258
5264
5259 * Improved the page() function using curses to auto-detect screen
5265 * Improved the page() function using curses to auto-detect screen
5260 size. Now it can make a much better decision on whether to print
5266 size. Now it can make a much better decision on whether to print
5261 or page a string. Option screen_length was modified: a value 0
5267 or page a string. Option screen_length was modified: a value 0
5262 means auto-detect, and that's the default now.
5268 means auto-detect, and that's the default now.
5263
5269
5264 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5270 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5265 go out. I'll test it for a few days, then talk to Janko about
5271 go out. I'll test it for a few days, then talk to Janko about
5266 licences and announce it.
5272 licences and announce it.
5267
5273
5268 * Fixed the length of the auto-generated ---> prompt which appears
5274 * Fixed the length of the auto-generated ---> prompt which appears
5269 for auto-parens and auto-quotes. Getting this right isn't trivial,
5275 for auto-parens and auto-quotes. Getting this right isn't trivial,
5270 with all the color escapes, different prompt types and optional
5276 with all the color escapes, different prompt types and optional
5271 separators. But it seems to be working in all the combinations.
5277 separators. But it seems to be working in all the combinations.
5272
5278
5273 2001-11-26 Fernando Perez <fperez@colorado.edu>
5279 2001-11-26 Fernando Perez <fperez@colorado.edu>
5274
5280
5275 * Wrote a regexp filter to get option types from the option names
5281 * Wrote a regexp filter to get option types from the option names
5276 string. This eliminates the need to manually keep two duplicate
5282 string. This eliminates the need to manually keep two duplicate
5277 lists.
5283 lists.
5278
5284
5279 * Removed the unneeded check_option_names. Now options are handled
5285 * Removed the unneeded check_option_names. Now options are handled
5280 in a much saner manner and it's easy to visually check that things
5286 in a much saner manner and it's easy to visually check that things
5281 are ok.
5287 are ok.
5282
5288
5283 * Updated version numbers on all files I modified to carry a
5289 * Updated version numbers on all files I modified to carry a
5284 notice so Janko and Nathan have clear version markers.
5290 notice so Janko and Nathan have clear version markers.
5285
5291
5286 * Updated docstring for ultraTB with my changes. I should send
5292 * Updated docstring for ultraTB with my changes. I should send
5287 this to Nathan.
5293 this to Nathan.
5288
5294
5289 * Lots of small fixes. Ran everything through pychecker again.
5295 * Lots of small fixes. Ran everything through pychecker again.
5290
5296
5291 * Made loading of deep_reload an cmd line option. If it's not too
5297 * Made loading of deep_reload an cmd line option. If it's not too
5292 kosher, now people can just disable it. With -nodeep_reload it's
5298 kosher, now people can just disable it. With -nodeep_reload it's
5293 still available as dreload(), it just won't overwrite reload().
5299 still available as dreload(), it just won't overwrite reload().
5294
5300
5295 * Moved many options to the no| form (-opt and -noopt
5301 * Moved many options to the no| form (-opt and -noopt
5296 accepted). Cleaner.
5302 accepted). Cleaner.
5297
5303
5298 * Changed magic_log so that if called with no parameters, it uses
5304 * Changed magic_log so that if called with no parameters, it uses
5299 'rotate' mode. That way auto-generated logs aren't automatically
5305 'rotate' mode. That way auto-generated logs aren't automatically
5300 over-written. For normal logs, now a backup is made if it exists
5306 over-written. For normal logs, now a backup is made if it exists
5301 (only 1 level of backups). A new 'backup' mode was added to the
5307 (only 1 level of backups). A new 'backup' mode was added to the
5302 Logger class to support this. This was a request by Janko.
5308 Logger class to support this. This was a request by Janko.
5303
5309
5304 * Added @logoff/@logon to stop/restart an active log.
5310 * Added @logoff/@logon to stop/restart an active log.
5305
5311
5306 * Fixed a lot of bugs in log saving/replay. It was pretty
5312 * Fixed a lot of bugs in log saving/replay. It was pretty
5307 broken. Now special lines (!@,/) appear properly in the command
5313 broken. Now special lines (!@,/) appear properly in the command
5308 history after a log replay.
5314 history after a log replay.
5309
5315
5310 * Tried and failed to implement full session saving via pickle. My
5316 * Tried and failed to implement full session saving via pickle. My
5311 idea was to pickle __main__.__dict__, but modules can't be
5317 idea was to pickle __main__.__dict__, but modules can't be
5312 pickled. This would be a better alternative to replaying logs, but
5318 pickled. This would be a better alternative to replaying logs, but
5313 seems quite tricky to get to work. Changed -session to be called
5319 seems quite tricky to get to work. Changed -session to be called
5314 -logplay, which more accurately reflects what it does. And if we
5320 -logplay, which more accurately reflects what it does. And if we
5315 ever get real session saving working, -session is now available.
5321 ever get real session saving working, -session is now available.
5316
5322
5317 * Implemented color schemes for prompts also. As for tracebacks,
5323 * Implemented color schemes for prompts also. As for tracebacks,
5318 currently only NoColor and Linux are supported. But now the
5324 currently only NoColor and Linux are supported. But now the
5319 infrastructure is in place, based on a generic ColorScheme
5325 infrastructure is in place, based on a generic ColorScheme
5320 class. So writing and activating new schemes both for the prompts
5326 class. So writing and activating new schemes both for the prompts
5321 and the tracebacks should be straightforward.
5327 and the tracebacks should be straightforward.
5322
5328
5323 * Version 0.1.13 released, 0.1.14 opened.
5329 * Version 0.1.13 released, 0.1.14 opened.
5324
5330
5325 * Changed handling of options for output cache. Now counter is
5331 * Changed handling of options for output cache. Now counter is
5326 hardwired starting at 1 and one specifies the maximum number of
5332 hardwired starting at 1 and one specifies the maximum number of
5327 entries *in the outcache* (not the max prompt counter). This is
5333 entries *in the outcache* (not the max prompt counter). This is
5328 much better, since many statements won't increase the cache
5334 much better, since many statements won't increase the cache
5329 count. It also eliminated some confusing options, now there's only
5335 count. It also eliminated some confusing options, now there's only
5330 one: cache_size.
5336 one: cache_size.
5331
5337
5332 * Added 'alias' magic function and magic_alias option in the
5338 * Added 'alias' magic function and magic_alias option in the
5333 ipythonrc file. Now the user can easily define whatever names he
5339 ipythonrc file. Now the user can easily define whatever names he
5334 wants for the magic functions without having to play weird
5340 wants for the magic functions without having to play weird
5335 namespace games. This gives IPython a real shell-like feel.
5341 namespace games. This gives IPython a real shell-like feel.
5336
5342
5337 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5343 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5338 @ or not).
5344 @ or not).
5339
5345
5340 This was one of the last remaining 'visible' bugs (that I know
5346 This was one of the last remaining 'visible' bugs (that I know
5341 of). I think if I can clean up the session loading so it works
5347 of). I think if I can clean up the session loading so it works
5342 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5348 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5343 about licensing).
5349 about licensing).
5344
5350
5345 2001-11-25 Fernando Perez <fperez@colorado.edu>
5351 2001-11-25 Fernando Perez <fperez@colorado.edu>
5346
5352
5347 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5353 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5348 there's a cleaner distinction between what ? and ?? show.
5354 there's a cleaner distinction between what ? and ?? show.
5349
5355
5350 * Added screen_length option. Now the user can define his own
5356 * Added screen_length option. Now the user can define his own
5351 screen size for page() operations.
5357 screen size for page() operations.
5352
5358
5353 * Implemented magic shell-like functions with automatic code
5359 * Implemented magic shell-like functions with automatic code
5354 generation. Now adding another function is just a matter of adding
5360 generation. Now adding another function is just a matter of adding
5355 an entry to a dict, and the function is dynamically generated at
5361 an entry to a dict, and the function is dynamically generated at
5356 run-time. Python has some really cool features!
5362 run-time. Python has some really cool features!
5357
5363
5358 * Renamed many options to cleanup conventions a little. Now all
5364 * Renamed many options to cleanup conventions a little. Now all
5359 are lowercase, and only underscores where needed. Also in the code
5365 are lowercase, and only underscores where needed. Also in the code
5360 option name tables are clearer.
5366 option name tables are clearer.
5361
5367
5362 * Changed prompts a little. Now input is 'In [n]:' instead of
5368 * Changed prompts a little. Now input is 'In [n]:' instead of
5363 'In[n]:='. This allows it the numbers to be aligned with the
5369 'In[n]:='. This allows it the numbers to be aligned with the
5364 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5370 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5365 Python (it was a Mathematica thing). The '...' continuation prompt
5371 Python (it was a Mathematica thing). The '...' continuation prompt
5366 was also changed a little to align better.
5372 was also changed a little to align better.
5367
5373
5368 * Fixed bug when flushing output cache. Not all _p<n> variables
5374 * Fixed bug when flushing output cache. Not all _p<n> variables
5369 exist, so their deletion needs to be wrapped in a try:
5375 exist, so their deletion needs to be wrapped in a try:
5370
5376
5371 * Figured out how to properly use inspect.formatargspec() (it
5377 * Figured out how to properly use inspect.formatargspec() (it
5372 requires the args preceded by *). So I removed all the code from
5378 requires the args preceded by *). So I removed all the code from
5373 _get_pdef in Magic, which was just replicating that.
5379 _get_pdef in Magic, which was just replicating that.
5374
5380
5375 * Added test to prefilter to allow redefining magic function names
5381 * Added test to prefilter to allow redefining magic function names
5376 as variables. This is ok, since the @ form is always available,
5382 as variables. This is ok, since the @ form is always available,
5377 but whe should allow the user to define a variable called 'ls' if
5383 but whe should allow the user to define a variable called 'ls' if
5378 he needs it.
5384 he needs it.
5379
5385
5380 * Moved the ToDo information from README into a separate ToDo.
5386 * Moved the ToDo information from README into a separate ToDo.
5381
5387
5382 * General code cleanup and small bugfixes. I think it's close to a
5388 * General code cleanup and small bugfixes. I think it's close to a
5383 state where it can be released, obviously with a big 'beta'
5389 state where it can be released, obviously with a big 'beta'
5384 warning on it.
5390 warning on it.
5385
5391
5386 * Got the magic function split to work. Now all magics are defined
5392 * Got the magic function split to work. Now all magics are defined
5387 in a separate class. It just organizes things a bit, and now
5393 in a separate class. It just organizes things a bit, and now
5388 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5394 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5389 was too long).
5395 was too long).
5390
5396
5391 * Changed @clear to @reset to avoid potential confusions with
5397 * Changed @clear to @reset to avoid potential confusions with
5392 the shell command clear. Also renamed @cl to @clear, which does
5398 the shell command clear. Also renamed @cl to @clear, which does
5393 exactly what people expect it to from their shell experience.
5399 exactly what people expect it to from their shell experience.
5394
5400
5395 Added a check to the @reset command (since it's so
5401 Added a check to the @reset command (since it's so
5396 destructive, it's probably a good idea to ask for confirmation).
5402 destructive, it's probably a good idea to ask for confirmation).
5397 But now reset only works for full namespace resetting. Since the
5403 But now reset only works for full namespace resetting. Since the
5398 del keyword is already there for deleting a few specific
5404 del keyword is already there for deleting a few specific
5399 variables, I don't see the point of having a redundant magic
5405 variables, I don't see the point of having a redundant magic
5400 function for the same task.
5406 function for the same task.
5401
5407
5402 2001-11-24 Fernando Perez <fperez@colorado.edu>
5408 2001-11-24 Fernando Perez <fperez@colorado.edu>
5403
5409
5404 * Updated the builtin docs (esp. the ? ones).
5410 * Updated the builtin docs (esp. the ? ones).
5405
5411
5406 * Ran all the code through pychecker. Not terribly impressed with
5412 * Ran all the code through pychecker. Not terribly impressed with
5407 it: lots of spurious warnings and didn't really find anything of
5413 it: lots of spurious warnings and didn't really find anything of
5408 substance (just a few modules being imported and not used).
5414 substance (just a few modules being imported and not used).
5409
5415
5410 * Implemented the new ultraTB functionality into IPython. New
5416 * Implemented the new ultraTB functionality into IPython. New
5411 option: xcolors. This chooses color scheme. xmode now only selects
5417 option: xcolors. This chooses color scheme. xmode now only selects
5412 between Plain and Verbose. Better orthogonality.
5418 between Plain and Verbose. Better orthogonality.
5413
5419
5414 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5420 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5415 mode and color scheme for the exception handlers. Now it's
5421 mode and color scheme for the exception handlers. Now it's
5416 possible to have the verbose traceback with no coloring.
5422 possible to have the verbose traceback with no coloring.
5417
5423
5418 2001-11-23 Fernando Perez <fperez@colorado.edu>
5424 2001-11-23 Fernando Perez <fperez@colorado.edu>
5419
5425
5420 * Version 0.1.12 released, 0.1.13 opened.
5426 * Version 0.1.12 released, 0.1.13 opened.
5421
5427
5422 * Removed option to set auto-quote and auto-paren escapes by
5428 * Removed option to set auto-quote and auto-paren escapes by
5423 user. The chances of breaking valid syntax are just too high. If
5429 user. The chances of breaking valid syntax are just too high. If
5424 someone *really* wants, they can always dig into the code.
5430 someone *really* wants, they can always dig into the code.
5425
5431
5426 * Made prompt separators configurable.
5432 * Made prompt separators configurable.
5427
5433
5428 2001-11-22 Fernando Perez <fperez@colorado.edu>
5434 2001-11-22 Fernando Perez <fperez@colorado.edu>
5429
5435
5430 * Small bugfixes in many places.
5436 * Small bugfixes in many places.
5431
5437
5432 * Removed the MyCompleter class from ipplib. It seemed redundant
5438 * Removed the MyCompleter class from ipplib. It seemed redundant
5433 with the C-p,C-n history search functionality. Less code to
5439 with the C-p,C-n history search functionality. Less code to
5434 maintain.
5440 maintain.
5435
5441
5436 * Moved all the original ipython.py code into ipythonlib.py. Right
5442 * Moved all the original ipython.py code into ipythonlib.py. Right
5437 now it's just one big dump into a function called make_IPython, so
5443 now it's just one big dump into a function called make_IPython, so
5438 no real modularity has been gained. But at least it makes the
5444 no real modularity has been gained. But at least it makes the
5439 wrapper script tiny, and since ipythonlib is a module, it gets
5445 wrapper script tiny, and since ipythonlib is a module, it gets
5440 compiled and startup is much faster.
5446 compiled and startup is much faster.
5441
5447
5442 This is a reasobably 'deep' change, so we should test it for a
5448 This is a reasobably 'deep' change, so we should test it for a
5443 while without messing too much more with the code.
5449 while without messing too much more with the code.
5444
5450
5445 2001-11-21 Fernando Perez <fperez@colorado.edu>
5451 2001-11-21 Fernando Perez <fperez@colorado.edu>
5446
5452
5447 * Version 0.1.11 released, 0.1.12 opened for further work.
5453 * Version 0.1.11 released, 0.1.12 opened for further work.
5448
5454
5449 * Removed dependency on Itpl. It was only needed in one place. It
5455 * Removed dependency on Itpl. It was only needed in one place. It
5450 would be nice if this became part of python, though. It makes life
5456 would be nice if this became part of python, though. It makes life
5451 *a lot* easier in some cases.
5457 *a lot* easier in some cases.
5452
5458
5453 * Simplified the prefilter code a bit. Now all handlers are
5459 * Simplified the prefilter code a bit. Now all handlers are
5454 expected to explicitly return a value (at least a blank string).
5460 expected to explicitly return a value (at least a blank string).
5455
5461
5456 * Heavy edits in ipplib. Removed the help system altogether. Now
5462 * Heavy edits in ipplib. Removed the help system altogether. Now
5457 obj?/?? is used for inspecting objects, a magic @doc prints
5463 obj?/?? is used for inspecting objects, a magic @doc prints
5458 docstrings, and full-blown Python help is accessed via the 'help'
5464 docstrings, and full-blown Python help is accessed via the 'help'
5459 keyword. This cleans up a lot of code (less to maintain) and does
5465 keyword. This cleans up a lot of code (less to maintain) and does
5460 the job. Since 'help' is now a standard Python component, might as
5466 the job. Since 'help' is now a standard Python component, might as
5461 well use it and remove duplicate functionality.
5467 well use it and remove duplicate functionality.
5462
5468
5463 Also removed the option to use ipplib as a standalone program. By
5469 Also removed the option to use ipplib as a standalone program. By
5464 now it's too dependent on other parts of IPython to function alone.
5470 now it's too dependent on other parts of IPython to function alone.
5465
5471
5466 * Fixed bug in genutils.pager. It would crash if the pager was
5472 * Fixed bug in genutils.pager. It would crash if the pager was
5467 exited immediately after opening (broken pipe).
5473 exited immediately after opening (broken pipe).
5468
5474
5469 * Trimmed down the VerboseTB reporting a little. The header is
5475 * Trimmed down the VerboseTB reporting a little. The header is
5470 much shorter now and the repeated exception arguments at the end
5476 much shorter now and the repeated exception arguments at the end
5471 have been removed. For interactive use the old header seemed a bit
5477 have been removed. For interactive use the old header seemed a bit
5472 excessive.
5478 excessive.
5473
5479
5474 * Fixed small bug in output of @whos for variables with multi-word
5480 * Fixed small bug in output of @whos for variables with multi-word
5475 types (only first word was displayed).
5481 types (only first word was displayed).
5476
5482
5477 2001-11-17 Fernando Perez <fperez@colorado.edu>
5483 2001-11-17 Fernando Perez <fperez@colorado.edu>
5478
5484
5479 * Version 0.1.10 released, 0.1.11 opened for further work.
5485 * Version 0.1.10 released, 0.1.11 opened for further work.
5480
5486
5481 * Modified dirs and friends. dirs now *returns* the stack (not
5487 * Modified dirs and friends. dirs now *returns* the stack (not
5482 prints), so one can manipulate it as a variable. Convenient to
5488 prints), so one can manipulate it as a variable. Convenient to
5483 travel along many directories.
5489 travel along many directories.
5484
5490
5485 * Fixed bug in magic_pdef: would only work with functions with
5491 * Fixed bug in magic_pdef: would only work with functions with
5486 arguments with default values.
5492 arguments with default values.
5487
5493
5488 2001-11-14 Fernando Perez <fperez@colorado.edu>
5494 2001-11-14 Fernando Perez <fperez@colorado.edu>
5489
5495
5490 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5496 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5491 example with IPython. Various other minor fixes and cleanups.
5497 example with IPython. Various other minor fixes and cleanups.
5492
5498
5493 * Version 0.1.9 released, 0.1.10 opened for further work.
5499 * Version 0.1.9 released, 0.1.10 opened for further work.
5494
5500
5495 * Added sys.path to the list of directories searched in the
5501 * Added sys.path to the list of directories searched in the
5496 execfile= option. It used to be the current directory and the
5502 execfile= option. It used to be the current directory and the
5497 user's IPYTHONDIR only.
5503 user's IPYTHONDIR only.
5498
5504
5499 2001-11-13 Fernando Perez <fperez@colorado.edu>
5505 2001-11-13 Fernando Perez <fperez@colorado.edu>
5500
5506
5501 * Reinstated the raw_input/prefilter separation that Janko had
5507 * Reinstated the raw_input/prefilter separation that Janko had
5502 initially. This gives a more convenient setup for extending the
5508 initially. This gives a more convenient setup for extending the
5503 pre-processor from the outside: raw_input always gets a string,
5509 pre-processor from the outside: raw_input always gets a string,
5504 and prefilter has to process it. We can then redefine prefilter
5510 and prefilter has to process it. We can then redefine prefilter
5505 from the outside and implement extensions for special
5511 from the outside and implement extensions for special
5506 purposes.
5512 purposes.
5507
5513
5508 Today I got one for inputting PhysicalQuantity objects
5514 Today I got one for inputting PhysicalQuantity objects
5509 (from Scientific) without needing any function calls at
5515 (from Scientific) without needing any function calls at
5510 all. Extremely convenient, and it's all done as a user-level
5516 all. Extremely convenient, and it's all done as a user-level
5511 extension (no IPython code was touched). Now instead of:
5517 extension (no IPython code was touched). Now instead of:
5512 a = PhysicalQuantity(4.2,'m/s**2')
5518 a = PhysicalQuantity(4.2,'m/s**2')
5513 one can simply say
5519 one can simply say
5514 a = 4.2 m/s**2
5520 a = 4.2 m/s**2
5515 or even
5521 or even
5516 a = 4.2 m/s^2
5522 a = 4.2 m/s^2
5517
5523
5518 I use this, but it's also a proof of concept: IPython really is
5524 I use this, but it's also a proof of concept: IPython really is
5519 fully user-extensible, even at the level of the parsing of the
5525 fully user-extensible, even at the level of the parsing of the
5520 command line. It's not trivial, but it's perfectly doable.
5526 command line. It's not trivial, but it's perfectly doable.
5521
5527
5522 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5528 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5523 the problem of modules being loaded in the inverse order in which
5529 the problem of modules being loaded in the inverse order in which
5524 they were defined in
5530 they were defined in
5525
5531
5526 * Version 0.1.8 released, 0.1.9 opened for further work.
5532 * Version 0.1.8 released, 0.1.9 opened for further work.
5527
5533
5528 * Added magics pdef, source and file. They respectively show the
5534 * Added magics pdef, source and file. They respectively show the
5529 definition line ('prototype' in C), source code and full python
5535 definition line ('prototype' in C), source code and full python
5530 file for any callable object. The object inspector oinfo uses
5536 file for any callable object. The object inspector oinfo uses
5531 these to show the same information.
5537 these to show the same information.
5532
5538
5533 * Version 0.1.7 released, 0.1.8 opened for further work.
5539 * Version 0.1.7 released, 0.1.8 opened for further work.
5534
5540
5535 * Separated all the magic functions into a class called Magic. The
5541 * Separated all the magic functions into a class called Magic. The
5536 InteractiveShell class was becoming too big for Xemacs to handle
5542 InteractiveShell class was becoming too big for Xemacs to handle
5537 (de-indenting a line would lock it up for 10 seconds while it
5543 (de-indenting a line would lock it up for 10 seconds while it
5538 backtracked on the whole class!)
5544 backtracked on the whole class!)
5539
5545
5540 FIXME: didn't work. It can be done, but right now namespaces are
5546 FIXME: didn't work. It can be done, but right now namespaces are
5541 all messed up. Do it later (reverted it for now, so at least
5547 all messed up. Do it later (reverted it for now, so at least
5542 everything works as before).
5548 everything works as before).
5543
5549
5544 * Got the object introspection system (magic_oinfo) working! I
5550 * Got the object introspection system (magic_oinfo) working! I
5545 think this is pretty much ready for release to Janko, so he can
5551 think this is pretty much ready for release to Janko, so he can
5546 test it for a while and then announce it. Pretty much 100% of what
5552 test it for a while and then announce it. Pretty much 100% of what
5547 I wanted for the 'phase 1' release is ready. Happy, tired.
5553 I wanted for the 'phase 1' release is ready. Happy, tired.
5548
5554
5549 2001-11-12 Fernando Perez <fperez@colorado.edu>
5555 2001-11-12 Fernando Perez <fperez@colorado.edu>
5550
5556
5551 * Version 0.1.6 released, 0.1.7 opened for further work.
5557 * Version 0.1.6 released, 0.1.7 opened for further work.
5552
5558
5553 * Fixed bug in printing: it used to test for truth before
5559 * Fixed bug in printing: it used to test for truth before
5554 printing, so 0 wouldn't print. Now checks for None.
5560 printing, so 0 wouldn't print. Now checks for None.
5555
5561
5556 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5562 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5557 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5563 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5558 reaches by hand into the outputcache. Think of a better way to do
5564 reaches by hand into the outputcache. Think of a better way to do
5559 this later.
5565 this later.
5560
5566
5561 * Various small fixes thanks to Nathan's comments.
5567 * Various small fixes thanks to Nathan's comments.
5562
5568
5563 * Changed magic_pprint to magic_Pprint. This way it doesn't
5569 * Changed magic_pprint to magic_Pprint. This way it doesn't
5564 collide with pprint() and the name is consistent with the command
5570 collide with pprint() and the name is consistent with the command
5565 line option.
5571 line option.
5566
5572
5567 * Changed prompt counter behavior to be fully like
5573 * Changed prompt counter behavior to be fully like
5568 Mathematica's. That is, even input that doesn't return a result
5574 Mathematica's. That is, even input that doesn't return a result
5569 raises the prompt counter. The old behavior was kind of confusing
5575 raises the prompt counter. The old behavior was kind of confusing
5570 (getting the same prompt number several times if the operation
5576 (getting the same prompt number several times if the operation
5571 didn't return a result).
5577 didn't return a result).
5572
5578
5573 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5579 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5574
5580
5575 * Fixed -Classic mode (wasn't working anymore).
5581 * Fixed -Classic mode (wasn't working anymore).
5576
5582
5577 * Added colored prompts using Nathan's new code. Colors are
5583 * Added colored prompts using Nathan's new code. Colors are
5578 currently hardwired, they can be user-configurable. For
5584 currently hardwired, they can be user-configurable. For
5579 developers, they can be chosen in file ipythonlib.py, at the
5585 developers, they can be chosen in file ipythonlib.py, at the
5580 beginning of the CachedOutput class def.
5586 beginning of the CachedOutput class def.
5581
5587
5582 2001-11-11 Fernando Perez <fperez@colorado.edu>
5588 2001-11-11 Fernando Perez <fperez@colorado.edu>
5583
5589
5584 * Version 0.1.5 released, 0.1.6 opened for further work.
5590 * Version 0.1.5 released, 0.1.6 opened for further work.
5585
5591
5586 * Changed magic_env to *return* the environment as a dict (not to
5592 * Changed magic_env to *return* the environment as a dict (not to
5587 print it). This way it prints, but it can also be processed.
5593 print it). This way it prints, but it can also be processed.
5588
5594
5589 * Added Verbose exception reporting to interactive
5595 * Added Verbose exception reporting to interactive
5590 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5596 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5591 traceback. Had to make some changes to the ultraTB file. This is
5597 traceback. Had to make some changes to the ultraTB file. This is
5592 probably the last 'big' thing in my mental todo list. This ties
5598 probably the last 'big' thing in my mental todo list. This ties
5593 in with the next entry:
5599 in with the next entry:
5594
5600
5595 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5601 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5596 has to specify is Plain, Color or Verbose for all exception
5602 has to specify is Plain, Color or Verbose for all exception
5597 handling.
5603 handling.
5598
5604
5599 * Removed ShellServices option. All this can really be done via
5605 * Removed ShellServices option. All this can really be done via
5600 the magic system. It's easier to extend, cleaner and has automatic
5606 the magic system. It's easier to extend, cleaner and has automatic
5601 namespace protection and documentation.
5607 namespace protection and documentation.
5602
5608
5603 2001-11-09 Fernando Perez <fperez@colorado.edu>
5609 2001-11-09 Fernando Perez <fperez@colorado.edu>
5604
5610
5605 * Fixed bug in output cache flushing (missing parameter to
5611 * Fixed bug in output cache flushing (missing parameter to
5606 __init__). Other small bugs fixed (found using pychecker).
5612 __init__). Other small bugs fixed (found using pychecker).
5607
5613
5608 * Version 0.1.4 opened for bugfixing.
5614 * Version 0.1.4 opened for bugfixing.
5609
5615
5610 2001-11-07 Fernando Perez <fperez@colorado.edu>
5616 2001-11-07 Fernando Perez <fperez@colorado.edu>
5611
5617
5612 * Version 0.1.3 released, mainly because of the raw_input bug.
5618 * Version 0.1.3 released, mainly because of the raw_input bug.
5613
5619
5614 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5620 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5615 and when testing for whether things were callable, a call could
5621 and when testing for whether things were callable, a call could
5616 actually be made to certain functions. They would get called again
5622 actually be made to certain functions. They would get called again
5617 once 'really' executed, with a resulting double call. A disaster
5623 once 'really' executed, with a resulting double call. A disaster
5618 in many cases (list.reverse() would never work!).
5624 in many cases (list.reverse() would never work!).
5619
5625
5620 * Removed prefilter() function, moved its code to raw_input (which
5626 * Removed prefilter() function, moved its code to raw_input (which
5621 after all was just a near-empty caller for prefilter). This saves
5627 after all was just a near-empty caller for prefilter). This saves
5622 a function call on every prompt, and simplifies the class a tiny bit.
5628 a function call on every prompt, and simplifies the class a tiny bit.
5623
5629
5624 * Fix _ip to __ip name in magic example file.
5630 * Fix _ip to __ip name in magic example file.
5625
5631
5626 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5632 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5627 work with non-gnu versions of tar.
5633 work with non-gnu versions of tar.
5628
5634
5629 2001-11-06 Fernando Perez <fperez@colorado.edu>
5635 2001-11-06 Fernando Perez <fperez@colorado.edu>
5630
5636
5631 * Version 0.1.2. Just to keep track of the recent changes.
5637 * Version 0.1.2. Just to keep track of the recent changes.
5632
5638
5633 * Fixed nasty bug in output prompt routine. It used to check 'if
5639 * Fixed nasty bug in output prompt routine. It used to check 'if
5634 arg != None...'. Problem is, this fails if arg implements a
5640 arg != None...'. Problem is, this fails if arg implements a
5635 special comparison (__cmp__) which disallows comparing to
5641 special comparison (__cmp__) which disallows comparing to
5636 None. Found it when trying to use the PhysicalQuantity module from
5642 None. Found it when trying to use the PhysicalQuantity module from
5637 ScientificPython.
5643 ScientificPython.
5638
5644
5639 2001-11-05 Fernando Perez <fperez@colorado.edu>
5645 2001-11-05 Fernando Perez <fperez@colorado.edu>
5640
5646
5641 * Also added dirs. Now the pushd/popd/dirs family functions
5647 * Also added dirs. Now the pushd/popd/dirs family functions
5642 basically like the shell, with the added convenience of going home
5648 basically like the shell, with the added convenience of going home
5643 when called with no args.
5649 when called with no args.
5644
5650
5645 * pushd/popd slightly modified to mimic shell behavior more
5651 * pushd/popd slightly modified to mimic shell behavior more
5646 closely.
5652 closely.
5647
5653
5648 * Added env,pushd,popd from ShellServices as magic functions. I
5654 * Added env,pushd,popd from ShellServices as magic functions. I
5649 think the cleanest will be to port all desired functions from
5655 think the cleanest will be to port all desired functions from
5650 ShellServices as magics and remove ShellServices altogether. This
5656 ShellServices as magics and remove ShellServices altogether. This
5651 will provide a single, clean way of adding functionality
5657 will provide a single, clean way of adding functionality
5652 (shell-type or otherwise) to IP.
5658 (shell-type or otherwise) to IP.
5653
5659
5654 2001-11-04 Fernando Perez <fperez@colorado.edu>
5660 2001-11-04 Fernando Perez <fperez@colorado.edu>
5655
5661
5656 * Added .ipython/ directory to sys.path. This way users can keep
5662 * Added .ipython/ directory to sys.path. This way users can keep
5657 customizations there and access them via import.
5663 customizations there and access them via import.
5658
5664
5659 2001-11-03 Fernando Perez <fperez@colorado.edu>
5665 2001-11-03 Fernando Perez <fperez@colorado.edu>
5660
5666
5661 * Opened version 0.1.1 for new changes.
5667 * Opened version 0.1.1 for new changes.
5662
5668
5663 * Changed version number to 0.1.0: first 'public' release, sent to
5669 * Changed version number to 0.1.0: first 'public' release, sent to
5664 Nathan and Janko.
5670 Nathan and Janko.
5665
5671
5666 * Lots of small fixes and tweaks.
5672 * Lots of small fixes and tweaks.
5667
5673
5668 * Minor changes to whos format. Now strings are shown, snipped if
5674 * Minor changes to whos format. Now strings are shown, snipped if
5669 too long.
5675 too long.
5670
5676
5671 * Changed ShellServices to work on __main__ so they show up in @who
5677 * Changed ShellServices to work on __main__ so they show up in @who
5672
5678
5673 * Help also works with ? at the end of a line:
5679 * Help also works with ? at the end of a line:
5674 ?sin and sin?
5680 ?sin and sin?
5675 both produce the same effect. This is nice, as often I use the
5681 both produce the same effect. This is nice, as often I use the
5676 tab-complete to find the name of a method, but I used to then have
5682 tab-complete to find the name of a method, but I used to then have
5677 to go to the beginning of the line to put a ? if I wanted more
5683 to go to the beginning of the line to put a ? if I wanted more
5678 info. Now I can just add the ? and hit return. Convenient.
5684 info. Now I can just add the ? and hit return. Convenient.
5679
5685
5680 2001-11-02 Fernando Perez <fperez@colorado.edu>
5686 2001-11-02 Fernando Perez <fperez@colorado.edu>
5681
5687
5682 * Python version check (>=2.1) added.
5688 * Python version check (>=2.1) added.
5683
5689
5684 * Added LazyPython documentation. At this point the docs are quite
5690 * Added LazyPython documentation. At this point the docs are quite
5685 a mess. A cleanup is in order.
5691 a mess. A cleanup is in order.
5686
5692
5687 * Auto-installer created. For some bizarre reason, the zipfiles
5693 * Auto-installer created. For some bizarre reason, the zipfiles
5688 module isn't working on my system. So I made a tar version
5694 module isn't working on my system. So I made a tar version
5689 (hopefully the command line options in various systems won't kill
5695 (hopefully the command line options in various systems won't kill
5690 me).
5696 me).
5691
5697
5692 * Fixes to Struct in genutils. Now all dictionary-like methods are
5698 * Fixes to Struct in genutils. Now all dictionary-like methods are
5693 protected (reasonably).
5699 protected (reasonably).
5694
5700
5695 * Added pager function to genutils and changed ? to print usage
5701 * Added pager function to genutils and changed ? to print usage
5696 note through it (it was too long).
5702 note through it (it was too long).
5697
5703
5698 * Added the LazyPython functionality. Works great! I changed the
5704 * Added the LazyPython functionality. Works great! I changed the
5699 auto-quote escape to ';', it's on home row and next to '. But
5705 auto-quote escape to ';', it's on home row and next to '. But
5700 both auto-quote and auto-paren (still /) escapes are command-line
5706 both auto-quote and auto-paren (still /) escapes are command-line
5701 parameters.
5707 parameters.
5702
5708
5703
5709
5704 2001-11-01 Fernando Perez <fperez@colorado.edu>
5710 2001-11-01 Fernando Perez <fperez@colorado.edu>
5705
5711
5706 * Version changed to 0.0.7. Fairly large change: configuration now
5712 * Version changed to 0.0.7. Fairly large change: configuration now
5707 is all stored in a directory, by default .ipython. There, all
5713 is all stored in a directory, by default .ipython. There, all
5708 config files have normal looking names (not .names)
5714 config files have normal looking names (not .names)
5709
5715
5710 * Version 0.0.6 Released first to Lucas and Archie as a test
5716 * Version 0.0.6 Released first to Lucas and Archie as a test
5711 run. Since it's the first 'semi-public' release, change version to
5717 run. Since it's the first 'semi-public' release, change version to
5712 > 0.0.6 for any changes now.
5718 > 0.0.6 for any changes now.
5713
5719
5714 * Stuff I had put in the ipplib.py changelog:
5720 * Stuff I had put in the ipplib.py changelog:
5715
5721
5716 Changes to InteractiveShell:
5722 Changes to InteractiveShell:
5717
5723
5718 - Made the usage message a parameter.
5724 - Made the usage message a parameter.
5719
5725
5720 - Require the name of the shell variable to be given. It's a bit
5726 - Require the name of the shell variable to be given. It's a bit
5721 of a hack, but allows the name 'shell' not to be hardwired in the
5727 of a hack, but allows the name 'shell' not to be hardwired in the
5722 magic (@) handler, which is problematic b/c it requires
5728 magic (@) handler, which is problematic b/c it requires
5723 polluting the global namespace with 'shell'. This in turn is
5729 polluting the global namespace with 'shell'. This in turn is
5724 fragile: if a user redefines a variable called shell, things
5730 fragile: if a user redefines a variable called shell, things
5725 break.
5731 break.
5726
5732
5727 - magic @: all functions available through @ need to be defined
5733 - magic @: all functions available through @ need to be defined
5728 as magic_<name>, even though they can be called simply as
5734 as magic_<name>, even though they can be called simply as
5729 @<name>. This allows the special command @magic to gather
5735 @<name>. This allows the special command @magic to gather
5730 information automatically about all existing magic functions,
5736 information automatically about all existing magic functions,
5731 even if they are run-time user extensions, by parsing the shell
5737 even if they are run-time user extensions, by parsing the shell
5732 instance __dict__ looking for special magic_ names.
5738 instance __dict__ looking for special magic_ names.
5733
5739
5734 - mainloop: added *two* local namespace parameters. This allows
5740 - mainloop: added *two* local namespace parameters. This allows
5735 the class to differentiate between parameters which were there
5741 the class to differentiate between parameters which were there
5736 before and after command line initialization was processed. This
5742 before and after command line initialization was processed. This
5737 way, later @who can show things loaded at startup by the
5743 way, later @who can show things loaded at startup by the
5738 user. This trick was necessary to make session saving/reloading
5744 user. This trick was necessary to make session saving/reloading
5739 really work: ideally after saving/exiting/reloading a session,
5745 really work: ideally after saving/exiting/reloading a session,
5740 *everything* should look the same, including the output of @who. I
5746 *everything* should look the same, including the output of @who. I
5741 was only able to make this work with this double namespace
5747 was only able to make this work with this double namespace
5742 trick.
5748 trick.
5743
5749
5744 - added a header to the logfile which allows (almost) full
5750 - added a header to the logfile which allows (almost) full
5745 session restoring.
5751 session restoring.
5746
5752
5747 - prepend lines beginning with @ or !, with a and log
5753 - prepend lines beginning with @ or !, with a and log
5748 them. Why? !lines: may be useful to know what you did @lines:
5754 them. Why? !lines: may be useful to know what you did @lines:
5749 they may affect session state. So when restoring a session, at
5755 they may affect session state. So when restoring a session, at
5750 least inform the user of their presence. I couldn't quite get
5756 least inform the user of their presence. I couldn't quite get
5751 them to properly re-execute, but at least the user is warned.
5757 them to properly re-execute, but at least the user is warned.
5752
5758
5753 * Started ChangeLog.
5759 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now