##// END OF EJS Templates
Fix unicode handling, patch by Stefan. Closes #129
fperez -
Show More
@@ -1,2569 +1,2569 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 2135 2007-03-10 09:26:25Z fperez $
9 $Id: iplib.py 2168 2007-03-23 00:57:04Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pydoc
50 import pydoc
51 import re
51 import re
52 import shutil
52 import shutil
53 import string
53 import string
54 import sys
54 import sys
55 import tempfile
55 import tempfile
56 import traceback
56 import traceback
57 import types
57 import types
58 import pickleshare
58 import pickleshare
59 from sets import Set
59 from sets import Set
60 from pprint import pprint, pformat
60 from pprint import pprint, pformat
61
61
62 # IPython's own modules
62 # IPython's own modules
63 import IPython
63 import IPython
64 from IPython import OInspect,PyColorize,ultraTB
64 from IPython import OInspect,PyColorize,ultraTB
65 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.FakeModule import FakeModule
66 from IPython.FakeModule import FakeModule
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Logger import Logger
68 from IPython.Logger import Logger
69 from IPython.Magic import Magic
69 from IPython.Magic import Magic
70 from IPython.Prompts import CachedOutput
70 from IPython.Prompts import CachedOutput
71 from IPython.ipstruct import Struct
71 from IPython.ipstruct import Struct
72 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
73 from IPython.usage import cmd_line_usage,interactive_usage
73 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.genutils import *
74 from IPython.genutils import *
75 from IPython.strdispatch import StrDispatch
75 from IPython.strdispatch import StrDispatch
76 import IPython.ipapi
76 import IPython.ipapi
77
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 self.strdispatchers = {}
408 self.strdispatchers = {}
409
409
410 # Set all default hooks, defined in the IPython.hooks module.
410 # Set all default hooks, defined in the IPython.hooks module.
411 hooks = IPython.hooks
411 hooks = IPython.hooks
412 for hook_name in hooks.__all__:
412 for hook_name in hooks.__all__:
413 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
413 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
414 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
414 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
415 #print "bound hook",hook_name
415 #print "bound hook",hook_name
416
416
417 # Flag to mark unconditional exit
417 # Flag to mark unconditional exit
418 self.exit_now = False
418 self.exit_now = False
419
419
420 self.usage_min = """\
420 self.usage_min = """\
421 An enhanced console for Python.
421 An enhanced console for Python.
422 Some of its features are:
422 Some of its features are:
423 - Readline support if the readline library is present.
423 - Readline support if the readline library is present.
424 - Tab completion in the local namespace.
424 - Tab completion in the local namespace.
425 - Logging of input, see command-line options.
425 - Logging of input, see command-line options.
426 - System shell escape via ! , eg !ls.
426 - System shell escape via ! , eg !ls.
427 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
427 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
428 - Keeps track of locally defined variables via %who, %whos.
428 - Keeps track of locally defined variables via %who, %whos.
429 - Show object information with a ? eg ?x or x? (use ?? for more info).
429 - Show object information with a ? eg ?x or x? (use ?? for more info).
430 """
430 """
431 if usage: self.usage = usage
431 if usage: self.usage = usage
432 else: self.usage = self.usage_min
432 else: self.usage = self.usage_min
433
433
434 # Storage
434 # Storage
435 self.rc = rc # This will hold all configuration information
435 self.rc = rc # This will hold all configuration information
436 self.pager = 'less'
436 self.pager = 'less'
437 # temporary files used for various purposes. Deleted at exit.
437 # temporary files used for various purposes. Deleted at exit.
438 self.tempfiles = []
438 self.tempfiles = []
439
439
440 # Keep track of readline usage (later set by init_readline)
440 # Keep track of readline usage (later set by init_readline)
441 self.has_readline = False
441 self.has_readline = False
442
442
443 # template for logfile headers. It gets resolved at runtime by the
443 # template for logfile headers. It gets resolved at runtime by the
444 # logstart method.
444 # logstart method.
445 self.loghead_tpl = \
445 self.loghead_tpl = \
446 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
446 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
447 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
447 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
448 #log# opts = %s
448 #log# opts = %s
449 #log# args = %s
449 #log# args = %s
450 #log# It is safe to make manual edits below here.
450 #log# It is safe to make manual edits below here.
451 #log#-----------------------------------------------------------------------
451 #log#-----------------------------------------------------------------------
452 """
452 """
453 # for pushd/popd management
453 # for pushd/popd management
454 try:
454 try:
455 self.home_dir = get_home_dir()
455 self.home_dir = get_home_dir()
456 except HomeDirError,msg:
456 except HomeDirError,msg:
457 fatal(msg)
457 fatal(msg)
458
458
459 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
459 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
460
460
461 # Functions to call the underlying shell.
461 # Functions to call the underlying shell.
462
462
463 # The first is similar to os.system, but it doesn't return a value,
463 # The first is similar to os.system, but it doesn't return a value,
464 # and it allows interpolation of variables in the user's namespace.
464 # and it allows interpolation of variables in the user's namespace.
465 self.system = lambda cmd: \
465 self.system = lambda cmd: \
466 shell(self.var_expand(cmd,depth=2),
466 shell(self.var_expand(cmd,depth=2),
467 header=self.rc.system_header,
467 header=self.rc.system_header,
468 verbose=self.rc.system_verbose)
468 verbose=self.rc.system_verbose)
469
469
470 # These are for getoutput and getoutputerror:
470 # These are for getoutput and getoutputerror:
471 self.getoutput = lambda cmd: \
471 self.getoutput = lambda cmd: \
472 getoutput(self.var_expand(cmd,depth=2),
472 getoutput(self.var_expand(cmd,depth=2),
473 header=self.rc.system_header,
473 header=self.rc.system_header,
474 verbose=self.rc.system_verbose)
474 verbose=self.rc.system_verbose)
475
475
476 self.getoutputerror = lambda cmd: \
476 self.getoutputerror = lambda cmd: \
477 getoutputerror(self.var_expand(cmd,depth=2),
477 getoutputerror(self.var_expand(cmd,depth=2),
478 header=self.rc.system_header,
478 header=self.rc.system_header,
479 verbose=self.rc.system_verbose)
479 verbose=self.rc.system_verbose)
480
480
481 # RegExp for splitting line contents into pre-char//first
481 # RegExp for splitting line contents into pre-char//first
482 # word-method//rest. For clarity, each group in on one line.
482 # word-method//rest. For clarity, each group in on one line.
483
483
484 # WARNING: update the regexp if the above escapes are changed, as they
484 # WARNING: update the regexp if the above escapes are changed, as they
485 # are hardwired in.
485 # are hardwired in.
486
486
487 # Don't get carried away with trying to make the autocalling catch too
487 # Don't get carried away with trying to make the autocalling catch too
488 # much: it's better to be conservative rather than to trigger hidden
488 # much: it's better to be conservative rather than to trigger hidden
489 # evals() somewhere and end up causing side effects.
489 # evals() somewhere and end up causing side effects.
490 self.line_split = re.compile(r'^(\s*[,;/]?\s*)'
490 self.line_split = re.compile(r'^(\s*[,;/]?\s*)'
491 r'([\?\w\.]+\w*\s*)'
491 r'([\?\w\.]+\w*\s*)'
492 r'(\(?.*$)')
492 r'(\(?.*$)')
493
493
494 # A simpler regexp used as a fallback if the above doesn't work. This
494 # A simpler regexp used as a fallback if the above doesn't work. This
495 # one is more conservative in how it partitions the input. This code
495 # one is more conservative in how it partitions the input. This code
496 # can probably be cleaned up to do everything with just one regexp, but
496 # can probably be cleaned up to do everything with just one regexp, but
497 # I'm afraid of breaking something; do it once the unit tests are in
497 # I'm afraid of breaking something; do it once the unit tests are in
498 # place.
498 # place.
499 self.line_split_fallback = re.compile(r'^(\s*)'
499 self.line_split_fallback = re.compile(r'^(\s*)'
500 r'([%\!\?\w\.]*)'
500 r'([%\!\?\w\.]*)'
501 r'(.*)')
501 r'(.*)')
502
502
503 # Original re, keep around for a while in case changes break something
503 # Original re, keep around for a while in case changes break something
504 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
504 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
505 # r'(\s*[\?\w\.]+\w*\s*)'
505 # r'(\s*[\?\w\.]+\w*\s*)'
506 # r'(\(?.*$)')
506 # r'(\(?.*$)')
507
507
508 # RegExp to identify potential function names
508 # RegExp to identify potential function names
509 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
509 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
510
510
511 # RegExp to exclude strings with this start from autocalling. In
511 # RegExp to exclude strings with this start from autocalling. In
512 # particular, all binary operators should be excluded, so that if foo
512 # particular, all binary operators should be excluded, so that if foo
513 # is callable, foo OP bar doesn't become foo(OP bar), which is
513 # is callable, foo OP bar doesn't become foo(OP bar), which is
514 # invalid. The characters '!=()' don't need to be checked for, as the
514 # invalid. The characters '!=()' don't need to be checked for, as the
515 # _prefilter routine explicitely does so, to catch direct calls and
515 # _prefilter routine explicitely does so, to catch direct calls and
516 # rebindings of existing names.
516 # rebindings of existing names.
517
517
518 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
518 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
519 # it affects the rest of the group in square brackets.
519 # it affects the rest of the group in square brackets.
520 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
520 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
521 '|^is |^not |^in |^and |^or ')
521 '|^is |^not |^in |^and |^or ')
522
522
523 # try to catch also methods for stuff in lists/tuples/dicts: off
523 # try to catch also methods for stuff in lists/tuples/dicts: off
524 # (experimental). For this to work, the line_split regexp would need
524 # (experimental). For this to work, the line_split regexp would need
525 # to be modified so it wouldn't break things at '['. That line is
525 # to be modified so it wouldn't break things at '['. That line is
526 # nasty enough that I shouldn't change it until I can test it _well_.
526 # nasty enough that I shouldn't change it until I can test it _well_.
527 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
527 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
528
528
529 # keep track of where we started running (mainly for crash post-mortem)
529 # keep track of where we started running (mainly for crash post-mortem)
530 self.starting_dir = os.getcwd()
530 self.starting_dir = os.getcwd()
531
531
532 # Various switches which can be set
532 # Various switches which can be set
533 self.CACHELENGTH = 5000 # this is cheap, it's just text
533 self.CACHELENGTH = 5000 # this is cheap, it's just text
534 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
534 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
535 self.banner2 = banner2
535 self.banner2 = banner2
536
536
537 # TraceBack handlers:
537 # TraceBack handlers:
538
538
539 # Syntax error handler.
539 # Syntax error handler.
540 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
540 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
541
541
542 # The interactive one is initialized with an offset, meaning we always
542 # The interactive one is initialized with an offset, meaning we always
543 # want to remove the topmost item in the traceback, which is our own
543 # want to remove the topmost item in the traceback, which is our own
544 # internal code. Valid modes: ['Plain','Context','Verbose']
544 # internal code. Valid modes: ['Plain','Context','Verbose']
545 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
545 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
546 color_scheme='NoColor',
546 color_scheme='NoColor',
547 tb_offset = 1)
547 tb_offset = 1)
548
548
549 # IPython itself shouldn't crash. This will produce a detailed
549 # IPython itself shouldn't crash. This will produce a detailed
550 # post-mortem if it does. But we only install the crash handler for
550 # post-mortem if it does. But we only install the crash handler for
551 # non-threaded shells, the threaded ones use a normal verbose reporter
551 # non-threaded shells, the threaded ones use a normal verbose reporter
552 # and lose the crash handler. This is because exceptions in the main
552 # and lose the crash handler. This is because exceptions in the main
553 # thread (such as in GUI code) propagate directly to sys.excepthook,
553 # thread (such as in GUI code) propagate directly to sys.excepthook,
554 # and there's no point in printing crash dumps for every user exception.
554 # and there's no point in printing crash dumps for every user exception.
555 if self.isthreaded:
555 if self.isthreaded:
556 ipCrashHandler = ultraTB.FormattedTB()
556 ipCrashHandler = ultraTB.FormattedTB()
557 else:
557 else:
558 from IPython import CrashHandler
558 from IPython import CrashHandler
559 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
559 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
560 self.set_crash_handler(ipCrashHandler)
560 self.set_crash_handler(ipCrashHandler)
561
561
562 # and add any custom exception handlers the user may have specified
562 # and add any custom exception handlers the user may have specified
563 self.set_custom_exc(*custom_exceptions)
563 self.set_custom_exc(*custom_exceptions)
564
564
565 # indentation management
565 # indentation management
566 self.autoindent = False
566 self.autoindent = False
567 self.indent_current_nsp = 0
567 self.indent_current_nsp = 0
568
568
569 # Make some aliases automatically
569 # Make some aliases automatically
570 # Prepare list of shell aliases to auto-define
570 # Prepare list of shell aliases to auto-define
571 if os.name == 'posix':
571 if os.name == 'posix':
572 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
572 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
573 'mv mv -i','rm rm -i','cp cp -i',
573 'mv mv -i','rm rm -i','cp cp -i',
574 'cat cat','less less','clear clear',
574 'cat cat','less less','clear clear',
575 # a better ls
575 # a better ls
576 'ls ls -F',
576 'ls ls -F',
577 # long ls
577 # long ls
578 'll ls -lF')
578 'll ls -lF')
579 # Extra ls aliases with color, which need special treatment on BSD
579 # Extra ls aliases with color, which need special treatment on BSD
580 # variants
580 # variants
581 ls_extra = ( # color ls
581 ls_extra = ( # color ls
582 'lc ls -F -o --color',
582 'lc ls -F -o --color',
583 # ls normal files only
583 # ls normal files only
584 'lf ls -F -o --color %l | grep ^-',
584 'lf ls -F -o --color %l | grep ^-',
585 # ls symbolic links
585 # ls symbolic links
586 'lk ls -F -o --color %l | grep ^l',
586 'lk ls -F -o --color %l | grep ^l',
587 # directories or links to directories,
587 # directories or links to directories,
588 'ldir ls -F -o --color %l | grep /$',
588 'ldir ls -F -o --color %l | grep /$',
589 # things which are executable
589 # things which are executable
590 'lx ls -F -o --color %l | grep ^-..x',
590 'lx ls -F -o --color %l | grep ^-..x',
591 )
591 )
592 # The BSDs don't ship GNU ls, so they don't understand the
592 # The BSDs don't ship GNU ls, so they don't understand the
593 # --color switch out of the box
593 # --color switch out of the box
594 if 'bsd' in sys.platform:
594 if 'bsd' in sys.platform:
595 ls_extra = ( # ls normal files only
595 ls_extra = ( # ls normal files only
596 'lf ls -lF | grep ^-',
596 'lf ls -lF | grep ^-',
597 # ls symbolic links
597 # ls symbolic links
598 'lk ls -lF | grep ^l',
598 'lk ls -lF | grep ^l',
599 # directories or links to directories,
599 # directories or links to directories,
600 'ldir ls -lF | grep /$',
600 'ldir ls -lF | grep /$',
601 # things which are executable
601 # things which are executable
602 'lx ls -lF | grep ^-..x',
602 'lx ls -lF | grep ^-..x',
603 )
603 )
604 auto_alias = auto_alias + ls_extra
604 auto_alias = auto_alias + ls_extra
605 elif os.name in ['nt','dos']:
605 elif os.name in ['nt','dos']:
606 auto_alias = ('dir dir /on', 'ls dir /on',
606 auto_alias = ('dir dir /on', 'ls dir /on',
607 'ddir dir /ad /on', 'ldir dir /ad /on',
607 'ddir dir /ad /on', 'ldir dir /ad /on',
608 'mkdir mkdir','rmdir rmdir','echo echo',
608 'mkdir mkdir','rmdir rmdir','echo echo',
609 'ren ren','cls cls','copy copy')
609 'ren ren','cls cls','copy copy')
610 else:
610 else:
611 auto_alias = ()
611 auto_alias = ()
612 self.auto_alias = [s.split(None,1) for s in auto_alias]
612 self.auto_alias = [s.split(None,1) for s in auto_alias]
613 # Call the actual (public) initializer
613 # Call the actual (public) initializer
614 self.init_auto_alias()
614 self.init_auto_alias()
615
615
616 # Produce a public API instance
616 # Produce a public API instance
617 self.api = IPython.ipapi.IPApi(self)
617 self.api = IPython.ipapi.IPApi(self)
618
618
619 # track which builtins we add, so we can clean up later
619 # track which builtins we add, so we can clean up later
620 self.builtins_added = {}
620 self.builtins_added = {}
621 # This method will add the necessary builtins for operation, but
621 # This method will add the necessary builtins for operation, but
622 # tracking what it did via the builtins_added dict.
622 # tracking what it did via the builtins_added dict.
623 self.add_builtins()
623 self.add_builtins()
624
624
625 # end __init__
625 # end __init__
626
626
627 def var_expand(self,cmd,depth=0):
627 def var_expand(self,cmd,depth=0):
628 """Expand python variables in a string.
628 """Expand python variables in a string.
629
629
630 The depth argument indicates how many frames above the caller should
630 The depth argument indicates how many frames above the caller should
631 be walked to look for the local namespace where to expand variables.
631 be walked to look for the local namespace where to expand variables.
632
632
633 The global namespace for expansion is always the user's interactive
633 The global namespace for expansion is always the user's interactive
634 namespace.
634 namespace.
635 """
635 """
636
636
637 return str(ItplNS(cmd.replace('#','\#'),
637 return str(ItplNS(cmd.replace('#','\#'),
638 self.user_ns, # globals
638 self.user_ns, # globals
639 # Skip our own frame in searching for locals:
639 # Skip our own frame in searching for locals:
640 sys._getframe(depth+1).f_locals # locals
640 sys._getframe(depth+1).f_locals # locals
641 ))
641 ))
642
642
643 def pre_config_initialization(self):
643 def pre_config_initialization(self):
644 """Pre-configuration init method
644 """Pre-configuration init method
645
645
646 This is called before the configuration files are processed to
646 This is called before the configuration files are processed to
647 prepare the services the config files might need.
647 prepare the services the config files might need.
648
648
649 self.rc already has reasonable default values at this point.
649 self.rc already has reasonable default values at this point.
650 """
650 """
651 rc = self.rc
651 rc = self.rc
652
652
653 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
653 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
654
654
655 def post_config_initialization(self):
655 def post_config_initialization(self):
656 """Post configuration init method
656 """Post configuration init method
657
657
658 This is called after the configuration files have been processed to
658 This is called after the configuration files have been processed to
659 'finalize' the initialization."""
659 'finalize' the initialization."""
660
660
661 rc = self.rc
661 rc = self.rc
662
662
663 # Object inspector
663 # Object inspector
664 self.inspector = OInspect.Inspector(OInspect.InspectColors,
664 self.inspector = OInspect.Inspector(OInspect.InspectColors,
665 PyColorize.ANSICodeColors,
665 PyColorize.ANSICodeColors,
666 'NoColor',
666 'NoColor',
667 rc.object_info_string_level)
667 rc.object_info_string_level)
668
668
669 # Load readline proper
669 # Load readline proper
670 if rc.readline:
670 if rc.readline:
671 self.init_readline()
671 self.init_readline()
672
672
673 # local shortcut, this is used a LOT
673 # local shortcut, this is used a LOT
674 self.log = self.logger.log
674 self.log = self.logger.log
675
675
676 # Initialize cache, set in/out prompts and printing system
676 # Initialize cache, set in/out prompts and printing system
677 self.outputcache = CachedOutput(self,
677 self.outputcache = CachedOutput(self,
678 rc.cache_size,
678 rc.cache_size,
679 rc.pprint,
679 rc.pprint,
680 input_sep = rc.separate_in,
680 input_sep = rc.separate_in,
681 output_sep = rc.separate_out,
681 output_sep = rc.separate_out,
682 output_sep2 = rc.separate_out2,
682 output_sep2 = rc.separate_out2,
683 ps1 = rc.prompt_in1,
683 ps1 = rc.prompt_in1,
684 ps2 = rc.prompt_in2,
684 ps2 = rc.prompt_in2,
685 ps_out = rc.prompt_out,
685 ps_out = rc.prompt_out,
686 pad_left = rc.prompts_pad_left)
686 pad_left = rc.prompts_pad_left)
687
687
688 # user may have over-ridden the default print hook:
688 # user may have over-ridden the default print hook:
689 try:
689 try:
690 self.outputcache.__class__.display = self.hooks.display
690 self.outputcache.__class__.display = self.hooks.display
691 except AttributeError:
691 except AttributeError:
692 pass
692 pass
693
693
694 # I don't like assigning globally to sys, because it means when
694 # I don't like assigning globally to sys, because it means when
695 # embedding instances, each embedded instance overrides the previous
695 # embedding instances, each embedded instance overrides the previous
696 # choice. But sys.displayhook seems to be called internally by exec,
696 # choice. But sys.displayhook seems to be called internally by exec,
697 # so I don't see a way around it. We first save the original and then
697 # so I don't see a way around it. We first save the original and then
698 # overwrite it.
698 # overwrite it.
699 self.sys_displayhook = sys.displayhook
699 self.sys_displayhook = sys.displayhook
700 sys.displayhook = self.outputcache
700 sys.displayhook = self.outputcache
701
701
702 # Set user colors (don't do it in the constructor above so that it
702 # Set user colors (don't do it in the constructor above so that it
703 # doesn't crash if colors option is invalid)
703 # doesn't crash if colors option is invalid)
704 self.magic_colors(rc.colors)
704 self.magic_colors(rc.colors)
705
705
706 # Set calling of pdb on exceptions
706 # Set calling of pdb on exceptions
707 self.call_pdb = rc.pdb
707 self.call_pdb = rc.pdb
708
708
709 # Load user aliases
709 # Load user aliases
710 for alias in rc.alias:
710 for alias in rc.alias:
711 self.magic_alias(alias)
711 self.magic_alias(alias)
712 self.hooks.late_startup_hook()
712 self.hooks.late_startup_hook()
713
713
714 batchrun = False
714 batchrun = False
715 for batchfile in [path(arg) for arg in self.rc.args
715 for batchfile in [path(arg) for arg in self.rc.args
716 if arg.lower().endswith('.ipy')]:
716 if arg.lower().endswith('.ipy')]:
717 if not batchfile.isfile():
717 if not batchfile.isfile():
718 print "No such batch file:", batchfile
718 print "No such batch file:", batchfile
719 continue
719 continue
720 self.api.runlines(batchfile.text())
720 self.api.runlines(batchfile.text())
721 batchrun = True
721 batchrun = True
722 if batchrun:
722 if batchrun:
723 self.exit_now = True
723 self.exit_now = True
724
724
725 def add_builtins(self):
725 def add_builtins(self):
726 """Store ipython references into the builtin namespace.
726 """Store ipython references into the builtin namespace.
727
727
728 Some parts of ipython operate via builtins injected here, which hold a
728 Some parts of ipython operate via builtins injected here, which hold a
729 reference to IPython itself."""
729 reference to IPython itself."""
730
730
731 # TODO: deprecate all except _ip; 'jobs' should be installed
731 # TODO: deprecate all except _ip; 'jobs' should be installed
732 # by an extension and the rest are under _ip, ipalias is redundant
732 # by an extension and the rest are under _ip, ipalias is redundant
733 builtins_new = dict(__IPYTHON__ = self,
733 builtins_new = dict(__IPYTHON__ = self,
734 ip_set_hook = self.set_hook,
734 ip_set_hook = self.set_hook,
735 jobs = self.jobs,
735 jobs = self.jobs,
736 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
736 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
737 ipalias = wrap_deprecated(self.ipalias),
737 ipalias = wrap_deprecated(self.ipalias),
738 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
738 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
739 _ip = self.api
739 _ip = self.api
740 )
740 )
741 for biname,bival in builtins_new.items():
741 for biname,bival in builtins_new.items():
742 try:
742 try:
743 # store the orignal value so we can restore it
743 # store the orignal value so we can restore it
744 self.builtins_added[biname] = __builtin__.__dict__[biname]
744 self.builtins_added[biname] = __builtin__.__dict__[biname]
745 except KeyError:
745 except KeyError:
746 # or mark that it wasn't defined, and we'll just delete it at
746 # or mark that it wasn't defined, and we'll just delete it at
747 # cleanup
747 # cleanup
748 self.builtins_added[biname] = Undefined
748 self.builtins_added[biname] = Undefined
749 __builtin__.__dict__[biname] = bival
749 __builtin__.__dict__[biname] = bival
750
750
751 # Keep in the builtins a flag for when IPython is active. We set it
751 # Keep in the builtins a flag for when IPython is active. We set it
752 # with setdefault so that multiple nested IPythons don't clobber one
752 # with setdefault so that multiple nested IPythons don't clobber one
753 # another. Each will increase its value by one upon being activated,
753 # another. Each will increase its value by one upon being activated,
754 # which also gives us a way to determine the nesting level.
754 # which also gives us a way to determine the nesting level.
755 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
755 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
756
756
757 def clean_builtins(self):
757 def clean_builtins(self):
758 """Remove any builtins which might have been added by add_builtins, or
758 """Remove any builtins which might have been added by add_builtins, or
759 restore overwritten ones to their previous values."""
759 restore overwritten ones to their previous values."""
760 for biname,bival in self.builtins_added.items():
760 for biname,bival in self.builtins_added.items():
761 if bival is Undefined:
761 if bival is Undefined:
762 del __builtin__.__dict__[biname]
762 del __builtin__.__dict__[biname]
763 else:
763 else:
764 __builtin__.__dict__[biname] = bival
764 __builtin__.__dict__[biname] = bival
765 self.builtins_added.clear()
765 self.builtins_added.clear()
766
766
767 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
767 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
768 """set_hook(name,hook) -> sets an internal IPython hook.
768 """set_hook(name,hook) -> sets an internal IPython hook.
769
769
770 IPython exposes some of its internal API as user-modifiable hooks. By
770 IPython exposes some of its internal API as user-modifiable hooks. By
771 adding your function to one of these hooks, you can modify IPython's
771 adding your function to one of these hooks, you can modify IPython's
772 behavior to call at runtime your own routines."""
772 behavior to call at runtime your own routines."""
773
773
774 # At some point in the future, this should validate the hook before it
774 # At some point in the future, this should validate the hook before it
775 # accepts it. Probably at least check that the hook takes the number
775 # accepts it. Probably at least check that the hook takes the number
776 # of args it's supposed to.
776 # of args it's supposed to.
777
777
778 f = new.instancemethod(hook,self,self.__class__)
778 f = new.instancemethod(hook,self,self.__class__)
779
779
780 # check if the hook is for strdispatcher first
780 # check if the hook is for strdispatcher first
781 if str_key is not None:
781 if str_key is not None:
782 sdp = self.strdispatchers.get(name, StrDispatch())
782 sdp = self.strdispatchers.get(name, StrDispatch())
783 sdp.add_s(str_key, f, priority )
783 sdp.add_s(str_key, f, priority )
784 self.strdispatchers[name] = sdp
784 self.strdispatchers[name] = sdp
785 return
785 return
786 if re_key is not None:
786 if re_key is not None:
787 sdp = self.strdispatchers.get(name, StrDispatch())
787 sdp = self.strdispatchers.get(name, StrDispatch())
788 sdp.add_re(re.compile(re_key), f, priority )
788 sdp.add_re(re.compile(re_key), f, priority )
789 self.strdispatchers[name] = sdp
789 self.strdispatchers[name] = sdp
790 return
790 return
791
791
792 dp = getattr(self.hooks, name, None)
792 dp = getattr(self.hooks, name, None)
793 if name not in IPython.hooks.__all__:
793 if name not in IPython.hooks.__all__:
794 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
794 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
795 if not dp:
795 if not dp:
796 dp = IPython.hooks.CommandChainDispatcher()
796 dp = IPython.hooks.CommandChainDispatcher()
797
797
798 try:
798 try:
799 dp.add(f,priority)
799 dp.add(f,priority)
800 except AttributeError:
800 except AttributeError:
801 # it was not commandchain, plain old func - replace
801 # it was not commandchain, plain old func - replace
802 dp = f
802 dp = f
803
803
804 setattr(self.hooks,name, dp)
804 setattr(self.hooks,name, dp)
805
805
806
806
807 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
807 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
808
808
809 def set_crash_handler(self,crashHandler):
809 def set_crash_handler(self,crashHandler):
810 """Set the IPython crash handler.
810 """Set the IPython crash handler.
811
811
812 This must be a callable with a signature suitable for use as
812 This must be a callable with a signature suitable for use as
813 sys.excepthook."""
813 sys.excepthook."""
814
814
815 # Install the given crash handler as the Python exception hook
815 # Install the given crash handler as the Python exception hook
816 sys.excepthook = crashHandler
816 sys.excepthook = crashHandler
817
817
818 # The instance will store a pointer to this, so that runtime code
818 # The instance will store a pointer to this, so that runtime code
819 # (such as magics) can access it. This is because during the
819 # (such as magics) can access it. This is because during the
820 # read-eval loop, it gets temporarily overwritten (to deal with GUI
820 # read-eval loop, it gets temporarily overwritten (to deal with GUI
821 # frameworks).
821 # frameworks).
822 self.sys_excepthook = sys.excepthook
822 self.sys_excepthook = sys.excepthook
823
823
824
824
825 def set_custom_exc(self,exc_tuple,handler):
825 def set_custom_exc(self,exc_tuple,handler):
826 """set_custom_exc(exc_tuple,handler)
826 """set_custom_exc(exc_tuple,handler)
827
827
828 Set a custom exception handler, which will be called if any of the
828 Set a custom exception handler, which will be called if any of the
829 exceptions in exc_tuple occur in the mainloop (specifically, in the
829 exceptions in exc_tuple occur in the mainloop (specifically, in the
830 runcode() method.
830 runcode() method.
831
831
832 Inputs:
832 Inputs:
833
833
834 - exc_tuple: a *tuple* of valid exceptions to call the defined
834 - exc_tuple: a *tuple* of valid exceptions to call the defined
835 handler for. It is very important that you use a tuple, and NOT A
835 handler for. It is very important that you use a tuple, and NOT A
836 LIST here, because of the way Python's except statement works. If
836 LIST here, because of the way Python's except statement works. If
837 you only want to trap a single exception, use a singleton tuple:
837 you only want to trap a single exception, use a singleton tuple:
838
838
839 exc_tuple == (MyCustomException,)
839 exc_tuple == (MyCustomException,)
840
840
841 - handler: this must be defined as a function with the following
841 - handler: this must be defined as a function with the following
842 basic interface: def my_handler(self,etype,value,tb).
842 basic interface: def my_handler(self,etype,value,tb).
843
843
844 This will be made into an instance method (via new.instancemethod)
844 This will be made into an instance method (via new.instancemethod)
845 of IPython itself, and it will be called if any of the exceptions
845 of IPython itself, and it will be called if any of the exceptions
846 listed in the exc_tuple are caught. If the handler is None, an
846 listed in the exc_tuple are caught. If the handler is None, an
847 internal basic one is used, which just prints basic info.
847 internal basic one is used, which just prints basic info.
848
848
849 WARNING: by putting in your own exception handler into IPython's main
849 WARNING: by putting in your own exception handler into IPython's main
850 execution loop, you run a very good chance of nasty crashes. This
850 execution loop, you run a very good chance of nasty crashes. This
851 facility should only be used if you really know what you are doing."""
851 facility should only be used if you really know what you are doing."""
852
852
853 assert type(exc_tuple)==type(()) , \
853 assert type(exc_tuple)==type(()) , \
854 "The custom exceptions must be given AS A TUPLE."
854 "The custom exceptions must be given AS A TUPLE."
855
855
856 def dummy_handler(self,etype,value,tb):
856 def dummy_handler(self,etype,value,tb):
857 print '*** Simple custom exception handler ***'
857 print '*** Simple custom exception handler ***'
858 print 'Exception type :',etype
858 print 'Exception type :',etype
859 print 'Exception value:',value
859 print 'Exception value:',value
860 print 'Traceback :',tb
860 print 'Traceback :',tb
861 print 'Source code :','\n'.join(self.buffer)
861 print 'Source code :','\n'.join(self.buffer)
862
862
863 if handler is None: handler = dummy_handler
863 if handler is None: handler = dummy_handler
864
864
865 self.CustomTB = new.instancemethod(handler,self,self.__class__)
865 self.CustomTB = new.instancemethod(handler,self,self.__class__)
866 self.custom_exceptions = exc_tuple
866 self.custom_exceptions = exc_tuple
867
867
868 def set_custom_completer(self,completer,pos=0):
868 def set_custom_completer(self,completer,pos=0):
869 """set_custom_completer(completer,pos=0)
869 """set_custom_completer(completer,pos=0)
870
870
871 Adds a new custom completer function.
871 Adds a new custom completer function.
872
872
873 The position argument (defaults to 0) is the index in the completers
873 The position argument (defaults to 0) is the index in the completers
874 list where you want the completer to be inserted."""
874 list where you want the completer to be inserted."""
875
875
876 newcomp = new.instancemethod(completer,self.Completer,
876 newcomp = new.instancemethod(completer,self.Completer,
877 self.Completer.__class__)
877 self.Completer.__class__)
878 self.Completer.matchers.insert(pos,newcomp)
878 self.Completer.matchers.insert(pos,newcomp)
879
879
880 def _get_call_pdb(self):
880 def _get_call_pdb(self):
881 return self._call_pdb
881 return self._call_pdb
882
882
883 def _set_call_pdb(self,val):
883 def _set_call_pdb(self,val):
884
884
885 if val not in (0,1,False,True):
885 if val not in (0,1,False,True):
886 raise ValueError,'new call_pdb value must be boolean'
886 raise ValueError,'new call_pdb value must be boolean'
887
887
888 # store value in instance
888 # store value in instance
889 self._call_pdb = val
889 self._call_pdb = val
890
890
891 # notify the actual exception handlers
891 # notify the actual exception handlers
892 self.InteractiveTB.call_pdb = val
892 self.InteractiveTB.call_pdb = val
893 if self.isthreaded:
893 if self.isthreaded:
894 try:
894 try:
895 self.sys_excepthook.call_pdb = val
895 self.sys_excepthook.call_pdb = val
896 except:
896 except:
897 warn('Failed to activate pdb for threaded exception handler')
897 warn('Failed to activate pdb for threaded exception handler')
898
898
899 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
899 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
900 'Control auto-activation of pdb at exceptions')
900 'Control auto-activation of pdb at exceptions')
901
901
902
902
903 # These special functions get installed in the builtin namespace, to
903 # These special functions get installed in the builtin namespace, to
904 # provide programmatic (pure python) access to magics, aliases and system
904 # provide programmatic (pure python) access to magics, aliases and system
905 # calls. This is important for logging, user scripting, and more.
905 # calls. This is important for logging, user scripting, and more.
906
906
907 # We are basically exposing, via normal python functions, the three
907 # We are basically exposing, via normal python functions, the three
908 # mechanisms in which ipython offers special call modes (magics for
908 # mechanisms in which ipython offers special call modes (magics for
909 # internal control, aliases for direct system access via pre-selected
909 # internal control, aliases for direct system access via pre-selected
910 # names, and !cmd for calling arbitrary system commands).
910 # names, and !cmd for calling arbitrary system commands).
911
911
912 def ipmagic(self,arg_s):
912 def ipmagic(self,arg_s):
913 """Call a magic function by name.
913 """Call a magic function by name.
914
914
915 Input: a string containing the name of the magic function to call and any
915 Input: a string containing the name of the magic function to call and any
916 additional arguments to be passed to the magic.
916 additional arguments to be passed to the magic.
917
917
918 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
918 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
919 prompt:
919 prompt:
920
920
921 In[1]: %name -opt foo bar
921 In[1]: %name -opt foo bar
922
922
923 To call a magic without arguments, simply use ipmagic('name').
923 To call a magic without arguments, simply use ipmagic('name').
924
924
925 This provides a proper Python function to call IPython's magics in any
925 This provides a proper Python function to call IPython's magics in any
926 valid Python code you can type at the interpreter, including loops and
926 valid Python code you can type at the interpreter, including loops and
927 compound statements. It is added by IPython to the Python builtin
927 compound statements. It is added by IPython to the Python builtin
928 namespace upon initialization."""
928 namespace upon initialization."""
929
929
930 args = arg_s.split(' ',1)
930 args = arg_s.split(' ',1)
931 magic_name = args[0]
931 magic_name = args[0]
932 magic_name = magic_name.lstrip(self.ESC_MAGIC)
932 magic_name = magic_name.lstrip(self.ESC_MAGIC)
933
933
934 try:
934 try:
935 magic_args = args[1]
935 magic_args = args[1]
936 except IndexError:
936 except IndexError:
937 magic_args = ''
937 magic_args = ''
938 fn = getattr(self,'magic_'+magic_name,None)
938 fn = getattr(self,'magic_'+magic_name,None)
939 if fn is None:
939 if fn is None:
940 error("Magic function `%s` not found." % magic_name)
940 error("Magic function `%s` not found." % magic_name)
941 else:
941 else:
942 magic_args = self.var_expand(magic_args,1)
942 magic_args = self.var_expand(magic_args,1)
943 return fn(magic_args)
943 return fn(magic_args)
944
944
945 def ipalias(self,arg_s):
945 def ipalias(self,arg_s):
946 """Call an alias by name.
946 """Call an alias by name.
947
947
948 Input: a string containing the name of the alias to call and any
948 Input: a string containing the name of the alias to call and any
949 additional arguments to be passed to the magic.
949 additional arguments to be passed to the magic.
950
950
951 ipalias('name -opt foo bar') is equivalent to typing at the ipython
951 ipalias('name -opt foo bar') is equivalent to typing at the ipython
952 prompt:
952 prompt:
953
953
954 In[1]: name -opt foo bar
954 In[1]: name -opt foo bar
955
955
956 To call an alias without arguments, simply use ipalias('name').
956 To call an alias without arguments, simply use ipalias('name').
957
957
958 This provides a proper Python function to call IPython's aliases in any
958 This provides a proper Python function to call IPython's aliases in any
959 valid Python code you can type at the interpreter, including loops and
959 valid Python code you can type at the interpreter, including loops and
960 compound statements. It is added by IPython to the Python builtin
960 compound statements. It is added by IPython to the Python builtin
961 namespace upon initialization."""
961 namespace upon initialization."""
962
962
963 args = arg_s.split(' ',1)
963 args = arg_s.split(' ',1)
964 alias_name = args[0]
964 alias_name = args[0]
965 try:
965 try:
966 alias_args = args[1]
966 alias_args = args[1]
967 except IndexError:
967 except IndexError:
968 alias_args = ''
968 alias_args = ''
969 if alias_name in self.alias_table:
969 if alias_name in self.alias_table:
970 self.call_alias(alias_name,alias_args)
970 self.call_alias(alias_name,alias_args)
971 else:
971 else:
972 error("Alias `%s` not found." % alias_name)
972 error("Alias `%s` not found." % alias_name)
973
973
974 def ipsystem(self,arg_s):
974 def ipsystem(self,arg_s):
975 """Make a system call, using IPython."""
975 """Make a system call, using IPython."""
976
976
977 self.system(arg_s)
977 self.system(arg_s)
978
978
979 def complete(self,text):
979 def complete(self,text):
980 """Return a sorted list of all possible completions on text.
980 """Return a sorted list of all possible completions on text.
981
981
982 Inputs:
982 Inputs:
983
983
984 - text: a string of text to be completed on.
984 - text: a string of text to be completed on.
985
985
986 This is a wrapper around the completion mechanism, similar to what
986 This is a wrapper around the completion mechanism, similar to what
987 readline does at the command line when the TAB key is hit. By
987 readline does at the command line when the TAB key is hit. By
988 exposing it as a method, it can be used by other non-readline
988 exposing it as a method, it can be used by other non-readline
989 environments (such as GUIs) for text completion.
989 environments (such as GUIs) for text completion.
990
990
991 Simple usage example:
991 Simple usage example:
992
992
993 In [1]: x = 'hello'
993 In [1]: x = 'hello'
994
994
995 In [2]: __IP.complete('x.l')
995 In [2]: __IP.complete('x.l')
996 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
996 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
997
997
998 complete = self.Completer.complete
998 complete = self.Completer.complete
999 state = 0
999 state = 0
1000 # use a dict so we get unique keys, since ipyhton's multiple
1000 # use a dict so we get unique keys, since ipyhton's multiple
1001 # completers can return duplicates.
1001 # completers can return duplicates.
1002 comps = {}
1002 comps = {}
1003 while True:
1003 while True:
1004 newcomp = complete(text,state)
1004 newcomp = complete(text,state)
1005 if newcomp is None:
1005 if newcomp is None:
1006 break
1006 break
1007 comps[newcomp] = 1
1007 comps[newcomp] = 1
1008 state += 1
1008 state += 1
1009 outcomps = comps.keys()
1009 outcomps = comps.keys()
1010 outcomps.sort()
1010 outcomps.sort()
1011 return outcomps
1011 return outcomps
1012
1012
1013 def set_completer_frame(self, frame=None):
1013 def set_completer_frame(self, frame=None):
1014 if frame:
1014 if frame:
1015 self.Completer.namespace = frame.f_locals
1015 self.Completer.namespace = frame.f_locals
1016 self.Completer.global_namespace = frame.f_globals
1016 self.Completer.global_namespace = frame.f_globals
1017 else:
1017 else:
1018 self.Completer.namespace = self.user_ns
1018 self.Completer.namespace = self.user_ns
1019 self.Completer.global_namespace = self.user_global_ns
1019 self.Completer.global_namespace = self.user_global_ns
1020
1020
1021 def init_auto_alias(self):
1021 def init_auto_alias(self):
1022 """Define some aliases automatically.
1022 """Define some aliases automatically.
1023
1023
1024 These are ALL parameter-less aliases"""
1024 These are ALL parameter-less aliases"""
1025
1025
1026 for alias,cmd in self.auto_alias:
1026 for alias,cmd in self.auto_alias:
1027 self.alias_table[alias] = (0,cmd)
1027 self.alias_table[alias] = (0,cmd)
1028
1028
1029 def alias_table_validate(self,verbose=0):
1029 def alias_table_validate(self,verbose=0):
1030 """Update information about the alias table.
1030 """Update information about the alias table.
1031
1031
1032 In particular, make sure no Python keywords/builtins are in it."""
1032 In particular, make sure no Python keywords/builtins are in it."""
1033
1033
1034 no_alias = self.no_alias
1034 no_alias = self.no_alias
1035 for k in self.alias_table.keys():
1035 for k in self.alias_table.keys():
1036 if k in no_alias:
1036 if k in no_alias:
1037 del self.alias_table[k]
1037 del self.alias_table[k]
1038 if verbose:
1038 if verbose:
1039 print ("Deleting alias <%s>, it's a Python "
1039 print ("Deleting alias <%s>, it's a Python "
1040 "keyword or builtin." % k)
1040 "keyword or builtin." % k)
1041
1041
1042 def set_autoindent(self,value=None):
1042 def set_autoindent(self,value=None):
1043 """Set the autoindent flag, checking for readline support.
1043 """Set the autoindent flag, checking for readline support.
1044
1044
1045 If called with no arguments, it acts as a toggle."""
1045 If called with no arguments, it acts as a toggle."""
1046
1046
1047 if not self.has_readline:
1047 if not self.has_readline:
1048 if os.name == 'posix':
1048 if os.name == 'posix':
1049 warn("The auto-indent feature requires the readline library")
1049 warn("The auto-indent feature requires the readline library")
1050 self.autoindent = 0
1050 self.autoindent = 0
1051 return
1051 return
1052 if value is None:
1052 if value is None:
1053 self.autoindent = not self.autoindent
1053 self.autoindent = not self.autoindent
1054 else:
1054 else:
1055 self.autoindent = value
1055 self.autoindent = value
1056
1056
1057 def rc_set_toggle(self,rc_field,value=None):
1057 def rc_set_toggle(self,rc_field,value=None):
1058 """Set or toggle a field in IPython's rc config. structure.
1058 """Set or toggle a field in IPython's rc config. structure.
1059
1059
1060 If called with no arguments, it acts as a toggle.
1060 If called with no arguments, it acts as a toggle.
1061
1061
1062 If called with a non-existent field, the resulting AttributeError
1062 If called with a non-existent field, the resulting AttributeError
1063 exception will propagate out."""
1063 exception will propagate out."""
1064
1064
1065 rc_val = getattr(self.rc,rc_field)
1065 rc_val = getattr(self.rc,rc_field)
1066 if value is None:
1066 if value is None:
1067 value = not rc_val
1067 value = not rc_val
1068 setattr(self.rc,rc_field,value)
1068 setattr(self.rc,rc_field,value)
1069
1069
1070 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1070 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1071 """Install the user configuration directory.
1071 """Install the user configuration directory.
1072
1072
1073 Can be called when running for the first time or to upgrade the user's
1073 Can be called when running for the first time or to upgrade the user's
1074 .ipython/ directory with the mode parameter. Valid modes are 'install'
1074 .ipython/ directory with the mode parameter. Valid modes are 'install'
1075 and 'upgrade'."""
1075 and 'upgrade'."""
1076
1076
1077 def wait():
1077 def wait():
1078 try:
1078 try:
1079 raw_input("Please press <RETURN> to start IPython.")
1079 raw_input("Please press <RETURN> to start IPython.")
1080 except EOFError:
1080 except EOFError:
1081 print >> Term.cout
1081 print >> Term.cout
1082 print '*'*70
1082 print '*'*70
1083
1083
1084 cwd = os.getcwd() # remember where we started
1084 cwd = os.getcwd() # remember where we started
1085 glb = glob.glob
1085 glb = glob.glob
1086 print '*'*70
1086 print '*'*70
1087 if mode == 'install':
1087 if mode == 'install':
1088 print \
1088 print \
1089 """Welcome to IPython. I will try to create a personal configuration directory
1089 """Welcome to IPython. I will try to create a personal configuration directory
1090 where you can customize many aspects of IPython's functionality in:\n"""
1090 where you can customize many aspects of IPython's functionality in:\n"""
1091 else:
1091 else:
1092 print 'I am going to upgrade your configuration in:'
1092 print 'I am going to upgrade your configuration in:'
1093
1093
1094 print ipythondir
1094 print ipythondir
1095
1095
1096 rcdirend = os.path.join('IPython','UserConfig')
1096 rcdirend = os.path.join('IPython','UserConfig')
1097 cfg = lambda d: os.path.join(d,rcdirend)
1097 cfg = lambda d: os.path.join(d,rcdirend)
1098 try:
1098 try:
1099 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1099 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1100 except IOError:
1100 except IOError:
1101 warning = """
1101 warning = """
1102 Installation error. IPython's directory was not found.
1102 Installation error. IPython's directory was not found.
1103
1103
1104 Check the following:
1104 Check the following:
1105
1105
1106 The ipython/IPython directory should be in a directory belonging to your
1106 The ipython/IPython directory should be in a directory belonging to your
1107 PYTHONPATH environment variable (that is, it should be in a directory
1107 PYTHONPATH environment variable (that is, it should be in a directory
1108 belonging to sys.path). You can copy it explicitly there or just link to it.
1108 belonging to sys.path). You can copy it explicitly there or just link to it.
1109
1109
1110 IPython will proceed with builtin defaults.
1110 IPython will proceed with builtin defaults.
1111 """
1111 """
1112 warn(warning)
1112 warn(warning)
1113 wait()
1113 wait()
1114 return
1114 return
1115
1115
1116 if mode == 'install':
1116 if mode == 'install':
1117 try:
1117 try:
1118 shutil.copytree(rcdir,ipythondir)
1118 shutil.copytree(rcdir,ipythondir)
1119 os.chdir(ipythondir)
1119 os.chdir(ipythondir)
1120 rc_files = glb("ipythonrc*")
1120 rc_files = glb("ipythonrc*")
1121 for rc_file in rc_files:
1121 for rc_file in rc_files:
1122 os.rename(rc_file,rc_file+rc_suffix)
1122 os.rename(rc_file,rc_file+rc_suffix)
1123 except:
1123 except:
1124 warning = """
1124 warning = """
1125
1125
1126 There was a problem with the installation:
1126 There was a problem with the installation:
1127 %s
1127 %s
1128 Try to correct it or contact the developers if you think it's a bug.
1128 Try to correct it or contact the developers if you think it's a bug.
1129 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1129 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1130 warn(warning)
1130 warn(warning)
1131 wait()
1131 wait()
1132 return
1132 return
1133
1133
1134 elif mode == 'upgrade':
1134 elif mode == 'upgrade':
1135 try:
1135 try:
1136 os.chdir(ipythondir)
1136 os.chdir(ipythondir)
1137 except:
1137 except:
1138 print """
1138 print """
1139 Can not upgrade: changing to directory %s failed. Details:
1139 Can not upgrade: changing to directory %s failed. Details:
1140 %s
1140 %s
1141 """ % (ipythondir,sys.exc_info()[1])
1141 """ % (ipythondir,sys.exc_info()[1])
1142 wait()
1142 wait()
1143 return
1143 return
1144 else:
1144 else:
1145 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1145 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1146 for new_full_path in sources:
1146 for new_full_path in sources:
1147 new_filename = os.path.basename(new_full_path)
1147 new_filename = os.path.basename(new_full_path)
1148 if new_filename.startswith('ipythonrc'):
1148 if new_filename.startswith('ipythonrc'):
1149 new_filename = new_filename + rc_suffix
1149 new_filename = new_filename + rc_suffix
1150 # The config directory should only contain files, skip any
1150 # The config directory should only contain files, skip any
1151 # directories which may be there (like CVS)
1151 # directories which may be there (like CVS)
1152 if os.path.isdir(new_full_path):
1152 if os.path.isdir(new_full_path):
1153 continue
1153 continue
1154 if os.path.exists(new_filename):
1154 if os.path.exists(new_filename):
1155 old_file = new_filename+'.old'
1155 old_file = new_filename+'.old'
1156 if os.path.exists(old_file):
1156 if os.path.exists(old_file):
1157 os.remove(old_file)
1157 os.remove(old_file)
1158 os.rename(new_filename,old_file)
1158 os.rename(new_filename,old_file)
1159 shutil.copy(new_full_path,new_filename)
1159 shutil.copy(new_full_path,new_filename)
1160 else:
1160 else:
1161 raise ValueError,'unrecognized mode for install:',`mode`
1161 raise ValueError,'unrecognized mode for install:',`mode`
1162
1162
1163 # Fix line-endings to those native to each platform in the config
1163 # Fix line-endings to those native to each platform in the config
1164 # directory.
1164 # directory.
1165 try:
1165 try:
1166 os.chdir(ipythondir)
1166 os.chdir(ipythondir)
1167 except:
1167 except:
1168 print """
1168 print """
1169 Problem: changing to directory %s failed.
1169 Problem: changing to directory %s failed.
1170 Details:
1170 Details:
1171 %s
1171 %s
1172
1172
1173 Some configuration files may have incorrect line endings. This should not
1173 Some configuration files may have incorrect line endings. This should not
1174 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1174 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1175 wait()
1175 wait()
1176 else:
1176 else:
1177 for fname in glb('ipythonrc*'):
1177 for fname in glb('ipythonrc*'):
1178 try:
1178 try:
1179 native_line_ends(fname,backup=0)
1179 native_line_ends(fname,backup=0)
1180 except IOError:
1180 except IOError:
1181 pass
1181 pass
1182
1182
1183 if mode == 'install':
1183 if mode == 'install':
1184 print """
1184 print """
1185 Successful installation!
1185 Successful installation!
1186
1186
1187 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1187 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1188 IPython manual (there are both HTML and PDF versions supplied with the
1188 IPython manual (there are both HTML and PDF versions supplied with the
1189 distribution) to make sure that your system environment is properly configured
1189 distribution) to make sure that your system environment is properly configured
1190 to take advantage of IPython's features.
1190 to take advantage of IPython's features.
1191
1191
1192 Important note: the configuration system has changed! The old system is
1192 Important note: the configuration system has changed! The old system is
1193 still in place, but its setting may be partly overridden by the settings in
1193 still in place, but its setting may be partly overridden by the settings in
1194 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1194 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1195 if some of the new settings bother you.
1195 if some of the new settings bother you.
1196
1196
1197 """
1197 """
1198 else:
1198 else:
1199 print """
1199 print """
1200 Successful upgrade!
1200 Successful upgrade!
1201
1201
1202 All files in your directory:
1202 All files in your directory:
1203 %(ipythondir)s
1203 %(ipythondir)s
1204 which would have been overwritten by the upgrade were backed up with a .old
1204 which would have been overwritten by the upgrade were backed up with a .old
1205 extension. If you had made particular customizations in those files you may
1205 extension. If you had made particular customizations in those files you may
1206 want to merge them back into the new files.""" % locals()
1206 want to merge them back into the new files.""" % locals()
1207 wait()
1207 wait()
1208 os.chdir(cwd)
1208 os.chdir(cwd)
1209 # end user_setup()
1209 # end user_setup()
1210
1210
1211 def atexit_operations(self):
1211 def atexit_operations(self):
1212 """This will be executed at the time of exit.
1212 """This will be executed at the time of exit.
1213
1213
1214 Saving of persistent data should be performed here. """
1214 Saving of persistent data should be performed here. """
1215
1215
1216 #print '*** IPython exit cleanup ***' # dbg
1216 #print '*** IPython exit cleanup ***' # dbg
1217 # input history
1217 # input history
1218 self.savehist()
1218 self.savehist()
1219
1219
1220 # Cleanup all tempfiles left around
1220 # Cleanup all tempfiles left around
1221 for tfile in self.tempfiles:
1221 for tfile in self.tempfiles:
1222 try:
1222 try:
1223 os.unlink(tfile)
1223 os.unlink(tfile)
1224 except OSError:
1224 except OSError:
1225 pass
1225 pass
1226
1226
1227 # save the "persistent data" catch-all dictionary
1227 # save the "persistent data" catch-all dictionary
1228 self.hooks.shutdown_hook()
1228 self.hooks.shutdown_hook()
1229
1229
1230 def savehist(self):
1230 def savehist(self):
1231 """Save input history to a file (via readline library)."""
1231 """Save input history to a file (via readline library)."""
1232 try:
1232 try:
1233 self.readline.write_history_file(self.histfile)
1233 self.readline.write_history_file(self.histfile)
1234 except:
1234 except:
1235 print 'Unable to save IPython command history to file: ' + \
1235 print 'Unable to save IPython command history to file: ' + \
1236 `self.histfile`
1236 `self.histfile`
1237
1237
1238 def history_saving_wrapper(self, func):
1238 def history_saving_wrapper(self, func):
1239 """ Wrap func for readline history saving
1239 """ Wrap func for readline history saving
1240
1240
1241 Convert func into callable that saves & restores
1241 Convert func into callable that saves & restores
1242 history around the call """
1242 history around the call """
1243
1243
1244 if not self.has_readline:
1244 if not self.has_readline:
1245 return func
1245 return func
1246
1246
1247 def wrapper():
1247 def wrapper():
1248 self.savehist()
1248 self.savehist()
1249 try:
1249 try:
1250 func()
1250 func()
1251 finally:
1251 finally:
1252 readline.read_history_file(self.histfile)
1252 readline.read_history_file(self.histfile)
1253 return wrapper
1253 return wrapper
1254
1254
1255
1255
1256 def pre_readline(self):
1256 def pre_readline(self):
1257 """readline hook to be used at the start of each line.
1257 """readline hook to be used at the start of each line.
1258
1258
1259 Currently it handles auto-indent only."""
1259 Currently it handles auto-indent only."""
1260
1260
1261 #debugx('self.indent_current_nsp','pre_readline:')
1261 #debugx('self.indent_current_nsp','pre_readline:')
1262 self.readline.insert_text(self.indent_current_str())
1262 self.readline.insert_text(self.indent_current_str())
1263
1263
1264 def init_readline(self):
1264 def init_readline(self):
1265 """Command history completion/saving/reloading."""
1265 """Command history completion/saving/reloading."""
1266
1266
1267 import IPython.rlineimpl as readline
1267 import IPython.rlineimpl as readline
1268 if not readline.have_readline:
1268 if not readline.have_readline:
1269 self.has_readline = 0
1269 self.has_readline = 0
1270 self.readline = None
1270 self.readline = None
1271 # no point in bugging windows users with this every time:
1271 # no point in bugging windows users with this every time:
1272 warn('Readline services not available on this platform.')
1272 warn('Readline services not available on this platform.')
1273 else:
1273 else:
1274 sys.modules['readline'] = readline
1274 sys.modules['readline'] = readline
1275 import atexit
1275 import atexit
1276 from IPython.completer import IPCompleter
1276 from IPython.completer import IPCompleter
1277 self.Completer = IPCompleter(self,
1277 self.Completer = IPCompleter(self,
1278 self.user_ns,
1278 self.user_ns,
1279 self.user_global_ns,
1279 self.user_global_ns,
1280 self.rc.readline_omit__names,
1280 self.rc.readline_omit__names,
1281 self.alias_table)
1281 self.alias_table)
1282 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1282 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1283 self.strdispatchers['complete_command'] = sdisp
1283 self.strdispatchers['complete_command'] = sdisp
1284 self.Completer.custom_completers = sdisp
1284 self.Completer.custom_completers = sdisp
1285 # Platform-specific configuration
1285 # Platform-specific configuration
1286 if os.name == 'nt':
1286 if os.name == 'nt':
1287 self.readline_startup_hook = readline.set_pre_input_hook
1287 self.readline_startup_hook = readline.set_pre_input_hook
1288 else:
1288 else:
1289 self.readline_startup_hook = readline.set_startup_hook
1289 self.readline_startup_hook = readline.set_startup_hook
1290
1290
1291 # Load user's initrc file (readline config)
1291 # Load user's initrc file (readline config)
1292 inputrc_name = os.environ.get('INPUTRC')
1292 inputrc_name = os.environ.get('INPUTRC')
1293 if inputrc_name is None:
1293 if inputrc_name is None:
1294 home_dir = get_home_dir()
1294 home_dir = get_home_dir()
1295 if home_dir is not None:
1295 if home_dir is not None:
1296 inputrc_name = os.path.join(home_dir,'.inputrc')
1296 inputrc_name = os.path.join(home_dir,'.inputrc')
1297 if os.path.isfile(inputrc_name):
1297 if os.path.isfile(inputrc_name):
1298 try:
1298 try:
1299 readline.read_init_file(inputrc_name)
1299 readline.read_init_file(inputrc_name)
1300 except:
1300 except:
1301 warn('Problems reading readline initialization file <%s>'
1301 warn('Problems reading readline initialization file <%s>'
1302 % inputrc_name)
1302 % inputrc_name)
1303
1303
1304 self.has_readline = 1
1304 self.has_readline = 1
1305 self.readline = readline
1305 self.readline = readline
1306 # save this in sys so embedded copies can restore it properly
1306 # save this in sys so embedded copies can restore it properly
1307 sys.ipcompleter = self.Completer.complete
1307 sys.ipcompleter = self.Completer.complete
1308 readline.set_completer(self.Completer.complete)
1308 readline.set_completer(self.Completer.complete)
1309
1309
1310 # Configure readline according to user's prefs
1310 # Configure readline according to user's prefs
1311 for rlcommand in self.rc.readline_parse_and_bind:
1311 for rlcommand in self.rc.readline_parse_and_bind:
1312 readline.parse_and_bind(rlcommand)
1312 readline.parse_and_bind(rlcommand)
1313
1313
1314 # remove some chars from the delimiters list
1314 # remove some chars from the delimiters list
1315 delims = readline.get_completer_delims()
1315 delims = readline.get_completer_delims()
1316 delims = delims.translate(string._idmap,
1316 delims = delims.translate(string._idmap,
1317 self.rc.readline_remove_delims)
1317 self.rc.readline_remove_delims)
1318 readline.set_completer_delims(delims)
1318 readline.set_completer_delims(delims)
1319 # otherwise we end up with a monster history after a while:
1319 # otherwise we end up with a monster history after a while:
1320 readline.set_history_length(1000)
1320 readline.set_history_length(1000)
1321 try:
1321 try:
1322 #print '*** Reading readline history' # dbg
1322 #print '*** Reading readline history' # dbg
1323 readline.read_history_file(self.histfile)
1323 readline.read_history_file(self.histfile)
1324 except IOError:
1324 except IOError:
1325 pass # It doesn't exist yet.
1325 pass # It doesn't exist yet.
1326
1326
1327 atexit.register(self.atexit_operations)
1327 atexit.register(self.atexit_operations)
1328 del atexit
1328 del atexit
1329
1329
1330 # Configure auto-indent for all platforms
1330 # Configure auto-indent for all platforms
1331 self.set_autoindent(self.rc.autoindent)
1331 self.set_autoindent(self.rc.autoindent)
1332
1332
1333 def ask_yes_no(self,prompt,default=True):
1333 def ask_yes_no(self,prompt,default=True):
1334 if self.rc.quiet:
1334 if self.rc.quiet:
1335 return True
1335 return True
1336 return ask_yes_no(prompt,default)
1336 return ask_yes_no(prompt,default)
1337
1337
1338 def _should_recompile(self,e):
1338 def _should_recompile(self,e):
1339 """Utility routine for edit_syntax_error"""
1339 """Utility routine for edit_syntax_error"""
1340
1340
1341 if e.filename in ('<ipython console>','<input>','<string>',
1341 if e.filename in ('<ipython console>','<input>','<string>',
1342 '<console>','<BackgroundJob compilation>',
1342 '<console>','<BackgroundJob compilation>',
1343 None):
1343 None):
1344
1344
1345 return False
1345 return False
1346 try:
1346 try:
1347 if (self.rc.autoedit_syntax and
1347 if (self.rc.autoedit_syntax and
1348 not self.ask_yes_no('Return to editor to correct syntax error? '
1348 not self.ask_yes_no('Return to editor to correct syntax error? '
1349 '[Y/n] ','y')):
1349 '[Y/n] ','y')):
1350 return False
1350 return False
1351 except EOFError:
1351 except EOFError:
1352 return False
1352 return False
1353
1353
1354 def int0(x):
1354 def int0(x):
1355 try:
1355 try:
1356 return int(x)
1356 return int(x)
1357 except TypeError:
1357 except TypeError:
1358 return 0
1358 return 0
1359 # always pass integer line and offset values to editor hook
1359 # always pass integer line and offset values to editor hook
1360 self.hooks.fix_error_editor(e.filename,
1360 self.hooks.fix_error_editor(e.filename,
1361 int0(e.lineno),int0(e.offset),e.msg)
1361 int0(e.lineno),int0(e.offset),e.msg)
1362 return True
1362 return True
1363
1363
1364 def edit_syntax_error(self):
1364 def edit_syntax_error(self):
1365 """The bottom half of the syntax error handler called in the main loop.
1365 """The bottom half of the syntax error handler called in the main loop.
1366
1366
1367 Loop until syntax error is fixed or user cancels.
1367 Loop until syntax error is fixed or user cancels.
1368 """
1368 """
1369
1369
1370 while self.SyntaxTB.last_syntax_error:
1370 while self.SyntaxTB.last_syntax_error:
1371 # copy and clear last_syntax_error
1371 # copy and clear last_syntax_error
1372 err = self.SyntaxTB.clear_err_state()
1372 err = self.SyntaxTB.clear_err_state()
1373 if not self._should_recompile(err):
1373 if not self._should_recompile(err):
1374 return
1374 return
1375 try:
1375 try:
1376 # may set last_syntax_error again if a SyntaxError is raised
1376 # may set last_syntax_error again if a SyntaxError is raised
1377 self.safe_execfile(err.filename,self.user_ns)
1377 self.safe_execfile(err.filename,self.user_ns)
1378 except:
1378 except:
1379 self.showtraceback()
1379 self.showtraceback()
1380 else:
1380 else:
1381 try:
1381 try:
1382 f = file(err.filename)
1382 f = file(err.filename)
1383 try:
1383 try:
1384 sys.displayhook(f.read())
1384 sys.displayhook(f.read())
1385 finally:
1385 finally:
1386 f.close()
1386 f.close()
1387 except:
1387 except:
1388 self.showtraceback()
1388 self.showtraceback()
1389
1389
1390 def showsyntaxerror(self, filename=None):
1390 def showsyntaxerror(self, filename=None):
1391 """Display the syntax error that just occurred.
1391 """Display the syntax error that just occurred.
1392
1392
1393 This doesn't display a stack trace because there isn't one.
1393 This doesn't display a stack trace because there isn't one.
1394
1394
1395 If a filename is given, it is stuffed in the exception instead
1395 If a filename is given, it is stuffed in the exception instead
1396 of what was there before (because Python's parser always uses
1396 of what was there before (because Python's parser always uses
1397 "<string>" when reading from a string).
1397 "<string>" when reading from a string).
1398 """
1398 """
1399 etype, value, last_traceback = sys.exc_info()
1399 etype, value, last_traceback = sys.exc_info()
1400
1400
1401 # See note about these variables in showtraceback() below
1401 # See note about these variables in showtraceback() below
1402 sys.last_type = etype
1402 sys.last_type = etype
1403 sys.last_value = value
1403 sys.last_value = value
1404 sys.last_traceback = last_traceback
1404 sys.last_traceback = last_traceback
1405
1405
1406 if filename and etype is SyntaxError:
1406 if filename and etype is SyntaxError:
1407 # Work hard to stuff the correct filename in the exception
1407 # Work hard to stuff the correct filename in the exception
1408 try:
1408 try:
1409 msg, (dummy_filename, lineno, offset, line) = value
1409 msg, (dummy_filename, lineno, offset, line) = value
1410 except:
1410 except:
1411 # Not the format we expect; leave it alone
1411 # Not the format we expect; leave it alone
1412 pass
1412 pass
1413 else:
1413 else:
1414 # Stuff in the right filename
1414 # Stuff in the right filename
1415 try:
1415 try:
1416 # Assume SyntaxError is a class exception
1416 # Assume SyntaxError is a class exception
1417 value = SyntaxError(msg, (filename, lineno, offset, line))
1417 value = SyntaxError(msg, (filename, lineno, offset, line))
1418 except:
1418 except:
1419 # If that failed, assume SyntaxError is a string
1419 # If that failed, assume SyntaxError is a string
1420 value = msg, (filename, lineno, offset, line)
1420 value = msg, (filename, lineno, offset, line)
1421 self.SyntaxTB(etype,value,[])
1421 self.SyntaxTB(etype,value,[])
1422
1422
1423 def debugger(self,force=False):
1423 def debugger(self,force=False):
1424 """Call the pydb/pdb debugger.
1424 """Call the pydb/pdb debugger.
1425
1425
1426 Keywords:
1426 Keywords:
1427
1427
1428 - force(False): by default, this routine checks the instance call_pdb
1428 - force(False): by default, this routine checks the instance call_pdb
1429 flag and does not actually invoke the debugger if the flag is false.
1429 flag and does not actually invoke the debugger if the flag is false.
1430 The 'force' option forces the debugger to activate even if the flag
1430 The 'force' option forces the debugger to activate even if the flag
1431 is false.
1431 is false.
1432 """
1432 """
1433
1433
1434 if not (force or self.call_pdb):
1434 if not (force or self.call_pdb):
1435 return
1435 return
1436
1436
1437 if not hasattr(sys,'last_traceback'):
1437 if not hasattr(sys,'last_traceback'):
1438 error('No traceback has been produced, nothing to debug.')
1438 error('No traceback has been produced, nothing to debug.')
1439 return
1439 return
1440
1440
1441 have_pydb = False
1441 have_pydb = False
1442 # use pydb if available
1442 # use pydb if available
1443 try:
1443 try:
1444 from pydb import pm
1444 from pydb import pm
1445 have_pydb = True
1445 have_pydb = True
1446 except ImportError:
1446 except ImportError:
1447 pass
1447 pass
1448 if not have_pydb:
1448 if not have_pydb:
1449 # fallback to our internal debugger
1449 # fallback to our internal debugger
1450 pm = lambda : self.InteractiveTB.debugger(force=True)
1450 pm = lambda : self.InteractiveTB.debugger(force=True)
1451 self.history_saving_wrapper(pm)()
1451 self.history_saving_wrapper(pm)()
1452
1452
1453 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1453 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1454 """Display the exception that just occurred.
1454 """Display the exception that just occurred.
1455
1455
1456 If nothing is known about the exception, this is the method which
1456 If nothing is known about the exception, this is the method which
1457 should be used throughout the code for presenting user tracebacks,
1457 should be used throughout the code for presenting user tracebacks,
1458 rather than directly invoking the InteractiveTB object.
1458 rather than directly invoking the InteractiveTB object.
1459
1459
1460 A specific showsyntaxerror() also exists, but this method can take
1460 A specific showsyntaxerror() also exists, but this method can take
1461 care of calling it if needed, so unless you are explicitly catching a
1461 care of calling it if needed, so unless you are explicitly catching a
1462 SyntaxError exception, don't try to analyze the stack manually and
1462 SyntaxError exception, don't try to analyze the stack manually and
1463 simply call this method."""
1463 simply call this method."""
1464
1464
1465 # Though this won't be called by syntax errors in the input line,
1465 # Though this won't be called by syntax errors in the input line,
1466 # there may be SyntaxError cases whith imported code.
1466 # there may be SyntaxError cases whith imported code.
1467 if exc_tuple is None:
1467 if exc_tuple is None:
1468 etype, value, tb = sys.exc_info()
1468 etype, value, tb = sys.exc_info()
1469 else:
1469 else:
1470 etype, value, tb = exc_tuple
1470 etype, value, tb = exc_tuple
1471
1471
1472 if etype is SyntaxError:
1472 if etype is SyntaxError:
1473 self.showsyntaxerror(filename)
1473 self.showsyntaxerror(filename)
1474 else:
1474 else:
1475 # WARNING: these variables are somewhat deprecated and not
1475 # WARNING: these variables are somewhat deprecated and not
1476 # necessarily safe to use in a threaded environment, but tools
1476 # necessarily safe to use in a threaded environment, but tools
1477 # like pdb depend on their existence, so let's set them. If we
1477 # like pdb depend on their existence, so let's set them. If we
1478 # find problems in the field, we'll need to revisit their use.
1478 # find problems in the field, we'll need to revisit their use.
1479 sys.last_type = etype
1479 sys.last_type = etype
1480 sys.last_value = value
1480 sys.last_value = value
1481 sys.last_traceback = tb
1481 sys.last_traceback = tb
1482
1482
1483 if etype in self.custom_exceptions:
1483 if etype in self.custom_exceptions:
1484 self.CustomTB(etype,value,tb)
1484 self.CustomTB(etype,value,tb)
1485 else:
1485 else:
1486 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1486 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1487 if self.InteractiveTB.call_pdb and self.has_readline:
1487 if self.InteractiveTB.call_pdb and self.has_readline:
1488 # pdb mucks up readline, fix it back
1488 # pdb mucks up readline, fix it back
1489 self.readline.set_completer(self.Completer.complete)
1489 self.readline.set_completer(self.Completer.complete)
1490
1490
1491 def mainloop(self,banner=None):
1491 def mainloop(self,banner=None):
1492 """Creates the local namespace and starts the mainloop.
1492 """Creates the local namespace and starts the mainloop.
1493
1493
1494 If an optional banner argument is given, it will override the
1494 If an optional banner argument is given, it will override the
1495 internally created default banner."""
1495 internally created default banner."""
1496
1496
1497 if self.rc.c: # Emulate Python's -c option
1497 if self.rc.c: # Emulate Python's -c option
1498 self.exec_init_cmd()
1498 self.exec_init_cmd()
1499 if banner is None:
1499 if banner is None:
1500 if not self.rc.banner:
1500 if not self.rc.banner:
1501 banner = ''
1501 banner = ''
1502 # banner is string? Use it directly!
1502 # banner is string? Use it directly!
1503 elif isinstance(self.rc.banner,basestring):
1503 elif isinstance(self.rc.banner,basestring):
1504 banner = self.rc.banner
1504 banner = self.rc.banner
1505 else:
1505 else:
1506 banner = self.BANNER+self.banner2
1506 banner = self.BANNER+self.banner2
1507
1507
1508 self.interact(banner)
1508 self.interact(banner)
1509
1509
1510 def exec_init_cmd(self):
1510 def exec_init_cmd(self):
1511 """Execute a command given at the command line.
1511 """Execute a command given at the command line.
1512
1512
1513 This emulates Python's -c option."""
1513 This emulates Python's -c option."""
1514
1514
1515 #sys.argv = ['-c']
1515 #sys.argv = ['-c']
1516 self.push(self.rc.c)
1516 self.push(self.rc.c)
1517
1517
1518 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1518 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1519 """Embeds IPython into a running python program.
1519 """Embeds IPython into a running python program.
1520
1520
1521 Input:
1521 Input:
1522
1522
1523 - header: An optional header message can be specified.
1523 - header: An optional header message can be specified.
1524
1524
1525 - local_ns, global_ns: working namespaces. If given as None, the
1525 - local_ns, global_ns: working namespaces. If given as None, the
1526 IPython-initialized one is updated with __main__.__dict__, so that
1526 IPython-initialized one is updated with __main__.__dict__, so that
1527 program variables become visible but user-specific configuration
1527 program variables become visible but user-specific configuration
1528 remains possible.
1528 remains possible.
1529
1529
1530 - stack_depth: specifies how many levels in the stack to go to
1530 - stack_depth: specifies how many levels in the stack to go to
1531 looking for namespaces (when local_ns and global_ns are None). This
1531 looking for namespaces (when local_ns and global_ns are None). This
1532 allows an intermediate caller to make sure that this function gets
1532 allows an intermediate caller to make sure that this function gets
1533 the namespace from the intended level in the stack. By default (0)
1533 the namespace from the intended level in the stack. By default (0)
1534 it will get its locals and globals from the immediate caller.
1534 it will get its locals and globals from the immediate caller.
1535
1535
1536 Warning: it's possible to use this in a program which is being run by
1536 Warning: it's possible to use this in a program which is being run by
1537 IPython itself (via %run), but some funny things will happen (a few
1537 IPython itself (via %run), but some funny things will happen (a few
1538 globals get overwritten). In the future this will be cleaned up, as
1538 globals get overwritten). In the future this will be cleaned up, as
1539 there is no fundamental reason why it can't work perfectly."""
1539 there is no fundamental reason why it can't work perfectly."""
1540
1540
1541 # Get locals and globals from caller
1541 # Get locals and globals from caller
1542 if local_ns is None or global_ns is None:
1542 if local_ns is None or global_ns is None:
1543 call_frame = sys._getframe(stack_depth).f_back
1543 call_frame = sys._getframe(stack_depth).f_back
1544
1544
1545 if local_ns is None:
1545 if local_ns is None:
1546 local_ns = call_frame.f_locals
1546 local_ns = call_frame.f_locals
1547 if global_ns is None:
1547 if global_ns is None:
1548 global_ns = call_frame.f_globals
1548 global_ns = call_frame.f_globals
1549
1549
1550 # Update namespaces and fire up interpreter
1550 # Update namespaces and fire up interpreter
1551
1551
1552 # The global one is easy, we can just throw it in
1552 # The global one is easy, we can just throw it in
1553 self.user_global_ns = global_ns
1553 self.user_global_ns = global_ns
1554
1554
1555 # but the user/local one is tricky: ipython needs it to store internal
1555 # but the user/local one is tricky: ipython needs it to store internal
1556 # data, but we also need the locals. We'll copy locals in the user
1556 # data, but we also need the locals. We'll copy locals in the user
1557 # one, but will track what got copied so we can delete them at exit.
1557 # one, but will track what got copied so we can delete them at exit.
1558 # This is so that a later embedded call doesn't see locals from a
1558 # This is so that a later embedded call doesn't see locals from a
1559 # previous call (which most likely existed in a separate scope).
1559 # previous call (which most likely existed in a separate scope).
1560 local_varnames = local_ns.keys()
1560 local_varnames = local_ns.keys()
1561 self.user_ns.update(local_ns)
1561 self.user_ns.update(local_ns)
1562
1562
1563 # Patch for global embedding to make sure that things don't overwrite
1563 # Patch for global embedding to make sure that things don't overwrite
1564 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1564 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1565 # FIXME. Test this a bit more carefully (the if.. is new)
1565 # FIXME. Test this a bit more carefully (the if.. is new)
1566 if local_ns is None and global_ns is None:
1566 if local_ns is None and global_ns is None:
1567 self.user_global_ns.update(__main__.__dict__)
1567 self.user_global_ns.update(__main__.__dict__)
1568
1568
1569 # make sure the tab-completer has the correct frame information, so it
1569 # make sure the tab-completer has the correct frame information, so it
1570 # actually completes using the frame's locals/globals
1570 # actually completes using the frame's locals/globals
1571 self.set_completer_frame()
1571 self.set_completer_frame()
1572
1572
1573 # before activating the interactive mode, we need to make sure that
1573 # before activating the interactive mode, we need to make sure that
1574 # all names in the builtin namespace needed by ipython point to
1574 # all names in the builtin namespace needed by ipython point to
1575 # ourselves, and not to other instances.
1575 # ourselves, and not to other instances.
1576 self.add_builtins()
1576 self.add_builtins()
1577
1577
1578 self.interact(header)
1578 self.interact(header)
1579
1579
1580 # now, purge out the user namespace from anything we might have added
1580 # now, purge out the user namespace from anything we might have added
1581 # from the caller's local namespace
1581 # from the caller's local namespace
1582 delvar = self.user_ns.pop
1582 delvar = self.user_ns.pop
1583 for var in local_varnames:
1583 for var in local_varnames:
1584 delvar(var,None)
1584 delvar(var,None)
1585 # and clean builtins we may have overridden
1585 # and clean builtins we may have overridden
1586 self.clean_builtins()
1586 self.clean_builtins()
1587
1587
1588 def interact(self, banner=None):
1588 def interact(self, banner=None):
1589 """Closely emulate the interactive Python console.
1589 """Closely emulate the interactive Python console.
1590
1590
1591 The optional banner argument specify the banner to print
1591 The optional banner argument specify the banner to print
1592 before the first interaction; by default it prints a banner
1592 before the first interaction; by default it prints a banner
1593 similar to the one printed by the real Python interpreter,
1593 similar to the one printed by the real Python interpreter,
1594 followed by the current class name in parentheses (so as not
1594 followed by the current class name in parentheses (so as not
1595 to confuse this with the real interpreter -- since it's so
1595 to confuse this with the real interpreter -- since it's so
1596 close!).
1596 close!).
1597
1597
1598 """
1598 """
1599
1599
1600 if self.exit_now:
1600 if self.exit_now:
1601 # batch run -> do not interact
1601 # batch run -> do not interact
1602 return
1602 return
1603 cprt = 'Type "copyright", "credits" or "license" for more information.'
1603 cprt = 'Type "copyright", "credits" or "license" for more information.'
1604 if banner is None:
1604 if banner is None:
1605 self.write("Python %s on %s\n%s\n(%s)\n" %
1605 self.write("Python %s on %s\n%s\n(%s)\n" %
1606 (sys.version, sys.platform, cprt,
1606 (sys.version, sys.platform, cprt,
1607 self.__class__.__name__))
1607 self.__class__.__name__))
1608 else:
1608 else:
1609 self.write(banner)
1609 self.write(banner)
1610
1610
1611 more = 0
1611 more = 0
1612
1612
1613 # Mark activity in the builtins
1613 # Mark activity in the builtins
1614 __builtin__.__dict__['__IPYTHON__active'] += 1
1614 __builtin__.__dict__['__IPYTHON__active'] += 1
1615
1615
1616 # exit_now is set by a call to %Exit or %Quit
1616 # exit_now is set by a call to %Exit or %Quit
1617 while not self.exit_now:
1617 while not self.exit_now:
1618 if more:
1618 if more:
1619 prompt = self.hooks.generate_prompt(True)
1619 prompt = self.hooks.generate_prompt(True)
1620 if self.autoindent:
1620 if self.autoindent:
1621 self.readline_startup_hook(self.pre_readline)
1621 self.readline_startup_hook(self.pre_readline)
1622 else:
1622 else:
1623 prompt = self.hooks.generate_prompt(False)
1623 prompt = self.hooks.generate_prompt(False)
1624 try:
1624 try:
1625 line = self.raw_input(prompt,more)
1625 line = self.raw_input(prompt,more)
1626 if self.exit_now:
1626 if self.exit_now:
1627 # quick exit on sys.std[in|out] close
1627 # quick exit on sys.std[in|out] close
1628 break
1628 break
1629 if self.autoindent:
1629 if self.autoindent:
1630 self.readline_startup_hook(None)
1630 self.readline_startup_hook(None)
1631 except KeyboardInterrupt:
1631 except KeyboardInterrupt:
1632 self.write('\nKeyboardInterrupt\n')
1632 self.write('\nKeyboardInterrupt\n')
1633 self.resetbuffer()
1633 self.resetbuffer()
1634 # keep cache in sync with the prompt counter:
1634 # keep cache in sync with the prompt counter:
1635 self.outputcache.prompt_count -= 1
1635 self.outputcache.prompt_count -= 1
1636
1636
1637 if self.autoindent:
1637 if self.autoindent:
1638 self.indent_current_nsp = 0
1638 self.indent_current_nsp = 0
1639 more = 0
1639 more = 0
1640 except EOFError:
1640 except EOFError:
1641 if self.autoindent:
1641 if self.autoindent:
1642 self.readline_startup_hook(None)
1642 self.readline_startup_hook(None)
1643 self.write('\n')
1643 self.write('\n')
1644 self.exit()
1644 self.exit()
1645 except bdb.BdbQuit:
1645 except bdb.BdbQuit:
1646 warn('The Python debugger has exited with a BdbQuit exception.\n'
1646 warn('The Python debugger has exited with a BdbQuit exception.\n'
1647 'Because of how pdb handles the stack, it is impossible\n'
1647 'Because of how pdb handles the stack, it is impossible\n'
1648 'for IPython to properly format this particular exception.\n'
1648 'for IPython to properly format this particular exception.\n'
1649 'IPython will resume normal operation.')
1649 'IPython will resume normal operation.')
1650 except:
1650 except:
1651 # exceptions here are VERY RARE, but they can be triggered
1651 # exceptions here are VERY RARE, but they can be triggered
1652 # asynchronously by signal handlers, for example.
1652 # asynchronously by signal handlers, for example.
1653 self.showtraceback()
1653 self.showtraceback()
1654 else:
1654 else:
1655 more = self.push(line)
1655 more = self.push(line)
1656 if (self.SyntaxTB.last_syntax_error and
1656 if (self.SyntaxTB.last_syntax_error and
1657 self.rc.autoedit_syntax):
1657 self.rc.autoedit_syntax):
1658 self.edit_syntax_error()
1658 self.edit_syntax_error()
1659
1659
1660 # We are off again...
1660 # We are off again...
1661 __builtin__.__dict__['__IPYTHON__active'] -= 1
1661 __builtin__.__dict__['__IPYTHON__active'] -= 1
1662
1662
1663 def excepthook(self, etype, value, tb):
1663 def excepthook(self, etype, value, tb):
1664 """One more defense for GUI apps that call sys.excepthook.
1664 """One more defense for GUI apps that call sys.excepthook.
1665
1665
1666 GUI frameworks like wxPython trap exceptions and call
1666 GUI frameworks like wxPython trap exceptions and call
1667 sys.excepthook themselves. I guess this is a feature that
1667 sys.excepthook themselves. I guess this is a feature that
1668 enables them to keep running after exceptions that would
1668 enables them to keep running after exceptions that would
1669 otherwise kill their mainloop. This is a bother for IPython
1669 otherwise kill their mainloop. This is a bother for IPython
1670 which excepts to catch all of the program exceptions with a try:
1670 which excepts to catch all of the program exceptions with a try:
1671 except: statement.
1671 except: statement.
1672
1672
1673 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1673 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1674 any app directly invokes sys.excepthook, it will look to the user like
1674 any app directly invokes sys.excepthook, it will look to the user like
1675 IPython crashed. In order to work around this, we can disable the
1675 IPython crashed. In order to work around this, we can disable the
1676 CrashHandler and replace it with this excepthook instead, which prints a
1676 CrashHandler and replace it with this excepthook instead, which prints a
1677 regular traceback using our InteractiveTB. In this fashion, apps which
1677 regular traceback using our InteractiveTB. In this fashion, apps which
1678 call sys.excepthook will generate a regular-looking exception from
1678 call sys.excepthook will generate a regular-looking exception from
1679 IPython, and the CrashHandler will only be triggered by real IPython
1679 IPython, and the CrashHandler will only be triggered by real IPython
1680 crashes.
1680 crashes.
1681
1681
1682 This hook should be used sparingly, only in places which are not likely
1682 This hook should be used sparingly, only in places which are not likely
1683 to be true IPython errors.
1683 to be true IPython errors.
1684 """
1684 """
1685 self.showtraceback((etype,value,tb),tb_offset=0)
1685 self.showtraceback((etype,value,tb),tb_offset=0)
1686
1686
1687 def expand_aliases(self,fn,rest):
1687 def expand_aliases(self,fn,rest):
1688 """ Expand multiple levels of aliases:
1688 """ Expand multiple levels of aliases:
1689
1689
1690 if:
1690 if:
1691
1691
1692 alias foo bar /tmp
1692 alias foo bar /tmp
1693 alias baz foo
1693 alias baz foo
1694
1694
1695 then:
1695 then:
1696
1696
1697 baz huhhahhei -> bar /tmp huhhahhei
1697 baz huhhahhei -> bar /tmp huhhahhei
1698
1698
1699 """
1699 """
1700 line = fn + " " + rest
1700 line = fn + " " + rest
1701
1701
1702 done = Set()
1702 done = Set()
1703 while 1:
1703 while 1:
1704 pre,fn,rest = self.split_user_input(line)
1704 pre,fn,rest = self.split_user_input(line)
1705 if fn in self.alias_table:
1705 if fn in self.alias_table:
1706 if fn in done:
1706 if fn in done:
1707 warn("Cyclic alias definition, repeated '%s'" % fn)
1707 warn("Cyclic alias definition, repeated '%s'" % fn)
1708 return ""
1708 return ""
1709 done.add(fn)
1709 done.add(fn)
1710
1710
1711 l2 = self.transform_alias(fn,rest)
1711 l2 = self.transform_alias(fn,rest)
1712 # dir -> dir
1712 # dir -> dir
1713 # print "alias",line, "->",l2 #dbg
1713 # print "alias",line, "->",l2 #dbg
1714 if l2 == line:
1714 if l2 == line:
1715 break
1715 break
1716 # ls -> ls -F should not recurse forever
1716 # ls -> ls -F should not recurse forever
1717 if l2.split(None,1)[0] == line.split(None,1)[0]:
1717 if l2.split(None,1)[0] == line.split(None,1)[0]:
1718 line = l2
1718 line = l2
1719 break
1719 break
1720
1720
1721 line=l2
1721 line=l2
1722
1722
1723
1723
1724 # print "al expand to",line #dbg
1724 # print "al expand to",line #dbg
1725 else:
1725 else:
1726 break
1726 break
1727
1727
1728 return line
1728 return line
1729
1729
1730 def transform_alias(self, alias,rest=''):
1730 def transform_alias(self, alias,rest=''):
1731 """ Transform alias to system command string.
1731 """ Transform alias to system command string.
1732 """
1732 """
1733 nargs,cmd = self.alias_table[alias]
1733 nargs,cmd = self.alias_table[alias]
1734 if ' ' in cmd and os.path.isfile(cmd):
1734 if ' ' in cmd and os.path.isfile(cmd):
1735 cmd = '"%s"' % cmd
1735 cmd = '"%s"' % cmd
1736
1736
1737 # Expand the %l special to be the user's input line
1737 # Expand the %l special to be the user's input line
1738 if cmd.find('%l') >= 0:
1738 if cmd.find('%l') >= 0:
1739 cmd = cmd.replace('%l',rest)
1739 cmd = cmd.replace('%l',rest)
1740 rest = ''
1740 rest = ''
1741 if nargs==0:
1741 if nargs==0:
1742 # Simple, argument-less aliases
1742 # Simple, argument-less aliases
1743 cmd = '%s %s' % (cmd,rest)
1743 cmd = '%s %s' % (cmd,rest)
1744 else:
1744 else:
1745 # Handle aliases with positional arguments
1745 # Handle aliases with positional arguments
1746 args = rest.split(None,nargs)
1746 args = rest.split(None,nargs)
1747 if len(args)< nargs:
1747 if len(args)< nargs:
1748 error('Alias <%s> requires %s arguments, %s given.' %
1748 error('Alias <%s> requires %s arguments, %s given.' %
1749 (alias,nargs,len(args)))
1749 (alias,nargs,len(args)))
1750 return None
1750 return None
1751 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1751 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1752 # Now call the macro, evaluating in the user's namespace
1752 # Now call the macro, evaluating in the user's namespace
1753 #print 'new command: <%r>' % cmd # dbg
1753 #print 'new command: <%r>' % cmd # dbg
1754 return cmd
1754 return cmd
1755
1755
1756 def call_alias(self,alias,rest=''):
1756 def call_alias(self,alias,rest=''):
1757 """Call an alias given its name and the rest of the line.
1757 """Call an alias given its name and the rest of the line.
1758
1758
1759 This is only used to provide backwards compatibility for users of
1759 This is only used to provide backwards compatibility for users of
1760 ipalias(), use of which is not recommended for anymore."""
1760 ipalias(), use of which is not recommended for anymore."""
1761
1761
1762 # Now call the macro, evaluating in the user's namespace
1762 # Now call the macro, evaluating in the user's namespace
1763 cmd = self.transform_alias(alias, rest)
1763 cmd = self.transform_alias(alias, rest)
1764 try:
1764 try:
1765 self.system(cmd)
1765 self.system(cmd)
1766 except:
1766 except:
1767 self.showtraceback()
1767 self.showtraceback()
1768
1768
1769 def indent_current_str(self):
1769 def indent_current_str(self):
1770 """return the current level of indentation as a string"""
1770 """return the current level of indentation as a string"""
1771 return self.indent_current_nsp * ' '
1771 return self.indent_current_nsp * ' '
1772
1772
1773 def autoindent_update(self,line):
1773 def autoindent_update(self,line):
1774 """Keep track of the indent level."""
1774 """Keep track of the indent level."""
1775
1775
1776 #debugx('line')
1776 #debugx('line')
1777 #debugx('self.indent_current_nsp')
1777 #debugx('self.indent_current_nsp')
1778 if self.autoindent:
1778 if self.autoindent:
1779 if line:
1779 if line:
1780 inisp = num_ini_spaces(line)
1780 inisp = num_ini_spaces(line)
1781 if inisp < self.indent_current_nsp:
1781 if inisp < self.indent_current_nsp:
1782 self.indent_current_nsp = inisp
1782 self.indent_current_nsp = inisp
1783
1783
1784 if line[-1] == ':':
1784 if line[-1] == ':':
1785 self.indent_current_nsp += 4
1785 self.indent_current_nsp += 4
1786 elif dedent_re.match(line):
1786 elif dedent_re.match(line):
1787 self.indent_current_nsp -= 4
1787 self.indent_current_nsp -= 4
1788 else:
1788 else:
1789 self.indent_current_nsp = 0
1789 self.indent_current_nsp = 0
1790
1790
1791 def runlines(self,lines):
1791 def runlines(self,lines):
1792 """Run a string of one or more lines of source.
1792 """Run a string of one or more lines of source.
1793
1793
1794 This method is capable of running a string containing multiple source
1794 This method is capable of running a string containing multiple source
1795 lines, as if they had been entered at the IPython prompt. Since it
1795 lines, as if they had been entered at the IPython prompt. Since it
1796 exposes IPython's processing machinery, the given strings can contain
1796 exposes IPython's processing machinery, the given strings can contain
1797 magic calls (%magic), special shell access (!cmd), etc."""
1797 magic calls (%magic), special shell access (!cmd), etc."""
1798
1798
1799 # We must start with a clean buffer, in case this is run from an
1799 # We must start with a clean buffer, in case this is run from an
1800 # interactive IPython session (via a magic, for example).
1800 # interactive IPython session (via a magic, for example).
1801 self.resetbuffer()
1801 self.resetbuffer()
1802 lines = lines.split('\n')
1802 lines = lines.split('\n')
1803 more = 0
1803 more = 0
1804 for line in lines:
1804 for line in lines:
1805 # skip blank lines so we don't mess up the prompt counter, but do
1805 # skip blank lines so we don't mess up the prompt counter, but do
1806 # NOT skip even a blank line if we are in a code block (more is
1806 # NOT skip even a blank line if we are in a code block (more is
1807 # true)
1807 # true)
1808 if line or more:
1808 if line or more:
1809 more = self.push(self.prefilter(line,more))
1809 more = self.push(self.prefilter(line,more))
1810 # IPython's runsource returns None if there was an error
1810 # IPython's runsource returns None if there was an error
1811 # compiling the code. This allows us to stop processing right
1811 # compiling the code. This allows us to stop processing right
1812 # away, so the user gets the error message at the right place.
1812 # away, so the user gets the error message at the right place.
1813 if more is None:
1813 if more is None:
1814 break
1814 break
1815 # final newline in case the input didn't have it, so that the code
1815 # final newline in case the input didn't have it, so that the code
1816 # actually does get executed
1816 # actually does get executed
1817 if more:
1817 if more:
1818 self.push('\n')
1818 self.push('\n')
1819
1819
1820 def runsource(self, source, filename='<input>', symbol='single'):
1820 def runsource(self, source, filename='<input>', symbol='single'):
1821 """Compile and run some source in the interpreter.
1821 """Compile and run some source in the interpreter.
1822
1822
1823 Arguments are as for compile_command().
1823 Arguments are as for compile_command().
1824
1824
1825 One several things can happen:
1825 One several things can happen:
1826
1826
1827 1) The input is incorrect; compile_command() raised an
1827 1) The input is incorrect; compile_command() raised an
1828 exception (SyntaxError or OverflowError). A syntax traceback
1828 exception (SyntaxError or OverflowError). A syntax traceback
1829 will be printed by calling the showsyntaxerror() method.
1829 will be printed by calling the showsyntaxerror() method.
1830
1830
1831 2) The input is incomplete, and more input is required;
1831 2) The input is incomplete, and more input is required;
1832 compile_command() returned None. Nothing happens.
1832 compile_command() returned None. Nothing happens.
1833
1833
1834 3) The input is complete; compile_command() returned a code
1834 3) The input is complete; compile_command() returned a code
1835 object. The code is executed by calling self.runcode() (which
1835 object. The code is executed by calling self.runcode() (which
1836 also handles run-time exceptions, except for SystemExit).
1836 also handles run-time exceptions, except for SystemExit).
1837
1837
1838 The return value is:
1838 The return value is:
1839
1839
1840 - True in case 2
1840 - True in case 2
1841
1841
1842 - False in the other cases, unless an exception is raised, where
1842 - False in the other cases, unless an exception is raised, where
1843 None is returned instead. This can be used by external callers to
1843 None is returned instead. This can be used by external callers to
1844 know whether to continue feeding input or not.
1844 know whether to continue feeding input or not.
1845
1845
1846 The return value can be used to decide whether to use sys.ps1 or
1846 The return value can be used to decide whether to use sys.ps1 or
1847 sys.ps2 to prompt the next line."""
1847 sys.ps2 to prompt the next line."""
1848
1848
1849 # if the source code has leading blanks, add 'if 1:\n' to it
1849 # if the source code has leading blanks, add 'if 1:\n' to it
1850 # this allows execution of indented pasted code. It is tempting
1850 # this allows execution of indented pasted code. It is tempting
1851 # to add '\n' at the end of source to run commands like ' a=1'
1851 # to add '\n' at the end of source to run commands like ' a=1'
1852 # directly, but this fails for more complicated scenarios
1852 # directly, but this fails for more complicated scenarios
1853 if source[:1] in [' ', '\t']:
1853 if source[:1] in [' ', '\t']:
1854 source = 'if 1:\n%s' % source
1854 source = 'if 1:\n%s' % source
1855
1855
1856 try:
1856 try:
1857 code = self.compile(source,filename,symbol)
1857 code = self.compile(source,filename,symbol)
1858 except (OverflowError, SyntaxError, ValueError):
1858 except (OverflowError, SyntaxError, ValueError):
1859 # Case 1
1859 # Case 1
1860 self.showsyntaxerror(filename)
1860 self.showsyntaxerror(filename)
1861 return None
1861 return None
1862
1862
1863 if code is None:
1863 if code is None:
1864 # Case 2
1864 # Case 2
1865 return True
1865 return True
1866
1866
1867 # Case 3
1867 # Case 3
1868 # We store the code object so that threaded shells and
1868 # We store the code object so that threaded shells and
1869 # custom exception handlers can access all this info if needed.
1869 # custom exception handlers can access all this info if needed.
1870 # The source corresponding to this can be obtained from the
1870 # The source corresponding to this can be obtained from the
1871 # buffer attribute as '\n'.join(self.buffer).
1871 # buffer attribute as '\n'.join(self.buffer).
1872 self.code_to_run = code
1872 self.code_to_run = code
1873 # now actually execute the code object
1873 # now actually execute the code object
1874 if self.runcode(code) == 0:
1874 if self.runcode(code) == 0:
1875 return False
1875 return False
1876 else:
1876 else:
1877 return None
1877 return None
1878
1878
1879 def runcode(self,code_obj):
1879 def runcode(self,code_obj):
1880 """Execute a code object.
1880 """Execute a code object.
1881
1881
1882 When an exception occurs, self.showtraceback() is called to display a
1882 When an exception occurs, self.showtraceback() is called to display a
1883 traceback.
1883 traceback.
1884
1884
1885 Return value: a flag indicating whether the code to be run completed
1885 Return value: a flag indicating whether the code to be run completed
1886 successfully:
1886 successfully:
1887
1887
1888 - 0: successful execution.
1888 - 0: successful execution.
1889 - 1: an error occurred.
1889 - 1: an error occurred.
1890 """
1890 """
1891
1891
1892 # Set our own excepthook in case the user code tries to call it
1892 # Set our own excepthook in case the user code tries to call it
1893 # directly, so that the IPython crash handler doesn't get triggered
1893 # directly, so that the IPython crash handler doesn't get triggered
1894 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1894 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1895
1895
1896 # we save the original sys.excepthook in the instance, in case config
1896 # we save the original sys.excepthook in the instance, in case config
1897 # code (such as magics) needs access to it.
1897 # code (such as magics) needs access to it.
1898 self.sys_excepthook = old_excepthook
1898 self.sys_excepthook = old_excepthook
1899 outflag = 1 # happens in more places, so it's easier as default
1899 outflag = 1 # happens in more places, so it's easier as default
1900 try:
1900 try:
1901 try:
1901 try:
1902 # Embedded instances require separate global/local namespaces
1902 # Embedded instances require separate global/local namespaces
1903 # so they can see both the surrounding (local) namespace and
1903 # so they can see both the surrounding (local) namespace and
1904 # the module-level globals when called inside another function.
1904 # the module-level globals when called inside another function.
1905 if self.embedded:
1905 if self.embedded:
1906 exec code_obj in self.user_global_ns, self.user_ns
1906 exec code_obj in self.user_global_ns, self.user_ns
1907 # Normal (non-embedded) instances should only have a single
1907 # Normal (non-embedded) instances should only have a single
1908 # namespace for user code execution, otherwise functions won't
1908 # namespace for user code execution, otherwise functions won't
1909 # see interactive top-level globals.
1909 # see interactive top-level globals.
1910 else:
1910 else:
1911 exec code_obj in self.user_ns
1911 exec code_obj in self.user_ns
1912 finally:
1912 finally:
1913 # Reset our crash handler in place
1913 # Reset our crash handler in place
1914 sys.excepthook = old_excepthook
1914 sys.excepthook = old_excepthook
1915 except SystemExit:
1915 except SystemExit:
1916 self.resetbuffer()
1916 self.resetbuffer()
1917 self.showtraceback()
1917 self.showtraceback()
1918 warn("Type %exit or %quit to exit IPython "
1918 warn("Type %exit or %quit to exit IPython "
1919 "(%Exit or %Quit do so unconditionally).",level=1)
1919 "(%Exit or %Quit do so unconditionally).",level=1)
1920 except self.custom_exceptions:
1920 except self.custom_exceptions:
1921 etype,value,tb = sys.exc_info()
1921 etype,value,tb = sys.exc_info()
1922 self.CustomTB(etype,value,tb)
1922 self.CustomTB(etype,value,tb)
1923 except:
1923 except:
1924 self.showtraceback()
1924 self.showtraceback()
1925 else:
1925 else:
1926 outflag = 0
1926 outflag = 0
1927 if softspace(sys.stdout, 0):
1927 if softspace(sys.stdout, 0):
1928 print
1928 print
1929 # Flush out code object which has been run (and source)
1929 # Flush out code object which has been run (and source)
1930 self.code_to_run = None
1930 self.code_to_run = None
1931 return outflag
1931 return outflag
1932
1932
1933 def push(self, line):
1933 def push(self, line):
1934 """Push a line to the interpreter.
1934 """Push a line to the interpreter.
1935
1935
1936 The line should not have a trailing newline; it may have
1936 The line should not have a trailing newline; it may have
1937 internal newlines. The line is appended to a buffer and the
1937 internal newlines. The line is appended to a buffer and the
1938 interpreter's runsource() method is called with the
1938 interpreter's runsource() method is called with the
1939 concatenated contents of the buffer as source. If this
1939 concatenated contents of the buffer as source. If this
1940 indicates that the command was executed or invalid, the buffer
1940 indicates that the command was executed or invalid, the buffer
1941 is reset; otherwise, the command is incomplete, and the buffer
1941 is reset; otherwise, the command is incomplete, and the buffer
1942 is left as it was after the line was appended. The return
1942 is left as it was after the line was appended. The return
1943 value is 1 if more input is required, 0 if the line was dealt
1943 value is 1 if more input is required, 0 if the line was dealt
1944 with in some way (this is the same as runsource()).
1944 with in some way (this is the same as runsource()).
1945 """
1945 """
1946
1946
1947 # autoindent management should be done here, and not in the
1947 # autoindent management should be done here, and not in the
1948 # interactive loop, since that one is only seen by keyboard input. We
1948 # interactive loop, since that one is only seen by keyboard input. We
1949 # need this done correctly even for code run via runlines (which uses
1949 # need this done correctly even for code run via runlines (which uses
1950 # push).
1950 # push).
1951
1951
1952 #print 'push line: <%s>' % line # dbg
1952 #print 'push line: <%s>' % line # dbg
1953 for subline in line.splitlines():
1953 for subline in line.splitlines():
1954 self.autoindent_update(subline)
1954 self.autoindent_update(subline)
1955 self.buffer.append(line)
1955 self.buffer.append(line)
1956 more = self.runsource('\n'.join(self.buffer), self.filename)
1956 more = self.runsource('\n'.join(self.buffer), self.filename)
1957 if not more:
1957 if not more:
1958 self.resetbuffer()
1958 self.resetbuffer()
1959 return more
1959 return more
1960
1960
1961 def resetbuffer(self):
1961 def resetbuffer(self):
1962 """Reset the input buffer."""
1962 """Reset the input buffer."""
1963 self.buffer[:] = []
1963 self.buffer[:] = []
1964
1964
1965 def raw_input(self,prompt='',continue_prompt=False):
1965 def raw_input(self,prompt='',continue_prompt=False):
1966 """Write a prompt and read a line.
1966 """Write a prompt and read a line.
1967
1967
1968 The returned line does not include the trailing newline.
1968 The returned line does not include the trailing newline.
1969 When the user enters the EOF key sequence, EOFError is raised.
1969 When the user enters the EOF key sequence, EOFError is raised.
1970
1970
1971 Optional inputs:
1971 Optional inputs:
1972
1972
1973 - prompt(''): a string to be printed to prompt the user.
1973 - prompt(''): a string to be printed to prompt the user.
1974
1974
1975 - continue_prompt(False): whether this line is the first one or a
1975 - continue_prompt(False): whether this line is the first one or a
1976 continuation in a sequence of inputs.
1976 continuation in a sequence of inputs.
1977 """
1977 """
1978
1978
1979 try:
1979 try:
1980 line = raw_input_original(prompt)
1980 line = raw_input_original(prompt).decode(sys.stdin.encoding)
1981 except ValueError:
1981 except ValueError:
1982 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1982 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1983 self.exit_now = True
1983 self.exit_now = True
1984 return ""
1984 return ""
1985
1985
1986
1986
1987 # Try to be reasonably smart about not re-indenting pasted input more
1987 # Try to be reasonably smart about not re-indenting pasted input more
1988 # than necessary. We do this by trimming out the auto-indent initial
1988 # than necessary. We do this by trimming out the auto-indent initial
1989 # spaces, if the user's actual input started itself with whitespace.
1989 # spaces, if the user's actual input started itself with whitespace.
1990 #debugx('self.buffer[-1]')
1990 #debugx('self.buffer[-1]')
1991
1991
1992 if self.autoindent:
1992 if self.autoindent:
1993 if num_ini_spaces(line) > self.indent_current_nsp:
1993 if num_ini_spaces(line) > self.indent_current_nsp:
1994 line = line[self.indent_current_nsp:]
1994 line = line[self.indent_current_nsp:]
1995 self.indent_current_nsp = 0
1995 self.indent_current_nsp = 0
1996
1996
1997 # store the unfiltered input before the user has any chance to modify
1997 # store the unfiltered input before the user has any chance to modify
1998 # it.
1998 # it.
1999 if line.strip():
1999 if line.strip():
2000 if continue_prompt:
2000 if continue_prompt:
2001 self.input_hist_raw[-1] += '%s\n' % line
2001 self.input_hist_raw[-1] += '%s\n' % line
2002 if self.has_readline: # and some config option is set?
2002 if self.has_readline: # and some config option is set?
2003 try:
2003 try:
2004 histlen = self.readline.get_current_history_length()
2004 histlen = self.readline.get_current_history_length()
2005 newhist = self.input_hist_raw[-1].rstrip()
2005 newhist = self.input_hist_raw[-1].rstrip()
2006 self.readline.remove_history_item(histlen-1)
2006 self.readline.remove_history_item(histlen-1)
2007 self.readline.replace_history_item(histlen-2,newhist)
2007 self.readline.replace_history_item(histlen-2,newhist)
2008 except AttributeError:
2008 except AttributeError:
2009 pass # re{move,place}_history_item are new in 2.4.
2009 pass # re{move,place}_history_item are new in 2.4.
2010 else:
2010 else:
2011 self.input_hist_raw.append('%s\n' % line)
2011 self.input_hist_raw.append('%s\n' % line)
2012
2012
2013 try:
2013 try:
2014 lineout = self.prefilter(line,continue_prompt)
2014 lineout = self.prefilter(line,continue_prompt)
2015 except:
2015 except:
2016 # blanket except, in case a user-defined prefilter crashes, so it
2016 # blanket except, in case a user-defined prefilter crashes, so it
2017 # can't take all of ipython with it.
2017 # can't take all of ipython with it.
2018 self.showtraceback()
2018 self.showtraceback()
2019 return ''
2019 return ''
2020 else:
2020 else:
2021 return lineout
2021 return lineout
2022
2022
2023 def split_user_input(self,line):
2023 def split_user_input(self,line):
2024 """Split user input into pre-char, function part and rest."""
2024 """Split user input into pre-char, function part and rest."""
2025
2025
2026 lsplit = self.line_split.match(line)
2026 lsplit = self.line_split.match(line)
2027 if lsplit is None: # no regexp match returns None
2027 if lsplit is None: # no regexp match returns None
2028 #print "match failed for line '%s'" % line # dbg
2028 #print "match failed for line '%s'" % line # dbg
2029 try:
2029 try:
2030 iFun,theRest = line.split(None,1)
2030 iFun,theRest = line.split(None,1)
2031 except ValueError:
2031 except ValueError:
2032 #print "split failed for line '%s'" % line # dbg
2032 #print "split failed for line '%s'" % line # dbg
2033 iFun,theRest = line,''
2033 iFun,theRest = line,''
2034 pre = re.match('^(\s*)(.*)',line).groups()[0]
2034 pre = re.match('^(\s*)(.*)',line).groups()[0]
2035 else:
2035 else:
2036 pre,iFun,theRest = lsplit.groups()
2036 pre,iFun,theRest = lsplit.groups()
2037
2037
2038 #print 'line:<%s>' % line # dbg
2038 #print 'line:<%s>' % line # dbg
2039 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2039 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2040 return pre,iFun.strip(),theRest
2040 return pre,iFun.strip(),theRest
2041
2041
2042 # THIS VERSION IS BROKEN!!! It was intended to prevent spurious attribute
2042 # THIS VERSION IS BROKEN!!! It was intended to prevent spurious attribute
2043 # accesses with a more stringent check of inputs, but it introduced other
2043 # accesses with a more stringent check of inputs, but it introduced other
2044 # bugs. Disable it for now until I can properly fix it.
2044 # bugs. Disable it for now until I can properly fix it.
2045 def split_user_inputBROKEN(self,line):
2045 def split_user_inputBROKEN(self,line):
2046 """Split user input into pre-char, function part and rest."""
2046 """Split user input into pre-char, function part and rest."""
2047
2047
2048 lsplit = self.line_split.match(line)
2048 lsplit = self.line_split.match(line)
2049 if lsplit is None: # no regexp match returns None
2049 if lsplit is None: # no regexp match returns None
2050 lsplit = self.line_split_fallback.match(line)
2050 lsplit = self.line_split_fallback.match(line)
2051
2051
2052 #pre,iFun,theRest = lsplit.groups() # dbg
2052 #pre,iFun,theRest = lsplit.groups() # dbg
2053 #print 'line:<%s>' % line # dbg
2053 #print 'line:<%s>' % line # dbg
2054 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2054 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2055 #return pre,iFun.strip(),theRest # dbg
2055 #return pre,iFun.strip(),theRest # dbg
2056
2056
2057 return lsplit.groups()
2057 return lsplit.groups()
2058
2058
2059 def _prefilter(self, line, continue_prompt):
2059 def _prefilter(self, line, continue_prompt):
2060 """Calls different preprocessors, depending on the form of line."""
2060 """Calls different preprocessors, depending on the form of line."""
2061
2061
2062 # All handlers *must* return a value, even if it's blank ('').
2062 # All handlers *must* return a value, even if it's blank ('').
2063
2063
2064 # Lines are NOT logged here. Handlers should process the line as
2064 # Lines are NOT logged here. Handlers should process the line as
2065 # needed, update the cache AND log it (so that the input cache array
2065 # needed, update the cache AND log it (so that the input cache array
2066 # stays synced).
2066 # stays synced).
2067
2067
2068 # This function is _very_ delicate, and since it's also the one which
2068 # This function is _very_ delicate, and since it's also the one which
2069 # determines IPython's response to user input, it must be as efficient
2069 # determines IPython's response to user input, it must be as efficient
2070 # as possible. For this reason it has _many_ returns in it, trying
2070 # as possible. For this reason it has _many_ returns in it, trying
2071 # always to exit as quickly as it can figure out what it needs to do.
2071 # always to exit as quickly as it can figure out what it needs to do.
2072
2072
2073 # This function is the main responsible for maintaining IPython's
2073 # This function is the main responsible for maintaining IPython's
2074 # behavior respectful of Python's semantics. So be _very_ careful if
2074 # behavior respectful of Python's semantics. So be _very_ careful if
2075 # making changes to anything here.
2075 # making changes to anything here.
2076
2076
2077 #.....................................................................
2077 #.....................................................................
2078 # Code begins
2078 # Code begins
2079
2079
2080 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2080 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2081
2081
2082 # save the line away in case we crash, so the post-mortem handler can
2082 # save the line away in case we crash, so the post-mortem handler can
2083 # record it
2083 # record it
2084 self._last_input_line = line
2084 self._last_input_line = line
2085
2085
2086 #print '***line: <%s>' % line # dbg
2086 #print '***line: <%s>' % line # dbg
2087
2087
2088 # the input history needs to track even empty lines
2088 # the input history needs to track even empty lines
2089 stripped = line.strip()
2089 stripped = line.strip()
2090
2090
2091 if not stripped:
2091 if not stripped:
2092 if not continue_prompt:
2092 if not continue_prompt:
2093 self.outputcache.prompt_count -= 1
2093 self.outputcache.prompt_count -= 1
2094 return self.handle_normal(line,continue_prompt)
2094 return self.handle_normal(line,continue_prompt)
2095 #return self.handle_normal('',continue_prompt)
2095 #return self.handle_normal('',continue_prompt)
2096
2096
2097 # print '***cont',continue_prompt # dbg
2097 # print '***cont',continue_prompt # dbg
2098 # special handlers are only allowed for single line statements
2098 # special handlers are only allowed for single line statements
2099 if continue_prompt and not self.rc.multi_line_specials:
2099 if continue_prompt and not self.rc.multi_line_specials:
2100 return self.handle_normal(line,continue_prompt)
2100 return self.handle_normal(line,continue_prompt)
2101
2101
2102
2102
2103 # For the rest, we need the structure of the input
2103 # For the rest, we need the structure of the input
2104 pre,iFun,theRest = self.split_user_input(line)
2104 pre,iFun,theRest = self.split_user_input(line)
2105
2105
2106 # See whether any pre-existing handler can take care of it
2106 # See whether any pre-existing handler can take care of it
2107
2107
2108 rewritten = self.hooks.input_prefilter(stripped)
2108 rewritten = self.hooks.input_prefilter(stripped)
2109 if rewritten != stripped: # ok, some prefilter did something
2109 if rewritten != stripped: # ok, some prefilter did something
2110 rewritten = pre + rewritten # add indentation
2110 rewritten = pre + rewritten # add indentation
2111 return self.handle_normal(rewritten)
2111 return self.handle_normal(rewritten)
2112
2112
2113 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2113 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2114
2114
2115 # First check for explicit escapes in the last/first character
2115 # First check for explicit escapes in the last/first character
2116 handler = None
2116 handler = None
2117 if line[-1] == self.ESC_HELP:
2117 if line[-1] == self.ESC_HELP:
2118 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2118 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2119 if handler is None:
2119 if handler is None:
2120 # look at the first character of iFun, NOT of line, so we skip
2120 # look at the first character of iFun, NOT of line, so we skip
2121 # leading whitespace in multiline input
2121 # leading whitespace in multiline input
2122 handler = self.esc_handlers.get(iFun[0:1])
2122 handler = self.esc_handlers.get(iFun[0:1])
2123 if handler is not None:
2123 if handler is not None:
2124 return handler(line,continue_prompt,pre,iFun,theRest)
2124 return handler(line,continue_prompt,pre,iFun,theRest)
2125 # Emacs ipython-mode tags certain input lines
2125 # Emacs ipython-mode tags certain input lines
2126 if line.endswith('# PYTHON-MODE'):
2126 if line.endswith('# PYTHON-MODE'):
2127 return self.handle_emacs(line,continue_prompt)
2127 return self.handle_emacs(line,continue_prompt)
2128
2128
2129 # Next, check if we can automatically execute this thing
2129 # Next, check if we can automatically execute this thing
2130
2130
2131 # Allow ! in multi-line statements if multi_line_specials is on:
2131 # Allow ! in multi-line statements if multi_line_specials is on:
2132 if continue_prompt and self.rc.multi_line_specials and \
2132 if continue_prompt and self.rc.multi_line_specials and \
2133 iFun.startswith(self.ESC_SHELL):
2133 iFun.startswith(self.ESC_SHELL):
2134 return self.handle_shell_escape(line,continue_prompt,
2134 return self.handle_shell_escape(line,continue_prompt,
2135 pre=pre,iFun=iFun,
2135 pre=pre,iFun=iFun,
2136 theRest=theRest)
2136 theRest=theRest)
2137
2137
2138 # Let's try to find if the input line is a magic fn
2138 # Let's try to find if the input line is a magic fn
2139 oinfo = None
2139 oinfo = None
2140 if hasattr(self,'magic_'+iFun):
2140 if hasattr(self,'magic_'+iFun):
2141 # WARNING: _ofind uses getattr(), so it can consume generators and
2141 # WARNING: _ofind uses getattr(), so it can consume generators and
2142 # cause other side effects.
2142 # cause other side effects.
2143 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2143 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2144 if oinfo['ismagic']:
2144 if oinfo['ismagic']:
2145 # Be careful not to call magics when a variable assignment is
2145 # Be careful not to call magics when a variable assignment is
2146 # being made (ls='hi', for example)
2146 # being made (ls='hi', for example)
2147 if self.rc.automagic and \
2147 if self.rc.automagic and \
2148 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2148 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2149 (self.rc.multi_line_specials or not continue_prompt):
2149 (self.rc.multi_line_specials or not continue_prompt):
2150 return self.handle_magic(line,continue_prompt,
2150 return self.handle_magic(line,continue_prompt,
2151 pre,iFun,theRest)
2151 pre,iFun,theRest)
2152 else:
2152 else:
2153 return self.handle_normal(line,continue_prompt)
2153 return self.handle_normal(line,continue_prompt)
2154
2154
2155 # If the rest of the line begins with an (in)equality, assginment or
2155 # If the rest of the line begins with an (in)equality, assginment or
2156 # function call, we should not call _ofind but simply execute it.
2156 # function call, we should not call _ofind but simply execute it.
2157 # This avoids spurious geattr() accesses on objects upon assignment.
2157 # This avoids spurious geattr() accesses on objects upon assignment.
2158 #
2158 #
2159 # It also allows users to assign to either alias or magic names true
2159 # It also allows users to assign to either alias or magic names true
2160 # python variables (the magic/alias systems always take second seat to
2160 # python variables (the magic/alias systems always take second seat to
2161 # true python code).
2161 # true python code).
2162 if theRest and theRest[0] in '!=()':
2162 if theRest and theRest[0] in '!=()':
2163 return self.handle_normal(line,continue_prompt)
2163 return self.handle_normal(line,continue_prompt)
2164
2164
2165 if oinfo is None:
2165 if oinfo is None:
2166 # let's try to ensure that _oinfo is ONLY called when autocall is
2166 # let's try to ensure that _oinfo is ONLY called when autocall is
2167 # on. Since it has inevitable potential side effects, at least
2167 # on. Since it has inevitable potential side effects, at least
2168 # having autocall off should be a guarantee to the user that no
2168 # having autocall off should be a guarantee to the user that no
2169 # weird things will happen.
2169 # weird things will happen.
2170
2170
2171 if self.rc.autocall:
2171 if self.rc.autocall:
2172 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2172 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2173 else:
2173 else:
2174 # in this case, all that's left is either an alias or
2174 # in this case, all that's left is either an alias or
2175 # processing the line normally.
2175 # processing the line normally.
2176 if iFun in self.alias_table:
2176 if iFun in self.alias_table:
2177 # if autocall is off, by not running _ofind we won't know
2177 # if autocall is off, by not running _ofind we won't know
2178 # whether the given name may also exist in one of the
2178 # whether the given name may also exist in one of the
2179 # user's namespace. At this point, it's best to do a
2179 # user's namespace. At this point, it's best to do a
2180 # quick check just to be sure that we don't let aliases
2180 # quick check just to be sure that we don't let aliases
2181 # shadow variables.
2181 # shadow variables.
2182 head = iFun.split('.',1)[0]
2182 head = iFun.split('.',1)[0]
2183 if head in self.user_ns or head in self.internal_ns \
2183 if head in self.user_ns or head in self.internal_ns \
2184 or head in __builtin__.__dict__:
2184 or head in __builtin__.__dict__:
2185 return self.handle_normal(line,continue_prompt)
2185 return self.handle_normal(line,continue_prompt)
2186 else:
2186 else:
2187 return self.handle_alias(line,continue_prompt,
2187 return self.handle_alias(line,continue_prompt,
2188 pre,iFun,theRest)
2188 pre,iFun,theRest)
2189
2189
2190 else:
2190 else:
2191 return self.handle_normal(line,continue_prompt)
2191 return self.handle_normal(line,continue_prompt)
2192
2192
2193 if not oinfo['found']:
2193 if not oinfo['found']:
2194 return self.handle_normal(line,continue_prompt)
2194 return self.handle_normal(line,continue_prompt)
2195 else:
2195 else:
2196 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2196 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2197 if oinfo['isalias']:
2197 if oinfo['isalias']:
2198 return self.handle_alias(line,continue_prompt,
2198 return self.handle_alias(line,continue_prompt,
2199 pre,iFun,theRest)
2199 pre,iFun,theRest)
2200
2200
2201 if (self.rc.autocall
2201 if (self.rc.autocall
2202 and
2202 and
2203 (
2203 (
2204 #only consider exclusion re if not "," or ";" autoquoting
2204 #only consider exclusion re if not "," or ";" autoquoting
2205 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2205 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2206 or pre == self.ESC_PAREN) or
2206 or pre == self.ESC_PAREN) or
2207 (not self.re_exclude_auto.match(theRest)))
2207 (not self.re_exclude_auto.match(theRest)))
2208 and
2208 and
2209 self.re_fun_name.match(iFun) and
2209 self.re_fun_name.match(iFun) and
2210 callable(oinfo['obj'])) :
2210 callable(oinfo['obj'])) :
2211 #print 'going auto' # dbg
2211 #print 'going auto' # dbg
2212 return self.handle_auto(line,continue_prompt,
2212 return self.handle_auto(line,continue_prompt,
2213 pre,iFun,theRest,oinfo['obj'])
2213 pre,iFun,theRest,oinfo['obj'])
2214 else:
2214 else:
2215 #print 'was callable?', callable(oinfo['obj']) # dbg
2215 #print 'was callable?', callable(oinfo['obj']) # dbg
2216 return self.handle_normal(line,continue_prompt)
2216 return self.handle_normal(line,continue_prompt)
2217
2217
2218 # If we get here, we have a normal Python line. Log and return.
2218 # If we get here, we have a normal Python line. Log and return.
2219 return self.handle_normal(line,continue_prompt)
2219 return self.handle_normal(line,continue_prompt)
2220
2220
2221 def _prefilter_dumb(self, line, continue_prompt):
2221 def _prefilter_dumb(self, line, continue_prompt):
2222 """simple prefilter function, for debugging"""
2222 """simple prefilter function, for debugging"""
2223 return self.handle_normal(line,continue_prompt)
2223 return self.handle_normal(line,continue_prompt)
2224
2224
2225
2225
2226 def multiline_prefilter(self, line, continue_prompt):
2226 def multiline_prefilter(self, line, continue_prompt):
2227 """ Run _prefilter for each line of input
2227 """ Run _prefilter for each line of input
2228
2228
2229 Covers cases where there are multiple lines in the user entry,
2229 Covers cases where there are multiple lines in the user entry,
2230 which is the case when the user goes back to a multiline history
2230 which is the case when the user goes back to a multiline history
2231 entry and presses enter.
2231 entry and presses enter.
2232
2232
2233 """
2233 """
2234 out = []
2234 out = []
2235 for l in line.rstrip('\n').split('\n'):
2235 for l in line.rstrip('\n').split('\n'):
2236 out.append(self._prefilter(l, continue_prompt))
2236 out.append(self._prefilter(l, continue_prompt))
2237 return '\n'.join(out)
2237 return '\n'.join(out)
2238
2238
2239 # Set the default prefilter() function (this can be user-overridden)
2239 # Set the default prefilter() function (this can be user-overridden)
2240 prefilter = multiline_prefilter
2240 prefilter = multiline_prefilter
2241
2241
2242 def handle_normal(self,line,continue_prompt=None,
2242 def handle_normal(self,line,continue_prompt=None,
2243 pre=None,iFun=None,theRest=None):
2243 pre=None,iFun=None,theRest=None):
2244 """Handle normal input lines. Use as a template for handlers."""
2244 """Handle normal input lines. Use as a template for handlers."""
2245
2245
2246 # With autoindent on, we need some way to exit the input loop, and I
2246 # With autoindent on, we need some way to exit the input loop, and I
2247 # don't want to force the user to have to backspace all the way to
2247 # don't want to force the user to have to backspace all the way to
2248 # clear the line. The rule will be in this case, that either two
2248 # clear the line. The rule will be in this case, that either two
2249 # lines of pure whitespace in a row, or a line of pure whitespace but
2249 # lines of pure whitespace in a row, or a line of pure whitespace but
2250 # of a size different to the indent level, will exit the input loop.
2250 # of a size different to the indent level, will exit the input loop.
2251
2251
2252 if (continue_prompt and self.autoindent and line.isspace() and
2252 if (continue_prompt and self.autoindent and line.isspace() and
2253 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2253 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2254 (self.buffer[-1]).isspace() )):
2254 (self.buffer[-1]).isspace() )):
2255 line = ''
2255 line = ''
2256
2256
2257 self.log(line,line,continue_prompt)
2257 self.log(line,line,continue_prompt)
2258 return line
2258 return line
2259
2259
2260 def handle_alias(self,line,continue_prompt=None,
2260 def handle_alias(self,line,continue_prompt=None,
2261 pre=None,iFun=None,theRest=None):
2261 pre=None,iFun=None,theRest=None):
2262 """Handle alias input lines. """
2262 """Handle alias input lines. """
2263
2263
2264 # pre is needed, because it carries the leading whitespace. Otherwise
2264 # pre is needed, because it carries the leading whitespace. Otherwise
2265 # aliases won't work in indented sections.
2265 # aliases won't work in indented sections.
2266 transformed = self.expand_aliases(iFun, theRest)
2266 transformed = self.expand_aliases(iFun, theRest)
2267 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2267 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2268 self.log(line,line_out,continue_prompt)
2268 self.log(line,line_out,continue_prompt)
2269 #print 'line out:',line_out # dbg
2269 #print 'line out:',line_out # dbg
2270 return line_out
2270 return line_out
2271
2271
2272 def handle_shell_escape(self, line, continue_prompt=None,
2272 def handle_shell_escape(self, line, continue_prompt=None,
2273 pre=None,iFun=None,theRest=None):
2273 pre=None,iFun=None,theRest=None):
2274 """Execute the line in a shell, empty return value"""
2274 """Execute the line in a shell, empty return value"""
2275
2275
2276 #print 'line in :', `line` # dbg
2276 #print 'line in :', `line` # dbg
2277 # Example of a special handler. Others follow a similar pattern.
2277 # Example of a special handler. Others follow a similar pattern.
2278 if line.lstrip().startswith('!!'):
2278 if line.lstrip().startswith('!!'):
2279 # rewrite iFun/theRest to properly hold the call to %sx and
2279 # rewrite iFun/theRest to properly hold the call to %sx and
2280 # the actual command to be executed, so handle_magic can work
2280 # the actual command to be executed, so handle_magic can work
2281 # correctly
2281 # correctly
2282 theRest = '%s %s' % (iFun[2:],theRest)
2282 theRest = '%s %s' % (iFun[2:],theRest)
2283 iFun = 'sx'
2283 iFun = 'sx'
2284 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2284 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2285 line.lstrip()[2:]),
2285 line.lstrip()[2:]),
2286 continue_prompt,pre,iFun,theRest)
2286 continue_prompt,pre,iFun,theRest)
2287 else:
2287 else:
2288 cmd=line.lstrip().lstrip('!')
2288 cmd=line.lstrip().lstrip('!')
2289 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2289 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2290 # update cache/log and return
2290 # update cache/log and return
2291 self.log(line,line_out,continue_prompt)
2291 self.log(line,line_out,continue_prompt)
2292 return line_out
2292 return line_out
2293
2293
2294 def handle_magic(self, line, continue_prompt=None,
2294 def handle_magic(self, line, continue_prompt=None,
2295 pre=None,iFun=None,theRest=None):
2295 pre=None,iFun=None,theRest=None):
2296 """Execute magic functions."""
2296 """Execute magic functions."""
2297
2297
2298
2298
2299 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2299 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2300 self.log(line,cmd,continue_prompt)
2300 self.log(line,cmd,continue_prompt)
2301 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2301 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2302 return cmd
2302 return cmd
2303
2303
2304 def handle_auto(self, line, continue_prompt=None,
2304 def handle_auto(self, line, continue_prompt=None,
2305 pre=None,iFun=None,theRest=None,obj=None):
2305 pre=None,iFun=None,theRest=None,obj=None):
2306 """Hande lines which can be auto-executed, quoting if requested."""
2306 """Hande lines which can be auto-executed, quoting if requested."""
2307
2307
2308 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2308 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2309
2309
2310 # This should only be active for single-line input!
2310 # This should only be active for single-line input!
2311 if continue_prompt:
2311 if continue_prompt:
2312 self.log(line,line,continue_prompt)
2312 self.log(line,line,continue_prompt)
2313 return line
2313 return line
2314
2314
2315 auto_rewrite = True
2315 auto_rewrite = True
2316
2316
2317 if pre == self.ESC_QUOTE:
2317 if pre == self.ESC_QUOTE:
2318 # Auto-quote splitting on whitespace
2318 # Auto-quote splitting on whitespace
2319 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2319 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2320 elif pre == self.ESC_QUOTE2:
2320 elif pre == self.ESC_QUOTE2:
2321 # Auto-quote whole string
2321 # Auto-quote whole string
2322 newcmd = '%s("%s")' % (iFun,theRest)
2322 newcmd = '%s("%s")' % (iFun,theRest)
2323 elif pre == self.ESC_PAREN:
2323 elif pre == self.ESC_PAREN:
2324 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2324 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2325 else:
2325 else:
2326 # Auto-paren.
2326 # Auto-paren.
2327 # We only apply it to argument-less calls if the autocall
2327 # We only apply it to argument-less calls if the autocall
2328 # parameter is set to 2. We only need to check that autocall is <
2328 # parameter is set to 2. We only need to check that autocall is <
2329 # 2, since this function isn't called unless it's at least 1.
2329 # 2, since this function isn't called unless it's at least 1.
2330 if not theRest and (self.rc.autocall < 2):
2330 if not theRest and (self.rc.autocall < 2):
2331 newcmd = '%s %s' % (iFun,theRest)
2331 newcmd = '%s %s' % (iFun,theRest)
2332 auto_rewrite = False
2332 auto_rewrite = False
2333 else:
2333 else:
2334 if theRest.startswith('['):
2334 if theRest.startswith('['):
2335 if hasattr(obj,'__getitem__'):
2335 if hasattr(obj,'__getitem__'):
2336 # Don't autocall in this case: item access for an object
2336 # Don't autocall in this case: item access for an object
2337 # which is BOTH callable and implements __getitem__.
2337 # which is BOTH callable and implements __getitem__.
2338 newcmd = '%s %s' % (iFun,theRest)
2338 newcmd = '%s %s' % (iFun,theRest)
2339 auto_rewrite = False
2339 auto_rewrite = False
2340 else:
2340 else:
2341 # if the object doesn't support [] access, go ahead and
2341 # if the object doesn't support [] access, go ahead and
2342 # autocall
2342 # autocall
2343 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2343 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2344 elif theRest.endswith(';'):
2344 elif theRest.endswith(';'):
2345 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2345 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2346 else:
2346 else:
2347 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2347 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2348
2348
2349 if auto_rewrite:
2349 if auto_rewrite:
2350 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2350 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2351 # log what is now valid Python, not the actual user input (without the
2351 # log what is now valid Python, not the actual user input (without the
2352 # final newline)
2352 # final newline)
2353 self.log(line,newcmd,continue_prompt)
2353 self.log(line,newcmd,continue_prompt)
2354 return newcmd
2354 return newcmd
2355
2355
2356 def handle_help(self, line, continue_prompt=None,
2356 def handle_help(self, line, continue_prompt=None,
2357 pre=None,iFun=None,theRest=None):
2357 pre=None,iFun=None,theRest=None):
2358 """Try to get some help for the object.
2358 """Try to get some help for the object.
2359
2359
2360 obj? or ?obj -> basic information.
2360 obj? or ?obj -> basic information.
2361 obj?? or ??obj -> more details.
2361 obj?? or ??obj -> more details.
2362 """
2362 """
2363
2363
2364 # We need to make sure that we don't process lines which would be
2364 # We need to make sure that we don't process lines which would be
2365 # otherwise valid python, such as "x=1 # what?"
2365 # otherwise valid python, such as "x=1 # what?"
2366 try:
2366 try:
2367 codeop.compile_command(line)
2367 codeop.compile_command(line)
2368 except SyntaxError:
2368 except SyntaxError:
2369 # We should only handle as help stuff which is NOT valid syntax
2369 # We should only handle as help stuff which is NOT valid syntax
2370 if line[0]==self.ESC_HELP:
2370 if line[0]==self.ESC_HELP:
2371 line = line[1:]
2371 line = line[1:]
2372 elif line[-1]==self.ESC_HELP:
2372 elif line[-1]==self.ESC_HELP:
2373 line = line[:-1]
2373 line = line[:-1]
2374 self.log(line,'#?'+line,continue_prompt)
2374 self.log(line,'#?'+line,continue_prompt)
2375 if line:
2375 if line:
2376 self.magic_pinfo(line)
2376 self.magic_pinfo(line)
2377 else:
2377 else:
2378 page(self.usage,screen_lines=self.rc.screen_length)
2378 page(self.usage,screen_lines=self.rc.screen_length)
2379 return '' # Empty string is needed here!
2379 return '' # Empty string is needed here!
2380 except:
2380 except:
2381 # Pass any other exceptions through to the normal handler
2381 # Pass any other exceptions through to the normal handler
2382 return self.handle_normal(line,continue_prompt)
2382 return self.handle_normal(line,continue_prompt)
2383 else:
2383 else:
2384 # If the code compiles ok, we should handle it normally
2384 # If the code compiles ok, we should handle it normally
2385 return self.handle_normal(line,continue_prompt)
2385 return self.handle_normal(line,continue_prompt)
2386
2386
2387 def getapi(self):
2387 def getapi(self):
2388 """ Get an IPApi object for this shell instance
2388 """ Get an IPApi object for this shell instance
2389
2389
2390 Getting an IPApi object is always preferable to accessing the shell
2390 Getting an IPApi object is always preferable to accessing the shell
2391 directly, but this holds true especially for extensions.
2391 directly, but this holds true especially for extensions.
2392
2392
2393 It should always be possible to implement an extension with IPApi
2393 It should always be possible to implement an extension with IPApi
2394 alone. If not, contact maintainer to request an addition.
2394 alone. If not, contact maintainer to request an addition.
2395
2395
2396 """
2396 """
2397 return self.api
2397 return self.api
2398
2398
2399 def handle_emacs(self,line,continue_prompt=None,
2399 def handle_emacs(self,line,continue_prompt=None,
2400 pre=None,iFun=None,theRest=None):
2400 pre=None,iFun=None,theRest=None):
2401 """Handle input lines marked by python-mode."""
2401 """Handle input lines marked by python-mode."""
2402
2402
2403 # Currently, nothing is done. Later more functionality can be added
2403 # Currently, nothing is done. Later more functionality can be added
2404 # here if needed.
2404 # here if needed.
2405
2405
2406 # The input cache shouldn't be updated
2406 # The input cache shouldn't be updated
2407
2407
2408 return line
2408 return line
2409
2409
2410 def mktempfile(self,data=None):
2410 def mktempfile(self,data=None):
2411 """Make a new tempfile and return its filename.
2411 """Make a new tempfile and return its filename.
2412
2412
2413 This makes a call to tempfile.mktemp, but it registers the created
2413 This makes a call to tempfile.mktemp, but it registers the created
2414 filename internally so ipython cleans it up at exit time.
2414 filename internally so ipython cleans it up at exit time.
2415
2415
2416 Optional inputs:
2416 Optional inputs:
2417
2417
2418 - data(None): if data is given, it gets written out to the temp file
2418 - data(None): if data is given, it gets written out to the temp file
2419 immediately, and the file is closed again."""
2419 immediately, and the file is closed again."""
2420
2420
2421 filename = tempfile.mktemp('.py','ipython_edit_')
2421 filename = tempfile.mktemp('.py','ipython_edit_')
2422 self.tempfiles.append(filename)
2422 self.tempfiles.append(filename)
2423
2423
2424 if data:
2424 if data:
2425 tmp_file = open(filename,'w')
2425 tmp_file = open(filename,'w')
2426 tmp_file.write(data)
2426 tmp_file.write(data)
2427 tmp_file.close()
2427 tmp_file.close()
2428 return filename
2428 return filename
2429
2429
2430 def write(self,data):
2430 def write(self,data):
2431 """Write a string to the default output"""
2431 """Write a string to the default output"""
2432 Term.cout.write(data)
2432 Term.cout.write(data)
2433
2433
2434 def write_err(self,data):
2434 def write_err(self,data):
2435 """Write a string to the default error output"""
2435 """Write a string to the default error output"""
2436 Term.cerr.write(data)
2436 Term.cerr.write(data)
2437
2437
2438 def exit(self):
2438 def exit(self):
2439 """Handle interactive exit.
2439 """Handle interactive exit.
2440
2440
2441 This method sets the exit_now attribute."""
2441 This method sets the exit_now attribute."""
2442
2442
2443 if self.rc.confirm_exit:
2443 if self.rc.confirm_exit:
2444 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2444 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2445 self.exit_now = True
2445 self.exit_now = True
2446 else:
2446 else:
2447 self.exit_now = True
2447 self.exit_now = True
2448
2448
2449 def safe_execfile(self,fname,*where,**kw):
2449 def safe_execfile(self,fname,*where,**kw):
2450 """A safe version of the builtin execfile().
2450 """A safe version of the builtin execfile().
2451
2451
2452 This version will never throw an exception, and knows how to handle
2452 This version will never throw an exception, and knows how to handle
2453 ipython logs as well."""
2453 ipython logs as well."""
2454
2454
2455 def syspath_cleanup():
2455 def syspath_cleanup():
2456 """Internal cleanup routine for sys.path."""
2456 """Internal cleanup routine for sys.path."""
2457 if add_dname:
2457 if add_dname:
2458 try:
2458 try:
2459 sys.path.remove(dname)
2459 sys.path.remove(dname)
2460 except ValueError:
2460 except ValueError:
2461 # For some reason the user has already removed it, ignore.
2461 # For some reason the user has already removed it, ignore.
2462 pass
2462 pass
2463
2463
2464 fname = os.path.expanduser(fname)
2464 fname = os.path.expanduser(fname)
2465
2465
2466 # Find things also in current directory. This is needed to mimic the
2466 # Find things also in current directory. This is needed to mimic the
2467 # behavior of running a script from the system command line, where
2467 # behavior of running a script from the system command line, where
2468 # Python inserts the script's directory into sys.path
2468 # Python inserts the script's directory into sys.path
2469 dname = os.path.dirname(os.path.abspath(fname))
2469 dname = os.path.dirname(os.path.abspath(fname))
2470 add_dname = False
2470 add_dname = False
2471 if dname not in sys.path:
2471 if dname not in sys.path:
2472 sys.path.insert(0,dname)
2472 sys.path.insert(0,dname)
2473 add_dname = True
2473 add_dname = True
2474
2474
2475 try:
2475 try:
2476 xfile = open(fname)
2476 xfile = open(fname)
2477 except:
2477 except:
2478 print >> Term.cerr, \
2478 print >> Term.cerr, \
2479 'Could not open file <%s> for safe execution.' % fname
2479 'Could not open file <%s> for safe execution.' % fname
2480 syspath_cleanup()
2480 syspath_cleanup()
2481 return None
2481 return None
2482
2482
2483 kw.setdefault('islog',0)
2483 kw.setdefault('islog',0)
2484 kw.setdefault('quiet',1)
2484 kw.setdefault('quiet',1)
2485 kw.setdefault('exit_ignore',0)
2485 kw.setdefault('exit_ignore',0)
2486 first = xfile.readline()
2486 first = xfile.readline()
2487 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2487 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2488 xfile.close()
2488 xfile.close()
2489 # line by line execution
2489 # line by line execution
2490 if first.startswith(loghead) or kw['islog']:
2490 if first.startswith(loghead) or kw['islog']:
2491 print 'Loading log file <%s> one line at a time...' % fname
2491 print 'Loading log file <%s> one line at a time...' % fname
2492 if kw['quiet']:
2492 if kw['quiet']:
2493 stdout_save = sys.stdout
2493 stdout_save = sys.stdout
2494 sys.stdout = StringIO.StringIO()
2494 sys.stdout = StringIO.StringIO()
2495 try:
2495 try:
2496 globs,locs = where[0:2]
2496 globs,locs = where[0:2]
2497 except:
2497 except:
2498 try:
2498 try:
2499 globs = locs = where[0]
2499 globs = locs = where[0]
2500 except:
2500 except:
2501 globs = locs = globals()
2501 globs = locs = globals()
2502 badblocks = []
2502 badblocks = []
2503
2503
2504 # we also need to identify indented blocks of code when replaying
2504 # we also need to identify indented blocks of code when replaying
2505 # logs and put them together before passing them to an exec
2505 # logs and put them together before passing them to an exec
2506 # statement. This takes a bit of regexp and look-ahead work in the
2506 # statement. This takes a bit of regexp and look-ahead work in the
2507 # file. It's easiest if we swallow the whole thing in memory
2507 # file. It's easiest if we swallow the whole thing in memory
2508 # first, and manually walk through the lines list moving the
2508 # first, and manually walk through the lines list moving the
2509 # counter ourselves.
2509 # counter ourselves.
2510 indent_re = re.compile('\s+\S')
2510 indent_re = re.compile('\s+\S')
2511 xfile = open(fname)
2511 xfile = open(fname)
2512 filelines = xfile.readlines()
2512 filelines = xfile.readlines()
2513 xfile.close()
2513 xfile.close()
2514 nlines = len(filelines)
2514 nlines = len(filelines)
2515 lnum = 0
2515 lnum = 0
2516 while lnum < nlines:
2516 while lnum < nlines:
2517 line = filelines[lnum]
2517 line = filelines[lnum]
2518 lnum += 1
2518 lnum += 1
2519 # don't re-insert logger status info into cache
2519 # don't re-insert logger status info into cache
2520 if line.startswith('#log#'):
2520 if line.startswith('#log#'):
2521 continue
2521 continue
2522 else:
2522 else:
2523 # build a block of code (maybe a single line) for execution
2523 # build a block of code (maybe a single line) for execution
2524 block = line
2524 block = line
2525 try:
2525 try:
2526 next = filelines[lnum] # lnum has already incremented
2526 next = filelines[lnum] # lnum has already incremented
2527 except:
2527 except:
2528 next = None
2528 next = None
2529 while next and indent_re.match(next):
2529 while next and indent_re.match(next):
2530 block += next
2530 block += next
2531 lnum += 1
2531 lnum += 1
2532 try:
2532 try:
2533 next = filelines[lnum]
2533 next = filelines[lnum]
2534 except:
2534 except:
2535 next = None
2535 next = None
2536 # now execute the block of one or more lines
2536 # now execute the block of one or more lines
2537 try:
2537 try:
2538 exec block in globs,locs
2538 exec block in globs,locs
2539 except SystemExit:
2539 except SystemExit:
2540 pass
2540 pass
2541 except:
2541 except:
2542 badblocks.append(block.rstrip())
2542 badblocks.append(block.rstrip())
2543 if kw['quiet']: # restore stdout
2543 if kw['quiet']: # restore stdout
2544 sys.stdout.close()
2544 sys.stdout.close()
2545 sys.stdout = stdout_save
2545 sys.stdout = stdout_save
2546 print 'Finished replaying log file <%s>' % fname
2546 print 'Finished replaying log file <%s>' % fname
2547 if badblocks:
2547 if badblocks:
2548 print >> sys.stderr, ('\nThe following lines/blocks in file '
2548 print >> sys.stderr, ('\nThe following lines/blocks in file '
2549 '<%s> reported errors:' % fname)
2549 '<%s> reported errors:' % fname)
2550
2550
2551 for badline in badblocks:
2551 for badline in badblocks:
2552 print >> sys.stderr, badline
2552 print >> sys.stderr, badline
2553 else: # regular file execution
2553 else: # regular file execution
2554 try:
2554 try:
2555 execfile(fname,*where)
2555 execfile(fname,*where)
2556 except SyntaxError:
2556 except SyntaxError:
2557 self.showsyntaxerror()
2557 self.showsyntaxerror()
2558 warn('Failure executing file: <%s>' % fname)
2558 warn('Failure executing file: <%s>' % fname)
2559 except SystemExit,status:
2559 except SystemExit,status:
2560 if not kw['exit_ignore']:
2560 if not kw['exit_ignore']:
2561 self.showtraceback()
2561 self.showtraceback()
2562 warn('Failure executing file: <%s>' % fname)
2562 warn('Failure executing file: <%s>' % fname)
2563 except:
2563 except:
2564 self.showtraceback()
2564 self.showtraceback()
2565 warn('Failure executing file: <%s>' % fname)
2565 warn('Failure executing file: <%s>' % fname)
2566
2566
2567 syspath_cleanup()
2567 syspath_cleanup()
2568
2568
2569 #************************* end of file <iplib.py> *****************************
2569 #************************* end of file <iplib.py> *****************************
@@ -1,6367 +1,6372 b''
1 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
4 input. Patch sent by Stefan.
5
1 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
6 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
2 * IPython/Extensions/ipy_stock_completer.py
7 * IPython/Extensions/ipy_stock_completer.py
3 shlex_split, fix bug in shlex_split. len function
8 shlex_split, fix bug in shlex_split. len function
4 call was missing in if statement. Caused shlex_split to
9 call was missing in if statement. Caused shlex_split to
5 sometimes return "" as last element.
10 sometimes return "" as last element.
6
11
7 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
12 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
8
13
9 * IPython/completer.py
14 * IPython/completer.py
10 (IPCompleter.file_matches.single_dir_expand): fix a problem
15 (IPCompleter.file_matches.single_dir_expand): fix a problem
11 reported by Stefan, where directories containign a single subdir
16 reported by Stefan, where directories containign a single subdir
12 would be completed too early.
17 would be completed too early.
13
18
14 * IPython/Shell.py (_load_pylab): Make the execution of 'from
19 * IPython/Shell.py (_load_pylab): Make the execution of 'from
15 pylab import *' when -pylab is given be optional. A new flag,
20 pylab import *' when -pylab is given be optional. A new flag,
16 pylab_import_all controls this behavior, the default is True for
21 pylab_import_all controls this behavior, the default is True for
17 backwards compatibility.
22 backwards compatibility.
18
23
19 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
24 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
20 modified) R. Bernstein's patch for fully syntax highlighted
25 modified) R. Bernstein's patch for fully syntax highlighted
21 tracebacks. The functionality is also available under ultraTB for
26 tracebacks. The functionality is also available under ultraTB for
22 non-ipython users (someone using ultraTB but outside an ipython
27 non-ipython users (someone using ultraTB but outside an ipython
23 session). They can select the color scheme by setting the
28 session). They can select the color scheme by setting the
24 module-level global DEFAULT_SCHEME. The highlight functionality
29 module-level global DEFAULT_SCHEME. The highlight functionality
25 also works when debugging.
30 also works when debugging.
26
31
27 * IPython/genutils.py (IOStream.close): small patch by
32 * IPython/genutils.py (IOStream.close): small patch by
28 R. Bernstein for improved pydb support.
33 R. Bernstein for improved pydb support.
29
34
30 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
35 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
31 DaveS <davls@telus.net> to improve support of debugging under
36 DaveS <davls@telus.net> to improve support of debugging under
32 NTEmacs, including improved pydb behavior.
37 NTEmacs, including improved pydb behavior.
33
38
34 * IPython/Magic.py (magic_prun): Fix saving of profile info for
39 * IPython/Magic.py (magic_prun): Fix saving of profile info for
35 Python 2.5, where the stats object API changed a little. Thanks
40 Python 2.5, where the stats object API changed a little. Thanks
36 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
41 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
37
42
38 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
43 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
39 Pernetty's patch to improve support for (X)Emacs under Win32.
44 Pernetty's patch to improve support for (X)Emacs under Win32.
40
45
41 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
46 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
42
47
43 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
48 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
44 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
49 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
45 a report by Nik Tautenhahn.
50 a report by Nik Tautenhahn.
46
51
47 2007-03-16 Walter Doerwald <walter@livinglogic.de>
52 2007-03-16 Walter Doerwald <walter@livinglogic.de>
48
53
49 * setup.py: Add the igrid help files to the list of data files
54 * setup.py: Add the igrid help files to the list of data files
50 to be installed alongside igrid.
55 to be installed alongside igrid.
51 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
56 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
52 Show the input object of the igrid browser as the window tile.
57 Show the input object of the igrid browser as the window tile.
53 Show the object the cursor is on in the statusbar.
58 Show the object the cursor is on in the statusbar.
54
59
55 2007-03-15 Ville Vainio <vivainio@gmail.com>
60 2007-03-15 Ville Vainio <vivainio@gmail.com>
56
61
57 * Extensions/ipy_stock_completers.py: Fixed exception
62 * Extensions/ipy_stock_completers.py: Fixed exception
58 on mismatching quotes in %run completer. Patch by
63 on mismatching quotes in %run completer. Patch by
59 JοΏ½rgen Stenarson. Closes #127.
64 JοΏ½rgen Stenarson. Closes #127.
60
65
61 2007-03-14 Ville Vainio <vivainio@gmail.com>
66 2007-03-14 Ville Vainio <vivainio@gmail.com>
62
67
63 * Extensions/ext_rehashdir.py: Do not do auto_alias
68 * Extensions/ext_rehashdir.py: Do not do auto_alias
64 in %rehashdir, it clobbers %store'd aliases.
69 in %rehashdir, it clobbers %store'd aliases.
65
70
66 * UserConfig/ipy_profile_sh.py: envpersist.py extension
71 * UserConfig/ipy_profile_sh.py: envpersist.py extension
67 (beefed up %env) imported for sh profile.
72 (beefed up %env) imported for sh profile.
68
73
69 2007-03-10 Walter Doerwald <walter@livinglogic.de>
74 2007-03-10 Walter Doerwald <walter@livinglogic.de>
70
75
71 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
76 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
72 as the default browser.
77 as the default browser.
73 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
78 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
74 As igrid displays all attributes it ever encounters, fetch() (which has
79 As igrid displays all attributes it ever encounters, fetch() (which has
75 been renamed to _fetch()) doesn't have to recalculate the display attributes
80 been renamed to _fetch()) doesn't have to recalculate the display attributes
76 every time a new item is fetched. This should speed up scrolling.
81 every time a new item is fetched. This should speed up scrolling.
77
82
78 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
83 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
79
84
80 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
85 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
81 Schmolck's recently reported tab-completion bug (my previous one
86 Schmolck's recently reported tab-completion bug (my previous one
82 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
87 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
83
88
84 2007-03-09 Walter Doerwald <walter@livinglogic.de>
89 2007-03-09 Walter Doerwald <walter@livinglogic.de>
85
90
86 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
91 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
87 Close help window if exiting igrid.
92 Close help window if exiting igrid.
88
93
89 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
94 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
90
95
91 * IPython/Extensions/ipy_defaults.py: Check if readline is available
96 * IPython/Extensions/ipy_defaults.py: Check if readline is available
92 before calling functions from readline.
97 before calling functions from readline.
93
98
94 2007-03-02 Walter Doerwald <walter@livinglogic.de>
99 2007-03-02 Walter Doerwald <walter@livinglogic.de>
95
100
96 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
101 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
97 igrid is a wxPython-based display object for ipipe. If your system has
102 igrid is a wxPython-based display object for ipipe. If your system has
98 wx installed igrid will be the default display. Without wx ipipe falls
103 wx installed igrid will be the default display. Without wx ipipe falls
99 back to ibrowse (which needs curses). If no curses is installed ipipe
104 back to ibrowse (which needs curses). If no curses is installed ipipe
100 falls back to idump.
105 falls back to idump.
101
106
102 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
107 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
103
108
104 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
109 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
105 my changes from yesterday, they introduced bugs. Will reactivate
110 my changes from yesterday, they introduced bugs. Will reactivate
106 once I get a correct solution, which will be much easier thanks to
111 once I get a correct solution, which will be much easier thanks to
107 Dan Milstein's new prefilter test suite.
112 Dan Milstein's new prefilter test suite.
108
113
109 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
114 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
110
115
111 * IPython/iplib.py (split_user_input): fix input splitting so we
116 * IPython/iplib.py (split_user_input): fix input splitting so we
112 don't attempt attribute accesses on things that can't possibly be
117 don't attempt attribute accesses on things that can't possibly be
113 valid Python attributes. After a bug report by Alex Schmolck.
118 valid Python attributes. After a bug report by Alex Schmolck.
114 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
119 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
115 %magic with explicit % prefix.
120 %magic with explicit % prefix.
116
121
117 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
122 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
118
123
119 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
124 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
120 avoid a DeprecationWarning from GTK.
125 avoid a DeprecationWarning from GTK.
121
126
122 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
127 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
123
128
124 * IPython/genutils.py (clock): I modified clock() to return total
129 * IPython/genutils.py (clock): I modified clock() to return total
125 time, user+system. This is a more commonly needed metric. I also
130 time, user+system. This is a more commonly needed metric. I also
126 introduced the new clocku/clocks to get only user/system time if
131 introduced the new clocku/clocks to get only user/system time if
127 one wants those instead.
132 one wants those instead.
128
133
129 ***WARNING: API CHANGE*** clock() used to return only user time,
134 ***WARNING: API CHANGE*** clock() used to return only user time,
130 so if you want exactly the same results as before, use clocku
135 so if you want exactly the same results as before, use clocku
131 instead.
136 instead.
132
137
133 2007-02-22 Ville Vainio <vivainio@gmail.com>
138 2007-02-22 Ville Vainio <vivainio@gmail.com>
134
139
135 * IPython/Extensions/ipy_p4.py: Extension for improved
140 * IPython/Extensions/ipy_p4.py: Extension for improved
136 p4 (perforce version control system) experience.
141 p4 (perforce version control system) experience.
137 Adds %p4 magic with p4 command completion and
142 Adds %p4 magic with p4 command completion and
138 automatic -G argument (marshall output as python dict)
143 automatic -G argument (marshall output as python dict)
139
144
140 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
145 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
141
146
142 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
147 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
143 stop marks.
148 stop marks.
144 (ClearingMixin): a simple mixin to easily make a Demo class clear
149 (ClearingMixin): a simple mixin to easily make a Demo class clear
145 the screen in between blocks and have empty marquees. The
150 the screen in between blocks and have empty marquees. The
146 ClearDemo and ClearIPDemo classes that use it are included.
151 ClearDemo and ClearIPDemo classes that use it are included.
147
152
148 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
153 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
149
154
150 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
155 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
151 protect against exceptions at Python shutdown time. Patch
156 protect against exceptions at Python shutdown time. Patch
152 sumbmitted to upstream.
157 sumbmitted to upstream.
153
158
154 2007-02-14 Walter Doerwald <walter@livinglogic.de>
159 2007-02-14 Walter Doerwald <walter@livinglogic.de>
155
160
156 * IPython/Extensions/ibrowse.py: If entering the first object level
161 * IPython/Extensions/ibrowse.py: If entering the first object level
157 (i.e. the object for which the browser has been started) fails,
162 (i.e. the object for which the browser has been started) fails,
158 now the error is raised directly (aborting the browser) instead of
163 now the error is raised directly (aborting the browser) instead of
159 running into an empty levels list later.
164 running into an empty levels list later.
160
165
161 2007-02-03 Walter Doerwald <walter@livinglogic.de>
166 2007-02-03 Walter Doerwald <walter@livinglogic.de>
162
167
163 * IPython/Extensions/ipipe.py: Add an xrepr implementation
168 * IPython/Extensions/ipipe.py: Add an xrepr implementation
164 for the noitem object.
169 for the noitem object.
165
170
166 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
171 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
167
172
168 * IPython/completer.py (Completer.attr_matches): Fix small
173 * IPython/completer.py (Completer.attr_matches): Fix small
169 tab-completion bug with Enthought Traits objects with units.
174 tab-completion bug with Enthought Traits objects with units.
170 Thanks to a bug report by Tom Denniston
175 Thanks to a bug report by Tom Denniston
171 <tom.denniston-AT-alum.dartmouth.org>.
176 <tom.denniston-AT-alum.dartmouth.org>.
172
177
173 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
178 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
174
179
175 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
180 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
176 bug where only .ipy or .py would be completed. Once the first
181 bug where only .ipy or .py would be completed. Once the first
177 argument to %run has been given, all completions are valid because
182 argument to %run has been given, all completions are valid because
178 they are the arguments to the script, which may well be non-python
183 they are the arguments to the script, which may well be non-python
179 filenames.
184 filenames.
180
185
181 * IPython/irunner.py (InteractiveRunner.run_source): major updates
186 * IPython/irunner.py (InteractiveRunner.run_source): major updates
182 to irunner to allow it to correctly support real doctesting of
187 to irunner to allow it to correctly support real doctesting of
183 out-of-process ipython code.
188 out-of-process ipython code.
184
189
185 * IPython/Magic.py (magic_cd): Make the setting of the terminal
190 * IPython/Magic.py (magic_cd): Make the setting of the terminal
186 title an option (-noterm_title) because it completely breaks
191 title an option (-noterm_title) because it completely breaks
187 doctesting.
192 doctesting.
188
193
189 * IPython/demo.py: fix IPythonDemo class that was not actually working.
194 * IPython/demo.py: fix IPythonDemo class that was not actually working.
190
195
191 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
196 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
192
197
193 * IPython/irunner.py (main): fix small bug where extensions were
198 * IPython/irunner.py (main): fix small bug where extensions were
194 not being correctly recognized.
199 not being correctly recognized.
195
200
196 2007-01-23 Walter Doerwald <walter@livinglogic.de>
201 2007-01-23 Walter Doerwald <walter@livinglogic.de>
197
202
198 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
203 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
199 a string containing a single line yields the string itself as the
204 a string containing a single line yields the string itself as the
200 only item.
205 only item.
201
206
202 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
207 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
203 object if it's the same as the one on the last level (This avoids
208 object if it's the same as the one on the last level (This avoids
204 infinite recursion for one line strings).
209 infinite recursion for one line strings).
205
210
206 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
211 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
207
212
208 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
213 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
209 all output streams before printing tracebacks. This ensures that
214 all output streams before printing tracebacks. This ensures that
210 user output doesn't end up interleaved with traceback output.
215 user output doesn't end up interleaved with traceback output.
211
216
212 2007-01-10 Ville Vainio <vivainio@gmail.com>
217 2007-01-10 Ville Vainio <vivainio@gmail.com>
213
218
214 * Extensions/envpersist.py: Turbocharged %env that remembers
219 * Extensions/envpersist.py: Turbocharged %env that remembers
215 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
220 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
216 "%env VISUAL=jed".
221 "%env VISUAL=jed".
217
222
218 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
223 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
219
224
220 * IPython/iplib.py (showtraceback): ensure that we correctly call
225 * IPython/iplib.py (showtraceback): ensure that we correctly call
221 custom handlers in all cases (some with pdb were slipping through,
226 custom handlers in all cases (some with pdb were slipping through,
222 but I'm not exactly sure why).
227 but I'm not exactly sure why).
223
228
224 * IPython/Debugger.py (Tracer.__init__): added new class to
229 * IPython/Debugger.py (Tracer.__init__): added new class to
225 support set_trace-like usage of IPython's enhanced debugger.
230 support set_trace-like usage of IPython's enhanced debugger.
226
231
227 2006-12-24 Ville Vainio <vivainio@gmail.com>
232 2006-12-24 Ville Vainio <vivainio@gmail.com>
228
233
229 * ipmaker.py: more informative message when ipy_user_conf
234 * ipmaker.py: more informative message when ipy_user_conf
230 import fails (suggest running %upgrade).
235 import fails (suggest running %upgrade).
231
236
232 * tools/run_ipy_in_profiler.py: Utility to see where
237 * tools/run_ipy_in_profiler.py: Utility to see where
233 the time during IPython startup is spent.
238 the time during IPython startup is spent.
234
239
235 2006-12-20 Ville Vainio <vivainio@gmail.com>
240 2006-12-20 Ville Vainio <vivainio@gmail.com>
236
241
237 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
242 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
238
243
239 * ipapi.py: Add new ipapi method, expand_alias.
244 * ipapi.py: Add new ipapi method, expand_alias.
240
245
241 * Release.py: Bump up version to 0.7.4.svn
246 * Release.py: Bump up version to 0.7.4.svn
242
247
243 2006-12-17 Ville Vainio <vivainio@gmail.com>
248 2006-12-17 Ville Vainio <vivainio@gmail.com>
244
249
245 * Extensions/jobctrl.py: Fixed &cmd arg arg...
250 * Extensions/jobctrl.py: Fixed &cmd arg arg...
246 to work properly on posix too
251 to work properly on posix too
247
252
248 * Release.py: Update revnum (version is still just 0.7.3).
253 * Release.py: Update revnum (version is still just 0.7.3).
249
254
250 2006-12-15 Ville Vainio <vivainio@gmail.com>
255 2006-12-15 Ville Vainio <vivainio@gmail.com>
251
256
252 * scripts/ipython_win_post_install: create ipython.py in
257 * scripts/ipython_win_post_install: create ipython.py in
253 prefix + "/scripts".
258 prefix + "/scripts".
254
259
255 * Release.py: Update version to 0.7.3.
260 * Release.py: Update version to 0.7.3.
256
261
257 2006-12-14 Ville Vainio <vivainio@gmail.com>
262 2006-12-14 Ville Vainio <vivainio@gmail.com>
258
263
259 * scripts/ipython_win_post_install: Overwrite old shortcuts
264 * scripts/ipython_win_post_install: Overwrite old shortcuts
260 if they already exist
265 if they already exist
261
266
262 * Release.py: release 0.7.3rc2
267 * Release.py: release 0.7.3rc2
263
268
264 2006-12-13 Ville Vainio <vivainio@gmail.com>
269 2006-12-13 Ville Vainio <vivainio@gmail.com>
265
270
266 * Branch and update Release.py for 0.7.3rc1
271 * Branch and update Release.py for 0.7.3rc1
267
272
268 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
273 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
269
274
270 * IPython/Shell.py (IPShellWX): update for current WX naming
275 * IPython/Shell.py (IPShellWX): update for current WX naming
271 conventions, to avoid a deprecation warning with current WX
276 conventions, to avoid a deprecation warning with current WX
272 versions. Thanks to a report by Danny Shevitz.
277 versions. Thanks to a report by Danny Shevitz.
273
278
274 2006-12-12 Ville Vainio <vivainio@gmail.com>
279 2006-12-12 Ville Vainio <vivainio@gmail.com>
275
280
276 * ipmaker.py: apply david cournapeau's patch to make
281 * ipmaker.py: apply david cournapeau's patch to make
277 import_some work properly even when ipythonrc does
282 import_some work properly even when ipythonrc does
278 import_some on empty list (it was an old bug!).
283 import_some on empty list (it was an old bug!).
279
284
280 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
285 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
281 Add deprecation note to ipythonrc and a url to wiki
286 Add deprecation note to ipythonrc and a url to wiki
282 in ipy_user_conf.py
287 in ipy_user_conf.py
283
288
284
289
285 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
290 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
286 as if it was typed on IPython command prompt, i.e.
291 as if it was typed on IPython command prompt, i.e.
287 as IPython script.
292 as IPython script.
288
293
289 * example-magic.py, magic_grepl.py: remove outdated examples
294 * example-magic.py, magic_grepl.py: remove outdated examples
290
295
291 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
296 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
292
297
293 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
298 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
294 is called before any exception has occurred.
299 is called before any exception has occurred.
295
300
296 2006-12-08 Ville Vainio <vivainio@gmail.com>
301 2006-12-08 Ville Vainio <vivainio@gmail.com>
297
302
298 * Extensions/ipy_stock_completers.py: fix cd completer
303 * Extensions/ipy_stock_completers.py: fix cd completer
299 to translate /'s to \'s again.
304 to translate /'s to \'s again.
300
305
301 * completer.py: prevent traceback on file completions w/
306 * completer.py: prevent traceback on file completions w/
302 backslash.
307 backslash.
303
308
304 * Release.py: Update release number to 0.7.3b3 for release
309 * Release.py: Update release number to 0.7.3b3 for release
305
310
306 2006-12-07 Ville Vainio <vivainio@gmail.com>
311 2006-12-07 Ville Vainio <vivainio@gmail.com>
307
312
308 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
313 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
309 while executing external code. Provides more shell-like behaviour
314 while executing external code. Provides more shell-like behaviour
310 and overall better response to ctrl + C / ctrl + break.
315 and overall better response to ctrl + C / ctrl + break.
311
316
312 * tools/make_tarball.py: new script to create tarball straight from svn
317 * tools/make_tarball.py: new script to create tarball straight from svn
313 (setup.py sdist doesn't work on win32).
318 (setup.py sdist doesn't work on win32).
314
319
315 * Extensions/ipy_stock_completers.py: fix cd completer to give up
320 * Extensions/ipy_stock_completers.py: fix cd completer to give up
316 on dirnames with spaces and use the default completer instead.
321 on dirnames with spaces and use the default completer instead.
317
322
318 * Revision.py: Change version to 0.7.3b2 for release.
323 * Revision.py: Change version to 0.7.3b2 for release.
319
324
320 2006-12-05 Ville Vainio <vivainio@gmail.com>
325 2006-12-05 Ville Vainio <vivainio@gmail.com>
321
326
322 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
327 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
323 pydb patch 4 (rm debug printing, py 2.5 checking)
328 pydb patch 4 (rm debug printing, py 2.5 checking)
324
329
325 2006-11-30 Walter Doerwald <walter@livinglogic.de>
330 2006-11-30 Walter Doerwald <walter@livinglogic.de>
326 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
331 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
327 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
332 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
328 "refreshfind" (mapped to "R") does the same but tries to go back to the same
333 "refreshfind" (mapped to "R") does the same but tries to go back to the same
329 object the cursor was on before the refresh. The command "markrange" is
334 object the cursor was on before the refresh. The command "markrange" is
330 mapped to "%" now.
335 mapped to "%" now.
331 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
336 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
332
337
333 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
338 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
334
339
335 * IPython/Magic.py (magic_debug): new %debug magic to activate the
340 * IPython/Magic.py (magic_debug): new %debug magic to activate the
336 interactive debugger on the last traceback, without having to call
341 interactive debugger on the last traceback, without having to call
337 %pdb and rerun your code. Made minor changes in various modules,
342 %pdb and rerun your code. Made minor changes in various modules,
338 should automatically recognize pydb if available.
343 should automatically recognize pydb if available.
339
344
340 2006-11-28 Ville Vainio <vivainio@gmail.com>
345 2006-11-28 Ville Vainio <vivainio@gmail.com>
341
346
342 * completer.py: If the text start with !, show file completions
347 * completer.py: If the text start with !, show file completions
343 properly. This helps when trying to complete command name
348 properly. This helps when trying to complete command name
344 for shell escapes.
349 for shell escapes.
345
350
346 2006-11-27 Ville Vainio <vivainio@gmail.com>
351 2006-11-27 Ville Vainio <vivainio@gmail.com>
347
352
348 * ipy_stock_completers.py: bzr completer submitted by Stefan van
353 * ipy_stock_completers.py: bzr completer submitted by Stefan van
349 der Walt. Clean up svn and hg completers by using a common
354 der Walt. Clean up svn and hg completers by using a common
350 vcs_completer.
355 vcs_completer.
351
356
352 2006-11-26 Ville Vainio <vivainio@gmail.com>
357 2006-11-26 Ville Vainio <vivainio@gmail.com>
353
358
354 * Remove ipconfig and %config; you should use _ip.options structure
359 * Remove ipconfig and %config; you should use _ip.options structure
355 directly instead!
360 directly instead!
356
361
357 * genutils.py: add wrap_deprecated function for deprecating callables
362 * genutils.py: add wrap_deprecated function for deprecating callables
358
363
359 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
364 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
360 _ip.system instead. ipalias is redundant.
365 _ip.system instead. ipalias is redundant.
361
366
362 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
367 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
363 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
368 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
364 explicit.
369 explicit.
365
370
366 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
371 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
367 completer. Try it by entering 'hg ' and pressing tab.
372 completer. Try it by entering 'hg ' and pressing tab.
368
373
369 * macro.py: Give Macro a useful __repr__ method
374 * macro.py: Give Macro a useful __repr__ method
370
375
371 * Magic.py: %whos abbreviates the typename of Macro for brevity.
376 * Magic.py: %whos abbreviates the typename of Macro for brevity.
372
377
373 2006-11-24 Walter Doerwald <walter@livinglogic.de>
378 2006-11-24 Walter Doerwald <walter@livinglogic.de>
374 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
379 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
375 we don't get a duplicate ipipe module, where registration of the xrepr
380 we don't get a duplicate ipipe module, where registration of the xrepr
376 implementation for Text is useless.
381 implementation for Text is useless.
377
382
378 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
383 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
379
384
380 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
385 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
381
386
382 2006-11-24 Ville Vainio <vivainio@gmail.com>
387 2006-11-24 Ville Vainio <vivainio@gmail.com>
383
388
384 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
389 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
385 try to use "cProfile" instead of the slower pure python
390 try to use "cProfile" instead of the slower pure python
386 "profile"
391 "profile"
387
392
388 2006-11-23 Ville Vainio <vivainio@gmail.com>
393 2006-11-23 Ville Vainio <vivainio@gmail.com>
389
394
390 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
395 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
391 Qt+IPython+Designer link in documentation.
396 Qt+IPython+Designer link in documentation.
392
397
393 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
398 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
394 correct Pdb object to %pydb.
399 correct Pdb object to %pydb.
395
400
396
401
397 2006-11-22 Walter Doerwald <walter@livinglogic.de>
402 2006-11-22 Walter Doerwald <walter@livinglogic.de>
398 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
403 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
399 generic xrepr(), otherwise the list implementation would kick in.
404 generic xrepr(), otherwise the list implementation would kick in.
400
405
401 2006-11-21 Ville Vainio <vivainio@gmail.com>
406 2006-11-21 Ville Vainio <vivainio@gmail.com>
402
407
403 * upgrade_dir.py: Now actually overwrites a nonmodified user file
408 * upgrade_dir.py: Now actually overwrites a nonmodified user file
404 with one from UserConfig.
409 with one from UserConfig.
405
410
406 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
411 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
407 it was missing which broke the sh profile.
412 it was missing which broke the sh profile.
408
413
409 * completer.py: file completer now uses explicit '/' instead
414 * completer.py: file completer now uses explicit '/' instead
410 of os.path.join, expansion of 'foo' was broken on win32
415 of os.path.join, expansion of 'foo' was broken on win32
411 if there was one directory with name 'foobar'.
416 if there was one directory with name 'foobar'.
412
417
413 * A bunch of patches from Kirill Smelkov:
418 * A bunch of patches from Kirill Smelkov:
414
419
415 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
420 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
416
421
417 * [patch 7/9] Implement %page -r (page in raw mode) -
422 * [patch 7/9] Implement %page -r (page in raw mode) -
418
423
419 * [patch 5/9] ScientificPython webpage has moved
424 * [patch 5/9] ScientificPython webpage has moved
420
425
421 * [patch 4/9] The manual mentions %ds, should be %dhist
426 * [patch 4/9] The manual mentions %ds, should be %dhist
422
427
423 * [patch 3/9] Kill old bits from %prun doc.
428 * [patch 3/9] Kill old bits from %prun doc.
424
429
425 * [patch 1/9] Fix typos here and there.
430 * [patch 1/9] Fix typos here and there.
426
431
427 2006-11-08 Ville Vainio <vivainio@gmail.com>
432 2006-11-08 Ville Vainio <vivainio@gmail.com>
428
433
429 * completer.py (attr_matches): catch all exceptions raised
434 * completer.py (attr_matches): catch all exceptions raised
430 by eval of expr with dots.
435 by eval of expr with dots.
431
436
432 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
437 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
433
438
434 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
439 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
435 input if it starts with whitespace. This allows you to paste
440 input if it starts with whitespace. This allows you to paste
436 indented input from any editor without manually having to type in
441 indented input from any editor without manually having to type in
437 the 'if 1:', which is convenient when working interactively.
442 the 'if 1:', which is convenient when working interactively.
438 Slightly modifed version of a patch by Bo Peng
443 Slightly modifed version of a patch by Bo Peng
439 <bpeng-AT-rice.edu>.
444 <bpeng-AT-rice.edu>.
440
445
441 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
446 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
442
447
443 * IPython/irunner.py (main): modified irunner so it automatically
448 * IPython/irunner.py (main): modified irunner so it automatically
444 recognizes the right runner to use based on the extension (.py for
449 recognizes the right runner to use based on the extension (.py for
445 python, .ipy for ipython and .sage for sage).
450 python, .ipy for ipython and .sage for sage).
446
451
447 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
452 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
448 visible in ipapi as ip.config(), to programatically control the
453 visible in ipapi as ip.config(), to programatically control the
449 internal rc object. There's an accompanying %config magic for
454 internal rc object. There's an accompanying %config magic for
450 interactive use, which has been enhanced to match the
455 interactive use, which has been enhanced to match the
451 funtionality in ipconfig.
456 funtionality in ipconfig.
452
457
453 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
458 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
454 so it's not just a toggle, it now takes an argument. Add support
459 so it's not just a toggle, it now takes an argument. Add support
455 for a customizable header when making system calls, as the new
460 for a customizable header when making system calls, as the new
456 system_header variable in the ipythonrc file.
461 system_header variable in the ipythonrc file.
457
462
458 2006-11-03 Walter Doerwald <walter@livinglogic.de>
463 2006-11-03 Walter Doerwald <walter@livinglogic.de>
459
464
460 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
465 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
461 generic functions (using Philip J. Eby's simplegeneric package).
466 generic functions (using Philip J. Eby's simplegeneric package).
462 This makes it possible to customize the display of third-party classes
467 This makes it possible to customize the display of third-party classes
463 without having to monkeypatch them. xiter() no longer supports a mode
468 without having to monkeypatch them. xiter() no longer supports a mode
464 argument and the XMode class has been removed. The same functionality can
469 argument and the XMode class has been removed. The same functionality can
465 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
470 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
466 One consequence of the switch to generic functions is that xrepr() and
471 One consequence of the switch to generic functions is that xrepr() and
467 xattrs() implementation must define the default value for the mode
472 xattrs() implementation must define the default value for the mode
468 argument themselves and xattrs() implementations must return real
473 argument themselves and xattrs() implementations must return real
469 descriptors.
474 descriptors.
470
475
471 * IPython/external: This new subpackage will contain all third-party
476 * IPython/external: This new subpackage will contain all third-party
472 packages that are bundled with IPython. (The first one is simplegeneric).
477 packages that are bundled with IPython. (The first one is simplegeneric).
473
478
474 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
479 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
475 directory which as been dropped in r1703.
480 directory which as been dropped in r1703.
476
481
477 * IPython/Extensions/ipipe.py (iless): Fixed.
482 * IPython/Extensions/ipipe.py (iless): Fixed.
478
483
479 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
484 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
480
485
481 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
486 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
482
487
483 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
488 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
484 handling in variable expansion so that shells and magics recognize
489 handling in variable expansion so that shells and magics recognize
485 function local scopes correctly. Bug reported by Brian.
490 function local scopes correctly. Bug reported by Brian.
486
491
487 * scripts/ipython: remove the very first entry in sys.path which
492 * scripts/ipython: remove the very first entry in sys.path which
488 Python auto-inserts for scripts, so that sys.path under IPython is
493 Python auto-inserts for scripts, so that sys.path under IPython is
489 as similar as possible to that under plain Python.
494 as similar as possible to that under plain Python.
490
495
491 * IPython/completer.py (IPCompleter.file_matches): Fix
496 * IPython/completer.py (IPCompleter.file_matches): Fix
492 tab-completion so that quotes are not closed unless the completion
497 tab-completion so that quotes are not closed unless the completion
493 is unambiguous. After a request by Stefan. Minor cleanups in
498 is unambiguous. After a request by Stefan. Minor cleanups in
494 ipy_stock_completers.
499 ipy_stock_completers.
495
500
496 2006-11-02 Ville Vainio <vivainio@gmail.com>
501 2006-11-02 Ville Vainio <vivainio@gmail.com>
497
502
498 * ipy_stock_completers.py: Add %run and %cd completers.
503 * ipy_stock_completers.py: Add %run and %cd completers.
499
504
500 * completer.py: Try running custom completer for both
505 * completer.py: Try running custom completer for both
501 "foo" and "%foo" if the command is just "foo". Ignore case
506 "foo" and "%foo" if the command is just "foo". Ignore case
502 when filtering possible completions.
507 when filtering possible completions.
503
508
504 * UserConfig/ipy_user_conf.py: install stock completers as default
509 * UserConfig/ipy_user_conf.py: install stock completers as default
505
510
506 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
511 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
507 simplified readline history save / restore through a wrapper
512 simplified readline history save / restore through a wrapper
508 function
513 function
509
514
510
515
511 2006-10-31 Ville Vainio <vivainio@gmail.com>
516 2006-10-31 Ville Vainio <vivainio@gmail.com>
512
517
513 * strdispatch.py, completer.py, ipy_stock_completers.py:
518 * strdispatch.py, completer.py, ipy_stock_completers.py:
514 Allow str_key ("command") in completer hooks. Implement
519 Allow str_key ("command") in completer hooks. Implement
515 trivial completer for 'import' (stdlib modules only). Rename
520 trivial completer for 'import' (stdlib modules only). Rename
516 ipy_linux_package_managers.py to ipy_stock_completers.py.
521 ipy_linux_package_managers.py to ipy_stock_completers.py.
517 SVN completer.
522 SVN completer.
518
523
519 * Extensions/ledit.py: %magic line editor for easily and
524 * Extensions/ledit.py: %magic line editor for easily and
520 incrementally manipulating lists of strings. The magic command
525 incrementally manipulating lists of strings. The magic command
521 name is %led.
526 name is %led.
522
527
523 2006-10-30 Ville Vainio <vivainio@gmail.com>
528 2006-10-30 Ville Vainio <vivainio@gmail.com>
524
529
525 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
530 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
526 Bernsteins's patches for pydb integration.
531 Bernsteins's patches for pydb integration.
527 http://bashdb.sourceforge.net/pydb/
532 http://bashdb.sourceforge.net/pydb/
528
533
529 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
534 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
530 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
535 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
531 custom completer hook to allow the users to implement their own
536 custom completer hook to allow the users to implement their own
532 completers. See ipy_linux_package_managers.py for example. The
537 completers. See ipy_linux_package_managers.py for example. The
533 hook name is 'complete_command'.
538 hook name is 'complete_command'.
534
539
535 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
540 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
536
541
537 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
542 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
538 Numeric leftovers.
543 Numeric leftovers.
539
544
540 * ipython.el (py-execute-region): apply Stefan's patch to fix
545 * ipython.el (py-execute-region): apply Stefan's patch to fix
541 garbled results if the python shell hasn't been previously started.
546 garbled results if the python shell hasn't been previously started.
542
547
543 * IPython/genutils.py (arg_split): moved to genutils, since it's a
548 * IPython/genutils.py (arg_split): moved to genutils, since it's a
544 pretty generic function and useful for other things.
549 pretty generic function and useful for other things.
545
550
546 * IPython/OInspect.py (getsource): Add customizable source
551 * IPython/OInspect.py (getsource): Add customizable source
547 extractor. After a request/patch form W. Stein (SAGE).
552 extractor. After a request/patch form W. Stein (SAGE).
548
553
549 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
554 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
550 window size to a more reasonable value from what pexpect does,
555 window size to a more reasonable value from what pexpect does,
551 since their choice causes wrapping bugs with long input lines.
556 since their choice causes wrapping bugs with long input lines.
552
557
553 2006-10-28 Ville Vainio <vivainio@gmail.com>
558 2006-10-28 Ville Vainio <vivainio@gmail.com>
554
559
555 * Magic.py (%run): Save and restore the readline history from
560 * Magic.py (%run): Save and restore the readline history from
556 file around %run commands to prevent side effects from
561 file around %run commands to prevent side effects from
557 %runned programs that might use readline (e.g. pydb).
562 %runned programs that might use readline (e.g. pydb).
558
563
559 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
564 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
560 invoking the pydb enhanced debugger.
565 invoking the pydb enhanced debugger.
561
566
562 2006-10-23 Walter Doerwald <walter@livinglogic.de>
567 2006-10-23 Walter Doerwald <walter@livinglogic.de>
563
568
564 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
569 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
565 call the base class method and propagate the return value to
570 call the base class method and propagate the return value to
566 ifile. This is now done by path itself.
571 ifile. This is now done by path itself.
567
572
568 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
573 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
569
574
570 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
575 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
571 api: set_crash_handler(), to expose the ability to change the
576 api: set_crash_handler(), to expose the ability to change the
572 internal crash handler.
577 internal crash handler.
573
578
574 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
579 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
575 the various parameters of the crash handler so that apps using
580 the various parameters of the crash handler so that apps using
576 IPython as their engine can customize crash handling. Ipmlemented
581 IPython as their engine can customize crash handling. Ipmlemented
577 at the request of SAGE.
582 at the request of SAGE.
578
583
579 2006-10-14 Ville Vainio <vivainio@gmail.com>
584 2006-10-14 Ville Vainio <vivainio@gmail.com>
580
585
581 * Magic.py, ipython.el: applied first "safe" part of Rocky
586 * Magic.py, ipython.el: applied first "safe" part of Rocky
582 Bernstein's patch set for pydb integration.
587 Bernstein's patch set for pydb integration.
583
588
584 * Magic.py (%unalias, %alias): %store'd aliases can now be
589 * Magic.py (%unalias, %alias): %store'd aliases can now be
585 removed with '%unalias'. %alias w/o args now shows most
590 removed with '%unalias'. %alias w/o args now shows most
586 interesting (stored / manually defined) aliases last
591 interesting (stored / manually defined) aliases last
587 where they catch the eye w/o scrolling.
592 where they catch the eye w/o scrolling.
588
593
589 * Magic.py (%rehashx), ext_rehashdir.py: files with
594 * Magic.py (%rehashx), ext_rehashdir.py: files with
590 'py' extension are always considered executable, even
595 'py' extension are always considered executable, even
591 when not in PATHEXT environment variable.
596 when not in PATHEXT environment variable.
592
597
593 2006-10-12 Ville Vainio <vivainio@gmail.com>
598 2006-10-12 Ville Vainio <vivainio@gmail.com>
594
599
595 * jobctrl.py: Add new "jobctrl" extension for spawning background
600 * jobctrl.py: Add new "jobctrl" extension for spawning background
596 processes with "&find /". 'import jobctrl' to try it out. Requires
601 processes with "&find /". 'import jobctrl' to try it out. Requires
597 'subprocess' module, standard in python 2.4+.
602 'subprocess' module, standard in python 2.4+.
598
603
599 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
604 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
600 so if foo -> bar and bar -> baz, then foo -> baz.
605 so if foo -> bar and bar -> baz, then foo -> baz.
601
606
602 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
607 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
603
608
604 * IPython/Magic.py (Magic.parse_options): add a new posix option
609 * IPython/Magic.py (Magic.parse_options): add a new posix option
605 to allow parsing of input args in magics that doesn't strip quotes
610 to allow parsing of input args in magics that doesn't strip quotes
606 (if posix=False). This also closes %timeit bug reported by
611 (if posix=False). This also closes %timeit bug reported by
607 Stefan.
612 Stefan.
608
613
609 2006-10-03 Ville Vainio <vivainio@gmail.com>
614 2006-10-03 Ville Vainio <vivainio@gmail.com>
610
615
611 * iplib.py (raw_input, interact): Return ValueError catching for
616 * iplib.py (raw_input, interact): Return ValueError catching for
612 raw_input. Fixes infinite loop for sys.stdin.close() or
617 raw_input. Fixes infinite loop for sys.stdin.close() or
613 sys.stdout.close().
618 sys.stdout.close().
614
619
615 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
620 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
616
621
617 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
622 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
618 to help in handling doctests. irunner is now pretty useful for
623 to help in handling doctests. irunner is now pretty useful for
619 running standalone scripts and simulate a full interactive session
624 running standalone scripts and simulate a full interactive session
620 in a format that can be then pasted as a doctest.
625 in a format that can be then pasted as a doctest.
621
626
622 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
627 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
623 on top of the default (useless) ones. This also fixes the nasty
628 on top of the default (useless) ones. This also fixes the nasty
624 way in which 2.5's Quitter() exits (reverted [1785]).
629 way in which 2.5's Quitter() exits (reverted [1785]).
625
630
626 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
631 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
627 2.5.
632 2.5.
628
633
629 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
634 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
630 color scheme is updated as well when color scheme is changed
635 color scheme is updated as well when color scheme is changed
631 interactively.
636 interactively.
632
637
633 2006-09-27 Ville Vainio <vivainio@gmail.com>
638 2006-09-27 Ville Vainio <vivainio@gmail.com>
634
639
635 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
640 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
636 infinite loop and just exit. It's a hack, but will do for a while.
641 infinite loop and just exit. It's a hack, but will do for a while.
637
642
638 2006-08-25 Walter Doerwald <walter@livinglogic.de>
643 2006-08-25 Walter Doerwald <walter@livinglogic.de>
639
644
640 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
645 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
641 the constructor, this makes it possible to get a list of only directories
646 the constructor, this makes it possible to get a list of only directories
642 or only files.
647 or only files.
643
648
644 2006-08-12 Ville Vainio <vivainio@gmail.com>
649 2006-08-12 Ville Vainio <vivainio@gmail.com>
645
650
646 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
651 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
647 they broke unittest
652 they broke unittest
648
653
649 2006-08-11 Ville Vainio <vivainio@gmail.com>
654 2006-08-11 Ville Vainio <vivainio@gmail.com>
650
655
651 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
656 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
652 by resolving issue properly, i.e. by inheriting FakeModule
657 by resolving issue properly, i.e. by inheriting FakeModule
653 from types.ModuleType. Pickling ipython interactive data
658 from types.ModuleType. Pickling ipython interactive data
654 should still work as usual (testing appreciated).
659 should still work as usual (testing appreciated).
655
660
656 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
661 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
657
662
658 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
663 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
659 running under python 2.3 with code from 2.4 to fix a bug with
664 running under python 2.3 with code from 2.4 to fix a bug with
660 help(). Reported by the Debian maintainers, Norbert Tretkowski
665 help(). Reported by the Debian maintainers, Norbert Tretkowski
661 <norbert-AT-tretkowski.de> and Alexandre Fayolle
666 <norbert-AT-tretkowski.de> and Alexandre Fayolle
662 <afayolle-AT-debian.org>.
667 <afayolle-AT-debian.org>.
663
668
664 2006-08-04 Walter Doerwald <walter@livinglogic.de>
669 2006-08-04 Walter Doerwald <walter@livinglogic.de>
665
670
666 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
671 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
667 (which was displaying "quit" twice).
672 (which was displaying "quit" twice).
668
673
669 2006-07-28 Walter Doerwald <walter@livinglogic.de>
674 2006-07-28 Walter Doerwald <walter@livinglogic.de>
670
675
671 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
676 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
672 the mode argument).
677 the mode argument).
673
678
674 2006-07-27 Walter Doerwald <walter@livinglogic.de>
679 2006-07-27 Walter Doerwald <walter@livinglogic.de>
675
680
676 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
681 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
677 not running under IPython.
682 not running under IPython.
678
683
679 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
684 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
680 and make it iterable (iterating over the attribute itself). Add two new
685 and make it iterable (iterating over the attribute itself). Add two new
681 magic strings for __xattrs__(): If the string starts with "-", the attribute
686 magic strings for __xattrs__(): If the string starts with "-", the attribute
682 will not be displayed in ibrowse's detail view (but it can still be
687 will not be displayed in ibrowse's detail view (but it can still be
683 iterated over). This makes it possible to add attributes that are large
688 iterated over). This makes it possible to add attributes that are large
684 lists or generator methods to the detail view. Replace magic attribute names
689 lists or generator methods to the detail view. Replace magic attribute names
685 and _attrname() and _getattr() with "descriptors": For each type of magic
690 and _attrname() and _getattr() with "descriptors": For each type of magic
686 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
691 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
687 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
692 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
688 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
693 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
689 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
694 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
690 are still supported.
695 are still supported.
691
696
692 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
697 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
693 fails in ibrowse.fetch(), the exception object is added as the last item
698 fails in ibrowse.fetch(), the exception object is added as the last item
694 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
699 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
695 a generator throws an exception midway through execution.
700 a generator throws an exception midway through execution.
696
701
697 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
702 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
698 encoding into methods.
703 encoding into methods.
699
704
700 2006-07-26 Ville Vainio <vivainio@gmail.com>
705 2006-07-26 Ville Vainio <vivainio@gmail.com>
701
706
702 * iplib.py: history now stores multiline input as single
707 * iplib.py: history now stores multiline input as single
703 history entries. Patch by Jorgen Cederlof.
708 history entries. Patch by Jorgen Cederlof.
704
709
705 2006-07-18 Walter Doerwald <walter@livinglogic.de>
710 2006-07-18 Walter Doerwald <walter@livinglogic.de>
706
711
707 * IPython/Extensions/ibrowse.py: Make cursor visible over
712 * IPython/Extensions/ibrowse.py: Make cursor visible over
708 non existing attributes.
713 non existing attributes.
709
714
710 2006-07-14 Walter Doerwald <walter@livinglogic.de>
715 2006-07-14 Walter Doerwald <walter@livinglogic.de>
711
716
712 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
717 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
713 error output of the running command doesn't mess up the screen.
718 error output of the running command doesn't mess up the screen.
714
719
715 2006-07-13 Walter Doerwald <walter@livinglogic.de>
720 2006-07-13 Walter Doerwald <walter@livinglogic.de>
716
721
717 * IPython/Extensions/ipipe.py (isort): Make isort usable without
722 * IPython/Extensions/ipipe.py (isort): Make isort usable without
718 argument. This sorts the items themselves.
723 argument. This sorts the items themselves.
719
724
720 2006-07-12 Walter Doerwald <walter@livinglogic.de>
725 2006-07-12 Walter Doerwald <walter@livinglogic.de>
721
726
722 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
727 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
723 Compile expression strings into code objects. This should speed
728 Compile expression strings into code objects. This should speed
724 up ifilter and friends somewhat.
729 up ifilter and friends somewhat.
725
730
726 2006-07-08 Ville Vainio <vivainio@gmail.com>
731 2006-07-08 Ville Vainio <vivainio@gmail.com>
727
732
728 * Magic.py: %cpaste now strips > from the beginning of lines
733 * Magic.py: %cpaste now strips > from the beginning of lines
729 to ease pasting quoted code from emails. Contributed by
734 to ease pasting quoted code from emails. Contributed by
730 Stefan van der Walt.
735 Stefan van der Walt.
731
736
732 2006-06-29 Ville Vainio <vivainio@gmail.com>
737 2006-06-29 Ville Vainio <vivainio@gmail.com>
733
738
734 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
739 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
735 mode, patch contributed by Darren Dale. NEEDS TESTING!
740 mode, patch contributed by Darren Dale. NEEDS TESTING!
736
741
737 2006-06-28 Walter Doerwald <walter@livinglogic.de>
742 2006-06-28 Walter Doerwald <walter@livinglogic.de>
738
743
739 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
744 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
740 a blue background. Fix fetching new display rows when the browser
745 a blue background. Fix fetching new display rows when the browser
741 scrolls more than a screenful (e.g. by using the goto command).
746 scrolls more than a screenful (e.g. by using the goto command).
742
747
743 2006-06-27 Ville Vainio <vivainio@gmail.com>
748 2006-06-27 Ville Vainio <vivainio@gmail.com>
744
749
745 * Magic.py (_inspect, _ofind) Apply David Huard's
750 * Magic.py (_inspect, _ofind) Apply David Huard's
746 patch for displaying the correct docstring for 'property'
751 patch for displaying the correct docstring for 'property'
747 attributes.
752 attributes.
748
753
749 2006-06-23 Walter Doerwald <walter@livinglogic.de>
754 2006-06-23 Walter Doerwald <walter@livinglogic.de>
750
755
751 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
756 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
752 commands into the methods implementing them.
757 commands into the methods implementing them.
753
758
754 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
759 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
755
760
756 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
761 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
757 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
762 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
758 autoindent support was authored by Jin Liu.
763 autoindent support was authored by Jin Liu.
759
764
760 2006-06-22 Walter Doerwald <walter@livinglogic.de>
765 2006-06-22 Walter Doerwald <walter@livinglogic.de>
761
766
762 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
767 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
763 for keymaps with a custom class that simplifies handling.
768 for keymaps with a custom class that simplifies handling.
764
769
765 2006-06-19 Walter Doerwald <walter@livinglogic.de>
770 2006-06-19 Walter Doerwald <walter@livinglogic.de>
766
771
767 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
772 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
768 resizing. This requires Python 2.5 to work.
773 resizing. This requires Python 2.5 to work.
769
774
770 2006-06-16 Walter Doerwald <walter@livinglogic.de>
775 2006-06-16 Walter Doerwald <walter@livinglogic.de>
771
776
772 * IPython/Extensions/ibrowse.py: Add two new commands to
777 * IPython/Extensions/ibrowse.py: Add two new commands to
773 ibrowse: "hideattr" (mapped to "h") hides the attribute under
778 ibrowse: "hideattr" (mapped to "h") hides the attribute under
774 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
779 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
775 attributes again. Remapped the help command to "?". Display
780 attributes again. Remapped the help command to "?". Display
776 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
781 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
777 as keys for the "home" and "end" commands. Add three new commands
782 as keys for the "home" and "end" commands. Add three new commands
778 to the input mode for "find" and friends: "delend" (CTRL-K)
783 to the input mode for "find" and friends: "delend" (CTRL-K)
779 deletes to the end of line. "incsearchup" searches upwards in the
784 deletes to the end of line. "incsearchup" searches upwards in the
780 command history for an input that starts with the text before the cursor.
785 command history for an input that starts with the text before the cursor.
781 "incsearchdown" does the same downwards. Removed a bogus mapping of
786 "incsearchdown" does the same downwards. Removed a bogus mapping of
782 the x key to "delete".
787 the x key to "delete".
783
788
784 2006-06-15 Ville Vainio <vivainio@gmail.com>
789 2006-06-15 Ville Vainio <vivainio@gmail.com>
785
790
786 * iplib.py, hooks.py: Added new generate_prompt hook that can be
791 * iplib.py, hooks.py: Added new generate_prompt hook that can be
787 used to create prompts dynamically, instead of the "old" way of
792 used to create prompts dynamically, instead of the "old" way of
788 assigning "magic" strings to prompt_in1 and prompt_in2. The old
793 assigning "magic" strings to prompt_in1 and prompt_in2. The old
789 way still works (it's invoked by the default hook), of course.
794 way still works (it's invoked by the default hook), of course.
790
795
791 * Prompts.py: added generate_output_prompt hook for altering output
796 * Prompts.py: added generate_output_prompt hook for altering output
792 prompt
797 prompt
793
798
794 * Release.py: Changed version string to 0.7.3.svn.
799 * Release.py: Changed version string to 0.7.3.svn.
795
800
796 2006-06-15 Walter Doerwald <walter@livinglogic.de>
801 2006-06-15 Walter Doerwald <walter@livinglogic.de>
797
802
798 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
803 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
799 the call to fetch() always tries to fetch enough data for at least one
804 the call to fetch() always tries to fetch enough data for at least one
800 full screen. This makes it possible to simply call moveto(0,0,True) in
805 full screen. This makes it possible to simply call moveto(0,0,True) in
801 the constructor. Fix typos and removed the obsolete goto attribute.
806 the constructor. Fix typos and removed the obsolete goto attribute.
802
807
803 2006-06-12 Ville Vainio <vivainio@gmail.com>
808 2006-06-12 Ville Vainio <vivainio@gmail.com>
804
809
805 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
810 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
806 allowing $variable interpolation within multiline statements,
811 allowing $variable interpolation within multiline statements,
807 though so far only with "sh" profile for a testing period.
812 though so far only with "sh" profile for a testing period.
808 The patch also enables splitting long commands with \ but it
813 The patch also enables splitting long commands with \ but it
809 doesn't work properly yet.
814 doesn't work properly yet.
810
815
811 2006-06-12 Walter Doerwald <walter@livinglogic.de>
816 2006-06-12 Walter Doerwald <walter@livinglogic.de>
812
817
813 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
818 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
814 input history and the position of the cursor in the input history for
819 input history and the position of the cursor in the input history for
815 the find, findbackwards and goto command.
820 the find, findbackwards and goto command.
816
821
817 2006-06-10 Walter Doerwald <walter@livinglogic.de>
822 2006-06-10 Walter Doerwald <walter@livinglogic.de>
818
823
819 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
824 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
820 implements the basic functionality of browser commands that require
825 implements the basic functionality of browser commands that require
821 input. Reimplement the goto, find and findbackwards commands as
826 input. Reimplement the goto, find and findbackwards commands as
822 subclasses of _CommandInput. Add an input history and keymaps to those
827 subclasses of _CommandInput. Add an input history and keymaps to those
823 commands. Add "\r" as a keyboard shortcut for the enterdefault and
828 commands. Add "\r" as a keyboard shortcut for the enterdefault and
824 execute commands.
829 execute commands.
825
830
826 2006-06-07 Ville Vainio <vivainio@gmail.com>
831 2006-06-07 Ville Vainio <vivainio@gmail.com>
827
832
828 * iplib.py: ipython mybatch.ipy exits ipython immediately after
833 * iplib.py: ipython mybatch.ipy exits ipython immediately after
829 running the batch files instead of leaving the session open.
834 running the batch files instead of leaving the session open.
830
835
831 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
836 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
832
837
833 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
838 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
834 the original fix was incomplete. Patch submitted by W. Maier.
839 the original fix was incomplete. Patch submitted by W. Maier.
835
840
836 2006-06-07 Ville Vainio <vivainio@gmail.com>
841 2006-06-07 Ville Vainio <vivainio@gmail.com>
837
842
838 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
843 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
839 Confirmation prompts can be supressed by 'quiet' option.
844 Confirmation prompts can be supressed by 'quiet' option.
840 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
845 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
841
846
842 2006-06-06 *** Released version 0.7.2
847 2006-06-06 *** Released version 0.7.2
843
848
844 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
849 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
845
850
846 * IPython/Release.py (version): Made 0.7.2 final for release.
851 * IPython/Release.py (version): Made 0.7.2 final for release.
847 Repo tagged and release cut.
852 Repo tagged and release cut.
848
853
849 2006-06-05 Ville Vainio <vivainio@gmail.com>
854 2006-06-05 Ville Vainio <vivainio@gmail.com>
850
855
851 * Magic.py (magic_rehashx): Honor no_alias list earlier in
856 * Magic.py (magic_rehashx): Honor no_alias list earlier in
852 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
857 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
853
858
854 * upgrade_dir.py: try import 'path' module a bit harder
859 * upgrade_dir.py: try import 'path' module a bit harder
855 (for %upgrade)
860 (for %upgrade)
856
861
857 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
862 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
858
863
859 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
864 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
860 instead of looping 20 times.
865 instead of looping 20 times.
861
866
862 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
867 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
863 correctly at initialization time. Bug reported by Krishna Mohan
868 correctly at initialization time. Bug reported by Krishna Mohan
864 Gundu <gkmohan-AT-gmail.com> on the user list.
869 Gundu <gkmohan-AT-gmail.com> on the user list.
865
870
866 * IPython/Release.py (version): Mark 0.7.2 version to start
871 * IPython/Release.py (version): Mark 0.7.2 version to start
867 testing for release on 06/06.
872 testing for release on 06/06.
868
873
869 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
874 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
870
875
871 * scripts/irunner: thin script interface so users don't have to
876 * scripts/irunner: thin script interface so users don't have to
872 find the module and call it as an executable, since modules rarely
877 find the module and call it as an executable, since modules rarely
873 live in people's PATH.
878 live in people's PATH.
874
879
875 * IPython/irunner.py (InteractiveRunner.__init__): added
880 * IPython/irunner.py (InteractiveRunner.__init__): added
876 delaybeforesend attribute to control delays with newer versions of
881 delaybeforesend attribute to control delays with newer versions of
877 pexpect. Thanks to detailed help from pexpect's author, Noah
882 pexpect. Thanks to detailed help from pexpect's author, Noah
878 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
883 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
879 correctly (it works in NoColor mode).
884 correctly (it works in NoColor mode).
880
885
881 * IPython/iplib.py (handle_normal): fix nasty crash reported on
886 * IPython/iplib.py (handle_normal): fix nasty crash reported on
882 SAGE list, from improper log() calls.
887 SAGE list, from improper log() calls.
883
888
884 2006-05-31 Ville Vainio <vivainio@gmail.com>
889 2006-05-31 Ville Vainio <vivainio@gmail.com>
885
890
886 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
891 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
887 with args in parens to work correctly with dirs that have spaces.
892 with args in parens to work correctly with dirs that have spaces.
888
893
889 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
894 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
890
895
891 * IPython/Logger.py (Logger.logstart): add option to log raw input
896 * IPython/Logger.py (Logger.logstart): add option to log raw input
892 instead of the processed one. A -r flag was added to the
897 instead of the processed one. A -r flag was added to the
893 %logstart magic used for controlling logging.
898 %logstart magic used for controlling logging.
894
899
895 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
900 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
896
901
897 * IPython/iplib.py (InteractiveShell.__init__): add check for the
902 * IPython/iplib.py (InteractiveShell.__init__): add check for the
898 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
903 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
899 recognize the option. After a bug report by Will Maier. This
904 recognize the option. After a bug report by Will Maier. This
900 closes #64 (will do it after confirmation from W. Maier).
905 closes #64 (will do it after confirmation from W. Maier).
901
906
902 * IPython/irunner.py: New module to run scripts as if manually
907 * IPython/irunner.py: New module to run scripts as if manually
903 typed into an interactive environment, based on pexpect. After a
908 typed into an interactive environment, based on pexpect. After a
904 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
909 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
905 ipython-user list. Simple unittests in the tests/ directory.
910 ipython-user list. Simple unittests in the tests/ directory.
906
911
907 * tools/release: add Will Maier, OpenBSD port maintainer, to
912 * tools/release: add Will Maier, OpenBSD port maintainer, to
908 recepients list. We are now officially part of the OpenBSD ports:
913 recepients list. We are now officially part of the OpenBSD ports:
909 http://www.openbsd.org/ports.html ! Many thanks to Will for the
914 http://www.openbsd.org/ports.html ! Many thanks to Will for the
910 work.
915 work.
911
916
912 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
917 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
913
918
914 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
919 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
915 so that it doesn't break tkinter apps.
920 so that it doesn't break tkinter apps.
916
921
917 * IPython/iplib.py (_prefilter): fix bug where aliases would
922 * IPython/iplib.py (_prefilter): fix bug where aliases would
918 shadow variables when autocall was fully off. Reported by SAGE
923 shadow variables when autocall was fully off. Reported by SAGE
919 author William Stein.
924 author William Stein.
920
925
921 * IPython/OInspect.py (Inspector.__init__): add a flag to control
926 * IPython/OInspect.py (Inspector.__init__): add a flag to control
922 at what detail level strings are computed when foo? is requested.
927 at what detail level strings are computed when foo? is requested.
923 This allows users to ask for example that the string form of an
928 This allows users to ask for example that the string form of an
924 object is only computed when foo?? is called, or even never, by
929 object is only computed when foo?? is called, or even never, by
925 setting the object_info_string_level >= 2 in the configuration
930 setting the object_info_string_level >= 2 in the configuration
926 file. This new option has been added and documented. After a
931 file. This new option has been added and documented. After a
927 request by SAGE to be able to control the printing of very large
932 request by SAGE to be able to control the printing of very large
928 objects more easily.
933 objects more easily.
929
934
930 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
935 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
931
936
932 * IPython/ipmaker.py (make_IPython): remove the ipython call path
937 * IPython/ipmaker.py (make_IPython): remove the ipython call path
933 from sys.argv, to be 100% consistent with how Python itself works
938 from sys.argv, to be 100% consistent with how Python itself works
934 (as seen for example with python -i file.py). After a bug report
939 (as seen for example with python -i file.py). After a bug report
935 by Jeffrey Collins.
940 by Jeffrey Collins.
936
941
937 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
942 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
938 nasty bug which was preventing custom namespaces with -pylab,
943 nasty bug which was preventing custom namespaces with -pylab,
939 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
944 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
940 compatibility (long gone from mpl).
945 compatibility (long gone from mpl).
941
946
942 * IPython/ipapi.py (make_session): name change: create->make. We
947 * IPython/ipapi.py (make_session): name change: create->make. We
943 use make in other places (ipmaker,...), it's shorter and easier to
948 use make in other places (ipmaker,...), it's shorter and easier to
944 type and say, etc. I'm trying to clean things before 0.7.2 so
949 type and say, etc. I'm trying to clean things before 0.7.2 so
945 that I can keep things stable wrt to ipapi in the chainsaw branch.
950 that I can keep things stable wrt to ipapi in the chainsaw branch.
946
951
947 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
952 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
948 python-mode recognizes our debugger mode. Add support for
953 python-mode recognizes our debugger mode. Add support for
949 autoindent inside (X)emacs. After a patch sent in by Jin Liu
954 autoindent inside (X)emacs. After a patch sent in by Jin Liu
950 <m.liu.jin-AT-gmail.com> originally written by
955 <m.liu.jin-AT-gmail.com> originally written by
951 doxgen-AT-newsmth.net (with minor modifications for xemacs
956 doxgen-AT-newsmth.net (with minor modifications for xemacs
952 compatibility)
957 compatibility)
953
958
954 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
959 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
955 tracebacks when walking the stack so that the stack tracking system
960 tracebacks when walking the stack so that the stack tracking system
956 in emacs' python-mode can identify the frames correctly.
961 in emacs' python-mode can identify the frames correctly.
957
962
958 * IPython/ipmaker.py (make_IPython): make the internal (and
963 * IPython/ipmaker.py (make_IPython): make the internal (and
959 default config) autoedit_syntax value false by default. Too many
964 default config) autoedit_syntax value false by default. Too many
960 users have complained to me (both on and off-list) about problems
965 users have complained to me (both on and off-list) about problems
961 with this option being on by default, so I'm making it default to
966 with this option being on by default, so I'm making it default to
962 off. It can still be enabled by anyone via the usual mechanisms.
967 off. It can still be enabled by anyone via the usual mechanisms.
963
968
964 * IPython/completer.py (Completer.attr_matches): add support for
969 * IPython/completer.py (Completer.attr_matches): add support for
965 PyCrust-style _getAttributeNames magic method. Patch contributed
970 PyCrust-style _getAttributeNames magic method. Patch contributed
966 by <mscott-AT-goldenspud.com>. Closes #50.
971 by <mscott-AT-goldenspud.com>. Closes #50.
967
972
968 * IPython/iplib.py (InteractiveShell.__init__): remove the
973 * IPython/iplib.py (InteractiveShell.__init__): remove the
969 deletion of exit/quit from __builtin__, which can break
974 deletion of exit/quit from __builtin__, which can break
970 third-party tools like the Zope debugging console. The
975 third-party tools like the Zope debugging console. The
971 %exit/%quit magics remain. In general, it's probably a good idea
976 %exit/%quit magics remain. In general, it's probably a good idea
972 not to delete anything from __builtin__, since we never know what
977 not to delete anything from __builtin__, since we never know what
973 that will break. In any case, python now (for 2.5) will support
978 that will break. In any case, python now (for 2.5) will support
974 'real' exit/quit, so this issue is moot. Closes #55.
979 'real' exit/quit, so this issue is moot. Closes #55.
975
980
976 * IPython/genutils.py (with_obj): rename the 'with' function to
981 * IPython/genutils.py (with_obj): rename the 'with' function to
977 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
982 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
978 becomes a language keyword. Closes #53.
983 becomes a language keyword. Closes #53.
979
984
980 * IPython/FakeModule.py (FakeModule.__init__): add a proper
985 * IPython/FakeModule.py (FakeModule.__init__): add a proper
981 __file__ attribute to this so it fools more things into thinking
986 __file__ attribute to this so it fools more things into thinking
982 it is a real module. Closes #59.
987 it is a real module. Closes #59.
983
988
984 * IPython/Magic.py (magic_edit): add -n option to open the editor
989 * IPython/Magic.py (magic_edit): add -n option to open the editor
985 at a specific line number. After a patch by Stefan van der Walt.
990 at a specific line number. After a patch by Stefan van der Walt.
986
991
987 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
992 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
988
993
989 * IPython/iplib.py (edit_syntax_error): fix crash when for some
994 * IPython/iplib.py (edit_syntax_error): fix crash when for some
990 reason the file could not be opened. After automatic crash
995 reason the file could not be opened. After automatic crash
991 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
996 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
992 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
997 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
993 (_should_recompile): Don't fire editor if using %bg, since there
998 (_should_recompile): Don't fire editor if using %bg, since there
994 is no file in the first place. From the same report as above.
999 is no file in the first place. From the same report as above.
995 (raw_input): protect against faulty third-party prefilters. After
1000 (raw_input): protect against faulty third-party prefilters. After
996 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1001 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
997 while running under SAGE.
1002 while running under SAGE.
998
1003
999 2006-05-23 Ville Vainio <vivainio@gmail.com>
1004 2006-05-23 Ville Vainio <vivainio@gmail.com>
1000
1005
1001 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1006 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1002 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1007 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1003 now returns None (again), unless dummy is specifically allowed by
1008 now returns None (again), unless dummy is specifically allowed by
1004 ipapi.get(allow_dummy=True).
1009 ipapi.get(allow_dummy=True).
1005
1010
1006 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1011 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1007
1012
1008 * IPython: remove all 2.2-compatibility objects and hacks from
1013 * IPython: remove all 2.2-compatibility objects and hacks from
1009 everywhere, since we only support 2.3 at this point. Docs
1014 everywhere, since we only support 2.3 at this point. Docs
1010 updated.
1015 updated.
1011
1016
1012 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1017 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1013 Anything requiring extra validation can be turned into a Python
1018 Anything requiring extra validation can be turned into a Python
1014 property in the future. I used a property for the db one b/c
1019 property in the future. I used a property for the db one b/c
1015 there was a nasty circularity problem with the initialization
1020 there was a nasty circularity problem with the initialization
1016 order, which right now I don't have time to clean up.
1021 order, which right now I don't have time to clean up.
1017
1022
1018 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1023 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1019 another locking bug reported by Jorgen. I'm not 100% sure though,
1024 another locking bug reported by Jorgen. I'm not 100% sure though,
1020 so more testing is needed...
1025 so more testing is needed...
1021
1026
1022 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1027 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1023
1028
1024 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1029 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1025 local variables from any routine in user code (typically executed
1030 local variables from any routine in user code (typically executed
1026 with %run) directly into the interactive namespace. Very useful
1031 with %run) directly into the interactive namespace. Very useful
1027 when doing complex debugging.
1032 when doing complex debugging.
1028 (IPythonNotRunning): Changed the default None object to a dummy
1033 (IPythonNotRunning): Changed the default None object to a dummy
1029 whose attributes can be queried as well as called without
1034 whose attributes can be queried as well as called without
1030 exploding, to ease writing code which works transparently both in
1035 exploding, to ease writing code which works transparently both in
1031 and out of ipython and uses some of this API.
1036 and out of ipython and uses some of this API.
1032
1037
1033 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1038 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1034
1039
1035 * IPython/hooks.py (result_display): Fix the fact that our display
1040 * IPython/hooks.py (result_display): Fix the fact that our display
1036 hook was using str() instead of repr(), as the default python
1041 hook was using str() instead of repr(), as the default python
1037 console does. This had gone unnoticed b/c it only happened if
1042 console does. This had gone unnoticed b/c it only happened if
1038 %Pprint was off, but the inconsistency was there.
1043 %Pprint was off, but the inconsistency was there.
1039
1044
1040 2006-05-15 Ville Vainio <vivainio@gmail.com>
1045 2006-05-15 Ville Vainio <vivainio@gmail.com>
1041
1046
1042 * Oinspect.py: Only show docstring for nonexisting/binary files
1047 * Oinspect.py: Only show docstring for nonexisting/binary files
1043 when doing object??, closing ticket #62
1048 when doing object??, closing ticket #62
1044
1049
1045 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1050 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1046
1051
1047 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1052 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1048 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1053 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1049 was being released in a routine which hadn't checked if it had
1054 was being released in a routine which hadn't checked if it had
1050 been the one to acquire it.
1055 been the one to acquire it.
1051
1056
1052 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1057 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1053
1058
1054 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1059 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1055
1060
1056 2006-04-11 Ville Vainio <vivainio@gmail.com>
1061 2006-04-11 Ville Vainio <vivainio@gmail.com>
1057
1062
1058 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1063 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1059 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1064 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1060 prefilters, allowing stuff like magics and aliases in the file.
1065 prefilters, allowing stuff like magics and aliases in the file.
1061
1066
1062 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1067 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1063 added. Supported now are "%clear in" and "%clear out" (clear input and
1068 added. Supported now are "%clear in" and "%clear out" (clear input and
1064 output history, respectively). Also fixed CachedOutput.flush to
1069 output history, respectively). Also fixed CachedOutput.flush to
1065 properly flush the output cache.
1070 properly flush the output cache.
1066
1071
1067 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1072 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1068 half-success (and fail explicitly).
1073 half-success (and fail explicitly).
1069
1074
1070 2006-03-28 Ville Vainio <vivainio@gmail.com>
1075 2006-03-28 Ville Vainio <vivainio@gmail.com>
1071
1076
1072 * iplib.py: Fix quoting of aliases so that only argless ones
1077 * iplib.py: Fix quoting of aliases so that only argless ones
1073 are quoted
1078 are quoted
1074
1079
1075 2006-03-28 Ville Vainio <vivainio@gmail.com>
1080 2006-03-28 Ville Vainio <vivainio@gmail.com>
1076
1081
1077 * iplib.py: Quote aliases with spaces in the name.
1082 * iplib.py: Quote aliases with spaces in the name.
1078 "c:\program files\blah\bin" is now legal alias target.
1083 "c:\program files\blah\bin" is now legal alias target.
1079
1084
1080 * ext_rehashdir.py: Space no longer allowed as arg
1085 * ext_rehashdir.py: Space no longer allowed as arg
1081 separator, since space is legal in path names.
1086 separator, since space is legal in path names.
1082
1087
1083 2006-03-16 Ville Vainio <vivainio@gmail.com>
1088 2006-03-16 Ville Vainio <vivainio@gmail.com>
1084
1089
1085 * upgrade_dir.py: Take path.py from Extensions, correcting
1090 * upgrade_dir.py: Take path.py from Extensions, correcting
1086 %upgrade magic
1091 %upgrade magic
1087
1092
1088 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1093 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1089
1094
1090 * hooks.py: Only enclose editor binary in quotes if legal and
1095 * hooks.py: Only enclose editor binary in quotes if legal and
1091 necessary (space in the name, and is an existing file). Fixes a bug
1096 necessary (space in the name, and is an existing file). Fixes a bug
1092 reported by Zachary Pincus.
1097 reported by Zachary Pincus.
1093
1098
1094 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1099 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1095
1100
1096 * Manual: thanks to a tip on proper color handling for Emacs, by
1101 * Manual: thanks to a tip on proper color handling for Emacs, by
1097 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1102 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1098
1103
1099 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1104 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1100 by applying the provided patch. Thanks to Liu Jin
1105 by applying the provided patch. Thanks to Liu Jin
1101 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1106 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1102 XEmacs/Linux, I'm trusting the submitter that it actually helps
1107 XEmacs/Linux, I'm trusting the submitter that it actually helps
1103 under win32/GNU Emacs. Will revisit if any problems are reported.
1108 under win32/GNU Emacs. Will revisit if any problems are reported.
1104
1109
1105 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1110 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1106
1111
1107 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1112 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1108 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1113 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1109
1114
1110 2006-03-12 Ville Vainio <vivainio@gmail.com>
1115 2006-03-12 Ville Vainio <vivainio@gmail.com>
1111
1116
1112 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1117 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1113 Torsten Marek.
1118 Torsten Marek.
1114
1119
1115 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1120 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1116
1121
1117 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1122 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1118 line ranges works again.
1123 line ranges works again.
1119
1124
1120 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1125 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1121
1126
1122 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1127 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1123 and friends, after a discussion with Zach Pincus on ipython-user.
1128 and friends, after a discussion with Zach Pincus on ipython-user.
1124 I'm not 100% sure, but after thinking about it quite a bit, it may
1129 I'm not 100% sure, but after thinking about it quite a bit, it may
1125 be OK. Testing with the multithreaded shells didn't reveal any
1130 be OK. Testing with the multithreaded shells didn't reveal any
1126 problems, but let's keep an eye out.
1131 problems, but let's keep an eye out.
1127
1132
1128 In the process, I fixed a few things which were calling
1133 In the process, I fixed a few things which were calling
1129 self.InteractiveTB() directly (like safe_execfile), which is a
1134 self.InteractiveTB() directly (like safe_execfile), which is a
1130 mistake: ALL exception reporting should be done by calling
1135 mistake: ALL exception reporting should be done by calling
1131 self.showtraceback(), which handles state and tab-completion and
1136 self.showtraceback(), which handles state and tab-completion and
1132 more.
1137 more.
1133
1138
1134 2006-03-01 Ville Vainio <vivainio@gmail.com>
1139 2006-03-01 Ville Vainio <vivainio@gmail.com>
1135
1140
1136 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1141 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1137 To use, do "from ipipe import *".
1142 To use, do "from ipipe import *".
1138
1143
1139 2006-02-24 Ville Vainio <vivainio@gmail.com>
1144 2006-02-24 Ville Vainio <vivainio@gmail.com>
1140
1145
1141 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1146 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1142 "cleanly" and safely than the older upgrade mechanism.
1147 "cleanly" and safely than the older upgrade mechanism.
1143
1148
1144 2006-02-21 Ville Vainio <vivainio@gmail.com>
1149 2006-02-21 Ville Vainio <vivainio@gmail.com>
1145
1150
1146 * Magic.py: %save works again.
1151 * Magic.py: %save works again.
1147
1152
1148 2006-02-15 Ville Vainio <vivainio@gmail.com>
1153 2006-02-15 Ville Vainio <vivainio@gmail.com>
1149
1154
1150 * Magic.py: %Pprint works again
1155 * Magic.py: %Pprint works again
1151
1156
1152 * Extensions/ipy_sane_defaults.py: Provide everything provided
1157 * Extensions/ipy_sane_defaults.py: Provide everything provided
1153 in default ipythonrc, to make it possible to have a completely empty
1158 in default ipythonrc, to make it possible to have a completely empty
1154 ipythonrc (and thus completely rc-file free configuration)
1159 ipythonrc (and thus completely rc-file free configuration)
1155
1160
1156 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1161 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1157
1162
1158 * IPython/hooks.py (editor): quote the call to the editor command,
1163 * IPython/hooks.py (editor): quote the call to the editor command,
1159 to allow commands with spaces in them. Problem noted by watching
1164 to allow commands with spaces in them. Problem noted by watching
1160 Ian Oswald's video about textpad under win32 at
1165 Ian Oswald's video about textpad under win32 at
1161 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1166 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1162
1167
1163 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1168 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1164 describing magics (we haven't used @ for a loong time).
1169 describing magics (we haven't used @ for a loong time).
1165
1170
1166 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1171 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1167 contributed by marienz to close
1172 contributed by marienz to close
1168 http://www.scipy.net/roundup/ipython/issue53.
1173 http://www.scipy.net/roundup/ipython/issue53.
1169
1174
1170 2006-02-10 Ville Vainio <vivainio@gmail.com>
1175 2006-02-10 Ville Vainio <vivainio@gmail.com>
1171
1176
1172 * genutils.py: getoutput now works in win32 too
1177 * genutils.py: getoutput now works in win32 too
1173
1178
1174 * completer.py: alias and magic completion only invoked
1179 * completer.py: alias and magic completion only invoked
1175 at the first "item" in the line, to avoid "cd %store"
1180 at the first "item" in the line, to avoid "cd %store"
1176 nonsense.
1181 nonsense.
1177
1182
1178 2006-02-09 Ville Vainio <vivainio@gmail.com>
1183 2006-02-09 Ville Vainio <vivainio@gmail.com>
1179
1184
1180 * test/*: Added a unit testing framework (finally).
1185 * test/*: Added a unit testing framework (finally).
1181 '%run runtests.py' to run test_*.
1186 '%run runtests.py' to run test_*.
1182
1187
1183 * ipapi.py: Exposed runlines and set_custom_exc
1188 * ipapi.py: Exposed runlines and set_custom_exc
1184
1189
1185 2006-02-07 Ville Vainio <vivainio@gmail.com>
1190 2006-02-07 Ville Vainio <vivainio@gmail.com>
1186
1191
1187 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1192 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1188 instead use "f(1 2)" as before.
1193 instead use "f(1 2)" as before.
1189
1194
1190 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1195 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1191
1196
1192 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1197 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1193 facilities, for demos processed by the IPython input filter
1198 facilities, for demos processed by the IPython input filter
1194 (IPythonDemo), and for running a script one-line-at-a-time as a
1199 (IPythonDemo), and for running a script one-line-at-a-time as a
1195 demo, both for pure Python (LineDemo) and for IPython-processed
1200 demo, both for pure Python (LineDemo) and for IPython-processed
1196 input (IPythonLineDemo). After a request by Dave Kohel, from the
1201 input (IPythonLineDemo). After a request by Dave Kohel, from the
1197 SAGE team.
1202 SAGE team.
1198 (Demo.edit): added an edit() method to the demo objects, to edit
1203 (Demo.edit): added an edit() method to the demo objects, to edit
1199 the in-memory copy of the last executed block.
1204 the in-memory copy of the last executed block.
1200
1205
1201 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1206 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1202 processing to %edit, %macro and %save. These commands can now be
1207 processing to %edit, %macro and %save. These commands can now be
1203 invoked on the unprocessed input as it was typed by the user
1208 invoked on the unprocessed input as it was typed by the user
1204 (without any prefilters applied). After requests by the SAGE team
1209 (without any prefilters applied). After requests by the SAGE team
1205 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1210 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1206
1211
1207 2006-02-01 Ville Vainio <vivainio@gmail.com>
1212 2006-02-01 Ville Vainio <vivainio@gmail.com>
1208
1213
1209 * setup.py, eggsetup.py: easy_install ipython==dev works
1214 * setup.py, eggsetup.py: easy_install ipython==dev works
1210 correctly now (on Linux)
1215 correctly now (on Linux)
1211
1216
1212 * ipy_user_conf,ipmaker: user config changes, removed spurious
1217 * ipy_user_conf,ipmaker: user config changes, removed spurious
1213 warnings
1218 warnings
1214
1219
1215 * iplib: if rc.banner is string, use it as is.
1220 * iplib: if rc.banner is string, use it as is.
1216
1221
1217 * Magic: %pycat accepts a string argument and pages it's contents.
1222 * Magic: %pycat accepts a string argument and pages it's contents.
1218
1223
1219
1224
1220 2006-01-30 Ville Vainio <vivainio@gmail.com>
1225 2006-01-30 Ville Vainio <vivainio@gmail.com>
1221
1226
1222 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1227 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1223 Now %store and bookmarks work through PickleShare, meaning that
1228 Now %store and bookmarks work through PickleShare, meaning that
1224 concurrent access is possible and all ipython sessions see the
1229 concurrent access is possible and all ipython sessions see the
1225 same database situation all the time, instead of snapshot of
1230 same database situation all the time, instead of snapshot of
1226 the situation when the session was started. Hence, %bookmark
1231 the situation when the session was started. Hence, %bookmark
1227 results are immediately accessible from othes sessions. The database
1232 results are immediately accessible from othes sessions. The database
1228 is also available for use by user extensions. See:
1233 is also available for use by user extensions. See:
1229 http://www.python.org/pypi/pickleshare
1234 http://www.python.org/pypi/pickleshare
1230
1235
1231 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1236 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1232
1237
1233 * aliases can now be %store'd
1238 * aliases can now be %store'd
1234
1239
1235 * path.py moved to Extensions so that pickleshare does not need
1240 * path.py moved to Extensions so that pickleshare does not need
1236 IPython-specific import. Extensions added to pythonpath right
1241 IPython-specific import. Extensions added to pythonpath right
1237 at __init__.
1242 at __init__.
1238
1243
1239 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1244 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1240 called with _ip.system and the pre-transformed command string.
1245 called with _ip.system and the pre-transformed command string.
1241
1246
1242 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1247 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1243
1248
1244 * IPython/iplib.py (interact): Fix that we were not catching
1249 * IPython/iplib.py (interact): Fix that we were not catching
1245 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1250 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1246 logic here had to change, but it's fixed now.
1251 logic here had to change, but it's fixed now.
1247
1252
1248 2006-01-29 Ville Vainio <vivainio@gmail.com>
1253 2006-01-29 Ville Vainio <vivainio@gmail.com>
1249
1254
1250 * iplib.py: Try to import pyreadline on Windows.
1255 * iplib.py: Try to import pyreadline on Windows.
1251
1256
1252 2006-01-27 Ville Vainio <vivainio@gmail.com>
1257 2006-01-27 Ville Vainio <vivainio@gmail.com>
1253
1258
1254 * iplib.py: Expose ipapi as _ip in builtin namespace.
1259 * iplib.py: Expose ipapi as _ip in builtin namespace.
1255 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1260 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1256 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1261 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1257 syntax now produce _ip.* variant of the commands.
1262 syntax now produce _ip.* variant of the commands.
1258
1263
1259 * "_ip.options().autoedit_syntax = 2" automatically throws
1264 * "_ip.options().autoedit_syntax = 2" automatically throws
1260 user to editor for syntax error correction without prompting.
1265 user to editor for syntax error correction without prompting.
1261
1266
1262 2006-01-27 Ville Vainio <vivainio@gmail.com>
1267 2006-01-27 Ville Vainio <vivainio@gmail.com>
1263
1268
1264 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1269 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1265 'ipython' at argv[0]) executed through command line.
1270 'ipython' at argv[0]) executed through command line.
1266 NOTE: this DEPRECATES calling ipython with multiple scripts
1271 NOTE: this DEPRECATES calling ipython with multiple scripts
1267 ("ipython a.py b.py c.py")
1272 ("ipython a.py b.py c.py")
1268
1273
1269 * iplib.py, hooks.py: Added configurable input prefilter,
1274 * iplib.py, hooks.py: Added configurable input prefilter,
1270 named 'input_prefilter'. See ext_rescapture.py for example
1275 named 'input_prefilter'. See ext_rescapture.py for example
1271 usage.
1276 usage.
1272
1277
1273 * ext_rescapture.py, Magic.py: Better system command output capture
1278 * ext_rescapture.py, Magic.py: Better system command output capture
1274 through 'var = !ls' (deprecates user-visible %sc). Same notation
1279 through 'var = !ls' (deprecates user-visible %sc). Same notation
1275 applies for magics, 'var = %alias' assigns alias list to var.
1280 applies for magics, 'var = %alias' assigns alias list to var.
1276
1281
1277 * ipapi.py: added meta() for accessing extension-usable data store.
1282 * ipapi.py: added meta() for accessing extension-usable data store.
1278
1283
1279 * iplib.py: added InteractiveShell.getapi(). New magics should be
1284 * iplib.py: added InteractiveShell.getapi(). New magics should be
1280 written doing self.getapi() instead of using the shell directly.
1285 written doing self.getapi() instead of using the shell directly.
1281
1286
1282 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1287 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1283 %store foo >> ~/myfoo.txt to store variables to files (in clean
1288 %store foo >> ~/myfoo.txt to store variables to files (in clean
1284 textual form, not a restorable pickle).
1289 textual form, not a restorable pickle).
1285
1290
1286 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1291 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1287
1292
1288 * usage.py, Magic.py: added %quickref
1293 * usage.py, Magic.py: added %quickref
1289
1294
1290 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1295 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1291
1296
1292 * GetoptErrors when invoking magics etc. with wrong args
1297 * GetoptErrors when invoking magics etc. with wrong args
1293 are now more helpful:
1298 are now more helpful:
1294 GetoptError: option -l not recognized (allowed: "qb" )
1299 GetoptError: option -l not recognized (allowed: "qb" )
1295
1300
1296 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1301 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1297
1302
1298 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1303 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1299 computationally intensive blocks don't appear to stall the demo.
1304 computationally intensive blocks don't appear to stall the demo.
1300
1305
1301 2006-01-24 Ville Vainio <vivainio@gmail.com>
1306 2006-01-24 Ville Vainio <vivainio@gmail.com>
1302
1307
1303 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1308 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1304 value to manipulate resulting history entry.
1309 value to manipulate resulting history entry.
1305
1310
1306 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1311 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1307 to instance methods of IPApi class, to make extending an embedded
1312 to instance methods of IPApi class, to make extending an embedded
1308 IPython feasible. See ext_rehashdir.py for example usage.
1313 IPython feasible. See ext_rehashdir.py for example usage.
1309
1314
1310 * Merged 1071-1076 from branches/0.7.1
1315 * Merged 1071-1076 from branches/0.7.1
1311
1316
1312
1317
1313 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1318 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1314
1319
1315 * tools/release (daystamp): Fix build tools to use the new
1320 * tools/release (daystamp): Fix build tools to use the new
1316 eggsetup.py script to build lightweight eggs.
1321 eggsetup.py script to build lightweight eggs.
1317
1322
1318 * Applied changesets 1062 and 1064 before 0.7.1 release.
1323 * Applied changesets 1062 and 1064 before 0.7.1 release.
1319
1324
1320 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1325 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1321 see the raw input history (without conversions like %ls ->
1326 see the raw input history (without conversions like %ls ->
1322 ipmagic("ls")). After a request from W. Stein, SAGE
1327 ipmagic("ls")). After a request from W. Stein, SAGE
1323 (http://modular.ucsd.edu/sage) developer. This information is
1328 (http://modular.ucsd.edu/sage) developer. This information is
1324 stored in the input_hist_raw attribute of the IPython instance, so
1329 stored in the input_hist_raw attribute of the IPython instance, so
1325 developers can access it if needed (it's an InputList instance).
1330 developers can access it if needed (it's an InputList instance).
1326
1331
1327 * Versionstring = 0.7.2.svn
1332 * Versionstring = 0.7.2.svn
1328
1333
1329 * eggsetup.py: A separate script for constructing eggs, creates
1334 * eggsetup.py: A separate script for constructing eggs, creates
1330 proper launch scripts even on Windows (an .exe file in
1335 proper launch scripts even on Windows (an .exe file in
1331 \python24\scripts).
1336 \python24\scripts).
1332
1337
1333 * ipapi.py: launch_new_instance, launch entry point needed for the
1338 * ipapi.py: launch_new_instance, launch entry point needed for the
1334 egg.
1339 egg.
1335
1340
1336 2006-01-23 Ville Vainio <vivainio@gmail.com>
1341 2006-01-23 Ville Vainio <vivainio@gmail.com>
1337
1342
1338 * Added %cpaste magic for pasting python code
1343 * Added %cpaste magic for pasting python code
1339
1344
1340 2006-01-22 Ville Vainio <vivainio@gmail.com>
1345 2006-01-22 Ville Vainio <vivainio@gmail.com>
1341
1346
1342 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1347 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1343
1348
1344 * Versionstring = 0.7.2.svn
1349 * Versionstring = 0.7.2.svn
1345
1350
1346 * eggsetup.py: A separate script for constructing eggs, creates
1351 * eggsetup.py: A separate script for constructing eggs, creates
1347 proper launch scripts even on Windows (an .exe file in
1352 proper launch scripts even on Windows (an .exe file in
1348 \python24\scripts).
1353 \python24\scripts).
1349
1354
1350 * ipapi.py: launch_new_instance, launch entry point needed for the
1355 * ipapi.py: launch_new_instance, launch entry point needed for the
1351 egg.
1356 egg.
1352
1357
1353 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1358 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1354
1359
1355 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1360 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1356 %pfile foo would print the file for foo even if it was a binary.
1361 %pfile foo would print the file for foo even if it was a binary.
1357 Now, extensions '.so' and '.dll' are skipped.
1362 Now, extensions '.so' and '.dll' are skipped.
1358
1363
1359 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1364 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1360 bug, where macros would fail in all threaded modes. I'm not 100%
1365 bug, where macros would fail in all threaded modes. I'm not 100%
1361 sure, so I'm going to put out an rc instead of making a release
1366 sure, so I'm going to put out an rc instead of making a release
1362 today, and wait for feedback for at least a few days.
1367 today, and wait for feedback for at least a few days.
1363
1368
1364 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1369 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1365 it...) the handling of pasting external code with autoindent on.
1370 it...) the handling of pasting external code with autoindent on.
1366 To get out of a multiline input, the rule will appear for most
1371 To get out of a multiline input, the rule will appear for most
1367 users unchanged: two blank lines or change the indent level
1372 users unchanged: two blank lines or change the indent level
1368 proposed by IPython. But there is a twist now: you can
1373 proposed by IPython. But there is a twist now: you can
1369 add/subtract only *one or two spaces*. If you add/subtract three
1374 add/subtract only *one or two spaces*. If you add/subtract three
1370 or more (unless you completely delete the line), IPython will
1375 or more (unless you completely delete the line), IPython will
1371 accept that line, and you'll need to enter a second one of pure
1376 accept that line, and you'll need to enter a second one of pure
1372 whitespace. I know it sounds complicated, but I can't find a
1377 whitespace. I know it sounds complicated, but I can't find a
1373 different solution that covers all the cases, with the right
1378 different solution that covers all the cases, with the right
1374 heuristics. Hopefully in actual use, nobody will really notice
1379 heuristics. Hopefully in actual use, nobody will really notice
1375 all these strange rules and things will 'just work'.
1380 all these strange rules and things will 'just work'.
1376
1381
1377 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1382 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1378
1383
1379 * IPython/iplib.py (interact): catch exceptions which can be
1384 * IPython/iplib.py (interact): catch exceptions which can be
1380 triggered asynchronously by signal handlers. Thanks to an
1385 triggered asynchronously by signal handlers. Thanks to an
1381 automatic crash report, submitted by Colin Kingsley
1386 automatic crash report, submitted by Colin Kingsley
1382 <tercel-AT-gentoo.org>.
1387 <tercel-AT-gentoo.org>.
1383
1388
1384 2006-01-20 Ville Vainio <vivainio@gmail.com>
1389 2006-01-20 Ville Vainio <vivainio@gmail.com>
1385
1390
1386 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1391 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1387 (%rehashdir, very useful, try it out) of how to extend ipython
1392 (%rehashdir, very useful, try it out) of how to extend ipython
1388 with new magics. Also added Extensions dir to pythonpath to make
1393 with new magics. Also added Extensions dir to pythonpath to make
1389 importing extensions easy.
1394 importing extensions easy.
1390
1395
1391 * %store now complains when trying to store interactively declared
1396 * %store now complains when trying to store interactively declared
1392 classes / instances of those classes.
1397 classes / instances of those classes.
1393
1398
1394 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1399 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1395 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1400 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1396 if they exist, and ipy_user_conf.py with some defaults is created for
1401 if they exist, and ipy_user_conf.py with some defaults is created for
1397 the user.
1402 the user.
1398
1403
1399 * Startup rehashing done by the config file, not InterpreterExec.
1404 * Startup rehashing done by the config file, not InterpreterExec.
1400 This means system commands are available even without selecting the
1405 This means system commands are available even without selecting the
1401 pysh profile. It's the sensible default after all.
1406 pysh profile. It's the sensible default after all.
1402
1407
1403 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1408 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1404
1409
1405 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1410 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1406 multiline code with autoindent on working. But I am really not
1411 multiline code with autoindent on working. But I am really not
1407 sure, so this needs more testing. Will commit a debug-enabled
1412 sure, so this needs more testing. Will commit a debug-enabled
1408 version for now, while I test it some more, so that Ville and
1413 version for now, while I test it some more, so that Ville and
1409 others may also catch any problems. Also made
1414 others may also catch any problems. Also made
1410 self.indent_current_str() a method, to ensure that there's no
1415 self.indent_current_str() a method, to ensure that there's no
1411 chance of the indent space count and the corresponding string
1416 chance of the indent space count and the corresponding string
1412 falling out of sync. All code needing the string should just call
1417 falling out of sync. All code needing the string should just call
1413 the method.
1418 the method.
1414
1419
1415 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1420 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1416
1421
1417 * IPython/Magic.py (magic_edit): fix check for when users don't
1422 * IPython/Magic.py (magic_edit): fix check for when users don't
1418 save their output files, the try/except was in the wrong section.
1423 save their output files, the try/except was in the wrong section.
1419
1424
1420 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1425 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1421
1426
1422 * IPython/Magic.py (magic_run): fix __file__ global missing from
1427 * IPython/Magic.py (magic_run): fix __file__ global missing from
1423 script's namespace when executed via %run. After a report by
1428 script's namespace when executed via %run. After a report by
1424 Vivian.
1429 Vivian.
1425
1430
1426 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1431 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1427 when using python 2.4. The parent constructor changed in 2.4, and
1432 when using python 2.4. The parent constructor changed in 2.4, and
1428 we need to track it directly (we can't call it, as it messes up
1433 we need to track it directly (we can't call it, as it messes up
1429 readline and tab-completion inside our pdb would stop working).
1434 readline and tab-completion inside our pdb would stop working).
1430 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1435 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1431
1436
1432 2006-01-16 Ville Vainio <vivainio@gmail.com>
1437 2006-01-16 Ville Vainio <vivainio@gmail.com>
1433
1438
1434 * Ipython/magic.py: Reverted back to old %edit functionality
1439 * Ipython/magic.py: Reverted back to old %edit functionality
1435 that returns file contents on exit.
1440 that returns file contents on exit.
1436
1441
1437 * IPython/path.py: Added Jason Orendorff's "path" module to
1442 * IPython/path.py: Added Jason Orendorff's "path" module to
1438 IPython tree, http://www.jorendorff.com/articles/python/path/.
1443 IPython tree, http://www.jorendorff.com/articles/python/path/.
1439 You can get path objects conveniently through %sc, and !!, e.g.:
1444 You can get path objects conveniently through %sc, and !!, e.g.:
1440 sc files=ls
1445 sc files=ls
1441 for p in files.paths: # or files.p
1446 for p in files.paths: # or files.p
1442 print p,p.mtime
1447 print p,p.mtime
1443
1448
1444 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1449 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1445 now work again without considering the exclusion regexp -
1450 now work again without considering the exclusion regexp -
1446 hence, things like ',foo my/path' turn to 'foo("my/path")'
1451 hence, things like ',foo my/path' turn to 'foo("my/path")'
1447 instead of syntax error.
1452 instead of syntax error.
1448
1453
1449
1454
1450 2006-01-14 Ville Vainio <vivainio@gmail.com>
1455 2006-01-14 Ville Vainio <vivainio@gmail.com>
1451
1456
1452 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1457 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1453 ipapi decorators for python 2.4 users, options() provides access to rc
1458 ipapi decorators for python 2.4 users, options() provides access to rc
1454 data.
1459 data.
1455
1460
1456 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1461 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1457 as path separators (even on Linux ;-). Space character after
1462 as path separators (even on Linux ;-). Space character after
1458 backslash (as yielded by tab completer) is still space;
1463 backslash (as yielded by tab completer) is still space;
1459 "%cd long\ name" works as expected.
1464 "%cd long\ name" works as expected.
1460
1465
1461 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1466 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1462 as "chain of command", with priority. API stays the same,
1467 as "chain of command", with priority. API stays the same,
1463 TryNext exception raised by a hook function signals that
1468 TryNext exception raised by a hook function signals that
1464 current hook failed and next hook should try handling it, as
1469 current hook failed and next hook should try handling it, as
1465 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1470 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1466 requested configurable display hook, which is now implemented.
1471 requested configurable display hook, which is now implemented.
1467
1472
1468 2006-01-13 Ville Vainio <vivainio@gmail.com>
1473 2006-01-13 Ville Vainio <vivainio@gmail.com>
1469
1474
1470 * IPython/platutils*.py: platform specific utility functions,
1475 * IPython/platutils*.py: platform specific utility functions,
1471 so far only set_term_title is implemented (change terminal
1476 so far only set_term_title is implemented (change terminal
1472 label in windowing systems). %cd now changes the title to
1477 label in windowing systems). %cd now changes the title to
1473 current dir.
1478 current dir.
1474
1479
1475 * IPython/Release.py: Added myself to "authors" list,
1480 * IPython/Release.py: Added myself to "authors" list,
1476 had to create new files.
1481 had to create new files.
1477
1482
1478 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1483 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1479 shell escape; not a known bug but had potential to be one in the
1484 shell escape; not a known bug but had potential to be one in the
1480 future.
1485 future.
1481
1486
1482 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1487 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1483 extension API for IPython! See the module for usage example. Fix
1488 extension API for IPython! See the module for usage example. Fix
1484 OInspect for docstring-less magic functions.
1489 OInspect for docstring-less magic functions.
1485
1490
1486
1491
1487 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1492 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1488
1493
1489 * IPython/iplib.py (raw_input): temporarily deactivate all
1494 * IPython/iplib.py (raw_input): temporarily deactivate all
1490 attempts at allowing pasting of code with autoindent on. It
1495 attempts at allowing pasting of code with autoindent on. It
1491 introduced bugs (reported by Prabhu) and I can't seem to find a
1496 introduced bugs (reported by Prabhu) and I can't seem to find a
1492 robust combination which works in all cases. Will have to revisit
1497 robust combination which works in all cases. Will have to revisit
1493 later.
1498 later.
1494
1499
1495 * IPython/genutils.py: remove isspace() function. We've dropped
1500 * IPython/genutils.py: remove isspace() function. We've dropped
1496 2.2 compatibility, so it's OK to use the string method.
1501 2.2 compatibility, so it's OK to use the string method.
1497
1502
1498 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1503 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1499
1504
1500 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1505 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1501 matching what NOT to autocall on, to include all python binary
1506 matching what NOT to autocall on, to include all python binary
1502 operators (including things like 'and', 'or', 'is' and 'in').
1507 operators (including things like 'and', 'or', 'is' and 'in').
1503 Prompted by a bug report on 'foo & bar', but I realized we had
1508 Prompted by a bug report on 'foo & bar', but I realized we had
1504 many more potential bug cases with other operators. The regexp is
1509 many more potential bug cases with other operators. The regexp is
1505 self.re_exclude_auto, it's fairly commented.
1510 self.re_exclude_auto, it's fairly commented.
1506
1511
1507 2006-01-12 Ville Vainio <vivainio@gmail.com>
1512 2006-01-12 Ville Vainio <vivainio@gmail.com>
1508
1513
1509 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1514 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1510 Prettified and hardened string/backslash quoting with ipsystem(),
1515 Prettified and hardened string/backslash quoting with ipsystem(),
1511 ipalias() and ipmagic(). Now even \ characters are passed to
1516 ipalias() and ipmagic(). Now even \ characters are passed to
1512 %magics, !shell escapes and aliases exactly as they are in the
1517 %magics, !shell escapes and aliases exactly as they are in the
1513 ipython command line. Should improve backslash experience,
1518 ipython command line. Should improve backslash experience,
1514 particularly in Windows (path delimiter for some commands that
1519 particularly in Windows (path delimiter for some commands that
1515 won't understand '/'), but Unix benefits as well (regexps). %cd
1520 won't understand '/'), but Unix benefits as well (regexps). %cd
1516 magic still doesn't support backslash path delimiters, though. Also
1521 magic still doesn't support backslash path delimiters, though. Also
1517 deleted all pretense of supporting multiline command strings in
1522 deleted all pretense of supporting multiline command strings in
1518 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1523 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1519
1524
1520 * doc/build_doc_instructions.txt added. Documentation on how to
1525 * doc/build_doc_instructions.txt added. Documentation on how to
1521 use doc/update_manual.py, added yesterday. Both files contributed
1526 use doc/update_manual.py, added yesterday. Both files contributed
1522 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1527 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1523 doc/*.sh for deprecation at a later date.
1528 doc/*.sh for deprecation at a later date.
1524
1529
1525 * /ipython.py Added ipython.py to root directory for
1530 * /ipython.py Added ipython.py to root directory for
1526 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1531 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1527 ipython.py) and development convenience (no need to keep doing
1532 ipython.py) and development convenience (no need to keep doing
1528 "setup.py install" between changes).
1533 "setup.py install" between changes).
1529
1534
1530 * Made ! and !! shell escapes work (again) in multiline expressions:
1535 * Made ! and !! shell escapes work (again) in multiline expressions:
1531 if 1:
1536 if 1:
1532 !ls
1537 !ls
1533 !!ls
1538 !!ls
1534
1539
1535 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1540 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1536
1541
1537 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1542 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1538 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1543 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1539 module in case-insensitive installation. Was causing crashes
1544 module in case-insensitive installation. Was causing crashes
1540 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1545 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1541
1546
1542 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1547 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1543 <marienz-AT-gentoo.org>, closes
1548 <marienz-AT-gentoo.org>, closes
1544 http://www.scipy.net/roundup/ipython/issue51.
1549 http://www.scipy.net/roundup/ipython/issue51.
1545
1550
1546 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1551 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1547
1552
1548 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1553 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1549 problem of excessive CPU usage under *nix and keyboard lag under
1554 problem of excessive CPU usage under *nix and keyboard lag under
1550 win32.
1555 win32.
1551
1556
1552 2006-01-10 *** Released version 0.7.0
1557 2006-01-10 *** Released version 0.7.0
1553
1558
1554 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1559 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1555
1560
1556 * IPython/Release.py (revision): tag version number to 0.7.0,
1561 * IPython/Release.py (revision): tag version number to 0.7.0,
1557 ready for release.
1562 ready for release.
1558
1563
1559 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1564 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1560 it informs the user of the name of the temp. file used. This can
1565 it informs the user of the name of the temp. file used. This can
1561 help if you decide later to reuse that same file, so you know
1566 help if you decide later to reuse that same file, so you know
1562 where to copy the info from.
1567 where to copy the info from.
1563
1568
1564 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1569 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1565
1570
1566 * setup_bdist_egg.py: little script to build an egg. Added
1571 * setup_bdist_egg.py: little script to build an egg. Added
1567 support in the release tools as well.
1572 support in the release tools as well.
1568
1573
1569 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1574 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1570
1575
1571 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1576 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1572 version selection (new -wxversion command line and ipythonrc
1577 version selection (new -wxversion command line and ipythonrc
1573 parameter). Patch contributed by Arnd Baecker
1578 parameter). Patch contributed by Arnd Baecker
1574 <arnd.baecker-AT-web.de>.
1579 <arnd.baecker-AT-web.de>.
1575
1580
1576 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1581 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1577 embedded instances, for variables defined at the interactive
1582 embedded instances, for variables defined at the interactive
1578 prompt of the embedded ipython. Reported by Arnd.
1583 prompt of the embedded ipython. Reported by Arnd.
1579
1584
1580 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1585 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1581 it can be used as a (stateful) toggle, or with a direct parameter.
1586 it can be used as a (stateful) toggle, or with a direct parameter.
1582
1587
1583 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1588 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1584 could be triggered in certain cases and cause the traceback
1589 could be triggered in certain cases and cause the traceback
1585 printer not to work.
1590 printer not to work.
1586
1591
1587 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1592 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1588
1593
1589 * IPython/iplib.py (_should_recompile): Small fix, closes
1594 * IPython/iplib.py (_should_recompile): Small fix, closes
1590 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1595 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1591
1596
1592 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1597 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1593
1598
1594 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1599 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1595 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1600 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1596 Moad for help with tracking it down.
1601 Moad for help with tracking it down.
1597
1602
1598 * IPython/iplib.py (handle_auto): fix autocall handling for
1603 * IPython/iplib.py (handle_auto): fix autocall handling for
1599 objects which support BOTH __getitem__ and __call__ (so that f [x]
1604 objects which support BOTH __getitem__ and __call__ (so that f [x]
1600 is left alone, instead of becoming f([x]) automatically).
1605 is left alone, instead of becoming f([x]) automatically).
1601
1606
1602 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1607 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1603 Ville's patch.
1608 Ville's patch.
1604
1609
1605 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1610 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1606
1611
1607 * IPython/iplib.py (handle_auto): changed autocall semantics to
1612 * IPython/iplib.py (handle_auto): changed autocall semantics to
1608 include 'smart' mode, where the autocall transformation is NOT
1613 include 'smart' mode, where the autocall transformation is NOT
1609 applied if there are no arguments on the line. This allows you to
1614 applied if there are no arguments on the line. This allows you to
1610 just type 'foo' if foo is a callable to see its internal form,
1615 just type 'foo' if foo is a callable to see its internal form,
1611 instead of having it called with no arguments (typically a
1616 instead of having it called with no arguments (typically a
1612 mistake). The old 'full' autocall still exists: for that, you
1617 mistake). The old 'full' autocall still exists: for that, you
1613 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1618 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1614
1619
1615 * IPython/completer.py (Completer.attr_matches): add
1620 * IPython/completer.py (Completer.attr_matches): add
1616 tab-completion support for Enthoughts' traits. After a report by
1621 tab-completion support for Enthoughts' traits. After a report by
1617 Arnd and a patch by Prabhu.
1622 Arnd and a patch by Prabhu.
1618
1623
1619 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1624 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1620
1625
1621 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1626 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1622 Schmolck's patch to fix inspect.getinnerframes().
1627 Schmolck's patch to fix inspect.getinnerframes().
1623
1628
1624 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1629 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1625 for embedded instances, regarding handling of namespaces and items
1630 for embedded instances, regarding handling of namespaces and items
1626 added to the __builtin__ one. Multiple embedded instances and
1631 added to the __builtin__ one. Multiple embedded instances and
1627 recursive embeddings should work better now (though I'm not sure
1632 recursive embeddings should work better now (though I'm not sure
1628 I've got all the corner cases fixed, that code is a bit of a brain
1633 I've got all the corner cases fixed, that code is a bit of a brain
1629 twister).
1634 twister).
1630
1635
1631 * IPython/Magic.py (magic_edit): added support to edit in-memory
1636 * IPython/Magic.py (magic_edit): added support to edit in-memory
1632 macros (automatically creates the necessary temp files). %edit
1637 macros (automatically creates the necessary temp files). %edit
1633 also doesn't return the file contents anymore, it's just noise.
1638 also doesn't return the file contents anymore, it's just noise.
1634
1639
1635 * IPython/completer.py (Completer.attr_matches): revert change to
1640 * IPython/completer.py (Completer.attr_matches): revert change to
1636 complete only on attributes listed in __all__. I realized it
1641 complete only on attributes listed in __all__. I realized it
1637 cripples the tab-completion system as a tool for exploring the
1642 cripples the tab-completion system as a tool for exploring the
1638 internals of unknown libraries (it renders any non-__all__
1643 internals of unknown libraries (it renders any non-__all__
1639 attribute off-limits). I got bit by this when trying to see
1644 attribute off-limits). I got bit by this when trying to see
1640 something inside the dis module.
1645 something inside the dis module.
1641
1646
1642 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1647 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1643
1648
1644 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1649 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1645 namespace for users and extension writers to hold data in. This
1650 namespace for users and extension writers to hold data in. This
1646 follows the discussion in
1651 follows the discussion in
1647 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1652 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1648
1653
1649 * IPython/completer.py (IPCompleter.complete): small patch to help
1654 * IPython/completer.py (IPCompleter.complete): small patch to help
1650 tab-completion under Emacs, after a suggestion by John Barnard
1655 tab-completion under Emacs, after a suggestion by John Barnard
1651 <barnarj-AT-ccf.org>.
1656 <barnarj-AT-ccf.org>.
1652
1657
1653 * IPython/Magic.py (Magic.extract_input_slices): added support for
1658 * IPython/Magic.py (Magic.extract_input_slices): added support for
1654 the slice notation in magics to use N-M to represent numbers N...M
1659 the slice notation in magics to use N-M to represent numbers N...M
1655 (closed endpoints). This is used by %macro and %save.
1660 (closed endpoints). This is used by %macro and %save.
1656
1661
1657 * IPython/completer.py (Completer.attr_matches): for modules which
1662 * IPython/completer.py (Completer.attr_matches): for modules which
1658 define __all__, complete only on those. After a patch by Jeffrey
1663 define __all__, complete only on those. After a patch by Jeffrey
1659 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1664 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1660 speed up this routine.
1665 speed up this routine.
1661
1666
1662 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1667 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1663 don't know if this is the end of it, but the behavior now is
1668 don't know if this is the end of it, but the behavior now is
1664 certainly much more correct. Note that coupled with macros,
1669 certainly much more correct. Note that coupled with macros,
1665 slightly surprising (at first) behavior may occur: a macro will in
1670 slightly surprising (at first) behavior may occur: a macro will in
1666 general expand to multiple lines of input, so upon exiting, the
1671 general expand to multiple lines of input, so upon exiting, the
1667 in/out counters will both be bumped by the corresponding amount
1672 in/out counters will both be bumped by the corresponding amount
1668 (as if the macro's contents had been typed interactively). Typing
1673 (as if the macro's contents had been typed interactively). Typing
1669 %hist will reveal the intermediate (silently processed) lines.
1674 %hist will reveal the intermediate (silently processed) lines.
1670
1675
1671 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1676 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1672 pickle to fail (%run was overwriting __main__ and not restoring
1677 pickle to fail (%run was overwriting __main__ and not restoring
1673 it, but pickle relies on __main__ to operate).
1678 it, but pickle relies on __main__ to operate).
1674
1679
1675 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1680 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1676 using properties, but forgot to make the main InteractiveShell
1681 using properties, but forgot to make the main InteractiveShell
1677 class a new-style class. Properties fail silently, and
1682 class a new-style class. Properties fail silently, and
1678 mysteriously, with old-style class (getters work, but
1683 mysteriously, with old-style class (getters work, but
1679 setters don't do anything).
1684 setters don't do anything).
1680
1685
1681 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1686 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1682
1687
1683 * IPython/Magic.py (magic_history): fix history reporting bug (I
1688 * IPython/Magic.py (magic_history): fix history reporting bug (I
1684 know some nasties are still there, I just can't seem to find a
1689 know some nasties are still there, I just can't seem to find a
1685 reproducible test case to track them down; the input history is
1690 reproducible test case to track them down; the input history is
1686 falling out of sync...)
1691 falling out of sync...)
1687
1692
1688 * IPython/iplib.py (handle_shell_escape): fix bug where both
1693 * IPython/iplib.py (handle_shell_escape): fix bug where both
1689 aliases and system accesses where broken for indented code (such
1694 aliases and system accesses where broken for indented code (such
1690 as loops).
1695 as loops).
1691
1696
1692 * IPython/genutils.py (shell): fix small but critical bug for
1697 * IPython/genutils.py (shell): fix small but critical bug for
1693 win32 system access.
1698 win32 system access.
1694
1699
1695 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1700 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1696
1701
1697 * IPython/iplib.py (showtraceback): remove use of the
1702 * IPython/iplib.py (showtraceback): remove use of the
1698 sys.last_{type/value/traceback} structures, which are non
1703 sys.last_{type/value/traceback} structures, which are non
1699 thread-safe.
1704 thread-safe.
1700 (_prefilter): change control flow to ensure that we NEVER
1705 (_prefilter): change control flow to ensure that we NEVER
1701 introspect objects when autocall is off. This will guarantee that
1706 introspect objects when autocall is off. This will guarantee that
1702 having an input line of the form 'x.y', where access to attribute
1707 having an input line of the form 'x.y', where access to attribute
1703 'y' has side effects, doesn't trigger the side effect TWICE. It
1708 'y' has side effects, doesn't trigger the side effect TWICE. It
1704 is important to note that, with autocall on, these side effects
1709 is important to note that, with autocall on, these side effects
1705 can still happen.
1710 can still happen.
1706 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1711 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1707 trio. IPython offers these three kinds of special calls which are
1712 trio. IPython offers these three kinds of special calls which are
1708 not python code, and it's a good thing to have their call method
1713 not python code, and it's a good thing to have their call method
1709 be accessible as pure python functions (not just special syntax at
1714 be accessible as pure python functions (not just special syntax at
1710 the command line). It gives us a better internal implementation
1715 the command line). It gives us a better internal implementation
1711 structure, as well as exposing these for user scripting more
1716 structure, as well as exposing these for user scripting more
1712 cleanly.
1717 cleanly.
1713
1718
1714 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1719 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1715 file. Now that they'll be more likely to be used with the
1720 file. Now that they'll be more likely to be used with the
1716 persistance system (%store), I want to make sure their module path
1721 persistance system (%store), I want to make sure their module path
1717 doesn't change in the future, so that we don't break things for
1722 doesn't change in the future, so that we don't break things for
1718 users' persisted data.
1723 users' persisted data.
1719
1724
1720 * IPython/iplib.py (autoindent_update): move indentation
1725 * IPython/iplib.py (autoindent_update): move indentation
1721 management into the _text_ processing loop, not the keyboard
1726 management into the _text_ processing loop, not the keyboard
1722 interactive one. This is necessary to correctly process non-typed
1727 interactive one. This is necessary to correctly process non-typed
1723 multiline input (such as macros).
1728 multiline input (such as macros).
1724
1729
1725 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1730 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1726 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1731 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1727 which was producing problems in the resulting manual.
1732 which was producing problems in the resulting manual.
1728 (magic_whos): improve reporting of instances (show their class,
1733 (magic_whos): improve reporting of instances (show their class,
1729 instead of simply printing 'instance' which isn't terribly
1734 instead of simply printing 'instance' which isn't terribly
1730 informative).
1735 informative).
1731
1736
1732 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1737 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1733 (minor mods) to support network shares under win32.
1738 (minor mods) to support network shares under win32.
1734
1739
1735 * IPython/winconsole.py (get_console_size): add new winconsole
1740 * IPython/winconsole.py (get_console_size): add new winconsole
1736 module and fixes to page_dumb() to improve its behavior under
1741 module and fixes to page_dumb() to improve its behavior under
1737 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1742 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1738
1743
1739 * IPython/Magic.py (Macro): simplified Macro class to just
1744 * IPython/Magic.py (Macro): simplified Macro class to just
1740 subclass list. We've had only 2.2 compatibility for a very long
1745 subclass list. We've had only 2.2 compatibility for a very long
1741 time, yet I was still avoiding subclassing the builtin types. No
1746 time, yet I was still avoiding subclassing the builtin types. No
1742 more (I'm also starting to use properties, though I won't shift to
1747 more (I'm also starting to use properties, though I won't shift to
1743 2.3-specific features quite yet).
1748 2.3-specific features quite yet).
1744 (magic_store): added Ville's patch for lightweight variable
1749 (magic_store): added Ville's patch for lightweight variable
1745 persistence, after a request on the user list by Matt Wilkie
1750 persistence, after a request on the user list by Matt Wilkie
1746 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1751 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1747 details.
1752 details.
1748
1753
1749 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1754 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1750 changed the default logfile name from 'ipython.log' to
1755 changed the default logfile name from 'ipython.log' to
1751 'ipython_log.py'. These logs are real python files, and now that
1756 'ipython_log.py'. These logs are real python files, and now that
1752 we have much better multiline support, people are more likely to
1757 we have much better multiline support, people are more likely to
1753 want to use them as such. Might as well name them correctly.
1758 want to use them as such. Might as well name them correctly.
1754
1759
1755 * IPython/Magic.py: substantial cleanup. While we can't stop
1760 * IPython/Magic.py: substantial cleanup. While we can't stop
1756 using magics as mixins, due to the existing customizations 'out
1761 using magics as mixins, due to the existing customizations 'out
1757 there' which rely on the mixin naming conventions, at least I
1762 there' which rely on the mixin naming conventions, at least I
1758 cleaned out all cross-class name usage. So once we are OK with
1763 cleaned out all cross-class name usage. So once we are OK with
1759 breaking compatibility, the two systems can be separated.
1764 breaking compatibility, the two systems can be separated.
1760
1765
1761 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1766 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1762 anymore, and the class is a fair bit less hideous as well. New
1767 anymore, and the class is a fair bit less hideous as well. New
1763 features were also introduced: timestamping of input, and logging
1768 features were also introduced: timestamping of input, and logging
1764 of output results. These are user-visible with the -t and -o
1769 of output results. These are user-visible with the -t and -o
1765 options to %logstart. Closes
1770 options to %logstart. Closes
1766 http://www.scipy.net/roundup/ipython/issue11 and a request by
1771 http://www.scipy.net/roundup/ipython/issue11 and a request by
1767 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1772 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1768
1773
1769 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1774 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1770
1775
1771 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1776 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1772 better handle backslashes in paths. See the thread 'More Windows
1777 better handle backslashes in paths. See the thread 'More Windows
1773 questions part 2 - \/ characters revisited' on the iypthon user
1778 questions part 2 - \/ characters revisited' on the iypthon user
1774 list:
1779 list:
1775 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1780 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1776
1781
1777 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1782 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1778
1783
1779 (InteractiveShell.__init__): change threaded shells to not use the
1784 (InteractiveShell.__init__): change threaded shells to not use the
1780 ipython crash handler. This was causing more problems than not,
1785 ipython crash handler. This was causing more problems than not,
1781 as exceptions in the main thread (GUI code, typically) would
1786 as exceptions in the main thread (GUI code, typically) would
1782 always show up as a 'crash', when they really weren't.
1787 always show up as a 'crash', when they really weren't.
1783
1788
1784 The colors and exception mode commands (%colors/%xmode) have been
1789 The colors and exception mode commands (%colors/%xmode) have been
1785 synchronized to also take this into account, so users can get
1790 synchronized to also take this into account, so users can get
1786 verbose exceptions for their threaded code as well. I also added
1791 verbose exceptions for their threaded code as well. I also added
1787 support for activating pdb inside this exception handler as well,
1792 support for activating pdb inside this exception handler as well,
1788 so now GUI authors can use IPython's enhanced pdb at runtime.
1793 so now GUI authors can use IPython's enhanced pdb at runtime.
1789
1794
1790 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1795 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1791 true by default, and add it to the shipped ipythonrc file. Since
1796 true by default, and add it to the shipped ipythonrc file. Since
1792 this asks the user before proceeding, I think it's OK to make it
1797 this asks the user before proceeding, I think it's OK to make it
1793 true by default.
1798 true by default.
1794
1799
1795 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1800 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1796 of the previous special-casing of input in the eval loop. I think
1801 of the previous special-casing of input in the eval loop. I think
1797 this is cleaner, as they really are commands and shouldn't have
1802 this is cleaner, as they really are commands and shouldn't have
1798 a special role in the middle of the core code.
1803 a special role in the middle of the core code.
1799
1804
1800 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1805 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1801
1806
1802 * IPython/iplib.py (edit_syntax_error): added support for
1807 * IPython/iplib.py (edit_syntax_error): added support for
1803 automatically reopening the editor if the file had a syntax error
1808 automatically reopening the editor if the file had a syntax error
1804 in it. Thanks to scottt who provided the patch at:
1809 in it. Thanks to scottt who provided the patch at:
1805 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1810 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1806 version committed).
1811 version committed).
1807
1812
1808 * IPython/iplib.py (handle_normal): add suport for multi-line
1813 * IPython/iplib.py (handle_normal): add suport for multi-line
1809 input with emtpy lines. This fixes
1814 input with emtpy lines. This fixes
1810 http://www.scipy.net/roundup/ipython/issue43 and a similar
1815 http://www.scipy.net/roundup/ipython/issue43 and a similar
1811 discussion on the user list.
1816 discussion on the user list.
1812
1817
1813 WARNING: a behavior change is necessarily introduced to support
1818 WARNING: a behavior change is necessarily introduced to support
1814 blank lines: now a single blank line with whitespace does NOT
1819 blank lines: now a single blank line with whitespace does NOT
1815 break the input loop, which means that when autoindent is on, by
1820 break the input loop, which means that when autoindent is on, by
1816 default hitting return on the next (indented) line does NOT exit.
1821 default hitting return on the next (indented) line does NOT exit.
1817
1822
1818 Instead, to exit a multiline input you can either have:
1823 Instead, to exit a multiline input you can either have:
1819
1824
1820 - TWO whitespace lines (just hit return again), or
1825 - TWO whitespace lines (just hit return again), or
1821 - a single whitespace line of a different length than provided
1826 - a single whitespace line of a different length than provided
1822 by the autoindent (add or remove a space).
1827 by the autoindent (add or remove a space).
1823
1828
1824 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1829 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1825 module to better organize all readline-related functionality.
1830 module to better organize all readline-related functionality.
1826 I've deleted FlexCompleter and put all completion clases here.
1831 I've deleted FlexCompleter and put all completion clases here.
1827
1832
1828 * IPython/iplib.py (raw_input): improve indentation management.
1833 * IPython/iplib.py (raw_input): improve indentation management.
1829 It is now possible to paste indented code with autoindent on, and
1834 It is now possible to paste indented code with autoindent on, and
1830 the code is interpreted correctly (though it still looks bad on
1835 the code is interpreted correctly (though it still looks bad on
1831 screen, due to the line-oriented nature of ipython).
1836 screen, due to the line-oriented nature of ipython).
1832 (MagicCompleter.complete): change behavior so that a TAB key on an
1837 (MagicCompleter.complete): change behavior so that a TAB key on an
1833 otherwise empty line actually inserts a tab, instead of completing
1838 otherwise empty line actually inserts a tab, instead of completing
1834 on the entire global namespace. This makes it easier to use the
1839 on the entire global namespace. This makes it easier to use the
1835 TAB key for indentation. After a request by Hans Meine
1840 TAB key for indentation. After a request by Hans Meine
1836 <hans_meine-AT-gmx.net>
1841 <hans_meine-AT-gmx.net>
1837 (_prefilter): add support so that typing plain 'exit' or 'quit'
1842 (_prefilter): add support so that typing plain 'exit' or 'quit'
1838 does a sensible thing. Originally I tried to deviate as little as
1843 does a sensible thing. Originally I tried to deviate as little as
1839 possible from the default python behavior, but even that one may
1844 possible from the default python behavior, but even that one may
1840 change in this direction (thread on python-dev to that effect).
1845 change in this direction (thread on python-dev to that effect).
1841 Regardless, ipython should do the right thing even if CPython's
1846 Regardless, ipython should do the right thing even if CPython's
1842 '>>>' prompt doesn't.
1847 '>>>' prompt doesn't.
1843 (InteractiveShell): removed subclassing code.InteractiveConsole
1848 (InteractiveShell): removed subclassing code.InteractiveConsole
1844 class. By now we'd overridden just about all of its methods: I've
1849 class. By now we'd overridden just about all of its methods: I've
1845 copied the remaining two over, and now ipython is a standalone
1850 copied the remaining two over, and now ipython is a standalone
1846 class. This will provide a clearer picture for the chainsaw
1851 class. This will provide a clearer picture for the chainsaw
1847 branch refactoring.
1852 branch refactoring.
1848
1853
1849 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1854 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1850
1855
1851 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1856 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1852 failures for objects which break when dir() is called on them.
1857 failures for objects which break when dir() is called on them.
1853
1858
1854 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1859 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1855 distinct local and global namespaces in the completer API. This
1860 distinct local and global namespaces in the completer API. This
1856 change allows us to properly handle completion with distinct
1861 change allows us to properly handle completion with distinct
1857 scopes, including in embedded instances (this had never really
1862 scopes, including in embedded instances (this had never really
1858 worked correctly).
1863 worked correctly).
1859
1864
1860 Note: this introduces a change in the constructor for
1865 Note: this introduces a change in the constructor for
1861 MagicCompleter, as a new global_namespace parameter is now the
1866 MagicCompleter, as a new global_namespace parameter is now the
1862 second argument (the others were bumped one position).
1867 second argument (the others were bumped one position).
1863
1868
1864 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1869 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1865
1870
1866 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1871 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1867 embedded instances (which can be done now thanks to Vivian's
1872 embedded instances (which can be done now thanks to Vivian's
1868 frame-handling fixes for pdb).
1873 frame-handling fixes for pdb).
1869 (InteractiveShell.__init__): Fix namespace handling problem in
1874 (InteractiveShell.__init__): Fix namespace handling problem in
1870 embedded instances. We were overwriting __main__ unconditionally,
1875 embedded instances. We were overwriting __main__ unconditionally,
1871 and this should only be done for 'full' (non-embedded) IPython;
1876 and this should only be done for 'full' (non-embedded) IPython;
1872 embedded instances must respect the caller's __main__. Thanks to
1877 embedded instances must respect the caller's __main__. Thanks to
1873 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1878 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1874
1879
1875 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1880 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1876
1881
1877 * setup.py: added download_url to setup(). This registers the
1882 * setup.py: added download_url to setup(). This registers the
1878 download address at PyPI, which is not only useful to humans
1883 download address at PyPI, which is not only useful to humans
1879 browsing the site, but is also picked up by setuptools (the Eggs
1884 browsing the site, but is also picked up by setuptools (the Eggs
1880 machinery). Thanks to Ville and R. Kern for the info/discussion
1885 machinery). Thanks to Ville and R. Kern for the info/discussion
1881 on this.
1886 on this.
1882
1887
1883 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1888 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1884
1889
1885 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1890 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1886 This brings a lot of nice functionality to the pdb mode, which now
1891 This brings a lot of nice functionality to the pdb mode, which now
1887 has tab-completion, syntax highlighting, and better stack handling
1892 has tab-completion, syntax highlighting, and better stack handling
1888 than before. Many thanks to Vivian De Smedt
1893 than before. Many thanks to Vivian De Smedt
1889 <vivian-AT-vdesmedt.com> for the original patches.
1894 <vivian-AT-vdesmedt.com> for the original patches.
1890
1895
1891 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1896 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1892
1897
1893 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1898 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1894 sequence to consistently accept the banner argument. The
1899 sequence to consistently accept the banner argument. The
1895 inconsistency was tripping SAGE, thanks to Gary Zablackis
1900 inconsistency was tripping SAGE, thanks to Gary Zablackis
1896 <gzabl-AT-yahoo.com> for the report.
1901 <gzabl-AT-yahoo.com> for the report.
1897
1902
1898 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1903 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1899
1904
1900 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1905 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1901 Fix bug where a naked 'alias' call in the ipythonrc file would
1906 Fix bug where a naked 'alias' call in the ipythonrc file would
1902 cause a crash. Bug reported by Jorgen Stenarson.
1907 cause a crash. Bug reported by Jorgen Stenarson.
1903
1908
1904 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1909 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1905
1910
1906 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1911 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1907 startup time.
1912 startup time.
1908
1913
1909 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1914 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1910 instances had introduced a bug with globals in normal code. Now
1915 instances had introduced a bug with globals in normal code. Now
1911 it's working in all cases.
1916 it's working in all cases.
1912
1917
1913 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1918 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1914 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1919 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1915 has been introduced to set the default case sensitivity of the
1920 has been introduced to set the default case sensitivity of the
1916 searches. Users can still select either mode at runtime on a
1921 searches. Users can still select either mode at runtime on a
1917 per-search basis.
1922 per-search basis.
1918
1923
1919 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1924 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1920
1925
1921 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1926 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1922 attributes in wildcard searches for subclasses. Modified version
1927 attributes in wildcard searches for subclasses. Modified version
1923 of a patch by Jorgen.
1928 of a patch by Jorgen.
1924
1929
1925 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1930 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1926
1931
1927 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1932 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1928 embedded instances. I added a user_global_ns attribute to the
1933 embedded instances. I added a user_global_ns attribute to the
1929 InteractiveShell class to handle this.
1934 InteractiveShell class to handle this.
1930
1935
1931 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1936 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1932
1937
1933 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1938 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1934 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1939 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1935 (reported under win32, but may happen also in other platforms).
1940 (reported under win32, but may happen also in other platforms).
1936 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1941 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1937
1942
1938 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1943 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1939
1944
1940 * IPython/Magic.py (magic_psearch): new support for wildcard
1945 * IPython/Magic.py (magic_psearch): new support for wildcard
1941 patterns. Now, typing ?a*b will list all names which begin with a
1946 patterns. Now, typing ?a*b will list all names which begin with a
1942 and end in b, for example. The %psearch magic has full
1947 and end in b, for example. The %psearch magic has full
1943 docstrings. Many thanks to JΓΆrgen Stenarson
1948 docstrings. Many thanks to JΓΆrgen Stenarson
1944 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1949 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1945 implementing this functionality.
1950 implementing this functionality.
1946
1951
1947 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1952 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1948
1953
1949 * Manual: fixed long-standing annoyance of double-dashes (as in
1954 * Manual: fixed long-standing annoyance of double-dashes (as in
1950 --prefix=~, for example) being stripped in the HTML version. This
1955 --prefix=~, for example) being stripped in the HTML version. This
1951 is a latex2html bug, but a workaround was provided. Many thanks
1956 is a latex2html bug, but a workaround was provided. Many thanks
1952 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1957 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1953 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1958 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1954 rolling. This seemingly small issue had tripped a number of users
1959 rolling. This seemingly small issue had tripped a number of users
1955 when first installing, so I'm glad to see it gone.
1960 when first installing, so I'm glad to see it gone.
1956
1961
1957 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1962 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1958
1963
1959 * IPython/Extensions/numeric_formats.py: fix missing import,
1964 * IPython/Extensions/numeric_formats.py: fix missing import,
1960 reported by Stephen Walton.
1965 reported by Stephen Walton.
1961
1966
1962 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1967 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1963
1968
1964 * IPython/demo.py: finish demo module, fully documented now.
1969 * IPython/demo.py: finish demo module, fully documented now.
1965
1970
1966 * IPython/genutils.py (file_read): simple little utility to read a
1971 * IPython/genutils.py (file_read): simple little utility to read a
1967 file and ensure it's closed afterwards.
1972 file and ensure it's closed afterwards.
1968
1973
1969 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1974 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1970
1975
1971 * IPython/demo.py (Demo.__init__): added support for individually
1976 * IPython/demo.py (Demo.__init__): added support for individually
1972 tagging blocks for automatic execution.
1977 tagging blocks for automatic execution.
1973
1978
1974 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1979 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1975 syntax-highlighted python sources, requested by John.
1980 syntax-highlighted python sources, requested by John.
1976
1981
1977 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1982 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1978
1983
1979 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1984 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1980 finishing.
1985 finishing.
1981
1986
1982 * IPython/genutils.py (shlex_split): moved from Magic to here,
1987 * IPython/genutils.py (shlex_split): moved from Magic to here,
1983 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1988 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1984
1989
1985 * IPython/demo.py (Demo.__init__): added support for silent
1990 * IPython/demo.py (Demo.__init__): added support for silent
1986 blocks, improved marks as regexps, docstrings written.
1991 blocks, improved marks as regexps, docstrings written.
1987 (Demo.__init__): better docstring, added support for sys.argv.
1992 (Demo.__init__): better docstring, added support for sys.argv.
1988
1993
1989 * IPython/genutils.py (marquee): little utility used by the demo
1994 * IPython/genutils.py (marquee): little utility used by the demo
1990 code, handy in general.
1995 code, handy in general.
1991
1996
1992 * IPython/demo.py (Demo.__init__): new class for interactive
1997 * IPython/demo.py (Demo.__init__): new class for interactive
1993 demos. Not documented yet, I just wrote it in a hurry for
1998 demos. Not documented yet, I just wrote it in a hurry for
1994 scipy'05. Will docstring later.
1999 scipy'05. Will docstring later.
1995
2000
1996 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2001 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1997
2002
1998 * IPython/Shell.py (sigint_handler): Drastic simplification which
2003 * IPython/Shell.py (sigint_handler): Drastic simplification which
1999 also seems to make Ctrl-C work correctly across threads! This is
2004 also seems to make Ctrl-C work correctly across threads! This is
2000 so simple, that I can't beleive I'd missed it before. Needs more
2005 so simple, that I can't beleive I'd missed it before. Needs more
2001 testing, though.
2006 testing, though.
2002 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2007 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2003 like this before...
2008 like this before...
2004
2009
2005 * IPython/genutils.py (get_home_dir): add protection against
2010 * IPython/genutils.py (get_home_dir): add protection against
2006 non-dirs in win32 registry.
2011 non-dirs in win32 registry.
2007
2012
2008 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2013 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2009 bug where dict was mutated while iterating (pysh crash).
2014 bug where dict was mutated while iterating (pysh crash).
2010
2015
2011 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2016 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2012
2017
2013 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2018 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2014 spurious newlines added by this routine. After a report by
2019 spurious newlines added by this routine. After a report by
2015 F. Mantegazza.
2020 F. Mantegazza.
2016
2021
2017 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2022 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2018
2023
2019 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2024 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2020 calls. These were a leftover from the GTK 1.x days, and can cause
2025 calls. These were a leftover from the GTK 1.x days, and can cause
2021 problems in certain cases (after a report by John Hunter).
2026 problems in certain cases (after a report by John Hunter).
2022
2027
2023 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2028 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2024 os.getcwd() fails at init time. Thanks to patch from David Remahl
2029 os.getcwd() fails at init time. Thanks to patch from David Remahl
2025 <chmod007-AT-mac.com>.
2030 <chmod007-AT-mac.com>.
2026 (InteractiveShell.__init__): prevent certain special magics from
2031 (InteractiveShell.__init__): prevent certain special magics from
2027 being shadowed by aliases. Closes
2032 being shadowed by aliases. Closes
2028 http://www.scipy.net/roundup/ipython/issue41.
2033 http://www.scipy.net/roundup/ipython/issue41.
2029
2034
2030 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2035 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2031
2036
2032 * IPython/iplib.py (InteractiveShell.complete): Added new
2037 * IPython/iplib.py (InteractiveShell.complete): Added new
2033 top-level completion method to expose the completion mechanism
2038 top-level completion method to expose the completion mechanism
2034 beyond readline-based environments.
2039 beyond readline-based environments.
2035
2040
2036 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2041 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2037
2042
2038 * tools/ipsvnc (svnversion): fix svnversion capture.
2043 * tools/ipsvnc (svnversion): fix svnversion capture.
2039
2044
2040 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2045 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2041 attribute to self, which was missing. Before, it was set by a
2046 attribute to self, which was missing. Before, it was set by a
2042 routine which in certain cases wasn't being called, so the
2047 routine which in certain cases wasn't being called, so the
2043 instance could end up missing the attribute. This caused a crash.
2048 instance could end up missing the attribute. This caused a crash.
2044 Closes http://www.scipy.net/roundup/ipython/issue40.
2049 Closes http://www.scipy.net/roundup/ipython/issue40.
2045
2050
2046 2005-08-16 Fernando Perez <fperez@colorado.edu>
2051 2005-08-16 Fernando Perez <fperez@colorado.edu>
2047
2052
2048 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2053 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2049 contains non-string attribute. Closes
2054 contains non-string attribute. Closes
2050 http://www.scipy.net/roundup/ipython/issue38.
2055 http://www.scipy.net/roundup/ipython/issue38.
2051
2056
2052 2005-08-14 Fernando Perez <fperez@colorado.edu>
2057 2005-08-14 Fernando Perez <fperez@colorado.edu>
2053
2058
2054 * tools/ipsvnc: Minor improvements, to add changeset info.
2059 * tools/ipsvnc: Minor improvements, to add changeset info.
2055
2060
2056 2005-08-12 Fernando Perez <fperez@colorado.edu>
2061 2005-08-12 Fernando Perez <fperez@colorado.edu>
2057
2062
2058 * IPython/iplib.py (runsource): remove self.code_to_run_src
2063 * IPython/iplib.py (runsource): remove self.code_to_run_src
2059 attribute. I realized this is nothing more than
2064 attribute. I realized this is nothing more than
2060 '\n'.join(self.buffer), and having the same data in two different
2065 '\n'.join(self.buffer), and having the same data in two different
2061 places is just asking for synchronization bugs. This may impact
2066 places is just asking for synchronization bugs. This may impact
2062 people who have custom exception handlers, so I need to warn
2067 people who have custom exception handlers, so I need to warn
2063 ipython-dev about it (F. Mantegazza may use them).
2068 ipython-dev about it (F. Mantegazza may use them).
2064
2069
2065 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2070 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2066
2071
2067 * IPython/genutils.py: fix 2.2 compatibility (generators)
2072 * IPython/genutils.py: fix 2.2 compatibility (generators)
2068
2073
2069 2005-07-18 Fernando Perez <fperez@colorado.edu>
2074 2005-07-18 Fernando Perez <fperez@colorado.edu>
2070
2075
2071 * IPython/genutils.py (get_home_dir): fix to help users with
2076 * IPython/genutils.py (get_home_dir): fix to help users with
2072 invalid $HOME under win32.
2077 invalid $HOME under win32.
2073
2078
2074 2005-07-17 Fernando Perez <fperez@colorado.edu>
2079 2005-07-17 Fernando Perez <fperez@colorado.edu>
2075
2080
2076 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2081 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2077 some old hacks and clean up a bit other routines; code should be
2082 some old hacks and clean up a bit other routines; code should be
2078 simpler and a bit faster.
2083 simpler and a bit faster.
2079
2084
2080 * IPython/iplib.py (interact): removed some last-resort attempts
2085 * IPython/iplib.py (interact): removed some last-resort attempts
2081 to survive broken stdout/stderr. That code was only making it
2086 to survive broken stdout/stderr. That code was only making it
2082 harder to abstract out the i/o (necessary for gui integration),
2087 harder to abstract out the i/o (necessary for gui integration),
2083 and the crashes it could prevent were extremely rare in practice
2088 and the crashes it could prevent were extremely rare in practice
2084 (besides being fully user-induced in a pretty violent manner).
2089 (besides being fully user-induced in a pretty violent manner).
2085
2090
2086 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2091 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2087 Nothing major yet, but the code is simpler to read; this should
2092 Nothing major yet, but the code is simpler to read; this should
2088 make it easier to do more serious modifications in the future.
2093 make it easier to do more serious modifications in the future.
2089
2094
2090 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2095 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2091 which broke in .15 (thanks to a report by Ville).
2096 which broke in .15 (thanks to a report by Ville).
2092
2097
2093 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2098 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2094 be quite correct, I know next to nothing about unicode). This
2099 be quite correct, I know next to nothing about unicode). This
2095 will allow unicode strings to be used in prompts, amongst other
2100 will allow unicode strings to be used in prompts, amongst other
2096 cases. It also will prevent ipython from crashing when unicode
2101 cases. It also will prevent ipython from crashing when unicode
2097 shows up unexpectedly in many places. If ascii encoding fails, we
2102 shows up unexpectedly in many places. If ascii encoding fails, we
2098 assume utf_8. Currently the encoding is not a user-visible
2103 assume utf_8. Currently the encoding is not a user-visible
2099 setting, though it could be made so if there is demand for it.
2104 setting, though it could be made so if there is demand for it.
2100
2105
2101 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2106 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2102
2107
2103 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2108 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2104
2109
2105 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2110 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2106
2111
2107 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2112 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2108 code can work transparently for 2.2/2.3.
2113 code can work transparently for 2.2/2.3.
2109
2114
2110 2005-07-16 Fernando Perez <fperez@colorado.edu>
2115 2005-07-16 Fernando Perez <fperez@colorado.edu>
2111
2116
2112 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2117 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2113 out of the color scheme table used for coloring exception
2118 out of the color scheme table used for coloring exception
2114 tracebacks. This allows user code to add new schemes at runtime.
2119 tracebacks. This allows user code to add new schemes at runtime.
2115 This is a minimally modified version of the patch at
2120 This is a minimally modified version of the patch at
2116 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2121 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2117 for the contribution.
2122 for the contribution.
2118
2123
2119 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2124 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2120 slightly modified version of the patch in
2125 slightly modified version of the patch in
2121 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2126 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2122 to remove the previous try/except solution (which was costlier).
2127 to remove the previous try/except solution (which was costlier).
2123 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2128 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2124
2129
2125 2005-06-08 Fernando Perez <fperez@colorado.edu>
2130 2005-06-08 Fernando Perez <fperez@colorado.edu>
2126
2131
2127 * IPython/iplib.py (write/write_err): Add methods to abstract all
2132 * IPython/iplib.py (write/write_err): Add methods to abstract all
2128 I/O a bit more.
2133 I/O a bit more.
2129
2134
2130 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2135 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2131 warning, reported by Aric Hagberg, fix by JD Hunter.
2136 warning, reported by Aric Hagberg, fix by JD Hunter.
2132
2137
2133 2005-06-02 *** Released version 0.6.15
2138 2005-06-02 *** Released version 0.6.15
2134
2139
2135 2005-06-01 Fernando Perez <fperez@colorado.edu>
2140 2005-06-01 Fernando Perez <fperez@colorado.edu>
2136
2141
2137 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2142 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2138 tab-completion of filenames within open-quoted strings. Note that
2143 tab-completion of filenames within open-quoted strings. Note that
2139 this requires that in ~/.ipython/ipythonrc, users change the
2144 this requires that in ~/.ipython/ipythonrc, users change the
2140 readline delimiters configuration to read:
2145 readline delimiters configuration to read:
2141
2146
2142 readline_remove_delims -/~
2147 readline_remove_delims -/~
2143
2148
2144
2149
2145 2005-05-31 *** Released version 0.6.14
2150 2005-05-31 *** Released version 0.6.14
2146
2151
2147 2005-05-29 Fernando Perez <fperez@colorado.edu>
2152 2005-05-29 Fernando Perez <fperez@colorado.edu>
2148
2153
2149 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2154 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2150 with files not on the filesystem. Reported by Eliyahu Sandler
2155 with files not on the filesystem. Reported by Eliyahu Sandler
2151 <eli@gondolin.net>
2156 <eli@gondolin.net>
2152
2157
2153 2005-05-22 Fernando Perez <fperez@colorado.edu>
2158 2005-05-22 Fernando Perez <fperez@colorado.edu>
2154
2159
2155 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2160 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2156 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2161 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2157
2162
2158 2005-05-19 Fernando Perez <fperez@colorado.edu>
2163 2005-05-19 Fernando Perez <fperez@colorado.edu>
2159
2164
2160 * IPython/iplib.py (safe_execfile): close a file which could be
2165 * IPython/iplib.py (safe_execfile): close a file which could be
2161 left open (causing problems in win32, which locks open files).
2166 left open (causing problems in win32, which locks open files).
2162 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2167 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2163
2168
2164 2005-05-18 Fernando Perez <fperez@colorado.edu>
2169 2005-05-18 Fernando Perez <fperez@colorado.edu>
2165
2170
2166 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2171 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2167 keyword arguments correctly to safe_execfile().
2172 keyword arguments correctly to safe_execfile().
2168
2173
2169 2005-05-13 Fernando Perez <fperez@colorado.edu>
2174 2005-05-13 Fernando Perez <fperez@colorado.edu>
2170
2175
2171 * ipython.1: Added info about Qt to manpage, and threads warning
2176 * ipython.1: Added info about Qt to manpage, and threads warning
2172 to usage page (invoked with --help).
2177 to usage page (invoked with --help).
2173
2178
2174 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2179 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2175 new matcher (it goes at the end of the priority list) to do
2180 new matcher (it goes at the end of the priority list) to do
2176 tab-completion on named function arguments. Submitted by George
2181 tab-completion on named function arguments. Submitted by George
2177 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2182 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2178 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2183 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2179 for more details.
2184 for more details.
2180
2185
2181 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2186 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2182 SystemExit exceptions in the script being run. Thanks to a report
2187 SystemExit exceptions in the script being run. Thanks to a report
2183 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2188 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2184 producing very annoying behavior when running unit tests.
2189 producing very annoying behavior when running unit tests.
2185
2190
2186 2005-05-12 Fernando Perez <fperez@colorado.edu>
2191 2005-05-12 Fernando Perez <fperez@colorado.edu>
2187
2192
2188 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2193 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2189 which I'd broken (again) due to a changed regexp. In the process,
2194 which I'd broken (again) due to a changed regexp. In the process,
2190 added ';' as an escape to auto-quote the whole line without
2195 added ';' as an escape to auto-quote the whole line without
2191 splitting its arguments. Thanks to a report by Jerry McRae
2196 splitting its arguments. Thanks to a report by Jerry McRae
2192 <qrs0xyc02-AT-sneakemail.com>.
2197 <qrs0xyc02-AT-sneakemail.com>.
2193
2198
2194 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2199 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2195 possible crashes caused by a TokenError. Reported by Ed Schofield
2200 possible crashes caused by a TokenError. Reported by Ed Schofield
2196 <schofield-AT-ftw.at>.
2201 <schofield-AT-ftw.at>.
2197
2202
2198 2005-05-06 Fernando Perez <fperez@colorado.edu>
2203 2005-05-06 Fernando Perez <fperez@colorado.edu>
2199
2204
2200 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2205 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2201
2206
2202 2005-04-29 Fernando Perez <fperez@colorado.edu>
2207 2005-04-29 Fernando Perez <fperez@colorado.edu>
2203
2208
2204 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2209 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2205 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2210 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2206 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2211 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2207 which provides support for Qt interactive usage (similar to the
2212 which provides support for Qt interactive usage (similar to the
2208 existing one for WX and GTK). This had been often requested.
2213 existing one for WX and GTK). This had been often requested.
2209
2214
2210 2005-04-14 *** Released version 0.6.13
2215 2005-04-14 *** Released version 0.6.13
2211
2216
2212 2005-04-08 Fernando Perez <fperez@colorado.edu>
2217 2005-04-08 Fernando Perez <fperez@colorado.edu>
2213
2218
2214 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2219 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2215 from _ofind, which gets called on almost every input line. Now,
2220 from _ofind, which gets called on almost every input line. Now,
2216 we only try to get docstrings if they are actually going to be
2221 we only try to get docstrings if they are actually going to be
2217 used (the overhead of fetching unnecessary docstrings can be
2222 used (the overhead of fetching unnecessary docstrings can be
2218 noticeable for certain objects, such as Pyro proxies).
2223 noticeable for certain objects, such as Pyro proxies).
2219
2224
2220 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2225 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2221 for completers. For some reason I had been passing them the state
2226 for completers. For some reason I had been passing them the state
2222 variable, which completers never actually need, and was in
2227 variable, which completers never actually need, and was in
2223 conflict with the rlcompleter API. Custom completers ONLY need to
2228 conflict with the rlcompleter API. Custom completers ONLY need to
2224 take the text parameter.
2229 take the text parameter.
2225
2230
2226 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2231 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2227 work correctly in pysh. I've also moved all the logic which used
2232 work correctly in pysh. I've also moved all the logic which used
2228 to be in pysh.py here, which will prevent problems with future
2233 to be in pysh.py here, which will prevent problems with future
2229 upgrades. However, this time I must warn users to update their
2234 upgrades. However, this time I must warn users to update their
2230 pysh profile to include the line
2235 pysh profile to include the line
2231
2236
2232 import_all IPython.Extensions.InterpreterExec
2237 import_all IPython.Extensions.InterpreterExec
2233
2238
2234 because otherwise things won't work for them. They MUST also
2239 because otherwise things won't work for them. They MUST also
2235 delete pysh.py and the line
2240 delete pysh.py and the line
2236
2241
2237 execfile pysh.py
2242 execfile pysh.py
2238
2243
2239 from their ipythonrc-pysh.
2244 from their ipythonrc-pysh.
2240
2245
2241 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2246 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2242 robust in the face of objects whose dir() returns non-strings
2247 robust in the face of objects whose dir() returns non-strings
2243 (which it shouldn't, but some broken libs like ITK do). Thanks to
2248 (which it shouldn't, but some broken libs like ITK do). Thanks to
2244 a patch by John Hunter (implemented differently, though). Also
2249 a patch by John Hunter (implemented differently, though). Also
2245 minor improvements by using .extend instead of + on lists.
2250 minor improvements by using .extend instead of + on lists.
2246
2251
2247 * pysh.py:
2252 * pysh.py:
2248
2253
2249 2005-04-06 Fernando Perez <fperez@colorado.edu>
2254 2005-04-06 Fernando Perez <fperez@colorado.edu>
2250
2255
2251 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2256 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2252 by default, so that all users benefit from it. Those who don't
2257 by default, so that all users benefit from it. Those who don't
2253 want it can still turn it off.
2258 want it can still turn it off.
2254
2259
2255 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2260 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2256 config file, I'd forgotten about this, so users were getting it
2261 config file, I'd forgotten about this, so users were getting it
2257 off by default.
2262 off by default.
2258
2263
2259 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2264 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2260 consistency. Now magics can be called in multiline statements,
2265 consistency. Now magics can be called in multiline statements,
2261 and python variables can be expanded in magic calls via $var.
2266 and python variables can be expanded in magic calls via $var.
2262 This makes the magic system behave just like aliases or !system
2267 This makes the magic system behave just like aliases or !system
2263 calls.
2268 calls.
2264
2269
2265 2005-03-28 Fernando Perez <fperez@colorado.edu>
2270 2005-03-28 Fernando Perez <fperez@colorado.edu>
2266
2271
2267 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2272 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2268 expensive string additions for building command. Add support for
2273 expensive string additions for building command. Add support for
2269 trailing ';' when autocall is used.
2274 trailing ';' when autocall is used.
2270
2275
2271 2005-03-26 Fernando Perez <fperez@colorado.edu>
2276 2005-03-26 Fernando Perez <fperez@colorado.edu>
2272
2277
2273 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2278 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2274 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2279 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2275 ipython.el robust against prompts with any number of spaces
2280 ipython.el robust against prompts with any number of spaces
2276 (including 0) after the ':' character.
2281 (including 0) after the ':' character.
2277
2282
2278 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2283 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2279 continuation prompt, which misled users to think the line was
2284 continuation prompt, which misled users to think the line was
2280 already indented. Closes debian Bug#300847, reported to me by
2285 already indented. Closes debian Bug#300847, reported to me by
2281 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2286 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2282
2287
2283 2005-03-23 Fernando Perez <fperez@colorado.edu>
2288 2005-03-23 Fernando Perez <fperez@colorado.edu>
2284
2289
2285 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2290 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2286 properly aligned if they have embedded newlines.
2291 properly aligned if they have embedded newlines.
2287
2292
2288 * IPython/iplib.py (runlines): Add a public method to expose
2293 * IPython/iplib.py (runlines): Add a public method to expose
2289 IPython's code execution machinery, so that users can run strings
2294 IPython's code execution machinery, so that users can run strings
2290 as if they had been typed at the prompt interactively.
2295 as if they had been typed at the prompt interactively.
2291 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2296 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2292 methods which can call the system shell, but with python variable
2297 methods which can call the system shell, but with python variable
2293 expansion. The three such methods are: __IPYTHON__.system,
2298 expansion. The three such methods are: __IPYTHON__.system,
2294 .getoutput and .getoutputerror. These need to be documented in a
2299 .getoutput and .getoutputerror. These need to be documented in a
2295 'public API' section (to be written) of the manual.
2300 'public API' section (to be written) of the manual.
2296
2301
2297 2005-03-20 Fernando Perez <fperez@colorado.edu>
2302 2005-03-20 Fernando Perez <fperez@colorado.edu>
2298
2303
2299 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2304 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2300 for custom exception handling. This is quite powerful, and it
2305 for custom exception handling. This is quite powerful, and it
2301 allows for user-installable exception handlers which can trap
2306 allows for user-installable exception handlers which can trap
2302 custom exceptions at runtime and treat them separately from
2307 custom exceptions at runtime and treat them separately from
2303 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2308 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2304 Mantegazza <mantegazza-AT-ill.fr>.
2309 Mantegazza <mantegazza-AT-ill.fr>.
2305 (InteractiveShell.set_custom_completer): public API function to
2310 (InteractiveShell.set_custom_completer): public API function to
2306 add new completers at runtime.
2311 add new completers at runtime.
2307
2312
2308 2005-03-19 Fernando Perez <fperez@colorado.edu>
2313 2005-03-19 Fernando Perez <fperez@colorado.edu>
2309
2314
2310 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2315 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2311 allow objects which provide their docstrings via non-standard
2316 allow objects which provide their docstrings via non-standard
2312 mechanisms (like Pyro proxies) to still be inspected by ipython's
2317 mechanisms (like Pyro proxies) to still be inspected by ipython's
2313 ? system.
2318 ? system.
2314
2319
2315 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2320 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2316 automatic capture system. I tried quite hard to make it work
2321 automatic capture system. I tried quite hard to make it work
2317 reliably, and simply failed. I tried many combinations with the
2322 reliably, and simply failed. I tried many combinations with the
2318 subprocess module, but eventually nothing worked in all needed
2323 subprocess module, but eventually nothing worked in all needed
2319 cases (not blocking stdin for the child, duplicating stdout
2324 cases (not blocking stdin for the child, duplicating stdout
2320 without blocking, etc). The new %sc/%sx still do capture to these
2325 without blocking, etc). The new %sc/%sx still do capture to these
2321 magical list/string objects which make shell use much more
2326 magical list/string objects which make shell use much more
2322 conveninent, so not all is lost.
2327 conveninent, so not all is lost.
2323
2328
2324 XXX - FIX MANUAL for the change above!
2329 XXX - FIX MANUAL for the change above!
2325
2330
2326 (runsource): I copied code.py's runsource() into ipython to modify
2331 (runsource): I copied code.py's runsource() into ipython to modify
2327 it a bit. Now the code object and source to be executed are
2332 it a bit. Now the code object and source to be executed are
2328 stored in ipython. This makes this info accessible to third-party
2333 stored in ipython. This makes this info accessible to third-party
2329 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2334 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2330 Mantegazza <mantegazza-AT-ill.fr>.
2335 Mantegazza <mantegazza-AT-ill.fr>.
2331
2336
2332 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2337 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2333 history-search via readline (like C-p/C-n). I'd wanted this for a
2338 history-search via readline (like C-p/C-n). I'd wanted this for a
2334 long time, but only recently found out how to do it. For users
2339 long time, but only recently found out how to do it. For users
2335 who already have their ipythonrc files made and want this, just
2340 who already have their ipythonrc files made and want this, just
2336 add:
2341 add:
2337
2342
2338 readline_parse_and_bind "\e[A": history-search-backward
2343 readline_parse_and_bind "\e[A": history-search-backward
2339 readline_parse_and_bind "\e[B": history-search-forward
2344 readline_parse_and_bind "\e[B": history-search-forward
2340
2345
2341 2005-03-18 Fernando Perez <fperez@colorado.edu>
2346 2005-03-18 Fernando Perez <fperez@colorado.edu>
2342
2347
2343 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2348 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2344 LSString and SList classes which allow transparent conversions
2349 LSString and SList classes which allow transparent conversions
2345 between list mode and whitespace-separated string.
2350 between list mode and whitespace-separated string.
2346 (magic_r): Fix recursion problem in %r.
2351 (magic_r): Fix recursion problem in %r.
2347
2352
2348 * IPython/genutils.py (LSString): New class to be used for
2353 * IPython/genutils.py (LSString): New class to be used for
2349 automatic storage of the results of all alias/system calls in _o
2354 automatic storage of the results of all alias/system calls in _o
2350 and _e (stdout/err). These provide a .l/.list attribute which
2355 and _e (stdout/err). These provide a .l/.list attribute which
2351 does automatic splitting on newlines. This means that for most
2356 does automatic splitting on newlines. This means that for most
2352 uses, you'll never need to do capturing of output with %sc/%sx
2357 uses, you'll never need to do capturing of output with %sc/%sx
2353 anymore, since ipython keeps this always done for you. Note that
2358 anymore, since ipython keeps this always done for you. Note that
2354 only the LAST results are stored, the _o/e variables are
2359 only the LAST results are stored, the _o/e variables are
2355 overwritten on each call. If you need to save their contents
2360 overwritten on each call. If you need to save their contents
2356 further, simply bind them to any other name.
2361 further, simply bind them to any other name.
2357
2362
2358 2005-03-17 Fernando Perez <fperez@colorado.edu>
2363 2005-03-17 Fernando Perez <fperez@colorado.edu>
2359
2364
2360 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2365 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2361 prompt namespace handling.
2366 prompt namespace handling.
2362
2367
2363 2005-03-16 Fernando Perez <fperez@colorado.edu>
2368 2005-03-16 Fernando Perez <fperez@colorado.edu>
2364
2369
2365 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2370 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2366 classic prompts to be '>>> ' (final space was missing, and it
2371 classic prompts to be '>>> ' (final space was missing, and it
2367 trips the emacs python mode).
2372 trips the emacs python mode).
2368 (BasePrompt.__str__): Added safe support for dynamic prompt
2373 (BasePrompt.__str__): Added safe support for dynamic prompt
2369 strings. Now you can set your prompt string to be '$x', and the
2374 strings. Now you can set your prompt string to be '$x', and the
2370 value of x will be printed from your interactive namespace. The
2375 value of x will be printed from your interactive namespace. The
2371 interpolation syntax includes the full Itpl support, so
2376 interpolation syntax includes the full Itpl support, so
2372 ${foo()+x+bar()} is a valid prompt string now, and the function
2377 ${foo()+x+bar()} is a valid prompt string now, and the function
2373 calls will be made at runtime.
2378 calls will be made at runtime.
2374
2379
2375 2005-03-15 Fernando Perez <fperez@colorado.edu>
2380 2005-03-15 Fernando Perez <fperez@colorado.edu>
2376
2381
2377 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2382 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2378 avoid name clashes in pylab. %hist still works, it just forwards
2383 avoid name clashes in pylab. %hist still works, it just forwards
2379 the call to %history.
2384 the call to %history.
2380
2385
2381 2005-03-02 *** Released version 0.6.12
2386 2005-03-02 *** Released version 0.6.12
2382
2387
2383 2005-03-02 Fernando Perez <fperez@colorado.edu>
2388 2005-03-02 Fernando Perez <fperez@colorado.edu>
2384
2389
2385 * IPython/iplib.py (handle_magic): log magic calls properly as
2390 * IPython/iplib.py (handle_magic): log magic calls properly as
2386 ipmagic() function calls.
2391 ipmagic() function calls.
2387
2392
2388 * IPython/Magic.py (magic_time): Improved %time to support
2393 * IPython/Magic.py (magic_time): Improved %time to support
2389 statements and provide wall-clock as well as CPU time.
2394 statements and provide wall-clock as well as CPU time.
2390
2395
2391 2005-02-27 Fernando Perez <fperez@colorado.edu>
2396 2005-02-27 Fernando Perez <fperez@colorado.edu>
2392
2397
2393 * IPython/hooks.py: New hooks module, to expose user-modifiable
2398 * IPython/hooks.py: New hooks module, to expose user-modifiable
2394 IPython functionality in a clean manner. For now only the editor
2399 IPython functionality in a clean manner. For now only the editor
2395 hook is actually written, and other thigns which I intend to turn
2400 hook is actually written, and other thigns which I intend to turn
2396 into proper hooks aren't yet there. The display and prefilter
2401 into proper hooks aren't yet there. The display and prefilter
2397 stuff, for example, should be hooks. But at least now the
2402 stuff, for example, should be hooks. But at least now the
2398 framework is in place, and the rest can be moved here with more
2403 framework is in place, and the rest can be moved here with more
2399 time later. IPython had had a .hooks variable for a long time for
2404 time later. IPython had had a .hooks variable for a long time for
2400 this purpose, but I'd never actually used it for anything.
2405 this purpose, but I'd never actually used it for anything.
2401
2406
2402 2005-02-26 Fernando Perez <fperez@colorado.edu>
2407 2005-02-26 Fernando Perez <fperez@colorado.edu>
2403
2408
2404 * IPython/ipmaker.py (make_IPython): make the default ipython
2409 * IPython/ipmaker.py (make_IPython): make the default ipython
2405 directory be called _ipython under win32, to follow more the
2410 directory be called _ipython under win32, to follow more the
2406 naming peculiarities of that platform (where buggy software like
2411 naming peculiarities of that platform (where buggy software like
2407 Visual Sourcesafe breaks with .named directories). Reported by
2412 Visual Sourcesafe breaks with .named directories). Reported by
2408 Ville Vainio.
2413 Ville Vainio.
2409
2414
2410 2005-02-23 Fernando Perez <fperez@colorado.edu>
2415 2005-02-23 Fernando Perez <fperez@colorado.edu>
2411
2416
2412 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2417 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2413 auto_aliases for win32 which were causing problems. Users can
2418 auto_aliases for win32 which were causing problems. Users can
2414 define the ones they personally like.
2419 define the ones they personally like.
2415
2420
2416 2005-02-21 Fernando Perez <fperez@colorado.edu>
2421 2005-02-21 Fernando Perez <fperez@colorado.edu>
2417
2422
2418 * IPython/Magic.py (magic_time): new magic to time execution of
2423 * IPython/Magic.py (magic_time): new magic to time execution of
2419 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2424 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2420
2425
2421 2005-02-19 Fernando Perez <fperez@colorado.edu>
2426 2005-02-19 Fernando Perez <fperez@colorado.edu>
2422
2427
2423 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2428 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2424 into keys (for prompts, for example).
2429 into keys (for prompts, for example).
2425
2430
2426 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2431 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2427 prompts in case users want them. This introduces a small behavior
2432 prompts in case users want them. This introduces a small behavior
2428 change: ipython does not automatically add a space to all prompts
2433 change: ipython does not automatically add a space to all prompts
2429 anymore. To get the old prompts with a space, users should add it
2434 anymore. To get the old prompts with a space, users should add it
2430 manually to their ipythonrc file, so for example prompt_in1 should
2435 manually to their ipythonrc file, so for example prompt_in1 should
2431 now read 'In [\#]: ' instead of 'In [\#]:'.
2436 now read 'In [\#]: ' instead of 'In [\#]:'.
2432 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2437 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2433 file) to control left-padding of secondary prompts.
2438 file) to control left-padding of secondary prompts.
2434
2439
2435 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2440 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2436 the profiler can't be imported. Fix for Debian, which removed
2441 the profiler can't be imported. Fix for Debian, which removed
2437 profile.py because of License issues. I applied a slightly
2442 profile.py because of License issues. I applied a slightly
2438 modified version of the original Debian patch at
2443 modified version of the original Debian patch at
2439 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2444 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2440
2445
2441 2005-02-17 Fernando Perez <fperez@colorado.edu>
2446 2005-02-17 Fernando Perez <fperez@colorado.edu>
2442
2447
2443 * IPython/genutils.py (native_line_ends): Fix bug which would
2448 * IPython/genutils.py (native_line_ends): Fix bug which would
2444 cause improper line-ends under win32 b/c I was not opening files
2449 cause improper line-ends under win32 b/c I was not opening files
2445 in binary mode. Bug report and fix thanks to Ville.
2450 in binary mode. Bug report and fix thanks to Ville.
2446
2451
2447 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2452 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2448 trying to catch spurious foo[1] autocalls. My fix actually broke
2453 trying to catch spurious foo[1] autocalls. My fix actually broke
2449 ',/' autoquote/call with explicit escape (bad regexp).
2454 ',/' autoquote/call with explicit escape (bad regexp).
2450
2455
2451 2005-02-15 *** Released version 0.6.11
2456 2005-02-15 *** Released version 0.6.11
2452
2457
2453 2005-02-14 Fernando Perez <fperez@colorado.edu>
2458 2005-02-14 Fernando Perez <fperez@colorado.edu>
2454
2459
2455 * IPython/background_jobs.py: New background job management
2460 * IPython/background_jobs.py: New background job management
2456 subsystem. This is implemented via a new set of classes, and
2461 subsystem. This is implemented via a new set of classes, and
2457 IPython now provides a builtin 'jobs' object for background job
2462 IPython now provides a builtin 'jobs' object for background job
2458 execution. A convenience %bg magic serves as a lightweight
2463 execution. A convenience %bg magic serves as a lightweight
2459 frontend for starting the more common type of calls. This was
2464 frontend for starting the more common type of calls. This was
2460 inspired by discussions with B. Granger and the BackgroundCommand
2465 inspired by discussions with B. Granger and the BackgroundCommand
2461 class described in the book Python Scripting for Computational
2466 class described in the book Python Scripting for Computational
2462 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2467 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2463 (although ultimately no code from this text was used, as IPython's
2468 (although ultimately no code from this text was used, as IPython's
2464 system is a separate implementation).
2469 system is a separate implementation).
2465
2470
2466 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2471 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2467 to control the completion of single/double underscore names
2472 to control the completion of single/double underscore names
2468 separately. As documented in the example ipytonrc file, the
2473 separately. As documented in the example ipytonrc file, the
2469 readline_omit__names variable can now be set to 2, to omit even
2474 readline_omit__names variable can now be set to 2, to omit even
2470 single underscore names. Thanks to a patch by Brian Wong
2475 single underscore names. Thanks to a patch by Brian Wong
2471 <BrianWong-AT-AirgoNetworks.Com>.
2476 <BrianWong-AT-AirgoNetworks.Com>.
2472 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2477 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2473 be autocalled as foo([1]) if foo were callable. A problem for
2478 be autocalled as foo([1]) if foo were callable. A problem for
2474 things which are both callable and implement __getitem__.
2479 things which are both callable and implement __getitem__.
2475 (init_readline): Fix autoindentation for win32. Thanks to a patch
2480 (init_readline): Fix autoindentation for win32. Thanks to a patch
2476 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2481 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2477
2482
2478 2005-02-12 Fernando Perez <fperez@colorado.edu>
2483 2005-02-12 Fernando Perez <fperez@colorado.edu>
2479
2484
2480 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2485 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2481 which I had written long ago to sort out user error messages which
2486 which I had written long ago to sort out user error messages which
2482 may occur during startup. This seemed like a good idea initially,
2487 may occur during startup. This seemed like a good idea initially,
2483 but it has proven a disaster in retrospect. I don't want to
2488 but it has proven a disaster in retrospect. I don't want to
2484 change much code for now, so my fix is to set the internal 'debug'
2489 change much code for now, so my fix is to set the internal 'debug'
2485 flag to true everywhere, whose only job was precisely to control
2490 flag to true everywhere, whose only job was precisely to control
2486 this subsystem. This closes issue 28 (as well as avoiding all
2491 this subsystem. This closes issue 28 (as well as avoiding all
2487 sorts of strange hangups which occur from time to time).
2492 sorts of strange hangups which occur from time to time).
2488
2493
2489 2005-02-07 Fernando Perez <fperez@colorado.edu>
2494 2005-02-07 Fernando Perez <fperez@colorado.edu>
2490
2495
2491 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2496 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2492 previous call produced a syntax error.
2497 previous call produced a syntax error.
2493
2498
2494 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2499 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2495 classes without constructor.
2500 classes without constructor.
2496
2501
2497 2005-02-06 Fernando Perez <fperez@colorado.edu>
2502 2005-02-06 Fernando Perez <fperez@colorado.edu>
2498
2503
2499 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2504 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2500 completions with the results of each matcher, so we return results
2505 completions with the results of each matcher, so we return results
2501 to the user from all namespaces. This breaks with ipython
2506 to the user from all namespaces. This breaks with ipython
2502 tradition, but I think it's a nicer behavior. Now you get all
2507 tradition, but I think it's a nicer behavior. Now you get all
2503 possible completions listed, from all possible namespaces (python,
2508 possible completions listed, from all possible namespaces (python,
2504 filesystem, magics...) After a request by John Hunter
2509 filesystem, magics...) After a request by John Hunter
2505 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2510 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2506
2511
2507 2005-02-05 Fernando Perez <fperez@colorado.edu>
2512 2005-02-05 Fernando Perez <fperez@colorado.edu>
2508
2513
2509 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2514 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2510 the call had quote characters in it (the quotes were stripped).
2515 the call had quote characters in it (the quotes were stripped).
2511
2516
2512 2005-01-31 Fernando Perez <fperez@colorado.edu>
2517 2005-01-31 Fernando Perez <fperez@colorado.edu>
2513
2518
2514 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2519 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2515 Itpl.itpl() to make the code more robust against psyco
2520 Itpl.itpl() to make the code more robust against psyco
2516 optimizations.
2521 optimizations.
2517
2522
2518 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2523 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2519 of causing an exception. Quicker, cleaner.
2524 of causing an exception. Quicker, cleaner.
2520
2525
2521 2005-01-28 Fernando Perez <fperez@colorado.edu>
2526 2005-01-28 Fernando Perez <fperez@colorado.edu>
2522
2527
2523 * scripts/ipython_win_post_install.py (install): hardcode
2528 * scripts/ipython_win_post_install.py (install): hardcode
2524 sys.prefix+'python.exe' as the executable path. It turns out that
2529 sys.prefix+'python.exe' as the executable path. It turns out that
2525 during the post-installation run, sys.executable resolves to the
2530 during the post-installation run, sys.executable resolves to the
2526 name of the binary installer! I should report this as a distutils
2531 name of the binary installer! I should report this as a distutils
2527 bug, I think. I updated the .10 release with this tiny fix, to
2532 bug, I think. I updated the .10 release with this tiny fix, to
2528 avoid annoying the lists further.
2533 avoid annoying the lists further.
2529
2534
2530 2005-01-27 *** Released version 0.6.10
2535 2005-01-27 *** Released version 0.6.10
2531
2536
2532 2005-01-27 Fernando Perez <fperez@colorado.edu>
2537 2005-01-27 Fernando Perez <fperez@colorado.edu>
2533
2538
2534 * IPython/numutils.py (norm): Added 'inf' as optional name for
2539 * IPython/numutils.py (norm): Added 'inf' as optional name for
2535 L-infinity norm, included references to mathworld.com for vector
2540 L-infinity norm, included references to mathworld.com for vector
2536 norm definitions.
2541 norm definitions.
2537 (amin/amax): added amin/amax for array min/max. Similar to what
2542 (amin/amax): added amin/amax for array min/max. Similar to what
2538 pylab ships with after the recent reorganization of names.
2543 pylab ships with after the recent reorganization of names.
2539 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2544 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2540
2545
2541 * ipython.el: committed Alex's recent fixes and improvements.
2546 * ipython.el: committed Alex's recent fixes and improvements.
2542 Tested with python-mode from CVS, and it looks excellent. Since
2547 Tested with python-mode from CVS, and it looks excellent. Since
2543 python-mode hasn't released anything in a while, I'm temporarily
2548 python-mode hasn't released anything in a while, I'm temporarily
2544 putting a copy of today's CVS (v 4.70) of python-mode in:
2549 putting a copy of today's CVS (v 4.70) of python-mode in:
2545 http://ipython.scipy.org/tmp/python-mode.el
2550 http://ipython.scipy.org/tmp/python-mode.el
2546
2551
2547 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2552 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2548 sys.executable for the executable name, instead of assuming it's
2553 sys.executable for the executable name, instead of assuming it's
2549 called 'python.exe' (the post-installer would have produced broken
2554 called 'python.exe' (the post-installer would have produced broken
2550 setups on systems with a differently named python binary).
2555 setups on systems with a differently named python binary).
2551
2556
2552 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2557 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2553 references to os.linesep, to make the code more
2558 references to os.linesep, to make the code more
2554 platform-independent. This is also part of the win32 coloring
2559 platform-independent. This is also part of the win32 coloring
2555 fixes.
2560 fixes.
2556
2561
2557 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2562 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2558 lines, which actually cause coloring bugs because the length of
2563 lines, which actually cause coloring bugs because the length of
2559 the line is very difficult to correctly compute with embedded
2564 the line is very difficult to correctly compute with embedded
2560 escapes. This was the source of all the coloring problems under
2565 escapes. This was the source of all the coloring problems under
2561 Win32. I think that _finally_, Win32 users have a properly
2566 Win32. I think that _finally_, Win32 users have a properly
2562 working ipython in all respects. This would never have happened
2567 working ipython in all respects. This would never have happened
2563 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2568 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2564
2569
2565 2005-01-26 *** Released version 0.6.9
2570 2005-01-26 *** Released version 0.6.9
2566
2571
2567 2005-01-25 Fernando Perez <fperez@colorado.edu>
2572 2005-01-25 Fernando Perez <fperez@colorado.edu>
2568
2573
2569 * setup.py: finally, we have a true Windows installer, thanks to
2574 * setup.py: finally, we have a true Windows installer, thanks to
2570 the excellent work of Viktor Ransmayr
2575 the excellent work of Viktor Ransmayr
2571 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2576 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2572 Windows users. The setup routine is quite a bit cleaner thanks to
2577 Windows users. The setup routine is quite a bit cleaner thanks to
2573 this, and the post-install script uses the proper functions to
2578 this, and the post-install script uses the proper functions to
2574 allow a clean de-installation using the standard Windows Control
2579 allow a clean de-installation using the standard Windows Control
2575 Panel.
2580 Panel.
2576
2581
2577 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2582 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2578 environment variable under all OSes (including win32) if
2583 environment variable under all OSes (including win32) if
2579 available. This will give consistency to win32 users who have set
2584 available. This will give consistency to win32 users who have set
2580 this variable for any reason. If os.environ['HOME'] fails, the
2585 this variable for any reason. If os.environ['HOME'] fails, the
2581 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2586 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2582
2587
2583 2005-01-24 Fernando Perez <fperez@colorado.edu>
2588 2005-01-24 Fernando Perez <fperez@colorado.edu>
2584
2589
2585 * IPython/numutils.py (empty_like): add empty_like(), similar to
2590 * IPython/numutils.py (empty_like): add empty_like(), similar to
2586 zeros_like() but taking advantage of the new empty() Numeric routine.
2591 zeros_like() but taking advantage of the new empty() Numeric routine.
2587
2592
2588 2005-01-23 *** Released version 0.6.8
2593 2005-01-23 *** Released version 0.6.8
2589
2594
2590 2005-01-22 Fernando Perez <fperez@colorado.edu>
2595 2005-01-22 Fernando Perez <fperez@colorado.edu>
2591
2596
2592 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2597 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2593 automatic show() calls. After discussing things with JDH, it
2598 automatic show() calls. After discussing things with JDH, it
2594 turns out there are too many corner cases where this can go wrong.
2599 turns out there are too many corner cases where this can go wrong.
2595 It's best not to try to be 'too smart', and simply have ipython
2600 It's best not to try to be 'too smart', and simply have ipython
2596 reproduce as much as possible the default behavior of a normal
2601 reproduce as much as possible the default behavior of a normal
2597 python shell.
2602 python shell.
2598
2603
2599 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2604 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2600 line-splitting regexp and _prefilter() to avoid calling getattr()
2605 line-splitting regexp and _prefilter() to avoid calling getattr()
2601 on assignments. This closes
2606 on assignments. This closes
2602 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2607 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2603 readline uses getattr(), so a simple <TAB> keypress is still
2608 readline uses getattr(), so a simple <TAB> keypress is still
2604 enough to trigger getattr() calls on an object.
2609 enough to trigger getattr() calls on an object.
2605
2610
2606 2005-01-21 Fernando Perez <fperez@colorado.edu>
2611 2005-01-21 Fernando Perez <fperez@colorado.edu>
2607
2612
2608 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2613 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2609 docstring under pylab so it doesn't mask the original.
2614 docstring under pylab so it doesn't mask the original.
2610
2615
2611 2005-01-21 *** Released version 0.6.7
2616 2005-01-21 *** Released version 0.6.7
2612
2617
2613 2005-01-21 Fernando Perez <fperez@colorado.edu>
2618 2005-01-21 Fernando Perez <fperez@colorado.edu>
2614
2619
2615 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2620 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2616 signal handling for win32 users in multithreaded mode.
2621 signal handling for win32 users in multithreaded mode.
2617
2622
2618 2005-01-17 Fernando Perez <fperez@colorado.edu>
2623 2005-01-17 Fernando Perez <fperez@colorado.edu>
2619
2624
2620 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2625 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2621 instances with no __init__. After a crash report by Norbert Nemec
2626 instances with no __init__. After a crash report by Norbert Nemec
2622 <Norbert-AT-nemec-online.de>.
2627 <Norbert-AT-nemec-online.de>.
2623
2628
2624 2005-01-14 Fernando Perez <fperez@colorado.edu>
2629 2005-01-14 Fernando Perez <fperez@colorado.edu>
2625
2630
2626 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2631 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2627 names for verbose exceptions, when multiple dotted names and the
2632 names for verbose exceptions, when multiple dotted names and the
2628 'parent' object were present on the same line.
2633 'parent' object were present on the same line.
2629
2634
2630 2005-01-11 Fernando Perez <fperez@colorado.edu>
2635 2005-01-11 Fernando Perez <fperez@colorado.edu>
2631
2636
2632 * IPython/genutils.py (flag_calls): new utility to trap and flag
2637 * IPython/genutils.py (flag_calls): new utility to trap and flag
2633 calls in functions. I need it to clean up matplotlib support.
2638 calls in functions. I need it to clean up matplotlib support.
2634 Also removed some deprecated code in genutils.
2639 Also removed some deprecated code in genutils.
2635
2640
2636 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2641 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2637 that matplotlib scripts called with %run, which don't call show()
2642 that matplotlib scripts called with %run, which don't call show()
2638 themselves, still have their plotting windows open.
2643 themselves, still have their plotting windows open.
2639
2644
2640 2005-01-05 Fernando Perez <fperez@colorado.edu>
2645 2005-01-05 Fernando Perez <fperez@colorado.edu>
2641
2646
2642 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2647 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2643 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2648 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2644
2649
2645 2004-12-19 Fernando Perez <fperez@colorado.edu>
2650 2004-12-19 Fernando Perez <fperez@colorado.edu>
2646
2651
2647 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2652 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2648 parent_runcode, which was an eyesore. The same result can be
2653 parent_runcode, which was an eyesore. The same result can be
2649 obtained with Python's regular superclass mechanisms.
2654 obtained with Python's regular superclass mechanisms.
2650
2655
2651 2004-12-17 Fernando Perez <fperez@colorado.edu>
2656 2004-12-17 Fernando Perez <fperez@colorado.edu>
2652
2657
2653 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2658 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2654 reported by Prabhu.
2659 reported by Prabhu.
2655 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2660 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2656 sys.stderr) instead of explicitly calling sys.stderr. This helps
2661 sys.stderr) instead of explicitly calling sys.stderr. This helps
2657 maintain our I/O abstractions clean, for future GUI embeddings.
2662 maintain our I/O abstractions clean, for future GUI embeddings.
2658
2663
2659 * IPython/genutils.py (info): added new utility for sys.stderr
2664 * IPython/genutils.py (info): added new utility for sys.stderr
2660 unified info message handling (thin wrapper around warn()).
2665 unified info message handling (thin wrapper around warn()).
2661
2666
2662 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2667 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2663 composite (dotted) names on verbose exceptions.
2668 composite (dotted) names on verbose exceptions.
2664 (VerboseTB.nullrepr): harden against another kind of errors which
2669 (VerboseTB.nullrepr): harden against another kind of errors which
2665 Python's inspect module can trigger, and which were crashing
2670 Python's inspect module can trigger, and which were crashing
2666 IPython. Thanks to a report by Marco Lombardi
2671 IPython. Thanks to a report by Marco Lombardi
2667 <mlombard-AT-ma010192.hq.eso.org>.
2672 <mlombard-AT-ma010192.hq.eso.org>.
2668
2673
2669 2004-12-13 *** Released version 0.6.6
2674 2004-12-13 *** Released version 0.6.6
2670
2675
2671 2004-12-12 Fernando Perez <fperez@colorado.edu>
2676 2004-12-12 Fernando Perez <fperez@colorado.edu>
2672
2677
2673 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2678 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2674 generated by pygtk upon initialization if it was built without
2679 generated by pygtk upon initialization if it was built without
2675 threads (for matplotlib users). After a crash reported by
2680 threads (for matplotlib users). After a crash reported by
2676 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2681 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2677
2682
2678 * IPython/ipmaker.py (make_IPython): fix small bug in the
2683 * IPython/ipmaker.py (make_IPython): fix small bug in the
2679 import_some parameter for multiple imports.
2684 import_some parameter for multiple imports.
2680
2685
2681 * IPython/iplib.py (ipmagic): simplified the interface of
2686 * IPython/iplib.py (ipmagic): simplified the interface of
2682 ipmagic() to take a single string argument, just as it would be
2687 ipmagic() to take a single string argument, just as it would be
2683 typed at the IPython cmd line.
2688 typed at the IPython cmd line.
2684 (ipalias): Added new ipalias() with an interface identical to
2689 (ipalias): Added new ipalias() with an interface identical to
2685 ipmagic(). This completes exposing a pure python interface to the
2690 ipmagic(). This completes exposing a pure python interface to the
2686 alias and magic system, which can be used in loops or more complex
2691 alias and magic system, which can be used in loops or more complex
2687 code where IPython's automatic line mangling is not active.
2692 code where IPython's automatic line mangling is not active.
2688
2693
2689 * IPython/genutils.py (timing): changed interface of timing to
2694 * IPython/genutils.py (timing): changed interface of timing to
2690 simply run code once, which is the most common case. timings()
2695 simply run code once, which is the most common case. timings()
2691 remains unchanged, for the cases where you want multiple runs.
2696 remains unchanged, for the cases where you want multiple runs.
2692
2697
2693 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2698 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2694 bug where Python2.2 crashes with exec'ing code which does not end
2699 bug where Python2.2 crashes with exec'ing code which does not end
2695 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2700 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2696 before.
2701 before.
2697
2702
2698 2004-12-10 Fernando Perez <fperez@colorado.edu>
2703 2004-12-10 Fernando Perez <fperez@colorado.edu>
2699
2704
2700 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2705 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2701 -t to -T, to accomodate the new -t flag in %run (the %run and
2706 -t to -T, to accomodate the new -t flag in %run (the %run and
2702 %prun options are kind of intermixed, and it's not easy to change
2707 %prun options are kind of intermixed, and it's not easy to change
2703 this with the limitations of python's getopt).
2708 this with the limitations of python's getopt).
2704
2709
2705 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2710 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2706 the execution of scripts. It's not as fine-tuned as timeit.py,
2711 the execution of scripts. It's not as fine-tuned as timeit.py,
2707 but it works from inside ipython (and under 2.2, which lacks
2712 but it works from inside ipython (and under 2.2, which lacks
2708 timeit.py). Optionally a number of runs > 1 can be given for
2713 timeit.py). Optionally a number of runs > 1 can be given for
2709 timing very short-running code.
2714 timing very short-running code.
2710
2715
2711 * IPython/genutils.py (uniq_stable): new routine which returns a
2716 * IPython/genutils.py (uniq_stable): new routine which returns a
2712 list of unique elements in any iterable, but in stable order of
2717 list of unique elements in any iterable, but in stable order of
2713 appearance. I needed this for the ultraTB fixes, and it's a handy
2718 appearance. I needed this for the ultraTB fixes, and it's a handy
2714 utility.
2719 utility.
2715
2720
2716 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2721 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2717 dotted names in Verbose exceptions. This had been broken since
2722 dotted names in Verbose exceptions. This had been broken since
2718 the very start, now x.y will properly be printed in a Verbose
2723 the very start, now x.y will properly be printed in a Verbose
2719 traceback, instead of x being shown and y appearing always as an
2724 traceback, instead of x being shown and y appearing always as an
2720 'undefined global'. Getting this to work was a bit tricky,
2725 'undefined global'. Getting this to work was a bit tricky,
2721 because by default python tokenizers are stateless. Saved by
2726 because by default python tokenizers are stateless. Saved by
2722 python's ability to easily add a bit of state to an arbitrary
2727 python's ability to easily add a bit of state to an arbitrary
2723 function (without needing to build a full-blown callable object).
2728 function (without needing to build a full-blown callable object).
2724
2729
2725 Also big cleanup of this code, which had horrendous runtime
2730 Also big cleanup of this code, which had horrendous runtime
2726 lookups of zillions of attributes for colorization. Moved all
2731 lookups of zillions of attributes for colorization. Moved all
2727 this code into a few templates, which make it cleaner and quicker.
2732 this code into a few templates, which make it cleaner and quicker.
2728
2733
2729 Printout quality was also improved for Verbose exceptions: one
2734 Printout quality was also improved for Verbose exceptions: one
2730 variable per line, and memory addresses are printed (this can be
2735 variable per line, and memory addresses are printed (this can be
2731 quite handy in nasty debugging situations, which is what Verbose
2736 quite handy in nasty debugging situations, which is what Verbose
2732 is for).
2737 is for).
2733
2738
2734 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2739 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2735 the command line as scripts to be loaded by embedded instances.
2740 the command line as scripts to be loaded by embedded instances.
2736 Doing so has the potential for an infinite recursion if there are
2741 Doing so has the potential for an infinite recursion if there are
2737 exceptions thrown in the process. This fixes a strange crash
2742 exceptions thrown in the process. This fixes a strange crash
2738 reported by Philippe MULLER <muller-AT-irit.fr>.
2743 reported by Philippe MULLER <muller-AT-irit.fr>.
2739
2744
2740 2004-12-09 Fernando Perez <fperez@colorado.edu>
2745 2004-12-09 Fernando Perez <fperez@colorado.edu>
2741
2746
2742 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2747 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2743 to reflect new names in matplotlib, which now expose the
2748 to reflect new names in matplotlib, which now expose the
2744 matlab-compatible interface via a pylab module instead of the
2749 matlab-compatible interface via a pylab module instead of the
2745 'matlab' name. The new code is backwards compatible, so users of
2750 'matlab' name. The new code is backwards compatible, so users of
2746 all matplotlib versions are OK. Patch by J. Hunter.
2751 all matplotlib versions are OK. Patch by J. Hunter.
2747
2752
2748 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2753 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2749 of __init__ docstrings for instances (class docstrings are already
2754 of __init__ docstrings for instances (class docstrings are already
2750 automatically printed). Instances with customized docstrings
2755 automatically printed). Instances with customized docstrings
2751 (indep. of the class) are also recognized and all 3 separate
2756 (indep. of the class) are also recognized and all 3 separate
2752 docstrings are printed (instance, class, constructor). After some
2757 docstrings are printed (instance, class, constructor). After some
2753 comments/suggestions by J. Hunter.
2758 comments/suggestions by J. Hunter.
2754
2759
2755 2004-12-05 Fernando Perez <fperez@colorado.edu>
2760 2004-12-05 Fernando Perez <fperez@colorado.edu>
2756
2761
2757 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2762 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2758 warnings when tab-completion fails and triggers an exception.
2763 warnings when tab-completion fails and triggers an exception.
2759
2764
2760 2004-12-03 Fernando Perez <fperez@colorado.edu>
2765 2004-12-03 Fernando Perez <fperez@colorado.edu>
2761
2766
2762 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2767 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2763 be triggered when using 'run -p'. An incorrect option flag was
2768 be triggered when using 'run -p'. An incorrect option flag was
2764 being set ('d' instead of 'D').
2769 being set ('d' instead of 'D').
2765 (manpage): fix missing escaped \- sign.
2770 (manpage): fix missing escaped \- sign.
2766
2771
2767 2004-11-30 *** Released version 0.6.5
2772 2004-11-30 *** Released version 0.6.5
2768
2773
2769 2004-11-30 Fernando Perez <fperez@colorado.edu>
2774 2004-11-30 Fernando Perez <fperez@colorado.edu>
2770
2775
2771 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2776 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2772 setting with -d option.
2777 setting with -d option.
2773
2778
2774 * setup.py (docfiles): Fix problem where the doc glob I was using
2779 * setup.py (docfiles): Fix problem where the doc glob I was using
2775 was COMPLETELY BROKEN. It was giving the right files by pure
2780 was COMPLETELY BROKEN. It was giving the right files by pure
2776 accident, but failed once I tried to include ipython.el. Note:
2781 accident, but failed once I tried to include ipython.el. Note:
2777 glob() does NOT allow you to do exclusion on multiple endings!
2782 glob() does NOT allow you to do exclusion on multiple endings!
2778
2783
2779 2004-11-29 Fernando Perez <fperez@colorado.edu>
2784 2004-11-29 Fernando Perez <fperez@colorado.edu>
2780
2785
2781 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2786 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2782 the manpage as the source. Better formatting & consistency.
2787 the manpage as the source. Better formatting & consistency.
2783
2788
2784 * IPython/Magic.py (magic_run): Added new -d option, to run
2789 * IPython/Magic.py (magic_run): Added new -d option, to run
2785 scripts under the control of the python pdb debugger. Note that
2790 scripts under the control of the python pdb debugger. Note that
2786 this required changing the %prun option -d to -D, to avoid a clash
2791 this required changing the %prun option -d to -D, to avoid a clash
2787 (since %run must pass options to %prun, and getopt is too dumb to
2792 (since %run must pass options to %prun, and getopt is too dumb to
2788 handle options with string values with embedded spaces). Thanks
2793 handle options with string values with embedded spaces). Thanks
2789 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2794 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2790 (magic_who_ls): added type matching to %who and %whos, so that one
2795 (magic_who_ls): added type matching to %who and %whos, so that one
2791 can filter their output to only include variables of certain
2796 can filter their output to only include variables of certain
2792 types. Another suggestion by Matthew.
2797 types. Another suggestion by Matthew.
2793 (magic_whos): Added memory summaries in kb and Mb for arrays.
2798 (magic_whos): Added memory summaries in kb and Mb for arrays.
2794 (magic_who): Improve formatting (break lines every 9 vars).
2799 (magic_who): Improve formatting (break lines every 9 vars).
2795
2800
2796 2004-11-28 Fernando Perez <fperez@colorado.edu>
2801 2004-11-28 Fernando Perez <fperez@colorado.edu>
2797
2802
2798 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2803 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2799 cache when empty lines were present.
2804 cache when empty lines were present.
2800
2805
2801 2004-11-24 Fernando Perez <fperez@colorado.edu>
2806 2004-11-24 Fernando Perez <fperez@colorado.edu>
2802
2807
2803 * IPython/usage.py (__doc__): document the re-activated threading
2808 * IPython/usage.py (__doc__): document the re-activated threading
2804 options for WX and GTK.
2809 options for WX and GTK.
2805
2810
2806 2004-11-23 Fernando Perez <fperez@colorado.edu>
2811 2004-11-23 Fernando Perez <fperez@colorado.edu>
2807
2812
2808 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2813 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2809 the -wthread and -gthread options, along with a new -tk one to try
2814 the -wthread and -gthread options, along with a new -tk one to try
2810 and coordinate Tk threading with wx/gtk. The tk support is very
2815 and coordinate Tk threading with wx/gtk. The tk support is very
2811 platform dependent, since it seems to require Tcl and Tk to be
2816 platform dependent, since it seems to require Tcl and Tk to be
2812 built with threads (Fedora1/2 appears NOT to have it, but in
2817 built with threads (Fedora1/2 appears NOT to have it, but in
2813 Prabhu's Debian boxes it works OK). But even with some Tk
2818 Prabhu's Debian boxes it works OK). But even with some Tk
2814 limitations, this is a great improvement.
2819 limitations, this is a great improvement.
2815
2820
2816 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2821 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2817 info in user prompts. Patch by Prabhu.
2822 info in user prompts. Patch by Prabhu.
2818
2823
2819 2004-11-18 Fernando Perez <fperez@colorado.edu>
2824 2004-11-18 Fernando Perez <fperez@colorado.edu>
2820
2825
2821 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2826 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2822 EOFErrors and bail, to avoid infinite loops if a non-terminating
2827 EOFErrors and bail, to avoid infinite loops if a non-terminating
2823 file is fed into ipython. Patch submitted in issue 19 by user,
2828 file is fed into ipython. Patch submitted in issue 19 by user,
2824 many thanks.
2829 many thanks.
2825
2830
2826 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2831 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2827 autoquote/parens in continuation prompts, which can cause lots of
2832 autoquote/parens in continuation prompts, which can cause lots of
2828 problems. Closes roundup issue 20.
2833 problems. Closes roundup issue 20.
2829
2834
2830 2004-11-17 Fernando Perez <fperez@colorado.edu>
2835 2004-11-17 Fernando Perez <fperez@colorado.edu>
2831
2836
2832 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2837 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2833 reported as debian bug #280505. I'm not sure my local changelog
2838 reported as debian bug #280505. I'm not sure my local changelog
2834 entry has the proper debian format (Jack?).
2839 entry has the proper debian format (Jack?).
2835
2840
2836 2004-11-08 *** Released version 0.6.4
2841 2004-11-08 *** Released version 0.6.4
2837
2842
2838 2004-11-08 Fernando Perez <fperez@colorado.edu>
2843 2004-11-08 Fernando Perez <fperez@colorado.edu>
2839
2844
2840 * IPython/iplib.py (init_readline): Fix exit message for Windows
2845 * IPython/iplib.py (init_readline): Fix exit message for Windows
2841 when readline is active. Thanks to a report by Eric Jones
2846 when readline is active. Thanks to a report by Eric Jones
2842 <eric-AT-enthought.com>.
2847 <eric-AT-enthought.com>.
2843
2848
2844 2004-11-07 Fernando Perez <fperez@colorado.edu>
2849 2004-11-07 Fernando Perez <fperez@colorado.edu>
2845
2850
2846 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2851 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2847 sometimes seen by win2k/cygwin users.
2852 sometimes seen by win2k/cygwin users.
2848
2853
2849 2004-11-06 Fernando Perez <fperez@colorado.edu>
2854 2004-11-06 Fernando Perez <fperez@colorado.edu>
2850
2855
2851 * IPython/iplib.py (interact): Change the handling of %Exit from
2856 * IPython/iplib.py (interact): Change the handling of %Exit from
2852 trying to propagate a SystemExit to an internal ipython flag.
2857 trying to propagate a SystemExit to an internal ipython flag.
2853 This is less elegant than using Python's exception mechanism, but
2858 This is less elegant than using Python's exception mechanism, but
2854 I can't get that to work reliably with threads, so under -pylab
2859 I can't get that to work reliably with threads, so under -pylab
2855 %Exit was hanging IPython. Cross-thread exception handling is
2860 %Exit was hanging IPython. Cross-thread exception handling is
2856 really a bitch. Thaks to a bug report by Stephen Walton
2861 really a bitch. Thaks to a bug report by Stephen Walton
2857 <stephen.walton-AT-csun.edu>.
2862 <stephen.walton-AT-csun.edu>.
2858
2863
2859 2004-11-04 Fernando Perez <fperez@colorado.edu>
2864 2004-11-04 Fernando Perez <fperez@colorado.edu>
2860
2865
2861 * IPython/iplib.py (raw_input_original): store a pointer to the
2866 * IPython/iplib.py (raw_input_original): store a pointer to the
2862 true raw_input to harden against code which can modify it
2867 true raw_input to harden against code which can modify it
2863 (wx.py.PyShell does this and would otherwise crash ipython).
2868 (wx.py.PyShell does this and would otherwise crash ipython).
2864 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2869 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2865
2870
2866 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2871 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2867 Ctrl-C problem, which does not mess up the input line.
2872 Ctrl-C problem, which does not mess up the input line.
2868
2873
2869 2004-11-03 Fernando Perez <fperez@colorado.edu>
2874 2004-11-03 Fernando Perez <fperez@colorado.edu>
2870
2875
2871 * IPython/Release.py: Changed licensing to BSD, in all files.
2876 * IPython/Release.py: Changed licensing to BSD, in all files.
2872 (name): lowercase name for tarball/RPM release.
2877 (name): lowercase name for tarball/RPM release.
2873
2878
2874 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2879 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2875 use throughout ipython.
2880 use throughout ipython.
2876
2881
2877 * IPython/Magic.py (Magic._ofind): Switch to using the new
2882 * IPython/Magic.py (Magic._ofind): Switch to using the new
2878 OInspect.getdoc() function.
2883 OInspect.getdoc() function.
2879
2884
2880 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2885 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2881 of the line currently being canceled via Ctrl-C. It's extremely
2886 of the line currently being canceled via Ctrl-C. It's extremely
2882 ugly, but I don't know how to do it better (the problem is one of
2887 ugly, but I don't know how to do it better (the problem is one of
2883 handling cross-thread exceptions).
2888 handling cross-thread exceptions).
2884
2889
2885 2004-10-28 Fernando Perez <fperez@colorado.edu>
2890 2004-10-28 Fernando Perez <fperez@colorado.edu>
2886
2891
2887 * IPython/Shell.py (signal_handler): add signal handlers to trap
2892 * IPython/Shell.py (signal_handler): add signal handlers to trap
2888 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2893 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2889 report by Francesc Alted.
2894 report by Francesc Alted.
2890
2895
2891 2004-10-21 Fernando Perez <fperez@colorado.edu>
2896 2004-10-21 Fernando Perez <fperez@colorado.edu>
2892
2897
2893 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2898 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2894 to % for pysh syntax extensions.
2899 to % for pysh syntax extensions.
2895
2900
2896 2004-10-09 Fernando Perez <fperez@colorado.edu>
2901 2004-10-09 Fernando Perez <fperez@colorado.edu>
2897
2902
2898 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2903 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2899 arrays to print a more useful summary, without calling str(arr).
2904 arrays to print a more useful summary, without calling str(arr).
2900 This avoids the problem of extremely lengthy computations which
2905 This avoids the problem of extremely lengthy computations which
2901 occur if arr is large, and appear to the user as a system lockup
2906 occur if arr is large, and appear to the user as a system lockup
2902 with 100% cpu activity. After a suggestion by Kristian Sandberg
2907 with 100% cpu activity. After a suggestion by Kristian Sandberg
2903 <Kristian.Sandberg@colorado.edu>.
2908 <Kristian.Sandberg@colorado.edu>.
2904 (Magic.__init__): fix bug in global magic escapes not being
2909 (Magic.__init__): fix bug in global magic escapes not being
2905 correctly set.
2910 correctly set.
2906
2911
2907 2004-10-08 Fernando Perez <fperez@colorado.edu>
2912 2004-10-08 Fernando Perez <fperez@colorado.edu>
2908
2913
2909 * IPython/Magic.py (__license__): change to absolute imports of
2914 * IPython/Magic.py (__license__): change to absolute imports of
2910 ipython's own internal packages, to start adapting to the absolute
2915 ipython's own internal packages, to start adapting to the absolute
2911 import requirement of PEP-328.
2916 import requirement of PEP-328.
2912
2917
2913 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2918 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2914 files, and standardize author/license marks through the Release
2919 files, and standardize author/license marks through the Release
2915 module instead of having per/file stuff (except for files with
2920 module instead of having per/file stuff (except for files with
2916 particular licenses, like the MIT/PSF-licensed codes).
2921 particular licenses, like the MIT/PSF-licensed codes).
2917
2922
2918 * IPython/Debugger.py: remove dead code for python 2.1
2923 * IPython/Debugger.py: remove dead code for python 2.1
2919
2924
2920 2004-10-04 Fernando Perez <fperez@colorado.edu>
2925 2004-10-04 Fernando Perez <fperez@colorado.edu>
2921
2926
2922 * IPython/iplib.py (ipmagic): New function for accessing magics
2927 * IPython/iplib.py (ipmagic): New function for accessing magics
2923 via a normal python function call.
2928 via a normal python function call.
2924
2929
2925 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2930 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2926 from '@' to '%', to accomodate the new @decorator syntax of python
2931 from '@' to '%', to accomodate the new @decorator syntax of python
2927 2.4.
2932 2.4.
2928
2933
2929 2004-09-29 Fernando Perez <fperez@colorado.edu>
2934 2004-09-29 Fernando Perez <fperez@colorado.edu>
2930
2935
2931 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2936 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2932 matplotlib.use to prevent running scripts which try to switch
2937 matplotlib.use to prevent running scripts which try to switch
2933 interactive backends from within ipython. This will just crash
2938 interactive backends from within ipython. This will just crash
2934 the python interpreter, so we can't allow it (but a detailed error
2939 the python interpreter, so we can't allow it (but a detailed error
2935 is given to the user).
2940 is given to the user).
2936
2941
2937 2004-09-28 Fernando Perez <fperez@colorado.edu>
2942 2004-09-28 Fernando Perez <fperez@colorado.edu>
2938
2943
2939 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2944 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2940 matplotlib-related fixes so that using @run with non-matplotlib
2945 matplotlib-related fixes so that using @run with non-matplotlib
2941 scripts doesn't pop up spurious plot windows. This requires
2946 scripts doesn't pop up spurious plot windows. This requires
2942 matplotlib >= 0.63, where I had to make some changes as well.
2947 matplotlib >= 0.63, where I had to make some changes as well.
2943
2948
2944 * IPython/ipmaker.py (make_IPython): update version requirement to
2949 * IPython/ipmaker.py (make_IPython): update version requirement to
2945 python 2.2.
2950 python 2.2.
2946
2951
2947 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2952 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2948 banner arg for embedded customization.
2953 banner arg for embedded customization.
2949
2954
2950 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2955 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2951 explicit uses of __IP as the IPython's instance name. Now things
2956 explicit uses of __IP as the IPython's instance name. Now things
2952 are properly handled via the shell.name value. The actual code
2957 are properly handled via the shell.name value. The actual code
2953 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2958 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2954 is much better than before. I'll clean things completely when the
2959 is much better than before. I'll clean things completely when the
2955 magic stuff gets a real overhaul.
2960 magic stuff gets a real overhaul.
2956
2961
2957 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2962 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2958 minor changes to debian dir.
2963 minor changes to debian dir.
2959
2964
2960 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2965 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2961 pointer to the shell itself in the interactive namespace even when
2966 pointer to the shell itself in the interactive namespace even when
2962 a user-supplied dict is provided. This is needed for embedding
2967 a user-supplied dict is provided. This is needed for embedding
2963 purposes (found by tests with Michel Sanner).
2968 purposes (found by tests with Michel Sanner).
2964
2969
2965 2004-09-27 Fernando Perez <fperez@colorado.edu>
2970 2004-09-27 Fernando Perez <fperez@colorado.edu>
2966
2971
2967 * IPython/UserConfig/ipythonrc: remove []{} from
2972 * IPython/UserConfig/ipythonrc: remove []{} from
2968 readline_remove_delims, so that things like [modname.<TAB> do
2973 readline_remove_delims, so that things like [modname.<TAB> do
2969 proper completion. This disables [].TAB, but that's a less common
2974 proper completion. This disables [].TAB, but that's a less common
2970 case than module names in list comprehensions, for example.
2975 case than module names in list comprehensions, for example.
2971 Thanks to a report by Andrea Riciputi.
2976 Thanks to a report by Andrea Riciputi.
2972
2977
2973 2004-09-09 Fernando Perez <fperez@colorado.edu>
2978 2004-09-09 Fernando Perez <fperez@colorado.edu>
2974
2979
2975 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2980 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2976 blocking problems in win32 and osx. Fix by John.
2981 blocking problems in win32 and osx. Fix by John.
2977
2982
2978 2004-09-08 Fernando Perez <fperez@colorado.edu>
2983 2004-09-08 Fernando Perez <fperez@colorado.edu>
2979
2984
2980 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2985 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2981 for Win32 and OSX. Fix by John Hunter.
2986 for Win32 and OSX. Fix by John Hunter.
2982
2987
2983 2004-08-30 *** Released version 0.6.3
2988 2004-08-30 *** Released version 0.6.3
2984
2989
2985 2004-08-30 Fernando Perez <fperez@colorado.edu>
2990 2004-08-30 Fernando Perez <fperez@colorado.edu>
2986
2991
2987 * setup.py (isfile): Add manpages to list of dependent files to be
2992 * setup.py (isfile): Add manpages to list of dependent files to be
2988 updated.
2993 updated.
2989
2994
2990 2004-08-27 Fernando Perez <fperez@colorado.edu>
2995 2004-08-27 Fernando Perez <fperez@colorado.edu>
2991
2996
2992 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2997 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2993 for now. They don't really work with standalone WX/GTK code
2998 for now. They don't really work with standalone WX/GTK code
2994 (though matplotlib IS working fine with both of those backends).
2999 (though matplotlib IS working fine with both of those backends).
2995 This will neeed much more testing. I disabled most things with
3000 This will neeed much more testing. I disabled most things with
2996 comments, so turning it back on later should be pretty easy.
3001 comments, so turning it back on later should be pretty easy.
2997
3002
2998 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3003 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2999 autocalling of expressions like r'foo', by modifying the line
3004 autocalling of expressions like r'foo', by modifying the line
3000 split regexp. Closes
3005 split regexp. Closes
3001 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3006 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3002 Riley <ipythonbugs-AT-sabi.net>.
3007 Riley <ipythonbugs-AT-sabi.net>.
3003 (InteractiveShell.mainloop): honor --nobanner with banner
3008 (InteractiveShell.mainloop): honor --nobanner with banner
3004 extensions.
3009 extensions.
3005
3010
3006 * IPython/Shell.py: Significant refactoring of all classes, so
3011 * IPython/Shell.py: Significant refactoring of all classes, so
3007 that we can really support ALL matplotlib backends and threading
3012 that we can really support ALL matplotlib backends and threading
3008 models (John spotted a bug with Tk which required this). Now we
3013 models (John spotted a bug with Tk which required this). Now we
3009 should support single-threaded, WX-threads and GTK-threads, both
3014 should support single-threaded, WX-threads and GTK-threads, both
3010 for generic code and for matplotlib.
3015 for generic code and for matplotlib.
3011
3016
3012 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3017 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3013 -pylab, to simplify things for users. Will also remove the pylab
3018 -pylab, to simplify things for users. Will also remove the pylab
3014 profile, since now all of matplotlib configuration is directly
3019 profile, since now all of matplotlib configuration is directly
3015 handled here. This also reduces startup time.
3020 handled here. This also reduces startup time.
3016
3021
3017 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3022 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3018 shell wasn't being correctly called. Also in IPShellWX.
3023 shell wasn't being correctly called. Also in IPShellWX.
3019
3024
3020 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3025 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3021 fine-tune banner.
3026 fine-tune banner.
3022
3027
3023 * IPython/numutils.py (spike): Deprecate these spike functions,
3028 * IPython/numutils.py (spike): Deprecate these spike functions,
3024 delete (long deprecated) gnuplot_exec handler.
3029 delete (long deprecated) gnuplot_exec handler.
3025
3030
3026 2004-08-26 Fernando Perez <fperez@colorado.edu>
3031 2004-08-26 Fernando Perez <fperez@colorado.edu>
3027
3032
3028 * ipython.1: Update for threading options, plus some others which
3033 * ipython.1: Update for threading options, plus some others which
3029 were missing.
3034 were missing.
3030
3035
3031 * IPython/ipmaker.py (__call__): Added -wthread option for
3036 * IPython/ipmaker.py (__call__): Added -wthread option for
3032 wxpython thread handling. Make sure threading options are only
3037 wxpython thread handling. Make sure threading options are only
3033 valid at the command line.
3038 valid at the command line.
3034
3039
3035 * scripts/ipython: moved shell selection into a factory function
3040 * scripts/ipython: moved shell selection into a factory function
3036 in Shell.py, to keep the starter script to a minimum.
3041 in Shell.py, to keep the starter script to a minimum.
3037
3042
3038 2004-08-25 Fernando Perez <fperez@colorado.edu>
3043 2004-08-25 Fernando Perez <fperez@colorado.edu>
3039
3044
3040 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3045 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3041 John. Along with some recent changes he made to matplotlib, the
3046 John. Along with some recent changes he made to matplotlib, the
3042 next versions of both systems should work very well together.
3047 next versions of both systems should work very well together.
3043
3048
3044 2004-08-24 Fernando Perez <fperez@colorado.edu>
3049 2004-08-24 Fernando Perez <fperez@colorado.edu>
3045
3050
3046 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3051 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3047 tried to switch the profiling to using hotshot, but I'm getting
3052 tried to switch the profiling to using hotshot, but I'm getting
3048 strange errors from prof.runctx() there. I may be misreading the
3053 strange errors from prof.runctx() there. I may be misreading the
3049 docs, but it looks weird. For now the profiling code will
3054 docs, but it looks weird. For now the profiling code will
3050 continue to use the standard profiler.
3055 continue to use the standard profiler.
3051
3056
3052 2004-08-23 Fernando Perez <fperez@colorado.edu>
3057 2004-08-23 Fernando Perez <fperez@colorado.edu>
3053
3058
3054 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3059 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3055 threaded shell, by John Hunter. It's not quite ready yet, but
3060 threaded shell, by John Hunter. It's not quite ready yet, but
3056 close.
3061 close.
3057
3062
3058 2004-08-22 Fernando Perez <fperez@colorado.edu>
3063 2004-08-22 Fernando Perez <fperez@colorado.edu>
3059
3064
3060 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3065 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3061 in Magic and ultraTB.
3066 in Magic and ultraTB.
3062
3067
3063 * ipython.1: document threading options in manpage.
3068 * ipython.1: document threading options in manpage.
3064
3069
3065 * scripts/ipython: Changed name of -thread option to -gthread,
3070 * scripts/ipython: Changed name of -thread option to -gthread,
3066 since this is GTK specific. I want to leave the door open for a
3071 since this is GTK specific. I want to leave the door open for a
3067 -wthread option for WX, which will most likely be necessary. This
3072 -wthread option for WX, which will most likely be necessary. This
3068 change affects usage and ipmaker as well.
3073 change affects usage and ipmaker as well.
3069
3074
3070 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3075 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3071 handle the matplotlib shell issues. Code by John Hunter
3076 handle the matplotlib shell issues. Code by John Hunter
3072 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3077 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3073 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3078 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3074 broken (and disabled for end users) for now, but it puts the
3079 broken (and disabled for end users) for now, but it puts the
3075 infrastructure in place.
3080 infrastructure in place.
3076
3081
3077 2004-08-21 Fernando Perez <fperez@colorado.edu>
3082 2004-08-21 Fernando Perez <fperez@colorado.edu>
3078
3083
3079 * ipythonrc-pylab: Add matplotlib support.
3084 * ipythonrc-pylab: Add matplotlib support.
3080
3085
3081 * matplotlib_config.py: new files for matplotlib support, part of
3086 * matplotlib_config.py: new files for matplotlib support, part of
3082 the pylab profile.
3087 the pylab profile.
3083
3088
3084 * IPython/usage.py (__doc__): documented the threading options.
3089 * IPython/usage.py (__doc__): documented the threading options.
3085
3090
3086 2004-08-20 Fernando Perez <fperez@colorado.edu>
3091 2004-08-20 Fernando Perez <fperez@colorado.edu>
3087
3092
3088 * ipython: Modified the main calling routine to handle the -thread
3093 * ipython: Modified the main calling routine to handle the -thread
3089 and -mpthread options. This needs to be done as a top-level hack,
3094 and -mpthread options. This needs to be done as a top-level hack,
3090 because it determines which class to instantiate for IPython
3095 because it determines which class to instantiate for IPython
3091 itself.
3096 itself.
3092
3097
3093 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3098 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3094 classes to support multithreaded GTK operation without blocking,
3099 classes to support multithreaded GTK operation without blocking,
3095 and matplotlib with all backends. This is a lot of still very
3100 and matplotlib with all backends. This is a lot of still very
3096 experimental code, and threads are tricky. So it may still have a
3101 experimental code, and threads are tricky. So it may still have a
3097 few rough edges... This code owes a lot to
3102 few rough edges... This code owes a lot to
3098 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3103 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3099 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3104 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3100 to John Hunter for all the matplotlib work.
3105 to John Hunter for all the matplotlib work.
3101
3106
3102 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3107 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3103 options for gtk thread and matplotlib support.
3108 options for gtk thread and matplotlib support.
3104
3109
3105 2004-08-16 Fernando Perez <fperez@colorado.edu>
3110 2004-08-16 Fernando Perez <fperez@colorado.edu>
3106
3111
3107 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3112 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3108 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3113 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3109 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3114 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3110
3115
3111 2004-08-11 Fernando Perez <fperez@colorado.edu>
3116 2004-08-11 Fernando Perez <fperez@colorado.edu>
3112
3117
3113 * setup.py (isfile): Fix build so documentation gets updated for
3118 * setup.py (isfile): Fix build so documentation gets updated for
3114 rpms (it was only done for .tgz builds).
3119 rpms (it was only done for .tgz builds).
3115
3120
3116 2004-08-10 Fernando Perez <fperez@colorado.edu>
3121 2004-08-10 Fernando Perez <fperez@colorado.edu>
3117
3122
3118 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3123 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3119
3124
3120 * iplib.py : Silence syntax error exceptions in tab-completion.
3125 * iplib.py : Silence syntax error exceptions in tab-completion.
3121
3126
3122 2004-08-05 Fernando Perez <fperez@colorado.edu>
3127 2004-08-05 Fernando Perez <fperez@colorado.edu>
3123
3128
3124 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3129 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3125 'color off' mark for continuation prompts. This was causing long
3130 'color off' mark for continuation prompts. This was causing long
3126 continuation lines to mis-wrap.
3131 continuation lines to mis-wrap.
3127
3132
3128 2004-08-01 Fernando Perez <fperez@colorado.edu>
3133 2004-08-01 Fernando Perez <fperez@colorado.edu>
3129
3134
3130 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3135 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3131 for building ipython to be a parameter. All this is necessary
3136 for building ipython to be a parameter. All this is necessary
3132 right now to have a multithreaded version, but this insane
3137 right now to have a multithreaded version, but this insane
3133 non-design will be cleaned up soon. For now, it's a hack that
3138 non-design will be cleaned up soon. For now, it's a hack that
3134 works.
3139 works.
3135
3140
3136 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3141 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3137 args in various places. No bugs so far, but it's a dangerous
3142 args in various places. No bugs so far, but it's a dangerous
3138 practice.
3143 practice.
3139
3144
3140 2004-07-31 Fernando Perez <fperez@colorado.edu>
3145 2004-07-31 Fernando Perez <fperez@colorado.edu>
3141
3146
3142 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3147 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3143 fix completion of files with dots in their names under most
3148 fix completion of files with dots in their names under most
3144 profiles (pysh was OK because the completion order is different).
3149 profiles (pysh was OK because the completion order is different).
3145
3150
3146 2004-07-27 Fernando Perez <fperez@colorado.edu>
3151 2004-07-27 Fernando Perez <fperez@colorado.edu>
3147
3152
3148 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3153 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3149 keywords manually, b/c the one in keyword.py was removed in python
3154 keywords manually, b/c the one in keyword.py was removed in python
3150 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3155 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3151 This is NOT a bug under python 2.3 and earlier.
3156 This is NOT a bug under python 2.3 and earlier.
3152
3157
3153 2004-07-26 Fernando Perez <fperez@colorado.edu>
3158 2004-07-26 Fernando Perez <fperez@colorado.edu>
3154
3159
3155 * IPython/ultraTB.py (VerboseTB.text): Add another
3160 * IPython/ultraTB.py (VerboseTB.text): Add another
3156 linecache.checkcache() call to try to prevent inspect.py from
3161 linecache.checkcache() call to try to prevent inspect.py from
3157 crashing under python 2.3. I think this fixes
3162 crashing under python 2.3. I think this fixes
3158 http://www.scipy.net/roundup/ipython/issue17.
3163 http://www.scipy.net/roundup/ipython/issue17.
3159
3164
3160 2004-07-26 *** Released version 0.6.2
3165 2004-07-26 *** Released version 0.6.2
3161
3166
3162 2004-07-26 Fernando Perez <fperez@colorado.edu>
3167 2004-07-26 Fernando Perez <fperez@colorado.edu>
3163
3168
3164 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3169 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3165 fail for any number.
3170 fail for any number.
3166 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3171 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3167 empty bookmarks.
3172 empty bookmarks.
3168
3173
3169 2004-07-26 *** Released version 0.6.1
3174 2004-07-26 *** Released version 0.6.1
3170
3175
3171 2004-07-26 Fernando Perez <fperez@colorado.edu>
3176 2004-07-26 Fernando Perez <fperez@colorado.edu>
3172
3177
3173 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3178 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3174
3179
3175 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3180 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3176 escaping '()[]{}' in filenames.
3181 escaping '()[]{}' in filenames.
3177
3182
3178 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3183 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3179 Python 2.2 users who lack a proper shlex.split.
3184 Python 2.2 users who lack a proper shlex.split.
3180
3185
3181 2004-07-19 Fernando Perez <fperez@colorado.edu>
3186 2004-07-19 Fernando Perez <fperez@colorado.edu>
3182
3187
3183 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3188 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3184 for reading readline's init file. I follow the normal chain:
3189 for reading readline's init file. I follow the normal chain:
3185 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3190 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3186 report by Mike Heeter. This closes
3191 report by Mike Heeter. This closes
3187 http://www.scipy.net/roundup/ipython/issue16.
3192 http://www.scipy.net/roundup/ipython/issue16.
3188
3193
3189 2004-07-18 Fernando Perez <fperez@colorado.edu>
3194 2004-07-18 Fernando Perez <fperez@colorado.edu>
3190
3195
3191 * IPython/iplib.py (__init__): Add better handling of '\' under
3196 * IPython/iplib.py (__init__): Add better handling of '\' under
3192 Win32 for filenames. After a patch by Ville.
3197 Win32 for filenames. After a patch by Ville.
3193
3198
3194 2004-07-17 Fernando Perez <fperez@colorado.edu>
3199 2004-07-17 Fernando Perez <fperez@colorado.edu>
3195
3200
3196 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3201 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3197 autocalling would be triggered for 'foo is bar' if foo is
3202 autocalling would be triggered for 'foo is bar' if foo is
3198 callable. I also cleaned up the autocall detection code to use a
3203 callable. I also cleaned up the autocall detection code to use a
3199 regexp, which is faster. Bug reported by Alexander Schmolck.
3204 regexp, which is faster. Bug reported by Alexander Schmolck.
3200
3205
3201 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3206 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3202 '?' in them would confuse the help system. Reported by Alex
3207 '?' in them would confuse the help system. Reported by Alex
3203 Schmolck.
3208 Schmolck.
3204
3209
3205 2004-07-16 Fernando Perez <fperez@colorado.edu>
3210 2004-07-16 Fernando Perez <fperez@colorado.edu>
3206
3211
3207 * IPython/GnuplotInteractive.py (__all__): added plot2.
3212 * IPython/GnuplotInteractive.py (__all__): added plot2.
3208
3213
3209 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3214 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3210 plotting dictionaries, lists or tuples of 1d arrays.
3215 plotting dictionaries, lists or tuples of 1d arrays.
3211
3216
3212 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3217 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3213 optimizations.
3218 optimizations.
3214
3219
3215 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3220 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3216 the information which was there from Janko's original IPP code:
3221 the information which was there from Janko's original IPP code:
3217
3222
3218 03.05.99 20:53 porto.ifm.uni-kiel.de
3223 03.05.99 20:53 porto.ifm.uni-kiel.de
3219 --Started changelog.
3224 --Started changelog.
3220 --make clear do what it say it does
3225 --make clear do what it say it does
3221 --added pretty output of lines from inputcache
3226 --added pretty output of lines from inputcache
3222 --Made Logger a mixin class, simplifies handling of switches
3227 --Made Logger a mixin class, simplifies handling of switches
3223 --Added own completer class. .string<TAB> expands to last history
3228 --Added own completer class. .string<TAB> expands to last history
3224 line which starts with string. The new expansion is also present
3229 line which starts with string. The new expansion is also present
3225 with Ctrl-r from the readline library. But this shows, who this
3230 with Ctrl-r from the readline library. But this shows, who this
3226 can be done for other cases.
3231 can be done for other cases.
3227 --Added convention that all shell functions should accept a
3232 --Added convention that all shell functions should accept a
3228 parameter_string This opens the door for different behaviour for
3233 parameter_string This opens the door for different behaviour for
3229 each function. @cd is a good example of this.
3234 each function. @cd is a good example of this.
3230
3235
3231 04.05.99 12:12 porto.ifm.uni-kiel.de
3236 04.05.99 12:12 porto.ifm.uni-kiel.de
3232 --added logfile rotation
3237 --added logfile rotation
3233 --added new mainloop method which freezes first the namespace
3238 --added new mainloop method which freezes first the namespace
3234
3239
3235 07.05.99 21:24 porto.ifm.uni-kiel.de
3240 07.05.99 21:24 porto.ifm.uni-kiel.de
3236 --added the docreader classes. Now there is a help system.
3241 --added the docreader classes. Now there is a help system.
3237 -This is only a first try. Currently it's not easy to put new
3242 -This is only a first try. Currently it's not easy to put new
3238 stuff in the indices. But this is the way to go. Info would be
3243 stuff in the indices. But this is the way to go. Info would be
3239 better, but HTML is every where and not everybody has an info
3244 better, but HTML is every where and not everybody has an info
3240 system installed and it's not so easy to change html-docs to info.
3245 system installed and it's not so easy to change html-docs to info.
3241 --added global logfile option
3246 --added global logfile option
3242 --there is now a hook for object inspection method pinfo needs to
3247 --there is now a hook for object inspection method pinfo needs to
3243 be provided for this. Can be reached by two '??'.
3248 be provided for this. Can be reached by two '??'.
3244
3249
3245 08.05.99 20:51 porto.ifm.uni-kiel.de
3250 08.05.99 20:51 porto.ifm.uni-kiel.de
3246 --added a README
3251 --added a README
3247 --bug in rc file. Something has changed so functions in the rc
3252 --bug in rc file. Something has changed so functions in the rc
3248 file need to reference the shell and not self. Not clear if it's a
3253 file need to reference the shell and not self. Not clear if it's a
3249 bug or feature.
3254 bug or feature.
3250 --changed rc file for new behavior
3255 --changed rc file for new behavior
3251
3256
3252 2004-07-15 Fernando Perez <fperez@colorado.edu>
3257 2004-07-15 Fernando Perez <fperez@colorado.edu>
3253
3258
3254 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3259 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3255 cache was falling out of sync in bizarre manners when multi-line
3260 cache was falling out of sync in bizarre manners when multi-line
3256 input was present. Minor optimizations and cleanup.
3261 input was present. Minor optimizations and cleanup.
3257
3262
3258 (Logger): Remove old Changelog info for cleanup. This is the
3263 (Logger): Remove old Changelog info for cleanup. This is the
3259 information which was there from Janko's original code:
3264 information which was there from Janko's original code:
3260
3265
3261 Changes to Logger: - made the default log filename a parameter
3266 Changes to Logger: - made the default log filename a parameter
3262
3267
3263 - put a check for lines beginning with !@? in log(). Needed
3268 - put a check for lines beginning with !@? in log(). Needed
3264 (even if the handlers properly log their lines) for mid-session
3269 (even if the handlers properly log their lines) for mid-session
3265 logging activation to work properly. Without this, lines logged
3270 logging activation to work properly. Without this, lines logged
3266 in mid session, which get read from the cache, would end up
3271 in mid session, which get read from the cache, would end up
3267 'bare' (with !@? in the open) in the log. Now they are caught
3272 'bare' (with !@? in the open) in the log. Now they are caught
3268 and prepended with a #.
3273 and prepended with a #.
3269
3274
3270 * IPython/iplib.py (InteractiveShell.init_readline): added check
3275 * IPython/iplib.py (InteractiveShell.init_readline): added check
3271 in case MagicCompleter fails to be defined, so we don't crash.
3276 in case MagicCompleter fails to be defined, so we don't crash.
3272
3277
3273 2004-07-13 Fernando Perez <fperez@colorado.edu>
3278 2004-07-13 Fernando Perez <fperez@colorado.edu>
3274
3279
3275 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3280 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3276 of EPS if the requested filename ends in '.eps'.
3281 of EPS if the requested filename ends in '.eps'.
3277
3282
3278 2004-07-04 Fernando Perez <fperez@colorado.edu>
3283 2004-07-04 Fernando Perez <fperez@colorado.edu>
3279
3284
3280 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3285 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3281 escaping of quotes when calling the shell.
3286 escaping of quotes when calling the shell.
3282
3287
3283 2004-07-02 Fernando Perez <fperez@colorado.edu>
3288 2004-07-02 Fernando Perez <fperez@colorado.edu>
3284
3289
3285 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3290 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3286 gettext not working because we were clobbering '_'. Fixes
3291 gettext not working because we were clobbering '_'. Fixes
3287 http://www.scipy.net/roundup/ipython/issue6.
3292 http://www.scipy.net/roundup/ipython/issue6.
3288
3293
3289 2004-07-01 Fernando Perez <fperez@colorado.edu>
3294 2004-07-01 Fernando Perez <fperez@colorado.edu>
3290
3295
3291 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3296 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3292 into @cd. Patch by Ville.
3297 into @cd. Patch by Ville.
3293
3298
3294 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3299 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3295 new function to store things after ipmaker runs. Patch by Ville.
3300 new function to store things after ipmaker runs. Patch by Ville.
3296 Eventually this will go away once ipmaker is removed and the class
3301 Eventually this will go away once ipmaker is removed and the class
3297 gets cleaned up, but for now it's ok. Key functionality here is
3302 gets cleaned up, but for now it's ok. Key functionality here is
3298 the addition of the persistent storage mechanism, a dict for
3303 the addition of the persistent storage mechanism, a dict for
3299 keeping data across sessions (for now just bookmarks, but more can
3304 keeping data across sessions (for now just bookmarks, but more can
3300 be implemented later).
3305 be implemented later).
3301
3306
3302 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3307 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3303 persistent across sections. Patch by Ville, I modified it
3308 persistent across sections. Patch by Ville, I modified it
3304 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3309 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3305 added a '-l' option to list all bookmarks.
3310 added a '-l' option to list all bookmarks.
3306
3311
3307 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3312 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3308 center for cleanup. Registered with atexit.register(). I moved
3313 center for cleanup. Registered with atexit.register(). I moved
3309 here the old exit_cleanup(). After a patch by Ville.
3314 here the old exit_cleanup(). After a patch by Ville.
3310
3315
3311 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3316 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3312 characters in the hacked shlex_split for python 2.2.
3317 characters in the hacked shlex_split for python 2.2.
3313
3318
3314 * IPython/iplib.py (file_matches): more fixes to filenames with
3319 * IPython/iplib.py (file_matches): more fixes to filenames with
3315 whitespace in them. It's not perfect, but limitations in python's
3320 whitespace in them. It's not perfect, but limitations in python's
3316 readline make it impossible to go further.
3321 readline make it impossible to go further.
3317
3322
3318 2004-06-29 Fernando Perez <fperez@colorado.edu>
3323 2004-06-29 Fernando Perez <fperez@colorado.edu>
3319
3324
3320 * IPython/iplib.py (file_matches): escape whitespace correctly in
3325 * IPython/iplib.py (file_matches): escape whitespace correctly in
3321 filename completions. Bug reported by Ville.
3326 filename completions. Bug reported by Ville.
3322
3327
3323 2004-06-28 Fernando Perez <fperez@colorado.edu>
3328 2004-06-28 Fernando Perez <fperez@colorado.edu>
3324
3329
3325 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3330 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3326 the history file will be called 'history-PROFNAME' (or just
3331 the history file will be called 'history-PROFNAME' (or just
3327 'history' if no profile is loaded). I was getting annoyed at
3332 'history' if no profile is loaded). I was getting annoyed at
3328 getting my Numerical work history clobbered by pysh sessions.
3333 getting my Numerical work history clobbered by pysh sessions.
3329
3334
3330 * IPython/iplib.py (InteractiveShell.__init__): Internal
3335 * IPython/iplib.py (InteractiveShell.__init__): Internal
3331 getoutputerror() function so that we can honor the system_verbose
3336 getoutputerror() function so that we can honor the system_verbose
3332 flag for _all_ system calls. I also added escaping of #
3337 flag for _all_ system calls. I also added escaping of #
3333 characters here to avoid confusing Itpl.
3338 characters here to avoid confusing Itpl.
3334
3339
3335 * IPython/Magic.py (shlex_split): removed call to shell in
3340 * IPython/Magic.py (shlex_split): removed call to shell in
3336 parse_options and replaced it with shlex.split(). The annoying
3341 parse_options and replaced it with shlex.split(). The annoying
3337 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3342 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3338 to backport it from 2.3, with several frail hacks (the shlex
3343 to backport it from 2.3, with several frail hacks (the shlex
3339 module is rather limited in 2.2). Thanks to a suggestion by Ville
3344 module is rather limited in 2.2). Thanks to a suggestion by Ville
3340 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3345 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3341 problem.
3346 problem.
3342
3347
3343 (Magic.magic_system_verbose): new toggle to print the actual
3348 (Magic.magic_system_verbose): new toggle to print the actual
3344 system calls made by ipython. Mainly for debugging purposes.
3349 system calls made by ipython. Mainly for debugging purposes.
3345
3350
3346 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3351 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3347 doesn't support persistence. Reported (and fix suggested) by
3352 doesn't support persistence. Reported (and fix suggested) by
3348 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3353 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3349
3354
3350 2004-06-26 Fernando Perez <fperez@colorado.edu>
3355 2004-06-26 Fernando Perez <fperez@colorado.edu>
3351
3356
3352 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3357 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3353 continue prompts.
3358 continue prompts.
3354
3359
3355 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3360 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3356 function (basically a big docstring) and a few more things here to
3361 function (basically a big docstring) and a few more things here to
3357 speedup startup. pysh.py is now very lightweight. We want because
3362 speedup startup. pysh.py is now very lightweight. We want because
3358 it gets execfile'd, while InterpreterExec gets imported, so
3363 it gets execfile'd, while InterpreterExec gets imported, so
3359 byte-compilation saves time.
3364 byte-compilation saves time.
3360
3365
3361 2004-06-25 Fernando Perez <fperez@colorado.edu>
3366 2004-06-25 Fernando Perez <fperez@colorado.edu>
3362
3367
3363 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3368 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3364 -NUM', which was recently broken.
3369 -NUM', which was recently broken.
3365
3370
3366 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3371 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3367 in multi-line input (but not !!, which doesn't make sense there).
3372 in multi-line input (but not !!, which doesn't make sense there).
3368
3373
3369 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3374 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3370 It's just too useful, and people can turn it off in the less
3375 It's just too useful, and people can turn it off in the less
3371 common cases where it's a problem.
3376 common cases where it's a problem.
3372
3377
3373 2004-06-24 Fernando Perez <fperez@colorado.edu>
3378 2004-06-24 Fernando Perez <fperez@colorado.edu>
3374
3379
3375 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3380 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3376 special syntaxes (like alias calling) is now allied in multi-line
3381 special syntaxes (like alias calling) is now allied in multi-line
3377 input. This is still _very_ experimental, but it's necessary for
3382 input. This is still _very_ experimental, but it's necessary for
3378 efficient shell usage combining python looping syntax with system
3383 efficient shell usage combining python looping syntax with system
3379 calls. For now it's restricted to aliases, I don't think it
3384 calls. For now it's restricted to aliases, I don't think it
3380 really even makes sense to have this for magics.
3385 really even makes sense to have this for magics.
3381
3386
3382 2004-06-23 Fernando Perez <fperez@colorado.edu>
3387 2004-06-23 Fernando Perez <fperez@colorado.edu>
3383
3388
3384 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3389 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3385 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3390 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3386
3391
3387 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3392 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3388 extensions under Windows (after code sent by Gary Bishop). The
3393 extensions under Windows (after code sent by Gary Bishop). The
3389 extensions considered 'executable' are stored in IPython's rc
3394 extensions considered 'executable' are stored in IPython's rc
3390 structure as win_exec_ext.
3395 structure as win_exec_ext.
3391
3396
3392 * IPython/genutils.py (shell): new function, like system() but
3397 * IPython/genutils.py (shell): new function, like system() but
3393 without return value. Very useful for interactive shell work.
3398 without return value. Very useful for interactive shell work.
3394
3399
3395 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3400 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3396 delete aliases.
3401 delete aliases.
3397
3402
3398 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3403 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3399 sure that the alias table doesn't contain python keywords.
3404 sure that the alias table doesn't contain python keywords.
3400
3405
3401 2004-06-21 Fernando Perez <fperez@colorado.edu>
3406 2004-06-21 Fernando Perez <fperez@colorado.edu>
3402
3407
3403 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3408 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3404 non-existent items are found in $PATH. Reported by Thorsten.
3409 non-existent items are found in $PATH. Reported by Thorsten.
3405
3410
3406 2004-06-20 Fernando Perez <fperez@colorado.edu>
3411 2004-06-20 Fernando Perez <fperez@colorado.edu>
3407
3412
3408 * IPython/iplib.py (complete): modified the completer so that the
3413 * IPython/iplib.py (complete): modified the completer so that the
3409 order of priorities can be easily changed at runtime.
3414 order of priorities can be easily changed at runtime.
3410
3415
3411 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3416 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3412 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3417 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3413
3418
3414 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3419 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3415 expand Python variables prepended with $ in all system calls. The
3420 expand Python variables prepended with $ in all system calls. The
3416 same was done to InteractiveShell.handle_shell_escape. Now all
3421 same was done to InteractiveShell.handle_shell_escape. Now all
3417 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3422 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3418 expansion of python variables and expressions according to the
3423 expansion of python variables and expressions according to the
3419 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3424 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3420
3425
3421 Though PEP-215 has been rejected, a similar (but simpler) one
3426 Though PEP-215 has been rejected, a similar (but simpler) one
3422 seems like it will go into Python 2.4, PEP-292 -
3427 seems like it will go into Python 2.4, PEP-292 -
3423 http://www.python.org/peps/pep-0292.html.
3428 http://www.python.org/peps/pep-0292.html.
3424
3429
3425 I'll keep the full syntax of PEP-215, since IPython has since the
3430 I'll keep the full syntax of PEP-215, since IPython has since the
3426 start used Ka-Ping Yee's reference implementation discussed there
3431 start used Ka-Ping Yee's reference implementation discussed there
3427 (Itpl), and I actually like the powerful semantics it offers.
3432 (Itpl), and I actually like the powerful semantics it offers.
3428
3433
3429 In order to access normal shell variables, the $ has to be escaped
3434 In order to access normal shell variables, the $ has to be escaped
3430 via an extra $. For example:
3435 via an extra $. For example:
3431
3436
3432 In [7]: PATH='a python variable'
3437 In [7]: PATH='a python variable'
3433
3438
3434 In [8]: !echo $PATH
3439 In [8]: !echo $PATH
3435 a python variable
3440 a python variable
3436
3441
3437 In [9]: !echo $$PATH
3442 In [9]: !echo $$PATH
3438 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3443 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3439
3444
3440 (Magic.parse_options): escape $ so the shell doesn't evaluate
3445 (Magic.parse_options): escape $ so the shell doesn't evaluate
3441 things prematurely.
3446 things prematurely.
3442
3447
3443 * IPython/iplib.py (InteractiveShell.call_alias): added the
3448 * IPython/iplib.py (InteractiveShell.call_alias): added the
3444 ability for aliases to expand python variables via $.
3449 ability for aliases to expand python variables via $.
3445
3450
3446 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3451 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3447 system, now there's a @rehash/@rehashx pair of magics. These work
3452 system, now there's a @rehash/@rehashx pair of magics. These work
3448 like the csh rehash command, and can be invoked at any time. They
3453 like the csh rehash command, and can be invoked at any time. They
3449 build a table of aliases to everything in the user's $PATH
3454 build a table of aliases to everything in the user's $PATH
3450 (@rehash uses everything, @rehashx is slower but only adds
3455 (@rehash uses everything, @rehashx is slower but only adds
3451 executable files). With this, the pysh.py-based shell profile can
3456 executable files). With this, the pysh.py-based shell profile can
3452 now simply call rehash upon startup, and full access to all
3457 now simply call rehash upon startup, and full access to all
3453 programs in the user's path is obtained.
3458 programs in the user's path is obtained.
3454
3459
3455 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3460 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3456 functionality is now fully in place. I removed the old dynamic
3461 functionality is now fully in place. I removed the old dynamic
3457 code generation based approach, in favor of a much lighter one
3462 code generation based approach, in favor of a much lighter one
3458 based on a simple dict. The advantage is that this allows me to
3463 based on a simple dict. The advantage is that this allows me to
3459 now have thousands of aliases with negligible cost (unthinkable
3464 now have thousands of aliases with negligible cost (unthinkable
3460 with the old system).
3465 with the old system).
3461
3466
3462 2004-06-19 Fernando Perez <fperez@colorado.edu>
3467 2004-06-19 Fernando Perez <fperez@colorado.edu>
3463
3468
3464 * IPython/iplib.py (__init__): extended MagicCompleter class to
3469 * IPython/iplib.py (__init__): extended MagicCompleter class to
3465 also complete (last in priority) on user aliases.
3470 also complete (last in priority) on user aliases.
3466
3471
3467 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3472 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3468 call to eval.
3473 call to eval.
3469 (ItplNS.__init__): Added a new class which functions like Itpl,
3474 (ItplNS.__init__): Added a new class which functions like Itpl,
3470 but allows configuring the namespace for the evaluation to occur
3475 but allows configuring the namespace for the evaluation to occur
3471 in.
3476 in.
3472
3477
3473 2004-06-18 Fernando Perez <fperez@colorado.edu>
3478 2004-06-18 Fernando Perez <fperez@colorado.edu>
3474
3479
3475 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3480 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3476 better message when 'exit' or 'quit' are typed (a common newbie
3481 better message when 'exit' or 'quit' are typed (a common newbie
3477 confusion).
3482 confusion).
3478
3483
3479 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3484 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3480 check for Windows users.
3485 check for Windows users.
3481
3486
3482 * IPython/iplib.py (InteractiveShell.user_setup): removed
3487 * IPython/iplib.py (InteractiveShell.user_setup): removed
3483 disabling of colors for Windows. I'll test at runtime and issue a
3488 disabling of colors for Windows. I'll test at runtime and issue a
3484 warning if Gary's readline isn't found, as to nudge users to
3489 warning if Gary's readline isn't found, as to nudge users to
3485 download it.
3490 download it.
3486
3491
3487 2004-06-16 Fernando Perez <fperez@colorado.edu>
3492 2004-06-16 Fernando Perez <fperez@colorado.edu>
3488
3493
3489 * IPython/genutils.py (Stream.__init__): changed to print errors
3494 * IPython/genutils.py (Stream.__init__): changed to print errors
3490 to sys.stderr. I had a circular dependency here. Now it's
3495 to sys.stderr. I had a circular dependency here. Now it's
3491 possible to run ipython as IDLE's shell (consider this pre-alpha,
3496 possible to run ipython as IDLE's shell (consider this pre-alpha,
3492 since true stdout things end up in the starting terminal instead
3497 since true stdout things end up in the starting terminal instead
3493 of IDLE's out).
3498 of IDLE's out).
3494
3499
3495 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3500 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3496 users who haven't # updated their prompt_in2 definitions. Remove
3501 users who haven't # updated their prompt_in2 definitions. Remove
3497 eventually.
3502 eventually.
3498 (multiple_replace): added credit to original ASPN recipe.
3503 (multiple_replace): added credit to original ASPN recipe.
3499
3504
3500 2004-06-15 Fernando Perez <fperez@colorado.edu>
3505 2004-06-15 Fernando Perez <fperez@colorado.edu>
3501
3506
3502 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3507 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3503 list of auto-defined aliases.
3508 list of auto-defined aliases.
3504
3509
3505 2004-06-13 Fernando Perez <fperez@colorado.edu>
3510 2004-06-13 Fernando Perez <fperez@colorado.edu>
3506
3511
3507 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3512 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3508 install was really requested (so setup.py can be used for other
3513 install was really requested (so setup.py can be used for other
3509 things under Windows).
3514 things under Windows).
3510
3515
3511 2004-06-10 Fernando Perez <fperez@colorado.edu>
3516 2004-06-10 Fernando Perez <fperez@colorado.edu>
3512
3517
3513 * IPython/Logger.py (Logger.create_log): Manually remove any old
3518 * IPython/Logger.py (Logger.create_log): Manually remove any old
3514 backup, since os.remove may fail under Windows. Fixes bug
3519 backup, since os.remove may fail under Windows. Fixes bug
3515 reported by Thorsten.
3520 reported by Thorsten.
3516
3521
3517 2004-06-09 Fernando Perez <fperez@colorado.edu>
3522 2004-06-09 Fernando Perez <fperez@colorado.edu>
3518
3523
3519 * examples/example-embed.py: fixed all references to %n (replaced
3524 * examples/example-embed.py: fixed all references to %n (replaced
3520 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3525 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3521 for all examples and the manual as well.
3526 for all examples and the manual as well.
3522
3527
3523 2004-06-08 Fernando Perez <fperez@colorado.edu>
3528 2004-06-08 Fernando Perez <fperez@colorado.edu>
3524
3529
3525 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3530 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3526 alignment and color management. All 3 prompt subsystems now
3531 alignment and color management. All 3 prompt subsystems now
3527 inherit from BasePrompt.
3532 inherit from BasePrompt.
3528
3533
3529 * tools/release: updates for windows installer build and tag rpms
3534 * tools/release: updates for windows installer build and tag rpms
3530 with python version (since paths are fixed).
3535 with python version (since paths are fixed).
3531
3536
3532 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3537 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3533 which will become eventually obsolete. Also fixed the default
3538 which will become eventually obsolete. Also fixed the default
3534 prompt_in2 to use \D, so at least new users start with the correct
3539 prompt_in2 to use \D, so at least new users start with the correct
3535 defaults.
3540 defaults.
3536 WARNING: Users with existing ipythonrc files will need to apply
3541 WARNING: Users with existing ipythonrc files will need to apply
3537 this fix manually!
3542 this fix manually!
3538
3543
3539 * setup.py: make windows installer (.exe). This is finally the
3544 * setup.py: make windows installer (.exe). This is finally the
3540 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3545 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3541 which I hadn't included because it required Python 2.3 (or recent
3546 which I hadn't included because it required Python 2.3 (or recent
3542 distutils).
3547 distutils).
3543
3548
3544 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3549 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3545 usage of new '\D' escape.
3550 usage of new '\D' escape.
3546
3551
3547 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3552 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3548 lacks os.getuid())
3553 lacks os.getuid())
3549 (CachedOutput.set_colors): Added the ability to turn coloring
3554 (CachedOutput.set_colors): Added the ability to turn coloring
3550 on/off with @colors even for manually defined prompt colors. It
3555 on/off with @colors even for manually defined prompt colors. It
3551 uses a nasty global, but it works safely and via the generic color
3556 uses a nasty global, but it works safely and via the generic color
3552 handling mechanism.
3557 handling mechanism.
3553 (Prompt2.__init__): Introduced new escape '\D' for continuation
3558 (Prompt2.__init__): Introduced new escape '\D' for continuation
3554 prompts. It represents the counter ('\#') as dots.
3559 prompts. It represents the counter ('\#') as dots.
3555 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3560 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3556 need to update their ipythonrc files and replace '%n' with '\D' in
3561 need to update their ipythonrc files and replace '%n' with '\D' in
3557 their prompt_in2 settings everywhere. Sorry, but there's
3562 their prompt_in2 settings everywhere. Sorry, but there's
3558 otherwise no clean way to get all prompts to properly align. The
3563 otherwise no clean way to get all prompts to properly align. The
3559 ipythonrc shipped with IPython has been updated.
3564 ipythonrc shipped with IPython has been updated.
3560
3565
3561 2004-06-07 Fernando Perez <fperez@colorado.edu>
3566 2004-06-07 Fernando Perez <fperez@colorado.edu>
3562
3567
3563 * setup.py (isfile): Pass local_icons option to latex2html, so the
3568 * setup.py (isfile): Pass local_icons option to latex2html, so the
3564 resulting HTML file is self-contained. Thanks to
3569 resulting HTML file is self-contained. Thanks to
3565 dryice-AT-liu.com.cn for the tip.
3570 dryice-AT-liu.com.cn for the tip.
3566
3571
3567 * pysh.py: I created a new profile 'shell', which implements a
3572 * pysh.py: I created a new profile 'shell', which implements a
3568 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3573 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3569 system shell, nor will it become one anytime soon. It's mainly
3574 system shell, nor will it become one anytime soon. It's mainly
3570 meant to illustrate the use of the new flexible bash-like prompts.
3575 meant to illustrate the use of the new flexible bash-like prompts.
3571 I guess it could be used by hardy souls for true shell management,
3576 I guess it could be used by hardy souls for true shell management,
3572 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3577 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3573 profile. This uses the InterpreterExec extension provided by
3578 profile. This uses the InterpreterExec extension provided by
3574 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3579 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3575
3580
3576 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3581 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3577 auto-align itself with the length of the previous input prompt
3582 auto-align itself with the length of the previous input prompt
3578 (taking into account the invisible color escapes).
3583 (taking into account the invisible color escapes).
3579 (CachedOutput.__init__): Large restructuring of this class. Now
3584 (CachedOutput.__init__): Large restructuring of this class. Now
3580 all three prompts (primary1, primary2, output) are proper objects,
3585 all three prompts (primary1, primary2, output) are proper objects,
3581 managed by the 'parent' CachedOutput class. The code is still a
3586 managed by the 'parent' CachedOutput class. The code is still a
3582 bit hackish (all prompts share state via a pointer to the cache),
3587 bit hackish (all prompts share state via a pointer to the cache),
3583 but it's overall far cleaner than before.
3588 but it's overall far cleaner than before.
3584
3589
3585 * IPython/genutils.py (getoutputerror): modified to add verbose,
3590 * IPython/genutils.py (getoutputerror): modified to add verbose,
3586 debug and header options. This makes the interface of all getout*
3591 debug and header options. This makes the interface of all getout*
3587 functions uniform.
3592 functions uniform.
3588 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3593 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3589
3594
3590 * IPython/Magic.py (Magic.default_option): added a function to
3595 * IPython/Magic.py (Magic.default_option): added a function to
3591 allow registering default options for any magic command. This
3596 allow registering default options for any magic command. This
3592 makes it easy to have profiles which customize the magics globally
3597 makes it easy to have profiles which customize the magics globally
3593 for a certain use. The values set through this function are
3598 for a certain use. The values set through this function are
3594 picked up by the parse_options() method, which all magics should
3599 picked up by the parse_options() method, which all magics should
3595 use to parse their options.
3600 use to parse their options.
3596
3601
3597 * IPython/genutils.py (warn): modified the warnings framework to
3602 * IPython/genutils.py (warn): modified the warnings framework to
3598 use the Term I/O class. I'm trying to slowly unify all of
3603 use the Term I/O class. I'm trying to slowly unify all of
3599 IPython's I/O operations to pass through Term.
3604 IPython's I/O operations to pass through Term.
3600
3605
3601 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3606 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3602 the secondary prompt to correctly match the length of the primary
3607 the secondary prompt to correctly match the length of the primary
3603 one for any prompt. Now multi-line code will properly line up
3608 one for any prompt. Now multi-line code will properly line up
3604 even for path dependent prompts, such as the new ones available
3609 even for path dependent prompts, such as the new ones available
3605 via the prompt_specials.
3610 via the prompt_specials.
3606
3611
3607 2004-06-06 Fernando Perez <fperez@colorado.edu>
3612 2004-06-06 Fernando Perez <fperez@colorado.edu>
3608
3613
3609 * IPython/Prompts.py (prompt_specials): Added the ability to have
3614 * IPython/Prompts.py (prompt_specials): Added the ability to have
3610 bash-like special sequences in the prompts, which get
3615 bash-like special sequences in the prompts, which get
3611 automatically expanded. Things like hostname, current working
3616 automatically expanded. Things like hostname, current working
3612 directory and username are implemented already, but it's easy to
3617 directory and username are implemented already, but it's easy to
3613 add more in the future. Thanks to a patch by W.J. van der Laan
3618 add more in the future. Thanks to a patch by W.J. van der Laan
3614 <gnufnork-AT-hetdigitalegat.nl>
3619 <gnufnork-AT-hetdigitalegat.nl>
3615 (prompt_specials): Added color support for prompt strings, so
3620 (prompt_specials): Added color support for prompt strings, so
3616 users can define arbitrary color setups for their prompts.
3621 users can define arbitrary color setups for their prompts.
3617
3622
3618 2004-06-05 Fernando Perez <fperez@colorado.edu>
3623 2004-06-05 Fernando Perez <fperez@colorado.edu>
3619
3624
3620 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3625 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3621 code to load Gary Bishop's readline and configure it
3626 code to load Gary Bishop's readline and configure it
3622 automatically. Thanks to Gary for help on this.
3627 automatically. Thanks to Gary for help on this.
3623
3628
3624 2004-06-01 Fernando Perez <fperez@colorado.edu>
3629 2004-06-01 Fernando Perez <fperez@colorado.edu>
3625
3630
3626 * IPython/Logger.py (Logger.create_log): fix bug for logging
3631 * IPython/Logger.py (Logger.create_log): fix bug for logging
3627 with no filename (previous fix was incomplete).
3632 with no filename (previous fix was incomplete).
3628
3633
3629 2004-05-25 Fernando Perez <fperez@colorado.edu>
3634 2004-05-25 Fernando Perez <fperez@colorado.edu>
3630
3635
3631 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3636 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3632 parens would get passed to the shell.
3637 parens would get passed to the shell.
3633
3638
3634 2004-05-20 Fernando Perez <fperez@colorado.edu>
3639 2004-05-20 Fernando Perez <fperez@colorado.edu>
3635
3640
3636 * IPython/Magic.py (Magic.magic_prun): changed default profile
3641 * IPython/Magic.py (Magic.magic_prun): changed default profile
3637 sort order to 'time' (the more common profiling need).
3642 sort order to 'time' (the more common profiling need).
3638
3643
3639 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3644 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3640 so that source code shown is guaranteed in sync with the file on
3645 so that source code shown is guaranteed in sync with the file on
3641 disk (also changed in psource). Similar fix to the one for
3646 disk (also changed in psource). Similar fix to the one for
3642 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3647 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3643 <yann.ledu-AT-noos.fr>.
3648 <yann.ledu-AT-noos.fr>.
3644
3649
3645 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3650 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3646 with a single option would not be correctly parsed. Closes
3651 with a single option would not be correctly parsed. Closes
3647 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3652 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3648 introduced in 0.6.0 (on 2004-05-06).
3653 introduced in 0.6.0 (on 2004-05-06).
3649
3654
3650 2004-05-13 *** Released version 0.6.0
3655 2004-05-13 *** Released version 0.6.0
3651
3656
3652 2004-05-13 Fernando Perez <fperez@colorado.edu>
3657 2004-05-13 Fernando Perez <fperez@colorado.edu>
3653
3658
3654 * debian/: Added debian/ directory to CVS, so that debian support
3659 * debian/: Added debian/ directory to CVS, so that debian support
3655 is publicly accessible. The debian package is maintained by Jack
3660 is publicly accessible. The debian package is maintained by Jack
3656 Moffit <jack-AT-xiph.org>.
3661 Moffit <jack-AT-xiph.org>.
3657
3662
3658 * Documentation: included the notes about an ipython-based system
3663 * Documentation: included the notes about an ipython-based system
3659 shell (the hypothetical 'pysh') into the new_design.pdf document,
3664 shell (the hypothetical 'pysh') into the new_design.pdf document,
3660 so that these ideas get distributed to users along with the
3665 so that these ideas get distributed to users along with the
3661 official documentation.
3666 official documentation.
3662
3667
3663 2004-05-10 Fernando Perez <fperez@colorado.edu>
3668 2004-05-10 Fernando Perez <fperez@colorado.edu>
3664
3669
3665 * IPython/Logger.py (Logger.create_log): fix recently introduced
3670 * IPython/Logger.py (Logger.create_log): fix recently introduced
3666 bug (misindented line) where logstart would fail when not given an
3671 bug (misindented line) where logstart would fail when not given an
3667 explicit filename.
3672 explicit filename.
3668
3673
3669 2004-05-09 Fernando Perez <fperez@colorado.edu>
3674 2004-05-09 Fernando Perez <fperez@colorado.edu>
3670
3675
3671 * IPython/Magic.py (Magic.parse_options): skip system call when
3676 * IPython/Magic.py (Magic.parse_options): skip system call when
3672 there are no options to look for. Faster, cleaner for the common
3677 there are no options to look for. Faster, cleaner for the common
3673 case.
3678 case.
3674
3679
3675 * Documentation: many updates to the manual: describing Windows
3680 * Documentation: many updates to the manual: describing Windows
3676 support better, Gnuplot updates, credits, misc small stuff. Also
3681 support better, Gnuplot updates, credits, misc small stuff. Also
3677 updated the new_design doc a bit.
3682 updated the new_design doc a bit.
3678
3683
3679 2004-05-06 *** Released version 0.6.0.rc1
3684 2004-05-06 *** Released version 0.6.0.rc1
3680
3685
3681 2004-05-06 Fernando Perez <fperez@colorado.edu>
3686 2004-05-06 Fernando Perez <fperez@colorado.edu>
3682
3687
3683 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3688 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3684 operations to use the vastly more efficient list/''.join() method.
3689 operations to use the vastly more efficient list/''.join() method.
3685 (FormattedTB.text): Fix
3690 (FormattedTB.text): Fix
3686 http://www.scipy.net/roundup/ipython/issue12 - exception source
3691 http://www.scipy.net/roundup/ipython/issue12 - exception source
3687 extract not updated after reload. Thanks to Mike Salib
3692 extract not updated after reload. Thanks to Mike Salib
3688 <msalib-AT-mit.edu> for pinning the source of the problem.
3693 <msalib-AT-mit.edu> for pinning the source of the problem.
3689 Fortunately, the solution works inside ipython and doesn't require
3694 Fortunately, the solution works inside ipython and doesn't require
3690 any changes to python proper.
3695 any changes to python proper.
3691
3696
3692 * IPython/Magic.py (Magic.parse_options): Improved to process the
3697 * IPython/Magic.py (Magic.parse_options): Improved to process the
3693 argument list as a true shell would (by actually using the
3698 argument list as a true shell would (by actually using the
3694 underlying system shell). This way, all @magics automatically get
3699 underlying system shell). This way, all @magics automatically get
3695 shell expansion for variables. Thanks to a comment by Alex
3700 shell expansion for variables. Thanks to a comment by Alex
3696 Schmolck.
3701 Schmolck.
3697
3702
3698 2004-04-04 Fernando Perez <fperez@colorado.edu>
3703 2004-04-04 Fernando Perez <fperez@colorado.edu>
3699
3704
3700 * IPython/iplib.py (InteractiveShell.interact): Added a special
3705 * IPython/iplib.py (InteractiveShell.interact): Added a special
3701 trap for a debugger quit exception, which is basically impossible
3706 trap for a debugger quit exception, which is basically impossible
3702 to handle by normal mechanisms, given what pdb does to the stack.
3707 to handle by normal mechanisms, given what pdb does to the stack.
3703 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3708 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3704
3709
3705 2004-04-03 Fernando Perez <fperez@colorado.edu>
3710 2004-04-03 Fernando Perez <fperez@colorado.edu>
3706
3711
3707 * IPython/genutils.py (Term): Standardized the names of the Term
3712 * IPython/genutils.py (Term): Standardized the names of the Term
3708 class streams to cin/cout/cerr, following C++ naming conventions
3713 class streams to cin/cout/cerr, following C++ naming conventions
3709 (I can't use in/out/err because 'in' is not a valid attribute
3714 (I can't use in/out/err because 'in' is not a valid attribute
3710 name).
3715 name).
3711
3716
3712 * IPython/iplib.py (InteractiveShell.interact): don't increment
3717 * IPython/iplib.py (InteractiveShell.interact): don't increment
3713 the prompt if there's no user input. By Daniel 'Dang' Griffith
3718 the prompt if there's no user input. By Daniel 'Dang' Griffith
3714 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3719 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3715 Francois Pinard.
3720 Francois Pinard.
3716
3721
3717 2004-04-02 Fernando Perez <fperez@colorado.edu>
3722 2004-04-02 Fernando Perez <fperez@colorado.edu>
3718
3723
3719 * IPython/genutils.py (Stream.__init__): Modified to survive at
3724 * IPython/genutils.py (Stream.__init__): Modified to survive at
3720 least importing in contexts where stdin/out/err aren't true file
3725 least importing in contexts where stdin/out/err aren't true file
3721 objects, such as PyCrust (they lack fileno() and mode). However,
3726 objects, such as PyCrust (they lack fileno() and mode). However,
3722 the recovery facilities which rely on these things existing will
3727 the recovery facilities which rely on these things existing will
3723 not work.
3728 not work.
3724
3729
3725 2004-04-01 Fernando Perez <fperez@colorado.edu>
3730 2004-04-01 Fernando Perez <fperez@colorado.edu>
3726
3731
3727 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3732 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3728 use the new getoutputerror() function, so it properly
3733 use the new getoutputerror() function, so it properly
3729 distinguishes stdout/err.
3734 distinguishes stdout/err.
3730
3735
3731 * IPython/genutils.py (getoutputerror): added a function to
3736 * IPython/genutils.py (getoutputerror): added a function to
3732 capture separately the standard output and error of a command.
3737 capture separately the standard output and error of a command.
3733 After a comment from dang on the mailing lists. This code is
3738 After a comment from dang on the mailing lists. This code is
3734 basically a modified version of commands.getstatusoutput(), from
3739 basically a modified version of commands.getstatusoutput(), from
3735 the standard library.
3740 the standard library.
3736
3741
3737 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3742 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3738 '!!' as a special syntax (shorthand) to access @sx.
3743 '!!' as a special syntax (shorthand) to access @sx.
3739
3744
3740 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3745 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3741 command and return its output as a list split on '\n'.
3746 command and return its output as a list split on '\n'.
3742
3747
3743 2004-03-31 Fernando Perez <fperez@colorado.edu>
3748 2004-03-31 Fernando Perez <fperez@colorado.edu>
3744
3749
3745 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3750 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3746 method to dictionaries used as FakeModule instances if they lack
3751 method to dictionaries used as FakeModule instances if they lack
3747 it. At least pydoc in python2.3 breaks for runtime-defined
3752 it. At least pydoc in python2.3 breaks for runtime-defined
3748 functions without this hack. At some point I need to _really_
3753 functions without this hack. At some point I need to _really_
3749 understand what FakeModule is doing, because it's a gross hack.
3754 understand what FakeModule is doing, because it's a gross hack.
3750 But it solves Arnd's problem for now...
3755 But it solves Arnd's problem for now...
3751
3756
3752 2004-02-27 Fernando Perez <fperez@colorado.edu>
3757 2004-02-27 Fernando Perez <fperez@colorado.edu>
3753
3758
3754 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3759 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3755 mode would behave erratically. Also increased the number of
3760 mode would behave erratically. Also increased the number of
3756 possible logs in rotate mod to 999. Thanks to Rod Holland
3761 possible logs in rotate mod to 999. Thanks to Rod Holland
3757 <rhh@StructureLABS.com> for the report and fixes.
3762 <rhh@StructureLABS.com> for the report and fixes.
3758
3763
3759 2004-02-26 Fernando Perez <fperez@colorado.edu>
3764 2004-02-26 Fernando Perez <fperez@colorado.edu>
3760
3765
3761 * IPython/genutils.py (page): Check that the curses module really
3766 * IPython/genutils.py (page): Check that the curses module really
3762 has the initscr attribute before trying to use it. For some
3767 has the initscr attribute before trying to use it. For some
3763 reason, the Solaris curses module is missing this. I think this
3768 reason, the Solaris curses module is missing this. I think this
3764 should be considered a Solaris python bug, but I'm not sure.
3769 should be considered a Solaris python bug, but I'm not sure.
3765
3770
3766 2004-01-17 Fernando Perez <fperez@colorado.edu>
3771 2004-01-17 Fernando Perez <fperez@colorado.edu>
3767
3772
3768 * IPython/genutils.py (Stream.__init__): Changes to try to make
3773 * IPython/genutils.py (Stream.__init__): Changes to try to make
3769 ipython robust against stdin/out/err being closed by the user.
3774 ipython robust against stdin/out/err being closed by the user.
3770 This is 'user error' (and blocks a normal python session, at least
3775 This is 'user error' (and blocks a normal python session, at least
3771 the stdout case). However, Ipython should be able to survive such
3776 the stdout case). However, Ipython should be able to survive such
3772 instances of abuse as gracefully as possible. To simplify the
3777 instances of abuse as gracefully as possible. To simplify the
3773 coding and maintain compatibility with Gary Bishop's Term
3778 coding and maintain compatibility with Gary Bishop's Term
3774 contributions, I've made use of classmethods for this. I think
3779 contributions, I've made use of classmethods for this. I think
3775 this introduces a dependency on python 2.2.
3780 this introduces a dependency on python 2.2.
3776
3781
3777 2004-01-13 Fernando Perez <fperez@colorado.edu>
3782 2004-01-13 Fernando Perez <fperez@colorado.edu>
3778
3783
3779 * IPython/numutils.py (exp_safe): simplified the code a bit and
3784 * IPython/numutils.py (exp_safe): simplified the code a bit and
3780 removed the need for importing the kinds module altogether.
3785 removed the need for importing the kinds module altogether.
3781
3786
3782 2004-01-06 Fernando Perez <fperez@colorado.edu>
3787 2004-01-06 Fernando Perez <fperez@colorado.edu>
3783
3788
3784 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3789 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3785 a magic function instead, after some community feedback. No
3790 a magic function instead, after some community feedback. No
3786 special syntax will exist for it, but its name is deliberately
3791 special syntax will exist for it, but its name is deliberately
3787 very short.
3792 very short.
3788
3793
3789 2003-12-20 Fernando Perez <fperez@colorado.edu>
3794 2003-12-20 Fernando Perez <fperez@colorado.edu>
3790
3795
3791 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3796 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3792 new functionality, to automagically assign the result of a shell
3797 new functionality, to automagically assign the result of a shell
3793 command to a variable. I'll solicit some community feedback on
3798 command to a variable. I'll solicit some community feedback on
3794 this before making it permanent.
3799 this before making it permanent.
3795
3800
3796 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3801 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3797 requested about callables for which inspect couldn't obtain a
3802 requested about callables for which inspect couldn't obtain a
3798 proper argspec. Thanks to a crash report sent by Etienne
3803 proper argspec. Thanks to a crash report sent by Etienne
3799 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3804 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3800
3805
3801 2003-12-09 Fernando Perez <fperez@colorado.edu>
3806 2003-12-09 Fernando Perez <fperez@colorado.edu>
3802
3807
3803 * IPython/genutils.py (page): patch for the pager to work across
3808 * IPython/genutils.py (page): patch for the pager to work across
3804 various versions of Windows. By Gary Bishop.
3809 various versions of Windows. By Gary Bishop.
3805
3810
3806 2003-12-04 Fernando Perez <fperez@colorado.edu>
3811 2003-12-04 Fernando Perez <fperez@colorado.edu>
3807
3812
3808 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3813 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3809 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3814 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3810 While I tested this and it looks ok, there may still be corner
3815 While I tested this and it looks ok, there may still be corner
3811 cases I've missed.
3816 cases I've missed.
3812
3817
3813 2003-12-01 Fernando Perez <fperez@colorado.edu>
3818 2003-12-01 Fernando Perez <fperez@colorado.edu>
3814
3819
3815 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3820 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3816 where a line like 'p,q=1,2' would fail because the automagic
3821 where a line like 'p,q=1,2' would fail because the automagic
3817 system would be triggered for @p.
3822 system would be triggered for @p.
3818
3823
3819 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3824 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3820 cleanups, code unmodified.
3825 cleanups, code unmodified.
3821
3826
3822 * IPython/genutils.py (Term): added a class for IPython to handle
3827 * IPython/genutils.py (Term): added a class for IPython to handle
3823 output. In most cases it will just be a proxy for stdout/err, but
3828 output. In most cases it will just be a proxy for stdout/err, but
3824 having this allows modifications to be made for some platforms,
3829 having this allows modifications to be made for some platforms,
3825 such as handling color escapes under Windows. All of this code
3830 such as handling color escapes under Windows. All of this code
3826 was contributed by Gary Bishop, with minor modifications by me.
3831 was contributed by Gary Bishop, with minor modifications by me.
3827 The actual changes affect many files.
3832 The actual changes affect many files.
3828
3833
3829 2003-11-30 Fernando Perez <fperez@colorado.edu>
3834 2003-11-30 Fernando Perez <fperez@colorado.edu>
3830
3835
3831 * IPython/iplib.py (file_matches): new completion code, courtesy
3836 * IPython/iplib.py (file_matches): new completion code, courtesy
3832 of Jeff Collins. This enables filename completion again under
3837 of Jeff Collins. This enables filename completion again under
3833 python 2.3, which disabled it at the C level.
3838 python 2.3, which disabled it at the C level.
3834
3839
3835 2003-11-11 Fernando Perez <fperez@colorado.edu>
3840 2003-11-11 Fernando Perez <fperez@colorado.edu>
3836
3841
3837 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3842 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3838 for Numeric.array(map(...)), but often convenient.
3843 for Numeric.array(map(...)), but often convenient.
3839
3844
3840 2003-11-05 Fernando Perez <fperez@colorado.edu>
3845 2003-11-05 Fernando Perez <fperez@colorado.edu>
3841
3846
3842 * IPython/numutils.py (frange): Changed a call from int() to
3847 * IPython/numutils.py (frange): Changed a call from int() to
3843 int(round()) to prevent a problem reported with arange() in the
3848 int(round()) to prevent a problem reported with arange() in the
3844 numpy list.
3849 numpy list.
3845
3850
3846 2003-10-06 Fernando Perez <fperez@colorado.edu>
3851 2003-10-06 Fernando Perez <fperez@colorado.edu>
3847
3852
3848 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3853 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3849 prevent crashes if sys lacks an argv attribute (it happens with
3854 prevent crashes if sys lacks an argv attribute (it happens with
3850 embedded interpreters which build a bare-bones sys module).
3855 embedded interpreters which build a bare-bones sys module).
3851 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3856 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3852
3857
3853 2003-09-24 Fernando Perez <fperez@colorado.edu>
3858 2003-09-24 Fernando Perez <fperez@colorado.edu>
3854
3859
3855 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3860 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3856 to protect against poorly written user objects where __getattr__
3861 to protect against poorly written user objects where __getattr__
3857 raises exceptions other than AttributeError. Thanks to a bug
3862 raises exceptions other than AttributeError. Thanks to a bug
3858 report by Oliver Sander <osander-AT-gmx.de>.
3863 report by Oliver Sander <osander-AT-gmx.de>.
3859
3864
3860 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3865 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3861 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3866 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3862
3867
3863 2003-09-09 Fernando Perez <fperez@colorado.edu>
3868 2003-09-09 Fernando Perez <fperez@colorado.edu>
3864
3869
3865 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3870 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3866 unpacking a list whith a callable as first element would
3871 unpacking a list whith a callable as first element would
3867 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3872 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3868 Collins.
3873 Collins.
3869
3874
3870 2003-08-25 *** Released version 0.5.0
3875 2003-08-25 *** Released version 0.5.0
3871
3876
3872 2003-08-22 Fernando Perez <fperez@colorado.edu>
3877 2003-08-22 Fernando Perez <fperez@colorado.edu>
3873
3878
3874 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3879 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3875 improperly defined user exceptions. Thanks to feedback from Mark
3880 improperly defined user exceptions. Thanks to feedback from Mark
3876 Russell <mrussell-AT-verio.net>.
3881 Russell <mrussell-AT-verio.net>.
3877
3882
3878 2003-08-20 Fernando Perez <fperez@colorado.edu>
3883 2003-08-20 Fernando Perez <fperez@colorado.edu>
3879
3884
3880 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3885 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3881 printing so that it would print multi-line string forms starting
3886 printing so that it would print multi-line string forms starting
3882 with a new line. This way the formatting is better respected for
3887 with a new line. This way the formatting is better respected for
3883 objects which work hard to make nice string forms.
3888 objects which work hard to make nice string forms.
3884
3889
3885 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3890 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3886 autocall would overtake data access for objects with both
3891 autocall would overtake data access for objects with both
3887 __getitem__ and __call__.
3892 __getitem__ and __call__.
3888
3893
3889 2003-08-19 *** Released version 0.5.0-rc1
3894 2003-08-19 *** Released version 0.5.0-rc1
3890
3895
3891 2003-08-19 Fernando Perez <fperez@colorado.edu>
3896 2003-08-19 Fernando Perez <fperez@colorado.edu>
3892
3897
3893 * IPython/deep_reload.py (load_tail): single tiny change here
3898 * IPython/deep_reload.py (load_tail): single tiny change here
3894 seems to fix the long-standing bug of dreload() failing to work
3899 seems to fix the long-standing bug of dreload() failing to work
3895 for dotted names. But this module is pretty tricky, so I may have
3900 for dotted names. But this module is pretty tricky, so I may have
3896 missed some subtlety. Needs more testing!.
3901 missed some subtlety. Needs more testing!.
3897
3902
3898 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3903 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3899 exceptions which have badly implemented __str__ methods.
3904 exceptions which have badly implemented __str__ methods.
3900 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3905 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3901 which I've been getting reports about from Python 2.3 users. I
3906 which I've been getting reports about from Python 2.3 users. I
3902 wish I had a simple test case to reproduce the problem, so I could
3907 wish I had a simple test case to reproduce the problem, so I could
3903 either write a cleaner workaround or file a bug report if
3908 either write a cleaner workaround or file a bug report if
3904 necessary.
3909 necessary.
3905
3910
3906 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3911 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3907 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3912 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3908 a bug report by Tjabo Kloppenburg.
3913 a bug report by Tjabo Kloppenburg.
3909
3914
3910 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3915 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3911 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3916 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3912 seems rather unstable. Thanks to a bug report by Tjabo
3917 seems rather unstable. Thanks to a bug report by Tjabo
3913 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3918 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3914
3919
3915 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3920 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3916 this out soon because of the critical fixes in the inner loop for
3921 this out soon because of the critical fixes in the inner loop for
3917 generators.
3922 generators.
3918
3923
3919 * IPython/Magic.py (Magic.getargspec): removed. This (and
3924 * IPython/Magic.py (Magic.getargspec): removed. This (and
3920 _get_def) have been obsoleted by OInspect for a long time, I
3925 _get_def) have been obsoleted by OInspect for a long time, I
3921 hadn't noticed that they were dead code.
3926 hadn't noticed that they were dead code.
3922 (Magic._ofind): restored _ofind functionality for a few literals
3927 (Magic._ofind): restored _ofind functionality for a few literals
3923 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3928 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3924 for things like "hello".capitalize?, since that would require a
3929 for things like "hello".capitalize?, since that would require a
3925 potentially dangerous eval() again.
3930 potentially dangerous eval() again.
3926
3931
3927 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3932 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3928 logic a bit more to clean up the escapes handling and minimize the
3933 logic a bit more to clean up the escapes handling and minimize the
3929 use of _ofind to only necessary cases. The interactive 'feel' of
3934 use of _ofind to only necessary cases. The interactive 'feel' of
3930 IPython should have improved quite a bit with the changes in
3935 IPython should have improved quite a bit with the changes in
3931 _prefilter and _ofind (besides being far safer than before).
3936 _prefilter and _ofind (besides being far safer than before).
3932
3937
3933 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3938 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3934 obscure, never reported). Edit would fail to find the object to
3939 obscure, never reported). Edit would fail to find the object to
3935 edit under some circumstances.
3940 edit under some circumstances.
3936 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3941 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3937 which were causing double-calling of generators. Those eval calls
3942 which were causing double-calling of generators. Those eval calls
3938 were _very_ dangerous, since code with side effects could be
3943 were _very_ dangerous, since code with side effects could be
3939 triggered. As they say, 'eval is evil'... These were the
3944 triggered. As they say, 'eval is evil'... These were the
3940 nastiest evals in IPython. Besides, _ofind is now far simpler,
3945 nastiest evals in IPython. Besides, _ofind is now far simpler,
3941 and it should also be quite a bit faster. Its use of inspect is
3946 and it should also be quite a bit faster. Its use of inspect is
3942 also safer, so perhaps some of the inspect-related crashes I've
3947 also safer, so perhaps some of the inspect-related crashes I've
3943 seen lately with Python 2.3 might be taken care of. That will
3948 seen lately with Python 2.3 might be taken care of. That will
3944 need more testing.
3949 need more testing.
3945
3950
3946 2003-08-17 Fernando Perez <fperez@colorado.edu>
3951 2003-08-17 Fernando Perez <fperez@colorado.edu>
3947
3952
3948 * IPython/iplib.py (InteractiveShell._prefilter): significant
3953 * IPython/iplib.py (InteractiveShell._prefilter): significant
3949 simplifications to the logic for handling user escapes. Faster
3954 simplifications to the logic for handling user escapes. Faster
3950 and simpler code.
3955 and simpler code.
3951
3956
3952 2003-08-14 Fernando Perez <fperez@colorado.edu>
3957 2003-08-14 Fernando Perez <fperez@colorado.edu>
3953
3958
3954 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3959 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3955 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3960 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3956 but it should be quite a bit faster. And the recursive version
3961 but it should be quite a bit faster. And the recursive version
3957 generated O(log N) intermediate storage for all rank>1 arrays,
3962 generated O(log N) intermediate storage for all rank>1 arrays,
3958 even if they were contiguous.
3963 even if they were contiguous.
3959 (l1norm): Added this function.
3964 (l1norm): Added this function.
3960 (norm): Added this function for arbitrary norms (including
3965 (norm): Added this function for arbitrary norms (including
3961 l-infinity). l1 and l2 are still special cases for convenience
3966 l-infinity). l1 and l2 are still special cases for convenience
3962 and speed.
3967 and speed.
3963
3968
3964 2003-08-03 Fernando Perez <fperez@colorado.edu>
3969 2003-08-03 Fernando Perez <fperez@colorado.edu>
3965
3970
3966 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3971 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3967 exceptions, which now raise PendingDeprecationWarnings in Python
3972 exceptions, which now raise PendingDeprecationWarnings in Python
3968 2.3. There were some in Magic and some in Gnuplot2.
3973 2.3. There were some in Magic and some in Gnuplot2.
3969
3974
3970 2003-06-30 Fernando Perez <fperez@colorado.edu>
3975 2003-06-30 Fernando Perez <fperez@colorado.edu>
3971
3976
3972 * IPython/genutils.py (page): modified to call curses only for
3977 * IPython/genutils.py (page): modified to call curses only for
3973 terminals where TERM=='xterm'. After problems under many other
3978 terminals where TERM=='xterm'. After problems under many other
3974 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3979 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3975
3980
3976 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3981 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3977 would be triggered when readline was absent. This was just an old
3982 would be triggered when readline was absent. This was just an old
3978 debugging statement I'd forgotten to take out.
3983 debugging statement I'd forgotten to take out.
3979
3984
3980 2003-06-20 Fernando Perez <fperez@colorado.edu>
3985 2003-06-20 Fernando Perez <fperez@colorado.edu>
3981
3986
3982 * IPython/genutils.py (clock): modified to return only user time
3987 * IPython/genutils.py (clock): modified to return only user time
3983 (not counting system time), after a discussion on scipy. While
3988 (not counting system time), after a discussion on scipy. While
3984 system time may be a useful quantity occasionally, it may much
3989 system time may be a useful quantity occasionally, it may much
3985 more easily be skewed by occasional swapping or other similar
3990 more easily be skewed by occasional swapping or other similar
3986 activity.
3991 activity.
3987
3992
3988 2003-06-05 Fernando Perez <fperez@colorado.edu>
3993 2003-06-05 Fernando Perez <fperez@colorado.edu>
3989
3994
3990 * IPython/numutils.py (identity): new function, for building
3995 * IPython/numutils.py (identity): new function, for building
3991 arbitrary rank Kronecker deltas (mostly backwards compatible with
3996 arbitrary rank Kronecker deltas (mostly backwards compatible with
3992 Numeric.identity)
3997 Numeric.identity)
3993
3998
3994 2003-06-03 Fernando Perez <fperez@colorado.edu>
3999 2003-06-03 Fernando Perez <fperez@colorado.edu>
3995
4000
3996 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4001 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3997 arguments passed to magics with spaces, to allow trailing '\' to
4002 arguments passed to magics with spaces, to allow trailing '\' to
3998 work normally (mainly for Windows users).
4003 work normally (mainly for Windows users).
3999
4004
4000 2003-05-29 Fernando Perez <fperez@colorado.edu>
4005 2003-05-29 Fernando Perez <fperez@colorado.edu>
4001
4006
4002 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4007 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4003 instead of pydoc.help. This fixes a bizarre behavior where
4008 instead of pydoc.help. This fixes a bizarre behavior where
4004 printing '%s' % locals() would trigger the help system. Now
4009 printing '%s' % locals() would trigger the help system. Now
4005 ipython behaves like normal python does.
4010 ipython behaves like normal python does.
4006
4011
4007 Note that if one does 'from pydoc import help', the bizarre
4012 Note that if one does 'from pydoc import help', the bizarre
4008 behavior returns, but this will also happen in normal python, so
4013 behavior returns, but this will also happen in normal python, so
4009 it's not an ipython bug anymore (it has to do with how pydoc.help
4014 it's not an ipython bug anymore (it has to do with how pydoc.help
4010 is implemented).
4015 is implemented).
4011
4016
4012 2003-05-22 Fernando Perez <fperez@colorado.edu>
4017 2003-05-22 Fernando Perez <fperez@colorado.edu>
4013
4018
4014 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4019 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4015 return [] instead of None when nothing matches, also match to end
4020 return [] instead of None when nothing matches, also match to end
4016 of line. Patch by Gary Bishop.
4021 of line. Patch by Gary Bishop.
4017
4022
4018 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4023 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4019 protection as before, for files passed on the command line. This
4024 protection as before, for files passed on the command line. This
4020 prevents the CrashHandler from kicking in if user files call into
4025 prevents the CrashHandler from kicking in if user files call into
4021 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4026 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4022 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4027 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4023
4028
4024 2003-05-20 *** Released version 0.4.0
4029 2003-05-20 *** Released version 0.4.0
4025
4030
4026 2003-05-20 Fernando Perez <fperez@colorado.edu>
4031 2003-05-20 Fernando Perez <fperez@colorado.edu>
4027
4032
4028 * setup.py: added support for manpages. It's a bit hackish b/c of
4033 * setup.py: added support for manpages. It's a bit hackish b/c of
4029 a bug in the way the bdist_rpm distutils target handles gzipped
4034 a bug in the way the bdist_rpm distutils target handles gzipped
4030 manpages, but it works. After a patch by Jack.
4035 manpages, but it works. After a patch by Jack.
4031
4036
4032 2003-05-19 Fernando Perez <fperez@colorado.edu>
4037 2003-05-19 Fernando Perez <fperez@colorado.edu>
4033
4038
4034 * IPython/numutils.py: added a mockup of the kinds module, since
4039 * IPython/numutils.py: added a mockup of the kinds module, since
4035 it was recently removed from Numeric. This way, numutils will
4040 it was recently removed from Numeric. This way, numutils will
4036 work for all users even if they are missing kinds.
4041 work for all users even if they are missing kinds.
4037
4042
4038 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4043 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4039 failure, which can occur with SWIG-wrapped extensions. After a
4044 failure, which can occur with SWIG-wrapped extensions. After a
4040 crash report from Prabhu.
4045 crash report from Prabhu.
4041
4046
4042 2003-05-16 Fernando Perez <fperez@colorado.edu>
4047 2003-05-16 Fernando Perez <fperez@colorado.edu>
4043
4048
4044 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4049 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4045 protect ipython from user code which may call directly
4050 protect ipython from user code which may call directly
4046 sys.excepthook (this looks like an ipython crash to the user, even
4051 sys.excepthook (this looks like an ipython crash to the user, even
4047 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4052 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4048 This is especially important to help users of WxWindows, but may
4053 This is especially important to help users of WxWindows, but may
4049 also be useful in other cases.
4054 also be useful in other cases.
4050
4055
4051 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4056 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4052 an optional tb_offset to be specified, and to preserve exception
4057 an optional tb_offset to be specified, and to preserve exception
4053 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4058 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4054
4059
4055 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4060 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4056
4061
4057 2003-05-15 Fernando Perez <fperez@colorado.edu>
4062 2003-05-15 Fernando Perez <fperez@colorado.edu>
4058
4063
4059 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4064 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4060 installing for a new user under Windows.
4065 installing for a new user under Windows.
4061
4066
4062 2003-05-12 Fernando Perez <fperez@colorado.edu>
4067 2003-05-12 Fernando Perez <fperez@colorado.edu>
4063
4068
4064 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4069 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4065 handler for Emacs comint-based lines. Currently it doesn't do
4070 handler for Emacs comint-based lines. Currently it doesn't do
4066 much (but importantly, it doesn't update the history cache). In
4071 much (but importantly, it doesn't update the history cache). In
4067 the future it may be expanded if Alex needs more functionality
4072 the future it may be expanded if Alex needs more functionality
4068 there.
4073 there.
4069
4074
4070 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4075 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4071 info to crash reports.
4076 info to crash reports.
4072
4077
4073 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4078 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4074 just like Python's -c. Also fixed crash with invalid -color
4079 just like Python's -c. Also fixed crash with invalid -color
4075 option value at startup. Thanks to Will French
4080 option value at startup. Thanks to Will French
4076 <wfrench-AT-bestweb.net> for the bug report.
4081 <wfrench-AT-bestweb.net> for the bug report.
4077
4082
4078 2003-05-09 Fernando Perez <fperez@colorado.edu>
4083 2003-05-09 Fernando Perez <fperez@colorado.edu>
4079
4084
4080 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4085 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4081 to EvalDict (it's a mapping, after all) and simplified its code
4086 to EvalDict (it's a mapping, after all) and simplified its code
4082 quite a bit, after a nice discussion on c.l.py where Gustavo
4087 quite a bit, after a nice discussion on c.l.py where Gustavo
4083 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4088 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4084
4089
4085 2003-04-30 Fernando Perez <fperez@colorado.edu>
4090 2003-04-30 Fernando Perez <fperez@colorado.edu>
4086
4091
4087 * IPython/genutils.py (timings_out): modified it to reduce its
4092 * IPython/genutils.py (timings_out): modified it to reduce its
4088 overhead in the common reps==1 case.
4093 overhead in the common reps==1 case.
4089
4094
4090 2003-04-29 Fernando Perez <fperez@colorado.edu>
4095 2003-04-29 Fernando Perez <fperez@colorado.edu>
4091
4096
4092 * IPython/genutils.py (timings_out): Modified to use the resource
4097 * IPython/genutils.py (timings_out): Modified to use the resource
4093 module, which avoids the wraparound problems of time.clock().
4098 module, which avoids the wraparound problems of time.clock().
4094
4099
4095 2003-04-17 *** Released version 0.2.15pre4
4100 2003-04-17 *** Released version 0.2.15pre4
4096
4101
4097 2003-04-17 Fernando Perez <fperez@colorado.edu>
4102 2003-04-17 Fernando Perez <fperez@colorado.edu>
4098
4103
4099 * setup.py (scriptfiles): Split windows-specific stuff over to a
4104 * setup.py (scriptfiles): Split windows-specific stuff over to a
4100 separate file, in an attempt to have a Windows GUI installer.
4105 separate file, in an attempt to have a Windows GUI installer.
4101 That didn't work, but part of the groundwork is done.
4106 That didn't work, but part of the groundwork is done.
4102
4107
4103 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4108 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4104 indent/unindent with 4 spaces. Particularly useful in combination
4109 indent/unindent with 4 spaces. Particularly useful in combination
4105 with the new auto-indent option.
4110 with the new auto-indent option.
4106
4111
4107 2003-04-16 Fernando Perez <fperez@colorado.edu>
4112 2003-04-16 Fernando Perez <fperez@colorado.edu>
4108
4113
4109 * IPython/Magic.py: various replacements of self.rc for
4114 * IPython/Magic.py: various replacements of self.rc for
4110 self.shell.rc. A lot more remains to be done to fully disentangle
4115 self.shell.rc. A lot more remains to be done to fully disentangle
4111 this class from the main Shell class.
4116 this class from the main Shell class.
4112
4117
4113 * IPython/GnuplotRuntime.py: added checks for mouse support so
4118 * IPython/GnuplotRuntime.py: added checks for mouse support so
4114 that we don't try to enable it if the current gnuplot doesn't
4119 that we don't try to enable it if the current gnuplot doesn't
4115 really support it. Also added checks so that we don't try to
4120 really support it. Also added checks so that we don't try to
4116 enable persist under Windows (where Gnuplot doesn't recognize the
4121 enable persist under Windows (where Gnuplot doesn't recognize the
4117 option).
4122 option).
4118
4123
4119 * IPython/iplib.py (InteractiveShell.interact): Added optional
4124 * IPython/iplib.py (InteractiveShell.interact): Added optional
4120 auto-indenting code, after a patch by King C. Shu
4125 auto-indenting code, after a patch by King C. Shu
4121 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4126 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4122 get along well with pasting indented code. If I ever figure out
4127 get along well with pasting indented code. If I ever figure out
4123 how to make that part go well, it will become on by default.
4128 how to make that part go well, it will become on by default.
4124
4129
4125 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4130 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4126 crash ipython if there was an unmatched '%' in the user's prompt
4131 crash ipython if there was an unmatched '%' in the user's prompt
4127 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4132 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4128
4133
4129 * IPython/iplib.py (InteractiveShell.interact): removed the
4134 * IPython/iplib.py (InteractiveShell.interact): removed the
4130 ability to ask the user whether he wants to crash or not at the
4135 ability to ask the user whether he wants to crash or not at the
4131 'last line' exception handler. Calling functions at that point
4136 'last line' exception handler. Calling functions at that point
4132 changes the stack, and the error reports would have incorrect
4137 changes the stack, and the error reports would have incorrect
4133 tracebacks.
4138 tracebacks.
4134
4139
4135 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4140 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4136 pass through a peger a pretty-printed form of any object. After a
4141 pass through a peger a pretty-printed form of any object. After a
4137 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4142 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4138
4143
4139 2003-04-14 Fernando Perez <fperez@colorado.edu>
4144 2003-04-14 Fernando Perez <fperez@colorado.edu>
4140
4145
4141 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4146 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4142 all files in ~ would be modified at first install (instead of
4147 all files in ~ would be modified at first install (instead of
4143 ~/.ipython). This could be potentially disastrous, as the
4148 ~/.ipython). This could be potentially disastrous, as the
4144 modification (make line-endings native) could damage binary files.
4149 modification (make line-endings native) could damage binary files.
4145
4150
4146 2003-04-10 Fernando Perez <fperez@colorado.edu>
4151 2003-04-10 Fernando Perez <fperez@colorado.edu>
4147
4152
4148 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4153 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4149 handle only lines which are invalid python. This now means that
4154 handle only lines which are invalid python. This now means that
4150 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4155 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4151 for the bug report.
4156 for the bug report.
4152
4157
4153 2003-04-01 Fernando Perez <fperez@colorado.edu>
4158 2003-04-01 Fernando Perez <fperez@colorado.edu>
4154
4159
4155 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4160 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4156 where failing to set sys.last_traceback would crash pdb.pm().
4161 where failing to set sys.last_traceback would crash pdb.pm().
4157 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4162 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4158 report.
4163 report.
4159
4164
4160 2003-03-25 Fernando Perez <fperez@colorado.edu>
4165 2003-03-25 Fernando Perez <fperez@colorado.edu>
4161
4166
4162 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4167 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4163 before printing it (it had a lot of spurious blank lines at the
4168 before printing it (it had a lot of spurious blank lines at the
4164 end).
4169 end).
4165
4170
4166 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4171 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4167 output would be sent 21 times! Obviously people don't use this
4172 output would be sent 21 times! Obviously people don't use this
4168 too often, or I would have heard about it.
4173 too often, or I would have heard about it.
4169
4174
4170 2003-03-24 Fernando Perez <fperez@colorado.edu>
4175 2003-03-24 Fernando Perez <fperez@colorado.edu>
4171
4176
4172 * setup.py (scriptfiles): renamed the data_files parameter from
4177 * setup.py (scriptfiles): renamed the data_files parameter from
4173 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4178 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4174 for the patch.
4179 for the patch.
4175
4180
4176 2003-03-20 Fernando Perez <fperez@colorado.edu>
4181 2003-03-20 Fernando Perez <fperez@colorado.edu>
4177
4182
4178 * IPython/genutils.py (error): added error() and fatal()
4183 * IPython/genutils.py (error): added error() and fatal()
4179 functions.
4184 functions.
4180
4185
4181 2003-03-18 *** Released version 0.2.15pre3
4186 2003-03-18 *** Released version 0.2.15pre3
4182
4187
4183 2003-03-18 Fernando Perez <fperez@colorado.edu>
4188 2003-03-18 Fernando Perez <fperez@colorado.edu>
4184
4189
4185 * setupext/install_data_ext.py
4190 * setupext/install_data_ext.py
4186 (install_data_ext.initialize_options): Class contributed by Jack
4191 (install_data_ext.initialize_options): Class contributed by Jack
4187 Moffit for fixing the old distutils hack. He is sending this to
4192 Moffit for fixing the old distutils hack. He is sending this to
4188 the distutils folks so in the future we may not need it as a
4193 the distutils folks so in the future we may not need it as a
4189 private fix.
4194 private fix.
4190
4195
4191 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4196 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4192 changes for Debian packaging. See his patch for full details.
4197 changes for Debian packaging. See his patch for full details.
4193 The old distutils hack of making the ipythonrc* files carry a
4198 The old distutils hack of making the ipythonrc* files carry a
4194 bogus .py extension is gone, at last. Examples were moved to a
4199 bogus .py extension is gone, at last. Examples were moved to a
4195 separate subdir under doc/, and the separate executable scripts
4200 separate subdir under doc/, and the separate executable scripts
4196 now live in their own directory. Overall a great cleanup. The
4201 now live in their own directory. Overall a great cleanup. The
4197 manual was updated to use the new files, and setup.py has been
4202 manual was updated to use the new files, and setup.py has been
4198 fixed for this setup.
4203 fixed for this setup.
4199
4204
4200 * IPython/PyColorize.py (Parser.usage): made non-executable and
4205 * IPython/PyColorize.py (Parser.usage): made non-executable and
4201 created a pycolor wrapper around it to be included as a script.
4206 created a pycolor wrapper around it to be included as a script.
4202
4207
4203 2003-03-12 *** Released version 0.2.15pre2
4208 2003-03-12 *** Released version 0.2.15pre2
4204
4209
4205 2003-03-12 Fernando Perez <fperez@colorado.edu>
4210 2003-03-12 Fernando Perez <fperez@colorado.edu>
4206
4211
4207 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4212 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4208 long-standing problem with garbage characters in some terminals.
4213 long-standing problem with garbage characters in some terminals.
4209 The issue was really that the \001 and \002 escapes must _only_ be
4214 The issue was really that the \001 and \002 escapes must _only_ be
4210 passed to input prompts (which call readline), but _never_ to
4215 passed to input prompts (which call readline), but _never_ to
4211 normal text to be printed on screen. I changed ColorANSI to have
4216 normal text to be printed on screen. I changed ColorANSI to have
4212 two classes: TermColors and InputTermColors, each with the
4217 two classes: TermColors and InputTermColors, each with the
4213 appropriate escapes for input prompts or normal text. The code in
4218 appropriate escapes for input prompts or normal text. The code in
4214 Prompts.py got slightly more complicated, but this very old and
4219 Prompts.py got slightly more complicated, but this very old and
4215 annoying bug is finally fixed.
4220 annoying bug is finally fixed.
4216
4221
4217 All the credit for nailing down the real origin of this problem
4222 All the credit for nailing down the real origin of this problem
4218 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4223 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4219 *Many* thanks to him for spending quite a bit of effort on this.
4224 *Many* thanks to him for spending quite a bit of effort on this.
4220
4225
4221 2003-03-05 *** Released version 0.2.15pre1
4226 2003-03-05 *** Released version 0.2.15pre1
4222
4227
4223 2003-03-03 Fernando Perez <fperez@colorado.edu>
4228 2003-03-03 Fernando Perez <fperez@colorado.edu>
4224
4229
4225 * IPython/FakeModule.py: Moved the former _FakeModule to a
4230 * IPython/FakeModule.py: Moved the former _FakeModule to a
4226 separate file, because it's also needed by Magic (to fix a similar
4231 separate file, because it's also needed by Magic (to fix a similar
4227 pickle-related issue in @run).
4232 pickle-related issue in @run).
4228
4233
4229 2003-03-02 Fernando Perez <fperez@colorado.edu>
4234 2003-03-02 Fernando Perez <fperez@colorado.edu>
4230
4235
4231 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4236 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4232 the autocall option at runtime.
4237 the autocall option at runtime.
4233 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4238 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4234 across Magic.py to start separating Magic from InteractiveShell.
4239 across Magic.py to start separating Magic from InteractiveShell.
4235 (Magic._ofind): Fixed to return proper namespace for dotted
4240 (Magic._ofind): Fixed to return proper namespace for dotted
4236 names. Before, a dotted name would always return 'not currently
4241 names. Before, a dotted name would always return 'not currently
4237 defined', because it would find the 'parent'. s.x would be found,
4242 defined', because it would find the 'parent'. s.x would be found,
4238 but since 'x' isn't defined by itself, it would get confused.
4243 but since 'x' isn't defined by itself, it would get confused.
4239 (Magic.magic_run): Fixed pickling problems reported by Ralf
4244 (Magic.magic_run): Fixed pickling problems reported by Ralf
4240 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4245 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4241 that I'd used when Mike Heeter reported similar issues at the
4246 that I'd used when Mike Heeter reported similar issues at the
4242 top-level, but now for @run. It boils down to injecting the
4247 top-level, but now for @run. It boils down to injecting the
4243 namespace where code is being executed with something that looks
4248 namespace where code is being executed with something that looks
4244 enough like a module to fool pickle.dump(). Since a pickle stores
4249 enough like a module to fool pickle.dump(). Since a pickle stores
4245 a named reference to the importing module, we need this for
4250 a named reference to the importing module, we need this for
4246 pickles to save something sensible.
4251 pickles to save something sensible.
4247
4252
4248 * IPython/ipmaker.py (make_IPython): added an autocall option.
4253 * IPython/ipmaker.py (make_IPython): added an autocall option.
4249
4254
4250 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4255 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4251 the auto-eval code. Now autocalling is an option, and the code is
4256 the auto-eval code. Now autocalling is an option, and the code is
4252 also vastly safer. There is no more eval() involved at all.
4257 also vastly safer. There is no more eval() involved at all.
4253
4258
4254 2003-03-01 Fernando Perez <fperez@colorado.edu>
4259 2003-03-01 Fernando Perez <fperez@colorado.edu>
4255
4260
4256 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4261 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4257 dict with named keys instead of a tuple.
4262 dict with named keys instead of a tuple.
4258
4263
4259 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4264 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4260
4265
4261 * setup.py (make_shortcut): Fixed message about directories
4266 * setup.py (make_shortcut): Fixed message about directories
4262 created during Windows installation (the directories were ok, just
4267 created during Windows installation (the directories were ok, just
4263 the printed message was misleading). Thanks to Chris Liechti
4268 the printed message was misleading). Thanks to Chris Liechti
4264 <cliechti-AT-gmx.net> for the heads up.
4269 <cliechti-AT-gmx.net> for the heads up.
4265
4270
4266 2003-02-21 Fernando Perez <fperez@colorado.edu>
4271 2003-02-21 Fernando Perez <fperez@colorado.edu>
4267
4272
4268 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4273 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4269 of ValueError exception when checking for auto-execution. This
4274 of ValueError exception when checking for auto-execution. This
4270 one is raised by things like Numeric arrays arr.flat when the
4275 one is raised by things like Numeric arrays arr.flat when the
4271 array is non-contiguous.
4276 array is non-contiguous.
4272
4277
4273 2003-01-31 Fernando Perez <fperez@colorado.edu>
4278 2003-01-31 Fernando Perez <fperez@colorado.edu>
4274
4279
4275 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4280 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4276 not return any value at all (even though the command would get
4281 not return any value at all (even though the command would get
4277 executed).
4282 executed).
4278 (xsys): Flush stdout right after printing the command to ensure
4283 (xsys): Flush stdout right after printing the command to ensure
4279 proper ordering of commands and command output in the total
4284 proper ordering of commands and command output in the total
4280 output.
4285 output.
4281 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4286 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4282 system/getoutput as defaults. The old ones are kept for
4287 system/getoutput as defaults. The old ones are kept for
4283 compatibility reasons, so no code which uses this library needs
4288 compatibility reasons, so no code which uses this library needs
4284 changing.
4289 changing.
4285
4290
4286 2003-01-27 *** Released version 0.2.14
4291 2003-01-27 *** Released version 0.2.14
4287
4292
4288 2003-01-25 Fernando Perez <fperez@colorado.edu>
4293 2003-01-25 Fernando Perez <fperez@colorado.edu>
4289
4294
4290 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4295 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4291 functions defined in previous edit sessions could not be re-edited
4296 functions defined in previous edit sessions could not be re-edited
4292 (because the temp files were immediately removed). Now temp files
4297 (because the temp files were immediately removed). Now temp files
4293 are removed only at IPython's exit.
4298 are removed only at IPython's exit.
4294 (Magic.magic_run): Improved @run to perform shell-like expansions
4299 (Magic.magic_run): Improved @run to perform shell-like expansions
4295 on its arguments (~users and $VARS). With this, @run becomes more
4300 on its arguments (~users and $VARS). With this, @run becomes more
4296 like a normal command-line.
4301 like a normal command-line.
4297
4302
4298 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4303 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4299 bugs related to embedding and cleaned up that code. A fairly
4304 bugs related to embedding and cleaned up that code. A fairly
4300 important one was the impossibility to access the global namespace
4305 important one was the impossibility to access the global namespace
4301 through the embedded IPython (only local variables were visible).
4306 through the embedded IPython (only local variables were visible).
4302
4307
4303 2003-01-14 Fernando Perez <fperez@colorado.edu>
4308 2003-01-14 Fernando Perez <fperez@colorado.edu>
4304
4309
4305 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4310 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4306 auto-calling to be a bit more conservative. Now it doesn't get
4311 auto-calling to be a bit more conservative. Now it doesn't get
4307 triggered if any of '!=()<>' are in the rest of the input line, to
4312 triggered if any of '!=()<>' are in the rest of the input line, to
4308 allow comparing callables. Thanks to Alex for the heads up.
4313 allow comparing callables. Thanks to Alex for the heads up.
4309
4314
4310 2003-01-07 Fernando Perez <fperez@colorado.edu>
4315 2003-01-07 Fernando Perez <fperez@colorado.edu>
4311
4316
4312 * IPython/genutils.py (page): fixed estimation of the number of
4317 * IPython/genutils.py (page): fixed estimation of the number of
4313 lines in a string to be paged to simply count newlines. This
4318 lines in a string to be paged to simply count newlines. This
4314 prevents over-guessing due to embedded escape sequences. A better
4319 prevents over-guessing due to embedded escape sequences. A better
4315 long-term solution would involve stripping out the control chars
4320 long-term solution would involve stripping out the control chars
4316 for the count, but it's potentially so expensive I just don't
4321 for the count, but it's potentially so expensive I just don't
4317 think it's worth doing.
4322 think it's worth doing.
4318
4323
4319 2002-12-19 *** Released version 0.2.14pre50
4324 2002-12-19 *** Released version 0.2.14pre50
4320
4325
4321 2002-12-19 Fernando Perez <fperez@colorado.edu>
4326 2002-12-19 Fernando Perez <fperez@colorado.edu>
4322
4327
4323 * tools/release (version): Changed release scripts to inform
4328 * tools/release (version): Changed release scripts to inform
4324 Andrea and build a NEWS file with a list of recent changes.
4329 Andrea and build a NEWS file with a list of recent changes.
4325
4330
4326 * IPython/ColorANSI.py (__all__): changed terminal detection
4331 * IPython/ColorANSI.py (__all__): changed terminal detection
4327 code. Seems to work better for xterms without breaking
4332 code. Seems to work better for xterms without breaking
4328 konsole. Will need more testing to determine if WinXP and Mac OSX
4333 konsole. Will need more testing to determine if WinXP and Mac OSX
4329 also work ok.
4334 also work ok.
4330
4335
4331 2002-12-18 *** Released version 0.2.14pre49
4336 2002-12-18 *** Released version 0.2.14pre49
4332
4337
4333 2002-12-18 Fernando Perez <fperez@colorado.edu>
4338 2002-12-18 Fernando Perez <fperez@colorado.edu>
4334
4339
4335 * Docs: added new info about Mac OSX, from Andrea.
4340 * Docs: added new info about Mac OSX, from Andrea.
4336
4341
4337 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4342 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4338 allow direct plotting of python strings whose format is the same
4343 allow direct plotting of python strings whose format is the same
4339 of gnuplot data files.
4344 of gnuplot data files.
4340
4345
4341 2002-12-16 Fernando Perez <fperez@colorado.edu>
4346 2002-12-16 Fernando Perez <fperez@colorado.edu>
4342
4347
4343 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4348 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4344 value of exit question to be acknowledged.
4349 value of exit question to be acknowledged.
4345
4350
4346 2002-12-03 Fernando Perez <fperez@colorado.edu>
4351 2002-12-03 Fernando Perez <fperez@colorado.edu>
4347
4352
4348 * IPython/ipmaker.py: removed generators, which had been added
4353 * IPython/ipmaker.py: removed generators, which had been added
4349 by mistake in an earlier debugging run. This was causing trouble
4354 by mistake in an earlier debugging run. This was causing trouble
4350 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4355 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4351 for pointing this out.
4356 for pointing this out.
4352
4357
4353 2002-11-17 Fernando Perez <fperez@colorado.edu>
4358 2002-11-17 Fernando Perez <fperez@colorado.edu>
4354
4359
4355 * Manual: updated the Gnuplot section.
4360 * Manual: updated the Gnuplot section.
4356
4361
4357 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4362 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4358 a much better split of what goes in Runtime and what goes in
4363 a much better split of what goes in Runtime and what goes in
4359 Interactive.
4364 Interactive.
4360
4365
4361 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4366 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4362 being imported from iplib.
4367 being imported from iplib.
4363
4368
4364 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4369 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4365 for command-passing. Now the global Gnuplot instance is called
4370 for command-passing. Now the global Gnuplot instance is called
4366 'gp' instead of 'g', which was really a far too fragile and
4371 'gp' instead of 'g', which was really a far too fragile and
4367 common name.
4372 common name.
4368
4373
4369 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4374 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4370 bounding boxes generated by Gnuplot for square plots.
4375 bounding boxes generated by Gnuplot for square plots.
4371
4376
4372 * IPython/genutils.py (popkey): new function added. I should
4377 * IPython/genutils.py (popkey): new function added. I should
4373 suggest this on c.l.py as a dict method, it seems useful.
4378 suggest this on c.l.py as a dict method, it seems useful.
4374
4379
4375 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4380 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4376 to transparently handle PostScript generation. MUCH better than
4381 to transparently handle PostScript generation. MUCH better than
4377 the previous plot_eps/replot_eps (which I removed now). The code
4382 the previous plot_eps/replot_eps (which I removed now). The code
4378 is also fairly clean and well documented now (including
4383 is also fairly clean and well documented now (including
4379 docstrings).
4384 docstrings).
4380
4385
4381 2002-11-13 Fernando Perez <fperez@colorado.edu>
4386 2002-11-13 Fernando Perez <fperez@colorado.edu>
4382
4387
4383 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4388 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4384 (inconsistent with options).
4389 (inconsistent with options).
4385
4390
4386 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4391 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4387 manually disabled, I don't know why. Fixed it.
4392 manually disabled, I don't know why. Fixed it.
4388 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4393 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4389 eps output.
4394 eps output.
4390
4395
4391 2002-11-12 Fernando Perez <fperez@colorado.edu>
4396 2002-11-12 Fernando Perez <fperez@colorado.edu>
4392
4397
4393 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4398 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4394 don't propagate up to caller. Fixes crash reported by François
4399 don't propagate up to caller. Fixes crash reported by François
4395 Pinard.
4400 Pinard.
4396
4401
4397 2002-11-09 Fernando Perez <fperez@colorado.edu>
4402 2002-11-09 Fernando Perez <fperez@colorado.edu>
4398
4403
4399 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4404 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4400 history file for new users.
4405 history file for new users.
4401 (make_IPython): fixed bug where initial install would leave the
4406 (make_IPython): fixed bug where initial install would leave the
4402 user running in the .ipython dir.
4407 user running in the .ipython dir.
4403 (make_IPython): fixed bug where config dir .ipython would be
4408 (make_IPython): fixed bug where config dir .ipython would be
4404 created regardless of the given -ipythondir option. Thanks to Cory
4409 created regardless of the given -ipythondir option. Thanks to Cory
4405 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4410 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4406
4411
4407 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4412 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4408 type confirmations. Will need to use it in all of IPython's code
4413 type confirmations. Will need to use it in all of IPython's code
4409 consistently.
4414 consistently.
4410
4415
4411 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4416 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4412 context to print 31 lines instead of the default 5. This will make
4417 context to print 31 lines instead of the default 5. This will make
4413 the crash reports extremely detailed in case the problem is in
4418 the crash reports extremely detailed in case the problem is in
4414 libraries I don't have access to.
4419 libraries I don't have access to.
4415
4420
4416 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4421 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4417 line of defense' code to still crash, but giving users fair
4422 line of defense' code to still crash, but giving users fair
4418 warning. I don't want internal errors to go unreported: if there's
4423 warning. I don't want internal errors to go unreported: if there's
4419 an internal problem, IPython should crash and generate a full
4424 an internal problem, IPython should crash and generate a full
4420 report.
4425 report.
4421
4426
4422 2002-11-08 Fernando Perez <fperez@colorado.edu>
4427 2002-11-08 Fernando Perez <fperez@colorado.edu>
4423
4428
4424 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4429 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4425 otherwise uncaught exceptions which can appear if people set
4430 otherwise uncaught exceptions which can appear if people set
4426 sys.stdout to something badly broken. Thanks to a crash report
4431 sys.stdout to something badly broken. Thanks to a crash report
4427 from henni-AT-mail.brainbot.com.
4432 from henni-AT-mail.brainbot.com.
4428
4433
4429 2002-11-04 Fernando Perez <fperez@colorado.edu>
4434 2002-11-04 Fernando Perez <fperez@colorado.edu>
4430
4435
4431 * IPython/iplib.py (InteractiveShell.interact): added
4436 * IPython/iplib.py (InteractiveShell.interact): added
4432 __IPYTHON__active to the builtins. It's a flag which goes on when
4437 __IPYTHON__active to the builtins. It's a flag which goes on when
4433 the interaction starts and goes off again when it stops. This
4438 the interaction starts and goes off again when it stops. This
4434 allows embedding code to detect being inside IPython. Before this
4439 allows embedding code to detect being inside IPython. Before this
4435 was done via __IPYTHON__, but that only shows that an IPython
4440 was done via __IPYTHON__, but that only shows that an IPython
4436 instance has been created.
4441 instance has been created.
4437
4442
4438 * IPython/Magic.py (Magic.magic_env): I realized that in a
4443 * IPython/Magic.py (Magic.magic_env): I realized that in a
4439 UserDict, instance.data holds the data as a normal dict. So I
4444 UserDict, instance.data holds the data as a normal dict. So I
4440 modified @env to return os.environ.data instead of rebuilding a
4445 modified @env to return os.environ.data instead of rebuilding a
4441 dict by hand.
4446 dict by hand.
4442
4447
4443 2002-11-02 Fernando Perez <fperez@colorado.edu>
4448 2002-11-02 Fernando Perez <fperez@colorado.edu>
4444
4449
4445 * IPython/genutils.py (warn): changed so that level 1 prints no
4450 * IPython/genutils.py (warn): changed so that level 1 prints no
4446 header. Level 2 is now the default (with 'WARNING' header, as
4451 header. Level 2 is now the default (with 'WARNING' header, as
4447 before). I think I tracked all places where changes were needed in
4452 before). I think I tracked all places where changes were needed in
4448 IPython, but outside code using the old level numbering may have
4453 IPython, but outside code using the old level numbering may have
4449 broken.
4454 broken.
4450
4455
4451 * IPython/iplib.py (InteractiveShell.runcode): added this to
4456 * IPython/iplib.py (InteractiveShell.runcode): added this to
4452 handle the tracebacks in SystemExit traps correctly. The previous
4457 handle the tracebacks in SystemExit traps correctly. The previous
4453 code (through interact) was printing more of the stack than
4458 code (through interact) was printing more of the stack than
4454 necessary, showing IPython internal code to the user.
4459 necessary, showing IPython internal code to the user.
4455
4460
4456 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4461 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4457 default. Now that the default at the confirmation prompt is yes,
4462 default. Now that the default at the confirmation prompt is yes,
4458 it's not so intrusive. François' argument that ipython sessions
4463 it's not so intrusive. François' argument that ipython sessions
4459 tend to be complex enough not to lose them from an accidental C-d,
4464 tend to be complex enough not to lose them from an accidental C-d,
4460 is a valid one.
4465 is a valid one.
4461
4466
4462 * IPython/iplib.py (InteractiveShell.interact): added a
4467 * IPython/iplib.py (InteractiveShell.interact): added a
4463 showtraceback() call to the SystemExit trap, and modified the exit
4468 showtraceback() call to the SystemExit trap, and modified the exit
4464 confirmation to have yes as the default.
4469 confirmation to have yes as the default.
4465
4470
4466 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4471 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4467 this file. It's been gone from the code for a long time, this was
4472 this file. It's been gone from the code for a long time, this was
4468 simply leftover junk.
4473 simply leftover junk.
4469
4474
4470 2002-11-01 Fernando Perez <fperez@colorado.edu>
4475 2002-11-01 Fernando Perez <fperez@colorado.edu>
4471
4476
4472 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4477 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4473 added. If set, IPython now traps EOF and asks for
4478 added. If set, IPython now traps EOF and asks for
4474 confirmation. After a request by François Pinard.
4479 confirmation. After a request by François Pinard.
4475
4480
4476 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4481 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4477 of @abort, and with a new (better) mechanism for handling the
4482 of @abort, and with a new (better) mechanism for handling the
4478 exceptions.
4483 exceptions.
4479
4484
4480 2002-10-27 Fernando Perez <fperez@colorado.edu>
4485 2002-10-27 Fernando Perez <fperez@colorado.edu>
4481
4486
4482 * IPython/usage.py (__doc__): updated the --help information and
4487 * IPython/usage.py (__doc__): updated the --help information and
4483 the ipythonrc file to indicate that -log generates
4488 the ipythonrc file to indicate that -log generates
4484 ./ipython.log. Also fixed the corresponding info in @logstart.
4489 ./ipython.log. Also fixed the corresponding info in @logstart.
4485 This and several other fixes in the manuals thanks to reports by
4490 This and several other fixes in the manuals thanks to reports by
4486 François Pinard <pinard-AT-iro.umontreal.ca>.
4491 François Pinard <pinard-AT-iro.umontreal.ca>.
4487
4492
4488 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4493 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4489 refer to @logstart (instead of @log, which doesn't exist).
4494 refer to @logstart (instead of @log, which doesn't exist).
4490
4495
4491 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4496 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4492 AttributeError crash. Thanks to Christopher Armstrong
4497 AttributeError crash. Thanks to Christopher Armstrong
4493 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4498 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4494 introduced recently (in 0.2.14pre37) with the fix to the eval
4499 introduced recently (in 0.2.14pre37) with the fix to the eval
4495 problem mentioned below.
4500 problem mentioned below.
4496
4501
4497 2002-10-17 Fernando Perez <fperez@colorado.edu>
4502 2002-10-17 Fernando Perez <fperez@colorado.edu>
4498
4503
4499 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4504 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4500 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4505 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4501
4506
4502 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4507 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4503 this function to fix a problem reported by Alex Schmolck. He saw
4508 this function to fix a problem reported by Alex Schmolck. He saw
4504 it with list comprehensions and generators, which were getting
4509 it with list comprehensions and generators, which were getting
4505 called twice. The real problem was an 'eval' call in testing for
4510 called twice. The real problem was an 'eval' call in testing for
4506 automagic which was evaluating the input line silently.
4511 automagic which was evaluating the input line silently.
4507
4512
4508 This is a potentially very nasty bug, if the input has side
4513 This is a potentially very nasty bug, if the input has side
4509 effects which must not be repeated. The code is much cleaner now,
4514 effects which must not be repeated. The code is much cleaner now,
4510 without any blanket 'except' left and with a regexp test for
4515 without any blanket 'except' left and with a regexp test for
4511 actual function names.
4516 actual function names.
4512
4517
4513 But an eval remains, which I'm not fully comfortable with. I just
4518 But an eval remains, which I'm not fully comfortable with. I just
4514 don't know how to find out if an expression could be a callable in
4519 don't know how to find out if an expression could be a callable in
4515 the user's namespace without doing an eval on the string. However
4520 the user's namespace without doing an eval on the string. However
4516 that string is now much more strictly checked so that no code
4521 that string is now much more strictly checked so that no code
4517 slips by, so the eval should only happen for things that can
4522 slips by, so the eval should only happen for things that can
4518 really be only function/method names.
4523 really be only function/method names.
4519
4524
4520 2002-10-15 Fernando Perez <fperez@colorado.edu>
4525 2002-10-15 Fernando Perez <fperez@colorado.edu>
4521
4526
4522 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4527 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4523 OSX information to main manual, removed README_Mac_OSX file from
4528 OSX information to main manual, removed README_Mac_OSX file from
4524 distribution. Also updated credits for recent additions.
4529 distribution. Also updated credits for recent additions.
4525
4530
4526 2002-10-10 Fernando Perez <fperez@colorado.edu>
4531 2002-10-10 Fernando Perez <fperez@colorado.edu>
4527
4532
4528 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4533 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4529 terminal-related issues. Many thanks to Andrea Riciputi
4534 terminal-related issues. Many thanks to Andrea Riciputi
4530 <andrea.riciputi-AT-libero.it> for writing it.
4535 <andrea.riciputi-AT-libero.it> for writing it.
4531
4536
4532 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4537 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4533 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4538 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4534
4539
4535 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4540 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4536 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4541 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4537 <syver-en-AT-online.no> who both submitted patches for this problem.
4542 <syver-en-AT-online.no> who both submitted patches for this problem.
4538
4543
4539 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4544 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4540 global embedding to make sure that things don't overwrite user
4545 global embedding to make sure that things don't overwrite user
4541 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4546 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4542
4547
4543 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4548 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4544 compatibility. Thanks to Hayden Callow
4549 compatibility. Thanks to Hayden Callow
4545 <h.callow-AT-elec.canterbury.ac.nz>
4550 <h.callow-AT-elec.canterbury.ac.nz>
4546
4551
4547 2002-10-04 Fernando Perez <fperez@colorado.edu>
4552 2002-10-04 Fernando Perez <fperez@colorado.edu>
4548
4553
4549 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4554 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4550 Gnuplot.File objects.
4555 Gnuplot.File objects.
4551
4556
4552 2002-07-23 Fernando Perez <fperez@colorado.edu>
4557 2002-07-23 Fernando Perez <fperez@colorado.edu>
4553
4558
4554 * IPython/genutils.py (timing): Added timings() and timing() for
4559 * IPython/genutils.py (timing): Added timings() and timing() for
4555 quick access to the most commonly needed data, the execution
4560 quick access to the most commonly needed data, the execution
4556 times. Old timing() renamed to timings_out().
4561 times. Old timing() renamed to timings_out().
4557
4562
4558 2002-07-18 Fernando Perez <fperez@colorado.edu>
4563 2002-07-18 Fernando Perez <fperez@colorado.edu>
4559
4564
4560 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4565 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4561 bug with nested instances disrupting the parent's tab completion.
4566 bug with nested instances disrupting the parent's tab completion.
4562
4567
4563 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4568 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4564 all_completions code to begin the emacs integration.
4569 all_completions code to begin the emacs integration.
4565
4570
4566 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4571 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4567 argument to allow titling individual arrays when plotting.
4572 argument to allow titling individual arrays when plotting.
4568
4573
4569 2002-07-15 Fernando Perez <fperez@colorado.edu>
4574 2002-07-15 Fernando Perez <fperez@colorado.edu>
4570
4575
4571 * setup.py (make_shortcut): changed to retrieve the value of
4576 * setup.py (make_shortcut): changed to retrieve the value of
4572 'Program Files' directory from the registry (this value changes in
4577 'Program Files' directory from the registry (this value changes in
4573 non-english versions of Windows). Thanks to Thomas Fanslau
4578 non-english versions of Windows). Thanks to Thomas Fanslau
4574 <tfanslau-AT-gmx.de> for the report.
4579 <tfanslau-AT-gmx.de> for the report.
4575
4580
4576 2002-07-10 Fernando Perez <fperez@colorado.edu>
4581 2002-07-10 Fernando Perez <fperez@colorado.edu>
4577
4582
4578 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4583 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4579 a bug in pdb, which crashes if a line with only whitespace is
4584 a bug in pdb, which crashes if a line with only whitespace is
4580 entered. Bug report submitted to sourceforge.
4585 entered. Bug report submitted to sourceforge.
4581
4586
4582 2002-07-09 Fernando Perez <fperez@colorado.edu>
4587 2002-07-09 Fernando Perez <fperez@colorado.edu>
4583
4588
4584 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4589 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4585 reporting exceptions (it's a bug in inspect.py, I just set a
4590 reporting exceptions (it's a bug in inspect.py, I just set a
4586 workaround).
4591 workaround).
4587
4592
4588 2002-07-08 Fernando Perez <fperez@colorado.edu>
4593 2002-07-08 Fernando Perez <fperez@colorado.edu>
4589
4594
4590 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4595 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4591 __IPYTHON__ in __builtins__ to show up in user_ns.
4596 __IPYTHON__ in __builtins__ to show up in user_ns.
4592
4597
4593 2002-07-03 Fernando Perez <fperez@colorado.edu>
4598 2002-07-03 Fernando Perez <fperez@colorado.edu>
4594
4599
4595 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4600 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4596 name from @gp_set_instance to @gp_set_default.
4601 name from @gp_set_instance to @gp_set_default.
4597
4602
4598 * IPython/ipmaker.py (make_IPython): default editor value set to
4603 * IPython/ipmaker.py (make_IPython): default editor value set to
4599 '0' (a string), to match the rc file. Otherwise will crash when
4604 '0' (a string), to match the rc file. Otherwise will crash when
4600 .strip() is called on it.
4605 .strip() is called on it.
4601
4606
4602
4607
4603 2002-06-28 Fernando Perez <fperez@colorado.edu>
4608 2002-06-28 Fernando Perez <fperez@colorado.edu>
4604
4609
4605 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4610 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4606 of files in current directory when a file is executed via
4611 of files in current directory when a file is executed via
4607 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4612 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4608
4613
4609 * setup.py (manfiles): fix for rpm builds, submitted by RA
4614 * setup.py (manfiles): fix for rpm builds, submitted by RA
4610 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4615 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4611
4616
4612 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4617 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4613 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4618 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4614 string!). A. Schmolck caught this one.
4619 string!). A. Schmolck caught this one.
4615
4620
4616 2002-06-27 Fernando Perez <fperez@colorado.edu>
4621 2002-06-27 Fernando Perez <fperez@colorado.edu>
4617
4622
4618 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4623 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4619 defined files at the cmd line. __name__ wasn't being set to
4624 defined files at the cmd line. __name__ wasn't being set to
4620 __main__.
4625 __main__.
4621
4626
4622 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4627 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4623 regular lists and tuples besides Numeric arrays.
4628 regular lists and tuples besides Numeric arrays.
4624
4629
4625 * IPython/Prompts.py (CachedOutput.__call__): Added output
4630 * IPython/Prompts.py (CachedOutput.__call__): Added output
4626 supression for input ending with ';'. Similar to Mathematica and
4631 supression for input ending with ';'. Similar to Mathematica and
4627 Matlab. The _* vars and Out[] list are still updated, just like
4632 Matlab. The _* vars and Out[] list are still updated, just like
4628 Mathematica behaves.
4633 Mathematica behaves.
4629
4634
4630 2002-06-25 Fernando Perez <fperez@colorado.edu>
4635 2002-06-25 Fernando Perez <fperez@colorado.edu>
4631
4636
4632 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4637 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4633 .ini extensions for profiels under Windows.
4638 .ini extensions for profiels under Windows.
4634
4639
4635 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4640 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4636 string form. Fix contributed by Alexander Schmolck
4641 string form. Fix contributed by Alexander Schmolck
4637 <a.schmolck-AT-gmx.net>
4642 <a.schmolck-AT-gmx.net>
4638
4643
4639 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4644 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4640 pre-configured Gnuplot instance.
4645 pre-configured Gnuplot instance.
4641
4646
4642 2002-06-21 Fernando Perez <fperez@colorado.edu>
4647 2002-06-21 Fernando Perez <fperez@colorado.edu>
4643
4648
4644 * IPython/numutils.py (exp_safe): new function, works around the
4649 * IPython/numutils.py (exp_safe): new function, works around the
4645 underflow problems in Numeric.
4650 underflow problems in Numeric.
4646 (log2): New fn. Safe log in base 2: returns exact integer answer
4651 (log2): New fn. Safe log in base 2: returns exact integer answer
4647 for exact integer powers of 2.
4652 for exact integer powers of 2.
4648
4653
4649 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4654 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4650 properly.
4655 properly.
4651
4656
4652 2002-06-20 Fernando Perez <fperez@colorado.edu>
4657 2002-06-20 Fernando Perez <fperez@colorado.edu>
4653
4658
4654 * IPython/genutils.py (timing): new function like
4659 * IPython/genutils.py (timing): new function like
4655 Mathematica's. Similar to time_test, but returns more info.
4660 Mathematica's. Similar to time_test, but returns more info.
4656
4661
4657 2002-06-18 Fernando Perez <fperez@colorado.edu>
4662 2002-06-18 Fernando Perez <fperez@colorado.edu>
4658
4663
4659 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4664 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4660 according to Mike Heeter's suggestions.
4665 according to Mike Heeter's suggestions.
4661
4666
4662 2002-06-16 Fernando Perez <fperez@colorado.edu>
4667 2002-06-16 Fernando Perez <fperez@colorado.edu>
4663
4668
4664 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4669 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4665 system. GnuplotMagic is gone as a user-directory option. New files
4670 system. GnuplotMagic is gone as a user-directory option. New files
4666 make it easier to use all the gnuplot stuff both from external
4671 make it easier to use all the gnuplot stuff both from external
4667 programs as well as from IPython. Had to rewrite part of
4672 programs as well as from IPython. Had to rewrite part of
4668 hardcopy() b/c of a strange bug: often the ps files simply don't
4673 hardcopy() b/c of a strange bug: often the ps files simply don't
4669 get created, and require a repeat of the command (often several
4674 get created, and require a repeat of the command (often several
4670 times).
4675 times).
4671
4676
4672 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4677 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4673 resolve output channel at call time, so that if sys.stderr has
4678 resolve output channel at call time, so that if sys.stderr has
4674 been redirected by user this gets honored.
4679 been redirected by user this gets honored.
4675
4680
4676 2002-06-13 Fernando Perez <fperez@colorado.edu>
4681 2002-06-13 Fernando Perez <fperez@colorado.edu>
4677
4682
4678 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4683 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4679 IPShell. Kept a copy with the old names to avoid breaking people's
4684 IPShell. Kept a copy with the old names to avoid breaking people's
4680 embedded code.
4685 embedded code.
4681
4686
4682 * IPython/ipython: simplified it to the bare minimum after
4687 * IPython/ipython: simplified it to the bare minimum after
4683 Holger's suggestions. Added info about how to use it in
4688 Holger's suggestions. Added info about how to use it in
4684 PYTHONSTARTUP.
4689 PYTHONSTARTUP.
4685
4690
4686 * IPython/Shell.py (IPythonShell): changed the options passing
4691 * IPython/Shell.py (IPythonShell): changed the options passing
4687 from a string with funky %s replacements to a straight list. Maybe
4692 from a string with funky %s replacements to a straight list. Maybe
4688 a bit more typing, but it follows sys.argv conventions, so there's
4693 a bit more typing, but it follows sys.argv conventions, so there's
4689 less special-casing to remember.
4694 less special-casing to remember.
4690
4695
4691 2002-06-12 Fernando Perez <fperez@colorado.edu>
4696 2002-06-12 Fernando Perez <fperez@colorado.edu>
4692
4697
4693 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4698 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4694 command. Thanks to a suggestion by Mike Heeter.
4699 command. Thanks to a suggestion by Mike Heeter.
4695 (Magic.magic_pfile): added behavior to look at filenames if given
4700 (Magic.magic_pfile): added behavior to look at filenames if given
4696 arg is not a defined object.
4701 arg is not a defined object.
4697 (Magic.magic_save): New @save function to save code snippets. Also
4702 (Magic.magic_save): New @save function to save code snippets. Also
4698 a Mike Heeter idea.
4703 a Mike Heeter idea.
4699
4704
4700 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4705 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4701 plot() and replot(). Much more convenient now, especially for
4706 plot() and replot(). Much more convenient now, especially for
4702 interactive use.
4707 interactive use.
4703
4708
4704 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4709 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4705 filenames.
4710 filenames.
4706
4711
4707 2002-06-02 Fernando Perez <fperez@colorado.edu>
4712 2002-06-02 Fernando Perez <fperez@colorado.edu>
4708
4713
4709 * IPython/Struct.py (Struct.__init__): modified to admit
4714 * IPython/Struct.py (Struct.__init__): modified to admit
4710 initialization via another struct.
4715 initialization via another struct.
4711
4716
4712 * IPython/genutils.py (SystemExec.__init__): New stateful
4717 * IPython/genutils.py (SystemExec.__init__): New stateful
4713 interface to xsys and bq. Useful for writing system scripts.
4718 interface to xsys and bq. Useful for writing system scripts.
4714
4719
4715 2002-05-30 Fernando Perez <fperez@colorado.edu>
4720 2002-05-30 Fernando Perez <fperez@colorado.edu>
4716
4721
4717 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4722 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4718 documents. This will make the user download smaller (it's getting
4723 documents. This will make the user download smaller (it's getting
4719 too big).
4724 too big).
4720
4725
4721 2002-05-29 Fernando Perez <fperez@colorado.edu>
4726 2002-05-29 Fernando Perez <fperez@colorado.edu>
4722
4727
4723 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4728 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4724 fix problems with shelve and pickle. Seems to work, but I don't
4729 fix problems with shelve and pickle. Seems to work, but I don't
4725 know if corner cases break it. Thanks to Mike Heeter
4730 know if corner cases break it. Thanks to Mike Heeter
4726 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4731 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4727
4732
4728 2002-05-24 Fernando Perez <fperez@colorado.edu>
4733 2002-05-24 Fernando Perez <fperez@colorado.edu>
4729
4734
4730 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4735 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4731 macros having broken.
4736 macros having broken.
4732
4737
4733 2002-05-21 Fernando Perez <fperez@colorado.edu>
4738 2002-05-21 Fernando Perez <fperez@colorado.edu>
4734
4739
4735 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4740 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4736 introduced logging bug: all history before logging started was
4741 introduced logging bug: all history before logging started was
4737 being written one character per line! This came from the redesign
4742 being written one character per line! This came from the redesign
4738 of the input history as a special list which slices to strings,
4743 of the input history as a special list which slices to strings,
4739 not to lists.
4744 not to lists.
4740
4745
4741 2002-05-20 Fernando Perez <fperez@colorado.edu>
4746 2002-05-20 Fernando Perez <fperez@colorado.edu>
4742
4747
4743 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4748 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4744 be an attribute of all classes in this module. The design of these
4749 be an attribute of all classes in this module. The design of these
4745 classes needs some serious overhauling.
4750 classes needs some serious overhauling.
4746
4751
4747 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4752 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4748 which was ignoring '_' in option names.
4753 which was ignoring '_' in option names.
4749
4754
4750 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4755 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4751 'Verbose_novars' to 'Context' and made it the new default. It's a
4756 'Verbose_novars' to 'Context' and made it the new default. It's a
4752 bit more readable and also safer than verbose.
4757 bit more readable and also safer than verbose.
4753
4758
4754 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4759 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4755 triple-quoted strings.
4760 triple-quoted strings.
4756
4761
4757 * IPython/OInspect.py (__all__): new module exposing the object
4762 * IPython/OInspect.py (__all__): new module exposing the object
4758 introspection facilities. Now the corresponding magics are dummy
4763 introspection facilities. Now the corresponding magics are dummy
4759 wrappers around this. Having this module will make it much easier
4764 wrappers around this. Having this module will make it much easier
4760 to put these functions into our modified pdb.
4765 to put these functions into our modified pdb.
4761 This new object inspector system uses the new colorizing module,
4766 This new object inspector system uses the new colorizing module,
4762 so source code and other things are nicely syntax highlighted.
4767 so source code and other things are nicely syntax highlighted.
4763
4768
4764 2002-05-18 Fernando Perez <fperez@colorado.edu>
4769 2002-05-18 Fernando Perez <fperez@colorado.edu>
4765
4770
4766 * IPython/ColorANSI.py: Split the coloring tools into a separate
4771 * IPython/ColorANSI.py: Split the coloring tools into a separate
4767 module so I can use them in other code easier (they were part of
4772 module so I can use them in other code easier (they were part of
4768 ultraTB).
4773 ultraTB).
4769
4774
4770 2002-05-17 Fernando Perez <fperez@colorado.edu>
4775 2002-05-17 Fernando Perez <fperez@colorado.edu>
4771
4776
4772 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4777 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4773 fixed it to set the global 'g' also to the called instance, as
4778 fixed it to set the global 'g' also to the called instance, as
4774 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4779 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4775 user's 'g' variables).
4780 user's 'g' variables).
4776
4781
4777 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4782 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4778 global variables (aliases to _ih,_oh) so that users which expect
4783 global variables (aliases to _ih,_oh) so that users which expect
4779 In[5] or Out[7] to work aren't unpleasantly surprised.
4784 In[5] or Out[7] to work aren't unpleasantly surprised.
4780 (InputList.__getslice__): new class to allow executing slices of
4785 (InputList.__getslice__): new class to allow executing slices of
4781 input history directly. Very simple class, complements the use of
4786 input history directly. Very simple class, complements the use of
4782 macros.
4787 macros.
4783
4788
4784 2002-05-16 Fernando Perez <fperez@colorado.edu>
4789 2002-05-16 Fernando Perez <fperez@colorado.edu>
4785
4790
4786 * setup.py (docdirbase): make doc directory be just doc/IPython
4791 * setup.py (docdirbase): make doc directory be just doc/IPython
4787 without version numbers, it will reduce clutter for users.
4792 without version numbers, it will reduce clutter for users.
4788
4793
4789 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4794 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4790 execfile call to prevent possible memory leak. See for details:
4795 execfile call to prevent possible memory leak. See for details:
4791 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4796 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4792
4797
4793 2002-05-15 Fernando Perez <fperez@colorado.edu>
4798 2002-05-15 Fernando Perez <fperez@colorado.edu>
4794
4799
4795 * IPython/Magic.py (Magic.magic_psource): made the object
4800 * IPython/Magic.py (Magic.magic_psource): made the object
4796 introspection names be more standard: pdoc, pdef, pfile and
4801 introspection names be more standard: pdoc, pdef, pfile and
4797 psource. They all print/page their output, and it makes
4802 psource. They all print/page their output, and it makes
4798 remembering them easier. Kept old names for compatibility as
4803 remembering them easier. Kept old names for compatibility as
4799 aliases.
4804 aliases.
4800
4805
4801 2002-05-14 Fernando Perez <fperez@colorado.edu>
4806 2002-05-14 Fernando Perez <fperez@colorado.edu>
4802
4807
4803 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4808 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4804 what the mouse problem was. The trick is to use gnuplot with temp
4809 what the mouse problem was. The trick is to use gnuplot with temp
4805 files and NOT with pipes (for data communication), because having
4810 files and NOT with pipes (for data communication), because having
4806 both pipes and the mouse on is bad news.
4811 both pipes and the mouse on is bad news.
4807
4812
4808 2002-05-13 Fernando Perez <fperez@colorado.edu>
4813 2002-05-13 Fernando Perez <fperez@colorado.edu>
4809
4814
4810 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4815 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4811 bug. Information would be reported about builtins even when
4816 bug. Information would be reported about builtins even when
4812 user-defined functions overrode them.
4817 user-defined functions overrode them.
4813
4818
4814 2002-05-11 Fernando Perez <fperez@colorado.edu>
4819 2002-05-11 Fernando Perez <fperez@colorado.edu>
4815
4820
4816 * IPython/__init__.py (__all__): removed FlexCompleter from
4821 * IPython/__init__.py (__all__): removed FlexCompleter from
4817 __all__ so that things don't fail in platforms without readline.
4822 __all__ so that things don't fail in platforms without readline.
4818
4823
4819 2002-05-10 Fernando Perez <fperez@colorado.edu>
4824 2002-05-10 Fernando Perez <fperez@colorado.edu>
4820
4825
4821 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4826 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4822 it requires Numeric, effectively making Numeric a dependency for
4827 it requires Numeric, effectively making Numeric a dependency for
4823 IPython.
4828 IPython.
4824
4829
4825 * Released 0.2.13
4830 * Released 0.2.13
4826
4831
4827 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4832 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4828 profiler interface. Now all the major options from the profiler
4833 profiler interface. Now all the major options from the profiler
4829 module are directly supported in IPython, both for single
4834 module are directly supported in IPython, both for single
4830 expressions (@prun) and for full programs (@run -p).
4835 expressions (@prun) and for full programs (@run -p).
4831
4836
4832 2002-05-09 Fernando Perez <fperez@colorado.edu>
4837 2002-05-09 Fernando Perez <fperez@colorado.edu>
4833
4838
4834 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4839 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4835 magic properly formatted for screen.
4840 magic properly formatted for screen.
4836
4841
4837 * setup.py (make_shortcut): Changed things to put pdf version in
4842 * setup.py (make_shortcut): Changed things to put pdf version in
4838 doc/ instead of doc/manual (had to change lyxport a bit).
4843 doc/ instead of doc/manual (had to change lyxport a bit).
4839
4844
4840 * IPython/Magic.py (Profile.string_stats): made profile runs go
4845 * IPython/Magic.py (Profile.string_stats): made profile runs go
4841 through pager (they are long and a pager allows searching, saving,
4846 through pager (they are long and a pager allows searching, saving,
4842 etc.)
4847 etc.)
4843
4848
4844 2002-05-08 Fernando Perez <fperez@colorado.edu>
4849 2002-05-08 Fernando Perez <fperez@colorado.edu>
4845
4850
4846 * Released 0.2.12
4851 * Released 0.2.12
4847
4852
4848 2002-05-06 Fernando Perez <fperez@colorado.edu>
4853 2002-05-06 Fernando Perez <fperez@colorado.edu>
4849
4854
4850 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4855 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4851 introduced); 'hist n1 n2' was broken.
4856 introduced); 'hist n1 n2' was broken.
4852 (Magic.magic_pdb): added optional on/off arguments to @pdb
4857 (Magic.magic_pdb): added optional on/off arguments to @pdb
4853 (Magic.magic_run): added option -i to @run, which executes code in
4858 (Magic.magic_run): added option -i to @run, which executes code in
4854 the IPython namespace instead of a clean one. Also added @irun as
4859 the IPython namespace instead of a clean one. Also added @irun as
4855 an alias to @run -i.
4860 an alias to @run -i.
4856
4861
4857 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4862 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4858 fixed (it didn't really do anything, the namespaces were wrong).
4863 fixed (it didn't really do anything, the namespaces were wrong).
4859
4864
4860 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4865 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4861
4866
4862 * IPython/__init__.py (__all__): Fixed package namespace, now
4867 * IPython/__init__.py (__all__): Fixed package namespace, now
4863 'import IPython' does give access to IPython.<all> as
4868 'import IPython' does give access to IPython.<all> as
4864 expected. Also renamed __release__ to Release.
4869 expected. Also renamed __release__ to Release.
4865
4870
4866 * IPython/Debugger.py (__license__): created new Pdb class which
4871 * IPython/Debugger.py (__license__): created new Pdb class which
4867 functions like a drop-in for the normal pdb.Pdb but does NOT
4872 functions like a drop-in for the normal pdb.Pdb but does NOT
4868 import readline by default. This way it doesn't muck up IPython's
4873 import readline by default. This way it doesn't muck up IPython's
4869 readline handling, and now tab-completion finally works in the
4874 readline handling, and now tab-completion finally works in the
4870 debugger -- sort of. It completes things globally visible, but the
4875 debugger -- sort of. It completes things globally visible, but the
4871 completer doesn't track the stack as pdb walks it. That's a bit
4876 completer doesn't track the stack as pdb walks it. That's a bit
4872 tricky, and I'll have to implement it later.
4877 tricky, and I'll have to implement it later.
4873
4878
4874 2002-05-05 Fernando Perez <fperez@colorado.edu>
4879 2002-05-05 Fernando Perez <fperez@colorado.edu>
4875
4880
4876 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4881 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4877 magic docstrings when printed via ? (explicit \'s were being
4882 magic docstrings when printed via ? (explicit \'s were being
4878 printed).
4883 printed).
4879
4884
4880 * IPython/ipmaker.py (make_IPython): fixed namespace
4885 * IPython/ipmaker.py (make_IPython): fixed namespace
4881 identification bug. Now variables loaded via logs or command-line
4886 identification bug. Now variables loaded via logs or command-line
4882 files are recognized in the interactive namespace by @who.
4887 files are recognized in the interactive namespace by @who.
4883
4888
4884 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4889 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4885 log replay system stemming from the string form of Structs.
4890 log replay system stemming from the string form of Structs.
4886
4891
4887 * IPython/Magic.py (Macro.__init__): improved macros to properly
4892 * IPython/Magic.py (Macro.__init__): improved macros to properly
4888 handle magic commands in them.
4893 handle magic commands in them.
4889 (Magic.magic_logstart): usernames are now expanded so 'logstart
4894 (Magic.magic_logstart): usernames are now expanded so 'logstart
4890 ~/mylog' now works.
4895 ~/mylog' now works.
4891
4896
4892 * IPython/iplib.py (complete): fixed bug where paths starting with
4897 * IPython/iplib.py (complete): fixed bug where paths starting with
4893 '/' would be completed as magic names.
4898 '/' would be completed as magic names.
4894
4899
4895 2002-05-04 Fernando Perez <fperez@colorado.edu>
4900 2002-05-04 Fernando Perez <fperez@colorado.edu>
4896
4901
4897 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4902 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4898 allow running full programs under the profiler's control.
4903 allow running full programs under the profiler's control.
4899
4904
4900 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4905 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4901 mode to report exceptions verbosely but without formatting
4906 mode to report exceptions verbosely but without formatting
4902 variables. This addresses the issue of ipython 'freezing' (it's
4907 variables. This addresses the issue of ipython 'freezing' (it's
4903 not frozen, but caught in an expensive formatting loop) when huge
4908 not frozen, but caught in an expensive formatting loop) when huge
4904 variables are in the context of an exception.
4909 variables are in the context of an exception.
4905 (VerboseTB.text): Added '--->' markers at line where exception was
4910 (VerboseTB.text): Added '--->' markers at line where exception was
4906 triggered. Much clearer to read, especially in NoColor modes.
4911 triggered. Much clearer to read, especially in NoColor modes.
4907
4912
4908 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4913 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4909 implemented in reverse when changing to the new parse_options().
4914 implemented in reverse when changing to the new parse_options().
4910
4915
4911 2002-05-03 Fernando Perez <fperez@colorado.edu>
4916 2002-05-03 Fernando Perez <fperez@colorado.edu>
4912
4917
4913 * IPython/Magic.py (Magic.parse_options): new function so that
4918 * IPython/Magic.py (Magic.parse_options): new function so that
4914 magics can parse options easier.
4919 magics can parse options easier.
4915 (Magic.magic_prun): new function similar to profile.run(),
4920 (Magic.magic_prun): new function similar to profile.run(),
4916 suggested by Chris Hart.
4921 suggested by Chris Hart.
4917 (Magic.magic_cd): fixed behavior so that it only changes if
4922 (Magic.magic_cd): fixed behavior so that it only changes if
4918 directory actually is in history.
4923 directory actually is in history.
4919
4924
4920 * IPython/usage.py (__doc__): added information about potential
4925 * IPython/usage.py (__doc__): added information about potential
4921 slowness of Verbose exception mode when there are huge data
4926 slowness of Verbose exception mode when there are huge data
4922 structures to be formatted (thanks to Archie Paulson).
4927 structures to be formatted (thanks to Archie Paulson).
4923
4928
4924 * IPython/ipmaker.py (make_IPython): Changed default logging
4929 * IPython/ipmaker.py (make_IPython): Changed default logging
4925 (when simply called with -log) to use curr_dir/ipython.log in
4930 (when simply called with -log) to use curr_dir/ipython.log in
4926 rotate mode. Fixed crash which was occuring with -log before
4931 rotate mode. Fixed crash which was occuring with -log before
4927 (thanks to Jim Boyle).
4932 (thanks to Jim Boyle).
4928
4933
4929 2002-05-01 Fernando Perez <fperez@colorado.edu>
4934 2002-05-01 Fernando Perez <fperez@colorado.edu>
4930
4935
4931 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4936 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4932 was nasty -- though somewhat of a corner case).
4937 was nasty -- though somewhat of a corner case).
4933
4938
4934 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4939 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4935 text (was a bug).
4940 text (was a bug).
4936
4941
4937 2002-04-30 Fernando Perez <fperez@colorado.edu>
4942 2002-04-30 Fernando Perez <fperez@colorado.edu>
4938
4943
4939 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4944 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4940 a print after ^D or ^C from the user so that the In[] prompt
4945 a print after ^D or ^C from the user so that the In[] prompt
4941 doesn't over-run the gnuplot one.
4946 doesn't over-run the gnuplot one.
4942
4947
4943 2002-04-29 Fernando Perez <fperez@colorado.edu>
4948 2002-04-29 Fernando Perez <fperez@colorado.edu>
4944
4949
4945 * Released 0.2.10
4950 * Released 0.2.10
4946
4951
4947 * IPython/__release__.py (version): get date dynamically.
4952 * IPython/__release__.py (version): get date dynamically.
4948
4953
4949 * Misc. documentation updates thanks to Arnd's comments. Also ran
4954 * Misc. documentation updates thanks to Arnd's comments. Also ran
4950 a full spellcheck on the manual (hadn't been done in a while).
4955 a full spellcheck on the manual (hadn't been done in a while).
4951
4956
4952 2002-04-27 Fernando Perez <fperez@colorado.edu>
4957 2002-04-27 Fernando Perez <fperez@colorado.edu>
4953
4958
4954 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4959 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4955 starting a log in mid-session would reset the input history list.
4960 starting a log in mid-session would reset the input history list.
4956
4961
4957 2002-04-26 Fernando Perez <fperez@colorado.edu>
4962 2002-04-26 Fernando Perez <fperez@colorado.edu>
4958
4963
4959 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4964 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4960 all files were being included in an update. Now anything in
4965 all files were being included in an update. Now anything in
4961 UserConfig that matches [A-Za-z]*.py will go (this excludes
4966 UserConfig that matches [A-Za-z]*.py will go (this excludes
4962 __init__.py)
4967 __init__.py)
4963
4968
4964 2002-04-25 Fernando Perez <fperez@colorado.edu>
4969 2002-04-25 Fernando Perez <fperez@colorado.edu>
4965
4970
4966 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4971 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4967 to __builtins__ so that any form of embedded or imported code can
4972 to __builtins__ so that any form of embedded or imported code can
4968 test for being inside IPython.
4973 test for being inside IPython.
4969
4974
4970 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4975 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4971 changed to GnuplotMagic because it's now an importable module,
4976 changed to GnuplotMagic because it's now an importable module,
4972 this makes the name follow that of the standard Gnuplot module.
4977 this makes the name follow that of the standard Gnuplot module.
4973 GnuplotMagic can now be loaded at any time in mid-session.
4978 GnuplotMagic can now be loaded at any time in mid-session.
4974
4979
4975 2002-04-24 Fernando Perez <fperez@colorado.edu>
4980 2002-04-24 Fernando Perez <fperez@colorado.edu>
4976
4981
4977 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4982 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4978 the globals (IPython has its own namespace) and the
4983 the globals (IPython has its own namespace) and the
4979 PhysicalQuantity stuff is much better anyway.
4984 PhysicalQuantity stuff is much better anyway.
4980
4985
4981 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4986 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4982 embedding example to standard user directory for
4987 embedding example to standard user directory for
4983 distribution. Also put it in the manual.
4988 distribution. Also put it in the manual.
4984
4989
4985 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4990 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4986 instance as first argument (so it doesn't rely on some obscure
4991 instance as first argument (so it doesn't rely on some obscure
4987 hidden global).
4992 hidden global).
4988
4993
4989 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4994 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4990 delimiters. While it prevents ().TAB from working, it allows
4995 delimiters. While it prevents ().TAB from working, it allows
4991 completions in open (... expressions. This is by far a more common
4996 completions in open (... expressions. This is by far a more common
4992 case.
4997 case.
4993
4998
4994 2002-04-23 Fernando Perez <fperez@colorado.edu>
4999 2002-04-23 Fernando Perez <fperez@colorado.edu>
4995
5000
4996 * IPython/Extensions/InterpreterPasteInput.py: new
5001 * IPython/Extensions/InterpreterPasteInput.py: new
4997 syntax-processing module for pasting lines with >>> or ... at the
5002 syntax-processing module for pasting lines with >>> or ... at the
4998 start.
5003 start.
4999
5004
5000 * IPython/Extensions/PhysicalQ_Interactive.py
5005 * IPython/Extensions/PhysicalQ_Interactive.py
5001 (PhysicalQuantityInteractive.__int__): fixed to work with either
5006 (PhysicalQuantityInteractive.__int__): fixed to work with either
5002 Numeric or math.
5007 Numeric or math.
5003
5008
5004 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5009 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5005 provided profiles. Now we have:
5010 provided profiles. Now we have:
5006 -math -> math module as * and cmath with its own namespace.
5011 -math -> math module as * and cmath with its own namespace.
5007 -numeric -> Numeric as *, plus gnuplot & grace
5012 -numeric -> Numeric as *, plus gnuplot & grace
5008 -physics -> same as before
5013 -physics -> same as before
5009
5014
5010 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5015 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5011 user-defined magics wouldn't be found by @magic if they were
5016 user-defined magics wouldn't be found by @magic if they were
5012 defined as class methods. Also cleaned up the namespace search
5017 defined as class methods. Also cleaned up the namespace search
5013 logic and the string building (to use %s instead of many repeated
5018 logic and the string building (to use %s instead of many repeated
5014 string adds).
5019 string adds).
5015
5020
5016 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5021 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5017 of user-defined magics to operate with class methods (cleaner, in
5022 of user-defined magics to operate with class methods (cleaner, in
5018 line with the gnuplot code).
5023 line with the gnuplot code).
5019
5024
5020 2002-04-22 Fernando Perez <fperez@colorado.edu>
5025 2002-04-22 Fernando Perez <fperez@colorado.edu>
5021
5026
5022 * setup.py: updated dependency list so that manual is updated when
5027 * setup.py: updated dependency list so that manual is updated when
5023 all included files change.
5028 all included files change.
5024
5029
5025 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5030 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5026 the delimiter removal option (the fix is ugly right now).
5031 the delimiter removal option (the fix is ugly right now).
5027
5032
5028 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5033 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5029 all of the math profile (quicker loading, no conflict between
5034 all of the math profile (quicker loading, no conflict between
5030 g-9.8 and g-gnuplot).
5035 g-9.8 and g-gnuplot).
5031
5036
5032 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5037 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5033 name of post-mortem files to IPython_crash_report.txt.
5038 name of post-mortem files to IPython_crash_report.txt.
5034
5039
5035 * Cleanup/update of the docs. Added all the new readline info and
5040 * Cleanup/update of the docs. Added all the new readline info and
5036 formatted all lists as 'real lists'.
5041 formatted all lists as 'real lists'.
5037
5042
5038 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5043 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5039 tab-completion options, since the full readline parse_and_bind is
5044 tab-completion options, since the full readline parse_and_bind is
5040 now accessible.
5045 now accessible.
5041
5046
5042 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5047 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5043 handling of readline options. Now users can specify any string to
5048 handling of readline options. Now users can specify any string to
5044 be passed to parse_and_bind(), as well as the delimiters to be
5049 be passed to parse_and_bind(), as well as the delimiters to be
5045 removed.
5050 removed.
5046 (InteractiveShell.__init__): Added __name__ to the global
5051 (InteractiveShell.__init__): Added __name__ to the global
5047 namespace so that things like Itpl which rely on its existence
5052 namespace so that things like Itpl which rely on its existence
5048 don't crash.
5053 don't crash.
5049 (InteractiveShell._prefilter): Defined the default with a _ so
5054 (InteractiveShell._prefilter): Defined the default with a _ so
5050 that prefilter() is easier to override, while the default one
5055 that prefilter() is easier to override, while the default one
5051 remains available.
5056 remains available.
5052
5057
5053 2002-04-18 Fernando Perez <fperez@colorado.edu>
5058 2002-04-18 Fernando Perez <fperez@colorado.edu>
5054
5059
5055 * Added information about pdb in the docs.
5060 * Added information about pdb in the docs.
5056
5061
5057 2002-04-17 Fernando Perez <fperez@colorado.edu>
5062 2002-04-17 Fernando Perez <fperez@colorado.edu>
5058
5063
5059 * IPython/ipmaker.py (make_IPython): added rc_override option to
5064 * IPython/ipmaker.py (make_IPython): added rc_override option to
5060 allow passing config options at creation time which may override
5065 allow passing config options at creation time which may override
5061 anything set in the config files or command line. This is
5066 anything set in the config files or command line. This is
5062 particularly useful for configuring embedded instances.
5067 particularly useful for configuring embedded instances.
5063
5068
5064 2002-04-15 Fernando Perez <fperez@colorado.edu>
5069 2002-04-15 Fernando Perez <fperez@colorado.edu>
5065
5070
5066 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5071 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5067 crash embedded instances because of the input cache falling out of
5072 crash embedded instances because of the input cache falling out of
5068 sync with the output counter.
5073 sync with the output counter.
5069
5074
5070 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5075 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5071 mode which calls pdb after an uncaught exception in IPython itself.
5076 mode which calls pdb after an uncaught exception in IPython itself.
5072
5077
5073 2002-04-14 Fernando Perez <fperez@colorado.edu>
5078 2002-04-14 Fernando Perez <fperez@colorado.edu>
5074
5079
5075 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5080 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5076 readline, fix it back after each call.
5081 readline, fix it back after each call.
5077
5082
5078 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5083 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5079 method to force all access via __call__(), which guarantees that
5084 method to force all access via __call__(), which guarantees that
5080 traceback references are properly deleted.
5085 traceback references are properly deleted.
5081
5086
5082 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5087 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5083 improve printing when pprint is in use.
5088 improve printing when pprint is in use.
5084
5089
5085 2002-04-13 Fernando Perez <fperez@colorado.edu>
5090 2002-04-13 Fernando Perez <fperez@colorado.edu>
5086
5091
5087 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5092 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5088 exceptions aren't caught anymore. If the user triggers one, he
5093 exceptions aren't caught anymore. If the user triggers one, he
5089 should know why he's doing it and it should go all the way up,
5094 should know why he's doing it and it should go all the way up,
5090 just like any other exception. So now @abort will fully kill the
5095 just like any other exception. So now @abort will fully kill the
5091 embedded interpreter and the embedding code (unless that happens
5096 embedded interpreter and the embedding code (unless that happens
5092 to catch SystemExit).
5097 to catch SystemExit).
5093
5098
5094 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5099 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5095 and a debugger() method to invoke the interactive pdb debugger
5100 and a debugger() method to invoke the interactive pdb debugger
5096 after printing exception information. Also added the corresponding
5101 after printing exception information. Also added the corresponding
5097 -pdb option and @pdb magic to control this feature, and updated
5102 -pdb option and @pdb magic to control this feature, and updated
5098 the docs. After a suggestion from Christopher Hart
5103 the docs. After a suggestion from Christopher Hart
5099 (hart-AT-caltech.edu).
5104 (hart-AT-caltech.edu).
5100
5105
5101 2002-04-12 Fernando Perez <fperez@colorado.edu>
5106 2002-04-12 Fernando Perez <fperez@colorado.edu>
5102
5107
5103 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5108 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5104 the exception handlers defined by the user (not the CrashHandler)
5109 the exception handlers defined by the user (not the CrashHandler)
5105 so that user exceptions don't trigger an ipython bug report.
5110 so that user exceptions don't trigger an ipython bug report.
5106
5111
5107 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5112 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5108 configurable (it should have always been so).
5113 configurable (it should have always been so).
5109
5114
5110 2002-03-26 Fernando Perez <fperez@colorado.edu>
5115 2002-03-26 Fernando Perez <fperez@colorado.edu>
5111
5116
5112 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5117 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5113 and there to fix embedding namespace issues. This should all be
5118 and there to fix embedding namespace issues. This should all be
5114 done in a more elegant way.
5119 done in a more elegant way.
5115
5120
5116 2002-03-25 Fernando Perez <fperez@colorado.edu>
5121 2002-03-25 Fernando Perez <fperez@colorado.edu>
5117
5122
5118 * IPython/genutils.py (get_home_dir): Try to make it work under
5123 * IPython/genutils.py (get_home_dir): Try to make it work under
5119 win9x also.
5124 win9x also.
5120
5125
5121 2002-03-20 Fernando Perez <fperez@colorado.edu>
5126 2002-03-20 Fernando Perez <fperez@colorado.edu>
5122
5127
5123 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5128 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5124 sys.displayhook untouched upon __init__.
5129 sys.displayhook untouched upon __init__.
5125
5130
5126 2002-03-19 Fernando Perez <fperez@colorado.edu>
5131 2002-03-19 Fernando Perez <fperez@colorado.edu>
5127
5132
5128 * Released 0.2.9 (for embedding bug, basically).
5133 * Released 0.2.9 (for embedding bug, basically).
5129
5134
5130 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5135 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5131 exceptions so that enclosing shell's state can be restored.
5136 exceptions so that enclosing shell's state can be restored.
5132
5137
5133 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5138 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5134 naming conventions in the .ipython/ dir.
5139 naming conventions in the .ipython/ dir.
5135
5140
5136 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5141 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5137 from delimiters list so filenames with - in them get expanded.
5142 from delimiters list so filenames with - in them get expanded.
5138
5143
5139 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5144 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5140 sys.displayhook not being properly restored after an embedded call.
5145 sys.displayhook not being properly restored after an embedded call.
5141
5146
5142 2002-03-18 Fernando Perez <fperez@colorado.edu>
5147 2002-03-18 Fernando Perez <fperez@colorado.edu>
5143
5148
5144 * Released 0.2.8
5149 * Released 0.2.8
5145
5150
5146 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5151 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5147 some files weren't being included in a -upgrade.
5152 some files weren't being included in a -upgrade.
5148 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5153 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5149 on' so that the first tab completes.
5154 on' so that the first tab completes.
5150 (InteractiveShell.handle_magic): fixed bug with spaces around
5155 (InteractiveShell.handle_magic): fixed bug with spaces around
5151 quotes breaking many magic commands.
5156 quotes breaking many magic commands.
5152
5157
5153 * setup.py: added note about ignoring the syntax error messages at
5158 * setup.py: added note about ignoring the syntax error messages at
5154 installation.
5159 installation.
5155
5160
5156 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5161 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5157 streamlining the gnuplot interface, now there's only one magic @gp.
5162 streamlining the gnuplot interface, now there's only one magic @gp.
5158
5163
5159 2002-03-17 Fernando Perez <fperez@colorado.edu>
5164 2002-03-17 Fernando Perez <fperez@colorado.edu>
5160
5165
5161 * IPython/UserConfig/magic_gnuplot.py: new name for the
5166 * IPython/UserConfig/magic_gnuplot.py: new name for the
5162 example-magic_pm.py file. Much enhanced system, now with a shell
5167 example-magic_pm.py file. Much enhanced system, now with a shell
5163 for communicating directly with gnuplot, one command at a time.
5168 for communicating directly with gnuplot, one command at a time.
5164
5169
5165 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5170 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5166 setting __name__=='__main__'.
5171 setting __name__=='__main__'.
5167
5172
5168 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5173 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5169 mini-shell for accessing gnuplot from inside ipython. Should
5174 mini-shell for accessing gnuplot from inside ipython. Should
5170 extend it later for grace access too. Inspired by Arnd's
5175 extend it later for grace access too. Inspired by Arnd's
5171 suggestion.
5176 suggestion.
5172
5177
5173 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5178 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5174 calling magic functions with () in their arguments. Thanks to Arnd
5179 calling magic functions with () in their arguments. Thanks to Arnd
5175 Baecker for pointing this to me.
5180 Baecker for pointing this to me.
5176
5181
5177 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5182 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5178 infinitely for integer or complex arrays (only worked with floats).
5183 infinitely for integer or complex arrays (only worked with floats).
5179
5184
5180 2002-03-16 Fernando Perez <fperez@colorado.edu>
5185 2002-03-16 Fernando Perez <fperez@colorado.edu>
5181
5186
5182 * setup.py: Merged setup and setup_windows into a single script
5187 * setup.py: Merged setup and setup_windows into a single script
5183 which properly handles things for windows users.
5188 which properly handles things for windows users.
5184
5189
5185 2002-03-15 Fernando Perez <fperez@colorado.edu>
5190 2002-03-15 Fernando Perez <fperez@colorado.edu>
5186
5191
5187 * Big change to the manual: now the magics are all automatically
5192 * Big change to the manual: now the magics are all automatically
5188 documented. This information is generated from their docstrings
5193 documented. This information is generated from their docstrings
5189 and put in a latex file included by the manual lyx file. This way
5194 and put in a latex file included by the manual lyx file. This way
5190 we get always up to date information for the magics. The manual
5195 we get always up to date information for the magics. The manual
5191 now also has proper version information, also auto-synced.
5196 now also has proper version information, also auto-synced.
5192
5197
5193 For this to work, an undocumented --magic_docstrings option was added.
5198 For this to work, an undocumented --magic_docstrings option was added.
5194
5199
5195 2002-03-13 Fernando Perez <fperez@colorado.edu>
5200 2002-03-13 Fernando Perez <fperez@colorado.edu>
5196
5201
5197 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5202 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5198 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5203 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5199
5204
5200 2002-03-12 Fernando Perez <fperez@colorado.edu>
5205 2002-03-12 Fernando Perez <fperez@colorado.edu>
5201
5206
5202 * IPython/ultraTB.py (TermColors): changed color escapes again to
5207 * IPython/ultraTB.py (TermColors): changed color escapes again to
5203 fix the (old, reintroduced) line-wrapping bug. Basically, if
5208 fix the (old, reintroduced) line-wrapping bug. Basically, if
5204 \001..\002 aren't given in the color escapes, lines get wrapped
5209 \001..\002 aren't given in the color escapes, lines get wrapped
5205 weirdly. But giving those screws up old xterms and emacs terms. So
5210 weirdly. But giving those screws up old xterms and emacs terms. So
5206 I added some logic for emacs terms to be ok, but I can't identify old
5211 I added some logic for emacs terms to be ok, but I can't identify old
5207 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5212 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5208
5213
5209 2002-03-10 Fernando Perez <fperez@colorado.edu>
5214 2002-03-10 Fernando Perez <fperez@colorado.edu>
5210
5215
5211 * IPython/usage.py (__doc__): Various documentation cleanups and
5216 * IPython/usage.py (__doc__): Various documentation cleanups and
5212 updates, both in usage docstrings and in the manual.
5217 updates, both in usage docstrings and in the manual.
5213
5218
5214 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5219 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5215 handling of caching. Set minimum acceptabe value for having a
5220 handling of caching. Set minimum acceptabe value for having a
5216 cache at 20 values.
5221 cache at 20 values.
5217
5222
5218 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5223 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5219 install_first_time function to a method, renamed it and added an
5224 install_first_time function to a method, renamed it and added an
5220 'upgrade' mode. Now people can update their config directory with
5225 'upgrade' mode. Now people can update their config directory with
5221 a simple command line switch (-upgrade, also new).
5226 a simple command line switch (-upgrade, also new).
5222
5227
5223 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5228 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5224 @file (convenient for automagic users under Python >= 2.2).
5229 @file (convenient for automagic users under Python >= 2.2).
5225 Removed @files (it seemed more like a plural than an abbrev. of
5230 Removed @files (it seemed more like a plural than an abbrev. of
5226 'file show').
5231 'file show').
5227
5232
5228 * IPython/iplib.py (install_first_time): Fixed crash if there were
5233 * IPython/iplib.py (install_first_time): Fixed crash if there were
5229 backup files ('~') in .ipython/ install directory.
5234 backup files ('~') in .ipython/ install directory.
5230
5235
5231 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5236 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5232 system. Things look fine, but these changes are fairly
5237 system. Things look fine, but these changes are fairly
5233 intrusive. Test them for a few days.
5238 intrusive. Test them for a few days.
5234
5239
5235 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5240 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5236 the prompts system. Now all in/out prompt strings are user
5241 the prompts system. Now all in/out prompt strings are user
5237 controllable. This is particularly useful for embedding, as one
5242 controllable. This is particularly useful for embedding, as one
5238 can tag embedded instances with particular prompts.
5243 can tag embedded instances with particular prompts.
5239
5244
5240 Also removed global use of sys.ps1/2, which now allows nested
5245 Also removed global use of sys.ps1/2, which now allows nested
5241 embeddings without any problems. Added command-line options for
5246 embeddings without any problems. Added command-line options for
5242 the prompt strings.
5247 the prompt strings.
5243
5248
5244 2002-03-08 Fernando Perez <fperez@colorado.edu>
5249 2002-03-08 Fernando Perez <fperez@colorado.edu>
5245
5250
5246 * IPython/UserConfig/example-embed-short.py (ipshell): added
5251 * IPython/UserConfig/example-embed-short.py (ipshell): added
5247 example file with the bare minimum code for embedding.
5252 example file with the bare minimum code for embedding.
5248
5253
5249 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5254 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5250 functionality for the embeddable shell to be activated/deactivated
5255 functionality for the embeddable shell to be activated/deactivated
5251 either globally or at each call.
5256 either globally or at each call.
5252
5257
5253 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5258 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5254 rewriting the prompt with '--->' for auto-inputs with proper
5259 rewriting the prompt with '--->' for auto-inputs with proper
5255 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5260 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5256 this is handled by the prompts class itself, as it should.
5261 this is handled by the prompts class itself, as it should.
5257
5262
5258 2002-03-05 Fernando Perez <fperez@colorado.edu>
5263 2002-03-05 Fernando Perez <fperez@colorado.edu>
5259
5264
5260 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5265 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5261 @logstart to avoid name clashes with the math log function.
5266 @logstart to avoid name clashes with the math log function.
5262
5267
5263 * Big updates to X/Emacs section of the manual.
5268 * Big updates to X/Emacs section of the manual.
5264
5269
5265 * Removed ipython_emacs. Milan explained to me how to pass
5270 * Removed ipython_emacs. Milan explained to me how to pass
5266 arguments to ipython through Emacs. Some day I'm going to end up
5271 arguments to ipython through Emacs. Some day I'm going to end up
5267 learning some lisp...
5272 learning some lisp...
5268
5273
5269 2002-03-04 Fernando Perez <fperez@colorado.edu>
5274 2002-03-04 Fernando Perez <fperez@colorado.edu>
5270
5275
5271 * IPython/ipython_emacs: Created script to be used as the
5276 * IPython/ipython_emacs: Created script to be used as the
5272 py-python-command Emacs variable so we can pass IPython
5277 py-python-command Emacs variable so we can pass IPython
5273 parameters. I can't figure out how to tell Emacs directly to pass
5278 parameters. I can't figure out how to tell Emacs directly to pass
5274 parameters to IPython, so a dummy shell script will do it.
5279 parameters to IPython, so a dummy shell script will do it.
5275
5280
5276 Other enhancements made for things to work better under Emacs'
5281 Other enhancements made for things to work better under Emacs'
5277 various types of terminals. Many thanks to Milan Zamazal
5282 various types of terminals. Many thanks to Milan Zamazal
5278 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5283 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5279
5284
5280 2002-03-01 Fernando Perez <fperez@colorado.edu>
5285 2002-03-01 Fernando Perez <fperez@colorado.edu>
5281
5286
5282 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5287 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5283 that loading of readline is now optional. This gives better
5288 that loading of readline is now optional. This gives better
5284 control to emacs users.
5289 control to emacs users.
5285
5290
5286 * IPython/ultraTB.py (__date__): Modified color escape sequences
5291 * IPython/ultraTB.py (__date__): Modified color escape sequences
5287 and now things work fine under xterm and in Emacs' term buffers
5292 and now things work fine under xterm and in Emacs' term buffers
5288 (though not shell ones). Well, in emacs you get colors, but all
5293 (though not shell ones). Well, in emacs you get colors, but all
5289 seem to be 'light' colors (no difference between dark and light
5294 seem to be 'light' colors (no difference between dark and light
5290 ones). But the garbage chars are gone, and also in xterms. It
5295 ones). But the garbage chars are gone, and also in xterms. It
5291 seems that now I'm using 'cleaner' ansi sequences.
5296 seems that now I'm using 'cleaner' ansi sequences.
5292
5297
5293 2002-02-21 Fernando Perez <fperez@colorado.edu>
5298 2002-02-21 Fernando Perez <fperez@colorado.edu>
5294
5299
5295 * Released 0.2.7 (mainly to publish the scoping fix).
5300 * Released 0.2.7 (mainly to publish the scoping fix).
5296
5301
5297 * IPython/Logger.py (Logger.logstate): added. A corresponding
5302 * IPython/Logger.py (Logger.logstate): added. A corresponding
5298 @logstate magic was created.
5303 @logstate magic was created.
5299
5304
5300 * IPython/Magic.py: fixed nested scoping problem under Python
5305 * IPython/Magic.py: fixed nested scoping problem under Python
5301 2.1.x (automagic wasn't working).
5306 2.1.x (automagic wasn't working).
5302
5307
5303 2002-02-20 Fernando Perez <fperez@colorado.edu>
5308 2002-02-20 Fernando Perez <fperez@colorado.edu>
5304
5309
5305 * Released 0.2.6.
5310 * Released 0.2.6.
5306
5311
5307 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5312 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5308 option so that logs can come out without any headers at all.
5313 option so that logs can come out without any headers at all.
5309
5314
5310 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5315 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5311 SciPy.
5316 SciPy.
5312
5317
5313 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5318 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5314 that embedded IPython calls don't require vars() to be explicitly
5319 that embedded IPython calls don't require vars() to be explicitly
5315 passed. Now they are extracted from the caller's frame (code
5320 passed. Now they are extracted from the caller's frame (code
5316 snatched from Eric Jones' weave). Added better documentation to
5321 snatched from Eric Jones' weave). Added better documentation to
5317 the section on embedding and the example file.
5322 the section on embedding and the example file.
5318
5323
5319 * IPython/genutils.py (page): Changed so that under emacs, it just
5324 * IPython/genutils.py (page): Changed so that under emacs, it just
5320 prints the string. You can then page up and down in the emacs
5325 prints the string. You can then page up and down in the emacs
5321 buffer itself. This is how the builtin help() works.
5326 buffer itself. This is how the builtin help() works.
5322
5327
5323 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5328 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5324 macro scoping: macros need to be executed in the user's namespace
5329 macro scoping: macros need to be executed in the user's namespace
5325 to work as if they had been typed by the user.
5330 to work as if they had been typed by the user.
5326
5331
5327 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5332 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5328 execute automatically (no need to type 'exec...'). They then
5333 execute automatically (no need to type 'exec...'). They then
5329 behave like 'true macros'. The printing system was also modified
5334 behave like 'true macros'. The printing system was also modified
5330 for this to work.
5335 for this to work.
5331
5336
5332 2002-02-19 Fernando Perez <fperez@colorado.edu>
5337 2002-02-19 Fernando Perez <fperez@colorado.edu>
5333
5338
5334 * IPython/genutils.py (page_file): new function for paging files
5339 * IPython/genutils.py (page_file): new function for paging files
5335 in an OS-independent way. Also necessary for file viewing to work
5340 in an OS-independent way. Also necessary for file viewing to work
5336 well inside Emacs buffers.
5341 well inside Emacs buffers.
5337 (page): Added checks for being in an emacs buffer.
5342 (page): Added checks for being in an emacs buffer.
5338 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5343 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5339 same bug in iplib.
5344 same bug in iplib.
5340
5345
5341 2002-02-18 Fernando Perez <fperez@colorado.edu>
5346 2002-02-18 Fernando Perez <fperez@colorado.edu>
5342
5347
5343 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5348 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5344 of readline so that IPython can work inside an Emacs buffer.
5349 of readline so that IPython can work inside an Emacs buffer.
5345
5350
5346 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5351 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5347 method signatures (they weren't really bugs, but it looks cleaner
5352 method signatures (they weren't really bugs, but it looks cleaner
5348 and keeps PyChecker happy).
5353 and keeps PyChecker happy).
5349
5354
5350 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5355 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5351 for implementing various user-defined hooks. Currently only
5356 for implementing various user-defined hooks. Currently only
5352 display is done.
5357 display is done.
5353
5358
5354 * IPython/Prompts.py (CachedOutput._display): changed display
5359 * IPython/Prompts.py (CachedOutput._display): changed display
5355 functions so that they can be dynamically changed by users easily.
5360 functions so that they can be dynamically changed by users easily.
5356
5361
5357 * IPython/Extensions/numeric_formats.py (num_display): added an
5362 * IPython/Extensions/numeric_formats.py (num_display): added an
5358 extension for printing NumPy arrays in flexible manners. It
5363 extension for printing NumPy arrays in flexible manners. It
5359 doesn't do anything yet, but all the structure is in
5364 doesn't do anything yet, but all the structure is in
5360 place. Ultimately the plan is to implement output format control
5365 place. Ultimately the plan is to implement output format control
5361 like in Octave.
5366 like in Octave.
5362
5367
5363 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5368 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5364 methods are found at run-time by all the automatic machinery.
5369 methods are found at run-time by all the automatic machinery.
5365
5370
5366 2002-02-17 Fernando Perez <fperez@colorado.edu>
5371 2002-02-17 Fernando Perez <fperez@colorado.edu>
5367
5372
5368 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5373 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5369 whole file a little.
5374 whole file a little.
5370
5375
5371 * ToDo: closed this document. Now there's a new_design.lyx
5376 * ToDo: closed this document. Now there's a new_design.lyx
5372 document for all new ideas. Added making a pdf of it for the
5377 document for all new ideas. Added making a pdf of it for the
5373 end-user distro.
5378 end-user distro.
5374
5379
5375 * IPython/Logger.py (Logger.switch_log): Created this to replace
5380 * IPython/Logger.py (Logger.switch_log): Created this to replace
5376 logon() and logoff(). It also fixes a nasty crash reported by
5381 logon() and logoff(). It also fixes a nasty crash reported by
5377 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5382 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5378
5383
5379 * IPython/iplib.py (complete): got auto-completion to work with
5384 * IPython/iplib.py (complete): got auto-completion to work with
5380 automagic (I had wanted this for a long time).
5385 automagic (I had wanted this for a long time).
5381
5386
5382 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5387 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5383 to @file, since file() is now a builtin and clashes with automagic
5388 to @file, since file() is now a builtin and clashes with automagic
5384 for @file.
5389 for @file.
5385
5390
5386 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5391 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5387 of this was previously in iplib, which had grown to more than 2000
5392 of this was previously in iplib, which had grown to more than 2000
5388 lines, way too long. No new functionality, but it makes managing
5393 lines, way too long. No new functionality, but it makes managing
5389 the code a bit easier.
5394 the code a bit easier.
5390
5395
5391 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5396 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5392 information to crash reports.
5397 information to crash reports.
5393
5398
5394 2002-02-12 Fernando Perez <fperez@colorado.edu>
5399 2002-02-12 Fernando Perez <fperez@colorado.edu>
5395
5400
5396 * Released 0.2.5.
5401 * Released 0.2.5.
5397
5402
5398 2002-02-11 Fernando Perez <fperez@colorado.edu>
5403 2002-02-11 Fernando Perez <fperez@colorado.edu>
5399
5404
5400 * Wrote a relatively complete Windows installer. It puts
5405 * Wrote a relatively complete Windows installer. It puts
5401 everything in place, creates Start Menu entries and fixes the
5406 everything in place, creates Start Menu entries and fixes the
5402 color issues. Nothing fancy, but it works.
5407 color issues. Nothing fancy, but it works.
5403
5408
5404 2002-02-10 Fernando Perez <fperez@colorado.edu>
5409 2002-02-10 Fernando Perez <fperez@colorado.edu>
5405
5410
5406 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5411 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5407 os.path.expanduser() call so that we can type @run ~/myfile.py and
5412 os.path.expanduser() call so that we can type @run ~/myfile.py and
5408 have thigs work as expected.
5413 have thigs work as expected.
5409
5414
5410 * IPython/genutils.py (page): fixed exception handling so things
5415 * IPython/genutils.py (page): fixed exception handling so things
5411 work both in Unix and Windows correctly. Quitting a pager triggers
5416 work both in Unix and Windows correctly. Quitting a pager triggers
5412 an IOError/broken pipe in Unix, and in windows not finding a pager
5417 an IOError/broken pipe in Unix, and in windows not finding a pager
5413 is also an IOError, so I had to actually look at the return value
5418 is also an IOError, so I had to actually look at the return value
5414 of the exception, not just the exception itself. Should be ok now.
5419 of the exception, not just the exception itself. Should be ok now.
5415
5420
5416 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5421 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5417 modified to allow case-insensitive color scheme changes.
5422 modified to allow case-insensitive color scheme changes.
5418
5423
5419 2002-02-09 Fernando Perez <fperez@colorado.edu>
5424 2002-02-09 Fernando Perez <fperez@colorado.edu>
5420
5425
5421 * IPython/genutils.py (native_line_ends): new function to leave
5426 * IPython/genutils.py (native_line_ends): new function to leave
5422 user config files with os-native line-endings.
5427 user config files with os-native line-endings.
5423
5428
5424 * README and manual updates.
5429 * README and manual updates.
5425
5430
5426 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5431 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5427 instead of StringType to catch Unicode strings.
5432 instead of StringType to catch Unicode strings.
5428
5433
5429 * IPython/genutils.py (filefind): fixed bug for paths with
5434 * IPython/genutils.py (filefind): fixed bug for paths with
5430 embedded spaces (very common in Windows).
5435 embedded spaces (very common in Windows).
5431
5436
5432 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5437 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5433 files under Windows, so that they get automatically associated
5438 files under Windows, so that they get automatically associated
5434 with a text editor. Windows makes it a pain to handle
5439 with a text editor. Windows makes it a pain to handle
5435 extension-less files.
5440 extension-less files.
5436
5441
5437 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5442 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5438 warning about readline only occur for Posix. In Windows there's no
5443 warning about readline only occur for Posix. In Windows there's no
5439 way to get readline, so why bother with the warning.
5444 way to get readline, so why bother with the warning.
5440
5445
5441 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5446 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5442 for __str__ instead of dir(self), since dir() changed in 2.2.
5447 for __str__ instead of dir(self), since dir() changed in 2.2.
5443
5448
5444 * Ported to Windows! Tested on XP, I suspect it should work fine
5449 * Ported to Windows! Tested on XP, I suspect it should work fine
5445 on NT/2000, but I don't think it will work on 98 et al. That
5450 on NT/2000, but I don't think it will work on 98 et al. That
5446 series of Windows is such a piece of junk anyway that I won't try
5451 series of Windows is such a piece of junk anyway that I won't try
5447 porting it there. The XP port was straightforward, showed a few
5452 porting it there. The XP port was straightforward, showed a few
5448 bugs here and there (fixed all), in particular some string
5453 bugs here and there (fixed all), in particular some string
5449 handling stuff which required considering Unicode strings (which
5454 handling stuff which required considering Unicode strings (which
5450 Windows uses). This is good, but hasn't been too tested :) No
5455 Windows uses). This is good, but hasn't been too tested :) No
5451 fancy installer yet, I'll put a note in the manual so people at
5456 fancy installer yet, I'll put a note in the manual so people at
5452 least make manually a shortcut.
5457 least make manually a shortcut.
5453
5458
5454 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5459 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5455 into a single one, "colors". This now controls both prompt and
5460 into a single one, "colors". This now controls both prompt and
5456 exception color schemes, and can be changed both at startup
5461 exception color schemes, and can be changed both at startup
5457 (either via command-line switches or via ipythonrc files) and at
5462 (either via command-line switches or via ipythonrc files) and at
5458 runtime, with @colors.
5463 runtime, with @colors.
5459 (Magic.magic_run): renamed @prun to @run and removed the old
5464 (Magic.magic_run): renamed @prun to @run and removed the old
5460 @run. The two were too similar to warrant keeping both.
5465 @run. The two were too similar to warrant keeping both.
5461
5466
5462 2002-02-03 Fernando Perez <fperez@colorado.edu>
5467 2002-02-03 Fernando Perez <fperez@colorado.edu>
5463
5468
5464 * IPython/iplib.py (install_first_time): Added comment on how to
5469 * IPython/iplib.py (install_first_time): Added comment on how to
5465 configure the color options for first-time users. Put a <return>
5470 configure the color options for first-time users. Put a <return>
5466 request at the end so that small-terminal users get a chance to
5471 request at the end so that small-terminal users get a chance to
5467 read the startup info.
5472 read the startup info.
5468
5473
5469 2002-01-23 Fernando Perez <fperez@colorado.edu>
5474 2002-01-23 Fernando Perez <fperez@colorado.edu>
5470
5475
5471 * IPython/iplib.py (CachedOutput.update): Changed output memory
5476 * IPython/iplib.py (CachedOutput.update): Changed output memory
5472 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5477 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5473 input history we still use _i. Did this b/c these variable are
5478 input history we still use _i. Did this b/c these variable are
5474 very commonly used in interactive work, so the less we need to
5479 very commonly used in interactive work, so the less we need to
5475 type the better off we are.
5480 type the better off we are.
5476 (Magic.magic_prun): updated @prun to better handle the namespaces
5481 (Magic.magic_prun): updated @prun to better handle the namespaces
5477 the file will run in, including a fix for __name__ not being set
5482 the file will run in, including a fix for __name__ not being set
5478 before.
5483 before.
5479
5484
5480 2002-01-20 Fernando Perez <fperez@colorado.edu>
5485 2002-01-20 Fernando Perez <fperez@colorado.edu>
5481
5486
5482 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5487 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5483 extra garbage for Python 2.2. Need to look more carefully into
5488 extra garbage for Python 2.2. Need to look more carefully into
5484 this later.
5489 this later.
5485
5490
5486 2002-01-19 Fernando Perez <fperez@colorado.edu>
5491 2002-01-19 Fernando Perez <fperez@colorado.edu>
5487
5492
5488 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5493 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5489 display SyntaxError exceptions properly formatted when they occur
5494 display SyntaxError exceptions properly formatted when they occur
5490 (they can be triggered by imported code).
5495 (they can be triggered by imported code).
5491
5496
5492 2002-01-18 Fernando Perez <fperez@colorado.edu>
5497 2002-01-18 Fernando Perez <fperez@colorado.edu>
5493
5498
5494 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5499 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5495 SyntaxError exceptions are reported nicely formatted, instead of
5500 SyntaxError exceptions are reported nicely formatted, instead of
5496 spitting out only offset information as before.
5501 spitting out only offset information as before.
5497 (Magic.magic_prun): Added the @prun function for executing
5502 (Magic.magic_prun): Added the @prun function for executing
5498 programs with command line args inside IPython.
5503 programs with command line args inside IPython.
5499
5504
5500 2002-01-16 Fernando Perez <fperez@colorado.edu>
5505 2002-01-16 Fernando Perez <fperez@colorado.edu>
5501
5506
5502 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5507 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5503 to *not* include the last item given in a range. This brings their
5508 to *not* include the last item given in a range. This brings their
5504 behavior in line with Python's slicing:
5509 behavior in line with Python's slicing:
5505 a[n1:n2] -> a[n1]...a[n2-1]
5510 a[n1:n2] -> a[n1]...a[n2-1]
5506 It may be a bit less convenient, but I prefer to stick to Python's
5511 It may be a bit less convenient, but I prefer to stick to Python's
5507 conventions *everywhere*, so users never have to wonder.
5512 conventions *everywhere*, so users never have to wonder.
5508 (Magic.magic_macro): Added @macro function to ease the creation of
5513 (Magic.magic_macro): Added @macro function to ease the creation of
5509 macros.
5514 macros.
5510
5515
5511 2002-01-05 Fernando Perez <fperez@colorado.edu>
5516 2002-01-05 Fernando Perez <fperez@colorado.edu>
5512
5517
5513 * Released 0.2.4.
5518 * Released 0.2.4.
5514
5519
5515 * IPython/iplib.py (Magic.magic_pdef):
5520 * IPython/iplib.py (Magic.magic_pdef):
5516 (InteractiveShell.safe_execfile): report magic lines and error
5521 (InteractiveShell.safe_execfile): report magic lines and error
5517 lines without line numbers so one can easily copy/paste them for
5522 lines without line numbers so one can easily copy/paste them for
5518 re-execution.
5523 re-execution.
5519
5524
5520 * Updated manual with recent changes.
5525 * Updated manual with recent changes.
5521
5526
5522 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5527 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5523 docstring printing when class? is called. Very handy for knowing
5528 docstring printing when class? is called. Very handy for knowing
5524 how to create class instances (as long as __init__ is well
5529 how to create class instances (as long as __init__ is well
5525 documented, of course :)
5530 documented, of course :)
5526 (Magic.magic_doc): print both class and constructor docstrings.
5531 (Magic.magic_doc): print both class and constructor docstrings.
5527 (Magic.magic_pdef): give constructor info if passed a class and
5532 (Magic.magic_pdef): give constructor info if passed a class and
5528 __call__ info for callable object instances.
5533 __call__ info for callable object instances.
5529
5534
5530 2002-01-04 Fernando Perez <fperez@colorado.edu>
5535 2002-01-04 Fernando Perez <fperez@colorado.edu>
5531
5536
5532 * Made deep_reload() off by default. It doesn't always work
5537 * Made deep_reload() off by default. It doesn't always work
5533 exactly as intended, so it's probably safer to have it off. It's
5538 exactly as intended, so it's probably safer to have it off. It's
5534 still available as dreload() anyway, so nothing is lost.
5539 still available as dreload() anyway, so nothing is lost.
5535
5540
5536 2002-01-02 Fernando Perez <fperez@colorado.edu>
5541 2002-01-02 Fernando Perez <fperez@colorado.edu>
5537
5542
5538 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5543 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5539 so I wanted an updated release).
5544 so I wanted an updated release).
5540
5545
5541 2001-12-27 Fernando Perez <fperez@colorado.edu>
5546 2001-12-27 Fernando Perez <fperez@colorado.edu>
5542
5547
5543 * IPython/iplib.py (InteractiveShell.interact): Added the original
5548 * IPython/iplib.py (InteractiveShell.interact): Added the original
5544 code from 'code.py' for this module in order to change the
5549 code from 'code.py' for this module in order to change the
5545 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5550 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5546 the history cache would break when the user hit Ctrl-C, and
5551 the history cache would break when the user hit Ctrl-C, and
5547 interact() offers no way to add any hooks to it.
5552 interact() offers no way to add any hooks to it.
5548
5553
5549 2001-12-23 Fernando Perez <fperez@colorado.edu>
5554 2001-12-23 Fernando Perez <fperez@colorado.edu>
5550
5555
5551 * setup.py: added check for 'MANIFEST' before trying to remove
5556 * setup.py: added check for 'MANIFEST' before trying to remove
5552 it. Thanks to Sean Reifschneider.
5557 it. Thanks to Sean Reifschneider.
5553
5558
5554 2001-12-22 Fernando Perez <fperez@colorado.edu>
5559 2001-12-22 Fernando Perez <fperez@colorado.edu>
5555
5560
5556 * Released 0.2.2.
5561 * Released 0.2.2.
5557
5562
5558 * Finished (reasonably) writing the manual. Later will add the
5563 * Finished (reasonably) writing the manual. Later will add the
5559 python-standard navigation stylesheets, but for the time being
5564 python-standard navigation stylesheets, but for the time being
5560 it's fairly complete. Distribution will include html and pdf
5565 it's fairly complete. Distribution will include html and pdf
5561 versions.
5566 versions.
5562
5567
5563 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5568 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5564 (MayaVi author).
5569 (MayaVi author).
5565
5570
5566 2001-12-21 Fernando Perez <fperez@colorado.edu>
5571 2001-12-21 Fernando Perez <fperez@colorado.edu>
5567
5572
5568 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5573 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5569 good public release, I think (with the manual and the distutils
5574 good public release, I think (with the manual and the distutils
5570 installer). The manual can use some work, but that can go
5575 installer). The manual can use some work, but that can go
5571 slowly. Otherwise I think it's quite nice for end users. Next
5576 slowly. Otherwise I think it's quite nice for end users. Next
5572 summer, rewrite the guts of it...
5577 summer, rewrite the guts of it...
5573
5578
5574 * Changed format of ipythonrc files to use whitespace as the
5579 * Changed format of ipythonrc files to use whitespace as the
5575 separator instead of an explicit '='. Cleaner.
5580 separator instead of an explicit '='. Cleaner.
5576
5581
5577 2001-12-20 Fernando Perez <fperez@colorado.edu>
5582 2001-12-20 Fernando Perez <fperez@colorado.edu>
5578
5583
5579 * Started a manual in LyX. For now it's just a quick merge of the
5584 * Started a manual in LyX. For now it's just a quick merge of the
5580 various internal docstrings and READMEs. Later it may grow into a
5585 various internal docstrings and READMEs. Later it may grow into a
5581 nice, full-blown manual.
5586 nice, full-blown manual.
5582
5587
5583 * Set up a distutils based installer. Installation should now be
5588 * Set up a distutils based installer. Installation should now be
5584 trivially simple for end-users.
5589 trivially simple for end-users.
5585
5590
5586 2001-12-11 Fernando Perez <fperez@colorado.edu>
5591 2001-12-11 Fernando Perez <fperez@colorado.edu>
5587
5592
5588 * Released 0.2.0. First public release, announced it at
5593 * Released 0.2.0. First public release, announced it at
5589 comp.lang.python. From now on, just bugfixes...
5594 comp.lang.python. From now on, just bugfixes...
5590
5595
5591 * Went through all the files, set copyright/license notices and
5596 * Went through all the files, set copyright/license notices and
5592 cleaned up things. Ready for release.
5597 cleaned up things. Ready for release.
5593
5598
5594 2001-12-10 Fernando Perez <fperez@colorado.edu>
5599 2001-12-10 Fernando Perez <fperez@colorado.edu>
5595
5600
5596 * Changed the first-time installer not to use tarfiles. It's more
5601 * Changed the first-time installer not to use tarfiles. It's more
5597 robust now and less unix-dependent. Also makes it easier for
5602 robust now and less unix-dependent. Also makes it easier for
5598 people to later upgrade versions.
5603 people to later upgrade versions.
5599
5604
5600 * Changed @exit to @abort to reflect the fact that it's pretty
5605 * Changed @exit to @abort to reflect the fact that it's pretty
5601 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5606 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5602 becomes significant only when IPyhton is embedded: in that case,
5607 becomes significant only when IPyhton is embedded: in that case,
5603 C-D closes IPython only, but @abort kills the enclosing program
5608 C-D closes IPython only, but @abort kills the enclosing program
5604 too (unless it had called IPython inside a try catching
5609 too (unless it had called IPython inside a try catching
5605 SystemExit).
5610 SystemExit).
5606
5611
5607 * Created Shell module which exposes the actuall IPython Shell
5612 * Created Shell module which exposes the actuall IPython Shell
5608 classes, currently the normal and the embeddable one. This at
5613 classes, currently the normal and the embeddable one. This at
5609 least offers a stable interface we won't need to change when
5614 least offers a stable interface we won't need to change when
5610 (later) the internals are rewritten. That rewrite will be confined
5615 (later) the internals are rewritten. That rewrite will be confined
5611 to iplib and ipmaker, but the Shell interface should remain as is.
5616 to iplib and ipmaker, but the Shell interface should remain as is.
5612
5617
5613 * Added embed module which offers an embeddable IPShell object,
5618 * Added embed module which offers an embeddable IPShell object,
5614 useful to fire up IPython *inside* a running program. Great for
5619 useful to fire up IPython *inside* a running program. Great for
5615 debugging or dynamical data analysis.
5620 debugging or dynamical data analysis.
5616
5621
5617 2001-12-08 Fernando Perez <fperez@colorado.edu>
5622 2001-12-08 Fernando Perez <fperez@colorado.edu>
5618
5623
5619 * Fixed small bug preventing seeing info from methods of defined
5624 * Fixed small bug preventing seeing info from methods of defined
5620 objects (incorrect namespace in _ofind()).
5625 objects (incorrect namespace in _ofind()).
5621
5626
5622 * Documentation cleanup. Moved the main usage docstrings to a
5627 * Documentation cleanup. Moved the main usage docstrings to a
5623 separate file, usage.py (cleaner to maintain, and hopefully in the
5628 separate file, usage.py (cleaner to maintain, and hopefully in the
5624 future some perlpod-like way of producing interactive, man and
5629 future some perlpod-like way of producing interactive, man and
5625 html docs out of it will be found).
5630 html docs out of it will be found).
5626
5631
5627 * Added @profile to see your profile at any time.
5632 * Added @profile to see your profile at any time.
5628
5633
5629 * Added @p as an alias for 'print'. It's especially convenient if
5634 * Added @p as an alias for 'print'. It's especially convenient if
5630 using automagic ('p x' prints x).
5635 using automagic ('p x' prints x).
5631
5636
5632 * Small cleanups and fixes after a pychecker run.
5637 * Small cleanups and fixes after a pychecker run.
5633
5638
5634 * Changed the @cd command to handle @cd - and @cd -<n> for
5639 * Changed the @cd command to handle @cd - and @cd -<n> for
5635 visiting any directory in _dh.
5640 visiting any directory in _dh.
5636
5641
5637 * Introduced _dh, a history of visited directories. @dhist prints
5642 * Introduced _dh, a history of visited directories. @dhist prints
5638 it out with numbers.
5643 it out with numbers.
5639
5644
5640 2001-12-07 Fernando Perez <fperez@colorado.edu>
5645 2001-12-07 Fernando Perez <fperez@colorado.edu>
5641
5646
5642 * Released 0.1.22
5647 * Released 0.1.22
5643
5648
5644 * Made initialization a bit more robust against invalid color
5649 * Made initialization a bit more robust against invalid color
5645 options in user input (exit, not traceback-crash).
5650 options in user input (exit, not traceback-crash).
5646
5651
5647 * Changed the bug crash reporter to write the report only in the
5652 * Changed the bug crash reporter to write the report only in the
5648 user's .ipython directory. That way IPython won't litter people's
5653 user's .ipython directory. That way IPython won't litter people's
5649 hard disks with crash files all over the place. Also print on
5654 hard disks with crash files all over the place. Also print on
5650 screen the necessary mail command.
5655 screen the necessary mail command.
5651
5656
5652 * With the new ultraTB, implemented LightBG color scheme for light
5657 * With the new ultraTB, implemented LightBG color scheme for light
5653 background terminals. A lot of people like white backgrounds, so I
5658 background terminals. A lot of people like white backgrounds, so I
5654 guess we should at least give them something readable.
5659 guess we should at least give them something readable.
5655
5660
5656 2001-12-06 Fernando Perez <fperez@colorado.edu>
5661 2001-12-06 Fernando Perez <fperez@colorado.edu>
5657
5662
5658 * Modified the structure of ultraTB. Now there's a proper class
5663 * Modified the structure of ultraTB. Now there's a proper class
5659 for tables of color schemes which allow adding schemes easily and
5664 for tables of color schemes which allow adding schemes easily and
5660 switching the active scheme without creating a new instance every
5665 switching the active scheme without creating a new instance every
5661 time (which was ridiculous). The syntax for creating new schemes
5666 time (which was ridiculous). The syntax for creating new schemes
5662 is also cleaner. I think ultraTB is finally done, with a clean
5667 is also cleaner. I think ultraTB is finally done, with a clean
5663 class structure. Names are also much cleaner (now there's proper
5668 class structure. Names are also much cleaner (now there's proper
5664 color tables, no need for every variable to also have 'color' in
5669 color tables, no need for every variable to also have 'color' in
5665 its name).
5670 its name).
5666
5671
5667 * Broke down genutils into separate files. Now genutils only
5672 * Broke down genutils into separate files. Now genutils only
5668 contains utility functions, and classes have been moved to their
5673 contains utility functions, and classes have been moved to their
5669 own files (they had enough independent functionality to warrant
5674 own files (they had enough independent functionality to warrant
5670 it): ConfigLoader, OutputTrap, Struct.
5675 it): ConfigLoader, OutputTrap, Struct.
5671
5676
5672 2001-12-05 Fernando Perez <fperez@colorado.edu>
5677 2001-12-05 Fernando Perez <fperez@colorado.edu>
5673
5678
5674 * IPython turns 21! Released version 0.1.21, as a candidate for
5679 * IPython turns 21! Released version 0.1.21, as a candidate for
5675 public consumption. If all goes well, release in a few days.
5680 public consumption. If all goes well, release in a few days.
5676
5681
5677 * Fixed path bug (files in Extensions/ directory wouldn't be found
5682 * Fixed path bug (files in Extensions/ directory wouldn't be found
5678 unless IPython/ was explicitly in sys.path).
5683 unless IPython/ was explicitly in sys.path).
5679
5684
5680 * Extended the FlexCompleter class as MagicCompleter to allow
5685 * Extended the FlexCompleter class as MagicCompleter to allow
5681 completion of @-starting lines.
5686 completion of @-starting lines.
5682
5687
5683 * Created __release__.py file as a central repository for release
5688 * Created __release__.py file as a central repository for release
5684 info that other files can read from.
5689 info that other files can read from.
5685
5690
5686 * Fixed small bug in logging: when logging was turned on in
5691 * Fixed small bug in logging: when logging was turned on in
5687 mid-session, old lines with special meanings (!@?) were being
5692 mid-session, old lines with special meanings (!@?) were being
5688 logged without the prepended comment, which is necessary since
5693 logged without the prepended comment, which is necessary since
5689 they are not truly valid python syntax. This should make session
5694 they are not truly valid python syntax. This should make session
5690 restores produce less errors.
5695 restores produce less errors.
5691
5696
5692 * The namespace cleanup forced me to make a FlexCompleter class
5697 * The namespace cleanup forced me to make a FlexCompleter class
5693 which is nothing but a ripoff of rlcompleter, but with selectable
5698 which is nothing but a ripoff of rlcompleter, but with selectable
5694 namespace (rlcompleter only works in __main__.__dict__). I'll try
5699 namespace (rlcompleter only works in __main__.__dict__). I'll try
5695 to submit a note to the authors to see if this change can be
5700 to submit a note to the authors to see if this change can be
5696 incorporated in future rlcompleter releases (Dec.6: done)
5701 incorporated in future rlcompleter releases (Dec.6: done)
5697
5702
5698 * More fixes to namespace handling. It was a mess! Now all
5703 * More fixes to namespace handling. It was a mess! Now all
5699 explicit references to __main__.__dict__ are gone (except when
5704 explicit references to __main__.__dict__ are gone (except when
5700 really needed) and everything is handled through the namespace
5705 really needed) and everything is handled through the namespace
5701 dicts in the IPython instance. We seem to be getting somewhere
5706 dicts in the IPython instance. We seem to be getting somewhere
5702 with this, finally...
5707 with this, finally...
5703
5708
5704 * Small documentation updates.
5709 * Small documentation updates.
5705
5710
5706 * Created the Extensions directory under IPython (with an
5711 * Created the Extensions directory under IPython (with an
5707 __init__.py). Put the PhysicalQ stuff there. This directory should
5712 __init__.py). Put the PhysicalQ stuff there. This directory should
5708 be used for all special-purpose extensions.
5713 be used for all special-purpose extensions.
5709
5714
5710 * File renaming:
5715 * File renaming:
5711 ipythonlib --> ipmaker
5716 ipythonlib --> ipmaker
5712 ipplib --> iplib
5717 ipplib --> iplib
5713 This makes a bit more sense in terms of what these files actually do.
5718 This makes a bit more sense in terms of what these files actually do.
5714
5719
5715 * Moved all the classes and functions in ipythonlib to ipplib, so
5720 * Moved all the classes and functions in ipythonlib to ipplib, so
5716 now ipythonlib only has make_IPython(). This will ease up its
5721 now ipythonlib only has make_IPython(). This will ease up its
5717 splitting in smaller functional chunks later.
5722 splitting in smaller functional chunks later.
5718
5723
5719 * Cleaned up (done, I think) output of @whos. Better column
5724 * Cleaned up (done, I think) output of @whos. Better column
5720 formatting, and now shows str(var) for as much as it can, which is
5725 formatting, and now shows str(var) for as much as it can, which is
5721 typically what one gets with a 'print var'.
5726 typically what one gets with a 'print var'.
5722
5727
5723 2001-12-04 Fernando Perez <fperez@colorado.edu>
5728 2001-12-04 Fernando Perez <fperez@colorado.edu>
5724
5729
5725 * Fixed namespace problems. Now builtin/IPyhton/user names get
5730 * Fixed namespace problems. Now builtin/IPyhton/user names get
5726 properly reported in their namespace. Internal namespace handling
5731 properly reported in their namespace. Internal namespace handling
5727 is finally getting decent (not perfect yet, but much better than
5732 is finally getting decent (not perfect yet, but much better than
5728 the ad-hoc mess we had).
5733 the ad-hoc mess we had).
5729
5734
5730 * Removed -exit option. If people just want to run a python
5735 * Removed -exit option. If people just want to run a python
5731 script, that's what the normal interpreter is for. Less
5736 script, that's what the normal interpreter is for. Less
5732 unnecessary options, less chances for bugs.
5737 unnecessary options, less chances for bugs.
5733
5738
5734 * Added a crash handler which generates a complete post-mortem if
5739 * Added a crash handler which generates a complete post-mortem if
5735 IPython crashes. This will help a lot in tracking bugs down the
5740 IPython crashes. This will help a lot in tracking bugs down the
5736 road.
5741 road.
5737
5742
5738 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5743 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5739 which were boud to functions being reassigned would bypass the
5744 which were boud to functions being reassigned would bypass the
5740 logger, breaking the sync of _il with the prompt counter. This
5745 logger, breaking the sync of _il with the prompt counter. This
5741 would then crash IPython later when a new line was logged.
5746 would then crash IPython later when a new line was logged.
5742
5747
5743 2001-12-02 Fernando Perez <fperez@colorado.edu>
5748 2001-12-02 Fernando Perez <fperez@colorado.edu>
5744
5749
5745 * Made IPython a package. This means people don't have to clutter
5750 * Made IPython a package. This means people don't have to clutter
5746 their sys.path with yet another directory. Changed the INSTALL
5751 their sys.path with yet another directory. Changed the INSTALL
5747 file accordingly.
5752 file accordingly.
5748
5753
5749 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5754 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5750 sorts its output (so @who shows it sorted) and @whos formats the
5755 sorts its output (so @who shows it sorted) and @whos formats the
5751 table according to the width of the first column. Nicer, easier to
5756 table according to the width of the first column. Nicer, easier to
5752 read. Todo: write a generic table_format() which takes a list of
5757 read. Todo: write a generic table_format() which takes a list of
5753 lists and prints it nicely formatted, with optional row/column
5758 lists and prints it nicely formatted, with optional row/column
5754 separators and proper padding and justification.
5759 separators and proper padding and justification.
5755
5760
5756 * Released 0.1.20
5761 * Released 0.1.20
5757
5762
5758 * Fixed bug in @log which would reverse the inputcache list (a
5763 * Fixed bug in @log which would reverse the inputcache list (a
5759 copy operation was missing).
5764 copy operation was missing).
5760
5765
5761 * Code cleanup. @config was changed to use page(). Better, since
5766 * Code cleanup. @config was changed to use page(). Better, since
5762 its output is always quite long.
5767 its output is always quite long.
5763
5768
5764 * Itpl is back as a dependency. I was having too many problems
5769 * Itpl is back as a dependency. I was having too many problems
5765 getting the parametric aliases to work reliably, and it's just
5770 getting the parametric aliases to work reliably, and it's just
5766 easier to code weird string operations with it than playing %()s
5771 easier to code weird string operations with it than playing %()s
5767 games. It's only ~6k, so I don't think it's too big a deal.
5772 games. It's only ~6k, so I don't think it's too big a deal.
5768
5773
5769 * Found (and fixed) a very nasty bug with history. !lines weren't
5774 * Found (and fixed) a very nasty bug with history. !lines weren't
5770 getting cached, and the out of sync caches would crash
5775 getting cached, and the out of sync caches would crash
5771 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5776 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5772 division of labor a bit better. Bug fixed, cleaner structure.
5777 division of labor a bit better. Bug fixed, cleaner structure.
5773
5778
5774 2001-12-01 Fernando Perez <fperez@colorado.edu>
5779 2001-12-01 Fernando Perez <fperez@colorado.edu>
5775
5780
5776 * Released 0.1.19
5781 * Released 0.1.19
5777
5782
5778 * Added option -n to @hist to prevent line number printing. Much
5783 * Added option -n to @hist to prevent line number printing. Much
5779 easier to copy/paste code this way.
5784 easier to copy/paste code this way.
5780
5785
5781 * Created global _il to hold the input list. Allows easy
5786 * Created global _il to hold the input list. Allows easy
5782 re-execution of blocks of code by slicing it (inspired by Janko's
5787 re-execution of blocks of code by slicing it (inspired by Janko's
5783 comment on 'macros').
5788 comment on 'macros').
5784
5789
5785 * Small fixes and doc updates.
5790 * Small fixes and doc updates.
5786
5791
5787 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5792 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5788 much too fragile with automagic. Handles properly multi-line
5793 much too fragile with automagic. Handles properly multi-line
5789 statements and takes parameters.
5794 statements and takes parameters.
5790
5795
5791 2001-11-30 Fernando Perez <fperez@colorado.edu>
5796 2001-11-30 Fernando Perez <fperez@colorado.edu>
5792
5797
5793 * Version 0.1.18 released.
5798 * Version 0.1.18 released.
5794
5799
5795 * Fixed nasty namespace bug in initial module imports.
5800 * Fixed nasty namespace bug in initial module imports.
5796
5801
5797 * Added copyright/license notes to all code files (except
5802 * Added copyright/license notes to all code files (except
5798 DPyGetOpt). For the time being, LGPL. That could change.
5803 DPyGetOpt). For the time being, LGPL. That could change.
5799
5804
5800 * Rewrote a much nicer README, updated INSTALL, cleaned up
5805 * Rewrote a much nicer README, updated INSTALL, cleaned up
5801 ipythonrc-* samples.
5806 ipythonrc-* samples.
5802
5807
5803 * Overall code/documentation cleanup. Basically ready for
5808 * Overall code/documentation cleanup. Basically ready for
5804 release. Only remaining thing: licence decision (LGPL?).
5809 release. Only remaining thing: licence decision (LGPL?).
5805
5810
5806 * Converted load_config to a class, ConfigLoader. Now recursion
5811 * Converted load_config to a class, ConfigLoader. Now recursion
5807 control is better organized. Doesn't include the same file twice.
5812 control is better organized. Doesn't include the same file twice.
5808
5813
5809 2001-11-29 Fernando Perez <fperez@colorado.edu>
5814 2001-11-29 Fernando Perez <fperez@colorado.edu>
5810
5815
5811 * Got input history working. Changed output history variables from
5816 * Got input history working. Changed output history variables from
5812 _p to _o so that _i is for input and _o for output. Just cleaner
5817 _p to _o so that _i is for input and _o for output. Just cleaner
5813 convention.
5818 convention.
5814
5819
5815 * Implemented parametric aliases. This pretty much allows the
5820 * Implemented parametric aliases. This pretty much allows the
5816 alias system to offer full-blown shell convenience, I think.
5821 alias system to offer full-blown shell convenience, I think.
5817
5822
5818 * Version 0.1.17 released, 0.1.18 opened.
5823 * Version 0.1.17 released, 0.1.18 opened.
5819
5824
5820 * dot_ipython/ipythonrc (alias): added documentation.
5825 * dot_ipython/ipythonrc (alias): added documentation.
5821 (xcolor): Fixed small bug (xcolors -> xcolor)
5826 (xcolor): Fixed small bug (xcolors -> xcolor)
5822
5827
5823 * Changed the alias system. Now alias is a magic command to define
5828 * Changed the alias system. Now alias is a magic command to define
5824 aliases just like the shell. Rationale: the builtin magics should
5829 aliases just like the shell. Rationale: the builtin magics should
5825 be there for things deeply connected to IPython's
5830 be there for things deeply connected to IPython's
5826 architecture. And this is a much lighter system for what I think
5831 architecture. And this is a much lighter system for what I think
5827 is the really important feature: allowing users to define quickly
5832 is the really important feature: allowing users to define quickly
5828 magics that will do shell things for them, so they can customize
5833 magics that will do shell things for them, so they can customize
5829 IPython easily to match their work habits. If someone is really
5834 IPython easily to match their work habits. If someone is really
5830 desperate to have another name for a builtin alias, they can
5835 desperate to have another name for a builtin alias, they can
5831 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5836 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5832 works.
5837 works.
5833
5838
5834 2001-11-28 Fernando Perez <fperez@colorado.edu>
5839 2001-11-28 Fernando Perez <fperez@colorado.edu>
5835
5840
5836 * Changed @file so that it opens the source file at the proper
5841 * Changed @file so that it opens the source file at the proper
5837 line. Since it uses less, if your EDITOR environment is
5842 line. Since it uses less, if your EDITOR environment is
5838 configured, typing v will immediately open your editor of choice
5843 configured, typing v will immediately open your editor of choice
5839 right at the line where the object is defined. Not as quick as
5844 right at the line where the object is defined. Not as quick as
5840 having a direct @edit command, but for all intents and purposes it
5845 having a direct @edit command, but for all intents and purposes it
5841 works. And I don't have to worry about writing @edit to deal with
5846 works. And I don't have to worry about writing @edit to deal with
5842 all the editors, less does that.
5847 all the editors, less does that.
5843
5848
5844 * Version 0.1.16 released, 0.1.17 opened.
5849 * Version 0.1.16 released, 0.1.17 opened.
5845
5850
5846 * Fixed some nasty bugs in the page/page_dumb combo that could
5851 * Fixed some nasty bugs in the page/page_dumb combo that could
5847 crash IPython.
5852 crash IPython.
5848
5853
5849 2001-11-27 Fernando Perez <fperez@colorado.edu>
5854 2001-11-27 Fernando Perez <fperez@colorado.edu>
5850
5855
5851 * Version 0.1.15 released, 0.1.16 opened.
5856 * Version 0.1.15 released, 0.1.16 opened.
5852
5857
5853 * Finally got ? and ?? to work for undefined things: now it's
5858 * Finally got ? and ?? to work for undefined things: now it's
5854 possible to type {}.get? and get information about the get method
5859 possible to type {}.get? and get information about the get method
5855 of dicts, or os.path? even if only os is defined (so technically
5860 of dicts, or os.path? even if only os is defined (so technically
5856 os.path isn't). Works at any level. For example, after import os,
5861 os.path isn't). Works at any level. For example, after import os,
5857 os?, os.path?, os.path.abspath? all work. This is great, took some
5862 os?, os.path?, os.path.abspath? all work. This is great, took some
5858 work in _ofind.
5863 work in _ofind.
5859
5864
5860 * Fixed more bugs with logging. The sanest way to do it was to add
5865 * Fixed more bugs with logging. The sanest way to do it was to add
5861 to @log a 'mode' parameter. Killed two in one shot (this mode
5866 to @log a 'mode' parameter. Killed two in one shot (this mode
5862 option was a request of Janko's). I think it's finally clean
5867 option was a request of Janko's). I think it's finally clean
5863 (famous last words).
5868 (famous last words).
5864
5869
5865 * Added a page_dumb() pager which does a decent job of paging on
5870 * Added a page_dumb() pager which does a decent job of paging on
5866 screen, if better things (like less) aren't available. One less
5871 screen, if better things (like less) aren't available. One less
5867 unix dependency (someday maybe somebody will port this to
5872 unix dependency (someday maybe somebody will port this to
5868 windows).
5873 windows).
5869
5874
5870 * Fixed problem in magic_log: would lock of logging out if log
5875 * Fixed problem in magic_log: would lock of logging out if log
5871 creation failed (because it would still think it had succeeded).
5876 creation failed (because it would still think it had succeeded).
5872
5877
5873 * Improved the page() function using curses to auto-detect screen
5878 * Improved the page() function using curses to auto-detect screen
5874 size. Now it can make a much better decision on whether to print
5879 size. Now it can make a much better decision on whether to print
5875 or page a string. Option screen_length was modified: a value 0
5880 or page a string. Option screen_length was modified: a value 0
5876 means auto-detect, and that's the default now.
5881 means auto-detect, and that's the default now.
5877
5882
5878 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5883 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5879 go out. I'll test it for a few days, then talk to Janko about
5884 go out. I'll test it for a few days, then talk to Janko about
5880 licences and announce it.
5885 licences and announce it.
5881
5886
5882 * Fixed the length of the auto-generated ---> prompt which appears
5887 * Fixed the length of the auto-generated ---> prompt which appears
5883 for auto-parens and auto-quotes. Getting this right isn't trivial,
5888 for auto-parens and auto-quotes. Getting this right isn't trivial,
5884 with all the color escapes, different prompt types and optional
5889 with all the color escapes, different prompt types and optional
5885 separators. But it seems to be working in all the combinations.
5890 separators. But it seems to be working in all the combinations.
5886
5891
5887 2001-11-26 Fernando Perez <fperez@colorado.edu>
5892 2001-11-26 Fernando Perez <fperez@colorado.edu>
5888
5893
5889 * Wrote a regexp filter to get option types from the option names
5894 * Wrote a regexp filter to get option types from the option names
5890 string. This eliminates the need to manually keep two duplicate
5895 string. This eliminates the need to manually keep two duplicate
5891 lists.
5896 lists.
5892
5897
5893 * Removed the unneeded check_option_names. Now options are handled
5898 * Removed the unneeded check_option_names. Now options are handled
5894 in a much saner manner and it's easy to visually check that things
5899 in a much saner manner and it's easy to visually check that things
5895 are ok.
5900 are ok.
5896
5901
5897 * Updated version numbers on all files I modified to carry a
5902 * Updated version numbers on all files I modified to carry a
5898 notice so Janko and Nathan have clear version markers.
5903 notice so Janko and Nathan have clear version markers.
5899
5904
5900 * Updated docstring for ultraTB with my changes. I should send
5905 * Updated docstring for ultraTB with my changes. I should send
5901 this to Nathan.
5906 this to Nathan.
5902
5907
5903 * Lots of small fixes. Ran everything through pychecker again.
5908 * Lots of small fixes. Ran everything through pychecker again.
5904
5909
5905 * Made loading of deep_reload an cmd line option. If it's not too
5910 * Made loading of deep_reload an cmd line option. If it's not too
5906 kosher, now people can just disable it. With -nodeep_reload it's
5911 kosher, now people can just disable it. With -nodeep_reload it's
5907 still available as dreload(), it just won't overwrite reload().
5912 still available as dreload(), it just won't overwrite reload().
5908
5913
5909 * Moved many options to the no| form (-opt and -noopt
5914 * Moved many options to the no| form (-opt and -noopt
5910 accepted). Cleaner.
5915 accepted). Cleaner.
5911
5916
5912 * Changed magic_log so that if called with no parameters, it uses
5917 * Changed magic_log so that if called with no parameters, it uses
5913 'rotate' mode. That way auto-generated logs aren't automatically
5918 'rotate' mode. That way auto-generated logs aren't automatically
5914 over-written. For normal logs, now a backup is made if it exists
5919 over-written. For normal logs, now a backup is made if it exists
5915 (only 1 level of backups). A new 'backup' mode was added to the
5920 (only 1 level of backups). A new 'backup' mode was added to the
5916 Logger class to support this. This was a request by Janko.
5921 Logger class to support this. This was a request by Janko.
5917
5922
5918 * Added @logoff/@logon to stop/restart an active log.
5923 * Added @logoff/@logon to stop/restart an active log.
5919
5924
5920 * Fixed a lot of bugs in log saving/replay. It was pretty
5925 * Fixed a lot of bugs in log saving/replay. It was pretty
5921 broken. Now special lines (!@,/) appear properly in the command
5926 broken. Now special lines (!@,/) appear properly in the command
5922 history after a log replay.
5927 history after a log replay.
5923
5928
5924 * Tried and failed to implement full session saving via pickle. My
5929 * Tried and failed to implement full session saving via pickle. My
5925 idea was to pickle __main__.__dict__, but modules can't be
5930 idea was to pickle __main__.__dict__, but modules can't be
5926 pickled. This would be a better alternative to replaying logs, but
5931 pickled. This would be a better alternative to replaying logs, but
5927 seems quite tricky to get to work. Changed -session to be called
5932 seems quite tricky to get to work. Changed -session to be called
5928 -logplay, which more accurately reflects what it does. And if we
5933 -logplay, which more accurately reflects what it does. And if we
5929 ever get real session saving working, -session is now available.
5934 ever get real session saving working, -session is now available.
5930
5935
5931 * Implemented color schemes for prompts also. As for tracebacks,
5936 * Implemented color schemes for prompts also. As for tracebacks,
5932 currently only NoColor and Linux are supported. But now the
5937 currently only NoColor and Linux are supported. But now the
5933 infrastructure is in place, based on a generic ColorScheme
5938 infrastructure is in place, based on a generic ColorScheme
5934 class. So writing and activating new schemes both for the prompts
5939 class. So writing and activating new schemes both for the prompts
5935 and the tracebacks should be straightforward.
5940 and the tracebacks should be straightforward.
5936
5941
5937 * Version 0.1.13 released, 0.1.14 opened.
5942 * Version 0.1.13 released, 0.1.14 opened.
5938
5943
5939 * Changed handling of options for output cache. Now counter is
5944 * Changed handling of options for output cache. Now counter is
5940 hardwired starting at 1 and one specifies the maximum number of
5945 hardwired starting at 1 and one specifies the maximum number of
5941 entries *in the outcache* (not the max prompt counter). This is
5946 entries *in the outcache* (not the max prompt counter). This is
5942 much better, since many statements won't increase the cache
5947 much better, since many statements won't increase the cache
5943 count. It also eliminated some confusing options, now there's only
5948 count. It also eliminated some confusing options, now there's only
5944 one: cache_size.
5949 one: cache_size.
5945
5950
5946 * Added 'alias' magic function and magic_alias option in the
5951 * Added 'alias' magic function and magic_alias option in the
5947 ipythonrc file. Now the user can easily define whatever names he
5952 ipythonrc file. Now the user can easily define whatever names he
5948 wants for the magic functions without having to play weird
5953 wants for the magic functions without having to play weird
5949 namespace games. This gives IPython a real shell-like feel.
5954 namespace games. This gives IPython a real shell-like feel.
5950
5955
5951 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5956 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5952 @ or not).
5957 @ or not).
5953
5958
5954 This was one of the last remaining 'visible' bugs (that I know
5959 This was one of the last remaining 'visible' bugs (that I know
5955 of). I think if I can clean up the session loading so it works
5960 of). I think if I can clean up the session loading so it works
5956 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5961 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5957 about licensing).
5962 about licensing).
5958
5963
5959 2001-11-25 Fernando Perez <fperez@colorado.edu>
5964 2001-11-25 Fernando Perez <fperez@colorado.edu>
5960
5965
5961 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5966 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5962 there's a cleaner distinction between what ? and ?? show.
5967 there's a cleaner distinction between what ? and ?? show.
5963
5968
5964 * Added screen_length option. Now the user can define his own
5969 * Added screen_length option. Now the user can define his own
5965 screen size for page() operations.
5970 screen size for page() operations.
5966
5971
5967 * Implemented magic shell-like functions with automatic code
5972 * Implemented magic shell-like functions with automatic code
5968 generation. Now adding another function is just a matter of adding
5973 generation. Now adding another function is just a matter of adding
5969 an entry to a dict, and the function is dynamically generated at
5974 an entry to a dict, and the function is dynamically generated at
5970 run-time. Python has some really cool features!
5975 run-time. Python has some really cool features!
5971
5976
5972 * Renamed many options to cleanup conventions a little. Now all
5977 * Renamed many options to cleanup conventions a little. Now all
5973 are lowercase, and only underscores where needed. Also in the code
5978 are lowercase, and only underscores where needed. Also in the code
5974 option name tables are clearer.
5979 option name tables are clearer.
5975
5980
5976 * Changed prompts a little. Now input is 'In [n]:' instead of
5981 * Changed prompts a little. Now input is 'In [n]:' instead of
5977 'In[n]:='. This allows it the numbers to be aligned with the
5982 'In[n]:='. This allows it the numbers to be aligned with the
5978 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5983 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5979 Python (it was a Mathematica thing). The '...' continuation prompt
5984 Python (it was a Mathematica thing). The '...' continuation prompt
5980 was also changed a little to align better.
5985 was also changed a little to align better.
5981
5986
5982 * Fixed bug when flushing output cache. Not all _p<n> variables
5987 * Fixed bug when flushing output cache. Not all _p<n> variables
5983 exist, so their deletion needs to be wrapped in a try:
5988 exist, so their deletion needs to be wrapped in a try:
5984
5989
5985 * Figured out how to properly use inspect.formatargspec() (it
5990 * Figured out how to properly use inspect.formatargspec() (it
5986 requires the args preceded by *). So I removed all the code from
5991 requires the args preceded by *). So I removed all the code from
5987 _get_pdef in Magic, which was just replicating that.
5992 _get_pdef in Magic, which was just replicating that.
5988
5993
5989 * Added test to prefilter to allow redefining magic function names
5994 * Added test to prefilter to allow redefining magic function names
5990 as variables. This is ok, since the @ form is always available,
5995 as variables. This is ok, since the @ form is always available,
5991 but whe should allow the user to define a variable called 'ls' if
5996 but whe should allow the user to define a variable called 'ls' if
5992 he needs it.
5997 he needs it.
5993
5998
5994 * Moved the ToDo information from README into a separate ToDo.
5999 * Moved the ToDo information from README into a separate ToDo.
5995
6000
5996 * General code cleanup and small bugfixes. I think it's close to a
6001 * General code cleanup and small bugfixes. I think it's close to a
5997 state where it can be released, obviously with a big 'beta'
6002 state where it can be released, obviously with a big 'beta'
5998 warning on it.
6003 warning on it.
5999
6004
6000 * Got the magic function split to work. Now all magics are defined
6005 * Got the magic function split to work. Now all magics are defined
6001 in a separate class. It just organizes things a bit, and now
6006 in a separate class. It just organizes things a bit, and now
6002 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6007 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6003 was too long).
6008 was too long).
6004
6009
6005 * Changed @clear to @reset to avoid potential confusions with
6010 * Changed @clear to @reset to avoid potential confusions with
6006 the shell command clear. Also renamed @cl to @clear, which does
6011 the shell command clear. Also renamed @cl to @clear, which does
6007 exactly what people expect it to from their shell experience.
6012 exactly what people expect it to from their shell experience.
6008
6013
6009 Added a check to the @reset command (since it's so
6014 Added a check to the @reset command (since it's so
6010 destructive, it's probably a good idea to ask for confirmation).
6015 destructive, it's probably a good idea to ask for confirmation).
6011 But now reset only works for full namespace resetting. Since the
6016 But now reset only works for full namespace resetting. Since the
6012 del keyword is already there for deleting a few specific
6017 del keyword is already there for deleting a few specific
6013 variables, I don't see the point of having a redundant magic
6018 variables, I don't see the point of having a redundant magic
6014 function for the same task.
6019 function for the same task.
6015
6020
6016 2001-11-24 Fernando Perez <fperez@colorado.edu>
6021 2001-11-24 Fernando Perez <fperez@colorado.edu>
6017
6022
6018 * Updated the builtin docs (esp. the ? ones).
6023 * Updated the builtin docs (esp. the ? ones).
6019
6024
6020 * Ran all the code through pychecker. Not terribly impressed with
6025 * Ran all the code through pychecker. Not terribly impressed with
6021 it: lots of spurious warnings and didn't really find anything of
6026 it: lots of spurious warnings and didn't really find anything of
6022 substance (just a few modules being imported and not used).
6027 substance (just a few modules being imported and not used).
6023
6028
6024 * Implemented the new ultraTB functionality into IPython. New
6029 * Implemented the new ultraTB functionality into IPython. New
6025 option: xcolors. This chooses color scheme. xmode now only selects
6030 option: xcolors. This chooses color scheme. xmode now only selects
6026 between Plain and Verbose. Better orthogonality.
6031 between Plain and Verbose. Better orthogonality.
6027
6032
6028 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6033 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6029 mode and color scheme for the exception handlers. Now it's
6034 mode and color scheme for the exception handlers. Now it's
6030 possible to have the verbose traceback with no coloring.
6035 possible to have the verbose traceback with no coloring.
6031
6036
6032 2001-11-23 Fernando Perez <fperez@colorado.edu>
6037 2001-11-23 Fernando Perez <fperez@colorado.edu>
6033
6038
6034 * Version 0.1.12 released, 0.1.13 opened.
6039 * Version 0.1.12 released, 0.1.13 opened.
6035
6040
6036 * Removed option to set auto-quote and auto-paren escapes by
6041 * Removed option to set auto-quote and auto-paren escapes by
6037 user. The chances of breaking valid syntax are just too high. If
6042 user. The chances of breaking valid syntax are just too high. If
6038 someone *really* wants, they can always dig into the code.
6043 someone *really* wants, they can always dig into the code.
6039
6044
6040 * Made prompt separators configurable.
6045 * Made prompt separators configurable.
6041
6046
6042 2001-11-22 Fernando Perez <fperez@colorado.edu>
6047 2001-11-22 Fernando Perez <fperez@colorado.edu>
6043
6048
6044 * Small bugfixes in many places.
6049 * Small bugfixes in many places.
6045
6050
6046 * Removed the MyCompleter class from ipplib. It seemed redundant
6051 * Removed the MyCompleter class from ipplib. It seemed redundant
6047 with the C-p,C-n history search functionality. Less code to
6052 with the C-p,C-n history search functionality. Less code to
6048 maintain.
6053 maintain.
6049
6054
6050 * Moved all the original ipython.py code into ipythonlib.py. Right
6055 * Moved all the original ipython.py code into ipythonlib.py. Right
6051 now it's just one big dump into a function called make_IPython, so
6056 now it's just one big dump into a function called make_IPython, so
6052 no real modularity has been gained. But at least it makes the
6057 no real modularity has been gained. But at least it makes the
6053 wrapper script tiny, and since ipythonlib is a module, it gets
6058 wrapper script tiny, and since ipythonlib is a module, it gets
6054 compiled and startup is much faster.
6059 compiled and startup is much faster.
6055
6060
6056 This is a reasobably 'deep' change, so we should test it for a
6061 This is a reasobably 'deep' change, so we should test it for a
6057 while without messing too much more with the code.
6062 while without messing too much more with the code.
6058
6063
6059 2001-11-21 Fernando Perez <fperez@colorado.edu>
6064 2001-11-21 Fernando Perez <fperez@colorado.edu>
6060
6065
6061 * Version 0.1.11 released, 0.1.12 opened for further work.
6066 * Version 0.1.11 released, 0.1.12 opened for further work.
6062
6067
6063 * Removed dependency on Itpl. It was only needed in one place. It
6068 * Removed dependency on Itpl. It was only needed in one place. It
6064 would be nice if this became part of python, though. It makes life
6069 would be nice if this became part of python, though. It makes life
6065 *a lot* easier in some cases.
6070 *a lot* easier in some cases.
6066
6071
6067 * Simplified the prefilter code a bit. Now all handlers are
6072 * Simplified the prefilter code a bit. Now all handlers are
6068 expected to explicitly return a value (at least a blank string).
6073 expected to explicitly return a value (at least a blank string).
6069
6074
6070 * Heavy edits in ipplib. Removed the help system altogether. Now
6075 * Heavy edits in ipplib. Removed the help system altogether. Now
6071 obj?/?? is used for inspecting objects, a magic @doc prints
6076 obj?/?? is used for inspecting objects, a magic @doc prints
6072 docstrings, and full-blown Python help is accessed via the 'help'
6077 docstrings, and full-blown Python help is accessed via the 'help'
6073 keyword. This cleans up a lot of code (less to maintain) and does
6078 keyword. This cleans up a lot of code (less to maintain) and does
6074 the job. Since 'help' is now a standard Python component, might as
6079 the job. Since 'help' is now a standard Python component, might as
6075 well use it and remove duplicate functionality.
6080 well use it and remove duplicate functionality.
6076
6081
6077 Also removed the option to use ipplib as a standalone program. By
6082 Also removed the option to use ipplib as a standalone program. By
6078 now it's too dependent on other parts of IPython to function alone.
6083 now it's too dependent on other parts of IPython to function alone.
6079
6084
6080 * Fixed bug in genutils.pager. It would crash if the pager was
6085 * Fixed bug in genutils.pager. It would crash if the pager was
6081 exited immediately after opening (broken pipe).
6086 exited immediately after opening (broken pipe).
6082
6087
6083 * Trimmed down the VerboseTB reporting a little. The header is
6088 * Trimmed down the VerboseTB reporting a little. The header is
6084 much shorter now and the repeated exception arguments at the end
6089 much shorter now and the repeated exception arguments at the end
6085 have been removed. For interactive use the old header seemed a bit
6090 have been removed. For interactive use the old header seemed a bit
6086 excessive.
6091 excessive.
6087
6092
6088 * Fixed small bug in output of @whos for variables with multi-word
6093 * Fixed small bug in output of @whos for variables with multi-word
6089 types (only first word was displayed).
6094 types (only first word was displayed).
6090
6095
6091 2001-11-17 Fernando Perez <fperez@colorado.edu>
6096 2001-11-17 Fernando Perez <fperez@colorado.edu>
6092
6097
6093 * Version 0.1.10 released, 0.1.11 opened for further work.
6098 * Version 0.1.10 released, 0.1.11 opened for further work.
6094
6099
6095 * Modified dirs and friends. dirs now *returns* the stack (not
6100 * Modified dirs and friends. dirs now *returns* the stack (not
6096 prints), so one can manipulate it as a variable. Convenient to
6101 prints), so one can manipulate it as a variable. Convenient to
6097 travel along many directories.
6102 travel along many directories.
6098
6103
6099 * Fixed bug in magic_pdef: would only work with functions with
6104 * Fixed bug in magic_pdef: would only work with functions with
6100 arguments with default values.
6105 arguments with default values.
6101
6106
6102 2001-11-14 Fernando Perez <fperez@colorado.edu>
6107 2001-11-14 Fernando Perez <fperez@colorado.edu>
6103
6108
6104 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6109 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6105 example with IPython. Various other minor fixes and cleanups.
6110 example with IPython. Various other minor fixes and cleanups.
6106
6111
6107 * Version 0.1.9 released, 0.1.10 opened for further work.
6112 * Version 0.1.9 released, 0.1.10 opened for further work.
6108
6113
6109 * Added sys.path to the list of directories searched in the
6114 * Added sys.path to the list of directories searched in the
6110 execfile= option. It used to be the current directory and the
6115 execfile= option. It used to be the current directory and the
6111 user's IPYTHONDIR only.
6116 user's IPYTHONDIR only.
6112
6117
6113 2001-11-13 Fernando Perez <fperez@colorado.edu>
6118 2001-11-13 Fernando Perez <fperez@colorado.edu>
6114
6119
6115 * Reinstated the raw_input/prefilter separation that Janko had
6120 * Reinstated the raw_input/prefilter separation that Janko had
6116 initially. This gives a more convenient setup for extending the
6121 initially. This gives a more convenient setup for extending the
6117 pre-processor from the outside: raw_input always gets a string,
6122 pre-processor from the outside: raw_input always gets a string,
6118 and prefilter has to process it. We can then redefine prefilter
6123 and prefilter has to process it. We can then redefine prefilter
6119 from the outside and implement extensions for special
6124 from the outside and implement extensions for special
6120 purposes.
6125 purposes.
6121
6126
6122 Today I got one for inputting PhysicalQuantity objects
6127 Today I got one for inputting PhysicalQuantity objects
6123 (from Scientific) without needing any function calls at
6128 (from Scientific) without needing any function calls at
6124 all. Extremely convenient, and it's all done as a user-level
6129 all. Extremely convenient, and it's all done as a user-level
6125 extension (no IPython code was touched). Now instead of:
6130 extension (no IPython code was touched). Now instead of:
6126 a = PhysicalQuantity(4.2,'m/s**2')
6131 a = PhysicalQuantity(4.2,'m/s**2')
6127 one can simply say
6132 one can simply say
6128 a = 4.2 m/s**2
6133 a = 4.2 m/s**2
6129 or even
6134 or even
6130 a = 4.2 m/s^2
6135 a = 4.2 m/s^2
6131
6136
6132 I use this, but it's also a proof of concept: IPython really is
6137 I use this, but it's also a proof of concept: IPython really is
6133 fully user-extensible, even at the level of the parsing of the
6138 fully user-extensible, even at the level of the parsing of the
6134 command line. It's not trivial, but it's perfectly doable.
6139 command line. It's not trivial, but it's perfectly doable.
6135
6140
6136 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6141 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6137 the problem of modules being loaded in the inverse order in which
6142 the problem of modules being loaded in the inverse order in which
6138 they were defined in
6143 they were defined in
6139
6144
6140 * Version 0.1.8 released, 0.1.9 opened for further work.
6145 * Version 0.1.8 released, 0.1.9 opened for further work.
6141
6146
6142 * Added magics pdef, source and file. They respectively show the
6147 * Added magics pdef, source and file. They respectively show the
6143 definition line ('prototype' in C), source code and full python
6148 definition line ('prototype' in C), source code and full python
6144 file for any callable object. The object inspector oinfo uses
6149 file for any callable object. The object inspector oinfo uses
6145 these to show the same information.
6150 these to show the same information.
6146
6151
6147 * Version 0.1.7 released, 0.1.8 opened for further work.
6152 * Version 0.1.7 released, 0.1.8 opened for further work.
6148
6153
6149 * Separated all the magic functions into a class called Magic. The
6154 * Separated all the magic functions into a class called Magic. The
6150 InteractiveShell class was becoming too big for Xemacs to handle
6155 InteractiveShell class was becoming too big for Xemacs to handle
6151 (de-indenting a line would lock it up for 10 seconds while it
6156 (de-indenting a line would lock it up for 10 seconds while it
6152 backtracked on the whole class!)
6157 backtracked on the whole class!)
6153
6158
6154 FIXME: didn't work. It can be done, but right now namespaces are
6159 FIXME: didn't work. It can be done, but right now namespaces are
6155 all messed up. Do it later (reverted it for now, so at least
6160 all messed up. Do it later (reverted it for now, so at least
6156 everything works as before).
6161 everything works as before).
6157
6162
6158 * Got the object introspection system (magic_oinfo) working! I
6163 * Got the object introspection system (magic_oinfo) working! I
6159 think this is pretty much ready for release to Janko, so he can
6164 think this is pretty much ready for release to Janko, so he can
6160 test it for a while and then announce it. Pretty much 100% of what
6165 test it for a while and then announce it. Pretty much 100% of what
6161 I wanted for the 'phase 1' release is ready. Happy, tired.
6166 I wanted for the 'phase 1' release is ready. Happy, tired.
6162
6167
6163 2001-11-12 Fernando Perez <fperez@colorado.edu>
6168 2001-11-12 Fernando Perez <fperez@colorado.edu>
6164
6169
6165 * Version 0.1.6 released, 0.1.7 opened for further work.
6170 * Version 0.1.6 released, 0.1.7 opened for further work.
6166
6171
6167 * Fixed bug in printing: it used to test for truth before
6172 * Fixed bug in printing: it used to test for truth before
6168 printing, so 0 wouldn't print. Now checks for None.
6173 printing, so 0 wouldn't print. Now checks for None.
6169
6174
6170 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6175 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6171 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6176 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6172 reaches by hand into the outputcache. Think of a better way to do
6177 reaches by hand into the outputcache. Think of a better way to do
6173 this later.
6178 this later.
6174
6179
6175 * Various small fixes thanks to Nathan's comments.
6180 * Various small fixes thanks to Nathan's comments.
6176
6181
6177 * Changed magic_pprint to magic_Pprint. This way it doesn't
6182 * Changed magic_pprint to magic_Pprint. This way it doesn't
6178 collide with pprint() and the name is consistent with the command
6183 collide with pprint() and the name is consistent with the command
6179 line option.
6184 line option.
6180
6185
6181 * Changed prompt counter behavior to be fully like
6186 * Changed prompt counter behavior to be fully like
6182 Mathematica's. That is, even input that doesn't return a result
6187 Mathematica's. That is, even input that doesn't return a result
6183 raises the prompt counter. The old behavior was kind of confusing
6188 raises the prompt counter. The old behavior was kind of confusing
6184 (getting the same prompt number several times if the operation
6189 (getting the same prompt number several times if the operation
6185 didn't return a result).
6190 didn't return a result).
6186
6191
6187 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6192 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6188
6193
6189 * Fixed -Classic mode (wasn't working anymore).
6194 * Fixed -Classic mode (wasn't working anymore).
6190
6195
6191 * Added colored prompts using Nathan's new code. Colors are
6196 * Added colored prompts using Nathan's new code. Colors are
6192 currently hardwired, they can be user-configurable. For
6197 currently hardwired, they can be user-configurable. For
6193 developers, they can be chosen in file ipythonlib.py, at the
6198 developers, they can be chosen in file ipythonlib.py, at the
6194 beginning of the CachedOutput class def.
6199 beginning of the CachedOutput class def.
6195
6200
6196 2001-11-11 Fernando Perez <fperez@colorado.edu>
6201 2001-11-11 Fernando Perez <fperez@colorado.edu>
6197
6202
6198 * Version 0.1.5 released, 0.1.6 opened for further work.
6203 * Version 0.1.5 released, 0.1.6 opened for further work.
6199
6204
6200 * Changed magic_env to *return* the environment as a dict (not to
6205 * Changed magic_env to *return* the environment as a dict (not to
6201 print it). This way it prints, but it can also be processed.
6206 print it). This way it prints, but it can also be processed.
6202
6207
6203 * Added Verbose exception reporting to interactive
6208 * Added Verbose exception reporting to interactive
6204 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6209 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6205 traceback. Had to make some changes to the ultraTB file. This is
6210 traceback. Had to make some changes to the ultraTB file. This is
6206 probably the last 'big' thing in my mental todo list. This ties
6211 probably the last 'big' thing in my mental todo list. This ties
6207 in with the next entry:
6212 in with the next entry:
6208
6213
6209 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6214 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6210 has to specify is Plain, Color or Verbose for all exception
6215 has to specify is Plain, Color or Verbose for all exception
6211 handling.
6216 handling.
6212
6217
6213 * Removed ShellServices option. All this can really be done via
6218 * Removed ShellServices option. All this can really be done via
6214 the magic system. It's easier to extend, cleaner and has automatic
6219 the magic system. It's easier to extend, cleaner and has automatic
6215 namespace protection and documentation.
6220 namespace protection and documentation.
6216
6221
6217 2001-11-09 Fernando Perez <fperez@colorado.edu>
6222 2001-11-09 Fernando Perez <fperez@colorado.edu>
6218
6223
6219 * Fixed bug in output cache flushing (missing parameter to
6224 * Fixed bug in output cache flushing (missing parameter to
6220 __init__). Other small bugs fixed (found using pychecker).
6225 __init__). Other small bugs fixed (found using pychecker).
6221
6226
6222 * Version 0.1.4 opened for bugfixing.
6227 * Version 0.1.4 opened for bugfixing.
6223
6228
6224 2001-11-07 Fernando Perez <fperez@colorado.edu>
6229 2001-11-07 Fernando Perez <fperez@colorado.edu>
6225
6230
6226 * Version 0.1.3 released, mainly because of the raw_input bug.
6231 * Version 0.1.3 released, mainly because of the raw_input bug.
6227
6232
6228 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6233 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6229 and when testing for whether things were callable, a call could
6234 and when testing for whether things were callable, a call could
6230 actually be made to certain functions. They would get called again
6235 actually be made to certain functions. They would get called again
6231 once 'really' executed, with a resulting double call. A disaster
6236 once 'really' executed, with a resulting double call. A disaster
6232 in many cases (list.reverse() would never work!).
6237 in many cases (list.reverse() would never work!).
6233
6238
6234 * Removed prefilter() function, moved its code to raw_input (which
6239 * Removed prefilter() function, moved its code to raw_input (which
6235 after all was just a near-empty caller for prefilter). This saves
6240 after all was just a near-empty caller for prefilter). This saves
6236 a function call on every prompt, and simplifies the class a tiny bit.
6241 a function call on every prompt, and simplifies the class a tiny bit.
6237
6242
6238 * Fix _ip to __ip name in magic example file.
6243 * Fix _ip to __ip name in magic example file.
6239
6244
6240 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6245 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6241 work with non-gnu versions of tar.
6246 work with non-gnu versions of tar.
6242
6247
6243 2001-11-06 Fernando Perez <fperez@colorado.edu>
6248 2001-11-06 Fernando Perez <fperez@colorado.edu>
6244
6249
6245 * Version 0.1.2. Just to keep track of the recent changes.
6250 * Version 0.1.2. Just to keep track of the recent changes.
6246
6251
6247 * Fixed nasty bug in output prompt routine. It used to check 'if
6252 * Fixed nasty bug in output prompt routine. It used to check 'if
6248 arg != None...'. Problem is, this fails if arg implements a
6253 arg != None...'. Problem is, this fails if arg implements a
6249 special comparison (__cmp__) which disallows comparing to
6254 special comparison (__cmp__) which disallows comparing to
6250 None. Found it when trying to use the PhysicalQuantity module from
6255 None. Found it when trying to use the PhysicalQuantity module from
6251 ScientificPython.
6256 ScientificPython.
6252
6257
6253 2001-11-05 Fernando Perez <fperez@colorado.edu>
6258 2001-11-05 Fernando Perez <fperez@colorado.edu>
6254
6259
6255 * Also added dirs. Now the pushd/popd/dirs family functions
6260 * Also added dirs. Now the pushd/popd/dirs family functions
6256 basically like the shell, with the added convenience of going home
6261 basically like the shell, with the added convenience of going home
6257 when called with no args.
6262 when called with no args.
6258
6263
6259 * pushd/popd slightly modified to mimic shell behavior more
6264 * pushd/popd slightly modified to mimic shell behavior more
6260 closely.
6265 closely.
6261
6266
6262 * Added env,pushd,popd from ShellServices as magic functions. I
6267 * Added env,pushd,popd from ShellServices as magic functions. I
6263 think the cleanest will be to port all desired functions from
6268 think the cleanest will be to port all desired functions from
6264 ShellServices as magics and remove ShellServices altogether. This
6269 ShellServices as magics and remove ShellServices altogether. This
6265 will provide a single, clean way of adding functionality
6270 will provide a single, clean way of adding functionality
6266 (shell-type or otherwise) to IP.
6271 (shell-type or otherwise) to IP.
6267
6272
6268 2001-11-04 Fernando Perez <fperez@colorado.edu>
6273 2001-11-04 Fernando Perez <fperez@colorado.edu>
6269
6274
6270 * Added .ipython/ directory to sys.path. This way users can keep
6275 * Added .ipython/ directory to sys.path. This way users can keep
6271 customizations there and access them via import.
6276 customizations there and access them via import.
6272
6277
6273 2001-11-03 Fernando Perez <fperez@colorado.edu>
6278 2001-11-03 Fernando Perez <fperez@colorado.edu>
6274
6279
6275 * Opened version 0.1.1 for new changes.
6280 * Opened version 0.1.1 for new changes.
6276
6281
6277 * Changed version number to 0.1.0: first 'public' release, sent to
6282 * Changed version number to 0.1.0: first 'public' release, sent to
6278 Nathan and Janko.
6283 Nathan and Janko.
6279
6284
6280 * Lots of small fixes and tweaks.
6285 * Lots of small fixes and tweaks.
6281
6286
6282 * Minor changes to whos format. Now strings are shown, snipped if
6287 * Minor changes to whos format. Now strings are shown, snipped if
6283 too long.
6288 too long.
6284
6289
6285 * Changed ShellServices to work on __main__ so they show up in @who
6290 * Changed ShellServices to work on __main__ so they show up in @who
6286
6291
6287 * Help also works with ? at the end of a line:
6292 * Help also works with ? at the end of a line:
6288 ?sin and sin?
6293 ?sin and sin?
6289 both produce the same effect. This is nice, as often I use the
6294 both produce the same effect. This is nice, as often I use the
6290 tab-complete to find the name of a method, but I used to then have
6295 tab-complete to find the name of a method, but I used to then have
6291 to go to the beginning of the line to put a ? if I wanted more
6296 to go to the beginning of the line to put a ? if I wanted more
6292 info. Now I can just add the ? and hit return. Convenient.
6297 info. Now I can just add the ? and hit return. Convenient.
6293
6298
6294 2001-11-02 Fernando Perez <fperez@colorado.edu>
6299 2001-11-02 Fernando Perez <fperez@colorado.edu>
6295
6300
6296 * Python version check (>=2.1) added.
6301 * Python version check (>=2.1) added.
6297
6302
6298 * Added LazyPython documentation. At this point the docs are quite
6303 * Added LazyPython documentation. At this point the docs are quite
6299 a mess. A cleanup is in order.
6304 a mess. A cleanup is in order.
6300
6305
6301 * Auto-installer created. For some bizarre reason, the zipfiles
6306 * Auto-installer created. For some bizarre reason, the zipfiles
6302 module isn't working on my system. So I made a tar version
6307 module isn't working on my system. So I made a tar version
6303 (hopefully the command line options in various systems won't kill
6308 (hopefully the command line options in various systems won't kill
6304 me).
6309 me).
6305
6310
6306 * Fixes to Struct in genutils. Now all dictionary-like methods are
6311 * Fixes to Struct in genutils. Now all dictionary-like methods are
6307 protected (reasonably).
6312 protected (reasonably).
6308
6313
6309 * Added pager function to genutils and changed ? to print usage
6314 * Added pager function to genutils and changed ? to print usage
6310 note through it (it was too long).
6315 note through it (it was too long).
6311
6316
6312 * Added the LazyPython functionality. Works great! I changed the
6317 * Added the LazyPython functionality. Works great! I changed the
6313 auto-quote escape to ';', it's on home row and next to '. But
6318 auto-quote escape to ';', it's on home row and next to '. But
6314 both auto-quote and auto-paren (still /) escapes are command-line
6319 both auto-quote and auto-paren (still /) escapes are command-line
6315 parameters.
6320 parameters.
6316
6321
6317
6322
6318 2001-11-01 Fernando Perez <fperez@colorado.edu>
6323 2001-11-01 Fernando Perez <fperez@colorado.edu>
6319
6324
6320 * Version changed to 0.0.7. Fairly large change: configuration now
6325 * Version changed to 0.0.7. Fairly large change: configuration now
6321 is all stored in a directory, by default .ipython. There, all
6326 is all stored in a directory, by default .ipython. There, all
6322 config files have normal looking names (not .names)
6327 config files have normal looking names (not .names)
6323
6328
6324 * Version 0.0.6 Released first to Lucas and Archie as a test
6329 * Version 0.0.6 Released first to Lucas and Archie as a test
6325 run. Since it's the first 'semi-public' release, change version to
6330 run. Since it's the first 'semi-public' release, change version to
6326 > 0.0.6 for any changes now.
6331 > 0.0.6 for any changes now.
6327
6332
6328 * Stuff I had put in the ipplib.py changelog:
6333 * Stuff I had put in the ipplib.py changelog:
6329
6334
6330 Changes to InteractiveShell:
6335 Changes to InteractiveShell:
6331
6336
6332 - Made the usage message a parameter.
6337 - Made the usage message a parameter.
6333
6338
6334 - Require the name of the shell variable to be given. It's a bit
6339 - Require the name of the shell variable to be given. It's a bit
6335 of a hack, but allows the name 'shell' not to be hardwired in the
6340 of a hack, but allows the name 'shell' not to be hardwired in the
6336 magic (@) handler, which is problematic b/c it requires
6341 magic (@) handler, which is problematic b/c it requires
6337 polluting the global namespace with 'shell'. This in turn is
6342 polluting the global namespace with 'shell'. This in turn is
6338 fragile: if a user redefines a variable called shell, things
6343 fragile: if a user redefines a variable called shell, things
6339 break.
6344 break.
6340
6345
6341 - magic @: all functions available through @ need to be defined
6346 - magic @: all functions available through @ need to be defined
6342 as magic_<name>, even though they can be called simply as
6347 as magic_<name>, even though they can be called simply as
6343 @<name>. This allows the special command @magic to gather
6348 @<name>. This allows the special command @magic to gather
6344 information automatically about all existing magic functions,
6349 information automatically about all existing magic functions,
6345 even if they are run-time user extensions, by parsing the shell
6350 even if they are run-time user extensions, by parsing the shell
6346 instance __dict__ looking for special magic_ names.
6351 instance __dict__ looking for special magic_ names.
6347
6352
6348 - mainloop: added *two* local namespace parameters. This allows
6353 - mainloop: added *two* local namespace parameters. This allows
6349 the class to differentiate between parameters which were there
6354 the class to differentiate between parameters which were there
6350 before and after command line initialization was processed. This
6355 before and after command line initialization was processed. This
6351 way, later @who can show things loaded at startup by the
6356 way, later @who can show things loaded at startup by the
6352 user. This trick was necessary to make session saving/reloading
6357 user. This trick was necessary to make session saving/reloading
6353 really work: ideally after saving/exiting/reloading a session,
6358 really work: ideally after saving/exiting/reloading a session,
6354 *everything* should look the same, including the output of @who. I
6359 *everything* should look the same, including the output of @who. I
6355 was only able to make this work with this double namespace
6360 was only able to make this work with this double namespace
6356 trick.
6361 trick.
6357
6362
6358 - added a header to the logfile which allows (almost) full
6363 - added a header to the logfile which allows (almost) full
6359 session restoring.
6364 session restoring.
6360
6365
6361 - prepend lines beginning with @ or !, with a and log
6366 - prepend lines beginning with @ or !, with a and log
6362 them. Why? !lines: may be useful to know what you did @lines:
6367 them. Why? !lines: may be useful to know what you did @lines:
6363 they may affect session state. So when restoring a session, at
6368 they may affect session state. So when restoring a session, at
6364 least inform the user of their presence. I couldn't quite get
6369 least inform the user of their presence. I couldn't quite get
6365 them to properly re-execute, but at least the user is warned.
6370 them to properly re-execute, but at least the user is warned.
6366
6371
6367 * Started ChangeLog.
6372 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now