##// END OF EJS Templates
fix !command /?. Closes \#52
vivainio -
Show More
@@ -1,2578 +1,2578 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 2172 2007-03-23 14:04:07Z vivainio $
9 $Id: iplib.py 2173 2007-03-23 14:26:16Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import 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 self.shell_line_split = re.compile(r'^(\s*)'
494 self.shell_line_split = re.compile(r'^(\s*)'
495 r'(\S*\s*)'
495 r'(\S*\s*)'
496 r'(\(?.*$)')
496 r'(\(?.*$)')
497
497
498
498
499 # A simpler regexp used as a fallback if the above doesn't work. This
499 # A simpler regexp used as a fallback if the above doesn't work. This
500 # one is more conservative in how it partitions the input. This code
500 # one is more conservative in how it partitions the input. This code
501 # can probably be cleaned up to do everything with just one regexp, but
501 # can probably be cleaned up to do everything with just one regexp, but
502 # I'm afraid of breaking something; do it once the unit tests are in
502 # I'm afraid of breaking something; do it once the unit tests are in
503 # place.
503 # place.
504 self.line_split_fallback = re.compile(r'^(\s*)'
504 self.line_split_fallback = re.compile(r'^(\s*)'
505 r'([%\!\?\w\.]*)'
505 r'([%\!\?\w\.]*)'
506 r'(.*)')
506 r'(.*)')
507
507
508 # Original re, keep around for a while in case changes break something
508 # Original re, keep around for a while in case changes break something
509 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
509 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
510 # r'(\s*[\?\w\.]+\w*\s*)'
510 # r'(\s*[\?\w\.]+\w*\s*)'
511 # r'(\(?.*$)')
511 # r'(\(?.*$)')
512
512
513 # RegExp to identify potential function names
513 # RegExp to identify potential function names
514 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
514 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
515
515
516 # RegExp to exclude strings with this start from autocalling. In
516 # RegExp to exclude strings with this start from autocalling. In
517 # particular, all binary operators should be excluded, so that if foo
517 # particular, all binary operators should be excluded, so that if foo
518 # is callable, foo OP bar doesn't become foo(OP bar), which is
518 # is callable, foo OP bar doesn't become foo(OP bar), which is
519 # invalid. The characters '!=()' don't need to be checked for, as the
519 # invalid. The characters '!=()' don't need to be checked for, as the
520 # _prefilter routine explicitely does so, to catch direct calls and
520 # _prefilter routine explicitely does so, to catch direct calls and
521 # rebindings of existing names.
521 # rebindings of existing names.
522
522
523 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
523 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
524 # it affects the rest of the group in square brackets.
524 # it affects the rest of the group in square brackets.
525 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
525 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
526 '|^is |^not |^in |^and |^or ')
526 '|^is |^not |^in |^and |^or ')
527
527
528 # try to catch also methods for stuff in lists/tuples/dicts: off
528 # try to catch also methods for stuff in lists/tuples/dicts: off
529 # (experimental). For this to work, the line_split regexp would need
529 # (experimental). For this to work, the line_split regexp would need
530 # to be modified so it wouldn't break things at '['. That line is
530 # to be modified so it wouldn't break things at '['. That line is
531 # nasty enough that I shouldn't change it until I can test it _well_.
531 # nasty enough that I shouldn't change it until I can test it _well_.
532 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
532 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
533
533
534 # keep track of where we started running (mainly for crash post-mortem)
534 # keep track of where we started running (mainly for crash post-mortem)
535 self.starting_dir = os.getcwd()
535 self.starting_dir = os.getcwd()
536
536
537 # Various switches which can be set
537 # Various switches which can be set
538 self.CACHELENGTH = 5000 # this is cheap, it's just text
538 self.CACHELENGTH = 5000 # this is cheap, it's just text
539 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
539 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
540 self.banner2 = banner2
540 self.banner2 = banner2
541
541
542 # TraceBack handlers:
542 # TraceBack handlers:
543
543
544 # Syntax error handler.
544 # Syntax error handler.
545 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
545 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
546
546
547 # The interactive one is initialized with an offset, meaning we always
547 # The interactive one is initialized with an offset, meaning we always
548 # want to remove the topmost item in the traceback, which is our own
548 # want to remove the topmost item in the traceback, which is our own
549 # internal code. Valid modes: ['Plain','Context','Verbose']
549 # internal code. Valid modes: ['Plain','Context','Verbose']
550 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
550 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
551 color_scheme='NoColor',
551 color_scheme='NoColor',
552 tb_offset = 1)
552 tb_offset = 1)
553
553
554 # IPython itself shouldn't crash. This will produce a detailed
554 # IPython itself shouldn't crash. This will produce a detailed
555 # post-mortem if it does. But we only install the crash handler for
555 # post-mortem if it does. But we only install the crash handler for
556 # non-threaded shells, the threaded ones use a normal verbose reporter
556 # non-threaded shells, the threaded ones use a normal verbose reporter
557 # and lose the crash handler. This is because exceptions in the main
557 # and lose the crash handler. This is because exceptions in the main
558 # thread (such as in GUI code) propagate directly to sys.excepthook,
558 # thread (such as in GUI code) propagate directly to sys.excepthook,
559 # and there's no point in printing crash dumps for every user exception.
559 # and there's no point in printing crash dumps for every user exception.
560 if self.isthreaded:
560 if self.isthreaded:
561 ipCrashHandler = ultraTB.FormattedTB()
561 ipCrashHandler = ultraTB.FormattedTB()
562 else:
562 else:
563 from IPython import CrashHandler
563 from IPython import CrashHandler
564 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
564 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
565 self.set_crash_handler(ipCrashHandler)
565 self.set_crash_handler(ipCrashHandler)
566
566
567 # and add any custom exception handlers the user may have specified
567 # and add any custom exception handlers the user may have specified
568 self.set_custom_exc(*custom_exceptions)
568 self.set_custom_exc(*custom_exceptions)
569
569
570 # indentation management
570 # indentation management
571 self.autoindent = False
571 self.autoindent = False
572 self.indent_current_nsp = 0
572 self.indent_current_nsp = 0
573
573
574 # Make some aliases automatically
574 # Make some aliases automatically
575 # Prepare list of shell aliases to auto-define
575 # Prepare list of shell aliases to auto-define
576 if os.name == 'posix':
576 if os.name == 'posix':
577 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
577 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
578 'mv mv -i','rm rm -i','cp cp -i',
578 'mv mv -i','rm rm -i','cp cp -i',
579 'cat cat','less less','clear clear',
579 'cat cat','less less','clear clear',
580 # a better ls
580 # a better ls
581 'ls ls -F',
581 'ls ls -F',
582 # long ls
582 # long ls
583 'll ls -lF')
583 'll ls -lF')
584 # Extra ls aliases with color, which need special treatment on BSD
584 # Extra ls aliases with color, which need special treatment on BSD
585 # variants
585 # variants
586 ls_extra = ( # color ls
586 ls_extra = ( # color ls
587 'lc ls -F -o --color',
587 'lc ls -F -o --color',
588 # ls normal files only
588 # ls normal files only
589 'lf ls -F -o --color %l | grep ^-',
589 'lf ls -F -o --color %l | grep ^-',
590 # ls symbolic links
590 # ls symbolic links
591 'lk ls -F -o --color %l | grep ^l',
591 'lk ls -F -o --color %l | grep ^l',
592 # directories or links to directories,
592 # directories or links to directories,
593 'ldir ls -F -o --color %l | grep /$',
593 'ldir ls -F -o --color %l | grep /$',
594 # things which are executable
594 # things which are executable
595 'lx ls -F -o --color %l | grep ^-..x',
595 'lx ls -F -o --color %l | grep ^-..x',
596 )
596 )
597 # The BSDs don't ship GNU ls, so they don't understand the
597 # The BSDs don't ship GNU ls, so they don't understand the
598 # --color switch out of the box
598 # --color switch out of the box
599 if 'bsd' in sys.platform:
599 if 'bsd' in sys.platform:
600 ls_extra = ( # ls normal files only
600 ls_extra = ( # ls normal files only
601 'lf ls -lF | grep ^-',
601 'lf ls -lF | grep ^-',
602 # ls symbolic links
602 # ls symbolic links
603 'lk ls -lF | grep ^l',
603 'lk ls -lF | grep ^l',
604 # directories or links to directories,
604 # directories or links to directories,
605 'ldir ls -lF | grep /$',
605 'ldir ls -lF | grep /$',
606 # things which are executable
606 # things which are executable
607 'lx ls -lF | grep ^-..x',
607 'lx ls -lF | grep ^-..x',
608 )
608 )
609 auto_alias = auto_alias + ls_extra
609 auto_alias = auto_alias + ls_extra
610 elif os.name in ['nt','dos']:
610 elif os.name in ['nt','dos']:
611 auto_alias = ('dir dir /on', 'ls dir /on',
611 auto_alias = ('dir dir /on', 'ls dir /on',
612 'ddir dir /ad /on', 'ldir dir /ad /on',
612 'ddir dir /ad /on', 'ldir dir /ad /on',
613 'mkdir mkdir','rmdir rmdir','echo echo',
613 'mkdir mkdir','rmdir rmdir','echo echo',
614 'ren ren','cls cls','copy copy')
614 'ren ren','cls cls','copy copy')
615 else:
615 else:
616 auto_alias = ()
616 auto_alias = ()
617 self.auto_alias = [s.split(None,1) for s in auto_alias]
617 self.auto_alias = [s.split(None,1) for s in auto_alias]
618 # Call the actual (public) initializer
618 # Call the actual (public) initializer
619 self.init_auto_alias()
619 self.init_auto_alias()
620
620
621 # Produce a public API instance
621 # Produce a public API instance
622 self.api = IPython.ipapi.IPApi(self)
622 self.api = IPython.ipapi.IPApi(self)
623
623
624 # track which builtins we add, so we can clean up later
624 # track which builtins we add, so we can clean up later
625 self.builtins_added = {}
625 self.builtins_added = {}
626 # This method will add the necessary builtins for operation, but
626 # This method will add the necessary builtins for operation, but
627 # tracking what it did via the builtins_added dict.
627 # tracking what it did via the builtins_added dict.
628 self.add_builtins()
628 self.add_builtins()
629
629
630 # end __init__
630 # end __init__
631
631
632 def var_expand(self,cmd,depth=0):
632 def var_expand(self,cmd,depth=0):
633 """Expand python variables in a string.
633 """Expand python variables in a string.
634
634
635 The depth argument indicates how many frames above the caller should
635 The depth argument indicates how many frames above the caller should
636 be walked to look for the local namespace where to expand variables.
636 be walked to look for the local namespace where to expand variables.
637
637
638 The global namespace for expansion is always the user's interactive
638 The global namespace for expansion is always the user's interactive
639 namespace.
639 namespace.
640 """
640 """
641
641
642 return str(ItplNS(cmd.replace('#','\#'),
642 return str(ItplNS(cmd.replace('#','\#'),
643 self.user_ns, # globals
643 self.user_ns, # globals
644 # Skip our own frame in searching for locals:
644 # Skip our own frame in searching for locals:
645 sys._getframe(depth+1).f_locals # locals
645 sys._getframe(depth+1).f_locals # locals
646 ))
646 ))
647
647
648 def pre_config_initialization(self):
648 def pre_config_initialization(self):
649 """Pre-configuration init method
649 """Pre-configuration init method
650
650
651 This is called before the configuration files are processed to
651 This is called before the configuration files are processed to
652 prepare the services the config files might need.
652 prepare the services the config files might need.
653
653
654 self.rc already has reasonable default values at this point.
654 self.rc already has reasonable default values at this point.
655 """
655 """
656 rc = self.rc
656 rc = self.rc
657
657
658 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
658 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
659
659
660 def post_config_initialization(self):
660 def post_config_initialization(self):
661 """Post configuration init method
661 """Post configuration init method
662
662
663 This is called after the configuration files have been processed to
663 This is called after the configuration files have been processed to
664 'finalize' the initialization."""
664 'finalize' the initialization."""
665
665
666 rc = self.rc
666 rc = self.rc
667
667
668 # Object inspector
668 # Object inspector
669 self.inspector = OInspect.Inspector(OInspect.InspectColors,
669 self.inspector = OInspect.Inspector(OInspect.InspectColors,
670 PyColorize.ANSICodeColors,
670 PyColorize.ANSICodeColors,
671 'NoColor',
671 'NoColor',
672 rc.object_info_string_level)
672 rc.object_info_string_level)
673
673
674 # Load readline proper
674 # Load readline proper
675 if rc.readline:
675 if rc.readline:
676 self.init_readline()
676 self.init_readline()
677
677
678 # local shortcut, this is used a LOT
678 # local shortcut, this is used a LOT
679 self.log = self.logger.log
679 self.log = self.logger.log
680
680
681 # Initialize cache, set in/out prompts and printing system
681 # Initialize cache, set in/out prompts and printing system
682 self.outputcache = CachedOutput(self,
682 self.outputcache = CachedOutput(self,
683 rc.cache_size,
683 rc.cache_size,
684 rc.pprint,
684 rc.pprint,
685 input_sep = rc.separate_in,
685 input_sep = rc.separate_in,
686 output_sep = rc.separate_out,
686 output_sep = rc.separate_out,
687 output_sep2 = rc.separate_out2,
687 output_sep2 = rc.separate_out2,
688 ps1 = rc.prompt_in1,
688 ps1 = rc.prompt_in1,
689 ps2 = rc.prompt_in2,
689 ps2 = rc.prompt_in2,
690 ps_out = rc.prompt_out,
690 ps_out = rc.prompt_out,
691 pad_left = rc.prompts_pad_left)
691 pad_left = rc.prompts_pad_left)
692
692
693 # user may have over-ridden the default print hook:
693 # user may have over-ridden the default print hook:
694 try:
694 try:
695 self.outputcache.__class__.display = self.hooks.display
695 self.outputcache.__class__.display = self.hooks.display
696 except AttributeError:
696 except AttributeError:
697 pass
697 pass
698
698
699 # I don't like assigning globally to sys, because it means when
699 # I don't like assigning globally to sys, because it means when
700 # embedding instances, each embedded instance overrides the previous
700 # embedding instances, each embedded instance overrides the previous
701 # choice. But sys.displayhook seems to be called internally by exec,
701 # choice. But sys.displayhook seems to be called internally by exec,
702 # so I don't see a way around it. We first save the original and then
702 # so I don't see a way around it. We first save the original and then
703 # overwrite it.
703 # overwrite it.
704 self.sys_displayhook = sys.displayhook
704 self.sys_displayhook = sys.displayhook
705 sys.displayhook = self.outputcache
705 sys.displayhook = self.outputcache
706
706
707 # Set user colors (don't do it in the constructor above so that it
707 # Set user colors (don't do it in the constructor above so that it
708 # doesn't crash if colors option is invalid)
708 # doesn't crash if colors option is invalid)
709 self.magic_colors(rc.colors)
709 self.magic_colors(rc.colors)
710
710
711 # Set calling of pdb on exceptions
711 # Set calling of pdb on exceptions
712 self.call_pdb = rc.pdb
712 self.call_pdb = rc.pdb
713
713
714 # Load user aliases
714 # Load user aliases
715 for alias in rc.alias:
715 for alias in rc.alias:
716 self.magic_alias(alias)
716 self.magic_alias(alias)
717 self.hooks.late_startup_hook()
717 self.hooks.late_startup_hook()
718
718
719 batchrun = False
719 batchrun = False
720 for batchfile in [path(arg) for arg in self.rc.args
720 for batchfile in [path(arg) for arg in self.rc.args
721 if arg.lower().endswith('.ipy')]:
721 if arg.lower().endswith('.ipy')]:
722 if not batchfile.isfile():
722 if not batchfile.isfile():
723 print "No such batch file:", batchfile
723 print "No such batch file:", batchfile
724 continue
724 continue
725 self.api.runlines(batchfile.text())
725 self.api.runlines(batchfile.text())
726 batchrun = True
726 batchrun = True
727 if batchrun:
727 if batchrun:
728 self.exit_now = True
728 self.exit_now = True
729
729
730 def add_builtins(self):
730 def add_builtins(self):
731 """Store ipython references into the builtin namespace.
731 """Store ipython references into the builtin namespace.
732
732
733 Some parts of ipython operate via builtins injected here, which hold a
733 Some parts of ipython operate via builtins injected here, which hold a
734 reference to IPython itself."""
734 reference to IPython itself."""
735
735
736 # TODO: deprecate all except _ip; 'jobs' should be installed
736 # TODO: deprecate all except _ip; 'jobs' should be installed
737 # by an extension and the rest are under _ip, ipalias is redundant
737 # by an extension and the rest are under _ip, ipalias is redundant
738 builtins_new = dict(__IPYTHON__ = self,
738 builtins_new = dict(__IPYTHON__ = self,
739 ip_set_hook = self.set_hook,
739 ip_set_hook = self.set_hook,
740 jobs = self.jobs,
740 jobs = self.jobs,
741 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
741 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
742 ipalias = wrap_deprecated(self.ipalias),
742 ipalias = wrap_deprecated(self.ipalias),
743 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
743 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
744 _ip = self.api
744 _ip = self.api
745 )
745 )
746 for biname,bival in builtins_new.items():
746 for biname,bival in builtins_new.items():
747 try:
747 try:
748 # store the orignal value so we can restore it
748 # store the orignal value so we can restore it
749 self.builtins_added[biname] = __builtin__.__dict__[biname]
749 self.builtins_added[biname] = __builtin__.__dict__[biname]
750 except KeyError:
750 except KeyError:
751 # or mark that it wasn't defined, and we'll just delete it at
751 # or mark that it wasn't defined, and we'll just delete it at
752 # cleanup
752 # cleanup
753 self.builtins_added[biname] = Undefined
753 self.builtins_added[biname] = Undefined
754 __builtin__.__dict__[biname] = bival
754 __builtin__.__dict__[biname] = bival
755
755
756 # Keep in the builtins a flag for when IPython is active. We set it
756 # Keep in the builtins a flag for when IPython is active. We set it
757 # with setdefault so that multiple nested IPythons don't clobber one
757 # with setdefault so that multiple nested IPythons don't clobber one
758 # another. Each will increase its value by one upon being activated,
758 # another. Each will increase its value by one upon being activated,
759 # which also gives us a way to determine the nesting level.
759 # which also gives us a way to determine the nesting level.
760 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
760 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
761
761
762 def clean_builtins(self):
762 def clean_builtins(self):
763 """Remove any builtins which might have been added by add_builtins, or
763 """Remove any builtins which might have been added by add_builtins, or
764 restore overwritten ones to their previous values."""
764 restore overwritten ones to their previous values."""
765 for biname,bival in self.builtins_added.items():
765 for biname,bival in self.builtins_added.items():
766 if bival is Undefined:
766 if bival is Undefined:
767 del __builtin__.__dict__[biname]
767 del __builtin__.__dict__[biname]
768 else:
768 else:
769 __builtin__.__dict__[biname] = bival
769 __builtin__.__dict__[biname] = bival
770 self.builtins_added.clear()
770 self.builtins_added.clear()
771
771
772 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
772 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
773 """set_hook(name,hook) -> sets an internal IPython hook.
773 """set_hook(name,hook) -> sets an internal IPython hook.
774
774
775 IPython exposes some of its internal API as user-modifiable hooks. By
775 IPython exposes some of its internal API as user-modifiable hooks. By
776 adding your function to one of these hooks, you can modify IPython's
776 adding your function to one of these hooks, you can modify IPython's
777 behavior to call at runtime your own routines."""
777 behavior to call at runtime your own routines."""
778
778
779 # At some point in the future, this should validate the hook before it
779 # At some point in the future, this should validate the hook before it
780 # accepts it. Probably at least check that the hook takes the number
780 # accepts it. Probably at least check that the hook takes the number
781 # of args it's supposed to.
781 # of args it's supposed to.
782
782
783 f = new.instancemethod(hook,self,self.__class__)
783 f = new.instancemethod(hook,self,self.__class__)
784
784
785 # check if the hook is for strdispatcher first
785 # check if the hook is for strdispatcher first
786 if str_key is not None:
786 if str_key is not None:
787 sdp = self.strdispatchers.get(name, StrDispatch())
787 sdp = self.strdispatchers.get(name, StrDispatch())
788 sdp.add_s(str_key, f, priority )
788 sdp.add_s(str_key, f, priority )
789 self.strdispatchers[name] = sdp
789 self.strdispatchers[name] = sdp
790 return
790 return
791 if re_key is not None:
791 if re_key is not None:
792 sdp = self.strdispatchers.get(name, StrDispatch())
792 sdp = self.strdispatchers.get(name, StrDispatch())
793 sdp.add_re(re.compile(re_key), f, priority )
793 sdp.add_re(re.compile(re_key), f, priority )
794 self.strdispatchers[name] = sdp
794 self.strdispatchers[name] = sdp
795 return
795 return
796
796
797 dp = getattr(self.hooks, name, None)
797 dp = getattr(self.hooks, name, None)
798 if name not in IPython.hooks.__all__:
798 if name not in IPython.hooks.__all__:
799 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
799 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
800 if not dp:
800 if not dp:
801 dp = IPython.hooks.CommandChainDispatcher()
801 dp = IPython.hooks.CommandChainDispatcher()
802
802
803 try:
803 try:
804 dp.add(f,priority)
804 dp.add(f,priority)
805 except AttributeError:
805 except AttributeError:
806 # it was not commandchain, plain old func - replace
806 # it was not commandchain, plain old func - replace
807 dp = f
807 dp = f
808
808
809 setattr(self.hooks,name, dp)
809 setattr(self.hooks,name, dp)
810
810
811
811
812 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
812 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
813
813
814 def set_crash_handler(self,crashHandler):
814 def set_crash_handler(self,crashHandler):
815 """Set the IPython crash handler.
815 """Set the IPython crash handler.
816
816
817 This must be a callable with a signature suitable for use as
817 This must be a callable with a signature suitable for use as
818 sys.excepthook."""
818 sys.excepthook."""
819
819
820 # Install the given crash handler as the Python exception hook
820 # Install the given crash handler as the Python exception hook
821 sys.excepthook = crashHandler
821 sys.excepthook = crashHandler
822
822
823 # The instance will store a pointer to this, so that runtime code
823 # The instance will store a pointer to this, so that runtime code
824 # (such as magics) can access it. This is because during the
824 # (such as magics) can access it. This is because during the
825 # read-eval loop, it gets temporarily overwritten (to deal with GUI
825 # read-eval loop, it gets temporarily overwritten (to deal with GUI
826 # frameworks).
826 # frameworks).
827 self.sys_excepthook = sys.excepthook
827 self.sys_excepthook = sys.excepthook
828
828
829
829
830 def set_custom_exc(self,exc_tuple,handler):
830 def set_custom_exc(self,exc_tuple,handler):
831 """set_custom_exc(exc_tuple,handler)
831 """set_custom_exc(exc_tuple,handler)
832
832
833 Set a custom exception handler, which will be called if any of the
833 Set a custom exception handler, which will be called if any of the
834 exceptions in exc_tuple occur in the mainloop (specifically, in the
834 exceptions in exc_tuple occur in the mainloop (specifically, in the
835 runcode() method.
835 runcode() method.
836
836
837 Inputs:
837 Inputs:
838
838
839 - exc_tuple: a *tuple* of valid exceptions to call the defined
839 - exc_tuple: a *tuple* of valid exceptions to call the defined
840 handler for. It is very important that you use a tuple, and NOT A
840 handler for. It is very important that you use a tuple, and NOT A
841 LIST here, because of the way Python's except statement works. If
841 LIST here, because of the way Python's except statement works. If
842 you only want to trap a single exception, use a singleton tuple:
842 you only want to trap a single exception, use a singleton tuple:
843
843
844 exc_tuple == (MyCustomException,)
844 exc_tuple == (MyCustomException,)
845
845
846 - handler: this must be defined as a function with the following
846 - handler: this must be defined as a function with the following
847 basic interface: def my_handler(self,etype,value,tb).
847 basic interface: def my_handler(self,etype,value,tb).
848
848
849 This will be made into an instance method (via new.instancemethod)
849 This will be made into an instance method (via new.instancemethod)
850 of IPython itself, and it will be called if any of the exceptions
850 of IPython itself, and it will be called if any of the exceptions
851 listed in the exc_tuple are caught. If the handler is None, an
851 listed in the exc_tuple are caught. If the handler is None, an
852 internal basic one is used, which just prints basic info.
852 internal basic one is used, which just prints basic info.
853
853
854 WARNING: by putting in your own exception handler into IPython's main
854 WARNING: by putting in your own exception handler into IPython's main
855 execution loop, you run a very good chance of nasty crashes. This
855 execution loop, you run a very good chance of nasty crashes. This
856 facility should only be used if you really know what you are doing."""
856 facility should only be used if you really know what you are doing."""
857
857
858 assert type(exc_tuple)==type(()) , \
858 assert type(exc_tuple)==type(()) , \
859 "The custom exceptions must be given AS A TUPLE."
859 "The custom exceptions must be given AS A TUPLE."
860
860
861 def dummy_handler(self,etype,value,tb):
861 def dummy_handler(self,etype,value,tb):
862 print '*** Simple custom exception handler ***'
862 print '*** Simple custom exception handler ***'
863 print 'Exception type :',etype
863 print 'Exception type :',etype
864 print 'Exception value:',value
864 print 'Exception value:',value
865 print 'Traceback :',tb
865 print 'Traceback :',tb
866 print 'Source code :','\n'.join(self.buffer)
866 print 'Source code :','\n'.join(self.buffer)
867
867
868 if handler is None: handler = dummy_handler
868 if handler is None: handler = dummy_handler
869
869
870 self.CustomTB = new.instancemethod(handler,self,self.__class__)
870 self.CustomTB = new.instancemethod(handler,self,self.__class__)
871 self.custom_exceptions = exc_tuple
871 self.custom_exceptions = exc_tuple
872
872
873 def set_custom_completer(self,completer,pos=0):
873 def set_custom_completer(self,completer,pos=0):
874 """set_custom_completer(completer,pos=0)
874 """set_custom_completer(completer,pos=0)
875
875
876 Adds a new custom completer function.
876 Adds a new custom completer function.
877
877
878 The position argument (defaults to 0) is the index in the completers
878 The position argument (defaults to 0) is the index in the completers
879 list where you want the completer to be inserted."""
879 list where you want the completer to be inserted."""
880
880
881 newcomp = new.instancemethod(completer,self.Completer,
881 newcomp = new.instancemethod(completer,self.Completer,
882 self.Completer.__class__)
882 self.Completer.__class__)
883 self.Completer.matchers.insert(pos,newcomp)
883 self.Completer.matchers.insert(pos,newcomp)
884
884
885 def _get_call_pdb(self):
885 def _get_call_pdb(self):
886 return self._call_pdb
886 return self._call_pdb
887
887
888 def _set_call_pdb(self,val):
888 def _set_call_pdb(self,val):
889
889
890 if val not in (0,1,False,True):
890 if val not in (0,1,False,True):
891 raise ValueError,'new call_pdb value must be boolean'
891 raise ValueError,'new call_pdb value must be boolean'
892
892
893 # store value in instance
893 # store value in instance
894 self._call_pdb = val
894 self._call_pdb = val
895
895
896 # notify the actual exception handlers
896 # notify the actual exception handlers
897 self.InteractiveTB.call_pdb = val
897 self.InteractiveTB.call_pdb = val
898 if self.isthreaded:
898 if self.isthreaded:
899 try:
899 try:
900 self.sys_excepthook.call_pdb = val
900 self.sys_excepthook.call_pdb = val
901 except:
901 except:
902 warn('Failed to activate pdb for threaded exception handler')
902 warn('Failed to activate pdb for threaded exception handler')
903
903
904 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
904 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
905 'Control auto-activation of pdb at exceptions')
905 'Control auto-activation of pdb at exceptions')
906
906
907
907
908 # These special functions get installed in the builtin namespace, to
908 # These special functions get installed in the builtin namespace, to
909 # provide programmatic (pure python) access to magics, aliases and system
909 # provide programmatic (pure python) access to magics, aliases and system
910 # calls. This is important for logging, user scripting, and more.
910 # calls. This is important for logging, user scripting, and more.
911
911
912 # We are basically exposing, via normal python functions, the three
912 # We are basically exposing, via normal python functions, the three
913 # mechanisms in which ipython offers special call modes (magics for
913 # mechanisms in which ipython offers special call modes (magics for
914 # internal control, aliases for direct system access via pre-selected
914 # internal control, aliases for direct system access via pre-selected
915 # names, and !cmd for calling arbitrary system commands).
915 # names, and !cmd for calling arbitrary system commands).
916
916
917 def ipmagic(self,arg_s):
917 def ipmagic(self,arg_s):
918 """Call a magic function by name.
918 """Call a magic function by name.
919
919
920 Input: a string containing the name of the magic function to call and any
920 Input: a string containing the name of the magic function to call and any
921 additional arguments to be passed to the magic.
921 additional arguments to be passed to the magic.
922
922
923 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
923 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
924 prompt:
924 prompt:
925
925
926 In[1]: %name -opt foo bar
926 In[1]: %name -opt foo bar
927
927
928 To call a magic without arguments, simply use ipmagic('name').
928 To call a magic without arguments, simply use ipmagic('name').
929
929
930 This provides a proper Python function to call IPython's magics in any
930 This provides a proper Python function to call IPython's magics in any
931 valid Python code you can type at the interpreter, including loops and
931 valid Python code you can type at the interpreter, including loops and
932 compound statements. It is added by IPython to the Python builtin
932 compound statements. It is added by IPython to the Python builtin
933 namespace upon initialization."""
933 namespace upon initialization."""
934
934
935 args = arg_s.split(' ',1)
935 args = arg_s.split(' ',1)
936 magic_name = args[0]
936 magic_name = args[0]
937 magic_name = magic_name.lstrip(self.ESC_MAGIC)
937 magic_name = magic_name.lstrip(self.ESC_MAGIC)
938
938
939 try:
939 try:
940 magic_args = args[1]
940 magic_args = args[1]
941 except IndexError:
941 except IndexError:
942 magic_args = ''
942 magic_args = ''
943 fn = getattr(self,'magic_'+magic_name,None)
943 fn = getattr(self,'magic_'+magic_name,None)
944 if fn is None:
944 if fn is None:
945 error("Magic function `%s` not found." % magic_name)
945 error("Magic function `%s` not found." % magic_name)
946 else:
946 else:
947 magic_args = self.var_expand(magic_args,1)
947 magic_args = self.var_expand(magic_args,1)
948 return fn(magic_args)
948 return fn(magic_args)
949
949
950 def ipalias(self,arg_s):
950 def ipalias(self,arg_s):
951 """Call an alias by name.
951 """Call an alias by name.
952
952
953 Input: a string containing the name of the alias to call and any
953 Input: a string containing the name of the alias to call and any
954 additional arguments to be passed to the magic.
954 additional arguments to be passed to the magic.
955
955
956 ipalias('name -opt foo bar') is equivalent to typing at the ipython
956 ipalias('name -opt foo bar') is equivalent to typing at the ipython
957 prompt:
957 prompt:
958
958
959 In[1]: name -opt foo bar
959 In[1]: name -opt foo bar
960
960
961 To call an alias without arguments, simply use ipalias('name').
961 To call an alias without arguments, simply use ipalias('name').
962
962
963 This provides a proper Python function to call IPython's aliases in any
963 This provides a proper Python function to call IPython's aliases in any
964 valid Python code you can type at the interpreter, including loops and
964 valid Python code you can type at the interpreter, including loops and
965 compound statements. It is added by IPython to the Python builtin
965 compound statements. It is added by IPython to the Python builtin
966 namespace upon initialization."""
966 namespace upon initialization."""
967
967
968 args = arg_s.split(' ',1)
968 args = arg_s.split(' ',1)
969 alias_name = args[0]
969 alias_name = args[0]
970 try:
970 try:
971 alias_args = args[1]
971 alias_args = args[1]
972 except IndexError:
972 except IndexError:
973 alias_args = ''
973 alias_args = ''
974 if alias_name in self.alias_table:
974 if alias_name in self.alias_table:
975 self.call_alias(alias_name,alias_args)
975 self.call_alias(alias_name,alias_args)
976 else:
976 else:
977 error("Alias `%s` not found." % alias_name)
977 error("Alias `%s` not found." % alias_name)
978
978
979 def ipsystem(self,arg_s):
979 def ipsystem(self,arg_s):
980 """Make a system call, using IPython."""
980 """Make a system call, using IPython."""
981
981
982 self.system(arg_s)
982 self.system(arg_s)
983
983
984 def complete(self,text):
984 def complete(self,text):
985 """Return a sorted list of all possible completions on text.
985 """Return a sorted list of all possible completions on text.
986
986
987 Inputs:
987 Inputs:
988
988
989 - text: a string of text to be completed on.
989 - text: a string of text to be completed on.
990
990
991 This is a wrapper around the completion mechanism, similar to what
991 This is a wrapper around the completion mechanism, similar to what
992 readline does at the command line when the TAB key is hit. By
992 readline does at the command line when the TAB key is hit. By
993 exposing it as a method, it can be used by other non-readline
993 exposing it as a method, it can be used by other non-readline
994 environments (such as GUIs) for text completion.
994 environments (such as GUIs) for text completion.
995
995
996 Simple usage example:
996 Simple usage example:
997
997
998 In [1]: x = 'hello'
998 In [1]: x = 'hello'
999
999
1000 In [2]: __IP.complete('x.l')
1000 In [2]: __IP.complete('x.l')
1001 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1001 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1002
1002
1003 complete = self.Completer.complete
1003 complete = self.Completer.complete
1004 state = 0
1004 state = 0
1005 # use a dict so we get unique keys, since ipyhton's multiple
1005 # use a dict so we get unique keys, since ipyhton's multiple
1006 # completers can return duplicates.
1006 # completers can return duplicates.
1007 comps = {}
1007 comps = {}
1008 while True:
1008 while True:
1009 newcomp = complete(text,state)
1009 newcomp = complete(text,state)
1010 if newcomp is None:
1010 if newcomp is None:
1011 break
1011 break
1012 comps[newcomp] = 1
1012 comps[newcomp] = 1
1013 state += 1
1013 state += 1
1014 outcomps = comps.keys()
1014 outcomps = comps.keys()
1015 outcomps.sort()
1015 outcomps.sort()
1016 return outcomps
1016 return outcomps
1017
1017
1018 def set_completer_frame(self, frame=None):
1018 def set_completer_frame(self, frame=None):
1019 if frame:
1019 if frame:
1020 self.Completer.namespace = frame.f_locals
1020 self.Completer.namespace = frame.f_locals
1021 self.Completer.global_namespace = frame.f_globals
1021 self.Completer.global_namespace = frame.f_globals
1022 else:
1022 else:
1023 self.Completer.namespace = self.user_ns
1023 self.Completer.namespace = self.user_ns
1024 self.Completer.global_namespace = self.user_global_ns
1024 self.Completer.global_namespace = self.user_global_ns
1025
1025
1026 def init_auto_alias(self):
1026 def init_auto_alias(self):
1027 """Define some aliases automatically.
1027 """Define some aliases automatically.
1028
1028
1029 These are ALL parameter-less aliases"""
1029 These are ALL parameter-less aliases"""
1030
1030
1031 for alias,cmd in self.auto_alias:
1031 for alias,cmd in self.auto_alias:
1032 self.alias_table[alias] = (0,cmd)
1032 self.alias_table[alias] = (0,cmd)
1033
1033
1034 def alias_table_validate(self,verbose=0):
1034 def alias_table_validate(self,verbose=0):
1035 """Update information about the alias table.
1035 """Update information about the alias table.
1036
1036
1037 In particular, make sure no Python keywords/builtins are in it."""
1037 In particular, make sure no Python keywords/builtins are in it."""
1038
1038
1039 no_alias = self.no_alias
1039 no_alias = self.no_alias
1040 for k in self.alias_table.keys():
1040 for k in self.alias_table.keys():
1041 if k in no_alias:
1041 if k in no_alias:
1042 del self.alias_table[k]
1042 del self.alias_table[k]
1043 if verbose:
1043 if verbose:
1044 print ("Deleting alias <%s>, it's a Python "
1044 print ("Deleting alias <%s>, it's a Python "
1045 "keyword or builtin." % k)
1045 "keyword or builtin." % k)
1046
1046
1047 def set_autoindent(self,value=None):
1047 def set_autoindent(self,value=None):
1048 """Set the autoindent flag, checking for readline support.
1048 """Set the autoindent flag, checking for readline support.
1049
1049
1050 If called with no arguments, it acts as a toggle."""
1050 If called with no arguments, it acts as a toggle."""
1051
1051
1052 if not self.has_readline:
1052 if not self.has_readline:
1053 if os.name == 'posix':
1053 if os.name == 'posix':
1054 warn("The auto-indent feature requires the readline library")
1054 warn("The auto-indent feature requires the readline library")
1055 self.autoindent = 0
1055 self.autoindent = 0
1056 return
1056 return
1057 if value is None:
1057 if value is None:
1058 self.autoindent = not self.autoindent
1058 self.autoindent = not self.autoindent
1059 else:
1059 else:
1060 self.autoindent = value
1060 self.autoindent = value
1061
1061
1062 def rc_set_toggle(self,rc_field,value=None):
1062 def rc_set_toggle(self,rc_field,value=None):
1063 """Set or toggle a field in IPython's rc config. structure.
1063 """Set or toggle a field in IPython's rc config. structure.
1064
1064
1065 If called with no arguments, it acts as a toggle.
1065 If called with no arguments, it acts as a toggle.
1066
1066
1067 If called with a non-existent field, the resulting AttributeError
1067 If called with a non-existent field, the resulting AttributeError
1068 exception will propagate out."""
1068 exception will propagate out."""
1069
1069
1070 rc_val = getattr(self.rc,rc_field)
1070 rc_val = getattr(self.rc,rc_field)
1071 if value is None:
1071 if value is None:
1072 value = not rc_val
1072 value = not rc_val
1073 setattr(self.rc,rc_field,value)
1073 setattr(self.rc,rc_field,value)
1074
1074
1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1076 """Install the user configuration directory.
1076 """Install the user configuration directory.
1077
1077
1078 Can be called when running for the first time or to upgrade the user's
1078 Can be called when running for the first time or to upgrade the user's
1079 .ipython/ directory with the mode parameter. Valid modes are 'install'
1079 .ipython/ directory with the mode parameter. Valid modes are 'install'
1080 and 'upgrade'."""
1080 and 'upgrade'."""
1081
1081
1082 def wait():
1082 def wait():
1083 try:
1083 try:
1084 raw_input("Please press <RETURN> to start IPython.")
1084 raw_input("Please press <RETURN> to start IPython.")
1085 except EOFError:
1085 except EOFError:
1086 print >> Term.cout
1086 print >> Term.cout
1087 print '*'*70
1087 print '*'*70
1088
1088
1089 cwd = os.getcwd() # remember where we started
1089 cwd = os.getcwd() # remember where we started
1090 glb = glob.glob
1090 glb = glob.glob
1091 print '*'*70
1091 print '*'*70
1092 if mode == 'install':
1092 if mode == 'install':
1093 print \
1093 print \
1094 """Welcome to IPython. I will try to create a personal configuration directory
1094 """Welcome to IPython. I will try to create a personal configuration directory
1095 where you can customize many aspects of IPython's functionality in:\n"""
1095 where you can customize many aspects of IPython's functionality in:\n"""
1096 else:
1096 else:
1097 print 'I am going to upgrade your configuration in:'
1097 print 'I am going to upgrade your configuration in:'
1098
1098
1099 print ipythondir
1099 print ipythondir
1100
1100
1101 rcdirend = os.path.join('IPython','UserConfig')
1101 rcdirend = os.path.join('IPython','UserConfig')
1102 cfg = lambda d: os.path.join(d,rcdirend)
1102 cfg = lambda d: os.path.join(d,rcdirend)
1103 try:
1103 try:
1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1105 except IOError:
1105 except IOError:
1106 warning = """
1106 warning = """
1107 Installation error. IPython's directory was not found.
1107 Installation error. IPython's directory was not found.
1108
1108
1109 Check the following:
1109 Check the following:
1110
1110
1111 The ipython/IPython directory should be in a directory belonging to your
1111 The ipython/IPython directory should be in a directory belonging to your
1112 PYTHONPATH environment variable (that is, it should be in a directory
1112 PYTHONPATH environment variable (that is, it should be in a directory
1113 belonging to sys.path). You can copy it explicitly there or just link to it.
1113 belonging to sys.path). You can copy it explicitly there or just link to it.
1114
1114
1115 IPython will proceed with builtin defaults.
1115 IPython will proceed with builtin defaults.
1116 """
1116 """
1117 warn(warning)
1117 warn(warning)
1118 wait()
1118 wait()
1119 return
1119 return
1120
1120
1121 if mode == 'install':
1121 if mode == 'install':
1122 try:
1122 try:
1123 shutil.copytree(rcdir,ipythondir)
1123 shutil.copytree(rcdir,ipythondir)
1124 os.chdir(ipythondir)
1124 os.chdir(ipythondir)
1125 rc_files = glb("ipythonrc*")
1125 rc_files = glb("ipythonrc*")
1126 for rc_file in rc_files:
1126 for rc_file in rc_files:
1127 os.rename(rc_file,rc_file+rc_suffix)
1127 os.rename(rc_file,rc_file+rc_suffix)
1128 except:
1128 except:
1129 warning = """
1129 warning = """
1130
1130
1131 There was a problem with the installation:
1131 There was a problem with the installation:
1132 %s
1132 %s
1133 Try to correct it or contact the developers if you think it's a bug.
1133 Try to correct it or contact the developers if you think it's a bug.
1134 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1134 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1135 warn(warning)
1135 warn(warning)
1136 wait()
1136 wait()
1137 return
1137 return
1138
1138
1139 elif mode == 'upgrade':
1139 elif mode == 'upgrade':
1140 try:
1140 try:
1141 os.chdir(ipythondir)
1141 os.chdir(ipythondir)
1142 except:
1142 except:
1143 print """
1143 print """
1144 Can not upgrade: changing to directory %s failed. Details:
1144 Can not upgrade: changing to directory %s failed. Details:
1145 %s
1145 %s
1146 """ % (ipythondir,sys.exc_info()[1])
1146 """ % (ipythondir,sys.exc_info()[1])
1147 wait()
1147 wait()
1148 return
1148 return
1149 else:
1149 else:
1150 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1150 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1151 for new_full_path in sources:
1151 for new_full_path in sources:
1152 new_filename = os.path.basename(new_full_path)
1152 new_filename = os.path.basename(new_full_path)
1153 if new_filename.startswith('ipythonrc'):
1153 if new_filename.startswith('ipythonrc'):
1154 new_filename = new_filename + rc_suffix
1154 new_filename = new_filename + rc_suffix
1155 # The config directory should only contain files, skip any
1155 # The config directory should only contain files, skip any
1156 # directories which may be there (like CVS)
1156 # directories which may be there (like CVS)
1157 if os.path.isdir(new_full_path):
1157 if os.path.isdir(new_full_path):
1158 continue
1158 continue
1159 if os.path.exists(new_filename):
1159 if os.path.exists(new_filename):
1160 old_file = new_filename+'.old'
1160 old_file = new_filename+'.old'
1161 if os.path.exists(old_file):
1161 if os.path.exists(old_file):
1162 os.remove(old_file)
1162 os.remove(old_file)
1163 os.rename(new_filename,old_file)
1163 os.rename(new_filename,old_file)
1164 shutil.copy(new_full_path,new_filename)
1164 shutil.copy(new_full_path,new_filename)
1165 else:
1165 else:
1166 raise ValueError,'unrecognized mode for install:',`mode`
1166 raise ValueError,'unrecognized mode for install:',`mode`
1167
1167
1168 # Fix line-endings to those native to each platform in the config
1168 # Fix line-endings to those native to each platform in the config
1169 # directory.
1169 # directory.
1170 try:
1170 try:
1171 os.chdir(ipythondir)
1171 os.chdir(ipythondir)
1172 except:
1172 except:
1173 print """
1173 print """
1174 Problem: changing to directory %s failed.
1174 Problem: changing to directory %s failed.
1175 Details:
1175 Details:
1176 %s
1176 %s
1177
1177
1178 Some configuration files may have incorrect line endings. This should not
1178 Some configuration files may have incorrect line endings. This should not
1179 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1179 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1180 wait()
1180 wait()
1181 else:
1181 else:
1182 for fname in glb('ipythonrc*'):
1182 for fname in glb('ipythonrc*'):
1183 try:
1183 try:
1184 native_line_ends(fname,backup=0)
1184 native_line_ends(fname,backup=0)
1185 except IOError:
1185 except IOError:
1186 pass
1186 pass
1187
1187
1188 if mode == 'install':
1188 if mode == 'install':
1189 print """
1189 print """
1190 Successful installation!
1190 Successful installation!
1191
1191
1192 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1192 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1193 IPython manual (there are both HTML and PDF versions supplied with the
1193 IPython manual (there are both HTML and PDF versions supplied with the
1194 distribution) to make sure that your system environment is properly configured
1194 distribution) to make sure that your system environment is properly configured
1195 to take advantage of IPython's features.
1195 to take advantage of IPython's features.
1196
1196
1197 Important note: the configuration system has changed! The old system is
1197 Important note: the configuration system has changed! The old system is
1198 still in place, but its setting may be partly overridden by the settings in
1198 still in place, but its setting may be partly overridden by the settings in
1199 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1199 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1200 if some of the new settings bother you.
1200 if some of the new settings bother you.
1201
1201
1202 """
1202 """
1203 else:
1203 else:
1204 print """
1204 print """
1205 Successful upgrade!
1205 Successful upgrade!
1206
1206
1207 All files in your directory:
1207 All files in your directory:
1208 %(ipythondir)s
1208 %(ipythondir)s
1209 which would have been overwritten by the upgrade were backed up with a .old
1209 which would have been overwritten by the upgrade were backed up with a .old
1210 extension. If you had made particular customizations in those files you may
1210 extension. If you had made particular customizations in those files you may
1211 want to merge them back into the new files.""" % locals()
1211 want to merge them back into the new files.""" % locals()
1212 wait()
1212 wait()
1213 os.chdir(cwd)
1213 os.chdir(cwd)
1214 # end user_setup()
1214 # end user_setup()
1215
1215
1216 def atexit_operations(self):
1216 def atexit_operations(self):
1217 """This will be executed at the time of exit.
1217 """This will be executed at the time of exit.
1218
1218
1219 Saving of persistent data should be performed here. """
1219 Saving of persistent data should be performed here. """
1220
1220
1221 #print '*** IPython exit cleanup ***' # dbg
1221 #print '*** IPython exit cleanup ***' # dbg
1222 # input history
1222 # input history
1223 self.savehist()
1223 self.savehist()
1224
1224
1225 # Cleanup all tempfiles left around
1225 # Cleanup all tempfiles left around
1226 for tfile in self.tempfiles:
1226 for tfile in self.tempfiles:
1227 try:
1227 try:
1228 os.unlink(tfile)
1228 os.unlink(tfile)
1229 except OSError:
1229 except OSError:
1230 pass
1230 pass
1231
1231
1232 # save the "persistent data" catch-all dictionary
1232 # save the "persistent data" catch-all dictionary
1233 self.hooks.shutdown_hook()
1233 self.hooks.shutdown_hook()
1234
1234
1235 def savehist(self):
1235 def savehist(self):
1236 """Save input history to a file (via readline library)."""
1236 """Save input history to a file (via readline library)."""
1237 try:
1237 try:
1238 self.readline.write_history_file(self.histfile)
1238 self.readline.write_history_file(self.histfile)
1239 except:
1239 except:
1240 print 'Unable to save IPython command history to file: ' + \
1240 print 'Unable to save IPython command history to file: ' + \
1241 `self.histfile`
1241 `self.histfile`
1242
1242
1243 def history_saving_wrapper(self, func):
1243 def history_saving_wrapper(self, func):
1244 """ Wrap func for readline history saving
1244 """ Wrap func for readline history saving
1245
1245
1246 Convert func into callable that saves & restores
1246 Convert func into callable that saves & restores
1247 history around the call """
1247 history around the call """
1248
1248
1249 if not self.has_readline:
1249 if not self.has_readline:
1250 return func
1250 return func
1251
1251
1252 def wrapper():
1252 def wrapper():
1253 self.savehist()
1253 self.savehist()
1254 try:
1254 try:
1255 func()
1255 func()
1256 finally:
1256 finally:
1257 readline.read_history_file(self.histfile)
1257 readline.read_history_file(self.histfile)
1258 return wrapper
1258 return wrapper
1259
1259
1260
1260
1261 def pre_readline(self):
1261 def pre_readline(self):
1262 """readline hook to be used at the start of each line.
1262 """readline hook to be used at the start of each line.
1263
1263
1264 Currently it handles auto-indent only."""
1264 Currently it handles auto-indent only."""
1265
1265
1266 #debugx('self.indent_current_nsp','pre_readline:')
1266 #debugx('self.indent_current_nsp','pre_readline:')
1267 self.readline.insert_text(self.indent_current_str())
1267 self.readline.insert_text(self.indent_current_str())
1268
1268
1269 def init_readline(self):
1269 def init_readline(self):
1270 """Command history completion/saving/reloading."""
1270 """Command history completion/saving/reloading."""
1271
1271
1272 import IPython.rlineimpl as readline
1272 import IPython.rlineimpl as readline
1273 if not readline.have_readline:
1273 if not readline.have_readline:
1274 self.has_readline = 0
1274 self.has_readline = 0
1275 self.readline = None
1275 self.readline = None
1276 # no point in bugging windows users with this every time:
1276 # no point in bugging windows users with this every time:
1277 warn('Readline services not available on this platform.')
1277 warn('Readline services not available on this platform.')
1278 else:
1278 else:
1279 sys.modules['readline'] = readline
1279 sys.modules['readline'] = readline
1280 import atexit
1280 import atexit
1281 from IPython.completer import IPCompleter
1281 from IPython.completer import IPCompleter
1282 self.Completer = IPCompleter(self,
1282 self.Completer = IPCompleter(self,
1283 self.user_ns,
1283 self.user_ns,
1284 self.user_global_ns,
1284 self.user_global_ns,
1285 self.rc.readline_omit__names,
1285 self.rc.readline_omit__names,
1286 self.alias_table)
1286 self.alias_table)
1287 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1287 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1288 self.strdispatchers['complete_command'] = sdisp
1288 self.strdispatchers['complete_command'] = sdisp
1289 self.Completer.custom_completers = sdisp
1289 self.Completer.custom_completers = sdisp
1290 # Platform-specific configuration
1290 # Platform-specific configuration
1291 if os.name == 'nt':
1291 if os.name == 'nt':
1292 self.readline_startup_hook = readline.set_pre_input_hook
1292 self.readline_startup_hook = readline.set_pre_input_hook
1293 else:
1293 else:
1294 self.readline_startup_hook = readline.set_startup_hook
1294 self.readline_startup_hook = readline.set_startup_hook
1295
1295
1296 # Load user's initrc file (readline config)
1296 # Load user's initrc file (readline config)
1297 inputrc_name = os.environ.get('INPUTRC')
1297 inputrc_name = os.environ.get('INPUTRC')
1298 if inputrc_name is None:
1298 if inputrc_name is None:
1299 home_dir = get_home_dir()
1299 home_dir = get_home_dir()
1300 if home_dir is not None:
1300 if home_dir is not None:
1301 inputrc_name = os.path.join(home_dir,'.inputrc')
1301 inputrc_name = os.path.join(home_dir,'.inputrc')
1302 if os.path.isfile(inputrc_name):
1302 if os.path.isfile(inputrc_name):
1303 try:
1303 try:
1304 readline.read_init_file(inputrc_name)
1304 readline.read_init_file(inputrc_name)
1305 except:
1305 except:
1306 warn('Problems reading readline initialization file <%s>'
1306 warn('Problems reading readline initialization file <%s>'
1307 % inputrc_name)
1307 % inputrc_name)
1308
1308
1309 self.has_readline = 1
1309 self.has_readline = 1
1310 self.readline = readline
1310 self.readline = readline
1311 # save this in sys so embedded copies can restore it properly
1311 # save this in sys so embedded copies can restore it properly
1312 sys.ipcompleter = self.Completer.complete
1312 sys.ipcompleter = self.Completer.complete
1313 readline.set_completer(self.Completer.complete)
1313 readline.set_completer(self.Completer.complete)
1314
1314
1315 # Configure readline according to user's prefs
1315 # Configure readline according to user's prefs
1316 for rlcommand in self.rc.readline_parse_and_bind:
1316 for rlcommand in self.rc.readline_parse_and_bind:
1317 readline.parse_and_bind(rlcommand)
1317 readline.parse_and_bind(rlcommand)
1318
1318
1319 # remove some chars from the delimiters list
1319 # remove some chars from the delimiters list
1320 delims = readline.get_completer_delims()
1320 delims = readline.get_completer_delims()
1321 delims = delims.translate(string._idmap,
1321 delims = delims.translate(string._idmap,
1322 self.rc.readline_remove_delims)
1322 self.rc.readline_remove_delims)
1323 readline.set_completer_delims(delims)
1323 readline.set_completer_delims(delims)
1324 # otherwise we end up with a monster history after a while:
1324 # otherwise we end up with a monster history after a while:
1325 readline.set_history_length(1000)
1325 readline.set_history_length(1000)
1326 try:
1326 try:
1327 #print '*** Reading readline history' # dbg
1327 #print '*** Reading readline history' # dbg
1328 readline.read_history_file(self.histfile)
1328 readline.read_history_file(self.histfile)
1329 except IOError:
1329 except IOError:
1330 pass # It doesn't exist yet.
1330 pass # It doesn't exist yet.
1331
1331
1332 atexit.register(self.atexit_operations)
1332 atexit.register(self.atexit_operations)
1333 del atexit
1333 del atexit
1334
1334
1335 # Configure auto-indent for all platforms
1335 # Configure auto-indent for all platforms
1336 self.set_autoindent(self.rc.autoindent)
1336 self.set_autoindent(self.rc.autoindent)
1337
1337
1338 def ask_yes_no(self,prompt,default=True):
1338 def ask_yes_no(self,prompt,default=True):
1339 if self.rc.quiet:
1339 if self.rc.quiet:
1340 return True
1340 return True
1341 return ask_yes_no(prompt,default)
1341 return ask_yes_no(prompt,default)
1342
1342
1343 def _should_recompile(self,e):
1343 def _should_recompile(self,e):
1344 """Utility routine for edit_syntax_error"""
1344 """Utility routine for edit_syntax_error"""
1345
1345
1346 if e.filename in ('<ipython console>','<input>','<string>',
1346 if e.filename in ('<ipython console>','<input>','<string>',
1347 '<console>','<BackgroundJob compilation>',
1347 '<console>','<BackgroundJob compilation>',
1348 None):
1348 None):
1349
1349
1350 return False
1350 return False
1351 try:
1351 try:
1352 if (self.rc.autoedit_syntax and
1352 if (self.rc.autoedit_syntax and
1353 not self.ask_yes_no('Return to editor to correct syntax error? '
1353 not self.ask_yes_no('Return to editor to correct syntax error? '
1354 '[Y/n] ','y')):
1354 '[Y/n] ','y')):
1355 return False
1355 return False
1356 except EOFError:
1356 except EOFError:
1357 return False
1357 return False
1358
1358
1359 def int0(x):
1359 def int0(x):
1360 try:
1360 try:
1361 return int(x)
1361 return int(x)
1362 except TypeError:
1362 except TypeError:
1363 return 0
1363 return 0
1364 # always pass integer line and offset values to editor hook
1364 # always pass integer line and offset values to editor hook
1365 self.hooks.fix_error_editor(e.filename,
1365 self.hooks.fix_error_editor(e.filename,
1366 int0(e.lineno),int0(e.offset),e.msg)
1366 int0(e.lineno),int0(e.offset),e.msg)
1367 return True
1367 return True
1368
1368
1369 def edit_syntax_error(self):
1369 def edit_syntax_error(self):
1370 """The bottom half of the syntax error handler called in the main loop.
1370 """The bottom half of the syntax error handler called in the main loop.
1371
1371
1372 Loop until syntax error is fixed or user cancels.
1372 Loop until syntax error is fixed or user cancels.
1373 """
1373 """
1374
1374
1375 while self.SyntaxTB.last_syntax_error:
1375 while self.SyntaxTB.last_syntax_error:
1376 # copy and clear last_syntax_error
1376 # copy and clear last_syntax_error
1377 err = self.SyntaxTB.clear_err_state()
1377 err = self.SyntaxTB.clear_err_state()
1378 if not self._should_recompile(err):
1378 if not self._should_recompile(err):
1379 return
1379 return
1380 try:
1380 try:
1381 # may set last_syntax_error again if a SyntaxError is raised
1381 # may set last_syntax_error again if a SyntaxError is raised
1382 self.safe_execfile(err.filename,self.user_ns)
1382 self.safe_execfile(err.filename,self.user_ns)
1383 except:
1383 except:
1384 self.showtraceback()
1384 self.showtraceback()
1385 else:
1385 else:
1386 try:
1386 try:
1387 f = file(err.filename)
1387 f = file(err.filename)
1388 try:
1388 try:
1389 sys.displayhook(f.read())
1389 sys.displayhook(f.read())
1390 finally:
1390 finally:
1391 f.close()
1391 f.close()
1392 except:
1392 except:
1393 self.showtraceback()
1393 self.showtraceback()
1394
1394
1395 def showsyntaxerror(self, filename=None):
1395 def showsyntaxerror(self, filename=None):
1396 """Display the syntax error that just occurred.
1396 """Display the syntax error that just occurred.
1397
1397
1398 This doesn't display a stack trace because there isn't one.
1398 This doesn't display a stack trace because there isn't one.
1399
1399
1400 If a filename is given, it is stuffed in the exception instead
1400 If a filename is given, it is stuffed in the exception instead
1401 of what was there before (because Python's parser always uses
1401 of what was there before (because Python's parser always uses
1402 "<string>" when reading from a string).
1402 "<string>" when reading from a string).
1403 """
1403 """
1404 etype, value, last_traceback = sys.exc_info()
1404 etype, value, last_traceback = sys.exc_info()
1405
1405
1406 # See note about these variables in showtraceback() below
1406 # See note about these variables in showtraceback() below
1407 sys.last_type = etype
1407 sys.last_type = etype
1408 sys.last_value = value
1408 sys.last_value = value
1409 sys.last_traceback = last_traceback
1409 sys.last_traceback = last_traceback
1410
1410
1411 if filename and etype is SyntaxError:
1411 if filename and etype is SyntaxError:
1412 # Work hard to stuff the correct filename in the exception
1412 # Work hard to stuff the correct filename in the exception
1413 try:
1413 try:
1414 msg, (dummy_filename, lineno, offset, line) = value
1414 msg, (dummy_filename, lineno, offset, line) = value
1415 except:
1415 except:
1416 # Not the format we expect; leave it alone
1416 # Not the format we expect; leave it alone
1417 pass
1417 pass
1418 else:
1418 else:
1419 # Stuff in the right filename
1419 # Stuff in the right filename
1420 try:
1420 try:
1421 # Assume SyntaxError is a class exception
1421 # Assume SyntaxError is a class exception
1422 value = SyntaxError(msg, (filename, lineno, offset, line))
1422 value = SyntaxError(msg, (filename, lineno, offset, line))
1423 except:
1423 except:
1424 # If that failed, assume SyntaxError is a string
1424 # If that failed, assume SyntaxError is a string
1425 value = msg, (filename, lineno, offset, line)
1425 value = msg, (filename, lineno, offset, line)
1426 self.SyntaxTB(etype,value,[])
1426 self.SyntaxTB(etype,value,[])
1427
1427
1428 def debugger(self,force=False):
1428 def debugger(self,force=False):
1429 """Call the pydb/pdb debugger.
1429 """Call the pydb/pdb debugger.
1430
1430
1431 Keywords:
1431 Keywords:
1432
1432
1433 - force(False): by default, this routine checks the instance call_pdb
1433 - force(False): by default, this routine checks the instance call_pdb
1434 flag and does not actually invoke the debugger if the flag is false.
1434 flag and does not actually invoke the debugger if the flag is false.
1435 The 'force' option forces the debugger to activate even if the flag
1435 The 'force' option forces the debugger to activate even if the flag
1436 is false.
1436 is false.
1437 """
1437 """
1438
1438
1439 if not (force or self.call_pdb):
1439 if not (force or self.call_pdb):
1440 return
1440 return
1441
1441
1442 if not hasattr(sys,'last_traceback'):
1442 if not hasattr(sys,'last_traceback'):
1443 error('No traceback has been produced, nothing to debug.')
1443 error('No traceback has been produced, nothing to debug.')
1444 return
1444 return
1445
1445
1446 have_pydb = False
1446 have_pydb = False
1447 # use pydb if available
1447 # use pydb if available
1448 try:
1448 try:
1449 from pydb import pm
1449 from pydb import pm
1450 have_pydb = True
1450 have_pydb = True
1451 except ImportError:
1451 except ImportError:
1452 pass
1452 pass
1453 if not have_pydb:
1453 if not have_pydb:
1454 # fallback to our internal debugger
1454 # fallback to our internal debugger
1455 pm = lambda : self.InteractiveTB.debugger(force=True)
1455 pm = lambda : self.InteractiveTB.debugger(force=True)
1456 self.history_saving_wrapper(pm)()
1456 self.history_saving_wrapper(pm)()
1457
1457
1458 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1458 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1459 """Display the exception that just occurred.
1459 """Display the exception that just occurred.
1460
1460
1461 If nothing is known about the exception, this is the method which
1461 If nothing is known about the exception, this is the method which
1462 should be used throughout the code for presenting user tracebacks,
1462 should be used throughout the code for presenting user tracebacks,
1463 rather than directly invoking the InteractiveTB object.
1463 rather than directly invoking the InteractiveTB object.
1464
1464
1465 A specific showsyntaxerror() also exists, but this method can take
1465 A specific showsyntaxerror() also exists, but this method can take
1466 care of calling it if needed, so unless you are explicitly catching a
1466 care of calling it if needed, so unless you are explicitly catching a
1467 SyntaxError exception, don't try to analyze the stack manually and
1467 SyntaxError exception, don't try to analyze the stack manually and
1468 simply call this method."""
1468 simply call this method."""
1469
1469
1470 # Though this won't be called by syntax errors in the input line,
1470 # Though this won't be called by syntax errors in the input line,
1471 # there may be SyntaxError cases whith imported code.
1471 # there may be SyntaxError cases whith imported code.
1472 if exc_tuple is None:
1472 if exc_tuple is None:
1473 etype, value, tb = sys.exc_info()
1473 etype, value, tb = sys.exc_info()
1474 else:
1474 else:
1475 etype, value, tb = exc_tuple
1475 etype, value, tb = exc_tuple
1476
1476
1477 if etype is SyntaxError:
1477 if etype is SyntaxError:
1478 self.showsyntaxerror(filename)
1478 self.showsyntaxerror(filename)
1479 else:
1479 else:
1480 # WARNING: these variables are somewhat deprecated and not
1480 # WARNING: these variables are somewhat deprecated and not
1481 # necessarily safe to use in a threaded environment, but tools
1481 # necessarily safe to use in a threaded environment, but tools
1482 # like pdb depend on their existence, so let's set them. If we
1482 # like pdb depend on their existence, so let's set them. If we
1483 # find problems in the field, we'll need to revisit their use.
1483 # find problems in the field, we'll need to revisit their use.
1484 sys.last_type = etype
1484 sys.last_type = etype
1485 sys.last_value = value
1485 sys.last_value = value
1486 sys.last_traceback = tb
1486 sys.last_traceback = tb
1487
1487
1488 if etype in self.custom_exceptions:
1488 if etype in self.custom_exceptions:
1489 self.CustomTB(etype,value,tb)
1489 self.CustomTB(etype,value,tb)
1490 else:
1490 else:
1491 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1491 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1492 if self.InteractiveTB.call_pdb and self.has_readline:
1492 if self.InteractiveTB.call_pdb and self.has_readline:
1493 # pdb mucks up readline, fix it back
1493 # pdb mucks up readline, fix it back
1494 self.readline.set_completer(self.Completer.complete)
1494 self.readline.set_completer(self.Completer.complete)
1495
1495
1496 def mainloop(self,banner=None):
1496 def mainloop(self,banner=None):
1497 """Creates the local namespace and starts the mainloop.
1497 """Creates the local namespace and starts the mainloop.
1498
1498
1499 If an optional banner argument is given, it will override the
1499 If an optional banner argument is given, it will override the
1500 internally created default banner."""
1500 internally created default banner."""
1501
1501
1502 if self.rc.c: # Emulate Python's -c option
1502 if self.rc.c: # Emulate Python's -c option
1503 self.exec_init_cmd()
1503 self.exec_init_cmd()
1504 if banner is None:
1504 if banner is None:
1505 if not self.rc.banner:
1505 if not self.rc.banner:
1506 banner = ''
1506 banner = ''
1507 # banner is string? Use it directly!
1507 # banner is string? Use it directly!
1508 elif isinstance(self.rc.banner,basestring):
1508 elif isinstance(self.rc.banner,basestring):
1509 banner = self.rc.banner
1509 banner = self.rc.banner
1510 else:
1510 else:
1511 banner = self.BANNER+self.banner2
1511 banner = self.BANNER+self.banner2
1512
1512
1513 self.interact(banner)
1513 self.interact(banner)
1514
1514
1515 def exec_init_cmd(self):
1515 def exec_init_cmd(self):
1516 """Execute a command given at the command line.
1516 """Execute a command given at the command line.
1517
1517
1518 This emulates Python's -c option."""
1518 This emulates Python's -c option."""
1519
1519
1520 #sys.argv = ['-c']
1520 #sys.argv = ['-c']
1521 self.push(self.rc.c)
1521 self.push(self.rc.c)
1522
1522
1523 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1523 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1524 """Embeds IPython into a running python program.
1524 """Embeds IPython into a running python program.
1525
1525
1526 Input:
1526 Input:
1527
1527
1528 - header: An optional header message can be specified.
1528 - header: An optional header message can be specified.
1529
1529
1530 - local_ns, global_ns: working namespaces. If given as None, the
1530 - local_ns, global_ns: working namespaces. If given as None, the
1531 IPython-initialized one is updated with __main__.__dict__, so that
1531 IPython-initialized one is updated with __main__.__dict__, so that
1532 program variables become visible but user-specific configuration
1532 program variables become visible but user-specific configuration
1533 remains possible.
1533 remains possible.
1534
1534
1535 - stack_depth: specifies how many levels in the stack to go to
1535 - stack_depth: specifies how many levels in the stack to go to
1536 looking for namespaces (when local_ns and global_ns are None). This
1536 looking for namespaces (when local_ns and global_ns are None). This
1537 allows an intermediate caller to make sure that this function gets
1537 allows an intermediate caller to make sure that this function gets
1538 the namespace from the intended level in the stack. By default (0)
1538 the namespace from the intended level in the stack. By default (0)
1539 it will get its locals and globals from the immediate caller.
1539 it will get its locals and globals from the immediate caller.
1540
1540
1541 Warning: it's possible to use this in a program which is being run by
1541 Warning: it's possible to use this in a program which is being run by
1542 IPython itself (via %run), but some funny things will happen (a few
1542 IPython itself (via %run), but some funny things will happen (a few
1543 globals get overwritten). In the future this will be cleaned up, as
1543 globals get overwritten). In the future this will be cleaned up, as
1544 there is no fundamental reason why it can't work perfectly."""
1544 there is no fundamental reason why it can't work perfectly."""
1545
1545
1546 # Get locals and globals from caller
1546 # Get locals and globals from caller
1547 if local_ns is None or global_ns is None:
1547 if local_ns is None or global_ns is None:
1548 call_frame = sys._getframe(stack_depth).f_back
1548 call_frame = sys._getframe(stack_depth).f_back
1549
1549
1550 if local_ns is None:
1550 if local_ns is None:
1551 local_ns = call_frame.f_locals
1551 local_ns = call_frame.f_locals
1552 if global_ns is None:
1552 if global_ns is None:
1553 global_ns = call_frame.f_globals
1553 global_ns = call_frame.f_globals
1554
1554
1555 # Update namespaces and fire up interpreter
1555 # Update namespaces and fire up interpreter
1556
1556
1557 # The global one is easy, we can just throw it in
1557 # The global one is easy, we can just throw it in
1558 self.user_global_ns = global_ns
1558 self.user_global_ns = global_ns
1559
1559
1560 # but the user/local one is tricky: ipython needs it to store internal
1560 # but the user/local one is tricky: ipython needs it to store internal
1561 # data, but we also need the locals. We'll copy locals in the user
1561 # data, but we also need the locals. We'll copy locals in the user
1562 # one, but will track what got copied so we can delete them at exit.
1562 # one, but will track what got copied so we can delete them at exit.
1563 # This is so that a later embedded call doesn't see locals from a
1563 # This is so that a later embedded call doesn't see locals from a
1564 # previous call (which most likely existed in a separate scope).
1564 # previous call (which most likely existed in a separate scope).
1565 local_varnames = local_ns.keys()
1565 local_varnames = local_ns.keys()
1566 self.user_ns.update(local_ns)
1566 self.user_ns.update(local_ns)
1567
1567
1568 # Patch for global embedding to make sure that things don't overwrite
1568 # Patch for global embedding to make sure that things don't overwrite
1569 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1569 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1570 # FIXME. Test this a bit more carefully (the if.. is new)
1570 # FIXME. Test this a bit more carefully (the if.. is new)
1571 if local_ns is None and global_ns is None:
1571 if local_ns is None and global_ns is None:
1572 self.user_global_ns.update(__main__.__dict__)
1572 self.user_global_ns.update(__main__.__dict__)
1573
1573
1574 # make sure the tab-completer has the correct frame information, so it
1574 # make sure the tab-completer has the correct frame information, so it
1575 # actually completes using the frame's locals/globals
1575 # actually completes using the frame's locals/globals
1576 self.set_completer_frame()
1576 self.set_completer_frame()
1577
1577
1578 # before activating the interactive mode, we need to make sure that
1578 # before activating the interactive mode, we need to make sure that
1579 # all names in the builtin namespace needed by ipython point to
1579 # all names in the builtin namespace needed by ipython point to
1580 # ourselves, and not to other instances.
1580 # ourselves, and not to other instances.
1581 self.add_builtins()
1581 self.add_builtins()
1582
1582
1583 self.interact(header)
1583 self.interact(header)
1584
1584
1585 # now, purge out the user namespace from anything we might have added
1585 # now, purge out the user namespace from anything we might have added
1586 # from the caller's local namespace
1586 # from the caller's local namespace
1587 delvar = self.user_ns.pop
1587 delvar = self.user_ns.pop
1588 for var in local_varnames:
1588 for var in local_varnames:
1589 delvar(var,None)
1589 delvar(var,None)
1590 # and clean builtins we may have overridden
1590 # and clean builtins we may have overridden
1591 self.clean_builtins()
1591 self.clean_builtins()
1592
1592
1593 def interact(self, banner=None):
1593 def interact(self, banner=None):
1594 """Closely emulate the interactive Python console.
1594 """Closely emulate the interactive Python console.
1595
1595
1596 The optional banner argument specify the banner to print
1596 The optional banner argument specify the banner to print
1597 before the first interaction; by default it prints a banner
1597 before the first interaction; by default it prints a banner
1598 similar to the one printed by the real Python interpreter,
1598 similar to the one printed by the real Python interpreter,
1599 followed by the current class name in parentheses (so as not
1599 followed by the current class name in parentheses (so as not
1600 to confuse this with the real interpreter -- since it's so
1600 to confuse this with the real interpreter -- since it's so
1601 close!).
1601 close!).
1602
1602
1603 """
1603 """
1604
1604
1605 if self.exit_now:
1605 if self.exit_now:
1606 # batch run -> do not interact
1606 # batch run -> do not interact
1607 return
1607 return
1608 cprt = 'Type "copyright", "credits" or "license" for more information.'
1608 cprt = 'Type "copyright", "credits" or "license" for more information.'
1609 if banner is None:
1609 if banner is None:
1610 self.write("Python %s on %s\n%s\n(%s)\n" %
1610 self.write("Python %s on %s\n%s\n(%s)\n" %
1611 (sys.version, sys.platform, cprt,
1611 (sys.version, sys.platform, cprt,
1612 self.__class__.__name__))
1612 self.__class__.__name__))
1613 else:
1613 else:
1614 self.write(banner)
1614 self.write(banner)
1615
1615
1616 more = 0
1616 more = 0
1617
1617
1618 # Mark activity in the builtins
1618 # Mark activity in the builtins
1619 __builtin__.__dict__['__IPYTHON__active'] += 1
1619 __builtin__.__dict__['__IPYTHON__active'] += 1
1620
1620
1621 # exit_now is set by a call to %Exit or %Quit
1621 # exit_now is set by a call to %Exit or %Quit
1622 while not self.exit_now:
1622 while not self.exit_now:
1623 if more:
1623 if more:
1624 prompt = self.hooks.generate_prompt(True)
1624 prompt = self.hooks.generate_prompt(True)
1625 if self.autoindent:
1625 if self.autoindent:
1626 self.readline_startup_hook(self.pre_readline)
1626 self.readline_startup_hook(self.pre_readline)
1627 else:
1627 else:
1628 prompt = self.hooks.generate_prompt(False)
1628 prompt = self.hooks.generate_prompt(False)
1629 try:
1629 try:
1630 line = self.raw_input(prompt,more)
1630 line = self.raw_input(prompt,more)
1631 if self.exit_now:
1631 if self.exit_now:
1632 # quick exit on sys.std[in|out] close
1632 # quick exit on sys.std[in|out] close
1633 break
1633 break
1634 if self.autoindent:
1634 if self.autoindent:
1635 self.readline_startup_hook(None)
1635 self.readline_startup_hook(None)
1636 except KeyboardInterrupt:
1636 except KeyboardInterrupt:
1637 self.write('\nKeyboardInterrupt\n')
1637 self.write('\nKeyboardInterrupt\n')
1638 self.resetbuffer()
1638 self.resetbuffer()
1639 # keep cache in sync with the prompt counter:
1639 # keep cache in sync with the prompt counter:
1640 self.outputcache.prompt_count -= 1
1640 self.outputcache.prompt_count -= 1
1641
1641
1642 if self.autoindent:
1642 if self.autoindent:
1643 self.indent_current_nsp = 0
1643 self.indent_current_nsp = 0
1644 more = 0
1644 more = 0
1645 except EOFError:
1645 except EOFError:
1646 if self.autoindent:
1646 if self.autoindent:
1647 self.readline_startup_hook(None)
1647 self.readline_startup_hook(None)
1648 self.write('\n')
1648 self.write('\n')
1649 self.exit()
1649 self.exit()
1650 except bdb.BdbQuit:
1650 except bdb.BdbQuit:
1651 warn('The Python debugger has exited with a BdbQuit exception.\n'
1651 warn('The Python debugger has exited with a BdbQuit exception.\n'
1652 'Because of how pdb handles the stack, it is impossible\n'
1652 'Because of how pdb handles the stack, it is impossible\n'
1653 'for IPython to properly format this particular exception.\n'
1653 'for IPython to properly format this particular exception.\n'
1654 'IPython will resume normal operation.')
1654 'IPython will resume normal operation.')
1655 except:
1655 except:
1656 # exceptions here are VERY RARE, but they can be triggered
1656 # exceptions here are VERY RARE, but they can be triggered
1657 # asynchronously by signal handlers, for example.
1657 # asynchronously by signal handlers, for example.
1658 self.showtraceback()
1658 self.showtraceback()
1659 else:
1659 else:
1660 more = self.push(line)
1660 more = self.push(line)
1661 if (self.SyntaxTB.last_syntax_error and
1661 if (self.SyntaxTB.last_syntax_error and
1662 self.rc.autoedit_syntax):
1662 self.rc.autoedit_syntax):
1663 self.edit_syntax_error()
1663 self.edit_syntax_error()
1664
1664
1665 # We are off again...
1665 # We are off again...
1666 __builtin__.__dict__['__IPYTHON__active'] -= 1
1666 __builtin__.__dict__['__IPYTHON__active'] -= 1
1667
1667
1668 def excepthook(self, etype, value, tb):
1668 def excepthook(self, etype, value, tb):
1669 """One more defense for GUI apps that call sys.excepthook.
1669 """One more defense for GUI apps that call sys.excepthook.
1670
1670
1671 GUI frameworks like wxPython trap exceptions and call
1671 GUI frameworks like wxPython trap exceptions and call
1672 sys.excepthook themselves. I guess this is a feature that
1672 sys.excepthook themselves. I guess this is a feature that
1673 enables them to keep running after exceptions that would
1673 enables them to keep running after exceptions that would
1674 otherwise kill their mainloop. This is a bother for IPython
1674 otherwise kill their mainloop. This is a bother for IPython
1675 which excepts to catch all of the program exceptions with a try:
1675 which excepts to catch all of the program exceptions with a try:
1676 except: statement.
1676 except: statement.
1677
1677
1678 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1678 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1679 any app directly invokes sys.excepthook, it will look to the user like
1679 any app directly invokes sys.excepthook, it will look to the user like
1680 IPython crashed. In order to work around this, we can disable the
1680 IPython crashed. In order to work around this, we can disable the
1681 CrashHandler and replace it with this excepthook instead, which prints a
1681 CrashHandler and replace it with this excepthook instead, which prints a
1682 regular traceback using our InteractiveTB. In this fashion, apps which
1682 regular traceback using our InteractiveTB. In this fashion, apps which
1683 call sys.excepthook will generate a regular-looking exception from
1683 call sys.excepthook will generate a regular-looking exception from
1684 IPython, and the CrashHandler will only be triggered by real IPython
1684 IPython, and the CrashHandler will only be triggered by real IPython
1685 crashes.
1685 crashes.
1686
1686
1687 This hook should be used sparingly, only in places which are not likely
1687 This hook should be used sparingly, only in places which are not likely
1688 to be true IPython errors.
1688 to be true IPython errors.
1689 """
1689 """
1690 self.showtraceback((etype,value,tb),tb_offset=0)
1690 self.showtraceback((etype,value,tb),tb_offset=0)
1691
1691
1692 def expand_aliases(self,fn,rest):
1692 def expand_aliases(self,fn,rest):
1693 """ Expand multiple levels of aliases:
1693 """ Expand multiple levels of aliases:
1694
1694
1695 if:
1695 if:
1696
1696
1697 alias foo bar /tmp
1697 alias foo bar /tmp
1698 alias baz foo
1698 alias baz foo
1699
1699
1700 then:
1700 then:
1701
1701
1702 baz huhhahhei -> bar /tmp huhhahhei
1702 baz huhhahhei -> bar /tmp huhhahhei
1703
1703
1704 """
1704 """
1705 line = fn + " " + rest
1705 line = fn + " " + rest
1706
1706
1707 done = Set()
1707 done = Set()
1708 while 1:
1708 while 1:
1709 pre,fn,rest = self.split_user_input(line, pattern = self.shell_line_split)
1709 pre,fn,rest = self.split_user_input(line, pattern = self.shell_line_split)
1710 # print "!",fn,"!",rest # dbg
1710 # print "!",fn,"!",rest # dbg
1711 if fn in self.alias_table:
1711 if fn in self.alias_table:
1712 if fn in done:
1712 if fn in done:
1713 warn("Cyclic alias definition, repeated '%s'" % fn)
1713 warn("Cyclic alias definition, repeated '%s'" % fn)
1714 return ""
1714 return ""
1715 done.add(fn)
1715 done.add(fn)
1716
1716
1717 l2 = self.transform_alias(fn,rest)
1717 l2 = self.transform_alias(fn,rest)
1718 # dir -> dir
1718 # dir -> dir
1719 # print "alias",line, "->",l2 #dbg
1719 # print "alias",line, "->",l2 #dbg
1720 if l2 == line:
1720 if l2 == line:
1721 break
1721 break
1722 # ls -> ls -F should not recurse forever
1722 # ls -> ls -F should not recurse forever
1723 if l2.split(None,1)[0] == line.split(None,1)[0]:
1723 if l2.split(None,1)[0] == line.split(None,1)[0]:
1724 line = l2
1724 line = l2
1725 break
1725 break
1726
1726
1727 line=l2
1727 line=l2
1728
1728
1729
1729
1730 # print "al expand to",line #dbg
1730 # print "al expand to",line #dbg
1731 else:
1731 else:
1732 break
1732 break
1733
1733
1734 return line
1734 return line
1735
1735
1736 def transform_alias(self, alias,rest=''):
1736 def transform_alias(self, alias,rest=''):
1737 """ Transform alias to system command string.
1737 """ Transform alias to system command string.
1738 """
1738 """
1739 nargs,cmd = self.alias_table[alias]
1739 nargs,cmd = self.alias_table[alias]
1740 if ' ' in cmd and os.path.isfile(cmd):
1740 if ' ' in cmd and os.path.isfile(cmd):
1741 cmd = '"%s"' % cmd
1741 cmd = '"%s"' % cmd
1742
1742
1743 # Expand the %l special to be the user's input line
1743 # Expand the %l special to be the user's input line
1744 if cmd.find('%l') >= 0:
1744 if cmd.find('%l') >= 0:
1745 cmd = cmd.replace('%l',rest)
1745 cmd = cmd.replace('%l',rest)
1746 rest = ''
1746 rest = ''
1747 if nargs==0:
1747 if nargs==0:
1748 # Simple, argument-less aliases
1748 # Simple, argument-less aliases
1749 cmd = '%s %s' % (cmd,rest)
1749 cmd = '%s %s' % (cmd,rest)
1750 else:
1750 else:
1751 # Handle aliases with positional arguments
1751 # Handle aliases with positional arguments
1752 args = rest.split(None,nargs)
1752 args = rest.split(None,nargs)
1753 if len(args)< nargs:
1753 if len(args)< nargs:
1754 error('Alias <%s> requires %s arguments, %s given.' %
1754 error('Alias <%s> requires %s arguments, %s given.' %
1755 (alias,nargs,len(args)))
1755 (alias,nargs,len(args)))
1756 return None
1756 return None
1757 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1757 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1758 # Now call the macro, evaluating in the user's namespace
1758 # Now call the macro, evaluating in the user's namespace
1759 #print 'new command: <%r>' % cmd # dbg
1759 #print 'new command: <%r>' % cmd # dbg
1760 return cmd
1760 return cmd
1761
1761
1762 def call_alias(self,alias,rest=''):
1762 def call_alias(self,alias,rest=''):
1763 """Call an alias given its name and the rest of the line.
1763 """Call an alias given its name and the rest of the line.
1764
1764
1765 This is only used to provide backwards compatibility for users of
1765 This is only used to provide backwards compatibility for users of
1766 ipalias(), use of which is not recommended for anymore."""
1766 ipalias(), use of which is not recommended for anymore."""
1767
1767
1768 # Now call the macro, evaluating in the user's namespace
1768 # Now call the macro, evaluating in the user's namespace
1769 cmd = self.transform_alias(alias, rest)
1769 cmd = self.transform_alias(alias, rest)
1770 try:
1770 try:
1771 self.system(cmd)
1771 self.system(cmd)
1772 except:
1772 except:
1773 self.showtraceback()
1773 self.showtraceback()
1774
1774
1775 def indent_current_str(self):
1775 def indent_current_str(self):
1776 """return the current level of indentation as a string"""
1776 """return the current level of indentation as a string"""
1777 return self.indent_current_nsp * ' '
1777 return self.indent_current_nsp * ' '
1778
1778
1779 def autoindent_update(self,line):
1779 def autoindent_update(self,line):
1780 """Keep track of the indent level."""
1780 """Keep track of the indent level."""
1781
1781
1782 #debugx('line')
1782 #debugx('line')
1783 #debugx('self.indent_current_nsp')
1783 #debugx('self.indent_current_nsp')
1784 if self.autoindent:
1784 if self.autoindent:
1785 if line:
1785 if line:
1786 inisp = num_ini_spaces(line)
1786 inisp = num_ini_spaces(line)
1787 if inisp < self.indent_current_nsp:
1787 if inisp < self.indent_current_nsp:
1788 self.indent_current_nsp = inisp
1788 self.indent_current_nsp = inisp
1789
1789
1790 if line[-1] == ':':
1790 if line[-1] == ':':
1791 self.indent_current_nsp += 4
1791 self.indent_current_nsp += 4
1792 elif dedent_re.match(line):
1792 elif dedent_re.match(line):
1793 self.indent_current_nsp -= 4
1793 self.indent_current_nsp -= 4
1794 else:
1794 else:
1795 self.indent_current_nsp = 0
1795 self.indent_current_nsp = 0
1796
1796
1797 def runlines(self,lines):
1797 def runlines(self,lines):
1798 """Run a string of one or more lines of source.
1798 """Run a string of one or more lines of source.
1799
1799
1800 This method is capable of running a string containing multiple source
1800 This method is capable of running a string containing multiple source
1801 lines, as if they had been entered at the IPython prompt. Since it
1801 lines, as if they had been entered at the IPython prompt. Since it
1802 exposes IPython's processing machinery, the given strings can contain
1802 exposes IPython's processing machinery, the given strings can contain
1803 magic calls (%magic), special shell access (!cmd), etc."""
1803 magic calls (%magic), special shell access (!cmd), etc."""
1804
1804
1805 # We must start with a clean buffer, in case this is run from an
1805 # We must start with a clean buffer, in case this is run from an
1806 # interactive IPython session (via a magic, for example).
1806 # interactive IPython session (via a magic, for example).
1807 self.resetbuffer()
1807 self.resetbuffer()
1808 lines = lines.split('\n')
1808 lines = lines.split('\n')
1809 more = 0
1809 more = 0
1810 for line in lines:
1810 for line in lines:
1811 # skip blank lines so we don't mess up the prompt counter, but do
1811 # skip blank lines so we don't mess up the prompt counter, but do
1812 # NOT skip even a blank line if we are in a code block (more is
1812 # NOT skip even a blank line if we are in a code block (more is
1813 # true)
1813 # true)
1814 if line or more:
1814 if line or more:
1815 more = self.push(self.prefilter(line,more))
1815 more = self.push(self.prefilter(line,more))
1816 # IPython's runsource returns None if there was an error
1816 # IPython's runsource returns None if there was an error
1817 # compiling the code. This allows us to stop processing right
1817 # compiling the code. This allows us to stop processing right
1818 # away, so the user gets the error message at the right place.
1818 # away, so the user gets the error message at the right place.
1819 if more is None:
1819 if more is None:
1820 break
1820 break
1821 # final newline in case the input didn't have it, so that the code
1821 # final newline in case the input didn't have it, so that the code
1822 # actually does get executed
1822 # actually does get executed
1823 if more:
1823 if more:
1824 self.push('\n')
1824 self.push('\n')
1825
1825
1826 def runsource(self, source, filename='<input>', symbol='single'):
1826 def runsource(self, source, filename='<input>', symbol='single'):
1827 """Compile and run some source in the interpreter.
1827 """Compile and run some source in the interpreter.
1828
1828
1829 Arguments are as for compile_command().
1829 Arguments are as for compile_command().
1830
1830
1831 One several things can happen:
1831 One several things can happen:
1832
1832
1833 1) The input is incorrect; compile_command() raised an
1833 1) The input is incorrect; compile_command() raised an
1834 exception (SyntaxError or OverflowError). A syntax traceback
1834 exception (SyntaxError or OverflowError). A syntax traceback
1835 will be printed by calling the showsyntaxerror() method.
1835 will be printed by calling the showsyntaxerror() method.
1836
1836
1837 2) The input is incomplete, and more input is required;
1837 2) The input is incomplete, and more input is required;
1838 compile_command() returned None. Nothing happens.
1838 compile_command() returned None. Nothing happens.
1839
1839
1840 3) The input is complete; compile_command() returned a code
1840 3) The input is complete; compile_command() returned a code
1841 object. The code is executed by calling self.runcode() (which
1841 object. The code is executed by calling self.runcode() (which
1842 also handles run-time exceptions, except for SystemExit).
1842 also handles run-time exceptions, except for SystemExit).
1843
1843
1844 The return value is:
1844 The return value is:
1845
1845
1846 - True in case 2
1846 - True in case 2
1847
1847
1848 - False in the other cases, unless an exception is raised, where
1848 - False in the other cases, unless an exception is raised, where
1849 None is returned instead. This can be used by external callers to
1849 None is returned instead. This can be used by external callers to
1850 know whether to continue feeding input or not.
1850 know whether to continue feeding input or not.
1851
1851
1852 The return value can be used to decide whether to use sys.ps1 or
1852 The return value can be used to decide whether to use sys.ps1 or
1853 sys.ps2 to prompt the next line."""
1853 sys.ps2 to prompt the next line."""
1854
1854
1855 # if the source code has leading blanks, add 'if 1:\n' to it
1855 # if the source code has leading blanks, add 'if 1:\n' to it
1856 # this allows execution of indented pasted code. It is tempting
1856 # this allows execution of indented pasted code. It is tempting
1857 # to add '\n' at the end of source to run commands like ' a=1'
1857 # to add '\n' at the end of source to run commands like ' a=1'
1858 # directly, but this fails for more complicated scenarios
1858 # directly, but this fails for more complicated scenarios
1859 if source[:1] in [' ', '\t']:
1859 if source[:1] in [' ', '\t']:
1860 source = 'if 1:\n%s' % source
1860 source = 'if 1:\n%s' % source
1861
1861
1862 try:
1862 try:
1863 code = self.compile(source,filename,symbol)
1863 code = self.compile(source,filename,symbol)
1864 except (OverflowError, SyntaxError, ValueError):
1864 except (OverflowError, SyntaxError, ValueError):
1865 # Case 1
1865 # Case 1
1866 self.showsyntaxerror(filename)
1866 self.showsyntaxerror(filename)
1867 return None
1867 return None
1868
1868
1869 if code is None:
1869 if code is None:
1870 # Case 2
1870 # Case 2
1871 return True
1871 return True
1872
1872
1873 # Case 3
1873 # Case 3
1874 # We store the code object so that threaded shells and
1874 # We store the code object so that threaded shells and
1875 # custom exception handlers can access all this info if needed.
1875 # custom exception handlers can access all this info if needed.
1876 # The source corresponding to this can be obtained from the
1876 # The source corresponding to this can be obtained from the
1877 # buffer attribute as '\n'.join(self.buffer).
1877 # buffer attribute as '\n'.join(self.buffer).
1878 self.code_to_run = code
1878 self.code_to_run = code
1879 # now actually execute the code object
1879 # now actually execute the code object
1880 if self.runcode(code) == 0:
1880 if self.runcode(code) == 0:
1881 return False
1881 return False
1882 else:
1882 else:
1883 return None
1883 return None
1884
1884
1885 def runcode(self,code_obj):
1885 def runcode(self,code_obj):
1886 """Execute a code object.
1886 """Execute a code object.
1887
1887
1888 When an exception occurs, self.showtraceback() is called to display a
1888 When an exception occurs, self.showtraceback() is called to display a
1889 traceback.
1889 traceback.
1890
1890
1891 Return value: a flag indicating whether the code to be run completed
1891 Return value: a flag indicating whether the code to be run completed
1892 successfully:
1892 successfully:
1893
1893
1894 - 0: successful execution.
1894 - 0: successful execution.
1895 - 1: an error occurred.
1895 - 1: an error occurred.
1896 """
1896 """
1897
1897
1898 # Set our own excepthook in case the user code tries to call it
1898 # Set our own excepthook in case the user code tries to call it
1899 # directly, so that the IPython crash handler doesn't get triggered
1899 # directly, so that the IPython crash handler doesn't get triggered
1900 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1900 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1901
1901
1902 # we save the original sys.excepthook in the instance, in case config
1902 # we save the original sys.excepthook in the instance, in case config
1903 # code (such as magics) needs access to it.
1903 # code (such as magics) needs access to it.
1904 self.sys_excepthook = old_excepthook
1904 self.sys_excepthook = old_excepthook
1905 outflag = 1 # happens in more places, so it's easier as default
1905 outflag = 1 # happens in more places, so it's easier as default
1906 try:
1906 try:
1907 try:
1907 try:
1908 # Embedded instances require separate global/local namespaces
1908 # Embedded instances require separate global/local namespaces
1909 # so they can see both the surrounding (local) namespace and
1909 # so they can see both the surrounding (local) namespace and
1910 # the module-level globals when called inside another function.
1910 # the module-level globals when called inside another function.
1911 if self.embedded:
1911 if self.embedded:
1912 exec code_obj in self.user_global_ns, self.user_ns
1912 exec code_obj in self.user_global_ns, self.user_ns
1913 # Normal (non-embedded) instances should only have a single
1913 # Normal (non-embedded) instances should only have a single
1914 # namespace for user code execution, otherwise functions won't
1914 # namespace for user code execution, otherwise functions won't
1915 # see interactive top-level globals.
1915 # see interactive top-level globals.
1916 else:
1916 else:
1917 exec code_obj in self.user_ns
1917 exec code_obj in self.user_ns
1918 finally:
1918 finally:
1919 # Reset our crash handler in place
1919 # Reset our crash handler in place
1920 sys.excepthook = old_excepthook
1920 sys.excepthook = old_excepthook
1921 except SystemExit:
1921 except SystemExit:
1922 self.resetbuffer()
1922 self.resetbuffer()
1923 self.showtraceback()
1923 self.showtraceback()
1924 warn("Type %exit or %quit to exit IPython "
1924 warn("Type %exit or %quit to exit IPython "
1925 "(%Exit or %Quit do so unconditionally).",level=1)
1925 "(%Exit or %Quit do so unconditionally).",level=1)
1926 except self.custom_exceptions:
1926 except self.custom_exceptions:
1927 etype,value,tb = sys.exc_info()
1927 etype,value,tb = sys.exc_info()
1928 self.CustomTB(etype,value,tb)
1928 self.CustomTB(etype,value,tb)
1929 except:
1929 except:
1930 self.showtraceback()
1930 self.showtraceback()
1931 else:
1931 else:
1932 outflag = 0
1932 outflag = 0
1933 if softspace(sys.stdout, 0):
1933 if softspace(sys.stdout, 0):
1934 print
1934 print
1935 # Flush out code object which has been run (and source)
1935 # Flush out code object which has been run (and source)
1936 self.code_to_run = None
1936 self.code_to_run = None
1937 return outflag
1937 return outflag
1938
1938
1939 def push(self, line):
1939 def push(self, line):
1940 """Push a line to the interpreter.
1940 """Push a line to the interpreter.
1941
1941
1942 The line should not have a trailing newline; it may have
1942 The line should not have a trailing newline; it may have
1943 internal newlines. The line is appended to a buffer and the
1943 internal newlines. The line is appended to a buffer and the
1944 interpreter's runsource() method is called with the
1944 interpreter's runsource() method is called with the
1945 concatenated contents of the buffer as source. If this
1945 concatenated contents of the buffer as source. If this
1946 indicates that the command was executed or invalid, the buffer
1946 indicates that the command was executed or invalid, the buffer
1947 is reset; otherwise, the command is incomplete, and the buffer
1947 is reset; otherwise, the command is incomplete, and the buffer
1948 is left as it was after the line was appended. The return
1948 is left as it was after the line was appended. The return
1949 value is 1 if more input is required, 0 if the line was dealt
1949 value is 1 if more input is required, 0 if the line was dealt
1950 with in some way (this is the same as runsource()).
1950 with in some way (this is the same as runsource()).
1951 """
1951 """
1952
1952
1953 # autoindent management should be done here, and not in the
1953 # autoindent management should be done here, and not in the
1954 # interactive loop, since that one is only seen by keyboard input. We
1954 # interactive loop, since that one is only seen by keyboard input. We
1955 # need this done correctly even for code run via runlines (which uses
1955 # need this done correctly even for code run via runlines (which uses
1956 # push).
1956 # push).
1957
1957
1958 #print 'push line: <%s>' % line # dbg
1958 #print 'push line: <%s>' % line # dbg
1959 for subline in line.splitlines():
1959 for subline in line.splitlines():
1960 self.autoindent_update(subline)
1960 self.autoindent_update(subline)
1961 self.buffer.append(line)
1961 self.buffer.append(line)
1962 more = self.runsource('\n'.join(self.buffer), self.filename)
1962 more = self.runsource('\n'.join(self.buffer), self.filename)
1963 if not more:
1963 if not more:
1964 self.resetbuffer()
1964 self.resetbuffer()
1965 return more
1965 return more
1966
1966
1967 def resetbuffer(self):
1967 def resetbuffer(self):
1968 """Reset the input buffer."""
1968 """Reset the input buffer."""
1969 self.buffer[:] = []
1969 self.buffer[:] = []
1970
1970
1971 def raw_input(self,prompt='',continue_prompt=False):
1971 def raw_input(self,prompt='',continue_prompt=False):
1972 """Write a prompt and read a line.
1972 """Write a prompt and read a line.
1973
1973
1974 The returned line does not include the trailing newline.
1974 The returned line does not include the trailing newline.
1975 When the user enters the EOF key sequence, EOFError is raised.
1975 When the user enters the EOF key sequence, EOFError is raised.
1976
1976
1977 Optional inputs:
1977 Optional inputs:
1978
1978
1979 - prompt(''): a string to be printed to prompt the user.
1979 - prompt(''): a string to be printed to prompt the user.
1980
1980
1981 - continue_prompt(False): whether this line is the first one or a
1981 - continue_prompt(False): whether this line is the first one or a
1982 continuation in a sequence of inputs.
1982 continuation in a sequence of inputs.
1983 """
1983 """
1984
1984
1985 try:
1985 try:
1986 line = raw_input_original(prompt).decode(sys.stdin.encoding)
1986 line = raw_input_original(prompt).decode(sys.stdin.encoding)
1987 except ValueError:
1987 except ValueError:
1988 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1988 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1989 self.exit_now = True
1989 self.exit_now = True
1990 return ""
1990 return ""
1991
1991
1992
1992
1993 # Try to be reasonably smart about not re-indenting pasted input more
1993 # Try to be reasonably smart about not re-indenting pasted input more
1994 # than necessary. We do this by trimming out the auto-indent initial
1994 # than necessary. We do this by trimming out the auto-indent initial
1995 # spaces, if the user's actual input started itself with whitespace.
1995 # spaces, if the user's actual input started itself with whitespace.
1996 #debugx('self.buffer[-1]')
1996 #debugx('self.buffer[-1]')
1997
1997
1998 if self.autoindent:
1998 if self.autoindent:
1999 if num_ini_spaces(line) > self.indent_current_nsp:
1999 if num_ini_spaces(line) > self.indent_current_nsp:
2000 line = line[self.indent_current_nsp:]
2000 line = line[self.indent_current_nsp:]
2001 self.indent_current_nsp = 0
2001 self.indent_current_nsp = 0
2002
2002
2003 # store the unfiltered input before the user has any chance to modify
2003 # store the unfiltered input before the user has any chance to modify
2004 # it.
2004 # it.
2005 if line.strip():
2005 if line.strip():
2006 if continue_prompt:
2006 if continue_prompt:
2007 self.input_hist_raw[-1] += '%s\n' % line
2007 self.input_hist_raw[-1] += '%s\n' % line
2008 if self.has_readline: # and some config option is set?
2008 if self.has_readline: # and some config option is set?
2009 try:
2009 try:
2010 histlen = self.readline.get_current_history_length()
2010 histlen = self.readline.get_current_history_length()
2011 newhist = self.input_hist_raw[-1].rstrip()
2011 newhist = self.input_hist_raw[-1].rstrip()
2012 self.readline.remove_history_item(histlen-1)
2012 self.readline.remove_history_item(histlen-1)
2013 self.readline.replace_history_item(histlen-2,newhist)
2013 self.readline.replace_history_item(histlen-2,newhist)
2014 except AttributeError:
2014 except AttributeError:
2015 pass # re{move,place}_history_item are new in 2.4.
2015 pass # re{move,place}_history_item are new in 2.4.
2016 else:
2016 else:
2017 self.input_hist_raw.append('%s\n' % line)
2017 self.input_hist_raw.append('%s\n' % line)
2018
2018
2019 try:
2019 try:
2020 lineout = self.prefilter(line,continue_prompt)
2020 lineout = self.prefilter(line,continue_prompt)
2021 except:
2021 except:
2022 # blanket except, in case a user-defined prefilter crashes, so it
2022 # blanket except, in case a user-defined prefilter crashes, so it
2023 # can't take all of ipython with it.
2023 # can't take all of ipython with it.
2024 self.showtraceback()
2024 self.showtraceback()
2025 return ''
2025 return ''
2026 else:
2026 else:
2027 return lineout
2027 return lineout
2028
2028
2029 def split_user_input(self,line, pattern = None):
2029 def split_user_input(self,line, pattern = None):
2030 """Split user input into pre-char, function part and rest."""
2030 """Split user input into pre-char, function part and rest."""
2031
2031
2032 if pattern is None:
2032 if pattern is None:
2033 pattern = self.line_split
2033 pattern = self.line_split
2034
2034
2035 lsplit = pattern.match(line)
2035 lsplit = pattern.match(line)
2036 if lsplit is None: # no regexp match returns None
2036 if lsplit is None: # no regexp match returns None
2037 #print "match failed for line '%s'" % line # dbg
2037 #print "match failed for line '%s'" % line # dbg
2038 try:
2038 try:
2039 iFun,theRest = line.split(None,1)
2039 iFun,theRest = line.split(None,1)
2040 except ValueError:
2040 except ValueError:
2041 #print "split failed for line '%s'" % line # dbg
2041 #print "split failed for line '%s'" % line # dbg
2042 iFun,theRest = line,''
2042 iFun,theRest = line,''
2043 pre = re.match('^(\s*)(.*)',line).groups()[0]
2043 pre = re.match('^(\s*)(.*)',line).groups()[0]
2044 else:
2044 else:
2045 pre,iFun,theRest = lsplit.groups()
2045 pre,iFun,theRest = lsplit.groups()
2046
2046
2047 #print 'line:<%s>' % line # dbg
2047 #print 'line:<%s>' % line # dbg
2048 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2048 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2049 return pre,iFun.strip(),theRest
2049 return pre,iFun.strip(),theRest
2050
2050
2051 # THIS VERSION IS BROKEN!!! It was intended to prevent spurious attribute
2051 # THIS VERSION IS BROKEN!!! It was intended to prevent spurious attribute
2052 # accesses with a more stringent check of inputs, but it introduced other
2052 # accesses with a more stringent check of inputs, but it introduced other
2053 # bugs. Disable it for now until I can properly fix it.
2053 # bugs. Disable it for now until I can properly fix it.
2054 def split_user_inputBROKEN(self,line):
2054 def split_user_inputBROKEN(self,line):
2055 """Split user input into pre-char, function part and rest."""
2055 """Split user input into pre-char, function part and rest."""
2056
2056
2057 lsplit = self.line_split.match(line)
2057 lsplit = self.line_split.match(line)
2058 if lsplit is None: # no regexp match returns None
2058 if lsplit is None: # no regexp match returns None
2059 lsplit = self.line_split_fallback.match(line)
2059 lsplit = self.line_split_fallback.match(line)
2060
2060
2061 #pre,iFun,theRest = lsplit.groups() # dbg
2061 #pre,iFun,theRest = lsplit.groups() # dbg
2062 #print 'line:<%s>' % line # dbg
2062 #print 'line:<%s>' % line # dbg
2063 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2063 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
2064 #return pre,iFun.strip(),theRest # dbg
2064 #return pre,iFun.strip(),theRest # dbg
2065
2065
2066 return lsplit.groups()
2066 return lsplit.groups()
2067
2067
2068 def _prefilter(self, line, continue_prompt):
2068 def _prefilter(self, line, continue_prompt):
2069 """Calls different preprocessors, depending on the form of line."""
2069 """Calls different preprocessors, depending on the form of line."""
2070
2070
2071 # All handlers *must* return a value, even if it's blank ('').
2071 # All handlers *must* return a value, even if it's blank ('').
2072
2072
2073 # Lines are NOT logged here. Handlers should process the line as
2073 # Lines are NOT logged here. Handlers should process the line as
2074 # needed, update the cache AND log it (so that the input cache array
2074 # needed, update the cache AND log it (so that the input cache array
2075 # stays synced).
2075 # stays synced).
2076
2076
2077 # This function is _very_ delicate, and since it's also the one which
2077 # This function is _very_ delicate, and since it's also the one which
2078 # determines IPython's response to user input, it must be as efficient
2078 # determines IPython's response to user input, it must be as efficient
2079 # as possible. For this reason it has _many_ returns in it, trying
2079 # as possible. For this reason it has _many_ returns in it, trying
2080 # always to exit as quickly as it can figure out what it needs to do.
2080 # always to exit as quickly as it can figure out what it needs to do.
2081
2081
2082 # This function is the main responsible for maintaining IPython's
2082 # This function is the main responsible for maintaining IPython's
2083 # behavior respectful of Python's semantics. So be _very_ careful if
2083 # behavior respectful of Python's semantics. So be _very_ careful if
2084 # making changes to anything here.
2084 # making changes to anything here.
2085
2085
2086 #.....................................................................
2086 #.....................................................................
2087 # Code begins
2087 # Code begins
2088
2088
2089 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2089 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2090
2090
2091 # save the line away in case we crash, so the post-mortem handler can
2091 # save the line away in case we crash, so the post-mortem handler can
2092 # record it
2092 # record it
2093 self._last_input_line = line
2093 self._last_input_line = line
2094
2094
2095 #print '***line: <%s>' % line # dbg
2095 #print '***line: <%s>' % line # dbg
2096
2096
2097 # the input history needs to track even empty lines
2097 # the input history needs to track even empty lines
2098 stripped = line.strip()
2098 stripped = line.strip()
2099
2099
2100 if not stripped:
2100 if not stripped:
2101 if not continue_prompt:
2101 if not continue_prompt:
2102 self.outputcache.prompt_count -= 1
2102 self.outputcache.prompt_count -= 1
2103 return self.handle_normal(line,continue_prompt)
2103 return self.handle_normal(line,continue_prompt)
2104 #return self.handle_normal('',continue_prompt)
2104 #return self.handle_normal('',continue_prompt)
2105
2105
2106 # print '***cont',continue_prompt # dbg
2106 # print '***cont',continue_prompt # dbg
2107 # special handlers are only allowed for single line statements
2107 # special handlers are only allowed for single line statements
2108 if continue_prompt and not self.rc.multi_line_specials:
2108 if continue_prompt and not self.rc.multi_line_specials:
2109 return self.handle_normal(line,continue_prompt)
2109 return self.handle_normal(line,continue_prompt)
2110
2110
2111
2111
2112 # For the rest, we need the structure of the input
2112 # For the rest, we need the structure of the input
2113 pre,iFun,theRest = self.split_user_input(line)
2113 pre,iFun,theRest = self.split_user_input(line)
2114
2114
2115 # See whether any pre-existing handler can take care of it
2115 # See whether any pre-existing handler can take care of it
2116
2116
2117 rewritten = self.hooks.input_prefilter(stripped)
2117 rewritten = self.hooks.input_prefilter(stripped)
2118 if rewritten != stripped: # ok, some prefilter did something
2118 if rewritten != stripped: # ok, some prefilter did something
2119 rewritten = pre + rewritten # add indentation
2119 rewritten = pre + rewritten # add indentation
2120 return self.handle_normal(rewritten)
2120 return self.handle_normal(rewritten)
2121
2121
2122 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2122 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2123
2124 # Next, check if we can automatically execute this thing
2125
2126 # Allow ! in multi-line statements if multi_line_specials is on:
2127 if continue_prompt and self.rc.multi_line_specials and \
2128 iFun.startswith(self.ESC_SHELL):
2129 return self.handle_shell_escape(line,continue_prompt,
2130 pre=pre,iFun=iFun,
2131 theRest=theRest)
2123
2132
2124 # First check for explicit escapes in the last/first character
2133 # First check for explicit escapes in the last/first character
2125 handler = None
2134 handler = None
2126 if line[-1] == self.ESC_HELP:
2135 if line[-1] == self.ESC_HELP:
2127 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2136 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2128 if handler is None:
2137 if handler is None:
2129 # look at the first character of iFun, NOT of line, so we skip
2138 # look at the first character of iFun, NOT of line, so we skip
2130 # leading whitespace in multiline input
2139 # leading whitespace in multiline input
2131 handler = self.esc_handlers.get(iFun[0:1])
2140 handler = self.esc_handlers.get(iFun[0:1])
2132 if handler is not None:
2141 if handler is not None:
2133 return handler(line,continue_prompt,pre,iFun,theRest)
2142 return handler(line,continue_prompt,pre,iFun,theRest)
2134 # Emacs ipython-mode tags certain input lines
2143 # Emacs ipython-mode tags certain input lines
2135 if line.endswith('# PYTHON-MODE'):
2144 if line.endswith('# PYTHON-MODE'):
2136 return self.handle_emacs(line,continue_prompt)
2145 return self.handle_emacs(line,continue_prompt)
2137
2146
2138 # Next, check if we can automatically execute this thing
2139
2140 # Allow ! in multi-line statements if multi_line_specials is on:
2141 if continue_prompt and self.rc.multi_line_specials and \
2142 iFun.startswith(self.ESC_SHELL):
2143 return self.handle_shell_escape(line,continue_prompt,
2144 pre=pre,iFun=iFun,
2145 theRest=theRest)
2146
2147 # Let's try to find if the input line is a magic fn
2147 # Let's try to find if the input line is a magic fn
2148 oinfo = None
2148 oinfo = None
2149 if hasattr(self,'magic_'+iFun):
2149 if hasattr(self,'magic_'+iFun):
2150 # WARNING: _ofind uses getattr(), so it can consume generators and
2150 # WARNING: _ofind uses getattr(), so it can consume generators and
2151 # cause other side effects.
2151 # cause other side effects.
2152 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2152 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2153 if oinfo['ismagic']:
2153 if oinfo['ismagic']:
2154 # Be careful not to call magics when a variable assignment is
2154 # Be careful not to call magics when a variable assignment is
2155 # being made (ls='hi', for example)
2155 # being made (ls='hi', for example)
2156 if self.rc.automagic and \
2156 if self.rc.automagic and \
2157 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2157 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2158 (self.rc.multi_line_specials or not continue_prompt):
2158 (self.rc.multi_line_specials or not continue_prompt):
2159 return self.handle_magic(line,continue_prompt,
2159 return self.handle_magic(line,continue_prompt,
2160 pre,iFun,theRest)
2160 pre,iFun,theRest)
2161 else:
2161 else:
2162 return self.handle_normal(line,continue_prompt)
2162 return self.handle_normal(line,continue_prompt)
2163
2163
2164 # If the rest of the line begins with an (in)equality, assginment or
2164 # If the rest of the line begins with an (in)equality, assginment or
2165 # function call, we should not call _ofind but simply execute it.
2165 # function call, we should not call _ofind but simply execute it.
2166 # This avoids spurious geattr() accesses on objects upon assignment.
2166 # This avoids spurious geattr() accesses on objects upon assignment.
2167 #
2167 #
2168 # It also allows users to assign to either alias or magic names true
2168 # It also allows users to assign to either alias or magic names true
2169 # python variables (the magic/alias systems always take second seat to
2169 # python variables (the magic/alias systems always take second seat to
2170 # true python code).
2170 # true python code).
2171 if theRest and theRest[0] in '!=()':
2171 if theRest and theRest[0] in '!=()':
2172 return self.handle_normal(line,continue_prompt)
2172 return self.handle_normal(line,continue_prompt)
2173
2173
2174 if oinfo is None:
2174 if oinfo is None:
2175 # let's try to ensure that _oinfo is ONLY called when autocall is
2175 # let's try to ensure that _oinfo is ONLY called when autocall is
2176 # on. Since it has inevitable potential side effects, at least
2176 # on. Since it has inevitable potential side effects, at least
2177 # having autocall off should be a guarantee to the user that no
2177 # having autocall off should be a guarantee to the user that no
2178 # weird things will happen.
2178 # weird things will happen.
2179
2179
2180 if self.rc.autocall:
2180 if self.rc.autocall:
2181 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2181 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2182 else:
2182 else:
2183 # in this case, all that's left is either an alias or
2183 # in this case, all that's left is either an alias or
2184 # processing the line normally.
2184 # processing the line normally.
2185 if iFun in self.alias_table:
2185 if iFun in self.alias_table:
2186 # if autocall is off, by not running _ofind we won't know
2186 # if autocall is off, by not running _ofind we won't know
2187 # whether the given name may also exist in one of the
2187 # whether the given name may also exist in one of the
2188 # user's namespace. At this point, it's best to do a
2188 # user's namespace. At this point, it's best to do a
2189 # quick check just to be sure that we don't let aliases
2189 # quick check just to be sure that we don't let aliases
2190 # shadow variables.
2190 # shadow variables.
2191 head = iFun.split('.',1)[0]
2191 head = iFun.split('.',1)[0]
2192 if head in self.user_ns or head in self.internal_ns \
2192 if head in self.user_ns or head in self.internal_ns \
2193 or head in __builtin__.__dict__:
2193 or head in __builtin__.__dict__:
2194 return self.handle_normal(line,continue_prompt)
2194 return self.handle_normal(line,continue_prompt)
2195 else:
2195 else:
2196 return self.handle_alias(line,continue_prompt,
2196 return self.handle_alias(line,continue_prompt,
2197 pre,iFun,theRest)
2197 pre,iFun,theRest)
2198
2198
2199 else:
2199 else:
2200 return self.handle_normal(line,continue_prompt)
2200 return self.handle_normal(line,continue_prompt)
2201
2201
2202 if not oinfo['found']:
2202 if not oinfo['found']:
2203 return self.handle_normal(line,continue_prompt)
2203 return self.handle_normal(line,continue_prompt)
2204 else:
2204 else:
2205 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2205 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2206 if oinfo['isalias']:
2206 if oinfo['isalias']:
2207 return self.handle_alias(line,continue_prompt,
2207 return self.handle_alias(line,continue_prompt,
2208 pre,iFun,theRest)
2208 pre,iFun,theRest)
2209
2209
2210 if (self.rc.autocall
2210 if (self.rc.autocall
2211 and
2211 and
2212 (
2212 (
2213 #only consider exclusion re if not "," or ";" autoquoting
2213 #only consider exclusion re if not "," or ";" autoquoting
2214 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2214 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2215 or pre == self.ESC_PAREN) or
2215 or pre == self.ESC_PAREN) or
2216 (not self.re_exclude_auto.match(theRest)))
2216 (not self.re_exclude_auto.match(theRest)))
2217 and
2217 and
2218 self.re_fun_name.match(iFun) and
2218 self.re_fun_name.match(iFun) and
2219 callable(oinfo['obj'])) :
2219 callable(oinfo['obj'])) :
2220 #print 'going auto' # dbg
2220 #print 'going auto' # dbg
2221 return self.handle_auto(line,continue_prompt,
2221 return self.handle_auto(line,continue_prompt,
2222 pre,iFun,theRest,oinfo['obj'])
2222 pre,iFun,theRest,oinfo['obj'])
2223 else:
2223 else:
2224 #print 'was callable?', callable(oinfo['obj']) # dbg
2224 #print 'was callable?', callable(oinfo['obj']) # dbg
2225 return self.handle_normal(line,continue_prompt)
2225 return self.handle_normal(line,continue_prompt)
2226
2226
2227 # If we get here, we have a normal Python line. Log and return.
2227 # If we get here, we have a normal Python line. Log and return.
2228 return self.handle_normal(line,continue_prompt)
2228 return self.handle_normal(line,continue_prompt)
2229
2229
2230 def _prefilter_dumb(self, line, continue_prompt):
2230 def _prefilter_dumb(self, line, continue_prompt):
2231 """simple prefilter function, for debugging"""
2231 """simple prefilter function, for debugging"""
2232 return self.handle_normal(line,continue_prompt)
2232 return self.handle_normal(line,continue_prompt)
2233
2233
2234
2234
2235 def multiline_prefilter(self, line, continue_prompt):
2235 def multiline_prefilter(self, line, continue_prompt):
2236 """ Run _prefilter for each line of input
2236 """ Run _prefilter for each line of input
2237
2237
2238 Covers cases where there are multiple lines in the user entry,
2238 Covers cases where there are multiple lines in the user entry,
2239 which is the case when the user goes back to a multiline history
2239 which is the case when the user goes back to a multiline history
2240 entry and presses enter.
2240 entry and presses enter.
2241
2241
2242 """
2242 """
2243 out = []
2243 out = []
2244 for l in line.rstrip('\n').split('\n'):
2244 for l in line.rstrip('\n').split('\n'):
2245 out.append(self._prefilter(l, continue_prompt))
2245 out.append(self._prefilter(l, continue_prompt))
2246 return '\n'.join(out)
2246 return '\n'.join(out)
2247
2247
2248 # Set the default prefilter() function (this can be user-overridden)
2248 # Set the default prefilter() function (this can be user-overridden)
2249 prefilter = multiline_prefilter
2249 prefilter = multiline_prefilter
2250
2250
2251 def handle_normal(self,line,continue_prompt=None,
2251 def handle_normal(self,line,continue_prompt=None,
2252 pre=None,iFun=None,theRest=None):
2252 pre=None,iFun=None,theRest=None):
2253 """Handle normal input lines. Use as a template for handlers."""
2253 """Handle normal input lines. Use as a template for handlers."""
2254
2254
2255 # With autoindent on, we need some way to exit the input loop, and I
2255 # With autoindent on, we need some way to exit the input loop, and I
2256 # don't want to force the user to have to backspace all the way to
2256 # don't want to force the user to have to backspace all the way to
2257 # clear the line. The rule will be in this case, that either two
2257 # clear the line. The rule will be in this case, that either two
2258 # lines of pure whitespace in a row, or a line of pure whitespace but
2258 # lines of pure whitespace in a row, or a line of pure whitespace but
2259 # of a size different to the indent level, will exit the input loop.
2259 # of a size different to the indent level, will exit the input loop.
2260
2260
2261 if (continue_prompt and self.autoindent and line.isspace() and
2261 if (continue_prompt and self.autoindent and line.isspace() and
2262 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2262 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2263 (self.buffer[-1]).isspace() )):
2263 (self.buffer[-1]).isspace() )):
2264 line = ''
2264 line = ''
2265
2265
2266 self.log(line,line,continue_prompt)
2266 self.log(line,line,continue_prompt)
2267 return line
2267 return line
2268
2268
2269 def handle_alias(self,line,continue_prompt=None,
2269 def handle_alias(self,line,continue_prompt=None,
2270 pre=None,iFun=None,theRest=None):
2270 pre=None,iFun=None,theRest=None):
2271 """Handle alias input lines. """
2271 """Handle alias input lines. """
2272
2272
2273 # pre is needed, because it carries the leading whitespace. Otherwise
2273 # pre is needed, because it carries the leading whitespace. Otherwise
2274 # aliases won't work in indented sections.
2274 # aliases won't work in indented sections.
2275 transformed = self.expand_aliases(iFun, theRest)
2275 transformed = self.expand_aliases(iFun, theRest)
2276 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2276 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2277 self.log(line,line_out,continue_prompt)
2277 self.log(line,line_out,continue_prompt)
2278 #print 'line out:',line_out # dbg
2278 #print 'line out:',line_out # dbg
2279 return line_out
2279 return line_out
2280
2280
2281 def handle_shell_escape(self, line, continue_prompt=None,
2281 def handle_shell_escape(self, line, continue_prompt=None,
2282 pre=None,iFun=None,theRest=None):
2282 pre=None,iFun=None,theRest=None):
2283 """Execute the line in a shell, empty return value"""
2283 """Execute the line in a shell, empty return value"""
2284
2284
2285 #print 'line in :', `line` # dbg
2285 #print 'line in :', `line` # dbg
2286 # Example of a special handler. Others follow a similar pattern.
2286 # Example of a special handler. Others follow a similar pattern.
2287 if line.lstrip().startswith('!!'):
2287 if line.lstrip().startswith('!!'):
2288 # rewrite iFun/theRest to properly hold the call to %sx and
2288 # rewrite iFun/theRest to properly hold the call to %sx and
2289 # the actual command to be executed, so handle_magic can work
2289 # the actual command to be executed, so handle_magic can work
2290 # correctly
2290 # correctly
2291 theRest = '%s %s' % (iFun[2:],theRest)
2291 theRest = '%s %s' % (iFun[2:],theRest)
2292 iFun = 'sx'
2292 iFun = 'sx'
2293 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2293 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2294 line.lstrip()[2:]),
2294 line.lstrip()[2:]),
2295 continue_prompt,pre,iFun,theRest)
2295 continue_prompt,pre,iFun,theRest)
2296 else:
2296 else:
2297 cmd=line.lstrip().lstrip('!')
2297 cmd=line.lstrip().lstrip('!')
2298 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2298 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2299 # update cache/log and return
2299 # update cache/log and return
2300 self.log(line,line_out,continue_prompt)
2300 self.log(line,line_out,continue_prompt)
2301 return line_out
2301 return line_out
2302
2302
2303 def handle_magic(self, line, continue_prompt=None,
2303 def handle_magic(self, line, continue_prompt=None,
2304 pre=None,iFun=None,theRest=None):
2304 pre=None,iFun=None,theRest=None):
2305 """Execute magic functions."""
2305 """Execute magic functions."""
2306
2306
2307
2307
2308 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2308 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2309 self.log(line,cmd,continue_prompt)
2309 self.log(line,cmd,continue_prompt)
2310 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2310 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2311 return cmd
2311 return cmd
2312
2312
2313 def handle_auto(self, line, continue_prompt=None,
2313 def handle_auto(self, line, continue_prompt=None,
2314 pre=None,iFun=None,theRest=None,obj=None):
2314 pre=None,iFun=None,theRest=None,obj=None):
2315 """Hande lines which can be auto-executed, quoting if requested."""
2315 """Hande lines which can be auto-executed, quoting if requested."""
2316
2316
2317 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2317 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2318
2318
2319 # This should only be active for single-line input!
2319 # This should only be active for single-line input!
2320 if continue_prompt:
2320 if continue_prompt:
2321 self.log(line,line,continue_prompt)
2321 self.log(line,line,continue_prompt)
2322 return line
2322 return line
2323
2323
2324 auto_rewrite = True
2324 auto_rewrite = True
2325
2325
2326 if pre == self.ESC_QUOTE:
2326 if pre == self.ESC_QUOTE:
2327 # Auto-quote splitting on whitespace
2327 # Auto-quote splitting on whitespace
2328 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2328 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2329 elif pre == self.ESC_QUOTE2:
2329 elif pre == self.ESC_QUOTE2:
2330 # Auto-quote whole string
2330 # Auto-quote whole string
2331 newcmd = '%s("%s")' % (iFun,theRest)
2331 newcmd = '%s("%s")' % (iFun,theRest)
2332 elif pre == self.ESC_PAREN:
2332 elif pre == self.ESC_PAREN:
2333 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2333 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2334 else:
2334 else:
2335 # Auto-paren.
2335 # Auto-paren.
2336 # We only apply it to argument-less calls if the autocall
2336 # We only apply it to argument-less calls if the autocall
2337 # parameter is set to 2. We only need to check that autocall is <
2337 # parameter is set to 2. We only need to check that autocall is <
2338 # 2, since this function isn't called unless it's at least 1.
2338 # 2, since this function isn't called unless it's at least 1.
2339 if not theRest and (self.rc.autocall < 2):
2339 if not theRest and (self.rc.autocall < 2):
2340 newcmd = '%s %s' % (iFun,theRest)
2340 newcmd = '%s %s' % (iFun,theRest)
2341 auto_rewrite = False
2341 auto_rewrite = False
2342 else:
2342 else:
2343 if theRest.startswith('['):
2343 if theRest.startswith('['):
2344 if hasattr(obj,'__getitem__'):
2344 if hasattr(obj,'__getitem__'):
2345 # Don't autocall in this case: item access for an object
2345 # Don't autocall in this case: item access for an object
2346 # which is BOTH callable and implements __getitem__.
2346 # which is BOTH callable and implements __getitem__.
2347 newcmd = '%s %s' % (iFun,theRest)
2347 newcmd = '%s %s' % (iFun,theRest)
2348 auto_rewrite = False
2348 auto_rewrite = False
2349 else:
2349 else:
2350 # if the object doesn't support [] access, go ahead and
2350 # if the object doesn't support [] access, go ahead and
2351 # autocall
2351 # autocall
2352 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2352 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2353 elif theRest.endswith(';'):
2353 elif theRest.endswith(';'):
2354 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2354 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2355 else:
2355 else:
2356 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2356 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2357
2357
2358 if auto_rewrite:
2358 if auto_rewrite:
2359 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2359 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2360 # log what is now valid Python, not the actual user input (without the
2360 # log what is now valid Python, not the actual user input (without the
2361 # final newline)
2361 # final newline)
2362 self.log(line,newcmd,continue_prompt)
2362 self.log(line,newcmd,continue_prompt)
2363 return newcmd
2363 return newcmd
2364
2364
2365 def handle_help(self, line, continue_prompt=None,
2365 def handle_help(self, line, continue_prompt=None,
2366 pre=None,iFun=None,theRest=None):
2366 pre=None,iFun=None,theRest=None):
2367 """Try to get some help for the object.
2367 """Try to get some help for the object.
2368
2368
2369 obj? or ?obj -> basic information.
2369 obj? or ?obj -> basic information.
2370 obj?? or ??obj -> more details.
2370 obj?? or ??obj -> more details.
2371 """
2371 """
2372
2372
2373 # We need to make sure that we don't process lines which would be
2373 # We need to make sure that we don't process lines which would be
2374 # otherwise valid python, such as "x=1 # what?"
2374 # otherwise valid python, such as "x=1 # what?"
2375 try:
2375 try:
2376 codeop.compile_command(line)
2376 codeop.compile_command(line)
2377 except SyntaxError:
2377 except SyntaxError:
2378 # We should only handle as help stuff which is NOT valid syntax
2378 # We should only handle as help stuff which is NOT valid syntax
2379 if line[0]==self.ESC_HELP:
2379 if line[0]==self.ESC_HELP:
2380 line = line[1:]
2380 line = line[1:]
2381 elif line[-1]==self.ESC_HELP:
2381 elif line[-1]==self.ESC_HELP:
2382 line = line[:-1]
2382 line = line[:-1]
2383 self.log(line,'#?'+line,continue_prompt)
2383 self.log(line,'#?'+line,continue_prompt)
2384 if line:
2384 if line:
2385 self.magic_pinfo(line)
2385 self.magic_pinfo(line)
2386 else:
2386 else:
2387 page(self.usage,screen_lines=self.rc.screen_length)
2387 page(self.usage,screen_lines=self.rc.screen_length)
2388 return '' # Empty string is needed here!
2388 return '' # Empty string is needed here!
2389 except:
2389 except:
2390 # Pass any other exceptions through to the normal handler
2390 # Pass any other exceptions through to the normal handler
2391 return self.handle_normal(line,continue_prompt)
2391 return self.handle_normal(line,continue_prompt)
2392 else:
2392 else:
2393 # If the code compiles ok, we should handle it normally
2393 # If the code compiles ok, we should handle it normally
2394 return self.handle_normal(line,continue_prompt)
2394 return self.handle_normal(line,continue_prompt)
2395
2395
2396 def getapi(self):
2396 def getapi(self):
2397 """ Get an IPApi object for this shell instance
2397 """ Get an IPApi object for this shell instance
2398
2398
2399 Getting an IPApi object is always preferable to accessing the shell
2399 Getting an IPApi object is always preferable to accessing the shell
2400 directly, but this holds true especially for extensions.
2400 directly, but this holds true especially for extensions.
2401
2401
2402 It should always be possible to implement an extension with IPApi
2402 It should always be possible to implement an extension with IPApi
2403 alone. If not, contact maintainer to request an addition.
2403 alone. If not, contact maintainer to request an addition.
2404
2404
2405 """
2405 """
2406 return self.api
2406 return self.api
2407
2407
2408 def handle_emacs(self,line,continue_prompt=None,
2408 def handle_emacs(self,line,continue_prompt=None,
2409 pre=None,iFun=None,theRest=None):
2409 pre=None,iFun=None,theRest=None):
2410 """Handle input lines marked by python-mode."""
2410 """Handle input lines marked by python-mode."""
2411
2411
2412 # Currently, nothing is done. Later more functionality can be added
2412 # Currently, nothing is done. Later more functionality can be added
2413 # here if needed.
2413 # here if needed.
2414
2414
2415 # The input cache shouldn't be updated
2415 # The input cache shouldn't be updated
2416
2416
2417 return line
2417 return line
2418
2418
2419 def mktempfile(self,data=None):
2419 def mktempfile(self,data=None):
2420 """Make a new tempfile and return its filename.
2420 """Make a new tempfile and return its filename.
2421
2421
2422 This makes a call to tempfile.mktemp, but it registers the created
2422 This makes a call to tempfile.mktemp, but it registers the created
2423 filename internally so ipython cleans it up at exit time.
2423 filename internally so ipython cleans it up at exit time.
2424
2424
2425 Optional inputs:
2425 Optional inputs:
2426
2426
2427 - data(None): if data is given, it gets written out to the temp file
2427 - data(None): if data is given, it gets written out to the temp file
2428 immediately, and the file is closed again."""
2428 immediately, and the file is closed again."""
2429
2429
2430 filename = tempfile.mktemp('.py','ipython_edit_')
2430 filename = tempfile.mktemp('.py','ipython_edit_')
2431 self.tempfiles.append(filename)
2431 self.tempfiles.append(filename)
2432
2432
2433 if data:
2433 if data:
2434 tmp_file = open(filename,'w')
2434 tmp_file = open(filename,'w')
2435 tmp_file.write(data)
2435 tmp_file.write(data)
2436 tmp_file.close()
2436 tmp_file.close()
2437 return filename
2437 return filename
2438
2438
2439 def write(self,data):
2439 def write(self,data):
2440 """Write a string to the default output"""
2440 """Write a string to the default output"""
2441 Term.cout.write(data)
2441 Term.cout.write(data)
2442
2442
2443 def write_err(self,data):
2443 def write_err(self,data):
2444 """Write a string to the default error output"""
2444 """Write a string to the default error output"""
2445 Term.cerr.write(data)
2445 Term.cerr.write(data)
2446
2446
2447 def exit(self):
2447 def exit(self):
2448 """Handle interactive exit.
2448 """Handle interactive exit.
2449
2449
2450 This method sets the exit_now attribute."""
2450 This method sets the exit_now attribute."""
2451
2451
2452 if self.rc.confirm_exit:
2452 if self.rc.confirm_exit:
2453 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2453 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2454 self.exit_now = True
2454 self.exit_now = True
2455 else:
2455 else:
2456 self.exit_now = True
2456 self.exit_now = True
2457
2457
2458 def safe_execfile(self,fname,*where,**kw):
2458 def safe_execfile(self,fname,*where,**kw):
2459 """A safe version of the builtin execfile().
2459 """A safe version of the builtin execfile().
2460
2460
2461 This version will never throw an exception, and knows how to handle
2461 This version will never throw an exception, and knows how to handle
2462 ipython logs as well."""
2462 ipython logs as well."""
2463
2463
2464 def syspath_cleanup():
2464 def syspath_cleanup():
2465 """Internal cleanup routine for sys.path."""
2465 """Internal cleanup routine for sys.path."""
2466 if add_dname:
2466 if add_dname:
2467 try:
2467 try:
2468 sys.path.remove(dname)
2468 sys.path.remove(dname)
2469 except ValueError:
2469 except ValueError:
2470 # For some reason the user has already removed it, ignore.
2470 # For some reason the user has already removed it, ignore.
2471 pass
2471 pass
2472
2472
2473 fname = os.path.expanduser(fname)
2473 fname = os.path.expanduser(fname)
2474
2474
2475 # Find things also in current directory. This is needed to mimic the
2475 # Find things also in current directory. This is needed to mimic the
2476 # behavior of running a script from the system command line, where
2476 # behavior of running a script from the system command line, where
2477 # Python inserts the script's directory into sys.path
2477 # Python inserts the script's directory into sys.path
2478 dname = os.path.dirname(os.path.abspath(fname))
2478 dname = os.path.dirname(os.path.abspath(fname))
2479 add_dname = False
2479 add_dname = False
2480 if dname not in sys.path:
2480 if dname not in sys.path:
2481 sys.path.insert(0,dname)
2481 sys.path.insert(0,dname)
2482 add_dname = True
2482 add_dname = True
2483
2483
2484 try:
2484 try:
2485 xfile = open(fname)
2485 xfile = open(fname)
2486 except:
2486 except:
2487 print >> Term.cerr, \
2487 print >> Term.cerr, \
2488 'Could not open file <%s> for safe execution.' % fname
2488 'Could not open file <%s> for safe execution.' % fname
2489 syspath_cleanup()
2489 syspath_cleanup()
2490 return None
2490 return None
2491
2491
2492 kw.setdefault('islog',0)
2492 kw.setdefault('islog',0)
2493 kw.setdefault('quiet',1)
2493 kw.setdefault('quiet',1)
2494 kw.setdefault('exit_ignore',0)
2494 kw.setdefault('exit_ignore',0)
2495 first = xfile.readline()
2495 first = xfile.readline()
2496 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2496 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2497 xfile.close()
2497 xfile.close()
2498 # line by line execution
2498 # line by line execution
2499 if first.startswith(loghead) or kw['islog']:
2499 if first.startswith(loghead) or kw['islog']:
2500 print 'Loading log file <%s> one line at a time...' % fname
2500 print 'Loading log file <%s> one line at a time...' % fname
2501 if kw['quiet']:
2501 if kw['quiet']:
2502 stdout_save = sys.stdout
2502 stdout_save = sys.stdout
2503 sys.stdout = StringIO.StringIO()
2503 sys.stdout = StringIO.StringIO()
2504 try:
2504 try:
2505 globs,locs = where[0:2]
2505 globs,locs = where[0:2]
2506 except:
2506 except:
2507 try:
2507 try:
2508 globs = locs = where[0]
2508 globs = locs = where[0]
2509 except:
2509 except:
2510 globs = locs = globals()
2510 globs = locs = globals()
2511 badblocks = []
2511 badblocks = []
2512
2512
2513 # we also need to identify indented blocks of code when replaying
2513 # we also need to identify indented blocks of code when replaying
2514 # logs and put them together before passing them to an exec
2514 # logs and put them together before passing them to an exec
2515 # statement. This takes a bit of regexp and look-ahead work in the
2515 # statement. This takes a bit of regexp and look-ahead work in the
2516 # file. It's easiest if we swallow the whole thing in memory
2516 # file. It's easiest if we swallow the whole thing in memory
2517 # first, and manually walk through the lines list moving the
2517 # first, and manually walk through the lines list moving the
2518 # counter ourselves.
2518 # counter ourselves.
2519 indent_re = re.compile('\s+\S')
2519 indent_re = re.compile('\s+\S')
2520 xfile = open(fname)
2520 xfile = open(fname)
2521 filelines = xfile.readlines()
2521 filelines = xfile.readlines()
2522 xfile.close()
2522 xfile.close()
2523 nlines = len(filelines)
2523 nlines = len(filelines)
2524 lnum = 0
2524 lnum = 0
2525 while lnum < nlines:
2525 while lnum < nlines:
2526 line = filelines[lnum]
2526 line = filelines[lnum]
2527 lnum += 1
2527 lnum += 1
2528 # don't re-insert logger status info into cache
2528 # don't re-insert logger status info into cache
2529 if line.startswith('#log#'):
2529 if line.startswith('#log#'):
2530 continue
2530 continue
2531 else:
2531 else:
2532 # build a block of code (maybe a single line) for execution
2532 # build a block of code (maybe a single line) for execution
2533 block = line
2533 block = line
2534 try:
2534 try:
2535 next = filelines[lnum] # lnum has already incremented
2535 next = filelines[lnum] # lnum has already incremented
2536 except:
2536 except:
2537 next = None
2537 next = None
2538 while next and indent_re.match(next):
2538 while next and indent_re.match(next):
2539 block += next
2539 block += next
2540 lnum += 1
2540 lnum += 1
2541 try:
2541 try:
2542 next = filelines[lnum]
2542 next = filelines[lnum]
2543 except:
2543 except:
2544 next = None
2544 next = None
2545 # now execute the block of one or more lines
2545 # now execute the block of one or more lines
2546 try:
2546 try:
2547 exec block in globs,locs
2547 exec block in globs,locs
2548 except SystemExit:
2548 except SystemExit:
2549 pass
2549 pass
2550 except:
2550 except:
2551 badblocks.append(block.rstrip())
2551 badblocks.append(block.rstrip())
2552 if kw['quiet']: # restore stdout
2552 if kw['quiet']: # restore stdout
2553 sys.stdout.close()
2553 sys.stdout.close()
2554 sys.stdout = stdout_save
2554 sys.stdout = stdout_save
2555 print 'Finished replaying log file <%s>' % fname
2555 print 'Finished replaying log file <%s>' % fname
2556 if badblocks:
2556 if badblocks:
2557 print >> sys.stderr, ('\nThe following lines/blocks in file '
2557 print >> sys.stderr, ('\nThe following lines/blocks in file '
2558 '<%s> reported errors:' % fname)
2558 '<%s> reported errors:' % fname)
2559
2559
2560 for badline in badblocks:
2560 for badline in badblocks:
2561 print >> sys.stderr, badline
2561 print >> sys.stderr, badline
2562 else: # regular file execution
2562 else: # regular file execution
2563 try:
2563 try:
2564 execfile(fname,*where)
2564 execfile(fname,*where)
2565 except SyntaxError:
2565 except SyntaxError:
2566 self.showsyntaxerror()
2566 self.showsyntaxerror()
2567 warn('Failure executing file: <%s>' % fname)
2567 warn('Failure executing file: <%s>' % fname)
2568 except SystemExit,status:
2568 except SystemExit,status:
2569 if not kw['exit_ignore']:
2569 if not kw['exit_ignore']:
2570 self.showtraceback()
2570 self.showtraceback()
2571 warn('Failure executing file: <%s>' % fname)
2571 warn('Failure executing file: <%s>' % fname)
2572 except:
2572 except:
2573 self.showtraceback()
2573 self.showtraceback()
2574 warn('Failure executing file: <%s>' % fname)
2574 warn('Failure executing file: <%s>' % fname)
2575
2575
2576 syspath_cleanup()
2576 syspath_cleanup()
2577
2577
2578 #************************* end of file <iplib.py> *****************************
2578 #************************* end of file <iplib.py> *****************************
@@ -1,6387 +1,6390 b''
1 2007-03-23 Ville Vainio <vivainio@gmail.com>
1 2007-03-23 Ville Vainio <vivainio@gmail.com>
2
2
3 * iplib.py: recursive alias expansion now works better, so that
3 * iplib.py: recursive alias expansion now works better, so that
4 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
4 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
5 doesn't trip up the process, if 'd' has been aliased to 'ls'.
5 doesn't trip up the process, if 'd' has been aliased to 'ls'.
6
6
7 * Extensions/ipy_gnuglobal.py added, provides %global magic
7 * Extensions/ipy_gnuglobal.py added, provides %global magic
8 for users of http://www.gnu.org/software/global
8 for users of http://www.gnu.org/software/global
9
10 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
11 Closes #52. Patch by Stefan van der Walt.
9
12
10 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
13 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
11
14
12 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
15 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
13 respect the __file__ attribute when using %run. Thanks to a bug
16 respect the __file__ attribute when using %run. Thanks to a bug
14 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
17 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
15
18
16 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
19 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
17
20
18 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
21 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
19 input. Patch sent by Stefan.
22 input. Patch sent by Stefan.
20
23
21 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
24 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
22 * IPython/Extensions/ipy_stock_completer.py
25 * IPython/Extensions/ipy_stock_completer.py
23 shlex_split, fix bug in shlex_split. len function
26 shlex_split, fix bug in shlex_split. len function
24 call was missing in if statement. Caused shlex_split to
27 call was missing in if statement. Caused shlex_split to
25 sometimes return "" as last element.
28 sometimes return "" as last element.
26
29
27 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
30 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
28
31
29 * IPython/completer.py
32 * IPython/completer.py
30 (IPCompleter.file_matches.single_dir_expand): fix a problem
33 (IPCompleter.file_matches.single_dir_expand): fix a problem
31 reported by Stefan, where directories containign a single subdir
34 reported by Stefan, where directories containign a single subdir
32 would be completed too early.
35 would be completed too early.
33
36
34 * IPython/Shell.py (_load_pylab): Make the execution of 'from
37 * IPython/Shell.py (_load_pylab): Make the execution of 'from
35 pylab import *' when -pylab is given be optional. A new flag,
38 pylab import *' when -pylab is given be optional. A new flag,
36 pylab_import_all controls this behavior, the default is True for
39 pylab_import_all controls this behavior, the default is True for
37 backwards compatibility.
40 backwards compatibility.
38
41
39 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
42 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
40 modified) R. Bernstein's patch for fully syntax highlighted
43 modified) R. Bernstein's patch for fully syntax highlighted
41 tracebacks. The functionality is also available under ultraTB for
44 tracebacks. The functionality is also available under ultraTB for
42 non-ipython users (someone using ultraTB but outside an ipython
45 non-ipython users (someone using ultraTB but outside an ipython
43 session). They can select the color scheme by setting the
46 session). They can select the color scheme by setting the
44 module-level global DEFAULT_SCHEME. The highlight functionality
47 module-level global DEFAULT_SCHEME. The highlight functionality
45 also works when debugging.
48 also works when debugging.
46
49
47 * IPython/genutils.py (IOStream.close): small patch by
50 * IPython/genutils.py (IOStream.close): small patch by
48 R. Bernstein for improved pydb support.
51 R. Bernstein for improved pydb support.
49
52
50 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
53 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
51 DaveS <davls@telus.net> to improve support of debugging under
54 DaveS <davls@telus.net> to improve support of debugging under
52 NTEmacs, including improved pydb behavior.
55 NTEmacs, including improved pydb behavior.
53
56
54 * IPython/Magic.py (magic_prun): Fix saving of profile info for
57 * IPython/Magic.py (magic_prun): Fix saving of profile info for
55 Python 2.5, where the stats object API changed a little. Thanks
58 Python 2.5, where the stats object API changed a little. Thanks
56 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
59 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
57
60
58 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
61 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
59 Pernetty's patch to improve support for (X)Emacs under Win32.
62 Pernetty's patch to improve support for (X)Emacs under Win32.
60
63
61 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
64 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
62
65
63 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
66 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
64 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
67 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
65 a report by Nik Tautenhahn.
68 a report by Nik Tautenhahn.
66
69
67 2007-03-16 Walter Doerwald <walter@livinglogic.de>
70 2007-03-16 Walter Doerwald <walter@livinglogic.de>
68
71
69 * setup.py: Add the igrid help files to the list of data files
72 * setup.py: Add the igrid help files to the list of data files
70 to be installed alongside igrid.
73 to be installed alongside igrid.
71 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
74 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
72 Show the input object of the igrid browser as the window tile.
75 Show the input object of the igrid browser as the window tile.
73 Show the object the cursor is on in the statusbar.
76 Show the object the cursor is on in the statusbar.
74
77
75 2007-03-15 Ville Vainio <vivainio@gmail.com>
78 2007-03-15 Ville Vainio <vivainio@gmail.com>
76
79
77 * Extensions/ipy_stock_completers.py: Fixed exception
80 * Extensions/ipy_stock_completers.py: Fixed exception
78 on mismatching quotes in %run completer. Patch by
81 on mismatching quotes in %run completer. Patch by
79 JοΏ½rgen Stenarson. Closes #127.
82 JοΏ½rgen Stenarson. Closes #127.
80
83
81 2007-03-14 Ville Vainio <vivainio@gmail.com>
84 2007-03-14 Ville Vainio <vivainio@gmail.com>
82
85
83 * Extensions/ext_rehashdir.py: Do not do auto_alias
86 * Extensions/ext_rehashdir.py: Do not do auto_alias
84 in %rehashdir, it clobbers %store'd aliases.
87 in %rehashdir, it clobbers %store'd aliases.
85
88
86 * UserConfig/ipy_profile_sh.py: envpersist.py extension
89 * UserConfig/ipy_profile_sh.py: envpersist.py extension
87 (beefed up %env) imported for sh profile.
90 (beefed up %env) imported for sh profile.
88
91
89 2007-03-10 Walter Doerwald <walter@livinglogic.de>
92 2007-03-10 Walter Doerwald <walter@livinglogic.de>
90
93
91 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
94 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
92 as the default browser.
95 as the default browser.
93 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
96 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
94 As igrid displays all attributes it ever encounters, fetch() (which has
97 As igrid displays all attributes it ever encounters, fetch() (which has
95 been renamed to _fetch()) doesn't have to recalculate the display attributes
98 been renamed to _fetch()) doesn't have to recalculate the display attributes
96 every time a new item is fetched. This should speed up scrolling.
99 every time a new item is fetched. This should speed up scrolling.
97
100
98 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
101 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
99
102
100 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
103 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
101 Schmolck's recently reported tab-completion bug (my previous one
104 Schmolck's recently reported tab-completion bug (my previous one
102 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
105 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
103
106
104 2007-03-09 Walter Doerwald <walter@livinglogic.de>
107 2007-03-09 Walter Doerwald <walter@livinglogic.de>
105
108
106 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
109 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
107 Close help window if exiting igrid.
110 Close help window if exiting igrid.
108
111
109 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
112 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
110
113
111 * IPython/Extensions/ipy_defaults.py: Check if readline is available
114 * IPython/Extensions/ipy_defaults.py: Check if readline is available
112 before calling functions from readline.
115 before calling functions from readline.
113
116
114 2007-03-02 Walter Doerwald <walter@livinglogic.de>
117 2007-03-02 Walter Doerwald <walter@livinglogic.de>
115
118
116 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
119 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
117 igrid is a wxPython-based display object for ipipe. If your system has
120 igrid is a wxPython-based display object for ipipe. If your system has
118 wx installed igrid will be the default display. Without wx ipipe falls
121 wx installed igrid will be the default display. Without wx ipipe falls
119 back to ibrowse (which needs curses). If no curses is installed ipipe
122 back to ibrowse (which needs curses). If no curses is installed ipipe
120 falls back to idump.
123 falls back to idump.
121
124
122 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
125 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
123
126
124 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
127 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
125 my changes from yesterday, they introduced bugs. Will reactivate
128 my changes from yesterday, they introduced bugs. Will reactivate
126 once I get a correct solution, which will be much easier thanks to
129 once I get a correct solution, which will be much easier thanks to
127 Dan Milstein's new prefilter test suite.
130 Dan Milstein's new prefilter test suite.
128
131
129 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
132 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
130
133
131 * IPython/iplib.py (split_user_input): fix input splitting so we
134 * IPython/iplib.py (split_user_input): fix input splitting so we
132 don't attempt attribute accesses on things that can't possibly be
135 don't attempt attribute accesses on things that can't possibly be
133 valid Python attributes. After a bug report by Alex Schmolck.
136 valid Python attributes. After a bug report by Alex Schmolck.
134 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
137 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
135 %magic with explicit % prefix.
138 %magic with explicit % prefix.
136
139
137 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
140 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
138
141
139 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
142 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
140 avoid a DeprecationWarning from GTK.
143 avoid a DeprecationWarning from GTK.
141
144
142 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
145 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
143
146
144 * IPython/genutils.py (clock): I modified clock() to return total
147 * IPython/genutils.py (clock): I modified clock() to return total
145 time, user+system. This is a more commonly needed metric. I also
148 time, user+system. This is a more commonly needed metric. I also
146 introduced the new clocku/clocks to get only user/system time if
149 introduced the new clocku/clocks to get only user/system time if
147 one wants those instead.
150 one wants those instead.
148
151
149 ***WARNING: API CHANGE*** clock() used to return only user time,
152 ***WARNING: API CHANGE*** clock() used to return only user time,
150 so if you want exactly the same results as before, use clocku
153 so if you want exactly the same results as before, use clocku
151 instead.
154 instead.
152
155
153 2007-02-22 Ville Vainio <vivainio@gmail.com>
156 2007-02-22 Ville Vainio <vivainio@gmail.com>
154
157
155 * IPython/Extensions/ipy_p4.py: Extension for improved
158 * IPython/Extensions/ipy_p4.py: Extension for improved
156 p4 (perforce version control system) experience.
159 p4 (perforce version control system) experience.
157 Adds %p4 magic with p4 command completion and
160 Adds %p4 magic with p4 command completion and
158 automatic -G argument (marshall output as python dict)
161 automatic -G argument (marshall output as python dict)
159
162
160 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
163 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
161
164
162 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
165 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
163 stop marks.
166 stop marks.
164 (ClearingMixin): a simple mixin to easily make a Demo class clear
167 (ClearingMixin): a simple mixin to easily make a Demo class clear
165 the screen in between blocks and have empty marquees. The
168 the screen in between blocks and have empty marquees. The
166 ClearDemo and ClearIPDemo classes that use it are included.
169 ClearDemo and ClearIPDemo classes that use it are included.
167
170
168 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
171 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
169
172
170 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
173 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
171 protect against exceptions at Python shutdown time. Patch
174 protect against exceptions at Python shutdown time. Patch
172 sumbmitted to upstream.
175 sumbmitted to upstream.
173
176
174 2007-02-14 Walter Doerwald <walter@livinglogic.de>
177 2007-02-14 Walter Doerwald <walter@livinglogic.de>
175
178
176 * IPython/Extensions/ibrowse.py: If entering the first object level
179 * IPython/Extensions/ibrowse.py: If entering the first object level
177 (i.e. the object for which the browser has been started) fails,
180 (i.e. the object for which the browser has been started) fails,
178 now the error is raised directly (aborting the browser) instead of
181 now the error is raised directly (aborting the browser) instead of
179 running into an empty levels list later.
182 running into an empty levels list later.
180
183
181 2007-02-03 Walter Doerwald <walter@livinglogic.de>
184 2007-02-03 Walter Doerwald <walter@livinglogic.de>
182
185
183 * IPython/Extensions/ipipe.py: Add an xrepr implementation
186 * IPython/Extensions/ipipe.py: Add an xrepr implementation
184 for the noitem object.
187 for the noitem object.
185
188
186 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
189 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
187
190
188 * IPython/completer.py (Completer.attr_matches): Fix small
191 * IPython/completer.py (Completer.attr_matches): Fix small
189 tab-completion bug with Enthought Traits objects with units.
192 tab-completion bug with Enthought Traits objects with units.
190 Thanks to a bug report by Tom Denniston
193 Thanks to a bug report by Tom Denniston
191 <tom.denniston-AT-alum.dartmouth.org>.
194 <tom.denniston-AT-alum.dartmouth.org>.
192
195
193 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
196 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
194
197
195 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
198 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
196 bug where only .ipy or .py would be completed. Once the first
199 bug where only .ipy or .py would be completed. Once the first
197 argument to %run has been given, all completions are valid because
200 argument to %run has been given, all completions are valid because
198 they are the arguments to the script, which may well be non-python
201 they are the arguments to the script, which may well be non-python
199 filenames.
202 filenames.
200
203
201 * IPython/irunner.py (InteractiveRunner.run_source): major updates
204 * IPython/irunner.py (InteractiveRunner.run_source): major updates
202 to irunner to allow it to correctly support real doctesting of
205 to irunner to allow it to correctly support real doctesting of
203 out-of-process ipython code.
206 out-of-process ipython code.
204
207
205 * IPython/Magic.py (magic_cd): Make the setting of the terminal
208 * IPython/Magic.py (magic_cd): Make the setting of the terminal
206 title an option (-noterm_title) because it completely breaks
209 title an option (-noterm_title) because it completely breaks
207 doctesting.
210 doctesting.
208
211
209 * IPython/demo.py: fix IPythonDemo class that was not actually working.
212 * IPython/demo.py: fix IPythonDemo class that was not actually working.
210
213
211 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
214 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
212
215
213 * IPython/irunner.py (main): fix small bug where extensions were
216 * IPython/irunner.py (main): fix small bug where extensions were
214 not being correctly recognized.
217 not being correctly recognized.
215
218
216 2007-01-23 Walter Doerwald <walter@livinglogic.de>
219 2007-01-23 Walter Doerwald <walter@livinglogic.de>
217
220
218 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
221 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
219 a string containing a single line yields the string itself as the
222 a string containing a single line yields the string itself as the
220 only item.
223 only item.
221
224
222 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
225 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
223 object if it's the same as the one on the last level (This avoids
226 object if it's the same as the one on the last level (This avoids
224 infinite recursion for one line strings).
227 infinite recursion for one line strings).
225
228
226 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
229 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
227
230
228 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
231 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
229 all output streams before printing tracebacks. This ensures that
232 all output streams before printing tracebacks. This ensures that
230 user output doesn't end up interleaved with traceback output.
233 user output doesn't end up interleaved with traceback output.
231
234
232 2007-01-10 Ville Vainio <vivainio@gmail.com>
235 2007-01-10 Ville Vainio <vivainio@gmail.com>
233
236
234 * Extensions/envpersist.py: Turbocharged %env that remembers
237 * Extensions/envpersist.py: Turbocharged %env that remembers
235 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
238 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
236 "%env VISUAL=jed".
239 "%env VISUAL=jed".
237
240
238 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
241 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
239
242
240 * IPython/iplib.py (showtraceback): ensure that we correctly call
243 * IPython/iplib.py (showtraceback): ensure that we correctly call
241 custom handlers in all cases (some with pdb were slipping through,
244 custom handlers in all cases (some with pdb were slipping through,
242 but I'm not exactly sure why).
245 but I'm not exactly sure why).
243
246
244 * IPython/Debugger.py (Tracer.__init__): added new class to
247 * IPython/Debugger.py (Tracer.__init__): added new class to
245 support set_trace-like usage of IPython's enhanced debugger.
248 support set_trace-like usage of IPython's enhanced debugger.
246
249
247 2006-12-24 Ville Vainio <vivainio@gmail.com>
250 2006-12-24 Ville Vainio <vivainio@gmail.com>
248
251
249 * ipmaker.py: more informative message when ipy_user_conf
252 * ipmaker.py: more informative message when ipy_user_conf
250 import fails (suggest running %upgrade).
253 import fails (suggest running %upgrade).
251
254
252 * tools/run_ipy_in_profiler.py: Utility to see where
255 * tools/run_ipy_in_profiler.py: Utility to see where
253 the time during IPython startup is spent.
256 the time during IPython startup is spent.
254
257
255 2006-12-20 Ville Vainio <vivainio@gmail.com>
258 2006-12-20 Ville Vainio <vivainio@gmail.com>
256
259
257 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
260 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
258
261
259 * ipapi.py: Add new ipapi method, expand_alias.
262 * ipapi.py: Add new ipapi method, expand_alias.
260
263
261 * Release.py: Bump up version to 0.7.4.svn
264 * Release.py: Bump up version to 0.7.4.svn
262
265
263 2006-12-17 Ville Vainio <vivainio@gmail.com>
266 2006-12-17 Ville Vainio <vivainio@gmail.com>
264
267
265 * Extensions/jobctrl.py: Fixed &cmd arg arg...
268 * Extensions/jobctrl.py: Fixed &cmd arg arg...
266 to work properly on posix too
269 to work properly on posix too
267
270
268 * Release.py: Update revnum (version is still just 0.7.3).
271 * Release.py: Update revnum (version is still just 0.7.3).
269
272
270 2006-12-15 Ville Vainio <vivainio@gmail.com>
273 2006-12-15 Ville Vainio <vivainio@gmail.com>
271
274
272 * scripts/ipython_win_post_install: create ipython.py in
275 * scripts/ipython_win_post_install: create ipython.py in
273 prefix + "/scripts".
276 prefix + "/scripts".
274
277
275 * Release.py: Update version to 0.7.3.
278 * Release.py: Update version to 0.7.3.
276
279
277 2006-12-14 Ville Vainio <vivainio@gmail.com>
280 2006-12-14 Ville Vainio <vivainio@gmail.com>
278
281
279 * scripts/ipython_win_post_install: Overwrite old shortcuts
282 * scripts/ipython_win_post_install: Overwrite old shortcuts
280 if they already exist
283 if they already exist
281
284
282 * Release.py: release 0.7.3rc2
285 * Release.py: release 0.7.3rc2
283
286
284 2006-12-13 Ville Vainio <vivainio@gmail.com>
287 2006-12-13 Ville Vainio <vivainio@gmail.com>
285
288
286 * Branch and update Release.py for 0.7.3rc1
289 * Branch and update Release.py for 0.7.3rc1
287
290
288 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
291 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
289
292
290 * IPython/Shell.py (IPShellWX): update for current WX naming
293 * IPython/Shell.py (IPShellWX): update for current WX naming
291 conventions, to avoid a deprecation warning with current WX
294 conventions, to avoid a deprecation warning with current WX
292 versions. Thanks to a report by Danny Shevitz.
295 versions. Thanks to a report by Danny Shevitz.
293
296
294 2006-12-12 Ville Vainio <vivainio@gmail.com>
297 2006-12-12 Ville Vainio <vivainio@gmail.com>
295
298
296 * ipmaker.py: apply david cournapeau's patch to make
299 * ipmaker.py: apply david cournapeau's patch to make
297 import_some work properly even when ipythonrc does
300 import_some work properly even when ipythonrc does
298 import_some on empty list (it was an old bug!).
301 import_some on empty list (it was an old bug!).
299
302
300 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
303 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
301 Add deprecation note to ipythonrc and a url to wiki
304 Add deprecation note to ipythonrc and a url to wiki
302 in ipy_user_conf.py
305 in ipy_user_conf.py
303
306
304
307
305 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
308 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
306 as if it was typed on IPython command prompt, i.e.
309 as if it was typed on IPython command prompt, i.e.
307 as IPython script.
310 as IPython script.
308
311
309 * example-magic.py, magic_grepl.py: remove outdated examples
312 * example-magic.py, magic_grepl.py: remove outdated examples
310
313
311 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
314 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
312
315
313 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
316 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
314 is called before any exception has occurred.
317 is called before any exception has occurred.
315
318
316 2006-12-08 Ville Vainio <vivainio@gmail.com>
319 2006-12-08 Ville Vainio <vivainio@gmail.com>
317
320
318 * Extensions/ipy_stock_completers.py: fix cd completer
321 * Extensions/ipy_stock_completers.py: fix cd completer
319 to translate /'s to \'s again.
322 to translate /'s to \'s again.
320
323
321 * completer.py: prevent traceback on file completions w/
324 * completer.py: prevent traceback on file completions w/
322 backslash.
325 backslash.
323
326
324 * Release.py: Update release number to 0.7.3b3 for release
327 * Release.py: Update release number to 0.7.3b3 for release
325
328
326 2006-12-07 Ville Vainio <vivainio@gmail.com>
329 2006-12-07 Ville Vainio <vivainio@gmail.com>
327
330
328 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
331 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
329 while executing external code. Provides more shell-like behaviour
332 while executing external code. Provides more shell-like behaviour
330 and overall better response to ctrl + C / ctrl + break.
333 and overall better response to ctrl + C / ctrl + break.
331
334
332 * tools/make_tarball.py: new script to create tarball straight from svn
335 * tools/make_tarball.py: new script to create tarball straight from svn
333 (setup.py sdist doesn't work on win32).
336 (setup.py sdist doesn't work on win32).
334
337
335 * Extensions/ipy_stock_completers.py: fix cd completer to give up
338 * Extensions/ipy_stock_completers.py: fix cd completer to give up
336 on dirnames with spaces and use the default completer instead.
339 on dirnames with spaces and use the default completer instead.
337
340
338 * Revision.py: Change version to 0.7.3b2 for release.
341 * Revision.py: Change version to 0.7.3b2 for release.
339
342
340 2006-12-05 Ville Vainio <vivainio@gmail.com>
343 2006-12-05 Ville Vainio <vivainio@gmail.com>
341
344
342 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
345 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
343 pydb patch 4 (rm debug printing, py 2.5 checking)
346 pydb patch 4 (rm debug printing, py 2.5 checking)
344
347
345 2006-11-30 Walter Doerwald <walter@livinglogic.de>
348 2006-11-30 Walter Doerwald <walter@livinglogic.de>
346 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
349 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
347 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
350 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
348 "refreshfind" (mapped to "R") does the same but tries to go back to the same
351 "refreshfind" (mapped to "R") does the same but tries to go back to the same
349 object the cursor was on before the refresh. The command "markrange" is
352 object the cursor was on before the refresh. The command "markrange" is
350 mapped to "%" now.
353 mapped to "%" now.
351 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
354 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
352
355
353 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
356 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
354
357
355 * IPython/Magic.py (magic_debug): new %debug magic to activate the
358 * IPython/Magic.py (magic_debug): new %debug magic to activate the
356 interactive debugger on the last traceback, without having to call
359 interactive debugger on the last traceback, without having to call
357 %pdb and rerun your code. Made minor changes in various modules,
360 %pdb and rerun your code. Made minor changes in various modules,
358 should automatically recognize pydb if available.
361 should automatically recognize pydb if available.
359
362
360 2006-11-28 Ville Vainio <vivainio@gmail.com>
363 2006-11-28 Ville Vainio <vivainio@gmail.com>
361
364
362 * completer.py: If the text start with !, show file completions
365 * completer.py: If the text start with !, show file completions
363 properly. This helps when trying to complete command name
366 properly. This helps when trying to complete command name
364 for shell escapes.
367 for shell escapes.
365
368
366 2006-11-27 Ville Vainio <vivainio@gmail.com>
369 2006-11-27 Ville Vainio <vivainio@gmail.com>
367
370
368 * ipy_stock_completers.py: bzr completer submitted by Stefan van
371 * ipy_stock_completers.py: bzr completer submitted by Stefan van
369 der Walt. Clean up svn and hg completers by using a common
372 der Walt. Clean up svn and hg completers by using a common
370 vcs_completer.
373 vcs_completer.
371
374
372 2006-11-26 Ville Vainio <vivainio@gmail.com>
375 2006-11-26 Ville Vainio <vivainio@gmail.com>
373
376
374 * Remove ipconfig and %config; you should use _ip.options structure
377 * Remove ipconfig and %config; you should use _ip.options structure
375 directly instead!
378 directly instead!
376
379
377 * genutils.py: add wrap_deprecated function for deprecating callables
380 * genutils.py: add wrap_deprecated function for deprecating callables
378
381
379 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
382 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
380 _ip.system instead. ipalias is redundant.
383 _ip.system instead. ipalias is redundant.
381
384
382 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
385 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
383 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
386 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
384 explicit.
387 explicit.
385
388
386 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
389 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
387 completer. Try it by entering 'hg ' and pressing tab.
390 completer. Try it by entering 'hg ' and pressing tab.
388
391
389 * macro.py: Give Macro a useful __repr__ method
392 * macro.py: Give Macro a useful __repr__ method
390
393
391 * Magic.py: %whos abbreviates the typename of Macro for brevity.
394 * Magic.py: %whos abbreviates the typename of Macro for brevity.
392
395
393 2006-11-24 Walter Doerwald <walter@livinglogic.de>
396 2006-11-24 Walter Doerwald <walter@livinglogic.de>
394 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
397 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
395 we don't get a duplicate ipipe module, where registration of the xrepr
398 we don't get a duplicate ipipe module, where registration of the xrepr
396 implementation for Text is useless.
399 implementation for Text is useless.
397
400
398 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
401 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
399
402
400 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
403 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
401
404
402 2006-11-24 Ville Vainio <vivainio@gmail.com>
405 2006-11-24 Ville Vainio <vivainio@gmail.com>
403
406
404 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
407 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
405 try to use "cProfile" instead of the slower pure python
408 try to use "cProfile" instead of the slower pure python
406 "profile"
409 "profile"
407
410
408 2006-11-23 Ville Vainio <vivainio@gmail.com>
411 2006-11-23 Ville Vainio <vivainio@gmail.com>
409
412
410 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
413 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
411 Qt+IPython+Designer link in documentation.
414 Qt+IPython+Designer link in documentation.
412
415
413 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
416 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
414 correct Pdb object to %pydb.
417 correct Pdb object to %pydb.
415
418
416
419
417 2006-11-22 Walter Doerwald <walter@livinglogic.de>
420 2006-11-22 Walter Doerwald <walter@livinglogic.de>
418 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
421 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
419 generic xrepr(), otherwise the list implementation would kick in.
422 generic xrepr(), otherwise the list implementation would kick in.
420
423
421 2006-11-21 Ville Vainio <vivainio@gmail.com>
424 2006-11-21 Ville Vainio <vivainio@gmail.com>
422
425
423 * upgrade_dir.py: Now actually overwrites a nonmodified user file
426 * upgrade_dir.py: Now actually overwrites a nonmodified user file
424 with one from UserConfig.
427 with one from UserConfig.
425
428
426 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
429 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
427 it was missing which broke the sh profile.
430 it was missing which broke the sh profile.
428
431
429 * completer.py: file completer now uses explicit '/' instead
432 * completer.py: file completer now uses explicit '/' instead
430 of os.path.join, expansion of 'foo' was broken on win32
433 of os.path.join, expansion of 'foo' was broken on win32
431 if there was one directory with name 'foobar'.
434 if there was one directory with name 'foobar'.
432
435
433 * A bunch of patches from Kirill Smelkov:
436 * A bunch of patches from Kirill Smelkov:
434
437
435 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
438 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
436
439
437 * [patch 7/9] Implement %page -r (page in raw mode) -
440 * [patch 7/9] Implement %page -r (page in raw mode) -
438
441
439 * [patch 5/9] ScientificPython webpage has moved
442 * [patch 5/9] ScientificPython webpage has moved
440
443
441 * [patch 4/9] The manual mentions %ds, should be %dhist
444 * [patch 4/9] The manual mentions %ds, should be %dhist
442
445
443 * [patch 3/9] Kill old bits from %prun doc.
446 * [patch 3/9] Kill old bits from %prun doc.
444
447
445 * [patch 1/9] Fix typos here and there.
448 * [patch 1/9] Fix typos here and there.
446
449
447 2006-11-08 Ville Vainio <vivainio@gmail.com>
450 2006-11-08 Ville Vainio <vivainio@gmail.com>
448
451
449 * completer.py (attr_matches): catch all exceptions raised
452 * completer.py (attr_matches): catch all exceptions raised
450 by eval of expr with dots.
453 by eval of expr with dots.
451
454
452 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
455 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
453
456
454 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
457 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
455 input if it starts with whitespace. This allows you to paste
458 input if it starts with whitespace. This allows you to paste
456 indented input from any editor without manually having to type in
459 indented input from any editor without manually having to type in
457 the 'if 1:', which is convenient when working interactively.
460 the 'if 1:', which is convenient when working interactively.
458 Slightly modifed version of a patch by Bo Peng
461 Slightly modifed version of a patch by Bo Peng
459 <bpeng-AT-rice.edu>.
462 <bpeng-AT-rice.edu>.
460
463
461 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
464 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
462
465
463 * IPython/irunner.py (main): modified irunner so it automatically
466 * IPython/irunner.py (main): modified irunner so it automatically
464 recognizes the right runner to use based on the extension (.py for
467 recognizes the right runner to use based on the extension (.py for
465 python, .ipy for ipython and .sage for sage).
468 python, .ipy for ipython and .sage for sage).
466
469
467 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
470 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
468 visible in ipapi as ip.config(), to programatically control the
471 visible in ipapi as ip.config(), to programatically control the
469 internal rc object. There's an accompanying %config magic for
472 internal rc object. There's an accompanying %config magic for
470 interactive use, which has been enhanced to match the
473 interactive use, which has been enhanced to match the
471 funtionality in ipconfig.
474 funtionality in ipconfig.
472
475
473 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
476 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
474 so it's not just a toggle, it now takes an argument. Add support
477 so it's not just a toggle, it now takes an argument. Add support
475 for a customizable header when making system calls, as the new
478 for a customizable header when making system calls, as the new
476 system_header variable in the ipythonrc file.
479 system_header variable in the ipythonrc file.
477
480
478 2006-11-03 Walter Doerwald <walter@livinglogic.de>
481 2006-11-03 Walter Doerwald <walter@livinglogic.de>
479
482
480 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
483 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
481 generic functions (using Philip J. Eby's simplegeneric package).
484 generic functions (using Philip J. Eby's simplegeneric package).
482 This makes it possible to customize the display of third-party classes
485 This makes it possible to customize the display of third-party classes
483 without having to monkeypatch them. xiter() no longer supports a mode
486 without having to monkeypatch them. xiter() no longer supports a mode
484 argument and the XMode class has been removed. The same functionality can
487 argument and the XMode class has been removed. The same functionality can
485 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
488 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
486 One consequence of the switch to generic functions is that xrepr() and
489 One consequence of the switch to generic functions is that xrepr() and
487 xattrs() implementation must define the default value for the mode
490 xattrs() implementation must define the default value for the mode
488 argument themselves and xattrs() implementations must return real
491 argument themselves and xattrs() implementations must return real
489 descriptors.
492 descriptors.
490
493
491 * IPython/external: This new subpackage will contain all third-party
494 * IPython/external: This new subpackage will contain all third-party
492 packages that are bundled with IPython. (The first one is simplegeneric).
495 packages that are bundled with IPython. (The first one is simplegeneric).
493
496
494 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
497 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
495 directory which as been dropped in r1703.
498 directory which as been dropped in r1703.
496
499
497 * IPython/Extensions/ipipe.py (iless): Fixed.
500 * IPython/Extensions/ipipe.py (iless): Fixed.
498
501
499 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
502 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
500
503
501 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
504 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
502
505
503 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
506 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
504 handling in variable expansion so that shells and magics recognize
507 handling in variable expansion so that shells and magics recognize
505 function local scopes correctly. Bug reported by Brian.
508 function local scopes correctly. Bug reported by Brian.
506
509
507 * scripts/ipython: remove the very first entry in sys.path which
510 * scripts/ipython: remove the very first entry in sys.path which
508 Python auto-inserts for scripts, so that sys.path under IPython is
511 Python auto-inserts for scripts, so that sys.path under IPython is
509 as similar as possible to that under plain Python.
512 as similar as possible to that under plain Python.
510
513
511 * IPython/completer.py (IPCompleter.file_matches): Fix
514 * IPython/completer.py (IPCompleter.file_matches): Fix
512 tab-completion so that quotes are not closed unless the completion
515 tab-completion so that quotes are not closed unless the completion
513 is unambiguous. After a request by Stefan. Minor cleanups in
516 is unambiguous. After a request by Stefan. Minor cleanups in
514 ipy_stock_completers.
517 ipy_stock_completers.
515
518
516 2006-11-02 Ville Vainio <vivainio@gmail.com>
519 2006-11-02 Ville Vainio <vivainio@gmail.com>
517
520
518 * ipy_stock_completers.py: Add %run and %cd completers.
521 * ipy_stock_completers.py: Add %run and %cd completers.
519
522
520 * completer.py: Try running custom completer for both
523 * completer.py: Try running custom completer for both
521 "foo" and "%foo" if the command is just "foo". Ignore case
524 "foo" and "%foo" if the command is just "foo". Ignore case
522 when filtering possible completions.
525 when filtering possible completions.
523
526
524 * UserConfig/ipy_user_conf.py: install stock completers as default
527 * UserConfig/ipy_user_conf.py: install stock completers as default
525
528
526 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
529 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
527 simplified readline history save / restore through a wrapper
530 simplified readline history save / restore through a wrapper
528 function
531 function
529
532
530
533
531 2006-10-31 Ville Vainio <vivainio@gmail.com>
534 2006-10-31 Ville Vainio <vivainio@gmail.com>
532
535
533 * strdispatch.py, completer.py, ipy_stock_completers.py:
536 * strdispatch.py, completer.py, ipy_stock_completers.py:
534 Allow str_key ("command") in completer hooks. Implement
537 Allow str_key ("command") in completer hooks. Implement
535 trivial completer for 'import' (stdlib modules only). Rename
538 trivial completer for 'import' (stdlib modules only). Rename
536 ipy_linux_package_managers.py to ipy_stock_completers.py.
539 ipy_linux_package_managers.py to ipy_stock_completers.py.
537 SVN completer.
540 SVN completer.
538
541
539 * Extensions/ledit.py: %magic line editor for easily and
542 * Extensions/ledit.py: %magic line editor for easily and
540 incrementally manipulating lists of strings. The magic command
543 incrementally manipulating lists of strings. The magic command
541 name is %led.
544 name is %led.
542
545
543 2006-10-30 Ville Vainio <vivainio@gmail.com>
546 2006-10-30 Ville Vainio <vivainio@gmail.com>
544
547
545 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
548 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
546 Bernsteins's patches for pydb integration.
549 Bernsteins's patches for pydb integration.
547 http://bashdb.sourceforge.net/pydb/
550 http://bashdb.sourceforge.net/pydb/
548
551
549 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
552 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
550 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
553 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
551 custom completer hook to allow the users to implement their own
554 custom completer hook to allow the users to implement their own
552 completers. See ipy_linux_package_managers.py for example. The
555 completers. See ipy_linux_package_managers.py for example. The
553 hook name is 'complete_command'.
556 hook name is 'complete_command'.
554
557
555 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
558 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
556
559
557 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
560 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
558 Numeric leftovers.
561 Numeric leftovers.
559
562
560 * ipython.el (py-execute-region): apply Stefan's patch to fix
563 * ipython.el (py-execute-region): apply Stefan's patch to fix
561 garbled results if the python shell hasn't been previously started.
564 garbled results if the python shell hasn't been previously started.
562
565
563 * IPython/genutils.py (arg_split): moved to genutils, since it's a
566 * IPython/genutils.py (arg_split): moved to genutils, since it's a
564 pretty generic function and useful for other things.
567 pretty generic function and useful for other things.
565
568
566 * IPython/OInspect.py (getsource): Add customizable source
569 * IPython/OInspect.py (getsource): Add customizable source
567 extractor. After a request/patch form W. Stein (SAGE).
570 extractor. After a request/patch form W. Stein (SAGE).
568
571
569 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
572 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
570 window size to a more reasonable value from what pexpect does,
573 window size to a more reasonable value from what pexpect does,
571 since their choice causes wrapping bugs with long input lines.
574 since their choice causes wrapping bugs with long input lines.
572
575
573 2006-10-28 Ville Vainio <vivainio@gmail.com>
576 2006-10-28 Ville Vainio <vivainio@gmail.com>
574
577
575 * Magic.py (%run): Save and restore the readline history from
578 * Magic.py (%run): Save and restore the readline history from
576 file around %run commands to prevent side effects from
579 file around %run commands to prevent side effects from
577 %runned programs that might use readline (e.g. pydb).
580 %runned programs that might use readline (e.g. pydb).
578
581
579 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
582 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
580 invoking the pydb enhanced debugger.
583 invoking the pydb enhanced debugger.
581
584
582 2006-10-23 Walter Doerwald <walter@livinglogic.de>
585 2006-10-23 Walter Doerwald <walter@livinglogic.de>
583
586
584 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
587 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
585 call the base class method and propagate the return value to
588 call the base class method and propagate the return value to
586 ifile. This is now done by path itself.
589 ifile. This is now done by path itself.
587
590
588 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
591 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
589
592
590 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
593 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
591 api: set_crash_handler(), to expose the ability to change the
594 api: set_crash_handler(), to expose the ability to change the
592 internal crash handler.
595 internal crash handler.
593
596
594 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
597 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
595 the various parameters of the crash handler so that apps using
598 the various parameters of the crash handler so that apps using
596 IPython as their engine can customize crash handling. Ipmlemented
599 IPython as their engine can customize crash handling. Ipmlemented
597 at the request of SAGE.
600 at the request of SAGE.
598
601
599 2006-10-14 Ville Vainio <vivainio@gmail.com>
602 2006-10-14 Ville Vainio <vivainio@gmail.com>
600
603
601 * Magic.py, ipython.el: applied first "safe" part of Rocky
604 * Magic.py, ipython.el: applied first "safe" part of Rocky
602 Bernstein's patch set for pydb integration.
605 Bernstein's patch set for pydb integration.
603
606
604 * Magic.py (%unalias, %alias): %store'd aliases can now be
607 * Magic.py (%unalias, %alias): %store'd aliases can now be
605 removed with '%unalias'. %alias w/o args now shows most
608 removed with '%unalias'. %alias w/o args now shows most
606 interesting (stored / manually defined) aliases last
609 interesting (stored / manually defined) aliases last
607 where they catch the eye w/o scrolling.
610 where they catch the eye w/o scrolling.
608
611
609 * Magic.py (%rehashx), ext_rehashdir.py: files with
612 * Magic.py (%rehashx), ext_rehashdir.py: files with
610 'py' extension are always considered executable, even
613 'py' extension are always considered executable, even
611 when not in PATHEXT environment variable.
614 when not in PATHEXT environment variable.
612
615
613 2006-10-12 Ville Vainio <vivainio@gmail.com>
616 2006-10-12 Ville Vainio <vivainio@gmail.com>
614
617
615 * jobctrl.py: Add new "jobctrl" extension for spawning background
618 * jobctrl.py: Add new "jobctrl" extension for spawning background
616 processes with "&find /". 'import jobctrl' to try it out. Requires
619 processes with "&find /". 'import jobctrl' to try it out. Requires
617 'subprocess' module, standard in python 2.4+.
620 'subprocess' module, standard in python 2.4+.
618
621
619 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
622 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
620 so if foo -> bar and bar -> baz, then foo -> baz.
623 so if foo -> bar and bar -> baz, then foo -> baz.
621
624
622 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
625 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
623
626
624 * IPython/Magic.py (Magic.parse_options): add a new posix option
627 * IPython/Magic.py (Magic.parse_options): add a new posix option
625 to allow parsing of input args in magics that doesn't strip quotes
628 to allow parsing of input args in magics that doesn't strip quotes
626 (if posix=False). This also closes %timeit bug reported by
629 (if posix=False). This also closes %timeit bug reported by
627 Stefan.
630 Stefan.
628
631
629 2006-10-03 Ville Vainio <vivainio@gmail.com>
632 2006-10-03 Ville Vainio <vivainio@gmail.com>
630
633
631 * iplib.py (raw_input, interact): Return ValueError catching for
634 * iplib.py (raw_input, interact): Return ValueError catching for
632 raw_input. Fixes infinite loop for sys.stdin.close() or
635 raw_input. Fixes infinite loop for sys.stdin.close() or
633 sys.stdout.close().
636 sys.stdout.close().
634
637
635 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
638 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
636
639
637 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
640 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
638 to help in handling doctests. irunner is now pretty useful for
641 to help in handling doctests. irunner is now pretty useful for
639 running standalone scripts and simulate a full interactive session
642 running standalone scripts and simulate a full interactive session
640 in a format that can be then pasted as a doctest.
643 in a format that can be then pasted as a doctest.
641
644
642 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
645 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
643 on top of the default (useless) ones. This also fixes the nasty
646 on top of the default (useless) ones. This also fixes the nasty
644 way in which 2.5's Quitter() exits (reverted [1785]).
647 way in which 2.5's Quitter() exits (reverted [1785]).
645
648
646 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
649 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
647 2.5.
650 2.5.
648
651
649 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
652 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
650 color scheme is updated as well when color scheme is changed
653 color scheme is updated as well when color scheme is changed
651 interactively.
654 interactively.
652
655
653 2006-09-27 Ville Vainio <vivainio@gmail.com>
656 2006-09-27 Ville Vainio <vivainio@gmail.com>
654
657
655 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
658 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
656 infinite loop and just exit. It's a hack, but will do for a while.
659 infinite loop and just exit. It's a hack, but will do for a while.
657
660
658 2006-08-25 Walter Doerwald <walter@livinglogic.de>
661 2006-08-25 Walter Doerwald <walter@livinglogic.de>
659
662
660 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
663 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
661 the constructor, this makes it possible to get a list of only directories
664 the constructor, this makes it possible to get a list of only directories
662 or only files.
665 or only files.
663
666
664 2006-08-12 Ville Vainio <vivainio@gmail.com>
667 2006-08-12 Ville Vainio <vivainio@gmail.com>
665
668
666 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
669 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
667 they broke unittest
670 they broke unittest
668
671
669 2006-08-11 Ville Vainio <vivainio@gmail.com>
672 2006-08-11 Ville Vainio <vivainio@gmail.com>
670
673
671 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
674 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
672 by resolving issue properly, i.e. by inheriting FakeModule
675 by resolving issue properly, i.e. by inheriting FakeModule
673 from types.ModuleType. Pickling ipython interactive data
676 from types.ModuleType. Pickling ipython interactive data
674 should still work as usual (testing appreciated).
677 should still work as usual (testing appreciated).
675
678
676 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
679 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
677
680
678 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
681 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
679 running under python 2.3 with code from 2.4 to fix a bug with
682 running under python 2.3 with code from 2.4 to fix a bug with
680 help(). Reported by the Debian maintainers, Norbert Tretkowski
683 help(). Reported by the Debian maintainers, Norbert Tretkowski
681 <norbert-AT-tretkowski.de> and Alexandre Fayolle
684 <norbert-AT-tretkowski.de> and Alexandre Fayolle
682 <afayolle-AT-debian.org>.
685 <afayolle-AT-debian.org>.
683
686
684 2006-08-04 Walter Doerwald <walter@livinglogic.de>
687 2006-08-04 Walter Doerwald <walter@livinglogic.de>
685
688
686 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
689 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
687 (which was displaying "quit" twice).
690 (which was displaying "quit" twice).
688
691
689 2006-07-28 Walter Doerwald <walter@livinglogic.de>
692 2006-07-28 Walter Doerwald <walter@livinglogic.de>
690
693
691 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
694 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
692 the mode argument).
695 the mode argument).
693
696
694 2006-07-27 Walter Doerwald <walter@livinglogic.de>
697 2006-07-27 Walter Doerwald <walter@livinglogic.de>
695
698
696 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
699 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
697 not running under IPython.
700 not running under IPython.
698
701
699 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
702 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
700 and make it iterable (iterating over the attribute itself). Add two new
703 and make it iterable (iterating over the attribute itself). Add two new
701 magic strings for __xattrs__(): If the string starts with "-", the attribute
704 magic strings for __xattrs__(): If the string starts with "-", the attribute
702 will not be displayed in ibrowse's detail view (but it can still be
705 will not be displayed in ibrowse's detail view (but it can still be
703 iterated over). This makes it possible to add attributes that are large
706 iterated over). This makes it possible to add attributes that are large
704 lists or generator methods to the detail view. Replace magic attribute names
707 lists or generator methods to the detail view. Replace magic attribute names
705 and _attrname() and _getattr() with "descriptors": For each type of magic
708 and _attrname() and _getattr() with "descriptors": For each type of magic
706 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
709 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
707 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
710 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
708 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
711 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
709 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
712 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
710 are still supported.
713 are still supported.
711
714
712 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
715 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
713 fails in ibrowse.fetch(), the exception object is added as the last item
716 fails in ibrowse.fetch(), the exception object is added as the last item
714 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
717 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
715 a generator throws an exception midway through execution.
718 a generator throws an exception midway through execution.
716
719
717 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
720 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
718 encoding into methods.
721 encoding into methods.
719
722
720 2006-07-26 Ville Vainio <vivainio@gmail.com>
723 2006-07-26 Ville Vainio <vivainio@gmail.com>
721
724
722 * iplib.py: history now stores multiline input as single
725 * iplib.py: history now stores multiline input as single
723 history entries. Patch by Jorgen Cederlof.
726 history entries. Patch by Jorgen Cederlof.
724
727
725 2006-07-18 Walter Doerwald <walter@livinglogic.de>
728 2006-07-18 Walter Doerwald <walter@livinglogic.de>
726
729
727 * IPython/Extensions/ibrowse.py: Make cursor visible over
730 * IPython/Extensions/ibrowse.py: Make cursor visible over
728 non existing attributes.
731 non existing attributes.
729
732
730 2006-07-14 Walter Doerwald <walter@livinglogic.de>
733 2006-07-14 Walter Doerwald <walter@livinglogic.de>
731
734
732 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
735 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
733 error output of the running command doesn't mess up the screen.
736 error output of the running command doesn't mess up the screen.
734
737
735 2006-07-13 Walter Doerwald <walter@livinglogic.de>
738 2006-07-13 Walter Doerwald <walter@livinglogic.de>
736
739
737 * IPython/Extensions/ipipe.py (isort): Make isort usable without
740 * IPython/Extensions/ipipe.py (isort): Make isort usable without
738 argument. This sorts the items themselves.
741 argument. This sorts the items themselves.
739
742
740 2006-07-12 Walter Doerwald <walter@livinglogic.de>
743 2006-07-12 Walter Doerwald <walter@livinglogic.de>
741
744
742 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
745 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
743 Compile expression strings into code objects. This should speed
746 Compile expression strings into code objects. This should speed
744 up ifilter and friends somewhat.
747 up ifilter and friends somewhat.
745
748
746 2006-07-08 Ville Vainio <vivainio@gmail.com>
749 2006-07-08 Ville Vainio <vivainio@gmail.com>
747
750
748 * Magic.py: %cpaste now strips > from the beginning of lines
751 * Magic.py: %cpaste now strips > from the beginning of lines
749 to ease pasting quoted code from emails. Contributed by
752 to ease pasting quoted code from emails. Contributed by
750 Stefan van der Walt.
753 Stefan van der Walt.
751
754
752 2006-06-29 Ville Vainio <vivainio@gmail.com>
755 2006-06-29 Ville Vainio <vivainio@gmail.com>
753
756
754 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
757 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
755 mode, patch contributed by Darren Dale. NEEDS TESTING!
758 mode, patch contributed by Darren Dale. NEEDS TESTING!
756
759
757 2006-06-28 Walter Doerwald <walter@livinglogic.de>
760 2006-06-28 Walter Doerwald <walter@livinglogic.de>
758
761
759 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
762 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
760 a blue background. Fix fetching new display rows when the browser
763 a blue background. Fix fetching new display rows when the browser
761 scrolls more than a screenful (e.g. by using the goto command).
764 scrolls more than a screenful (e.g. by using the goto command).
762
765
763 2006-06-27 Ville Vainio <vivainio@gmail.com>
766 2006-06-27 Ville Vainio <vivainio@gmail.com>
764
767
765 * Magic.py (_inspect, _ofind) Apply David Huard's
768 * Magic.py (_inspect, _ofind) Apply David Huard's
766 patch for displaying the correct docstring for 'property'
769 patch for displaying the correct docstring for 'property'
767 attributes.
770 attributes.
768
771
769 2006-06-23 Walter Doerwald <walter@livinglogic.de>
772 2006-06-23 Walter Doerwald <walter@livinglogic.de>
770
773
771 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
774 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
772 commands into the methods implementing them.
775 commands into the methods implementing them.
773
776
774 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
777 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
775
778
776 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
779 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
777 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
780 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
778 autoindent support was authored by Jin Liu.
781 autoindent support was authored by Jin Liu.
779
782
780 2006-06-22 Walter Doerwald <walter@livinglogic.de>
783 2006-06-22 Walter Doerwald <walter@livinglogic.de>
781
784
782 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
785 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
783 for keymaps with a custom class that simplifies handling.
786 for keymaps with a custom class that simplifies handling.
784
787
785 2006-06-19 Walter Doerwald <walter@livinglogic.de>
788 2006-06-19 Walter Doerwald <walter@livinglogic.de>
786
789
787 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
790 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
788 resizing. This requires Python 2.5 to work.
791 resizing. This requires Python 2.5 to work.
789
792
790 2006-06-16 Walter Doerwald <walter@livinglogic.de>
793 2006-06-16 Walter Doerwald <walter@livinglogic.de>
791
794
792 * IPython/Extensions/ibrowse.py: Add two new commands to
795 * IPython/Extensions/ibrowse.py: Add two new commands to
793 ibrowse: "hideattr" (mapped to "h") hides the attribute under
796 ibrowse: "hideattr" (mapped to "h") hides the attribute under
794 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
797 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
795 attributes again. Remapped the help command to "?". Display
798 attributes again. Remapped the help command to "?". Display
796 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
799 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
797 as keys for the "home" and "end" commands. Add three new commands
800 as keys for the "home" and "end" commands. Add three new commands
798 to the input mode for "find" and friends: "delend" (CTRL-K)
801 to the input mode for "find" and friends: "delend" (CTRL-K)
799 deletes to the end of line. "incsearchup" searches upwards in the
802 deletes to the end of line. "incsearchup" searches upwards in the
800 command history for an input that starts with the text before the cursor.
803 command history for an input that starts with the text before the cursor.
801 "incsearchdown" does the same downwards. Removed a bogus mapping of
804 "incsearchdown" does the same downwards. Removed a bogus mapping of
802 the x key to "delete".
805 the x key to "delete".
803
806
804 2006-06-15 Ville Vainio <vivainio@gmail.com>
807 2006-06-15 Ville Vainio <vivainio@gmail.com>
805
808
806 * iplib.py, hooks.py: Added new generate_prompt hook that can be
809 * iplib.py, hooks.py: Added new generate_prompt hook that can be
807 used to create prompts dynamically, instead of the "old" way of
810 used to create prompts dynamically, instead of the "old" way of
808 assigning "magic" strings to prompt_in1 and prompt_in2. The old
811 assigning "magic" strings to prompt_in1 and prompt_in2. The old
809 way still works (it's invoked by the default hook), of course.
812 way still works (it's invoked by the default hook), of course.
810
813
811 * Prompts.py: added generate_output_prompt hook for altering output
814 * Prompts.py: added generate_output_prompt hook for altering output
812 prompt
815 prompt
813
816
814 * Release.py: Changed version string to 0.7.3.svn.
817 * Release.py: Changed version string to 0.7.3.svn.
815
818
816 2006-06-15 Walter Doerwald <walter@livinglogic.de>
819 2006-06-15 Walter Doerwald <walter@livinglogic.de>
817
820
818 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
821 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
819 the call to fetch() always tries to fetch enough data for at least one
822 the call to fetch() always tries to fetch enough data for at least one
820 full screen. This makes it possible to simply call moveto(0,0,True) in
823 full screen. This makes it possible to simply call moveto(0,0,True) in
821 the constructor. Fix typos and removed the obsolete goto attribute.
824 the constructor. Fix typos and removed the obsolete goto attribute.
822
825
823 2006-06-12 Ville Vainio <vivainio@gmail.com>
826 2006-06-12 Ville Vainio <vivainio@gmail.com>
824
827
825 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
828 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
826 allowing $variable interpolation within multiline statements,
829 allowing $variable interpolation within multiline statements,
827 though so far only with "sh" profile for a testing period.
830 though so far only with "sh" profile for a testing period.
828 The patch also enables splitting long commands with \ but it
831 The patch also enables splitting long commands with \ but it
829 doesn't work properly yet.
832 doesn't work properly yet.
830
833
831 2006-06-12 Walter Doerwald <walter@livinglogic.de>
834 2006-06-12 Walter Doerwald <walter@livinglogic.de>
832
835
833 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
836 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
834 input history and the position of the cursor in the input history for
837 input history and the position of the cursor in the input history for
835 the find, findbackwards and goto command.
838 the find, findbackwards and goto command.
836
839
837 2006-06-10 Walter Doerwald <walter@livinglogic.de>
840 2006-06-10 Walter Doerwald <walter@livinglogic.de>
838
841
839 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
842 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
840 implements the basic functionality of browser commands that require
843 implements the basic functionality of browser commands that require
841 input. Reimplement the goto, find and findbackwards commands as
844 input. Reimplement the goto, find and findbackwards commands as
842 subclasses of _CommandInput. Add an input history and keymaps to those
845 subclasses of _CommandInput. Add an input history and keymaps to those
843 commands. Add "\r" as a keyboard shortcut for the enterdefault and
846 commands. Add "\r" as a keyboard shortcut for the enterdefault and
844 execute commands.
847 execute commands.
845
848
846 2006-06-07 Ville Vainio <vivainio@gmail.com>
849 2006-06-07 Ville Vainio <vivainio@gmail.com>
847
850
848 * iplib.py: ipython mybatch.ipy exits ipython immediately after
851 * iplib.py: ipython mybatch.ipy exits ipython immediately after
849 running the batch files instead of leaving the session open.
852 running the batch files instead of leaving the session open.
850
853
851 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
854 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
852
855
853 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
856 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
854 the original fix was incomplete. Patch submitted by W. Maier.
857 the original fix was incomplete. Patch submitted by W. Maier.
855
858
856 2006-06-07 Ville Vainio <vivainio@gmail.com>
859 2006-06-07 Ville Vainio <vivainio@gmail.com>
857
860
858 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
861 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
859 Confirmation prompts can be supressed by 'quiet' option.
862 Confirmation prompts can be supressed by 'quiet' option.
860 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
863 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
861
864
862 2006-06-06 *** Released version 0.7.2
865 2006-06-06 *** Released version 0.7.2
863
866
864 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
867 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
865
868
866 * IPython/Release.py (version): Made 0.7.2 final for release.
869 * IPython/Release.py (version): Made 0.7.2 final for release.
867 Repo tagged and release cut.
870 Repo tagged and release cut.
868
871
869 2006-06-05 Ville Vainio <vivainio@gmail.com>
872 2006-06-05 Ville Vainio <vivainio@gmail.com>
870
873
871 * Magic.py (magic_rehashx): Honor no_alias list earlier in
874 * Magic.py (magic_rehashx): Honor no_alias list earlier in
872 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
875 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
873
876
874 * upgrade_dir.py: try import 'path' module a bit harder
877 * upgrade_dir.py: try import 'path' module a bit harder
875 (for %upgrade)
878 (for %upgrade)
876
879
877 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
880 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
878
881
879 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
882 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
880 instead of looping 20 times.
883 instead of looping 20 times.
881
884
882 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
885 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
883 correctly at initialization time. Bug reported by Krishna Mohan
886 correctly at initialization time. Bug reported by Krishna Mohan
884 Gundu <gkmohan-AT-gmail.com> on the user list.
887 Gundu <gkmohan-AT-gmail.com> on the user list.
885
888
886 * IPython/Release.py (version): Mark 0.7.2 version to start
889 * IPython/Release.py (version): Mark 0.7.2 version to start
887 testing for release on 06/06.
890 testing for release on 06/06.
888
891
889 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
892 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
890
893
891 * scripts/irunner: thin script interface so users don't have to
894 * scripts/irunner: thin script interface so users don't have to
892 find the module and call it as an executable, since modules rarely
895 find the module and call it as an executable, since modules rarely
893 live in people's PATH.
896 live in people's PATH.
894
897
895 * IPython/irunner.py (InteractiveRunner.__init__): added
898 * IPython/irunner.py (InteractiveRunner.__init__): added
896 delaybeforesend attribute to control delays with newer versions of
899 delaybeforesend attribute to control delays with newer versions of
897 pexpect. Thanks to detailed help from pexpect's author, Noah
900 pexpect. Thanks to detailed help from pexpect's author, Noah
898 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
901 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
899 correctly (it works in NoColor mode).
902 correctly (it works in NoColor mode).
900
903
901 * IPython/iplib.py (handle_normal): fix nasty crash reported on
904 * IPython/iplib.py (handle_normal): fix nasty crash reported on
902 SAGE list, from improper log() calls.
905 SAGE list, from improper log() calls.
903
906
904 2006-05-31 Ville Vainio <vivainio@gmail.com>
907 2006-05-31 Ville Vainio <vivainio@gmail.com>
905
908
906 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
909 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
907 with args in parens to work correctly with dirs that have spaces.
910 with args in parens to work correctly with dirs that have spaces.
908
911
909 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
912 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
910
913
911 * IPython/Logger.py (Logger.logstart): add option to log raw input
914 * IPython/Logger.py (Logger.logstart): add option to log raw input
912 instead of the processed one. A -r flag was added to the
915 instead of the processed one. A -r flag was added to the
913 %logstart magic used for controlling logging.
916 %logstart magic used for controlling logging.
914
917
915 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
918 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
916
919
917 * IPython/iplib.py (InteractiveShell.__init__): add check for the
920 * IPython/iplib.py (InteractiveShell.__init__): add check for the
918 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
921 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
919 recognize the option. After a bug report by Will Maier. This
922 recognize the option. After a bug report by Will Maier. This
920 closes #64 (will do it after confirmation from W. Maier).
923 closes #64 (will do it after confirmation from W. Maier).
921
924
922 * IPython/irunner.py: New module to run scripts as if manually
925 * IPython/irunner.py: New module to run scripts as if manually
923 typed into an interactive environment, based on pexpect. After a
926 typed into an interactive environment, based on pexpect. After a
924 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
927 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
925 ipython-user list. Simple unittests in the tests/ directory.
928 ipython-user list. Simple unittests in the tests/ directory.
926
929
927 * tools/release: add Will Maier, OpenBSD port maintainer, to
930 * tools/release: add Will Maier, OpenBSD port maintainer, to
928 recepients list. We are now officially part of the OpenBSD ports:
931 recepients list. We are now officially part of the OpenBSD ports:
929 http://www.openbsd.org/ports.html ! Many thanks to Will for the
932 http://www.openbsd.org/ports.html ! Many thanks to Will for the
930 work.
933 work.
931
934
932 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
935 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
933
936
934 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
937 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
935 so that it doesn't break tkinter apps.
938 so that it doesn't break tkinter apps.
936
939
937 * IPython/iplib.py (_prefilter): fix bug where aliases would
940 * IPython/iplib.py (_prefilter): fix bug where aliases would
938 shadow variables when autocall was fully off. Reported by SAGE
941 shadow variables when autocall was fully off. Reported by SAGE
939 author William Stein.
942 author William Stein.
940
943
941 * IPython/OInspect.py (Inspector.__init__): add a flag to control
944 * IPython/OInspect.py (Inspector.__init__): add a flag to control
942 at what detail level strings are computed when foo? is requested.
945 at what detail level strings are computed when foo? is requested.
943 This allows users to ask for example that the string form of an
946 This allows users to ask for example that the string form of an
944 object is only computed when foo?? is called, or even never, by
947 object is only computed when foo?? is called, or even never, by
945 setting the object_info_string_level >= 2 in the configuration
948 setting the object_info_string_level >= 2 in the configuration
946 file. This new option has been added and documented. After a
949 file. This new option has been added and documented. After a
947 request by SAGE to be able to control the printing of very large
950 request by SAGE to be able to control the printing of very large
948 objects more easily.
951 objects more easily.
949
952
950 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
953 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
951
954
952 * IPython/ipmaker.py (make_IPython): remove the ipython call path
955 * IPython/ipmaker.py (make_IPython): remove the ipython call path
953 from sys.argv, to be 100% consistent with how Python itself works
956 from sys.argv, to be 100% consistent with how Python itself works
954 (as seen for example with python -i file.py). After a bug report
957 (as seen for example with python -i file.py). After a bug report
955 by Jeffrey Collins.
958 by Jeffrey Collins.
956
959
957 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
960 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
958 nasty bug which was preventing custom namespaces with -pylab,
961 nasty bug which was preventing custom namespaces with -pylab,
959 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
962 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
960 compatibility (long gone from mpl).
963 compatibility (long gone from mpl).
961
964
962 * IPython/ipapi.py (make_session): name change: create->make. We
965 * IPython/ipapi.py (make_session): name change: create->make. We
963 use make in other places (ipmaker,...), it's shorter and easier to
966 use make in other places (ipmaker,...), it's shorter and easier to
964 type and say, etc. I'm trying to clean things before 0.7.2 so
967 type and say, etc. I'm trying to clean things before 0.7.2 so
965 that I can keep things stable wrt to ipapi in the chainsaw branch.
968 that I can keep things stable wrt to ipapi in the chainsaw branch.
966
969
967 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
970 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
968 python-mode recognizes our debugger mode. Add support for
971 python-mode recognizes our debugger mode. Add support for
969 autoindent inside (X)emacs. After a patch sent in by Jin Liu
972 autoindent inside (X)emacs. After a patch sent in by Jin Liu
970 <m.liu.jin-AT-gmail.com> originally written by
973 <m.liu.jin-AT-gmail.com> originally written by
971 doxgen-AT-newsmth.net (with minor modifications for xemacs
974 doxgen-AT-newsmth.net (with minor modifications for xemacs
972 compatibility)
975 compatibility)
973
976
974 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
977 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
975 tracebacks when walking the stack so that the stack tracking system
978 tracebacks when walking the stack so that the stack tracking system
976 in emacs' python-mode can identify the frames correctly.
979 in emacs' python-mode can identify the frames correctly.
977
980
978 * IPython/ipmaker.py (make_IPython): make the internal (and
981 * IPython/ipmaker.py (make_IPython): make the internal (and
979 default config) autoedit_syntax value false by default. Too many
982 default config) autoedit_syntax value false by default. Too many
980 users have complained to me (both on and off-list) about problems
983 users have complained to me (both on and off-list) about problems
981 with this option being on by default, so I'm making it default to
984 with this option being on by default, so I'm making it default to
982 off. It can still be enabled by anyone via the usual mechanisms.
985 off. It can still be enabled by anyone via the usual mechanisms.
983
986
984 * IPython/completer.py (Completer.attr_matches): add support for
987 * IPython/completer.py (Completer.attr_matches): add support for
985 PyCrust-style _getAttributeNames magic method. Patch contributed
988 PyCrust-style _getAttributeNames magic method. Patch contributed
986 by <mscott-AT-goldenspud.com>. Closes #50.
989 by <mscott-AT-goldenspud.com>. Closes #50.
987
990
988 * IPython/iplib.py (InteractiveShell.__init__): remove the
991 * IPython/iplib.py (InteractiveShell.__init__): remove the
989 deletion of exit/quit from __builtin__, which can break
992 deletion of exit/quit from __builtin__, which can break
990 third-party tools like the Zope debugging console. The
993 third-party tools like the Zope debugging console. The
991 %exit/%quit magics remain. In general, it's probably a good idea
994 %exit/%quit magics remain. In general, it's probably a good idea
992 not to delete anything from __builtin__, since we never know what
995 not to delete anything from __builtin__, since we never know what
993 that will break. In any case, python now (for 2.5) will support
996 that will break. In any case, python now (for 2.5) will support
994 'real' exit/quit, so this issue is moot. Closes #55.
997 'real' exit/quit, so this issue is moot. Closes #55.
995
998
996 * IPython/genutils.py (with_obj): rename the 'with' function to
999 * IPython/genutils.py (with_obj): rename the 'with' function to
997 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1000 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
998 becomes a language keyword. Closes #53.
1001 becomes a language keyword. Closes #53.
999
1002
1000 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1003 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1001 __file__ attribute to this so it fools more things into thinking
1004 __file__ attribute to this so it fools more things into thinking
1002 it is a real module. Closes #59.
1005 it is a real module. Closes #59.
1003
1006
1004 * IPython/Magic.py (magic_edit): add -n option to open the editor
1007 * IPython/Magic.py (magic_edit): add -n option to open the editor
1005 at a specific line number. After a patch by Stefan van der Walt.
1008 at a specific line number. After a patch by Stefan van der Walt.
1006
1009
1007 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1010 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1008
1011
1009 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1012 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1010 reason the file could not be opened. After automatic crash
1013 reason the file could not be opened. After automatic crash
1011 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1014 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1012 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1015 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1013 (_should_recompile): Don't fire editor if using %bg, since there
1016 (_should_recompile): Don't fire editor if using %bg, since there
1014 is no file in the first place. From the same report as above.
1017 is no file in the first place. From the same report as above.
1015 (raw_input): protect against faulty third-party prefilters. After
1018 (raw_input): protect against faulty third-party prefilters. After
1016 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1019 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1017 while running under SAGE.
1020 while running under SAGE.
1018
1021
1019 2006-05-23 Ville Vainio <vivainio@gmail.com>
1022 2006-05-23 Ville Vainio <vivainio@gmail.com>
1020
1023
1021 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1024 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1022 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1025 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1023 now returns None (again), unless dummy is specifically allowed by
1026 now returns None (again), unless dummy is specifically allowed by
1024 ipapi.get(allow_dummy=True).
1027 ipapi.get(allow_dummy=True).
1025
1028
1026 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1029 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1027
1030
1028 * IPython: remove all 2.2-compatibility objects and hacks from
1031 * IPython: remove all 2.2-compatibility objects and hacks from
1029 everywhere, since we only support 2.3 at this point. Docs
1032 everywhere, since we only support 2.3 at this point. Docs
1030 updated.
1033 updated.
1031
1034
1032 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1035 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1033 Anything requiring extra validation can be turned into a Python
1036 Anything requiring extra validation can be turned into a Python
1034 property in the future. I used a property for the db one b/c
1037 property in the future. I used a property for the db one b/c
1035 there was a nasty circularity problem with the initialization
1038 there was a nasty circularity problem with the initialization
1036 order, which right now I don't have time to clean up.
1039 order, which right now I don't have time to clean up.
1037
1040
1038 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1041 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1039 another locking bug reported by Jorgen. I'm not 100% sure though,
1042 another locking bug reported by Jorgen. I'm not 100% sure though,
1040 so more testing is needed...
1043 so more testing is needed...
1041
1044
1042 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1045 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1043
1046
1044 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1047 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1045 local variables from any routine in user code (typically executed
1048 local variables from any routine in user code (typically executed
1046 with %run) directly into the interactive namespace. Very useful
1049 with %run) directly into the interactive namespace. Very useful
1047 when doing complex debugging.
1050 when doing complex debugging.
1048 (IPythonNotRunning): Changed the default None object to a dummy
1051 (IPythonNotRunning): Changed the default None object to a dummy
1049 whose attributes can be queried as well as called without
1052 whose attributes can be queried as well as called without
1050 exploding, to ease writing code which works transparently both in
1053 exploding, to ease writing code which works transparently both in
1051 and out of ipython and uses some of this API.
1054 and out of ipython and uses some of this API.
1052
1055
1053 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1056 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1054
1057
1055 * IPython/hooks.py (result_display): Fix the fact that our display
1058 * IPython/hooks.py (result_display): Fix the fact that our display
1056 hook was using str() instead of repr(), as the default python
1059 hook was using str() instead of repr(), as the default python
1057 console does. This had gone unnoticed b/c it only happened if
1060 console does. This had gone unnoticed b/c it only happened if
1058 %Pprint was off, but the inconsistency was there.
1061 %Pprint was off, but the inconsistency was there.
1059
1062
1060 2006-05-15 Ville Vainio <vivainio@gmail.com>
1063 2006-05-15 Ville Vainio <vivainio@gmail.com>
1061
1064
1062 * Oinspect.py: Only show docstring for nonexisting/binary files
1065 * Oinspect.py: Only show docstring for nonexisting/binary files
1063 when doing object??, closing ticket #62
1066 when doing object??, closing ticket #62
1064
1067
1065 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1068 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1066
1069
1067 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1070 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1068 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1071 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1069 was being released in a routine which hadn't checked if it had
1072 was being released in a routine which hadn't checked if it had
1070 been the one to acquire it.
1073 been the one to acquire it.
1071
1074
1072 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1075 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1073
1076
1074 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1077 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1075
1078
1076 2006-04-11 Ville Vainio <vivainio@gmail.com>
1079 2006-04-11 Ville Vainio <vivainio@gmail.com>
1077
1080
1078 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1081 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1079 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1082 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1080 prefilters, allowing stuff like magics and aliases in the file.
1083 prefilters, allowing stuff like magics and aliases in the file.
1081
1084
1082 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1085 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1083 added. Supported now are "%clear in" and "%clear out" (clear input and
1086 added. Supported now are "%clear in" and "%clear out" (clear input and
1084 output history, respectively). Also fixed CachedOutput.flush to
1087 output history, respectively). Also fixed CachedOutput.flush to
1085 properly flush the output cache.
1088 properly flush the output cache.
1086
1089
1087 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1090 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1088 half-success (and fail explicitly).
1091 half-success (and fail explicitly).
1089
1092
1090 2006-03-28 Ville Vainio <vivainio@gmail.com>
1093 2006-03-28 Ville Vainio <vivainio@gmail.com>
1091
1094
1092 * iplib.py: Fix quoting of aliases so that only argless ones
1095 * iplib.py: Fix quoting of aliases so that only argless ones
1093 are quoted
1096 are quoted
1094
1097
1095 2006-03-28 Ville Vainio <vivainio@gmail.com>
1098 2006-03-28 Ville Vainio <vivainio@gmail.com>
1096
1099
1097 * iplib.py: Quote aliases with spaces in the name.
1100 * iplib.py: Quote aliases with spaces in the name.
1098 "c:\program files\blah\bin" is now legal alias target.
1101 "c:\program files\blah\bin" is now legal alias target.
1099
1102
1100 * ext_rehashdir.py: Space no longer allowed as arg
1103 * ext_rehashdir.py: Space no longer allowed as arg
1101 separator, since space is legal in path names.
1104 separator, since space is legal in path names.
1102
1105
1103 2006-03-16 Ville Vainio <vivainio@gmail.com>
1106 2006-03-16 Ville Vainio <vivainio@gmail.com>
1104
1107
1105 * upgrade_dir.py: Take path.py from Extensions, correcting
1108 * upgrade_dir.py: Take path.py from Extensions, correcting
1106 %upgrade magic
1109 %upgrade magic
1107
1110
1108 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1111 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1109
1112
1110 * hooks.py: Only enclose editor binary in quotes if legal and
1113 * hooks.py: Only enclose editor binary in quotes if legal and
1111 necessary (space in the name, and is an existing file). Fixes a bug
1114 necessary (space in the name, and is an existing file). Fixes a bug
1112 reported by Zachary Pincus.
1115 reported by Zachary Pincus.
1113
1116
1114 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1117 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1115
1118
1116 * Manual: thanks to a tip on proper color handling for Emacs, by
1119 * Manual: thanks to a tip on proper color handling for Emacs, by
1117 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1120 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1118
1121
1119 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1122 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1120 by applying the provided patch. Thanks to Liu Jin
1123 by applying the provided patch. Thanks to Liu Jin
1121 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1124 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1122 XEmacs/Linux, I'm trusting the submitter that it actually helps
1125 XEmacs/Linux, I'm trusting the submitter that it actually helps
1123 under win32/GNU Emacs. Will revisit if any problems are reported.
1126 under win32/GNU Emacs. Will revisit if any problems are reported.
1124
1127
1125 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1128 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1126
1129
1127 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1130 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1128 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1131 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1129
1132
1130 2006-03-12 Ville Vainio <vivainio@gmail.com>
1133 2006-03-12 Ville Vainio <vivainio@gmail.com>
1131
1134
1132 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1135 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1133 Torsten Marek.
1136 Torsten Marek.
1134
1137
1135 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1138 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1136
1139
1137 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1140 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1138 line ranges works again.
1141 line ranges works again.
1139
1142
1140 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1143 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1141
1144
1142 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1145 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1143 and friends, after a discussion with Zach Pincus on ipython-user.
1146 and friends, after a discussion with Zach Pincus on ipython-user.
1144 I'm not 100% sure, but after thinking about it quite a bit, it may
1147 I'm not 100% sure, but after thinking about it quite a bit, it may
1145 be OK. Testing with the multithreaded shells didn't reveal any
1148 be OK. Testing with the multithreaded shells didn't reveal any
1146 problems, but let's keep an eye out.
1149 problems, but let's keep an eye out.
1147
1150
1148 In the process, I fixed a few things which were calling
1151 In the process, I fixed a few things which were calling
1149 self.InteractiveTB() directly (like safe_execfile), which is a
1152 self.InteractiveTB() directly (like safe_execfile), which is a
1150 mistake: ALL exception reporting should be done by calling
1153 mistake: ALL exception reporting should be done by calling
1151 self.showtraceback(), which handles state and tab-completion and
1154 self.showtraceback(), which handles state and tab-completion and
1152 more.
1155 more.
1153
1156
1154 2006-03-01 Ville Vainio <vivainio@gmail.com>
1157 2006-03-01 Ville Vainio <vivainio@gmail.com>
1155
1158
1156 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1159 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1157 To use, do "from ipipe import *".
1160 To use, do "from ipipe import *".
1158
1161
1159 2006-02-24 Ville Vainio <vivainio@gmail.com>
1162 2006-02-24 Ville Vainio <vivainio@gmail.com>
1160
1163
1161 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1164 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1162 "cleanly" and safely than the older upgrade mechanism.
1165 "cleanly" and safely than the older upgrade mechanism.
1163
1166
1164 2006-02-21 Ville Vainio <vivainio@gmail.com>
1167 2006-02-21 Ville Vainio <vivainio@gmail.com>
1165
1168
1166 * Magic.py: %save works again.
1169 * Magic.py: %save works again.
1167
1170
1168 2006-02-15 Ville Vainio <vivainio@gmail.com>
1171 2006-02-15 Ville Vainio <vivainio@gmail.com>
1169
1172
1170 * Magic.py: %Pprint works again
1173 * Magic.py: %Pprint works again
1171
1174
1172 * Extensions/ipy_sane_defaults.py: Provide everything provided
1175 * Extensions/ipy_sane_defaults.py: Provide everything provided
1173 in default ipythonrc, to make it possible to have a completely empty
1176 in default ipythonrc, to make it possible to have a completely empty
1174 ipythonrc (and thus completely rc-file free configuration)
1177 ipythonrc (and thus completely rc-file free configuration)
1175
1178
1176 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1179 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1177
1180
1178 * IPython/hooks.py (editor): quote the call to the editor command,
1181 * IPython/hooks.py (editor): quote the call to the editor command,
1179 to allow commands with spaces in them. Problem noted by watching
1182 to allow commands with spaces in them. Problem noted by watching
1180 Ian Oswald's video about textpad under win32 at
1183 Ian Oswald's video about textpad under win32 at
1181 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1184 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1182
1185
1183 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1186 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1184 describing magics (we haven't used @ for a loong time).
1187 describing magics (we haven't used @ for a loong time).
1185
1188
1186 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1189 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1187 contributed by marienz to close
1190 contributed by marienz to close
1188 http://www.scipy.net/roundup/ipython/issue53.
1191 http://www.scipy.net/roundup/ipython/issue53.
1189
1192
1190 2006-02-10 Ville Vainio <vivainio@gmail.com>
1193 2006-02-10 Ville Vainio <vivainio@gmail.com>
1191
1194
1192 * genutils.py: getoutput now works in win32 too
1195 * genutils.py: getoutput now works in win32 too
1193
1196
1194 * completer.py: alias and magic completion only invoked
1197 * completer.py: alias and magic completion only invoked
1195 at the first "item" in the line, to avoid "cd %store"
1198 at the first "item" in the line, to avoid "cd %store"
1196 nonsense.
1199 nonsense.
1197
1200
1198 2006-02-09 Ville Vainio <vivainio@gmail.com>
1201 2006-02-09 Ville Vainio <vivainio@gmail.com>
1199
1202
1200 * test/*: Added a unit testing framework (finally).
1203 * test/*: Added a unit testing framework (finally).
1201 '%run runtests.py' to run test_*.
1204 '%run runtests.py' to run test_*.
1202
1205
1203 * ipapi.py: Exposed runlines and set_custom_exc
1206 * ipapi.py: Exposed runlines and set_custom_exc
1204
1207
1205 2006-02-07 Ville Vainio <vivainio@gmail.com>
1208 2006-02-07 Ville Vainio <vivainio@gmail.com>
1206
1209
1207 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1210 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1208 instead use "f(1 2)" as before.
1211 instead use "f(1 2)" as before.
1209
1212
1210 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1213 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1211
1214
1212 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1215 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1213 facilities, for demos processed by the IPython input filter
1216 facilities, for demos processed by the IPython input filter
1214 (IPythonDemo), and for running a script one-line-at-a-time as a
1217 (IPythonDemo), and for running a script one-line-at-a-time as a
1215 demo, both for pure Python (LineDemo) and for IPython-processed
1218 demo, both for pure Python (LineDemo) and for IPython-processed
1216 input (IPythonLineDemo). After a request by Dave Kohel, from the
1219 input (IPythonLineDemo). After a request by Dave Kohel, from the
1217 SAGE team.
1220 SAGE team.
1218 (Demo.edit): added an edit() method to the demo objects, to edit
1221 (Demo.edit): added an edit() method to the demo objects, to edit
1219 the in-memory copy of the last executed block.
1222 the in-memory copy of the last executed block.
1220
1223
1221 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1224 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1222 processing to %edit, %macro and %save. These commands can now be
1225 processing to %edit, %macro and %save. These commands can now be
1223 invoked on the unprocessed input as it was typed by the user
1226 invoked on the unprocessed input as it was typed by the user
1224 (without any prefilters applied). After requests by the SAGE team
1227 (without any prefilters applied). After requests by the SAGE team
1225 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1228 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1226
1229
1227 2006-02-01 Ville Vainio <vivainio@gmail.com>
1230 2006-02-01 Ville Vainio <vivainio@gmail.com>
1228
1231
1229 * setup.py, eggsetup.py: easy_install ipython==dev works
1232 * setup.py, eggsetup.py: easy_install ipython==dev works
1230 correctly now (on Linux)
1233 correctly now (on Linux)
1231
1234
1232 * ipy_user_conf,ipmaker: user config changes, removed spurious
1235 * ipy_user_conf,ipmaker: user config changes, removed spurious
1233 warnings
1236 warnings
1234
1237
1235 * iplib: if rc.banner is string, use it as is.
1238 * iplib: if rc.banner is string, use it as is.
1236
1239
1237 * Magic: %pycat accepts a string argument and pages it's contents.
1240 * Magic: %pycat accepts a string argument and pages it's contents.
1238
1241
1239
1242
1240 2006-01-30 Ville Vainio <vivainio@gmail.com>
1243 2006-01-30 Ville Vainio <vivainio@gmail.com>
1241
1244
1242 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1245 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1243 Now %store and bookmarks work through PickleShare, meaning that
1246 Now %store and bookmarks work through PickleShare, meaning that
1244 concurrent access is possible and all ipython sessions see the
1247 concurrent access is possible and all ipython sessions see the
1245 same database situation all the time, instead of snapshot of
1248 same database situation all the time, instead of snapshot of
1246 the situation when the session was started. Hence, %bookmark
1249 the situation when the session was started. Hence, %bookmark
1247 results are immediately accessible from othes sessions. The database
1250 results are immediately accessible from othes sessions. The database
1248 is also available for use by user extensions. See:
1251 is also available for use by user extensions. See:
1249 http://www.python.org/pypi/pickleshare
1252 http://www.python.org/pypi/pickleshare
1250
1253
1251 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1254 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1252
1255
1253 * aliases can now be %store'd
1256 * aliases can now be %store'd
1254
1257
1255 * path.py moved to Extensions so that pickleshare does not need
1258 * path.py moved to Extensions so that pickleshare does not need
1256 IPython-specific import. Extensions added to pythonpath right
1259 IPython-specific import. Extensions added to pythonpath right
1257 at __init__.
1260 at __init__.
1258
1261
1259 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1262 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1260 called with _ip.system and the pre-transformed command string.
1263 called with _ip.system and the pre-transformed command string.
1261
1264
1262 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1265 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1263
1266
1264 * IPython/iplib.py (interact): Fix that we were not catching
1267 * IPython/iplib.py (interact): Fix that we were not catching
1265 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1268 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1266 logic here had to change, but it's fixed now.
1269 logic here had to change, but it's fixed now.
1267
1270
1268 2006-01-29 Ville Vainio <vivainio@gmail.com>
1271 2006-01-29 Ville Vainio <vivainio@gmail.com>
1269
1272
1270 * iplib.py: Try to import pyreadline on Windows.
1273 * iplib.py: Try to import pyreadline on Windows.
1271
1274
1272 2006-01-27 Ville Vainio <vivainio@gmail.com>
1275 2006-01-27 Ville Vainio <vivainio@gmail.com>
1273
1276
1274 * iplib.py: Expose ipapi as _ip in builtin namespace.
1277 * iplib.py: Expose ipapi as _ip in builtin namespace.
1275 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1278 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1276 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1279 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1277 syntax now produce _ip.* variant of the commands.
1280 syntax now produce _ip.* variant of the commands.
1278
1281
1279 * "_ip.options().autoedit_syntax = 2" automatically throws
1282 * "_ip.options().autoedit_syntax = 2" automatically throws
1280 user to editor for syntax error correction without prompting.
1283 user to editor for syntax error correction without prompting.
1281
1284
1282 2006-01-27 Ville Vainio <vivainio@gmail.com>
1285 2006-01-27 Ville Vainio <vivainio@gmail.com>
1283
1286
1284 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1287 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1285 'ipython' at argv[0]) executed through command line.
1288 'ipython' at argv[0]) executed through command line.
1286 NOTE: this DEPRECATES calling ipython with multiple scripts
1289 NOTE: this DEPRECATES calling ipython with multiple scripts
1287 ("ipython a.py b.py c.py")
1290 ("ipython a.py b.py c.py")
1288
1291
1289 * iplib.py, hooks.py: Added configurable input prefilter,
1292 * iplib.py, hooks.py: Added configurable input prefilter,
1290 named 'input_prefilter'. See ext_rescapture.py for example
1293 named 'input_prefilter'. See ext_rescapture.py for example
1291 usage.
1294 usage.
1292
1295
1293 * ext_rescapture.py, Magic.py: Better system command output capture
1296 * ext_rescapture.py, Magic.py: Better system command output capture
1294 through 'var = !ls' (deprecates user-visible %sc). Same notation
1297 through 'var = !ls' (deprecates user-visible %sc). Same notation
1295 applies for magics, 'var = %alias' assigns alias list to var.
1298 applies for magics, 'var = %alias' assigns alias list to var.
1296
1299
1297 * ipapi.py: added meta() for accessing extension-usable data store.
1300 * ipapi.py: added meta() for accessing extension-usable data store.
1298
1301
1299 * iplib.py: added InteractiveShell.getapi(). New magics should be
1302 * iplib.py: added InteractiveShell.getapi(). New magics should be
1300 written doing self.getapi() instead of using the shell directly.
1303 written doing self.getapi() instead of using the shell directly.
1301
1304
1302 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1305 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1303 %store foo >> ~/myfoo.txt to store variables to files (in clean
1306 %store foo >> ~/myfoo.txt to store variables to files (in clean
1304 textual form, not a restorable pickle).
1307 textual form, not a restorable pickle).
1305
1308
1306 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1309 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1307
1310
1308 * usage.py, Magic.py: added %quickref
1311 * usage.py, Magic.py: added %quickref
1309
1312
1310 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1313 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1311
1314
1312 * GetoptErrors when invoking magics etc. with wrong args
1315 * GetoptErrors when invoking magics etc. with wrong args
1313 are now more helpful:
1316 are now more helpful:
1314 GetoptError: option -l not recognized (allowed: "qb" )
1317 GetoptError: option -l not recognized (allowed: "qb" )
1315
1318
1316 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1319 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1317
1320
1318 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1321 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1319 computationally intensive blocks don't appear to stall the demo.
1322 computationally intensive blocks don't appear to stall the demo.
1320
1323
1321 2006-01-24 Ville Vainio <vivainio@gmail.com>
1324 2006-01-24 Ville Vainio <vivainio@gmail.com>
1322
1325
1323 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1326 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1324 value to manipulate resulting history entry.
1327 value to manipulate resulting history entry.
1325
1328
1326 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1329 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1327 to instance methods of IPApi class, to make extending an embedded
1330 to instance methods of IPApi class, to make extending an embedded
1328 IPython feasible. See ext_rehashdir.py for example usage.
1331 IPython feasible. See ext_rehashdir.py for example usage.
1329
1332
1330 * Merged 1071-1076 from branches/0.7.1
1333 * Merged 1071-1076 from branches/0.7.1
1331
1334
1332
1335
1333 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1336 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1334
1337
1335 * tools/release (daystamp): Fix build tools to use the new
1338 * tools/release (daystamp): Fix build tools to use the new
1336 eggsetup.py script to build lightweight eggs.
1339 eggsetup.py script to build lightweight eggs.
1337
1340
1338 * Applied changesets 1062 and 1064 before 0.7.1 release.
1341 * Applied changesets 1062 and 1064 before 0.7.1 release.
1339
1342
1340 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1343 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1341 see the raw input history (without conversions like %ls ->
1344 see the raw input history (without conversions like %ls ->
1342 ipmagic("ls")). After a request from W. Stein, SAGE
1345 ipmagic("ls")). After a request from W. Stein, SAGE
1343 (http://modular.ucsd.edu/sage) developer. This information is
1346 (http://modular.ucsd.edu/sage) developer. This information is
1344 stored in the input_hist_raw attribute of the IPython instance, so
1347 stored in the input_hist_raw attribute of the IPython instance, so
1345 developers can access it if needed (it's an InputList instance).
1348 developers can access it if needed (it's an InputList instance).
1346
1349
1347 * Versionstring = 0.7.2.svn
1350 * Versionstring = 0.7.2.svn
1348
1351
1349 * eggsetup.py: A separate script for constructing eggs, creates
1352 * eggsetup.py: A separate script for constructing eggs, creates
1350 proper launch scripts even on Windows (an .exe file in
1353 proper launch scripts even on Windows (an .exe file in
1351 \python24\scripts).
1354 \python24\scripts).
1352
1355
1353 * ipapi.py: launch_new_instance, launch entry point needed for the
1356 * ipapi.py: launch_new_instance, launch entry point needed for the
1354 egg.
1357 egg.
1355
1358
1356 2006-01-23 Ville Vainio <vivainio@gmail.com>
1359 2006-01-23 Ville Vainio <vivainio@gmail.com>
1357
1360
1358 * Added %cpaste magic for pasting python code
1361 * Added %cpaste magic for pasting python code
1359
1362
1360 2006-01-22 Ville Vainio <vivainio@gmail.com>
1363 2006-01-22 Ville Vainio <vivainio@gmail.com>
1361
1364
1362 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1365 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1363
1366
1364 * Versionstring = 0.7.2.svn
1367 * Versionstring = 0.7.2.svn
1365
1368
1366 * eggsetup.py: A separate script for constructing eggs, creates
1369 * eggsetup.py: A separate script for constructing eggs, creates
1367 proper launch scripts even on Windows (an .exe file in
1370 proper launch scripts even on Windows (an .exe file in
1368 \python24\scripts).
1371 \python24\scripts).
1369
1372
1370 * ipapi.py: launch_new_instance, launch entry point needed for the
1373 * ipapi.py: launch_new_instance, launch entry point needed for the
1371 egg.
1374 egg.
1372
1375
1373 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1376 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1374
1377
1375 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1378 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1376 %pfile foo would print the file for foo even if it was a binary.
1379 %pfile foo would print the file for foo even if it was a binary.
1377 Now, extensions '.so' and '.dll' are skipped.
1380 Now, extensions '.so' and '.dll' are skipped.
1378
1381
1379 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1382 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1380 bug, where macros would fail in all threaded modes. I'm not 100%
1383 bug, where macros would fail in all threaded modes. I'm not 100%
1381 sure, so I'm going to put out an rc instead of making a release
1384 sure, so I'm going to put out an rc instead of making a release
1382 today, and wait for feedback for at least a few days.
1385 today, and wait for feedback for at least a few days.
1383
1386
1384 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1387 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1385 it...) the handling of pasting external code with autoindent on.
1388 it...) the handling of pasting external code with autoindent on.
1386 To get out of a multiline input, the rule will appear for most
1389 To get out of a multiline input, the rule will appear for most
1387 users unchanged: two blank lines or change the indent level
1390 users unchanged: two blank lines or change the indent level
1388 proposed by IPython. But there is a twist now: you can
1391 proposed by IPython. But there is a twist now: you can
1389 add/subtract only *one or two spaces*. If you add/subtract three
1392 add/subtract only *one or two spaces*. If you add/subtract three
1390 or more (unless you completely delete the line), IPython will
1393 or more (unless you completely delete the line), IPython will
1391 accept that line, and you'll need to enter a second one of pure
1394 accept that line, and you'll need to enter a second one of pure
1392 whitespace. I know it sounds complicated, but I can't find a
1395 whitespace. I know it sounds complicated, but I can't find a
1393 different solution that covers all the cases, with the right
1396 different solution that covers all the cases, with the right
1394 heuristics. Hopefully in actual use, nobody will really notice
1397 heuristics. Hopefully in actual use, nobody will really notice
1395 all these strange rules and things will 'just work'.
1398 all these strange rules and things will 'just work'.
1396
1399
1397 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1400 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1398
1401
1399 * IPython/iplib.py (interact): catch exceptions which can be
1402 * IPython/iplib.py (interact): catch exceptions which can be
1400 triggered asynchronously by signal handlers. Thanks to an
1403 triggered asynchronously by signal handlers. Thanks to an
1401 automatic crash report, submitted by Colin Kingsley
1404 automatic crash report, submitted by Colin Kingsley
1402 <tercel-AT-gentoo.org>.
1405 <tercel-AT-gentoo.org>.
1403
1406
1404 2006-01-20 Ville Vainio <vivainio@gmail.com>
1407 2006-01-20 Ville Vainio <vivainio@gmail.com>
1405
1408
1406 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1409 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1407 (%rehashdir, very useful, try it out) of how to extend ipython
1410 (%rehashdir, very useful, try it out) of how to extend ipython
1408 with new magics. Also added Extensions dir to pythonpath to make
1411 with new magics. Also added Extensions dir to pythonpath to make
1409 importing extensions easy.
1412 importing extensions easy.
1410
1413
1411 * %store now complains when trying to store interactively declared
1414 * %store now complains when trying to store interactively declared
1412 classes / instances of those classes.
1415 classes / instances of those classes.
1413
1416
1414 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1417 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1415 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1418 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1416 if they exist, and ipy_user_conf.py with some defaults is created for
1419 if they exist, and ipy_user_conf.py with some defaults is created for
1417 the user.
1420 the user.
1418
1421
1419 * Startup rehashing done by the config file, not InterpreterExec.
1422 * Startup rehashing done by the config file, not InterpreterExec.
1420 This means system commands are available even without selecting the
1423 This means system commands are available even without selecting the
1421 pysh profile. It's the sensible default after all.
1424 pysh profile. It's the sensible default after all.
1422
1425
1423 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1426 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1424
1427
1425 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1428 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1426 multiline code with autoindent on working. But I am really not
1429 multiline code with autoindent on working. But I am really not
1427 sure, so this needs more testing. Will commit a debug-enabled
1430 sure, so this needs more testing. Will commit a debug-enabled
1428 version for now, while I test it some more, so that Ville and
1431 version for now, while I test it some more, so that Ville and
1429 others may also catch any problems. Also made
1432 others may also catch any problems. Also made
1430 self.indent_current_str() a method, to ensure that there's no
1433 self.indent_current_str() a method, to ensure that there's no
1431 chance of the indent space count and the corresponding string
1434 chance of the indent space count and the corresponding string
1432 falling out of sync. All code needing the string should just call
1435 falling out of sync. All code needing the string should just call
1433 the method.
1436 the method.
1434
1437
1435 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1438 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1436
1439
1437 * IPython/Magic.py (magic_edit): fix check for when users don't
1440 * IPython/Magic.py (magic_edit): fix check for when users don't
1438 save their output files, the try/except was in the wrong section.
1441 save their output files, the try/except was in the wrong section.
1439
1442
1440 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1443 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1441
1444
1442 * IPython/Magic.py (magic_run): fix __file__ global missing from
1445 * IPython/Magic.py (magic_run): fix __file__ global missing from
1443 script's namespace when executed via %run. After a report by
1446 script's namespace when executed via %run. After a report by
1444 Vivian.
1447 Vivian.
1445
1448
1446 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1449 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1447 when using python 2.4. The parent constructor changed in 2.4, and
1450 when using python 2.4. The parent constructor changed in 2.4, and
1448 we need to track it directly (we can't call it, as it messes up
1451 we need to track it directly (we can't call it, as it messes up
1449 readline and tab-completion inside our pdb would stop working).
1452 readline and tab-completion inside our pdb would stop working).
1450 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1453 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1451
1454
1452 2006-01-16 Ville Vainio <vivainio@gmail.com>
1455 2006-01-16 Ville Vainio <vivainio@gmail.com>
1453
1456
1454 * Ipython/magic.py: Reverted back to old %edit functionality
1457 * Ipython/magic.py: Reverted back to old %edit functionality
1455 that returns file contents on exit.
1458 that returns file contents on exit.
1456
1459
1457 * IPython/path.py: Added Jason Orendorff's "path" module to
1460 * IPython/path.py: Added Jason Orendorff's "path" module to
1458 IPython tree, http://www.jorendorff.com/articles/python/path/.
1461 IPython tree, http://www.jorendorff.com/articles/python/path/.
1459 You can get path objects conveniently through %sc, and !!, e.g.:
1462 You can get path objects conveniently through %sc, and !!, e.g.:
1460 sc files=ls
1463 sc files=ls
1461 for p in files.paths: # or files.p
1464 for p in files.paths: # or files.p
1462 print p,p.mtime
1465 print p,p.mtime
1463
1466
1464 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1467 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1465 now work again without considering the exclusion regexp -
1468 now work again without considering the exclusion regexp -
1466 hence, things like ',foo my/path' turn to 'foo("my/path")'
1469 hence, things like ',foo my/path' turn to 'foo("my/path")'
1467 instead of syntax error.
1470 instead of syntax error.
1468
1471
1469
1472
1470 2006-01-14 Ville Vainio <vivainio@gmail.com>
1473 2006-01-14 Ville Vainio <vivainio@gmail.com>
1471
1474
1472 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1475 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1473 ipapi decorators for python 2.4 users, options() provides access to rc
1476 ipapi decorators for python 2.4 users, options() provides access to rc
1474 data.
1477 data.
1475
1478
1476 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1479 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1477 as path separators (even on Linux ;-). Space character after
1480 as path separators (even on Linux ;-). Space character after
1478 backslash (as yielded by tab completer) is still space;
1481 backslash (as yielded by tab completer) is still space;
1479 "%cd long\ name" works as expected.
1482 "%cd long\ name" works as expected.
1480
1483
1481 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1484 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1482 as "chain of command", with priority. API stays the same,
1485 as "chain of command", with priority. API stays the same,
1483 TryNext exception raised by a hook function signals that
1486 TryNext exception raised by a hook function signals that
1484 current hook failed and next hook should try handling it, as
1487 current hook failed and next hook should try handling it, as
1485 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1488 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1486 requested configurable display hook, which is now implemented.
1489 requested configurable display hook, which is now implemented.
1487
1490
1488 2006-01-13 Ville Vainio <vivainio@gmail.com>
1491 2006-01-13 Ville Vainio <vivainio@gmail.com>
1489
1492
1490 * IPython/platutils*.py: platform specific utility functions,
1493 * IPython/platutils*.py: platform specific utility functions,
1491 so far only set_term_title is implemented (change terminal
1494 so far only set_term_title is implemented (change terminal
1492 label in windowing systems). %cd now changes the title to
1495 label in windowing systems). %cd now changes the title to
1493 current dir.
1496 current dir.
1494
1497
1495 * IPython/Release.py: Added myself to "authors" list,
1498 * IPython/Release.py: Added myself to "authors" list,
1496 had to create new files.
1499 had to create new files.
1497
1500
1498 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1501 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1499 shell escape; not a known bug but had potential to be one in the
1502 shell escape; not a known bug but had potential to be one in the
1500 future.
1503 future.
1501
1504
1502 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1505 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1503 extension API for IPython! See the module for usage example. Fix
1506 extension API for IPython! See the module for usage example. Fix
1504 OInspect for docstring-less magic functions.
1507 OInspect for docstring-less magic functions.
1505
1508
1506
1509
1507 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1510 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1508
1511
1509 * IPython/iplib.py (raw_input): temporarily deactivate all
1512 * IPython/iplib.py (raw_input): temporarily deactivate all
1510 attempts at allowing pasting of code with autoindent on. It
1513 attempts at allowing pasting of code with autoindent on. It
1511 introduced bugs (reported by Prabhu) and I can't seem to find a
1514 introduced bugs (reported by Prabhu) and I can't seem to find a
1512 robust combination which works in all cases. Will have to revisit
1515 robust combination which works in all cases. Will have to revisit
1513 later.
1516 later.
1514
1517
1515 * IPython/genutils.py: remove isspace() function. We've dropped
1518 * IPython/genutils.py: remove isspace() function. We've dropped
1516 2.2 compatibility, so it's OK to use the string method.
1519 2.2 compatibility, so it's OK to use the string method.
1517
1520
1518 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1521 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1519
1522
1520 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1523 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1521 matching what NOT to autocall on, to include all python binary
1524 matching what NOT to autocall on, to include all python binary
1522 operators (including things like 'and', 'or', 'is' and 'in').
1525 operators (including things like 'and', 'or', 'is' and 'in').
1523 Prompted by a bug report on 'foo & bar', but I realized we had
1526 Prompted by a bug report on 'foo & bar', but I realized we had
1524 many more potential bug cases with other operators. The regexp is
1527 many more potential bug cases with other operators. The regexp is
1525 self.re_exclude_auto, it's fairly commented.
1528 self.re_exclude_auto, it's fairly commented.
1526
1529
1527 2006-01-12 Ville Vainio <vivainio@gmail.com>
1530 2006-01-12 Ville Vainio <vivainio@gmail.com>
1528
1531
1529 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1532 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1530 Prettified and hardened string/backslash quoting with ipsystem(),
1533 Prettified and hardened string/backslash quoting with ipsystem(),
1531 ipalias() and ipmagic(). Now even \ characters are passed to
1534 ipalias() and ipmagic(). Now even \ characters are passed to
1532 %magics, !shell escapes and aliases exactly as they are in the
1535 %magics, !shell escapes and aliases exactly as they are in the
1533 ipython command line. Should improve backslash experience,
1536 ipython command line. Should improve backslash experience,
1534 particularly in Windows (path delimiter for some commands that
1537 particularly in Windows (path delimiter for some commands that
1535 won't understand '/'), but Unix benefits as well (regexps). %cd
1538 won't understand '/'), but Unix benefits as well (regexps). %cd
1536 magic still doesn't support backslash path delimiters, though. Also
1539 magic still doesn't support backslash path delimiters, though. Also
1537 deleted all pretense of supporting multiline command strings in
1540 deleted all pretense of supporting multiline command strings in
1538 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1541 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1539
1542
1540 * doc/build_doc_instructions.txt added. Documentation on how to
1543 * doc/build_doc_instructions.txt added. Documentation on how to
1541 use doc/update_manual.py, added yesterday. Both files contributed
1544 use doc/update_manual.py, added yesterday. Both files contributed
1542 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1545 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1543 doc/*.sh for deprecation at a later date.
1546 doc/*.sh for deprecation at a later date.
1544
1547
1545 * /ipython.py Added ipython.py to root directory for
1548 * /ipython.py Added ipython.py to root directory for
1546 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1549 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1547 ipython.py) and development convenience (no need to keep doing
1550 ipython.py) and development convenience (no need to keep doing
1548 "setup.py install" between changes).
1551 "setup.py install" between changes).
1549
1552
1550 * Made ! and !! shell escapes work (again) in multiline expressions:
1553 * Made ! and !! shell escapes work (again) in multiline expressions:
1551 if 1:
1554 if 1:
1552 !ls
1555 !ls
1553 !!ls
1556 !!ls
1554
1557
1555 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1558 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1556
1559
1557 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1560 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1558 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1561 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1559 module in case-insensitive installation. Was causing crashes
1562 module in case-insensitive installation. Was causing crashes
1560 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1563 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1561
1564
1562 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1565 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1563 <marienz-AT-gentoo.org>, closes
1566 <marienz-AT-gentoo.org>, closes
1564 http://www.scipy.net/roundup/ipython/issue51.
1567 http://www.scipy.net/roundup/ipython/issue51.
1565
1568
1566 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1569 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1567
1570
1568 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1571 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1569 problem of excessive CPU usage under *nix and keyboard lag under
1572 problem of excessive CPU usage under *nix and keyboard lag under
1570 win32.
1573 win32.
1571
1574
1572 2006-01-10 *** Released version 0.7.0
1575 2006-01-10 *** Released version 0.7.0
1573
1576
1574 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1577 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1575
1578
1576 * IPython/Release.py (revision): tag version number to 0.7.0,
1579 * IPython/Release.py (revision): tag version number to 0.7.0,
1577 ready for release.
1580 ready for release.
1578
1581
1579 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1582 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1580 it informs the user of the name of the temp. file used. This can
1583 it informs the user of the name of the temp. file used. This can
1581 help if you decide later to reuse that same file, so you know
1584 help if you decide later to reuse that same file, so you know
1582 where to copy the info from.
1585 where to copy the info from.
1583
1586
1584 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1587 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1585
1588
1586 * setup_bdist_egg.py: little script to build an egg. Added
1589 * setup_bdist_egg.py: little script to build an egg. Added
1587 support in the release tools as well.
1590 support in the release tools as well.
1588
1591
1589 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1592 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1590
1593
1591 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1594 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1592 version selection (new -wxversion command line and ipythonrc
1595 version selection (new -wxversion command line and ipythonrc
1593 parameter). Patch contributed by Arnd Baecker
1596 parameter). Patch contributed by Arnd Baecker
1594 <arnd.baecker-AT-web.de>.
1597 <arnd.baecker-AT-web.de>.
1595
1598
1596 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1599 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1597 embedded instances, for variables defined at the interactive
1600 embedded instances, for variables defined at the interactive
1598 prompt of the embedded ipython. Reported by Arnd.
1601 prompt of the embedded ipython. Reported by Arnd.
1599
1602
1600 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1603 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1601 it can be used as a (stateful) toggle, or with a direct parameter.
1604 it can be used as a (stateful) toggle, or with a direct parameter.
1602
1605
1603 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1606 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1604 could be triggered in certain cases and cause the traceback
1607 could be triggered in certain cases and cause the traceback
1605 printer not to work.
1608 printer not to work.
1606
1609
1607 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1610 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1608
1611
1609 * IPython/iplib.py (_should_recompile): Small fix, closes
1612 * IPython/iplib.py (_should_recompile): Small fix, closes
1610 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1613 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1611
1614
1612 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1615 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1613
1616
1614 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1617 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1615 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1618 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1616 Moad for help with tracking it down.
1619 Moad for help with tracking it down.
1617
1620
1618 * IPython/iplib.py (handle_auto): fix autocall handling for
1621 * IPython/iplib.py (handle_auto): fix autocall handling for
1619 objects which support BOTH __getitem__ and __call__ (so that f [x]
1622 objects which support BOTH __getitem__ and __call__ (so that f [x]
1620 is left alone, instead of becoming f([x]) automatically).
1623 is left alone, instead of becoming f([x]) automatically).
1621
1624
1622 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1625 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1623 Ville's patch.
1626 Ville's patch.
1624
1627
1625 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1628 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1626
1629
1627 * IPython/iplib.py (handle_auto): changed autocall semantics to
1630 * IPython/iplib.py (handle_auto): changed autocall semantics to
1628 include 'smart' mode, where the autocall transformation is NOT
1631 include 'smart' mode, where the autocall transformation is NOT
1629 applied if there are no arguments on the line. This allows you to
1632 applied if there are no arguments on the line. This allows you to
1630 just type 'foo' if foo is a callable to see its internal form,
1633 just type 'foo' if foo is a callable to see its internal form,
1631 instead of having it called with no arguments (typically a
1634 instead of having it called with no arguments (typically a
1632 mistake). The old 'full' autocall still exists: for that, you
1635 mistake). The old 'full' autocall still exists: for that, you
1633 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1636 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1634
1637
1635 * IPython/completer.py (Completer.attr_matches): add
1638 * IPython/completer.py (Completer.attr_matches): add
1636 tab-completion support for Enthoughts' traits. After a report by
1639 tab-completion support for Enthoughts' traits. After a report by
1637 Arnd and a patch by Prabhu.
1640 Arnd and a patch by Prabhu.
1638
1641
1639 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1642 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1640
1643
1641 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1644 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1642 Schmolck's patch to fix inspect.getinnerframes().
1645 Schmolck's patch to fix inspect.getinnerframes().
1643
1646
1644 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1647 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1645 for embedded instances, regarding handling of namespaces and items
1648 for embedded instances, regarding handling of namespaces and items
1646 added to the __builtin__ one. Multiple embedded instances and
1649 added to the __builtin__ one. Multiple embedded instances and
1647 recursive embeddings should work better now (though I'm not sure
1650 recursive embeddings should work better now (though I'm not sure
1648 I've got all the corner cases fixed, that code is a bit of a brain
1651 I've got all the corner cases fixed, that code is a bit of a brain
1649 twister).
1652 twister).
1650
1653
1651 * IPython/Magic.py (magic_edit): added support to edit in-memory
1654 * IPython/Magic.py (magic_edit): added support to edit in-memory
1652 macros (automatically creates the necessary temp files). %edit
1655 macros (automatically creates the necessary temp files). %edit
1653 also doesn't return the file contents anymore, it's just noise.
1656 also doesn't return the file contents anymore, it's just noise.
1654
1657
1655 * IPython/completer.py (Completer.attr_matches): revert change to
1658 * IPython/completer.py (Completer.attr_matches): revert change to
1656 complete only on attributes listed in __all__. I realized it
1659 complete only on attributes listed in __all__. I realized it
1657 cripples the tab-completion system as a tool for exploring the
1660 cripples the tab-completion system as a tool for exploring the
1658 internals of unknown libraries (it renders any non-__all__
1661 internals of unknown libraries (it renders any non-__all__
1659 attribute off-limits). I got bit by this when trying to see
1662 attribute off-limits). I got bit by this when trying to see
1660 something inside the dis module.
1663 something inside the dis module.
1661
1664
1662 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1665 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1663
1666
1664 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1667 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1665 namespace for users and extension writers to hold data in. This
1668 namespace for users and extension writers to hold data in. This
1666 follows the discussion in
1669 follows the discussion in
1667 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1670 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1668
1671
1669 * IPython/completer.py (IPCompleter.complete): small patch to help
1672 * IPython/completer.py (IPCompleter.complete): small patch to help
1670 tab-completion under Emacs, after a suggestion by John Barnard
1673 tab-completion under Emacs, after a suggestion by John Barnard
1671 <barnarj-AT-ccf.org>.
1674 <barnarj-AT-ccf.org>.
1672
1675
1673 * IPython/Magic.py (Magic.extract_input_slices): added support for
1676 * IPython/Magic.py (Magic.extract_input_slices): added support for
1674 the slice notation in magics to use N-M to represent numbers N...M
1677 the slice notation in magics to use N-M to represent numbers N...M
1675 (closed endpoints). This is used by %macro and %save.
1678 (closed endpoints). This is used by %macro and %save.
1676
1679
1677 * IPython/completer.py (Completer.attr_matches): for modules which
1680 * IPython/completer.py (Completer.attr_matches): for modules which
1678 define __all__, complete only on those. After a patch by Jeffrey
1681 define __all__, complete only on those. After a patch by Jeffrey
1679 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1682 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1680 speed up this routine.
1683 speed up this routine.
1681
1684
1682 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1685 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1683 don't know if this is the end of it, but the behavior now is
1686 don't know if this is the end of it, but the behavior now is
1684 certainly much more correct. Note that coupled with macros,
1687 certainly much more correct. Note that coupled with macros,
1685 slightly surprising (at first) behavior may occur: a macro will in
1688 slightly surprising (at first) behavior may occur: a macro will in
1686 general expand to multiple lines of input, so upon exiting, the
1689 general expand to multiple lines of input, so upon exiting, the
1687 in/out counters will both be bumped by the corresponding amount
1690 in/out counters will both be bumped by the corresponding amount
1688 (as if the macro's contents had been typed interactively). Typing
1691 (as if the macro's contents had been typed interactively). Typing
1689 %hist will reveal the intermediate (silently processed) lines.
1692 %hist will reveal the intermediate (silently processed) lines.
1690
1693
1691 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1694 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1692 pickle to fail (%run was overwriting __main__ and not restoring
1695 pickle to fail (%run was overwriting __main__ and not restoring
1693 it, but pickle relies on __main__ to operate).
1696 it, but pickle relies on __main__ to operate).
1694
1697
1695 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1698 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1696 using properties, but forgot to make the main InteractiveShell
1699 using properties, but forgot to make the main InteractiveShell
1697 class a new-style class. Properties fail silently, and
1700 class a new-style class. Properties fail silently, and
1698 mysteriously, with old-style class (getters work, but
1701 mysteriously, with old-style class (getters work, but
1699 setters don't do anything).
1702 setters don't do anything).
1700
1703
1701 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1704 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1702
1705
1703 * IPython/Magic.py (magic_history): fix history reporting bug (I
1706 * IPython/Magic.py (magic_history): fix history reporting bug (I
1704 know some nasties are still there, I just can't seem to find a
1707 know some nasties are still there, I just can't seem to find a
1705 reproducible test case to track them down; the input history is
1708 reproducible test case to track them down; the input history is
1706 falling out of sync...)
1709 falling out of sync...)
1707
1710
1708 * IPython/iplib.py (handle_shell_escape): fix bug where both
1711 * IPython/iplib.py (handle_shell_escape): fix bug where both
1709 aliases and system accesses where broken for indented code (such
1712 aliases and system accesses where broken for indented code (such
1710 as loops).
1713 as loops).
1711
1714
1712 * IPython/genutils.py (shell): fix small but critical bug for
1715 * IPython/genutils.py (shell): fix small but critical bug for
1713 win32 system access.
1716 win32 system access.
1714
1717
1715 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1718 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1716
1719
1717 * IPython/iplib.py (showtraceback): remove use of the
1720 * IPython/iplib.py (showtraceback): remove use of the
1718 sys.last_{type/value/traceback} structures, which are non
1721 sys.last_{type/value/traceback} structures, which are non
1719 thread-safe.
1722 thread-safe.
1720 (_prefilter): change control flow to ensure that we NEVER
1723 (_prefilter): change control flow to ensure that we NEVER
1721 introspect objects when autocall is off. This will guarantee that
1724 introspect objects when autocall is off. This will guarantee that
1722 having an input line of the form 'x.y', where access to attribute
1725 having an input line of the form 'x.y', where access to attribute
1723 'y' has side effects, doesn't trigger the side effect TWICE. It
1726 'y' has side effects, doesn't trigger the side effect TWICE. It
1724 is important to note that, with autocall on, these side effects
1727 is important to note that, with autocall on, these side effects
1725 can still happen.
1728 can still happen.
1726 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1729 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1727 trio. IPython offers these three kinds of special calls which are
1730 trio. IPython offers these three kinds of special calls which are
1728 not python code, and it's a good thing to have their call method
1731 not python code, and it's a good thing to have their call method
1729 be accessible as pure python functions (not just special syntax at
1732 be accessible as pure python functions (not just special syntax at
1730 the command line). It gives us a better internal implementation
1733 the command line). It gives us a better internal implementation
1731 structure, as well as exposing these for user scripting more
1734 structure, as well as exposing these for user scripting more
1732 cleanly.
1735 cleanly.
1733
1736
1734 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1737 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1735 file. Now that they'll be more likely to be used with the
1738 file. Now that they'll be more likely to be used with the
1736 persistance system (%store), I want to make sure their module path
1739 persistance system (%store), I want to make sure their module path
1737 doesn't change in the future, so that we don't break things for
1740 doesn't change in the future, so that we don't break things for
1738 users' persisted data.
1741 users' persisted data.
1739
1742
1740 * IPython/iplib.py (autoindent_update): move indentation
1743 * IPython/iplib.py (autoindent_update): move indentation
1741 management into the _text_ processing loop, not the keyboard
1744 management into the _text_ processing loop, not the keyboard
1742 interactive one. This is necessary to correctly process non-typed
1745 interactive one. This is necessary to correctly process non-typed
1743 multiline input (such as macros).
1746 multiline input (such as macros).
1744
1747
1745 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1748 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1746 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1749 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1747 which was producing problems in the resulting manual.
1750 which was producing problems in the resulting manual.
1748 (magic_whos): improve reporting of instances (show their class,
1751 (magic_whos): improve reporting of instances (show their class,
1749 instead of simply printing 'instance' which isn't terribly
1752 instead of simply printing 'instance' which isn't terribly
1750 informative).
1753 informative).
1751
1754
1752 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1755 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1753 (minor mods) to support network shares under win32.
1756 (minor mods) to support network shares under win32.
1754
1757
1755 * IPython/winconsole.py (get_console_size): add new winconsole
1758 * IPython/winconsole.py (get_console_size): add new winconsole
1756 module and fixes to page_dumb() to improve its behavior under
1759 module and fixes to page_dumb() to improve its behavior under
1757 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1760 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1758
1761
1759 * IPython/Magic.py (Macro): simplified Macro class to just
1762 * IPython/Magic.py (Macro): simplified Macro class to just
1760 subclass list. We've had only 2.2 compatibility for a very long
1763 subclass list. We've had only 2.2 compatibility for a very long
1761 time, yet I was still avoiding subclassing the builtin types. No
1764 time, yet I was still avoiding subclassing the builtin types. No
1762 more (I'm also starting to use properties, though I won't shift to
1765 more (I'm also starting to use properties, though I won't shift to
1763 2.3-specific features quite yet).
1766 2.3-specific features quite yet).
1764 (magic_store): added Ville's patch for lightweight variable
1767 (magic_store): added Ville's patch for lightweight variable
1765 persistence, after a request on the user list by Matt Wilkie
1768 persistence, after a request on the user list by Matt Wilkie
1766 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1769 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1767 details.
1770 details.
1768
1771
1769 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1772 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1770 changed the default logfile name from 'ipython.log' to
1773 changed the default logfile name from 'ipython.log' to
1771 'ipython_log.py'. These logs are real python files, and now that
1774 'ipython_log.py'. These logs are real python files, and now that
1772 we have much better multiline support, people are more likely to
1775 we have much better multiline support, people are more likely to
1773 want to use them as such. Might as well name them correctly.
1776 want to use them as such. Might as well name them correctly.
1774
1777
1775 * IPython/Magic.py: substantial cleanup. While we can't stop
1778 * IPython/Magic.py: substantial cleanup. While we can't stop
1776 using magics as mixins, due to the existing customizations 'out
1779 using magics as mixins, due to the existing customizations 'out
1777 there' which rely on the mixin naming conventions, at least I
1780 there' which rely on the mixin naming conventions, at least I
1778 cleaned out all cross-class name usage. So once we are OK with
1781 cleaned out all cross-class name usage. So once we are OK with
1779 breaking compatibility, the two systems can be separated.
1782 breaking compatibility, the two systems can be separated.
1780
1783
1781 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1784 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1782 anymore, and the class is a fair bit less hideous as well. New
1785 anymore, and the class is a fair bit less hideous as well. New
1783 features were also introduced: timestamping of input, and logging
1786 features were also introduced: timestamping of input, and logging
1784 of output results. These are user-visible with the -t and -o
1787 of output results. These are user-visible with the -t and -o
1785 options to %logstart. Closes
1788 options to %logstart. Closes
1786 http://www.scipy.net/roundup/ipython/issue11 and a request by
1789 http://www.scipy.net/roundup/ipython/issue11 and a request by
1787 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1790 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1788
1791
1789 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1792 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1790
1793
1791 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1794 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1792 better handle backslashes in paths. See the thread 'More Windows
1795 better handle backslashes in paths. See the thread 'More Windows
1793 questions part 2 - \/ characters revisited' on the iypthon user
1796 questions part 2 - \/ characters revisited' on the iypthon user
1794 list:
1797 list:
1795 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1798 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1796
1799
1797 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1800 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1798
1801
1799 (InteractiveShell.__init__): change threaded shells to not use the
1802 (InteractiveShell.__init__): change threaded shells to not use the
1800 ipython crash handler. This was causing more problems than not,
1803 ipython crash handler. This was causing more problems than not,
1801 as exceptions in the main thread (GUI code, typically) would
1804 as exceptions in the main thread (GUI code, typically) would
1802 always show up as a 'crash', when they really weren't.
1805 always show up as a 'crash', when they really weren't.
1803
1806
1804 The colors and exception mode commands (%colors/%xmode) have been
1807 The colors and exception mode commands (%colors/%xmode) have been
1805 synchronized to also take this into account, so users can get
1808 synchronized to also take this into account, so users can get
1806 verbose exceptions for their threaded code as well. I also added
1809 verbose exceptions for their threaded code as well. I also added
1807 support for activating pdb inside this exception handler as well,
1810 support for activating pdb inside this exception handler as well,
1808 so now GUI authors can use IPython's enhanced pdb at runtime.
1811 so now GUI authors can use IPython's enhanced pdb at runtime.
1809
1812
1810 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1813 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1811 true by default, and add it to the shipped ipythonrc file. Since
1814 true by default, and add it to the shipped ipythonrc file. Since
1812 this asks the user before proceeding, I think it's OK to make it
1815 this asks the user before proceeding, I think it's OK to make it
1813 true by default.
1816 true by default.
1814
1817
1815 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1818 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1816 of the previous special-casing of input in the eval loop. I think
1819 of the previous special-casing of input in the eval loop. I think
1817 this is cleaner, as they really are commands and shouldn't have
1820 this is cleaner, as they really are commands and shouldn't have
1818 a special role in the middle of the core code.
1821 a special role in the middle of the core code.
1819
1822
1820 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1823 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1821
1824
1822 * IPython/iplib.py (edit_syntax_error): added support for
1825 * IPython/iplib.py (edit_syntax_error): added support for
1823 automatically reopening the editor if the file had a syntax error
1826 automatically reopening the editor if the file had a syntax error
1824 in it. Thanks to scottt who provided the patch at:
1827 in it. Thanks to scottt who provided the patch at:
1825 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1828 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1826 version committed).
1829 version committed).
1827
1830
1828 * IPython/iplib.py (handle_normal): add suport for multi-line
1831 * IPython/iplib.py (handle_normal): add suport for multi-line
1829 input with emtpy lines. This fixes
1832 input with emtpy lines. This fixes
1830 http://www.scipy.net/roundup/ipython/issue43 and a similar
1833 http://www.scipy.net/roundup/ipython/issue43 and a similar
1831 discussion on the user list.
1834 discussion on the user list.
1832
1835
1833 WARNING: a behavior change is necessarily introduced to support
1836 WARNING: a behavior change is necessarily introduced to support
1834 blank lines: now a single blank line with whitespace does NOT
1837 blank lines: now a single blank line with whitespace does NOT
1835 break the input loop, which means that when autoindent is on, by
1838 break the input loop, which means that when autoindent is on, by
1836 default hitting return on the next (indented) line does NOT exit.
1839 default hitting return on the next (indented) line does NOT exit.
1837
1840
1838 Instead, to exit a multiline input you can either have:
1841 Instead, to exit a multiline input you can either have:
1839
1842
1840 - TWO whitespace lines (just hit return again), or
1843 - TWO whitespace lines (just hit return again), or
1841 - a single whitespace line of a different length than provided
1844 - a single whitespace line of a different length than provided
1842 by the autoindent (add or remove a space).
1845 by the autoindent (add or remove a space).
1843
1846
1844 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1847 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1845 module to better organize all readline-related functionality.
1848 module to better organize all readline-related functionality.
1846 I've deleted FlexCompleter and put all completion clases here.
1849 I've deleted FlexCompleter and put all completion clases here.
1847
1850
1848 * IPython/iplib.py (raw_input): improve indentation management.
1851 * IPython/iplib.py (raw_input): improve indentation management.
1849 It is now possible to paste indented code with autoindent on, and
1852 It is now possible to paste indented code with autoindent on, and
1850 the code is interpreted correctly (though it still looks bad on
1853 the code is interpreted correctly (though it still looks bad on
1851 screen, due to the line-oriented nature of ipython).
1854 screen, due to the line-oriented nature of ipython).
1852 (MagicCompleter.complete): change behavior so that a TAB key on an
1855 (MagicCompleter.complete): change behavior so that a TAB key on an
1853 otherwise empty line actually inserts a tab, instead of completing
1856 otherwise empty line actually inserts a tab, instead of completing
1854 on the entire global namespace. This makes it easier to use the
1857 on the entire global namespace. This makes it easier to use the
1855 TAB key for indentation. After a request by Hans Meine
1858 TAB key for indentation. After a request by Hans Meine
1856 <hans_meine-AT-gmx.net>
1859 <hans_meine-AT-gmx.net>
1857 (_prefilter): add support so that typing plain 'exit' or 'quit'
1860 (_prefilter): add support so that typing plain 'exit' or 'quit'
1858 does a sensible thing. Originally I tried to deviate as little as
1861 does a sensible thing. Originally I tried to deviate as little as
1859 possible from the default python behavior, but even that one may
1862 possible from the default python behavior, but even that one may
1860 change in this direction (thread on python-dev to that effect).
1863 change in this direction (thread on python-dev to that effect).
1861 Regardless, ipython should do the right thing even if CPython's
1864 Regardless, ipython should do the right thing even if CPython's
1862 '>>>' prompt doesn't.
1865 '>>>' prompt doesn't.
1863 (InteractiveShell): removed subclassing code.InteractiveConsole
1866 (InteractiveShell): removed subclassing code.InteractiveConsole
1864 class. By now we'd overridden just about all of its methods: I've
1867 class. By now we'd overridden just about all of its methods: I've
1865 copied the remaining two over, and now ipython is a standalone
1868 copied the remaining two over, and now ipython is a standalone
1866 class. This will provide a clearer picture for the chainsaw
1869 class. This will provide a clearer picture for the chainsaw
1867 branch refactoring.
1870 branch refactoring.
1868
1871
1869 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1872 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1870
1873
1871 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1874 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1872 failures for objects which break when dir() is called on them.
1875 failures for objects which break when dir() is called on them.
1873
1876
1874 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1877 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1875 distinct local and global namespaces in the completer API. This
1878 distinct local and global namespaces in the completer API. This
1876 change allows us to properly handle completion with distinct
1879 change allows us to properly handle completion with distinct
1877 scopes, including in embedded instances (this had never really
1880 scopes, including in embedded instances (this had never really
1878 worked correctly).
1881 worked correctly).
1879
1882
1880 Note: this introduces a change in the constructor for
1883 Note: this introduces a change in the constructor for
1881 MagicCompleter, as a new global_namespace parameter is now the
1884 MagicCompleter, as a new global_namespace parameter is now the
1882 second argument (the others were bumped one position).
1885 second argument (the others were bumped one position).
1883
1886
1884 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1887 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1885
1888
1886 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1889 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1887 embedded instances (which can be done now thanks to Vivian's
1890 embedded instances (which can be done now thanks to Vivian's
1888 frame-handling fixes for pdb).
1891 frame-handling fixes for pdb).
1889 (InteractiveShell.__init__): Fix namespace handling problem in
1892 (InteractiveShell.__init__): Fix namespace handling problem in
1890 embedded instances. We were overwriting __main__ unconditionally,
1893 embedded instances. We were overwriting __main__ unconditionally,
1891 and this should only be done for 'full' (non-embedded) IPython;
1894 and this should only be done for 'full' (non-embedded) IPython;
1892 embedded instances must respect the caller's __main__. Thanks to
1895 embedded instances must respect the caller's __main__. Thanks to
1893 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1896 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1894
1897
1895 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1898 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1896
1899
1897 * setup.py: added download_url to setup(). This registers the
1900 * setup.py: added download_url to setup(). This registers the
1898 download address at PyPI, which is not only useful to humans
1901 download address at PyPI, which is not only useful to humans
1899 browsing the site, but is also picked up by setuptools (the Eggs
1902 browsing the site, but is also picked up by setuptools (the Eggs
1900 machinery). Thanks to Ville and R. Kern for the info/discussion
1903 machinery). Thanks to Ville and R. Kern for the info/discussion
1901 on this.
1904 on this.
1902
1905
1903 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1906 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1904
1907
1905 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1908 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1906 This brings a lot of nice functionality to the pdb mode, which now
1909 This brings a lot of nice functionality to the pdb mode, which now
1907 has tab-completion, syntax highlighting, and better stack handling
1910 has tab-completion, syntax highlighting, and better stack handling
1908 than before. Many thanks to Vivian De Smedt
1911 than before. Many thanks to Vivian De Smedt
1909 <vivian-AT-vdesmedt.com> for the original patches.
1912 <vivian-AT-vdesmedt.com> for the original patches.
1910
1913
1911 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1914 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1912
1915
1913 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1916 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1914 sequence to consistently accept the banner argument. The
1917 sequence to consistently accept the banner argument. The
1915 inconsistency was tripping SAGE, thanks to Gary Zablackis
1918 inconsistency was tripping SAGE, thanks to Gary Zablackis
1916 <gzabl-AT-yahoo.com> for the report.
1919 <gzabl-AT-yahoo.com> for the report.
1917
1920
1918 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1921 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1919
1922
1920 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1923 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1921 Fix bug where a naked 'alias' call in the ipythonrc file would
1924 Fix bug where a naked 'alias' call in the ipythonrc file would
1922 cause a crash. Bug reported by Jorgen Stenarson.
1925 cause a crash. Bug reported by Jorgen Stenarson.
1923
1926
1924 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1927 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1925
1928
1926 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1929 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1927 startup time.
1930 startup time.
1928
1931
1929 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1932 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1930 instances had introduced a bug with globals in normal code. Now
1933 instances had introduced a bug with globals in normal code. Now
1931 it's working in all cases.
1934 it's working in all cases.
1932
1935
1933 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1936 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1934 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1937 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1935 has been introduced to set the default case sensitivity of the
1938 has been introduced to set the default case sensitivity of the
1936 searches. Users can still select either mode at runtime on a
1939 searches. Users can still select either mode at runtime on a
1937 per-search basis.
1940 per-search basis.
1938
1941
1939 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1942 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1940
1943
1941 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1944 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1942 attributes in wildcard searches for subclasses. Modified version
1945 attributes in wildcard searches for subclasses. Modified version
1943 of a patch by Jorgen.
1946 of a patch by Jorgen.
1944
1947
1945 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1948 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1946
1949
1947 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1950 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1948 embedded instances. I added a user_global_ns attribute to the
1951 embedded instances. I added a user_global_ns attribute to the
1949 InteractiveShell class to handle this.
1952 InteractiveShell class to handle this.
1950
1953
1951 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1954 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1952
1955
1953 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1956 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1954 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1957 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1955 (reported under win32, but may happen also in other platforms).
1958 (reported under win32, but may happen also in other platforms).
1956 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1959 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1957
1960
1958 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1961 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1959
1962
1960 * IPython/Magic.py (magic_psearch): new support for wildcard
1963 * IPython/Magic.py (magic_psearch): new support for wildcard
1961 patterns. Now, typing ?a*b will list all names which begin with a
1964 patterns. Now, typing ?a*b will list all names which begin with a
1962 and end in b, for example. The %psearch magic has full
1965 and end in b, for example. The %psearch magic has full
1963 docstrings. Many thanks to JΓΆrgen Stenarson
1966 docstrings. Many thanks to JΓΆrgen Stenarson
1964 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1967 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1965 implementing this functionality.
1968 implementing this functionality.
1966
1969
1967 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1970 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1968
1971
1969 * Manual: fixed long-standing annoyance of double-dashes (as in
1972 * Manual: fixed long-standing annoyance of double-dashes (as in
1970 --prefix=~, for example) being stripped in the HTML version. This
1973 --prefix=~, for example) being stripped in the HTML version. This
1971 is a latex2html bug, but a workaround was provided. Many thanks
1974 is a latex2html bug, but a workaround was provided. Many thanks
1972 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1975 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1973 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1976 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1974 rolling. This seemingly small issue had tripped a number of users
1977 rolling. This seemingly small issue had tripped a number of users
1975 when first installing, so I'm glad to see it gone.
1978 when first installing, so I'm glad to see it gone.
1976
1979
1977 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1980 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1978
1981
1979 * IPython/Extensions/numeric_formats.py: fix missing import,
1982 * IPython/Extensions/numeric_formats.py: fix missing import,
1980 reported by Stephen Walton.
1983 reported by Stephen Walton.
1981
1984
1982 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1985 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1983
1986
1984 * IPython/demo.py: finish demo module, fully documented now.
1987 * IPython/demo.py: finish demo module, fully documented now.
1985
1988
1986 * IPython/genutils.py (file_read): simple little utility to read a
1989 * IPython/genutils.py (file_read): simple little utility to read a
1987 file and ensure it's closed afterwards.
1990 file and ensure it's closed afterwards.
1988
1991
1989 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1992 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1990
1993
1991 * IPython/demo.py (Demo.__init__): added support for individually
1994 * IPython/demo.py (Demo.__init__): added support for individually
1992 tagging blocks for automatic execution.
1995 tagging blocks for automatic execution.
1993
1996
1994 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1997 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1995 syntax-highlighted python sources, requested by John.
1998 syntax-highlighted python sources, requested by John.
1996
1999
1997 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2000 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1998
2001
1999 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2002 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2000 finishing.
2003 finishing.
2001
2004
2002 * IPython/genutils.py (shlex_split): moved from Magic to here,
2005 * IPython/genutils.py (shlex_split): moved from Magic to here,
2003 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2006 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2004
2007
2005 * IPython/demo.py (Demo.__init__): added support for silent
2008 * IPython/demo.py (Demo.__init__): added support for silent
2006 blocks, improved marks as regexps, docstrings written.
2009 blocks, improved marks as regexps, docstrings written.
2007 (Demo.__init__): better docstring, added support for sys.argv.
2010 (Demo.__init__): better docstring, added support for sys.argv.
2008
2011
2009 * IPython/genutils.py (marquee): little utility used by the demo
2012 * IPython/genutils.py (marquee): little utility used by the demo
2010 code, handy in general.
2013 code, handy in general.
2011
2014
2012 * IPython/demo.py (Demo.__init__): new class for interactive
2015 * IPython/demo.py (Demo.__init__): new class for interactive
2013 demos. Not documented yet, I just wrote it in a hurry for
2016 demos. Not documented yet, I just wrote it in a hurry for
2014 scipy'05. Will docstring later.
2017 scipy'05. Will docstring later.
2015
2018
2016 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2019 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2017
2020
2018 * IPython/Shell.py (sigint_handler): Drastic simplification which
2021 * IPython/Shell.py (sigint_handler): Drastic simplification which
2019 also seems to make Ctrl-C work correctly across threads! This is
2022 also seems to make Ctrl-C work correctly across threads! This is
2020 so simple, that I can't beleive I'd missed it before. Needs more
2023 so simple, that I can't beleive I'd missed it before. Needs more
2021 testing, though.
2024 testing, though.
2022 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2025 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2023 like this before...
2026 like this before...
2024
2027
2025 * IPython/genutils.py (get_home_dir): add protection against
2028 * IPython/genutils.py (get_home_dir): add protection against
2026 non-dirs in win32 registry.
2029 non-dirs in win32 registry.
2027
2030
2028 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2031 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2029 bug where dict was mutated while iterating (pysh crash).
2032 bug where dict was mutated while iterating (pysh crash).
2030
2033
2031 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2034 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2032
2035
2033 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2036 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2034 spurious newlines added by this routine. After a report by
2037 spurious newlines added by this routine. After a report by
2035 F. Mantegazza.
2038 F. Mantegazza.
2036
2039
2037 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2040 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2038
2041
2039 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2042 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2040 calls. These were a leftover from the GTK 1.x days, and can cause
2043 calls. These were a leftover from the GTK 1.x days, and can cause
2041 problems in certain cases (after a report by John Hunter).
2044 problems in certain cases (after a report by John Hunter).
2042
2045
2043 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2046 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2044 os.getcwd() fails at init time. Thanks to patch from David Remahl
2047 os.getcwd() fails at init time. Thanks to patch from David Remahl
2045 <chmod007-AT-mac.com>.
2048 <chmod007-AT-mac.com>.
2046 (InteractiveShell.__init__): prevent certain special magics from
2049 (InteractiveShell.__init__): prevent certain special magics from
2047 being shadowed by aliases. Closes
2050 being shadowed by aliases. Closes
2048 http://www.scipy.net/roundup/ipython/issue41.
2051 http://www.scipy.net/roundup/ipython/issue41.
2049
2052
2050 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2053 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2051
2054
2052 * IPython/iplib.py (InteractiveShell.complete): Added new
2055 * IPython/iplib.py (InteractiveShell.complete): Added new
2053 top-level completion method to expose the completion mechanism
2056 top-level completion method to expose the completion mechanism
2054 beyond readline-based environments.
2057 beyond readline-based environments.
2055
2058
2056 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2059 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2057
2060
2058 * tools/ipsvnc (svnversion): fix svnversion capture.
2061 * tools/ipsvnc (svnversion): fix svnversion capture.
2059
2062
2060 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2063 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2061 attribute to self, which was missing. Before, it was set by a
2064 attribute to self, which was missing. Before, it was set by a
2062 routine which in certain cases wasn't being called, so the
2065 routine which in certain cases wasn't being called, so the
2063 instance could end up missing the attribute. This caused a crash.
2066 instance could end up missing the attribute. This caused a crash.
2064 Closes http://www.scipy.net/roundup/ipython/issue40.
2067 Closes http://www.scipy.net/roundup/ipython/issue40.
2065
2068
2066 2005-08-16 Fernando Perez <fperez@colorado.edu>
2069 2005-08-16 Fernando Perez <fperez@colorado.edu>
2067
2070
2068 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2071 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2069 contains non-string attribute. Closes
2072 contains non-string attribute. Closes
2070 http://www.scipy.net/roundup/ipython/issue38.
2073 http://www.scipy.net/roundup/ipython/issue38.
2071
2074
2072 2005-08-14 Fernando Perez <fperez@colorado.edu>
2075 2005-08-14 Fernando Perez <fperez@colorado.edu>
2073
2076
2074 * tools/ipsvnc: Minor improvements, to add changeset info.
2077 * tools/ipsvnc: Minor improvements, to add changeset info.
2075
2078
2076 2005-08-12 Fernando Perez <fperez@colorado.edu>
2079 2005-08-12 Fernando Perez <fperez@colorado.edu>
2077
2080
2078 * IPython/iplib.py (runsource): remove self.code_to_run_src
2081 * IPython/iplib.py (runsource): remove self.code_to_run_src
2079 attribute. I realized this is nothing more than
2082 attribute. I realized this is nothing more than
2080 '\n'.join(self.buffer), and having the same data in two different
2083 '\n'.join(self.buffer), and having the same data in two different
2081 places is just asking for synchronization bugs. This may impact
2084 places is just asking for synchronization bugs. This may impact
2082 people who have custom exception handlers, so I need to warn
2085 people who have custom exception handlers, so I need to warn
2083 ipython-dev about it (F. Mantegazza may use them).
2086 ipython-dev about it (F. Mantegazza may use them).
2084
2087
2085 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2088 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2086
2089
2087 * IPython/genutils.py: fix 2.2 compatibility (generators)
2090 * IPython/genutils.py: fix 2.2 compatibility (generators)
2088
2091
2089 2005-07-18 Fernando Perez <fperez@colorado.edu>
2092 2005-07-18 Fernando Perez <fperez@colorado.edu>
2090
2093
2091 * IPython/genutils.py (get_home_dir): fix to help users with
2094 * IPython/genutils.py (get_home_dir): fix to help users with
2092 invalid $HOME under win32.
2095 invalid $HOME under win32.
2093
2096
2094 2005-07-17 Fernando Perez <fperez@colorado.edu>
2097 2005-07-17 Fernando Perez <fperez@colorado.edu>
2095
2098
2096 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2099 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2097 some old hacks and clean up a bit other routines; code should be
2100 some old hacks and clean up a bit other routines; code should be
2098 simpler and a bit faster.
2101 simpler and a bit faster.
2099
2102
2100 * IPython/iplib.py (interact): removed some last-resort attempts
2103 * IPython/iplib.py (interact): removed some last-resort attempts
2101 to survive broken stdout/stderr. That code was only making it
2104 to survive broken stdout/stderr. That code was only making it
2102 harder to abstract out the i/o (necessary for gui integration),
2105 harder to abstract out the i/o (necessary for gui integration),
2103 and the crashes it could prevent were extremely rare in practice
2106 and the crashes it could prevent were extremely rare in practice
2104 (besides being fully user-induced in a pretty violent manner).
2107 (besides being fully user-induced in a pretty violent manner).
2105
2108
2106 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2109 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2107 Nothing major yet, but the code is simpler to read; this should
2110 Nothing major yet, but the code is simpler to read; this should
2108 make it easier to do more serious modifications in the future.
2111 make it easier to do more serious modifications in the future.
2109
2112
2110 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2113 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2111 which broke in .15 (thanks to a report by Ville).
2114 which broke in .15 (thanks to a report by Ville).
2112
2115
2113 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2116 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2114 be quite correct, I know next to nothing about unicode). This
2117 be quite correct, I know next to nothing about unicode). This
2115 will allow unicode strings to be used in prompts, amongst other
2118 will allow unicode strings to be used in prompts, amongst other
2116 cases. It also will prevent ipython from crashing when unicode
2119 cases. It also will prevent ipython from crashing when unicode
2117 shows up unexpectedly in many places. If ascii encoding fails, we
2120 shows up unexpectedly in many places. If ascii encoding fails, we
2118 assume utf_8. Currently the encoding is not a user-visible
2121 assume utf_8. Currently the encoding is not a user-visible
2119 setting, though it could be made so if there is demand for it.
2122 setting, though it could be made so if there is demand for it.
2120
2123
2121 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2124 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2122
2125
2123 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2126 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2124
2127
2125 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2128 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2126
2129
2127 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2130 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2128 code can work transparently for 2.2/2.3.
2131 code can work transparently for 2.2/2.3.
2129
2132
2130 2005-07-16 Fernando Perez <fperez@colorado.edu>
2133 2005-07-16 Fernando Perez <fperez@colorado.edu>
2131
2134
2132 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2135 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2133 out of the color scheme table used for coloring exception
2136 out of the color scheme table used for coloring exception
2134 tracebacks. This allows user code to add new schemes at runtime.
2137 tracebacks. This allows user code to add new schemes at runtime.
2135 This is a minimally modified version of the patch at
2138 This is a minimally modified version of the patch at
2136 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2139 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2137 for the contribution.
2140 for the contribution.
2138
2141
2139 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2142 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2140 slightly modified version of the patch in
2143 slightly modified version of the patch in
2141 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2144 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2142 to remove the previous try/except solution (which was costlier).
2145 to remove the previous try/except solution (which was costlier).
2143 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2146 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2144
2147
2145 2005-06-08 Fernando Perez <fperez@colorado.edu>
2148 2005-06-08 Fernando Perez <fperez@colorado.edu>
2146
2149
2147 * IPython/iplib.py (write/write_err): Add methods to abstract all
2150 * IPython/iplib.py (write/write_err): Add methods to abstract all
2148 I/O a bit more.
2151 I/O a bit more.
2149
2152
2150 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2153 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2151 warning, reported by Aric Hagberg, fix by JD Hunter.
2154 warning, reported by Aric Hagberg, fix by JD Hunter.
2152
2155
2153 2005-06-02 *** Released version 0.6.15
2156 2005-06-02 *** Released version 0.6.15
2154
2157
2155 2005-06-01 Fernando Perez <fperez@colorado.edu>
2158 2005-06-01 Fernando Perez <fperez@colorado.edu>
2156
2159
2157 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2160 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2158 tab-completion of filenames within open-quoted strings. Note that
2161 tab-completion of filenames within open-quoted strings. Note that
2159 this requires that in ~/.ipython/ipythonrc, users change the
2162 this requires that in ~/.ipython/ipythonrc, users change the
2160 readline delimiters configuration to read:
2163 readline delimiters configuration to read:
2161
2164
2162 readline_remove_delims -/~
2165 readline_remove_delims -/~
2163
2166
2164
2167
2165 2005-05-31 *** Released version 0.6.14
2168 2005-05-31 *** Released version 0.6.14
2166
2169
2167 2005-05-29 Fernando Perez <fperez@colorado.edu>
2170 2005-05-29 Fernando Perez <fperez@colorado.edu>
2168
2171
2169 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2172 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2170 with files not on the filesystem. Reported by Eliyahu Sandler
2173 with files not on the filesystem. Reported by Eliyahu Sandler
2171 <eli@gondolin.net>
2174 <eli@gondolin.net>
2172
2175
2173 2005-05-22 Fernando Perez <fperez@colorado.edu>
2176 2005-05-22 Fernando Perez <fperez@colorado.edu>
2174
2177
2175 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2178 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2176 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2179 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2177
2180
2178 2005-05-19 Fernando Perez <fperez@colorado.edu>
2181 2005-05-19 Fernando Perez <fperez@colorado.edu>
2179
2182
2180 * IPython/iplib.py (safe_execfile): close a file which could be
2183 * IPython/iplib.py (safe_execfile): close a file which could be
2181 left open (causing problems in win32, which locks open files).
2184 left open (causing problems in win32, which locks open files).
2182 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2185 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2183
2186
2184 2005-05-18 Fernando Perez <fperez@colorado.edu>
2187 2005-05-18 Fernando Perez <fperez@colorado.edu>
2185
2188
2186 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2189 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2187 keyword arguments correctly to safe_execfile().
2190 keyword arguments correctly to safe_execfile().
2188
2191
2189 2005-05-13 Fernando Perez <fperez@colorado.edu>
2192 2005-05-13 Fernando Perez <fperez@colorado.edu>
2190
2193
2191 * ipython.1: Added info about Qt to manpage, and threads warning
2194 * ipython.1: Added info about Qt to manpage, and threads warning
2192 to usage page (invoked with --help).
2195 to usage page (invoked with --help).
2193
2196
2194 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2197 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2195 new matcher (it goes at the end of the priority list) to do
2198 new matcher (it goes at the end of the priority list) to do
2196 tab-completion on named function arguments. Submitted by George
2199 tab-completion on named function arguments. Submitted by George
2197 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2200 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2198 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2201 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2199 for more details.
2202 for more details.
2200
2203
2201 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2204 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2202 SystemExit exceptions in the script being run. Thanks to a report
2205 SystemExit exceptions in the script being run. Thanks to a report
2203 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2206 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2204 producing very annoying behavior when running unit tests.
2207 producing very annoying behavior when running unit tests.
2205
2208
2206 2005-05-12 Fernando Perez <fperez@colorado.edu>
2209 2005-05-12 Fernando Perez <fperez@colorado.edu>
2207
2210
2208 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2211 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2209 which I'd broken (again) due to a changed regexp. In the process,
2212 which I'd broken (again) due to a changed regexp. In the process,
2210 added ';' as an escape to auto-quote the whole line without
2213 added ';' as an escape to auto-quote the whole line without
2211 splitting its arguments. Thanks to a report by Jerry McRae
2214 splitting its arguments. Thanks to a report by Jerry McRae
2212 <qrs0xyc02-AT-sneakemail.com>.
2215 <qrs0xyc02-AT-sneakemail.com>.
2213
2216
2214 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2217 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2215 possible crashes caused by a TokenError. Reported by Ed Schofield
2218 possible crashes caused by a TokenError. Reported by Ed Schofield
2216 <schofield-AT-ftw.at>.
2219 <schofield-AT-ftw.at>.
2217
2220
2218 2005-05-06 Fernando Perez <fperez@colorado.edu>
2221 2005-05-06 Fernando Perez <fperez@colorado.edu>
2219
2222
2220 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2223 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2221
2224
2222 2005-04-29 Fernando Perez <fperez@colorado.edu>
2225 2005-04-29 Fernando Perez <fperez@colorado.edu>
2223
2226
2224 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2227 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2225 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2228 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2226 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2229 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2227 which provides support for Qt interactive usage (similar to the
2230 which provides support for Qt interactive usage (similar to the
2228 existing one for WX and GTK). This had been often requested.
2231 existing one for WX and GTK). This had been often requested.
2229
2232
2230 2005-04-14 *** Released version 0.6.13
2233 2005-04-14 *** Released version 0.6.13
2231
2234
2232 2005-04-08 Fernando Perez <fperez@colorado.edu>
2235 2005-04-08 Fernando Perez <fperez@colorado.edu>
2233
2236
2234 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2237 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2235 from _ofind, which gets called on almost every input line. Now,
2238 from _ofind, which gets called on almost every input line. Now,
2236 we only try to get docstrings if they are actually going to be
2239 we only try to get docstrings if they are actually going to be
2237 used (the overhead of fetching unnecessary docstrings can be
2240 used (the overhead of fetching unnecessary docstrings can be
2238 noticeable for certain objects, such as Pyro proxies).
2241 noticeable for certain objects, such as Pyro proxies).
2239
2242
2240 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2243 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2241 for completers. For some reason I had been passing them the state
2244 for completers. For some reason I had been passing them the state
2242 variable, which completers never actually need, and was in
2245 variable, which completers never actually need, and was in
2243 conflict with the rlcompleter API. Custom completers ONLY need to
2246 conflict with the rlcompleter API. Custom completers ONLY need to
2244 take the text parameter.
2247 take the text parameter.
2245
2248
2246 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2249 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2247 work correctly in pysh. I've also moved all the logic which used
2250 work correctly in pysh. I've also moved all the logic which used
2248 to be in pysh.py here, which will prevent problems with future
2251 to be in pysh.py here, which will prevent problems with future
2249 upgrades. However, this time I must warn users to update their
2252 upgrades. However, this time I must warn users to update their
2250 pysh profile to include the line
2253 pysh profile to include the line
2251
2254
2252 import_all IPython.Extensions.InterpreterExec
2255 import_all IPython.Extensions.InterpreterExec
2253
2256
2254 because otherwise things won't work for them. They MUST also
2257 because otherwise things won't work for them. They MUST also
2255 delete pysh.py and the line
2258 delete pysh.py and the line
2256
2259
2257 execfile pysh.py
2260 execfile pysh.py
2258
2261
2259 from their ipythonrc-pysh.
2262 from their ipythonrc-pysh.
2260
2263
2261 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2264 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2262 robust in the face of objects whose dir() returns non-strings
2265 robust in the face of objects whose dir() returns non-strings
2263 (which it shouldn't, but some broken libs like ITK do). Thanks to
2266 (which it shouldn't, but some broken libs like ITK do). Thanks to
2264 a patch by John Hunter (implemented differently, though). Also
2267 a patch by John Hunter (implemented differently, though). Also
2265 minor improvements by using .extend instead of + on lists.
2268 minor improvements by using .extend instead of + on lists.
2266
2269
2267 * pysh.py:
2270 * pysh.py:
2268
2271
2269 2005-04-06 Fernando Perez <fperez@colorado.edu>
2272 2005-04-06 Fernando Perez <fperez@colorado.edu>
2270
2273
2271 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2274 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2272 by default, so that all users benefit from it. Those who don't
2275 by default, so that all users benefit from it. Those who don't
2273 want it can still turn it off.
2276 want it can still turn it off.
2274
2277
2275 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2278 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2276 config file, I'd forgotten about this, so users were getting it
2279 config file, I'd forgotten about this, so users were getting it
2277 off by default.
2280 off by default.
2278
2281
2279 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2282 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2280 consistency. Now magics can be called in multiline statements,
2283 consistency. Now magics can be called in multiline statements,
2281 and python variables can be expanded in magic calls via $var.
2284 and python variables can be expanded in magic calls via $var.
2282 This makes the magic system behave just like aliases or !system
2285 This makes the magic system behave just like aliases or !system
2283 calls.
2286 calls.
2284
2287
2285 2005-03-28 Fernando Perez <fperez@colorado.edu>
2288 2005-03-28 Fernando Perez <fperez@colorado.edu>
2286
2289
2287 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2290 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2288 expensive string additions for building command. Add support for
2291 expensive string additions for building command. Add support for
2289 trailing ';' when autocall is used.
2292 trailing ';' when autocall is used.
2290
2293
2291 2005-03-26 Fernando Perez <fperez@colorado.edu>
2294 2005-03-26 Fernando Perez <fperez@colorado.edu>
2292
2295
2293 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2296 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2294 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2297 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2295 ipython.el robust against prompts with any number of spaces
2298 ipython.el robust against prompts with any number of spaces
2296 (including 0) after the ':' character.
2299 (including 0) after the ':' character.
2297
2300
2298 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2301 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2299 continuation prompt, which misled users to think the line was
2302 continuation prompt, which misled users to think the line was
2300 already indented. Closes debian Bug#300847, reported to me by
2303 already indented. Closes debian Bug#300847, reported to me by
2301 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2304 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2302
2305
2303 2005-03-23 Fernando Perez <fperez@colorado.edu>
2306 2005-03-23 Fernando Perez <fperez@colorado.edu>
2304
2307
2305 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2308 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2306 properly aligned if they have embedded newlines.
2309 properly aligned if they have embedded newlines.
2307
2310
2308 * IPython/iplib.py (runlines): Add a public method to expose
2311 * IPython/iplib.py (runlines): Add a public method to expose
2309 IPython's code execution machinery, so that users can run strings
2312 IPython's code execution machinery, so that users can run strings
2310 as if they had been typed at the prompt interactively.
2313 as if they had been typed at the prompt interactively.
2311 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2314 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2312 methods which can call the system shell, but with python variable
2315 methods which can call the system shell, but with python variable
2313 expansion. The three such methods are: __IPYTHON__.system,
2316 expansion. The three such methods are: __IPYTHON__.system,
2314 .getoutput and .getoutputerror. These need to be documented in a
2317 .getoutput and .getoutputerror. These need to be documented in a
2315 'public API' section (to be written) of the manual.
2318 'public API' section (to be written) of the manual.
2316
2319
2317 2005-03-20 Fernando Perez <fperez@colorado.edu>
2320 2005-03-20 Fernando Perez <fperez@colorado.edu>
2318
2321
2319 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2322 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2320 for custom exception handling. This is quite powerful, and it
2323 for custom exception handling. This is quite powerful, and it
2321 allows for user-installable exception handlers which can trap
2324 allows for user-installable exception handlers which can trap
2322 custom exceptions at runtime and treat them separately from
2325 custom exceptions at runtime and treat them separately from
2323 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2326 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2324 Mantegazza <mantegazza-AT-ill.fr>.
2327 Mantegazza <mantegazza-AT-ill.fr>.
2325 (InteractiveShell.set_custom_completer): public API function to
2328 (InteractiveShell.set_custom_completer): public API function to
2326 add new completers at runtime.
2329 add new completers at runtime.
2327
2330
2328 2005-03-19 Fernando Perez <fperez@colorado.edu>
2331 2005-03-19 Fernando Perez <fperez@colorado.edu>
2329
2332
2330 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2333 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2331 allow objects which provide their docstrings via non-standard
2334 allow objects which provide their docstrings via non-standard
2332 mechanisms (like Pyro proxies) to still be inspected by ipython's
2335 mechanisms (like Pyro proxies) to still be inspected by ipython's
2333 ? system.
2336 ? system.
2334
2337
2335 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2338 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2336 automatic capture system. I tried quite hard to make it work
2339 automatic capture system. I tried quite hard to make it work
2337 reliably, and simply failed. I tried many combinations with the
2340 reliably, and simply failed. I tried many combinations with the
2338 subprocess module, but eventually nothing worked in all needed
2341 subprocess module, but eventually nothing worked in all needed
2339 cases (not blocking stdin for the child, duplicating stdout
2342 cases (not blocking stdin for the child, duplicating stdout
2340 without blocking, etc). The new %sc/%sx still do capture to these
2343 without blocking, etc). The new %sc/%sx still do capture to these
2341 magical list/string objects which make shell use much more
2344 magical list/string objects which make shell use much more
2342 conveninent, so not all is lost.
2345 conveninent, so not all is lost.
2343
2346
2344 XXX - FIX MANUAL for the change above!
2347 XXX - FIX MANUAL for the change above!
2345
2348
2346 (runsource): I copied code.py's runsource() into ipython to modify
2349 (runsource): I copied code.py's runsource() into ipython to modify
2347 it a bit. Now the code object and source to be executed are
2350 it a bit. Now the code object and source to be executed are
2348 stored in ipython. This makes this info accessible to third-party
2351 stored in ipython. This makes this info accessible to third-party
2349 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2352 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2350 Mantegazza <mantegazza-AT-ill.fr>.
2353 Mantegazza <mantegazza-AT-ill.fr>.
2351
2354
2352 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2355 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2353 history-search via readline (like C-p/C-n). I'd wanted this for a
2356 history-search via readline (like C-p/C-n). I'd wanted this for a
2354 long time, but only recently found out how to do it. For users
2357 long time, but only recently found out how to do it. For users
2355 who already have their ipythonrc files made and want this, just
2358 who already have their ipythonrc files made and want this, just
2356 add:
2359 add:
2357
2360
2358 readline_parse_and_bind "\e[A": history-search-backward
2361 readline_parse_and_bind "\e[A": history-search-backward
2359 readline_parse_and_bind "\e[B": history-search-forward
2362 readline_parse_and_bind "\e[B": history-search-forward
2360
2363
2361 2005-03-18 Fernando Perez <fperez@colorado.edu>
2364 2005-03-18 Fernando Perez <fperez@colorado.edu>
2362
2365
2363 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2366 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2364 LSString and SList classes which allow transparent conversions
2367 LSString and SList classes which allow transparent conversions
2365 between list mode and whitespace-separated string.
2368 between list mode and whitespace-separated string.
2366 (magic_r): Fix recursion problem in %r.
2369 (magic_r): Fix recursion problem in %r.
2367
2370
2368 * IPython/genutils.py (LSString): New class to be used for
2371 * IPython/genutils.py (LSString): New class to be used for
2369 automatic storage of the results of all alias/system calls in _o
2372 automatic storage of the results of all alias/system calls in _o
2370 and _e (stdout/err). These provide a .l/.list attribute which
2373 and _e (stdout/err). These provide a .l/.list attribute which
2371 does automatic splitting on newlines. This means that for most
2374 does automatic splitting on newlines. This means that for most
2372 uses, you'll never need to do capturing of output with %sc/%sx
2375 uses, you'll never need to do capturing of output with %sc/%sx
2373 anymore, since ipython keeps this always done for you. Note that
2376 anymore, since ipython keeps this always done for you. Note that
2374 only the LAST results are stored, the _o/e variables are
2377 only the LAST results are stored, the _o/e variables are
2375 overwritten on each call. If you need to save their contents
2378 overwritten on each call. If you need to save their contents
2376 further, simply bind them to any other name.
2379 further, simply bind them to any other name.
2377
2380
2378 2005-03-17 Fernando Perez <fperez@colorado.edu>
2381 2005-03-17 Fernando Perez <fperez@colorado.edu>
2379
2382
2380 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2383 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2381 prompt namespace handling.
2384 prompt namespace handling.
2382
2385
2383 2005-03-16 Fernando Perez <fperez@colorado.edu>
2386 2005-03-16 Fernando Perez <fperez@colorado.edu>
2384
2387
2385 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2388 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2386 classic prompts to be '>>> ' (final space was missing, and it
2389 classic prompts to be '>>> ' (final space was missing, and it
2387 trips the emacs python mode).
2390 trips the emacs python mode).
2388 (BasePrompt.__str__): Added safe support for dynamic prompt
2391 (BasePrompt.__str__): Added safe support for dynamic prompt
2389 strings. Now you can set your prompt string to be '$x', and the
2392 strings. Now you can set your prompt string to be '$x', and the
2390 value of x will be printed from your interactive namespace. The
2393 value of x will be printed from your interactive namespace. The
2391 interpolation syntax includes the full Itpl support, so
2394 interpolation syntax includes the full Itpl support, so
2392 ${foo()+x+bar()} is a valid prompt string now, and the function
2395 ${foo()+x+bar()} is a valid prompt string now, and the function
2393 calls will be made at runtime.
2396 calls will be made at runtime.
2394
2397
2395 2005-03-15 Fernando Perez <fperez@colorado.edu>
2398 2005-03-15 Fernando Perez <fperez@colorado.edu>
2396
2399
2397 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2400 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2398 avoid name clashes in pylab. %hist still works, it just forwards
2401 avoid name clashes in pylab. %hist still works, it just forwards
2399 the call to %history.
2402 the call to %history.
2400
2403
2401 2005-03-02 *** Released version 0.6.12
2404 2005-03-02 *** Released version 0.6.12
2402
2405
2403 2005-03-02 Fernando Perez <fperez@colorado.edu>
2406 2005-03-02 Fernando Perez <fperez@colorado.edu>
2404
2407
2405 * IPython/iplib.py (handle_magic): log magic calls properly as
2408 * IPython/iplib.py (handle_magic): log magic calls properly as
2406 ipmagic() function calls.
2409 ipmagic() function calls.
2407
2410
2408 * IPython/Magic.py (magic_time): Improved %time to support
2411 * IPython/Magic.py (magic_time): Improved %time to support
2409 statements and provide wall-clock as well as CPU time.
2412 statements and provide wall-clock as well as CPU time.
2410
2413
2411 2005-02-27 Fernando Perez <fperez@colorado.edu>
2414 2005-02-27 Fernando Perez <fperez@colorado.edu>
2412
2415
2413 * IPython/hooks.py: New hooks module, to expose user-modifiable
2416 * IPython/hooks.py: New hooks module, to expose user-modifiable
2414 IPython functionality in a clean manner. For now only the editor
2417 IPython functionality in a clean manner. For now only the editor
2415 hook is actually written, and other thigns which I intend to turn
2418 hook is actually written, and other thigns which I intend to turn
2416 into proper hooks aren't yet there. The display and prefilter
2419 into proper hooks aren't yet there. The display and prefilter
2417 stuff, for example, should be hooks. But at least now the
2420 stuff, for example, should be hooks. But at least now the
2418 framework is in place, and the rest can be moved here with more
2421 framework is in place, and the rest can be moved here with more
2419 time later. IPython had had a .hooks variable for a long time for
2422 time later. IPython had had a .hooks variable for a long time for
2420 this purpose, but I'd never actually used it for anything.
2423 this purpose, but I'd never actually used it for anything.
2421
2424
2422 2005-02-26 Fernando Perez <fperez@colorado.edu>
2425 2005-02-26 Fernando Perez <fperez@colorado.edu>
2423
2426
2424 * IPython/ipmaker.py (make_IPython): make the default ipython
2427 * IPython/ipmaker.py (make_IPython): make the default ipython
2425 directory be called _ipython under win32, to follow more the
2428 directory be called _ipython under win32, to follow more the
2426 naming peculiarities of that platform (where buggy software like
2429 naming peculiarities of that platform (where buggy software like
2427 Visual Sourcesafe breaks with .named directories). Reported by
2430 Visual Sourcesafe breaks with .named directories). Reported by
2428 Ville Vainio.
2431 Ville Vainio.
2429
2432
2430 2005-02-23 Fernando Perez <fperez@colorado.edu>
2433 2005-02-23 Fernando Perez <fperez@colorado.edu>
2431
2434
2432 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2435 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2433 auto_aliases for win32 which were causing problems. Users can
2436 auto_aliases for win32 which were causing problems. Users can
2434 define the ones they personally like.
2437 define the ones they personally like.
2435
2438
2436 2005-02-21 Fernando Perez <fperez@colorado.edu>
2439 2005-02-21 Fernando Perez <fperez@colorado.edu>
2437
2440
2438 * IPython/Magic.py (magic_time): new magic to time execution of
2441 * IPython/Magic.py (magic_time): new magic to time execution of
2439 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2442 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2440
2443
2441 2005-02-19 Fernando Perez <fperez@colorado.edu>
2444 2005-02-19 Fernando Perez <fperez@colorado.edu>
2442
2445
2443 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2446 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2444 into keys (for prompts, for example).
2447 into keys (for prompts, for example).
2445
2448
2446 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2449 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2447 prompts in case users want them. This introduces a small behavior
2450 prompts in case users want them. This introduces a small behavior
2448 change: ipython does not automatically add a space to all prompts
2451 change: ipython does not automatically add a space to all prompts
2449 anymore. To get the old prompts with a space, users should add it
2452 anymore. To get the old prompts with a space, users should add it
2450 manually to their ipythonrc file, so for example prompt_in1 should
2453 manually to their ipythonrc file, so for example prompt_in1 should
2451 now read 'In [\#]: ' instead of 'In [\#]:'.
2454 now read 'In [\#]: ' instead of 'In [\#]:'.
2452 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2455 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2453 file) to control left-padding of secondary prompts.
2456 file) to control left-padding of secondary prompts.
2454
2457
2455 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2458 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2456 the profiler can't be imported. Fix for Debian, which removed
2459 the profiler can't be imported. Fix for Debian, which removed
2457 profile.py because of License issues. I applied a slightly
2460 profile.py because of License issues. I applied a slightly
2458 modified version of the original Debian patch at
2461 modified version of the original Debian patch at
2459 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2462 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2460
2463
2461 2005-02-17 Fernando Perez <fperez@colorado.edu>
2464 2005-02-17 Fernando Perez <fperez@colorado.edu>
2462
2465
2463 * IPython/genutils.py (native_line_ends): Fix bug which would
2466 * IPython/genutils.py (native_line_ends): Fix bug which would
2464 cause improper line-ends under win32 b/c I was not opening files
2467 cause improper line-ends under win32 b/c I was not opening files
2465 in binary mode. Bug report and fix thanks to Ville.
2468 in binary mode. Bug report and fix thanks to Ville.
2466
2469
2467 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2470 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2468 trying to catch spurious foo[1] autocalls. My fix actually broke
2471 trying to catch spurious foo[1] autocalls. My fix actually broke
2469 ',/' autoquote/call with explicit escape (bad regexp).
2472 ',/' autoquote/call with explicit escape (bad regexp).
2470
2473
2471 2005-02-15 *** Released version 0.6.11
2474 2005-02-15 *** Released version 0.6.11
2472
2475
2473 2005-02-14 Fernando Perez <fperez@colorado.edu>
2476 2005-02-14 Fernando Perez <fperez@colorado.edu>
2474
2477
2475 * IPython/background_jobs.py: New background job management
2478 * IPython/background_jobs.py: New background job management
2476 subsystem. This is implemented via a new set of classes, and
2479 subsystem. This is implemented via a new set of classes, and
2477 IPython now provides a builtin 'jobs' object for background job
2480 IPython now provides a builtin 'jobs' object for background job
2478 execution. A convenience %bg magic serves as a lightweight
2481 execution. A convenience %bg magic serves as a lightweight
2479 frontend for starting the more common type of calls. This was
2482 frontend for starting the more common type of calls. This was
2480 inspired by discussions with B. Granger and the BackgroundCommand
2483 inspired by discussions with B. Granger and the BackgroundCommand
2481 class described in the book Python Scripting for Computational
2484 class described in the book Python Scripting for Computational
2482 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2485 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2483 (although ultimately no code from this text was used, as IPython's
2486 (although ultimately no code from this text was used, as IPython's
2484 system is a separate implementation).
2487 system is a separate implementation).
2485
2488
2486 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2489 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2487 to control the completion of single/double underscore names
2490 to control the completion of single/double underscore names
2488 separately. As documented in the example ipytonrc file, the
2491 separately. As documented in the example ipytonrc file, the
2489 readline_omit__names variable can now be set to 2, to omit even
2492 readline_omit__names variable can now be set to 2, to omit even
2490 single underscore names. Thanks to a patch by Brian Wong
2493 single underscore names. Thanks to a patch by Brian Wong
2491 <BrianWong-AT-AirgoNetworks.Com>.
2494 <BrianWong-AT-AirgoNetworks.Com>.
2492 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2495 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2493 be autocalled as foo([1]) if foo were callable. A problem for
2496 be autocalled as foo([1]) if foo were callable. A problem for
2494 things which are both callable and implement __getitem__.
2497 things which are both callable and implement __getitem__.
2495 (init_readline): Fix autoindentation for win32. Thanks to a patch
2498 (init_readline): Fix autoindentation for win32. Thanks to a patch
2496 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2499 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2497
2500
2498 2005-02-12 Fernando Perez <fperez@colorado.edu>
2501 2005-02-12 Fernando Perez <fperez@colorado.edu>
2499
2502
2500 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2503 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2501 which I had written long ago to sort out user error messages which
2504 which I had written long ago to sort out user error messages which
2502 may occur during startup. This seemed like a good idea initially,
2505 may occur during startup. This seemed like a good idea initially,
2503 but it has proven a disaster in retrospect. I don't want to
2506 but it has proven a disaster in retrospect. I don't want to
2504 change much code for now, so my fix is to set the internal 'debug'
2507 change much code for now, so my fix is to set the internal 'debug'
2505 flag to true everywhere, whose only job was precisely to control
2508 flag to true everywhere, whose only job was precisely to control
2506 this subsystem. This closes issue 28 (as well as avoiding all
2509 this subsystem. This closes issue 28 (as well as avoiding all
2507 sorts of strange hangups which occur from time to time).
2510 sorts of strange hangups which occur from time to time).
2508
2511
2509 2005-02-07 Fernando Perez <fperez@colorado.edu>
2512 2005-02-07 Fernando Perez <fperez@colorado.edu>
2510
2513
2511 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2514 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2512 previous call produced a syntax error.
2515 previous call produced a syntax error.
2513
2516
2514 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2517 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2515 classes without constructor.
2518 classes without constructor.
2516
2519
2517 2005-02-06 Fernando Perez <fperez@colorado.edu>
2520 2005-02-06 Fernando Perez <fperez@colorado.edu>
2518
2521
2519 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2522 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2520 completions with the results of each matcher, so we return results
2523 completions with the results of each matcher, so we return results
2521 to the user from all namespaces. This breaks with ipython
2524 to the user from all namespaces. This breaks with ipython
2522 tradition, but I think it's a nicer behavior. Now you get all
2525 tradition, but I think it's a nicer behavior. Now you get all
2523 possible completions listed, from all possible namespaces (python,
2526 possible completions listed, from all possible namespaces (python,
2524 filesystem, magics...) After a request by John Hunter
2527 filesystem, magics...) After a request by John Hunter
2525 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2528 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2526
2529
2527 2005-02-05 Fernando Perez <fperez@colorado.edu>
2530 2005-02-05 Fernando Perez <fperez@colorado.edu>
2528
2531
2529 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2532 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2530 the call had quote characters in it (the quotes were stripped).
2533 the call had quote characters in it (the quotes were stripped).
2531
2534
2532 2005-01-31 Fernando Perez <fperez@colorado.edu>
2535 2005-01-31 Fernando Perez <fperez@colorado.edu>
2533
2536
2534 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2537 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2535 Itpl.itpl() to make the code more robust against psyco
2538 Itpl.itpl() to make the code more robust against psyco
2536 optimizations.
2539 optimizations.
2537
2540
2538 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2541 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2539 of causing an exception. Quicker, cleaner.
2542 of causing an exception. Quicker, cleaner.
2540
2543
2541 2005-01-28 Fernando Perez <fperez@colorado.edu>
2544 2005-01-28 Fernando Perez <fperez@colorado.edu>
2542
2545
2543 * scripts/ipython_win_post_install.py (install): hardcode
2546 * scripts/ipython_win_post_install.py (install): hardcode
2544 sys.prefix+'python.exe' as the executable path. It turns out that
2547 sys.prefix+'python.exe' as the executable path. It turns out that
2545 during the post-installation run, sys.executable resolves to the
2548 during the post-installation run, sys.executable resolves to the
2546 name of the binary installer! I should report this as a distutils
2549 name of the binary installer! I should report this as a distutils
2547 bug, I think. I updated the .10 release with this tiny fix, to
2550 bug, I think. I updated the .10 release with this tiny fix, to
2548 avoid annoying the lists further.
2551 avoid annoying the lists further.
2549
2552
2550 2005-01-27 *** Released version 0.6.10
2553 2005-01-27 *** Released version 0.6.10
2551
2554
2552 2005-01-27 Fernando Perez <fperez@colorado.edu>
2555 2005-01-27 Fernando Perez <fperez@colorado.edu>
2553
2556
2554 * IPython/numutils.py (norm): Added 'inf' as optional name for
2557 * IPython/numutils.py (norm): Added 'inf' as optional name for
2555 L-infinity norm, included references to mathworld.com for vector
2558 L-infinity norm, included references to mathworld.com for vector
2556 norm definitions.
2559 norm definitions.
2557 (amin/amax): added amin/amax for array min/max. Similar to what
2560 (amin/amax): added amin/amax for array min/max. Similar to what
2558 pylab ships with after the recent reorganization of names.
2561 pylab ships with after the recent reorganization of names.
2559 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2562 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2560
2563
2561 * ipython.el: committed Alex's recent fixes and improvements.
2564 * ipython.el: committed Alex's recent fixes and improvements.
2562 Tested with python-mode from CVS, and it looks excellent. Since
2565 Tested with python-mode from CVS, and it looks excellent. Since
2563 python-mode hasn't released anything in a while, I'm temporarily
2566 python-mode hasn't released anything in a while, I'm temporarily
2564 putting a copy of today's CVS (v 4.70) of python-mode in:
2567 putting a copy of today's CVS (v 4.70) of python-mode in:
2565 http://ipython.scipy.org/tmp/python-mode.el
2568 http://ipython.scipy.org/tmp/python-mode.el
2566
2569
2567 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2570 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2568 sys.executable for the executable name, instead of assuming it's
2571 sys.executable for the executable name, instead of assuming it's
2569 called 'python.exe' (the post-installer would have produced broken
2572 called 'python.exe' (the post-installer would have produced broken
2570 setups on systems with a differently named python binary).
2573 setups on systems with a differently named python binary).
2571
2574
2572 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2575 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2573 references to os.linesep, to make the code more
2576 references to os.linesep, to make the code more
2574 platform-independent. This is also part of the win32 coloring
2577 platform-independent. This is also part of the win32 coloring
2575 fixes.
2578 fixes.
2576
2579
2577 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2580 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2578 lines, which actually cause coloring bugs because the length of
2581 lines, which actually cause coloring bugs because the length of
2579 the line is very difficult to correctly compute with embedded
2582 the line is very difficult to correctly compute with embedded
2580 escapes. This was the source of all the coloring problems under
2583 escapes. This was the source of all the coloring problems under
2581 Win32. I think that _finally_, Win32 users have a properly
2584 Win32. I think that _finally_, Win32 users have a properly
2582 working ipython in all respects. This would never have happened
2585 working ipython in all respects. This would never have happened
2583 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2586 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2584
2587
2585 2005-01-26 *** Released version 0.6.9
2588 2005-01-26 *** Released version 0.6.9
2586
2589
2587 2005-01-25 Fernando Perez <fperez@colorado.edu>
2590 2005-01-25 Fernando Perez <fperez@colorado.edu>
2588
2591
2589 * setup.py: finally, we have a true Windows installer, thanks to
2592 * setup.py: finally, we have a true Windows installer, thanks to
2590 the excellent work of Viktor Ransmayr
2593 the excellent work of Viktor Ransmayr
2591 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2594 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2592 Windows users. The setup routine is quite a bit cleaner thanks to
2595 Windows users. The setup routine is quite a bit cleaner thanks to
2593 this, and the post-install script uses the proper functions to
2596 this, and the post-install script uses the proper functions to
2594 allow a clean de-installation using the standard Windows Control
2597 allow a clean de-installation using the standard Windows Control
2595 Panel.
2598 Panel.
2596
2599
2597 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2600 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2598 environment variable under all OSes (including win32) if
2601 environment variable under all OSes (including win32) if
2599 available. This will give consistency to win32 users who have set
2602 available. This will give consistency to win32 users who have set
2600 this variable for any reason. If os.environ['HOME'] fails, the
2603 this variable for any reason. If os.environ['HOME'] fails, the
2601 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2604 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2602
2605
2603 2005-01-24 Fernando Perez <fperez@colorado.edu>
2606 2005-01-24 Fernando Perez <fperez@colorado.edu>
2604
2607
2605 * IPython/numutils.py (empty_like): add empty_like(), similar to
2608 * IPython/numutils.py (empty_like): add empty_like(), similar to
2606 zeros_like() but taking advantage of the new empty() Numeric routine.
2609 zeros_like() but taking advantage of the new empty() Numeric routine.
2607
2610
2608 2005-01-23 *** Released version 0.6.8
2611 2005-01-23 *** Released version 0.6.8
2609
2612
2610 2005-01-22 Fernando Perez <fperez@colorado.edu>
2613 2005-01-22 Fernando Perez <fperez@colorado.edu>
2611
2614
2612 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2615 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2613 automatic show() calls. After discussing things with JDH, it
2616 automatic show() calls. After discussing things with JDH, it
2614 turns out there are too many corner cases where this can go wrong.
2617 turns out there are too many corner cases where this can go wrong.
2615 It's best not to try to be 'too smart', and simply have ipython
2618 It's best not to try to be 'too smart', and simply have ipython
2616 reproduce as much as possible the default behavior of a normal
2619 reproduce as much as possible the default behavior of a normal
2617 python shell.
2620 python shell.
2618
2621
2619 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2622 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2620 line-splitting regexp and _prefilter() to avoid calling getattr()
2623 line-splitting regexp and _prefilter() to avoid calling getattr()
2621 on assignments. This closes
2624 on assignments. This closes
2622 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2625 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2623 readline uses getattr(), so a simple <TAB> keypress is still
2626 readline uses getattr(), so a simple <TAB> keypress is still
2624 enough to trigger getattr() calls on an object.
2627 enough to trigger getattr() calls on an object.
2625
2628
2626 2005-01-21 Fernando Perez <fperez@colorado.edu>
2629 2005-01-21 Fernando Perez <fperez@colorado.edu>
2627
2630
2628 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2631 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2629 docstring under pylab so it doesn't mask the original.
2632 docstring under pylab so it doesn't mask the original.
2630
2633
2631 2005-01-21 *** Released version 0.6.7
2634 2005-01-21 *** Released version 0.6.7
2632
2635
2633 2005-01-21 Fernando Perez <fperez@colorado.edu>
2636 2005-01-21 Fernando Perez <fperez@colorado.edu>
2634
2637
2635 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2638 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2636 signal handling for win32 users in multithreaded mode.
2639 signal handling for win32 users in multithreaded mode.
2637
2640
2638 2005-01-17 Fernando Perez <fperez@colorado.edu>
2641 2005-01-17 Fernando Perez <fperez@colorado.edu>
2639
2642
2640 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2643 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2641 instances with no __init__. After a crash report by Norbert Nemec
2644 instances with no __init__. After a crash report by Norbert Nemec
2642 <Norbert-AT-nemec-online.de>.
2645 <Norbert-AT-nemec-online.de>.
2643
2646
2644 2005-01-14 Fernando Perez <fperez@colorado.edu>
2647 2005-01-14 Fernando Perez <fperez@colorado.edu>
2645
2648
2646 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2649 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2647 names for verbose exceptions, when multiple dotted names and the
2650 names for verbose exceptions, when multiple dotted names and the
2648 'parent' object were present on the same line.
2651 'parent' object were present on the same line.
2649
2652
2650 2005-01-11 Fernando Perez <fperez@colorado.edu>
2653 2005-01-11 Fernando Perez <fperez@colorado.edu>
2651
2654
2652 * IPython/genutils.py (flag_calls): new utility to trap and flag
2655 * IPython/genutils.py (flag_calls): new utility to trap and flag
2653 calls in functions. I need it to clean up matplotlib support.
2656 calls in functions. I need it to clean up matplotlib support.
2654 Also removed some deprecated code in genutils.
2657 Also removed some deprecated code in genutils.
2655
2658
2656 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2659 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2657 that matplotlib scripts called with %run, which don't call show()
2660 that matplotlib scripts called with %run, which don't call show()
2658 themselves, still have their plotting windows open.
2661 themselves, still have their plotting windows open.
2659
2662
2660 2005-01-05 Fernando Perez <fperez@colorado.edu>
2663 2005-01-05 Fernando Perez <fperez@colorado.edu>
2661
2664
2662 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2665 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2663 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2666 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2664
2667
2665 2004-12-19 Fernando Perez <fperez@colorado.edu>
2668 2004-12-19 Fernando Perez <fperez@colorado.edu>
2666
2669
2667 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2670 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2668 parent_runcode, which was an eyesore. The same result can be
2671 parent_runcode, which was an eyesore. The same result can be
2669 obtained with Python's regular superclass mechanisms.
2672 obtained with Python's regular superclass mechanisms.
2670
2673
2671 2004-12-17 Fernando Perez <fperez@colorado.edu>
2674 2004-12-17 Fernando Perez <fperez@colorado.edu>
2672
2675
2673 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2676 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2674 reported by Prabhu.
2677 reported by Prabhu.
2675 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2678 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2676 sys.stderr) instead of explicitly calling sys.stderr. This helps
2679 sys.stderr) instead of explicitly calling sys.stderr. This helps
2677 maintain our I/O abstractions clean, for future GUI embeddings.
2680 maintain our I/O abstractions clean, for future GUI embeddings.
2678
2681
2679 * IPython/genutils.py (info): added new utility for sys.stderr
2682 * IPython/genutils.py (info): added new utility for sys.stderr
2680 unified info message handling (thin wrapper around warn()).
2683 unified info message handling (thin wrapper around warn()).
2681
2684
2682 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2685 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2683 composite (dotted) names on verbose exceptions.
2686 composite (dotted) names on verbose exceptions.
2684 (VerboseTB.nullrepr): harden against another kind of errors which
2687 (VerboseTB.nullrepr): harden against another kind of errors which
2685 Python's inspect module can trigger, and which were crashing
2688 Python's inspect module can trigger, and which were crashing
2686 IPython. Thanks to a report by Marco Lombardi
2689 IPython. Thanks to a report by Marco Lombardi
2687 <mlombard-AT-ma010192.hq.eso.org>.
2690 <mlombard-AT-ma010192.hq.eso.org>.
2688
2691
2689 2004-12-13 *** Released version 0.6.6
2692 2004-12-13 *** Released version 0.6.6
2690
2693
2691 2004-12-12 Fernando Perez <fperez@colorado.edu>
2694 2004-12-12 Fernando Perez <fperez@colorado.edu>
2692
2695
2693 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2696 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2694 generated by pygtk upon initialization if it was built without
2697 generated by pygtk upon initialization if it was built without
2695 threads (for matplotlib users). After a crash reported by
2698 threads (for matplotlib users). After a crash reported by
2696 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2699 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2697
2700
2698 * IPython/ipmaker.py (make_IPython): fix small bug in the
2701 * IPython/ipmaker.py (make_IPython): fix small bug in the
2699 import_some parameter for multiple imports.
2702 import_some parameter for multiple imports.
2700
2703
2701 * IPython/iplib.py (ipmagic): simplified the interface of
2704 * IPython/iplib.py (ipmagic): simplified the interface of
2702 ipmagic() to take a single string argument, just as it would be
2705 ipmagic() to take a single string argument, just as it would be
2703 typed at the IPython cmd line.
2706 typed at the IPython cmd line.
2704 (ipalias): Added new ipalias() with an interface identical to
2707 (ipalias): Added new ipalias() with an interface identical to
2705 ipmagic(). This completes exposing a pure python interface to the
2708 ipmagic(). This completes exposing a pure python interface to the
2706 alias and magic system, which can be used in loops or more complex
2709 alias and magic system, which can be used in loops or more complex
2707 code where IPython's automatic line mangling is not active.
2710 code where IPython's automatic line mangling is not active.
2708
2711
2709 * IPython/genutils.py (timing): changed interface of timing to
2712 * IPython/genutils.py (timing): changed interface of timing to
2710 simply run code once, which is the most common case. timings()
2713 simply run code once, which is the most common case. timings()
2711 remains unchanged, for the cases where you want multiple runs.
2714 remains unchanged, for the cases where you want multiple runs.
2712
2715
2713 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2716 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2714 bug where Python2.2 crashes with exec'ing code which does not end
2717 bug where Python2.2 crashes with exec'ing code which does not end
2715 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2718 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2716 before.
2719 before.
2717
2720
2718 2004-12-10 Fernando Perez <fperez@colorado.edu>
2721 2004-12-10 Fernando Perez <fperez@colorado.edu>
2719
2722
2720 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2723 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2721 -t to -T, to accomodate the new -t flag in %run (the %run and
2724 -t to -T, to accomodate the new -t flag in %run (the %run and
2722 %prun options are kind of intermixed, and it's not easy to change
2725 %prun options are kind of intermixed, and it's not easy to change
2723 this with the limitations of python's getopt).
2726 this with the limitations of python's getopt).
2724
2727
2725 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2728 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2726 the execution of scripts. It's not as fine-tuned as timeit.py,
2729 the execution of scripts. It's not as fine-tuned as timeit.py,
2727 but it works from inside ipython (and under 2.2, which lacks
2730 but it works from inside ipython (and under 2.2, which lacks
2728 timeit.py). Optionally a number of runs > 1 can be given for
2731 timeit.py). Optionally a number of runs > 1 can be given for
2729 timing very short-running code.
2732 timing very short-running code.
2730
2733
2731 * IPython/genutils.py (uniq_stable): new routine which returns a
2734 * IPython/genutils.py (uniq_stable): new routine which returns a
2732 list of unique elements in any iterable, but in stable order of
2735 list of unique elements in any iterable, but in stable order of
2733 appearance. I needed this for the ultraTB fixes, and it's a handy
2736 appearance. I needed this for the ultraTB fixes, and it's a handy
2734 utility.
2737 utility.
2735
2738
2736 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2739 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2737 dotted names in Verbose exceptions. This had been broken since
2740 dotted names in Verbose exceptions. This had been broken since
2738 the very start, now x.y will properly be printed in a Verbose
2741 the very start, now x.y will properly be printed in a Verbose
2739 traceback, instead of x being shown and y appearing always as an
2742 traceback, instead of x being shown and y appearing always as an
2740 'undefined global'. Getting this to work was a bit tricky,
2743 'undefined global'. Getting this to work was a bit tricky,
2741 because by default python tokenizers are stateless. Saved by
2744 because by default python tokenizers are stateless. Saved by
2742 python's ability to easily add a bit of state to an arbitrary
2745 python's ability to easily add a bit of state to an arbitrary
2743 function (without needing to build a full-blown callable object).
2746 function (without needing to build a full-blown callable object).
2744
2747
2745 Also big cleanup of this code, which had horrendous runtime
2748 Also big cleanup of this code, which had horrendous runtime
2746 lookups of zillions of attributes for colorization. Moved all
2749 lookups of zillions of attributes for colorization. Moved all
2747 this code into a few templates, which make it cleaner and quicker.
2750 this code into a few templates, which make it cleaner and quicker.
2748
2751
2749 Printout quality was also improved for Verbose exceptions: one
2752 Printout quality was also improved for Verbose exceptions: one
2750 variable per line, and memory addresses are printed (this can be
2753 variable per line, and memory addresses are printed (this can be
2751 quite handy in nasty debugging situations, which is what Verbose
2754 quite handy in nasty debugging situations, which is what Verbose
2752 is for).
2755 is for).
2753
2756
2754 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2757 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2755 the command line as scripts to be loaded by embedded instances.
2758 the command line as scripts to be loaded by embedded instances.
2756 Doing so has the potential for an infinite recursion if there are
2759 Doing so has the potential for an infinite recursion if there are
2757 exceptions thrown in the process. This fixes a strange crash
2760 exceptions thrown in the process. This fixes a strange crash
2758 reported by Philippe MULLER <muller-AT-irit.fr>.
2761 reported by Philippe MULLER <muller-AT-irit.fr>.
2759
2762
2760 2004-12-09 Fernando Perez <fperez@colorado.edu>
2763 2004-12-09 Fernando Perez <fperez@colorado.edu>
2761
2764
2762 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2765 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2763 to reflect new names in matplotlib, which now expose the
2766 to reflect new names in matplotlib, which now expose the
2764 matlab-compatible interface via a pylab module instead of the
2767 matlab-compatible interface via a pylab module instead of the
2765 'matlab' name. The new code is backwards compatible, so users of
2768 'matlab' name. The new code is backwards compatible, so users of
2766 all matplotlib versions are OK. Patch by J. Hunter.
2769 all matplotlib versions are OK. Patch by J. Hunter.
2767
2770
2768 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2771 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2769 of __init__ docstrings for instances (class docstrings are already
2772 of __init__ docstrings for instances (class docstrings are already
2770 automatically printed). Instances with customized docstrings
2773 automatically printed). Instances with customized docstrings
2771 (indep. of the class) are also recognized and all 3 separate
2774 (indep. of the class) are also recognized and all 3 separate
2772 docstrings are printed (instance, class, constructor). After some
2775 docstrings are printed (instance, class, constructor). After some
2773 comments/suggestions by J. Hunter.
2776 comments/suggestions by J. Hunter.
2774
2777
2775 2004-12-05 Fernando Perez <fperez@colorado.edu>
2778 2004-12-05 Fernando Perez <fperez@colorado.edu>
2776
2779
2777 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2780 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2778 warnings when tab-completion fails and triggers an exception.
2781 warnings when tab-completion fails and triggers an exception.
2779
2782
2780 2004-12-03 Fernando Perez <fperez@colorado.edu>
2783 2004-12-03 Fernando Perez <fperez@colorado.edu>
2781
2784
2782 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2785 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2783 be triggered when using 'run -p'. An incorrect option flag was
2786 be triggered when using 'run -p'. An incorrect option flag was
2784 being set ('d' instead of 'D').
2787 being set ('d' instead of 'D').
2785 (manpage): fix missing escaped \- sign.
2788 (manpage): fix missing escaped \- sign.
2786
2789
2787 2004-11-30 *** Released version 0.6.5
2790 2004-11-30 *** Released version 0.6.5
2788
2791
2789 2004-11-30 Fernando Perez <fperez@colorado.edu>
2792 2004-11-30 Fernando Perez <fperez@colorado.edu>
2790
2793
2791 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2794 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2792 setting with -d option.
2795 setting with -d option.
2793
2796
2794 * setup.py (docfiles): Fix problem where the doc glob I was using
2797 * setup.py (docfiles): Fix problem where the doc glob I was using
2795 was COMPLETELY BROKEN. It was giving the right files by pure
2798 was COMPLETELY BROKEN. It was giving the right files by pure
2796 accident, but failed once I tried to include ipython.el. Note:
2799 accident, but failed once I tried to include ipython.el. Note:
2797 glob() does NOT allow you to do exclusion on multiple endings!
2800 glob() does NOT allow you to do exclusion on multiple endings!
2798
2801
2799 2004-11-29 Fernando Perez <fperez@colorado.edu>
2802 2004-11-29 Fernando Perez <fperez@colorado.edu>
2800
2803
2801 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2804 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2802 the manpage as the source. Better formatting & consistency.
2805 the manpage as the source. Better formatting & consistency.
2803
2806
2804 * IPython/Magic.py (magic_run): Added new -d option, to run
2807 * IPython/Magic.py (magic_run): Added new -d option, to run
2805 scripts under the control of the python pdb debugger. Note that
2808 scripts under the control of the python pdb debugger. Note that
2806 this required changing the %prun option -d to -D, to avoid a clash
2809 this required changing the %prun option -d to -D, to avoid a clash
2807 (since %run must pass options to %prun, and getopt is too dumb to
2810 (since %run must pass options to %prun, and getopt is too dumb to
2808 handle options with string values with embedded spaces). Thanks
2811 handle options with string values with embedded spaces). Thanks
2809 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2812 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2810 (magic_who_ls): added type matching to %who and %whos, so that one
2813 (magic_who_ls): added type matching to %who and %whos, so that one
2811 can filter their output to only include variables of certain
2814 can filter their output to only include variables of certain
2812 types. Another suggestion by Matthew.
2815 types. Another suggestion by Matthew.
2813 (magic_whos): Added memory summaries in kb and Mb for arrays.
2816 (magic_whos): Added memory summaries in kb and Mb for arrays.
2814 (magic_who): Improve formatting (break lines every 9 vars).
2817 (magic_who): Improve formatting (break lines every 9 vars).
2815
2818
2816 2004-11-28 Fernando Perez <fperez@colorado.edu>
2819 2004-11-28 Fernando Perez <fperez@colorado.edu>
2817
2820
2818 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2821 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2819 cache when empty lines were present.
2822 cache when empty lines were present.
2820
2823
2821 2004-11-24 Fernando Perez <fperez@colorado.edu>
2824 2004-11-24 Fernando Perez <fperez@colorado.edu>
2822
2825
2823 * IPython/usage.py (__doc__): document the re-activated threading
2826 * IPython/usage.py (__doc__): document the re-activated threading
2824 options for WX and GTK.
2827 options for WX and GTK.
2825
2828
2826 2004-11-23 Fernando Perez <fperez@colorado.edu>
2829 2004-11-23 Fernando Perez <fperez@colorado.edu>
2827
2830
2828 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2831 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2829 the -wthread and -gthread options, along with a new -tk one to try
2832 the -wthread and -gthread options, along with a new -tk one to try
2830 and coordinate Tk threading with wx/gtk. The tk support is very
2833 and coordinate Tk threading with wx/gtk. The tk support is very
2831 platform dependent, since it seems to require Tcl and Tk to be
2834 platform dependent, since it seems to require Tcl and Tk to be
2832 built with threads (Fedora1/2 appears NOT to have it, but in
2835 built with threads (Fedora1/2 appears NOT to have it, but in
2833 Prabhu's Debian boxes it works OK). But even with some Tk
2836 Prabhu's Debian boxes it works OK). But even with some Tk
2834 limitations, this is a great improvement.
2837 limitations, this is a great improvement.
2835
2838
2836 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2839 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2837 info in user prompts. Patch by Prabhu.
2840 info in user prompts. Patch by Prabhu.
2838
2841
2839 2004-11-18 Fernando Perez <fperez@colorado.edu>
2842 2004-11-18 Fernando Perez <fperez@colorado.edu>
2840
2843
2841 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2844 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2842 EOFErrors and bail, to avoid infinite loops if a non-terminating
2845 EOFErrors and bail, to avoid infinite loops if a non-terminating
2843 file is fed into ipython. Patch submitted in issue 19 by user,
2846 file is fed into ipython. Patch submitted in issue 19 by user,
2844 many thanks.
2847 many thanks.
2845
2848
2846 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2849 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2847 autoquote/parens in continuation prompts, which can cause lots of
2850 autoquote/parens in continuation prompts, which can cause lots of
2848 problems. Closes roundup issue 20.
2851 problems. Closes roundup issue 20.
2849
2852
2850 2004-11-17 Fernando Perez <fperez@colorado.edu>
2853 2004-11-17 Fernando Perez <fperez@colorado.edu>
2851
2854
2852 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2855 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2853 reported as debian bug #280505. I'm not sure my local changelog
2856 reported as debian bug #280505. I'm not sure my local changelog
2854 entry has the proper debian format (Jack?).
2857 entry has the proper debian format (Jack?).
2855
2858
2856 2004-11-08 *** Released version 0.6.4
2859 2004-11-08 *** Released version 0.6.4
2857
2860
2858 2004-11-08 Fernando Perez <fperez@colorado.edu>
2861 2004-11-08 Fernando Perez <fperez@colorado.edu>
2859
2862
2860 * IPython/iplib.py (init_readline): Fix exit message for Windows
2863 * IPython/iplib.py (init_readline): Fix exit message for Windows
2861 when readline is active. Thanks to a report by Eric Jones
2864 when readline is active. Thanks to a report by Eric Jones
2862 <eric-AT-enthought.com>.
2865 <eric-AT-enthought.com>.
2863
2866
2864 2004-11-07 Fernando Perez <fperez@colorado.edu>
2867 2004-11-07 Fernando Perez <fperez@colorado.edu>
2865
2868
2866 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2869 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2867 sometimes seen by win2k/cygwin users.
2870 sometimes seen by win2k/cygwin users.
2868
2871
2869 2004-11-06 Fernando Perez <fperez@colorado.edu>
2872 2004-11-06 Fernando Perez <fperez@colorado.edu>
2870
2873
2871 * IPython/iplib.py (interact): Change the handling of %Exit from
2874 * IPython/iplib.py (interact): Change the handling of %Exit from
2872 trying to propagate a SystemExit to an internal ipython flag.
2875 trying to propagate a SystemExit to an internal ipython flag.
2873 This is less elegant than using Python's exception mechanism, but
2876 This is less elegant than using Python's exception mechanism, but
2874 I can't get that to work reliably with threads, so under -pylab
2877 I can't get that to work reliably with threads, so under -pylab
2875 %Exit was hanging IPython. Cross-thread exception handling is
2878 %Exit was hanging IPython. Cross-thread exception handling is
2876 really a bitch. Thaks to a bug report by Stephen Walton
2879 really a bitch. Thaks to a bug report by Stephen Walton
2877 <stephen.walton-AT-csun.edu>.
2880 <stephen.walton-AT-csun.edu>.
2878
2881
2879 2004-11-04 Fernando Perez <fperez@colorado.edu>
2882 2004-11-04 Fernando Perez <fperez@colorado.edu>
2880
2883
2881 * IPython/iplib.py (raw_input_original): store a pointer to the
2884 * IPython/iplib.py (raw_input_original): store a pointer to the
2882 true raw_input to harden against code which can modify it
2885 true raw_input to harden against code which can modify it
2883 (wx.py.PyShell does this and would otherwise crash ipython).
2886 (wx.py.PyShell does this and would otherwise crash ipython).
2884 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2887 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2885
2888
2886 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2889 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2887 Ctrl-C problem, which does not mess up the input line.
2890 Ctrl-C problem, which does not mess up the input line.
2888
2891
2889 2004-11-03 Fernando Perez <fperez@colorado.edu>
2892 2004-11-03 Fernando Perez <fperez@colorado.edu>
2890
2893
2891 * IPython/Release.py: Changed licensing to BSD, in all files.
2894 * IPython/Release.py: Changed licensing to BSD, in all files.
2892 (name): lowercase name for tarball/RPM release.
2895 (name): lowercase name for tarball/RPM release.
2893
2896
2894 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2897 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2895 use throughout ipython.
2898 use throughout ipython.
2896
2899
2897 * IPython/Magic.py (Magic._ofind): Switch to using the new
2900 * IPython/Magic.py (Magic._ofind): Switch to using the new
2898 OInspect.getdoc() function.
2901 OInspect.getdoc() function.
2899
2902
2900 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2903 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2901 of the line currently being canceled via Ctrl-C. It's extremely
2904 of the line currently being canceled via Ctrl-C. It's extremely
2902 ugly, but I don't know how to do it better (the problem is one of
2905 ugly, but I don't know how to do it better (the problem is one of
2903 handling cross-thread exceptions).
2906 handling cross-thread exceptions).
2904
2907
2905 2004-10-28 Fernando Perez <fperez@colorado.edu>
2908 2004-10-28 Fernando Perez <fperez@colorado.edu>
2906
2909
2907 * IPython/Shell.py (signal_handler): add signal handlers to trap
2910 * IPython/Shell.py (signal_handler): add signal handlers to trap
2908 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2911 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2909 report by Francesc Alted.
2912 report by Francesc Alted.
2910
2913
2911 2004-10-21 Fernando Perez <fperez@colorado.edu>
2914 2004-10-21 Fernando Perez <fperez@colorado.edu>
2912
2915
2913 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2916 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2914 to % for pysh syntax extensions.
2917 to % for pysh syntax extensions.
2915
2918
2916 2004-10-09 Fernando Perez <fperez@colorado.edu>
2919 2004-10-09 Fernando Perez <fperez@colorado.edu>
2917
2920
2918 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2921 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2919 arrays to print a more useful summary, without calling str(arr).
2922 arrays to print a more useful summary, without calling str(arr).
2920 This avoids the problem of extremely lengthy computations which
2923 This avoids the problem of extremely lengthy computations which
2921 occur if arr is large, and appear to the user as a system lockup
2924 occur if arr is large, and appear to the user as a system lockup
2922 with 100% cpu activity. After a suggestion by Kristian Sandberg
2925 with 100% cpu activity. After a suggestion by Kristian Sandberg
2923 <Kristian.Sandberg@colorado.edu>.
2926 <Kristian.Sandberg@colorado.edu>.
2924 (Magic.__init__): fix bug in global magic escapes not being
2927 (Magic.__init__): fix bug in global magic escapes not being
2925 correctly set.
2928 correctly set.
2926
2929
2927 2004-10-08 Fernando Perez <fperez@colorado.edu>
2930 2004-10-08 Fernando Perez <fperez@colorado.edu>
2928
2931
2929 * IPython/Magic.py (__license__): change to absolute imports of
2932 * IPython/Magic.py (__license__): change to absolute imports of
2930 ipython's own internal packages, to start adapting to the absolute
2933 ipython's own internal packages, to start adapting to the absolute
2931 import requirement of PEP-328.
2934 import requirement of PEP-328.
2932
2935
2933 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2936 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2934 files, and standardize author/license marks through the Release
2937 files, and standardize author/license marks through the Release
2935 module instead of having per/file stuff (except for files with
2938 module instead of having per/file stuff (except for files with
2936 particular licenses, like the MIT/PSF-licensed codes).
2939 particular licenses, like the MIT/PSF-licensed codes).
2937
2940
2938 * IPython/Debugger.py: remove dead code for python 2.1
2941 * IPython/Debugger.py: remove dead code for python 2.1
2939
2942
2940 2004-10-04 Fernando Perez <fperez@colorado.edu>
2943 2004-10-04 Fernando Perez <fperez@colorado.edu>
2941
2944
2942 * IPython/iplib.py (ipmagic): New function for accessing magics
2945 * IPython/iplib.py (ipmagic): New function for accessing magics
2943 via a normal python function call.
2946 via a normal python function call.
2944
2947
2945 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2948 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2946 from '@' to '%', to accomodate the new @decorator syntax of python
2949 from '@' to '%', to accomodate the new @decorator syntax of python
2947 2.4.
2950 2.4.
2948
2951
2949 2004-09-29 Fernando Perez <fperez@colorado.edu>
2952 2004-09-29 Fernando Perez <fperez@colorado.edu>
2950
2953
2951 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2954 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2952 matplotlib.use to prevent running scripts which try to switch
2955 matplotlib.use to prevent running scripts which try to switch
2953 interactive backends from within ipython. This will just crash
2956 interactive backends from within ipython. This will just crash
2954 the python interpreter, so we can't allow it (but a detailed error
2957 the python interpreter, so we can't allow it (but a detailed error
2955 is given to the user).
2958 is given to the user).
2956
2959
2957 2004-09-28 Fernando Perez <fperez@colorado.edu>
2960 2004-09-28 Fernando Perez <fperez@colorado.edu>
2958
2961
2959 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2962 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2960 matplotlib-related fixes so that using @run with non-matplotlib
2963 matplotlib-related fixes so that using @run with non-matplotlib
2961 scripts doesn't pop up spurious plot windows. This requires
2964 scripts doesn't pop up spurious plot windows. This requires
2962 matplotlib >= 0.63, where I had to make some changes as well.
2965 matplotlib >= 0.63, where I had to make some changes as well.
2963
2966
2964 * IPython/ipmaker.py (make_IPython): update version requirement to
2967 * IPython/ipmaker.py (make_IPython): update version requirement to
2965 python 2.2.
2968 python 2.2.
2966
2969
2967 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2970 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2968 banner arg for embedded customization.
2971 banner arg for embedded customization.
2969
2972
2970 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2973 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2971 explicit uses of __IP as the IPython's instance name. Now things
2974 explicit uses of __IP as the IPython's instance name. Now things
2972 are properly handled via the shell.name value. The actual code
2975 are properly handled via the shell.name value. The actual code
2973 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2976 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2974 is much better than before. I'll clean things completely when the
2977 is much better than before. I'll clean things completely when the
2975 magic stuff gets a real overhaul.
2978 magic stuff gets a real overhaul.
2976
2979
2977 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2980 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2978 minor changes to debian dir.
2981 minor changes to debian dir.
2979
2982
2980 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2983 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2981 pointer to the shell itself in the interactive namespace even when
2984 pointer to the shell itself in the interactive namespace even when
2982 a user-supplied dict is provided. This is needed for embedding
2985 a user-supplied dict is provided. This is needed for embedding
2983 purposes (found by tests with Michel Sanner).
2986 purposes (found by tests with Michel Sanner).
2984
2987
2985 2004-09-27 Fernando Perez <fperez@colorado.edu>
2988 2004-09-27 Fernando Perez <fperez@colorado.edu>
2986
2989
2987 * IPython/UserConfig/ipythonrc: remove []{} from
2990 * IPython/UserConfig/ipythonrc: remove []{} from
2988 readline_remove_delims, so that things like [modname.<TAB> do
2991 readline_remove_delims, so that things like [modname.<TAB> do
2989 proper completion. This disables [].TAB, but that's a less common
2992 proper completion. This disables [].TAB, but that's a less common
2990 case than module names in list comprehensions, for example.
2993 case than module names in list comprehensions, for example.
2991 Thanks to a report by Andrea Riciputi.
2994 Thanks to a report by Andrea Riciputi.
2992
2995
2993 2004-09-09 Fernando Perez <fperez@colorado.edu>
2996 2004-09-09 Fernando Perez <fperez@colorado.edu>
2994
2997
2995 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2998 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2996 blocking problems in win32 and osx. Fix by John.
2999 blocking problems in win32 and osx. Fix by John.
2997
3000
2998 2004-09-08 Fernando Perez <fperez@colorado.edu>
3001 2004-09-08 Fernando Perez <fperez@colorado.edu>
2999
3002
3000 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3003 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3001 for Win32 and OSX. Fix by John Hunter.
3004 for Win32 and OSX. Fix by John Hunter.
3002
3005
3003 2004-08-30 *** Released version 0.6.3
3006 2004-08-30 *** Released version 0.6.3
3004
3007
3005 2004-08-30 Fernando Perez <fperez@colorado.edu>
3008 2004-08-30 Fernando Perez <fperez@colorado.edu>
3006
3009
3007 * setup.py (isfile): Add manpages to list of dependent files to be
3010 * setup.py (isfile): Add manpages to list of dependent files to be
3008 updated.
3011 updated.
3009
3012
3010 2004-08-27 Fernando Perez <fperez@colorado.edu>
3013 2004-08-27 Fernando Perez <fperez@colorado.edu>
3011
3014
3012 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3015 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3013 for now. They don't really work with standalone WX/GTK code
3016 for now. They don't really work with standalone WX/GTK code
3014 (though matplotlib IS working fine with both of those backends).
3017 (though matplotlib IS working fine with both of those backends).
3015 This will neeed much more testing. I disabled most things with
3018 This will neeed much more testing. I disabled most things with
3016 comments, so turning it back on later should be pretty easy.
3019 comments, so turning it back on later should be pretty easy.
3017
3020
3018 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3021 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3019 autocalling of expressions like r'foo', by modifying the line
3022 autocalling of expressions like r'foo', by modifying the line
3020 split regexp. Closes
3023 split regexp. Closes
3021 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3024 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3022 Riley <ipythonbugs-AT-sabi.net>.
3025 Riley <ipythonbugs-AT-sabi.net>.
3023 (InteractiveShell.mainloop): honor --nobanner with banner
3026 (InteractiveShell.mainloop): honor --nobanner with banner
3024 extensions.
3027 extensions.
3025
3028
3026 * IPython/Shell.py: Significant refactoring of all classes, so
3029 * IPython/Shell.py: Significant refactoring of all classes, so
3027 that we can really support ALL matplotlib backends and threading
3030 that we can really support ALL matplotlib backends and threading
3028 models (John spotted a bug with Tk which required this). Now we
3031 models (John spotted a bug with Tk which required this). Now we
3029 should support single-threaded, WX-threads and GTK-threads, both
3032 should support single-threaded, WX-threads and GTK-threads, both
3030 for generic code and for matplotlib.
3033 for generic code and for matplotlib.
3031
3034
3032 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3035 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3033 -pylab, to simplify things for users. Will also remove the pylab
3036 -pylab, to simplify things for users. Will also remove the pylab
3034 profile, since now all of matplotlib configuration is directly
3037 profile, since now all of matplotlib configuration is directly
3035 handled here. This also reduces startup time.
3038 handled here. This also reduces startup time.
3036
3039
3037 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3040 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3038 shell wasn't being correctly called. Also in IPShellWX.
3041 shell wasn't being correctly called. Also in IPShellWX.
3039
3042
3040 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3043 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3041 fine-tune banner.
3044 fine-tune banner.
3042
3045
3043 * IPython/numutils.py (spike): Deprecate these spike functions,
3046 * IPython/numutils.py (spike): Deprecate these spike functions,
3044 delete (long deprecated) gnuplot_exec handler.
3047 delete (long deprecated) gnuplot_exec handler.
3045
3048
3046 2004-08-26 Fernando Perez <fperez@colorado.edu>
3049 2004-08-26 Fernando Perez <fperez@colorado.edu>
3047
3050
3048 * ipython.1: Update for threading options, plus some others which
3051 * ipython.1: Update for threading options, plus some others which
3049 were missing.
3052 were missing.
3050
3053
3051 * IPython/ipmaker.py (__call__): Added -wthread option for
3054 * IPython/ipmaker.py (__call__): Added -wthread option for
3052 wxpython thread handling. Make sure threading options are only
3055 wxpython thread handling. Make sure threading options are only
3053 valid at the command line.
3056 valid at the command line.
3054
3057
3055 * scripts/ipython: moved shell selection into a factory function
3058 * scripts/ipython: moved shell selection into a factory function
3056 in Shell.py, to keep the starter script to a minimum.
3059 in Shell.py, to keep the starter script to a minimum.
3057
3060
3058 2004-08-25 Fernando Perez <fperez@colorado.edu>
3061 2004-08-25 Fernando Perez <fperez@colorado.edu>
3059
3062
3060 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3063 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3061 John. Along with some recent changes he made to matplotlib, the
3064 John. Along with some recent changes he made to matplotlib, the
3062 next versions of both systems should work very well together.
3065 next versions of both systems should work very well together.
3063
3066
3064 2004-08-24 Fernando Perez <fperez@colorado.edu>
3067 2004-08-24 Fernando Perez <fperez@colorado.edu>
3065
3068
3066 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3069 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3067 tried to switch the profiling to using hotshot, but I'm getting
3070 tried to switch the profiling to using hotshot, but I'm getting
3068 strange errors from prof.runctx() there. I may be misreading the
3071 strange errors from prof.runctx() there. I may be misreading the
3069 docs, but it looks weird. For now the profiling code will
3072 docs, but it looks weird. For now the profiling code will
3070 continue to use the standard profiler.
3073 continue to use the standard profiler.
3071
3074
3072 2004-08-23 Fernando Perez <fperez@colorado.edu>
3075 2004-08-23 Fernando Perez <fperez@colorado.edu>
3073
3076
3074 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3077 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3075 threaded shell, by John Hunter. It's not quite ready yet, but
3078 threaded shell, by John Hunter. It's not quite ready yet, but
3076 close.
3079 close.
3077
3080
3078 2004-08-22 Fernando Perez <fperez@colorado.edu>
3081 2004-08-22 Fernando Perez <fperez@colorado.edu>
3079
3082
3080 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3083 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3081 in Magic and ultraTB.
3084 in Magic and ultraTB.
3082
3085
3083 * ipython.1: document threading options in manpage.
3086 * ipython.1: document threading options in manpage.
3084
3087
3085 * scripts/ipython: Changed name of -thread option to -gthread,
3088 * scripts/ipython: Changed name of -thread option to -gthread,
3086 since this is GTK specific. I want to leave the door open for a
3089 since this is GTK specific. I want to leave the door open for a
3087 -wthread option for WX, which will most likely be necessary. This
3090 -wthread option for WX, which will most likely be necessary. This
3088 change affects usage and ipmaker as well.
3091 change affects usage and ipmaker as well.
3089
3092
3090 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3093 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3091 handle the matplotlib shell issues. Code by John Hunter
3094 handle the matplotlib shell issues. Code by John Hunter
3092 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3095 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3093 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3096 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3094 broken (and disabled for end users) for now, but it puts the
3097 broken (and disabled for end users) for now, but it puts the
3095 infrastructure in place.
3098 infrastructure in place.
3096
3099
3097 2004-08-21 Fernando Perez <fperez@colorado.edu>
3100 2004-08-21 Fernando Perez <fperez@colorado.edu>
3098
3101
3099 * ipythonrc-pylab: Add matplotlib support.
3102 * ipythonrc-pylab: Add matplotlib support.
3100
3103
3101 * matplotlib_config.py: new files for matplotlib support, part of
3104 * matplotlib_config.py: new files for matplotlib support, part of
3102 the pylab profile.
3105 the pylab profile.
3103
3106
3104 * IPython/usage.py (__doc__): documented the threading options.
3107 * IPython/usage.py (__doc__): documented the threading options.
3105
3108
3106 2004-08-20 Fernando Perez <fperez@colorado.edu>
3109 2004-08-20 Fernando Perez <fperez@colorado.edu>
3107
3110
3108 * ipython: Modified the main calling routine to handle the -thread
3111 * ipython: Modified the main calling routine to handle the -thread
3109 and -mpthread options. This needs to be done as a top-level hack,
3112 and -mpthread options. This needs to be done as a top-level hack,
3110 because it determines which class to instantiate for IPython
3113 because it determines which class to instantiate for IPython
3111 itself.
3114 itself.
3112
3115
3113 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3116 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3114 classes to support multithreaded GTK operation without blocking,
3117 classes to support multithreaded GTK operation without blocking,
3115 and matplotlib with all backends. This is a lot of still very
3118 and matplotlib with all backends. This is a lot of still very
3116 experimental code, and threads are tricky. So it may still have a
3119 experimental code, and threads are tricky. So it may still have a
3117 few rough edges... This code owes a lot to
3120 few rough edges... This code owes a lot to
3118 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3121 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3119 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3122 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3120 to John Hunter for all the matplotlib work.
3123 to John Hunter for all the matplotlib work.
3121
3124
3122 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3125 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3123 options for gtk thread and matplotlib support.
3126 options for gtk thread and matplotlib support.
3124
3127
3125 2004-08-16 Fernando Perez <fperez@colorado.edu>
3128 2004-08-16 Fernando Perez <fperez@colorado.edu>
3126
3129
3127 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3130 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3128 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3131 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3129 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3132 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3130
3133
3131 2004-08-11 Fernando Perez <fperez@colorado.edu>
3134 2004-08-11 Fernando Perez <fperez@colorado.edu>
3132
3135
3133 * setup.py (isfile): Fix build so documentation gets updated for
3136 * setup.py (isfile): Fix build so documentation gets updated for
3134 rpms (it was only done for .tgz builds).
3137 rpms (it was only done for .tgz builds).
3135
3138
3136 2004-08-10 Fernando Perez <fperez@colorado.edu>
3139 2004-08-10 Fernando Perez <fperez@colorado.edu>
3137
3140
3138 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3141 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3139
3142
3140 * iplib.py : Silence syntax error exceptions in tab-completion.
3143 * iplib.py : Silence syntax error exceptions in tab-completion.
3141
3144
3142 2004-08-05 Fernando Perez <fperez@colorado.edu>
3145 2004-08-05 Fernando Perez <fperez@colorado.edu>
3143
3146
3144 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3147 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3145 'color off' mark for continuation prompts. This was causing long
3148 'color off' mark for continuation prompts. This was causing long
3146 continuation lines to mis-wrap.
3149 continuation lines to mis-wrap.
3147
3150
3148 2004-08-01 Fernando Perez <fperez@colorado.edu>
3151 2004-08-01 Fernando Perez <fperez@colorado.edu>
3149
3152
3150 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3153 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3151 for building ipython to be a parameter. All this is necessary
3154 for building ipython to be a parameter. All this is necessary
3152 right now to have a multithreaded version, but this insane
3155 right now to have a multithreaded version, but this insane
3153 non-design will be cleaned up soon. For now, it's a hack that
3156 non-design will be cleaned up soon. For now, it's a hack that
3154 works.
3157 works.
3155
3158
3156 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3159 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3157 args in various places. No bugs so far, but it's a dangerous
3160 args in various places. No bugs so far, but it's a dangerous
3158 practice.
3161 practice.
3159
3162
3160 2004-07-31 Fernando Perez <fperez@colorado.edu>
3163 2004-07-31 Fernando Perez <fperez@colorado.edu>
3161
3164
3162 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3165 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3163 fix completion of files with dots in their names under most
3166 fix completion of files with dots in their names under most
3164 profiles (pysh was OK because the completion order is different).
3167 profiles (pysh was OK because the completion order is different).
3165
3168
3166 2004-07-27 Fernando Perez <fperez@colorado.edu>
3169 2004-07-27 Fernando Perez <fperez@colorado.edu>
3167
3170
3168 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3171 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3169 keywords manually, b/c the one in keyword.py was removed in python
3172 keywords manually, b/c the one in keyword.py was removed in python
3170 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3173 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3171 This is NOT a bug under python 2.3 and earlier.
3174 This is NOT a bug under python 2.3 and earlier.
3172
3175
3173 2004-07-26 Fernando Perez <fperez@colorado.edu>
3176 2004-07-26 Fernando Perez <fperez@colorado.edu>
3174
3177
3175 * IPython/ultraTB.py (VerboseTB.text): Add another
3178 * IPython/ultraTB.py (VerboseTB.text): Add another
3176 linecache.checkcache() call to try to prevent inspect.py from
3179 linecache.checkcache() call to try to prevent inspect.py from
3177 crashing under python 2.3. I think this fixes
3180 crashing under python 2.3. I think this fixes
3178 http://www.scipy.net/roundup/ipython/issue17.
3181 http://www.scipy.net/roundup/ipython/issue17.
3179
3182
3180 2004-07-26 *** Released version 0.6.2
3183 2004-07-26 *** Released version 0.6.2
3181
3184
3182 2004-07-26 Fernando Perez <fperez@colorado.edu>
3185 2004-07-26 Fernando Perez <fperez@colorado.edu>
3183
3186
3184 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3187 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3185 fail for any number.
3188 fail for any number.
3186 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3189 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3187 empty bookmarks.
3190 empty bookmarks.
3188
3191
3189 2004-07-26 *** Released version 0.6.1
3192 2004-07-26 *** Released version 0.6.1
3190
3193
3191 2004-07-26 Fernando Perez <fperez@colorado.edu>
3194 2004-07-26 Fernando Perez <fperez@colorado.edu>
3192
3195
3193 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3196 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3194
3197
3195 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3198 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3196 escaping '()[]{}' in filenames.
3199 escaping '()[]{}' in filenames.
3197
3200
3198 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3201 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3199 Python 2.2 users who lack a proper shlex.split.
3202 Python 2.2 users who lack a proper shlex.split.
3200
3203
3201 2004-07-19 Fernando Perez <fperez@colorado.edu>
3204 2004-07-19 Fernando Perez <fperez@colorado.edu>
3202
3205
3203 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3206 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3204 for reading readline's init file. I follow the normal chain:
3207 for reading readline's init file. I follow the normal chain:
3205 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3208 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3206 report by Mike Heeter. This closes
3209 report by Mike Heeter. This closes
3207 http://www.scipy.net/roundup/ipython/issue16.
3210 http://www.scipy.net/roundup/ipython/issue16.
3208
3211
3209 2004-07-18 Fernando Perez <fperez@colorado.edu>
3212 2004-07-18 Fernando Perez <fperez@colorado.edu>
3210
3213
3211 * IPython/iplib.py (__init__): Add better handling of '\' under
3214 * IPython/iplib.py (__init__): Add better handling of '\' under
3212 Win32 for filenames. After a patch by Ville.
3215 Win32 for filenames. After a patch by Ville.
3213
3216
3214 2004-07-17 Fernando Perez <fperez@colorado.edu>
3217 2004-07-17 Fernando Perez <fperez@colorado.edu>
3215
3218
3216 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3219 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3217 autocalling would be triggered for 'foo is bar' if foo is
3220 autocalling would be triggered for 'foo is bar' if foo is
3218 callable. I also cleaned up the autocall detection code to use a
3221 callable. I also cleaned up the autocall detection code to use a
3219 regexp, which is faster. Bug reported by Alexander Schmolck.
3222 regexp, which is faster. Bug reported by Alexander Schmolck.
3220
3223
3221 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3224 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3222 '?' in them would confuse the help system. Reported by Alex
3225 '?' in them would confuse the help system. Reported by Alex
3223 Schmolck.
3226 Schmolck.
3224
3227
3225 2004-07-16 Fernando Perez <fperez@colorado.edu>
3228 2004-07-16 Fernando Perez <fperez@colorado.edu>
3226
3229
3227 * IPython/GnuplotInteractive.py (__all__): added plot2.
3230 * IPython/GnuplotInteractive.py (__all__): added plot2.
3228
3231
3229 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3232 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3230 plotting dictionaries, lists or tuples of 1d arrays.
3233 plotting dictionaries, lists or tuples of 1d arrays.
3231
3234
3232 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3235 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3233 optimizations.
3236 optimizations.
3234
3237
3235 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3238 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3236 the information which was there from Janko's original IPP code:
3239 the information which was there from Janko's original IPP code:
3237
3240
3238 03.05.99 20:53 porto.ifm.uni-kiel.de
3241 03.05.99 20:53 porto.ifm.uni-kiel.de
3239 --Started changelog.
3242 --Started changelog.
3240 --make clear do what it say it does
3243 --make clear do what it say it does
3241 --added pretty output of lines from inputcache
3244 --added pretty output of lines from inputcache
3242 --Made Logger a mixin class, simplifies handling of switches
3245 --Made Logger a mixin class, simplifies handling of switches
3243 --Added own completer class. .string<TAB> expands to last history
3246 --Added own completer class. .string<TAB> expands to last history
3244 line which starts with string. The new expansion is also present
3247 line which starts with string. The new expansion is also present
3245 with Ctrl-r from the readline library. But this shows, who this
3248 with Ctrl-r from the readline library. But this shows, who this
3246 can be done for other cases.
3249 can be done for other cases.
3247 --Added convention that all shell functions should accept a
3250 --Added convention that all shell functions should accept a
3248 parameter_string This opens the door for different behaviour for
3251 parameter_string This opens the door for different behaviour for
3249 each function. @cd is a good example of this.
3252 each function. @cd is a good example of this.
3250
3253
3251 04.05.99 12:12 porto.ifm.uni-kiel.de
3254 04.05.99 12:12 porto.ifm.uni-kiel.de
3252 --added logfile rotation
3255 --added logfile rotation
3253 --added new mainloop method which freezes first the namespace
3256 --added new mainloop method which freezes first the namespace
3254
3257
3255 07.05.99 21:24 porto.ifm.uni-kiel.de
3258 07.05.99 21:24 porto.ifm.uni-kiel.de
3256 --added the docreader classes. Now there is a help system.
3259 --added the docreader classes. Now there is a help system.
3257 -This is only a first try. Currently it's not easy to put new
3260 -This is only a first try. Currently it's not easy to put new
3258 stuff in the indices. But this is the way to go. Info would be
3261 stuff in the indices. But this is the way to go. Info would be
3259 better, but HTML is every where and not everybody has an info
3262 better, but HTML is every where and not everybody has an info
3260 system installed and it's not so easy to change html-docs to info.
3263 system installed and it's not so easy to change html-docs to info.
3261 --added global logfile option
3264 --added global logfile option
3262 --there is now a hook for object inspection method pinfo needs to
3265 --there is now a hook for object inspection method pinfo needs to
3263 be provided for this. Can be reached by two '??'.
3266 be provided for this. Can be reached by two '??'.
3264
3267
3265 08.05.99 20:51 porto.ifm.uni-kiel.de
3268 08.05.99 20:51 porto.ifm.uni-kiel.de
3266 --added a README
3269 --added a README
3267 --bug in rc file. Something has changed so functions in the rc
3270 --bug in rc file. Something has changed so functions in the rc
3268 file need to reference the shell and not self. Not clear if it's a
3271 file need to reference the shell and not self. Not clear if it's a
3269 bug or feature.
3272 bug or feature.
3270 --changed rc file for new behavior
3273 --changed rc file for new behavior
3271
3274
3272 2004-07-15 Fernando Perez <fperez@colorado.edu>
3275 2004-07-15 Fernando Perez <fperez@colorado.edu>
3273
3276
3274 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3277 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3275 cache was falling out of sync in bizarre manners when multi-line
3278 cache was falling out of sync in bizarre manners when multi-line
3276 input was present. Minor optimizations and cleanup.
3279 input was present. Minor optimizations and cleanup.
3277
3280
3278 (Logger): Remove old Changelog info for cleanup. This is the
3281 (Logger): Remove old Changelog info for cleanup. This is the
3279 information which was there from Janko's original code:
3282 information which was there from Janko's original code:
3280
3283
3281 Changes to Logger: - made the default log filename a parameter
3284 Changes to Logger: - made the default log filename a parameter
3282
3285
3283 - put a check for lines beginning with !@? in log(). Needed
3286 - put a check for lines beginning with !@? in log(). Needed
3284 (even if the handlers properly log their lines) for mid-session
3287 (even if the handlers properly log their lines) for mid-session
3285 logging activation to work properly. Without this, lines logged
3288 logging activation to work properly. Without this, lines logged
3286 in mid session, which get read from the cache, would end up
3289 in mid session, which get read from the cache, would end up
3287 'bare' (with !@? in the open) in the log. Now they are caught
3290 'bare' (with !@? in the open) in the log. Now they are caught
3288 and prepended with a #.
3291 and prepended with a #.
3289
3292
3290 * IPython/iplib.py (InteractiveShell.init_readline): added check
3293 * IPython/iplib.py (InteractiveShell.init_readline): added check
3291 in case MagicCompleter fails to be defined, so we don't crash.
3294 in case MagicCompleter fails to be defined, so we don't crash.
3292
3295
3293 2004-07-13 Fernando Perez <fperez@colorado.edu>
3296 2004-07-13 Fernando Perez <fperez@colorado.edu>
3294
3297
3295 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3298 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3296 of EPS if the requested filename ends in '.eps'.
3299 of EPS if the requested filename ends in '.eps'.
3297
3300
3298 2004-07-04 Fernando Perez <fperez@colorado.edu>
3301 2004-07-04 Fernando Perez <fperez@colorado.edu>
3299
3302
3300 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3303 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3301 escaping of quotes when calling the shell.
3304 escaping of quotes when calling the shell.
3302
3305
3303 2004-07-02 Fernando Perez <fperez@colorado.edu>
3306 2004-07-02 Fernando Perez <fperez@colorado.edu>
3304
3307
3305 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3308 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3306 gettext not working because we were clobbering '_'. Fixes
3309 gettext not working because we were clobbering '_'. Fixes
3307 http://www.scipy.net/roundup/ipython/issue6.
3310 http://www.scipy.net/roundup/ipython/issue6.
3308
3311
3309 2004-07-01 Fernando Perez <fperez@colorado.edu>
3312 2004-07-01 Fernando Perez <fperez@colorado.edu>
3310
3313
3311 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3314 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3312 into @cd. Patch by Ville.
3315 into @cd. Patch by Ville.
3313
3316
3314 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3317 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3315 new function to store things after ipmaker runs. Patch by Ville.
3318 new function to store things after ipmaker runs. Patch by Ville.
3316 Eventually this will go away once ipmaker is removed and the class
3319 Eventually this will go away once ipmaker is removed and the class
3317 gets cleaned up, but for now it's ok. Key functionality here is
3320 gets cleaned up, but for now it's ok. Key functionality here is
3318 the addition of the persistent storage mechanism, a dict for
3321 the addition of the persistent storage mechanism, a dict for
3319 keeping data across sessions (for now just bookmarks, but more can
3322 keeping data across sessions (for now just bookmarks, but more can
3320 be implemented later).
3323 be implemented later).
3321
3324
3322 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3325 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3323 persistent across sections. Patch by Ville, I modified it
3326 persistent across sections. Patch by Ville, I modified it
3324 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3327 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3325 added a '-l' option to list all bookmarks.
3328 added a '-l' option to list all bookmarks.
3326
3329
3327 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3330 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3328 center for cleanup. Registered with atexit.register(). I moved
3331 center for cleanup. Registered with atexit.register(). I moved
3329 here the old exit_cleanup(). After a patch by Ville.
3332 here the old exit_cleanup(). After a patch by Ville.
3330
3333
3331 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3334 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3332 characters in the hacked shlex_split for python 2.2.
3335 characters in the hacked shlex_split for python 2.2.
3333
3336
3334 * IPython/iplib.py (file_matches): more fixes to filenames with
3337 * IPython/iplib.py (file_matches): more fixes to filenames with
3335 whitespace in them. It's not perfect, but limitations in python's
3338 whitespace in them. It's not perfect, but limitations in python's
3336 readline make it impossible to go further.
3339 readline make it impossible to go further.
3337
3340
3338 2004-06-29 Fernando Perez <fperez@colorado.edu>
3341 2004-06-29 Fernando Perez <fperez@colorado.edu>
3339
3342
3340 * IPython/iplib.py (file_matches): escape whitespace correctly in
3343 * IPython/iplib.py (file_matches): escape whitespace correctly in
3341 filename completions. Bug reported by Ville.
3344 filename completions. Bug reported by Ville.
3342
3345
3343 2004-06-28 Fernando Perez <fperez@colorado.edu>
3346 2004-06-28 Fernando Perez <fperez@colorado.edu>
3344
3347
3345 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3348 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3346 the history file will be called 'history-PROFNAME' (or just
3349 the history file will be called 'history-PROFNAME' (or just
3347 'history' if no profile is loaded). I was getting annoyed at
3350 'history' if no profile is loaded). I was getting annoyed at
3348 getting my Numerical work history clobbered by pysh sessions.
3351 getting my Numerical work history clobbered by pysh sessions.
3349
3352
3350 * IPython/iplib.py (InteractiveShell.__init__): Internal
3353 * IPython/iplib.py (InteractiveShell.__init__): Internal
3351 getoutputerror() function so that we can honor the system_verbose
3354 getoutputerror() function so that we can honor the system_verbose
3352 flag for _all_ system calls. I also added escaping of #
3355 flag for _all_ system calls. I also added escaping of #
3353 characters here to avoid confusing Itpl.
3356 characters here to avoid confusing Itpl.
3354
3357
3355 * IPython/Magic.py (shlex_split): removed call to shell in
3358 * IPython/Magic.py (shlex_split): removed call to shell in
3356 parse_options and replaced it with shlex.split(). The annoying
3359 parse_options and replaced it with shlex.split(). The annoying
3357 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3360 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3358 to backport it from 2.3, with several frail hacks (the shlex
3361 to backport it from 2.3, with several frail hacks (the shlex
3359 module is rather limited in 2.2). Thanks to a suggestion by Ville
3362 module is rather limited in 2.2). Thanks to a suggestion by Ville
3360 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3363 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3361 problem.
3364 problem.
3362
3365
3363 (Magic.magic_system_verbose): new toggle to print the actual
3366 (Magic.magic_system_verbose): new toggle to print the actual
3364 system calls made by ipython. Mainly for debugging purposes.
3367 system calls made by ipython. Mainly for debugging purposes.
3365
3368
3366 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3369 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3367 doesn't support persistence. Reported (and fix suggested) by
3370 doesn't support persistence. Reported (and fix suggested) by
3368 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3371 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3369
3372
3370 2004-06-26 Fernando Perez <fperez@colorado.edu>
3373 2004-06-26 Fernando Perez <fperez@colorado.edu>
3371
3374
3372 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3375 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3373 continue prompts.
3376 continue prompts.
3374
3377
3375 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3378 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3376 function (basically a big docstring) and a few more things here to
3379 function (basically a big docstring) and a few more things here to
3377 speedup startup. pysh.py is now very lightweight. We want because
3380 speedup startup. pysh.py is now very lightweight. We want because
3378 it gets execfile'd, while InterpreterExec gets imported, so
3381 it gets execfile'd, while InterpreterExec gets imported, so
3379 byte-compilation saves time.
3382 byte-compilation saves time.
3380
3383
3381 2004-06-25 Fernando Perez <fperez@colorado.edu>
3384 2004-06-25 Fernando Perez <fperez@colorado.edu>
3382
3385
3383 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3386 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3384 -NUM', which was recently broken.
3387 -NUM', which was recently broken.
3385
3388
3386 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3389 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3387 in multi-line input (but not !!, which doesn't make sense there).
3390 in multi-line input (but not !!, which doesn't make sense there).
3388
3391
3389 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3392 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3390 It's just too useful, and people can turn it off in the less
3393 It's just too useful, and people can turn it off in the less
3391 common cases where it's a problem.
3394 common cases where it's a problem.
3392
3395
3393 2004-06-24 Fernando Perez <fperez@colorado.edu>
3396 2004-06-24 Fernando Perez <fperez@colorado.edu>
3394
3397
3395 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3398 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3396 special syntaxes (like alias calling) is now allied in multi-line
3399 special syntaxes (like alias calling) is now allied in multi-line
3397 input. This is still _very_ experimental, but it's necessary for
3400 input. This is still _very_ experimental, but it's necessary for
3398 efficient shell usage combining python looping syntax with system
3401 efficient shell usage combining python looping syntax with system
3399 calls. For now it's restricted to aliases, I don't think it
3402 calls. For now it's restricted to aliases, I don't think it
3400 really even makes sense to have this for magics.
3403 really even makes sense to have this for magics.
3401
3404
3402 2004-06-23 Fernando Perez <fperez@colorado.edu>
3405 2004-06-23 Fernando Perez <fperez@colorado.edu>
3403
3406
3404 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3407 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3405 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3408 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3406
3409
3407 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3410 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3408 extensions under Windows (after code sent by Gary Bishop). The
3411 extensions under Windows (after code sent by Gary Bishop). The
3409 extensions considered 'executable' are stored in IPython's rc
3412 extensions considered 'executable' are stored in IPython's rc
3410 structure as win_exec_ext.
3413 structure as win_exec_ext.
3411
3414
3412 * IPython/genutils.py (shell): new function, like system() but
3415 * IPython/genutils.py (shell): new function, like system() but
3413 without return value. Very useful for interactive shell work.
3416 without return value. Very useful for interactive shell work.
3414
3417
3415 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3418 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3416 delete aliases.
3419 delete aliases.
3417
3420
3418 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3421 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3419 sure that the alias table doesn't contain python keywords.
3422 sure that the alias table doesn't contain python keywords.
3420
3423
3421 2004-06-21 Fernando Perez <fperez@colorado.edu>
3424 2004-06-21 Fernando Perez <fperez@colorado.edu>
3422
3425
3423 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3426 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3424 non-existent items are found in $PATH. Reported by Thorsten.
3427 non-existent items are found in $PATH. Reported by Thorsten.
3425
3428
3426 2004-06-20 Fernando Perez <fperez@colorado.edu>
3429 2004-06-20 Fernando Perez <fperez@colorado.edu>
3427
3430
3428 * IPython/iplib.py (complete): modified the completer so that the
3431 * IPython/iplib.py (complete): modified the completer so that the
3429 order of priorities can be easily changed at runtime.
3432 order of priorities can be easily changed at runtime.
3430
3433
3431 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3434 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3432 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3435 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3433
3436
3434 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3437 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3435 expand Python variables prepended with $ in all system calls. The
3438 expand Python variables prepended with $ in all system calls. The
3436 same was done to InteractiveShell.handle_shell_escape. Now all
3439 same was done to InteractiveShell.handle_shell_escape. Now all
3437 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3440 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3438 expansion of python variables and expressions according to the
3441 expansion of python variables and expressions according to the
3439 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3442 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3440
3443
3441 Though PEP-215 has been rejected, a similar (but simpler) one
3444 Though PEP-215 has been rejected, a similar (but simpler) one
3442 seems like it will go into Python 2.4, PEP-292 -
3445 seems like it will go into Python 2.4, PEP-292 -
3443 http://www.python.org/peps/pep-0292.html.
3446 http://www.python.org/peps/pep-0292.html.
3444
3447
3445 I'll keep the full syntax of PEP-215, since IPython has since the
3448 I'll keep the full syntax of PEP-215, since IPython has since the
3446 start used Ka-Ping Yee's reference implementation discussed there
3449 start used Ka-Ping Yee's reference implementation discussed there
3447 (Itpl), and I actually like the powerful semantics it offers.
3450 (Itpl), and I actually like the powerful semantics it offers.
3448
3451
3449 In order to access normal shell variables, the $ has to be escaped
3452 In order to access normal shell variables, the $ has to be escaped
3450 via an extra $. For example:
3453 via an extra $. For example:
3451
3454
3452 In [7]: PATH='a python variable'
3455 In [7]: PATH='a python variable'
3453
3456
3454 In [8]: !echo $PATH
3457 In [8]: !echo $PATH
3455 a python variable
3458 a python variable
3456
3459
3457 In [9]: !echo $$PATH
3460 In [9]: !echo $$PATH
3458 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3461 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3459
3462
3460 (Magic.parse_options): escape $ so the shell doesn't evaluate
3463 (Magic.parse_options): escape $ so the shell doesn't evaluate
3461 things prematurely.
3464 things prematurely.
3462
3465
3463 * IPython/iplib.py (InteractiveShell.call_alias): added the
3466 * IPython/iplib.py (InteractiveShell.call_alias): added the
3464 ability for aliases to expand python variables via $.
3467 ability for aliases to expand python variables via $.
3465
3468
3466 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3469 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3467 system, now there's a @rehash/@rehashx pair of magics. These work
3470 system, now there's a @rehash/@rehashx pair of magics. These work
3468 like the csh rehash command, and can be invoked at any time. They
3471 like the csh rehash command, and can be invoked at any time. They
3469 build a table of aliases to everything in the user's $PATH
3472 build a table of aliases to everything in the user's $PATH
3470 (@rehash uses everything, @rehashx is slower but only adds
3473 (@rehash uses everything, @rehashx is slower but only adds
3471 executable files). With this, the pysh.py-based shell profile can
3474 executable files). With this, the pysh.py-based shell profile can
3472 now simply call rehash upon startup, and full access to all
3475 now simply call rehash upon startup, and full access to all
3473 programs in the user's path is obtained.
3476 programs in the user's path is obtained.
3474
3477
3475 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3478 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3476 functionality is now fully in place. I removed the old dynamic
3479 functionality is now fully in place. I removed the old dynamic
3477 code generation based approach, in favor of a much lighter one
3480 code generation based approach, in favor of a much lighter one
3478 based on a simple dict. The advantage is that this allows me to
3481 based on a simple dict. The advantage is that this allows me to
3479 now have thousands of aliases with negligible cost (unthinkable
3482 now have thousands of aliases with negligible cost (unthinkable
3480 with the old system).
3483 with the old system).
3481
3484
3482 2004-06-19 Fernando Perez <fperez@colorado.edu>
3485 2004-06-19 Fernando Perez <fperez@colorado.edu>
3483
3486
3484 * IPython/iplib.py (__init__): extended MagicCompleter class to
3487 * IPython/iplib.py (__init__): extended MagicCompleter class to
3485 also complete (last in priority) on user aliases.
3488 also complete (last in priority) on user aliases.
3486
3489
3487 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3490 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3488 call to eval.
3491 call to eval.
3489 (ItplNS.__init__): Added a new class which functions like Itpl,
3492 (ItplNS.__init__): Added a new class which functions like Itpl,
3490 but allows configuring the namespace for the evaluation to occur
3493 but allows configuring the namespace for the evaluation to occur
3491 in.
3494 in.
3492
3495
3493 2004-06-18 Fernando Perez <fperez@colorado.edu>
3496 2004-06-18 Fernando Perez <fperez@colorado.edu>
3494
3497
3495 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3498 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3496 better message when 'exit' or 'quit' are typed (a common newbie
3499 better message when 'exit' or 'quit' are typed (a common newbie
3497 confusion).
3500 confusion).
3498
3501
3499 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3502 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3500 check for Windows users.
3503 check for Windows users.
3501
3504
3502 * IPython/iplib.py (InteractiveShell.user_setup): removed
3505 * IPython/iplib.py (InteractiveShell.user_setup): removed
3503 disabling of colors for Windows. I'll test at runtime and issue a
3506 disabling of colors for Windows. I'll test at runtime and issue a
3504 warning if Gary's readline isn't found, as to nudge users to
3507 warning if Gary's readline isn't found, as to nudge users to
3505 download it.
3508 download it.
3506
3509
3507 2004-06-16 Fernando Perez <fperez@colorado.edu>
3510 2004-06-16 Fernando Perez <fperez@colorado.edu>
3508
3511
3509 * IPython/genutils.py (Stream.__init__): changed to print errors
3512 * IPython/genutils.py (Stream.__init__): changed to print errors
3510 to sys.stderr. I had a circular dependency here. Now it's
3513 to sys.stderr. I had a circular dependency here. Now it's
3511 possible to run ipython as IDLE's shell (consider this pre-alpha,
3514 possible to run ipython as IDLE's shell (consider this pre-alpha,
3512 since true stdout things end up in the starting terminal instead
3515 since true stdout things end up in the starting terminal instead
3513 of IDLE's out).
3516 of IDLE's out).
3514
3517
3515 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3518 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3516 users who haven't # updated their prompt_in2 definitions. Remove
3519 users who haven't # updated their prompt_in2 definitions. Remove
3517 eventually.
3520 eventually.
3518 (multiple_replace): added credit to original ASPN recipe.
3521 (multiple_replace): added credit to original ASPN recipe.
3519
3522
3520 2004-06-15 Fernando Perez <fperez@colorado.edu>
3523 2004-06-15 Fernando Perez <fperez@colorado.edu>
3521
3524
3522 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3525 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3523 list of auto-defined aliases.
3526 list of auto-defined aliases.
3524
3527
3525 2004-06-13 Fernando Perez <fperez@colorado.edu>
3528 2004-06-13 Fernando Perez <fperez@colorado.edu>
3526
3529
3527 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3530 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3528 install was really requested (so setup.py can be used for other
3531 install was really requested (so setup.py can be used for other
3529 things under Windows).
3532 things under Windows).
3530
3533
3531 2004-06-10 Fernando Perez <fperez@colorado.edu>
3534 2004-06-10 Fernando Perez <fperez@colorado.edu>
3532
3535
3533 * IPython/Logger.py (Logger.create_log): Manually remove any old
3536 * IPython/Logger.py (Logger.create_log): Manually remove any old
3534 backup, since os.remove may fail under Windows. Fixes bug
3537 backup, since os.remove may fail under Windows. Fixes bug
3535 reported by Thorsten.
3538 reported by Thorsten.
3536
3539
3537 2004-06-09 Fernando Perez <fperez@colorado.edu>
3540 2004-06-09 Fernando Perez <fperez@colorado.edu>
3538
3541
3539 * examples/example-embed.py: fixed all references to %n (replaced
3542 * examples/example-embed.py: fixed all references to %n (replaced
3540 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3543 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3541 for all examples and the manual as well.
3544 for all examples and the manual as well.
3542
3545
3543 2004-06-08 Fernando Perez <fperez@colorado.edu>
3546 2004-06-08 Fernando Perez <fperez@colorado.edu>
3544
3547
3545 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3548 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3546 alignment and color management. All 3 prompt subsystems now
3549 alignment and color management. All 3 prompt subsystems now
3547 inherit from BasePrompt.
3550 inherit from BasePrompt.
3548
3551
3549 * tools/release: updates for windows installer build and tag rpms
3552 * tools/release: updates for windows installer build and tag rpms
3550 with python version (since paths are fixed).
3553 with python version (since paths are fixed).
3551
3554
3552 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3555 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3553 which will become eventually obsolete. Also fixed the default
3556 which will become eventually obsolete. Also fixed the default
3554 prompt_in2 to use \D, so at least new users start with the correct
3557 prompt_in2 to use \D, so at least new users start with the correct
3555 defaults.
3558 defaults.
3556 WARNING: Users with existing ipythonrc files will need to apply
3559 WARNING: Users with existing ipythonrc files will need to apply
3557 this fix manually!
3560 this fix manually!
3558
3561
3559 * setup.py: make windows installer (.exe). This is finally the
3562 * setup.py: make windows installer (.exe). This is finally the
3560 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3563 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3561 which I hadn't included because it required Python 2.3 (or recent
3564 which I hadn't included because it required Python 2.3 (or recent
3562 distutils).
3565 distutils).
3563
3566
3564 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3567 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3565 usage of new '\D' escape.
3568 usage of new '\D' escape.
3566
3569
3567 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3570 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3568 lacks os.getuid())
3571 lacks os.getuid())
3569 (CachedOutput.set_colors): Added the ability to turn coloring
3572 (CachedOutput.set_colors): Added the ability to turn coloring
3570 on/off with @colors even for manually defined prompt colors. It
3573 on/off with @colors even for manually defined prompt colors. It
3571 uses a nasty global, but it works safely and via the generic color
3574 uses a nasty global, but it works safely and via the generic color
3572 handling mechanism.
3575 handling mechanism.
3573 (Prompt2.__init__): Introduced new escape '\D' for continuation
3576 (Prompt2.__init__): Introduced new escape '\D' for continuation
3574 prompts. It represents the counter ('\#') as dots.
3577 prompts. It represents the counter ('\#') as dots.
3575 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3578 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3576 need to update their ipythonrc files and replace '%n' with '\D' in
3579 need to update their ipythonrc files and replace '%n' with '\D' in
3577 their prompt_in2 settings everywhere. Sorry, but there's
3580 their prompt_in2 settings everywhere. Sorry, but there's
3578 otherwise no clean way to get all prompts to properly align. The
3581 otherwise no clean way to get all prompts to properly align. The
3579 ipythonrc shipped with IPython has been updated.
3582 ipythonrc shipped with IPython has been updated.
3580
3583
3581 2004-06-07 Fernando Perez <fperez@colorado.edu>
3584 2004-06-07 Fernando Perez <fperez@colorado.edu>
3582
3585
3583 * setup.py (isfile): Pass local_icons option to latex2html, so the
3586 * setup.py (isfile): Pass local_icons option to latex2html, so the
3584 resulting HTML file is self-contained. Thanks to
3587 resulting HTML file is self-contained. Thanks to
3585 dryice-AT-liu.com.cn for the tip.
3588 dryice-AT-liu.com.cn for the tip.
3586
3589
3587 * pysh.py: I created a new profile 'shell', which implements a
3590 * pysh.py: I created a new profile 'shell', which implements a
3588 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3591 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3589 system shell, nor will it become one anytime soon. It's mainly
3592 system shell, nor will it become one anytime soon. It's mainly
3590 meant to illustrate the use of the new flexible bash-like prompts.
3593 meant to illustrate the use of the new flexible bash-like prompts.
3591 I guess it could be used by hardy souls for true shell management,
3594 I guess it could be used by hardy souls for true shell management,
3592 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3595 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3593 profile. This uses the InterpreterExec extension provided by
3596 profile. This uses the InterpreterExec extension provided by
3594 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3597 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3595
3598
3596 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3599 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3597 auto-align itself with the length of the previous input prompt
3600 auto-align itself with the length of the previous input prompt
3598 (taking into account the invisible color escapes).
3601 (taking into account the invisible color escapes).
3599 (CachedOutput.__init__): Large restructuring of this class. Now
3602 (CachedOutput.__init__): Large restructuring of this class. Now
3600 all three prompts (primary1, primary2, output) are proper objects,
3603 all three prompts (primary1, primary2, output) are proper objects,
3601 managed by the 'parent' CachedOutput class. The code is still a
3604 managed by the 'parent' CachedOutput class. The code is still a
3602 bit hackish (all prompts share state via a pointer to the cache),
3605 bit hackish (all prompts share state via a pointer to the cache),
3603 but it's overall far cleaner than before.
3606 but it's overall far cleaner than before.
3604
3607
3605 * IPython/genutils.py (getoutputerror): modified to add verbose,
3608 * IPython/genutils.py (getoutputerror): modified to add verbose,
3606 debug and header options. This makes the interface of all getout*
3609 debug and header options. This makes the interface of all getout*
3607 functions uniform.
3610 functions uniform.
3608 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3611 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3609
3612
3610 * IPython/Magic.py (Magic.default_option): added a function to
3613 * IPython/Magic.py (Magic.default_option): added a function to
3611 allow registering default options for any magic command. This
3614 allow registering default options for any magic command. This
3612 makes it easy to have profiles which customize the magics globally
3615 makes it easy to have profiles which customize the magics globally
3613 for a certain use. The values set through this function are
3616 for a certain use. The values set through this function are
3614 picked up by the parse_options() method, which all magics should
3617 picked up by the parse_options() method, which all magics should
3615 use to parse their options.
3618 use to parse their options.
3616
3619
3617 * IPython/genutils.py (warn): modified the warnings framework to
3620 * IPython/genutils.py (warn): modified the warnings framework to
3618 use the Term I/O class. I'm trying to slowly unify all of
3621 use the Term I/O class. I'm trying to slowly unify all of
3619 IPython's I/O operations to pass through Term.
3622 IPython's I/O operations to pass through Term.
3620
3623
3621 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3624 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3622 the secondary prompt to correctly match the length of the primary
3625 the secondary prompt to correctly match the length of the primary
3623 one for any prompt. Now multi-line code will properly line up
3626 one for any prompt. Now multi-line code will properly line up
3624 even for path dependent prompts, such as the new ones available
3627 even for path dependent prompts, such as the new ones available
3625 via the prompt_specials.
3628 via the prompt_specials.
3626
3629
3627 2004-06-06 Fernando Perez <fperez@colorado.edu>
3630 2004-06-06 Fernando Perez <fperez@colorado.edu>
3628
3631
3629 * IPython/Prompts.py (prompt_specials): Added the ability to have
3632 * IPython/Prompts.py (prompt_specials): Added the ability to have
3630 bash-like special sequences in the prompts, which get
3633 bash-like special sequences in the prompts, which get
3631 automatically expanded. Things like hostname, current working
3634 automatically expanded. Things like hostname, current working
3632 directory and username are implemented already, but it's easy to
3635 directory and username are implemented already, but it's easy to
3633 add more in the future. Thanks to a patch by W.J. van der Laan
3636 add more in the future. Thanks to a patch by W.J. van der Laan
3634 <gnufnork-AT-hetdigitalegat.nl>
3637 <gnufnork-AT-hetdigitalegat.nl>
3635 (prompt_specials): Added color support for prompt strings, so
3638 (prompt_specials): Added color support for prompt strings, so
3636 users can define arbitrary color setups for their prompts.
3639 users can define arbitrary color setups for their prompts.
3637
3640
3638 2004-06-05 Fernando Perez <fperez@colorado.edu>
3641 2004-06-05 Fernando Perez <fperez@colorado.edu>
3639
3642
3640 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3643 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3641 code to load Gary Bishop's readline and configure it
3644 code to load Gary Bishop's readline and configure it
3642 automatically. Thanks to Gary for help on this.
3645 automatically. Thanks to Gary for help on this.
3643
3646
3644 2004-06-01 Fernando Perez <fperez@colorado.edu>
3647 2004-06-01 Fernando Perez <fperez@colorado.edu>
3645
3648
3646 * IPython/Logger.py (Logger.create_log): fix bug for logging
3649 * IPython/Logger.py (Logger.create_log): fix bug for logging
3647 with no filename (previous fix was incomplete).
3650 with no filename (previous fix was incomplete).
3648
3651
3649 2004-05-25 Fernando Perez <fperez@colorado.edu>
3652 2004-05-25 Fernando Perez <fperez@colorado.edu>
3650
3653
3651 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3654 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3652 parens would get passed to the shell.
3655 parens would get passed to the shell.
3653
3656
3654 2004-05-20 Fernando Perez <fperez@colorado.edu>
3657 2004-05-20 Fernando Perez <fperez@colorado.edu>
3655
3658
3656 * IPython/Magic.py (Magic.magic_prun): changed default profile
3659 * IPython/Magic.py (Magic.magic_prun): changed default profile
3657 sort order to 'time' (the more common profiling need).
3660 sort order to 'time' (the more common profiling need).
3658
3661
3659 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3662 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3660 so that source code shown is guaranteed in sync with the file on
3663 so that source code shown is guaranteed in sync with the file on
3661 disk (also changed in psource). Similar fix to the one for
3664 disk (also changed in psource). Similar fix to the one for
3662 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3665 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3663 <yann.ledu-AT-noos.fr>.
3666 <yann.ledu-AT-noos.fr>.
3664
3667
3665 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3668 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3666 with a single option would not be correctly parsed. Closes
3669 with a single option would not be correctly parsed. Closes
3667 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3670 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3668 introduced in 0.6.0 (on 2004-05-06).
3671 introduced in 0.6.0 (on 2004-05-06).
3669
3672
3670 2004-05-13 *** Released version 0.6.0
3673 2004-05-13 *** Released version 0.6.0
3671
3674
3672 2004-05-13 Fernando Perez <fperez@colorado.edu>
3675 2004-05-13 Fernando Perez <fperez@colorado.edu>
3673
3676
3674 * debian/: Added debian/ directory to CVS, so that debian support
3677 * debian/: Added debian/ directory to CVS, so that debian support
3675 is publicly accessible. The debian package is maintained by Jack
3678 is publicly accessible. The debian package is maintained by Jack
3676 Moffit <jack-AT-xiph.org>.
3679 Moffit <jack-AT-xiph.org>.
3677
3680
3678 * Documentation: included the notes about an ipython-based system
3681 * Documentation: included the notes about an ipython-based system
3679 shell (the hypothetical 'pysh') into the new_design.pdf document,
3682 shell (the hypothetical 'pysh') into the new_design.pdf document,
3680 so that these ideas get distributed to users along with the
3683 so that these ideas get distributed to users along with the
3681 official documentation.
3684 official documentation.
3682
3685
3683 2004-05-10 Fernando Perez <fperez@colorado.edu>
3686 2004-05-10 Fernando Perez <fperez@colorado.edu>
3684
3687
3685 * IPython/Logger.py (Logger.create_log): fix recently introduced
3688 * IPython/Logger.py (Logger.create_log): fix recently introduced
3686 bug (misindented line) where logstart would fail when not given an
3689 bug (misindented line) where logstart would fail when not given an
3687 explicit filename.
3690 explicit filename.
3688
3691
3689 2004-05-09 Fernando Perez <fperez@colorado.edu>
3692 2004-05-09 Fernando Perez <fperez@colorado.edu>
3690
3693
3691 * IPython/Magic.py (Magic.parse_options): skip system call when
3694 * IPython/Magic.py (Magic.parse_options): skip system call when
3692 there are no options to look for. Faster, cleaner for the common
3695 there are no options to look for. Faster, cleaner for the common
3693 case.
3696 case.
3694
3697
3695 * Documentation: many updates to the manual: describing Windows
3698 * Documentation: many updates to the manual: describing Windows
3696 support better, Gnuplot updates, credits, misc small stuff. Also
3699 support better, Gnuplot updates, credits, misc small stuff. Also
3697 updated the new_design doc a bit.
3700 updated the new_design doc a bit.
3698
3701
3699 2004-05-06 *** Released version 0.6.0.rc1
3702 2004-05-06 *** Released version 0.6.0.rc1
3700
3703
3701 2004-05-06 Fernando Perez <fperez@colorado.edu>
3704 2004-05-06 Fernando Perez <fperez@colorado.edu>
3702
3705
3703 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3706 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3704 operations to use the vastly more efficient list/''.join() method.
3707 operations to use the vastly more efficient list/''.join() method.
3705 (FormattedTB.text): Fix
3708 (FormattedTB.text): Fix
3706 http://www.scipy.net/roundup/ipython/issue12 - exception source
3709 http://www.scipy.net/roundup/ipython/issue12 - exception source
3707 extract not updated after reload. Thanks to Mike Salib
3710 extract not updated after reload. Thanks to Mike Salib
3708 <msalib-AT-mit.edu> for pinning the source of the problem.
3711 <msalib-AT-mit.edu> for pinning the source of the problem.
3709 Fortunately, the solution works inside ipython and doesn't require
3712 Fortunately, the solution works inside ipython and doesn't require
3710 any changes to python proper.
3713 any changes to python proper.
3711
3714
3712 * IPython/Magic.py (Magic.parse_options): Improved to process the
3715 * IPython/Magic.py (Magic.parse_options): Improved to process the
3713 argument list as a true shell would (by actually using the
3716 argument list as a true shell would (by actually using the
3714 underlying system shell). This way, all @magics automatically get
3717 underlying system shell). This way, all @magics automatically get
3715 shell expansion for variables. Thanks to a comment by Alex
3718 shell expansion for variables. Thanks to a comment by Alex
3716 Schmolck.
3719 Schmolck.
3717
3720
3718 2004-04-04 Fernando Perez <fperez@colorado.edu>
3721 2004-04-04 Fernando Perez <fperez@colorado.edu>
3719
3722
3720 * IPython/iplib.py (InteractiveShell.interact): Added a special
3723 * IPython/iplib.py (InteractiveShell.interact): Added a special
3721 trap for a debugger quit exception, which is basically impossible
3724 trap for a debugger quit exception, which is basically impossible
3722 to handle by normal mechanisms, given what pdb does to the stack.
3725 to handle by normal mechanisms, given what pdb does to the stack.
3723 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3726 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3724
3727
3725 2004-04-03 Fernando Perez <fperez@colorado.edu>
3728 2004-04-03 Fernando Perez <fperez@colorado.edu>
3726
3729
3727 * IPython/genutils.py (Term): Standardized the names of the Term
3730 * IPython/genutils.py (Term): Standardized the names of the Term
3728 class streams to cin/cout/cerr, following C++ naming conventions
3731 class streams to cin/cout/cerr, following C++ naming conventions
3729 (I can't use in/out/err because 'in' is not a valid attribute
3732 (I can't use in/out/err because 'in' is not a valid attribute
3730 name).
3733 name).
3731
3734
3732 * IPython/iplib.py (InteractiveShell.interact): don't increment
3735 * IPython/iplib.py (InteractiveShell.interact): don't increment
3733 the prompt if there's no user input. By Daniel 'Dang' Griffith
3736 the prompt if there's no user input. By Daniel 'Dang' Griffith
3734 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3737 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3735 Francois Pinard.
3738 Francois Pinard.
3736
3739
3737 2004-04-02 Fernando Perez <fperez@colorado.edu>
3740 2004-04-02 Fernando Perez <fperez@colorado.edu>
3738
3741
3739 * IPython/genutils.py (Stream.__init__): Modified to survive at
3742 * IPython/genutils.py (Stream.__init__): Modified to survive at
3740 least importing in contexts where stdin/out/err aren't true file
3743 least importing in contexts where stdin/out/err aren't true file
3741 objects, such as PyCrust (they lack fileno() and mode). However,
3744 objects, such as PyCrust (they lack fileno() and mode). However,
3742 the recovery facilities which rely on these things existing will
3745 the recovery facilities which rely on these things existing will
3743 not work.
3746 not work.
3744
3747
3745 2004-04-01 Fernando Perez <fperez@colorado.edu>
3748 2004-04-01 Fernando Perez <fperez@colorado.edu>
3746
3749
3747 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3750 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3748 use the new getoutputerror() function, so it properly
3751 use the new getoutputerror() function, so it properly
3749 distinguishes stdout/err.
3752 distinguishes stdout/err.
3750
3753
3751 * IPython/genutils.py (getoutputerror): added a function to
3754 * IPython/genutils.py (getoutputerror): added a function to
3752 capture separately the standard output and error of a command.
3755 capture separately the standard output and error of a command.
3753 After a comment from dang on the mailing lists. This code is
3756 After a comment from dang on the mailing lists. This code is
3754 basically a modified version of commands.getstatusoutput(), from
3757 basically a modified version of commands.getstatusoutput(), from
3755 the standard library.
3758 the standard library.
3756
3759
3757 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3760 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3758 '!!' as a special syntax (shorthand) to access @sx.
3761 '!!' as a special syntax (shorthand) to access @sx.
3759
3762
3760 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3763 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3761 command and return its output as a list split on '\n'.
3764 command and return its output as a list split on '\n'.
3762
3765
3763 2004-03-31 Fernando Perez <fperez@colorado.edu>
3766 2004-03-31 Fernando Perez <fperez@colorado.edu>
3764
3767
3765 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3768 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3766 method to dictionaries used as FakeModule instances if they lack
3769 method to dictionaries used as FakeModule instances if they lack
3767 it. At least pydoc in python2.3 breaks for runtime-defined
3770 it. At least pydoc in python2.3 breaks for runtime-defined
3768 functions without this hack. At some point I need to _really_
3771 functions without this hack. At some point I need to _really_
3769 understand what FakeModule is doing, because it's a gross hack.
3772 understand what FakeModule is doing, because it's a gross hack.
3770 But it solves Arnd's problem for now...
3773 But it solves Arnd's problem for now...
3771
3774
3772 2004-02-27 Fernando Perez <fperez@colorado.edu>
3775 2004-02-27 Fernando Perez <fperez@colorado.edu>
3773
3776
3774 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3777 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3775 mode would behave erratically. Also increased the number of
3778 mode would behave erratically. Also increased the number of
3776 possible logs in rotate mod to 999. Thanks to Rod Holland
3779 possible logs in rotate mod to 999. Thanks to Rod Holland
3777 <rhh@StructureLABS.com> for the report and fixes.
3780 <rhh@StructureLABS.com> for the report and fixes.
3778
3781
3779 2004-02-26 Fernando Perez <fperez@colorado.edu>
3782 2004-02-26 Fernando Perez <fperez@colorado.edu>
3780
3783
3781 * IPython/genutils.py (page): Check that the curses module really
3784 * IPython/genutils.py (page): Check that the curses module really
3782 has the initscr attribute before trying to use it. For some
3785 has the initscr attribute before trying to use it. For some
3783 reason, the Solaris curses module is missing this. I think this
3786 reason, the Solaris curses module is missing this. I think this
3784 should be considered a Solaris python bug, but I'm not sure.
3787 should be considered a Solaris python bug, but I'm not sure.
3785
3788
3786 2004-01-17 Fernando Perez <fperez@colorado.edu>
3789 2004-01-17 Fernando Perez <fperez@colorado.edu>
3787
3790
3788 * IPython/genutils.py (Stream.__init__): Changes to try to make
3791 * IPython/genutils.py (Stream.__init__): Changes to try to make
3789 ipython robust against stdin/out/err being closed by the user.
3792 ipython robust against stdin/out/err being closed by the user.
3790 This is 'user error' (and blocks a normal python session, at least
3793 This is 'user error' (and blocks a normal python session, at least
3791 the stdout case). However, Ipython should be able to survive such
3794 the stdout case). However, Ipython should be able to survive such
3792 instances of abuse as gracefully as possible. To simplify the
3795 instances of abuse as gracefully as possible. To simplify the
3793 coding and maintain compatibility with Gary Bishop's Term
3796 coding and maintain compatibility with Gary Bishop's Term
3794 contributions, I've made use of classmethods for this. I think
3797 contributions, I've made use of classmethods for this. I think
3795 this introduces a dependency on python 2.2.
3798 this introduces a dependency on python 2.2.
3796
3799
3797 2004-01-13 Fernando Perez <fperez@colorado.edu>
3800 2004-01-13 Fernando Perez <fperez@colorado.edu>
3798
3801
3799 * IPython/numutils.py (exp_safe): simplified the code a bit and
3802 * IPython/numutils.py (exp_safe): simplified the code a bit and
3800 removed the need for importing the kinds module altogether.
3803 removed the need for importing the kinds module altogether.
3801
3804
3802 2004-01-06 Fernando Perez <fperez@colorado.edu>
3805 2004-01-06 Fernando Perez <fperez@colorado.edu>
3803
3806
3804 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3807 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3805 a magic function instead, after some community feedback. No
3808 a magic function instead, after some community feedback. No
3806 special syntax will exist for it, but its name is deliberately
3809 special syntax will exist for it, but its name is deliberately
3807 very short.
3810 very short.
3808
3811
3809 2003-12-20 Fernando Perez <fperez@colorado.edu>
3812 2003-12-20 Fernando Perez <fperez@colorado.edu>
3810
3813
3811 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3814 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3812 new functionality, to automagically assign the result of a shell
3815 new functionality, to automagically assign the result of a shell
3813 command to a variable. I'll solicit some community feedback on
3816 command to a variable. I'll solicit some community feedback on
3814 this before making it permanent.
3817 this before making it permanent.
3815
3818
3816 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3819 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3817 requested about callables for which inspect couldn't obtain a
3820 requested about callables for which inspect couldn't obtain a
3818 proper argspec. Thanks to a crash report sent by Etienne
3821 proper argspec. Thanks to a crash report sent by Etienne
3819 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3822 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3820
3823
3821 2003-12-09 Fernando Perez <fperez@colorado.edu>
3824 2003-12-09 Fernando Perez <fperez@colorado.edu>
3822
3825
3823 * IPython/genutils.py (page): patch for the pager to work across
3826 * IPython/genutils.py (page): patch for the pager to work across
3824 various versions of Windows. By Gary Bishop.
3827 various versions of Windows. By Gary Bishop.
3825
3828
3826 2003-12-04 Fernando Perez <fperez@colorado.edu>
3829 2003-12-04 Fernando Perez <fperez@colorado.edu>
3827
3830
3828 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3831 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3829 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3832 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3830 While I tested this and it looks ok, there may still be corner
3833 While I tested this and it looks ok, there may still be corner
3831 cases I've missed.
3834 cases I've missed.
3832
3835
3833 2003-12-01 Fernando Perez <fperez@colorado.edu>
3836 2003-12-01 Fernando Perez <fperez@colorado.edu>
3834
3837
3835 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3838 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3836 where a line like 'p,q=1,2' would fail because the automagic
3839 where a line like 'p,q=1,2' would fail because the automagic
3837 system would be triggered for @p.
3840 system would be triggered for @p.
3838
3841
3839 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3842 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3840 cleanups, code unmodified.
3843 cleanups, code unmodified.
3841
3844
3842 * IPython/genutils.py (Term): added a class for IPython to handle
3845 * IPython/genutils.py (Term): added a class for IPython to handle
3843 output. In most cases it will just be a proxy for stdout/err, but
3846 output. In most cases it will just be a proxy for stdout/err, but
3844 having this allows modifications to be made for some platforms,
3847 having this allows modifications to be made for some platforms,
3845 such as handling color escapes under Windows. All of this code
3848 such as handling color escapes under Windows. All of this code
3846 was contributed by Gary Bishop, with minor modifications by me.
3849 was contributed by Gary Bishop, with minor modifications by me.
3847 The actual changes affect many files.
3850 The actual changes affect many files.
3848
3851
3849 2003-11-30 Fernando Perez <fperez@colorado.edu>
3852 2003-11-30 Fernando Perez <fperez@colorado.edu>
3850
3853
3851 * IPython/iplib.py (file_matches): new completion code, courtesy
3854 * IPython/iplib.py (file_matches): new completion code, courtesy
3852 of Jeff Collins. This enables filename completion again under
3855 of Jeff Collins. This enables filename completion again under
3853 python 2.3, which disabled it at the C level.
3856 python 2.3, which disabled it at the C level.
3854
3857
3855 2003-11-11 Fernando Perez <fperez@colorado.edu>
3858 2003-11-11 Fernando Perez <fperez@colorado.edu>
3856
3859
3857 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3860 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3858 for Numeric.array(map(...)), but often convenient.
3861 for Numeric.array(map(...)), but often convenient.
3859
3862
3860 2003-11-05 Fernando Perez <fperez@colorado.edu>
3863 2003-11-05 Fernando Perez <fperez@colorado.edu>
3861
3864
3862 * IPython/numutils.py (frange): Changed a call from int() to
3865 * IPython/numutils.py (frange): Changed a call from int() to
3863 int(round()) to prevent a problem reported with arange() in the
3866 int(round()) to prevent a problem reported with arange() in the
3864 numpy list.
3867 numpy list.
3865
3868
3866 2003-10-06 Fernando Perez <fperez@colorado.edu>
3869 2003-10-06 Fernando Perez <fperez@colorado.edu>
3867
3870
3868 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3871 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3869 prevent crashes if sys lacks an argv attribute (it happens with
3872 prevent crashes if sys lacks an argv attribute (it happens with
3870 embedded interpreters which build a bare-bones sys module).
3873 embedded interpreters which build a bare-bones sys module).
3871 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3874 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3872
3875
3873 2003-09-24 Fernando Perez <fperez@colorado.edu>
3876 2003-09-24 Fernando Perez <fperez@colorado.edu>
3874
3877
3875 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3878 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3876 to protect against poorly written user objects where __getattr__
3879 to protect against poorly written user objects where __getattr__
3877 raises exceptions other than AttributeError. Thanks to a bug
3880 raises exceptions other than AttributeError. Thanks to a bug
3878 report by Oliver Sander <osander-AT-gmx.de>.
3881 report by Oliver Sander <osander-AT-gmx.de>.
3879
3882
3880 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3883 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3881 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3884 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3882
3885
3883 2003-09-09 Fernando Perez <fperez@colorado.edu>
3886 2003-09-09 Fernando Perez <fperez@colorado.edu>
3884
3887
3885 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3888 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3886 unpacking a list whith a callable as first element would
3889 unpacking a list whith a callable as first element would
3887 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3890 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3888 Collins.
3891 Collins.
3889
3892
3890 2003-08-25 *** Released version 0.5.0
3893 2003-08-25 *** Released version 0.5.0
3891
3894
3892 2003-08-22 Fernando Perez <fperez@colorado.edu>
3895 2003-08-22 Fernando Perez <fperez@colorado.edu>
3893
3896
3894 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3897 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3895 improperly defined user exceptions. Thanks to feedback from Mark
3898 improperly defined user exceptions. Thanks to feedback from Mark
3896 Russell <mrussell-AT-verio.net>.
3899 Russell <mrussell-AT-verio.net>.
3897
3900
3898 2003-08-20 Fernando Perez <fperez@colorado.edu>
3901 2003-08-20 Fernando Perez <fperez@colorado.edu>
3899
3902
3900 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3903 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3901 printing so that it would print multi-line string forms starting
3904 printing so that it would print multi-line string forms starting
3902 with a new line. This way the formatting is better respected for
3905 with a new line. This way the formatting is better respected for
3903 objects which work hard to make nice string forms.
3906 objects which work hard to make nice string forms.
3904
3907
3905 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3908 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3906 autocall would overtake data access for objects with both
3909 autocall would overtake data access for objects with both
3907 __getitem__ and __call__.
3910 __getitem__ and __call__.
3908
3911
3909 2003-08-19 *** Released version 0.5.0-rc1
3912 2003-08-19 *** Released version 0.5.0-rc1
3910
3913
3911 2003-08-19 Fernando Perez <fperez@colorado.edu>
3914 2003-08-19 Fernando Perez <fperez@colorado.edu>
3912
3915
3913 * IPython/deep_reload.py (load_tail): single tiny change here
3916 * IPython/deep_reload.py (load_tail): single tiny change here
3914 seems to fix the long-standing bug of dreload() failing to work
3917 seems to fix the long-standing bug of dreload() failing to work
3915 for dotted names. But this module is pretty tricky, so I may have
3918 for dotted names. But this module is pretty tricky, so I may have
3916 missed some subtlety. Needs more testing!.
3919 missed some subtlety. Needs more testing!.
3917
3920
3918 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3921 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3919 exceptions which have badly implemented __str__ methods.
3922 exceptions which have badly implemented __str__ methods.
3920 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3923 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3921 which I've been getting reports about from Python 2.3 users. I
3924 which I've been getting reports about from Python 2.3 users. I
3922 wish I had a simple test case to reproduce the problem, so I could
3925 wish I had a simple test case to reproduce the problem, so I could
3923 either write a cleaner workaround or file a bug report if
3926 either write a cleaner workaround or file a bug report if
3924 necessary.
3927 necessary.
3925
3928
3926 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3929 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3927 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3930 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3928 a bug report by Tjabo Kloppenburg.
3931 a bug report by Tjabo Kloppenburg.
3929
3932
3930 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3933 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3931 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3934 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3932 seems rather unstable. Thanks to a bug report by Tjabo
3935 seems rather unstable. Thanks to a bug report by Tjabo
3933 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3936 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3934
3937
3935 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3938 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3936 this out soon because of the critical fixes in the inner loop for
3939 this out soon because of the critical fixes in the inner loop for
3937 generators.
3940 generators.
3938
3941
3939 * IPython/Magic.py (Magic.getargspec): removed. This (and
3942 * IPython/Magic.py (Magic.getargspec): removed. This (and
3940 _get_def) have been obsoleted by OInspect for a long time, I
3943 _get_def) have been obsoleted by OInspect for a long time, I
3941 hadn't noticed that they were dead code.
3944 hadn't noticed that they were dead code.
3942 (Magic._ofind): restored _ofind functionality for a few literals
3945 (Magic._ofind): restored _ofind functionality for a few literals
3943 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3946 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3944 for things like "hello".capitalize?, since that would require a
3947 for things like "hello".capitalize?, since that would require a
3945 potentially dangerous eval() again.
3948 potentially dangerous eval() again.
3946
3949
3947 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3950 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3948 logic a bit more to clean up the escapes handling and minimize the
3951 logic a bit more to clean up the escapes handling and minimize the
3949 use of _ofind to only necessary cases. The interactive 'feel' of
3952 use of _ofind to only necessary cases. The interactive 'feel' of
3950 IPython should have improved quite a bit with the changes in
3953 IPython should have improved quite a bit with the changes in
3951 _prefilter and _ofind (besides being far safer than before).
3954 _prefilter and _ofind (besides being far safer than before).
3952
3955
3953 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3956 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3954 obscure, never reported). Edit would fail to find the object to
3957 obscure, never reported). Edit would fail to find the object to
3955 edit under some circumstances.
3958 edit under some circumstances.
3956 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3959 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3957 which were causing double-calling of generators. Those eval calls
3960 which were causing double-calling of generators. Those eval calls
3958 were _very_ dangerous, since code with side effects could be
3961 were _very_ dangerous, since code with side effects could be
3959 triggered. As they say, 'eval is evil'... These were the
3962 triggered. As they say, 'eval is evil'... These were the
3960 nastiest evals in IPython. Besides, _ofind is now far simpler,
3963 nastiest evals in IPython. Besides, _ofind is now far simpler,
3961 and it should also be quite a bit faster. Its use of inspect is
3964 and it should also be quite a bit faster. Its use of inspect is
3962 also safer, so perhaps some of the inspect-related crashes I've
3965 also safer, so perhaps some of the inspect-related crashes I've
3963 seen lately with Python 2.3 might be taken care of. That will
3966 seen lately with Python 2.3 might be taken care of. That will
3964 need more testing.
3967 need more testing.
3965
3968
3966 2003-08-17 Fernando Perez <fperez@colorado.edu>
3969 2003-08-17 Fernando Perez <fperez@colorado.edu>
3967
3970
3968 * IPython/iplib.py (InteractiveShell._prefilter): significant
3971 * IPython/iplib.py (InteractiveShell._prefilter): significant
3969 simplifications to the logic for handling user escapes. Faster
3972 simplifications to the logic for handling user escapes. Faster
3970 and simpler code.
3973 and simpler code.
3971
3974
3972 2003-08-14 Fernando Perez <fperez@colorado.edu>
3975 2003-08-14 Fernando Perez <fperez@colorado.edu>
3973
3976
3974 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3977 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3975 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3978 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3976 but it should be quite a bit faster. And the recursive version
3979 but it should be quite a bit faster. And the recursive version
3977 generated O(log N) intermediate storage for all rank>1 arrays,
3980 generated O(log N) intermediate storage for all rank>1 arrays,
3978 even if they were contiguous.
3981 even if they were contiguous.
3979 (l1norm): Added this function.
3982 (l1norm): Added this function.
3980 (norm): Added this function for arbitrary norms (including
3983 (norm): Added this function for arbitrary norms (including
3981 l-infinity). l1 and l2 are still special cases for convenience
3984 l-infinity). l1 and l2 are still special cases for convenience
3982 and speed.
3985 and speed.
3983
3986
3984 2003-08-03 Fernando Perez <fperez@colorado.edu>
3987 2003-08-03 Fernando Perez <fperez@colorado.edu>
3985
3988
3986 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3989 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3987 exceptions, which now raise PendingDeprecationWarnings in Python
3990 exceptions, which now raise PendingDeprecationWarnings in Python
3988 2.3. There were some in Magic and some in Gnuplot2.
3991 2.3. There were some in Magic and some in Gnuplot2.
3989
3992
3990 2003-06-30 Fernando Perez <fperez@colorado.edu>
3993 2003-06-30 Fernando Perez <fperez@colorado.edu>
3991
3994
3992 * IPython/genutils.py (page): modified to call curses only for
3995 * IPython/genutils.py (page): modified to call curses only for
3993 terminals where TERM=='xterm'. After problems under many other
3996 terminals where TERM=='xterm'. After problems under many other
3994 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3997 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3995
3998
3996 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3999 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3997 would be triggered when readline was absent. This was just an old
4000 would be triggered when readline was absent. This was just an old
3998 debugging statement I'd forgotten to take out.
4001 debugging statement I'd forgotten to take out.
3999
4002
4000 2003-06-20 Fernando Perez <fperez@colorado.edu>
4003 2003-06-20 Fernando Perez <fperez@colorado.edu>
4001
4004
4002 * IPython/genutils.py (clock): modified to return only user time
4005 * IPython/genutils.py (clock): modified to return only user time
4003 (not counting system time), after a discussion on scipy. While
4006 (not counting system time), after a discussion on scipy. While
4004 system time may be a useful quantity occasionally, it may much
4007 system time may be a useful quantity occasionally, it may much
4005 more easily be skewed by occasional swapping or other similar
4008 more easily be skewed by occasional swapping or other similar
4006 activity.
4009 activity.
4007
4010
4008 2003-06-05 Fernando Perez <fperez@colorado.edu>
4011 2003-06-05 Fernando Perez <fperez@colorado.edu>
4009
4012
4010 * IPython/numutils.py (identity): new function, for building
4013 * IPython/numutils.py (identity): new function, for building
4011 arbitrary rank Kronecker deltas (mostly backwards compatible with
4014 arbitrary rank Kronecker deltas (mostly backwards compatible with
4012 Numeric.identity)
4015 Numeric.identity)
4013
4016
4014 2003-06-03 Fernando Perez <fperez@colorado.edu>
4017 2003-06-03 Fernando Perez <fperez@colorado.edu>
4015
4018
4016 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4019 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4017 arguments passed to magics with spaces, to allow trailing '\' to
4020 arguments passed to magics with spaces, to allow trailing '\' to
4018 work normally (mainly for Windows users).
4021 work normally (mainly for Windows users).
4019
4022
4020 2003-05-29 Fernando Perez <fperez@colorado.edu>
4023 2003-05-29 Fernando Perez <fperez@colorado.edu>
4021
4024
4022 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4025 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4023 instead of pydoc.help. This fixes a bizarre behavior where
4026 instead of pydoc.help. This fixes a bizarre behavior where
4024 printing '%s' % locals() would trigger the help system. Now
4027 printing '%s' % locals() would trigger the help system. Now
4025 ipython behaves like normal python does.
4028 ipython behaves like normal python does.
4026
4029
4027 Note that if one does 'from pydoc import help', the bizarre
4030 Note that if one does 'from pydoc import help', the bizarre
4028 behavior returns, but this will also happen in normal python, so
4031 behavior returns, but this will also happen in normal python, so
4029 it's not an ipython bug anymore (it has to do with how pydoc.help
4032 it's not an ipython bug anymore (it has to do with how pydoc.help
4030 is implemented).
4033 is implemented).
4031
4034
4032 2003-05-22 Fernando Perez <fperez@colorado.edu>
4035 2003-05-22 Fernando Perez <fperez@colorado.edu>
4033
4036
4034 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4037 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4035 return [] instead of None when nothing matches, also match to end
4038 return [] instead of None when nothing matches, also match to end
4036 of line. Patch by Gary Bishop.
4039 of line. Patch by Gary Bishop.
4037
4040
4038 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4041 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4039 protection as before, for files passed on the command line. This
4042 protection as before, for files passed on the command line. This
4040 prevents the CrashHandler from kicking in if user files call into
4043 prevents the CrashHandler from kicking in if user files call into
4041 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4044 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4042 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4045 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4043
4046
4044 2003-05-20 *** Released version 0.4.0
4047 2003-05-20 *** Released version 0.4.0
4045
4048
4046 2003-05-20 Fernando Perez <fperez@colorado.edu>
4049 2003-05-20 Fernando Perez <fperez@colorado.edu>
4047
4050
4048 * setup.py: added support for manpages. It's a bit hackish b/c of
4051 * setup.py: added support for manpages. It's a bit hackish b/c of
4049 a bug in the way the bdist_rpm distutils target handles gzipped
4052 a bug in the way the bdist_rpm distutils target handles gzipped
4050 manpages, but it works. After a patch by Jack.
4053 manpages, but it works. After a patch by Jack.
4051
4054
4052 2003-05-19 Fernando Perez <fperez@colorado.edu>
4055 2003-05-19 Fernando Perez <fperez@colorado.edu>
4053
4056
4054 * IPython/numutils.py: added a mockup of the kinds module, since
4057 * IPython/numutils.py: added a mockup of the kinds module, since
4055 it was recently removed from Numeric. This way, numutils will
4058 it was recently removed from Numeric. This way, numutils will
4056 work for all users even if they are missing kinds.
4059 work for all users even if they are missing kinds.
4057
4060
4058 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4061 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4059 failure, which can occur with SWIG-wrapped extensions. After a
4062 failure, which can occur with SWIG-wrapped extensions. After a
4060 crash report from Prabhu.
4063 crash report from Prabhu.
4061
4064
4062 2003-05-16 Fernando Perez <fperez@colorado.edu>
4065 2003-05-16 Fernando Perez <fperez@colorado.edu>
4063
4066
4064 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4067 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4065 protect ipython from user code which may call directly
4068 protect ipython from user code which may call directly
4066 sys.excepthook (this looks like an ipython crash to the user, even
4069 sys.excepthook (this looks like an ipython crash to the user, even
4067 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4070 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4068 This is especially important to help users of WxWindows, but may
4071 This is especially important to help users of WxWindows, but may
4069 also be useful in other cases.
4072 also be useful in other cases.
4070
4073
4071 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4074 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4072 an optional tb_offset to be specified, and to preserve exception
4075 an optional tb_offset to be specified, and to preserve exception
4073 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4076 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4074
4077
4075 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4078 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4076
4079
4077 2003-05-15 Fernando Perez <fperez@colorado.edu>
4080 2003-05-15 Fernando Perez <fperez@colorado.edu>
4078
4081
4079 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4082 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4080 installing for a new user under Windows.
4083 installing for a new user under Windows.
4081
4084
4082 2003-05-12 Fernando Perez <fperez@colorado.edu>
4085 2003-05-12 Fernando Perez <fperez@colorado.edu>
4083
4086
4084 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4087 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4085 handler for Emacs comint-based lines. Currently it doesn't do
4088 handler for Emacs comint-based lines. Currently it doesn't do
4086 much (but importantly, it doesn't update the history cache). In
4089 much (but importantly, it doesn't update the history cache). In
4087 the future it may be expanded if Alex needs more functionality
4090 the future it may be expanded if Alex needs more functionality
4088 there.
4091 there.
4089
4092
4090 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4093 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4091 info to crash reports.
4094 info to crash reports.
4092
4095
4093 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4096 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4094 just like Python's -c. Also fixed crash with invalid -color
4097 just like Python's -c. Also fixed crash with invalid -color
4095 option value at startup. Thanks to Will French
4098 option value at startup. Thanks to Will French
4096 <wfrench-AT-bestweb.net> for the bug report.
4099 <wfrench-AT-bestweb.net> for the bug report.
4097
4100
4098 2003-05-09 Fernando Perez <fperez@colorado.edu>
4101 2003-05-09 Fernando Perez <fperez@colorado.edu>
4099
4102
4100 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4103 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4101 to EvalDict (it's a mapping, after all) and simplified its code
4104 to EvalDict (it's a mapping, after all) and simplified its code
4102 quite a bit, after a nice discussion on c.l.py where Gustavo
4105 quite a bit, after a nice discussion on c.l.py where Gustavo
4103 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4106 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4104
4107
4105 2003-04-30 Fernando Perez <fperez@colorado.edu>
4108 2003-04-30 Fernando Perez <fperez@colorado.edu>
4106
4109
4107 * IPython/genutils.py (timings_out): modified it to reduce its
4110 * IPython/genutils.py (timings_out): modified it to reduce its
4108 overhead in the common reps==1 case.
4111 overhead in the common reps==1 case.
4109
4112
4110 2003-04-29 Fernando Perez <fperez@colorado.edu>
4113 2003-04-29 Fernando Perez <fperez@colorado.edu>
4111
4114
4112 * IPython/genutils.py (timings_out): Modified to use the resource
4115 * IPython/genutils.py (timings_out): Modified to use the resource
4113 module, which avoids the wraparound problems of time.clock().
4116 module, which avoids the wraparound problems of time.clock().
4114
4117
4115 2003-04-17 *** Released version 0.2.15pre4
4118 2003-04-17 *** Released version 0.2.15pre4
4116
4119
4117 2003-04-17 Fernando Perez <fperez@colorado.edu>
4120 2003-04-17 Fernando Perez <fperez@colorado.edu>
4118
4121
4119 * setup.py (scriptfiles): Split windows-specific stuff over to a
4122 * setup.py (scriptfiles): Split windows-specific stuff over to a
4120 separate file, in an attempt to have a Windows GUI installer.
4123 separate file, in an attempt to have a Windows GUI installer.
4121 That didn't work, but part of the groundwork is done.
4124 That didn't work, but part of the groundwork is done.
4122
4125
4123 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4126 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4124 indent/unindent with 4 spaces. Particularly useful in combination
4127 indent/unindent with 4 spaces. Particularly useful in combination
4125 with the new auto-indent option.
4128 with the new auto-indent option.
4126
4129
4127 2003-04-16 Fernando Perez <fperez@colorado.edu>
4130 2003-04-16 Fernando Perez <fperez@colorado.edu>
4128
4131
4129 * IPython/Magic.py: various replacements of self.rc for
4132 * IPython/Magic.py: various replacements of self.rc for
4130 self.shell.rc. A lot more remains to be done to fully disentangle
4133 self.shell.rc. A lot more remains to be done to fully disentangle
4131 this class from the main Shell class.
4134 this class from the main Shell class.
4132
4135
4133 * IPython/GnuplotRuntime.py: added checks for mouse support so
4136 * IPython/GnuplotRuntime.py: added checks for mouse support so
4134 that we don't try to enable it if the current gnuplot doesn't
4137 that we don't try to enable it if the current gnuplot doesn't
4135 really support it. Also added checks so that we don't try to
4138 really support it. Also added checks so that we don't try to
4136 enable persist under Windows (where Gnuplot doesn't recognize the
4139 enable persist under Windows (where Gnuplot doesn't recognize the
4137 option).
4140 option).
4138
4141
4139 * IPython/iplib.py (InteractiveShell.interact): Added optional
4142 * IPython/iplib.py (InteractiveShell.interact): Added optional
4140 auto-indenting code, after a patch by King C. Shu
4143 auto-indenting code, after a patch by King C. Shu
4141 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4144 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4142 get along well with pasting indented code. If I ever figure out
4145 get along well with pasting indented code. If I ever figure out
4143 how to make that part go well, it will become on by default.
4146 how to make that part go well, it will become on by default.
4144
4147
4145 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4148 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4146 crash ipython if there was an unmatched '%' in the user's prompt
4149 crash ipython if there was an unmatched '%' in the user's prompt
4147 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4150 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4148
4151
4149 * IPython/iplib.py (InteractiveShell.interact): removed the
4152 * IPython/iplib.py (InteractiveShell.interact): removed the
4150 ability to ask the user whether he wants to crash or not at the
4153 ability to ask the user whether he wants to crash or not at the
4151 'last line' exception handler. Calling functions at that point
4154 'last line' exception handler. Calling functions at that point
4152 changes the stack, and the error reports would have incorrect
4155 changes the stack, and the error reports would have incorrect
4153 tracebacks.
4156 tracebacks.
4154
4157
4155 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4158 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4156 pass through a peger a pretty-printed form of any object. After a
4159 pass through a peger a pretty-printed form of any object. After a
4157 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4160 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4158
4161
4159 2003-04-14 Fernando Perez <fperez@colorado.edu>
4162 2003-04-14 Fernando Perez <fperez@colorado.edu>
4160
4163
4161 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4164 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4162 all files in ~ would be modified at first install (instead of
4165 all files in ~ would be modified at first install (instead of
4163 ~/.ipython). This could be potentially disastrous, as the
4166 ~/.ipython). This could be potentially disastrous, as the
4164 modification (make line-endings native) could damage binary files.
4167 modification (make line-endings native) could damage binary files.
4165
4168
4166 2003-04-10 Fernando Perez <fperez@colorado.edu>
4169 2003-04-10 Fernando Perez <fperez@colorado.edu>
4167
4170
4168 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4171 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4169 handle only lines which are invalid python. This now means that
4172 handle only lines which are invalid python. This now means that
4170 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4173 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4171 for the bug report.
4174 for the bug report.
4172
4175
4173 2003-04-01 Fernando Perez <fperez@colorado.edu>
4176 2003-04-01 Fernando Perez <fperez@colorado.edu>
4174
4177
4175 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4178 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4176 where failing to set sys.last_traceback would crash pdb.pm().
4179 where failing to set sys.last_traceback would crash pdb.pm().
4177 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4180 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4178 report.
4181 report.
4179
4182
4180 2003-03-25 Fernando Perez <fperez@colorado.edu>
4183 2003-03-25 Fernando Perez <fperez@colorado.edu>
4181
4184
4182 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4185 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4183 before printing it (it had a lot of spurious blank lines at the
4186 before printing it (it had a lot of spurious blank lines at the
4184 end).
4187 end).
4185
4188
4186 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4189 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4187 output would be sent 21 times! Obviously people don't use this
4190 output would be sent 21 times! Obviously people don't use this
4188 too often, or I would have heard about it.
4191 too often, or I would have heard about it.
4189
4192
4190 2003-03-24 Fernando Perez <fperez@colorado.edu>
4193 2003-03-24 Fernando Perez <fperez@colorado.edu>
4191
4194
4192 * setup.py (scriptfiles): renamed the data_files parameter from
4195 * setup.py (scriptfiles): renamed the data_files parameter from
4193 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4196 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4194 for the patch.
4197 for the patch.
4195
4198
4196 2003-03-20 Fernando Perez <fperez@colorado.edu>
4199 2003-03-20 Fernando Perez <fperez@colorado.edu>
4197
4200
4198 * IPython/genutils.py (error): added error() and fatal()
4201 * IPython/genutils.py (error): added error() and fatal()
4199 functions.
4202 functions.
4200
4203
4201 2003-03-18 *** Released version 0.2.15pre3
4204 2003-03-18 *** Released version 0.2.15pre3
4202
4205
4203 2003-03-18 Fernando Perez <fperez@colorado.edu>
4206 2003-03-18 Fernando Perez <fperez@colorado.edu>
4204
4207
4205 * setupext/install_data_ext.py
4208 * setupext/install_data_ext.py
4206 (install_data_ext.initialize_options): Class contributed by Jack
4209 (install_data_ext.initialize_options): Class contributed by Jack
4207 Moffit for fixing the old distutils hack. He is sending this to
4210 Moffit for fixing the old distutils hack. He is sending this to
4208 the distutils folks so in the future we may not need it as a
4211 the distutils folks so in the future we may not need it as a
4209 private fix.
4212 private fix.
4210
4213
4211 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4214 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4212 changes for Debian packaging. See his patch for full details.
4215 changes for Debian packaging. See his patch for full details.
4213 The old distutils hack of making the ipythonrc* files carry a
4216 The old distutils hack of making the ipythonrc* files carry a
4214 bogus .py extension is gone, at last. Examples were moved to a
4217 bogus .py extension is gone, at last. Examples were moved to a
4215 separate subdir under doc/, and the separate executable scripts
4218 separate subdir under doc/, and the separate executable scripts
4216 now live in their own directory. Overall a great cleanup. The
4219 now live in their own directory. Overall a great cleanup. The
4217 manual was updated to use the new files, and setup.py has been
4220 manual was updated to use the new files, and setup.py has been
4218 fixed for this setup.
4221 fixed for this setup.
4219
4222
4220 * IPython/PyColorize.py (Parser.usage): made non-executable and
4223 * IPython/PyColorize.py (Parser.usage): made non-executable and
4221 created a pycolor wrapper around it to be included as a script.
4224 created a pycolor wrapper around it to be included as a script.
4222
4225
4223 2003-03-12 *** Released version 0.2.15pre2
4226 2003-03-12 *** Released version 0.2.15pre2
4224
4227
4225 2003-03-12 Fernando Perez <fperez@colorado.edu>
4228 2003-03-12 Fernando Perez <fperez@colorado.edu>
4226
4229
4227 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4230 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4228 long-standing problem with garbage characters in some terminals.
4231 long-standing problem with garbage characters in some terminals.
4229 The issue was really that the \001 and \002 escapes must _only_ be
4232 The issue was really that the \001 and \002 escapes must _only_ be
4230 passed to input prompts (which call readline), but _never_ to
4233 passed to input prompts (which call readline), but _never_ to
4231 normal text to be printed on screen. I changed ColorANSI to have
4234 normal text to be printed on screen. I changed ColorANSI to have
4232 two classes: TermColors and InputTermColors, each with the
4235 two classes: TermColors and InputTermColors, each with the
4233 appropriate escapes for input prompts or normal text. The code in
4236 appropriate escapes for input prompts or normal text. The code in
4234 Prompts.py got slightly more complicated, but this very old and
4237 Prompts.py got slightly more complicated, but this very old and
4235 annoying bug is finally fixed.
4238 annoying bug is finally fixed.
4236
4239
4237 All the credit for nailing down the real origin of this problem
4240 All the credit for nailing down the real origin of this problem
4238 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4241 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4239 *Many* thanks to him for spending quite a bit of effort on this.
4242 *Many* thanks to him for spending quite a bit of effort on this.
4240
4243
4241 2003-03-05 *** Released version 0.2.15pre1
4244 2003-03-05 *** Released version 0.2.15pre1
4242
4245
4243 2003-03-03 Fernando Perez <fperez@colorado.edu>
4246 2003-03-03 Fernando Perez <fperez@colorado.edu>
4244
4247
4245 * IPython/FakeModule.py: Moved the former _FakeModule to a
4248 * IPython/FakeModule.py: Moved the former _FakeModule to a
4246 separate file, because it's also needed by Magic (to fix a similar
4249 separate file, because it's also needed by Magic (to fix a similar
4247 pickle-related issue in @run).
4250 pickle-related issue in @run).
4248
4251
4249 2003-03-02 Fernando Perez <fperez@colorado.edu>
4252 2003-03-02 Fernando Perez <fperez@colorado.edu>
4250
4253
4251 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4254 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4252 the autocall option at runtime.
4255 the autocall option at runtime.
4253 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4256 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4254 across Magic.py to start separating Magic from InteractiveShell.
4257 across Magic.py to start separating Magic from InteractiveShell.
4255 (Magic._ofind): Fixed to return proper namespace for dotted
4258 (Magic._ofind): Fixed to return proper namespace for dotted
4256 names. Before, a dotted name would always return 'not currently
4259 names. Before, a dotted name would always return 'not currently
4257 defined', because it would find the 'parent'. s.x would be found,
4260 defined', because it would find the 'parent'. s.x would be found,
4258 but since 'x' isn't defined by itself, it would get confused.
4261 but since 'x' isn't defined by itself, it would get confused.
4259 (Magic.magic_run): Fixed pickling problems reported by Ralf
4262 (Magic.magic_run): Fixed pickling problems reported by Ralf
4260 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4263 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4261 that I'd used when Mike Heeter reported similar issues at the
4264 that I'd used when Mike Heeter reported similar issues at the
4262 top-level, but now for @run. It boils down to injecting the
4265 top-level, but now for @run. It boils down to injecting the
4263 namespace where code is being executed with something that looks
4266 namespace where code is being executed with something that looks
4264 enough like a module to fool pickle.dump(). Since a pickle stores
4267 enough like a module to fool pickle.dump(). Since a pickle stores
4265 a named reference to the importing module, we need this for
4268 a named reference to the importing module, we need this for
4266 pickles to save something sensible.
4269 pickles to save something sensible.
4267
4270
4268 * IPython/ipmaker.py (make_IPython): added an autocall option.
4271 * IPython/ipmaker.py (make_IPython): added an autocall option.
4269
4272
4270 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4273 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4271 the auto-eval code. Now autocalling is an option, and the code is
4274 the auto-eval code. Now autocalling is an option, and the code is
4272 also vastly safer. There is no more eval() involved at all.
4275 also vastly safer. There is no more eval() involved at all.
4273
4276
4274 2003-03-01 Fernando Perez <fperez@colorado.edu>
4277 2003-03-01 Fernando Perez <fperez@colorado.edu>
4275
4278
4276 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4279 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4277 dict with named keys instead of a tuple.
4280 dict with named keys instead of a tuple.
4278
4281
4279 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4282 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4280
4283
4281 * setup.py (make_shortcut): Fixed message about directories
4284 * setup.py (make_shortcut): Fixed message about directories
4282 created during Windows installation (the directories were ok, just
4285 created during Windows installation (the directories were ok, just
4283 the printed message was misleading). Thanks to Chris Liechti
4286 the printed message was misleading). Thanks to Chris Liechti
4284 <cliechti-AT-gmx.net> for the heads up.
4287 <cliechti-AT-gmx.net> for the heads up.
4285
4288
4286 2003-02-21 Fernando Perez <fperez@colorado.edu>
4289 2003-02-21 Fernando Perez <fperez@colorado.edu>
4287
4290
4288 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4291 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4289 of ValueError exception when checking for auto-execution. This
4292 of ValueError exception when checking for auto-execution. This
4290 one is raised by things like Numeric arrays arr.flat when the
4293 one is raised by things like Numeric arrays arr.flat when the
4291 array is non-contiguous.
4294 array is non-contiguous.
4292
4295
4293 2003-01-31 Fernando Perez <fperez@colorado.edu>
4296 2003-01-31 Fernando Perez <fperez@colorado.edu>
4294
4297
4295 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4298 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4296 not return any value at all (even though the command would get
4299 not return any value at all (even though the command would get
4297 executed).
4300 executed).
4298 (xsys): Flush stdout right after printing the command to ensure
4301 (xsys): Flush stdout right after printing the command to ensure
4299 proper ordering of commands and command output in the total
4302 proper ordering of commands and command output in the total
4300 output.
4303 output.
4301 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4304 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4302 system/getoutput as defaults. The old ones are kept for
4305 system/getoutput as defaults. The old ones are kept for
4303 compatibility reasons, so no code which uses this library needs
4306 compatibility reasons, so no code which uses this library needs
4304 changing.
4307 changing.
4305
4308
4306 2003-01-27 *** Released version 0.2.14
4309 2003-01-27 *** Released version 0.2.14
4307
4310
4308 2003-01-25 Fernando Perez <fperez@colorado.edu>
4311 2003-01-25 Fernando Perez <fperez@colorado.edu>
4309
4312
4310 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4313 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4311 functions defined in previous edit sessions could not be re-edited
4314 functions defined in previous edit sessions could not be re-edited
4312 (because the temp files were immediately removed). Now temp files
4315 (because the temp files were immediately removed). Now temp files
4313 are removed only at IPython's exit.
4316 are removed only at IPython's exit.
4314 (Magic.magic_run): Improved @run to perform shell-like expansions
4317 (Magic.magic_run): Improved @run to perform shell-like expansions
4315 on its arguments (~users and $VARS). With this, @run becomes more
4318 on its arguments (~users and $VARS). With this, @run becomes more
4316 like a normal command-line.
4319 like a normal command-line.
4317
4320
4318 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4321 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4319 bugs related to embedding and cleaned up that code. A fairly
4322 bugs related to embedding and cleaned up that code. A fairly
4320 important one was the impossibility to access the global namespace
4323 important one was the impossibility to access the global namespace
4321 through the embedded IPython (only local variables were visible).
4324 through the embedded IPython (only local variables were visible).
4322
4325
4323 2003-01-14 Fernando Perez <fperez@colorado.edu>
4326 2003-01-14 Fernando Perez <fperez@colorado.edu>
4324
4327
4325 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4328 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4326 auto-calling to be a bit more conservative. Now it doesn't get
4329 auto-calling to be a bit more conservative. Now it doesn't get
4327 triggered if any of '!=()<>' are in the rest of the input line, to
4330 triggered if any of '!=()<>' are in the rest of the input line, to
4328 allow comparing callables. Thanks to Alex for the heads up.
4331 allow comparing callables. Thanks to Alex for the heads up.
4329
4332
4330 2003-01-07 Fernando Perez <fperez@colorado.edu>
4333 2003-01-07 Fernando Perez <fperez@colorado.edu>
4331
4334
4332 * IPython/genutils.py (page): fixed estimation of the number of
4335 * IPython/genutils.py (page): fixed estimation of the number of
4333 lines in a string to be paged to simply count newlines. This
4336 lines in a string to be paged to simply count newlines. This
4334 prevents over-guessing due to embedded escape sequences. A better
4337 prevents over-guessing due to embedded escape sequences. A better
4335 long-term solution would involve stripping out the control chars
4338 long-term solution would involve stripping out the control chars
4336 for the count, but it's potentially so expensive I just don't
4339 for the count, but it's potentially so expensive I just don't
4337 think it's worth doing.
4340 think it's worth doing.
4338
4341
4339 2002-12-19 *** Released version 0.2.14pre50
4342 2002-12-19 *** Released version 0.2.14pre50
4340
4343
4341 2002-12-19 Fernando Perez <fperez@colorado.edu>
4344 2002-12-19 Fernando Perez <fperez@colorado.edu>
4342
4345
4343 * tools/release (version): Changed release scripts to inform
4346 * tools/release (version): Changed release scripts to inform
4344 Andrea and build a NEWS file with a list of recent changes.
4347 Andrea and build a NEWS file with a list of recent changes.
4345
4348
4346 * IPython/ColorANSI.py (__all__): changed terminal detection
4349 * IPython/ColorANSI.py (__all__): changed terminal detection
4347 code. Seems to work better for xterms without breaking
4350 code. Seems to work better for xterms without breaking
4348 konsole. Will need more testing to determine if WinXP and Mac OSX
4351 konsole. Will need more testing to determine if WinXP and Mac OSX
4349 also work ok.
4352 also work ok.
4350
4353
4351 2002-12-18 *** Released version 0.2.14pre49
4354 2002-12-18 *** Released version 0.2.14pre49
4352
4355
4353 2002-12-18 Fernando Perez <fperez@colorado.edu>
4356 2002-12-18 Fernando Perez <fperez@colorado.edu>
4354
4357
4355 * Docs: added new info about Mac OSX, from Andrea.
4358 * Docs: added new info about Mac OSX, from Andrea.
4356
4359
4357 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4360 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4358 allow direct plotting of python strings whose format is the same
4361 allow direct plotting of python strings whose format is the same
4359 of gnuplot data files.
4362 of gnuplot data files.
4360
4363
4361 2002-12-16 Fernando Perez <fperez@colorado.edu>
4364 2002-12-16 Fernando Perez <fperez@colorado.edu>
4362
4365
4363 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4366 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4364 value of exit question to be acknowledged.
4367 value of exit question to be acknowledged.
4365
4368
4366 2002-12-03 Fernando Perez <fperez@colorado.edu>
4369 2002-12-03 Fernando Perez <fperez@colorado.edu>
4367
4370
4368 * IPython/ipmaker.py: removed generators, which had been added
4371 * IPython/ipmaker.py: removed generators, which had been added
4369 by mistake in an earlier debugging run. This was causing trouble
4372 by mistake in an earlier debugging run. This was causing trouble
4370 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4373 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4371 for pointing this out.
4374 for pointing this out.
4372
4375
4373 2002-11-17 Fernando Perez <fperez@colorado.edu>
4376 2002-11-17 Fernando Perez <fperez@colorado.edu>
4374
4377
4375 * Manual: updated the Gnuplot section.
4378 * Manual: updated the Gnuplot section.
4376
4379
4377 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4380 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4378 a much better split of what goes in Runtime and what goes in
4381 a much better split of what goes in Runtime and what goes in
4379 Interactive.
4382 Interactive.
4380
4383
4381 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4384 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4382 being imported from iplib.
4385 being imported from iplib.
4383
4386
4384 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4387 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4385 for command-passing. Now the global Gnuplot instance is called
4388 for command-passing. Now the global Gnuplot instance is called
4386 'gp' instead of 'g', which was really a far too fragile and
4389 'gp' instead of 'g', which was really a far too fragile and
4387 common name.
4390 common name.
4388
4391
4389 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4392 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4390 bounding boxes generated by Gnuplot for square plots.
4393 bounding boxes generated by Gnuplot for square plots.
4391
4394
4392 * IPython/genutils.py (popkey): new function added. I should
4395 * IPython/genutils.py (popkey): new function added. I should
4393 suggest this on c.l.py as a dict method, it seems useful.
4396 suggest this on c.l.py as a dict method, it seems useful.
4394
4397
4395 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4398 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4396 to transparently handle PostScript generation. MUCH better than
4399 to transparently handle PostScript generation. MUCH better than
4397 the previous plot_eps/replot_eps (which I removed now). The code
4400 the previous plot_eps/replot_eps (which I removed now). The code
4398 is also fairly clean and well documented now (including
4401 is also fairly clean and well documented now (including
4399 docstrings).
4402 docstrings).
4400
4403
4401 2002-11-13 Fernando Perez <fperez@colorado.edu>
4404 2002-11-13 Fernando Perez <fperez@colorado.edu>
4402
4405
4403 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4406 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4404 (inconsistent with options).
4407 (inconsistent with options).
4405
4408
4406 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4409 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4407 manually disabled, I don't know why. Fixed it.
4410 manually disabled, I don't know why. Fixed it.
4408 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4411 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4409 eps output.
4412 eps output.
4410
4413
4411 2002-11-12 Fernando Perez <fperez@colorado.edu>
4414 2002-11-12 Fernando Perez <fperez@colorado.edu>
4412
4415
4413 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4416 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4414 don't propagate up to caller. Fixes crash reported by François
4417 don't propagate up to caller. Fixes crash reported by François
4415 Pinard.
4418 Pinard.
4416
4419
4417 2002-11-09 Fernando Perez <fperez@colorado.edu>
4420 2002-11-09 Fernando Perez <fperez@colorado.edu>
4418
4421
4419 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4422 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4420 history file for new users.
4423 history file for new users.
4421 (make_IPython): fixed bug where initial install would leave the
4424 (make_IPython): fixed bug where initial install would leave the
4422 user running in the .ipython dir.
4425 user running in the .ipython dir.
4423 (make_IPython): fixed bug where config dir .ipython would be
4426 (make_IPython): fixed bug where config dir .ipython would be
4424 created regardless of the given -ipythondir option. Thanks to Cory
4427 created regardless of the given -ipythondir option. Thanks to Cory
4425 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4428 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4426
4429
4427 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4430 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4428 type confirmations. Will need to use it in all of IPython's code
4431 type confirmations. Will need to use it in all of IPython's code
4429 consistently.
4432 consistently.
4430
4433
4431 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4434 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4432 context to print 31 lines instead of the default 5. This will make
4435 context to print 31 lines instead of the default 5. This will make
4433 the crash reports extremely detailed in case the problem is in
4436 the crash reports extremely detailed in case the problem is in
4434 libraries I don't have access to.
4437 libraries I don't have access to.
4435
4438
4436 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4439 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4437 line of defense' code to still crash, but giving users fair
4440 line of defense' code to still crash, but giving users fair
4438 warning. I don't want internal errors to go unreported: if there's
4441 warning. I don't want internal errors to go unreported: if there's
4439 an internal problem, IPython should crash and generate a full
4442 an internal problem, IPython should crash and generate a full
4440 report.
4443 report.
4441
4444
4442 2002-11-08 Fernando Perez <fperez@colorado.edu>
4445 2002-11-08 Fernando Perez <fperez@colorado.edu>
4443
4446
4444 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4447 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4445 otherwise uncaught exceptions which can appear if people set
4448 otherwise uncaught exceptions which can appear if people set
4446 sys.stdout to something badly broken. Thanks to a crash report
4449 sys.stdout to something badly broken. Thanks to a crash report
4447 from henni-AT-mail.brainbot.com.
4450 from henni-AT-mail.brainbot.com.
4448
4451
4449 2002-11-04 Fernando Perez <fperez@colorado.edu>
4452 2002-11-04 Fernando Perez <fperez@colorado.edu>
4450
4453
4451 * IPython/iplib.py (InteractiveShell.interact): added
4454 * IPython/iplib.py (InteractiveShell.interact): added
4452 __IPYTHON__active to the builtins. It's a flag which goes on when
4455 __IPYTHON__active to the builtins. It's a flag which goes on when
4453 the interaction starts and goes off again when it stops. This
4456 the interaction starts and goes off again when it stops. This
4454 allows embedding code to detect being inside IPython. Before this
4457 allows embedding code to detect being inside IPython. Before this
4455 was done via __IPYTHON__, but that only shows that an IPython
4458 was done via __IPYTHON__, but that only shows that an IPython
4456 instance has been created.
4459 instance has been created.
4457
4460
4458 * IPython/Magic.py (Magic.magic_env): I realized that in a
4461 * IPython/Magic.py (Magic.magic_env): I realized that in a
4459 UserDict, instance.data holds the data as a normal dict. So I
4462 UserDict, instance.data holds the data as a normal dict. So I
4460 modified @env to return os.environ.data instead of rebuilding a
4463 modified @env to return os.environ.data instead of rebuilding a
4461 dict by hand.
4464 dict by hand.
4462
4465
4463 2002-11-02 Fernando Perez <fperez@colorado.edu>
4466 2002-11-02 Fernando Perez <fperez@colorado.edu>
4464
4467
4465 * IPython/genutils.py (warn): changed so that level 1 prints no
4468 * IPython/genutils.py (warn): changed so that level 1 prints no
4466 header. Level 2 is now the default (with 'WARNING' header, as
4469 header. Level 2 is now the default (with 'WARNING' header, as
4467 before). I think I tracked all places where changes were needed in
4470 before). I think I tracked all places where changes were needed in
4468 IPython, but outside code using the old level numbering may have
4471 IPython, but outside code using the old level numbering may have
4469 broken.
4472 broken.
4470
4473
4471 * IPython/iplib.py (InteractiveShell.runcode): added this to
4474 * IPython/iplib.py (InteractiveShell.runcode): added this to
4472 handle the tracebacks in SystemExit traps correctly. The previous
4475 handle the tracebacks in SystemExit traps correctly. The previous
4473 code (through interact) was printing more of the stack than
4476 code (through interact) was printing more of the stack than
4474 necessary, showing IPython internal code to the user.
4477 necessary, showing IPython internal code to the user.
4475
4478
4476 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4479 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4477 default. Now that the default at the confirmation prompt is yes,
4480 default. Now that the default at the confirmation prompt is yes,
4478 it's not so intrusive. François' argument that ipython sessions
4481 it's not so intrusive. François' argument that ipython sessions
4479 tend to be complex enough not to lose them from an accidental C-d,
4482 tend to be complex enough not to lose them from an accidental C-d,
4480 is a valid one.
4483 is a valid one.
4481
4484
4482 * IPython/iplib.py (InteractiveShell.interact): added a
4485 * IPython/iplib.py (InteractiveShell.interact): added a
4483 showtraceback() call to the SystemExit trap, and modified the exit
4486 showtraceback() call to the SystemExit trap, and modified the exit
4484 confirmation to have yes as the default.
4487 confirmation to have yes as the default.
4485
4488
4486 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4489 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4487 this file. It's been gone from the code for a long time, this was
4490 this file. It's been gone from the code for a long time, this was
4488 simply leftover junk.
4491 simply leftover junk.
4489
4492
4490 2002-11-01 Fernando Perez <fperez@colorado.edu>
4493 2002-11-01 Fernando Perez <fperez@colorado.edu>
4491
4494
4492 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4495 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4493 added. If set, IPython now traps EOF and asks for
4496 added. If set, IPython now traps EOF and asks for
4494 confirmation. After a request by François Pinard.
4497 confirmation. After a request by François Pinard.
4495
4498
4496 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4499 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4497 of @abort, and with a new (better) mechanism for handling the
4500 of @abort, and with a new (better) mechanism for handling the
4498 exceptions.
4501 exceptions.
4499
4502
4500 2002-10-27 Fernando Perez <fperez@colorado.edu>
4503 2002-10-27 Fernando Perez <fperez@colorado.edu>
4501
4504
4502 * IPython/usage.py (__doc__): updated the --help information and
4505 * IPython/usage.py (__doc__): updated the --help information and
4503 the ipythonrc file to indicate that -log generates
4506 the ipythonrc file to indicate that -log generates
4504 ./ipython.log. Also fixed the corresponding info in @logstart.
4507 ./ipython.log. Also fixed the corresponding info in @logstart.
4505 This and several other fixes in the manuals thanks to reports by
4508 This and several other fixes in the manuals thanks to reports by
4506 François Pinard <pinard-AT-iro.umontreal.ca>.
4509 François Pinard <pinard-AT-iro.umontreal.ca>.
4507
4510
4508 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4511 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4509 refer to @logstart (instead of @log, which doesn't exist).
4512 refer to @logstart (instead of @log, which doesn't exist).
4510
4513
4511 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4514 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4512 AttributeError crash. Thanks to Christopher Armstrong
4515 AttributeError crash. Thanks to Christopher Armstrong
4513 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4516 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4514 introduced recently (in 0.2.14pre37) with the fix to the eval
4517 introduced recently (in 0.2.14pre37) with the fix to the eval
4515 problem mentioned below.
4518 problem mentioned below.
4516
4519
4517 2002-10-17 Fernando Perez <fperez@colorado.edu>
4520 2002-10-17 Fernando Perez <fperez@colorado.edu>
4518
4521
4519 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4522 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4520 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4523 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4521
4524
4522 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4525 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4523 this function to fix a problem reported by Alex Schmolck. He saw
4526 this function to fix a problem reported by Alex Schmolck. He saw
4524 it with list comprehensions and generators, which were getting
4527 it with list comprehensions and generators, which were getting
4525 called twice. The real problem was an 'eval' call in testing for
4528 called twice. The real problem was an 'eval' call in testing for
4526 automagic which was evaluating the input line silently.
4529 automagic which was evaluating the input line silently.
4527
4530
4528 This is a potentially very nasty bug, if the input has side
4531 This is a potentially very nasty bug, if the input has side
4529 effects which must not be repeated. The code is much cleaner now,
4532 effects which must not be repeated. The code is much cleaner now,
4530 without any blanket 'except' left and with a regexp test for
4533 without any blanket 'except' left and with a regexp test for
4531 actual function names.
4534 actual function names.
4532
4535
4533 But an eval remains, which I'm not fully comfortable with. I just
4536 But an eval remains, which I'm not fully comfortable with. I just
4534 don't know how to find out if an expression could be a callable in
4537 don't know how to find out if an expression could be a callable in
4535 the user's namespace without doing an eval on the string. However
4538 the user's namespace without doing an eval on the string. However
4536 that string is now much more strictly checked so that no code
4539 that string is now much more strictly checked so that no code
4537 slips by, so the eval should only happen for things that can
4540 slips by, so the eval should only happen for things that can
4538 really be only function/method names.
4541 really be only function/method names.
4539
4542
4540 2002-10-15 Fernando Perez <fperez@colorado.edu>
4543 2002-10-15 Fernando Perez <fperez@colorado.edu>
4541
4544
4542 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4545 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4543 OSX information to main manual, removed README_Mac_OSX file from
4546 OSX information to main manual, removed README_Mac_OSX file from
4544 distribution. Also updated credits for recent additions.
4547 distribution. Also updated credits for recent additions.
4545
4548
4546 2002-10-10 Fernando Perez <fperez@colorado.edu>
4549 2002-10-10 Fernando Perez <fperez@colorado.edu>
4547
4550
4548 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4551 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4549 terminal-related issues. Many thanks to Andrea Riciputi
4552 terminal-related issues. Many thanks to Andrea Riciputi
4550 <andrea.riciputi-AT-libero.it> for writing it.
4553 <andrea.riciputi-AT-libero.it> for writing it.
4551
4554
4552 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4555 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4553 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4556 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4554
4557
4555 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4558 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4556 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4559 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4557 <syver-en-AT-online.no> who both submitted patches for this problem.
4560 <syver-en-AT-online.no> who both submitted patches for this problem.
4558
4561
4559 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4562 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4560 global embedding to make sure that things don't overwrite user
4563 global embedding to make sure that things don't overwrite user
4561 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4564 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4562
4565
4563 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4566 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4564 compatibility. Thanks to Hayden Callow
4567 compatibility. Thanks to Hayden Callow
4565 <h.callow-AT-elec.canterbury.ac.nz>
4568 <h.callow-AT-elec.canterbury.ac.nz>
4566
4569
4567 2002-10-04 Fernando Perez <fperez@colorado.edu>
4570 2002-10-04 Fernando Perez <fperez@colorado.edu>
4568
4571
4569 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4572 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4570 Gnuplot.File objects.
4573 Gnuplot.File objects.
4571
4574
4572 2002-07-23 Fernando Perez <fperez@colorado.edu>
4575 2002-07-23 Fernando Perez <fperez@colorado.edu>
4573
4576
4574 * IPython/genutils.py (timing): Added timings() and timing() for
4577 * IPython/genutils.py (timing): Added timings() and timing() for
4575 quick access to the most commonly needed data, the execution
4578 quick access to the most commonly needed data, the execution
4576 times. Old timing() renamed to timings_out().
4579 times. Old timing() renamed to timings_out().
4577
4580
4578 2002-07-18 Fernando Perez <fperez@colorado.edu>
4581 2002-07-18 Fernando Perez <fperez@colorado.edu>
4579
4582
4580 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4583 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4581 bug with nested instances disrupting the parent's tab completion.
4584 bug with nested instances disrupting the parent's tab completion.
4582
4585
4583 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4586 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4584 all_completions code to begin the emacs integration.
4587 all_completions code to begin the emacs integration.
4585
4588
4586 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4589 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4587 argument to allow titling individual arrays when plotting.
4590 argument to allow titling individual arrays when plotting.
4588
4591
4589 2002-07-15 Fernando Perez <fperez@colorado.edu>
4592 2002-07-15 Fernando Perez <fperez@colorado.edu>
4590
4593
4591 * setup.py (make_shortcut): changed to retrieve the value of
4594 * setup.py (make_shortcut): changed to retrieve the value of
4592 'Program Files' directory from the registry (this value changes in
4595 'Program Files' directory from the registry (this value changes in
4593 non-english versions of Windows). Thanks to Thomas Fanslau
4596 non-english versions of Windows). Thanks to Thomas Fanslau
4594 <tfanslau-AT-gmx.de> for the report.
4597 <tfanslau-AT-gmx.de> for the report.
4595
4598
4596 2002-07-10 Fernando Perez <fperez@colorado.edu>
4599 2002-07-10 Fernando Perez <fperez@colorado.edu>
4597
4600
4598 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4601 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4599 a bug in pdb, which crashes if a line with only whitespace is
4602 a bug in pdb, which crashes if a line with only whitespace is
4600 entered. Bug report submitted to sourceforge.
4603 entered. Bug report submitted to sourceforge.
4601
4604
4602 2002-07-09 Fernando Perez <fperez@colorado.edu>
4605 2002-07-09 Fernando Perez <fperez@colorado.edu>
4603
4606
4604 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4607 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4605 reporting exceptions (it's a bug in inspect.py, I just set a
4608 reporting exceptions (it's a bug in inspect.py, I just set a
4606 workaround).
4609 workaround).
4607
4610
4608 2002-07-08 Fernando Perez <fperez@colorado.edu>
4611 2002-07-08 Fernando Perez <fperez@colorado.edu>
4609
4612
4610 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4613 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4611 __IPYTHON__ in __builtins__ to show up in user_ns.
4614 __IPYTHON__ in __builtins__ to show up in user_ns.
4612
4615
4613 2002-07-03 Fernando Perez <fperez@colorado.edu>
4616 2002-07-03 Fernando Perez <fperez@colorado.edu>
4614
4617
4615 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4618 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4616 name from @gp_set_instance to @gp_set_default.
4619 name from @gp_set_instance to @gp_set_default.
4617
4620
4618 * IPython/ipmaker.py (make_IPython): default editor value set to
4621 * IPython/ipmaker.py (make_IPython): default editor value set to
4619 '0' (a string), to match the rc file. Otherwise will crash when
4622 '0' (a string), to match the rc file. Otherwise will crash when
4620 .strip() is called on it.
4623 .strip() is called on it.
4621
4624
4622
4625
4623 2002-06-28 Fernando Perez <fperez@colorado.edu>
4626 2002-06-28 Fernando Perez <fperez@colorado.edu>
4624
4627
4625 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4628 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4626 of files in current directory when a file is executed via
4629 of files in current directory when a file is executed via
4627 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4630 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4628
4631
4629 * setup.py (manfiles): fix for rpm builds, submitted by RA
4632 * setup.py (manfiles): fix for rpm builds, submitted by RA
4630 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4633 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4631
4634
4632 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4635 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4633 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4636 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4634 string!). A. Schmolck caught this one.
4637 string!). A. Schmolck caught this one.
4635
4638
4636 2002-06-27 Fernando Perez <fperez@colorado.edu>
4639 2002-06-27 Fernando Perez <fperez@colorado.edu>
4637
4640
4638 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4641 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4639 defined files at the cmd line. __name__ wasn't being set to
4642 defined files at the cmd line. __name__ wasn't being set to
4640 __main__.
4643 __main__.
4641
4644
4642 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4645 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4643 regular lists and tuples besides Numeric arrays.
4646 regular lists and tuples besides Numeric arrays.
4644
4647
4645 * IPython/Prompts.py (CachedOutput.__call__): Added output
4648 * IPython/Prompts.py (CachedOutput.__call__): Added output
4646 supression for input ending with ';'. Similar to Mathematica and
4649 supression for input ending with ';'. Similar to Mathematica and
4647 Matlab. The _* vars and Out[] list are still updated, just like
4650 Matlab. The _* vars and Out[] list are still updated, just like
4648 Mathematica behaves.
4651 Mathematica behaves.
4649
4652
4650 2002-06-25 Fernando Perez <fperez@colorado.edu>
4653 2002-06-25 Fernando Perez <fperez@colorado.edu>
4651
4654
4652 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4655 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4653 .ini extensions for profiels under Windows.
4656 .ini extensions for profiels under Windows.
4654
4657
4655 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4658 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4656 string form. Fix contributed by Alexander Schmolck
4659 string form. Fix contributed by Alexander Schmolck
4657 <a.schmolck-AT-gmx.net>
4660 <a.schmolck-AT-gmx.net>
4658
4661
4659 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4662 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4660 pre-configured Gnuplot instance.
4663 pre-configured Gnuplot instance.
4661
4664
4662 2002-06-21 Fernando Perez <fperez@colorado.edu>
4665 2002-06-21 Fernando Perez <fperez@colorado.edu>
4663
4666
4664 * IPython/numutils.py (exp_safe): new function, works around the
4667 * IPython/numutils.py (exp_safe): new function, works around the
4665 underflow problems in Numeric.
4668 underflow problems in Numeric.
4666 (log2): New fn. Safe log in base 2: returns exact integer answer
4669 (log2): New fn. Safe log in base 2: returns exact integer answer
4667 for exact integer powers of 2.
4670 for exact integer powers of 2.
4668
4671
4669 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4672 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4670 properly.
4673 properly.
4671
4674
4672 2002-06-20 Fernando Perez <fperez@colorado.edu>
4675 2002-06-20 Fernando Perez <fperez@colorado.edu>
4673
4676
4674 * IPython/genutils.py (timing): new function like
4677 * IPython/genutils.py (timing): new function like
4675 Mathematica's. Similar to time_test, but returns more info.
4678 Mathematica's. Similar to time_test, but returns more info.
4676
4679
4677 2002-06-18 Fernando Perez <fperez@colorado.edu>
4680 2002-06-18 Fernando Perez <fperez@colorado.edu>
4678
4681
4679 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4682 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4680 according to Mike Heeter's suggestions.
4683 according to Mike Heeter's suggestions.
4681
4684
4682 2002-06-16 Fernando Perez <fperez@colorado.edu>
4685 2002-06-16 Fernando Perez <fperez@colorado.edu>
4683
4686
4684 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4687 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4685 system. GnuplotMagic is gone as a user-directory option. New files
4688 system. GnuplotMagic is gone as a user-directory option. New files
4686 make it easier to use all the gnuplot stuff both from external
4689 make it easier to use all the gnuplot stuff both from external
4687 programs as well as from IPython. Had to rewrite part of
4690 programs as well as from IPython. Had to rewrite part of
4688 hardcopy() b/c of a strange bug: often the ps files simply don't
4691 hardcopy() b/c of a strange bug: often the ps files simply don't
4689 get created, and require a repeat of the command (often several
4692 get created, and require a repeat of the command (often several
4690 times).
4693 times).
4691
4694
4692 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4695 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4693 resolve output channel at call time, so that if sys.stderr has
4696 resolve output channel at call time, so that if sys.stderr has
4694 been redirected by user this gets honored.
4697 been redirected by user this gets honored.
4695
4698
4696 2002-06-13 Fernando Perez <fperez@colorado.edu>
4699 2002-06-13 Fernando Perez <fperez@colorado.edu>
4697
4700
4698 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4701 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4699 IPShell. Kept a copy with the old names to avoid breaking people's
4702 IPShell. Kept a copy with the old names to avoid breaking people's
4700 embedded code.
4703 embedded code.
4701
4704
4702 * IPython/ipython: simplified it to the bare minimum after
4705 * IPython/ipython: simplified it to the bare minimum after
4703 Holger's suggestions. Added info about how to use it in
4706 Holger's suggestions. Added info about how to use it in
4704 PYTHONSTARTUP.
4707 PYTHONSTARTUP.
4705
4708
4706 * IPython/Shell.py (IPythonShell): changed the options passing
4709 * IPython/Shell.py (IPythonShell): changed the options passing
4707 from a string with funky %s replacements to a straight list. Maybe
4710 from a string with funky %s replacements to a straight list. Maybe
4708 a bit more typing, but it follows sys.argv conventions, so there's
4711 a bit more typing, but it follows sys.argv conventions, so there's
4709 less special-casing to remember.
4712 less special-casing to remember.
4710
4713
4711 2002-06-12 Fernando Perez <fperez@colorado.edu>
4714 2002-06-12 Fernando Perez <fperez@colorado.edu>
4712
4715
4713 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4716 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4714 command. Thanks to a suggestion by Mike Heeter.
4717 command. Thanks to a suggestion by Mike Heeter.
4715 (Magic.magic_pfile): added behavior to look at filenames if given
4718 (Magic.magic_pfile): added behavior to look at filenames if given
4716 arg is not a defined object.
4719 arg is not a defined object.
4717 (Magic.magic_save): New @save function to save code snippets. Also
4720 (Magic.magic_save): New @save function to save code snippets. Also
4718 a Mike Heeter idea.
4721 a Mike Heeter idea.
4719
4722
4720 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4723 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4721 plot() and replot(). Much more convenient now, especially for
4724 plot() and replot(). Much more convenient now, especially for
4722 interactive use.
4725 interactive use.
4723
4726
4724 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4727 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4725 filenames.
4728 filenames.
4726
4729
4727 2002-06-02 Fernando Perez <fperez@colorado.edu>
4730 2002-06-02 Fernando Perez <fperez@colorado.edu>
4728
4731
4729 * IPython/Struct.py (Struct.__init__): modified to admit
4732 * IPython/Struct.py (Struct.__init__): modified to admit
4730 initialization via another struct.
4733 initialization via another struct.
4731
4734
4732 * IPython/genutils.py (SystemExec.__init__): New stateful
4735 * IPython/genutils.py (SystemExec.__init__): New stateful
4733 interface to xsys and bq. Useful for writing system scripts.
4736 interface to xsys and bq. Useful for writing system scripts.
4734
4737
4735 2002-05-30 Fernando Perez <fperez@colorado.edu>
4738 2002-05-30 Fernando Perez <fperez@colorado.edu>
4736
4739
4737 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4740 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4738 documents. This will make the user download smaller (it's getting
4741 documents. This will make the user download smaller (it's getting
4739 too big).
4742 too big).
4740
4743
4741 2002-05-29 Fernando Perez <fperez@colorado.edu>
4744 2002-05-29 Fernando Perez <fperez@colorado.edu>
4742
4745
4743 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4746 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4744 fix problems with shelve and pickle. Seems to work, but I don't
4747 fix problems with shelve and pickle. Seems to work, but I don't
4745 know if corner cases break it. Thanks to Mike Heeter
4748 know if corner cases break it. Thanks to Mike Heeter
4746 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4749 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4747
4750
4748 2002-05-24 Fernando Perez <fperez@colorado.edu>
4751 2002-05-24 Fernando Perez <fperez@colorado.edu>
4749
4752
4750 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4753 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4751 macros having broken.
4754 macros having broken.
4752
4755
4753 2002-05-21 Fernando Perez <fperez@colorado.edu>
4756 2002-05-21 Fernando Perez <fperez@colorado.edu>
4754
4757
4755 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4758 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4756 introduced logging bug: all history before logging started was
4759 introduced logging bug: all history before logging started was
4757 being written one character per line! This came from the redesign
4760 being written one character per line! This came from the redesign
4758 of the input history as a special list which slices to strings,
4761 of the input history as a special list which slices to strings,
4759 not to lists.
4762 not to lists.
4760
4763
4761 2002-05-20 Fernando Perez <fperez@colorado.edu>
4764 2002-05-20 Fernando Perez <fperez@colorado.edu>
4762
4765
4763 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4766 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4764 be an attribute of all classes in this module. The design of these
4767 be an attribute of all classes in this module. The design of these
4765 classes needs some serious overhauling.
4768 classes needs some serious overhauling.
4766
4769
4767 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4770 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4768 which was ignoring '_' in option names.
4771 which was ignoring '_' in option names.
4769
4772
4770 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4773 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4771 'Verbose_novars' to 'Context' and made it the new default. It's a
4774 'Verbose_novars' to 'Context' and made it the new default. It's a
4772 bit more readable and also safer than verbose.
4775 bit more readable and also safer than verbose.
4773
4776
4774 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4777 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4775 triple-quoted strings.
4778 triple-quoted strings.
4776
4779
4777 * IPython/OInspect.py (__all__): new module exposing the object
4780 * IPython/OInspect.py (__all__): new module exposing the object
4778 introspection facilities. Now the corresponding magics are dummy
4781 introspection facilities. Now the corresponding magics are dummy
4779 wrappers around this. Having this module will make it much easier
4782 wrappers around this. Having this module will make it much easier
4780 to put these functions into our modified pdb.
4783 to put these functions into our modified pdb.
4781 This new object inspector system uses the new colorizing module,
4784 This new object inspector system uses the new colorizing module,
4782 so source code and other things are nicely syntax highlighted.
4785 so source code and other things are nicely syntax highlighted.
4783
4786
4784 2002-05-18 Fernando Perez <fperez@colorado.edu>
4787 2002-05-18 Fernando Perez <fperez@colorado.edu>
4785
4788
4786 * IPython/ColorANSI.py: Split the coloring tools into a separate
4789 * IPython/ColorANSI.py: Split the coloring tools into a separate
4787 module so I can use them in other code easier (they were part of
4790 module so I can use them in other code easier (they were part of
4788 ultraTB).
4791 ultraTB).
4789
4792
4790 2002-05-17 Fernando Perez <fperez@colorado.edu>
4793 2002-05-17 Fernando Perez <fperez@colorado.edu>
4791
4794
4792 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4795 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4793 fixed it to set the global 'g' also to the called instance, as
4796 fixed it to set the global 'g' also to the called instance, as
4794 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4797 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4795 user's 'g' variables).
4798 user's 'g' variables).
4796
4799
4797 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4800 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4798 global variables (aliases to _ih,_oh) so that users which expect
4801 global variables (aliases to _ih,_oh) so that users which expect
4799 In[5] or Out[7] to work aren't unpleasantly surprised.
4802 In[5] or Out[7] to work aren't unpleasantly surprised.
4800 (InputList.__getslice__): new class to allow executing slices of
4803 (InputList.__getslice__): new class to allow executing slices of
4801 input history directly. Very simple class, complements the use of
4804 input history directly. Very simple class, complements the use of
4802 macros.
4805 macros.
4803
4806
4804 2002-05-16 Fernando Perez <fperez@colorado.edu>
4807 2002-05-16 Fernando Perez <fperez@colorado.edu>
4805
4808
4806 * setup.py (docdirbase): make doc directory be just doc/IPython
4809 * setup.py (docdirbase): make doc directory be just doc/IPython
4807 without version numbers, it will reduce clutter for users.
4810 without version numbers, it will reduce clutter for users.
4808
4811
4809 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4812 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4810 execfile call to prevent possible memory leak. See for details:
4813 execfile call to prevent possible memory leak. See for details:
4811 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4814 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4812
4815
4813 2002-05-15 Fernando Perez <fperez@colorado.edu>
4816 2002-05-15 Fernando Perez <fperez@colorado.edu>
4814
4817
4815 * IPython/Magic.py (Magic.magic_psource): made the object
4818 * IPython/Magic.py (Magic.magic_psource): made the object
4816 introspection names be more standard: pdoc, pdef, pfile and
4819 introspection names be more standard: pdoc, pdef, pfile and
4817 psource. They all print/page their output, and it makes
4820 psource. They all print/page their output, and it makes
4818 remembering them easier. Kept old names for compatibility as
4821 remembering them easier. Kept old names for compatibility as
4819 aliases.
4822 aliases.
4820
4823
4821 2002-05-14 Fernando Perez <fperez@colorado.edu>
4824 2002-05-14 Fernando Perez <fperez@colorado.edu>
4822
4825
4823 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4826 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4824 what the mouse problem was. The trick is to use gnuplot with temp
4827 what the mouse problem was. The trick is to use gnuplot with temp
4825 files and NOT with pipes (for data communication), because having
4828 files and NOT with pipes (for data communication), because having
4826 both pipes and the mouse on is bad news.
4829 both pipes and the mouse on is bad news.
4827
4830
4828 2002-05-13 Fernando Perez <fperez@colorado.edu>
4831 2002-05-13 Fernando Perez <fperez@colorado.edu>
4829
4832
4830 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4833 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4831 bug. Information would be reported about builtins even when
4834 bug. Information would be reported about builtins even when
4832 user-defined functions overrode them.
4835 user-defined functions overrode them.
4833
4836
4834 2002-05-11 Fernando Perez <fperez@colorado.edu>
4837 2002-05-11 Fernando Perez <fperez@colorado.edu>
4835
4838
4836 * IPython/__init__.py (__all__): removed FlexCompleter from
4839 * IPython/__init__.py (__all__): removed FlexCompleter from
4837 __all__ so that things don't fail in platforms without readline.
4840 __all__ so that things don't fail in platforms without readline.
4838
4841
4839 2002-05-10 Fernando Perez <fperez@colorado.edu>
4842 2002-05-10 Fernando Perez <fperez@colorado.edu>
4840
4843
4841 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4844 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4842 it requires Numeric, effectively making Numeric a dependency for
4845 it requires Numeric, effectively making Numeric a dependency for
4843 IPython.
4846 IPython.
4844
4847
4845 * Released 0.2.13
4848 * Released 0.2.13
4846
4849
4847 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4850 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4848 profiler interface. Now all the major options from the profiler
4851 profiler interface. Now all the major options from the profiler
4849 module are directly supported in IPython, both for single
4852 module are directly supported in IPython, both for single
4850 expressions (@prun) and for full programs (@run -p).
4853 expressions (@prun) and for full programs (@run -p).
4851
4854
4852 2002-05-09 Fernando Perez <fperez@colorado.edu>
4855 2002-05-09 Fernando Perez <fperez@colorado.edu>
4853
4856
4854 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4857 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4855 magic properly formatted for screen.
4858 magic properly formatted for screen.
4856
4859
4857 * setup.py (make_shortcut): Changed things to put pdf version in
4860 * setup.py (make_shortcut): Changed things to put pdf version in
4858 doc/ instead of doc/manual (had to change lyxport a bit).
4861 doc/ instead of doc/manual (had to change lyxport a bit).
4859
4862
4860 * IPython/Magic.py (Profile.string_stats): made profile runs go
4863 * IPython/Magic.py (Profile.string_stats): made profile runs go
4861 through pager (they are long and a pager allows searching, saving,
4864 through pager (they are long and a pager allows searching, saving,
4862 etc.)
4865 etc.)
4863
4866
4864 2002-05-08 Fernando Perez <fperez@colorado.edu>
4867 2002-05-08 Fernando Perez <fperez@colorado.edu>
4865
4868
4866 * Released 0.2.12
4869 * Released 0.2.12
4867
4870
4868 2002-05-06 Fernando Perez <fperez@colorado.edu>
4871 2002-05-06 Fernando Perez <fperez@colorado.edu>
4869
4872
4870 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4873 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4871 introduced); 'hist n1 n2' was broken.
4874 introduced); 'hist n1 n2' was broken.
4872 (Magic.magic_pdb): added optional on/off arguments to @pdb
4875 (Magic.magic_pdb): added optional on/off arguments to @pdb
4873 (Magic.magic_run): added option -i to @run, which executes code in
4876 (Magic.magic_run): added option -i to @run, which executes code in
4874 the IPython namespace instead of a clean one. Also added @irun as
4877 the IPython namespace instead of a clean one. Also added @irun as
4875 an alias to @run -i.
4878 an alias to @run -i.
4876
4879
4877 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4880 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4878 fixed (it didn't really do anything, the namespaces were wrong).
4881 fixed (it didn't really do anything, the namespaces were wrong).
4879
4882
4880 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4883 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4881
4884
4882 * IPython/__init__.py (__all__): Fixed package namespace, now
4885 * IPython/__init__.py (__all__): Fixed package namespace, now
4883 'import IPython' does give access to IPython.<all> as
4886 'import IPython' does give access to IPython.<all> as
4884 expected. Also renamed __release__ to Release.
4887 expected. Also renamed __release__ to Release.
4885
4888
4886 * IPython/Debugger.py (__license__): created new Pdb class which
4889 * IPython/Debugger.py (__license__): created new Pdb class which
4887 functions like a drop-in for the normal pdb.Pdb but does NOT
4890 functions like a drop-in for the normal pdb.Pdb but does NOT
4888 import readline by default. This way it doesn't muck up IPython's
4891 import readline by default. This way it doesn't muck up IPython's
4889 readline handling, and now tab-completion finally works in the
4892 readline handling, and now tab-completion finally works in the
4890 debugger -- sort of. It completes things globally visible, but the
4893 debugger -- sort of. It completes things globally visible, but the
4891 completer doesn't track the stack as pdb walks it. That's a bit
4894 completer doesn't track the stack as pdb walks it. That's a bit
4892 tricky, and I'll have to implement it later.
4895 tricky, and I'll have to implement it later.
4893
4896
4894 2002-05-05 Fernando Perez <fperez@colorado.edu>
4897 2002-05-05 Fernando Perez <fperez@colorado.edu>
4895
4898
4896 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4899 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4897 magic docstrings when printed via ? (explicit \'s were being
4900 magic docstrings when printed via ? (explicit \'s were being
4898 printed).
4901 printed).
4899
4902
4900 * IPython/ipmaker.py (make_IPython): fixed namespace
4903 * IPython/ipmaker.py (make_IPython): fixed namespace
4901 identification bug. Now variables loaded via logs or command-line
4904 identification bug. Now variables loaded via logs or command-line
4902 files are recognized in the interactive namespace by @who.
4905 files are recognized in the interactive namespace by @who.
4903
4906
4904 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4907 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4905 log replay system stemming from the string form of Structs.
4908 log replay system stemming from the string form of Structs.
4906
4909
4907 * IPython/Magic.py (Macro.__init__): improved macros to properly
4910 * IPython/Magic.py (Macro.__init__): improved macros to properly
4908 handle magic commands in them.
4911 handle magic commands in them.
4909 (Magic.magic_logstart): usernames are now expanded so 'logstart
4912 (Magic.magic_logstart): usernames are now expanded so 'logstart
4910 ~/mylog' now works.
4913 ~/mylog' now works.
4911
4914
4912 * IPython/iplib.py (complete): fixed bug where paths starting with
4915 * IPython/iplib.py (complete): fixed bug where paths starting with
4913 '/' would be completed as magic names.
4916 '/' would be completed as magic names.
4914
4917
4915 2002-05-04 Fernando Perez <fperez@colorado.edu>
4918 2002-05-04 Fernando Perez <fperez@colorado.edu>
4916
4919
4917 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4920 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4918 allow running full programs under the profiler's control.
4921 allow running full programs under the profiler's control.
4919
4922
4920 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4923 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4921 mode to report exceptions verbosely but without formatting
4924 mode to report exceptions verbosely but without formatting
4922 variables. This addresses the issue of ipython 'freezing' (it's
4925 variables. This addresses the issue of ipython 'freezing' (it's
4923 not frozen, but caught in an expensive formatting loop) when huge
4926 not frozen, but caught in an expensive formatting loop) when huge
4924 variables are in the context of an exception.
4927 variables are in the context of an exception.
4925 (VerboseTB.text): Added '--->' markers at line where exception was
4928 (VerboseTB.text): Added '--->' markers at line where exception was
4926 triggered. Much clearer to read, especially in NoColor modes.
4929 triggered. Much clearer to read, especially in NoColor modes.
4927
4930
4928 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4931 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4929 implemented in reverse when changing to the new parse_options().
4932 implemented in reverse when changing to the new parse_options().
4930
4933
4931 2002-05-03 Fernando Perez <fperez@colorado.edu>
4934 2002-05-03 Fernando Perez <fperez@colorado.edu>
4932
4935
4933 * IPython/Magic.py (Magic.parse_options): new function so that
4936 * IPython/Magic.py (Magic.parse_options): new function so that
4934 magics can parse options easier.
4937 magics can parse options easier.
4935 (Magic.magic_prun): new function similar to profile.run(),
4938 (Magic.magic_prun): new function similar to profile.run(),
4936 suggested by Chris Hart.
4939 suggested by Chris Hart.
4937 (Magic.magic_cd): fixed behavior so that it only changes if
4940 (Magic.magic_cd): fixed behavior so that it only changes if
4938 directory actually is in history.
4941 directory actually is in history.
4939
4942
4940 * IPython/usage.py (__doc__): added information about potential
4943 * IPython/usage.py (__doc__): added information about potential
4941 slowness of Verbose exception mode when there are huge data
4944 slowness of Verbose exception mode when there are huge data
4942 structures to be formatted (thanks to Archie Paulson).
4945 structures to be formatted (thanks to Archie Paulson).
4943
4946
4944 * IPython/ipmaker.py (make_IPython): Changed default logging
4947 * IPython/ipmaker.py (make_IPython): Changed default logging
4945 (when simply called with -log) to use curr_dir/ipython.log in
4948 (when simply called with -log) to use curr_dir/ipython.log in
4946 rotate mode. Fixed crash which was occuring with -log before
4949 rotate mode. Fixed crash which was occuring with -log before
4947 (thanks to Jim Boyle).
4950 (thanks to Jim Boyle).
4948
4951
4949 2002-05-01 Fernando Perez <fperez@colorado.edu>
4952 2002-05-01 Fernando Perez <fperez@colorado.edu>
4950
4953
4951 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4954 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4952 was nasty -- though somewhat of a corner case).
4955 was nasty -- though somewhat of a corner case).
4953
4956
4954 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4957 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4955 text (was a bug).
4958 text (was a bug).
4956
4959
4957 2002-04-30 Fernando Perez <fperez@colorado.edu>
4960 2002-04-30 Fernando Perez <fperez@colorado.edu>
4958
4961
4959 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4962 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4960 a print after ^D or ^C from the user so that the In[] prompt
4963 a print after ^D or ^C from the user so that the In[] prompt
4961 doesn't over-run the gnuplot one.
4964 doesn't over-run the gnuplot one.
4962
4965
4963 2002-04-29 Fernando Perez <fperez@colorado.edu>
4966 2002-04-29 Fernando Perez <fperez@colorado.edu>
4964
4967
4965 * Released 0.2.10
4968 * Released 0.2.10
4966
4969
4967 * IPython/__release__.py (version): get date dynamically.
4970 * IPython/__release__.py (version): get date dynamically.
4968
4971
4969 * Misc. documentation updates thanks to Arnd's comments. Also ran
4972 * Misc. documentation updates thanks to Arnd's comments. Also ran
4970 a full spellcheck on the manual (hadn't been done in a while).
4973 a full spellcheck on the manual (hadn't been done in a while).
4971
4974
4972 2002-04-27 Fernando Perez <fperez@colorado.edu>
4975 2002-04-27 Fernando Perez <fperez@colorado.edu>
4973
4976
4974 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4977 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4975 starting a log in mid-session would reset the input history list.
4978 starting a log in mid-session would reset the input history list.
4976
4979
4977 2002-04-26 Fernando Perez <fperez@colorado.edu>
4980 2002-04-26 Fernando Perez <fperez@colorado.edu>
4978
4981
4979 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4982 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4980 all files were being included in an update. Now anything in
4983 all files were being included in an update. Now anything in
4981 UserConfig that matches [A-Za-z]*.py will go (this excludes
4984 UserConfig that matches [A-Za-z]*.py will go (this excludes
4982 __init__.py)
4985 __init__.py)
4983
4986
4984 2002-04-25 Fernando Perez <fperez@colorado.edu>
4987 2002-04-25 Fernando Perez <fperez@colorado.edu>
4985
4988
4986 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4989 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4987 to __builtins__ so that any form of embedded or imported code can
4990 to __builtins__ so that any form of embedded or imported code can
4988 test for being inside IPython.
4991 test for being inside IPython.
4989
4992
4990 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4993 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4991 changed to GnuplotMagic because it's now an importable module,
4994 changed to GnuplotMagic because it's now an importable module,
4992 this makes the name follow that of the standard Gnuplot module.
4995 this makes the name follow that of the standard Gnuplot module.
4993 GnuplotMagic can now be loaded at any time in mid-session.
4996 GnuplotMagic can now be loaded at any time in mid-session.
4994
4997
4995 2002-04-24 Fernando Perez <fperez@colorado.edu>
4998 2002-04-24 Fernando Perez <fperez@colorado.edu>
4996
4999
4997 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5000 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4998 the globals (IPython has its own namespace) and the
5001 the globals (IPython has its own namespace) and the
4999 PhysicalQuantity stuff is much better anyway.
5002 PhysicalQuantity stuff is much better anyway.
5000
5003
5001 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5004 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5002 embedding example to standard user directory for
5005 embedding example to standard user directory for
5003 distribution. Also put it in the manual.
5006 distribution. Also put it in the manual.
5004
5007
5005 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5008 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5006 instance as first argument (so it doesn't rely on some obscure
5009 instance as first argument (so it doesn't rely on some obscure
5007 hidden global).
5010 hidden global).
5008
5011
5009 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5012 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5010 delimiters. While it prevents ().TAB from working, it allows
5013 delimiters. While it prevents ().TAB from working, it allows
5011 completions in open (... expressions. This is by far a more common
5014 completions in open (... expressions. This is by far a more common
5012 case.
5015 case.
5013
5016
5014 2002-04-23 Fernando Perez <fperez@colorado.edu>
5017 2002-04-23 Fernando Perez <fperez@colorado.edu>
5015
5018
5016 * IPython/Extensions/InterpreterPasteInput.py: new
5019 * IPython/Extensions/InterpreterPasteInput.py: new
5017 syntax-processing module for pasting lines with >>> or ... at the
5020 syntax-processing module for pasting lines with >>> or ... at the
5018 start.
5021 start.
5019
5022
5020 * IPython/Extensions/PhysicalQ_Interactive.py
5023 * IPython/Extensions/PhysicalQ_Interactive.py
5021 (PhysicalQuantityInteractive.__int__): fixed to work with either
5024 (PhysicalQuantityInteractive.__int__): fixed to work with either
5022 Numeric or math.
5025 Numeric or math.
5023
5026
5024 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5027 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5025 provided profiles. Now we have:
5028 provided profiles. Now we have:
5026 -math -> math module as * and cmath with its own namespace.
5029 -math -> math module as * and cmath with its own namespace.
5027 -numeric -> Numeric as *, plus gnuplot & grace
5030 -numeric -> Numeric as *, plus gnuplot & grace
5028 -physics -> same as before
5031 -physics -> same as before
5029
5032
5030 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5033 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5031 user-defined magics wouldn't be found by @magic if they were
5034 user-defined magics wouldn't be found by @magic if they were
5032 defined as class methods. Also cleaned up the namespace search
5035 defined as class methods. Also cleaned up the namespace search
5033 logic and the string building (to use %s instead of many repeated
5036 logic and the string building (to use %s instead of many repeated
5034 string adds).
5037 string adds).
5035
5038
5036 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5039 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5037 of user-defined magics to operate with class methods (cleaner, in
5040 of user-defined magics to operate with class methods (cleaner, in
5038 line with the gnuplot code).
5041 line with the gnuplot code).
5039
5042
5040 2002-04-22 Fernando Perez <fperez@colorado.edu>
5043 2002-04-22 Fernando Perez <fperez@colorado.edu>
5041
5044
5042 * setup.py: updated dependency list so that manual is updated when
5045 * setup.py: updated dependency list so that manual is updated when
5043 all included files change.
5046 all included files change.
5044
5047
5045 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5048 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5046 the delimiter removal option (the fix is ugly right now).
5049 the delimiter removal option (the fix is ugly right now).
5047
5050
5048 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5051 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5049 all of the math profile (quicker loading, no conflict between
5052 all of the math profile (quicker loading, no conflict between
5050 g-9.8 and g-gnuplot).
5053 g-9.8 and g-gnuplot).
5051
5054
5052 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5055 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5053 name of post-mortem files to IPython_crash_report.txt.
5056 name of post-mortem files to IPython_crash_report.txt.
5054
5057
5055 * Cleanup/update of the docs. Added all the new readline info and
5058 * Cleanup/update of the docs. Added all the new readline info and
5056 formatted all lists as 'real lists'.
5059 formatted all lists as 'real lists'.
5057
5060
5058 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5061 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5059 tab-completion options, since the full readline parse_and_bind is
5062 tab-completion options, since the full readline parse_and_bind is
5060 now accessible.
5063 now accessible.
5061
5064
5062 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5065 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5063 handling of readline options. Now users can specify any string to
5066 handling of readline options. Now users can specify any string to
5064 be passed to parse_and_bind(), as well as the delimiters to be
5067 be passed to parse_and_bind(), as well as the delimiters to be
5065 removed.
5068 removed.
5066 (InteractiveShell.__init__): Added __name__ to the global
5069 (InteractiveShell.__init__): Added __name__ to the global
5067 namespace so that things like Itpl which rely on its existence
5070 namespace so that things like Itpl which rely on its existence
5068 don't crash.
5071 don't crash.
5069 (InteractiveShell._prefilter): Defined the default with a _ so
5072 (InteractiveShell._prefilter): Defined the default with a _ so
5070 that prefilter() is easier to override, while the default one
5073 that prefilter() is easier to override, while the default one
5071 remains available.
5074 remains available.
5072
5075
5073 2002-04-18 Fernando Perez <fperez@colorado.edu>
5076 2002-04-18 Fernando Perez <fperez@colorado.edu>
5074
5077
5075 * Added information about pdb in the docs.
5078 * Added information about pdb in the docs.
5076
5079
5077 2002-04-17 Fernando Perez <fperez@colorado.edu>
5080 2002-04-17 Fernando Perez <fperez@colorado.edu>
5078
5081
5079 * IPython/ipmaker.py (make_IPython): added rc_override option to
5082 * IPython/ipmaker.py (make_IPython): added rc_override option to
5080 allow passing config options at creation time which may override
5083 allow passing config options at creation time which may override
5081 anything set in the config files or command line. This is
5084 anything set in the config files or command line. This is
5082 particularly useful for configuring embedded instances.
5085 particularly useful for configuring embedded instances.
5083
5086
5084 2002-04-15 Fernando Perez <fperez@colorado.edu>
5087 2002-04-15 Fernando Perez <fperez@colorado.edu>
5085
5088
5086 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5089 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5087 crash embedded instances because of the input cache falling out of
5090 crash embedded instances because of the input cache falling out of
5088 sync with the output counter.
5091 sync with the output counter.
5089
5092
5090 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5093 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5091 mode which calls pdb after an uncaught exception in IPython itself.
5094 mode which calls pdb after an uncaught exception in IPython itself.
5092
5095
5093 2002-04-14 Fernando Perez <fperez@colorado.edu>
5096 2002-04-14 Fernando Perez <fperez@colorado.edu>
5094
5097
5095 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5098 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5096 readline, fix it back after each call.
5099 readline, fix it back after each call.
5097
5100
5098 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5101 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5099 method to force all access via __call__(), which guarantees that
5102 method to force all access via __call__(), which guarantees that
5100 traceback references are properly deleted.
5103 traceback references are properly deleted.
5101
5104
5102 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5105 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5103 improve printing when pprint is in use.
5106 improve printing when pprint is in use.
5104
5107
5105 2002-04-13 Fernando Perez <fperez@colorado.edu>
5108 2002-04-13 Fernando Perez <fperez@colorado.edu>
5106
5109
5107 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5110 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5108 exceptions aren't caught anymore. If the user triggers one, he
5111 exceptions aren't caught anymore. If the user triggers one, he
5109 should know why he's doing it and it should go all the way up,
5112 should know why he's doing it and it should go all the way up,
5110 just like any other exception. So now @abort will fully kill the
5113 just like any other exception. So now @abort will fully kill the
5111 embedded interpreter and the embedding code (unless that happens
5114 embedded interpreter and the embedding code (unless that happens
5112 to catch SystemExit).
5115 to catch SystemExit).
5113
5116
5114 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5117 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5115 and a debugger() method to invoke the interactive pdb debugger
5118 and a debugger() method to invoke the interactive pdb debugger
5116 after printing exception information. Also added the corresponding
5119 after printing exception information. Also added the corresponding
5117 -pdb option and @pdb magic to control this feature, and updated
5120 -pdb option and @pdb magic to control this feature, and updated
5118 the docs. After a suggestion from Christopher Hart
5121 the docs. After a suggestion from Christopher Hart
5119 (hart-AT-caltech.edu).
5122 (hart-AT-caltech.edu).
5120
5123
5121 2002-04-12 Fernando Perez <fperez@colorado.edu>
5124 2002-04-12 Fernando Perez <fperez@colorado.edu>
5122
5125
5123 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5126 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5124 the exception handlers defined by the user (not the CrashHandler)
5127 the exception handlers defined by the user (not the CrashHandler)
5125 so that user exceptions don't trigger an ipython bug report.
5128 so that user exceptions don't trigger an ipython bug report.
5126
5129
5127 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5130 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5128 configurable (it should have always been so).
5131 configurable (it should have always been so).
5129
5132
5130 2002-03-26 Fernando Perez <fperez@colorado.edu>
5133 2002-03-26 Fernando Perez <fperez@colorado.edu>
5131
5134
5132 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5135 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5133 and there to fix embedding namespace issues. This should all be
5136 and there to fix embedding namespace issues. This should all be
5134 done in a more elegant way.
5137 done in a more elegant way.
5135
5138
5136 2002-03-25 Fernando Perez <fperez@colorado.edu>
5139 2002-03-25 Fernando Perez <fperez@colorado.edu>
5137
5140
5138 * IPython/genutils.py (get_home_dir): Try to make it work under
5141 * IPython/genutils.py (get_home_dir): Try to make it work under
5139 win9x also.
5142 win9x also.
5140
5143
5141 2002-03-20 Fernando Perez <fperez@colorado.edu>
5144 2002-03-20 Fernando Perez <fperez@colorado.edu>
5142
5145
5143 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5146 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5144 sys.displayhook untouched upon __init__.
5147 sys.displayhook untouched upon __init__.
5145
5148
5146 2002-03-19 Fernando Perez <fperez@colorado.edu>
5149 2002-03-19 Fernando Perez <fperez@colorado.edu>
5147
5150
5148 * Released 0.2.9 (for embedding bug, basically).
5151 * Released 0.2.9 (for embedding bug, basically).
5149
5152
5150 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5153 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5151 exceptions so that enclosing shell's state can be restored.
5154 exceptions so that enclosing shell's state can be restored.
5152
5155
5153 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5156 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5154 naming conventions in the .ipython/ dir.
5157 naming conventions in the .ipython/ dir.
5155
5158
5156 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5159 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5157 from delimiters list so filenames with - in them get expanded.
5160 from delimiters list so filenames with - in them get expanded.
5158
5161
5159 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5162 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5160 sys.displayhook not being properly restored after an embedded call.
5163 sys.displayhook not being properly restored after an embedded call.
5161
5164
5162 2002-03-18 Fernando Perez <fperez@colorado.edu>
5165 2002-03-18 Fernando Perez <fperez@colorado.edu>
5163
5166
5164 * Released 0.2.8
5167 * Released 0.2.8
5165
5168
5166 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5169 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5167 some files weren't being included in a -upgrade.
5170 some files weren't being included in a -upgrade.
5168 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5171 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5169 on' so that the first tab completes.
5172 on' so that the first tab completes.
5170 (InteractiveShell.handle_magic): fixed bug with spaces around
5173 (InteractiveShell.handle_magic): fixed bug with spaces around
5171 quotes breaking many magic commands.
5174 quotes breaking many magic commands.
5172
5175
5173 * setup.py: added note about ignoring the syntax error messages at
5176 * setup.py: added note about ignoring the syntax error messages at
5174 installation.
5177 installation.
5175
5178
5176 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5179 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5177 streamlining the gnuplot interface, now there's only one magic @gp.
5180 streamlining the gnuplot interface, now there's only one magic @gp.
5178
5181
5179 2002-03-17 Fernando Perez <fperez@colorado.edu>
5182 2002-03-17 Fernando Perez <fperez@colorado.edu>
5180
5183
5181 * IPython/UserConfig/magic_gnuplot.py: new name for the
5184 * IPython/UserConfig/magic_gnuplot.py: new name for the
5182 example-magic_pm.py file. Much enhanced system, now with a shell
5185 example-magic_pm.py file. Much enhanced system, now with a shell
5183 for communicating directly with gnuplot, one command at a time.
5186 for communicating directly with gnuplot, one command at a time.
5184
5187
5185 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5188 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5186 setting __name__=='__main__'.
5189 setting __name__=='__main__'.
5187
5190
5188 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5191 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5189 mini-shell for accessing gnuplot from inside ipython. Should
5192 mini-shell for accessing gnuplot from inside ipython. Should
5190 extend it later for grace access too. Inspired by Arnd's
5193 extend it later for grace access too. Inspired by Arnd's
5191 suggestion.
5194 suggestion.
5192
5195
5193 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5196 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5194 calling magic functions with () in their arguments. Thanks to Arnd
5197 calling magic functions with () in their arguments. Thanks to Arnd
5195 Baecker for pointing this to me.
5198 Baecker for pointing this to me.
5196
5199
5197 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5200 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5198 infinitely for integer or complex arrays (only worked with floats).
5201 infinitely for integer or complex arrays (only worked with floats).
5199
5202
5200 2002-03-16 Fernando Perez <fperez@colorado.edu>
5203 2002-03-16 Fernando Perez <fperez@colorado.edu>
5201
5204
5202 * setup.py: Merged setup and setup_windows into a single script
5205 * setup.py: Merged setup and setup_windows into a single script
5203 which properly handles things for windows users.
5206 which properly handles things for windows users.
5204
5207
5205 2002-03-15 Fernando Perez <fperez@colorado.edu>
5208 2002-03-15 Fernando Perez <fperez@colorado.edu>
5206
5209
5207 * Big change to the manual: now the magics are all automatically
5210 * Big change to the manual: now the magics are all automatically
5208 documented. This information is generated from their docstrings
5211 documented. This information is generated from their docstrings
5209 and put in a latex file included by the manual lyx file. This way
5212 and put in a latex file included by the manual lyx file. This way
5210 we get always up to date information for the magics. The manual
5213 we get always up to date information for the magics. The manual
5211 now also has proper version information, also auto-synced.
5214 now also has proper version information, also auto-synced.
5212
5215
5213 For this to work, an undocumented --magic_docstrings option was added.
5216 For this to work, an undocumented --magic_docstrings option was added.
5214
5217
5215 2002-03-13 Fernando Perez <fperez@colorado.edu>
5218 2002-03-13 Fernando Perez <fperez@colorado.edu>
5216
5219
5217 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5220 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5218 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5221 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5219
5222
5220 2002-03-12 Fernando Perez <fperez@colorado.edu>
5223 2002-03-12 Fernando Perez <fperez@colorado.edu>
5221
5224
5222 * IPython/ultraTB.py (TermColors): changed color escapes again to
5225 * IPython/ultraTB.py (TermColors): changed color escapes again to
5223 fix the (old, reintroduced) line-wrapping bug. Basically, if
5226 fix the (old, reintroduced) line-wrapping bug. Basically, if
5224 \001..\002 aren't given in the color escapes, lines get wrapped
5227 \001..\002 aren't given in the color escapes, lines get wrapped
5225 weirdly. But giving those screws up old xterms and emacs terms. So
5228 weirdly. But giving those screws up old xterms and emacs terms. So
5226 I added some logic for emacs terms to be ok, but I can't identify old
5229 I added some logic for emacs terms to be ok, but I can't identify old
5227 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5230 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5228
5231
5229 2002-03-10 Fernando Perez <fperez@colorado.edu>
5232 2002-03-10 Fernando Perez <fperez@colorado.edu>
5230
5233
5231 * IPython/usage.py (__doc__): Various documentation cleanups and
5234 * IPython/usage.py (__doc__): Various documentation cleanups and
5232 updates, both in usage docstrings and in the manual.
5235 updates, both in usage docstrings and in the manual.
5233
5236
5234 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5237 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5235 handling of caching. Set minimum acceptabe value for having a
5238 handling of caching. Set minimum acceptabe value for having a
5236 cache at 20 values.
5239 cache at 20 values.
5237
5240
5238 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5241 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5239 install_first_time function to a method, renamed it and added an
5242 install_first_time function to a method, renamed it and added an
5240 'upgrade' mode. Now people can update their config directory with
5243 'upgrade' mode. Now people can update their config directory with
5241 a simple command line switch (-upgrade, also new).
5244 a simple command line switch (-upgrade, also new).
5242
5245
5243 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5246 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5244 @file (convenient for automagic users under Python >= 2.2).
5247 @file (convenient for automagic users under Python >= 2.2).
5245 Removed @files (it seemed more like a plural than an abbrev. of
5248 Removed @files (it seemed more like a plural than an abbrev. of
5246 'file show').
5249 'file show').
5247
5250
5248 * IPython/iplib.py (install_first_time): Fixed crash if there were
5251 * IPython/iplib.py (install_first_time): Fixed crash if there were
5249 backup files ('~') in .ipython/ install directory.
5252 backup files ('~') in .ipython/ install directory.
5250
5253
5251 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5254 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5252 system. Things look fine, but these changes are fairly
5255 system. Things look fine, but these changes are fairly
5253 intrusive. Test them for a few days.
5256 intrusive. Test them for a few days.
5254
5257
5255 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5258 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5256 the prompts system. Now all in/out prompt strings are user
5259 the prompts system. Now all in/out prompt strings are user
5257 controllable. This is particularly useful for embedding, as one
5260 controllable. This is particularly useful for embedding, as one
5258 can tag embedded instances with particular prompts.
5261 can tag embedded instances with particular prompts.
5259
5262
5260 Also removed global use of sys.ps1/2, which now allows nested
5263 Also removed global use of sys.ps1/2, which now allows nested
5261 embeddings without any problems. Added command-line options for
5264 embeddings without any problems. Added command-line options for
5262 the prompt strings.
5265 the prompt strings.
5263
5266
5264 2002-03-08 Fernando Perez <fperez@colorado.edu>
5267 2002-03-08 Fernando Perez <fperez@colorado.edu>
5265
5268
5266 * IPython/UserConfig/example-embed-short.py (ipshell): added
5269 * IPython/UserConfig/example-embed-short.py (ipshell): added
5267 example file with the bare minimum code for embedding.
5270 example file with the bare minimum code for embedding.
5268
5271
5269 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5272 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5270 functionality for the embeddable shell to be activated/deactivated
5273 functionality for the embeddable shell to be activated/deactivated
5271 either globally or at each call.
5274 either globally or at each call.
5272
5275
5273 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5276 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5274 rewriting the prompt with '--->' for auto-inputs with proper
5277 rewriting the prompt with '--->' for auto-inputs with proper
5275 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5278 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5276 this is handled by the prompts class itself, as it should.
5279 this is handled by the prompts class itself, as it should.
5277
5280
5278 2002-03-05 Fernando Perez <fperez@colorado.edu>
5281 2002-03-05 Fernando Perez <fperez@colorado.edu>
5279
5282
5280 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5283 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5281 @logstart to avoid name clashes with the math log function.
5284 @logstart to avoid name clashes with the math log function.
5282
5285
5283 * Big updates to X/Emacs section of the manual.
5286 * Big updates to X/Emacs section of the manual.
5284
5287
5285 * Removed ipython_emacs. Milan explained to me how to pass
5288 * Removed ipython_emacs. Milan explained to me how to pass
5286 arguments to ipython through Emacs. Some day I'm going to end up
5289 arguments to ipython through Emacs. Some day I'm going to end up
5287 learning some lisp...
5290 learning some lisp...
5288
5291
5289 2002-03-04 Fernando Perez <fperez@colorado.edu>
5292 2002-03-04 Fernando Perez <fperez@colorado.edu>
5290
5293
5291 * IPython/ipython_emacs: Created script to be used as the
5294 * IPython/ipython_emacs: Created script to be used as the
5292 py-python-command Emacs variable so we can pass IPython
5295 py-python-command Emacs variable so we can pass IPython
5293 parameters. I can't figure out how to tell Emacs directly to pass
5296 parameters. I can't figure out how to tell Emacs directly to pass
5294 parameters to IPython, so a dummy shell script will do it.
5297 parameters to IPython, so a dummy shell script will do it.
5295
5298
5296 Other enhancements made for things to work better under Emacs'
5299 Other enhancements made for things to work better under Emacs'
5297 various types of terminals. Many thanks to Milan Zamazal
5300 various types of terminals. Many thanks to Milan Zamazal
5298 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5301 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5299
5302
5300 2002-03-01 Fernando Perez <fperez@colorado.edu>
5303 2002-03-01 Fernando Perez <fperez@colorado.edu>
5301
5304
5302 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5305 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5303 that loading of readline is now optional. This gives better
5306 that loading of readline is now optional. This gives better
5304 control to emacs users.
5307 control to emacs users.
5305
5308
5306 * IPython/ultraTB.py (__date__): Modified color escape sequences
5309 * IPython/ultraTB.py (__date__): Modified color escape sequences
5307 and now things work fine under xterm and in Emacs' term buffers
5310 and now things work fine under xterm and in Emacs' term buffers
5308 (though not shell ones). Well, in emacs you get colors, but all
5311 (though not shell ones). Well, in emacs you get colors, but all
5309 seem to be 'light' colors (no difference between dark and light
5312 seem to be 'light' colors (no difference between dark and light
5310 ones). But the garbage chars are gone, and also in xterms. It
5313 ones). But the garbage chars are gone, and also in xterms. It
5311 seems that now I'm using 'cleaner' ansi sequences.
5314 seems that now I'm using 'cleaner' ansi sequences.
5312
5315
5313 2002-02-21 Fernando Perez <fperez@colorado.edu>
5316 2002-02-21 Fernando Perez <fperez@colorado.edu>
5314
5317
5315 * Released 0.2.7 (mainly to publish the scoping fix).
5318 * Released 0.2.7 (mainly to publish the scoping fix).
5316
5319
5317 * IPython/Logger.py (Logger.logstate): added. A corresponding
5320 * IPython/Logger.py (Logger.logstate): added. A corresponding
5318 @logstate magic was created.
5321 @logstate magic was created.
5319
5322
5320 * IPython/Magic.py: fixed nested scoping problem under Python
5323 * IPython/Magic.py: fixed nested scoping problem under Python
5321 2.1.x (automagic wasn't working).
5324 2.1.x (automagic wasn't working).
5322
5325
5323 2002-02-20 Fernando Perez <fperez@colorado.edu>
5326 2002-02-20 Fernando Perez <fperez@colorado.edu>
5324
5327
5325 * Released 0.2.6.
5328 * Released 0.2.6.
5326
5329
5327 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5330 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5328 option so that logs can come out without any headers at all.
5331 option so that logs can come out without any headers at all.
5329
5332
5330 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5333 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5331 SciPy.
5334 SciPy.
5332
5335
5333 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5336 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5334 that embedded IPython calls don't require vars() to be explicitly
5337 that embedded IPython calls don't require vars() to be explicitly
5335 passed. Now they are extracted from the caller's frame (code
5338 passed. Now they are extracted from the caller's frame (code
5336 snatched from Eric Jones' weave). Added better documentation to
5339 snatched from Eric Jones' weave). Added better documentation to
5337 the section on embedding and the example file.
5340 the section on embedding and the example file.
5338
5341
5339 * IPython/genutils.py (page): Changed so that under emacs, it just
5342 * IPython/genutils.py (page): Changed so that under emacs, it just
5340 prints the string. You can then page up and down in the emacs
5343 prints the string. You can then page up and down in the emacs
5341 buffer itself. This is how the builtin help() works.
5344 buffer itself. This is how the builtin help() works.
5342
5345
5343 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5346 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5344 macro scoping: macros need to be executed in the user's namespace
5347 macro scoping: macros need to be executed in the user's namespace
5345 to work as if they had been typed by the user.
5348 to work as if they had been typed by the user.
5346
5349
5347 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5350 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5348 execute automatically (no need to type 'exec...'). They then
5351 execute automatically (no need to type 'exec...'). They then
5349 behave like 'true macros'. The printing system was also modified
5352 behave like 'true macros'. The printing system was also modified
5350 for this to work.
5353 for this to work.
5351
5354
5352 2002-02-19 Fernando Perez <fperez@colorado.edu>
5355 2002-02-19 Fernando Perez <fperez@colorado.edu>
5353
5356
5354 * IPython/genutils.py (page_file): new function for paging files
5357 * IPython/genutils.py (page_file): new function for paging files
5355 in an OS-independent way. Also necessary for file viewing to work
5358 in an OS-independent way. Also necessary for file viewing to work
5356 well inside Emacs buffers.
5359 well inside Emacs buffers.
5357 (page): Added checks for being in an emacs buffer.
5360 (page): Added checks for being in an emacs buffer.
5358 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5361 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5359 same bug in iplib.
5362 same bug in iplib.
5360
5363
5361 2002-02-18 Fernando Perez <fperez@colorado.edu>
5364 2002-02-18 Fernando Perez <fperez@colorado.edu>
5362
5365
5363 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5366 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5364 of readline so that IPython can work inside an Emacs buffer.
5367 of readline so that IPython can work inside an Emacs buffer.
5365
5368
5366 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5369 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5367 method signatures (they weren't really bugs, but it looks cleaner
5370 method signatures (they weren't really bugs, but it looks cleaner
5368 and keeps PyChecker happy).
5371 and keeps PyChecker happy).
5369
5372
5370 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5373 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5371 for implementing various user-defined hooks. Currently only
5374 for implementing various user-defined hooks. Currently only
5372 display is done.
5375 display is done.
5373
5376
5374 * IPython/Prompts.py (CachedOutput._display): changed display
5377 * IPython/Prompts.py (CachedOutput._display): changed display
5375 functions so that they can be dynamically changed by users easily.
5378 functions so that they can be dynamically changed by users easily.
5376
5379
5377 * IPython/Extensions/numeric_formats.py (num_display): added an
5380 * IPython/Extensions/numeric_formats.py (num_display): added an
5378 extension for printing NumPy arrays in flexible manners. It
5381 extension for printing NumPy arrays in flexible manners. It
5379 doesn't do anything yet, but all the structure is in
5382 doesn't do anything yet, but all the structure is in
5380 place. Ultimately the plan is to implement output format control
5383 place. Ultimately the plan is to implement output format control
5381 like in Octave.
5384 like in Octave.
5382
5385
5383 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5386 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5384 methods are found at run-time by all the automatic machinery.
5387 methods are found at run-time by all the automatic machinery.
5385
5388
5386 2002-02-17 Fernando Perez <fperez@colorado.edu>
5389 2002-02-17 Fernando Perez <fperez@colorado.edu>
5387
5390
5388 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5391 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5389 whole file a little.
5392 whole file a little.
5390
5393
5391 * ToDo: closed this document. Now there's a new_design.lyx
5394 * ToDo: closed this document. Now there's a new_design.lyx
5392 document for all new ideas. Added making a pdf of it for the
5395 document for all new ideas. Added making a pdf of it for the
5393 end-user distro.
5396 end-user distro.
5394
5397
5395 * IPython/Logger.py (Logger.switch_log): Created this to replace
5398 * IPython/Logger.py (Logger.switch_log): Created this to replace
5396 logon() and logoff(). It also fixes a nasty crash reported by
5399 logon() and logoff(). It also fixes a nasty crash reported by
5397 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5400 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5398
5401
5399 * IPython/iplib.py (complete): got auto-completion to work with
5402 * IPython/iplib.py (complete): got auto-completion to work with
5400 automagic (I had wanted this for a long time).
5403 automagic (I had wanted this for a long time).
5401
5404
5402 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5405 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5403 to @file, since file() is now a builtin and clashes with automagic
5406 to @file, since file() is now a builtin and clashes with automagic
5404 for @file.
5407 for @file.
5405
5408
5406 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5409 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5407 of this was previously in iplib, which had grown to more than 2000
5410 of this was previously in iplib, which had grown to more than 2000
5408 lines, way too long. No new functionality, but it makes managing
5411 lines, way too long. No new functionality, but it makes managing
5409 the code a bit easier.
5412 the code a bit easier.
5410
5413
5411 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5414 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5412 information to crash reports.
5415 information to crash reports.
5413
5416
5414 2002-02-12 Fernando Perez <fperez@colorado.edu>
5417 2002-02-12 Fernando Perez <fperez@colorado.edu>
5415
5418
5416 * Released 0.2.5.
5419 * Released 0.2.5.
5417
5420
5418 2002-02-11 Fernando Perez <fperez@colorado.edu>
5421 2002-02-11 Fernando Perez <fperez@colorado.edu>
5419
5422
5420 * Wrote a relatively complete Windows installer. It puts
5423 * Wrote a relatively complete Windows installer. It puts
5421 everything in place, creates Start Menu entries and fixes the
5424 everything in place, creates Start Menu entries and fixes the
5422 color issues. Nothing fancy, but it works.
5425 color issues. Nothing fancy, but it works.
5423
5426
5424 2002-02-10 Fernando Perez <fperez@colorado.edu>
5427 2002-02-10 Fernando Perez <fperez@colorado.edu>
5425
5428
5426 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5429 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5427 os.path.expanduser() call so that we can type @run ~/myfile.py and
5430 os.path.expanduser() call so that we can type @run ~/myfile.py and
5428 have thigs work as expected.
5431 have thigs work as expected.
5429
5432
5430 * IPython/genutils.py (page): fixed exception handling so things
5433 * IPython/genutils.py (page): fixed exception handling so things
5431 work both in Unix and Windows correctly. Quitting a pager triggers
5434 work both in Unix and Windows correctly. Quitting a pager triggers
5432 an IOError/broken pipe in Unix, and in windows not finding a pager
5435 an IOError/broken pipe in Unix, and in windows not finding a pager
5433 is also an IOError, so I had to actually look at the return value
5436 is also an IOError, so I had to actually look at the return value
5434 of the exception, not just the exception itself. Should be ok now.
5437 of the exception, not just the exception itself. Should be ok now.
5435
5438
5436 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5439 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5437 modified to allow case-insensitive color scheme changes.
5440 modified to allow case-insensitive color scheme changes.
5438
5441
5439 2002-02-09 Fernando Perez <fperez@colorado.edu>
5442 2002-02-09 Fernando Perez <fperez@colorado.edu>
5440
5443
5441 * IPython/genutils.py (native_line_ends): new function to leave
5444 * IPython/genutils.py (native_line_ends): new function to leave
5442 user config files with os-native line-endings.
5445 user config files with os-native line-endings.
5443
5446
5444 * README and manual updates.
5447 * README and manual updates.
5445
5448
5446 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5449 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5447 instead of StringType to catch Unicode strings.
5450 instead of StringType to catch Unicode strings.
5448
5451
5449 * IPython/genutils.py (filefind): fixed bug for paths with
5452 * IPython/genutils.py (filefind): fixed bug for paths with
5450 embedded spaces (very common in Windows).
5453 embedded spaces (very common in Windows).
5451
5454
5452 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5455 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5453 files under Windows, so that they get automatically associated
5456 files under Windows, so that they get automatically associated
5454 with a text editor. Windows makes it a pain to handle
5457 with a text editor. Windows makes it a pain to handle
5455 extension-less files.
5458 extension-less files.
5456
5459
5457 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5460 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5458 warning about readline only occur for Posix. In Windows there's no
5461 warning about readline only occur for Posix. In Windows there's no
5459 way to get readline, so why bother with the warning.
5462 way to get readline, so why bother with the warning.
5460
5463
5461 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5464 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5462 for __str__ instead of dir(self), since dir() changed in 2.2.
5465 for __str__ instead of dir(self), since dir() changed in 2.2.
5463
5466
5464 * Ported to Windows! Tested on XP, I suspect it should work fine
5467 * Ported to Windows! Tested on XP, I suspect it should work fine
5465 on NT/2000, but I don't think it will work on 98 et al. That
5468 on NT/2000, but I don't think it will work on 98 et al. That
5466 series of Windows is such a piece of junk anyway that I won't try
5469 series of Windows is such a piece of junk anyway that I won't try
5467 porting it there. The XP port was straightforward, showed a few
5470 porting it there. The XP port was straightforward, showed a few
5468 bugs here and there (fixed all), in particular some string
5471 bugs here and there (fixed all), in particular some string
5469 handling stuff which required considering Unicode strings (which
5472 handling stuff which required considering Unicode strings (which
5470 Windows uses). This is good, but hasn't been too tested :) No
5473 Windows uses). This is good, but hasn't been too tested :) No
5471 fancy installer yet, I'll put a note in the manual so people at
5474 fancy installer yet, I'll put a note in the manual so people at
5472 least make manually a shortcut.
5475 least make manually a shortcut.
5473
5476
5474 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5477 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5475 into a single one, "colors". This now controls both prompt and
5478 into a single one, "colors". This now controls both prompt and
5476 exception color schemes, and can be changed both at startup
5479 exception color schemes, and can be changed both at startup
5477 (either via command-line switches or via ipythonrc files) and at
5480 (either via command-line switches or via ipythonrc files) and at
5478 runtime, with @colors.
5481 runtime, with @colors.
5479 (Magic.magic_run): renamed @prun to @run and removed the old
5482 (Magic.magic_run): renamed @prun to @run and removed the old
5480 @run. The two were too similar to warrant keeping both.
5483 @run. The two were too similar to warrant keeping both.
5481
5484
5482 2002-02-03 Fernando Perez <fperez@colorado.edu>
5485 2002-02-03 Fernando Perez <fperez@colorado.edu>
5483
5486
5484 * IPython/iplib.py (install_first_time): Added comment on how to
5487 * IPython/iplib.py (install_first_time): Added comment on how to
5485 configure the color options for first-time users. Put a <return>
5488 configure the color options for first-time users. Put a <return>
5486 request at the end so that small-terminal users get a chance to
5489 request at the end so that small-terminal users get a chance to
5487 read the startup info.
5490 read the startup info.
5488
5491
5489 2002-01-23 Fernando Perez <fperez@colorado.edu>
5492 2002-01-23 Fernando Perez <fperez@colorado.edu>
5490
5493
5491 * IPython/iplib.py (CachedOutput.update): Changed output memory
5494 * IPython/iplib.py (CachedOutput.update): Changed output memory
5492 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5495 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5493 input history we still use _i. Did this b/c these variable are
5496 input history we still use _i. Did this b/c these variable are
5494 very commonly used in interactive work, so the less we need to
5497 very commonly used in interactive work, so the less we need to
5495 type the better off we are.
5498 type the better off we are.
5496 (Magic.magic_prun): updated @prun to better handle the namespaces
5499 (Magic.magic_prun): updated @prun to better handle the namespaces
5497 the file will run in, including a fix for __name__ not being set
5500 the file will run in, including a fix for __name__ not being set
5498 before.
5501 before.
5499
5502
5500 2002-01-20 Fernando Perez <fperez@colorado.edu>
5503 2002-01-20 Fernando Perez <fperez@colorado.edu>
5501
5504
5502 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5505 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5503 extra garbage for Python 2.2. Need to look more carefully into
5506 extra garbage for Python 2.2. Need to look more carefully into
5504 this later.
5507 this later.
5505
5508
5506 2002-01-19 Fernando Perez <fperez@colorado.edu>
5509 2002-01-19 Fernando Perez <fperez@colorado.edu>
5507
5510
5508 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5511 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5509 display SyntaxError exceptions properly formatted when they occur
5512 display SyntaxError exceptions properly formatted when they occur
5510 (they can be triggered by imported code).
5513 (they can be triggered by imported code).
5511
5514
5512 2002-01-18 Fernando Perez <fperez@colorado.edu>
5515 2002-01-18 Fernando Perez <fperez@colorado.edu>
5513
5516
5514 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5517 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5515 SyntaxError exceptions are reported nicely formatted, instead of
5518 SyntaxError exceptions are reported nicely formatted, instead of
5516 spitting out only offset information as before.
5519 spitting out only offset information as before.
5517 (Magic.magic_prun): Added the @prun function for executing
5520 (Magic.magic_prun): Added the @prun function for executing
5518 programs with command line args inside IPython.
5521 programs with command line args inside IPython.
5519
5522
5520 2002-01-16 Fernando Perez <fperez@colorado.edu>
5523 2002-01-16 Fernando Perez <fperez@colorado.edu>
5521
5524
5522 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5525 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5523 to *not* include the last item given in a range. This brings their
5526 to *not* include the last item given in a range. This brings their
5524 behavior in line with Python's slicing:
5527 behavior in line with Python's slicing:
5525 a[n1:n2] -> a[n1]...a[n2-1]
5528 a[n1:n2] -> a[n1]...a[n2-1]
5526 It may be a bit less convenient, but I prefer to stick to Python's
5529 It may be a bit less convenient, but I prefer to stick to Python's
5527 conventions *everywhere*, so users never have to wonder.
5530 conventions *everywhere*, so users never have to wonder.
5528 (Magic.magic_macro): Added @macro function to ease the creation of
5531 (Magic.magic_macro): Added @macro function to ease the creation of
5529 macros.
5532 macros.
5530
5533
5531 2002-01-05 Fernando Perez <fperez@colorado.edu>
5534 2002-01-05 Fernando Perez <fperez@colorado.edu>
5532
5535
5533 * Released 0.2.4.
5536 * Released 0.2.4.
5534
5537
5535 * IPython/iplib.py (Magic.magic_pdef):
5538 * IPython/iplib.py (Magic.magic_pdef):
5536 (InteractiveShell.safe_execfile): report magic lines and error
5539 (InteractiveShell.safe_execfile): report magic lines and error
5537 lines without line numbers so one can easily copy/paste them for
5540 lines without line numbers so one can easily copy/paste them for
5538 re-execution.
5541 re-execution.
5539
5542
5540 * Updated manual with recent changes.
5543 * Updated manual with recent changes.
5541
5544
5542 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5545 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5543 docstring printing when class? is called. Very handy for knowing
5546 docstring printing when class? is called. Very handy for knowing
5544 how to create class instances (as long as __init__ is well
5547 how to create class instances (as long as __init__ is well
5545 documented, of course :)
5548 documented, of course :)
5546 (Magic.magic_doc): print both class and constructor docstrings.
5549 (Magic.magic_doc): print both class and constructor docstrings.
5547 (Magic.magic_pdef): give constructor info if passed a class and
5550 (Magic.magic_pdef): give constructor info if passed a class and
5548 __call__ info for callable object instances.
5551 __call__ info for callable object instances.
5549
5552
5550 2002-01-04 Fernando Perez <fperez@colorado.edu>
5553 2002-01-04 Fernando Perez <fperez@colorado.edu>
5551
5554
5552 * Made deep_reload() off by default. It doesn't always work
5555 * Made deep_reload() off by default. It doesn't always work
5553 exactly as intended, so it's probably safer to have it off. It's
5556 exactly as intended, so it's probably safer to have it off. It's
5554 still available as dreload() anyway, so nothing is lost.
5557 still available as dreload() anyway, so nothing is lost.
5555
5558
5556 2002-01-02 Fernando Perez <fperez@colorado.edu>
5559 2002-01-02 Fernando Perez <fperez@colorado.edu>
5557
5560
5558 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5561 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5559 so I wanted an updated release).
5562 so I wanted an updated release).
5560
5563
5561 2001-12-27 Fernando Perez <fperez@colorado.edu>
5564 2001-12-27 Fernando Perez <fperez@colorado.edu>
5562
5565
5563 * IPython/iplib.py (InteractiveShell.interact): Added the original
5566 * IPython/iplib.py (InteractiveShell.interact): Added the original
5564 code from 'code.py' for this module in order to change the
5567 code from 'code.py' for this module in order to change the
5565 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5568 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5566 the history cache would break when the user hit Ctrl-C, and
5569 the history cache would break when the user hit Ctrl-C, and
5567 interact() offers no way to add any hooks to it.
5570 interact() offers no way to add any hooks to it.
5568
5571
5569 2001-12-23 Fernando Perez <fperez@colorado.edu>
5572 2001-12-23 Fernando Perez <fperez@colorado.edu>
5570
5573
5571 * setup.py: added check for 'MANIFEST' before trying to remove
5574 * setup.py: added check for 'MANIFEST' before trying to remove
5572 it. Thanks to Sean Reifschneider.
5575 it. Thanks to Sean Reifschneider.
5573
5576
5574 2001-12-22 Fernando Perez <fperez@colorado.edu>
5577 2001-12-22 Fernando Perez <fperez@colorado.edu>
5575
5578
5576 * Released 0.2.2.
5579 * Released 0.2.2.
5577
5580
5578 * Finished (reasonably) writing the manual. Later will add the
5581 * Finished (reasonably) writing the manual. Later will add the
5579 python-standard navigation stylesheets, but for the time being
5582 python-standard navigation stylesheets, but for the time being
5580 it's fairly complete. Distribution will include html and pdf
5583 it's fairly complete. Distribution will include html and pdf
5581 versions.
5584 versions.
5582
5585
5583 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5586 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5584 (MayaVi author).
5587 (MayaVi author).
5585
5588
5586 2001-12-21 Fernando Perez <fperez@colorado.edu>
5589 2001-12-21 Fernando Perez <fperez@colorado.edu>
5587
5590
5588 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5591 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5589 good public release, I think (with the manual and the distutils
5592 good public release, I think (with the manual and the distutils
5590 installer). The manual can use some work, but that can go
5593 installer). The manual can use some work, but that can go
5591 slowly. Otherwise I think it's quite nice for end users. Next
5594 slowly. Otherwise I think it's quite nice for end users. Next
5592 summer, rewrite the guts of it...
5595 summer, rewrite the guts of it...
5593
5596
5594 * Changed format of ipythonrc files to use whitespace as the
5597 * Changed format of ipythonrc files to use whitespace as the
5595 separator instead of an explicit '='. Cleaner.
5598 separator instead of an explicit '='. Cleaner.
5596
5599
5597 2001-12-20 Fernando Perez <fperez@colorado.edu>
5600 2001-12-20 Fernando Perez <fperez@colorado.edu>
5598
5601
5599 * Started a manual in LyX. For now it's just a quick merge of the
5602 * Started a manual in LyX. For now it's just a quick merge of the
5600 various internal docstrings and READMEs. Later it may grow into a
5603 various internal docstrings and READMEs. Later it may grow into a
5601 nice, full-blown manual.
5604 nice, full-blown manual.
5602
5605
5603 * Set up a distutils based installer. Installation should now be
5606 * Set up a distutils based installer. Installation should now be
5604 trivially simple for end-users.
5607 trivially simple for end-users.
5605
5608
5606 2001-12-11 Fernando Perez <fperez@colorado.edu>
5609 2001-12-11 Fernando Perez <fperez@colorado.edu>
5607
5610
5608 * Released 0.2.0. First public release, announced it at
5611 * Released 0.2.0. First public release, announced it at
5609 comp.lang.python. From now on, just bugfixes...
5612 comp.lang.python. From now on, just bugfixes...
5610
5613
5611 * Went through all the files, set copyright/license notices and
5614 * Went through all the files, set copyright/license notices and
5612 cleaned up things. Ready for release.
5615 cleaned up things. Ready for release.
5613
5616
5614 2001-12-10 Fernando Perez <fperez@colorado.edu>
5617 2001-12-10 Fernando Perez <fperez@colorado.edu>
5615
5618
5616 * Changed the first-time installer not to use tarfiles. It's more
5619 * Changed the first-time installer not to use tarfiles. It's more
5617 robust now and less unix-dependent. Also makes it easier for
5620 robust now and less unix-dependent. Also makes it easier for
5618 people to later upgrade versions.
5621 people to later upgrade versions.
5619
5622
5620 * Changed @exit to @abort to reflect the fact that it's pretty
5623 * Changed @exit to @abort to reflect the fact that it's pretty
5621 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5624 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5622 becomes significant only when IPyhton is embedded: in that case,
5625 becomes significant only when IPyhton is embedded: in that case,
5623 C-D closes IPython only, but @abort kills the enclosing program
5626 C-D closes IPython only, but @abort kills the enclosing program
5624 too (unless it had called IPython inside a try catching
5627 too (unless it had called IPython inside a try catching
5625 SystemExit).
5628 SystemExit).
5626
5629
5627 * Created Shell module which exposes the actuall IPython Shell
5630 * Created Shell module which exposes the actuall IPython Shell
5628 classes, currently the normal and the embeddable one. This at
5631 classes, currently the normal and the embeddable one. This at
5629 least offers a stable interface we won't need to change when
5632 least offers a stable interface we won't need to change when
5630 (later) the internals are rewritten. That rewrite will be confined
5633 (later) the internals are rewritten. That rewrite will be confined
5631 to iplib and ipmaker, but the Shell interface should remain as is.
5634 to iplib and ipmaker, but the Shell interface should remain as is.
5632
5635
5633 * Added embed module which offers an embeddable IPShell object,
5636 * Added embed module which offers an embeddable IPShell object,
5634 useful to fire up IPython *inside* a running program. Great for
5637 useful to fire up IPython *inside* a running program. Great for
5635 debugging or dynamical data analysis.
5638 debugging or dynamical data analysis.
5636
5639
5637 2001-12-08 Fernando Perez <fperez@colorado.edu>
5640 2001-12-08 Fernando Perez <fperez@colorado.edu>
5638
5641
5639 * Fixed small bug preventing seeing info from methods of defined
5642 * Fixed small bug preventing seeing info from methods of defined
5640 objects (incorrect namespace in _ofind()).
5643 objects (incorrect namespace in _ofind()).
5641
5644
5642 * Documentation cleanup. Moved the main usage docstrings to a
5645 * Documentation cleanup. Moved the main usage docstrings to a
5643 separate file, usage.py (cleaner to maintain, and hopefully in the
5646 separate file, usage.py (cleaner to maintain, and hopefully in the
5644 future some perlpod-like way of producing interactive, man and
5647 future some perlpod-like way of producing interactive, man and
5645 html docs out of it will be found).
5648 html docs out of it will be found).
5646
5649
5647 * Added @profile to see your profile at any time.
5650 * Added @profile to see your profile at any time.
5648
5651
5649 * Added @p as an alias for 'print'. It's especially convenient if
5652 * Added @p as an alias for 'print'. It's especially convenient if
5650 using automagic ('p x' prints x).
5653 using automagic ('p x' prints x).
5651
5654
5652 * Small cleanups and fixes after a pychecker run.
5655 * Small cleanups and fixes after a pychecker run.
5653
5656
5654 * Changed the @cd command to handle @cd - and @cd -<n> for
5657 * Changed the @cd command to handle @cd - and @cd -<n> for
5655 visiting any directory in _dh.
5658 visiting any directory in _dh.
5656
5659
5657 * Introduced _dh, a history of visited directories. @dhist prints
5660 * Introduced _dh, a history of visited directories. @dhist prints
5658 it out with numbers.
5661 it out with numbers.
5659
5662
5660 2001-12-07 Fernando Perez <fperez@colorado.edu>
5663 2001-12-07 Fernando Perez <fperez@colorado.edu>
5661
5664
5662 * Released 0.1.22
5665 * Released 0.1.22
5663
5666
5664 * Made initialization a bit more robust against invalid color
5667 * Made initialization a bit more robust against invalid color
5665 options in user input (exit, not traceback-crash).
5668 options in user input (exit, not traceback-crash).
5666
5669
5667 * Changed the bug crash reporter to write the report only in the
5670 * Changed the bug crash reporter to write the report only in the
5668 user's .ipython directory. That way IPython won't litter people's
5671 user's .ipython directory. That way IPython won't litter people's
5669 hard disks with crash files all over the place. Also print on
5672 hard disks with crash files all over the place. Also print on
5670 screen the necessary mail command.
5673 screen the necessary mail command.
5671
5674
5672 * With the new ultraTB, implemented LightBG color scheme for light
5675 * With the new ultraTB, implemented LightBG color scheme for light
5673 background terminals. A lot of people like white backgrounds, so I
5676 background terminals. A lot of people like white backgrounds, so I
5674 guess we should at least give them something readable.
5677 guess we should at least give them something readable.
5675
5678
5676 2001-12-06 Fernando Perez <fperez@colorado.edu>
5679 2001-12-06 Fernando Perez <fperez@colorado.edu>
5677
5680
5678 * Modified the structure of ultraTB. Now there's a proper class
5681 * Modified the structure of ultraTB. Now there's a proper class
5679 for tables of color schemes which allow adding schemes easily and
5682 for tables of color schemes which allow adding schemes easily and
5680 switching the active scheme without creating a new instance every
5683 switching the active scheme without creating a new instance every
5681 time (which was ridiculous). The syntax for creating new schemes
5684 time (which was ridiculous). The syntax for creating new schemes
5682 is also cleaner. I think ultraTB is finally done, with a clean
5685 is also cleaner. I think ultraTB is finally done, with a clean
5683 class structure. Names are also much cleaner (now there's proper
5686 class structure. Names are also much cleaner (now there's proper
5684 color tables, no need for every variable to also have 'color' in
5687 color tables, no need for every variable to also have 'color' in
5685 its name).
5688 its name).
5686
5689
5687 * Broke down genutils into separate files. Now genutils only
5690 * Broke down genutils into separate files. Now genutils only
5688 contains utility functions, and classes have been moved to their
5691 contains utility functions, and classes have been moved to their
5689 own files (they had enough independent functionality to warrant
5692 own files (they had enough independent functionality to warrant
5690 it): ConfigLoader, OutputTrap, Struct.
5693 it): ConfigLoader, OutputTrap, Struct.
5691
5694
5692 2001-12-05 Fernando Perez <fperez@colorado.edu>
5695 2001-12-05 Fernando Perez <fperez@colorado.edu>
5693
5696
5694 * IPython turns 21! Released version 0.1.21, as a candidate for
5697 * IPython turns 21! Released version 0.1.21, as a candidate for
5695 public consumption. If all goes well, release in a few days.
5698 public consumption. If all goes well, release in a few days.
5696
5699
5697 * Fixed path bug (files in Extensions/ directory wouldn't be found
5700 * Fixed path bug (files in Extensions/ directory wouldn't be found
5698 unless IPython/ was explicitly in sys.path).
5701 unless IPython/ was explicitly in sys.path).
5699
5702
5700 * Extended the FlexCompleter class as MagicCompleter to allow
5703 * Extended the FlexCompleter class as MagicCompleter to allow
5701 completion of @-starting lines.
5704 completion of @-starting lines.
5702
5705
5703 * Created __release__.py file as a central repository for release
5706 * Created __release__.py file as a central repository for release
5704 info that other files can read from.
5707 info that other files can read from.
5705
5708
5706 * Fixed small bug in logging: when logging was turned on in
5709 * Fixed small bug in logging: when logging was turned on in
5707 mid-session, old lines with special meanings (!@?) were being
5710 mid-session, old lines with special meanings (!@?) were being
5708 logged without the prepended comment, which is necessary since
5711 logged without the prepended comment, which is necessary since
5709 they are not truly valid python syntax. This should make session
5712 they are not truly valid python syntax. This should make session
5710 restores produce less errors.
5713 restores produce less errors.
5711
5714
5712 * The namespace cleanup forced me to make a FlexCompleter class
5715 * The namespace cleanup forced me to make a FlexCompleter class
5713 which is nothing but a ripoff of rlcompleter, but with selectable
5716 which is nothing but a ripoff of rlcompleter, but with selectable
5714 namespace (rlcompleter only works in __main__.__dict__). I'll try
5717 namespace (rlcompleter only works in __main__.__dict__). I'll try
5715 to submit a note to the authors to see if this change can be
5718 to submit a note to the authors to see if this change can be
5716 incorporated in future rlcompleter releases (Dec.6: done)
5719 incorporated in future rlcompleter releases (Dec.6: done)
5717
5720
5718 * More fixes to namespace handling. It was a mess! Now all
5721 * More fixes to namespace handling. It was a mess! Now all
5719 explicit references to __main__.__dict__ are gone (except when
5722 explicit references to __main__.__dict__ are gone (except when
5720 really needed) and everything is handled through the namespace
5723 really needed) and everything is handled through the namespace
5721 dicts in the IPython instance. We seem to be getting somewhere
5724 dicts in the IPython instance. We seem to be getting somewhere
5722 with this, finally...
5725 with this, finally...
5723
5726
5724 * Small documentation updates.
5727 * Small documentation updates.
5725
5728
5726 * Created the Extensions directory under IPython (with an
5729 * Created the Extensions directory under IPython (with an
5727 __init__.py). Put the PhysicalQ stuff there. This directory should
5730 __init__.py). Put the PhysicalQ stuff there. This directory should
5728 be used for all special-purpose extensions.
5731 be used for all special-purpose extensions.
5729
5732
5730 * File renaming:
5733 * File renaming:
5731 ipythonlib --> ipmaker
5734 ipythonlib --> ipmaker
5732 ipplib --> iplib
5735 ipplib --> iplib
5733 This makes a bit more sense in terms of what these files actually do.
5736 This makes a bit more sense in terms of what these files actually do.
5734
5737
5735 * Moved all the classes and functions in ipythonlib to ipplib, so
5738 * Moved all the classes and functions in ipythonlib to ipplib, so
5736 now ipythonlib only has make_IPython(). This will ease up its
5739 now ipythonlib only has make_IPython(). This will ease up its
5737 splitting in smaller functional chunks later.
5740 splitting in smaller functional chunks later.
5738
5741
5739 * Cleaned up (done, I think) output of @whos. Better column
5742 * Cleaned up (done, I think) output of @whos. Better column
5740 formatting, and now shows str(var) for as much as it can, which is
5743 formatting, and now shows str(var) for as much as it can, which is
5741 typically what one gets with a 'print var'.
5744 typically what one gets with a 'print var'.
5742
5745
5743 2001-12-04 Fernando Perez <fperez@colorado.edu>
5746 2001-12-04 Fernando Perez <fperez@colorado.edu>
5744
5747
5745 * Fixed namespace problems. Now builtin/IPyhton/user names get
5748 * Fixed namespace problems. Now builtin/IPyhton/user names get
5746 properly reported in their namespace. Internal namespace handling
5749 properly reported in their namespace. Internal namespace handling
5747 is finally getting decent (not perfect yet, but much better than
5750 is finally getting decent (not perfect yet, but much better than
5748 the ad-hoc mess we had).
5751 the ad-hoc mess we had).
5749
5752
5750 * Removed -exit option. If people just want to run a python
5753 * Removed -exit option. If people just want to run a python
5751 script, that's what the normal interpreter is for. Less
5754 script, that's what the normal interpreter is for. Less
5752 unnecessary options, less chances for bugs.
5755 unnecessary options, less chances for bugs.
5753
5756
5754 * Added a crash handler which generates a complete post-mortem if
5757 * Added a crash handler which generates a complete post-mortem if
5755 IPython crashes. This will help a lot in tracking bugs down the
5758 IPython crashes. This will help a lot in tracking bugs down the
5756 road.
5759 road.
5757
5760
5758 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5761 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5759 which were boud to functions being reassigned would bypass the
5762 which were boud to functions being reassigned would bypass the
5760 logger, breaking the sync of _il with the prompt counter. This
5763 logger, breaking the sync of _il with the prompt counter. This
5761 would then crash IPython later when a new line was logged.
5764 would then crash IPython later when a new line was logged.
5762
5765
5763 2001-12-02 Fernando Perez <fperez@colorado.edu>
5766 2001-12-02 Fernando Perez <fperez@colorado.edu>
5764
5767
5765 * Made IPython a package. This means people don't have to clutter
5768 * Made IPython a package. This means people don't have to clutter
5766 their sys.path with yet another directory. Changed the INSTALL
5769 their sys.path with yet another directory. Changed the INSTALL
5767 file accordingly.
5770 file accordingly.
5768
5771
5769 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5772 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5770 sorts its output (so @who shows it sorted) and @whos formats the
5773 sorts its output (so @who shows it sorted) and @whos formats the
5771 table according to the width of the first column. Nicer, easier to
5774 table according to the width of the first column. Nicer, easier to
5772 read. Todo: write a generic table_format() which takes a list of
5775 read. Todo: write a generic table_format() which takes a list of
5773 lists and prints it nicely formatted, with optional row/column
5776 lists and prints it nicely formatted, with optional row/column
5774 separators and proper padding and justification.
5777 separators and proper padding and justification.
5775
5778
5776 * Released 0.1.20
5779 * Released 0.1.20
5777
5780
5778 * Fixed bug in @log which would reverse the inputcache list (a
5781 * Fixed bug in @log which would reverse the inputcache list (a
5779 copy operation was missing).
5782 copy operation was missing).
5780
5783
5781 * Code cleanup. @config was changed to use page(). Better, since
5784 * Code cleanup. @config was changed to use page(). Better, since
5782 its output is always quite long.
5785 its output is always quite long.
5783
5786
5784 * Itpl is back as a dependency. I was having too many problems
5787 * Itpl is back as a dependency. I was having too many problems
5785 getting the parametric aliases to work reliably, and it's just
5788 getting the parametric aliases to work reliably, and it's just
5786 easier to code weird string operations with it than playing %()s
5789 easier to code weird string operations with it than playing %()s
5787 games. It's only ~6k, so I don't think it's too big a deal.
5790 games. It's only ~6k, so I don't think it's too big a deal.
5788
5791
5789 * Found (and fixed) a very nasty bug with history. !lines weren't
5792 * Found (and fixed) a very nasty bug with history. !lines weren't
5790 getting cached, and the out of sync caches would crash
5793 getting cached, and the out of sync caches would crash
5791 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5794 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5792 division of labor a bit better. Bug fixed, cleaner structure.
5795 division of labor a bit better. Bug fixed, cleaner structure.
5793
5796
5794 2001-12-01 Fernando Perez <fperez@colorado.edu>
5797 2001-12-01 Fernando Perez <fperez@colorado.edu>
5795
5798
5796 * Released 0.1.19
5799 * Released 0.1.19
5797
5800
5798 * Added option -n to @hist to prevent line number printing. Much
5801 * Added option -n to @hist to prevent line number printing. Much
5799 easier to copy/paste code this way.
5802 easier to copy/paste code this way.
5800
5803
5801 * Created global _il to hold the input list. Allows easy
5804 * Created global _il to hold the input list. Allows easy
5802 re-execution of blocks of code by slicing it (inspired by Janko's
5805 re-execution of blocks of code by slicing it (inspired by Janko's
5803 comment on 'macros').
5806 comment on 'macros').
5804
5807
5805 * Small fixes and doc updates.
5808 * Small fixes and doc updates.
5806
5809
5807 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5810 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5808 much too fragile with automagic. Handles properly multi-line
5811 much too fragile with automagic. Handles properly multi-line
5809 statements and takes parameters.
5812 statements and takes parameters.
5810
5813
5811 2001-11-30 Fernando Perez <fperez@colorado.edu>
5814 2001-11-30 Fernando Perez <fperez@colorado.edu>
5812
5815
5813 * Version 0.1.18 released.
5816 * Version 0.1.18 released.
5814
5817
5815 * Fixed nasty namespace bug in initial module imports.
5818 * Fixed nasty namespace bug in initial module imports.
5816
5819
5817 * Added copyright/license notes to all code files (except
5820 * Added copyright/license notes to all code files (except
5818 DPyGetOpt). For the time being, LGPL. That could change.
5821 DPyGetOpt). For the time being, LGPL. That could change.
5819
5822
5820 * Rewrote a much nicer README, updated INSTALL, cleaned up
5823 * Rewrote a much nicer README, updated INSTALL, cleaned up
5821 ipythonrc-* samples.
5824 ipythonrc-* samples.
5822
5825
5823 * Overall code/documentation cleanup. Basically ready for
5826 * Overall code/documentation cleanup. Basically ready for
5824 release. Only remaining thing: licence decision (LGPL?).
5827 release. Only remaining thing: licence decision (LGPL?).
5825
5828
5826 * Converted load_config to a class, ConfigLoader. Now recursion
5829 * Converted load_config to a class, ConfigLoader. Now recursion
5827 control is better organized. Doesn't include the same file twice.
5830 control is better organized. Doesn't include the same file twice.
5828
5831
5829 2001-11-29 Fernando Perez <fperez@colorado.edu>
5832 2001-11-29 Fernando Perez <fperez@colorado.edu>
5830
5833
5831 * Got input history working. Changed output history variables from
5834 * Got input history working. Changed output history variables from
5832 _p to _o so that _i is for input and _o for output. Just cleaner
5835 _p to _o so that _i is for input and _o for output. Just cleaner
5833 convention.
5836 convention.
5834
5837
5835 * Implemented parametric aliases. This pretty much allows the
5838 * Implemented parametric aliases. This pretty much allows the
5836 alias system to offer full-blown shell convenience, I think.
5839 alias system to offer full-blown shell convenience, I think.
5837
5840
5838 * Version 0.1.17 released, 0.1.18 opened.
5841 * Version 0.1.17 released, 0.1.18 opened.
5839
5842
5840 * dot_ipython/ipythonrc (alias): added documentation.
5843 * dot_ipython/ipythonrc (alias): added documentation.
5841 (xcolor): Fixed small bug (xcolors -> xcolor)
5844 (xcolor): Fixed small bug (xcolors -> xcolor)
5842
5845
5843 * Changed the alias system. Now alias is a magic command to define
5846 * Changed the alias system. Now alias is a magic command to define
5844 aliases just like the shell. Rationale: the builtin magics should
5847 aliases just like the shell. Rationale: the builtin magics should
5845 be there for things deeply connected to IPython's
5848 be there for things deeply connected to IPython's
5846 architecture. And this is a much lighter system for what I think
5849 architecture. And this is a much lighter system for what I think
5847 is the really important feature: allowing users to define quickly
5850 is the really important feature: allowing users to define quickly
5848 magics that will do shell things for them, so they can customize
5851 magics that will do shell things for them, so they can customize
5849 IPython easily to match their work habits. If someone is really
5852 IPython easily to match their work habits. If someone is really
5850 desperate to have another name for a builtin alias, they can
5853 desperate to have another name for a builtin alias, they can
5851 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5854 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5852 works.
5855 works.
5853
5856
5854 2001-11-28 Fernando Perez <fperez@colorado.edu>
5857 2001-11-28 Fernando Perez <fperez@colorado.edu>
5855
5858
5856 * Changed @file so that it opens the source file at the proper
5859 * Changed @file so that it opens the source file at the proper
5857 line. Since it uses less, if your EDITOR environment is
5860 line. Since it uses less, if your EDITOR environment is
5858 configured, typing v will immediately open your editor of choice
5861 configured, typing v will immediately open your editor of choice
5859 right at the line where the object is defined. Not as quick as
5862 right at the line where the object is defined. Not as quick as
5860 having a direct @edit command, but for all intents and purposes it
5863 having a direct @edit command, but for all intents and purposes it
5861 works. And I don't have to worry about writing @edit to deal with
5864 works. And I don't have to worry about writing @edit to deal with
5862 all the editors, less does that.
5865 all the editors, less does that.
5863
5866
5864 * Version 0.1.16 released, 0.1.17 opened.
5867 * Version 0.1.16 released, 0.1.17 opened.
5865
5868
5866 * Fixed some nasty bugs in the page/page_dumb combo that could
5869 * Fixed some nasty bugs in the page/page_dumb combo that could
5867 crash IPython.
5870 crash IPython.
5868
5871
5869 2001-11-27 Fernando Perez <fperez@colorado.edu>
5872 2001-11-27 Fernando Perez <fperez@colorado.edu>
5870
5873
5871 * Version 0.1.15 released, 0.1.16 opened.
5874 * Version 0.1.15 released, 0.1.16 opened.
5872
5875
5873 * Finally got ? and ?? to work for undefined things: now it's
5876 * Finally got ? and ?? to work for undefined things: now it's
5874 possible to type {}.get? and get information about the get method
5877 possible to type {}.get? and get information about the get method
5875 of dicts, or os.path? even if only os is defined (so technically
5878 of dicts, or os.path? even if only os is defined (so technically
5876 os.path isn't). Works at any level. For example, after import os,
5879 os.path isn't). Works at any level. For example, after import os,
5877 os?, os.path?, os.path.abspath? all work. This is great, took some
5880 os?, os.path?, os.path.abspath? all work. This is great, took some
5878 work in _ofind.
5881 work in _ofind.
5879
5882
5880 * Fixed more bugs with logging. The sanest way to do it was to add
5883 * Fixed more bugs with logging. The sanest way to do it was to add
5881 to @log a 'mode' parameter. Killed two in one shot (this mode
5884 to @log a 'mode' parameter. Killed two in one shot (this mode
5882 option was a request of Janko's). I think it's finally clean
5885 option was a request of Janko's). I think it's finally clean
5883 (famous last words).
5886 (famous last words).
5884
5887
5885 * Added a page_dumb() pager which does a decent job of paging on
5888 * Added a page_dumb() pager which does a decent job of paging on
5886 screen, if better things (like less) aren't available. One less
5889 screen, if better things (like less) aren't available. One less
5887 unix dependency (someday maybe somebody will port this to
5890 unix dependency (someday maybe somebody will port this to
5888 windows).
5891 windows).
5889
5892
5890 * Fixed problem in magic_log: would lock of logging out if log
5893 * Fixed problem in magic_log: would lock of logging out if log
5891 creation failed (because it would still think it had succeeded).
5894 creation failed (because it would still think it had succeeded).
5892
5895
5893 * Improved the page() function using curses to auto-detect screen
5896 * Improved the page() function using curses to auto-detect screen
5894 size. Now it can make a much better decision on whether to print
5897 size. Now it can make a much better decision on whether to print
5895 or page a string. Option screen_length was modified: a value 0
5898 or page a string. Option screen_length was modified: a value 0
5896 means auto-detect, and that's the default now.
5899 means auto-detect, and that's the default now.
5897
5900
5898 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5901 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5899 go out. I'll test it for a few days, then talk to Janko about
5902 go out. I'll test it for a few days, then talk to Janko about
5900 licences and announce it.
5903 licences and announce it.
5901
5904
5902 * Fixed the length of the auto-generated ---> prompt which appears
5905 * Fixed the length of the auto-generated ---> prompt which appears
5903 for auto-parens and auto-quotes. Getting this right isn't trivial,
5906 for auto-parens and auto-quotes. Getting this right isn't trivial,
5904 with all the color escapes, different prompt types and optional
5907 with all the color escapes, different prompt types and optional
5905 separators. But it seems to be working in all the combinations.
5908 separators. But it seems to be working in all the combinations.
5906
5909
5907 2001-11-26 Fernando Perez <fperez@colorado.edu>
5910 2001-11-26 Fernando Perez <fperez@colorado.edu>
5908
5911
5909 * Wrote a regexp filter to get option types from the option names
5912 * Wrote a regexp filter to get option types from the option names
5910 string. This eliminates the need to manually keep two duplicate
5913 string. This eliminates the need to manually keep two duplicate
5911 lists.
5914 lists.
5912
5915
5913 * Removed the unneeded check_option_names. Now options are handled
5916 * Removed the unneeded check_option_names. Now options are handled
5914 in a much saner manner and it's easy to visually check that things
5917 in a much saner manner and it's easy to visually check that things
5915 are ok.
5918 are ok.
5916
5919
5917 * Updated version numbers on all files I modified to carry a
5920 * Updated version numbers on all files I modified to carry a
5918 notice so Janko and Nathan have clear version markers.
5921 notice so Janko and Nathan have clear version markers.
5919
5922
5920 * Updated docstring for ultraTB with my changes. I should send
5923 * Updated docstring for ultraTB with my changes. I should send
5921 this to Nathan.
5924 this to Nathan.
5922
5925
5923 * Lots of small fixes. Ran everything through pychecker again.
5926 * Lots of small fixes. Ran everything through pychecker again.
5924
5927
5925 * Made loading of deep_reload an cmd line option. If it's not too
5928 * Made loading of deep_reload an cmd line option. If it's not too
5926 kosher, now people can just disable it. With -nodeep_reload it's
5929 kosher, now people can just disable it. With -nodeep_reload it's
5927 still available as dreload(), it just won't overwrite reload().
5930 still available as dreload(), it just won't overwrite reload().
5928
5931
5929 * Moved many options to the no| form (-opt and -noopt
5932 * Moved many options to the no| form (-opt and -noopt
5930 accepted). Cleaner.
5933 accepted). Cleaner.
5931
5934
5932 * Changed magic_log so that if called with no parameters, it uses
5935 * Changed magic_log so that if called with no parameters, it uses
5933 'rotate' mode. That way auto-generated logs aren't automatically
5936 'rotate' mode. That way auto-generated logs aren't automatically
5934 over-written. For normal logs, now a backup is made if it exists
5937 over-written. For normal logs, now a backup is made if it exists
5935 (only 1 level of backups). A new 'backup' mode was added to the
5938 (only 1 level of backups). A new 'backup' mode was added to the
5936 Logger class to support this. This was a request by Janko.
5939 Logger class to support this. This was a request by Janko.
5937
5940
5938 * Added @logoff/@logon to stop/restart an active log.
5941 * Added @logoff/@logon to stop/restart an active log.
5939
5942
5940 * Fixed a lot of bugs in log saving/replay. It was pretty
5943 * Fixed a lot of bugs in log saving/replay. It was pretty
5941 broken. Now special lines (!@,/) appear properly in the command
5944 broken. Now special lines (!@,/) appear properly in the command
5942 history after a log replay.
5945 history after a log replay.
5943
5946
5944 * Tried and failed to implement full session saving via pickle. My
5947 * Tried and failed to implement full session saving via pickle. My
5945 idea was to pickle __main__.__dict__, but modules can't be
5948 idea was to pickle __main__.__dict__, but modules can't be
5946 pickled. This would be a better alternative to replaying logs, but
5949 pickled. This would be a better alternative to replaying logs, but
5947 seems quite tricky to get to work. Changed -session to be called
5950 seems quite tricky to get to work. Changed -session to be called
5948 -logplay, which more accurately reflects what it does. And if we
5951 -logplay, which more accurately reflects what it does. And if we
5949 ever get real session saving working, -session is now available.
5952 ever get real session saving working, -session is now available.
5950
5953
5951 * Implemented color schemes for prompts also. As for tracebacks,
5954 * Implemented color schemes for prompts also. As for tracebacks,
5952 currently only NoColor and Linux are supported. But now the
5955 currently only NoColor and Linux are supported. But now the
5953 infrastructure is in place, based on a generic ColorScheme
5956 infrastructure is in place, based on a generic ColorScheme
5954 class. So writing and activating new schemes both for the prompts
5957 class. So writing and activating new schemes both for the prompts
5955 and the tracebacks should be straightforward.
5958 and the tracebacks should be straightforward.
5956
5959
5957 * Version 0.1.13 released, 0.1.14 opened.
5960 * Version 0.1.13 released, 0.1.14 opened.
5958
5961
5959 * Changed handling of options for output cache. Now counter is
5962 * Changed handling of options for output cache. Now counter is
5960 hardwired starting at 1 and one specifies the maximum number of
5963 hardwired starting at 1 and one specifies the maximum number of
5961 entries *in the outcache* (not the max prompt counter). This is
5964 entries *in the outcache* (not the max prompt counter). This is
5962 much better, since many statements won't increase the cache
5965 much better, since many statements won't increase the cache
5963 count. It also eliminated some confusing options, now there's only
5966 count. It also eliminated some confusing options, now there's only
5964 one: cache_size.
5967 one: cache_size.
5965
5968
5966 * Added 'alias' magic function and magic_alias option in the
5969 * Added 'alias' magic function and magic_alias option in the
5967 ipythonrc file. Now the user can easily define whatever names he
5970 ipythonrc file. Now the user can easily define whatever names he
5968 wants for the magic functions without having to play weird
5971 wants for the magic functions without having to play weird
5969 namespace games. This gives IPython a real shell-like feel.
5972 namespace games. This gives IPython a real shell-like feel.
5970
5973
5971 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5974 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5972 @ or not).
5975 @ or not).
5973
5976
5974 This was one of the last remaining 'visible' bugs (that I know
5977 This was one of the last remaining 'visible' bugs (that I know
5975 of). I think if I can clean up the session loading so it works
5978 of). I think if I can clean up the session loading so it works
5976 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5979 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5977 about licensing).
5980 about licensing).
5978
5981
5979 2001-11-25 Fernando Perez <fperez@colorado.edu>
5982 2001-11-25 Fernando Perez <fperez@colorado.edu>
5980
5983
5981 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5984 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5982 there's a cleaner distinction between what ? and ?? show.
5985 there's a cleaner distinction between what ? and ?? show.
5983
5986
5984 * Added screen_length option. Now the user can define his own
5987 * Added screen_length option. Now the user can define his own
5985 screen size for page() operations.
5988 screen size for page() operations.
5986
5989
5987 * Implemented magic shell-like functions with automatic code
5990 * Implemented magic shell-like functions with automatic code
5988 generation. Now adding another function is just a matter of adding
5991 generation. Now adding another function is just a matter of adding
5989 an entry to a dict, and the function is dynamically generated at
5992 an entry to a dict, and the function is dynamically generated at
5990 run-time. Python has some really cool features!
5993 run-time. Python has some really cool features!
5991
5994
5992 * Renamed many options to cleanup conventions a little. Now all
5995 * Renamed many options to cleanup conventions a little. Now all
5993 are lowercase, and only underscores where needed. Also in the code
5996 are lowercase, and only underscores where needed. Also in the code
5994 option name tables are clearer.
5997 option name tables are clearer.
5995
5998
5996 * Changed prompts a little. Now input is 'In [n]:' instead of
5999 * Changed prompts a little. Now input is 'In [n]:' instead of
5997 'In[n]:='. This allows it the numbers to be aligned with the
6000 'In[n]:='. This allows it the numbers to be aligned with the
5998 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6001 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5999 Python (it was a Mathematica thing). The '...' continuation prompt
6002 Python (it was a Mathematica thing). The '...' continuation prompt
6000 was also changed a little to align better.
6003 was also changed a little to align better.
6001
6004
6002 * Fixed bug when flushing output cache. Not all _p<n> variables
6005 * Fixed bug when flushing output cache. Not all _p<n> variables
6003 exist, so their deletion needs to be wrapped in a try:
6006 exist, so their deletion needs to be wrapped in a try:
6004
6007
6005 * Figured out how to properly use inspect.formatargspec() (it
6008 * Figured out how to properly use inspect.formatargspec() (it
6006 requires the args preceded by *). So I removed all the code from
6009 requires the args preceded by *). So I removed all the code from
6007 _get_pdef in Magic, which was just replicating that.
6010 _get_pdef in Magic, which was just replicating that.
6008
6011
6009 * Added test to prefilter to allow redefining magic function names
6012 * Added test to prefilter to allow redefining magic function names
6010 as variables. This is ok, since the @ form is always available,
6013 as variables. This is ok, since the @ form is always available,
6011 but whe should allow the user to define a variable called 'ls' if
6014 but whe should allow the user to define a variable called 'ls' if
6012 he needs it.
6015 he needs it.
6013
6016
6014 * Moved the ToDo information from README into a separate ToDo.
6017 * Moved the ToDo information from README into a separate ToDo.
6015
6018
6016 * General code cleanup and small bugfixes. I think it's close to a
6019 * General code cleanup and small bugfixes. I think it's close to a
6017 state where it can be released, obviously with a big 'beta'
6020 state where it can be released, obviously with a big 'beta'
6018 warning on it.
6021 warning on it.
6019
6022
6020 * Got the magic function split to work. Now all magics are defined
6023 * Got the magic function split to work. Now all magics are defined
6021 in a separate class. It just organizes things a bit, and now
6024 in a separate class. It just organizes things a bit, and now
6022 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6025 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6023 was too long).
6026 was too long).
6024
6027
6025 * Changed @clear to @reset to avoid potential confusions with
6028 * Changed @clear to @reset to avoid potential confusions with
6026 the shell command clear. Also renamed @cl to @clear, which does
6029 the shell command clear. Also renamed @cl to @clear, which does
6027 exactly what people expect it to from their shell experience.
6030 exactly what people expect it to from their shell experience.
6028
6031
6029 Added a check to the @reset command (since it's so
6032 Added a check to the @reset command (since it's so
6030 destructive, it's probably a good idea to ask for confirmation).
6033 destructive, it's probably a good idea to ask for confirmation).
6031 But now reset only works for full namespace resetting. Since the
6034 But now reset only works for full namespace resetting. Since the
6032 del keyword is already there for deleting a few specific
6035 del keyword is already there for deleting a few specific
6033 variables, I don't see the point of having a redundant magic
6036 variables, I don't see the point of having a redundant magic
6034 function for the same task.
6037 function for the same task.
6035
6038
6036 2001-11-24 Fernando Perez <fperez@colorado.edu>
6039 2001-11-24 Fernando Perez <fperez@colorado.edu>
6037
6040
6038 * Updated the builtin docs (esp. the ? ones).
6041 * Updated the builtin docs (esp. the ? ones).
6039
6042
6040 * Ran all the code through pychecker. Not terribly impressed with
6043 * Ran all the code through pychecker. Not terribly impressed with
6041 it: lots of spurious warnings and didn't really find anything of
6044 it: lots of spurious warnings and didn't really find anything of
6042 substance (just a few modules being imported and not used).
6045 substance (just a few modules being imported and not used).
6043
6046
6044 * Implemented the new ultraTB functionality into IPython. New
6047 * Implemented the new ultraTB functionality into IPython. New
6045 option: xcolors. This chooses color scheme. xmode now only selects
6048 option: xcolors. This chooses color scheme. xmode now only selects
6046 between Plain and Verbose. Better orthogonality.
6049 between Plain and Verbose. Better orthogonality.
6047
6050
6048 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6051 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6049 mode and color scheme for the exception handlers. Now it's
6052 mode and color scheme for the exception handlers. Now it's
6050 possible to have the verbose traceback with no coloring.
6053 possible to have the verbose traceback with no coloring.
6051
6054
6052 2001-11-23 Fernando Perez <fperez@colorado.edu>
6055 2001-11-23 Fernando Perez <fperez@colorado.edu>
6053
6056
6054 * Version 0.1.12 released, 0.1.13 opened.
6057 * Version 0.1.12 released, 0.1.13 opened.
6055
6058
6056 * Removed option to set auto-quote and auto-paren escapes by
6059 * Removed option to set auto-quote and auto-paren escapes by
6057 user. The chances of breaking valid syntax are just too high. If
6060 user. The chances of breaking valid syntax are just too high. If
6058 someone *really* wants, they can always dig into the code.
6061 someone *really* wants, they can always dig into the code.
6059
6062
6060 * Made prompt separators configurable.
6063 * Made prompt separators configurable.
6061
6064
6062 2001-11-22 Fernando Perez <fperez@colorado.edu>
6065 2001-11-22 Fernando Perez <fperez@colorado.edu>
6063
6066
6064 * Small bugfixes in many places.
6067 * Small bugfixes in many places.
6065
6068
6066 * Removed the MyCompleter class from ipplib. It seemed redundant
6069 * Removed the MyCompleter class from ipplib. It seemed redundant
6067 with the C-p,C-n history search functionality. Less code to
6070 with the C-p,C-n history search functionality. Less code to
6068 maintain.
6071 maintain.
6069
6072
6070 * Moved all the original ipython.py code into ipythonlib.py. Right
6073 * Moved all the original ipython.py code into ipythonlib.py. Right
6071 now it's just one big dump into a function called make_IPython, so
6074 now it's just one big dump into a function called make_IPython, so
6072 no real modularity has been gained. But at least it makes the
6075 no real modularity has been gained. But at least it makes the
6073 wrapper script tiny, and since ipythonlib is a module, it gets
6076 wrapper script tiny, and since ipythonlib is a module, it gets
6074 compiled and startup is much faster.
6077 compiled and startup is much faster.
6075
6078
6076 This is a reasobably 'deep' change, so we should test it for a
6079 This is a reasobably 'deep' change, so we should test it for a
6077 while without messing too much more with the code.
6080 while without messing too much more with the code.
6078
6081
6079 2001-11-21 Fernando Perez <fperez@colorado.edu>
6082 2001-11-21 Fernando Perez <fperez@colorado.edu>
6080
6083
6081 * Version 0.1.11 released, 0.1.12 opened for further work.
6084 * Version 0.1.11 released, 0.1.12 opened for further work.
6082
6085
6083 * Removed dependency on Itpl. It was only needed in one place. It
6086 * Removed dependency on Itpl. It was only needed in one place. It
6084 would be nice if this became part of python, though. It makes life
6087 would be nice if this became part of python, though. It makes life
6085 *a lot* easier in some cases.
6088 *a lot* easier in some cases.
6086
6089
6087 * Simplified the prefilter code a bit. Now all handlers are
6090 * Simplified the prefilter code a bit. Now all handlers are
6088 expected to explicitly return a value (at least a blank string).
6091 expected to explicitly return a value (at least a blank string).
6089
6092
6090 * Heavy edits in ipplib. Removed the help system altogether. Now
6093 * Heavy edits in ipplib. Removed the help system altogether. Now
6091 obj?/?? is used for inspecting objects, a magic @doc prints
6094 obj?/?? is used for inspecting objects, a magic @doc prints
6092 docstrings, and full-blown Python help is accessed via the 'help'
6095 docstrings, and full-blown Python help is accessed via the 'help'
6093 keyword. This cleans up a lot of code (less to maintain) and does
6096 keyword. This cleans up a lot of code (less to maintain) and does
6094 the job. Since 'help' is now a standard Python component, might as
6097 the job. Since 'help' is now a standard Python component, might as
6095 well use it and remove duplicate functionality.
6098 well use it and remove duplicate functionality.
6096
6099
6097 Also removed the option to use ipplib as a standalone program. By
6100 Also removed the option to use ipplib as a standalone program. By
6098 now it's too dependent on other parts of IPython to function alone.
6101 now it's too dependent on other parts of IPython to function alone.
6099
6102
6100 * Fixed bug in genutils.pager. It would crash if the pager was
6103 * Fixed bug in genutils.pager. It would crash if the pager was
6101 exited immediately after opening (broken pipe).
6104 exited immediately after opening (broken pipe).
6102
6105
6103 * Trimmed down the VerboseTB reporting a little. The header is
6106 * Trimmed down the VerboseTB reporting a little. The header is
6104 much shorter now and the repeated exception arguments at the end
6107 much shorter now and the repeated exception arguments at the end
6105 have been removed. For interactive use the old header seemed a bit
6108 have been removed. For interactive use the old header seemed a bit
6106 excessive.
6109 excessive.
6107
6110
6108 * Fixed small bug in output of @whos for variables with multi-word
6111 * Fixed small bug in output of @whos for variables with multi-word
6109 types (only first word was displayed).
6112 types (only first word was displayed).
6110
6113
6111 2001-11-17 Fernando Perez <fperez@colorado.edu>
6114 2001-11-17 Fernando Perez <fperez@colorado.edu>
6112
6115
6113 * Version 0.1.10 released, 0.1.11 opened for further work.
6116 * Version 0.1.10 released, 0.1.11 opened for further work.
6114
6117
6115 * Modified dirs and friends. dirs now *returns* the stack (not
6118 * Modified dirs and friends. dirs now *returns* the stack (not
6116 prints), so one can manipulate it as a variable. Convenient to
6119 prints), so one can manipulate it as a variable. Convenient to
6117 travel along many directories.
6120 travel along many directories.
6118
6121
6119 * Fixed bug in magic_pdef: would only work with functions with
6122 * Fixed bug in magic_pdef: would only work with functions with
6120 arguments with default values.
6123 arguments with default values.
6121
6124
6122 2001-11-14 Fernando Perez <fperez@colorado.edu>
6125 2001-11-14 Fernando Perez <fperez@colorado.edu>
6123
6126
6124 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6127 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6125 example with IPython. Various other minor fixes and cleanups.
6128 example with IPython. Various other minor fixes and cleanups.
6126
6129
6127 * Version 0.1.9 released, 0.1.10 opened for further work.
6130 * Version 0.1.9 released, 0.1.10 opened for further work.
6128
6131
6129 * Added sys.path to the list of directories searched in the
6132 * Added sys.path to the list of directories searched in the
6130 execfile= option. It used to be the current directory and the
6133 execfile= option. It used to be the current directory and the
6131 user's IPYTHONDIR only.
6134 user's IPYTHONDIR only.
6132
6135
6133 2001-11-13 Fernando Perez <fperez@colorado.edu>
6136 2001-11-13 Fernando Perez <fperez@colorado.edu>
6134
6137
6135 * Reinstated the raw_input/prefilter separation that Janko had
6138 * Reinstated the raw_input/prefilter separation that Janko had
6136 initially. This gives a more convenient setup for extending the
6139 initially. This gives a more convenient setup for extending the
6137 pre-processor from the outside: raw_input always gets a string,
6140 pre-processor from the outside: raw_input always gets a string,
6138 and prefilter has to process it. We can then redefine prefilter
6141 and prefilter has to process it. We can then redefine prefilter
6139 from the outside and implement extensions for special
6142 from the outside and implement extensions for special
6140 purposes.
6143 purposes.
6141
6144
6142 Today I got one for inputting PhysicalQuantity objects
6145 Today I got one for inputting PhysicalQuantity objects
6143 (from Scientific) without needing any function calls at
6146 (from Scientific) without needing any function calls at
6144 all. Extremely convenient, and it's all done as a user-level
6147 all. Extremely convenient, and it's all done as a user-level
6145 extension (no IPython code was touched). Now instead of:
6148 extension (no IPython code was touched). Now instead of:
6146 a = PhysicalQuantity(4.2,'m/s**2')
6149 a = PhysicalQuantity(4.2,'m/s**2')
6147 one can simply say
6150 one can simply say
6148 a = 4.2 m/s**2
6151 a = 4.2 m/s**2
6149 or even
6152 or even
6150 a = 4.2 m/s^2
6153 a = 4.2 m/s^2
6151
6154
6152 I use this, but it's also a proof of concept: IPython really is
6155 I use this, but it's also a proof of concept: IPython really is
6153 fully user-extensible, even at the level of the parsing of the
6156 fully user-extensible, even at the level of the parsing of the
6154 command line. It's not trivial, but it's perfectly doable.
6157 command line. It's not trivial, but it's perfectly doable.
6155
6158
6156 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6159 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6157 the problem of modules being loaded in the inverse order in which
6160 the problem of modules being loaded in the inverse order in which
6158 they were defined in
6161 they were defined in
6159
6162
6160 * Version 0.1.8 released, 0.1.9 opened for further work.
6163 * Version 0.1.8 released, 0.1.9 opened for further work.
6161
6164
6162 * Added magics pdef, source and file. They respectively show the
6165 * Added magics pdef, source and file. They respectively show the
6163 definition line ('prototype' in C), source code and full python
6166 definition line ('prototype' in C), source code and full python
6164 file for any callable object. The object inspector oinfo uses
6167 file for any callable object. The object inspector oinfo uses
6165 these to show the same information.
6168 these to show the same information.
6166
6169
6167 * Version 0.1.7 released, 0.1.8 opened for further work.
6170 * Version 0.1.7 released, 0.1.8 opened for further work.
6168
6171
6169 * Separated all the magic functions into a class called Magic. The
6172 * Separated all the magic functions into a class called Magic. The
6170 InteractiveShell class was becoming too big for Xemacs to handle
6173 InteractiveShell class was becoming too big for Xemacs to handle
6171 (de-indenting a line would lock it up for 10 seconds while it
6174 (de-indenting a line would lock it up for 10 seconds while it
6172 backtracked on the whole class!)
6175 backtracked on the whole class!)
6173
6176
6174 FIXME: didn't work. It can be done, but right now namespaces are
6177 FIXME: didn't work. It can be done, but right now namespaces are
6175 all messed up. Do it later (reverted it for now, so at least
6178 all messed up. Do it later (reverted it for now, so at least
6176 everything works as before).
6179 everything works as before).
6177
6180
6178 * Got the object introspection system (magic_oinfo) working! I
6181 * Got the object introspection system (magic_oinfo) working! I
6179 think this is pretty much ready for release to Janko, so he can
6182 think this is pretty much ready for release to Janko, so he can
6180 test it for a while and then announce it. Pretty much 100% of what
6183 test it for a while and then announce it. Pretty much 100% of what
6181 I wanted for the 'phase 1' release is ready. Happy, tired.
6184 I wanted for the 'phase 1' release is ready. Happy, tired.
6182
6185
6183 2001-11-12 Fernando Perez <fperez@colorado.edu>
6186 2001-11-12 Fernando Perez <fperez@colorado.edu>
6184
6187
6185 * Version 0.1.6 released, 0.1.7 opened for further work.
6188 * Version 0.1.6 released, 0.1.7 opened for further work.
6186
6189
6187 * Fixed bug in printing: it used to test for truth before
6190 * Fixed bug in printing: it used to test for truth before
6188 printing, so 0 wouldn't print. Now checks for None.
6191 printing, so 0 wouldn't print. Now checks for None.
6189
6192
6190 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6193 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6191 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6194 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6192 reaches by hand into the outputcache. Think of a better way to do
6195 reaches by hand into the outputcache. Think of a better way to do
6193 this later.
6196 this later.
6194
6197
6195 * Various small fixes thanks to Nathan's comments.
6198 * Various small fixes thanks to Nathan's comments.
6196
6199
6197 * Changed magic_pprint to magic_Pprint. This way it doesn't
6200 * Changed magic_pprint to magic_Pprint. This way it doesn't
6198 collide with pprint() and the name is consistent with the command
6201 collide with pprint() and the name is consistent with the command
6199 line option.
6202 line option.
6200
6203
6201 * Changed prompt counter behavior to be fully like
6204 * Changed prompt counter behavior to be fully like
6202 Mathematica's. That is, even input that doesn't return a result
6205 Mathematica's. That is, even input that doesn't return a result
6203 raises the prompt counter. The old behavior was kind of confusing
6206 raises the prompt counter. The old behavior was kind of confusing
6204 (getting the same prompt number several times if the operation
6207 (getting the same prompt number several times if the operation
6205 didn't return a result).
6208 didn't return a result).
6206
6209
6207 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6210 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6208
6211
6209 * Fixed -Classic mode (wasn't working anymore).
6212 * Fixed -Classic mode (wasn't working anymore).
6210
6213
6211 * Added colored prompts using Nathan's new code. Colors are
6214 * Added colored prompts using Nathan's new code. Colors are
6212 currently hardwired, they can be user-configurable. For
6215 currently hardwired, they can be user-configurable. For
6213 developers, they can be chosen in file ipythonlib.py, at the
6216 developers, they can be chosen in file ipythonlib.py, at the
6214 beginning of the CachedOutput class def.
6217 beginning of the CachedOutput class def.
6215
6218
6216 2001-11-11 Fernando Perez <fperez@colorado.edu>
6219 2001-11-11 Fernando Perez <fperez@colorado.edu>
6217
6220
6218 * Version 0.1.5 released, 0.1.6 opened for further work.
6221 * Version 0.1.5 released, 0.1.6 opened for further work.
6219
6222
6220 * Changed magic_env to *return* the environment as a dict (not to
6223 * Changed magic_env to *return* the environment as a dict (not to
6221 print it). This way it prints, but it can also be processed.
6224 print it). This way it prints, but it can also be processed.
6222
6225
6223 * Added Verbose exception reporting to interactive
6226 * Added Verbose exception reporting to interactive
6224 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6227 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6225 traceback. Had to make some changes to the ultraTB file. This is
6228 traceback. Had to make some changes to the ultraTB file. This is
6226 probably the last 'big' thing in my mental todo list. This ties
6229 probably the last 'big' thing in my mental todo list. This ties
6227 in with the next entry:
6230 in with the next entry:
6228
6231
6229 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6232 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6230 has to specify is Plain, Color or Verbose for all exception
6233 has to specify is Plain, Color or Verbose for all exception
6231 handling.
6234 handling.
6232
6235
6233 * Removed ShellServices option. All this can really be done via
6236 * Removed ShellServices option. All this can really be done via
6234 the magic system. It's easier to extend, cleaner and has automatic
6237 the magic system. It's easier to extend, cleaner and has automatic
6235 namespace protection and documentation.
6238 namespace protection and documentation.
6236
6239
6237 2001-11-09 Fernando Perez <fperez@colorado.edu>
6240 2001-11-09 Fernando Perez <fperez@colorado.edu>
6238
6241
6239 * Fixed bug in output cache flushing (missing parameter to
6242 * Fixed bug in output cache flushing (missing parameter to
6240 __init__). Other small bugs fixed (found using pychecker).
6243 __init__). Other small bugs fixed (found using pychecker).
6241
6244
6242 * Version 0.1.4 opened for bugfixing.
6245 * Version 0.1.4 opened for bugfixing.
6243
6246
6244 2001-11-07 Fernando Perez <fperez@colorado.edu>
6247 2001-11-07 Fernando Perez <fperez@colorado.edu>
6245
6248
6246 * Version 0.1.3 released, mainly because of the raw_input bug.
6249 * Version 0.1.3 released, mainly because of the raw_input bug.
6247
6250
6248 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6251 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6249 and when testing for whether things were callable, a call could
6252 and when testing for whether things were callable, a call could
6250 actually be made to certain functions. They would get called again
6253 actually be made to certain functions. They would get called again
6251 once 'really' executed, with a resulting double call. A disaster
6254 once 'really' executed, with a resulting double call. A disaster
6252 in many cases (list.reverse() would never work!).
6255 in many cases (list.reverse() would never work!).
6253
6256
6254 * Removed prefilter() function, moved its code to raw_input (which
6257 * Removed prefilter() function, moved its code to raw_input (which
6255 after all was just a near-empty caller for prefilter). This saves
6258 after all was just a near-empty caller for prefilter). This saves
6256 a function call on every prompt, and simplifies the class a tiny bit.
6259 a function call on every prompt, and simplifies the class a tiny bit.
6257
6260
6258 * Fix _ip to __ip name in magic example file.
6261 * Fix _ip to __ip name in magic example file.
6259
6262
6260 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6263 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6261 work with non-gnu versions of tar.
6264 work with non-gnu versions of tar.
6262
6265
6263 2001-11-06 Fernando Perez <fperez@colorado.edu>
6266 2001-11-06 Fernando Perez <fperez@colorado.edu>
6264
6267
6265 * Version 0.1.2. Just to keep track of the recent changes.
6268 * Version 0.1.2. Just to keep track of the recent changes.
6266
6269
6267 * Fixed nasty bug in output prompt routine. It used to check 'if
6270 * Fixed nasty bug in output prompt routine. It used to check 'if
6268 arg != None...'. Problem is, this fails if arg implements a
6271 arg != None...'. Problem is, this fails if arg implements a
6269 special comparison (__cmp__) which disallows comparing to
6272 special comparison (__cmp__) which disallows comparing to
6270 None. Found it when trying to use the PhysicalQuantity module from
6273 None. Found it when trying to use the PhysicalQuantity module from
6271 ScientificPython.
6274 ScientificPython.
6272
6275
6273 2001-11-05 Fernando Perez <fperez@colorado.edu>
6276 2001-11-05 Fernando Perez <fperez@colorado.edu>
6274
6277
6275 * Also added dirs. Now the pushd/popd/dirs family functions
6278 * Also added dirs. Now the pushd/popd/dirs family functions
6276 basically like the shell, with the added convenience of going home
6279 basically like the shell, with the added convenience of going home
6277 when called with no args.
6280 when called with no args.
6278
6281
6279 * pushd/popd slightly modified to mimic shell behavior more
6282 * pushd/popd slightly modified to mimic shell behavior more
6280 closely.
6283 closely.
6281
6284
6282 * Added env,pushd,popd from ShellServices as magic functions. I
6285 * Added env,pushd,popd from ShellServices as magic functions. I
6283 think the cleanest will be to port all desired functions from
6286 think the cleanest will be to port all desired functions from
6284 ShellServices as magics and remove ShellServices altogether. This
6287 ShellServices as magics and remove ShellServices altogether. This
6285 will provide a single, clean way of adding functionality
6288 will provide a single, clean way of adding functionality
6286 (shell-type or otherwise) to IP.
6289 (shell-type or otherwise) to IP.
6287
6290
6288 2001-11-04 Fernando Perez <fperez@colorado.edu>
6291 2001-11-04 Fernando Perez <fperez@colorado.edu>
6289
6292
6290 * Added .ipython/ directory to sys.path. This way users can keep
6293 * Added .ipython/ directory to sys.path. This way users can keep
6291 customizations there and access them via import.
6294 customizations there and access them via import.
6292
6295
6293 2001-11-03 Fernando Perez <fperez@colorado.edu>
6296 2001-11-03 Fernando Perez <fperez@colorado.edu>
6294
6297
6295 * Opened version 0.1.1 for new changes.
6298 * Opened version 0.1.1 for new changes.
6296
6299
6297 * Changed version number to 0.1.0: first 'public' release, sent to
6300 * Changed version number to 0.1.0: first 'public' release, sent to
6298 Nathan and Janko.
6301 Nathan and Janko.
6299
6302
6300 * Lots of small fixes and tweaks.
6303 * Lots of small fixes and tweaks.
6301
6304
6302 * Minor changes to whos format. Now strings are shown, snipped if
6305 * Minor changes to whos format. Now strings are shown, snipped if
6303 too long.
6306 too long.
6304
6307
6305 * Changed ShellServices to work on __main__ so they show up in @who
6308 * Changed ShellServices to work on __main__ so they show up in @who
6306
6309
6307 * Help also works with ? at the end of a line:
6310 * Help also works with ? at the end of a line:
6308 ?sin and sin?
6311 ?sin and sin?
6309 both produce the same effect. This is nice, as often I use the
6312 both produce the same effect. This is nice, as often I use the
6310 tab-complete to find the name of a method, but I used to then have
6313 tab-complete to find the name of a method, but I used to then have
6311 to go to the beginning of the line to put a ? if I wanted more
6314 to go to the beginning of the line to put a ? if I wanted more
6312 info. Now I can just add the ? and hit return. Convenient.
6315 info. Now I can just add the ? and hit return. Convenient.
6313
6316
6314 2001-11-02 Fernando Perez <fperez@colorado.edu>
6317 2001-11-02 Fernando Perez <fperez@colorado.edu>
6315
6318
6316 * Python version check (>=2.1) added.
6319 * Python version check (>=2.1) added.
6317
6320
6318 * Added LazyPython documentation. At this point the docs are quite
6321 * Added LazyPython documentation. At this point the docs are quite
6319 a mess. A cleanup is in order.
6322 a mess. A cleanup is in order.
6320
6323
6321 * Auto-installer created. For some bizarre reason, the zipfiles
6324 * Auto-installer created. For some bizarre reason, the zipfiles
6322 module isn't working on my system. So I made a tar version
6325 module isn't working on my system. So I made a tar version
6323 (hopefully the command line options in various systems won't kill
6326 (hopefully the command line options in various systems won't kill
6324 me).
6327 me).
6325
6328
6326 * Fixes to Struct in genutils. Now all dictionary-like methods are
6329 * Fixes to Struct in genutils. Now all dictionary-like methods are
6327 protected (reasonably).
6330 protected (reasonably).
6328
6331
6329 * Added pager function to genutils and changed ? to print usage
6332 * Added pager function to genutils and changed ? to print usage
6330 note through it (it was too long).
6333 note through it (it was too long).
6331
6334
6332 * Added the LazyPython functionality. Works great! I changed the
6335 * Added the LazyPython functionality. Works great! I changed the
6333 auto-quote escape to ';', it's on home row and next to '. But
6336 auto-quote escape to ';', it's on home row and next to '. But
6334 both auto-quote and auto-paren (still /) escapes are command-line
6337 both auto-quote and auto-paren (still /) escapes are command-line
6335 parameters.
6338 parameters.
6336
6339
6337
6340
6338 2001-11-01 Fernando Perez <fperez@colorado.edu>
6341 2001-11-01 Fernando Perez <fperez@colorado.edu>
6339
6342
6340 * Version changed to 0.0.7. Fairly large change: configuration now
6343 * Version changed to 0.0.7. Fairly large change: configuration now
6341 is all stored in a directory, by default .ipython. There, all
6344 is all stored in a directory, by default .ipython. There, all
6342 config files have normal looking names (not .names)
6345 config files have normal looking names (not .names)
6343
6346
6344 * Version 0.0.6 Released first to Lucas and Archie as a test
6347 * Version 0.0.6 Released first to Lucas and Archie as a test
6345 run. Since it's the first 'semi-public' release, change version to
6348 run. Since it's the first 'semi-public' release, change version to
6346 > 0.0.6 for any changes now.
6349 > 0.0.6 for any changes now.
6347
6350
6348 * Stuff I had put in the ipplib.py changelog:
6351 * Stuff I had put in the ipplib.py changelog:
6349
6352
6350 Changes to InteractiveShell:
6353 Changes to InteractiveShell:
6351
6354
6352 - Made the usage message a parameter.
6355 - Made the usage message a parameter.
6353
6356
6354 - Require the name of the shell variable to be given. It's a bit
6357 - Require the name of the shell variable to be given. It's a bit
6355 of a hack, but allows the name 'shell' not to be hardwired in the
6358 of a hack, but allows the name 'shell' not to be hardwired in the
6356 magic (@) handler, which is problematic b/c it requires
6359 magic (@) handler, which is problematic b/c it requires
6357 polluting the global namespace with 'shell'. This in turn is
6360 polluting the global namespace with 'shell'. This in turn is
6358 fragile: if a user redefines a variable called shell, things
6361 fragile: if a user redefines a variable called shell, things
6359 break.
6362 break.
6360
6363
6361 - magic @: all functions available through @ need to be defined
6364 - magic @: all functions available through @ need to be defined
6362 as magic_<name>, even though they can be called simply as
6365 as magic_<name>, even though they can be called simply as
6363 @<name>. This allows the special command @magic to gather
6366 @<name>. This allows the special command @magic to gather
6364 information automatically about all existing magic functions,
6367 information automatically about all existing magic functions,
6365 even if they are run-time user extensions, by parsing the shell
6368 even if they are run-time user extensions, by parsing the shell
6366 instance __dict__ looking for special magic_ names.
6369 instance __dict__ looking for special magic_ names.
6367
6370
6368 - mainloop: added *two* local namespace parameters. This allows
6371 - mainloop: added *two* local namespace parameters. This allows
6369 the class to differentiate between parameters which were there
6372 the class to differentiate between parameters which were there
6370 before and after command line initialization was processed. This
6373 before and after command line initialization was processed. This
6371 way, later @who can show things loaded at startup by the
6374 way, later @who can show things loaded at startup by the
6372 user. This trick was necessary to make session saving/reloading
6375 user. This trick was necessary to make session saving/reloading
6373 really work: ideally after saving/exiting/reloading a session,
6376 really work: ideally after saving/exiting/reloading a session,
6374 *everything* should look the same, including the output of @who. I
6377 *everything* should look the same, including the output of @who. I
6375 was only able to make this work with this double namespace
6378 was only able to make this work with this double namespace
6376 trick.
6379 trick.
6377
6380
6378 - added a header to the logfile which allows (almost) full
6381 - added a header to the logfile which allows (almost) full
6379 session restoring.
6382 session restoring.
6380
6383
6381 - prepend lines beginning with @ or !, with a and log
6384 - prepend lines beginning with @ or !, with a and log
6382 them. Why? !lines: may be useful to know what you did @lines:
6385 them. Why? !lines: may be useful to know what you did @lines:
6383 they may affect session state. So when restoring a session, at
6386 they may affect session state. So when restoring a session, at
6384 least inform the user of their presence. I couldn't quite get
6387 least inform the user of their presence. I couldn't quite get
6385 them to properly re-execute, but at least the user is warned.
6388 them to properly re-execute, but at least the user is warned.
6386
6389
6387 * Started ChangeLog.
6390 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now