##// END OF EJS Templates
Restore sys.last_traceback and friends, for the benefit of pdb.pm(). Let's hope it doesn't cause problems with threaded shells (tested, OK so far). Other exception-related cleanups.
fperez -
Show More
@@ -1,2268 +1,2278 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 1140 2006-02-10 17:07:11Z vivainio $
9 $Id: iplib.py 1202 2006-03-12 06:37:52Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from __future__ import generators # for 2.2 backwards-compatibility
31 from __future__ import generators # for 2.2 backwards-compatibility
32
32
33 from IPython import Release
33 from IPython import Release
34 __author__ = '%s <%s>\n%s <%s>' % \
34 __author__ = '%s <%s>\n%s <%s>' % \
35 ( Release.authors['Janko'] + Release.authors['Fernando'] )
35 ( Release.authors['Janko'] + Release.authors['Fernando'] )
36 __license__ = Release.license
36 __license__ = Release.license
37 __version__ = Release.version
37 __version__ = Release.version
38
38
39 # Python standard modules
39 # Python standard modules
40 import __main__
40 import __main__
41 import __builtin__
41 import __builtin__
42 import StringIO
42 import StringIO
43 import bdb
43 import bdb
44 import cPickle as pickle
44 import cPickle as pickle
45 import codeop
45 import codeop
46 import exceptions
46 import exceptions
47 import glob
47 import glob
48 import inspect
48 import inspect
49 import keyword
49 import keyword
50 import new
50 import new
51 import os
51 import os
52 import pdb
52 import pdb
53 import pydoc
53 import pydoc
54 import re
54 import re
55 import shutil
55 import shutil
56 import string
56 import string
57 import sys
57 import sys
58 import tempfile
58 import tempfile
59 import traceback
59 import traceback
60 import types
60 import types
61 import pickleshare
61 import pickleshare
62
62
63 from pprint import pprint, pformat
63 from pprint import pprint, pformat
64
64
65 # IPython's own modules
65 # IPython's own modules
66 import IPython
66 import IPython
67 from IPython import OInspect,PyColorize,ultraTB
67 from IPython import OInspect,PyColorize,ultraTB
68 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
68 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
69 from IPython.FakeModule import FakeModule
69 from IPython.FakeModule import FakeModule
70 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
70 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
71 from IPython.Logger import Logger
71 from IPython.Logger import Logger
72 from IPython.Magic import Magic
72 from IPython.Magic import Magic
73 from IPython.Prompts import CachedOutput
73 from IPython.Prompts import CachedOutput
74 from IPython.ipstruct import Struct
74 from IPython.ipstruct import Struct
75 from IPython.background_jobs import BackgroundJobManager
75 from IPython.background_jobs import BackgroundJobManager
76 from IPython.usage import cmd_line_usage,interactive_usage
76 from IPython.usage import cmd_line_usage,interactive_usage
77 from IPython.genutils import *
77 from IPython.genutils import *
78 import IPython.ipapi
78 import IPython.ipapi
79
79
80 # Globals
80 # Globals
81
81
82 # store the builtin raw_input globally, and use this always, in case user code
82 # store the builtin raw_input globally, and use this always, in case user code
83 # overwrites it (like wx.py.PyShell does)
83 # overwrites it (like wx.py.PyShell does)
84 raw_input_original = raw_input
84 raw_input_original = raw_input
85
85
86 # compiled regexps for autoindent management
86 # compiled regexps for autoindent management
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88
88
89
89
90 #****************************************************************************
90 #****************************************************************************
91 # Some utility function definitions
91 # Some utility function definitions
92
92
93 ini_spaces_re = re.compile(r'^(\s+)')
93 ini_spaces_re = re.compile(r'^(\s+)')
94
94
95 def num_ini_spaces(strng):
95 def num_ini_spaces(strng):
96 """Return the number of initial spaces in a string"""
96 """Return the number of initial spaces in a string"""
97
97
98 ini_spaces = ini_spaces_re.match(strng)
98 ini_spaces = ini_spaces_re.match(strng)
99 if ini_spaces:
99 if ini_spaces:
100 return ini_spaces.end()
100 return ini_spaces.end()
101 else:
101 else:
102 return 0
102 return 0
103
103
104 def softspace(file, newvalue):
104 def softspace(file, newvalue):
105 """Copied from code.py, to remove the dependency"""
105 """Copied from code.py, to remove the dependency"""
106
106
107 oldvalue = 0
107 oldvalue = 0
108 try:
108 try:
109 oldvalue = file.softspace
109 oldvalue = file.softspace
110 except AttributeError:
110 except AttributeError:
111 pass
111 pass
112 try:
112 try:
113 file.softspace = newvalue
113 file.softspace = newvalue
114 except (AttributeError, TypeError):
114 except (AttributeError, TypeError):
115 # "attribute-less object" or "read-only attributes"
115 # "attribute-less object" or "read-only attributes"
116 pass
116 pass
117 return oldvalue
117 return oldvalue
118
118
119
119
120 #****************************************************************************
120 #****************************************************************************
121 # Local use exceptions
121 # Local use exceptions
122 class SpaceInInput(exceptions.Exception): pass
122 class SpaceInInput(exceptions.Exception): pass
123
123
124
124
125 #****************************************************************************
125 #****************************************************************************
126 # Local use classes
126 # Local use classes
127 class Bunch: pass
127 class Bunch: pass
128
128
129 class Undefined: pass
129 class Undefined: pass
130
130
131 class InputList(list):
131 class InputList(list):
132 """Class to store user input.
132 """Class to store user input.
133
133
134 It's basically a list, but slices return a string instead of a list, thus
134 It's basically a list, but slices return a string instead of a list, thus
135 allowing things like (assuming 'In' is an instance):
135 allowing things like (assuming 'In' is an instance):
136
136
137 exec In[4:7]
137 exec In[4:7]
138
138
139 or
139 or
140
140
141 exec In[5:9] + In[14] + In[21:25]"""
141 exec In[5:9] + In[14] + In[21:25]"""
142
142
143 def __getslice__(self,i,j):
143 def __getslice__(self,i,j):
144 return ''.join(list.__getslice__(self,i,j))
144 return ''.join(list.__getslice__(self,i,j))
145
145
146 class SyntaxTB(ultraTB.ListTB):
146 class SyntaxTB(ultraTB.ListTB):
147 """Extension which holds some state: the last exception value"""
147 """Extension which holds some state: the last exception value"""
148
148
149 def __init__(self,color_scheme = 'NoColor'):
149 def __init__(self,color_scheme = 'NoColor'):
150 ultraTB.ListTB.__init__(self,color_scheme)
150 ultraTB.ListTB.__init__(self,color_scheme)
151 self.last_syntax_error = None
151 self.last_syntax_error = None
152
152
153 def __call__(self, etype, value, elist):
153 def __call__(self, etype, value, elist):
154 self.last_syntax_error = value
154 self.last_syntax_error = value
155 ultraTB.ListTB.__call__(self,etype,value,elist)
155 ultraTB.ListTB.__call__(self,etype,value,elist)
156
156
157 def clear_err_state(self):
157 def clear_err_state(self):
158 """Return the current error state and clear it"""
158 """Return the current error state and clear it"""
159 e = self.last_syntax_error
159 e = self.last_syntax_error
160 self.last_syntax_error = None
160 self.last_syntax_error = None
161 return e
161 return e
162
162
163 #****************************************************************************
163 #****************************************************************************
164 # Main IPython class
164 # Main IPython class
165
165
166 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
166 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
167 # until a full rewrite is made. I've cleaned all cross-class uses of
167 # until a full rewrite is made. I've cleaned all cross-class uses of
168 # attributes and methods, but too much user code out there relies on the
168 # attributes and methods, but too much user code out there relies on the
169 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
169 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
170 #
170 #
171 # But at least now, all the pieces have been separated and we could, in
171 # But at least now, all the pieces have been separated and we could, in
172 # principle, stop using the mixin. This will ease the transition to the
172 # principle, stop using the mixin. This will ease the transition to the
173 # chainsaw branch.
173 # chainsaw branch.
174
174
175 # For reference, the following is the list of 'self.foo' uses in the Magic
175 # For reference, the following is the list of 'self.foo' uses in the Magic
176 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
176 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
177 # class, to prevent clashes.
177 # class, to prevent clashes.
178
178
179 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
179 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
180 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
180 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
181 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
181 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
182 # 'self.value']
182 # 'self.value']
183
183
184 class InteractiveShell(object,Magic):
184 class InteractiveShell(object,Magic):
185 """An enhanced console for Python."""
185 """An enhanced console for Python."""
186
186
187 # class attribute to indicate whether the class supports threads or not.
187 # class attribute to indicate whether the class supports threads or not.
188 # Subclasses with thread support should override this as needed.
188 # Subclasses with thread support should override this as needed.
189 isthreaded = False
189 isthreaded = False
190
190
191 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
191 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
192 user_ns = None,user_global_ns=None,banner2='',
192 user_ns = None,user_global_ns=None,banner2='',
193 custom_exceptions=((),None),embedded=False):
193 custom_exceptions=((),None),embedded=False):
194
194
195
195
196 # log system
196 # log system
197 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
197 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
198
198
199 # Produce a public API instance
199 # Produce a public API instance
200
200
201 self.api = IPython.ipapi.IPApi(self)
201 self.api = IPython.ipapi.IPApi(self)
202
202
203 # some minimal strict typechecks. For some core data structures, I
203 # some minimal strict typechecks. For some core data structures, I
204 # want actual basic python types, not just anything that looks like
204 # want actual basic python types, not just anything that looks like
205 # one. This is especially true for namespaces.
205 # one. This is especially true for namespaces.
206 for ns in (user_ns,user_global_ns):
206 for ns in (user_ns,user_global_ns):
207 if ns is not None and type(ns) != types.DictType:
207 if ns is not None and type(ns) != types.DictType:
208 raise TypeError,'namespace must be a dictionary'
208 raise TypeError,'namespace must be a dictionary'
209
209
210 # Job manager (for jobs run as background threads)
210 # Job manager (for jobs run as background threads)
211 self.jobs = BackgroundJobManager()
211 self.jobs = BackgroundJobManager()
212
212
213 # track which builtins we add, so we can clean up later
213 # track which builtins we add, so we can clean up later
214 self.builtins_added = {}
214 self.builtins_added = {}
215 # This method will add the necessary builtins for operation, but
215 # This method will add the necessary builtins for operation, but
216 # tracking what it did via the builtins_added dict.
216 # tracking what it did via the builtins_added dict.
217 self.add_builtins()
217 self.add_builtins()
218
218
219 # Do the intuitively correct thing for quit/exit: we remove the
219 # Do the intuitively correct thing for quit/exit: we remove the
220 # builtins if they exist, and our own magics will deal with this
220 # builtins if they exist, and our own magics will deal with this
221 try:
221 try:
222 del __builtin__.exit, __builtin__.quit
222 del __builtin__.exit, __builtin__.quit
223 except AttributeError:
223 except AttributeError:
224 pass
224 pass
225
225
226 # Store the actual shell's name
226 # Store the actual shell's name
227 self.name = name
227 self.name = name
228
228
229 # We need to know whether the instance is meant for embedding, since
229 # We need to know whether the instance is meant for embedding, since
230 # global/local namespaces need to be handled differently in that case
230 # global/local namespaces need to be handled differently in that case
231 self.embedded = embedded
231 self.embedded = embedded
232
232
233 # command compiler
233 # command compiler
234 self.compile = codeop.CommandCompiler()
234 self.compile = codeop.CommandCompiler()
235
235
236 # User input buffer
236 # User input buffer
237 self.buffer = []
237 self.buffer = []
238
238
239 # Default name given in compilation of code
239 # Default name given in compilation of code
240 self.filename = '<ipython console>'
240 self.filename = '<ipython console>'
241
241
242 # Make an empty namespace, which extension writers can rely on both
242 # Make an empty namespace, which extension writers can rely on both
243 # existing and NEVER being used by ipython itself. This gives them a
243 # existing and NEVER being used by ipython itself. This gives them a
244 # convenient location for storing additional information and state
244 # convenient location for storing additional information and state
245 # their extensions may require, without fear of collisions with other
245 # their extensions may require, without fear of collisions with other
246 # ipython names that may develop later.
246 # ipython names that may develop later.
247 self.meta = Struct()
247 self.meta = Struct()
248
248
249 # Create the namespace where the user will operate. user_ns is
249 # Create the namespace where the user will operate. user_ns is
250 # normally the only one used, and it is passed to the exec calls as
250 # normally the only one used, and it is passed to the exec calls as
251 # the locals argument. But we do carry a user_global_ns namespace
251 # the locals argument. But we do carry a user_global_ns namespace
252 # given as the exec 'globals' argument, This is useful in embedding
252 # given as the exec 'globals' argument, This is useful in embedding
253 # situations where the ipython shell opens in a context where the
253 # situations where the ipython shell opens in a context where the
254 # distinction between locals and globals is meaningful.
254 # distinction between locals and globals is meaningful.
255
255
256 # FIXME. For some strange reason, __builtins__ is showing up at user
256 # FIXME. For some strange reason, __builtins__ is showing up at user
257 # level as a dict instead of a module. This is a manual fix, but I
257 # level as a dict instead of a module. This is a manual fix, but I
258 # should really track down where the problem is coming from. Alex
258 # should really track down where the problem is coming from. Alex
259 # Schmolck reported this problem first.
259 # Schmolck reported this problem first.
260
260
261 # A useful post by Alex Martelli on this topic:
261 # A useful post by Alex Martelli on this topic:
262 # Re: inconsistent value from __builtins__
262 # Re: inconsistent value from __builtins__
263 # Von: Alex Martelli <aleaxit@yahoo.com>
263 # Von: Alex Martelli <aleaxit@yahoo.com>
264 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
264 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
265 # Gruppen: comp.lang.python
265 # Gruppen: comp.lang.python
266
266
267 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
267 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
268 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
268 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
269 # > <type 'dict'>
269 # > <type 'dict'>
270 # > >>> print type(__builtins__)
270 # > >>> print type(__builtins__)
271 # > <type 'module'>
271 # > <type 'module'>
272 # > Is this difference in return value intentional?
272 # > Is this difference in return value intentional?
273
273
274 # Well, it's documented that '__builtins__' can be either a dictionary
274 # Well, it's documented that '__builtins__' can be either a dictionary
275 # or a module, and it's been that way for a long time. Whether it's
275 # or a module, and it's been that way for a long time. Whether it's
276 # intentional (or sensible), I don't know. In any case, the idea is
276 # intentional (or sensible), I don't know. In any case, the idea is
277 # that if you need to access the built-in namespace directly, you
277 # that if you need to access the built-in namespace directly, you
278 # should start with "import __builtin__" (note, no 's') which will
278 # should start with "import __builtin__" (note, no 's') which will
279 # definitely give you a module. Yeah, it's somewhat confusing:-(.
279 # definitely give you a module. Yeah, it's somewhat confusing:-(.
280
280
281 if user_ns is None:
281 if user_ns is None:
282 # Set __name__ to __main__ to better match the behavior of the
282 # Set __name__ to __main__ to better match the behavior of the
283 # normal interpreter.
283 # normal interpreter.
284 user_ns = {'__name__' :'__main__',
284 user_ns = {'__name__' :'__main__',
285 '__builtins__' : __builtin__,
285 '__builtins__' : __builtin__,
286 }
286 }
287
287
288 if user_global_ns is None:
288 if user_global_ns is None:
289 user_global_ns = {}
289 user_global_ns = {}
290
290
291 # Assign namespaces
291 # Assign namespaces
292 # This is the namespace where all normal user variables live
292 # This is the namespace where all normal user variables live
293 self.user_ns = user_ns
293 self.user_ns = user_ns
294 # Embedded instances require a separate namespace for globals.
294 # Embedded instances require a separate namespace for globals.
295 # Normally this one is unused by non-embedded instances.
295 # Normally this one is unused by non-embedded instances.
296 self.user_global_ns = user_global_ns
296 self.user_global_ns = user_global_ns
297 # A namespace to keep track of internal data structures to prevent
297 # A namespace to keep track of internal data structures to prevent
298 # them from cluttering user-visible stuff. Will be updated later
298 # them from cluttering user-visible stuff. Will be updated later
299 self.internal_ns = {}
299 self.internal_ns = {}
300
300
301 # Namespace of system aliases. Each entry in the alias
301 # Namespace of system aliases. Each entry in the alias
302 # table must be a 2-tuple of the form (N,name), where N is the number
302 # table must be a 2-tuple of the form (N,name), where N is the number
303 # of positional arguments of the alias.
303 # of positional arguments of the alias.
304 self.alias_table = {}
304 self.alias_table = {}
305
305
306 # A table holding all the namespaces IPython deals with, so that
306 # A table holding all the namespaces IPython deals with, so that
307 # introspection facilities can search easily.
307 # introspection facilities can search easily.
308 self.ns_table = {'user':user_ns,
308 self.ns_table = {'user':user_ns,
309 'user_global':user_global_ns,
309 'user_global':user_global_ns,
310 'alias':self.alias_table,
310 'alias':self.alias_table,
311 'internal':self.internal_ns,
311 'internal':self.internal_ns,
312 'builtin':__builtin__.__dict__
312 'builtin':__builtin__.__dict__
313 }
313 }
314
314
315 # The user namespace MUST have a pointer to the shell itself.
315 # The user namespace MUST have a pointer to the shell itself.
316 self.user_ns[name] = self
316 self.user_ns[name] = self
317
317
318 # We need to insert into sys.modules something that looks like a
318 # We need to insert into sys.modules something that looks like a
319 # module but which accesses the IPython namespace, for shelve and
319 # module but which accesses the IPython namespace, for shelve and
320 # pickle to work interactively. Normally they rely on getting
320 # pickle to work interactively. Normally they rely on getting
321 # everything out of __main__, but for embedding purposes each IPython
321 # everything out of __main__, but for embedding purposes each IPython
322 # instance has its own private namespace, so we can't go shoving
322 # instance has its own private namespace, so we can't go shoving
323 # everything into __main__.
323 # everything into __main__.
324
324
325 # note, however, that we should only do this for non-embedded
325 # note, however, that we should only do this for non-embedded
326 # ipythons, which really mimic the __main__.__dict__ with their own
326 # ipythons, which really mimic the __main__.__dict__ with their own
327 # namespace. Embedded instances, on the other hand, should not do
327 # namespace. Embedded instances, on the other hand, should not do
328 # this because they need to manage the user local/global namespaces
328 # this because they need to manage the user local/global namespaces
329 # only, but they live within a 'normal' __main__ (meaning, they
329 # only, but they live within a 'normal' __main__ (meaning, they
330 # shouldn't overtake the execution environment of the script they're
330 # shouldn't overtake the execution environment of the script they're
331 # embedded in).
331 # embedded in).
332
332
333 if not embedded:
333 if not embedded:
334 try:
334 try:
335 main_name = self.user_ns['__name__']
335 main_name = self.user_ns['__name__']
336 except KeyError:
336 except KeyError:
337 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
337 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
338 else:
338 else:
339 #print "pickle hack in place" # dbg
339 #print "pickle hack in place" # dbg
340 #print 'main_name:',main_name # dbg
340 #print 'main_name:',main_name # dbg
341 sys.modules[main_name] = FakeModule(self.user_ns)
341 sys.modules[main_name] = FakeModule(self.user_ns)
342
342
343 # List of input with multi-line handling.
343 # List of input with multi-line handling.
344 # Fill its zero entry, user counter starts at 1
344 # Fill its zero entry, user counter starts at 1
345 self.input_hist = InputList(['\n'])
345 self.input_hist = InputList(['\n'])
346 # This one will hold the 'raw' input history, without any
346 # This one will hold the 'raw' input history, without any
347 # pre-processing. This will allow users to retrieve the input just as
347 # pre-processing. This will allow users to retrieve the input just as
348 # it was exactly typed in by the user, with %hist -r.
348 # it was exactly typed in by the user, with %hist -r.
349 self.input_hist_raw = InputList(['\n'])
349 self.input_hist_raw = InputList(['\n'])
350
350
351 # list of visited directories
351 # list of visited directories
352 try:
352 try:
353 self.dir_hist = [os.getcwd()]
353 self.dir_hist = [os.getcwd()]
354 except IOError, e:
354 except IOError, e:
355 self.dir_hist = []
355 self.dir_hist = []
356
356
357 # dict of output history
357 # dict of output history
358 self.output_hist = {}
358 self.output_hist = {}
359
359
360 # dict of things NOT to alias (keywords, builtins and some magics)
360 # dict of things NOT to alias (keywords, builtins and some magics)
361 no_alias = {}
361 no_alias = {}
362 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
362 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
363 for key in keyword.kwlist + no_alias_magics:
363 for key in keyword.kwlist + no_alias_magics:
364 no_alias[key] = 1
364 no_alias[key] = 1
365 no_alias.update(__builtin__.__dict__)
365 no_alias.update(__builtin__.__dict__)
366 self.no_alias = no_alias
366 self.no_alias = no_alias
367
367
368 # make global variables for user access to these
368 # make global variables for user access to these
369 self.user_ns['_ih'] = self.input_hist
369 self.user_ns['_ih'] = self.input_hist
370 self.user_ns['_oh'] = self.output_hist
370 self.user_ns['_oh'] = self.output_hist
371 self.user_ns['_dh'] = self.dir_hist
371 self.user_ns['_dh'] = self.dir_hist
372
372
373 # user aliases to input and output histories
373 # user aliases to input and output histories
374 self.user_ns['In'] = self.input_hist
374 self.user_ns['In'] = self.input_hist
375 self.user_ns['Out'] = self.output_hist
375 self.user_ns['Out'] = self.output_hist
376
376
377 # Object variable to store code object waiting execution. This is
377 # Object variable to store code object waiting execution. This is
378 # used mainly by the multithreaded shells, but it can come in handy in
378 # used mainly by the multithreaded shells, but it can come in handy in
379 # other situations. No need to use a Queue here, since it's a single
379 # other situations. No need to use a Queue here, since it's a single
380 # item which gets cleared once run.
380 # item which gets cleared once run.
381 self.code_to_run = None
381 self.code_to_run = None
382
382
383 # escapes for automatic behavior on the command line
383 # escapes for automatic behavior on the command line
384 self.ESC_SHELL = '!'
384 self.ESC_SHELL = '!'
385 self.ESC_HELP = '?'
385 self.ESC_HELP = '?'
386 self.ESC_MAGIC = '%'
386 self.ESC_MAGIC = '%'
387 self.ESC_QUOTE = ','
387 self.ESC_QUOTE = ','
388 self.ESC_QUOTE2 = ';'
388 self.ESC_QUOTE2 = ';'
389 self.ESC_PAREN = '/'
389 self.ESC_PAREN = '/'
390
390
391 # And their associated handlers
391 # And their associated handlers
392 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
392 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
393 self.ESC_QUOTE : self.handle_auto,
393 self.ESC_QUOTE : self.handle_auto,
394 self.ESC_QUOTE2 : self.handle_auto,
394 self.ESC_QUOTE2 : self.handle_auto,
395 self.ESC_MAGIC : self.handle_magic,
395 self.ESC_MAGIC : self.handle_magic,
396 self.ESC_HELP : self.handle_help,
396 self.ESC_HELP : self.handle_help,
397 self.ESC_SHELL : self.handle_shell_escape,
397 self.ESC_SHELL : self.handle_shell_escape,
398 }
398 }
399
399
400 # class initializations
400 # class initializations
401 Magic.__init__(self,self)
401 Magic.__init__(self,self)
402
402
403 # Python source parser/formatter for syntax highlighting
403 # Python source parser/formatter for syntax highlighting
404 pyformat = PyColorize.Parser().format
404 pyformat = PyColorize.Parser().format
405 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
405 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
406
406
407 # hooks holds pointers used for user-side customizations
407 # hooks holds pointers used for user-side customizations
408 self.hooks = Struct()
408 self.hooks = Struct()
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 # utility to expand user variables via Itpl
463 # utility to expand user variables via Itpl
464 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
464 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
465 self.user_ns))
465 self.user_ns))
466 # The first is similar to os.system, but it doesn't return a value,
466 # The first is similar to os.system, but it doesn't return a value,
467 # and it allows interpolation of variables in the user's namespace.
467 # and it allows interpolation of variables in the user's namespace.
468 self.system = lambda cmd: shell(self.var_expand(cmd),
468 self.system = lambda cmd: shell(self.var_expand(cmd),
469 header='IPython system call: ',
469 header='IPython system call: ',
470 verbose=self.rc.system_verbose)
470 verbose=self.rc.system_verbose)
471 # These are for getoutput and getoutputerror:
471 # These are for getoutput and getoutputerror:
472 self.getoutput = lambda cmd: \
472 self.getoutput = lambda cmd: \
473 getoutput(self.var_expand(cmd),
473 getoutput(self.var_expand(cmd),
474 header='IPython system call: ',
474 header='IPython system call: ',
475 verbose=self.rc.system_verbose)
475 verbose=self.rc.system_verbose)
476 self.getoutputerror = lambda cmd: \
476 self.getoutputerror = lambda cmd: \
477 getoutputerror(str(ItplNS(cmd.replace('#','\#'),
477 getoutputerror(str(ItplNS(cmd.replace('#','\#'),
478 self.user_ns)),
478 self.user_ns)),
479 header='IPython system call: ',
479 header='IPython system call: ',
480 verbose=self.rc.system_verbose)
480 verbose=self.rc.system_verbose)
481
481
482 # RegExp for splitting line contents into pre-char//first
482 # RegExp for splitting line contents into pre-char//first
483 # word-method//rest. For clarity, each group in on one line.
483 # word-method//rest. For clarity, each group in on one line.
484
484
485 # WARNING: update the regexp if the above escapes are changed, as they
485 # WARNING: update the regexp if the above escapes are changed, as they
486 # are hardwired in.
486 # are hardwired in.
487
487
488 # Don't get carried away with trying to make the autocalling catch too
488 # Don't get carried away with trying to make the autocalling catch too
489 # much: it's better to be conservative rather than to trigger hidden
489 # much: it's better to be conservative rather than to trigger hidden
490 # evals() somewhere and end up causing side effects.
490 # evals() somewhere and end up causing side effects.
491
491
492 self.line_split = re.compile(r'^([\s*,;/])'
492 self.line_split = re.compile(r'^([\s*,;/])'
493 r'([\?\w\.]+\w*\s*)'
493 r'([\?\w\.]+\w*\s*)'
494 r'(\(?.*$)')
494 r'(\(?.*$)')
495
495
496 # Original re, keep around for a while in case changes break something
496 # Original re, keep around for a while in case changes break something
497 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
497 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
498 # r'(\s*[\?\w\.]+\w*\s*)'
498 # r'(\s*[\?\w\.]+\w*\s*)'
499 # r'(\(?.*$)')
499 # r'(\(?.*$)')
500
500
501 # RegExp to identify potential function names
501 # RegExp to identify potential function names
502 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
502 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
503
503
504 # RegExp to exclude strings with this start from autocalling. In
504 # RegExp to exclude strings with this start from autocalling. In
505 # particular, all binary operators should be excluded, so that if foo
505 # particular, all binary operators should be excluded, so that if foo
506 # is callable, foo OP bar doesn't become foo(OP bar), which is
506 # is callable, foo OP bar doesn't become foo(OP bar), which is
507 # invalid. The characters '!=()' don't need to be checked for, as the
507 # invalid. The characters '!=()' don't need to be checked for, as the
508 # _prefilter routine explicitely does so, to catch direct calls and
508 # _prefilter routine explicitely does so, to catch direct calls and
509 # rebindings of existing names.
509 # rebindings of existing names.
510
510
511 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
511 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
512 # it affects the rest of the group in square brackets.
512 # it affects the rest of the group in square brackets.
513 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
513 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
514 '|^is |^not |^in |^and |^or ')
514 '|^is |^not |^in |^and |^or ')
515
515
516 # try to catch also methods for stuff in lists/tuples/dicts: off
516 # try to catch also methods for stuff in lists/tuples/dicts: off
517 # (experimental). For this to work, the line_split regexp would need
517 # (experimental). For this to work, the line_split regexp would need
518 # to be modified so it wouldn't break things at '['. That line is
518 # to be modified so it wouldn't break things at '['. That line is
519 # nasty enough that I shouldn't change it until I can test it _well_.
519 # nasty enough that I shouldn't change it until I can test it _well_.
520 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
520 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
521
521
522 # keep track of where we started running (mainly for crash post-mortem)
522 # keep track of where we started running (mainly for crash post-mortem)
523 self.starting_dir = os.getcwd()
523 self.starting_dir = os.getcwd()
524
524
525 # Various switches which can be set
525 # Various switches which can be set
526 self.CACHELENGTH = 5000 # this is cheap, it's just text
526 self.CACHELENGTH = 5000 # this is cheap, it's just text
527 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
527 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
528 self.banner2 = banner2
528 self.banner2 = banner2
529
529
530 # TraceBack handlers:
530 # TraceBack handlers:
531
531
532 # Syntax error handler.
532 # Syntax error handler.
533 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
533 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
534
534
535 # The interactive one is initialized with an offset, meaning we always
535 # The interactive one is initialized with an offset, meaning we always
536 # want to remove the topmost item in the traceback, which is our own
536 # want to remove the topmost item in the traceback, which is our own
537 # internal code. Valid modes: ['Plain','Context','Verbose']
537 # internal code. Valid modes: ['Plain','Context','Verbose']
538 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
538 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
539 color_scheme='NoColor',
539 color_scheme='NoColor',
540 tb_offset = 1)
540 tb_offset = 1)
541
541
542 # IPython itself shouldn't crash. This will produce a detailed
542 # IPython itself shouldn't crash. This will produce a detailed
543 # post-mortem if it does. But we only install the crash handler for
543 # post-mortem if it does. But we only install the crash handler for
544 # non-threaded shells, the threaded ones use a normal verbose reporter
544 # non-threaded shells, the threaded ones use a normal verbose reporter
545 # and lose the crash handler. This is because exceptions in the main
545 # and lose the crash handler. This is because exceptions in the main
546 # thread (such as in GUI code) propagate directly to sys.excepthook,
546 # thread (such as in GUI code) propagate directly to sys.excepthook,
547 # and there's no point in printing crash dumps for every user exception.
547 # and there's no point in printing crash dumps for every user exception.
548 if self.isthreaded:
548 if self.isthreaded:
549 sys.excepthook = ultraTB.FormattedTB()
549 sys.excepthook = ultraTB.FormattedTB()
550 else:
550 else:
551 from IPython import CrashHandler
551 from IPython import CrashHandler
552 sys.excepthook = CrashHandler.CrashHandler(self)
552 sys.excepthook = CrashHandler.CrashHandler(self)
553
553
554 # The instance will store a pointer to this, so that runtime code
554 # The instance will store a pointer to this, so that runtime code
555 # (such as magics) can access it. This is because during the
555 # (such as magics) can access it. This is because during the
556 # read-eval loop, it gets temporarily overwritten (to deal with GUI
556 # read-eval loop, it gets temporarily overwritten (to deal with GUI
557 # frameworks).
557 # frameworks).
558 self.sys_excepthook = sys.excepthook
558 self.sys_excepthook = sys.excepthook
559
559
560 # and add any custom exception handlers the user may have specified
560 # and add any custom exception handlers the user may have specified
561 self.set_custom_exc(*custom_exceptions)
561 self.set_custom_exc(*custom_exceptions)
562
562
563 # Object inspector
563 # Object inspector
564 self.inspector = OInspect.Inspector(OInspect.InspectColors,
564 self.inspector = OInspect.Inspector(OInspect.InspectColors,
565 PyColorize.ANSICodeColors,
565 PyColorize.ANSICodeColors,
566 'NoColor')
566 'NoColor')
567 # indentation management
567 # indentation management
568 self.autoindent = False
568 self.autoindent = False
569 self.indent_current_nsp = 0
569 self.indent_current_nsp = 0
570
570
571 # Make some aliases automatically
571 # Make some aliases automatically
572 # Prepare list of shell aliases to auto-define
572 # Prepare list of shell aliases to auto-define
573 if os.name == 'posix':
573 if os.name == 'posix':
574 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
574 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
575 'mv mv -i','rm rm -i','cp cp -i',
575 'mv mv -i','rm rm -i','cp cp -i',
576 'cat cat','less less','clear clear',
576 'cat cat','less less','clear clear',
577 # a better ls
577 # a better ls
578 'ls ls -F',
578 'ls ls -F',
579 # long ls
579 # long ls
580 'll ls -lF',
580 'll ls -lF',
581 # color ls
581 # color ls
582 'lc ls -F -o --color',
582 'lc ls -F -o --color',
583 # ls normal files only
583 # ls normal files only
584 'lf ls -F -o --color %l | grep ^-',
584 'lf ls -F -o --color %l | grep ^-',
585 # ls symbolic links
585 # ls symbolic links
586 'lk ls -F -o --color %l | grep ^l',
586 'lk ls -F -o --color %l | grep ^l',
587 # directories or links to directories,
587 # directories or links to directories,
588 'ldir ls -F -o --color %l | grep /$',
588 'ldir ls -F -o --color %l | grep /$',
589 # things which are executable
589 # things which are executable
590 'lx ls -F -o --color %l | grep ^-..x',
590 'lx ls -F -o --color %l | grep ^-..x',
591 )
591 )
592 elif os.name in ['nt','dos']:
592 elif os.name in ['nt','dos']:
593 auto_alias = ('dir dir /on', 'ls dir /on',
593 auto_alias = ('dir dir /on', 'ls dir /on',
594 'ddir dir /ad /on', 'ldir dir /ad /on',
594 'ddir dir /ad /on', 'ldir dir /ad /on',
595 'mkdir mkdir','rmdir rmdir','echo echo',
595 'mkdir mkdir','rmdir rmdir','echo echo',
596 'ren ren','cls cls','copy copy')
596 'ren ren','cls cls','copy copy')
597 else:
597 else:
598 auto_alias = ()
598 auto_alias = ()
599 self.auto_alias = map(lambda s:s.split(None,1),auto_alias)
599 self.auto_alias = map(lambda s:s.split(None,1),auto_alias)
600 # Call the actual (public) initializer
600 # Call the actual (public) initializer
601 self.init_auto_alias()
601 self.init_auto_alias()
602 # end __init__
602 # end __init__
603
603
604 def pre_config_initialization(self):
604 def pre_config_initialization(self):
605 """Pre-configuration init method
605 """Pre-configuration init method
606
606
607 This is called before the configuration files are processed to
607 This is called before the configuration files are processed to
608 prepare the services the config files might need.
608 prepare the services the config files might need.
609
609
610 self.rc already has reasonable default values at this point.
610 self.rc already has reasonable default values at this point.
611 """
611 """
612 rc = self.rc
612 rc = self.rc
613
613
614 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
614 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
615
615
616
616
617 def post_config_initialization(self):
617 def post_config_initialization(self):
618 """Post configuration init method
618 """Post configuration init method
619
619
620 This is called after the configuration files have been processed to
620 This is called after the configuration files have been processed to
621 'finalize' the initialization."""
621 'finalize' the initialization."""
622
622
623 rc = self.rc
623 rc = self.rc
624
624
625 # Load readline proper
625 # Load readline proper
626 if rc.readline:
626 if rc.readline:
627 self.init_readline()
627 self.init_readline()
628
628
629 # local shortcut, this is used a LOT
629 # local shortcut, this is used a LOT
630 self.log = self.logger.log
630 self.log = self.logger.log
631
631
632 # Initialize cache, set in/out prompts and printing system
632 # Initialize cache, set in/out prompts and printing system
633 self.outputcache = CachedOutput(self,
633 self.outputcache = CachedOutput(self,
634 rc.cache_size,
634 rc.cache_size,
635 rc.pprint,
635 rc.pprint,
636 input_sep = rc.separate_in,
636 input_sep = rc.separate_in,
637 output_sep = rc.separate_out,
637 output_sep = rc.separate_out,
638 output_sep2 = rc.separate_out2,
638 output_sep2 = rc.separate_out2,
639 ps1 = rc.prompt_in1,
639 ps1 = rc.prompt_in1,
640 ps2 = rc.prompt_in2,
640 ps2 = rc.prompt_in2,
641 ps_out = rc.prompt_out,
641 ps_out = rc.prompt_out,
642 pad_left = rc.prompts_pad_left)
642 pad_left = rc.prompts_pad_left)
643
643
644 # user may have over-ridden the default print hook:
644 # user may have over-ridden the default print hook:
645 try:
645 try:
646 self.outputcache.__class__.display = self.hooks.display
646 self.outputcache.__class__.display = self.hooks.display
647 except AttributeError:
647 except AttributeError:
648 pass
648 pass
649
649
650 # I don't like assigning globally to sys, because it means when embedding
650 # I don't like assigning globally to sys, because it means when embedding
651 # instances, each embedded instance overrides the previous choice. But
651 # instances, each embedded instance overrides the previous choice. But
652 # sys.displayhook seems to be called internally by exec, so I don't see a
652 # sys.displayhook seems to be called internally by exec, so I don't see a
653 # way around it.
653 # way around it.
654 sys.displayhook = self.outputcache
654 sys.displayhook = self.outputcache
655
655
656 # Set user colors (don't do it in the constructor above so that it
656 # Set user colors (don't do it in the constructor above so that it
657 # doesn't crash if colors option is invalid)
657 # doesn't crash if colors option is invalid)
658 self.magic_colors(rc.colors)
658 self.magic_colors(rc.colors)
659
659
660 # Set calling of pdb on exceptions
660 # Set calling of pdb on exceptions
661 self.call_pdb = rc.pdb
661 self.call_pdb = rc.pdb
662
662
663 # Load user aliases
663 # Load user aliases
664 for alias in rc.alias:
664 for alias in rc.alias:
665 self.magic_alias(alias)
665 self.magic_alias(alias)
666 self.hooks.late_startup_hook()
666 self.hooks.late_startup_hook()
667
667
668
668
669 def add_builtins(self):
669 def add_builtins(self):
670 """Store ipython references into the builtin namespace.
670 """Store ipython references into the builtin namespace.
671
671
672 Some parts of ipython operate via builtins injected here, which hold a
672 Some parts of ipython operate via builtins injected here, which hold a
673 reference to IPython itself."""
673 reference to IPython itself."""
674
674
675 # TODO: deprecate all except _ip; 'jobs' should be installed
675 # TODO: deprecate all except _ip; 'jobs' should be installed
676 # by an extension and the rest are under _ip, ipalias is redundant
676 # by an extension and the rest are under _ip, ipalias is redundant
677 builtins_new = dict(__IPYTHON__ = self,
677 builtins_new = dict(__IPYTHON__ = self,
678 ip_set_hook = self.set_hook,
678 ip_set_hook = self.set_hook,
679 jobs = self.jobs,
679 jobs = self.jobs,
680 ipmagic = self.ipmagic,
680 ipmagic = self.ipmagic,
681 ipalias = self.ipalias,
681 ipalias = self.ipalias,
682 ipsystem = self.ipsystem,
682 ipsystem = self.ipsystem,
683 _ip = self.api
683 _ip = self.api
684 )
684 )
685 for biname,bival in builtins_new.items():
685 for biname,bival in builtins_new.items():
686 try:
686 try:
687 # store the orignal value so we can restore it
687 # store the orignal value so we can restore it
688 self.builtins_added[biname] = __builtin__.__dict__[biname]
688 self.builtins_added[biname] = __builtin__.__dict__[biname]
689 except KeyError:
689 except KeyError:
690 # or mark that it wasn't defined, and we'll just delete it at
690 # or mark that it wasn't defined, and we'll just delete it at
691 # cleanup
691 # cleanup
692 self.builtins_added[biname] = Undefined
692 self.builtins_added[biname] = Undefined
693 __builtin__.__dict__[biname] = bival
693 __builtin__.__dict__[biname] = bival
694
694
695 # Keep in the builtins a flag for when IPython is active. We set it
695 # Keep in the builtins a flag for when IPython is active. We set it
696 # with setdefault so that multiple nested IPythons don't clobber one
696 # with setdefault so that multiple nested IPythons don't clobber one
697 # another. Each will increase its value by one upon being activated,
697 # another. Each will increase its value by one upon being activated,
698 # which also gives us a way to determine the nesting level.
698 # which also gives us a way to determine the nesting level.
699 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
699 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
700
700
701 def clean_builtins(self):
701 def clean_builtins(self):
702 """Remove any builtins which might have been added by add_builtins, or
702 """Remove any builtins which might have been added by add_builtins, or
703 restore overwritten ones to their previous values."""
703 restore overwritten ones to their previous values."""
704 for biname,bival in self.builtins_added.items():
704 for biname,bival in self.builtins_added.items():
705 if bival is Undefined:
705 if bival is Undefined:
706 del __builtin__.__dict__[biname]
706 del __builtin__.__dict__[biname]
707 else:
707 else:
708 __builtin__.__dict__[biname] = bival
708 __builtin__.__dict__[biname] = bival
709 self.builtins_added.clear()
709 self.builtins_added.clear()
710
710
711 def set_hook(self,name,hook, priority = 50):
711 def set_hook(self,name,hook, priority = 50):
712 """set_hook(name,hook) -> sets an internal IPython hook.
712 """set_hook(name,hook) -> sets an internal IPython hook.
713
713
714 IPython exposes some of its internal API as user-modifiable hooks. By
714 IPython exposes some of its internal API as user-modifiable hooks. By
715 adding your function to one of these hooks, you can modify IPython's
715 adding your function to one of these hooks, you can modify IPython's
716 behavior to call at runtime your own routines."""
716 behavior to call at runtime your own routines."""
717
717
718 # At some point in the future, this should validate the hook before it
718 # At some point in the future, this should validate the hook before it
719 # accepts it. Probably at least check that the hook takes the number
719 # accepts it. Probably at least check that the hook takes the number
720 # of args it's supposed to.
720 # of args it's supposed to.
721 dp = getattr(self.hooks, name, None)
721 dp = getattr(self.hooks, name, None)
722 if name not in IPython.hooks.__all__:
722 if name not in IPython.hooks.__all__:
723 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
723 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
724 if not dp:
724 if not dp:
725 dp = IPython.hooks.CommandChainDispatcher()
725 dp = IPython.hooks.CommandChainDispatcher()
726
726
727 f = new.instancemethod(hook,self,self.__class__)
727 f = new.instancemethod(hook,self,self.__class__)
728 try:
728 try:
729 dp.add(f,priority)
729 dp.add(f,priority)
730 except AttributeError:
730 except AttributeError:
731 # it was not commandchain, plain old func - replace
731 # it was not commandchain, plain old func - replace
732 dp = f
732 dp = f
733
733
734 setattr(self.hooks,name, dp)
734 setattr(self.hooks,name, dp)
735
735
736
736
737 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
737 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
738
738
739 def set_custom_exc(self,exc_tuple,handler):
739 def set_custom_exc(self,exc_tuple,handler):
740 """set_custom_exc(exc_tuple,handler)
740 """set_custom_exc(exc_tuple,handler)
741
741
742 Set a custom exception handler, which will be called if any of the
742 Set a custom exception handler, which will be called if any of the
743 exceptions in exc_tuple occur in the mainloop (specifically, in the
743 exceptions in exc_tuple occur in the mainloop (specifically, in the
744 runcode() method.
744 runcode() method.
745
745
746 Inputs:
746 Inputs:
747
747
748 - exc_tuple: a *tuple* of valid exceptions to call the defined
748 - exc_tuple: a *tuple* of valid exceptions to call the defined
749 handler for. It is very important that you use a tuple, and NOT A
749 handler for. It is very important that you use a tuple, and NOT A
750 LIST here, because of the way Python's except statement works. If
750 LIST here, because of the way Python's except statement works. If
751 you only want to trap a single exception, use a singleton tuple:
751 you only want to trap a single exception, use a singleton tuple:
752
752
753 exc_tuple == (MyCustomException,)
753 exc_tuple == (MyCustomException,)
754
754
755 - handler: this must be defined as a function with the following
755 - handler: this must be defined as a function with the following
756 basic interface: def my_handler(self,etype,value,tb).
756 basic interface: def my_handler(self,etype,value,tb).
757
757
758 This will be made into an instance method (via new.instancemethod)
758 This will be made into an instance method (via new.instancemethod)
759 of IPython itself, and it will be called if any of the exceptions
759 of IPython itself, and it will be called if any of the exceptions
760 listed in the exc_tuple are caught. If the handler is None, an
760 listed in the exc_tuple are caught. If the handler is None, an
761 internal basic one is used, which just prints basic info.
761 internal basic one is used, which just prints basic info.
762
762
763 WARNING: by putting in your own exception handler into IPython's main
763 WARNING: by putting in your own exception handler into IPython's main
764 execution loop, you run a very good chance of nasty crashes. This
764 execution loop, you run a very good chance of nasty crashes. This
765 facility should only be used if you really know what you are doing."""
765 facility should only be used if you really know what you are doing."""
766
766
767 assert type(exc_tuple)==type(()) , \
767 assert type(exc_tuple)==type(()) , \
768 "The custom exceptions must be given AS A TUPLE."
768 "The custom exceptions must be given AS A TUPLE."
769
769
770 def dummy_handler(self,etype,value,tb):
770 def dummy_handler(self,etype,value,tb):
771 print '*** Simple custom exception handler ***'
771 print '*** Simple custom exception handler ***'
772 print 'Exception type :',etype
772 print 'Exception type :',etype
773 print 'Exception value:',value
773 print 'Exception value:',value
774 print 'Traceback :',tb
774 print 'Traceback :',tb
775 print 'Source code :','\n'.join(self.buffer)
775 print 'Source code :','\n'.join(self.buffer)
776
776
777 if handler is None: handler = dummy_handler
777 if handler is None: handler = dummy_handler
778
778
779 self.CustomTB = new.instancemethod(handler,self,self.__class__)
779 self.CustomTB = new.instancemethod(handler,self,self.__class__)
780 self.custom_exceptions = exc_tuple
780 self.custom_exceptions = exc_tuple
781
781
782 def set_custom_completer(self,completer,pos=0):
782 def set_custom_completer(self,completer,pos=0):
783 """set_custom_completer(completer,pos=0)
783 """set_custom_completer(completer,pos=0)
784
784
785 Adds a new custom completer function.
785 Adds a new custom completer function.
786
786
787 The position argument (defaults to 0) is the index in the completers
787 The position argument (defaults to 0) is the index in the completers
788 list where you want the completer to be inserted."""
788 list where you want the completer to be inserted."""
789
789
790 newcomp = new.instancemethod(completer,self.Completer,
790 newcomp = new.instancemethod(completer,self.Completer,
791 self.Completer.__class__)
791 self.Completer.__class__)
792 self.Completer.matchers.insert(pos,newcomp)
792 self.Completer.matchers.insert(pos,newcomp)
793
793
794 def _get_call_pdb(self):
794 def _get_call_pdb(self):
795 return self._call_pdb
795 return self._call_pdb
796
796
797 def _set_call_pdb(self,val):
797 def _set_call_pdb(self,val):
798
798
799 if val not in (0,1,False,True):
799 if val not in (0,1,False,True):
800 raise ValueError,'new call_pdb value must be boolean'
800 raise ValueError,'new call_pdb value must be boolean'
801
801
802 # store value in instance
802 # store value in instance
803 self._call_pdb = val
803 self._call_pdb = val
804
804
805 # notify the actual exception handlers
805 # notify the actual exception handlers
806 self.InteractiveTB.call_pdb = val
806 self.InteractiveTB.call_pdb = val
807 if self.isthreaded:
807 if self.isthreaded:
808 try:
808 try:
809 self.sys_excepthook.call_pdb = val
809 self.sys_excepthook.call_pdb = val
810 except:
810 except:
811 warn('Failed to activate pdb for threaded exception handler')
811 warn('Failed to activate pdb for threaded exception handler')
812
812
813 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
813 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
814 'Control auto-activation of pdb at exceptions')
814 'Control auto-activation of pdb at exceptions')
815
815
816
816
817 # These special functions get installed in the builtin namespace, to
817 # These special functions get installed in the builtin namespace, to
818 # provide programmatic (pure python) access to magics, aliases and system
818 # provide programmatic (pure python) access to magics, aliases and system
819 # calls. This is important for logging, user scripting, and more.
819 # calls. This is important for logging, user scripting, and more.
820
820
821 # We are basically exposing, via normal python functions, the three
821 # We are basically exposing, via normal python functions, the three
822 # mechanisms in which ipython offers special call modes (magics for
822 # mechanisms in which ipython offers special call modes (magics for
823 # internal control, aliases for direct system access via pre-selected
823 # internal control, aliases for direct system access via pre-selected
824 # names, and !cmd for calling arbitrary system commands).
824 # names, and !cmd for calling arbitrary system commands).
825
825
826 def ipmagic(self,arg_s):
826 def ipmagic(self,arg_s):
827 """Call a magic function by name.
827 """Call a magic function by name.
828
828
829 Input: a string containing the name of the magic function to call and any
829 Input: a string containing the name of the magic function to call and any
830 additional arguments to be passed to the magic.
830 additional arguments to be passed to the magic.
831
831
832 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
832 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
833 prompt:
833 prompt:
834
834
835 In[1]: %name -opt foo bar
835 In[1]: %name -opt foo bar
836
836
837 To call a magic without arguments, simply use ipmagic('name').
837 To call a magic without arguments, simply use ipmagic('name').
838
838
839 This provides a proper Python function to call IPython's magics in any
839 This provides a proper Python function to call IPython's magics in any
840 valid Python code you can type at the interpreter, including loops and
840 valid Python code you can type at the interpreter, including loops and
841 compound statements. It is added by IPython to the Python builtin
841 compound statements. It is added by IPython to the Python builtin
842 namespace upon initialization."""
842 namespace upon initialization."""
843
843
844 args = arg_s.split(' ',1)
844 args = arg_s.split(' ',1)
845 magic_name = args[0]
845 magic_name = args[0]
846 magic_name = magic_name.lstrip(self.ESC_MAGIC)
846 magic_name = magic_name.lstrip(self.ESC_MAGIC)
847
847
848 try:
848 try:
849 magic_args = args[1]
849 magic_args = args[1]
850 except IndexError:
850 except IndexError:
851 magic_args = ''
851 magic_args = ''
852 fn = getattr(self,'magic_'+magic_name,None)
852 fn = getattr(self,'magic_'+magic_name,None)
853 if fn is None:
853 if fn is None:
854 error("Magic function `%s` not found." % magic_name)
854 error("Magic function `%s` not found." % magic_name)
855 else:
855 else:
856 magic_args = self.var_expand(magic_args)
856 magic_args = self.var_expand(magic_args)
857 return fn(magic_args)
857 return fn(magic_args)
858
858
859 def ipalias(self,arg_s):
859 def ipalias(self,arg_s):
860 """Call an alias by name.
860 """Call an alias by name.
861
861
862 Input: a string containing the name of the alias to call and any
862 Input: a string containing the name of the alias to call and any
863 additional arguments to be passed to the magic.
863 additional arguments to be passed to the magic.
864
864
865 ipalias('name -opt foo bar') is equivalent to typing at the ipython
865 ipalias('name -opt foo bar') is equivalent to typing at the ipython
866 prompt:
866 prompt:
867
867
868 In[1]: name -opt foo bar
868 In[1]: name -opt foo bar
869
869
870 To call an alias without arguments, simply use ipalias('name').
870 To call an alias without arguments, simply use ipalias('name').
871
871
872 This provides a proper Python function to call IPython's aliases in any
872 This provides a proper Python function to call IPython's aliases in any
873 valid Python code you can type at the interpreter, including loops and
873 valid Python code you can type at the interpreter, including loops and
874 compound statements. It is added by IPython to the Python builtin
874 compound statements. It is added by IPython to the Python builtin
875 namespace upon initialization."""
875 namespace upon initialization."""
876
876
877 args = arg_s.split(' ',1)
877 args = arg_s.split(' ',1)
878 alias_name = args[0]
878 alias_name = args[0]
879 try:
879 try:
880 alias_args = args[1]
880 alias_args = args[1]
881 except IndexError:
881 except IndexError:
882 alias_args = ''
882 alias_args = ''
883 if alias_name in self.alias_table:
883 if alias_name in self.alias_table:
884 self.call_alias(alias_name,alias_args)
884 self.call_alias(alias_name,alias_args)
885 else:
885 else:
886 error("Alias `%s` not found." % alias_name)
886 error("Alias `%s` not found." % alias_name)
887
887
888 def ipsystem(self,arg_s):
888 def ipsystem(self,arg_s):
889 """Make a system call, using IPython."""
889 """Make a system call, using IPython."""
890
890
891 self.system(arg_s)
891 self.system(arg_s)
892
892
893 def complete(self,text):
893 def complete(self,text):
894 """Return a sorted list of all possible completions on text.
894 """Return a sorted list of all possible completions on text.
895
895
896 Inputs:
896 Inputs:
897
897
898 - text: a string of text to be completed on.
898 - text: a string of text to be completed on.
899
899
900 This is a wrapper around the completion mechanism, similar to what
900 This is a wrapper around the completion mechanism, similar to what
901 readline does at the command line when the TAB key is hit. By
901 readline does at the command line when the TAB key is hit. By
902 exposing it as a method, it can be used by other non-readline
902 exposing it as a method, it can be used by other non-readline
903 environments (such as GUIs) for text completion.
903 environments (such as GUIs) for text completion.
904
904
905 Simple usage example:
905 Simple usage example:
906
906
907 In [1]: x = 'hello'
907 In [1]: x = 'hello'
908
908
909 In [2]: __IP.complete('x.l')
909 In [2]: __IP.complete('x.l')
910 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
910 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
911
911
912 complete = self.Completer.complete
912 complete = self.Completer.complete
913 state = 0
913 state = 0
914 # use a dict so we get unique keys, since ipyhton's multiple
914 # use a dict so we get unique keys, since ipyhton's multiple
915 # completers can return duplicates.
915 # completers can return duplicates.
916 comps = {}
916 comps = {}
917 while True:
917 while True:
918 newcomp = complete(text,state)
918 newcomp = complete(text,state)
919 if newcomp is None:
919 if newcomp is None:
920 break
920 break
921 comps[newcomp] = 1
921 comps[newcomp] = 1
922 state += 1
922 state += 1
923 outcomps = comps.keys()
923 outcomps = comps.keys()
924 outcomps.sort()
924 outcomps.sort()
925 return outcomps
925 return outcomps
926
926
927 def set_completer_frame(self, frame=None):
927 def set_completer_frame(self, frame=None):
928 if frame:
928 if frame:
929 self.Completer.namespace = frame.f_locals
929 self.Completer.namespace = frame.f_locals
930 self.Completer.global_namespace = frame.f_globals
930 self.Completer.global_namespace = frame.f_globals
931 else:
931 else:
932 self.Completer.namespace = self.user_ns
932 self.Completer.namespace = self.user_ns
933 self.Completer.global_namespace = self.user_global_ns
933 self.Completer.global_namespace = self.user_global_ns
934
934
935 def init_auto_alias(self):
935 def init_auto_alias(self):
936 """Define some aliases automatically.
936 """Define some aliases automatically.
937
937
938 These are ALL parameter-less aliases"""
938 These are ALL parameter-less aliases"""
939
939
940 for alias,cmd in self.auto_alias:
940 for alias,cmd in self.auto_alias:
941 self.alias_table[alias] = (0,cmd)
941 self.alias_table[alias] = (0,cmd)
942
942
943 def alias_table_validate(self,verbose=0):
943 def alias_table_validate(self,verbose=0):
944 """Update information about the alias table.
944 """Update information about the alias table.
945
945
946 In particular, make sure no Python keywords/builtins are in it."""
946 In particular, make sure no Python keywords/builtins are in it."""
947
947
948 no_alias = self.no_alias
948 no_alias = self.no_alias
949 for k in self.alias_table.keys():
949 for k in self.alias_table.keys():
950 if k in no_alias:
950 if k in no_alias:
951 del self.alias_table[k]
951 del self.alias_table[k]
952 if verbose:
952 if verbose:
953 print ("Deleting alias <%s>, it's a Python "
953 print ("Deleting alias <%s>, it's a Python "
954 "keyword or builtin." % k)
954 "keyword or builtin." % k)
955
955
956 def set_autoindent(self,value=None):
956 def set_autoindent(self,value=None):
957 """Set the autoindent flag, checking for readline support.
957 """Set the autoindent flag, checking for readline support.
958
958
959 If called with no arguments, it acts as a toggle."""
959 If called with no arguments, it acts as a toggle."""
960
960
961 if not self.has_readline:
961 if not self.has_readline:
962 if os.name == 'posix':
962 if os.name == 'posix':
963 warn("The auto-indent feature requires the readline library")
963 warn("The auto-indent feature requires the readline library")
964 self.autoindent = 0
964 self.autoindent = 0
965 return
965 return
966 if value is None:
966 if value is None:
967 self.autoindent = not self.autoindent
967 self.autoindent = not self.autoindent
968 else:
968 else:
969 self.autoindent = value
969 self.autoindent = value
970
970
971 def rc_set_toggle(self,rc_field,value=None):
971 def rc_set_toggle(self,rc_field,value=None):
972 """Set or toggle a field in IPython's rc config. structure.
972 """Set or toggle a field in IPython's rc config. structure.
973
973
974 If called with no arguments, it acts as a toggle.
974 If called with no arguments, it acts as a toggle.
975
975
976 If called with a non-existent field, the resulting AttributeError
976 If called with a non-existent field, the resulting AttributeError
977 exception will propagate out."""
977 exception will propagate out."""
978
978
979 rc_val = getattr(self.rc,rc_field)
979 rc_val = getattr(self.rc,rc_field)
980 if value is None:
980 if value is None:
981 value = not rc_val
981 value = not rc_val
982 setattr(self.rc,rc_field,value)
982 setattr(self.rc,rc_field,value)
983
983
984 def user_setup(self,ipythondir,rc_suffix,mode='install'):
984 def user_setup(self,ipythondir,rc_suffix,mode='install'):
985 """Install the user configuration directory.
985 """Install the user configuration directory.
986
986
987 Can be called when running for the first time or to upgrade the user's
987 Can be called when running for the first time or to upgrade the user's
988 .ipython/ directory with the mode parameter. Valid modes are 'install'
988 .ipython/ directory with the mode parameter. Valid modes are 'install'
989 and 'upgrade'."""
989 and 'upgrade'."""
990
990
991 def wait():
991 def wait():
992 try:
992 try:
993 raw_input("Please press <RETURN> to start IPython.")
993 raw_input("Please press <RETURN> to start IPython.")
994 except EOFError:
994 except EOFError:
995 print >> Term.cout
995 print >> Term.cout
996 print '*'*70
996 print '*'*70
997
997
998 cwd = os.getcwd() # remember where we started
998 cwd = os.getcwd() # remember where we started
999 glb = glob.glob
999 glb = glob.glob
1000 print '*'*70
1000 print '*'*70
1001 if mode == 'install':
1001 if mode == 'install':
1002 print \
1002 print \
1003 """Welcome to IPython. I will try to create a personal configuration directory
1003 """Welcome to IPython. I will try to create a personal configuration directory
1004 where you can customize many aspects of IPython's functionality in:\n"""
1004 where you can customize many aspects of IPython's functionality in:\n"""
1005 else:
1005 else:
1006 print 'I am going to upgrade your configuration in:'
1006 print 'I am going to upgrade your configuration in:'
1007
1007
1008 print ipythondir
1008 print ipythondir
1009
1009
1010 rcdirend = os.path.join('IPython','UserConfig')
1010 rcdirend = os.path.join('IPython','UserConfig')
1011 cfg = lambda d: os.path.join(d,rcdirend)
1011 cfg = lambda d: os.path.join(d,rcdirend)
1012 try:
1012 try:
1013 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1013 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1014 except IOError:
1014 except IOError:
1015 warning = """
1015 warning = """
1016 Installation error. IPython's directory was not found.
1016 Installation error. IPython's directory was not found.
1017
1017
1018 Check the following:
1018 Check the following:
1019
1019
1020 The ipython/IPython directory should be in a directory belonging to your
1020 The ipython/IPython directory should be in a directory belonging to your
1021 PYTHONPATH environment variable (that is, it should be in a directory
1021 PYTHONPATH environment variable (that is, it should be in a directory
1022 belonging to sys.path). You can copy it explicitly there or just link to it.
1022 belonging to sys.path). You can copy it explicitly there or just link to it.
1023
1023
1024 IPython will proceed with builtin defaults.
1024 IPython will proceed with builtin defaults.
1025 """
1025 """
1026 warn(warning)
1026 warn(warning)
1027 wait()
1027 wait()
1028 return
1028 return
1029
1029
1030 if mode == 'install':
1030 if mode == 'install':
1031 try:
1031 try:
1032 shutil.copytree(rcdir,ipythondir)
1032 shutil.copytree(rcdir,ipythondir)
1033 os.chdir(ipythondir)
1033 os.chdir(ipythondir)
1034 rc_files = glb("ipythonrc*")
1034 rc_files = glb("ipythonrc*")
1035 for rc_file in rc_files:
1035 for rc_file in rc_files:
1036 os.rename(rc_file,rc_file+rc_suffix)
1036 os.rename(rc_file,rc_file+rc_suffix)
1037 except:
1037 except:
1038 warning = """
1038 warning = """
1039
1039
1040 There was a problem with the installation:
1040 There was a problem with the installation:
1041 %s
1041 %s
1042 Try to correct it or contact the developers if you think it's a bug.
1042 Try to correct it or contact the developers if you think it's a bug.
1043 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1043 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1044 warn(warning)
1044 warn(warning)
1045 wait()
1045 wait()
1046 return
1046 return
1047
1047
1048 elif mode == 'upgrade':
1048 elif mode == 'upgrade':
1049 try:
1049 try:
1050 os.chdir(ipythondir)
1050 os.chdir(ipythondir)
1051 except:
1051 except:
1052 print """
1052 print """
1053 Can not upgrade: changing to directory %s failed. Details:
1053 Can not upgrade: changing to directory %s failed. Details:
1054 %s
1054 %s
1055 """ % (ipythondir,sys.exc_info()[1])
1055 """ % (ipythondir,sys.exc_info()[1])
1056 wait()
1056 wait()
1057 return
1057 return
1058 else:
1058 else:
1059 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1059 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1060 for new_full_path in sources:
1060 for new_full_path in sources:
1061 new_filename = os.path.basename(new_full_path)
1061 new_filename = os.path.basename(new_full_path)
1062 if new_filename.startswith('ipythonrc'):
1062 if new_filename.startswith('ipythonrc'):
1063 new_filename = new_filename + rc_suffix
1063 new_filename = new_filename + rc_suffix
1064 # The config directory should only contain files, skip any
1064 # The config directory should only contain files, skip any
1065 # directories which may be there (like CVS)
1065 # directories which may be there (like CVS)
1066 if os.path.isdir(new_full_path):
1066 if os.path.isdir(new_full_path):
1067 continue
1067 continue
1068 if os.path.exists(new_filename):
1068 if os.path.exists(new_filename):
1069 old_file = new_filename+'.old'
1069 old_file = new_filename+'.old'
1070 if os.path.exists(old_file):
1070 if os.path.exists(old_file):
1071 os.remove(old_file)
1071 os.remove(old_file)
1072 os.rename(new_filename,old_file)
1072 os.rename(new_filename,old_file)
1073 shutil.copy(new_full_path,new_filename)
1073 shutil.copy(new_full_path,new_filename)
1074 else:
1074 else:
1075 raise ValueError,'unrecognized mode for install:',`mode`
1075 raise ValueError,'unrecognized mode for install:',`mode`
1076
1076
1077 # Fix line-endings to those native to each platform in the config
1077 # Fix line-endings to those native to each platform in the config
1078 # directory.
1078 # directory.
1079 try:
1079 try:
1080 os.chdir(ipythondir)
1080 os.chdir(ipythondir)
1081 except:
1081 except:
1082 print """
1082 print """
1083 Problem: changing to directory %s failed.
1083 Problem: changing to directory %s failed.
1084 Details:
1084 Details:
1085 %s
1085 %s
1086
1086
1087 Some configuration files may have incorrect line endings. This should not
1087 Some configuration files may have incorrect line endings. This should not
1088 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1088 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1089 wait()
1089 wait()
1090 else:
1090 else:
1091 for fname in glb('ipythonrc*'):
1091 for fname in glb('ipythonrc*'):
1092 try:
1092 try:
1093 native_line_ends(fname,backup=0)
1093 native_line_ends(fname,backup=0)
1094 except IOError:
1094 except IOError:
1095 pass
1095 pass
1096
1096
1097 if mode == 'install':
1097 if mode == 'install':
1098 print """
1098 print """
1099 Successful installation!
1099 Successful installation!
1100
1100
1101 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1101 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1102 IPython manual (there are both HTML and PDF versions supplied with the
1102 IPython manual (there are both HTML and PDF versions supplied with the
1103 distribution) to make sure that your system environment is properly configured
1103 distribution) to make sure that your system environment is properly configured
1104 to take advantage of IPython's features.
1104 to take advantage of IPython's features.
1105
1105
1106 Important note: the configuration system has changed! The old system is
1106 Important note: the configuration system has changed! The old system is
1107 still in place, but its setting may be partly overridden by the settings in
1107 still in place, but its setting may be partly overridden by the settings in
1108 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1108 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1109 if some of the new settings bother you.
1109 if some of the new settings bother you.
1110
1110
1111 """
1111 """
1112 else:
1112 else:
1113 print """
1113 print """
1114 Successful upgrade!
1114 Successful upgrade!
1115
1115
1116 All files in your directory:
1116 All files in your directory:
1117 %(ipythondir)s
1117 %(ipythondir)s
1118 which would have been overwritten by the upgrade were backed up with a .old
1118 which would have been overwritten by the upgrade were backed up with a .old
1119 extension. If you had made particular customizations in those files you may
1119 extension. If you had made particular customizations in those files you may
1120 want to merge them back into the new files.""" % locals()
1120 want to merge them back into the new files.""" % locals()
1121 wait()
1121 wait()
1122 os.chdir(cwd)
1122 os.chdir(cwd)
1123 # end user_setup()
1123 # end user_setup()
1124
1124
1125 def atexit_operations(self):
1125 def atexit_operations(self):
1126 """This will be executed at the time of exit.
1126 """This will be executed at the time of exit.
1127
1127
1128 Saving of persistent data should be performed here. """
1128 Saving of persistent data should be performed here. """
1129
1129
1130 #print '*** IPython exit cleanup ***' # dbg
1130 #print '*** IPython exit cleanup ***' # dbg
1131 # input history
1131 # input history
1132 self.savehist()
1132 self.savehist()
1133
1133
1134 # Cleanup all tempfiles left around
1134 # Cleanup all tempfiles left around
1135 for tfile in self.tempfiles:
1135 for tfile in self.tempfiles:
1136 try:
1136 try:
1137 os.unlink(tfile)
1137 os.unlink(tfile)
1138 except OSError:
1138 except OSError:
1139 pass
1139 pass
1140
1140
1141 # save the "persistent data" catch-all dictionary
1141 # save the "persistent data" catch-all dictionary
1142 self.hooks.shutdown_hook()
1142 self.hooks.shutdown_hook()
1143
1143
1144 def savehist(self):
1144 def savehist(self):
1145 """Save input history to a file (via readline library)."""
1145 """Save input history to a file (via readline library)."""
1146 try:
1146 try:
1147 self.readline.write_history_file(self.histfile)
1147 self.readline.write_history_file(self.histfile)
1148 except:
1148 except:
1149 print 'Unable to save IPython command history to file: ' + \
1149 print 'Unable to save IPython command history to file: ' + \
1150 `self.histfile`
1150 `self.histfile`
1151
1151
1152 def pre_readline(self):
1152 def pre_readline(self):
1153 """readline hook to be used at the start of each line.
1153 """readline hook to be used at the start of each line.
1154
1154
1155 Currently it handles auto-indent only."""
1155 Currently it handles auto-indent only."""
1156
1156
1157 #debugx('self.indent_current_nsp','pre_readline:')
1157 #debugx('self.indent_current_nsp','pre_readline:')
1158 self.readline.insert_text(self.indent_current_str())
1158 self.readline.insert_text(self.indent_current_str())
1159
1159
1160 def init_readline(self):
1160 def init_readline(self):
1161 """Command history completion/saving/reloading."""
1161 """Command history completion/saving/reloading."""
1162
1162
1163 import IPython.rlineimpl as readline
1163 import IPython.rlineimpl as readline
1164 if not readline.have_readline:
1164 if not readline.have_readline:
1165 self.has_readline = 0
1165 self.has_readline = 0
1166 self.readline = None
1166 self.readline = None
1167 # no point in bugging windows users with this every time:
1167 # no point in bugging windows users with this every time:
1168 warn('Readline services not available on this platform.')
1168 warn('Readline services not available on this platform.')
1169 else:
1169 else:
1170 sys.modules['readline'] = readline
1170 sys.modules['readline'] = readline
1171 import atexit
1171 import atexit
1172 from IPython.completer import IPCompleter
1172 from IPython.completer import IPCompleter
1173 self.Completer = IPCompleter(self,
1173 self.Completer = IPCompleter(self,
1174 self.user_ns,
1174 self.user_ns,
1175 self.user_global_ns,
1175 self.user_global_ns,
1176 self.rc.readline_omit__names,
1176 self.rc.readline_omit__names,
1177 self.alias_table)
1177 self.alias_table)
1178
1178
1179 # Platform-specific configuration
1179 # Platform-specific configuration
1180 if os.name == 'nt':
1180 if os.name == 'nt':
1181 self.readline_startup_hook = readline.set_pre_input_hook
1181 self.readline_startup_hook = readline.set_pre_input_hook
1182 else:
1182 else:
1183 self.readline_startup_hook = readline.set_startup_hook
1183 self.readline_startup_hook = readline.set_startup_hook
1184
1184
1185 # Load user's initrc file (readline config)
1185 # Load user's initrc file (readline config)
1186 inputrc_name = os.environ.get('INPUTRC')
1186 inputrc_name = os.environ.get('INPUTRC')
1187 if inputrc_name is None:
1187 if inputrc_name is None:
1188 home_dir = get_home_dir()
1188 home_dir = get_home_dir()
1189 if home_dir is not None:
1189 if home_dir is not None:
1190 inputrc_name = os.path.join(home_dir,'.inputrc')
1190 inputrc_name = os.path.join(home_dir,'.inputrc')
1191 if os.path.isfile(inputrc_name):
1191 if os.path.isfile(inputrc_name):
1192 try:
1192 try:
1193 readline.read_init_file(inputrc_name)
1193 readline.read_init_file(inputrc_name)
1194 except:
1194 except:
1195 warn('Problems reading readline initialization file <%s>'
1195 warn('Problems reading readline initialization file <%s>'
1196 % inputrc_name)
1196 % inputrc_name)
1197
1197
1198 self.has_readline = 1
1198 self.has_readline = 1
1199 self.readline = readline
1199 self.readline = readline
1200 # save this in sys so embedded copies can restore it properly
1200 # save this in sys so embedded copies can restore it properly
1201 sys.ipcompleter = self.Completer.complete
1201 sys.ipcompleter = self.Completer.complete
1202 readline.set_completer(self.Completer.complete)
1202 readline.set_completer(self.Completer.complete)
1203
1203
1204 # Configure readline according to user's prefs
1204 # Configure readline according to user's prefs
1205 for rlcommand in self.rc.readline_parse_and_bind:
1205 for rlcommand in self.rc.readline_parse_and_bind:
1206 readline.parse_and_bind(rlcommand)
1206 readline.parse_and_bind(rlcommand)
1207
1207
1208 # remove some chars from the delimiters list
1208 # remove some chars from the delimiters list
1209 delims = readline.get_completer_delims()
1209 delims = readline.get_completer_delims()
1210 delims = delims.translate(string._idmap,
1210 delims = delims.translate(string._idmap,
1211 self.rc.readline_remove_delims)
1211 self.rc.readline_remove_delims)
1212 readline.set_completer_delims(delims)
1212 readline.set_completer_delims(delims)
1213 # otherwise we end up with a monster history after a while:
1213 # otherwise we end up with a monster history after a while:
1214 readline.set_history_length(1000)
1214 readline.set_history_length(1000)
1215 try:
1215 try:
1216 #print '*** Reading readline history' # dbg
1216 #print '*** Reading readline history' # dbg
1217 readline.read_history_file(self.histfile)
1217 readline.read_history_file(self.histfile)
1218 except IOError:
1218 except IOError:
1219 pass # It doesn't exist yet.
1219 pass # It doesn't exist yet.
1220
1220
1221 atexit.register(self.atexit_operations)
1221 atexit.register(self.atexit_operations)
1222 del atexit
1222 del atexit
1223
1223
1224 # Configure auto-indent for all platforms
1224 # Configure auto-indent for all platforms
1225 self.set_autoindent(self.rc.autoindent)
1225 self.set_autoindent(self.rc.autoindent)
1226
1226
1227 def _should_recompile(self,e):
1227 def _should_recompile(self,e):
1228 """Utility routine for edit_syntax_error"""
1228 """Utility routine for edit_syntax_error"""
1229
1229
1230 if e.filename in ('<ipython console>','<input>','<string>',
1230 if e.filename in ('<ipython console>','<input>','<string>',
1231 '<console>',None):
1231 '<console>',None):
1232
1232
1233 return False
1233 return False
1234 try:
1234 try:
1235 if (self.rc.autoedit_syntax and
1235 if (self.rc.autoedit_syntax and
1236 not ask_yes_no('Return to editor to correct syntax error? '
1236 not ask_yes_no('Return to editor to correct syntax error? '
1237 '[Y/n] ','y')):
1237 '[Y/n] ','y')):
1238 return False
1238 return False
1239 except EOFError:
1239 except EOFError:
1240 return False
1240 return False
1241
1241
1242 def int0(x):
1242 def int0(x):
1243 try:
1243 try:
1244 return int(x)
1244 return int(x)
1245 except TypeError:
1245 except TypeError:
1246 return 0
1246 return 0
1247 # always pass integer line and offset values to editor hook
1247 # always pass integer line and offset values to editor hook
1248 self.hooks.fix_error_editor(e.filename,
1248 self.hooks.fix_error_editor(e.filename,
1249 int0(e.lineno),int0(e.offset),e.msg)
1249 int0(e.lineno),int0(e.offset),e.msg)
1250 return True
1250 return True
1251
1251
1252 def edit_syntax_error(self):
1252 def edit_syntax_error(self):
1253 """The bottom half of the syntax error handler called in the main loop.
1253 """The bottom half of the syntax error handler called in the main loop.
1254
1254
1255 Loop until syntax error is fixed or user cancels.
1255 Loop until syntax error is fixed or user cancels.
1256 """
1256 """
1257
1257
1258 while self.SyntaxTB.last_syntax_error:
1258 while self.SyntaxTB.last_syntax_error:
1259 # copy and clear last_syntax_error
1259 # copy and clear last_syntax_error
1260 err = self.SyntaxTB.clear_err_state()
1260 err = self.SyntaxTB.clear_err_state()
1261 if not self._should_recompile(err):
1261 if not self._should_recompile(err):
1262 return
1262 return
1263 try:
1263 try:
1264 # may set last_syntax_error again if a SyntaxError is raised
1264 # may set last_syntax_error again if a SyntaxError is raised
1265 self.safe_execfile(err.filename,self.shell.user_ns)
1265 self.safe_execfile(err.filename,self.shell.user_ns)
1266 except:
1266 except:
1267 self.showtraceback()
1267 self.showtraceback()
1268 else:
1268 else:
1269 f = file(err.filename)
1269 f = file(err.filename)
1270 try:
1270 try:
1271 sys.displayhook(f.read())
1271 sys.displayhook(f.read())
1272 finally:
1272 finally:
1273 f.close()
1273 f.close()
1274
1274
1275 def showsyntaxerror(self, filename=None):
1275 def showsyntaxerror(self, filename=None):
1276 """Display the syntax error that just occurred.
1276 """Display the syntax error that just occurred.
1277
1277
1278 This doesn't display a stack trace because there isn't one.
1278 This doesn't display a stack trace because there isn't one.
1279
1279
1280 If a filename is given, it is stuffed in the exception instead
1280 If a filename is given, it is stuffed in the exception instead
1281 of what was there before (because Python's parser always uses
1281 of what was there before (because Python's parser always uses
1282 "<string>" when reading from a string).
1282 "<string>" when reading from a string).
1283 """
1283 """
1284 etype, value, last_traceback = sys.exc_info()
1284 etype, value, last_traceback = sys.exc_info()
1285
1286 # See note about these variables in showtraceback() below
1287 sys.last_type = etype
1288 sys.last_value = value
1289 sys.last_traceback = last_traceback
1290
1285 if filename and etype is SyntaxError:
1291 if filename and etype is SyntaxError:
1286 # Work hard to stuff the correct filename in the exception
1292 # Work hard to stuff the correct filename in the exception
1287 try:
1293 try:
1288 msg, (dummy_filename, lineno, offset, line) = value
1294 msg, (dummy_filename, lineno, offset, line) = value
1289 except:
1295 except:
1290 # Not the format we expect; leave it alone
1296 # Not the format we expect; leave it alone
1291 pass
1297 pass
1292 else:
1298 else:
1293 # Stuff in the right filename
1299 # Stuff in the right filename
1294 try:
1300 try:
1295 # Assume SyntaxError is a class exception
1301 # Assume SyntaxError is a class exception
1296 value = SyntaxError(msg, (filename, lineno, offset, line))
1302 value = SyntaxError(msg, (filename, lineno, offset, line))
1297 except:
1303 except:
1298 # If that failed, assume SyntaxError is a string
1304 # If that failed, assume SyntaxError is a string
1299 value = msg, (filename, lineno, offset, line)
1305 value = msg, (filename, lineno, offset, line)
1300 self.SyntaxTB(etype,value,[])
1306 self.SyntaxTB(etype,value,[])
1301
1307
1302 def debugger(self):
1308 def debugger(self):
1303 """Call the pdb debugger."""
1309 """Call the pdb debugger."""
1304
1310
1305 if not self.rc.pdb:
1311 if not self.rc.pdb:
1306 return
1312 return
1307 pdb.pm()
1313 pdb.pm()
1308
1314
1309 def showtraceback(self,exc_tuple = None,filename=None):
1315 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1310 """Display the exception that just occurred."""
1316 """Display the exception that just occurred."""
1311
1317
1312 # Though this won't be called by syntax errors in the input line,
1318 # Though this won't be called by syntax errors in the input line,
1313 # there may be SyntaxError cases whith imported code.
1319 # there may be SyntaxError cases whith imported code.
1314 if exc_tuple is None:
1320 if exc_tuple is None:
1315 type, value, tb = sys.exc_info()
1321 etype, value, tb = sys.exc_info()
1316 else:
1322 else:
1317 type, value, tb = exc_tuple
1323 etype, value, tb = exc_tuple
1318 if type is SyntaxError:
1324 if etype is SyntaxError:
1319 self.showsyntaxerror(filename)
1325 self.showsyntaxerror(filename)
1320 else:
1326 else:
1321 self.InteractiveTB()
1327 # WARNING: these variables are somewhat deprecated and not
1328 # necessarily safe to use in a threaded environment, but tools
1329 # like pdb depend on their existence, so let's set them. If we
1330 # find problems in the field, we'll need to revisit their use.
1331 sys.last_type = etype
1332 sys.last_value = value
1333 sys.last_traceback = tb
1334
1335 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1322 if self.InteractiveTB.call_pdb and self.has_readline:
1336 if self.InteractiveTB.call_pdb and self.has_readline:
1323 # pdb mucks up readline, fix it back
1337 # pdb mucks up readline, fix it back
1324 self.readline.set_completer(self.Completer.complete)
1338 self.readline.set_completer(self.Completer.complete)
1325
1339
1326 def mainloop(self,banner=None):
1340 def mainloop(self,banner=None):
1327 """Creates the local namespace and starts the mainloop.
1341 """Creates the local namespace and starts the mainloop.
1328
1342
1329 If an optional banner argument is given, it will override the
1343 If an optional banner argument is given, it will override the
1330 internally created default banner."""
1344 internally created default banner."""
1331
1345
1332 if self.rc.c: # Emulate Python's -c option
1346 if self.rc.c: # Emulate Python's -c option
1333 self.exec_init_cmd()
1347 self.exec_init_cmd()
1334 if banner is None:
1348 if banner is None:
1335 if not self.rc.banner:
1349 if not self.rc.banner:
1336 banner = ''
1350 banner = ''
1337 # banner is string? Use it directly!
1351 # banner is string? Use it directly!
1338 elif isinstance(self.rc.banner,basestring):
1352 elif isinstance(self.rc.banner,basestring):
1339 banner = self.rc.banner
1353 banner = self.rc.banner
1340 else:
1354 else:
1341 banner = self.BANNER+self.banner2
1355 banner = self.BANNER+self.banner2
1342
1356
1343 self.interact(banner)
1357 self.interact(banner)
1344
1358
1345 def exec_init_cmd(self):
1359 def exec_init_cmd(self):
1346 """Execute a command given at the command line.
1360 """Execute a command given at the command line.
1347
1361
1348 This emulates Python's -c option."""
1362 This emulates Python's -c option."""
1349
1363
1350 #sys.argv = ['-c']
1364 #sys.argv = ['-c']
1351 self.push(self.rc.c)
1365 self.push(self.rc.c)
1352
1366
1353 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1367 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1354 """Embeds IPython into a running python program.
1368 """Embeds IPython into a running python program.
1355
1369
1356 Input:
1370 Input:
1357
1371
1358 - header: An optional header message can be specified.
1372 - header: An optional header message can be specified.
1359
1373
1360 - local_ns, global_ns: working namespaces. If given as None, the
1374 - local_ns, global_ns: working namespaces. If given as None, the
1361 IPython-initialized one is updated with __main__.__dict__, so that
1375 IPython-initialized one is updated with __main__.__dict__, so that
1362 program variables become visible but user-specific configuration
1376 program variables become visible but user-specific configuration
1363 remains possible.
1377 remains possible.
1364
1378
1365 - stack_depth: specifies how many levels in the stack to go to
1379 - stack_depth: specifies how many levels in the stack to go to
1366 looking for namespaces (when local_ns and global_ns are None). This
1380 looking for namespaces (when local_ns and global_ns are None). This
1367 allows an intermediate caller to make sure that this function gets
1381 allows an intermediate caller to make sure that this function gets
1368 the namespace from the intended level in the stack. By default (0)
1382 the namespace from the intended level in the stack. By default (0)
1369 it will get its locals and globals from the immediate caller.
1383 it will get its locals and globals from the immediate caller.
1370
1384
1371 Warning: it's possible to use this in a program which is being run by
1385 Warning: it's possible to use this in a program which is being run by
1372 IPython itself (via %run), but some funny things will happen (a few
1386 IPython itself (via %run), but some funny things will happen (a few
1373 globals get overwritten). In the future this will be cleaned up, as
1387 globals get overwritten). In the future this will be cleaned up, as
1374 there is no fundamental reason why it can't work perfectly."""
1388 there is no fundamental reason why it can't work perfectly."""
1375
1389
1376 # Get locals and globals from caller
1390 # Get locals and globals from caller
1377 if local_ns is None or global_ns is None:
1391 if local_ns is None or global_ns is None:
1378 call_frame = sys._getframe(stack_depth).f_back
1392 call_frame = sys._getframe(stack_depth).f_back
1379
1393
1380 if local_ns is None:
1394 if local_ns is None:
1381 local_ns = call_frame.f_locals
1395 local_ns = call_frame.f_locals
1382 if global_ns is None:
1396 if global_ns is None:
1383 global_ns = call_frame.f_globals
1397 global_ns = call_frame.f_globals
1384
1398
1385 # Update namespaces and fire up interpreter
1399 # Update namespaces and fire up interpreter
1386
1400
1387 # The global one is easy, we can just throw it in
1401 # The global one is easy, we can just throw it in
1388 self.user_global_ns = global_ns
1402 self.user_global_ns = global_ns
1389
1403
1390 # but the user/local one is tricky: ipython needs it to store internal
1404 # but the user/local one is tricky: ipython needs it to store internal
1391 # data, but we also need the locals. We'll copy locals in the user
1405 # data, but we also need the locals. We'll copy locals in the user
1392 # one, but will track what got copied so we can delete them at exit.
1406 # one, but will track what got copied so we can delete them at exit.
1393 # This is so that a later embedded call doesn't see locals from a
1407 # This is so that a later embedded call doesn't see locals from a
1394 # previous call (which most likely existed in a separate scope).
1408 # previous call (which most likely existed in a separate scope).
1395 local_varnames = local_ns.keys()
1409 local_varnames = local_ns.keys()
1396 self.user_ns.update(local_ns)
1410 self.user_ns.update(local_ns)
1397
1411
1398 # Patch for global embedding to make sure that things don't overwrite
1412 # Patch for global embedding to make sure that things don't overwrite
1399 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1413 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1400 # FIXME. Test this a bit more carefully (the if.. is new)
1414 # FIXME. Test this a bit more carefully (the if.. is new)
1401 if local_ns is None and global_ns is None:
1415 if local_ns is None and global_ns is None:
1402 self.user_global_ns.update(__main__.__dict__)
1416 self.user_global_ns.update(__main__.__dict__)
1403
1417
1404 # make sure the tab-completer has the correct frame information, so it
1418 # make sure the tab-completer has the correct frame information, so it
1405 # actually completes using the frame's locals/globals
1419 # actually completes using the frame's locals/globals
1406 self.set_completer_frame()
1420 self.set_completer_frame()
1407
1421
1408 # before activating the interactive mode, we need to make sure that
1422 # before activating the interactive mode, we need to make sure that
1409 # all names in the builtin namespace needed by ipython point to
1423 # all names in the builtin namespace needed by ipython point to
1410 # ourselves, and not to other instances.
1424 # ourselves, and not to other instances.
1411 self.add_builtins()
1425 self.add_builtins()
1412
1426
1413 self.interact(header)
1427 self.interact(header)
1414
1428
1415 # now, purge out the user namespace from anything we might have added
1429 # now, purge out the user namespace from anything we might have added
1416 # from the caller's local namespace
1430 # from the caller's local namespace
1417 delvar = self.user_ns.pop
1431 delvar = self.user_ns.pop
1418 for var in local_varnames:
1432 for var in local_varnames:
1419 delvar(var,None)
1433 delvar(var,None)
1420 # and clean builtins we may have overridden
1434 # and clean builtins we may have overridden
1421 self.clean_builtins()
1435 self.clean_builtins()
1422
1436
1423 def interact(self, banner=None):
1437 def interact(self, banner=None):
1424 """Closely emulate the interactive Python console.
1438 """Closely emulate the interactive Python console.
1425
1439
1426 The optional banner argument specify the banner to print
1440 The optional banner argument specify the banner to print
1427 before the first interaction; by default it prints a banner
1441 before the first interaction; by default it prints a banner
1428 similar to the one printed by the real Python interpreter,
1442 similar to the one printed by the real Python interpreter,
1429 followed by the current class name in parentheses (so as not
1443 followed by the current class name in parentheses (so as not
1430 to confuse this with the real interpreter -- since it's so
1444 to confuse this with the real interpreter -- since it's so
1431 close!).
1445 close!).
1432
1446
1433 """
1447 """
1434 cprt = 'Type "copyright", "credits" or "license" for more information.'
1448 cprt = 'Type "copyright", "credits" or "license" for more information.'
1435 if banner is None:
1449 if banner is None:
1436 self.write("Python %s on %s\n%s\n(%s)\n" %
1450 self.write("Python %s on %s\n%s\n(%s)\n" %
1437 (sys.version, sys.platform, cprt,
1451 (sys.version, sys.platform, cprt,
1438 self.__class__.__name__))
1452 self.__class__.__name__))
1439 else:
1453 else:
1440 self.write(banner)
1454 self.write(banner)
1441
1455
1442 more = 0
1456 more = 0
1443
1457
1444 # Mark activity in the builtins
1458 # Mark activity in the builtins
1445 __builtin__.__dict__['__IPYTHON__active'] += 1
1459 __builtin__.__dict__['__IPYTHON__active'] += 1
1446
1460
1447 # exit_now is set by a call to %Exit or %Quit
1461 # exit_now is set by a call to %Exit or %Quit
1448 self.exit_now = False
1462 self.exit_now = False
1449 while not self.exit_now:
1463 while not self.exit_now:
1450 if more:
1464 if more:
1451 prompt = self.outputcache.prompt2
1465 prompt = self.outputcache.prompt2
1452 if self.autoindent:
1466 if self.autoindent:
1453 self.readline_startup_hook(self.pre_readline)
1467 self.readline_startup_hook(self.pre_readline)
1454 else:
1468 else:
1455 prompt = self.outputcache.prompt1
1469 prompt = self.outputcache.prompt1
1456 try:
1470 try:
1457 line = self.raw_input(prompt,more)
1471 line = self.raw_input(prompt,more)
1458 if self.autoindent:
1472 if self.autoindent:
1459 self.readline_startup_hook(None)
1473 self.readline_startup_hook(None)
1460 except KeyboardInterrupt:
1474 except KeyboardInterrupt:
1461 self.write('\nKeyboardInterrupt\n')
1475 self.write('\nKeyboardInterrupt\n')
1462 self.resetbuffer()
1476 self.resetbuffer()
1463 # keep cache in sync with the prompt counter:
1477 # keep cache in sync with the prompt counter:
1464 self.outputcache.prompt_count -= 1
1478 self.outputcache.prompt_count -= 1
1465
1479
1466 if self.autoindent:
1480 if self.autoindent:
1467 self.indent_current_nsp = 0
1481 self.indent_current_nsp = 0
1468 more = 0
1482 more = 0
1469 except EOFError:
1483 except EOFError:
1470 if self.autoindent:
1484 if self.autoindent:
1471 self.readline_startup_hook(None)
1485 self.readline_startup_hook(None)
1472 self.write('\n')
1486 self.write('\n')
1473 self.exit()
1487 self.exit()
1474 except bdb.BdbQuit:
1488 except bdb.BdbQuit:
1475 warn('The Python debugger has exited with a BdbQuit exception.\n'
1489 warn('The Python debugger has exited with a BdbQuit exception.\n'
1476 'Because of how pdb handles the stack, it is impossible\n'
1490 'Because of how pdb handles the stack, it is impossible\n'
1477 'for IPython to properly format this particular exception.\n'
1491 'for IPython to properly format this particular exception.\n'
1478 'IPython will resume normal operation.')
1492 'IPython will resume normal operation.')
1479 except:
1493 except:
1480 # exceptions here are VERY RARE, but they can be triggered
1494 # exceptions here are VERY RARE, but they can be triggered
1481 # asynchronously by signal handlers, for example.
1495 # asynchronously by signal handlers, for example.
1482 self.showtraceback()
1496 self.showtraceback()
1483 else:
1497 else:
1484 more = self.push(line)
1498 more = self.push(line)
1485 if (self.SyntaxTB.last_syntax_error and
1499 if (self.SyntaxTB.last_syntax_error and
1486 self.rc.autoedit_syntax):
1500 self.rc.autoedit_syntax):
1487 self.edit_syntax_error()
1501 self.edit_syntax_error()
1488
1502
1489 # We are off again...
1503 # We are off again...
1490 __builtin__.__dict__['__IPYTHON__active'] -= 1
1504 __builtin__.__dict__['__IPYTHON__active'] -= 1
1491
1505
1492 def excepthook(self, type, value, tb):
1506 def excepthook(self, etype, value, tb):
1493 """One more defense for GUI apps that call sys.excepthook.
1507 """One more defense for GUI apps that call sys.excepthook.
1494
1508
1495 GUI frameworks like wxPython trap exceptions and call
1509 GUI frameworks like wxPython trap exceptions and call
1496 sys.excepthook themselves. I guess this is a feature that
1510 sys.excepthook themselves. I guess this is a feature that
1497 enables them to keep running after exceptions that would
1511 enables them to keep running after exceptions that would
1498 otherwise kill their mainloop. This is a bother for IPython
1512 otherwise kill their mainloop. This is a bother for IPython
1499 which excepts to catch all of the program exceptions with a try:
1513 which excepts to catch all of the program exceptions with a try:
1500 except: statement.
1514 except: statement.
1501
1515
1502 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1516 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1503 any app directly invokes sys.excepthook, it will look to the user like
1517 any app directly invokes sys.excepthook, it will look to the user like
1504 IPython crashed. In order to work around this, we can disable the
1518 IPython crashed. In order to work around this, we can disable the
1505 CrashHandler and replace it with this excepthook instead, which prints a
1519 CrashHandler and replace it with this excepthook instead, which prints a
1506 regular traceback using our InteractiveTB. In this fashion, apps which
1520 regular traceback using our InteractiveTB. In this fashion, apps which
1507 call sys.excepthook will generate a regular-looking exception from
1521 call sys.excepthook will generate a regular-looking exception from
1508 IPython, and the CrashHandler will only be triggered by real IPython
1522 IPython, and the CrashHandler will only be triggered by real IPython
1509 crashes.
1523 crashes.
1510
1524
1511 This hook should be used sparingly, only in places which are not likely
1525 This hook should be used sparingly, only in places which are not likely
1512 to be true IPython errors.
1526 to be true IPython errors.
1513 """
1527 """
1514
1528 self.showtraceback((etype,value,tb),tb_offset=0)
1515 self.InteractiveTB(type, value, tb, tb_offset=0)
1516 if self.InteractiveTB.call_pdb and self.has_readline:
1517 self.readline.set_completer(self.Completer.complete)
1518
1529
1519 def transform_alias(self, alias,rest=''):
1530 def transform_alias(self, alias,rest=''):
1520 """ Transform alias to system command string
1531 """ Transform alias to system command string
1521
1532
1522 """
1533 """
1523 nargs,cmd = self.alias_table[alias]
1534 nargs,cmd = self.alias_table[alias]
1524 # Expand the %l special to be the user's input line
1535 # Expand the %l special to be the user's input line
1525 if cmd.find('%l') >= 0:
1536 if cmd.find('%l') >= 0:
1526 cmd = cmd.replace('%l',rest)
1537 cmd = cmd.replace('%l',rest)
1527 rest = ''
1538 rest = ''
1528 if nargs==0:
1539 if nargs==0:
1529 # Simple, argument-less aliases
1540 # Simple, argument-less aliases
1530 cmd = '%s %s' % (cmd,rest)
1541 cmd = '%s %s' % (cmd,rest)
1531 else:
1542 else:
1532 # Handle aliases with positional arguments
1543 # Handle aliases with positional arguments
1533 args = rest.split(None,nargs)
1544 args = rest.split(None,nargs)
1534 if len(args)< nargs:
1545 if len(args)< nargs:
1535 error('Alias <%s> requires %s arguments, %s given.' %
1546 error('Alias <%s> requires %s arguments, %s given.' %
1536 (alias,nargs,len(args)))
1547 (alias,nargs,len(args)))
1537 return None
1548 return None
1538 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1549 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1539 # Now call the macro, evaluating in the user's namespace
1550 # Now call the macro, evaluating in the user's namespace
1540
1551
1541 return cmd
1552 return cmd
1542
1553
1543 def call_alias(self,alias,rest=''):
1554 def call_alias(self,alias,rest=''):
1544 """Call an alias given its name and the rest of the line.
1555 """Call an alias given its name and the rest of the line.
1545
1556
1546 This is only used to provide backwards compatibility for users of
1557 This is only used to provide backwards compatibility for users of
1547 ipalias(), use of which is not recommended for anymore."""
1558 ipalias(), use of which is not recommended for anymore."""
1548
1559
1549 # Now call the macro, evaluating in the user's namespace
1560 # Now call the macro, evaluating in the user's namespace
1550 cmd = self.transform_alias(alias, rest)
1561 cmd = self.transform_alias(alias, rest)
1551 try:
1562 try:
1552 self.system(cmd)
1563 self.system(cmd)
1553 except:
1564 except:
1554 self.showtraceback()
1565 self.showtraceback()
1555
1566
1556 def indent_current_str(self):
1567 def indent_current_str(self):
1557 """return the current level of indentation as a string"""
1568 """return the current level of indentation as a string"""
1558 return self.indent_current_nsp * ' '
1569 return self.indent_current_nsp * ' '
1559
1570
1560 def autoindent_update(self,line):
1571 def autoindent_update(self,line):
1561 """Keep track of the indent level."""
1572 """Keep track of the indent level."""
1562
1573
1563 #debugx('line')
1574 #debugx('line')
1564 #debugx('self.indent_current_nsp')
1575 #debugx('self.indent_current_nsp')
1565 if self.autoindent:
1576 if self.autoindent:
1566 if line:
1577 if line:
1567 inisp = num_ini_spaces(line)
1578 inisp = num_ini_spaces(line)
1568 if inisp < self.indent_current_nsp:
1579 if inisp < self.indent_current_nsp:
1569 self.indent_current_nsp = inisp
1580 self.indent_current_nsp = inisp
1570
1581
1571 if line[-1] == ':':
1582 if line[-1] == ':':
1572 self.indent_current_nsp += 4
1583 self.indent_current_nsp += 4
1573 elif dedent_re.match(line):
1584 elif dedent_re.match(line):
1574 self.indent_current_nsp -= 4
1585 self.indent_current_nsp -= 4
1575 else:
1586 else:
1576 self.indent_current_nsp = 0
1587 self.indent_current_nsp = 0
1577
1588
1578 def runlines(self,lines):
1589 def runlines(self,lines):
1579 """Run a string of one or more lines of source.
1590 """Run a string of one or more lines of source.
1580
1591
1581 This method is capable of running a string containing multiple source
1592 This method is capable of running a string containing multiple source
1582 lines, as if they had been entered at the IPython prompt. Since it
1593 lines, as if they had been entered at the IPython prompt. Since it
1583 exposes IPython's processing machinery, the given strings can contain
1594 exposes IPython's processing machinery, the given strings can contain
1584 magic calls (%magic), special shell access (!cmd), etc."""
1595 magic calls (%magic), special shell access (!cmd), etc."""
1585
1596
1586 # We must start with a clean buffer, in case this is run from an
1597 # We must start with a clean buffer, in case this is run from an
1587 # interactive IPython session (via a magic, for example).
1598 # interactive IPython session (via a magic, for example).
1588 self.resetbuffer()
1599 self.resetbuffer()
1589 lines = lines.split('\n')
1600 lines = lines.split('\n')
1590 more = 0
1601 more = 0
1591 for line in lines:
1602 for line in lines:
1592 # skip blank lines so we don't mess up the prompt counter, but do
1603 # skip blank lines so we don't mess up the prompt counter, but do
1593 # NOT skip even a blank line if we are in a code block (more is
1604 # NOT skip even a blank line if we are in a code block (more is
1594 # true)
1605 # true)
1595 if line or more:
1606 if line or more:
1596 more = self.push(self.prefilter(line,more))
1607 more = self.push(self.prefilter(line,more))
1597 # IPython's runsource returns None if there was an error
1608 # IPython's runsource returns None if there was an error
1598 # compiling the code. This allows us to stop processing right
1609 # compiling the code. This allows us to stop processing right
1599 # away, so the user gets the error message at the right place.
1610 # away, so the user gets the error message at the right place.
1600 if more is None:
1611 if more is None:
1601 break
1612 break
1602 # final newline in case the input didn't have it, so that the code
1613 # final newline in case the input didn't have it, so that the code
1603 # actually does get executed
1614 # actually does get executed
1604 if more:
1615 if more:
1605 self.push('\n')
1616 self.push('\n')
1606
1617
1607 def runsource(self, source, filename='<input>', symbol='single'):
1618 def runsource(self, source, filename='<input>', symbol='single'):
1608 """Compile and run some source in the interpreter.
1619 """Compile and run some source in the interpreter.
1609
1620
1610 Arguments are as for compile_command().
1621 Arguments are as for compile_command().
1611
1622
1612 One several things can happen:
1623 One several things can happen:
1613
1624
1614 1) The input is incorrect; compile_command() raised an
1625 1) The input is incorrect; compile_command() raised an
1615 exception (SyntaxError or OverflowError). A syntax traceback
1626 exception (SyntaxError or OverflowError). A syntax traceback
1616 will be printed by calling the showsyntaxerror() method.
1627 will be printed by calling the showsyntaxerror() method.
1617
1628
1618 2) The input is incomplete, and more input is required;
1629 2) The input is incomplete, and more input is required;
1619 compile_command() returned None. Nothing happens.
1630 compile_command() returned None. Nothing happens.
1620
1631
1621 3) The input is complete; compile_command() returned a code
1632 3) The input is complete; compile_command() returned a code
1622 object. The code is executed by calling self.runcode() (which
1633 object. The code is executed by calling self.runcode() (which
1623 also handles run-time exceptions, except for SystemExit).
1634 also handles run-time exceptions, except for SystemExit).
1624
1635
1625 The return value is:
1636 The return value is:
1626
1637
1627 - True in case 2
1638 - True in case 2
1628
1639
1629 - False in the other cases, unless an exception is raised, where
1640 - False in the other cases, unless an exception is raised, where
1630 None is returned instead. This can be used by external callers to
1641 None is returned instead. This can be used by external callers to
1631 know whether to continue feeding input or not.
1642 know whether to continue feeding input or not.
1632
1643
1633 The return value can be used to decide whether to use sys.ps1 or
1644 The return value can be used to decide whether to use sys.ps1 or
1634 sys.ps2 to prompt the next line."""
1645 sys.ps2 to prompt the next line."""
1635
1646
1636 try:
1647 try:
1637 code = self.compile(source,filename,symbol)
1648 code = self.compile(source,filename,symbol)
1638 except (OverflowError, SyntaxError, ValueError):
1649 except (OverflowError, SyntaxError, ValueError):
1639 # Case 1
1650 # Case 1
1640 self.showsyntaxerror(filename)
1651 self.showsyntaxerror(filename)
1641 return None
1652 return None
1642
1653
1643 if code is None:
1654 if code is None:
1644 # Case 2
1655 # Case 2
1645 return True
1656 return True
1646
1657
1647 # Case 3
1658 # Case 3
1648 # We store the code object so that threaded shells and
1659 # We store the code object so that threaded shells and
1649 # custom exception handlers can access all this info if needed.
1660 # custom exception handlers can access all this info if needed.
1650 # The source corresponding to this can be obtained from the
1661 # The source corresponding to this can be obtained from the
1651 # buffer attribute as '\n'.join(self.buffer).
1662 # buffer attribute as '\n'.join(self.buffer).
1652 self.code_to_run = code
1663 self.code_to_run = code
1653 # now actually execute the code object
1664 # now actually execute the code object
1654 if self.runcode(code) == 0:
1665 if self.runcode(code) == 0:
1655 return False
1666 return False
1656 else:
1667 else:
1657 return None
1668 return None
1658
1669
1659 def runcode(self,code_obj):
1670 def runcode(self,code_obj):
1660 """Execute a code object.
1671 """Execute a code object.
1661
1672
1662 When an exception occurs, self.showtraceback() is called to display a
1673 When an exception occurs, self.showtraceback() is called to display a
1663 traceback.
1674 traceback.
1664
1675
1665 Return value: a flag indicating whether the code to be run completed
1676 Return value: a flag indicating whether the code to be run completed
1666 successfully:
1677 successfully:
1667
1678
1668 - 0: successful execution.
1679 - 0: successful execution.
1669 - 1: an error occurred.
1680 - 1: an error occurred.
1670 """
1681 """
1671
1682
1672 # Set our own excepthook in case the user code tries to call it
1683 # Set our own excepthook in case the user code tries to call it
1673 # directly, so that the IPython crash handler doesn't get triggered
1684 # directly, so that the IPython crash handler doesn't get triggered
1674 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1685 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1675
1686
1676 # we save the original sys.excepthook in the instance, in case config
1687 # we save the original sys.excepthook in the instance, in case config
1677 # code (such as magics) needs access to it.
1688 # code (such as magics) needs access to it.
1678 self.sys_excepthook = old_excepthook
1689 self.sys_excepthook = old_excepthook
1679 outflag = 1 # happens in more places, so it's easier as default
1690 outflag = 1 # happens in more places, so it's easier as default
1680 try:
1691 try:
1681 try:
1692 try:
1682 # Embedded instances require separate global/local namespaces
1693 # Embedded instances require separate global/local namespaces
1683 # so they can see both the surrounding (local) namespace and
1694 # so they can see both the surrounding (local) namespace and
1684 # the module-level globals when called inside another function.
1695 # the module-level globals when called inside another function.
1685 if self.embedded:
1696 if self.embedded:
1686 exec code_obj in self.user_global_ns, self.user_ns
1697 exec code_obj in self.user_global_ns, self.user_ns
1687 # Normal (non-embedded) instances should only have a single
1698 # Normal (non-embedded) instances should only have a single
1688 # namespace for user code execution, otherwise functions won't
1699 # namespace for user code execution, otherwise functions won't
1689 # see interactive top-level globals.
1700 # see interactive top-level globals.
1690 else:
1701 else:
1691 exec code_obj in self.user_ns
1702 exec code_obj in self.user_ns
1692 finally:
1703 finally:
1693 # Reset our crash handler in place
1704 # Reset our crash handler in place
1694 sys.excepthook = old_excepthook
1705 sys.excepthook = old_excepthook
1695 except SystemExit:
1706 except SystemExit:
1696 self.resetbuffer()
1707 self.resetbuffer()
1697 self.showtraceback()
1708 self.showtraceback()
1698 warn("Type exit or quit to exit IPython "
1709 warn("Type exit or quit to exit IPython "
1699 "(%Exit or %Quit do so unconditionally).",level=1)
1710 "(%Exit or %Quit do so unconditionally).",level=1)
1700 except self.custom_exceptions:
1711 except self.custom_exceptions:
1701 etype,value,tb = sys.exc_info()
1712 etype,value,tb = sys.exc_info()
1702 self.CustomTB(etype,value,tb)
1713 self.CustomTB(etype,value,tb)
1703 except:
1714 except:
1704 self.showtraceback()
1715 self.showtraceback()
1705 else:
1716 else:
1706 outflag = 0
1717 outflag = 0
1707 if softspace(sys.stdout, 0):
1718 if softspace(sys.stdout, 0):
1708 print
1719 print
1709 # Flush out code object which has been run (and source)
1720 # Flush out code object which has been run (and source)
1710 self.code_to_run = None
1721 self.code_to_run = None
1711 return outflag
1722 return outflag
1712
1723
1713 def push(self, line):
1724 def push(self, line):
1714 """Push a line to the interpreter.
1725 """Push a line to the interpreter.
1715
1726
1716 The line should not have a trailing newline; it may have
1727 The line should not have a trailing newline; it may have
1717 internal newlines. The line is appended to a buffer and the
1728 internal newlines. The line is appended to a buffer and the
1718 interpreter's runsource() method is called with the
1729 interpreter's runsource() method is called with the
1719 concatenated contents of the buffer as source. If this
1730 concatenated contents of the buffer as source. If this
1720 indicates that the command was executed or invalid, the buffer
1731 indicates that the command was executed or invalid, the buffer
1721 is reset; otherwise, the command is incomplete, and the buffer
1732 is reset; otherwise, the command is incomplete, and the buffer
1722 is left as it was after the line was appended. The return
1733 is left as it was after the line was appended. The return
1723 value is 1 if more input is required, 0 if the line was dealt
1734 value is 1 if more input is required, 0 if the line was dealt
1724 with in some way (this is the same as runsource()).
1735 with in some way (this is the same as runsource()).
1725 """
1736 """
1726
1737
1727 # autoindent management should be done here, and not in the
1738 # autoindent management should be done here, and not in the
1728 # interactive loop, since that one is only seen by keyboard input. We
1739 # interactive loop, since that one is only seen by keyboard input. We
1729 # need this done correctly even for code run via runlines (which uses
1740 # need this done correctly even for code run via runlines (which uses
1730 # push).
1741 # push).
1731
1742
1732 #print 'push line: <%s>' % line # dbg
1743 #print 'push line: <%s>' % line # dbg
1733 self.autoindent_update(line)
1744 self.autoindent_update(line)
1734
1745
1735 self.buffer.append(line)
1746 self.buffer.append(line)
1736 more = self.runsource('\n'.join(self.buffer), self.filename)
1747 more = self.runsource('\n'.join(self.buffer), self.filename)
1737 if not more:
1748 if not more:
1738 self.resetbuffer()
1749 self.resetbuffer()
1739 return more
1750 return more
1740
1751
1741 def resetbuffer(self):
1752 def resetbuffer(self):
1742 """Reset the input buffer."""
1753 """Reset the input buffer."""
1743 self.buffer[:] = []
1754 self.buffer[:] = []
1744
1755
1745 def raw_input(self,prompt='',continue_prompt=False):
1756 def raw_input(self,prompt='',continue_prompt=False):
1746 """Write a prompt and read a line.
1757 """Write a prompt and read a line.
1747
1758
1748 The returned line does not include the trailing newline.
1759 The returned line does not include the trailing newline.
1749 When the user enters the EOF key sequence, EOFError is raised.
1760 When the user enters the EOF key sequence, EOFError is raised.
1750
1761
1751 Optional inputs:
1762 Optional inputs:
1752
1763
1753 - prompt(''): a string to be printed to prompt the user.
1764 - prompt(''): a string to be printed to prompt the user.
1754
1765
1755 - continue_prompt(False): whether this line is the first one or a
1766 - continue_prompt(False): whether this line is the first one or a
1756 continuation in a sequence of inputs.
1767 continuation in a sequence of inputs.
1757 """
1768 """
1758
1769
1759 line = raw_input_original(prompt)
1770 line = raw_input_original(prompt)
1760
1771
1761 # Try to be reasonably smart about not re-indenting pasted input more
1772 # Try to be reasonably smart about not re-indenting pasted input more
1762 # than necessary. We do this by trimming out the auto-indent initial
1773 # than necessary. We do this by trimming out the auto-indent initial
1763 # spaces, if the user's actual input started itself with whitespace.
1774 # spaces, if the user's actual input started itself with whitespace.
1764 #debugx('self.buffer[-1]')
1775 #debugx('self.buffer[-1]')
1765
1776
1766 if self.autoindent:
1777 if self.autoindent:
1767 if num_ini_spaces(line) > self.indent_current_nsp:
1778 if num_ini_spaces(line) > self.indent_current_nsp:
1768 line = line[self.indent_current_nsp:]
1779 line = line[self.indent_current_nsp:]
1769 self.indent_current_nsp = 0
1780 self.indent_current_nsp = 0
1770
1781
1771 # store the unfiltered input before the user has any chance to modify
1782 # store the unfiltered input before the user has any chance to modify
1772 # it.
1783 # it.
1773 if line.strip():
1784 if line.strip():
1774 if continue_prompt:
1785 if continue_prompt:
1775 self.input_hist_raw[-1] += '%s\n' % line
1786 self.input_hist_raw[-1] += '%s\n' % line
1776 else:
1787 else:
1777 self.input_hist_raw.append('%s\n' % line)
1788 self.input_hist_raw.append('%s\n' % line)
1778
1789
1779 lineout = self.prefilter(line,continue_prompt)
1790 lineout = self.prefilter(line,continue_prompt)
1780 return lineout
1791 return lineout
1781
1792
1782 def split_user_input(self,line):
1793 def split_user_input(self,line):
1783 """Split user input into pre-char, function part and rest."""
1794 """Split user input into pre-char, function part and rest."""
1784
1795
1785 lsplit = self.line_split.match(line)
1796 lsplit = self.line_split.match(line)
1786 if lsplit is None: # no regexp match returns None
1797 if lsplit is None: # no regexp match returns None
1787 try:
1798 try:
1788 iFun,theRest = line.split(None,1)
1799 iFun,theRest = line.split(None,1)
1789 except ValueError:
1800 except ValueError:
1790 iFun,theRest = line,''
1801 iFun,theRest = line,''
1791 pre = re.match('^(\s*)(.*)',line).groups()[0]
1802 pre = re.match('^(\s*)(.*)',line).groups()[0]
1792 else:
1803 else:
1793 pre,iFun,theRest = lsplit.groups()
1804 pre,iFun,theRest = lsplit.groups()
1794
1805
1795 #print 'line:<%s>' % line # dbg
1806 #print 'line:<%s>' % line # dbg
1796 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1807 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1797 return pre,iFun.strip(),theRest
1808 return pre,iFun.strip(),theRest
1798
1809
1799 def _prefilter(self, line, continue_prompt):
1810 def _prefilter(self, line, continue_prompt):
1800 """Calls different preprocessors, depending on the form of line."""
1811 """Calls different preprocessors, depending on the form of line."""
1801
1812
1802 # All handlers *must* return a value, even if it's blank ('').
1813 # All handlers *must* return a value, even if it's blank ('').
1803
1814
1804 # Lines are NOT logged here. Handlers should process the line as
1815 # Lines are NOT logged here. Handlers should process the line as
1805 # needed, update the cache AND log it (so that the input cache array
1816 # needed, update the cache AND log it (so that the input cache array
1806 # stays synced).
1817 # stays synced).
1807
1818
1808 # This function is _very_ delicate, and since it's also the one which
1819 # This function is _very_ delicate, and since it's also the one which
1809 # determines IPython's response to user input, it must be as efficient
1820 # determines IPython's response to user input, it must be as efficient
1810 # as possible. For this reason it has _many_ returns in it, trying
1821 # as possible. For this reason it has _many_ returns in it, trying
1811 # always to exit as quickly as it can figure out what it needs to do.
1822 # always to exit as quickly as it can figure out what it needs to do.
1812
1823
1813 # This function is the main responsible for maintaining IPython's
1824 # This function is the main responsible for maintaining IPython's
1814 # behavior respectful of Python's semantics. So be _very_ careful if
1825 # behavior respectful of Python's semantics. So be _very_ careful if
1815 # making changes to anything here.
1826 # making changes to anything here.
1816
1827
1817 #.....................................................................
1828 #.....................................................................
1818 # Code begins
1829 # Code begins
1819
1830
1820 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1831 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1821
1832
1822 # save the line away in case we crash, so the post-mortem handler can
1833 # save the line away in case we crash, so the post-mortem handler can
1823 # record it
1834 # record it
1824 self._last_input_line = line
1835 self._last_input_line = line
1825
1836
1826 #print '***line: <%s>' % line # dbg
1837 #print '***line: <%s>' % line # dbg
1827
1838
1828 # the input history needs to track even empty lines
1839 # the input history needs to track even empty lines
1829 stripped = line.strip()
1840 stripped = line.strip()
1830
1841
1831 if not stripped:
1842 if not stripped:
1832 if not continue_prompt:
1843 if not continue_prompt:
1833 self.outputcache.prompt_count -= 1
1844 self.outputcache.prompt_count -= 1
1834 return self.handle_normal(line,continue_prompt)
1845 return self.handle_normal(line,continue_prompt)
1835 #return self.handle_normal('',continue_prompt)
1846 #return self.handle_normal('',continue_prompt)
1836
1847
1837 # print '***cont',continue_prompt # dbg
1848 # print '***cont',continue_prompt # dbg
1838 # special handlers are only allowed for single line statements
1849 # special handlers are only allowed for single line statements
1839 if continue_prompt and not self.rc.multi_line_specials:
1850 if continue_prompt and not self.rc.multi_line_specials:
1840 return self.handle_normal(line,continue_prompt)
1851 return self.handle_normal(line,continue_prompt)
1841
1852
1842
1853
1843 # For the rest, we need the structure of the input
1854 # For the rest, we need the structure of the input
1844 pre,iFun,theRest = self.split_user_input(line)
1855 pre,iFun,theRest = self.split_user_input(line)
1845
1856
1846 # See whether any pre-existing handler can take care of it
1857 # See whether any pre-existing handler can take care of it
1847
1858
1848 rewritten = self.hooks.input_prefilter(stripped)
1859 rewritten = self.hooks.input_prefilter(stripped)
1849 if rewritten != stripped: # ok, some prefilter did something
1860 if rewritten != stripped: # ok, some prefilter did something
1850 rewritten = pre + rewritten # add indentation
1861 rewritten = pre + rewritten # add indentation
1851 return self.handle_normal(rewritten)
1862 return self.handle_normal(rewritten)
1852
1863
1853
1864
1854
1865
1855
1866
1856 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1867 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1857
1868
1858 # First check for explicit escapes in the last/first character
1869 # First check for explicit escapes in the last/first character
1859 handler = None
1870 handler = None
1860 if line[-1] == self.ESC_HELP:
1871 if line[-1] == self.ESC_HELP:
1861 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1872 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1862 if handler is None:
1873 if handler is None:
1863 # look at the first character of iFun, NOT of line, so we skip
1874 # look at the first character of iFun, NOT of line, so we skip
1864 # leading whitespace in multiline input
1875 # leading whitespace in multiline input
1865 handler = self.esc_handlers.get(iFun[0:1])
1876 handler = self.esc_handlers.get(iFun[0:1])
1866 if handler is not None:
1877 if handler is not None:
1867 return handler(line,continue_prompt,pre,iFun,theRest)
1878 return handler(line,continue_prompt,pre,iFun,theRest)
1868 # Emacs ipython-mode tags certain input lines
1879 # Emacs ipython-mode tags certain input lines
1869 if line.endswith('# PYTHON-MODE'):
1880 if line.endswith('# PYTHON-MODE'):
1870 return self.handle_emacs(line,continue_prompt)
1881 return self.handle_emacs(line,continue_prompt)
1871
1882
1872 # Next, check if we can automatically execute this thing
1883 # Next, check if we can automatically execute this thing
1873
1884
1874 # Allow ! in multi-line statements if multi_line_specials is on:
1885 # Allow ! in multi-line statements if multi_line_specials is on:
1875 if continue_prompt and self.rc.multi_line_specials and \
1886 if continue_prompt and self.rc.multi_line_specials and \
1876 iFun.startswith(self.ESC_SHELL):
1887 iFun.startswith(self.ESC_SHELL):
1877 return self.handle_shell_escape(line,continue_prompt,
1888 return self.handle_shell_escape(line,continue_prompt,
1878 pre=pre,iFun=iFun,
1889 pre=pre,iFun=iFun,
1879 theRest=theRest)
1890 theRest=theRest)
1880
1891
1881 # Let's try to find if the input line is a magic fn
1892 # Let's try to find if the input line is a magic fn
1882 oinfo = None
1893 oinfo = None
1883 if hasattr(self,'magic_'+iFun):
1894 if hasattr(self,'magic_'+iFun):
1884 # WARNING: _ofind uses getattr(), so it can consume generators and
1895 # WARNING: _ofind uses getattr(), so it can consume generators and
1885 # cause other side effects.
1896 # cause other side effects.
1886 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1897 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1887 if oinfo['ismagic']:
1898 if oinfo['ismagic']:
1888 # Be careful not to call magics when a variable assignment is
1899 # Be careful not to call magics when a variable assignment is
1889 # being made (ls='hi', for example)
1900 # being made (ls='hi', for example)
1890 if self.rc.automagic and \
1901 if self.rc.automagic and \
1891 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1902 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
1892 (self.rc.multi_line_specials or not continue_prompt):
1903 (self.rc.multi_line_specials or not continue_prompt):
1893 return self.handle_magic(line,continue_prompt,
1904 return self.handle_magic(line,continue_prompt,
1894 pre,iFun,theRest)
1905 pre,iFun,theRest)
1895 else:
1906 else:
1896 return self.handle_normal(line,continue_prompt)
1907 return self.handle_normal(line,continue_prompt)
1897
1908
1898 # If the rest of the line begins with an (in)equality, assginment or
1909 # If the rest of the line begins with an (in)equality, assginment or
1899 # function call, we should not call _ofind but simply execute it.
1910 # function call, we should not call _ofind but simply execute it.
1900 # This avoids spurious geattr() accesses on objects upon assignment.
1911 # This avoids spurious geattr() accesses on objects upon assignment.
1901 #
1912 #
1902 # It also allows users to assign to either alias or magic names true
1913 # It also allows users to assign to either alias or magic names true
1903 # python variables (the magic/alias systems always take second seat to
1914 # python variables (the magic/alias systems always take second seat to
1904 # true python code).
1915 # true python code).
1905 if theRest and theRest[0] in '!=()':
1916 if theRest and theRest[0] in '!=()':
1906 return self.handle_normal(line,continue_prompt)
1917 return self.handle_normal(line,continue_prompt)
1907
1918
1908 if oinfo is None:
1919 if oinfo is None:
1909 # let's try to ensure that _oinfo is ONLY called when autocall is
1920 # let's try to ensure that _oinfo is ONLY called when autocall is
1910 # on. Since it has inevitable potential side effects, at least
1921 # on. Since it has inevitable potential side effects, at least
1911 # having autocall off should be a guarantee to the user that no
1922 # having autocall off should be a guarantee to the user that no
1912 # weird things will happen.
1923 # weird things will happen.
1913
1924
1914 if self.rc.autocall:
1925 if self.rc.autocall:
1915 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1926 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
1916 else:
1927 else:
1917 # in this case, all that's left is either an alias or
1928 # in this case, all that's left is either an alias or
1918 # processing the line normally.
1929 # processing the line normally.
1919 if iFun in self.alias_table:
1930 if iFun in self.alias_table:
1920 return self.handle_alias(line,continue_prompt,
1931 return self.handle_alias(line,continue_prompt,
1921 pre,iFun,theRest)
1932 pre,iFun,theRest)
1922
1933
1923 else:
1934 else:
1924 return self.handle_normal(line,continue_prompt)
1935 return self.handle_normal(line,continue_prompt)
1925
1936
1926 if not oinfo['found']:
1937 if not oinfo['found']:
1927 return self.handle_normal(line,continue_prompt)
1938 return self.handle_normal(line,continue_prompt)
1928 else:
1939 else:
1929 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1940 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1930 if oinfo['isalias']:
1941 if oinfo['isalias']:
1931 return self.handle_alias(line,continue_prompt,
1942 return self.handle_alias(line,continue_prompt,
1932 pre,iFun,theRest)
1943 pre,iFun,theRest)
1933
1944
1934 if (self.rc.autocall
1945 if (self.rc.autocall
1935 and
1946 and
1936 (
1947 (
1937 #only consider exclusion re if not "," or ";" autoquoting
1948 #only consider exclusion re if not "," or ";" autoquoting
1938 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
1949 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
1939 or pre == self.ESC_PAREN) or
1950 or pre == self.ESC_PAREN) or
1940 (not self.re_exclude_auto.match(theRest)))
1951 (not self.re_exclude_auto.match(theRest)))
1941 and
1952 and
1942 self.re_fun_name.match(iFun) and
1953 self.re_fun_name.match(iFun) and
1943 callable(oinfo['obj'])) :
1954 callable(oinfo['obj'])) :
1944 #print 'going auto' # dbg
1955 #print 'going auto' # dbg
1945 return self.handle_auto(line,continue_prompt,
1956 return self.handle_auto(line,continue_prompt,
1946 pre,iFun,theRest,oinfo['obj'])
1957 pre,iFun,theRest,oinfo['obj'])
1947 else:
1958 else:
1948 #print 'was callable?', callable(oinfo['obj']) # dbg
1959 #print 'was callable?', callable(oinfo['obj']) # dbg
1949 return self.handle_normal(line,continue_prompt)
1960 return self.handle_normal(line,continue_prompt)
1950
1961
1951 # If we get here, we have a normal Python line. Log and return.
1962 # If we get here, we have a normal Python line. Log and return.
1952 return self.handle_normal(line,continue_prompt)
1963 return self.handle_normal(line,continue_prompt)
1953
1964
1954 def _prefilter_dumb(self, line, continue_prompt):
1965 def _prefilter_dumb(self, line, continue_prompt):
1955 """simple prefilter function, for debugging"""
1966 """simple prefilter function, for debugging"""
1956 return self.handle_normal(line,continue_prompt)
1967 return self.handle_normal(line,continue_prompt)
1957
1968
1958 # Set the default prefilter() function (this can be user-overridden)
1969 # Set the default prefilter() function (this can be user-overridden)
1959 prefilter = _prefilter
1970 prefilter = _prefilter
1960
1971
1961 def handle_normal(self,line,continue_prompt=None,
1972 def handle_normal(self,line,continue_prompt=None,
1962 pre=None,iFun=None,theRest=None):
1973 pre=None,iFun=None,theRest=None):
1963 """Handle normal input lines. Use as a template for handlers."""
1974 """Handle normal input lines. Use as a template for handlers."""
1964
1975
1965 # With autoindent on, we need some way to exit the input loop, and I
1976 # With autoindent on, we need some way to exit the input loop, and I
1966 # don't want to force the user to have to backspace all the way to
1977 # don't want to force the user to have to backspace all the way to
1967 # clear the line. The rule will be in this case, that either two
1978 # clear the line. The rule will be in this case, that either two
1968 # lines of pure whitespace in a row, or a line of pure whitespace but
1979 # lines of pure whitespace in a row, or a line of pure whitespace but
1969 # of a size different to the indent level, will exit the input loop.
1980 # of a size different to the indent level, will exit the input loop.
1970
1981
1971 if (continue_prompt and self.autoindent and line.isspace() and
1982 if (continue_prompt and self.autoindent and line.isspace() and
1972 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
1983 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
1973 (self.buffer[-1]).isspace() )):
1984 (self.buffer[-1]).isspace() )):
1974 line = ''
1985 line = ''
1975
1986
1976 self.log(line,continue_prompt)
1987 self.log(line,continue_prompt)
1977 return line
1988 return line
1978
1989
1979 def handle_alias(self,line,continue_prompt=None,
1990 def handle_alias(self,line,continue_prompt=None,
1980 pre=None,iFun=None,theRest=None):
1991 pre=None,iFun=None,theRest=None):
1981 """Handle alias input lines. """
1992 """Handle alias input lines. """
1982
1993
1983 # pre is needed, because it carries the leading whitespace. Otherwise
1994 # pre is needed, because it carries the leading whitespace. Otherwise
1984 # aliases won't work in indented sections.
1995 # aliases won't work in indented sections.
1985 transformed = self.transform_alias(iFun, theRest)
1996 transformed = self.transform_alias(iFun, theRest)
1986 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
1997 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
1987 self.log(line_out,continue_prompt)
1998 self.log(line_out,continue_prompt)
1988 return line_out
1999 return line_out
1989
2000
1990 def handle_shell_escape(self, line, continue_prompt=None,
2001 def handle_shell_escape(self, line, continue_prompt=None,
1991 pre=None,iFun=None,theRest=None):
2002 pre=None,iFun=None,theRest=None):
1992 """Execute the line in a shell, empty return value"""
2003 """Execute the line in a shell, empty return value"""
1993
2004
1994 #print 'line in :', `line` # dbg
2005 #print 'line in :', `line` # dbg
1995 # Example of a special handler. Others follow a similar pattern.
2006 # Example of a special handler. Others follow a similar pattern.
1996 if line.lstrip().startswith('!!'):
2007 if line.lstrip().startswith('!!'):
1997 # rewrite iFun/theRest to properly hold the call to %sx and
2008 # rewrite iFun/theRest to properly hold the call to %sx and
1998 # the actual command to be executed, so handle_magic can work
2009 # the actual command to be executed, so handle_magic can work
1999 # correctly
2010 # correctly
2000 theRest = '%s %s' % (iFun[2:],theRest)
2011 theRest = '%s %s' % (iFun[2:],theRest)
2001 iFun = 'sx'
2012 iFun = 'sx'
2002 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2013 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2003 line.lstrip()[2:]),
2014 line.lstrip()[2:]),
2004 continue_prompt,pre,iFun,theRest)
2015 continue_prompt,pre,iFun,theRest)
2005 else:
2016 else:
2006 cmd=line.lstrip().lstrip('!')
2017 cmd=line.lstrip().lstrip('!')
2007 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2018 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2008 # update cache/log and return
2019 # update cache/log and return
2009 self.log(line_out,continue_prompt)
2020 self.log(line_out,continue_prompt)
2010 return line_out
2021 return line_out
2011
2022
2012 def handle_magic(self, line, continue_prompt=None,
2023 def handle_magic(self, line, continue_prompt=None,
2013 pre=None,iFun=None,theRest=None):
2024 pre=None,iFun=None,theRest=None):
2014 """Execute magic functions."""
2025 """Execute magic functions."""
2015
2026
2016
2027
2017 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2028 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2018 self.log(cmd,continue_prompt)
2029 self.log(cmd,continue_prompt)
2019 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2030 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2020 return cmd
2031 return cmd
2021
2032
2022 def handle_auto(self, line, continue_prompt=None,
2033 def handle_auto(self, line, continue_prompt=None,
2023 pre=None,iFun=None,theRest=None,obj=None):
2034 pre=None,iFun=None,theRest=None,obj=None):
2024 """Hande lines which can be auto-executed, quoting if requested."""
2035 """Hande lines which can be auto-executed, quoting if requested."""
2025
2036
2026 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2037 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2027
2038
2028 # This should only be active for single-line input!
2039 # This should only be active for single-line input!
2029 if continue_prompt:
2040 if continue_prompt:
2030 self.log(line,continue_prompt)
2041 self.log(line,continue_prompt)
2031 return line
2042 return line
2032
2043
2033 auto_rewrite = True
2044 auto_rewrite = True
2034
2045
2035 if pre == self.ESC_QUOTE:
2046 if pre == self.ESC_QUOTE:
2036 # Auto-quote splitting on whitespace
2047 # Auto-quote splitting on whitespace
2037 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2048 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2038 elif pre == self.ESC_QUOTE2:
2049 elif pre == self.ESC_QUOTE2:
2039 # Auto-quote whole string
2050 # Auto-quote whole string
2040 newcmd = '%s("%s")' % (iFun,theRest)
2051 newcmd = '%s("%s")' % (iFun,theRest)
2041 elif pre == self.ESC_PAREN:
2052 elif pre == self.ESC_PAREN:
2042 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2053 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2043 else:
2054 else:
2044 # Auto-paren.
2055 # Auto-paren.
2045 # We only apply it to argument-less calls if the autocall
2056 # We only apply it to argument-less calls if the autocall
2046 # parameter is set to 2. We only need to check that autocall is <
2057 # parameter is set to 2. We only need to check that autocall is <
2047 # 2, since this function isn't called unless it's at least 1.
2058 # 2, since this function isn't called unless it's at least 1.
2048 if not theRest and (self.rc.autocall < 2):
2059 if not theRest and (self.rc.autocall < 2):
2049 newcmd = '%s %s' % (iFun,theRest)
2060 newcmd = '%s %s' % (iFun,theRest)
2050 auto_rewrite = False
2061 auto_rewrite = False
2051 else:
2062 else:
2052 if theRest.startswith('['):
2063 if theRest.startswith('['):
2053 if hasattr(obj,'__getitem__'):
2064 if hasattr(obj,'__getitem__'):
2054 # Don't autocall in this case: item access for an object
2065 # Don't autocall in this case: item access for an object
2055 # which is BOTH callable and implements __getitem__.
2066 # which is BOTH callable and implements __getitem__.
2056 newcmd = '%s %s' % (iFun,theRest)
2067 newcmd = '%s %s' % (iFun,theRest)
2057 auto_rewrite = False
2068 auto_rewrite = False
2058 else:
2069 else:
2059 # if the object doesn't support [] access, go ahead and
2070 # if the object doesn't support [] access, go ahead and
2060 # autocall
2071 # autocall
2061 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2072 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2062 elif theRest.endswith(';'):
2073 elif theRest.endswith(';'):
2063 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2074 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2064 else:
2075 else:
2065 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2076 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2066
2077
2067 if auto_rewrite:
2078 if auto_rewrite:
2068 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2079 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2069 # log what is now valid Python, not the actual user input (without the
2080 # log what is now valid Python, not the actual user input (without the
2070 # final newline)
2081 # final newline)
2071 self.log(newcmd,continue_prompt)
2082 self.log(newcmd,continue_prompt)
2072 return newcmd
2083 return newcmd
2073
2084
2074 def handle_help(self, line, continue_prompt=None,
2085 def handle_help(self, line, continue_prompt=None,
2075 pre=None,iFun=None,theRest=None):
2086 pre=None,iFun=None,theRest=None):
2076 """Try to get some help for the object.
2087 """Try to get some help for the object.
2077
2088
2078 obj? or ?obj -> basic information.
2089 obj? or ?obj -> basic information.
2079 obj?? or ??obj -> more details.
2090 obj?? or ??obj -> more details.
2080 """
2091 """
2081
2092
2082 # We need to make sure that we don't process lines which would be
2093 # We need to make sure that we don't process lines which would be
2083 # otherwise valid python, such as "x=1 # what?"
2094 # otherwise valid python, such as "x=1 # what?"
2084 try:
2095 try:
2085 codeop.compile_command(line)
2096 codeop.compile_command(line)
2086 except SyntaxError:
2097 except SyntaxError:
2087 # We should only handle as help stuff which is NOT valid syntax
2098 # We should only handle as help stuff which is NOT valid syntax
2088 if line[0]==self.ESC_HELP:
2099 if line[0]==self.ESC_HELP:
2089 line = line[1:]
2100 line = line[1:]
2090 elif line[-1]==self.ESC_HELP:
2101 elif line[-1]==self.ESC_HELP:
2091 line = line[:-1]
2102 line = line[:-1]
2092 self.log('#?'+line)
2103 self.log('#?'+line)
2093 if line:
2104 if line:
2094 self.magic_pinfo(line)
2105 self.magic_pinfo(line)
2095 else:
2106 else:
2096 page(self.usage,screen_lines=self.rc.screen_length)
2107 page(self.usage,screen_lines=self.rc.screen_length)
2097 return '' # Empty string is needed here!
2108 return '' # Empty string is needed here!
2098 except:
2109 except:
2099 # Pass any other exceptions through to the normal handler
2110 # Pass any other exceptions through to the normal handler
2100 return self.handle_normal(line,continue_prompt)
2111 return self.handle_normal(line,continue_prompt)
2101 else:
2112 else:
2102 # If the code compiles ok, we should handle it normally
2113 # If the code compiles ok, we should handle it normally
2103 return self.handle_normal(line,continue_prompt)
2114 return self.handle_normal(line,continue_prompt)
2104
2115
2105 def getapi(self):
2116 def getapi(self):
2106 """ Get an IPApi object for this shell instance
2117 """ Get an IPApi object for this shell instance
2107
2118
2108 Getting an IPApi object is always preferable to accessing the shell
2119 Getting an IPApi object is always preferable to accessing the shell
2109 directly, but this holds true especially for extensions.
2120 directly, but this holds true especially for extensions.
2110
2121
2111 It should always be possible to implement an extension with IPApi
2122 It should always be possible to implement an extension with IPApi
2112 alone. If not, contact maintainer to request an addition.
2123 alone. If not, contact maintainer to request an addition.
2113
2124
2114 """
2125 """
2115 return self.api
2126 return self.api
2116
2127
2117 def handle_emacs(self,line,continue_prompt=None,
2128 def handle_emacs(self,line,continue_prompt=None,
2118 pre=None,iFun=None,theRest=None):
2129 pre=None,iFun=None,theRest=None):
2119 """Handle input lines marked by python-mode."""
2130 """Handle input lines marked by python-mode."""
2120
2131
2121 # Currently, nothing is done. Later more functionality can be added
2132 # Currently, nothing is done. Later more functionality can be added
2122 # here if needed.
2133 # here if needed.
2123
2134
2124 # The input cache shouldn't be updated
2135 # The input cache shouldn't be updated
2125
2136
2126 return line
2137 return line
2127
2138
2128 def mktempfile(self,data=None):
2139 def mktempfile(self,data=None):
2129 """Make a new tempfile and return its filename.
2140 """Make a new tempfile and return its filename.
2130
2141
2131 This makes a call to tempfile.mktemp, but it registers the created
2142 This makes a call to tempfile.mktemp, but it registers the created
2132 filename internally so ipython cleans it up at exit time.
2143 filename internally so ipython cleans it up at exit time.
2133
2144
2134 Optional inputs:
2145 Optional inputs:
2135
2146
2136 - data(None): if data is given, it gets written out to the temp file
2147 - data(None): if data is given, it gets written out to the temp file
2137 immediately, and the file is closed again."""
2148 immediately, and the file is closed again."""
2138
2149
2139 filename = tempfile.mktemp('.py','ipython_edit_')
2150 filename = tempfile.mktemp('.py','ipython_edit_')
2140 self.tempfiles.append(filename)
2151 self.tempfiles.append(filename)
2141
2152
2142 if data:
2153 if data:
2143 tmp_file = open(filename,'w')
2154 tmp_file = open(filename,'w')
2144 tmp_file.write(data)
2155 tmp_file.write(data)
2145 tmp_file.close()
2156 tmp_file.close()
2146 return filename
2157 return filename
2147
2158
2148 def write(self,data):
2159 def write(self,data):
2149 """Write a string to the default output"""
2160 """Write a string to the default output"""
2150 Term.cout.write(data)
2161 Term.cout.write(data)
2151
2162
2152 def write_err(self,data):
2163 def write_err(self,data):
2153 """Write a string to the default error output"""
2164 """Write a string to the default error output"""
2154 Term.cerr.write(data)
2165 Term.cerr.write(data)
2155
2166
2156 def exit(self):
2167 def exit(self):
2157 """Handle interactive exit.
2168 """Handle interactive exit.
2158
2169
2159 This method sets the exit_now attribute."""
2170 This method sets the exit_now attribute."""
2160
2171
2161 if self.rc.confirm_exit:
2172 if self.rc.confirm_exit:
2162 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2173 if ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2163 self.exit_now = True
2174 self.exit_now = True
2164 else:
2175 else:
2165 self.exit_now = True
2176 self.exit_now = True
2166 return self.exit_now
2177 return self.exit_now
2167
2178
2168 def safe_execfile(self,fname,*where,**kw):
2179 def safe_execfile(self,fname,*where,**kw):
2169 fname = os.path.expanduser(fname)
2180 fname = os.path.expanduser(fname)
2170
2181
2171 # find things also in current directory
2182 # find things also in current directory
2172 dname = os.path.dirname(fname)
2183 dname = os.path.dirname(fname)
2173 if not sys.path.count(dname):
2184 if not sys.path.count(dname):
2174 sys.path.append(dname)
2185 sys.path.append(dname)
2175
2186
2176 try:
2187 try:
2177 xfile = open(fname)
2188 xfile = open(fname)
2178 except:
2189 except:
2179 print >> Term.cerr, \
2190 print >> Term.cerr, \
2180 'Could not open file <%s> for safe execution.' % fname
2191 'Could not open file <%s> for safe execution.' % fname
2181 return None
2192 return None
2182
2193
2183 kw.setdefault('islog',0)
2194 kw.setdefault('islog',0)
2184 kw.setdefault('quiet',1)
2195 kw.setdefault('quiet',1)
2185 kw.setdefault('exit_ignore',0)
2196 kw.setdefault('exit_ignore',0)
2186 first = xfile.readline()
2197 first = xfile.readline()
2187 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2198 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2188 xfile.close()
2199 xfile.close()
2189 # line by line execution
2200 # line by line execution
2190 if first.startswith(loghead) or kw['islog']:
2201 if first.startswith(loghead) or kw['islog']:
2191 print 'Loading log file <%s> one line at a time...' % fname
2202 print 'Loading log file <%s> one line at a time...' % fname
2192 if kw['quiet']:
2203 if kw['quiet']:
2193 stdout_save = sys.stdout
2204 stdout_save = sys.stdout
2194 sys.stdout = StringIO.StringIO()
2205 sys.stdout = StringIO.StringIO()
2195 try:
2206 try:
2196 globs,locs = where[0:2]
2207 globs,locs = where[0:2]
2197 except:
2208 except:
2198 try:
2209 try:
2199 globs = locs = where[0]
2210 globs = locs = where[0]
2200 except:
2211 except:
2201 globs = locs = globals()
2212 globs = locs = globals()
2202 badblocks = []
2213 badblocks = []
2203
2214
2204 # we also need to identify indented blocks of code when replaying
2215 # we also need to identify indented blocks of code when replaying
2205 # logs and put them together before passing them to an exec
2216 # logs and put them together before passing them to an exec
2206 # statement. This takes a bit of regexp and look-ahead work in the
2217 # statement. This takes a bit of regexp and look-ahead work in the
2207 # file. It's easiest if we swallow the whole thing in memory
2218 # file. It's easiest if we swallow the whole thing in memory
2208 # first, and manually walk through the lines list moving the
2219 # first, and manually walk through the lines list moving the
2209 # counter ourselves.
2220 # counter ourselves.
2210 indent_re = re.compile('\s+\S')
2221 indent_re = re.compile('\s+\S')
2211 xfile = open(fname)
2222 xfile = open(fname)
2212 filelines = xfile.readlines()
2223 filelines = xfile.readlines()
2213 xfile.close()
2224 xfile.close()
2214 nlines = len(filelines)
2225 nlines = len(filelines)
2215 lnum = 0
2226 lnum = 0
2216 while lnum < nlines:
2227 while lnum < nlines:
2217 line = filelines[lnum]
2228 line = filelines[lnum]
2218 lnum += 1
2229 lnum += 1
2219 # don't re-insert logger status info into cache
2230 # don't re-insert logger status info into cache
2220 if line.startswith('#log#'):
2231 if line.startswith('#log#'):
2221 continue
2232 continue
2222 else:
2233 else:
2223 # build a block of code (maybe a single line) for execution
2234 # build a block of code (maybe a single line) for execution
2224 block = line
2235 block = line
2225 try:
2236 try:
2226 next = filelines[lnum] # lnum has already incremented
2237 next = filelines[lnum] # lnum has already incremented
2227 except:
2238 except:
2228 next = None
2239 next = None
2229 while next and indent_re.match(next):
2240 while next and indent_re.match(next):
2230 block += next
2241 block += next
2231 lnum += 1
2242 lnum += 1
2232 try:
2243 try:
2233 next = filelines[lnum]
2244 next = filelines[lnum]
2234 except:
2245 except:
2235 next = None
2246 next = None
2236 # now execute the block of one or more lines
2247 # now execute the block of one or more lines
2237 try:
2248 try:
2238 exec block in globs,locs
2249 exec block in globs,locs
2239 except SystemExit:
2250 except SystemExit:
2240 pass
2251 pass
2241 except:
2252 except:
2242 badblocks.append(block.rstrip())
2253 badblocks.append(block.rstrip())
2243 if kw['quiet']: # restore stdout
2254 if kw['quiet']: # restore stdout
2244 sys.stdout.close()
2255 sys.stdout.close()
2245 sys.stdout = stdout_save
2256 sys.stdout = stdout_save
2246 print 'Finished replaying log file <%s>' % fname
2257 print 'Finished replaying log file <%s>' % fname
2247 if badblocks:
2258 if badblocks:
2248 print >> sys.stderr, ('\nThe following lines/blocks in file '
2259 print >> sys.stderr, ('\nThe following lines/blocks in file '
2249 '<%s> reported errors:' % fname)
2260 '<%s> reported errors:' % fname)
2250
2261
2251 for badline in badblocks:
2262 for badline in badblocks:
2252 print >> sys.stderr, badline
2263 print >> sys.stderr, badline
2253 else: # regular file execution
2264 else: # regular file execution
2254 try:
2265 try:
2255 execfile(fname,*where)
2266 execfile(fname,*where)
2256 except SyntaxError:
2267 except SyntaxError:
2257 etype,evalue = sys.exc_info()[:2]
2268 self.showsyntaxerror()
2258 self.SyntaxTB(etype,evalue,[])
2259 warn('Failure executing file: <%s>' % fname)
2269 warn('Failure executing file: <%s>' % fname)
2260 except SystemExit,status:
2270 except SystemExit,status:
2261 if not kw['exit_ignore']:
2271 if not kw['exit_ignore']:
2262 self.InteractiveTB()
2272 self.showtraceback()
2263 warn('Failure executing file: <%s>' % fname)
2273 warn('Failure executing file: <%s>' % fname)
2264 except:
2274 except:
2265 self.InteractiveTB()
2275 self.showtraceback()
2266 warn('Failure executing file: <%s>' % fname)
2276 warn('Failure executing file: <%s>' % fname)
2267
2277
2268 #************************* end of file <iplib.py> *****************************
2278 #************************* end of file <iplib.py> *****************************
@@ -1,5235 +1,5249 b''
1 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/iplib.py (showtraceback): add back sys.last_traceback
4 and friends, after a discussion with Zach Pincus on ipython-user.
5 I'm not 100% sure, but after thinking aobut it quite a bit, it may
6 be OK. Testing with the multithreaded shells didn't reveal any
7 problems, but let's keep an eye out.
8
9 In the process, I fixed a few things which were calling
10 self.InteractiveTB() directly (like safe_execfile), which is a
11 mistake: ALL exception reporting should be done by calling
12 self.showtraceback(), which handles state and tab-completion and
13 more.
14
1 2006-03-01 Ville Vainio <vivainio@gmail.com>
15 2006-03-01 Ville Vainio <vivainio@gmail.com>
2
16
3 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
17 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
4 To use, do "from ipipe import *".
18 To use, do "from ipipe import *".
5
19
6 2006-02-24 Ville Vainio <vivainio@gmail.com>
20 2006-02-24 Ville Vainio <vivainio@gmail.com>
7
21
8 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
22 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
9 "cleanly" and safely than the older upgrade mechanism.
23 "cleanly" and safely than the older upgrade mechanism.
10
24
11 2006-02-21 Ville Vainio <vivainio@gmail.com>
25 2006-02-21 Ville Vainio <vivainio@gmail.com>
12
26
13 * Magic.py: %save works again.
27 * Magic.py: %save works again.
14
28
15 2006-02-15 Ville Vainio <vivainio@gmail.com>
29 2006-02-15 Ville Vainio <vivainio@gmail.com>
16
30
17 * Magic.py: %Pprint works again
31 * Magic.py: %Pprint works again
18
32
19 * Extensions/ipy_sane_defaults.py: Provide everything provided
33 * Extensions/ipy_sane_defaults.py: Provide everything provided
20 in default ipythonrc, to make it possible to have a completely empty
34 in default ipythonrc, to make it possible to have a completely empty
21 ipythonrc (and thus completely rc-file free configuration)
35 ipythonrc (and thus completely rc-file free configuration)
22
36
23
37
24 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
38 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
25
39
26 * IPython/hooks.py (editor): quote the call to the editor command,
40 * IPython/hooks.py (editor): quote the call to the editor command,
27 to allow commands with spaces in them. Problem noted by watching
41 to allow commands with spaces in them. Problem noted by watching
28 Ian Oswald's video about textpad under win32 at
42 Ian Oswald's video about textpad under win32 at
29 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
43 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
30
44
31 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
45 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
32 describing magics (we haven't used @ for a loong time).
46 describing magics (we haven't used @ for a loong time).
33
47
34 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
48 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
35 contributed by marienz to close
49 contributed by marienz to close
36 http://www.scipy.net/roundup/ipython/issue53.
50 http://www.scipy.net/roundup/ipython/issue53.
37
51
38 2006-02-10 Ville Vainio <vivainio@gmail.com>
52 2006-02-10 Ville Vainio <vivainio@gmail.com>
39
53
40 * genutils.py: getoutput now works in win32 too
54 * genutils.py: getoutput now works in win32 too
41
55
42 * completer.py: alias and magic completion only invoked
56 * completer.py: alias and magic completion only invoked
43 at the first "item" in the line, to avoid "cd %store"
57 at the first "item" in the line, to avoid "cd %store"
44 nonsense.
58 nonsense.
45
59
46 2006-02-09 Ville Vainio <vivainio@gmail.com>
60 2006-02-09 Ville Vainio <vivainio@gmail.com>
47
61
48 * test/*: Added a unit testing framework (finally).
62 * test/*: Added a unit testing framework (finally).
49 '%run runtests.py' to run test_*.
63 '%run runtests.py' to run test_*.
50
64
51 * ipapi.py: Exposed runlines and set_custom_exc
65 * ipapi.py: Exposed runlines and set_custom_exc
52
66
53 2006-02-07 Ville Vainio <vivainio@gmail.com>
67 2006-02-07 Ville Vainio <vivainio@gmail.com>
54
68
55 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
69 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
56 instead use "f(1 2)" as before.
70 instead use "f(1 2)" as before.
57
71
58 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
72 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
59
73
60 * IPython/demo.py (IPythonDemo): Add new classes to the demo
74 * IPython/demo.py (IPythonDemo): Add new classes to the demo
61 facilities, for demos processed by the IPython input filter
75 facilities, for demos processed by the IPython input filter
62 (IPythonDemo), and for running a script one-line-at-a-time as a
76 (IPythonDemo), and for running a script one-line-at-a-time as a
63 demo, both for pure Python (LineDemo) and for IPython-processed
77 demo, both for pure Python (LineDemo) and for IPython-processed
64 input (IPythonLineDemo). After a request by Dave Kohel, from the
78 input (IPythonLineDemo). After a request by Dave Kohel, from the
65 SAGE team.
79 SAGE team.
66 (Demo.edit): added and edit() method to the demo objects, to edit
80 (Demo.edit): added and edit() method to the demo objects, to edit
67 the in-memory copy of the last executed block.
81 the in-memory copy of the last executed block.
68
82
69 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
83 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
70 processing to %edit, %macro and %save. These commands can now be
84 processing to %edit, %macro and %save. These commands can now be
71 invoked on the unprocessed input as it was typed by the user
85 invoked on the unprocessed input as it was typed by the user
72 (without any prefilters applied). After requests by the SAGE team
86 (without any prefilters applied). After requests by the SAGE team
73 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
87 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
74
88
75 2006-02-01 Ville Vainio <vivainio@gmail.com>
89 2006-02-01 Ville Vainio <vivainio@gmail.com>
76
90
77 * setup.py, eggsetup.py: easy_install ipython==dev works
91 * setup.py, eggsetup.py: easy_install ipython==dev works
78 correctly now (on Linux)
92 correctly now (on Linux)
79
93
80 * ipy_user_conf,ipmaker: user config changes, removed spurious
94 * ipy_user_conf,ipmaker: user config changes, removed spurious
81 warnings
95 warnings
82
96
83 * iplib: if rc.banner is string, use it as is.
97 * iplib: if rc.banner is string, use it as is.
84
98
85 * Magic: %pycat accepts a string argument and pages it's contents.
99 * Magic: %pycat accepts a string argument and pages it's contents.
86
100
87
101
88 2006-01-30 Ville Vainio <vivainio@gmail.com>
102 2006-01-30 Ville Vainio <vivainio@gmail.com>
89
103
90 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
104 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
91 Now %store and bookmarks work through PickleShare, meaning that
105 Now %store and bookmarks work through PickleShare, meaning that
92 concurrent access is possible and all ipython sessions see the
106 concurrent access is possible and all ipython sessions see the
93 same database situation all the time, instead of snapshot of
107 same database situation all the time, instead of snapshot of
94 the situation when the session was started. Hence, %bookmark
108 the situation when the session was started. Hence, %bookmark
95 results are immediately accessible from othes sessions. The database
109 results are immediately accessible from othes sessions. The database
96 is also available for use by user extensions. See:
110 is also available for use by user extensions. See:
97 http://www.python.org/pypi/pickleshare
111 http://www.python.org/pypi/pickleshare
98
112
99 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
113 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
100
114
101 * aliases can now be %store'd
115 * aliases can now be %store'd
102
116
103 * path.py move to Extensions so that pickleshare does not need
117 * path.py move to Extensions so that pickleshare does not need
104 IPython-specific import. Extensions added to pythonpath right
118 IPython-specific import. Extensions added to pythonpath right
105 at __init__.
119 at __init__.
106
120
107 * iplib.py: ipalias deprecated/redundant; aliases are converted and
121 * iplib.py: ipalias deprecated/redundant; aliases are converted and
108 called with _ip.system and the pre-transformed command string.
122 called with _ip.system and the pre-transformed command string.
109
123
110 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
124 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
111
125
112 * IPython/iplib.py (interact): Fix that we were not catching
126 * IPython/iplib.py (interact): Fix that we were not catching
113 KeyboardInterrupt exceptions properly. I'm not quite sure why the
127 KeyboardInterrupt exceptions properly. I'm not quite sure why the
114 logic here had to change, but it's fixed now.
128 logic here had to change, but it's fixed now.
115
129
116 2006-01-29 Ville Vainio <vivainio@gmail.com>
130 2006-01-29 Ville Vainio <vivainio@gmail.com>
117
131
118 * iplib.py: Try to import pyreadline on Windows.
132 * iplib.py: Try to import pyreadline on Windows.
119
133
120 2006-01-27 Ville Vainio <vivainio@gmail.com>
134 2006-01-27 Ville Vainio <vivainio@gmail.com>
121
135
122 * iplib.py: Expose ipapi as _ip in builtin namespace.
136 * iplib.py: Expose ipapi as _ip in builtin namespace.
123 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
137 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
124 and ip_set_hook (-> _ip.set_hook) redundant. % and !
138 and ip_set_hook (-> _ip.set_hook) redundant. % and !
125 syntax now produce _ip.* variant of the commands.
139 syntax now produce _ip.* variant of the commands.
126
140
127 * "_ip.options().autoedit_syntax = 2" automatically throws
141 * "_ip.options().autoedit_syntax = 2" automatically throws
128 user to editor for syntax error correction without prompting.
142 user to editor for syntax error correction without prompting.
129
143
130 2006-01-27 Ville Vainio <vivainio@gmail.com>
144 2006-01-27 Ville Vainio <vivainio@gmail.com>
131
145
132 * ipmaker.py: Give "realistic" sys.argv for scripts (without
146 * ipmaker.py: Give "realistic" sys.argv for scripts (without
133 'ipython' at argv[0]) executed through command line.
147 'ipython' at argv[0]) executed through command line.
134 NOTE: this DEPRECATES calling ipython with multiple scripts
148 NOTE: this DEPRECATES calling ipython with multiple scripts
135 ("ipython a.py b.py c.py")
149 ("ipython a.py b.py c.py")
136
150
137 * iplib.py, hooks.py: Added configurable input prefilter,
151 * iplib.py, hooks.py: Added configurable input prefilter,
138 named 'input_prefilter'. See ext_rescapture.py for example
152 named 'input_prefilter'. See ext_rescapture.py for example
139 usage.
153 usage.
140
154
141 * ext_rescapture.py, Magic.py: Better system command output capture
155 * ext_rescapture.py, Magic.py: Better system command output capture
142 through 'var = !ls' (deprecates user-visible %sc). Same notation
156 through 'var = !ls' (deprecates user-visible %sc). Same notation
143 applies for magics, 'var = %alias' assigns alias list to var.
157 applies for magics, 'var = %alias' assigns alias list to var.
144
158
145 * ipapi.py: added meta() for accessing extension-usable data store.
159 * ipapi.py: added meta() for accessing extension-usable data store.
146
160
147 * iplib.py: added InteractiveShell.getapi(). New magics should be
161 * iplib.py: added InteractiveShell.getapi(). New magics should be
148 written doing self.getapi() instead of using the shell directly.
162 written doing self.getapi() instead of using the shell directly.
149
163
150 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
164 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
151 %store foo >> ~/myfoo.txt to store variables to files (in clean
165 %store foo >> ~/myfoo.txt to store variables to files (in clean
152 textual form, not a restorable pickle).
166 textual form, not a restorable pickle).
153
167
154 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
168 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
155
169
156 * usage.py, Magic.py: added %quickref
170 * usage.py, Magic.py: added %quickref
157
171
158 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
172 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
159
173
160 * GetoptErrors when invoking magics etc. with wrong args
174 * GetoptErrors when invoking magics etc. with wrong args
161 are now more helpful:
175 are now more helpful:
162 GetoptError: option -l not recognized (allowed: "qb" )
176 GetoptError: option -l not recognized (allowed: "qb" )
163
177
164 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
178 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
165
179
166 * IPython/demo.py (Demo.show): Flush stdout after each block, so
180 * IPython/demo.py (Demo.show): Flush stdout after each block, so
167 computationally intensive blocks don't appear to stall the demo.
181 computationally intensive blocks don't appear to stall the demo.
168
182
169 2006-01-24 Ville Vainio <vivainio@gmail.com>
183 2006-01-24 Ville Vainio <vivainio@gmail.com>
170
184
171 * iplib.py, hooks.py: 'result_display' hook can return a non-None
185 * iplib.py, hooks.py: 'result_display' hook can return a non-None
172 value to manipulate resulting history entry.
186 value to manipulate resulting history entry.
173
187
174 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
188 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
175 to instance methods of IPApi class, to make extending an embedded
189 to instance methods of IPApi class, to make extending an embedded
176 IPython feasible. See ext_rehashdir.py for example usage.
190 IPython feasible. See ext_rehashdir.py for example usage.
177
191
178 * Merged 1071-1076 from banches/0.7.1
192 * Merged 1071-1076 from banches/0.7.1
179
193
180
194
181 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
195 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
182
196
183 * tools/release (daystamp): Fix build tools to use the new
197 * tools/release (daystamp): Fix build tools to use the new
184 eggsetup.py script to build lightweight eggs.
198 eggsetup.py script to build lightweight eggs.
185
199
186 * Applied changesets 1062 and 1064 before 0.7.1 release.
200 * Applied changesets 1062 and 1064 before 0.7.1 release.
187
201
188 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
202 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
189 see the raw input history (without conversions like %ls ->
203 see the raw input history (without conversions like %ls ->
190 ipmagic("ls")). After a request from W. Stein, SAGE
204 ipmagic("ls")). After a request from W. Stein, SAGE
191 (http://modular.ucsd.edu/sage) developer. This information is
205 (http://modular.ucsd.edu/sage) developer. This information is
192 stored in the input_hist_raw attribute of the IPython instance, so
206 stored in the input_hist_raw attribute of the IPython instance, so
193 developers can access it if needed (it's an InputList instance).
207 developers can access it if needed (it's an InputList instance).
194
208
195 * Versionstring = 0.7.2.svn
209 * Versionstring = 0.7.2.svn
196
210
197 * eggsetup.py: A separate script for constructing eggs, creates
211 * eggsetup.py: A separate script for constructing eggs, creates
198 proper launch scripts even on Windows (an .exe file in
212 proper launch scripts even on Windows (an .exe file in
199 \python24\scripts).
213 \python24\scripts).
200
214
201 * ipapi.py: launch_new_instance, launch entry point needed for the
215 * ipapi.py: launch_new_instance, launch entry point needed for the
202 egg.
216 egg.
203
217
204 2006-01-23 Ville Vainio <vivainio@gmail.com>
218 2006-01-23 Ville Vainio <vivainio@gmail.com>
205
219
206 * Added %cpaste magic for pasting python code
220 * Added %cpaste magic for pasting python code
207
221
208 2006-01-22 Ville Vainio <vivainio@gmail.com>
222 2006-01-22 Ville Vainio <vivainio@gmail.com>
209
223
210 * Merge from branches/0.7.1 into trunk, revs 1052-1057
224 * Merge from branches/0.7.1 into trunk, revs 1052-1057
211
225
212 * Versionstring = 0.7.2.svn
226 * Versionstring = 0.7.2.svn
213
227
214 * eggsetup.py: A separate script for constructing eggs, creates
228 * eggsetup.py: A separate script for constructing eggs, creates
215 proper launch scripts even on Windows (an .exe file in
229 proper launch scripts even on Windows (an .exe file in
216 \python24\scripts).
230 \python24\scripts).
217
231
218 * ipapi.py: launch_new_instance, launch entry point needed for the
232 * ipapi.py: launch_new_instance, launch entry point needed for the
219 egg.
233 egg.
220
234
221 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
235 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
222
236
223 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
237 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
224 %pfile foo would print the file for foo even if it was a binary.
238 %pfile foo would print the file for foo even if it was a binary.
225 Now, extensions '.so' and '.dll' are skipped.
239 Now, extensions '.so' and '.dll' are skipped.
226
240
227 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
241 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
228 bug, where macros would fail in all threaded modes. I'm not 100%
242 bug, where macros would fail in all threaded modes. I'm not 100%
229 sure, so I'm going to put out an rc instead of making a release
243 sure, so I'm going to put out an rc instead of making a release
230 today, and wait for feedback for at least a few days.
244 today, and wait for feedback for at least a few days.
231
245
232 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
246 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
233 it...) the handling of pasting external code with autoindent on.
247 it...) the handling of pasting external code with autoindent on.
234 To get out of a multiline input, the rule will appear for most
248 To get out of a multiline input, the rule will appear for most
235 users unchanged: two blank lines or change the indent level
249 users unchanged: two blank lines or change the indent level
236 proposed by IPython. But there is a twist now: you can
250 proposed by IPython. But there is a twist now: you can
237 add/subtract only *one or two spaces*. If you add/subtract three
251 add/subtract only *one or two spaces*. If you add/subtract three
238 or more (unless you completely delete the line), IPython will
252 or more (unless you completely delete the line), IPython will
239 accept that line, and you'll need to enter a second one of pure
253 accept that line, and you'll need to enter a second one of pure
240 whitespace. I know it sounds complicated, but I can't find a
254 whitespace. I know it sounds complicated, but I can't find a
241 different solution that covers all the cases, with the right
255 different solution that covers all the cases, with the right
242 heuristics. Hopefully in actual use, nobody will really notice
256 heuristics. Hopefully in actual use, nobody will really notice
243 all these strange rules and things will 'just work'.
257 all these strange rules and things will 'just work'.
244
258
245 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
259 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
246
260
247 * IPython/iplib.py (interact): catch exceptions which can be
261 * IPython/iplib.py (interact): catch exceptions which can be
248 triggered asynchronously by signal handlers. Thanks to an
262 triggered asynchronously by signal handlers. Thanks to an
249 automatic crash report, submitted by Colin Kingsley
263 automatic crash report, submitted by Colin Kingsley
250 <tercel-AT-gentoo.org>.
264 <tercel-AT-gentoo.org>.
251
265
252 2006-01-20 Ville Vainio <vivainio@gmail.com>
266 2006-01-20 Ville Vainio <vivainio@gmail.com>
253
267
254 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
268 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
255 (%rehashdir, very useful, try it out) of how to extend ipython
269 (%rehashdir, very useful, try it out) of how to extend ipython
256 with new magics. Also added Extensions dir to pythonpath to make
270 with new magics. Also added Extensions dir to pythonpath to make
257 importing extensions easy.
271 importing extensions easy.
258
272
259 * %store now complains when trying to store interactively declared
273 * %store now complains when trying to store interactively declared
260 classes / instances of those classes.
274 classes / instances of those classes.
261
275
262 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
276 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
263 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
277 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
264 if they exist, and ipy_user_conf.py with some defaults is created for
278 if they exist, and ipy_user_conf.py with some defaults is created for
265 the user.
279 the user.
266
280
267 * Startup rehashing done by the config file, not InterpreterExec.
281 * Startup rehashing done by the config file, not InterpreterExec.
268 This means system commands are available even without selecting the
282 This means system commands are available even without selecting the
269 pysh profile. It's the sensible default after all.
283 pysh profile. It's the sensible default after all.
270
284
271 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
285 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
272
286
273 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
287 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
274 multiline code with autoindent on working. But I am really not
288 multiline code with autoindent on working. But I am really not
275 sure, so this needs more testing. Will commit a debug-enabled
289 sure, so this needs more testing. Will commit a debug-enabled
276 version for now, while I test it some more, so that Ville and
290 version for now, while I test it some more, so that Ville and
277 others may also catch any problems. Also made
291 others may also catch any problems. Also made
278 self.indent_current_str() a method, to ensure that there's no
292 self.indent_current_str() a method, to ensure that there's no
279 chance of the indent space count and the corresponding string
293 chance of the indent space count and the corresponding string
280 falling out of sync. All code needing the string should just call
294 falling out of sync. All code needing the string should just call
281 the method.
295 the method.
282
296
283 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
297 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
284
298
285 * IPython/Magic.py (magic_edit): fix check for when users don't
299 * IPython/Magic.py (magic_edit): fix check for when users don't
286 save their output files, the try/except was in the wrong section.
300 save their output files, the try/except was in the wrong section.
287
301
288 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
302 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
289
303
290 * IPython/Magic.py (magic_run): fix __file__ global missing from
304 * IPython/Magic.py (magic_run): fix __file__ global missing from
291 script's namespace when executed via %run. After a report by
305 script's namespace when executed via %run. After a report by
292 Vivian.
306 Vivian.
293
307
294 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
308 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
295 when using python 2.4. The parent constructor changed in 2.4, and
309 when using python 2.4. The parent constructor changed in 2.4, and
296 we need to track it directly (we can't call it, as it messes up
310 we need to track it directly (we can't call it, as it messes up
297 readline and tab-completion inside our pdb would stop working).
311 readline and tab-completion inside our pdb would stop working).
298 After a bug report by R. Bernstein <rocky-AT-panix.com>.
312 After a bug report by R. Bernstein <rocky-AT-panix.com>.
299
313
300 2006-01-16 Ville Vainio <vivainio@gmail.com>
314 2006-01-16 Ville Vainio <vivainio@gmail.com>
301
315
302 * Ipython/magic.py:Reverted back to old %edit functionality
316 * Ipython/magic.py:Reverted back to old %edit functionality
303 that returns file contents on exit.
317 that returns file contents on exit.
304
318
305 * IPython/path.py: Added Jason Orendorff's "path" module to
319 * IPython/path.py: Added Jason Orendorff's "path" module to
306 IPython tree, http://www.jorendorff.com/articles/python/path/.
320 IPython tree, http://www.jorendorff.com/articles/python/path/.
307 You can get path objects conveniently through %sc, and !!, e.g.:
321 You can get path objects conveniently through %sc, and !!, e.g.:
308 sc files=ls
322 sc files=ls
309 for p in files.paths: # or files.p
323 for p in files.paths: # or files.p
310 print p,p.mtime
324 print p,p.mtime
311
325
312 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
326 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
313 now work again without considering the exclusion regexp -
327 now work again without considering the exclusion regexp -
314 hence, things like ',foo my/path' turn to 'foo("my/path")'
328 hence, things like ',foo my/path' turn to 'foo("my/path")'
315 instead of syntax error.
329 instead of syntax error.
316
330
317
331
318 2006-01-14 Ville Vainio <vivainio@gmail.com>
332 2006-01-14 Ville Vainio <vivainio@gmail.com>
319
333
320 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
334 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
321 ipapi decorators for python 2.4 users, options() provides access to rc
335 ipapi decorators for python 2.4 users, options() provides access to rc
322 data.
336 data.
323
337
324 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
338 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
325 as path separators (even on Linux ;-). Space character after
339 as path separators (even on Linux ;-). Space character after
326 backslash (as yielded by tab completer) is still space;
340 backslash (as yielded by tab completer) is still space;
327 "%cd long\ name" works as expected.
341 "%cd long\ name" works as expected.
328
342
329 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
343 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
330 as "chain of command", with priority. API stays the same,
344 as "chain of command", with priority. API stays the same,
331 TryNext exception raised by a hook function signals that
345 TryNext exception raised by a hook function signals that
332 current hook failed and next hook should try handling it, as
346 current hook failed and next hook should try handling it, as
333 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
347 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
334 requested configurable display hook, which is now implemented.
348 requested configurable display hook, which is now implemented.
335
349
336 2006-01-13 Ville Vainio <vivainio@gmail.com>
350 2006-01-13 Ville Vainio <vivainio@gmail.com>
337
351
338 * IPython/platutils*.py: platform specific utility functions,
352 * IPython/platutils*.py: platform specific utility functions,
339 so far only set_term_title is implemented (change terminal
353 so far only set_term_title is implemented (change terminal
340 label in windowing systems). %cd now changes the title to
354 label in windowing systems). %cd now changes the title to
341 current dir.
355 current dir.
342
356
343 * IPython/Release.py: Added myself to "authors" list,
357 * IPython/Release.py: Added myself to "authors" list,
344 had to create new files.
358 had to create new files.
345
359
346 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
360 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
347 shell escape; not a known bug but had potential to be one in the
361 shell escape; not a known bug but had potential to be one in the
348 future.
362 future.
349
363
350 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
364 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
351 extension API for IPython! See the module for usage example. Fix
365 extension API for IPython! See the module for usage example. Fix
352 OInspect for docstring-less magic functions.
366 OInspect for docstring-less magic functions.
353
367
354
368
355 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
369 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
356
370
357 * IPython/iplib.py (raw_input): temporarily deactivate all
371 * IPython/iplib.py (raw_input): temporarily deactivate all
358 attempts at allowing pasting of code with autoindent on. It
372 attempts at allowing pasting of code with autoindent on. It
359 introduced bugs (reported by Prabhu) and I can't seem to find a
373 introduced bugs (reported by Prabhu) and I can't seem to find a
360 robust combination which works in all cases. Will have to revisit
374 robust combination which works in all cases. Will have to revisit
361 later.
375 later.
362
376
363 * IPython/genutils.py: remove isspace() function. We've dropped
377 * IPython/genutils.py: remove isspace() function. We've dropped
364 2.2 compatibility, so it's OK to use the string method.
378 2.2 compatibility, so it's OK to use the string method.
365
379
366 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
380 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
367
381
368 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
382 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
369 matching what NOT to autocall on, to include all python binary
383 matching what NOT to autocall on, to include all python binary
370 operators (including things like 'and', 'or', 'is' and 'in').
384 operators (including things like 'and', 'or', 'is' and 'in').
371 Prompted by a bug report on 'foo & bar', but I realized we had
385 Prompted by a bug report on 'foo & bar', but I realized we had
372 many more potential bug cases with other operators. The regexp is
386 many more potential bug cases with other operators. The regexp is
373 self.re_exclude_auto, it's fairly commented.
387 self.re_exclude_auto, it's fairly commented.
374
388
375 2006-01-12 Ville Vainio <vivainio@gmail.com>
389 2006-01-12 Ville Vainio <vivainio@gmail.com>
376
390
377 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
391 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
378 Prettified and hardened string/backslash quoting with ipsystem(),
392 Prettified and hardened string/backslash quoting with ipsystem(),
379 ipalias() and ipmagic(). Now even \ characters are passed to
393 ipalias() and ipmagic(). Now even \ characters are passed to
380 %magics, !shell escapes and aliases exactly as they are in the
394 %magics, !shell escapes and aliases exactly as they are in the
381 ipython command line. Should improve backslash experience,
395 ipython command line. Should improve backslash experience,
382 particularly in Windows (path delimiter for some commands that
396 particularly in Windows (path delimiter for some commands that
383 won't understand '/'), but Unix benefits as well (regexps). %cd
397 won't understand '/'), but Unix benefits as well (regexps). %cd
384 magic still doesn't support backslash path delimiters, though. Also
398 magic still doesn't support backslash path delimiters, though. Also
385 deleted all pretense of supporting multiline command strings in
399 deleted all pretense of supporting multiline command strings in
386 !system or %magic commands. Thanks to Jerry McRae for suggestions.
400 !system or %magic commands. Thanks to Jerry McRae for suggestions.
387
401
388 * doc/build_doc_instructions.txt added. Documentation on how to
402 * doc/build_doc_instructions.txt added. Documentation on how to
389 use doc/update_manual.py, added yesterday. Both files contributed
403 use doc/update_manual.py, added yesterday. Both files contributed
390 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
404 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
391 doc/*.sh for deprecation at a later date.
405 doc/*.sh for deprecation at a later date.
392
406
393 * /ipython.py Added ipython.py to root directory for
407 * /ipython.py Added ipython.py to root directory for
394 zero-installation (tar xzvf ipython.tgz; cd ipython; python
408 zero-installation (tar xzvf ipython.tgz; cd ipython; python
395 ipython.py) and development convenience (no need to kee doing
409 ipython.py) and development convenience (no need to kee doing
396 "setup.py install" between changes).
410 "setup.py install" between changes).
397
411
398 * Made ! and !! shell escapes work (again) in multiline expressions:
412 * Made ! and !! shell escapes work (again) in multiline expressions:
399 if 1:
413 if 1:
400 !ls
414 !ls
401 !!ls
415 !!ls
402
416
403 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
417 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
404
418
405 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
419 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
406 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
420 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
407 module in case-insensitive installation. Was causing crashes
421 module in case-insensitive installation. Was causing crashes
408 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
422 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
409
423
410 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
424 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
411 <marienz-AT-gentoo.org>, closes
425 <marienz-AT-gentoo.org>, closes
412 http://www.scipy.net/roundup/ipython/issue51.
426 http://www.scipy.net/roundup/ipython/issue51.
413
427
414 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
428 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
415
429
416 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
430 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
417 problem of excessive CPU usage under *nix and keyboard lag under
431 problem of excessive CPU usage under *nix and keyboard lag under
418 win32.
432 win32.
419
433
420 2006-01-10 *** Released version 0.7.0
434 2006-01-10 *** Released version 0.7.0
421
435
422 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
436 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
423
437
424 * IPython/Release.py (revision): tag version number to 0.7.0,
438 * IPython/Release.py (revision): tag version number to 0.7.0,
425 ready for release.
439 ready for release.
426
440
427 * IPython/Magic.py (magic_edit): Add print statement to %edit so
441 * IPython/Magic.py (magic_edit): Add print statement to %edit so
428 it informs the user of the name of the temp. file used. This can
442 it informs the user of the name of the temp. file used. This can
429 help if you decide later to reuse that same file, so you know
443 help if you decide later to reuse that same file, so you know
430 where to copy the info from.
444 where to copy the info from.
431
445
432 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
446 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
433
447
434 * setup_bdist_egg.py: little script to build an egg. Added
448 * setup_bdist_egg.py: little script to build an egg. Added
435 support in the release tools as well.
449 support in the release tools as well.
436
450
437 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
451 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
438
452
439 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
453 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
440 version selection (new -wxversion command line and ipythonrc
454 version selection (new -wxversion command line and ipythonrc
441 parameter). Patch contributed by Arnd Baecker
455 parameter). Patch contributed by Arnd Baecker
442 <arnd.baecker-AT-web.de>.
456 <arnd.baecker-AT-web.de>.
443
457
444 * IPython/iplib.py (embed_mainloop): fix tab-completion in
458 * IPython/iplib.py (embed_mainloop): fix tab-completion in
445 embedded instances, for variables defined at the interactive
459 embedded instances, for variables defined at the interactive
446 prompt of the embedded ipython. Reported by Arnd.
460 prompt of the embedded ipython. Reported by Arnd.
447
461
448 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
462 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
449 it can be used as a (stateful) toggle, or with a direct parameter.
463 it can be used as a (stateful) toggle, or with a direct parameter.
450
464
451 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
465 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
452 could be triggered in certain cases and cause the traceback
466 could be triggered in certain cases and cause the traceback
453 printer not to work.
467 printer not to work.
454
468
455 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
469 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
456
470
457 * IPython/iplib.py (_should_recompile): Small fix, closes
471 * IPython/iplib.py (_should_recompile): Small fix, closes
458 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
472 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
459
473
460 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
474 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
461
475
462 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
476 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
463 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
477 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
464 Moad for help with tracking it down.
478 Moad for help with tracking it down.
465
479
466 * IPython/iplib.py (handle_auto): fix autocall handling for
480 * IPython/iplib.py (handle_auto): fix autocall handling for
467 objects which support BOTH __getitem__ and __call__ (so that f [x]
481 objects which support BOTH __getitem__ and __call__ (so that f [x]
468 is left alone, instead of becoming f([x]) automatically).
482 is left alone, instead of becoming f([x]) automatically).
469
483
470 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
484 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
471 Ville's patch.
485 Ville's patch.
472
486
473 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
487 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
474
488
475 * IPython/iplib.py (handle_auto): changed autocall semantics to
489 * IPython/iplib.py (handle_auto): changed autocall semantics to
476 include 'smart' mode, where the autocall transformation is NOT
490 include 'smart' mode, where the autocall transformation is NOT
477 applied if there are no arguments on the line. This allows you to
491 applied if there are no arguments on the line. This allows you to
478 just type 'foo' if foo is a callable to see its internal form,
492 just type 'foo' if foo is a callable to see its internal form,
479 instead of having it called with no arguments (typically a
493 instead of having it called with no arguments (typically a
480 mistake). The old 'full' autocall still exists: for that, you
494 mistake). The old 'full' autocall still exists: for that, you
481 need to set the 'autocall' parameter to 2 in your ipythonrc file.
495 need to set the 'autocall' parameter to 2 in your ipythonrc file.
482
496
483 * IPython/completer.py (Completer.attr_matches): add
497 * IPython/completer.py (Completer.attr_matches): add
484 tab-completion support for Enthoughts' traits. After a report by
498 tab-completion support for Enthoughts' traits. After a report by
485 Arnd and a patch by Prabhu.
499 Arnd and a patch by Prabhu.
486
500
487 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
501 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
488
502
489 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
503 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
490 Schmolck's patch to fix inspect.getinnerframes().
504 Schmolck's patch to fix inspect.getinnerframes().
491
505
492 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
506 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
493 for embedded instances, regarding handling of namespaces and items
507 for embedded instances, regarding handling of namespaces and items
494 added to the __builtin__ one. Multiple embedded instances and
508 added to the __builtin__ one. Multiple embedded instances and
495 recursive embeddings should work better now (though I'm not sure
509 recursive embeddings should work better now (though I'm not sure
496 I've got all the corner cases fixed, that code is a bit of a brain
510 I've got all the corner cases fixed, that code is a bit of a brain
497 twister).
511 twister).
498
512
499 * IPython/Magic.py (magic_edit): added support to edit in-memory
513 * IPython/Magic.py (magic_edit): added support to edit in-memory
500 macros (automatically creates the necessary temp files). %edit
514 macros (automatically creates the necessary temp files). %edit
501 also doesn't return the file contents anymore, it's just noise.
515 also doesn't return the file contents anymore, it's just noise.
502
516
503 * IPython/completer.py (Completer.attr_matches): revert change to
517 * IPython/completer.py (Completer.attr_matches): revert change to
504 complete only on attributes listed in __all__. I realized it
518 complete only on attributes listed in __all__. I realized it
505 cripples the tab-completion system as a tool for exploring the
519 cripples the tab-completion system as a tool for exploring the
506 internals of unknown libraries (it renders any non-__all__
520 internals of unknown libraries (it renders any non-__all__
507 attribute off-limits). I got bit by this when trying to see
521 attribute off-limits). I got bit by this when trying to see
508 something inside the dis module.
522 something inside the dis module.
509
523
510 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
524 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
511
525
512 * IPython/iplib.py (InteractiveShell.__init__): add .meta
526 * IPython/iplib.py (InteractiveShell.__init__): add .meta
513 namespace for users and extension writers to hold data in. This
527 namespace for users and extension writers to hold data in. This
514 follows the discussion in
528 follows the discussion in
515 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
529 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
516
530
517 * IPython/completer.py (IPCompleter.complete): small patch to help
531 * IPython/completer.py (IPCompleter.complete): small patch to help
518 tab-completion under Emacs, after a suggestion by John Barnard
532 tab-completion under Emacs, after a suggestion by John Barnard
519 <barnarj-AT-ccf.org>.
533 <barnarj-AT-ccf.org>.
520
534
521 * IPython/Magic.py (Magic.extract_input_slices): added support for
535 * IPython/Magic.py (Magic.extract_input_slices): added support for
522 the slice notation in magics to use N-M to represent numbers N...M
536 the slice notation in magics to use N-M to represent numbers N...M
523 (closed endpoints). This is used by %macro and %save.
537 (closed endpoints). This is used by %macro and %save.
524
538
525 * IPython/completer.py (Completer.attr_matches): for modules which
539 * IPython/completer.py (Completer.attr_matches): for modules which
526 define __all__, complete only on those. After a patch by Jeffrey
540 define __all__, complete only on those. After a patch by Jeffrey
527 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
541 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
528 speed up this routine.
542 speed up this routine.
529
543
530 * IPython/Logger.py (Logger.log): fix a history handling bug. I
544 * IPython/Logger.py (Logger.log): fix a history handling bug. I
531 don't know if this is the end of it, but the behavior now is
545 don't know if this is the end of it, but the behavior now is
532 certainly much more correct. Note that coupled with macros,
546 certainly much more correct. Note that coupled with macros,
533 slightly surprising (at first) behavior may occur: a macro will in
547 slightly surprising (at first) behavior may occur: a macro will in
534 general expand to multiple lines of input, so upon exiting, the
548 general expand to multiple lines of input, so upon exiting, the
535 in/out counters will both be bumped by the corresponding amount
549 in/out counters will both be bumped by the corresponding amount
536 (as if the macro's contents had been typed interactively). Typing
550 (as if the macro's contents had been typed interactively). Typing
537 %hist will reveal the intermediate (silently processed) lines.
551 %hist will reveal the intermediate (silently processed) lines.
538
552
539 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
553 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
540 pickle to fail (%run was overwriting __main__ and not restoring
554 pickle to fail (%run was overwriting __main__ and not restoring
541 it, but pickle relies on __main__ to operate).
555 it, but pickle relies on __main__ to operate).
542
556
543 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
557 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
544 using properties, but forgot to make the main InteractiveShell
558 using properties, but forgot to make the main InteractiveShell
545 class a new-style class. Properties fail silently, and
559 class a new-style class. Properties fail silently, and
546 misteriously, with old-style class (getters work, but
560 misteriously, with old-style class (getters work, but
547 setters don't do anything).
561 setters don't do anything).
548
562
549 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
563 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
550
564
551 * IPython/Magic.py (magic_history): fix history reporting bug (I
565 * IPython/Magic.py (magic_history): fix history reporting bug (I
552 know some nasties are still there, I just can't seem to find a
566 know some nasties are still there, I just can't seem to find a
553 reproducible test case to track them down; the input history is
567 reproducible test case to track them down; the input history is
554 falling out of sync...)
568 falling out of sync...)
555
569
556 * IPython/iplib.py (handle_shell_escape): fix bug where both
570 * IPython/iplib.py (handle_shell_escape): fix bug where both
557 aliases and system accesses where broken for indented code (such
571 aliases and system accesses where broken for indented code (such
558 as loops).
572 as loops).
559
573
560 * IPython/genutils.py (shell): fix small but critical bug for
574 * IPython/genutils.py (shell): fix small but critical bug for
561 win32 system access.
575 win32 system access.
562
576
563 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
577 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
564
578
565 * IPython/iplib.py (showtraceback): remove use of the
579 * IPython/iplib.py (showtraceback): remove use of the
566 sys.last_{type/value/traceback} structures, which are non
580 sys.last_{type/value/traceback} structures, which are non
567 thread-safe.
581 thread-safe.
568 (_prefilter): change control flow to ensure that we NEVER
582 (_prefilter): change control flow to ensure that we NEVER
569 introspect objects when autocall is off. This will guarantee that
583 introspect objects when autocall is off. This will guarantee that
570 having an input line of the form 'x.y', where access to attribute
584 having an input line of the form 'x.y', where access to attribute
571 'y' has side effects, doesn't trigger the side effect TWICE. It
585 'y' has side effects, doesn't trigger the side effect TWICE. It
572 is important to note that, with autocall on, these side effects
586 is important to note that, with autocall on, these side effects
573 can still happen.
587 can still happen.
574 (ipsystem): new builtin, to complete the ip{magic/alias/system}
588 (ipsystem): new builtin, to complete the ip{magic/alias/system}
575 trio. IPython offers these three kinds of special calls which are
589 trio. IPython offers these three kinds of special calls which are
576 not python code, and it's a good thing to have their call method
590 not python code, and it's a good thing to have their call method
577 be accessible as pure python functions (not just special syntax at
591 be accessible as pure python functions (not just special syntax at
578 the command line). It gives us a better internal implementation
592 the command line). It gives us a better internal implementation
579 structure, as well as exposing these for user scripting more
593 structure, as well as exposing these for user scripting more
580 cleanly.
594 cleanly.
581
595
582 * IPython/macro.py (Macro.__init__): moved macros to a standalone
596 * IPython/macro.py (Macro.__init__): moved macros to a standalone
583 file. Now that they'll be more likely to be used with the
597 file. Now that they'll be more likely to be used with the
584 persistance system (%store), I want to make sure their module path
598 persistance system (%store), I want to make sure their module path
585 doesn't change in the future, so that we don't break things for
599 doesn't change in the future, so that we don't break things for
586 users' persisted data.
600 users' persisted data.
587
601
588 * IPython/iplib.py (autoindent_update): move indentation
602 * IPython/iplib.py (autoindent_update): move indentation
589 management into the _text_ processing loop, not the keyboard
603 management into the _text_ processing loop, not the keyboard
590 interactive one. This is necessary to correctly process non-typed
604 interactive one. This is necessary to correctly process non-typed
591 multiline input (such as macros).
605 multiline input (such as macros).
592
606
593 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
607 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
594 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
608 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
595 which was producing problems in the resulting manual.
609 which was producing problems in the resulting manual.
596 (magic_whos): improve reporting of instances (show their class,
610 (magic_whos): improve reporting of instances (show their class,
597 instead of simply printing 'instance' which isn't terribly
611 instead of simply printing 'instance' which isn't terribly
598 informative).
612 informative).
599
613
600 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
614 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
601 (minor mods) to support network shares under win32.
615 (minor mods) to support network shares under win32.
602
616
603 * IPython/winconsole.py (get_console_size): add new winconsole
617 * IPython/winconsole.py (get_console_size): add new winconsole
604 module and fixes to page_dumb() to improve its behavior under
618 module and fixes to page_dumb() to improve its behavior under
605 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
619 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
606
620
607 * IPython/Magic.py (Macro): simplified Macro class to just
621 * IPython/Magic.py (Macro): simplified Macro class to just
608 subclass list. We've had only 2.2 compatibility for a very long
622 subclass list. We've had only 2.2 compatibility for a very long
609 time, yet I was still avoiding subclassing the builtin types. No
623 time, yet I was still avoiding subclassing the builtin types. No
610 more (I'm also starting to use properties, though I won't shift to
624 more (I'm also starting to use properties, though I won't shift to
611 2.3-specific features quite yet).
625 2.3-specific features quite yet).
612 (magic_store): added Ville's patch for lightweight variable
626 (magic_store): added Ville's patch for lightweight variable
613 persistence, after a request on the user list by Matt Wilkie
627 persistence, after a request on the user list by Matt Wilkie
614 <maphew-AT-gmail.com>. The new %store magic's docstring has full
628 <maphew-AT-gmail.com>. The new %store magic's docstring has full
615 details.
629 details.
616
630
617 * IPython/iplib.py (InteractiveShell.post_config_initialization):
631 * IPython/iplib.py (InteractiveShell.post_config_initialization):
618 changed the default logfile name from 'ipython.log' to
632 changed the default logfile name from 'ipython.log' to
619 'ipython_log.py'. These logs are real python files, and now that
633 'ipython_log.py'. These logs are real python files, and now that
620 we have much better multiline support, people are more likely to
634 we have much better multiline support, people are more likely to
621 want to use them as such. Might as well name them correctly.
635 want to use them as such. Might as well name them correctly.
622
636
623 * IPython/Magic.py: substantial cleanup. While we can't stop
637 * IPython/Magic.py: substantial cleanup. While we can't stop
624 using magics as mixins, due to the existing customizations 'out
638 using magics as mixins, due to the existing customizations 'out
625 there' which rely on the mixin naming conventions, at least I
639 there' which rely on the mixin naming conventions, at least I
626 cleaned out all cross-class name usage. So once we are OK with
640 cleaned out all cross-class name usage. So once we are OK with
627 breaking compatibility, the two systems can be separated.
641 breaking compatibility, the two systems can be separated.
628
642
629 * IPython/Logger.py: major cleanup. This one is NOT a mixin
643 * IPython/Logger.py: major cleanup. This one is NOT a mixin
630 anymore, and the class is a fair bit less hideous as well. New
644 anymore, and the class is a fair bit less hideous as well. New
631 features were also introduced: timestamping of input, and logging
645 features were also introduced: timestamping of input, and logging
632 of output results. These are user-visible with the -t and -o
646 of output results. These are user-visible with the -t and -o
633 options to %logstart. Closes
647 options to %logstart. Closes
634 http://www.scipy.net/roundup/ipython/issue11 and a request by
648 http://www.scipy.net/roundup/ipython/issue11 and a request by
635 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
649 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
636
650
637 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
651 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
638
652
639 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
653 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
640 better hadnle backslashes in paths. See the thread 'More Windows
654 better hadnle backslashes in paths. See the thread 'More Windows
641 questions part 2 - \/ characters revisited' on the iypthon user
655 questions part 2 - \/ characters revisited' on the iypthon user
642 list:
656 list:
643 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
657 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
644
658
645 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
659 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
646
660
647 (InteractiveShell.__init__): change threaded shells to not use the
661 (InteractiveShell.__init__): change threaded shells to not use the
648 ipython crash handler. This was causing more problems than not,
662 ipython crash handler. This was causing more problems than not,
649 as exceptions in the main thread (GUI code, typically) would
663 as exceptions in the main thread (GUI code, typically) would
650 always show up as a 'crash', when they really weren't.
664 always show up as a 'crash', when they really weren't.
651
665
652 The colors and exception mode commands (%colors/%xmode) have been
666 The colors and exception mode commands (%colors/%xmode) have been
653 synchronized to also take this into account, so users can get
667 synchronized to also take this into account, so users can get
654 verbose exceptions for their threaded code as well. I also added
668 verbose exceptions for their threaded code as well. I also added
655 support for activating pdb inside this exception handler as well,
669 support for activating pdb inside this exception handler as well,
656 so now GUI authors can use IPython's enhanced pdb at runtime.
670 so now GUI authors can use IPython's enhanced pdb at runtime.
657
671
658 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
672 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
659 true by default, and add it to the shipped ipythonrc file. Since
673 true by default, and add it to the shipped ipythonrc file. Since
660 this asks the user before proceeding, I think it's OK to make it
674 this asks the user before proceeding, I think it's OK to make it
661 true by default.
675 true by default.
662
676
663 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
677 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
664 of the previous special-casing of input in the eval loop. I think
678 of the previous special-casing of input in the eval loop. I think
665 this is cleaner, as they really are commands and shouldn't have
679 this is cleaner, as they really are commands and shouldn't have
666 a special role in the middle of the core code.
680 a special role in the middle of the core code.
667
681
668 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
682 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
669
683
670 * IPython/iplib.py (edit_syntax_error): added support for
684 * IPython/iplib.py (edit_syntax_error): added support for
671 automatically reopening the editor if the file had a syntax error
685 automatically reopening the editor if the file had a syntax error
672 in it. Thanks to scottt who provided the patch at:
686 in it. Thanks to scottt who provided the patch at:
673 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
687 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
674 version committed).
688 version committed).
675
689
676 * IPython/iplib.py (handle_normal): add suport for multi-line
690 * IPython/iplib.py (handle_normal): add suport for multi-line
677 input with emtpy lines. This fixes
691 input with emtpy lines. This fixes
678 http://www.scipy.net/roundup/ipython/issue43 and a similar
692 http://www.scipy.net/roundup/ipython/issue43 and a similar
679 discussion on the user list.
693 discussion on the user list.
680
694
681 WARNING: a behavior change is necessarily introduced to support
695 WARNING: a behavior change is necessarily introduced to support
682 blank lines: now a single blank line with whitespace does NOT
696 blank lines: now a single blank line with whitespace does NOT
683 break the input loop, which means that when autoindent is on, by
697 break the input loop, which means that when autoindent is on, by
684 default hitting return on the next (indented) line does NOT exit.
698 default hitting return on the next (indented) line does NOT exit.
685
699
686 Instead, to exit a multiline input you can either have:
700 Instead, to exit a multiline input you can either have:
687
701
688 - TWO whitespace lines (just hit return again), or
702 - TWO whitespace lines (just hit return again), or
689 - a single whitespace line of a different length than provided
703 - a single whitespace line of a different length than provided
690 by the autoindent (add or remove a space).
704 by the autoindent (add or remove a space).
691
705
692 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
706 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
693 module to better organize all readline-related functionality.
707 module to better organize all readline-related functionality.
694 I've deleted FlexCompleter and put all completion clases here.
708 I've deleted FlexCompleter and put all completion clases here.
695
709
696 * IPython/iplib.py (raw_input): improve indentation management.
710 * IPython/iplib.py (raw_input): improve indentation management.
697 It is now possible to paste indented code with autoindent on, and
711 It is now possible to paste indented code with autoindent on, and
698 the code is interpreted correctly (though it still looks bad on
712 the code is interpreted correctly (though it still looks bad on
699 screen, due to the line-oriented nature of ipython).
713 screen, due to the line-oriented nature of ipython).
700 (MagicCompleter.complete): change behavior so that a TAB key on an
714 (MagicCompleter.complete): change behavior so that a TAB key on an
701 otherwise empty line actually inserts a tab, instead of completing
715 otherwise empty line actually inserts a tab, instead of completing
702 on the entire global namespace. This makes it easier to use the
716 on the entire global namespace. This makes it easier to use the
703 TAB key for indentation. After a request by Hans Meine
717 TAB key for indentation. After a request by Hans Meine
704 <hans_meine-AT-gmx.net>
718 <hans_meine-AT-gmx.net>
705 (_prefilter): add support so that typing plain 'exit' or 'quit'
719 (_prefilter): add support so that typing plain 'exit' or 'quit'
706 does a sensible thing. Originally I tried to deviate as little as
720 does a sensible thing. Originally I tried to deviate as little as
707 possible from the default python behavior, but even that one may
721 possible from the default python behavior, but even that one may
708 change in this direction (thread on python-dev to that effect).
722 change in this direction (thread on python-dev to that effect).
709 Regardless, ipython should do the right thing even if CPython's
723 Regardless, ipython should do the right thing even if CPython's
710 '>>>' prompt doesn't.
724 '>>>' prompt doesn't.
711 (InteractiveShell): removed subclassing code.InteractiveConsole
725 (InteractiveShell): removed subclassing code.InteractiveConsole
712 class. By now we'd overridden just about all of its methods: I've
726 class. By now we'd overridden just about all of its methods: I've
713 copied the remaining two over, and now ipython is a standalone
727 copied the remaining two over, and now ipython is a standalone
714 class. This will provide a clearer picture for the chainsaw
728 class. This will provide a clearer picture for the chainsaw
715 branch refactoring.
729 branch refactoring.
716
730
717 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
731 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
718
732
719 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
733 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
720 failures for objects which break when dir() is called on them.
734 failures for objects which break when dir() is called on them.
721
735
722 * IPython/FlexCompleter.py (Completer.__init__): Added support for
736 * IPython/FlexCompleter.py (Completer.__init__): Added support for
723 distinct local and global namespaces in the completer API. This
737 distinct local and global namespaces in the completer API. This
724 change allows us top properly handle completion with distinct
738 change allows us top properly handle completion with distinct
725 scopes, including in embedded instances (this had never really
739 scopes, including in embedded instances (this had never really
726 worked correctly).
740 worked correctly).
727
741
728 Note: this introduces a change in the constructor for
742 Note: this introduces a change in the constructor for
729 MagicCompleter, as a new global_namespace parameter is now the
743 MagicCompleter, as a new global_namespace parameter is now the
730 second argument (the others were bumped one position).
744 second argument (the others were bumped one position).
731
745
732 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
746 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
733
747
734 * IPython/iplib.py (embed_mainloop): fix tab-completion in
748 * IPython/iplib.py (embed_mainloop): fix tab-completion in
735 embedded instances (which can be done now thanks to Vivian's
749 embedded instances (which can be done now thanks to Vivian's
736 frame-handling fixes for pdb).
750 frame-handling fixes for pdb).
737 (InteractiveShell.__init__): Fix namespace handling problem in
751 (InteractiveShell.__init__): Fix namespace handling problem in
738 embedded instances. We were overwriting __main__ unconditionally,
752 embedded instances. We were overwriting __main__ unconditionally,
739 and this should only be done for 'full' (non-embedded) IPython;
753 and this should only be done for 'full' (non-embedded) IPython;
740 embedded instances must respect the caller's __main__. Thanks to
754 embedded instances must respect the caller's __main__. Thanks to
741 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
755 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
742
756
743 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
757 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
744
758
745 * setup.py: added download_url to setup(). This registers the
759 * setup.py: added download_url to setup(). This registers the
746 download address at PyPI, which is not only useful to humans
760 download address at PyPI, which is not only useful to humans
747 browsing the site, but is also picked up by setuptools (the Eggs
761 browsing the site, but is also picked up by setuptools (the Eggs
748 machinery). Thanks to Ville and R. Kern for the info/discussion
762 machinery). Thanks to Ville and R. Kern for the info/discussion
749 on this.
763 on this.
750
764
751 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
765 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
752
766
753 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
767 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
754 This brings a lot of nice functionality to the pdb mode, which now
768 This brings a lot of nice functionality to the pdb mode, which now
755 has tab-completion, syntax highlighting, and better stack handling
769 has tab-completion, syntax highlighting, and better stack handling
756 than before. Many thanks to Vivian De Smedt
770 than before. Many thanks to Vivian De Smedt
757 <vivian-AT-vdesmedt.com> for the original patches.
771 <vivian-AT-vdesmedt.com> for the original patches.
758
772
759 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
773 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
760
774
761 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
775 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
762 sequence to consistently accept the banner argument. The
776 sequence to consistently accept the banner argument. The
763 inconsistency was tripping SAGE, thanks to Gary Zablackis
777 inconsistency was tripping SAGE, thanks to Gary Zablackis
764 <gzabl-AT-yahoo.com> for the report.
778 <gzabl-AT-yahoo.com> for the report.
765
779
766 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
780 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
767
781
768 * IPython/iplib.py (InteractiveShell.post_config_initialization):
782 * IPython/iplib.py (InteractiveShell.post_config_initialization):
769 Fix bug where a naked 'alias' call in the ipythonrc file would
783 Fix bug where a naked 'alias' call in the ipythonrc file would
770 cause a crash. Bug reported by Jorgen Stenarson.
784 cause a crash. Bug reported by Jorgen Stenarson.
771
785
772 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
786 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
773
787
774 * IPython/ipmaker.py (make_IPython): cleanups which should improve
788 * IPython/ipmaker.py (make_IPython): cleanups which should improve
775 startup time.
789 startup time.
776
790
777 * IPython/iplib.py (runcode): my globals 'fix' for embedded
791 * IPython/iplib.py (runcode): my globals 'fix' for embedded
778 instances had introduced a bug with globals in normal code. Now
792 instances had introduced a bug with globals in normal code. Now
779 it's working in all cases.
793 it's working in all cases.
780
794
781 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
795 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
782 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
796 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
783 has been introduced to set the default case sensitivity of the
797 has been introduced to set the default case sensitivity of the
784 searches. Users can still select either mode at runtime on a
798 searches. Users can still select either mode at runtime on a
785 per-search basis.
799 per-search basis.
786
800
787 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
801 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
788
802
789 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
803 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
790 attributes in wildcard searches for subclasses. Modified version
804 attributes in wildcard searches for subclasses. Modified version
791 of a patch by Jorgen.
805 of a patch by Jorgen.
792
806
793 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
807 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
794
808
795 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
809 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
796 embedded instances. I added a user_global_ns attribute to the
810 embedded instances. I added a user_global_ns attribute to the
797 InteractiveShell class to handle this.
811 InteractiveShell class to handle this.
798
812
799 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
813 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
800
814
801 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
815 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
802 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
816 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
803 (reported under win32, but may happen also in other platforms).
817 (reported under win32, but may happen also in other platforms).
804 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
818 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
805
819
806 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
820 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
807
821
808 * IPython/Magic.py (magic_psearch): new support for wildcard
822 * IPython/Magic.py (magic_psearch): new support for wildcard
809 patterns. Now, typing ?a*b will list all names which begin with a
823 patterns. Now, typing ?a*b will list all names which begin with a
810 and end in b, for example. The %psearch magic has full
824 and end in b, for example. The %psearch magic has full
811 docstrings. Many thanks to JΓΆrgen Stenarson
825 docstrings. Many thanks to JΓΆrgen Stenarson
812 <jorgen.stenarson-AT-bostream.nu>, author of the patches
826 <jorgen.stenarson-AT-bostream.nu>, author of the patches
813 implementing this functionality.
827 implementing this functionality.
814
828
815 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
829 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
816
830
817 * Manual: fixed long-standing annoyance of double-dashes (as in
831 * Manual: fixed long-standing annoyance of double-dashes (as in
818 --prefix=~, for example) being stripped in the HTML version. This
832 --prefix=~, for example) being stripped in the HTML version. This
819 is a latex2html bug, but a workaround was provided. Many thanks
833 is a latex2html bug, but a workaround was provided. Many thanks
820 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
834 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
821 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
835 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
822 rolling. This seemingly small issue had tripped a number of users
836 rolling. This seemingly small issue had tripped a number of users
823 when first installing, so I'm glad to see it gone.
837 when first installing, so I'm glad to see it gone.
824
838
825 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
839 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
826
840
827 * IPython/Extensions/numeric_formats.py: fix missing import,
841 * IPython/Extensions/numeric_formats.py: fix missing import,
828 reported by Stephen Walton.
842 reported by Stephen Walton.
829
843
830 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
844 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
831
845
832 * IPython/demo.py: finish demo module, fully documented now.
846 * IPython/demo.py: finish demo module, fully documented now.
833
847
834 * IPython/genutils.py (file_read): simple little utility to read a
848 * IPython/genutils.py (file_read): simple little utility to read a
835 file and ensure it's closed afterwards.
849 file and ensure it's closed afterwards.
836
850
837 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
851 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
838
852
839 * IPython/demo.py (Demo.__init__): added support for individually
853 * IPython/demo.py (Demo.__init__): added support for individually
840 tagging blocks for automatic execution.
854 tagging blocks for automatic execution.
841
855
842 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
856 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
843 syntax-highlighted python sources, requested by John.
857 syntax-highlighted python sources, requested by John.
844
858
845 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
859 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
846
860
847 * IPython/demo.py (Demo.again): fix bug where again() blocks after
861 * IPython/demo.py (Demo.again): fix bug where again() blocks after
848 finishing.
862 finishing.
849
863
850 * IPython/genutils.py (shlex_split): moved from Magic to here,
864 * IPython/genutils.py (shlex_split): moved from Magic to here,
851 where all 2.2 compatibility stuff lives. I needed it for demo.py.
865 where all 2.2 compatibility stuff lives. I needed it for demo.py.
852
866
853 * IPython/demo.py (Demo.__init__): added support for silent
867 * IPython/demo.py (Demo.__init__): added support for silent
854 blocks, improved marks as regexps, docstrings written.
868 blocks, improved marks as regexps, docstrings written.
855 (Demo.__init__): better docstring, added support for sys.argv.
869 (Demo.__init__): better docstring, added support for sys.argv.
856
870
857 * IPython/genutils.py (marquee): little utility used by the demo
871 * IPython/genutils.py (marquee): little utility used by the demo
858 code, handy in general.
872 code, handy in general.
859
873
860 * IPython/demo.py (Demo.__init__): new class for interactive
874 * IPython/demo.py (Demo.__init__): new class for interactive
861 demos. Not documented yet, I just wrote it in a hurry for
875 demos. Not documented yet, I just wrote it in a hurry for
862 scipy'05. Will docstring later.
876 scipy'05. Will docstring later.
863
877
864 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
878 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
865
879
866 * IPython/Shell.py (sigint_handler): Drastic simplification which
880 * IPython/Shell.py (sigint_handler): Drastic simplification which
867 also seems to make Ctrl-C work correctly across threads! This is
881 also seems to make Ctrl-C work correctly across threads! This is
868 so simple, that I can't beleive I'd missed it before. Needs more
882 so simple, that I can't beleive I'd missed it before. Needs more
869 testing, though.
883 testing, though.
870 (KBINT): Never mind, revert changes. I'm sure I'd tried something
884 (KBINT): Never mind, revert changes. I'm sure I'd tried something
871 like this before...
885 like this before...
872
886
873 * IPython/genutils.py (get_home_dir): add protection against
887 * IPython/genutils.py (get_home_dir): add protection against
874 non-dirs in win32 registry.
888 non-dirs in win32 registry.
875
889
876 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
890 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
877 bug where dict was mutated while iterating (pysh crash).
891 bug where dict was mutated while iterating (pysh crash).
878
892
879 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
893 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
880
894
881 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
895 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
882 spurious newlines added by this routine. After a report by
896 spurious newlines added by this routine. After a report by
883 F. Mantegazza.
897 F. Mantegazza.
884
898
885 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
899 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
886
900
887 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
901 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
888 calls. These were a leftover from the GTK 1.x days, and can cause
902 calls. These were a leftover from the GTK 1.x days, and can cause
889 problems in certain cases (after a report by John Hunter).
903 problems in certain cases (after a report by John Hunter).
890
904
891 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
905 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
892 os.getcwd() fails at init time. Thanks to patch from David Remahl
906 os.getcwd() fails at init time. Thanks to patch from David Remahl
893 <chmod007-AT-mac.com>.
907 <chmod007-AT-mac.com>.
894 (InteractiveShell.__init__): prevent certain special magics from
908 (InteractiveShell.__init__): prevent certain special magics from
895 being shadowed by aliases. Closes
909 being shadowed by aliases. Closes
896 http://www.scipy.net/roundup/ipython/issue41.
910 http://www.scipy.net/roundup/ipython/issue41.
897
911
898 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
912 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
899
913
900 * IPython/iplib.py (InteractiveShell.complete): Added new
914 * IPython/iplib.py (InteractiveShell.complete): Added new
901 top-level completion method to expose the completion mechanism
915 top-level completion method to expose the completion mechanism
902 beyond readline-based environments.
916 beyond readline-based environments.
903
917
904 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
918 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
905
919
906 * tools/ipsvnc (svnversion): fix svnversion capture.
920 * tools/ipsvnc (svnversion): fix svnversion capture.
907
921
908 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
922 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
909 attribute to self, which was missing. Before, it was set by a
923 attribute to self, which was missing. Before, it was set by a
910 routine which in certain cases wasn't being called, so the
924 routine which in certain cases wasn't being called, so the
911 instance could end up missing the attribute. This caused a crash.
925 instance could end up missing the attribute. This caused a crash.
912 Closes http://www.scipy.net/roundup/ipython/issue40.
926 Closes http://www.scipy.net/roundup/ipython/issue40.
913
927
914 2005-08-16 Fernando Perez <fperez@colorado.edu>
928 2005-08-16 Fernando Perez <fperez@colorado.edu>
915
929
916 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
930 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
917 contains non-string attribute. Closes
931 contains non-string attribute. Closes
918 http://www.scipy.net/roundup/ipython/issue38.
932 http://www.scipy.net/roundup/ipython/issue38.
919
933
920 2005-08-14 Fernando Perez <fperez@colorado.edu>
934 2005-08-14 Fernando Perez <fperez@colorado.edu>
921
935
922 * tools/ipsvnc: Minor improvements, to add changeset info.
936 * tools/ipsvnc: Minor improvements, to add changeset info.
923
937
924 2005-08-12 Fernando Perez <fperez@colorado.edu>
938 2005-08-12 Fernando Perez <fperez@colorado.edu>
925
939
926 * IPython/iplib.py (runsource): remove self.code_to_run_src
940 * IPython/iplib.py (runsource): remove self.code_to_run_src
927 attribute. I realized this is nothing more than
941 attribute. I realized this is nothing more than
928 '\n'.join(self.buffer), and having the same data in two different
942 '\n'.join(self.buffer), and having the same data in two different
929 places is just asking for synchronization bugs. This may impact
943 places is just asking for synchronization bugs. This may impact
930 people who have custom exception handlers, so I need to warn
944 people who have custom exception handlers, so I need to warn
931 ipython-dev about it (F. Mantegazza may use them).
945 ipython-dev about it (F. Mantegazza may use them).
932
946
933 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
947 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
934
948
935 * IPython/genutils.py: fix 2.2 compatibility (generators)
949 * IPython/genutils.py: fix 2.2 compatibility (generators)
936
950
937 2005-07-18 Fernando Perez <fperez@colorado.edu>
951 2005-07-18 Fernando Perez <fperez@colorado.edu>
938
952
939 * IPython/genutils.py (get_home_dir): fix to help users with
953 * IPython/genutils.py (get_home_dir): fix to help users with
940 invalid $HOME under win32.
954 invalid $HOME under win32.
941
955
942 2005-07-17 Fernando Perez <fperez@colorado.edu>
956 2005-07-17 Fernando Perez <fperez@colorado.edu>
943
957
944 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
958 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
945 some old hacks and clean up a bit other routines; code should be
959 some old hacks and clean up a bit other routines; code should be
946 simpler and a bit faster.
960 simpler and a bit faster.
947
961
948 * IPython/iplib.py (interact): removed some last-resort attempts
962 * IPython/iplib.py (interact): removed some last-resort attempts
949 to survive broken stdout/stderr. That code was only making it
963 to survive broken stdout/stderr. That code was only making it
950 harder to abstract out the i/o (necessary for gui integration),
964 harder to abstract out the i/o (necessary for gui integration),
951 and the crashes it could prevent were extremely rare in practice
965 and the crashes it could prevent were extremely rare in practice
952 (besides being fully user-induced in a pretty violent manner).
966 (besides being fully user-induced in a pretty violent manner).
953
967
954 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
968 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
955 Nothing major yet, but the code is simpler to read; this should
969 Nothing major yet, but the code is simpler to read; this should
956 make it easier to do more serious modifications in the future.
970 make it easier to do more serious modifications in the future.
957
971
958 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
972 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
959 which broke in .15 (thanks to a report by Ville).
973 which broke in .15 (thanks to a report by Ville).
960
974
961 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
975 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
962 be quite correct, I know next to nothing about unicode). This
976 be quite correct, I know next to nothing about unicode). This
963 will allow unicode strings to be used in prompts, amongst other
977 will allow unicode strings to be used in prompts, amongst other
964 cases. It also will prevent ipython from crashing when unicode
978 cases. It also will prevent ipython from crashing when unicode
965 shows up unexpectedly in many places. If ascii encoding fails, we
979 shows up unexpectedly in many places. If ascii encoding fails, we
966 assume utf_8. Currently the encoding is not a user-visible
980 assume utf_8. Currently the encoding is not a user-visible
967 setting, though it could be made so if there is demand for it.
981 setting, though it could be made so if there is demand for it.
968
982
969 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
983 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
970
984
971 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
985 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
972
986
973 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
987 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
974
988
975 * IPython/genutils.py: Add 2.2 compatibility here, so all other
989 * IPython/genutils.py: Add 2.2 compatibility here, so all other
976 code can work transparently for 2.2/2.3.
990 code can work transparently for 2.2/2.3.
977
991
978 2005-07-16 Fernando Perez <fperez@colorado.edu>
992 2005-07-16 Fernando Perez <fperez@colorado.edu>
979
993
980 * IPython/ultraTB.py (ExceptionColors): Make a global variable
994 * IPython/ultraTB.py (ExceptionColors): Make a global variable
981 out of the color scheme table used for coloring exception
995 out of the color scheme table used for coloring exception
982 tracebacks. This allows user code to add new schemes at runtime.
996 tracebacks. This allows user code to add new schemes at runtime.
983 This is a minimally modified version of the patch at
997 This is a minimally modified version of the patch at
984 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
998 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
985 for the contribution.
999 for the contribution.
986
1000
987 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1001 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
988 slightly modified version of the patch in
1002 slightly modified version of the patch in
989 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1003 http://www.scipy.net/roundup/ipython/issue34, which also allows me
990 to remove the previous try/except solution (which was costlier).
1004 to remove the previous try/except solution (which was costlier).
991 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1005 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
992
1006
993 2005-06-08 Fernando Perez <fperez@colorado.edu>
1007 2005-06-08 Fernando Perez <fperez@colorado.edu>
994
1008
995 * IPython/iplib.py (write/write_err): Add methods to abstract all
1009 * IPython/iplib.py (write/write_err): Add methods to abstract all
996 I/O a bit more.
1010 I/O a bit more.
997
1011
998 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1012 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
999 warning, reported by Aric Hagberg, fix by JD Hunter.
1013 warning, reported by Aric Hagberg, fix by JD Hunter.
1000
1014
1001 2005-06-02 *** Released version 0.6.15
1015 2005-06-02 *** Released version 0.6.15
1002
1016
1003 2005-06-01 Fernando Perez <fperez@colorado.edu>
1017 2005-06-01 Fernando Perez <fperez@colorado.edu>
1004
1018
1005 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1019 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1006 tab-completion of filenames within open-quoted strings. Note that
1020 tab-completion of filenames within open-quoted strings. Note that
1007 this requires that in ~/.ipython/ipythonrc, users change the
1021 this requires that in ~/.ipython/ipythonrc, users change the
1008 readline delimiters configuration to read:
1022 readline delimiters configuration to read:
1009
1023
1010 readline_remove_delims -/~
1024 readline_remove_delims -/~
1011
1025
1012
1026
1013 2005-05-31 *** Released version 0.6.14
1027 2005-05-31 *** Released version 0.6.14
1014
1028
1015 2005-05-29 Fernando Perez <fperez@colorado.edu>
1029 2005-05-29 Fernando Perez <fperez@colorado.edu>
1016
1030
1017 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1031 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1018 with files not on the filesystem. Reported by Eliyahu Sandler
1032 with files not on the filesystem. Reported by Eliyahu Sandler
1019 <eli@gondolin.net>
1033 <eli@gondolin.net>
1020
1034
1021 2005-05-22 Fernando Perez <fperez@colorado.edu>
1035 2005-05-22 Fernando Perez <fperez@colorado.edu>
1022
1036
1023 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1037 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1024 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1038 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1025
1039
1026 2005-05-19 Fernando Perez <fperez@colorado.edu>
1040 2005-05-19 Fernando Perez <fperez@colorado.edu>
1027
1041
1028 * IPython/iplib.py (safe_execfile): close a file which could be
1042 * IPython/iplib.py (safe_execfile): close a file which could be
1029 left open (causing problems in win32, which locks open files).
1043 left open (causing problems in win32, which locks open files).
1030 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1044 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1031
1045
1032 2005-05-18 Fernando Perez <fperez@colorado.edu>
1046 2005-05-18 Fernando Perez <fperez@colorado.edu>
1033
1047
1034 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1048 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1035 keyword arguments correctly to safe_execfile().
1049 keyword arguments correctly to safe_execfile().
1036
1050
1037 2005-05-13 Fernando Perez <fperez@colorado.edu>
1051 2005-05-13 Fernando Perez <fperez@colorado.edu>
1038
1052
1039 * ipython.1: Added info about Qt to manpage, and threads warning
1053 * ipython.1: Added info about Qt to manpage, and threads warning
1040 to usage page (invoked with --help).
1054 to usage page (invoked with --help).
1041
1055
1042 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1056 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1043 new matcher (it goes at the end of the priority list) to do
1057 new matcher (it goes at the end of the priority list) to do
1044 tab-completion on named function arguments. Submitted by George
1058 tab-completion on named function arguments. Submitted by George
1045 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1059 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1046 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1060 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1047 for more details.
1061 for more details.
1048
1062
1049 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1063 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1050 SystemExit exceptions in the script being run. Thanks to a report
1064 SystemExit exceptions in the script being run. Thanks to a report
1051 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1065 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1052 producing very annoying behavior when running unit tests.
1066 producing very annoying behavior when running unit tests.
1053
1067
1054 2005-05-12 Fernando Perez <fperez@colorado.edu>
1068 2005-05-12 Fernando Perez <fperez@colorado.edu>
1055
1069
1056 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1070 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1057 which I'd broken (again) due to a changed regexp. In the process,
1071 which I'd broken (again) due to a changed regexp. In the process,
1058 added ';' as an escape to auto-quote the whole line without
1072 added ';' as an escape to auto-quote the whole line without
1059 splitting its arguments. Thanks to a report by Jerry McRae
1073 splitting its arguments. Thanks to a report by Jerry McRae
1060 <qrs0xyc02-AT-sneakemail.com>.
1074 <qrs0xyc02-AT-sneakemail.com>.
1061
1075
1062 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1076 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1063 possible crashes caused by a TokenError. Reported by Ed Schofield
1077 possible crashes caused by a TokenError. Reported by Ed Schofield
1064 <schofield-AT-ftw.at>.
1078 <schofield-AT-ftw.at>.
1065
1079
1066 2005-05-06 Fernando Perez <fperez@colorado.edu>
1080 2005-05-06 Fernando Perez <fperez@colorado.edu>
1067
1081
1068 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1082 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1069
1083
1070 2005-04-29 Fernando Perez <fperez@colorado.edu>
1084 2005-04-29 Fernando Perez <fperez@colorado.edu>
1071
1085
1072 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1086 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1073 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1087 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1074 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1088 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1075 which provides support for Qt interactive usage (similar to the
1089 which provides support for Qt interactive usage (similar to the
1076 existing one for WX and GTK). This had been often requested.
1090 existing one for WX and GTK). This had been often requested.
1077
1091
1078 2005-04-14 *** Released version 0.6.13
1092 2005-04-14 *** Released version 0.6.13
1079
1093
1080 2005-04-08 Fernando Perez <fperez@colorado.edu>
1094 2005-04-08 Fernando Perez <fperez@colorado.edu>
1081
1095
1082 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1096 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1083 from _ofind, which gets called on almost every input line. Now,
1097 from _ofind, which gets called on almost every input line. Now,
1084 we only try to get docstrings if they are actually going to be
1098 we only try to get docstrings if they are actually going to be
1085 used (the overhead of fetching unnecessary docstrings can be
1099 used (the overhead of fetching unnecessary docstrings can be
1086 noticeable for certain objects, such as Pyro proxies).
1100 noticeable for certain objects, such as Pyro proxies).
1087
1101
1088 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1102 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1089 for completers. For some reason I had been passing them the state
1103 for completers. For some reason I had been passing them the state
1090 variable, which completers never actually need, and was in
1104 variable, which completers never actually need, and was in
1091 conflict with the rlcompleter API. Custom completers ONLY need to
1105 conflict with the rlcompleter API. Custom completers ONLY need to
1092 take the text parameter.
1106 take the text parameter.
1093
1107
1094 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1108 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1095 work correctly in pysh. I've also moved all the logic which used
1109 work correctly in pysh. I've also moved all the logic which used
1096 to be in pysh.py here, which will prevent problems with future
1110 to be in pysh.py here, which will prevent problems with future
1097 upgrades. However, this time I must warn users to update their
1111 upgrades. However, this time I must warn users to update their
1098 pysh profile to include the line
1112 pysh profile to include the line
1099
1113
1100 import_all IPython.Extensions.InterpreterExec
1114 import_all IPython.Extensions.InterpreterExec
1101
1115
1102 because otherwise things won't work for them. They MUST also
1116 because otherwise things won't work for them. They MUST also
1103 delete pysh.py and the line
1117 delete pysh.py and the line
1104
1118
1105 execfile pysh.py
1119 execfile pysh.py
1106
1120
1107 from their ipythonrc-pysh.
1121 from their ipythonrc-pysh.
1108
1122
1109 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1123 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1110 robust in the face of objects whose dir() returns non-strings
1124 robust in the face of objects whose dir() returns non-strings
1111 (which it shouldn't, but some broken libs like ITK do). Thanks to
1125 (which it shouldn't, but some broken libs like ITK do). Thanks to
1112 a patch by John Hunter (implemented differently, though). Also
1126 a patch by John Hunter (implemented differently, though). Also
1113 minor improvements by using .extend instead of + on lists.
1127 minor improvements by using .extend instead of + on lists.
1114
1128
1115 * pysh.py:
1129 * pysh.py:
1116
1130
1117 2005-04-06 Fernando Perez <fperez@colorado.edu>
1131 2005-04-06 Fernando Perez <fperez@colorado.edu>
1118
1132
1119 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1133 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1120 by default, so that all users benefit from it. Those who don't
1134 by default, so that all users benefit from it. Those who don't
1121 want it can still turn it off.
1135 want it can still turn it off.
1122
1136
1123 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1137 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1124 config file, I'd forgotten about this, so users were getting it
1138 config file, I'd forgotten about this, so users were getting it
1125 off by default.
1139 off by default.
1126
1140
1127 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1141 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1128 consistency. Now magics can be called in multiline statements,
1142 consistency. Now magics can be called in multiline statements,
1129 and python variables can be expanded in magic calls via $var.
1143 and python variables can be expanded in magic calls via $var.
1130 This makes the magic system behave just like aliases or !system
1144 This makes the magic system behave just like aliases or !system
1131 calls.
1145 calls.
1132
1146
1133 2005-03-28 Fernando Perez <fperez@colorado.edu>
1147 2005-03-28 Fernando Perez <fperez@colorado.edu>
1134
1148
1135 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1149 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1136 expensive string additions for building command. Add support for
1150 expensive string additions for building command. Add support for
1137 trailing ';' when autocall is used.
1151 trailing ';' when autocall is used.
1138
1152
1139 2005-03-26 Fernando Perez <fperez@colorado.edu>
1153 2005-03-26 Fernando Perez <fperez@colorado.edu>
1140
1154
1141 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1155 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1142 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1156 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1143 ipython.el robust against prompts with any number of spaces
1157 ipython.el robust against prompts with any number of spaces
1144 (including 0) after the ':' character.
1158 (including 0) after the ':' character.
1145
1159
1146 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1160 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1147 continuation prompt, which misled users to think the line was
1161 continuation prompt, which misled users to think the line was
1148 already indented. Closes debian Bug#300847, reported to me by
1162 already indented. Closes debian Bug#300847, reported to me by
1149 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1163 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1150
1164
1151 2005-03-23 Fernando Perez <fperez@colorado.edu>
1165 2005-03-23 Fernando Perez <fperez@colorado.edu>
1152
1166
1153 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1167 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1154 properly aligned if they have embedded newlines.
1168 properly aligned if they have embedded newlines.
1155
1169
1156 * IPython/iplib.py (runlines): Add a public method to expose
1170 * IPython/iplib.py (runlines): Add a public method to expose
1157 IPython's code execution machinery, so that users can run strings
1171 IPython's code execution machinery, so that users can run strings
1158 as if they had been typed at the prompt interactively.
1172 as if they had been typed at the prompt interactively.
1159 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1173 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1160 methods which can call the system shell, but with python variable
1174 methods which can call the system shell, but with python variable
1161 expansion. The three such methods are: __IPYTHON__.system,
1175 expansion. The three such methods are: __IPYTHON__.system,
1162 .getoutput and .getoutputerror. These need to be documented in a
1176 .getoutput and .getoutputerror. These need to be documented in a
1163 'public API' section (to be written) of the manual.
1177 'public API' section (to be written) of the manual.
1164
1178
1165 2005-03-20 Fernando Perez <fperez@colorado.edu>
1179 2005-03-20 Fernando Perez <fperez@colorado.edu>
1166
1180
1167 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1181 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1168 for custom exception handling. This is quite powerful, and it
1182 for custom exception handling. This is quite powerful, and it
1169 allows for user-installable exception handlers which can trap
1183 allows for user-installable exception handlers which can trap
1170 custom exceptions at runtime and treat them separately from
1184 custom exceptions at runtime and treat them separately from
1171 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1185 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1172 Mantegazza <mantegazza-AT-ill.fr>.
1186 Mantegazza <mantegazza-AT-ill.fr>.
1173 (InteractiveShell.set_custom_completer): public API function to
1187 (InteractiveShell.set_custom_completer): public API function to
1174 add new completers at runtime.
1188 add new completers at runtime.
1175
1189
1176 2005-03-19 Fernando Perez <fperez@colorado.edu>
1190 2005-03-19 Fernando Perez <fperez@colorado.edu>
1177
1191
1178 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1192 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1179 allow objects which provide their docstrings via non-standard
1193 allow objects which provide their docstrings via non-standard
1180 mechanisms (like Pyro proxies) to still be inspected by ipython's
1194 mechanisms (like Pyro proxies) to still be inspected by ipython's
1181 ? system.
1195 ? system.
1182
1196
1183 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1197 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1184 automatic capture system. I tried quite hard to make it work
1198 automatic capture system. I tried quite hard to make it work
1185 reliably, and simply failed. I tried many combinations with the
1199 reliably, and simply failed. I tried many combinations with the
1186 subprocess module, but eventually nothing worked in all needed
1200 subprocess module, but eventually nothing worked in all needed
1187 cases (not blocking stdin for the child, duplicating stdout
1201 cases (not blocking stdin for the child, duplicating stdout
1188 without blocking, etc). The new %sc/%sx still do capture to these
1202 without blocking, etc). The new %sc/%sx still do capture to these
1189 magical list/string objects which make shell use much more
1203 magical list/string objects which make shell use much more
1190 conveninent, so not all is lost.
1204 conveninent, so not all is lost.
1191
1205
1192 XXX - FIX MANUAL for the change above!
1206 XXX - FIX MANUAL for the change above!
1193
1207
1194 (runsource): I copied code.py's runsource() into ipython to modify
1208 (runsource): I copied code.py's runsource() into ipython to modify
1195 it a bit. Now the code object and source to be executed are
1209 it a bit. Now the code object and source to be executed are
1196 stored in ipython. This makes this info accessible to third-party
1210 stored in ipython. This makes this info accessible to third-party
1197 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1211 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1198 Mantegazza <mantegazza-AT-ill.fr>.
1212 Mantegazza <mantegazza-AT-ill.fr>.
1199
1213
1200 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1214 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1201 history-search via readline (like C-p/C-n). I'd wanted this for a
1215 history-search via readline (like C-p/C-n). I'd wanted this for a
1202 long time, but only recently found out how to do it. For users
1216 long time, but only recently found out how to do it. For users
1203 who already have their ipythonrc files made and want this, just
1217 who already have their ipythonrc files made and want this, just
1204 add:
1218 add:
1205
1219
1206 readline_parse_and_bind "\e[A": history-search-backward
1220 readline_parse_and_bind "\e[A": history-search-backward
1207 readline_parse_and_bind "\e[B": history-search-forward
1221 readline_parse_and_bind "\e[B": history-search-forward
1208
1222
1209 2005-03-18 Fernando Perez <fperez@colorado.edu>
1223 2005-03-18 Fernando Perez <fperez@colorado.edu>
1210
1224
1211 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1225 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1212 LSString and SList classes which allow transparent conversions
1226 LSString and SList classes which allow transparent conversions
1213 between list mode and whitespace-separated string.
1227 between list mode and whitespace-separated string.
1214 (magic_r): Fix recursion problem in %r.
1228 (magic_r): Fix recursion problem in %r.
1215
1229
1216 * IPython/genutils.py (LSString): New class to be used for
1230 * IPython/genutils.py (LSString): New class to be used for
1217 automatic storage of the results of all alias/system calls in _o
1231 automatic storage of the results of all alias/system calls in _o
1218 and _e (stdout/err). These provide a .l/.list attribute which
1232 and _e (stdout/err). These provide a .l/.list attribute which
1219 does automatic splitting on newlines. This means that for most
1233 does automatic splitting on newlines. This means that for most
1220 uses, you'll never need to do capturing of output with %sc/%sx
1234 uses, you'll never need to do capturing of output with %sc/%sx
1221 anymore, since ipython keeps this always done for you. Note that
1235 anymore, since ipython keeps this always done for you. Note that
1222 only the LAST results are stored, the _o/e variables are
1236 only the LAST results are stored, the _o/e variables are
1223 overwritten on each call. If you need to save their contents
1237 overwritten on each call. If you need to save their contents
1224 further, simply bind them to any other name.
1238 further, simply bind them to any other name.
1225
1239
1226 2005-03-17 Fernando Perez <fperez@colorado.edu>
1240 2005-03-17 Fernando Perez <fperez@colorado.edu>
1227
1241
1228 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1242 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1229 prompt namespace handling.
1243 prompt namespace handling.
1230
1244
1231 2005-03-16 Fernando Perez <fperez@colorado.edu>
1245 2005-03-16 Fernando Perez <fperez@colorado.edu>
1232
1246
1233 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1247 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1234 classic prompts to be '>>> ' (final space was missing, and it
1248 classic prompts to be '>>> ' (final space was missing, and it
1235 trips the emacs python mode).
1249 trips the emacs python mode).
1236 (BasePrompt.__str__): Added safe support for dynamic prompt
1250 (BasePrompt.__str__): Added safe support for dynamic prompt
1237 strings. Now you can set your prompt string to be '$x', and the
1251 strings. Now you can set your prompt string to be '$x', and the
1238 value of x will be printed from your interactive namespace. The
1252 value of x will be printed from your interactive namespace. The
1239 interpolation syntax includes the full Itpl support, so
1253 interpolation syntax includes the full Itpl support, so
1240 ${foo()+x+bar()} is a valid prompt string now, and the function
1254 ${foo()+x+bar()} is a valid prompt string now, and the function
1241 calls will be made at runtime.
1255 calls will be made at runtime.
1242
1256
1243 2005-03-15 Fernando Perez <fperez@colorado.edu>
1257 2005-03-15 Fernando Perez <fperez@colorado.edu>
1244
1258
1245 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1259 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1246 avoid name clashes in pylab. %hist still works, it just forwards
1260 avoid name clashes in pylab. %hist still works, it just forwards
1247 the call to %history.
1261 the call to %history.
1248
1262
1249 2005-03-02 *** Released version 0.6.12
1263 2005-03-02 *** Released version 0.6.12
1250
1264
1251 2005-03-02 Fernando Perez <fperez@colorado.edu>
1265 2005-03-02 Fernando Perez <fperez@colorado.edu>
1252
1266
1253 * IPython/iplib.py (handle_magic): log magic calls properly as
1267 * IPython/iplib.py (handle_magic): log magic calls properly as
1254 ipmagic() function calls.
1268 ipmagic() function calls.
1255
1269
1256 * IPython/Magic.py (magic_time): Improved %time to support
1270 * IPython/Magic.py (magic_time): Improved %time to support
1257 statements and provide wall-clock as well as CPU time.
1271 statements and provide wall-clock as well as CPU time.
1258
1272
1259 2005-02-27 Fernando Perez <fperez@colorado.edu>
1273 2005-02-27 Fernando Perez <fperez@colorado.edu>
1260
1274
1261 * IPython/hooks.py: New hooks module, to expose user-modifiable
1275 * IPython/hooks.py: New hooks module, to expose user-modifiable
1262 IPython functionality in a clean manner. For now only the editor
1276 IPython functionality in a clean manner. For now only the editor
1263 hook is actually written, and other thigns which I intend to turn
1277 hook is actually written, and other thigns which I intend to turn
1264 into proper hooks aren't yet there. The display and prefilter
1278 into proper hooks aren't yet there. The display and prefilter
1265 stuff, for example, should be hooks. But at least now the
1279 stuff, for example, should be hooks. But at least now the
1266 framework is in place, and the rest can be moved here with more
1280 framework is in place, and the rest can be moved here with more
1267 time later. IPython had had a .hooks variable for a long time for
1281 time later. IPython had had a .hooks variable for a long time for
1268 this purpose, but I'd never actually used it for anything.
1282 this purpose, but I'd never actually used it for anything.
1269
1283
1270 2005-02-26 Fernando Perez <fperez@colorado.edu>
1284 2005-02-26 Fernando Perez <fperez@colorado.edu>
1271
1285
1272 * IPython/ipmaker.py (make_IPython): make the default ipython
1286 * IPython/ipmaker.py (make_IPython): make the default ipython
1273 directory be called _ipython under win32, to follow more the
1287 directory be called _ipython under win32, to follow more the
1274 naming peculiarities of that platform (where buggy software like
1288 naming peculiarities of that platform (where buggy software like
1275 Visual Sourcesafe breaks with .named directories). Reported by
1289 Visual Sourcesafe breaks with .named directories). Reported by
1276 Ville Vainio.
1290 Ville Vainio.
1277
1291
1278 2005-02-23 Fernando Perez <fperez@colorado.edu>
1292 2005-02-23 Fernando Perez <fperez@colorado.edu>
1279
1293
1280 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1294 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1281 auto_aliases for win32 which were causing problems. Users can
1295 auto_aliases for win32 which were causing problems. Users can
1282 define the ones they personally like.
1296 define the ones they personally like.
1283
1297
1284 2005-02-21 Fernando Perez <fperez@colorado.edu>
1298 2005-02-21 Fernando Perez <fperez@colorado.edu>
1285
1299
1286 * IPython/Magic.py (magic_time): new magic to time execution of
1300 * IPython/Magic.py (magic_time): new magic to time execution of
1287 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1301 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1288
1302
1289 2005-02-19 Fernando Perez <fperez@colorado.edu>
1303 2005-02-19 Fernando Perez <fperez@colorado.edu>
1290
1304
1291 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1305 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1292 into keys (for prompts, for example).
1306 into keys (for prompts, for example).
1293
1307
1294 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1308 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1295 prompts in case users want them. This introduces a small behavior
1309 prompts in case users want them. This introduces a small behavior
1296 change: ipython does not automatically add a space to all prompts
1310 change: ipython does not automatically add a space to all prompts
1297 anymore. To get the old prompts with a space, users should add it
1311 anymore. To get the old prompts with a space, users should add it
1298 manually to their ipythonrc file, so for example prompt_in1 should
1312 manually to their ipythonrc file, so for example prompt_in1 should
1299 now read 'In [\#]: ' instead of 'In [\#]:'.
1313 now read 'In [\#]: ' instead of 'In [\#]:'.
1300 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1314 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1301 file) to control left-padding of secondary prompts.
1315 file) to control left-padding of secondary prompts.
1302
1316
1303 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1317 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1304 the profiler can't be imported. Fix for Debian, which removed
1318 the profiler can't be imported. Fix for Debian, which removed
1305 profile.py because of License issues. I applied a slightly
1319 profile.py because of License issues. I applied a slightly
1306 modified version of the original Debian patch at
1320 modified version of the original Debian patch at
1307 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1321 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1308
1322
1309 2005-02-17 Fernando Perez <fperez@colorado.edu>
1323 2005-02-17 Fernando Perez <fperez@colorado.edu>
1310
1324
1311 * IPython/genutils.py (native_line_ends): Fix bug which would
1325 * IPython/genutils.py (native_line_ends): Fix bug which would
1312 cause improper line-ends under win32 b/c I was not opening files
1326 cause improper line-ends under win32 b/c I was not opening files
1313 in binary mode. Bug report and fix thanks to Ville.
1327 in binary mode. Bug report and fix thanks to Ville.
1314
1328
1315 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1329 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1316 trying to catch spurious foo[1] autocalls. My fix actually broke
1330 trying to catch spurious foo[1] autocalls. My fix actually broke
1317 ',/' autoquote/call with explicit escape (bad regexp).
1331 ',/' autoquote/call with explicit escape (bad regexp).
1318
1332
1319 2005-02-15 *** Released version 0.6.11
1333 2005-02-15 *** Released version 0.6.11
1320
1334
1321 2005-02-14 Fernando Perez <fperez@colorado.edu>
1335 2005-02-14 Fernando Perez <fperez@colorado.edu>
1322
1336
1323 * IPython/background_jobs.py: New background job management
1337 * IPython/background_jobs.py: New background job management
1324 subsystem. This is implemented via a new set of classes, and
1338 subsystem. This is implemented via a new set of classes, and
1325 IPython now provides a builtin 'jobs' object for background job
1339 IPython now provides a builtin 'jobs' object for background job
1326 execution. A convenience %bg magic serves as a lightweight
1340 execution. A convenience %bg magic serves as a lightweight
1327 frontend for starting the more common type of calls. This was
1341 frontend for starting the more common type of calls. This was
1328 inspired by discussions with B. Granger and the BackgroundCommand
1342 inspired by discussions with B. Granger and the BackgroundCommand
1329 class described in the book Python Scripting for Computational
1343 class described in the book Python Scripting for Computational
1330 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1344 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1331 (although ultimately no code from this text was used, as IPython's
1345 (although ultimately no code from this text was used, as IPython's
1332 system is a separate implementation).
1346 system is a separate implementation).
1333
1347
1334 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1348 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1335 to control the completion of single/double underscore names
1349 to control the completion of single/double underscore names
1336 separately. As documented in the example ipytonrc file, the
1350 separately. As documented in the example ipytonrc file, the
1337 readline_omit__names variable can now be set to 2, to omit even
1351 readline_omit__names variable can now be set to 2, to omit even
1338 single underscore names. Thanks to a patch by Brian Wong
1352 single underscore names. Thanks to a patch by Brian Wong
1339 <BrianWong-AT-AirgoNetworks.Com>.
1353 <BrianWong-AT-AirgoNetworks.Com>.
1340 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1354 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1341 be autocalled as foo([1]) if foo were callable. A problem for
1355 be autocalled as foo([1]) if foo were callable. A problem for
1342 things which are both callable and implement __getitem__.
1356 things which are both callable and implement __getitem__.
1343 (init_readline): Fix autoindentation for win32. Thanks to a patch
1357 (init_readline): Fix autoindentation for win32. Thanks to a patch
1344 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1358 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1345
1359
1346 2005-02-12 Fernando Perez <fperez@colorado.edu>
1360 2005-02-12 Fernando Perez <fperez@colorado.edu>
1347
1361
1348 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1362 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1349 which I had written long ago to sort out user error messages which
1363 which I had written long ago to sort out user error messages which
1350 may occur during startup. This seemed like a good idea initially,
1364 may occur during startup. This seemed like a good idea initially,
1351 but it has proven a disaster in retrospect. I don't want to
1365 but it has proven a disaster in retrospect. I don't want to
1352 change much code for now, so my fix is to set the internal 'debug'
1366 change much code for now, so my fix is to set the internal 'debug'
1353 flag to true everywhere, whose only job was precisely to control
1367 flag to true everywhere, whose only job was precisely to control
1354 this subsystem. This closes issue 28 (as well as avoiding all
1368 this subsystem. This closes issue 28 (as well as avoiding all
1355 sorts of strange hangups which occur from time to time).
1369 sorts of strange hangups which occur from time to time).
1356
1370
1357 2005-02-07 Fernando Perez <fperez@colorado.edu>
1371 2005-02-07 Fernando Perez <fperez@colorado.edu>
1358
1372
1359 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1373 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1360 previous call produced a syntax error.
1374 previous call produced a syntax error.
1361
1375
1362 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1376 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1363 classes without constructor.
1377 classes without constructor.
1364
1378
1365 2005-02-06 Fernando Perez <fperez@colorado.edu>
1379 2005-02-06 Fernando Perez <fperez@colorado.edu>
1366
1380
1367 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1381 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1368 completions with the results of each matcher, so we return results
1382 completions with the results of each matcher, so we return results
1369 to the user from all namespaces. This breaks with ipython
1383 to the user from all namespaces. This breaks with ipython
1370 tradition, but I think it's a nicer behavior. Now you get all
1384 tradition, but I think it's a nicer behavior. Now you get all
1371 possible completions listed, from all possible namespaces (python,
1385 possible completions listed, from all possible namespaces (python,
1372 filesystem, magics...) After a request by John Hunter
1386 filesystem, magics...) After a request by John Hunter
1373 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1387 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1374
1388
1375 2005-02-05 Fernando Perez <fperez@colorado.edu>
1389 2005-02-05 Fernando Perez <fperez@colorado.edu>
1376
1390
1377 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1391 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1378 the call had quote characters in it (the quotes were stripped).
1392 the call had quote characters in it (the quotes were stripped).
1379
1393
1380 2005-01-31 Fernando Perez <fperez@colorado.edu>
1394 2005-01-31 Fernando Perez <fperez@colorado.edu>
1381
1395
1382 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1396 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1383 Itpl.itpl() to make the code more robust against psyco
1397 Itpl.itpl() to make the code more robust against psyco
1384 optimizations.
1398 optimizations.
1385
1399
1386 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1400 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1387 of causing an exception. Quicker, cleaner.
1401 of causing an exception. Quicker, cleaner.
1388
1402
1389 2005-01-28 Fernando Perez <fperez@colorado.edu>
1403 2005-01-28 Fernando Perez <fperez@colorado.edu>
1390
1404
1391 * scripts/ipython_win_post_install.py (install): hardcode
1405 * scripts/ipython_win_post_install.py (install): hardcode
1392 sys.prefix+'python.exe' as the executable path. It turns out that
1406 sys.prefix+'python.exe' as the executable path. It turns out that
1393 during the post-installation run, sys.executable resolves to the
1407 during the post-installation run, sys.executable resolves to the
1394 name of the binary installer! I should report this as a distutils
1408 name of the binary installer! I should report this as a distutils
1395 bug, I think. I updated the .10 release with this tiny fix, to
1409 bug, I think. I updated the .10 release with this tiny fix, to
1396 avoid annoying the lists further.
1410 avoid annoying the lists further.
1397
1411
1398 2005-01-27 *** Released version 0.6.10
1412 2005-01-27 *** Released version 0.6.10
1399
1413
1400 2005-01-27 Fernando Perez <fperez@colorado.edu>
1414 2005-01-27 Fernando Perez <fperez@colorado.edu>
1401
1415
1402 * IPython/numutils.py (norm): Added 'inf' as optional name for
1416 * IPython/numutils.py (norm): Added 'inf' as optional name for
1403 L-infinity norm, included references to mathworld.com for vector
1417 L-infinity norm, included references to mathworld.com for vector
1404 norm definitions.
1418 norm definitions.
1405 (amin/amax): added amin/amax for array min/max. Similar to what
1419 (amin/amax): added amin/amax for array min/max. Similar to what
1406 pylab ships with after the recent reorganization of names.
1420 pylab ships with after the recent reorganization of names.
1407 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1421 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1408
1422
1409 * ipython.el: committed Alex's recent fixes and improvements.
1423 * ipython.el: committed Alex's recent fixes and improvements.
1410 Tested with python-mode from CVS, and it looks excellent. Since
1424 Tested with python-mode from CVS, and it looks excellent. Since
1411 python-mode hasn't released anything in a while, I'm temporarily
1425 python-mode hasn't released anything in a while, I'm temporarily
1412 putting a copy of today's CVS (v 4.70) of python-mode in:
1426 putting a copy of today's CVS (v 4.70) of python-mode in:
1413 http://ipython.scipy.org/tmp/python-mode.el
1427 http://ipython.scipy.org/tmp/python-mode.el
1414
1428
1415 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1429 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1416 sys.executable for the executable name, instead of assuming it's
1430 sys.executable for the executable name, instead of assuming it's
1417 called 'python.exe' (the post-installer would have produced broken
1431 called 'python.exe' (the post-installer would have produced broken
1418 setups on systems with a differently named python binary).
1432 setups on systems with a differently named python binary).
1419
1433
1420 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1434 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1421 references to os.linesep, to make the code more
1435 references to os.linesep, to make the code more
1422 platform-independent. This is also part of the win32 coloring
1436 platform-independent. This is also part of the win32 coloring
1423 fixes.
1437 fixes.
1424
1438
1425 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1439 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1426 lines, which actually cause coloring bugs because the length of
1440 lines, which actually cause coloring bugs because the length of
1427 the line is very difficult to correctly compute with embedded
1441 the line is very difficult to correctly compute with embedded
1428 escapes. This was the source of all the coloring problems under
1442 escapes. This was the source of all the coloring problems under
1429 Win32. I think that _finally_, Win32 users have a properly
1443 Win32. I think that _finally_, Win32 users have a properly
1430 working ipython in all respects. This would never have happened
1444 working ipython in all respects. This would never have happened
1431 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1445 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1432
1446
1433 2005-01-26 *** Released version 0.6.9
1447 2005-01-26 *** Released version 0.6.9
1434
1448
1435 2005-01-25 Fernando Perez <fperez@colorado.edu>
1449 2005-01-25 Fernando Perez <fperez@colorado.edu>
1436
1450
1437 * setup.py: finally, we have a true Windows installer, thanks to
1451 * setup.py: finally, we have a true Windows installer, thanks to
1438 the excellent work of Viktor Ransmayr
1452 the excellent work of Viktor Ransmayr
1439 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1453 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1440 Windows users. The setup routine is quite a bit cleaner thanks to
1454 Windows users. The setup routine is quite a bit cleaner thanks to
1441 this, and the post-install script uses the proper functions to
1455 this, and the post-install script uses the proper functions to
1442 allow a clean de-installation using the standard Windows Control
1456 allow a clean de-installation using the standard Windows Control
1443 Panel.
1457 Panel.
1444
1458
1445 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1459 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1446 environment variable under all OSes (including win32) if
1460 environment variable under all OSes (including win32) if
1447 available. This will give consistency to win32 users who have set
1461 available. This will give consistency to win32 users who have set
1448 this variable for any reason. If os.environ['HOME'] fails, the
1462 this variable for any reason. If os.environ['HOME'] fails, the
1449 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1463 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1450
1464
1451 2005-01-24 Fernando Perez <fperez@colorado.edu>
1465 2005-01-24 Fernando Perez <fperez@colorado.edu>
1452
1466
1453 * IPython/numutils.py (empty_like): add empty_like(), similar to
1467 * IPython/numutils.py (empty_like): add empty_like(), similar to
1454 zeros_like() but taking advantage of the new empty() Numeric routine.
1468 zeros_like() but taking advantage of the new empty() Numeric routine.
1455
1469
1456 2005-01-23 *** Released version 0.6.8
1470 2005-01-23 *** Released version 0.6.8
1457
1471
1458 2005-01-22 Fernando Perez <fperez@colorado.edu>
1472 2005-01-22 Fernando Perez <fperez@colorado.edu>
1459
1473
1460 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1474 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1461 automatic show() calls. After discussing things with JDH, it
1475 automatic show() calls. After discussing things with JDH, it
1462 turns out there are too many corner cases where this can go wrong.
1476 turns out there are too many corner cases where this can go wrong.
1463 It's best not to try to be 'too smart', and simply have ipython
1477 It's best not to try to be 'too smart', and simply have ipython
1464 reproduce as much as possible the default behavior of a normal
1478 reproduce as much as possible the default behavior of a normal
1465 python shell.
1479 python shell.
1466
1480
1467 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1481 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1468 line-splitting regexp and _prefilter() to avoid calling getattr()
1482 line-splitting regexp and _prefilter() to avoid calling getattr()
1469 on assignments. This closes
1483 on assignments. This closes
1470 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1484 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1471 readline uses getattr(), so a simple <TAB> keypress is still
1485 readline uses getattr(), so a simple <TAB> keypress is still
1472 enough to trigger getattr() calls on an object.
1486 enough to trigger getattr() calls on an object.
1473
1487
1474 2005-01-21 Fernando Perez <fperez@colorado.edu>
1488 2005-01-21 Fernando Perez <fperez@colorado.edu>
1475
1489
1476 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1490 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1477 docstring under pylab so it doesn't mask the original.
1491 docstring under pylab so it doesn't mask the original.
1478
1492
1479 2005-01-21 *** Released version 0.6.7
1493 2005-01-21 *** Released version 0.6.7
1480
1494
1481 2005-01-21 Fernando Perez <fperez@colorado.edu>
1495 2005-01-21 Fernando Perez <fperez@colorado.edu>
1482
1496
1483 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1497 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1484 signal handling for win32 users in multithreaded mode.
1498 signal handling for win32 users in multithreaded mode.
1485
1499
1486 2005-01-17 Fernando Perez <fperez@colorado.edu>
1500 2005-01-17 Fernando Perez <fperez@colorado.edu>
1487
1501
1488 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1502 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1489 instances with no __init__. After a crash report by Norbert Nemec
1503 instances with no __init__. After a crash report by Norbert Nemec
1490 <Norbert-AT-nemec-online.de>.
1504 <Norbert-AT-nemec-online.de>.
1491
1505
1492 2005-01-14 Fernando Perez <fperez@colorado.edu>
1506 2005-01-14 Fernando Perez <fperez@colorado.edu>
1493
1507
1494 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1508 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1495 names for verbose exceptions, when multiple dotted names and the
1509 names for verbose exceptions, when multiple dotted names and the
1496 'parent' object were present on the same line.
1510 'parent' object were present on the same line.
1497
1511
1498 2005-01-11 Fernando Perez <fperez@colorado.edu>
1512 2005-01-11 Fernando Perez <fperez@colorado.edu>
1499
1513
1500 * IPython/genutils.py (flag_calls): new utility to trap and flag
1514 * IPython/genutils.py (flag_calls): new utility to trap and flag
1501 calls in functions. I need it to clean up matplotlib support.
1515 calls in functions. I need it to clean up matplotlib support.
1502 Also removed some deprecated code in genutils.
1516 Also removed some deprecated code in genutils.
1503
1517
1504 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1518 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1505 that matplotlib scripts called with %run, which don't call show()
1519 that matplotlib scripts called with %run, which don't call show()
1506 themselves, still have their plotting windows open.
1520 themselves, still have their plotting windows open.
1507
1521
1508 2005-01-05 Fernando Perez <fperez@colorado.edu>
1522 2005-01-05 Fernando Perez <fperez@colorado.edu>
1509
1523
1510 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1524 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1511 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1525 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1512
1526
1513 2004-12-19 Fernando Perez <fperez@colorado.edu>
1527 2004-12-19 Fernando Perez <fperez@colorado.edu>
1514
1528
1515 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1529 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1516 parent_runcode, which was an eyesore. The same result can be
1530 parent_runcode, which was an eyesore. The same result can be
1517 obtained with Python's regular superclass mechanisms.
1531 obtained with Python's regular superclass mechanisms.
1518
1532
1519 2004-12-17 Fernando Perez <fperez@colorado.edu>
1533 2004-12-17 Fernando Perez <fperez@colorado.edu>
1520
1534
1521 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1535 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1522 reported by Prabhu.
1536 reported by Prabhu.
1523 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1537 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1524 sys.stderr) instead of explicitly calling sys.stderr. This helps
1538 sys.stderr) instead of explicitly calling sys.stderr. This helps
1525 maintain our I/O abstractions clean, for future GUI embeddings.
1539 maintain our I/O abstractions clean, for future GUI embeddings.
1526
1540
1527 * IPython/genutils.py (info): added new utility for sys.stderr
1541 * IPython/genutils.py (info): added new utility for sys.stderr
1528 unified info message handling (thin wrapper around warn()).
1542 unified info message handling (thin wrapper around warn()).
1529
1543
1530 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1544 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1531 composite (dotted) names on verbose exceptions.
1545 composite (dotted) names on verbose exceptions.
1532 (VerboseTB.nullrepr): harden against another kind of errors which
1546 (VerboseTB.nullrepr): harden against another kind of errors which
1533 Python's inspect module can trigger, and which were crashing
1547 Python's inspect module can trigger, and which were crashing
1534 IPython. Thanks to a report by Marco Lombardi
1548 IPython. Thanks to a report by Marco Lombardi
1535 <mlombard-AT-ma010192.hq.eso.org>.
1549 <mlombard-AT-ma010192.hq.eso.org>.
1536
1550
1537 2004-12-13 *** Released version 0.6.6
1551 2004-12-13 *** Released version 0.6.6
1538
1552
1539 2004-12-12 Fernando Perez <fperez@colorado.edu>
1553 2004-12-12 Fernando Perez <fperez@colorado.edu>
1540
1554
1541 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1555 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1542 generated by pygtk upon initialization if it was built without
1556 generated by pygtk upon initialization if it was built without
1543 threads (for matplotlib users). After a crash reported by
1557 threads (for matplotlib users). After a crash reported by
1544 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1558 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1545
1559
1546 * IPython/ipmaker.py (make_IPython): fix small bug in the
1560 * IPython/ipmaker.py (make_IPython): fix small bug in the
1547 import_some parameter for multiple imports.
1561 import_some parameter for multiple imports.
1548
1562
1549 * IPython/iplib.py (ipmagic): simplified the interface of
1563 * IPython/iplib.py (ipmagic): simplified the interface of
1550 ipmagic() to take a single string argument, just as it would be
1564 ipmagic() to take a single string argument, just as it would be
1551 typed at the IPython cmd line.
1565 typed at the IPython cmd line.
1552 (ipalias): Added new ipalias() with an interface identical to
1566 (ipalias): Added new ipalias() with an interface identical to
1553 ipmagic(). This completes exposing a pure python interface to the
1567 ipmagic(). This completes exposing a pure python interface to the
1554 alias and magic system, which can be used in loops or more complex
1568 alias and magic system, which can be used in loops or more complex
1555 code where IPython's automatic line mangling is not active.
1569 code where IPython's automatic line mangling is not active.
1556
1570
1557 * IPython/genutils.py (timing): changed interface of timing to
1571 * IPython/genutils.py (timing): changed interface of timing to
1558 simply run code once, which is the most common case. timings()
1572 simply run code once, which is the most common case. timings()
1559 remains unchanged, for the cases where you want multiple runs.
1573 remains unchanged, for the cases where you want multiple runs.
1560
1574
1561 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1575 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1562 bug where Python2.2 crashes with exec'ing code which does not end
1576 bug where Python2.2 crashes with exec'ing code which does not end
1563 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1577 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1564 before.
1578 before.
1565
1579
1566 2004-12-10 Fernando Perez <fperez@colorado.edu>
1580 2004-12-10 Fernando Perez <fperez@colorado.edu>
1567
1581
1568 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1582 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1569 -t to -T, to accomodate the new -t flag in %run (the %run and
1583 -t to -T, to accomodate the new -t flag in %run (the %run and
1570 %prun options are kind of intermixed, and it's not easy to change
1584 %prun options are kind of intermixed, and it's not easy to change
1571 this with the limitations of python's getopt).
1585 this with the limitations of python's getopt).
1572
1586
1573 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1587 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1574 the execution of scripts. It's not as fine-tuned as timeit.py,
1588 the execution of scripts. It's not as fine-tuned as timeit.py,
1575 but it works from inside ipython (and under 2.2, which lacks
1589 but it works from inside ipython (and under 2.2, which lacks
1576 timeit.py). Optionally a number of runs > 1 can be given for
1590 timeit.py). Optionally a number of runs > 1 can be given for
1577 timing very short-running code.
1591 timing very short-running code.
1578
1592
1579 * IPython/genutils.py (uniq_stable): new routine which returns a
1593 * IPython/genutils.py (uniq_stable): new routine which returns a
1580 list of unique elements in any iterable, but in stable order of
1594 list of unique elements in any iterable, but in stable order of
1581 appearance. I needed this for the ultraTB fixes, and it's a handy
1595 appearance. I needed this for the ultraTB fixes, and it's a handy
1582 utility.
1596 utility.
1583
1597
1584 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1598 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1585 dotted names in Verbose exceptions. This had been broken since
1599 dotted names in Verbose exceptions. This had been broken since
1586 the very start, now x.y will properly be printed in a Verbose
1600 the very start, now x.y will properly be printed in a Verbose
1587 traceback, instead of x being shown and y appearing always as an
1601 traceback, instead of x being shown and y appearing always as an
1588 'undefined global'. Getting this to work was a bit tricky,
1602 'undefined global'. Getting this to work was a bit tricky,
1589 because by default python tokenizers are stateless. Saved by
1603 because by default python tokenizers are stateless. Saved by
1590 python's ability to easily add a bit of state to an arbitrary
1604 python's ability to easily add a bit of state to an arbitrary
1591 function (without needing to build a full-blown callable object).
1605 function (without needing to build a full-blown callable object).
1592
1606
1593 Also big cleanup of this code, which had horrendous runtime
1607 Also big cleanup of this code, which had horrendous runtime
1594 lookups of zillions of attributes for colorization. Moved all
1608 lookups of zillions of attributes for colorization. Moved all
1595 this code into a few templates, which make it cleaner and quicker.
1609 this code into a few templates, which make it cleaner and quicker.
1596
1610
1597 Printout quality was also improved for Verbose exceptions: one
1611 Printout quality was also improved for Verbose exceptions: one
1598 variable per line, and memory addresses are printed (this can be
1612 variable per line, and memory addresses are printed (this can be
1599 quite handy in nasty debugging situations, which is what Verbose
1613 quite handy in nasty debugging situations, which is what Verbose
1600 is for).
1614 is for).
1601
1615
1602 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1616 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1603 the command line as scripts to be loaded by embedded instances.
1617 the command line as scripts to be loaded by embedded instances.
1604 Doing so has the potential for an infinite recursion if there are
1618 Doing so has the potential for an infinite recursion if there are
1605 exceptions thrown in the process. This fixes a strange crash
1619 exceptions thrown in the process. This fixes a strange crash
1606 reported by Philippe MULLER <muller-AT-irit.fr>.
1620 reported by Philippe MULLER <muller-AT-irit.fr>.
1607
1621
1608 2004-12-09 Fernando Perez <fperez@colorado.edu>
1622 2004-12-09 Fernando Perez <fperez@colorado.edu>
1609
1623
1610 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1624 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1611 to reflect new names in matplotlib, which now expose the
1625 to reflect new names in matplotlib, which now expose the
1612 matlab-compatible interface via a pylab module instead of the
1626 matlab-compatible interface via a pylab module instead of the
1613 'matlab' name. The new code is backwards compatible, so users of
1627 'matlab' name. The new code is backwards compatible, so users of
1614 all matplotlib versions are OK. Patch by J. Hunter.
1628 all matplotlib versions are OK. Patch by J. Hunter.
1615
1629
1616 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1630 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1617 of __init__ docstrings for instances (class docstrings are already
1631 of __init__ docstrings for instances (class docstrings are already
1618 automatically printed). Instances with customized docstrings
1632 automatically printed). Instances with customized docstrings
1619 (indep. of the class) are also recognized and all 3 separate
1633 (indep. of the class) are also recognized and all 3 separate
1620 docstrings are printed (instance, class, constructor). After some
1634 docstrings are printed (instance, class, constructor). After some
1621 comments/suggestions by J. Hunter.
1635 comments/suggestions by J. Hunter.
1622
1636
1623 2004-12-05 Fernando Perez <fperez@colorado.edu>
1637 2004-12-05 Fernando Perez <fperez@colorado.edu>
1624
1638
1625 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1639 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1626 warnings when tab-completion fails and triggers an exception.
1640 warnings when tab-completion fails and triggers an exception.
1627
1641
1628 2004-12-03 Fernando Perez <fperez@colorado.edu>
1642 2004-12-03 Fernando Perez <fperez@colorado.edu>
1629
1643
1630 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1644 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1631 be triggered when using 'run -p'. An incorrect option flag was
1645 be triggered when using 'run -p'. An incorrect option flag was
1632 being set ('d' instead of 'D').
1646 being set ('d' instead of 'D').
1633 (manpage): fix missing escaped \- sign.
1647 (manpage): fix missing escaped \- sign.
1634
1648
1635 2004-11-30 *** Released version 0.6.5
1649 2004-11-30 *** Released version 0.6.5
1636
1650
1637 2004-11-30 Fernando Perez <fperez@colorado.edu>
1651 2004-11-30 Fernando Perez <fperez@colorado.edu>
1638
1652
1639 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1653 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1640 setting with -d option.
1654 setting with -d option.
1641
1655
1642 * setup.py (docfiles): Fix problem where the doc glob I was using
1656 * setup.py (docfiles): Fix problem where the doc glob I was using
1643 was COMPLETELY BROKEN. It was giving the right files by pure
1657 was COMPLETELY BROKEN. It was giving the right files by pure
1644 accident, but failed once I tried to include ipython.el. Note:
1658 accident, but failed once I tried to include ipython.el. Note:
1645 glob() does NOT allow you to do exclusion on multiple endings!
1659 glob() does NOT allow you to do exclusion on multiple endings!
1646
1660
1647 2004-11-29 Fernando Perez <fperez@colorado.edu>
1661 2004-11-29 Fernando Perez <fperez@colorado.edu>
1648
1662
1649 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1663 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1650 the manpage as the source. Better formatting & consistency.
1664 the manpage as the source. Better formatting & consistency.
1651
1665
1652 * IPython/Magic.py (magic_run): Added new -d option, to run
1666 * IPython/Magic.py (magic_run): Added new -d option, to run
1653 scripts under the control of the python pdb debugger. Note that
1667 scripts under the control of the python pdb debugger. Note that
1654 this required changing the %prun option -d to -D, to avoid a clash
1668 this required changing the %prun option -d to -D, to avoid a clash
1655 (since %run must pass options to %prun, and getopt is too dumb to
1669 (since %run must pass options to %prun, and getopt is too dumb to
1656 handle options with string values with embedded spaces). Thanks
1670 handle options with string values with embedded spaces). Thanks
1657 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1671 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1658 (magic_who_ls): added type matching to %who and %whos, so that one
1672 (magic_who_ls): added type matching to %who and %whos, so that one
1659 can filter their output to only include variables of certain
1673 can filter their output to only include variables of certain
1660 types. Another suggestion by Matthew.
1674 types. Another suggestion by Matthew.
1661 (magic_whos): Added memory summaries in kb and Mb for arrays.
1675 (magic_whos): Added memory summaries in kb and Mb for arrays.
1662 (magic_who): Improve formatting (break lines every 9 vars).
1676 (magic_who): Improve formatting (break lines every 9 vars).
1663
1677
1664 2004-11-28 Fernando Perez <fperez@colorado.edu>
1678 2004-11-28 Fernando Perez <fperez@colorado.edu>
1665
1679
1666 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1680 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1667 cache when empty lines were present.
1681 cache when empty lines were present.
1668
1682
1669 2004-11-24 Fernando Perez <fperez@colorado.edu>
1683 2004-11-24 Fernando Perez <fperez@colorado.edu>
1670
1684
1671 * IPython/usage.py (__doc__): document the re-activated threading
1685 * IPython/usage.py (__doc__): document the re-activated threading
1672 options for WX and GTK.
1686 options for WX and GTK.
1673
1687
1674 2004-11-23 Fernando Perez <fperez@colorado.edu>
1688 2004-11-23 Fernando Perez <fperez@colorado.edu>
1675
1689
1676 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1690 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1677 the -wthread and -gthread options, along with a new -tk one to try
1691 the -wthread and -gthread options, along with a new -tk one to try
1678 and coordinate Tk threading with wx/gtk. The tk support is very
1692 and coordinate Tk threading with wx/gtk. The tk support is very
1679 platform dependent, since it seems to require Tcl and Tk to be
1693 platform dependent, since it seems to require Tcl and Tk to be
1680 built with threads (Fedora1/2 appears NOT to have it, but in
1694 built with threads (Fedora1/2 appears NOT to have it, but in
1681 Prabhu's Debian boxes it works OK). But even with some Tk
1695 Prabhu's Debian boxes it works OK). But even with some Tk
1682 limitations, this is a great improvement.
1696 limitations, this is a great improvement.
1683
1697
1684 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1698 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1685 info in user prompts. Patch by Prabhu.
1699 info in user prompts. Patch by Prabhu.
1686
1700
1687 2004-11-18 Fernando Perez <fperez@colorado.edu>
1701 2004-11-18 Fernando Perez <fperez@colorado.edu>
1688
1702
1689 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1703 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1690 EOFErrors and bail, to avoid infinite loops if a non-terminating
1704 EOFErrors and bail, to avoid infinite loops if a non-terminating
1691 file is fed into ipython. Patch submitted in issue 19 by user,
1705 file is fed into ipython. Patch submitted in issue 19 by user,
1692 many thanks.
1706 many thanks.
1693
1707
1694 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1708 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1695 autoquote/parens in continuation prompts, which can cause lots of
1709 autoquote/parens in continuation prompts, which can cause lots of
1696 problems. Closes roundup issue 20.
1710 problems. Closes roundup issue 20.
1697
1711
1698 2004-11-17 Fernando Perez <fperez@colorado.edu>
1712 2004-11-17 Fernando Perez <fperez@colorado.edu>
1699
1713
1700 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1714 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1701 reported as debian bug #280505. I'm not sure my local changelog
1715 reported as debian bug #280505. I'm not sure my local changelog
1702 entry has the proper debian format (Jack?).
1716 entry has the proper debian format (Jack?).
1703
1717
1704 2004-11-08 *** Released version 0.6.4
1718 2004-11-08 *** Released version 0.6.4
1705
1719
1706 2004-11-08 Fernando Perez <fperez@colorado.edu>
1720 2004-11-08 Fernando Perez <fperez@colorado.edu>
1707
1721
1708 * IPython/iplib.py (init_readline): Fix exit message for Windows
1722 * IPython/iplib.py (init_readline): Fix exit message for Windows
1709 when readline is active. Thanks to a report by Eric Jones
1723 when readline is active. Thanks to a report by Eric Jones
1710 <eric-AT-enthought.com>.
1724 <eric-AT-enthought.com>.
1711
1725
1712 2004-11-07 Fernando Perez <fperez@colorado.edu>
1726 2004-11-07 Fernando Perez <fperez@colorado.edu>
1713
1727
1714 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1728 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1715 sometimes seen by win2k/cygwin users.
1729 sometimes seen by win2k/cygwin users.
1716
1730
1717 2004-11-06 Fernando Perez <fperez@colorado.edu>
1731 2004-11-06 Fernando Perez <fperez@colorado.edu>
1718
1732
1719 * IPython/iplib.py (interact): Change the handling of %Exit from
1733 * IPython/iplib.py (interact): Change the handling of %Exit from
1720 trying to propagate a SystemExit to an internal ipython flag.
1734 trying to propagate a SystemExit to an internal ipython flag.
1721 This is less elegant than using Python's exception mechanism, but
1735 This is less elegant than using Python's exception mechanism, but
1722 I can't get that to work reliably with threads, so under -pylab
1736 I can't get that to work reliably with threads, so under -pylab
1723 %Exit was hanging IPython. Cross-thread exception handling is
1737 %Exit was hanging IPython. Cross-thread exception handling is
1724 really a bitch. Thaks to a bug report by Stephen Walton
1738 really a bitch. Thaks to a bug report by Stephen Walton
1725 <stephen.walton-AT-csun.edu>.
1739 <stephen.walton-AT-csun.edu>.
1726
1740
1727 2004-11-04 Fernando Perez <fperez@colorado.edu>
1741 2004-11-04 Fernando Perez <fperez@colorado.edu>
1728
1742
1729 * IPython/iplib.py (raw_input_original): store a pointer to the
1743 * IPython/iplib.py (raw_input_original): store a pointer to the
1730 true raw_input to harden against code which can modify it
1744 true raw_input to harden against code which can modify it
1731 (wx.py.PyShell does this and would otherwise crash ipython).
1745 (wx.py.PyShell does this and would otherwise crash ipython).
1732 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1746 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1733
1747
1734 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1748 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1735 Ctrl-C problem, which does not mess up the input line.
1749 Ctrl-C problem, which does not mess up the input line.
1736
1750
1737 2004-11-03 Fernando Perez <fperez@colorado.edu>
1751 2004-11-03 Fernando Perez <fperez@colorado.edu>
1738
1752
1739 * IPython/Release.py: Changed licensing to BSD, in all files.
1753 * IPython/Release.py: Changed licensing to BSD, in all files.
1740 (name): lowercase name for tarball/RPM release.
1754 (name): lowercase name for tarball/RPM release.
1741
1755
1742 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1756 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1743 use throughout ipython.
1757 use throughout ipython.
1744
1758
1745 * IPython/Magic.py (Magic._ofind): Switch to using the new
1759 * IPython/Magic.py (Magic._ofind): Switch to using the new
1746 OInspect.getdoc() function.
1760 OInspect.getdoc() function.
1747
1761
1748 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1762 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1749 of the line currently being canceled via Ctrl-C. It's extremely
1763 of the line currently being canceled via Ctrl-C. It's extremely
1750 ugly, but I don't know how to do it better (the problem is one of
1764 ugly, but I don't know how to do it better (the problem is one of
1751 handling cross-thread exceptions).
1765 handling cross-thread exceptions).
1752
1766
1753 2004-10-28 Fernando Perez <fperez@colorado.edu>
1767 2004-10-28 Fernando Perez <fperez@colorado.edu>
1754
1768
1755 * IPython/Shell.py (signal_handler): add signal handlers to trap
1769 * IPython/Shell.py (signal_handler): add signal handlers to trap
1756 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1770 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1757 report by Francesc Alted.
1771 report by Francesc Alted.
1758
1772
1759 2004-10-21 Fernando Perez <fperez@colorado.edu>
1773 2004-10-21 Fernando Perez <fperez@colorado.edu>
1760
1774
1761 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1775 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1762 to % for pysh syntax extensions.
1776 to % for pysh syntax extensions.
1763
1777
1764 2004-10-09 Fernando Perez <fperez@colorado.edu>
1778 2004-10-09 Fernando Perez <fperez@colorado.edu>
1765
1779
1766 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1780 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1767 arrays to print a more useful summary, without calling str(arr).
1781 arrays to print a more useful summary, without calling str(arr).
1768 This avoids the problem of extremely lengthy computations which
1782 This avoids the problem of extremely lengthy computations which
1769 occur if arr is large, and appear to the user as a system lockup
1783 occur if arr is large, and appear to the user as a system lockup
1770 with 100% cpu activity. After a suggestion by Kristian Sandberg
1784 with 100% cpu activity. After a suggestion by Kristian Sandberg
1771 <Kristian.Sandberg@colorado.edu>.
1785 <Kristian.Sandberg@colorado.edu>.
1772 (Magic.__init__): fix bug in global magic escapes not being
1786 (Magic.__init__): fix bug in global magic escapes not being
1773 correctly set.
1787 correctly set.
1774
1788
1775 2004-10-08 Fernando Perez <fperez@colorado.edu>
1789 2004-10-08 Fernando Perez <fperez@colorado.edu>
1776
1790
1777 * IPython/Magic.py (__license__): change to absolute imports of
1791 * IPython/Magic.py (__license__): change to absolute imports of
1778 ipython's own internal packages, to start adapting to the absolute
1792 ipython's own internal packages, to start adapting to the absolute
1779 import requirement of PEP-328.
1793 import requirement of PEP-328.
1780
1794
1781 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1795 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1782 files, and standardize author/license marks through the Release
1796 files, and standardize author/license marks through the Release
1783 module instead of having per/file stuff (except for files with
1797 module instead of having per/file stuff (except for files with
1784 particular licenses, like the MIT/PSF-licensed codes).
1798 particular licenses, like the MIT/PSF-licensed codes).
1785
1799
1786 * IPython/Debugger.py: remove dead code for python 2.1
1800 * IPython/Debugger.py: remove dead code for python 2.1
1787
1801
1788 2004-10-04 Fernando Perez <fperez@colorado.edu>
1802 2004-10-04 Fernando Perez <fperez@colorado.edu>
1789
1803
1790 * IPython/iplib.py (ipmagic): New function for accessing magics
1804 * IPython/iplib.py (ipmagic): New function for accessing magics
1791 via a normal python function call.
1805 via a normal python function call.
1792
1806
1793 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1807 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1794 from '@' to '%', to accomodate the new @decorator syntax of python
1808 from '@' to '%', to accomodate the new @decorator syntax of python
1795 2.4.
1809 2.4.
1796
1810
1797 2004-09-29 Fernando Perez <fperez@colorado.edu>
1811 2004-09-29 Fernando Perez <fperez@colorado.edu>
1798
1812
1799 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1813 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1800 matplotlib.use to prevent running scripts which try to switch
1814 matplotlib.use to prevent running scripts which try to switch
1801 interactive backends from within ipython. This will just crash
1815 interactive backends from within ipython. This will just crash
1802 the python interpreter, so we can't allow it (but a detailed error
1816 the python interpreter, so we can't allow it (but a detailed error
1803 is given to the user).
1817 is given to the user).
1804
1818
1805 2004-09-28 Fernando Perez <fperez@colorado.edu>
1819 2004-09-28 Fernando Perez <fperez@colorado.edu>
1806
1820
1807 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1821 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1808 matplotlib-related fixes so that using @run with non-matplotlib
1822 matplotlib-related fixes so that using @run with non-matplotlib
1809 scripts doesn't pop up spurious plot windows. This requires
1823 scripts doesn't pop up spurious plot windows. This requires
1810 matplotlib >= 0.63, where I had to make some changes as well.
1824 matplotlib >= 0.63, where I had to make some changes as well.
1811
1825
1812 * IPython/ipmaker.py (make_IPython): update version requirement to
1826 * IPython/ipmaker.py (make_IPython): update version requirement to
1813 python 2.2.
1827 python 2.2.
1814
1828
1815 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1829 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1816 banner arg for embedded customization.
1830 banner arg for embedded customization.
1817
1831
1818 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1832 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1819 explicit uses of __IP as the IPython's instance name. Now things
1833 explicit uses of __IP as the IPython's instance name. Now things
1820 are properly handled via the shell.name value. The actual code
1834 are properly handled via the shell.name value. The actual code
1821 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1835 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1822 is much better than before. I'll clean things completely when the
1836 is much better than before. I'll clean things completely when the
1823 magic stuff gets a real overhaul.
1837 magic stuff gets a real overhaul.
1824
1838
1825 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1839 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1826 minor changes to debian dir.
1840 minor changes to debian dir.
1827
1841
1828 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1842 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1829 pointer to the shell itself in the interactive namespace even when
1843 pointer to the shell itself in the interactive namespace even when
1830 a user-supplied dict is provided. This is needed for embedding
1844 a user-supplied dict is provided. This is needed for embedding
1831 purposes (found by tests with Michel Sanner).
1845 purposes (found by tests with Michel Sanner).
1832
1846
1833 2004-09-27 Fernando Perez <fperez@colorado.edu>
1847 2004-09-27 Fernando Perez <fperez@colorado.edu>
1834
1848
1835 * IPython/UserConfig/ipythonrc: remove []{} from
1849 * IPython/UserConfig/ipythonrc: remove []{} from
1836 readline_remove_delims, so that things like [modname.<TAB> do
1850 readline_remove_delims, so that things like [modname.<TAB> do
1837 proper completion. This disables [].TAB, but that's a less common
1851 proper completion. This disables [].TAB, but that's a less common
1838 case than module names in list comprehensions, for example.
1852 case than module names in list comprehensions, for example.
1839 Thanks to a report by Andrea Riciputi.
1853 Thanks to a report by Andrea Riciputi.
1840
1854
1841 2004-09-09 Fernando Perez <fperez@colorado.edu>
1855 2004-09-09 Fernando Perez <fperez@colorado.edu>
1842
1856
1843 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1857 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1844 blocking problems in win32 and osx. Fix by John.
1858 blocking problems in win32 and osx. Fix by John.
1845
1859
1846 2004-09-08 Fernando Perez <fperez@colorado.edu>
1860 2004-09-08 Fernando Perez <fperez@colorado.edu>
1847
1861
1848 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1862 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1849 for Win32 and OSX. Fix by John Hunter.
1863 for Win32 and OSX. Fix by John Hunter.
1850
1864
1851 2004-08-30 *** Released version 0.6.3
1865 2004-08-30 *** Released version 0.6.3
1852
1866
1853 2004-08-30 Fernando Perez <fperez@colorado.edu>
1867 2004-08-30 Fernando Perez <fperez@colorado.edu>
1854
1868
1855 * setup.py (isfile): Add manpages to list of dependent files to be
1869 * setup.py (isfile): Add manpages to list of dependent files to be
1856 updated.
1870 updated.
1857
1871
1858 2004-08-27 Fernando Perez <fperez@colorado.edu>
1872 2004-08-27 Fernando Perez <fperez@colorado.edu>
1859
1873
1860 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1874 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1861 for now. They don't really work with standalone WX/GTK code
1875 for now. They don't really work with standalone WX/GTK code
1862 (though matplotlib IS working fine with both of those backends).
1876 (though matplotlib IS working fine with both of those backends).
1863 This will neeed much more testing. I disabled most things with
1877 This will neeed much more testing. I disabled most things with
1864 comments, so turning it back on later should be pretty easy.
1878 comments, so turning it back on later should be pretty easy.
1865
1879
1866 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1880 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1867 autocalling of expressions like r'foo', by modifying the line
1881 autocalling of expressions like r'foo', by modifying the line
1868 split regexp. Closes
1882 split regexp. Closes
1869 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1883 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1870 Riley <ipythonbugs-AT-sabi.net>.
1884 Riley <ipythonbugs-AT-sabi.net>.
1871 (InteractiveShell.mainloop): honor --nobanner with banner
1885 (InteractiveShell.mainloop): honor --nobanner with banner
1872 extensions.
1886 extensions.
1873
1887
1874 * IPython/Shell.py: Significant refactoring of all classes, so
1888 * IPython/Shell.py: Significant refactoring of all classes, so
1875 that we can really support ALL matplotlib backends and threading
1889 that we can really support ALL matplotlib backends and threading
1876 models (John spotted a bug with Tk which required this). Now we
1890 models (John spotted a bug with Tk which required this). Now we
1877 should support single-threaded, WX-threads and GTK-threads, both
1891 should support single-threaded, WX-threads and GTK-threads, both
1878 for generic code and for matplotlib.
1892 for generic code and for matplotlib.
1879
1893
1880 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1894 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1881 -pylab, to simplify things for users. Will also remove the pylab
1895 -pylab, to simplify things for users. Will also remove the pylab
1882 profile, since now all of matplotlib configuration is directly
1896 profile, since now all of matplotlib configuration is directly
1883 handled here. This also reduces startup time.
1897 handled here. This also reduces startup time.
1884
1898
1885 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1899 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1886 shell wasn't being correctly called. Also in IPShellWX.
1900 shell wasn't being correctly called. Also in IPShellWX.
1887
1901
1888 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1902 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1889 fine-tune banner.
1903 fine-tune banner.
1890
1904
1891 * IPython/numutils.py (spike): Deprecate these spike functions,
1905 * IPython/numutils.py (spike): Deprecate these spike functions,
1892 delete (long deprecated) gnuplot_exec handler.
1906 delete (long deprecated) gnuplot_exec handler.
1893
1907
1894 2004-08-26 Fernando Perez <fperez@colorado.edu>
1908 2004-08-26 Fernando Perez <fperez@colorado.edu>
1895
1909
1896 * ipython.1: Update for threading options, plus some others which
1910 * ipython.1: Update for threading options, plus some others which
1897 were missing.
1911 were missing.
1898
1912
1899 * IPython/ipmaker.py (__call__): Added -wthread option for
1913 * IPython/ipmaker.py (__call__): Added -wthread option for
1900 wxpython thread handling. Make sure threading options are only
1914 wxpython thread handling. Make sure threading options are only
1901 valid at the command line.
1915 valid at the command line.
1902
1916
1903 * scripts/ipython: moved shell selection into a factory function
1917 * scripts/ipython: moved shell selection into a factory function
1904 in Shell.py, to keep the starter script to a minimum.
1918 in Shell.py, to keep the starter script to a minimum.
1905
1919
1906 2004-08-25 Fernando Perez <fperez@colorado.edu>
1920 2004-08-25 Fernando Perez <fperez@colorado.edu>
1907
1921
1908 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1922 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1909 John. Along with some recent changes he made to matplotlib, the
1923 John. Along with some recent changes he made to matplotlib, the
1910 next versions of both systems should work very well together.
1924 next versions of both systems should work very well together.
1911
1925
1912 2004-08-24 Fernando Perez <fperez@colorado.edu>
1926 2004-08-24 Fernando Perez <fperez@colorado.edu>
1913
1927
1914 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1928 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1915 tried to switch the profiling to using hotshot, but I'm getting
1929 tried to switch the profiling to using hotshot, but I'm getting
1916 strange errors from prof.runctx() there. I may be misreading the
1930 strange errors from prof.runctx() there. I may be misreading the
1917 docs, but it looks weird. For now the profiling code will
1931 docs, but it looks weird. For now the profiling code will
1918 continue to use the standard profiler.
1932 continue to use the standard profiler.
1919
1933
1920 2004-08-23 Fernando Perez <fperez@colorado.edu>
1934 2004-08-23 Fernando Perez <fperez@colorado.edu>
1921
1935
1922 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1936 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1923 threaded shell, by John Hunter. It's not quite ready yet, but
1937 threaded shell, by John Hunter. It's not quite ready yet, but
1924 close.
1938 close.
1925
1939
1926 2004-08-22 Fernando Perez <fperez@colorado.edu>
1940 2004-08-22 Fernando Perez <fperez@colorado.edu>
1927
1941
1928 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1942 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1929 in Magic and ultraTB.
1943 in Magic and ultraTB.
1930
1944
1931 * ipython.1: document threading options in manpage.
1945 * ipython.1: document threading options in manpage.
1932
1946
1933 * scripts/ipython: Changed name of -thread option to -gthread,
1947 * scripts/ipython: Changed name of -thread option to -gthread,
1934 since this is GTK specific. I want to leave the door open for a
1948 since this is GTK specific. I want to leave the door open for a
1935 -wthread option for WX, which will most likely be necessary. This
1949 -wthread option for WX, which will most likely be necessary. This
1936 change affects usage and ipmaker as well.
1950 change affects usage and ipmaker as well.
1937
1951
1938 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1952 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1939 handle the matplotlib shell issues. Code by John Hunter
1953 handle the matplotlib shell issues. Code by John Hunter
1940 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1954 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1941 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1955 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1942 broken (and disabled for end users) for now, but it puts the
1956 broken (and disabled for end users) for now, but it puts the
1943 infrastructure in place.
1957 infrastructure in place.
1944
1958
1945 2004-08-21 Fernando Perez <fperez@colorado.edu>
1959 2004-08-21 Fernando Perez <fperez@colorado.edu>
1946
1960
1947 * ipythonrc-pylab: Add matplotlib support.
1961 * ipythonrc-pylab: Add matplotlib support.
1948
1962
1949 * matplotlib_config.py: new files for matplotlib support, part of
1963 * matplotlib_config.py: new files for matplotlib support, part of
1950 the pylab profile.
1964 the pylab profile.
1951
1965
1952 * IPython/usage.py (__doc__): documented the threading options.
1966 * IPython/usage.py (__doc__): documented the threading options.
1953
1967
1954 2004-08-20 Fernando Perez <fperez@colorado.edu>
1968 2004-08-20 Fernando Perez <fperez@colorado.edu>
1955
1969
1956 * ipython: Modified the main calling routine to handle the -thread
1970 * ipython: Modified the main calling routine to handle the -thread
1957 and -mpthread options. This needs to be done as a top-level hack,
1971 and -mpthread options. This needs to be done as a top-level hack,
1958 because it determines which class to instantiate for IPython
1972 because it determines which class to instantiate for IPython
1959 itself.
1973 itself.
1960
1974
1961 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1975 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1962 classes to support multithreaded GTK operation without blocking,
1976 classes to support multithreaded GTK operation without blocking,
1963 and matplotlib with all backends. This is a lot of still very
1977 and matplotlib with all backends. This is a lot of still very
1964 experimental code, and threads are tricky. So it may still have a
1978 experimental code, and threads are tricky. So it may still have a
1965 few rough edges... This code owes a lot to
1979 few rough edges... This code owes a lot to
1966 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1980 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1967 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1981 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1968 to John Hunter for all the matplotlib work.
1982 to John Hunter for all the matplotlib work.
1969
1983
1970 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1984 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1971 options for gtk thread and matplotlib support.
1985 options for gtk thread and matplotlib support.
1972
1986
1973 2004-08-16 Fernando Perez <fperez@colorado.edu>
1987 2004-08-16 Fernando Perez <fperez@colorado.edu>
1974
1988
1975 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1989 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1976 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1990 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1977 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1991 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1978
1992
1979 2004-08-11 Fernando Perez <fperez@colorado.edu>
1993 2004-08-11 Fernando Perez <fperez@colorado.edu>
1980
1994
1981 * setup.py (isfile): Fix build so documentation gets updated for
1995 * setup.py (isfile): Fix build so documentation gets updated for
1982 rpms (it was only done for .tgz builds).
1996 rpms (it was only done for .tgz builds).
1983
1997
1984 2004-08-10 Fernando Perez <fperez@colorado.edu>
1998 2004-08-10 Fernando Perez <fperez@colorado.edu>
1985
1999
1986 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2000 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1987
2001
1988 * iplib.py : Silence syntax error exceptions in tab-completion.
2002 * iplib.py : Silence syntax error exceptions in tab-completion.
1989
2003
1990 2004-08-05 Fernando Perez <fperez@colorado.edu>
2004 2004-08-05 Fernando Perez <fperez@colorado.edu>
1991
2005
1992 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2006 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1993 'color off' mark for continuation prompts. This was causing long
2007 'color off' mark for continuation prompts. This was causing long
1994 continuation lines to mis-wrap.
2008 continuation lines to mis-wrap.
1995
2009
1996 2004-08-01 Fernando Perez <fperez@colorado.edu>
2010 2004-08-01 Fernando Perez <fperez@colorado.edu>
1997
2011
1998 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2012 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1999 for building ipython to be a parameter. All this is necessary
2013 for building ipython to be a parameter. All this is necessary
2000 right now to have a multithreaded version, but this insane
2014 right now to have a multithreaded version, but this insane
2001 non-design will be cleaned up soon. For now, it's a hack that
2015 non-design will be cleaned up soon. For now, it's a hack that
2002 works.
2016 works.
2003
2017
2004 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2018 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2005 args in various places. No bugs so far, but it's a dangerous
2019 args in various places. No bugs so far, but it's a dangerous
2006 practice.
2020 practice.
2007
2021
2008 2004-07-31 Fernando Perez <fperez@colorado.edu>
2022 2004-07-31 Fernando Perez <fperez@colorado.edu>
2009
2023
2010 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2024 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2011 fix completion of files with dots in their names under most
2025 fix completion of files with dots in their names under most
2012 profiles (pysh was OK because the completion order is different).
2026 profiles (pysh was OK because the completion order is different).
2013
2027
2014 2004-07-27 Fernando Perez <fperez@colorado.edu>
2028 2004-07-27 Fernando Perez <fperez@colorado.edu>
2015
2029
2016 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2030 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2017 keywords manually, b/c the one in keyword.py was removed in python
2031 keywords manually, b/c the one in keyword.py was removed in python
2018 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2032 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2019 This is NOT a bug under python 2.3 and earlier.
2033 This is NOT a bug under python 2.3 and earlier.
2020
2034
2021 2004-07-26 Fernando Perez <fperez@colorado.edu>
2035 2004-07-26 Fernando Perez <fperez@colorado.edu>
2022
2036
2023 * IPython/ultraTB.py (VerboseTB.text): Add another
2037 * IPython/ultraTB.py (VerboseTB.text): Add another
2024 linecache.checkcache() call to try to prevent inspect.py from
2038 linecache.checkcache() call to try to prevent inspect.py from
2025 crashing under python 2.3. I think this fixes
2039 crashing under python 2.3. I think this fixes
2026 http://www.scipy.net/roundup/ipython/issue17.
2040 http://www.scipy.net/roundup/ipython/issue17.
2027
2041
2028 2004-07-26 *** Released version 0.6.2
2042 2004-07-26 *** Released version 0.6.2
2029
2043
2030 2004-07-26 Fernando Perez <fperez@colorado.edu>
2044 2004-07-26 Fernando Perez <fperez@colorado.edu>
2031
2045
2032 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2046 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2033 fail for any number.
2047 fail for any number.
2034 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2048 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2035 empty bookmarks.
2049 empty bookmarks.
2036
2050
2037 2004-07-26 *** Released version 0.6.1
2051 2004-07-26 *** Released version 0.6.1
2038
2052
2039 2004-07-26 Fernando Perez <fperez@colorado.edu>
2053 2004-07-26 Fernando Perez <fperez@colorado.edu>
2040
2054
2041 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2055 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2042
2056
2043 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2057 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2044 escaping '()[]{}' in filenames.
2058 escaping '()[]{}' in filenames.
2045
2059
2046 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2060 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2047 Python 2.2 users who lack a proper shlex.split.
2061 Python 2.2 users who lack a proper shlex.split.
2048
2062
2049 2004-07-19 Fernando Perez <fperez@colorado.edu>
2063 2004-07-19 Fernando Perez <fperez@colorado.edu>
2050
2064
2051 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2065 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2052 for reading readline's init file. I follow the normal chain:
2066 for reading readline's init file. I follow the normal chain:
2053 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2067 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2054 report by Mike Heeter. This closes
2068 report by Mike Heeter. This closes
2055 http://www.scipy.net/roundup/ipython/issue16.
2069 http://www.scipy.net/roundup/ipython/issue16.
2056
2070
2057 2004-07-18 Fernando Perez <fperez@colorado.edu>
2071 2004-07-18 Fernando Perez <fperez@colorado.edu>
2058
2072
2059 * IPython/iplib.py (__init__): Add better handling of '\' under
2073 * IPython/iplib.py (__init__): Add better handling of '\' under
2060 Win32 for filenames. After a patch by Ville.
2074 Win32 for filenames. After a patch by Ville.
2061
2075
2062 2004-07-17 Fernando Perez <fperez@colorado.edu>
2076 2004-07-17 Fernando Perez <fperez@colorado.edu>
2063
2077
2064 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2078 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2065 autocalling would be triggered for 'foo is bar' if foo is
2079 autocalling would be triggered for 'foo is bar' if foo is
2066 callable. I also cleaned up the autocall detection code to use a
2080 callable. I also cleaned up the autocall detection code to use a
2067 regexp, which is faster. Bug reported by Alexander Schmolck.
2081 regexp, which is faster. Bug reported by Alexander Schmolck.
2068
2082
2069 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2083 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2070 '?' in them would confuse the help system. Reported by Alex
2084 '?' in them would confuse the help system. Reported by Alex
2071 Schmolck.
2085 Schmolck.
2072
2086
2073 2004-07-16 Fernando Perez <fperez@colorado.edu>
2087 2004-07-16 Fernando Perez <fperez@colorado.edu>
2074
2088
2075 * IPython/GnuplotInteractive.py (__all__): added plot2.
2089 * IPython/GnuplotInteractive.py (__all__): added plot2.
2076
2090
2077 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2091 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2078 plotting dictionaries, lists or tuples of 1d arrays.
2092 plotting dictionaries, lists or tuples of 1d arrays.
2079
2093
2080 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2094 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2081 optimizations.
2095 optimizations.
2082
2096
2083 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2097 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2084 the information which was there from Janko's original IPP code:
2098 the information which was there from Janko's original IPP code:
2085
2099
2086 03.05.99 20:53 porto.ifm.uni-kiel.de
2100 03.05.99 20:53 porto.ifm.uni-kiel.de
2087 --Started changelog.
2101 --Started changelog.
2088 --make clear do what it say it does
2102 --make clear do what it say it does
2089 --added pretty output of lines from inputcache
2103 --added pretty output of lines from inputcache
2090 --Made Logger a mixin class, simplifies handling of switches
2104 --Made Logger a mixin class, simplifies handling of switches
2091 --Added own completer class. .string<TAB> expands to last history
2105 --Added own completer class. .string<TAB> expands to last history
2092 line which starts with string. The new expansion is also present
2106 line which starts with string. The new expansion is also present
2093 with Ctrl-r from the readline library. But this shows, who this
2107 with Ctrl-r from the readline library. But this shows, who this
2094 can be done for other cases.
2108 can be done for other cases.
2095 --Added convention that all shell functions should accept a
2109 --Added convention that all shell functions should accept a
2096 parameter_string This opens the door for different behaviour for
2110 parameter_string This opens the door for different behaviour for
2097 each function. @cd is a good example of this.
2111 each function. @cd is a good example of this.
2098
2112
2099 04.05.99 12:12 porto.ifm.uni-kiel.de
2113 04.05.99 12:12 porto.ifm.uni-kiel.de
2100 --added logfile rotation
2114 --added logfile rotation
2101 --added new mainloop method which freezes first the namespace
2115 --added new mainloop method which freezes first the namespace
2102
2116
2103 07.05.99 21:24 porto.ifm.uni-kiel.de
2117 07.05.99 21:24 porto.ifm.uni-kiel.de
2104 --added the docreader classes. Now there is a help system.
2118 --added the docreader classes. Now there is a help system.
2105 -This is only a first try. Currently it's not easy to put new
2119 -This is only a first try. Currently it's not easy to put new
2106 stuff in the indices. But this is the way to go. Info would be
2120 stuff in the indices. But this is the way to go. Info would be
2107 better, but HTML is every where and not everybody has an info
2121 better, but HTML is every where and not everybody has an info
2108 system installed and it's not so easy to change html-docs to info.
2122 system installed and it's not so easy to change html-docs to info.
2109 --added global logfile option
2123 --added global logfile option
2110 --there is now a hook for object inspection method pinfo needs to
2124 --there is now a hook for object inspection method pinfo needs to
2111 be provided for this. Can be reached by two '??'.
2125 be provided for this. Can be reached by two '??'.
2112
2126
2113 08.05.99 20:51 porto.ifm.uni-kiel.de
2127 08.05.99 20:51 porto.ifm.uni-kiel.de
2114 --added a README
2128 --added a README
2115 --bug in rc file. Something has changed so functions in the rc
2129 --bug in rc file. Something has changed so functions in the rc
2116 file need to reference the shell and not self. Not clear if it's a
2130 file need to reference the shell and not self. Not clear if it's a
2117 bug or feature.
2131 bug or feature.
2118 --changed rc file for new behavior
2132 --changed rc file for new behavior
2119
2133
2120 2004-07-15 Fernando Perez <fperez@colorado.edu>
2134 2004-07-15 Fernando Perez <fperez@colorado.edu>
2121
2135
2122 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2136 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2123 cache was falling out of sync in bizarre manners when multi-line
2137 cache was falling out of sync in bizarre manners when multi-line
2124 input was present. Minor optimizations and cleanup.
2138 input was present. Minor optimizations and cleanup.
2125
2139
2126 (Logger): Remove old Changelog info for cleanup. This is the
2140 (Logger): Remove old Changelog info for cleanup. This is the
2127 information which was there from Janko's original code:
2141 information which was there from Janko's original code:
2128
2142
2129 Changes to Logger: - made the default log filename a parameter
2143 Changes to Logger: - made the default log filename a parameter
2130
2144
2131 - put a check for lines beginning with !@? in log(). Needed
2145 - put a check for lines beginning with !@? in log(). Needed
2132 (even if the handlers properly log their lines) for mid-session
2146 (even if the handlers properly log their lines) for mid-session
2133 logging activation to work properly. Without this, lines logged
2147 logging activation to work properly. Without this, lines logged
2134 in mid session, which get read from the cache, would end up
2148 in mid session, which get read from the cache, would end up
2135 'bare' (with !@? in the open) in the log. Now they are caught
2149 'bare' (with !@? in the open) in the log. Now they are caught
2136 and prepended with a #.
2150 and prepended with a #.
2137
2151
2138 * IPython/iplib.py (InteractiveShell.init_readline): added check
2152 * IPython/iplib.py (InteractiveShell.init_readline): added check
2139 in case MagicCompleter fails to be defined, so we don't crash.
2153 in case MagicCompleter fails to be defined, so we don't crash.
2140
2154
2141 2004-07-13 Fernando Perez <fperez@colorado.edu>
2155 2004-07-13 Fernando Perez <fperez@colorado.edu>
2142
2156
2143 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2157 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2144 of EPS if the requested filename ends in '.eps'.
2158 of EPS if the requested filename ends in '.eps'.
2145
2159
2146 2004-07-04 Fernando Perez <fperez@colorado.edu>
2160 2004-07-04 Fernando Perez <fperez@colorado.edu>
2147
2161
2148 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2162 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2149 escaping of quotes when calling the shell.
2163 escaping of quotes when calling the shell.
2150
2164
2151 2004-07-02 Fernando Perez <fperez@colorado.edu>
2165 2004-07-02 Fernando Perez <fperez@colorado.edu>
2152
2166
2153 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2167 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2154 gettext not working because we were clobbering '_'. Fixes
2168 gettext not working because we were clobbering '_'. Fixes
2155 http://www.scipy.net/roundup/ipython/issue6.
2169 http://www.scipy.net/roundup/ipython/issue6.
2156
2170
2157 2004-07-01 Fernando Perez <fperez@colorado.edu>
2171 2004-07-01 Fernando Perez <fperez@colorado.edu>
2158
2172
2159 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2173 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2160 into @cd. Patch by Ville.
2174 into @cd. Patch by Ville.
2161
2175
2162 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2176 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2163 new function to store things after ipmaker runs. Patch by Ville.
2177 new function to store things after ipmaker runs. Patch by Ville.
2164 Eventually this will go away once ipmaker is removed and the class
2178 Eventually this will go away once ipmaker is removed and the class
2165 gets cleaned up, but for now it's ok. Key functionality here is
2179 gets cleaned up, but for now it's ok. Key functionality here is
2166 the addition of the persistent storage mechanism, a dict for
2180 the addition of the persistent storage mechanism, a dict for
2167 keeping data across sessions (for now just bookmarks, but more can
2181 keeping data across sessions (for now just bookmarks, but more can
2168 be implemented later).
2182 be implemented later).
2169
2183
2170 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2184 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2171 persistent across sections. Patch by Ville, I modified it
2185 persistent across sections. Patch by Ville, I modified it
2172 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2186 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2173 added a '-l' option to list all bookmarks.
2187 added a '-l' option to list all bookmarks.
2174
2188
2175 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2189 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2176 center for cleanup. Registered with atexit.register(). I moved
2190 center for cleanup. Registered with atexit.register(). I moved
2177 here the old exit_cleanup(). After a patch by Ville.
2191 here the old exit_cleanup(). After a patch by Ville.
2178
2192
2179 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2193 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2180 characters in the hacked shlex_split for python 2.2.
2194 characters in the hacked shlex_split for python 2.2.
2181
2195
2182 * IPython/iplib.py (file_matches): more fixes to filenames with
2196 * IPython/iplib.py (file_matches): more fixes to filenames with
2183 whitespace in them. It's not perfect, but limitations in python's
2197 whitespace in them. It's not perfect, but limitations in python's
2184 readline make it impossible to go further.
2198 readline make it impossible to go further.
2185
2199
2186 2004-06-29 Fernando Perez <fperez@colorado.edu>
2200 2004-06-29 Fernando Perez <fperez@colorado.edu>
2187
2201
2188 * IPython/iplib.py (file_matches): escape whitespace correctly in
2202 * IPython/iplib.py (file_matches): escape whitespace correctly in
2189 filename completions. Bug reported by Ville.
2203 filename completions. Bug reported by Ville.
2190
2204
2191 2004-06-28 Fernando Perez <fperez@colorado.edu>
2205 2004-06-28 Fernando Perez <fperez@colorado.edu>
2192
2206
2193 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2207 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2194 the history file will be called 'history-PROFNAME' (or just
2208 the history file will be called 'history-PROFNAME' (or just
2195 'history' if no profile is loaded). I was getting annoyed at
2209 'history' if no profile is loaded). I was getting annoyed at
2196 getting my Numerical work history clobbered by pysh sessions.
2210 getting my Numerical work history clobbered by pysh sessions.
2197
2211
2198 * IPython/iplib.py (InteractiveShell.__init__): Internal
2212 * IPython/iplib.py (InteractiveShell.__init__): Internal
2199 getoutputerror() function so that we can honor the system_verbose
2213 getoutputerror() function so that we can honor the system_verbose
2200 flag for _all_ system calls. I also added escaping of #
2214 flag for _all_ system calls. I also added escaping of #
2201 characters here to avoid confusing Itpl.
2215 characters here to avoid confusing Itpl.
2202
2216
2203 * IPython/Magic.py (shlex_split): removed call to shell in
2217 * IPython/Magic.py (shlex_split): removed call to shell in
2204 parse_options and replaced it with shlex.split(). The annoying
2218 parse_options and replaced it with shlex.split(). The annoying
2205 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2219 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2206 to backport it from 2.3, with several frail hacks (the shlex
2220 to backport it from 2.3, with several frail hacks (the shlex
2207 module is rather limited in 2.2). Thanks to a suggestion by Ville
2221 module is rather limited in 2.2). Thanks to a suggestion by Ville
2208 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2222 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2209 problem.
2223 problem.
2210
2224
2211 (Magic.magic_system_verbose): new toggle to print the actual
2225 (Magic.magic_system_verbose): new toggle to print the actual
2212 system calls made by ipython. Mainly for debugging purposes.
2226 system calls made by ipython. Mainly for debugging purposes.
2213
2227
2214 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2228 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2215 doesn't support persistence. Reported (and fix suggested) by
2229 doesn't support persistence. Reported (and fix suggested) by
2216 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2230 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2217
2231
2218 2004-06-26 Fernando Perez <fperez@colorado.edu>
2232 2004-06-26 Fernando Perez <fperez@colorado.edu>
2219
2233
2220 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2234 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2221 continue prompts.
2235 continue prompts.
2222
2236
2223 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2237 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2224 function (basically a big docstring) and a few more things here to
2238 function (basically a big docstring) and a few more things here to
2225 speedup startup. pysh.py is now very lightweight. We want because
2239 speedup startup. pysh.py is now very lightweight. We want because
2226 it gets execfile'd, while InterpreterExec gets imported, so
2240 it gets execfile'd, while InterpreterExec gets imported, so
2227 byte-compilation saves time.
2241 byte-compilation saves time.
2228
2242
2229 2004-06-25 Fernando Perez <fperez@colorado.edu>
2243 2004-06-25 Fernando Perez <fperez@colorado.edu>
2230
2244
2231 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2245 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2232 -NUM', which was recently broken.
2246 -NUM', which was recently broken.
2233
2247
2234 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2248 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2235 in multi-line input (but not !!, which doesn't make sense there).
2249 in multi-line input (but not !!, which doesn't make sense there).
2236
2250
2237 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2251 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2238 It's just too useful, and people can turn it off in the less
2252 It's just too useful, and people can turn it off in the less
2239 common cases where it's a problem.
2253 common cases where it's a problem.
2240
2254
2241 2004-06-24 Fernando Perez <fperez@colorado.edu>
2255 2004-06-24 Fernando Perez <fperez@colorado.edu>
2242
2256
2243 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2257 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2244 special syntaxes (like alias calling) is now allied in multi-line
2258 special syntaxes (like alias calling) is now allied in multi-line
2245 input. This is still _very_ experimental, but it's necessary for
2259 input. This is still _very_ experimental, but it's necessary for
2246 efficient shell usage combining python looping syntax with system
2260 efficient shell usage combining python looping syntax with system
2247 calls. For now it's restricted to aliases, I don't think it
2261 calls. For now it's restricted to aliases, I don't think it
2248 really even makes sense to have this for magics.
2262 really even makes sense to have this for magics.
2249
2263
2250 2004-06-23 Fernando Perez <fperez@colorado.edu>
2264 2004-06-23 Fernando Perez <fperez@colorado.edu>
2251
2265
2252 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2266 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2253 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2267 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2254
2268
2255 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2269 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2256 extensions under Windows (after code sent by Gary Bishop). The
2270 extensions under Windows (after code sent by Gary Bishop). The
2257 extensions considered 'executable' are stored in IPython's rc
2271 extensions considered 'executable' are stored in IPython's rc
2258 structure as win_exec_ext.
2272 structure as win_exec_ext.
2259
2273
2260 * IPython/genutils.py (shell): new function, like system() but
2274 * IPython/genutils.py (shell): new function, like system() but
2261 without return value. Very useful for interactive shell work.
2275 without return value. Very useful for interactive shell work.
2262
2276
2263 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2277 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2264 delete aliases.
2278 delete aliases.
2265
2279
2266 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2280 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2267 sure that the alias table doesn't contain python keywords.
2281 sure that the alias table doesn't contain python keywords.
2268
2282
2269 2004-06-21 Fernando Perez <fperez@colorado.edu>
2283 2004-06-21 Fernando Perez <fperez@colorado.edu>
2270
2284
2271 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2285 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2272 non-existent items are found in $PATH. Reported by Thorsten.
2286 non-existent items are found in $PATH. Reported by Thorsten.
2273
2287
2274 2004-06-20 Fernando Perez <fperez@colorado.edu>
2288 2004-06-20 Fernando Perez <fperez@colorado.edu>
2275
2289
2276 * IPython/iplib.py (complete): modified the completer so that the
2290 * IPython/iplib.py (complete): modified the completer so that the
2277 order of priorities can be easily changed at runtime.
2291 order of priorities can be easily changed at runtime.
2278
2292
2279 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2293 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2280 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2294 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2281
2295
2282 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2296 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2283 expand Python variables prepended with $ in all system calls. The
2297 expand Python variables prepended with $ in all system calls. The
2284 same was done to InteractiveShell.handle_shell_escape. Now all
2298 same was done to InteractiveShell.handle_shell_escape. Now all
2285 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2299 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2286 expansion of python variables and expressions according to the
2300 expansion of python variables and expressions according to the
2287 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2301 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2288
2302
2289 Though PEP-215 has been rejected, a similar (but simpler) one
2303 Though PEP-215 has been rejected, a similar (but simpler) one
2290 seems like it will go into Python 2.4, PEP-292 -
2304 seems like it will go into Python 2.4, PEP-292 -
2291 http://www.python.org/peps/pep-0292.html.
2305 http://www.python.org/peps/pep-0292.html.
2292
2306
2293 I'll keep the full syntax of PEP-215, since IPython has since the
2307 I'll keep the full syntax of PEP-215, since IPython has since the
2294 start used Ka-Ping Yee's reference implementation discussed there
2308 start used Ka-Ping Yee's reference implementation discussed there
2295 (Itpl), and I actually like the powerful semantics it offers.
2309 (Itpl), and I actually like the powerful semantics it offers.
2296
2310
2297 In order to access normal shell variables, the $ has to be escaped
2311 In order to access normal shell variables, the $ has to be escaped
2298 via an extra $. For example:
2312 via an extra $. For example:
2299
2313
2300 In [7]: PATH='a python variable'
2314 In [7]: PATH='a python variable'
2301
2315
2302 In [8]: !echo $PATH
2316 In [8]: !echo $PATH
2303 a python variable
2317 a python variable
2304
2318
2305 In [9]: !echo $$PATH
2319 In [9]: !echo $$PATH
2306 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2320 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2307
2321
2308 (Magic.parse_options): escape $ so the shell doesn't evaluate
2322 (Magic.parse_options): escape $ so the shell doesn't evaluate
2309 things prematurely.
2323 things prematurely.
2310
2324
2311 * IPython/iplib.py (InteractiveShell.call_alias): added the
2325 * IPython/iplib.py (InteractiveShell.call_alias): added the
2312 ability for aliases to expand python variables via $.
2326 ability for aliases to expand python variables via $.
2313
2327
2314 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2328 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2315 system, now there's a @rehash/@rehashx pair of magics. These work
2329 system, now there's a @rehash/@rehashx pair of magics. These work
2316 like the csh rehash command, and can be invoked at any time. They
2330 like the csh rehash command, and can be invoked at any time. They
2317 build a table of aliases to everything in the user's $PATH
2331 build a table of aliases to everything in the user's $PATH
2318 (@rehash uses everything, @rehashx is slower but only adds
2332 (@rehash uses everything, @rehashx is slower but only adds
2319 executable files). With this, the pysh.py-based shell profile can
2333 executable files). With this, the pysh.py-based shell profile can
2320 now simply call rehash upon startup, and full access to all
2334 now simply call rehash upon startup, and full access to all
2321 programs in the user's path is obtained.
2335 programs in the user's path is obtained.
2322
2336
2323 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2337 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2324 functionality is now fully in place. I removed the old dynamic
2338 functionality is now fully in place. I removed the old dynamic
2325 code generation based approach, in favor of a much lighter one
2339 code generation based approach, in favor of a much lighter one
2326 based on a simple dict. The advantage is that this allows me to
2340 based on a simple dict. The advantage is that this allows me to
2327 now have thousands of aliases with negligible cost (unthinkable
2341 now have thousands of aliases with negligible cost (unthinkable
2328 with the old system).
2342 with the old system).
2329
2343
2330 2004-06-19 Fernando Perez <fperez@colorado.edu>
2344 2004-06-19 Fernando Perez <fperez@colorado.edu>
2331
2345
2332 * IPython/iplib.py (__init__): extended MagicCompleter class to
2346 * IPython/iplib.py (__init__): extended MagicCompleter class to
2333 also complete (last in priority) on user aliases.
2347 also complete (last in priority) on user aliases.
2334
2348
2335 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2349 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2336 call to eval.
2350 call to eval.
2337 (ItplNS.__init__): Added a new class which functions like Itpl,
2351 (ItplNS.__init__): Added a new class which functions like Itpl,
2338 but allows configuring the namespace for the evaluation to occur
2352 but allows configuring the namespace for the evaluation to occur
2339 in.
2353 in.
2340
2354
2341 2004-06-18 Fernando Perez <fperez@colorado.edu>
2355 2004-06-18 Fernando Perez <fperez@colorado.edu>
2342
2356
2343 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2357 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2344 better message when 'exit' or 'quit' are typed (a common newbie
2358 better message when 'exit' or 'quit' are typed (a common newbie
2345 confusion).
2359 confusion).
2346
2360
2347 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2361 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2348 check for Windows users.
2362 check for Windows users.
2349
2363
2350 * IPython/iplib.py (InteractiveShell.user_setup): removed
2364 * IPython/iplib.py (InteractiveShell.user_setup): removed
2351 disabling of colors for Windows. I'll test at runtime and issue a
2365 disabling of colors for Windows. I'll test at runtime and issue a
2352 warning if Gary's readline isn't found, as to nudge users to
2366 warning if Gary's readline isn't found, as to nudge users to
2353 download it.
2367 download it.
2354
2368
2355 2004-06-16 Fernando Perez <fperez@colorado.edu>
2369 2004-06-16 Fernando Perez <fperez@colorado.edu>
2356
2370
2357 * IPython/genutils.py (Stream.__init__): changed to print errors
2371 * IPython/genutils.py (Stream.__init__): changed to print errors
2358 to sys.stderr. I had a circular dependency here. Now it's
2372 to sys.stderr. I had a circular dependency here. Now it's
2359 possible to run ipython as IDLE's shell (consider this pre-alpha,
2373 possible to run ipython as IDLE's shell (consider this pre-alpha,
2360 since true stdout things end up in the starting terminal instead
2374 since true stdout things end up in the starting terminal instead
2361 of IDLE's out).
2375 of IDLE's out).
2362
2376
2363 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2377 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2364 users who haven't # updated their prompt_in2 definitions. Remove
2378 users who haven't # updated their prompt_in2 definitions. Remove
2365 eventually.
2379 eventually.
2366 (multiple_replace): added credit to original ASPN recipe.
2380 (multiple_replace): added credit to original ASPN recipe.
2367
2381
2368 2004-06-15 Fernando Perez <fperez@colorado.edu>
2382 2004-06-15 Fernando Perez <fperez@colorado.edu>
2369
2383
2370 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2384 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2371 list of auto-defined aliases.
2385 list of auto-defined aliases.
2372
2386
2373 2004-06-13 Fernando Perez <fperez@colorado.edu>
2387 2004-06-13 Fernando Perez <fperez@colorado.edu>
2374
2388
2375 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2389 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2376 install was really requested (so setup.py can be used for other
2390 install was really requested (so setup.py can be used for other
2377 things under Windows).
2391 things under Windows).
2378
2392
2379 2004-06-10 Fernando Perez <fperez@colorado.edu>
2393 2004-06-10 Fernando Perez <fperez@colorado.edu>
2380
2394
2381 * IPython/Logger.py (Logger.create_log): Manually remove any old
2395 * IPython/Logger.py (Logger.create_log): Manually remove any old
2382 backup, since os.remove may fail under Windows. Fixes bug
2396 backup, since os.remove may fail under Windows. Fixes bug
2383 reported by Thorsten.
2397 reported by Thorsten.
2384
2398
2385 2004-06-09 Fernando Perez <fperez@colorado.edu>
2399 2004-06-09 Fernando Perez <fperez@colorado.edu>
2386
2400
2387 * examples/example-embed.py: fixed all references to %n (replaced
2401 * examples/example-embed.py: fixed all references to %n (replaced
2388 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2402 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2389 for all examples and the manual as well.
2403 for all examples and the manual as well.
2390
2404
2391 2004-06-08 Fernando Perez <fperez@colorado.edu>
2405 2004-06-08 Fernando Perez <fperez@colorado.edu>
2392
2406
2393 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2407 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2394 alignment and color management. All 3 prompt subsystems now
2408 alignment and color management. All 3 prompt subsystems now
2395 inherit from BasePrompt.
2409 inherit from BasePrompt.
2396
2410
2397 * tools/release: updates for windows installer build and tag rpms
2411 * tools/release: updates for windows installer build and tag rpms
2398 with python version (since paths are fixed).
2412 with python version (since paths are fixed).
2399
2413
2400 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2414 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2401 which will become eventually obsolete. Also fixed the default
2415 which will become eventually obsolete. Also fixed the default
2402 prompt_in2 to use \D, so at least new users start with the correct
2416 prompt_in2 to use \D, so at least new users start with the correct
2403 defaults.
2417 defaults.
2404 WARNING: Users with existing ipythonrc files will need to apply
2418 WARNING: Users with existing ipythonrc files will need to apply
2405 this fix manually!
2419 this fix manually!
2406
2420
2407 * setup.py: make windows installer (.exe). This is finally the
2421 * setup.py: make windows installer (.exe). This is finally the
2408 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2422 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2409 which I hadn't included because it required Python 2.3 (or recent
2423 which I hadn't included because it required Python 2.3 (or recent
2410 distutils).
2424 distutils).
2411
2425
2412 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2426 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2413 usage of new '\D' escape.
2427 usage of new '\D' escape.
2414
2428
2415 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2429 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2416 lacks os.getuid())
2430 lacks os.getuid())
2417 (CachedOutput.set_colors): Added the ability to turn coloring
2431 (CachedOutput.set_colors): Added the ability to turn coloring
2418 on/off with @colors even for manually defined prompt colors. It
2432 on/off with @colors even for manually defined prompt colors. It
2419 uses a nasty global, but it works safely and via the generic color
2433 uses a nasty global, but it works safely and via the generic color
2420 handling mechanism.
2434 handling mechanism.
2421 (Prompt2.__init__): Introduced new escape '\D' for continuation
2435 (Prompt2.__init__): Introduced new escape '\D' for continuation
2422 prompts. It represents the counter ('\#') as dots.
2436 prompts. It represents the counter ('\#') as dots.
2423 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2437 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2424 need to update their ipythonrc files and replace '%n' with '\D' in
2438 need to update their ipythonrc files and replace '%n' with '\D' in
2425 their prompt_in2 settings everywhere. Sorry, but there's
2439 their prompt_in2 settings everywhere. Sorry, but there's
2426 otherwise no clean way to get all prompts to properly align. The
2440 otherwise no clean way to get all prompts to properly align. The
2427 ipythonrc shipped with IPython has been updated.
2441 ipythonrc shipped with IPython has been updated.
2428
2442
2429 2004-06-07 Fernando Perez <fperez@colorado.edu>
2443 2004-06-07 Fernando Perez <fperez@colorado.edu>
2430
2444
2431 * setup.py (isfile): Pass local_icons option to latex2html, so the
2445 * setup.py (isfile): Pass local_icons option to latex2html, so the
2432 resulting HTML file is self-contained. Thanks to
2446 resulting HTML file is self-contained. Thanks to
2433 dryice-AT-liu.com.cn for the tip.
2447 dryice-AT-liu.com.cn for the tip.
2434
2448
2435 * pysh.py: I created a new profile 'shell', which implements a
2449 * pysh.py: I created a new profile 'shell', which implements a
2436 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2450 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2437 system shell, nor will it become one anytime soon. It's mainly
2451 system shell, nor will it become one anytime soon. It's mainly
2438 meant to illustrate the use of the new flexible bash-like prompts.
2452 meant to illustrate the use of the new flexible bash-like prompts.
2439 I guess it could be used by hardy souls for true shell management,
2453 I guess it could be used by hardy souls for true shell management,
2440 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2454 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2441 profile. This uses the InterpreterExec extension provided by
2455 profile. This uses the InterpreterExec extension provided by
2442 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2456 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2443
2457
2444 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2458 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2445 auto-align itself with the length of the previous input prompt
2459 auto-align itself with the length of the previous input prompt
2446 (taking into account the invisible color escapes).
2460 (taking into account the invisible color escapes).
2447 (CachedOutput.__init__): Large restructuring of this class. Now
2461 (CachedOutput.__init__): Large restructuring of this class. Now
2448 all three prompts (primary1, primary2, output) are proper objects,
2462 all three prompts (primary1, primary2, output) are proper objects,
2449 managed by the 'parent' CachedOutput class. The code is still a
2463 managed by the 'parent' CachedOutput class. The code is still a
2450 bit hackish (all prompts share state via a pointer to the cache),
2464 bit hackish (all prompts share state via a pointer to the cache),
2451 but it's overall far cleaner than before.
2465 but it's overall far cleaner than before.
2452
2466
2453 * IPython/genutils.py (getoutputerror): modified to add verbose,
2467 * IPython/genutils.py (getoutputerror): modified to add verbose,
2454 debug and header options. This makes the interface of all getout*
2468 debug and header options. This makes the interface of all getout*
2455 functions uniform.
2469 functions uniform.
2456 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2470 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2457
2471
2458 * IPython/Magic.py (Magic.default_option): added a function to
2472 * IPython/Magic.py (Magic.default_option): added a function to
2459 allow registering default options for any magic command. This
2473 allow registering default options for any magic command. This
2460 makes it easy to have profiles which customize the magics globally
2474 makes it easy to have profiles which customize the magics globally
2461 for a certain use. The values set through this function are
2475 for a certain use. The values set through this function are
2462 picked up by the parse_options() method, which all magics should
2476 picked up by the parse_options() method, which all magics should
2463 use to parse their options.
2477 use to parse their options.
2464
2478
2465 * IPython/genutils.py (warn): modified the warnings framework to
2479 * IPython/genutils.py (warn): modified the warnings framework to
2466 use the Term I/O class. I'm trying to slowly unify all of
2480 use the Term I/O class. I'm trying to slowly unify all of
2467 IPython's I/O operations to pass through Term.
2481 IPython's I/O operations to pass through Term.
2468
2482
2469 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2483 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2470 the secondary prompt to correctly match the length of the primary
2484 the secondary prompt to correctly match the length of the primary
2471 one for any prompt. Now multi-line code will properly line up
2485 one for any prompt. Now multi-line code will properly line up
2472 even for path dependent prompts, such as the new ones available
2486 even for path dependent prompts, such as the new ones available
2473 via the prompt_specials.
2487 via the prompt_specials.
2474
2488
2475 2004-06-06 Fernando Perez <fperez@colorado.edu>
2489 2004-06-06 Fernando Perez <fperez@colorado.edu>
2476
2490
2477 * IPython/Prompts.py (prompt_specials): Added the ability to have
2491 * IPython/Prompts.py (prompt_specials): Added the ability to have
2478 bash-like special sequences in the prompts, which get
2492 bash-like special sequences in the prompts, which get
2479 automatically expanded. Things like hostname, current working
2493 automatically expanded. Things like hostname, current working
2480 directory and username are implemented already, but it's easy to
2494 directory and username are implemented already, but it's easy to
2481 add more in the future. Thanks to a patch by W.J. van der Laan
2495 add more in the future. Thanks to a patch by W.J. van der Laan
2482 <gnufnork-AT-hetdigitalegat.nl>
2496 <gnufnork-AT-hetdigitalegat.nl>
2483 (prompt_specials): Added color support for prompt strings, so
2497 (prompt_specials): Added color support for prompt strings, so
2484 users can define arbitrary color setups for their prompts.
2498 users can define arbitrary color setups for their prompts.
2485
2499
2486 2004-06-05 Fernando Perez <fperez@colorado.edu>
2500 2004-06-05 Fernando Perez <fperez@colorado.edu>
2487
2501
2488 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2502 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2489 code to load Gary Bishop's readline and configure it
2503 code to load Gary Bishop's readline and configure it
2490 automatically. Thanks to Gary for help on this.
2504 automatically. Thanks to Gary for help on this.
2491
2505
2492 2004-06-01 Fernando Perez <fperez@colorado.edu>
2506 2004-06-01 Fernando Perez <fperez@colorado.edu>
2493
2507
2494 * IPython/Logger.py (Logger.create_log): fix bug for logging
2508 * IPython/Logger.py (Logger.create_log): fix bug for logging
2495 with no filename (previous fix was incomplete).
2509 with no filename (previous fix was incomplete).
2496
2510
2497 2004-05-25 Fernando Perez <fperez@colorado.edu>
2511 2004-05-25 Fernando Perez <fperez@colorado.edu>
2498
2512
2499 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2513 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2500 parens would get passed to the shell.
2514 parens would get passed to the shell.
2501
2515
2502 2004-05-20 Fernando Perez <fperez@colorado.edu>
2516 2004-05-20 Fernando Perez <fperez@colorado.edu>
2503
2517
2504 * IPython/Magic.py (Magic.magic_prun): changed default profile
2518 * IPython/Magic.py (Magic.magic_prun): changed default profile
2505 sort order to 'time' (the more common profiling need).
2519 sort order to 'time' (the more common profiling need).
2506
2520
2507 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2521 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2508 so that source code shown is guaranteed in sync with the file on
2522 so that source code shown is guaranteed in sync with the file on
2509 disk (also changed in psource). Similar fix to the one for
2523 disk (also changed in psource). Similar fix to the one for
2510 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2524 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2511 <yann.ledu-AT-noos.fr>.
2525 <yann.ledu-AT-noos.fr>.
2512
2526
2513 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2527 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2514 with a single option would not be correctly parsed. Closes
2528 with a single option would not be correctly parsed. Closes
2515 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2529 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2516 introduced in 0.6.0 (on 2004-05-06).
2530 introduced in 0.6.0 (on 2004-05-06).
2517
2531
2518 2004-05-13 *** Released version 0.6.0
2532 2004-05-13 *** Released version 0.6.0
2519
2533
2520 2004-05-13 Fernando Perez <fperez@colorado.edu>
2534 2004-05-13 Fernando Perez <fperez@colorado.edu>
2521
2535
2522 * debian/: Added debian/ directory to CVS, so that debian support
2536 * debian/: Added debian/ directory to CVS, so that debian support
2523 is publicly accessible. The debian package is maintained by Jack
2537 is publicly accessible. The debian package is maintained by Jack
2524 Moffit <jack-AT-xiph.org>.
2538 Moffit <jack-AT-xiph.org>.
2525
2539
2526 * Documentation: included the notes about an ipython-based system
2540 * Documentation: included the notes about an ipython-based system
2527 shell (the hypothetical 'pysh') into the new_design.pdf document,
2541 shell (the hypothetical 'pysh') into the new_design.pdf document,
2528 so that these ideas get distributed to users along with the
2542 so that these ideas get distributed to users along with the
2529 official documentation.
2543 official documentation.
2530
2544
2531 2004-05-10 Fernando Perez <fperez@colorado.edu>
2545 2004-05-10 Fernando Perez <fperez@colorado.edu>
2532
2546
2533 * IPython/Logger.py (Logger.create_log): fix recently introduced
2547 * IPython/Logger.py (Logger.create_log): fix recently introduced
2534 bug (misindented line) where logstart would fail when not given an
2548 bug (misindented line) where logstart would fail when not given an
2535 explicit filename.
2549 explicit filename.
2536
2550
2537 2004-05-09 Fernando Perez <fperez@colorado.edu>
2551 2004-05-09 Fernando Perez <fperez@colorado.edu>
2538
2552
2539 * IPython/Magic.py (Magic.parse_options): skip system call when
2553 * IPython/Magic.py (Magic.parse_options): skip system call when
2540 there are no options to look for. Faster, cleaner for the common
2554 there are no options to look for. Faster, cleaner for the common
2541 case.
2555 case.
2542
2556
2543 * Documentation: many updates to the manual: describing Windows
2557 * Documentation: many updates to the manual: describing Windows
2544 support better, Gnuplot updates, credits, misc small stuff. Also
2558 support better, Gnuplot updates, credits, misc small stuff. Also
2545 updated the new_design doc a bit.
2559 updated the new_design doc a bit.
2546
2560
2547 2004-05-06 *** Released version 0.6.0.rc1
2561 2004-05-06 *** Released version 0.6.0.rc1
2548
2562
2549 2004-05-06 Fernando Perez <fperez@colorado.edu>
2563 2004-05-06 Fernando Perez <fperez@colorado.edu>
2550
2564
2551 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2565 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2552 operations to use the vastly more efficient list/''.join() method.
2566 operations to use the vastly more efficient list/''.join() method.
2553 (FormattedTB.text): Fix
2567 (FormattedTB.text): Fix
2554 http://www.scipy.net/roundup/ipython/issue12 - exception source
2568 http://www.scipy.net/roundup/ipython/issue12 - exception source
2555 extract not updated after reload. Thanks to Mike Salib
2569 extract not updated after reload. Thanks to Mike Salib
2556 <msalib-AT-mit.edu> for pinning the source of the problem.
2570 <msalib-AT-mit.edu> for pinning the source of the problem.
2557 Fortunately, the solution works inside ipython and doesn't require
2571 Fortunately, the solution works inside ipython and doesn't require
2558 any changes to python proper.
2572 any changes to python proper.
2559
2573
2560 * IPython/Magic.py (Magic.parse_options): Improved to process the
2574 * IPython/Magic.py (Magic.parse_options): Improved to process the
2561 argument list as a true shell would (by actually using the
2575 argument list as a true shell would (by actually using the
2562 underlying system shell). This way, all @magics automatically get
2576 underlying system shell). This way, all @magics automatically get
2563 shell expansion for variables. Thanks to a comment by Alex
2577 shell expansion for variables. Thanks to a comment by Alex
2564 Schmolck.
2578 Schmolck.
2565
2579
2566 2004-04-04 Fernando Perez <fperez@colorado.edu>
2580 2004-04-04 Fernando Perez <fperez@colorado.edu>
2567
2581
2568 * IPython/iplib.py (InteractiveShell.interact): Added a special
2582 * IPython/iplib.py (InteractiveShell.interact): Added a special
2569 trap for a debugger quit exception, which is basically impossible
2583 trap for a debugger quit exception, which is basically impossible
2570 to handle by normal mechanisms, given what pdb does to the stack.
2584 to handle by normal mechanisms, given what pdb does to the stack.
2571 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2585 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2572
2586
2573 2004-04-03 Fernando Perez <fperez@colorado.edu>
2587 2004-04-03 Fernando Perez <fperez@colorado.edu>
2574
2588
2575 * IPython/genutils.py (Term): Standardized the names of the Term
2589 * IPython/genutils.py (Term): Standardized the names of the Term
2576 class streams to cin/cout/cerr, following C++ naming conventions
2590 class streams to cin/cout/cerr, following C++ naming conventions
2577 (I can't use in/out/err because 'in' is not a valid attribute
2591 (I can't use in/out/err because 'in' is not a valid attribute
2578 name).
2592 name).
2579
2593
2580 * IPython/iplib.py (InteractiveShell.interact): don't increment
2594 * IPython/iplib.py (InteractiveShell.interact): don't increment
2581 the prompt if there's no user input. By Daniel 'Dang' Griffith
2595 the prompt if there's no user input. By Daniel 'Dang' Griffith
2582 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2596 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2583 Francois Pinard.
2597 Francois Pinard.
2584
2598
2585 2004-04-02 Fernando Perez <fperez@colorado.edu>
2599 2004-04-02 Fernando Perez <fperez@colorado.edu>
2586
2600
2587 * IPython/genutils.py (Stream.__init__): Modified to survive at
2601 * IPython/genutils.py (Stream.__init__): Modified to survive at
2588 least importing in contexts where stdin/out/err aren't true file
2602 least importing in contexts where stdin/out/err aren't true file
2589 objects, such as PyCrust (they lack fileno() and mode). However,
2603 objects, such as PyCrust (they lack fileno() and mode). However,
2590 the recovery facilities which rely on these things existing will
2604 the recovery facilities which rely on these things existing will
2591 not work.
2605 not work.
2592
2606
2593 2004-04-01 Fernando Perez <fperez@colorado.edu>
2607 2004-04-01 Fernando Perez <fperez@colorado.edu>
2594
2608
2595 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2609 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2596 use the new getoutputerror() function, so it properly
2610 use the new getoutputerror() function, so it properly
2597 distinguishes stdout/err.
2611 distinguishes stdout/err.
2598
2612
2599 * IPython/genutils.py (getoutputerror): added a function to
2613 * IPython/genutils.py (getoutputerror): added a function to
2600 capture separately the standard output and error of a command.
2614 capture separately the standard output and error of a command.
2601 After a comment from dang on the mailing lists. This code is
2615 After a comment from dang on the mailing lists. This code is
2602 basically a modified version of commands.getstatusoutput(), from
2616 basically a modified version of commands.getstatusoutput(), from
2603 the standard library.
2617 the standard library.
2604
2618
2605 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2619 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2606 '!!' as a special syntax (shorthand) to access @sx.
2620 '!!' as a special syntax (shorthand) to access @sx.
2607
2621
2608 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2622 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2609 command and return its output as a list split on '\n'.
2623 command and return its output as a list split on '\n'.
2610
2624
2611 2004-03-31 Fernando Perez <fperez@colorado.edu>
2625 2004-03-31 Fernando Perez <fperez@colorado.edu>
2612
2626
2613 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2627 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2614 method to dictionaries used as FakeModule instances if they lack
2628 method to dictionaries used as FakeModule instances if they lack
2615 it. At least pydoc in python2.3 breaks for runtime-defined
2629 it. At least pydoc in python2.3 breaks for runtime-defined
2616 functions without this hack. At some point I need to _really_
2630 functions without this hack. At some point I need to _really_
2617 understand what FakeModule is doing, because it's a gross hack.
2631 understand what FakeModule is doing, because it's a gross hack.
2618 But it solves Arnd's problem for now...
2632 But it solves Arnd's problem for now...
2619
2633
2620 2004-02-27 Fernando Perez <fperez@colorado.edu>
2634 2004-02-27 Fernando Perez <fperez@colorado.edu>
2621
2635
2622 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2636 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2623 mode would behave erratically. Also increased the number of
2637 mode would behave erratically. Also increased the number of
2624 possible logs in rotate mod to 999. Thanks to Rod Holland
2638 possible logs in rotate mod to 999. Thanks to Rod Holland
2625 <rhh@StructureLABS.com> for the report and fixes.
2639 <rhh@StructureLABS.com> for the report and fixes.
2626
2640
2627 2004-02-26 Fernando Perez <fperez@colorado.edu>
2641 2004-02-26 Fernando Perez <fperez@colorado.edu>
2628
2642
2629 * IPython/genutils.py (page): Check that the curses module really
2643 * IPython/genutils.py (page): Check that the curses module really
2630 has the initscr attribute before trying to use it. For some
2644 has the initscr attribute before trying to use it. For some
2631 reason, the Solaris curses module is missing this. I think this
2645 reason, the Solaris curses module is missing this. I think this
2632 should be considered a Solaris python bug, but I'm not sure.
2646 should be considered a Solaris python bug, but I'm not sure.
2633
2647
2634 2004-01-17 Fernando Perez <fperez@colorado.edu>
2648 2004-01-17 Fernando Perez <fperez@colorado.edu>
2635
2649
2636 * IPython/genutils.py (Stream.__init__): Changes to try to make
2650 * IPython/genutils.py (Stream.__init__): Changes to try to make
2637 ipython robust against stdin/out/err being closed by the user.
2651 ipython robust against stdin/out/err being closed by the user.
2638 This is 'user error' (and blocks a normal python session, at least
2652 This is 'user error' (and blocks a normal python session, at least
2639 the stdout case). However, Ipython should be able to survive such
2653 the stdout case). However, Ipython should be able to survive such
2640 instances of abuse as gracefully as possible. To simplify the
2654 instances of abuse as gracefully as possible. To simplify the
2641 coding and maintain compatibility with Gary Bishop's Term
2655 coding and maintain compatibility with Gary Bishop's Term
2642 contributions, I've made use of classmethods for this. I think
2656 contributions, I've made use of classmethods for this. I think
2643 this introduces a dependency on python 2.2.
2657 this introduces a dependency on python 2.2.
2644
2658
2645 2004-01-13 Fernando Perez <fperez@colorado.edu>
2659 2004-01-13 Fernando Perez <fperez@colorado.edu>
2646
2660
2647 * IPython/numutils.py (exp_safe): simplified the code a bit and
2661 * IPython/numutils.py (exp_safe): simplified the code a bit and
2648 removed the need for importing the kinds module altogether.
2662 removed the need for importing the kinds module altogether.
2649
2663
2650 2004-01-06 Fernando Perez <fperez@colorado.edu>
2664 2004-01-06 Fernando Perez <fperez@colorado.edu>
2651
2665
2652 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2666 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2653 a magic function instead, after some community feedback. No
2667 a magic function instead, after some community feedback. No
2654 special syntax will exist for it, but its name is deliberately
2668 special syntax will exist for it, but its name is deliberately
2655 very short.
2669 very short.
2656
2670
2657 2003-12-20 Fernando Perez <fperez@colorado.edu>
2671 2003-12-20 Fernando Perez <fperez@colorado.edu>
2658
2672
2659 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2673 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2660 new functionality, to automagically assign the result of a shell
2674 new functionality, to automagically assign the result of a shell
2661 command to a variable. I'll solicit some community feedback on
2675 command to a variable. I'll solicit some community feedback on
2662 this before making it permanent.
2676 this before making it permanent.
2663
2677
2664 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2678 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2665 requested about callables for which inspect couldn't obtain a
2679 requested about callables for which inspect couldn't obtain a
2666 proper argspec. Thanks to a crash report sent by Etienne
2680 proper argspec. Thanks to a crash report sent by Etienne
2667 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2681 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2668
2682
2669 2003-12-09 Fernando Perez <fperez@colorado.edu>
2683 2003-12-09 Fernando Perez <fperez@colorado.edu>
2670
2684
2671 * IPython/genutils.py (page): patch for the pager to work across
2685 * IPython/genutils.py (page): patch for the pager to work across
2672 various versions of Windows. By Gary Bishop.
2686 various versions of Windows. By Gary Bishop.
2673
2687
2674 2003-12-04 Fernando Perez <fperez@colorado.edu>
2688 2003-12-04 Fernando Perez <fperez@colorado.edu>
2675
2689
2676 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2690 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2677 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2691 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2678 While I tested this and it looks ok, there may still be corner
2692 While I tested this and it looks ok, there may still be corner
2679 cases I've missed.
2693 cases I've missed.
2680
2694
2681 2003-12-01 Fernando Perez <fperez@colorado.edu>
2695 2003-12-01 Fernando Perez <fperez@colorado.edu>
2682
2696
2683 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2697 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2684 where a line like 'p,q=1,2' would fail because the automagic
2698 where a line like 'p,q=1,2' would fail because the automagic
2685 system would be triggered for @p.
2699 system would be triggered for @p.
2686
2700
2687 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2701 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2688 cleanups, code unmodified.
2702 cleanups, code unmodified.
2689
2703
2690 * IPython/genutils.py (Term): added a class for IPython to handle
2704 * IPython/genutils.py (Term): added a class for IPython to handle
2691 output. In most cases it will just be a proxy for stdout/err, but
2705 output. In most cases it will just be a proxy for stdout/err, but
2692 having this allows modifications to be made for some platforms,
2706 having this allows modifications to be made for some platforms,
2693 such as handling color escapes under Windows. All of this code
2707 such as handling color escapes under Windows. All of this code
2694 was contributed by Gary Bishop, with minor modifications by me.
2708 was contributed by Gary Bishop, with minor modifications by me.
2695 The actual changes affect many files.
2709 The actual changes affect many files.
2696
2710
2697 2003-11-30 Fernando Perez <fperez@colorado.edu>
2711 2003-11-30 Fernando Perez <fperez@colorado.edu>
2698
2712
2699 * IPython/iplib.py (file_matches): new completion code, courtesy
2713 * IPython/iplib.py (file_matches): new completion code, courtesy
2700 of Jeff Collins. This enables filename completion again under
2714 of Jeff Collins. This enables filename completion again under
2701 python 2.3, which disabled it at the C level.
2715 python 2.3, which disabled it at the C level.
2702
2716
2703 2003-11-11 Fernando Perez <fperez@colorado.edu>
2717 2003-11-11 Fernando Perez <fperez@colorado.edu>
2704
2718
2705 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2719 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2706 for Numeric.array(map(...)), but often convenient.
2720 for Numeric.array(map(...)), but often convenient.
2707
2721
2708 2003-11-05 Fernando Perez <fperez@colorado.edu>
2722 2003-11-05 Fernando Perez <fperez@colorado.edu>
2709
2723
2710 * IPython/numutils.py (frange): Changed a call from int() to
2724 * IPython/numutils.py (frange): Changed a call from int() to
2711 int(round()) to prevent a problem reported with arange() in the
2725 int(round()) to prevent a problem reported with arange() in the
2712 numpy list.
2726 numpy list.
2713
2727
2714 2003-10-06 Fernando Perez <fperez@colorado.edu>
2728 2003-10-06 Fernando Perez <fperez@colorado.edu>
2715
2729
2716 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2730 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2717 prevent crashes if sys lacks an argv attribute (it happens with
2731 prevent crashes if sys lacks an argv attribute (it happens with
2718 embedded interpreters which build a bare-bones sys module).
2732 embedded interpreters which build a bare-bones sys module).
2719 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2733 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2720
2734
2721 2003-09-24 Fernando Perez <fperez@colorado.edu>
2735 2003-09-24 Fernando Perez <fperez@colorado.edu>
2722
2736
2723 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2737 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2724 to protect against poorly written user objects where __getattr__
2738 to protect against poorly written user objects where __getattr__
2725 raises exceptions other than AttributeError. Thanks to a bug
2739 raises exceptions other than AttributeError. Thanks to a bug
2726 report by Oliver Sander <osander-AT-gmx.de>.
2740 report by Oliver Sander <osander-AT-gmx.de>.
2727
2741
2728 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2742 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2729 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2743 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2730
2744
2731 2003-09-09 Fernando Perez <fperez@colorado.edu>
2745 2003-09-09 Fernando Perez <fperez@colorado.edu>
2732
2746
2733 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2747 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2734 unpacking a list whith a callable as first element would
2748 unpacking a list whith a callable as first element would
2735 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2749 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2736 Collins.
2750 Collins.
2737
2751
2738 2003-08-25 *** Released version 0.5.0
2752 2003-08-25 *** Released version 0.5.0
2739
2753
2740 2003-08-22 Fernando Perez <fperez@colorado.edu>
2754 2003-08-22 Fernando Perez <fperez@colorado.edu>
2741
2755
2742 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2756 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2743 improperly defined user exceptions. Thanks to feedback from Mark
2757 improperly defined user exceptions. Thanks to feedback from Mark
2744 Russell <mrussell-AT-verio.net>.
2758 Russell <mrussell-AT-verio.net>.
2745
2759
2746 2003-08-20 Fernando Perez <fperez@colorado.edu>
2760 2003-08-20 Fernando Perez <fperez@colorado.edu>
2747
2761
2748 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2762 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2749 printing so that it would print multi-line string forms starting
2763 printing so that it would print multi-line string forms starting
2750 with a new line. This way the formatting is better respected for
2764 with a new line. This way the formatting is better respected for
2751 objects which work hard to make nice string forms.
2765 objects which work hard to make nice string forms.
2752
2766
2753 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2767 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2754 autocall would overtake data access for objects with both
2768 autocall would overtake data access for objects with both
2755 __getitem__ and __call__.
2769 __getitem__ and __call__.
2756
2770
2757 2003-08-19 *** Released version 0.5.0-rc1
2771 2003-08-19 *** Released version 0.5.0-rc1
2758
2772
2759 2003-08-19 Fernando Perez <fperez@colorado.edu>
2773 2003-08-19 Fernando Perez <fperez@colorado.edu>
2760
2774
2761 * IPython/deep_reload.py (load_tail): single tiny change here
2775 * IPython/deep_reload.py (load_tail): single tiny change here
2762 seems to fix the long-standing bug of dreload() failing to work
2776 seems to fix the long-standing bug of dreload() failing to work
2763 for dotted names. But this module is pretty tricky, so I may have
2777 for dotted names. But this module is pretty tricky, so I may have
2764 missed some subtlety. Needs more testing!.
2778 missed some subtlety. Needs more testing!.
2765
2779
2766 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2780 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2767 exceptions which have badly implemented __str__ methods.
2781 exceptions which have badly implemented __str__ methods.
2768 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2782 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2769 which I've been getting reports about from Python 2.3 users. I
2783 which I've been getting reports about from Python 2.3 users. I
2770 wish I had a simple test case to reproduce the problem, so I could
2784 wish I had a simple test case to reproduce the problem, so I could
2771 either write a cleaner workaround or file a bug report if
2785 either write a cleaner workaround or file a bug report if
2772 necessary.
2786 necessary.
2773
2787
2774 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2788 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2775 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2789 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2776 a bug report by Tjabo Kloppenburg.
2790 a bug report by Tjabo Kloppenburg.
2777
2791
2778 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2792 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2779 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2793 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2780 seems rather unstable. Thanks to a bug report by Tjabo
2794 seems rather unstable. Thanks to a bug report by Tjabo
2781 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2795 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2782
2796
2783 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2797 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2784 this out soon because of the critical fixes in the inner loop for
2798 this out soon because of the critical fixes in the inner loop for
2785 generators.
2799 generators.
2786
2800
2787 * IPython/Magic.py (Magic.getargspec): removed. This (and
2801 * IPython/Magic.py (Magic.getargspec): removed. This (and
2788 _get_def) have been obsoleted by OInspect for a long time, I
2802 _get_def) have been obsoleted by OInspect for a long time, I
2789 hadn't noticed that they were dead code.
2803 hadn't noticed that they were dead code.
2790 (Magic._ofind): restored _ofind functionality for a few literals
2804 (Magic._ofind): restored _ofind functionality for a few literals
2791 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2805 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2792 for things like "hello".capitalize?, since that would require a
2806 for things like "hello".capitalize?, since that would require a
2793 potentially dangerous eval() again.
2807 potentially dangerous eval() again.
2794
2808
2795 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2809 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2796 logic a bit more to clean up the escapes handling and minimize the
2810 logic a bit more to clean up the escapes handling and minimize the
2797 use of _ofind to only necessary cases. The interactive 'feel' of
2811 use of _ofind to only necessary cases. The interactive 'feel' of
2798 IPython should have improved quite a bit with the changes in
2812 IPython should have improved quite a bit with the changes in
2799 _prefilter and _ofind (besides being far safer than before).
2813 _prefilter and _ofind (besides being far safer than before).
2800
2814
2801 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2815 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2802 obscure, never reported). Edit would fail to find the object to
2816 obscure, never reported). Edit would fail to find the object to
2803 edit under some circumstances.
2817 edit under some circumstances.
2804 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2818 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2805 which were causing double-calling of generators. Those eval calls
2819 which were causing double-calling of generators. Those eval calls
2806 were _very_ dangerous, since code with side effects could be
2820 were _very_ dangerous, since code with side effects could be
2807 triggered. As they say, 'eval is evil'... These were the
2821 triggered. As they say, 'eval is evil'... These were the
2808 nastiest evals in IPython. Besides, _ofind is now far simpler,
2822 nastiest evals in IPython. Besides, _ofind is now far simpler,
2809 and it should also be quite a bit faster. Its use of inspect is
2823 and it should also be quite a bit faster. Its use of inspect is
2810 also safer, so perhaps some of the inspect-related crashes I've
2824 also safer, so perhaps some of the inspect-related crashes I've
2811 seen lately with Python 2.3 might be taken care of. That will
2825 seen lately with Python 2.3 might be taken care of. That will
2812 need more testing.
2826 need more testing.
2813
2827
2814 2003-08-17 Fernando Perez <fperez@colorado.edu>
2828 2003-08-17 Fernando Perez <fperez@colorado.edu>
2815
2829
2816 * IPython/iplib.py (InteractiveShell._prefilter): significant
2830 * IPython/iplib.py (InteractiveShell._prefilter): significant
2817 simplifications to the logic for handling user escapes. Faster
2831 simplifications to the logic for handling user escapes. Faster
2818 and simpler code.
2832 and simpler code.
2819
2833
2820 2003-08-14 Fernando Perez <fperez@colorado.edu>
2834 2003-08-14 Fernando Perez <fperez@colorado.edu>
2821
2835
2822 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2836 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2823 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2837 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2824 but it should be quite a bit faster. And the recursive version
2838 but it should be quite a bit faster. And the recursive version
2825 generated O(log N) intermediate storage for all rank>1 arrays,
2839 generated O(log N) intermediate storage for all rank>1 arrays,
2826 even if they were contiguous.
2840 even if they were contiguous.
2827 (l1norm): Added this function.
2841 (l1norm): Added this function.
2828 (norm): Added this function for arbitrary norms (including
2842 (norm): Added this function for arbitrary norms (including
2829 l-infinity). l1 and l2 are still special cases for convenience
2843 l-infinity). l1 and l2 are still special cases for convenience
2830 and speed.
2844 and speed.
2831
2845
2832 2003-08-03 Fernando Perez <fperez@colorado.edu>
2846 2003-08-03 Fernando Perez <fperez@colorado.edu>
2833
2847
2834 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2848 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2835 exceptions, which now raise PendingDeprecationWarnings in Python
2849 exceptions, which now raise PendingDeprecationWarnings in Python
2836 2.3. There were some in Magic and some in Gnuplot2.
2850 2.3. There were some in Magic and some in Gnuplot2.
2837
2851
2838 2003-06-30 Fernando Perez <fperez@colorado.edu>
2852 2003-06-30 Fernando Perez <fperez@colorado.edu>
2839
2853
2840 * IPython/genutils.py (page): modified to call curses only for
2854 * IPython/genutils.py (page): modified to call curses only for
2841 terminals where TERM=='xterm'. After problems under many other
2855 terminals where TERM=='xterm'. After problems under many other
2842 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2856 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2843
2857
2844 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2858 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2845 would be triggered when readline was absent. This was just an old
2859 would be triggered when readline was absent. This was just an old
2846 debugging statement I'd forgotten to take out.
2860 debugging statement I'd forgotten to take out.
2847
2861
2848 2003-06-20 Fernando Perez <fperez@colorado.edu>
2862 2003-06-20 Fernando Perez <fperez@colorado.edu>
2849
2863
2850 * IPython/genutils.py (clock): modified to return only user time
2864 * IPython/genutils.py (clock): modified to return only user time
2851 (not counting system time), after a discussion on scipy. While
2865 (not counting system time), after a discussion on scipy. While
2852 system time may be a useful quantity occasionally, it may much
2866 system time may be a useful quantity occasionally, it may much
2853 more easily be skewed by occasional swapping or other similar
2867 more easily be skewed by occasional swapping or other similar
2854 activity.
2868 activity.
2855
2869
2856 2003-06-05 Fernando Perez <fperez@colorado.edu>
2870 2003-06-05 Fernando Perez <fperez@colorado.edu>
2857
2871
2858 * IPython/numutils.py (identity): new function, for building
2872 * IPython/numutils.py (identity): new function, for building
2859 arbitrary rank Kronecker deltas (mostly backwards compatible with
2873 arbitrary rank Kronecker deltas (mostly backwards compatible with
2860 Numeric.identity)
2874 Numeric.identity)
2861
2875
2862 2003-06-03 Fernando Perez <fperez@colorado.edu>
2876 2003-06-03 Fernando Perez <fperez@colorado.edu>
2863
2877
2864 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2878 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2865 arguments passed to magics with spaces, to allow trailing '\' to
2879 arguments passed to magics with spaces, to allow trailing '\' to
2866 work normally (mainly for Windows users).
2880 work normally (mainly for Windows users).
2867
2881
2868 2003-05-29 Fernando Perez <fperez@colorado.edu>
2882 2003-05-29 Fernando Perez <fperez@colorado.edu>
2869
2883
2870 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2884 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2871 instead of pydoc.help. This fixes a bizarre behavior where
2885 instead of pydoc.help. This fixes a bizarre behavior where
2872 printing '%s' % locals() would trigger the help system. Now
2886 printing '%s' % locals() would trigger the help system. Now
2873 ipython behaves like normal python does.
2887 ipython behaves like normal python does.
2874
2888
2875 Note that if one does 'from pydoc import help', the bizarre
2889 Note that if one does 'from pydoc import help', the bizarre
2876 behavior returns, but this will also happen in normal python, so
2890 behavior returns, but this will also happen in normal python, so
2877 it's not an ipython bug anymore (it has to do with how pydoc.help
2891 it's not an ipython bug anymore (it has to do with how pydoc.help
2878 is implemented).
2892 is implemented).
2879
2893
2880 2003-05-22 Fernando Perez <fperez@colorado.edu>
2894 2003-05-22 Fernando Perez <fperez@colorado.edu>
2881
2895
2882 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2896 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2883 return [] instead of None when nothing matches, also match to end
2897 return [] instead of None when nothing matches, also match to end
2884 of line. Patch by Gary Bishop.
2898 of line. Patch by Gary Bishop.
2885
2899
2886 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2900 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2887 protection as before, for files passed on the command line. This
2901 protection as before, for files passed on the command line. This
2888 prevents the CrashHandler from kicking in if user files call into
2902 prevents the CrashHandler from kicking in if user files call into
2889 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2903 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2890 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2904 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2891
2905
2892 2003-05-20 *** Released version 0.4.0
2906 2003-05-20 *** Released version 0.4.0
2893
2907
2894 2003-05-20 Fernando Perez <fperez@colorado.edu>
2908 2003-05-20 Fernando Perez <fperez@colorado.edu>
2895
2909
2896 * setup.py: added support for manpages. It's a bit hackish b/c of
2910 * setup.py: added support for manpages. It's a bit hackish b/c of
2897 a bug in the way the bdist_rpm distutils target handles gzipped
2911 a bug in the way the bdist_rpm distutils target handles gzipped
2898 manpages, but it works. After a patch by Jack.
2912 manpages, but it works. After a patch by Jack.
2899
2913
2900 2003-05-19 Fernando Perez <fperez@colorado.edu>
2914 2003-05-19 Fernando Perez <fperez@colorado.edu>
2901
2915
2902 * IPython/numutils.py: added a mockup of the kinds module, since
2916 * IPython/numutils.py: added a mockup of the kinds module, since
2903 it was recently removed from Numeric. This way, numutils will
2917 it was recently removed from Numeric. This way, numutils will
2904 work for all users even if they are missing kinds.
2918 work for all users even if they are missing kinds.
2905
2919
2906 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2920 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2907 failure, which can occur with SWIG-wrapped extensions. After a
2921 failure, which can occur with SWIG-wrapped extensions. After a
2908 crash report from Prabhu.
2922 crash report from Prabhu.
2909
2923
2910 2003-05-16 Fernando Perez <fperez@colorado.edu>
2924 2003-05-16 Fernando Perez <fperez@colorado.edu>
2911
2925
2912 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2926 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2913 protect ipython from user code which may call directly
2927 protect ipython from user code which may call directly
2914 sys.excepthook (this looks like an ipython crash to the user, even
2928 sys.excepthook (this looks like an ipython crash to the user, even
2915 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2929 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2916 This is especially important to help users of WxWindows, but may
2930 This is especially important to help users of WxWindows, but may
2917 also be useful in other cases.
2931 also be useful in other cases.
2918
2932
2919 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2933 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2920 an optional tb_offset to be specified, and to preserve exception
2934 an optional tb_offset to be specified, and to preserve exception
2921 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2935 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2922
2936
2923 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2937 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2924
2938
2925 2003-05-15 Fernando Perez <fperez@colorado.edu>
2939 2003-05-15 Fernando Perez <fperez@colorado.edu>
2926
2940
2927 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2941 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2928 installing for a new user under Windows.
2942 installing for a new user under Windows.
2929
2943
2930 2003-05-12 Fernando Perez <fperez@colorado.edu>
2944 2003-05-12 Fernando Perez <fperez@colorado.edu>
2931
2945
2932 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2946 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2933 handler for Emacs comint-based lines. Currently it doesn't do
2947 handler for Emacs comint-based lines. Currently it doesn't do
2934 much (but importantly, it doesn't update the history cache). In
2948 much (but importantly, it doesn't update the history cache). In
2935 the future it may be expanded if Alex needs more functionality
2949 the future it may be expanded if Alex needs more functionality
2936 there.
2950 there.
2937
2951
2938 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2952 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2939 info to crash reports.
2953 info to crash reports.
2940
2954
2941 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2955 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2942 just like Python's -c. Also fixed crash with invalid -color
2956 just like Python's -c. Also fixed crash with invalid -color
2943 option value at startup. Thanks to Will French
2957 option value at startup. Thanks to Will French
2944 <wfrench-AT-bestweb.net> for the bug report.
2958 <wfrench-AT-bestweb.net> for the bug report.
2945
2959
2946 2003-05-09 Fernando Perez <fperez@colorado.edu>
2960 2003-05-09 Fernando Perez <fperez@colorado.edu>
2947
2961
2948 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2962 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2949 to EvalDict (it's a mapping, after all) and simplified its code
2963 to EvalDict (it's a mapping, after all) and simplified its code
2950 quite a bit, after a nice discussion on c.l.py where Gustavo
2964 quite a bit, after a nice discussion on c.l.py where Gustavo
2951 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2965 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2952
2966
2953 2003-04-30 Fernando Perez <fperez@colorado.edu>
2967 2003-04-30 Fernando Perez <fperez@colorado.edu>
2954
2968
2955 * IPython/genutils.py (timings_out): modified it to reduce its
2969 * IPython/genutils.py (timings_out): modified it to reduce its
2956 overhead in the common reps==1 case.
2970 overhead in the common reps==1 case.
2957
2971
2958 2003-04-29 Fernando Perez <fperez@colorado.edu>
2972 2003-04-29 Fernando Perez <fperez@colorado.edu>
2959
2973
2960 * IPython/genutils.py (timings_out): Modified to use the resource
2974 * IPython/genutils.py (timings_out): Modified to use the resource
2961 module, which avoids the wraparound problems of time.clock().
2975 module, which avoids the wraparound problems of time.clock().
2962
2976
2963 2003-04-17 *** Released version 0.2.15pre4
2977 2003-04-17 *** Released version 0.2.15pre4
2964
2978
2965 2003-04-17 Fernando Perez <fperez@colorado.edu>
2979 2003-04-17 Fernando Perez <fperez@colorado.edu>
2966
2980
2967 * setup.py (scriptfiles): Split windows-specific stuff over to a
2981 * setup.py (scriptfiles): Split windows-specific stuff over to a
2968 separate file, in an attempt to have a Windows GUI installer.
2982 separate file, in an attempt to have a Windows GUI installer.
2969 That didn't work, but part of the groundwork is done.
2983 That didn't work, but part of the groundwork is done.
2970
2984
2971 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2985 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2972 indent/unindent with 4 spaces. Particularly useful in combination
2986 indent/unindent with 4 spaces. Particularly useful in combination
2973 with the new auto-indent option.
2987 with the new auto-indent option.
2974
2988
2975 2003-04-16 Fernando Perez <fperez@colorado.edu>
2989 2003-04-16 Fernando Perez <fperez@colorado.edu>
2976
2990
2977 * IPython/Magic.py: various replacements of self.rc for
2991 * IPython/Magic.py: various replacements of self.rc for
2978 self.shell.rc. A lot more remains to be done to fully disentangle
2992 self.shell.rc. A lot more remains to be done to fully disentangle
2979 this class from the main Shell class.
2993 this class from the main Shell class.
2980
2994
2981 * IPython/GnuplotRuntime.py: added checks for mouse support so
2995 * IPython/GnuplotRuntime.py: added checks for mouse support so
2982 that we don't try to enable it if the current gnuplot doesn't
2996 that we don't try to enable it if the current gnuplot doesn't
2983 really support it. Also added checks so that we don't try to
2997 really support it. Also added checks so that we don't try to
2984 enable persist under Windows (where Gnuplot doesn't recognize the
2998 enable persist under Windows (where Gnuplot doesn't recognize the
2985 option).
2999 option).
2986
3000
2987 * IPython/iplib.py (InteractiveShell.interact): Added optional
3001 * IPython/iplib.py (InteractiveShell.interact): Added optional
2988 auto-indenting code, after a patch by King C. Shu
3002 auto-indenting code, after a patch by King C. Shu
2989 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3003 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2990 get along well with pasting indented code. If I ever figure out
3004 get along well with pasting indented code. If I ever figure out
2991 how to make that part go well, it will become on by default.
3005 how to make that part go well, it will become on by default.
2992
3006
2993 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3007 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2994 crash ipython if there was an unmatched '%' in the user's prompt
3008 crash ipython if there was an unmatched '%' in the user's prompt
2995 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3009 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2996
3010
2997 * IPython/iplib.py (InteractiveShell.interact): removed the
3011 * IPython/iplib.py (InteractiveShell.interact): removed the
2998 ability to ask the user whether he wants to crash or not at the
3012 ability to ask the user whether he wants to crash or not at the
2999 'last line' exception handler. Calling functions at that point
3013 'last line' exception handler. Calling functions at that point
3000 changes the stack, and the error reports would have incorrect
3014 changes the stack, and the error reports would have incorrect
3001 tracebacks.
3015 tracebacks.
3002
3016
3003 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3017 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3004 pass through a peger a pretty-printed form of any object. After a
3018 pass through a peger a pretty-printed form of any object. After a
3005 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3019 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3006
3020
3007 2003-04-14 Fernando Perez <fperez@colorado.edu>
3021 2003-04-14 Fernando Perez <fperez@colorado.edu>
3008
3022
3009 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3023 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3010 all files in ~ would be modified at first install (instead of
3024 all files in ~ would be modified at first install (instead of
3011 ~/.ipython). This could be potentially disastrous, as the
3025 ~/.ipython). This could be potentially disastrous, as the
3012 modification (make line-endings native) could damage binary files.
3026 modification (make line-endings native) could damage binary files.
3013
3027
3014 2003-04-10 Fernando Perez <fperez@colorado.edu>
3028 2003-04-10 Fernando Perez <fperez@colorado.edu>
3015
3029
3016 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3030 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3017 handle only lines which are invalid python. This now means that
3031 handle only lines which are invalid python. This now means that
3018 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3032 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3019 for the bug report.
3033 for the bug report.
3020
3034
3021 2003-04-01 Fernando Perez <fperez@colorado.edu>
3035 2003-04-01 Fernando Perez <fperez@colorado.edu>
3022
3036
3023 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3037 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3024 where failing to set sys.last_traceback would crash pdb.pm().
3038 where failing to set sys.last_traceback would crash pdb.pm().
3025 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3039 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3026 report.
3040 report.
3027
3041
3028 2003-03-25 Fernando Perez <fperez@colorado.edu>
3042 2003-03-25 Fernando Perez <fperez@colorado.edu>
3029
3043
3030 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3044 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3031 before printing it (it had a lot of spurious blank lines at the
3045 before printing it (it had a lot of spurious blank lines at the
3032 end).
3046 end).
3033
3047
3034 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3048 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3035 output would be sent 21 times! Obviously people don't use this
3049 output would be sent 21 times! Obviously people don't use this
3036 too often, or I would have heard about it.
3050 too often, or I would have heard about it.
3037
3051
3038 2003-03-24 Fernando Perez <fperez@colorado.edu>
3052 2003-03-24 Fernando Perez <fperez@colorado.edu>
3039
3053
3040 * setup.py (scriptfiles): renamed the data_files parameter from
3054 * setup.py (scriptfiles): renamed the data_files parameter from
3041 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3055 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3042 for the patch.
3056 for the patch.
3043
3057
3044 2003-03-20 Fernando Perez <fperez@colorado.edu>
3058 2003-03-20 Fernando Perez <fperez@colorado.edu>
3045
3059
3046 * IPython/genutils.py (error): added error() and fatal()
3060 * IPython/genutils.py (error): added error() and fatal()
3047 functions.
3061 functions.
3048
3062
3049 2003-03-18 *** Released version 0.2.15pre3
3063 2003-03-18 *** Released version 0.2.15pre3
3050
3064
3051 2003-03-18 Fernando Perez <fperez@colorado.edu>
3065 2003-03-18 Fernando Perez <fperez@colorado.edu>
3052
3066
3053 * setupext/install_data_ext.py
3067 * setupext/install_data_ext.py
3054 (install_data_ext.initialize_options): Class contributed by Jack
3068 (install_data_ext.initialize_options): Class contributed by Jack
3055 Moffit for fixing the old distutils hack. He is sending this to
3069 Moffit for fixing the old distutils hack. He is sending this to
3056 the distutils folks so in the future we may not need it as a
3070 the distutils folks so in the future we may not need it as a
3057 private fix.
3071 private fix.
3058
3072
3059 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3073 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3060 changes for Debian packaging. See his patch for full details.
3074 changes for Debian packaging. See his patch for full details.
3061 The old distutils hack of making the ipythonrc* files carry a
3075 The old distutils hack of making the ipythonrc* files carry a
3062 bogus .py extension is gone, at last. Examples were moved to a
3076 bogus .py extension is gone, at last. Examples were moved to a
3063 separate subdir under doc/, and the separate executable scripts
3077 separate subdir under doc/, and the separate executable scripts
3064 now live in their own directory. Overall a great cleanup. The
3078 now live in their own directory. Overall a great cleanup. The
3065 manual was updated to use the new files, and setup.py has been
3079 manual was updated to use the new files, and setup.py has been
3066 fixed for this setup.
3080 fixed for this setup.
3067
3081
3068 * IPython/PyColorize.py (Parser.usage): made non-executable and
3082 * IPython/PyColorize.py (Parser.usage): made non-executable and
3069 created a pycolor wrapper around it to be included as a script.
3083 created a pycolor wrapper around it to be included as a script.
3070
3084
3071 2003-03-12 *** Released version 0.2.15pre2
3085 2003-03-12 *** Released version 0.2.15pre2
3072
3086
3073 2003-03-12 Fernando Perez <fperez@colorado.edu>
3087 2003-03-12 Fernando Perez <fperez@colorado.edu>
3074
3088
3075 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3089 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3076 long-standing problem with garbage characters in some terminals.
3090 long-standing problem with garbage characters in some terminals.
3077 The issue was really that the \001 and \002 escapes must _only_ be
3091 The issue was really that the \001 and \002 escapes must _only_ be
3078 passed to input prompts (which call readline), but _never_ to
3092 passed to input prompts (which call readline), but _never_ to
3079 normal text to be printed on screen. I changed ColorANSI to have
3093 normal text to be printed on screen. I changed ColorANSI to have
3080 two classes: TermColors and InputTermColors, each with the
3094 two classes: TermColors and InputTermColors, each with the
3081 appropriate escapes for input prompts or normal text. The code in
3095 appropriate escapes for input prompts or normal text. The code in
3082 Prompts.py got slightly more complicated, but this very old and
3096 Prompts.py got slightly more complicated, but this very old and
3083 annoying bug is finally fixed.
3097 annoying bug is finally fixed.
3084
3098
3085 All the credit for nailing down the real origin of this problem
3099 All the credit for nailing down the real origin of this problem
3086 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3100 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3087 *Many* thanks to him for spending quite a bit of effort on this.
3101 *Many* thanks to him for spending quite a bit of effort on this.
3088
3102
3089 2003-03-05 *** Released version 0.2.15pre1
3103 2003-03-05 *** Released version 0.2.15pre1
3090
3104
3091 2003-03-03 Fernando Perez <fperez@colorado.edu>
3105 2003-03-03 Fernando Perez <fperez@colorado.edu>
3092
3106
3093 * IPython/FakeModule.py: Moved the former _FakeModule to a
3107 * IPython/FakeModule.py: Moved the former _FakeModule to a
3094 separate file, because it's also needed by Magic (to fix a similar
3108 separate file, because it's also needed by Magic (to fix a similar
3095 pickle-related issue in @run).
3109 pickle-related issue in @run).
3096
3110
3097 2003-03-02 Fernando Perez <fperez@colorado.edu>
3111 2003-03-02 Fernando Perez <fperez@colorado.edu>
3098
3112
3099 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3113 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3100 the autocall option at runtime.
3114 the autocall option at runtime.
3101 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3115 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3102 across Magic.py to start separating Magic from InteractiveShell.
3116 across Magic.py to start separating Magic from InteractiveShell.
3103 (Magic._ofind): Fixed to return proper namespace for dotted
3117 (Magic._ofind): Fixed to return proper namespace for dotted
3104 names. Before, a dotted name would always return 'not currently
3118 names. Before, a dotted name would always return 'not currently
3105 defined', because it would find the 'parent'. s.x would be found,
3119 defined', because it would find the 'parent'. s.x would be found,
3106 but since 'x' isn't defined by itself, it would get confused.
3120 but since 'x' isn't defined by itself, it would get confused.
3107 (Magic.magic_run): Fixed pickling problems reported by Ralf
3121 (Magic.magic_run): Fixed pickling problems reported by Ralf
3108 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3122 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3109 that I'd used when Mike Heeter reported similar issues at the
3123 that I'd used when Mike Heeter reported similar issues at the
3110 top-level, but now for @run. It boils down to injecting the
3124 top-level, but now for @run. It boils down to injecting the
3111 namespace where code is being executed with something that looks
3125 namespace where code is being executed with something that looks
3112 enough like a module to fool pickle.dump(). Since a pickle stores
3126 enough like a module to fool pickle.dump(). Since a pickle stores
3113 a named reference to the importing module, we need this for
3127 a named reference to the importing module, we need this for
3114 pickles to save something sensible.
3128 pickles to save something sensible.
3115
3129
3116 * IPython/ipmaker.py (make_IPython): added an autocall option.
3130 * IPython/ipmaker.py (make_IPython): added an autocall option.
3117
3131
3118 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3132 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3119 the auto-eval code. Now autocalling is an option, and the code is
3133 the auto-eval code. Now autocalling is an option, and the code is
3120 also vastly safer. There is no more eval() involved at all.
3134 also vastly safer. There is no more eval() involved at all.
3121
3135
3122 2003-03-01 Fernando Perez <fperez@colorado.edu>
3136 2003-03-01 Fernando Perez <fperez@colorado.edu>
3123
3137
3124 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3138 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3125 dict with named keys instead of a tuple.
3139 dict with named keys instead of a tuple.
3126
3140
3127 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3141 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3128
3142
3129 * setup.py (make_shortcut): Fixed message about directories
3143 * setup.py (make_shortcut): Fixed message about directories
3130 created during Windows installation (the directories were ok, just
3144 created during Windows installation (the directories were ok, just
3131 the printed message was misleading). Thanks to Chris Liechti
3145 the printed message was misleading). Thanks to Chris Liechti
3132 <cliechti-AT-gmx.net> for the heads up.
3146 <cliechti-AT-gmx.net> for the heads up.
3133
3147
3134 2003-02-21 Fernando Perez <fperez@colorado.edu>
3148 2003-02-21 Fernando Perez <fperez@colorado.edu>
3135
3149
3136 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3150 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3137 of ValueError exception when checking for auto-execution. This
3151 of ValueError exception when checking for auto-execution. This
3138 one is raised by things like Numeric arrays arr.flat when the
3152 one is raised by things like Numeric arrays arr.flat when the
3139 array is non-contiguous.
3153 array is non-contiguous.
3140
3154
3141 2003-01-31 Fernando Perez <fperez@colorado.edu>
3155 2003-01-31 Fernando Perez <fperez@colorado.edu>
3142
3156
3143 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3157 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3144 not return any value at all (even though the command would get
3158 not return any value at all (even though the command would get
3145 executed).
3159 executed).
3146 (xsys): Flush stdout right after printing the command to ensure
3160 (xsys): Flush stdout right after printing the command to ensure
3147 proper ordering of commands and command output in the total
3161 proper ordering of commands and command output in the total
3148 output.
3162 output.
3149 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3163 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3150 system/getoutput as defaults. The old ones are kept for
3164 system/getoutput as defaults. The old ones are kept for
3151 compatibility reasons, so no code which uses this library needs
3165 compatibility reasons, so no code which uses this library needs
3152 changing.
3166 changing.
3153
3167
3154 2003-01-27 *** Released version 0.2.14
3168 2003-01-27 *** Released version 0.2.14
3155
3169
3156 2003-01-25 Fernando Perez <fperez@colorado.edu>
3170 2003-01-25 Fernando Perez <fperez@colorado.edu>
3157
3171
3158 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3172 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3159 functions defined in previous edit sessions could not be re-edited
3173 functions defined in previous edit sessions could not be re-edited
3160 (because the temp files were immediately removed). Now temp files
3174 (because the temp files were immediately removed). Now temp files
3161 are removed only at IPython's exit.
3175 are removed only at IPython's exit.
3162 (Magic.magic_run): Improved @run to perform shell-like expansions
3176 (Magic.magic_run): Improved @run to perform shell-like expansions
3163 on its arguments (~users and $VARS). With this, @run becomes more
3177 on its arguments (~users and $VARS). With this, @run becomes more
3164 like a normal command-line.
3178 like a normal command-line.
3165
3179
3166 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3180 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3167 bugs related to embedding and cleaned up that code. A fairly
3181 bugs related to embedding and cleaned up that code. A fairly
3168 important one was the impossibility to access the global namespace
3182 important one was the impossibility to access the global namespace
3169 through the embedded IPython (only local variables were visible).
3183 through the embedded IPython (only local variables were visible).
3170
3184
3171 2003-01-14 Fernando Perez <fperez@colorado.edu>
3185 2003-01-14 Fernando Perez <fperez@colorado.edu>
3172
3186
3173 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3187 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3174 auto-calling to be a bit more conservative. Now it doesn't get
3188 auto-calling to be a bit more conservative. Now it doesn't get
3175 triggered if any of '!=()<>' are in the rest of the input line, to
3189 triggered if any of '!=()<>' are in the rest of the input line, to
3176 allow comparing callables. Thanks to Alex for the heads up.
3190 allow comparing callables. Thanks to Alex for the heads up.
3177
3191
3178 2003-01-07 Fernando Perez <fperez@colorado.edu>
3192 2003-01-07 Fernando Perez <fperez@colorado.edu>
3179
3193
3180 * IPython/genutils.py (page): fixed estimation of the number of
3194 * IPython/genutils.py (page): fixed estimation of the number of
3181 lines in a string to be paged to simply count newlines. This
3195 lines in a string to be paged to simply count newlines. This
3182 prevents over-guessing due to embedded escape sequences. A better
3196 prevents over-guessing due to embedded escape sequences. A better
3183 long-term solution would involve stripping out the control chars
3197 long-term solution would involve stripping out the control chars
3184 for the count, but it's potentially so expensive I just don't
3198 for the count, but it's potentially so expensive I just don't
3185 think it's worth doing.
3199 think it's worth doing.
3186
3200
3187 2002-12-19 *** Released version 0.2.14pre50
3201 2002-12-19 *** Released version 0.2.14pre50
3188
3202
3189 2002-12-19 Fernando Perez <fperez@colorado.edu>
3203 2002-12-19 Fernando Perez <fperez@colorado.edu>
3190
3204
3191 * tools/release (version): Changed release scripts to inform
3205 * tools/release (version): Changed release scripts to inform
3192 Andrea and build a NEWS file with a list of recent changes.
3206 Andrea and build a NEWS file with a list of recent changes.
3193
3207
3194 * IPython/ColorANSI.py (__all__): changed terminal detection
3208 * IPython/ColorANSI.py (__all__): changed terminal detection
3195 code. Seems to work better for xterms without breaking
3209 code. Seems to work better for xterms without breaking
3196 konsole. Will need more testing to determine if WinXP and Mac OSX
3210 konsole. Will need more testing to determine if WinXP and Mac OSX
3197 also work ok.
3211 also work ok.
3198
3212
3199 2002-12-18 *** Released version 0.2.14pre49
3213 2002-12-18 *** Released version 0.2.14pre49
3200
3214
3201 2002-12-18 Fernando Perez <fperez@colorado.edu>
3215 2002-12-18 Fernando Perez <fperez@colorado.edu>
3202
3216
3203 * Docs: added new info about Mac OSX, from Andrea.
3217 * Docs: added new info about Mac OSX, from Andrea.
3204
3218
3205 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3219 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3206 allow direct plotting of python strings whose format is the same
3220 allow direct plotting of python strings whose format is the same
3207 of gnuplot data files.
3221 of gnuplot data files.
3208
3222
3209 2002-12-16 Fernando Perez <fperez@colorado.edu>
3223 2002-12-16 Fernando Perez <fperez@colorado.edu>
3210
3224
3211 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3225 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3212 value of exit question to be acknowledged.
3226 value of exit question to be acknowledged.
3213
3227
3214 2002-12-03 Fernando Perez <fperez@colorado.edu>
3228 2002-12-03 Fernando Perez <fperez@colorado.edu>
3215
3229
3216 * IPython/ipmaker.py: removed generators, which had been added
3230 * IPython/ipmaker.py: removed generators, which had been added
3217 by mistake in an earlier debugging run. This was causing trouble
3231 by mistake in an earlier debugging run. This was causing trouble
3218 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3232 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3219 for pointing this out.
3233 for pointing this out.
3220
3234
3221 2002-11-17 Fernando Perez <fperez@colorado.edu>
3235 2002-11-17 Fernando Perez <fperez@colorado.edu>
3222
3236
3223 * Manual: updated the Gnuplot section.
3237 * Manual: updated the Gnuplot section.
3224
3238
3225 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3239 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3226 a much better split of what goes in Runtime and what goes in
3240 a much better split of what goes in Runtime and what goes in
3227 Interactive.
3241 Interactive.
3228
3242
3229 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3243 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3230 being imported from iplib.
3244 being imported from iplib.
3231
3245
3232 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3246 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3233 for command-passing. Now the global Gnuplot instance is called
3247 for command-passing. Now the global Gnuplot instance is called
3234 'gp' instead of 'g', which was really a far too fragile and
3248 'gp' instead of 'g', which was really a far too fragile and
3235 common name.
3249 common name.
3236
3250
3237 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3251 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3238 bounding boxes generated by Gnuplot for square plots.
3252 bounding boxes generated by Gnuplot for square plots.
3239
3253
3240 * IPython/genutils.py (popkey): new function added. I should
3254 * IPython/genutils.py (popkey): new function added. I should
3241 suggest this on c.l.py as a dict method, it seems useful.
3255 suggest this on c.l.py as a dict method, it seems useful.
3242
3256
3243 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3257 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3244 to transparently handle PostScript generation. MUCH better than
3258 to transparently handle PostScript generation. MUCH better than
3245 the previous plot_eps/replot_eps (which I removed now). The code
3259 the previous plot_eps/replot_eps (which I removed now). The code
3246 is also fairly clean and well documented now (including
3260 is also fairly clean and well documented now (including
3247 docstrings).
3261 docstrings).
3248
3262
3249 2002-11-13 Fernando Perez <fperez@colorado.edu>
3263 2002-11-13 Fernando Perez <fperez@colorado.edu>
3250
3264
3251 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3265 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3252 (inconsistent with options).
3266 (inconsistent with options).
3253
3267
3254 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3268 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3255 manually disabled, I don't know why. Fixed it.
3269 manually disabled, I don't know why. Fixed it.
3256 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3270 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3257 eps output.
3271 eps output.
3258
3272
3259 2002-11-12 Fernando Perez <fperez@colorado.edu>
3273 2002-11-12 Fernando Perez <fperez@colorado.edu>
3260
3274
3261 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3275 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3262 don't propagate up to caller. Fixes crash reported by François
3276 don't propagate up to caller. Fixes crash reported by François
3263 Pinard.
3277 Pinard.
3264
3278
3265 2002-11-09 Fernando Perez <fperez@colorado.edu>
3279 2002-11-09 Fernando Perez <fperez@colorado.edu>
3266
3280
3267 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3281 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3268 history file for new users.
3282 history file for new users.
3269 (make_IPython): fixed bug where initial install would leave the
3283 (make_IPython): fixed bug where initial install would leave the
3270 user running in the .ipython dir.
3284 user running in the .ipython dir.
3271 (make_IPython): fixed bug where config dir .ipython would be
3285 (make_IPython): fixed bug where config dir .ipython would be
3272 created regardless of the given -ipythondir option. Thanks to Cory
3286 created regardless of the given -ipythondir option. Thanks to Cory
3273 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3287 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3274
3288
3275 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3289 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3276 type confirmations. Will need to use it in all of IPython's code
3290 type confirmations. Will need to use it in all of IPython's code
3277 consistently.
3291 consistently.
3278
3292
3279 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3293 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3280 context to print 31 lines instead of the default 5. This will make
3294 context to print 31 lines instead of the default 5. This will make
3281 the crash reports extremely detailed in case the problem is in
3295 the crash reports extremely detailed in case the problem is in
3282 libraries I don't have access to.
3296 libraries I don't have access to.
3283
3297
3284 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3298 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3285 line of defense' code to still crash, but giving users fair
3299 line of defense' code to still crash, but giving users fair
3286 warning. I don't want internal errors to go unreported: if there's
3300 warning. I don't want internal errors to go unreported: if there's
3287 an internal problem, IPython should crash and generate a full
3301 an internal problem, IPython should crash and generate a full
3288 report.
3302 report.
3289
3303
3290 2002-11-08 Fernando Perez <fperez@colorado.edu>
3304 2002-11-08 Fernando Perez <fperez@colorado.edu>
3291
3305
3292 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3306 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3293 otherwise uncaught exceptions which can appear if people set
3307 otherwise uncaught exceptions which can appear if people set
3294 sys.stdout to something badly broken. Thanks to a crash report
3308 sys.stdout to something badly broken. Thanks to a crash report
3295 from henni-AT-mail.brainbot.com.
3309 from henni-AT-mail.brainbot.com.
3296
3310
3297 2002-11-04 Fernando Perez <fperez@colorado.edu>
3311 2002-11-04 Fernando Perez <fperez@colorado.edu>
3298
3312
3299 * IPython/iplib.py (InteractiveShell.interact): added
3313 * IPython/iplib.py (InteractiveShell.interact): added
3300 __IPYTHON__active to the builtins. It's a flag which goes on when
3314 __IPYTHON__active to the builtins. It's a flag which goes on when
3301 the interaction starts and goes off again when it stops. This
3315 the interaction starts and goes off again when it stops. This
3302 allows embedding code to detect being inside IPython. Before this
3316 allows embedding code to detect being inside IPython. Before this
3303 was done via __IPYTHON__, but that only shows that an IPython
3317 was done via __IPYTHON__, but that only shows that an IPython
3304 instance has been created.
3318 instance has been created.
3305
3319
3306 * IPython/Magic.py (Magic.magic_env): I realized that in a
3320 * IPython/Magic.py (Magic.magic_env): I realized that in a
3307 UserDict, instance.data holds the data as a normal dict. So I
3321 UserDict, instance.data holds the data as a normal dict. So I
3308 modified @env to return os.environ.data instead of rebuilding a
3322 modified @env to return os.environ.data instead of rebuilding a
3309 dict by hand.
3323 dict by hand.
3310
3324
3311 2002-11-02 Fernando Perez <fperez@colorado.edu>
3325 2002-11-02 Fernando Perez <fperez@colorado.edu>
3312
3326
3313 * IPython/genutils.py (warn): changed so that level 1 prints no
3327 * IPython/genutils.py (warn): changed so that level 1 prints no
3314 header. Level 2 is now the default (with 'WARNING' header, as
3328 header. Level 2 is now the default (with 'WARNING' header, as
3315 before). I think I tracked all places where changes were needed in
3329 before). I think I tracked all places where changes were needed in
3316 IPython, but outside code using the old level numbering may have
3330 IPython, but outside code using the old level numbering may have
3317 broken.
3331 broken.
3318
3332
3319 * IPython/iplib.py (InteractiveShell.runcode): added this to
3333 * IPython/iplib.py (InteractiveShell.runcode): added this to
3320 handle the tracebacks in SystemExit traps correctly. The previous
3334 handle the tracebacks in SystemExit traps correctly. The previous
3321 code (through interact) was printing more of the stack than
3335 code (through interact) was printing more of the stack than
3322 necessary, showing IPython internal code to the user.
3336 necessary, showing IPython internal code to the user.
3323
3337
3324 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3338 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3325 default. Now that the default at the confirmation prompt is yes,
3339 default. Now that the default at the confirmation prompt is yes,
3326 it's not so intrusive. François' argument that ipython sessions
3340 it's not so intrusive. François' argument that ipython sessions
3327 tend to be complex enough not to lose them from an accidental C-d,
3341 tend to be complex enough not to lose them from an accidental C-d,
3328 is a valid one.
3342 is a valid one.
3329
3343
3330 * IPython/iplib.py (InteractiveShell.interact): added a
3344 * IPython/iplib.py (InteractiveShell.interact): added a
3331 showtraceback() call to the SystemExit trap, and modified the exit
3345 showtraceback() call to the SystemExit trap, and modified the exit
3332 confirmation to have yes as the default.
3346 confirmation to have yes as the default.
3333
3347
3334 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3348 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3335 this file. It's been gone from the code for a long time, this was
3349 this file. It's been gone from the code for a long time, this was
3336 simply leftover junk.
3350 simply leftover junk.
3337
3351
3338 2002-11-01 Fernando Perez <fperez@colorado.edu>
3352 2002-11-01 Fernando Perez <fperez@colorado.edu>
3339
3353
3340 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3354 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3341 added. If set, IPython now traps EOF and asks for
3355 added. If set, IPython now traps EOF and asks for
3342 confirmation. After a request by François Pinard.
3356 confirmation. After a request by François Pinard.
3343
3357
3344 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3358 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3345 of @abort, and with a new (better) mechanism for handling the
3359 of @abort, and with a new (better) mechanism for handling the
3346 exceptions.
3360 exceptions.
3347
3361
3348 2002-10-27 Fernando Perez <fperez@colorado.edu>
3362 2002-10-27 Fernando Perez <fperez@colorado.edu>
3349
3363
3350 * IPython/usage.py (__doc__): updated the --help information and
3364 * IPython/usage.py (__doc__): updated the --help information and
3351 the ipythonrc file to indicate that -log generates
3365 the ipythonrc file to indicate that -log generates
3352 ./ipython.log. Also fixed the corresponding info in @logstart.
3366 ./ipython.log. Also fixed the corresponding info in @logstart.
3353 This and several other fixes in the manuals thanks to reports by
3367 This and several other fixes in the manuals thanks to reports by
3354 François Pinard <pinard-AT-iro.umontreal.ca>.
3368 François Pinard <pinard-AT-iro.umontreal.ca>.
3355
3369
3356 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3370 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3357 refer to @logstart (instead of @log, which doesn't exist).
3371 refer to @logstart (instead of @log, which doesn't exist).
3358
3372
3359 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3373 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3360 AttributeError crash. Thanks to Christopher Armstrong
3374 AttributeError crash. Thanks to Christopher Armstrong
3361 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3375 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3362 introduced recently (in 0.2.14pre37) with the fix to the eval
3376 introduced recently (in 0.2.14pre37) with the fix to the eval
3363 problem mentioned below.
3377 problem mentioned below.
3364
3378
3365 2002-10-17 Fernando Perez <fperez@colorado.edu>
3379 2002-10-17 Fernando Perez <fperez@colorado.edu>
3366
3380
3367 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3381 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3368 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3382 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3369
3383
3370 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3384 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3371 this function to fix a problem reported by Alex Schmolck. He saw
3385 this function to fix a problem reported by Alex Schmolck. He saw
3372 it with list comprehensions and generators, which were getting
3386 it with list comprehensions and generators, which were getting
3373 called twice. The real problem was an 'eval' call in testing for
3387 called twice. The real problem was an 'eval' call in testing for
3374 automagic which was evaluating the input line silently.
3388 automagic which was evaluating the input line silently.
3375
3389
3376 This is a potentially very nasty bug, if the input has side
3390 This is a potentially very nasty bug, if the input has side
3377 effects which must not be repeated. The code is much cleaner now,
3391 effects which must not be repeated. The code is much cleaner now,
3378 without any blanket 'except' left and with a regexp test for
3392 without any blanket 'except' left and with a regexp test for
3379 actual function names.
3393 actual function names.
3380
3394
3381 But an eval remains, which I'm not fully comfortable with. I just
3395 But an eval remains, which I'm not fully comfortable with. I just
3382 don't know how to find out if an expression could be a callable in
3396 don't know how to find out if an expression could be a callable in
3383 the user's namespace without doing an eval on the string. However
3397 the user's namespace without doing an eval on the string. However
3384 that string is now much more strictly checked so that no code
3398 that string is now much more strictly checked so that no code
3385 slips by, so the eval should only happen for things that can
3399 slips by, so the eval should only happen for things that can
3386 really be only function/method names.
3400 really be only function/method names.
3387
3401
3388 2002-10-15 Fernando Perez <fperez@colorado.edu>
3402 2002-10-15 Fernando Perez <fperez@colorado.edu>
3389
3403
3390 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3404 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3391 OSX information to main manual, removed README_Mac_OSX file from
3405 OSX information to main manual, removed README_Mac_OSX file from
3392 distribution. Also updated credits for recent additions.
3406 distribution. Also updated credits for recent additions.
3393
3407
3394 2002-10-10 Fernando Perez <fperez@colorado.edu>
3408 2002-10-10 Fernando Perez <fperez@colorado.edu>
3395
3409
3396 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3410 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3397 terminal-related issues. Many thanks to Andrea Riciputi
3411 terminal-related issues. Many thanks to Andrea Riciputi
3398 <andrea.riciputi-AT-libero.it> for writing it.
3412 <andrea.riciputi-AT-libero.it> for writing it.
3399
3413
3400 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3414 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3401 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3415 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3402
3416
3403 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3417 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3404 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3418 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3405 <syver-en-AT-online.no> who both submitted patches for this problem.
3419 <syver-en-AT-online.no> who both submitted patches for this problem.
3406
3420
3407 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3421 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3408 global embedding to make sure that things don't overwrite user
3422 global embedding to make sure that things don't overwrite user
3409 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3423 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3410
3424
3411 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3425 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3412 compatibility. Thanks to Hayden Callow
3426 compatibility. Thanks to Hayden Callow
3413 <h.callow-AT-elec.canterbury.ac.nz>
3427 <h.callow-AT-elec.canterbury.ac.nz>
3414
3428
3415 2002-10-04 Fernando Perez <fperez@colorado.edu>
3429 2002-10-04 Fernando Perez <fperez@colorado.edu>
3416
3430
3417 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3431 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3418 Gnuplot.File objects.
3432 Gnuplot.File objects.
3419
3433
3420 2002-07-23 Fernando Perez <fperez@colorado.edu>
3434 2002-07-23 Fernando Perez <fperez@colorado.edu>
3421
3435
3422 * IPython/genutils.py (timing): Added timings() and timing() for
3436 * IPython/genutils.py (timing): Added timings() and timing() for
3423 quick access to the most commonly needed data, the execution
3437 quick access to the most commonly needed data, the execution
3424 times. Old timing() renamed to timings_out().
3438 times. Old timing() renamed to timings_out().
3425
3439
3426 2002-07-18 Fernando Perez <fperez@colorado.edu>
3440 2002-07-18 Fernando Perez <fperez@colorado.edu>
3427
3441
3428 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3442 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3429 bug with nested instances disrupting the parent's tab completion.
3443 bug with nested instances disrupting the parent's tab completion.
3430
3444
3431 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3445 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3432 all_completions code to begin the emacs integration.
3446 all_completions code to begin the emacs integration.
3433
3447
3434 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3448 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3435 argument to allow titling individual arrays when plotting.
3449 argument to allow titling individual arrays when plotting.
3436
3450
3437 2002-07-15 Fernando Perez <fperez@colorado.edu>
3451 2002-07-15 Fernando Perez <fperez@colorado.edu>
3438
3452
3439 * setup.py (make_shortcut): changed to retrieve the value of
3453 * setup.py (make_shortcut): changed to retrieve the value of
3440 'Program Files' directory from the registry (this value changes in
3454 'Program Files' directory from the registry (this value changes in
3441 non-english versions of Windows). Thanks to Thomas Fanslau
3455 non-english versions of Windows). Thanks to Thomas Fanslau
3442 <tfanslau-AT-gmx.de> for the report.
3456 <tfanslau-AT-gmx.de> for the report.
3443
3457
3444 2002-07-10 Fernando Perez <fperez@colorado.edu>
3458 2002-07-10 Fernando Perez <fperez@colorado.edu>
3445
3459
3446 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3460 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3447 a bug in pdb, which crashes if a line with only whitespace is
3461 a bug in pdb, which crashes if a line with only whitespace is
3448 entered. Bug report submitted to sourceforge.
3462 entered. Bug report submitted to sourceforge.
3449
3463
3450 2002-07-09 Fernando Perez <fperez@colorado.edu>
3464 2002-07-09 Fernando Perez <fperez@colorado.edu>
3451
3465
3452 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3466 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3453 reporting exceptions (it's a bug in inspect.py, I just set a
3467 reporting exceptions (it's a bug in inspect.py, I just set a
3454 workaround).
3468 workaround).
3455
3469
3456 2002-07-08 Fernando Perez <fperez@colorado.edu>
3470 2002-07-08 Fernando Perez <fperez@colorado.edu>
3457
3471
3458 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3472 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3459 __IPYTHON__ in __builtins__ to show up in user_ns.
3473 __IPYTHON__ in __builtins__ to show up in user_ns.
3460
3474
3461 2002-07-03 Fernando Perez <fperez@colorado.edu>
3475 2002-07-03 Fernando Perez <fperez@colorado.edu>
3462
3476
3463 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3477 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3464 name from @gp_set_instance to @gp_set_default.
3478 name from @gp_set_instance to @gp_set_default.
3465
3479
3466 * IPython/ipmaker.py (make_IPython): default editor value set to
3480 * IPython/ipmaker.py (make_IPython): default editor value set to
3467 '0' (a string), to match the rc file. Otherwise will crash when
3481 '0' (a string), to match the rc file. Otherwise will crash when
3468 .strip() is called on it.
3482 .strip() is called on it.
3469
3483
3470
3484
3471 2002-06-28 Fernando Perez <fperez@colorado.edu>
3485 2002-06-28 Fernando Perez <fperez@colorado.edu>
3472
3486
3473 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3487 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3474 of files in current directory when a file is executed via
3488 of files in current directory when a file is executed via
3475 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3489 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3476
3490
3477 * setup.py (manfiles): fix for rpm builds, submitted by RA
3491 * setup.py (manfiles): fix for rpm builds, submitted by RA
3478 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3492 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3479
3493
3480 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3494 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3481 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3495 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3482 string!). A. Schmolck caught this one.
3496 string!). A. Schmolck caught this one.
3483
3497
3484 2002-06-27 Fernando Perez <fperez@colorado.edu>
3498 2002-06-27 Fernando Perez <fperez@colorado.edu>
3485
3499
3486 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3500 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3487 defined files at the cmd line. __name__ wasn't being set to
3501 defined files at the cmd line. __name__ wasn't being set to
3488 __main__.
3502 __main__.
3489
3503
3490 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3504 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3491 regular lists and tuples besides Numeric arrays.
3505 regular lists and tuples besides Numeric arrays.
3492
3506
3493 * IPython/Prompts.py (CachedOutput.__call__): Added output
3507 * IPython/Prompts.py (CachedOutput.__call__): Added output
3494 supression for input ending with ';'. Similar to Mathematica and
3508 supression for input ending with ';'. Similar to Mathematica and
3495 Matlab. The _* vars and Out[] list are still updated, just like
3509 Matlab. The _* vars and Out[] list are still updated, just like
3496 Mathematica behaves.
3510 Mathematica behaves.
3497
3511
3498 2002-06-25 Fernando Perez <fperez@colorado.edu>
3512 2002-06-25 Fernando Perez <fperez@colorado.edu>
3499
3513
3500 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3514 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3501 .ini extensions for profiels under Windows.
3515 .ini extensions for profiels under Windows.
3502
3516
3503 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3517 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3504 string form. Fix contributed by Alexander Schmolck
3518 string form. Fix contributed by Alexander Schmolck
3505 <a.schmolck-AT-gmx.net>
3519 <a.schmolck-AT-gmx.net>
3506
3520
3507 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3521 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3508 pre-configured Gnuplot instance.
3522 pre-configured Gnuplot instance.
3509
3523
3510 2002-06-21 Fernando Perez <fperez@colorado.edu>
3524 2002-06-21 Fernando Perez <fperez@colorado.edu>
3511
3525
3512 * IPython/numutils.py (exp_safe): new function, works around the
3526 * IPython/numutils.py (exp_safe): new function, works around the
3513 underflow problems in Numeric.
3527 underflow problems in Numeric.
3514 (log2): New fn. Safe log in base 2: returns exact integer answer
3528 (log2): New fn. Safe log in base 2: returns exact integer answer
3515 for exact integer powers of 2.
3529 for exact integer powers of 2.
3516
3530
3517 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3531 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3518 properly.
3532 properly.
3519
3533
3520 2002-06-20 Fernando Perez <fperez@colorado.edu>
3534 2002-06-20 Fernando Perez <fperez@colorado.edu>
3521
3535
3522 * IPython/genutils.py (timing): new function like
3536 * IPython/genutils.py (timing): new function like
3523 Mathematica's. Similar to time_test, but returns more info.
3537 Mathematica's. Similar to time_test, but returns more info.
3524
3538
3525 2002-06-18 Fernando Perez <fperez@colorado.edu>
3539 2002-06-18 Fernando Perez <fperez@colorado.edu>
3526
3540
3527 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3541 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3528 according to Mike Heeter's suggestions.
3542 according to Mike Heeter's suggestions.
3529
3543
3530 2002-06-16 Fernando Perez <fperez@colorado.edu>
3544 2002-06-16 Fernando Perez <fperez@colorado.edu>
3531
3545
3532 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3546 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3533 system. GnuplotMagic is gone as a user-directory option. New files
3547 system. GnuplotMagic is gone as a user-directory option. New files
3534 make it easier to use all the gnuplot stuff both from external
3548 make it easier to use all the gnuplot stuff both from external
3535 programs as well as from IPython. Had to rewrite part of
3549 programs as well as from IPython. Had to rewrite part of
3536 hardcopy() b/c of a strange bug: often the ps files simply don't
3550 hardcopy() b/c of a strange bug: often the ps files simply don't
3537 get created, and require a repeat of the command (often several
3551 get created, and require a repeat of the command (often several
3538 times).
3552 times).
3539
3553
3540 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3554 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3541 resolve output channel at call time, so that if sys.stderr has
3555 resolve output channel at call time, so that if sys.stderr has
3542 been redirected by user this gets honored.
3556 been redirected by user this gets honored.
3543
3557
3544 2002-06-13 Fernando Perez <fperez@colorado.edu>
3558 2002-06-13 Fernando Perez <fperez@colorado.edu>
3545
3559
3546 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3560 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3547 IPShell. Kept a copy with the old names to avoid breaking people's
3561 IPShell. Kept a copy with the old names to avoid breaking people's
3548 embedded code.
3562 embedded code.
3549
3563
3550 * IPython/ipython: simplified it to the bare minimum after
3564 * IPython/ipython: simplified it to the bare minimum after
3551 Holger's suggestions. Added info about how to use it in
3565 Holger's suggestions. Added info about how to use it in
3552 PYTHONSTARTUP.
3566 PYTHONSTARTUP.
3553
3567
3554 * IPython/Shell.py (IPythonShell): changed the options passing
3568 * IPython/Shell.py (IPythonShell): changed the options passing
3555 from a string with funky %s replacements to a straight list. Maybe
3569 from a string with funky %s replacements to a straight list. Maybe
3556 a bit more typing, but it follows sys.argv conventions, so there's
3570 a bit more typing, but it follows sys.argv conventions, so there's
3557 less special-casing to remember.
3571 less special-casing to remember.
3558
3572
3559 2002-06-12 Fernando Perez <fperez@colorado.edu>
3573 2002-06-12 Fernando Perez <fperez@colorado.edu>
3560
3574
3561 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3575 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3562 command. Thanks to a suggestion by Mike Heeter.
3576 command. Thanks to a suggestion by Mike Heeter.
3563 (Magic.magic_pfile): added behavior to look at filenames if given
3577 (Magic.magic_pfile): added behavior to look at filenames if given
3564 arg is not a defined object.
3578 arg is not a defined object.
3565 (Magic.magic_save): New @save function to save code snippets. Also
3579 (Magic.magic_save): New @save function to save code snippets. Also
3566 a Mike Heeter idea.
3580 a Mike Heeter idea.
3567
3581
3568 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3582 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3569 plot() and replot(). Much more convenient now, especially for
3583 plot() and replot(). Much more convenient now, especially for
3570 interactive use.
3584 interactive use.
3571
3585
3572 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3586 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3573 filenames.
3587 filenames.
3574
3588
3575 2002-06-02 Fernando Perez <fperez@colorado.edu>
3589 2002-06-02 Fernando Perez <fperez@colorado.edu>
3576
3590
3577 * IPython/Struct.py (Struct.__init__): modified to admit
3591 * IPython/Struct.py (Struct.__init__): modified to admit
3578 initialization via another struct.
3592 initialization via another struct.
3579
3593
3580 * IPython/genutils.py (SystemExec.__init__): New stateful
3594 * IPython/genutils.py (SystemExec.__init__): New stateful
3581 interface to xsys and bq. Useful for writing system scripts.
3595 interface to xsys and bq. Useful for writing system scripts.
3582
3596
3583 2002-05-30 Fernando Perez <fperez@colorado.edu>
3597 2002-05-30 Fernando Perez <fperez@colorado.edu>
3584
3598
3585 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3599 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3586 documents. This will make the user download smaller (it's getting
3600 documents. This will make the user download smaller (it's getting
3587 too big).
3601 too big).
3588
3602
3589 2002-05-29 Fernando Perez <fperez@colorado.edu>
3603 2002-05-29 Fernando Perez <fperez@colorado.edu>
3590
3604
3591 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3605 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3592 fix problems with shelve and pickle. Seems to work, but I don't
3606 fix problems with shelve and pickle. Seems to work, but I don't
3593 know if corner cases break it. Thanks to Mike Heeter
3607 know if corner cases break it. Thanks to Mike Heeter
3594 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3608 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3595
3609
3596 2002-05-24 Fernando Perez <fperez@colorado.edu>
3610 2002-05-24 Fernando Perez <fperez@colorado.edu>
3597
3611
3598 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3612 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3599 macros having broken.
3613 macros having broken.
3600
3614
3601 2002-05-21 Fernando Perez <fperez@colorado.edu>
3615 2002-05-21 Fernando Perez <fperez@colorado.edu>
3602
3616
3603 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3617 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3604 introduced logging bug: all history before logging started was
3618 introduced logging bug: all history before logging started was
3605 being written one character per line! This came from the redesign
3619 being written one character per line! This came from the redesign
3606 of the input history as a special list which slices to strings,
3620 of the input history as a special list which slices to strings,
3607 not to lists.
3621 not to lists.
3608
3622
3609 2002-05-20 Fernando Perez <fperez@colorado.edu>
3623 2002-05-20 Fernando Perez <fperez@colorado.edu>
3610
3624
3611 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3625 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3612 be an attribute of all classes in this module. The design of these
3626 be an attribute of all classes in this module. The design of these
3613 classes needs some serious overhauling.
3627 classes needs some serious overhauling.
3614
3628
3615 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3629 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3616 which was ignoring '_' in option names.
3630 which was ignoring '_' in option names.
3617
3631
3618 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3632 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3619 'Verbose_novars' to 'Context' and made it the new default. It's a
3633 'Verbose_novars' to 'Context' and made it the new default. It's a
3620 bit more readable and also safer than verbose.
3634 bit more readable and also safer than verbose.
3621
3635
3622 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3636 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3623 triple-quoted strings.
3637 triple-quoted strings.
3624
3638
3625 * IPython/OInspect.py (__all__): new module exposing the object
3639 * IPython/OInspect.py (__all__): new module exposing the object
3626 introspection facilities. Now the corresponding magics are dummy
3640 introspection facilities. Now the corresponding magics are dummy
3627 wrappers around this. Having this module will make it much easier
3641 wrappers around this. Having this module will make it much easier
3628 to put these functions into our modified pdb.
3642 to put these functions into our modified pdb.
3629 This new object inspector system uses the new colorizing module,
3643 This new object inspector system uses the new colorizing module,
3630 so source code and other things are nicely syntax highlighted.
3644 so source code and other things are nicely syntax highlighted.
3631
3645
3632 2002-05-18 Fernando Perez <fperez@colorado.edu>
3646 2002-05-18 Fernando Perez <fperez@colorado.edu>
3633
3647
3634 * IPython/ColorANSI.py: Split the coloring tools into a separate
3648 * IPython/ColorANSI.py: Split the coloring tools into a separate
3635 module so I can use them in other code easier (they were part of
3649 module so I can use them in other code easier (they were part of
3636 ultraTB).
3650 ultraTB).
3637
3651
3638 2002-05-17 Fernando Perez <fperez@colorado.edu>
3652 2002-05-17 Fernando Perez <fperez@colorado.edu>
3639
3653
3640 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3654 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3641 fixed it to set the global 'g' also to the called instance, as
3655 fixed it to set the global 'g' also to the called instance, as
3642 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3656 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3643 user's 'g' variables).
3657 user's 'g' variables).
3644
3658
3645 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3659 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3646 global variables (aliases to _ih,_oh) so that users which expect
3660 global variables (aliases to _ih,_oh) so that users which expect
3647 In[5] or Out[7] to work aren't unpleasantly surprised.
3661 In[5] or Out[7] to work aren't unpleasantly surprised.
3648 (InputList.__getslice__): new class to allow executing slices of
3662 (InputList.__getslice__): new class to allow executing slices of
3649 input history directly. Very simple class, complements the use of
3663 input history directly. Very simple class, complements the use of
3650 macros.
3664 macros.
3651
3665
3652 2002-05-16 Fernando Perez <fperez@colorado.edu>
3666 2002-05-16 Fernando Perez <fperez@colorado.edu>
3653
3667
3654 * setup.py (docdirbase): make doc directory be just doc/IPython
3668 * setup.py (docdirbase): make doc directory be just doc/IPython
3655 without version numbers, it will reduce clutter for users.
3669 without version numbers, it will reduce clutter for users.
3656
3670
3657 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3671 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3658 execfile call to prevent possible memory leak. See for details:
3672 execfile call to prevent possible memory leak. See for details:
3659 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3673 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3660
3674
3661 2002-05-15 Fernando Perez <fperez@colorado.edu>
3675 2002-05-15 Fernando Perez <fperez@colorado.edu>
3662
3676
3663 * IPython/Magic.py (Magic.magic_psource): made the object
3677 * IPython/Magic.py (Magic.magic_psource): made the object
3664 introspection names be more standard: pdoc, pdef, pfile and
3678 introspection names be more standard: pdoc, pdef, pfile and
3665 psource. They all print/page their output, and it makes
3679 psource. They all print/page their output, and it makes
3666 remembering them easier. Kept old names for compatibility as
3680 remembering them easier. Kept old names for compatibility as
3667 aliases.
3681 aliases.
3668
3682
3669 2002-05-14 Fernando Perez <fperez@colorado.edu>
3683 2002-05-14 Fernando Perez <fperez@colorado.edu>
3670
3684
3671 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3685 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3672 what the mouse problem was. The trick is to use gnuplot with temp
3686 what the mouse problem was. The trick is to use gnuplot with temp
3673 files and NOT with pipes (for data communication), because having
3687 files and NOT with pipes (for data communication), because having
3674 both pipes and the mouse on is bad news.
3688 both pipes and the mouse on is bad news.
3675
3689
3676 2002-05-13 Fernando Perez <fperez@colorado.edu>
3690 2002-05-13 Fernando Perez <fperez@colorado.edu>
3677
3691
3678 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3692 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3679 bug. Information would be reported about builtins even when
3693 bug. Information would be reported about builtins even when
3680 user-defined functions overrode them.
3694 user-defined functions overrode them.
3681
3695
3682 2002-05-11 Fernando Perez <fperez@colorado.edu>
3696 2002-05-11 Fernando Perez <fperez@colorado.edu>
3683
3697
3684 * IPython/__init__.py (__all__): removed FlexCompleter from
3698 * IPython/__init__.py (__all__): removed FlexCompleter from
3685 __all__ so that things don't fail in platforms without readline.
3699 __all__ so that things don't fail in platforms without readline.
3686
3700
3687 2002-05-10 Fernando Perez <fperez@colorado.edu>
3701 2002-05-10 Fernando Perez <fperez@colorado.edu>
3688
3702
3689 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3703 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3690 it requires Numeric, effectively making Numeric a dependency for
3704 it requires Numeric, effectively making Numeric a dependency for
3691 IPython.
3705 IPython.
3692
3706
3693 * Released 0.2.13
3707 * Released 0.2.13
3694
3708
3695 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3709 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3696 profiler interface. Now all the major options from the profiler
3710 profiler interface. Now all the major options from the profiler
3697 module are directly supported in IPython, both for single
3711 module are directly supported in IPython, both for single
3698 expressions (@prun) and for full programs (@run -p).
3712 expressions (@prun) and for full programs (@run -p).
3699
3713
3700 2002-05-09 Fernando Perez <fperez@colorado.edu>
3714 2002-05-09 Fernando Perez <fperez@colorado.edu>
3701
3715
3702 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3716 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3703 magic properly formatted for screen.
3717 magic properly formatted for screen.
3704
3718
3705 * setup.py (make_shortcut): Changed things to put pdf version in
3719 * setup.py (make_shortcut): Changed things to put pdf version in
3706 doc/ instead of doc/manual (had to change lyxport a bit).
3720 doc/ instead of doc/manual (had to change lyxport a bit).
3707
3721
3708 * IPython/Magic.py (Profile.string_stats): made profile runs go
3722 * IPython/Magic.py (Profile.string_stats): made profile runs go
3709 through pager (they are long and a pager allows searching, saving,
3723 through pager (they are long and a pager allows searching, saving,
3710 etc.)
3724 etc.)
3711
3725
3712 2002-05-08 Fernando Perez <fperez@colorado.edu>
3726 2002-05-08 Fernando Perez <fperez@colorado.edu>
3713
3727
3714 * Released 0.2.12
3728 * Released 0.2.12
3715
3729
3716 2002-05-06 Fernando Perez <fperez@colorado.edu>
3730 2002-05-06 Fernando Perez <fperez@colorado.edu>
3717
3731
3718 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3732 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3719 introduced); 'hist n1 n2' was broken.
3733 introduced); 'hist n1 n2' was broken.
3720 (Magic.magic_pdb): added optional on/off arguments to @pdb
3734 (Magic.magic_pdb): added optional on/off arguments to @pdb
3721 (Magic.magic_run): added option -i to @run, which executes code in
3735 (Magic.magic_run): added option -i to @run, which executes code in
3722 the IPython namespace instead of a clean one. Also added @irun as
3736 the IPython namespace instead of a clean one. Also added @irun as
3723 an alias to @run -i.
3737 an alias to @run -i.
3724
3738
3725 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3739 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3726 fixed (it didn't really do anything, the namespaces were wrong).
3740 fixed (it didn't really do anything, the namespaces were wrong).
3727
3741
3728 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3742 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3729
3743
3730 * IPython/__init__.py (__all__): Fixed package namespace, now
3744 * IPython/__init__.py (__all__): Fixed package namespace, now
3731 'import IPython' does give access to IPython.<all> as
3745 'import IPython' does give access to IPython.<all> as
3732 expected. Also renamed __release__ to Release.
3746 expected. Also renamed __release__ to Release.
3733
3747
3734 * IPython/Debugger.py (__license__): created new Pdb class which
3748 * IPython/Debugger.py (__license__): created new Pdb class which
3735 functions like a drop-in for the normal pdb.Pdb but does NOT
3749 functions like a drop-in for the normal pdb.Pdb but does NOT
3736 import readline by default. This way it doesn't muck up IPython's
3750 import readline by default. This way it doesn't muck up IPython's
3737 readline handling, and now tab-completion finally works in the
3751 readline handling, and now tab-completion finally works in the
3738 debugger -- sort of. It completes things globally visible, but the
3752 debugger -- sort of. It completes things globally visible, but the
3739 completer doesn't track the stack as pdb walks it. That's a bit
3753 completer doesn't track the stack as pdb walks it. That's a bit
3740 tricky, and I'll have to implement it later.
3754 tricky, and I'll have to implement it later.
3741
3755
3742 2002-05-05 Fernando Perez <fperez@colorado.edu>
3756 2002-05-05 Fernando Perez <fperez@colorado.edu>
3743
3757
3744 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3758 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3745 magic docstrings when printed via ? (explicit \'s were being
3759 magic docstrings when printed via ? (explicit \'s were being
3746 printed).
3760 printed).
3747
3761
3748 * IPython/ipmaker.py (make_IPython): fixed namespace
3762 * IPython/ipmaker.py (make_IPython): fixed namespace
3749 identification bug. Now variables loaded via logs or command-line
3763 identification bug. Now variables loaded via logs or command-line
3750 files are recognized in the interactive namespace by @who.
3764 files are recognized in the interactive namespace by @who.
3751
3765
3752 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3766 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3753 log replay system stemming from the string form of Structs.
3767 log replay system stemming from the string form of Structs.
3754
3768
3755 * IPython/Magic.py (Macro.__init__): improved macros to properly
3769 * IPython/Magic.py (Macro.__init__): improved macros to properly
3756 handle magic commands in them.
3770 handle magic commands in them.
3757 (Magic.magic_logstart): usernames are now expanded so 'logstart
3771 (Magic.magic_logstart): usernames are now expanded so 'logstart
3758 ~/mylog' now works.
3772 ~/mylog' now works.
3759
3773
3760 * IPython/iplib.py (complete): fixed bug where paths starting with
3774 * IPython/iplib.py (complete): fixed bug where paths starting with
3761 '/' would be completed as magic names.
3775 '/' would be completed as magic names.
3762
3776
3763 2002-05-04 Fernando Perez <fperez@colorado.edu>
3777 2002-05-04 Fernando Perez <fperez@colorado.edu>
3764
3778
3765 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3779 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3766 allow running full programs under the profiler's control.
3780 allow running full programs under the profiler's control.
3767
3781
3768 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3782 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3769 mode to report exceptions verbosely but without formatting
3783 mode to report exceptions verbosely but without formatting
3770 variables. This addresses the issue of ipython 'freezing' (it's
3784 variables. This addresses the issue of ipython 'freezing' (it's
3771 not frozen, but caught in an expensive formatting loop) when huge
3785 not frozen, but caught in an expensive formatting loop) when huge
3772 variables are in the context of an exception.
3786 variables are in the context of an exception.
3773 (VerboseTB.text): Added '--->' markers at line where exception was
3787 (VerboseTB.text): Added '--->' markers at line where exception was
3774 triggered. Much clearer to read, especially in NoColor modes.
3788 triggered. Much clearer to read, especially in NoColor modes.
3775
3789
3776 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3790 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3777 implemented in reverse when changing to the new parse_options().
3791 implemented in reverse when changing to the new parse_options().
3778
3792
3779 2002-05-03 Fernando Perez <fperez@colorado.edu>
3793 2002-05-03 Fernando Perez <fperez@colorado.edu>
3780
3794
3781 * IPython/Magic.py (Magic.parse_options): new function so that
3795 * IPython/Magic.py (Magic.parse_options): new function so that
3782 magics can parse options easier.
3796 magics can parse options easier.
3783 (Magic.magic_prun): new function similar to profile.run(),
3797 (Magic.magic_prun): new function similar to profile.run(),
3784 suggested by Chris Hart.
3798 suggested by Chris Hart.
3785 (Magic.magic_cd): fixed behavior so that it only changes if
3799 (Magic.magic_cd): fixed behavior so that it only changes if
3786 directory actually is in history.
3800 directory actually is in history.
3787
3801
3788 * IPython/usage.py (__doc__): added information about potential
3802 * IPython/usage.py (__doc__): added information about potential
3789 slowness of Verbose exception mode when there are huge data
3803 slowness of Verbose exception mode when there are huge data
3790 structures to be formatted (thanks to Archie Paulson).
3804 structures to be formatted (thanks to Archie Paulson).
3791
3805
3792 * IPython/ipmaker.py (make_IPython): Changed default logging
3806 * IPython/ipmaker.py (make_IPython): Changed default logging
3793 (when simply called with -log) to use curr_dir/ipython.log in
3807 (when simply called with -log) to use curr_dir/ipython.log in
3794 rotate mode. Fixed crash which was occuring with -log before
3808 rotate mode. Fixed crash which was occuring with -log before
3795 (thanks to Jim Boyle).
3809 (thanks to Jim Boyle).
3796
3810
3797 2002-05-01 Fernando Perez <fperez@colorado.edu>
3811 2002-05-01 Fernando Perez <fperez@colorado.edu>
3798
3812
3799 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3813 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3800 was nasty -- though somewhat of a corner case).
3814 was nasty -- though somewhat of a corner case).
3801
3815
3802 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3816 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3803 text (was a bug).
3817 text (was a bug).
3804
3818
3805 2002-04-30 Fernando Perez <fperez@colorado.edu>
3819 2002-04-30 Fernando Perez <fperez@colorado.edu>
3806
3820
3807 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3821 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3808 a print after ^D or ^C from the user so that the In[] prompt
3822 a print after ^D or ^C from the user so that the In[] prompt
3809 doesn't over-run the gnuplot one.
3823 doesn't over-run the gnuplot one.
3810
3824
3811 2002-04-29 Fernando Perez <fperez@colorado.edu>
3825 2002-04-29 Fernando Perez <fperez@colorado.edu>
3812
3826
3813 * Released 0.2.10
3827 * Released 0.2.10
3814
3828
3815 * IPython/__release__.py (version): get date dynamically.
3829 * IPython/__release__.py (version): get date dynamically.
3816
3830
3817 * Misc. documentation updates thanks to Arnd's comments. Also ran
3831 * Misc. documentation updates thanks to Arnd's comments. Also ran
3818 a full spellcheck on the manual (hadn't been done in a while).
3832 a full spellcheck on the manual (hadn't been done in a while).
3819
3833
3820 2002-04-27 Fernando Perez <fperez@colorado.edu>
3834 2002-04-27 Fernando Perez <fperez@colorado.edu>
3821
3835
3822 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3836 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3823 starting a log in mid-session would reset the input history list.
3837 starting a log in mid-session would reset the input history list.
3824
3838
3825 2002-04-26 Fernando Perez <fperez@colorado.edu>
3839 2002-04-26 Fernando Perez <fperez@colorado.edu>
3826
3840
3827 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3841 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3828 all files were being included in an update. Now anything in
3842 all files were being included in an update. Now anything in
3829 UserConfig that matches [A-Za-z]*.py will go (this excludes
3843 UserConfig that matches [A-Za-z]*.py will go (this excludes
3830 __init__.py)
3844 __init__.py)
3831
3845
3832 2002-04-25 Fernando Perez <fperez@colorado.edu>
3846 2002-04-25 Fernando Perez <fperez@colorado.edu>
3833
3847
3834 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3848 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3835 to __builtins__ so that any form of embedded or imported code can
3849 to __builtins__ so that any form of embedded or imported code can
3836 test for being inside IPython.
3850 test for being inside IPython.
3837
3851
3838 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3852 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3839 changed to GnuplotMagic because it's now an importable module,
3853 changed to GnuplotMagic because it's now an importable module,
3840 this makes the name follow that of the standard Gnuplot module.
3854 this makes the name follow that of the standard Gnuplot module.
3841 GnuplotMagic can now be loaded at any time in mid-session.
3855 GnuplotMagic can now be loaded at any time in mid-session.
3842
3856
3843 2002-04-24 Fernando Perez <fperez@colorado.edu>
3857 2002-04-24 Fernando Perez <fperez@colorado.edu>
3844
3858
3845 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3859 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3846 the globals (IPython has its own namespace) and the
3860 the globals (IPython has its own namespace) and the
3847 PhysicalQuantity stuff is much better anyway.
3861 PhysicalQuantity stuff is much better anyway.
3848
3862
3849 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3863 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3850 embedding example to standard user directory for
3864 embedding example to standard user directory for
3851 distribution. Also put it in the manual.
3865 distribution. Also put it in the manual.
3852
3866
3853 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3867 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3854 instance as first argument (so it doesn't rely on some obscure
3868 instance as first argument (so it doesn't rely on some obscure
3855 hidden global).
3869 hidden global).
3856
3870
3857 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3871 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3858 delimiters. While it prevents ().TAB from working, it allows
3872 delimiters. While it prevents ().TAB from working, it allows
3859 completions in open (... expressions. This is by far a more common
3873 completions in open (... expressions. This is by far a more common
3860 case.
3874 case.
3861
3875
3862 2002-04-23 Fernando Perez <fperez@colorado.edu>
3876 2002-04-23 Fernando Perez <fperez@colorado.edu>
3863
3877
3864 * IPython/Extensions/InterpreterPasteInput.py: new
3878 * IPython/Extensions/InterpreterPasteInput.py: new
3865 syntax-processing module for pasting lines with >>> or ... at the
3879 syntax-processing module for pasting lines with >>> or ... at the
3866 start.
3880 start.
3867
3881
3868 * IPython/Extensions/PhysicalQ_Interactive.py
3882 * IPython/Extensions/PhysicalQ_Interactive.py
3869 (PhysicalQuantityInteractive.__int__): fixed to work with either
3883 (PhysicalQuantityInteractive.__int__): fixed to work with either
3870 Numeric or math.
3884 Numeric or math.
3871
3885
3872 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3886 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3873 provided profiles. Now we have:
3887 provided profiles. Now we have:
3874 -math -> math module as * and cmath with its own namespace.
3888 -math -> math module as * and cmath with its own namespace.
3875 -numeric -> Numeric as *, plus gnuplot & grace
3889 -numeric -> Numeric as *, plus gnuplot & grace
3876 -physics -> same as before
3890 -physics -> same as before
3877
3891
3878 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3892 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3879 user-defined magics wouldn't be found by @magic if they were
3893 user-defined magics wouldn't be found by @magic if they were
3880 defined as class methods. Also cleaned up the namespace search
3894 defined as class methods. Also cleaned up the namespace search
3881 logic and the string building (to use %s instead of many repeated
3895 logic and the string building (to use %s instead of many repeated
3882 string adds).
3896 string adds).
3883
3897
3884 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3898 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3885 of user-defined magics to operate with class methods (cleaner, in
3899 of user-defined magics to operate with class methods (cleaner, in
3886 line with the gnuplot code).
3900 line with the gnuplot code).
3887
3901
3888 2002-04-22 Fernando Perez <fperez@colorado.edu>
3902 2002-04-22 Fernando Perez <fperez@colorado.edu>
3889
3903
3890 * setup.py: updated dependency list so that manual is updated when
3904 * setup.py: updated dependency list so that manual is updated when
3891 all included files change.
3905 all included files change.
3892
3906
3893 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3907 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3894 the delimiter removal option (the fix is ugly right now).
3908 the delimiter removal option (the fix is ugly right now).
3895
3909
3896 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3910 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3897 all of the math profile (quicker loading, no conflict between
3911 all of the math profile (quicker loading, no conflict between
3898 g-9.8 and g-gnuplot).
3912 g-9.8 and g-gnuplot).
3899
3913
3900 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3914 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3901 name of post-mortem files to IPython_crash_report.txt.
3915 name of post-mortem files to IPython_crash_report.txt.
3902
3916
3903 * Cleanup/update of the docs. Added all the new readline info and
3917 * Cleanup/update of the docs. Added all the new readline info and
3904 formatted all lists as 'real lists'.
3918 formatted all lists as 'real lists'.
3905
3919
3906 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3920 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3907 tab-completion options, since the full readline parse_and_bind is
3921 tab-completion options, since the full readline parse_and_bind is
3908 now accessible.
3922 now accessible.
3909
3923
3910 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3924 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3911 handling of readline options. Now users can specify any string to
3925 handling of readline options. Now users can specify any string to
3912 be passed to parse_and_bind(), as well as the delimiters to be
3926 be passed to parse_and_bind(), as well as the delimiters to be
3913 removed.
3927 removed.
3914 (InteractiveShell.__init__): Added __name__ to the global
3928 (InteractiveShell.__init__): Added __name__ to the global
3915 namespace so that things like Itpl which rely on its existence
3929 namespace so that things like Itpl which rely on its existence
3916 don't crash.
3930 don't crash.
3917 (InteractiveShell._prefilter): Defined the default with a _ so
3931 (InteractiveShell._prefilter): Defined the default with a _ so
3918 that prefilter() is easier to override, while the default one
3932 that prefilter() is easier to override, while the default one
3919 remains available.
3933 remains available.
3920
3934
3921 2002-04-18 Fernando Perez <fperez@colorado.edu>
3935 2002-04-18 Fernando Perez <fperez@colorado.edu>
3922
3936
3923 * Added information about pdb in the docs.
3937 * Added information about pdb in the docs.
3924
3938
3925 2002-04-17 Fernando Perez <fperez@colorado.edu>
3939 2002-04-17 Fernando Perez <fperez@colorado.edu>
3926
3940
3927 * IPython/ipmaker.py (make_IPython): added rc_override option to
3941 * IPython/ipmaker.py (make_IPython): added rc_override option to
3928 allow passing config options at creation time which may override
3942 allow passing config options at creation time which may override
3929 anything set in the config files or command line. This is
3943 anything set in the config files or command line. This is
3930 particularly useful for configuring embedded instances.
3944 particularly useful for configuring embedded instances.
3931
3945
3932 2002-04-15 Fernando Perez <fperez@colorado.edu>
3946 2002-04-15 Fernando Perez <fperez@colorado.edu>
3933
3947
3934 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3948 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3935 crash embedded instances because of the input cache falling out of
3949 crash embedded instances because of the input cache falling out of
3936 sync with the output counter.
3950 sync with the output counter.
3937
3951
3938 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3952 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3939 mode which calls pdb after an uncaught exception in IPython itself.
3953 mode which calls pdb after an uncaught exception in IPython itself.
3940
3954
3941 2002-04-14 Fernando Perez <fperez@colorado.edu>
3955 2002-04-14 Fernando Perez <fperez@colorado.edu>
3942
3956
3943 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3957 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3944 readline, fix it back after each call.
3958 readline, fix it back after each call.
3945
3959
3946 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3960 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3947 method to force all access via __call__(), which guarantees that
3961 method to force all access via __call__(), which guarantees that
3948 traceback references are properly deleted.
3962 traceback references are properly deleted.
3949
3963
3950 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3964 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3951 improve printing when pprint is in use.
3965 improve printing when pprint is in use.
3952
3966
3953 2002-04-13 Fernando Perez <fperez@colorado.edu>
3967 2002-04-13 Fernando Perez <fperez@colorado.edu>
3954
3968
3955 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3969 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3956 exceptions aren't caught anymore. If the user triggers one, he
3970 exceptions aren't caught anymore. If the user triggers one, he
3957 should know why he's doing it and it should go all the way up,
3971 should know why he's doing it and it should go all the way up,
3958 just like any other exception. So now @abort will fully kill the
3972 just like any other exception. So now @abort will fully kill the
3959 embedded interpreter and the embedding code (unless that happens
3973 embedded interpreter and the embedding code (unless that happens
3960 to catch SystemExit).
3974 to catch SystemExit).
3961
3975
3962 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3976 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3963 and a debugger() method to invoke the interactive pdb debugger
3977 and a debugger() method to invoke the interactive pdb debugger
3964 after printing exception information. Also added the corresponding
3978 after printing exception information. Also added the corresponding
3965 -pdb option and @pdb magic to control this feature, and updated
3979 -pdb option and @pdb magic to control this feature, and updated
3966 the docs. After a suggestion from Christopher Hart
3980 the docs. After a suggestion from Christopher Hart
3967 (hart-AT-caltech.edu).
3981 (hart-AT-caltech.edu).
3968
3982
3969 2002-04-12 Fernando Perez <fperez@colorado.edu>
3983 2002-04-12 Fernando Perez <fperez@colorado.edu>
3970
3984
3971 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3985 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3972 the exception handlers defined by the user (not the CrashHandler)
3986 the exception handlers defined by the user (not the CrashHandler)
3973 so that user exceptions don't trigger an ipython bug report.
3987 so that user exceptions don't trigger an ipython bug report.
3974
3988
3975 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3989 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3976 configurable (it should have always been so).
3990 configurable (it should have always been so).
3977
3991
3978 2002-03-26 Fernando Perez <fperez@colorado.edu>
3992 2002-03-26 Fernando Perez <fperez@colorado.edu>
3979
3993
3980 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3994 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3981 and there to fix embedding namespace issues. This should all be
3995 and there to fix embedding namespace issues. This should all be
3982 done in a more elegant way.
3996 done in a more elegant way.
3983
3997
3984 2002-03-25 Fernando Perez <fperez@colorado.edu>
3998 2002-03-25 Fernando Perez <fperez@colorado.edu>
3985
3999
3986 * IPython/genutils.py (get_home_dir): Try to make it work under
4000 * IPython/genutils.py (get_home_dir): Try to make it work under
3987 win9x also.
4001 win9x also.
3988
4002
3989 2002-03-20 Fernando Perez <fperez@colorado.edu>
4003 2002-03-20 Fernando Perez <fperez@colorado.edu>
3990
4004
3991 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4005 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3992 sys.displayhook untouched upon __init__.
4006 sys.displayhook untouched upon __init__.
3993
4007
3994 2002-03-19 Fernando Perez <fperez@colorado.edu>
4008 2002-03-19 Fernando Perez <fperez@colorado.edu>
3995
4009
3996 * Released 0.2.9 (for embedding bug, basically).
4010 * Released 0.2.9 (for embedding bug, basically).
3997
4011
3998 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4012 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3999 exceptions so that enclosing shell's state can be restored.
4013 exceptions so that enclosing shell's state can be restored.
4000
4014
4001 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4015 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4002 naming conventions in the .ipython/ dir.
4016 naming conventions in the .ipython/ dir.
4003
4017
4004 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4018 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4005 from delimiters list so filenames with - in them get expanded.
4019 from delimiters list so filenames with - in them get expanded.
4006
4020
4007 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4021 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4008 sys.displayhook not being properly restored after an embedded call.
4022 sys.displayhook not being properly restored after an embedded call.
4009
4023
4010 2002-03-18 Fernando Perez <fperez@colorado.edu>
4024 2002-03-18 Fernando Perez <fperez@colorado.edu>
4011
4025
4012 * Released 0.2.8
4026 * Released 0.2.8
4013
4027
4014 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4028 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4015 some files weren't being included in a -upgrade.
4029 some files weren't being included in a -upgrade.
4016 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4030 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4017 on' so that the first tab completes.
4031 on' so that the first tab completes.
4018 (InteractiveShell.handle_magic): fixed bug with spaces around
4032 (InteractiveShell.handle_magic): fixed bug with spaces around
4019 quotes breaking many magic commands.
4033 quotes breaking many magic commands.
4020
4034
4021 * setup.py: added note about ignoring the syntax error messages at
4035 * setup.py: added note about ignoring the syntax error messages at
4022 installation.
4036 installation.
4023
4037
4024 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4038 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4025 streamlining the gnuplot interface, now there's only one magic @gp.
4039 streamlining the gnuplot interface, now there's only one magic @gp.
4026
4040
4027 2002-03-17 Fernando Perez <fperez@colorado.edu>
4041 2002-03-17 Fernando Perez <fperez@colorado.edu>
4028
4042
4029 * IPython/UserConfig/magic_gnuplot.py: new name for the
4043 * IPython/UserConfig/magic_gnuplot.py: new name for the
4030 example-magic_pm.py file. Much enhanced system, now with a shell
4044 example-magic_pm.py file. Much enhanced system, now with a shell
4031 for communicating directly with gnuplot, one command at a time.
4045 for communicating directly with gnuplot, one command at a time.
4032
4046
4033 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4047 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4034 setting __name__=='__main__'.
4048 setting __name__=='__main__'.
4035
4049
4036 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4050 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4037 mini-shell for accessing gnuplot from inside ipython. Should
4051 mini-shell for accessing gnuplot from inside ipython. Should
4038 extend it later for grace access too. Inspired by Arnd's
4052 extend it later for grace access too. Inspired by Arnd's
4039 suggestion.
4053 suggestion.
4040
4054
4041 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4055 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4042 calling magic functions with () in their arguments. Thanks to Arnd
4056 calling magic functions with () in their arguments. Thanks to Arnd
4043 Baecker for pointing this to me.
4057 Baecker for pointing this to me.
4044
4058
4045 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4059 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4046 infinitely for integer or complex arrays (only worked with floats).
4060 infinitely for integer or complex arrays (only worked with floats).
4047
4061
4048 2002-03-16 Fernando Perez <fperez@colorado.edu>
4062 2002-03-16 Fernando Perez <fperez@colorado.edu>
4049
4063
4050 * setup.py: Merged setup and setup_windows into a single script
4064 * setup.py: Merged setup and setup_windows into a single script
4051 which properly handles things for windows users.
4065 which properly handles things for windows users.
4052
4066
4053 2002-03-15 Fernando Perez <fperez@colorado.edu>
4067 2002-03-15 Fernando Perez <fperez@colorado.edu>
4054
4068
4055 * Big change to the manual: now the magics are all automatically
4069 * Big change to the manual: now the magics are all automatically
4056 documented. This information is generated from their docstrings
4070 documented. This information is generated from their docstrings
4057 and put in a latex file included by the manual lyx file. This way
4071 and put in a latex file included by the manual lyx file. This way
4058 we get always up to date information for the magics. The manual
4072 we get always up to date information for the magics. The manual
4059 now also has proper version information, also auto-synced.
4073 now also has proper version information, also auto-synced.
4060
4074
4061 For this to work, an undocumented --magic_docstrings option was added.
4075 For this to work, an undocumented --magic_docstrings option was added.
4062
4076
4063 2002-03-13 Fernando Perez <fperez@colorado.edu>
4077 2002-03-13 Fernando Perez <fperez@colorado.edu>
4064
4078
4065 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4079 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4066 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4080 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4067
4081
4068 2002-03-12 Fernando Perez <fperez@colorado.edu>
4082 2002-03-12 Fernando Perez <fperez@colorado.edu>
4069
4083
4070 * IPython/ultraTB.py (TermColors): changed color escapes again to
4084 * IPython/ultraTB.py (TermColors): changed color escapes again to
4071 fix the (old, reintroduced) line-wrapping bug. Basically, if
4085 fix the (old, reintroduced) line-wrapping bug. Basically, if
4072 \001..\002 aren't given in the color escapes, lines get wrapped
4086 \001..\002 aren't given in the color escapes, lines get wrapped
4073 weirdly. But giving those screws up old xterms and emacs terms. So
4087 weirdly. But giving those screws up old xterms and emacs terms. So
4074 I added some logic for emacs terms to be ok, but I can't identify old
4088 I added some logic for emacs terms to be ok, but I can't identify old
4075 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4089 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4076
4090
4077 2002-03-10 Fernando Perez <fperez@colorado.edu>
4091 2002-03-10 Fernando Perez <fperez@colorado.edu>
4078
4092
4079 * IPython/usage.py (__doc__): Various documentation cleanups and
4093 * IPython/usage.py (__doc__): Various documentation cleanups and
4080 updates, both in usage docstrings and in the manual.
4094 updates, both in usage docstrings and in the manual.
4081
4095
4082 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4096 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4083 handling of caching. Set minimum acceptabe value for having a
4097 handling of caching. Set minimum acceptabe value for having a
4084 cache at 20 values.
4098 cache at 20 values.
4085
4099
4086 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4100 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4087 install_first_time function to a method, renamed it and added an
4101 install_first_time function to a method, renamed it and added an
4088 'upgrade' mode. Now people can update their config directory with
4102 'upgrade' mode. Now people can update their config directory with
4089 a simple command line switch (-upgrade, also new).
4103 a simple command line switch (-upgrade, also new).
4090
4104
4091 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4105 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4092 @file (convenient for automagic users under Python >= 2.2).
4106 @file (convenient for automagic users under Python >= 2.2).
4093 Removed @files (it seemed more like a plural than an abbrev. of
4107 Removed @files (it seemed more like a plural than an abbrev. of
4094 'file show').
4108 'file show').
4095
4109
4096 * IPython/iplib.py (install_first_time): Fixed crash if there were
4110 * IPython/iplib.py (install_first_time): Fixed crash if there were
4097 backup files ('~') in .ipython/ install directory.
4111 backup files ('~') in .ipython/ install directory.
4098
4112
4099 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4113 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4100 system. Things look fine, but these changes are fairly
4114 system. Things look fine, but these changes are fairly
4101 intrusive. Test them for a few days.
4115 intrusive. Test them for a few days.
4102
4116
4103 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4117 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4104 the prompts system. Now all in/out prompt strings are user
4118 the prompts system. Now all in/out prompt strings are user
4105 controllable. This is particularly useful for embedding, as one
4119 controllable. This is particularly useful for embedding, as one
4106 can tag embedded instances with particular prompts.
4120 can tag embedded instances with particular prompts.
4107
4121
4108 Also removed global use of sys.ps1/2, which now allows nested
4122 Also removed global use of sys.ps1/2, which now allows nested
4109 embeddings without any problems. Added command-line options for
4123 embeddings without any problems. Added command-line options for
4110 the prompt strings.
4124 the prompt strings.
4111
4125
4112 2002-03-08 Fernando Perez <fperez@colorado.edu>
4126 2002-03-08 Fernando Perez <fperez@colorado.edu>
4113
4127
4114 * IPython/UserConfig/example-embed-short.py (ipshell): added
4128 * IPython/UserConfig/example-embed-short.py (ipshell): added
4115 example file with the bare minimum code for embedding.
4129 example file with the bare minimum code for embedding.
4116
4130
4117 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4131 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4118 functionality for the embeddable shell to be activated/deactivated
4132 functionality for the embeddable shell to be activated/deactivated
4119 either globally or at each call.
4133 either globally or at each call.
4120
4134
4121 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4135 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4122 rewriting the prompt with '--->' for auto-inputs with proper
4136 rewriting the prompt with '--->' for auto-inputs with proper
4123 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4137 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4124 this is handled by the prompts class itself, as it should.
4138 this is handled by the prompts class itself, as it should.
4125
4139
4126 2002-03-05 Fernando Perez <fperez@colorado.edu>
4140 2002-03-05 Fernando Perez <fperez@colorado.edu>
4127
4141
4128 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4142 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4129 @logstart to avoid name clashes with the math log function.
4143 @logstart to avoid name clashes with the math log function.
4130
4144
4131 * Big updates to X/Emacs section of the manual.
4145 * Big updates to X/Emacs section of the manual.
4132
4146
4133 * Removed ipython_emacs. Milan explained to me how to pass
4147 * Removed ipython_emacs. Milan explained to me how to pass
4134 arguments to ipython through Emacs. Some day I'm going to end up
4148 arguments to ipython through Emacs. Some day I'm going to end up
4135 learning some lisp...
4149 learning some lisp...
4136
4150
4137 2002-03-04 Fernando Perez <fperez@colorado.edu>
4151 2002-03-04 Fernando Perez <fperez@colorado.edu>
4138
4152
4139 * IPython/ipython_emacs: Created script to be used as the
4153 * IPython/ipython_emacs: Created script to be used as the
4140 py-python-command Emacs variable so we can pass IPython
4154 py-python-command Emacs variable so we can pass IPython
4141 parameters. I can't figure out how to tell Emacs directly to pass
4155 parameters. I can't figure out how to tell Emacs directly to pass
4142 parameters to IPython, so a dummy shell script will do it.
4156 parameters to IPython, so a dummy shell script will do it.
4143
4157
4144 Other enhancements made for things to work better under Emacs'
4158 Other enhancements made for things to work better under Emacs'
4145 various types of terminals. Many thanks to Milan Zamazal
4159 various types of terminals. Many thanks to Milan Zamazal
4146 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4160 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4147
4161
4148 2002-03-01 Fernando Perez <fperez@colorado.edu>
4162 2002-03-01 Fernando Perez <fperez@colorado.edu>
4149
4163
4150 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4164 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4151 that loading of readline is now optional. This gives better
4165 that loading of readline is now optional. This gives better
4152 control to emacs users.
4166 control to emacs users.
4153
4167
4154 * IPython/ultraTB.py (__date__): Modified color escape sequences
4168 * IPython/ultraTB.py (__date__): Modified color escape sequences
4155 and now things work fine under xterm and in Emacs' term buffers
4169 and now things work fine under xterm and in Emacs' term buffers
4156 (though not shell ones). Well, in emacs you get colors, but all
4170 (though not shell ones). Well, in emacs you get colors, but all
4157 seem to be 'light' colors (no difference between dark and light
4171 seem to be 'light' colors (no difference between dark and light
4158 ones). But the garbage chars are gone, and also in xterms. It
4172 ones). But the garbage chars are gone, and also in xterms. It
4159 seems that now I'm using 'cleaner' ansi sequences.
4173 seems that now I'm using 'cleaner' ansi sequences.
4160
4174
4161 2002-02-21 Fernando Perez <fperez@colorado.edu>
4175 2002-02-21 Fernando Perez <fperez@colorado.edu>
4162
4176
4163 * Released 0.2.7 (mainly to publish the scoping fix).
4177 * Released 0.2.7 (mainly to publish the scoping fix).
4164
4178
4165 * IPython/Logger.py (Logger.logstate): added. A corresponding
4179 * IPython/Logger.py (Logger.logstate): added. A corresponding
4166 @logstate magic was created.
4180 @logstate magic was created.
4167
4181
4168 * IPython/Magic.py: fixed nested scoping problem under Python
4182 * IPython/Magic.py: fixed nested scoping problem under Python
4169 2.1.x (automagic wasn't working).
4183 2.1.x (automagic wasn't working).
4170
4184
4171 2002-02-20 Fernando Perez <fperez@colorado.edu>
4185 2002-02-20 Fernando Perez <fperez@colorado.edu>
4172
4186
4173 * Released 0.2.6.
4187 * Released 0.2.6.
4174
4188
4175 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4189 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4176 option so that logs can come out without any headers at all.
4190 option so that logs can come out without any headers at all.
4177
4191
4178 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4192 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4179 SciPy.
4193 SciPy.
4180
4194
4181 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4195 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4182 that embedded IPython calls don't require vars() to be explicitly
4196 that embedded IPython calls don't require vars() to be explicitly
4183 passed. Now they are extracted from the caller's frame (code
4197 passed. Now they are extracted from the caller's frame (code
4184 snatched from Eric Jones' weave). Added better documentation to
4198 snatched from Eric Jones' weave). Added better documentation to
4185 the section on embedding and the example file.
4199 the section on embedding and the example file.
4186
4200
4187 * IPython/genutils.py (page): Changed so that under emacs, it just
4201 * IPython/genutils.py (page): Changed so that under emacs, it just
4188 prints the string. You can then page up and down in the emacs
4202 prints the string. You can then page up and down in the emacs
4189 buffer itself. This is how the builtin help() works.
4203 buffer itself. This is how the builtin help() works.
4190
4204
4191 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4205 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4192 macro scoping: macros need to be executed in the user's namespace
4206 macro scoping: macros need to be executed in the user's namespace
4193 to work as if they had been typed by the user.
4207 to work as if they had been typed by the user.
4194
4208
4195 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4209 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4196 execute automatically (no need to type 'exec...'). They then
4210 execute automatically (no need to type 'exec...'). They then
4197 behave like 'true macros'. The printing system was also modified
4211 behave like 'true macros'. The printing system was also modified
4198 for this to work.
4212 for this to work.
4199
4213
4200 2002-02-19 Fernando Perez <fperez@colorado.edu>
4214 2002-02-19 Fernando Perez <fperez@colorado.edu>
4201
4215
4202 * IPython/genutils.py (page_file): new function for paging files
4216 * IPython/genutils.py (page_file): new function for paging files
4203 in an OS-independent way. Also necessary for file viewing to work
4217 in an OS-independent way. Also necessary for file viewing to work
4204 well inside Emacs buffers.
4218 well inside Emacs buffers.
4205 (page): Added checks for being in an emacs buffer.
4219 (page): Added checks for being in an emacs buffer.
4206 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4220 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4207 same bug in iplib.
4221 same bug in iplib.
4208
4222
4209 2002-02-18 Fernando Perez <fperez@colorado.edu>
4223 2002-02-18 Fernando Perez <fperez@colorado.edu>
4210
4224
4211 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4225 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4212 of readline so that IPython can work inside an Emacs buffer.
4226 of readline so that IPython can work inside an Emacs buffer.
4213
4227
4214 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4228 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4215 method signatures (they weren't really bugs, but it looks cleaner
4229 method signatures (they weren't really bugs, but it looks cleaner
4216 and keeps PyChecker happy).
4230 and keeps PyChecker happy).
4217
4231
4218 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4232 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4219 for implementing various user-defined hooks. Currently only
4233 for implementing various user-defined hooks. Currently only
4220 display is done.
4234 display is done.
4221
4235
4222 * IPython/Prompts.py (CachedOutput._display): changed display
4236 * IPython/Prompts.py (CachedOutput._display): changed display
4223 functions so that they can be dynamically changed by users easily.
4237 functions so that they can be dynamically changed by users easily.
4224
4238
4225 * IPython/Extensions/numeric_formats.py (num_display): added an
4239 * IPython/Extensions/numeric_formats.py (num_display): added an
4226 extension for printing NumPy arrays in flexible manners. It
4240 extension for printing NumPy arrays in flexible manners. It
4227 doesn't do anything yet, but all the structure is in
4241 doesn't do anything yet, but all the structure is in
4228 place. Ultimately the plan is to implement output format control
4242 place. Ultimately the plan is to implement output format control
4229 like in Octave.
4243 like in Octave.
4230
4244
4231 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4245 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4232 methods are found at run-time by all the automatic machinery.
4246 methods are found at run-time by all the automatic machinery.
4233
4247
4234 2002-02-17 Fernando Perez <fperez@colorado.edu>
4248 2002-02-17 Fernando Perez <fperez@colorado.edu>
4235
4249
4236 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4250 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4237 whole file a little.
4251 whole file a little.
4238
4252
4239 * ToDo: closed this document. Now there's a new_design.lyx
4253 * ToDo: closed this document. Now there's a new_design.lyx
4240 document for all new ideas. Added making a pdf of it for the
4254 document for all new ideas. Added making a pdf of it for the
4241 end-user distro.
4255 end-user distro.
4242
4256
4243 * IPython/Logger.py (Logger.switch_log): Created this to replace
4257 * IPython/Logger.py (Logger.switch_log): Created this to replace
4244 logon() and logoff(). It also fixes a nasty crash reported by
4258 logon() and logoff(). It also fixes a nasty crash reported by
4245 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4259 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4246
4260
4247 * IPython/iplib.py (complete): got auto-completion to work with
4261 * IPython/iplib.py (complete): got auto-completion to work with
4248 automagic (I had wanted this for a long time).
4262 automagic (I had wanted this for a long time).
4249
4263
4250 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4264 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4251 to @file, since file() is now a builtin and clashes with automagic
4265 to @file, since file() is now a builtin and clashes with automagic
4252 for @file.
4266 for @file.
4253
4267
4254 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4268 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4255 of this was previously in iplib, which had grown to more than 2000
4269 of this was previously in iplib, which had grown to more than 2000
4256 lines, way too long. No new functionality, but it makes managing
4270 lines, way too long. No new functionality, but it makes managing
4257 the code a bit easier.
4271 the code a bit easier.
4258
4272
4259 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4273 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4260 information to crash reports.
4274 information to crash reports.
4261
4275
4262 2002-02-12 Fernando Perez <fperez@colorado.edu>
4276 2002-02-12 Fernando Perez <fperez@colorado.edu>
4263
4277
4264 * Released 0.2.5.
4278 * Released 0.2.5.
4265
4279
4266 2002-02-11 Fernando Perez <fperez@colorado.edu>
4280 2002-02-11 Fernando Perez <fperez@colorado.edu>
4267
4281
4268 * Wrote a relatively complete Windows installer. It puts
4282 * Wrote a relatively complete Windows installer. It puts
4269 everything in place, creates Start Menu entries and fixes the
4283 everything in place, creates Start Menu entries and fixes the
4270 color issues. Nothing fancy, but it works.
4284 color issues. Nothing fancy, but it works.
4271
4285
4272 2002-02-10 Fernando Perez <fperez@colorado.edu>
4286 2002-02-10 Fernando Perez <fperez@colorado.edu>
4273
4287
4274 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4288 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4275 os.path.expanduser() call so that we can type @run ~/myfile.py and
4289 os.path.expanduser() call so that we can type @run ~/myfile.py and
4276 have thigs work as expected.
4290 have thigs work as expected.
4277
4291
4278 * IPython/genutils.py (page): fixed exception handling so things
4292 * IPython/genutils.py (page): fixed exception handling so things
4279 work both in Unix and Windows correctly. Quitting a pager triggers
4293 work both in Unix and Windows correctly. Quitting a pager triggers
4280 an IOError/broken pipe in Unix, and in windows not finding a pager
4294 an IOError/broken pipe in Unix, and in windows not finding a pager
4281 is also an IOError, so I had to actually look at the return value
4295 is also an IOError, so I had to actually look at the return value
4282 of the exception, not just the exception itself. Should be ok now.
4296 of the exception, not just the exception itself. Should be ok now.
4283
4297
4284 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4298 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4285 modified to allow case-insensitive color scheme changes.
4299 modified to allow case-insensitive color scheme changes.
4286
4300
4287 2002-02-09 Fernando Perez <fperez@colorado.edu>
4301 2002-02-09 Fernando Perez <fperez@colorado.edu>
4288
4302
4289 * IPython/genutils.py (native_line_ends): new function to leave
4303 * IPython/genutils.py (native_line_ends): new function to leave
4290 user config files with os-native line-endings.
4304 user config files with os-native line-endings.
4291
4305
4292 * README and manual updates.
4306 * README and manual updates.
4293
4307
4294 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4308 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4295 instead of StringType to catch Unicode strings.
4309 instead of StringType to catch Unicode strings.
4296
4310
4297 * IPython/genutils.py (filefind): fixed bug for paths with
4311 * IPython/genutils.py (filefind): fixed bug for paths with
4298 embedded spaces (very common in Windows).
4312 embedded spaces (very common in Windows).
4299
4313
4300 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4314 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4301 files under Windows, so that they get automatically associated
4315 files under Windows, so that they get automatically associated
4302 with a text editor. Windows makes it a pain to handle
4316 with a text editor. Windows makes it a pain to handle
4303 extension-less files.
4317 extension-less files.
4304
4318
4305 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4319 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4306 warning about readline only occur for Posix. In Windows there's no
4320 warning about readline only occur for Posix. In Windows there's no
4307 way to get readline, so why bother with the warning.
4321 way to get readline, so why bother with the warning.
4308
4322
4309 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4323 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4310 for __str__ instead of dir(self), since dir() changed in 2.2.
4324 for __str__ instead of dir(self), since dir() changed in 2.2.
4311
4325
4312 * Ported to Windows! Tested on XP, I suspect it should work fine
4326 * Ported to Windows! Tested on XP, I suspect it should work fine
4313 on NT/2000, but I don't think it will work on 98 et al. That
4327 on NT/2000, but I don't think it will work on 98 et al. That
4314 series of Windows is such a piece of junk anyway that I won't try
4328 series of Windows is such a piece of junk anyway that I won't try
4315 porting it there. The XP port was straightforward, showed a few
4329 porting it there. The XP port was straightforward, showed a few
4316 bugs here and there (fixed all), in particular some string
4330 bugs here and there (fixed all), in particular some string
4317 handling stuff which required considering Unicode strings (which
4331 handling stuff which required considering Unicode strings (which
4318 Windows uses). This is good, but hasn't been too tested :) No
4332 Windows uses). This is good, but hasn't been too tested :) No
4319 fancy installer yet, I'll put a note in the manual so people at
4333 fancy installer yet, I'll put a note in the manual so people at
4320 least make manually a shortcut.
4334 least make manually a shortcut.
4321
4335
4322 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4336 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4323 into a single one, "colors". This now controls both prompt and
4337 into a single one, "colors". This now controls both prompt and
4324 exception color schemes, and can be changed both at startup
4338 exception color schemes, and can be changed both at startup
4325 (either via command-line switches or via ipythonrc files) and at
4339 (either via command-line switches or via ipythonrc files) and at
4326 runtime, with @colors.
4340 runtime, with @colors.
4327 (Magic.magic_run): renamed @prun to @run and removed the old
4341 (Magic.magic_run): renamed @prun to @run and removed the old
4328 @run. The two were too similar to warrant keeping both.
4342 @run. The two were too similar to warrant keeping both.
4329
4343
4330 2002-02-03 Fernando Perez <fperez@colorado.edu>
4344 2002-02-03 Fernando Perez <fperez@colorado.edu>
4331
4345
4332 * IPython/iplib.py (install_first_time): Added comment on how to
4346 * IPython/iplib.py (install_first_time): Added comment on how to
4333 configure the color options for first-time users. Put a <return>
4347 configure the color options for first-time users. Put a <return>
4334 request at the end so that small-terminal users get a chance to
4348 request at the end so that small-terminal users get a chance to
4335 read the startup info.
4349 read the startup info.
4336
4350
4337 2002-01-23 Fernando Perez <fperez@colorado.edu>
4351 2002-01-23 Fernando Perez <fperez@colorado.edu>
4338
4352
4339 * IPython/iplib.py (CachedOutput.update): Changed output memory
4353 * IPython/iplib.py (CachedOutput.update): Changed output memory
4340 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4354 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4341 input history we still use _i. Did this b/c these variable are
4355 input history we still use _i. Did this b/c these variable are
4342 very commonly used in interactive work, so the less we need to
4356 very commonly used in interactive work, so the less we need to
4343 type the better off we are.
4357 type the better off we are.
4344 (Magic.magic_prun): updated @prun to better handle the namespaces
4358 (Magic.magic_prun): updated @prun to better handle the namespaces
4345 the file will run in, including a fix for __name__ not being set
4359 the file will run in, including a fix for __name__ not being set
4346 before.
4360 before.
4347
4361
4348 2002-01-20 Fernando Perez <fperez@colorado.edu>
4362 2002-01-20 Fernando Perez <fperez@colorado.edu>
4349
4363
4350 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4364 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4351 extra garbage for Python 2.2. Need to look more carefully into
4365 extra garbage for Python 2.2. Need to look more carefully into
4352 this later.
4366 this later.
4353
4367
4354 2002-01-19 Fernando Perez <fperez@colorado.edu>
4368 2002-01-19 Fernando Perez <fperez@colorado.edu>
4355
4369
4356 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4370 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4357 display SyntaxError exceptions properly formatted when they occur
4371 display SyntaxError exceptions properly formatted when they occur
4358 (they can be triggered by imported code).
4372 (they can be triggered by imported code).
4359
4373
4360 2002-01-18 Fernando Perez <fperez@colorado.edu>
4374 2002-01-18 Fernando Perez <fperez@colorado.edu>
4361
4375
4362 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4376 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4363 SyntaxError exceptions are reported nicely formatted, instead of
4377 SyntaxError exceptions are reported nicely formatted, instead of
4364 spitting out only offset information as before.
4378 spitting out only offset information as before.
4365 (Magic.magic_prun): Added the @prun function for executing
4379 (Magic.magic_prun): Added the @prun function for executing
4366 programs with command line args inside IPython.
4380 programs with command line args inside IPython.
4367
4381
4368 2002-01-16 Fernando Perez <fperez@colorado.edu>
4382 2002-01-16 Fernando Perez <fperez@colorado.edu>
4369
4383
4370 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4384 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4371 to *not* include the last item given in a range. This brings their
4385 to *not* include the last item given in a range. This brings their
4372 behavior in line with Python's slicing:
4386 behavior in line with Python's slicing:
4373 a[n1:n2] -> a[n1]...a[n2-1]
4387 a[n1:n2] -> a[n1]...a[n2-1]
4374 It may be a bit less convenient, but I prefer to stick to Python's
4388 It may be a bit less convenient, but I prefer to stick to Python's
4375 conventions *everywhere*, so users never have to wonder.
4389 conventions *everywhere*, so users never have to wonder.
4376 (Magic.magic_macro): Added @macro function to ease the creation of
4390 (Magic.magic_macro): Added @macro function to ease the creation of
4377 macros.
4391 macros.
4378
4392
4379 2002-01-05 Fernando Perez <fperez@colorado.edu>
4393 2002-01-05 Fernando Perez <fperez@colorado.edu>
4380
4394
4381 * Released 0.2.4.
4395 * Released 0.2.4.
4382
4396
4383 * IPython/iplib.py (Magic.magic_pdef):
4397 * IPython/iplib.py (Magic.magic_pdef):
4384 (InteractiveShell.safe_execfile): report magic lines and error
4398 (InteractiveShell.safe_execfile): report magic lines and error
4385 lines without line numbers so one can easily copy/paste them for
4399 lines without line numbers so one can easily copy/paste them for
4386 re-execution.
4400 re-execution.
4387
4401
4388 * Updated manual with recent changes.
4402 * Updated manual with recent changes.
4389
4403
4390 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4404 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4391 docstring printing when class? is called. Very handy for knowing
4405 docstring printing when class? is called. Very handy for knowing
4392 how to create class instances (as long as __init__ is well
4406 how to create class instances (as long as __init__ is well
4393 documented, of course :)
4407 documented, of course :)
4394 (Magic.magic_doc): print both class and constructor docstrings.
4408 (Magic.magic_doc): print both class and constructor docstrings.
4395 (Magic.magic_pdef): give constructor info if passed a class and
4409 (Magic.magic_pdef): give constructor info if passed a class and
4396 __call__ info for callable object instances.
4410 __call__ info for callable object instances.
4397
4411
4398 2002-01-04 Fernando Perez <fperez@colorado.edu>
4412 2002-01-04 Fernando Perez <fperez@colorado.edu>
4399
4413
4400 * Made deep_reload() off by default. It doesn't always work
4414 * Made deep_reload() off by default. It doesn't always work
4401 exactly as intended, so it's probably safer to have it off. It's
4415 exactly as intended, so it's probably safer to have it off. It's
4402 still available as dreload() anyway, so nothing is lost.
4416 still available as dreload() anyway, so nothing is lost.
4403
4417
4404 2002-01-02 Fernando Perez <fperez@colorado.edu>
4418 2002-01-02 Fernando Perez <fperez@colorado.edu>
4405
4419
4406 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4420 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4407 so I wanted an updated release).
4421 so I wanted an updated release).
4408
4422
4409 2001-12-27 Fernando Perez <fperez@colorado.edu>
4423 2001-12-27 Fernando Perez <fperez@colorado.edu>
4410
4424
4411 * IPython/iplib.py (InteractiveShell.interact): Added the original
4425 * IPython/iplib.py (InteractiveShell.interact): Added the original
4412 code from 'code.py' for this module in order to change the
4426 code from 'code.py' for this module in order to change the
4413 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4427 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4414 the history cache would break when the user hit Ctrl-C, and
4428 the history cache would break when the user hit Ctrl-C, and
4415 interact() offers no way to add any hooks to it.
4429 interact() offers no way to add any hooks to it.
4416
4430
4417 2001-12-23 Fernando Perez <fperez@colorado.edu>
4431 2001-12-23 Fernando Perez <fperez@colorado.edu>
4418
4432
4419 * setup.py: added check for 'MANIFEST' before trying to remove
4433 * setup.py: added check for 'MANIFEST' before trying to remove
4420 it. Thanks to Sean Reifschneider.
4434 it. Thanks to Sean Reifschneider.
4421
4435
4422 2001-12-22 Fernando Perez <fperez@colorado.edu>
4436 2001-12-22 Fernando Perez <fperez@colorado.edu>
4423
4437
4424 * Released 0.2.2.
4438 * Released 0.2.2.
4425
4439
4426 * Finished (reasonably) writing the manual. Later will add the
4440 * Finished (reasonably) writing the manual. Later will add the
4427 python-standard navigation stylesheets, but for the time being
4441 python-standard navigation stylesheets, but for the time being
4428 it's fairly complete. Distribution will include html and pdf
4442 it's fairly complete. Distribution will include html and pdf
4429 versions.
4443 versions.
4430
4444
4431 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4445 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4432 (MayaVi author).
4446 (MayaVi author).
4433
4447
4434 2001-12-21 Fernando Perez <fperez@colorado.edu>
4448 2001-12-21 Fernando Perez <fperez@colorado.edu>
4435
4449
4436 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4450 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4437 good public release, I think (with the manual and the distutils
4451 good public release, I think (with the manual and the distutils
4438 installer). The manual can use some work, but that can go
4452 installer). The manual can use some work, but that can go
4439 slowly. Otherwise I think it's quite nice for end users. Next
4453 slowly. Otherwise I think it's quite nice for end users. Next
4440 summer, rewrite the guts of it...
4454 summer, rewrite the guts of it...
4441
4455
4442 * Changed format of ipythonrc files to use whitespace as the
4456 * Changed format of ipythonrc files to use whitespace as the
4443 separator instead of an explicit '='. Cleaner.
4457 separator instead of an explicit '='. Cleaner.
4444
4458
4445 2001-12-20 Fernando Perez <fperez@colorado.edu>
4459 2001-12-20 Fernando Perez <fperez@colorado.edu>
4446
4460
4447 * Started a manual in LyX. For now it's just a quick merge of the
4461 * Started a manual in LyX. For now it's just a quick merge of the
4448 various internal docstrings and READMEs. Later it may grow into a
4462 various internal docstrings and READMEs. Later it may grow into a
4449 nice, full-blown manual.
4463 nice, full-blown manual.
4450
4464
4451 * Set up a distutils based installer. Installation should now be
4465 * Set up a distutils based installer. Installation should now be
4452 trivially simple for end-users.
4466 trivially simple for end-users.
4453
4467
4454 2001-12-11 Fernando Perez <fperez@colorado.edu>
4468 2001-12-11 Fernando Perez <fperez@colorado.edu>
4455
4469
4456 * Released 0.2.0. First public release, announced it at
4470 * Released 0.2.0. First public release, announced it at
4457 comp.lang.python. From now on, just bugfixes...
4471 comp.lang.python. From now on, just bugfixes...
4458
4472
4459 * Went through all the files, set copyright/license notices and
4473 * Went through all the files, set copyright/license notices and
4460 cleaned up things. Ready for release.
4474 cleaned up things. Ready for release.
4461
4475
4462 2001-12-10 Fernando Perez <fperez@colorado.edu>
4476 2001-12-10 Fernando Perez <fperez@colorado.edu>
4463
4477
4464 * Changed the first-time installer not to use tarfiles. It's more
4478 * Changed the first-time installer not to use tarfiles. It's more
4465 robust now and less unix-dependent. Also makes it easier for
4479 robust now and less unix-dependent. Also makes it easier for
4466 people to later upgrade versions.
4480 people to later upgrade versions.
4467
4481
4468 * Changed @exit to @abort to reflect the fact that it's pretty
4482 * Changed @exit to @abort to reflect the fact that it's pretty
4469 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4483 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4470 becomes significant only when IPyhton is embedded: in that case,
4484 becomes significant only when IPyhton is embedded: in that case,
4471 C-D closes IPython only, but @abort kills the enclosing program
4485 C-D closes IPython only, but @abort kills the enclosing program
4472 too (unless it had called IPython inside a try catching
4486 too (unless it had called IPython inside a try catching
4473 SystemExit).
4487 SystemExit).
4474
4488
4475 * Created Shell module which exposes the actuall IPython Shell
4489 * Created Shell module which exposes the actuall IPython Shell
4476 classes, currently the normal and the embeddable one. This at
4490 classes, currently the normal and the embeddable one. This at
4477 least offers a stable interface we won't need to change when
4491 least offers a stable interface we won't need to change when
4478 (later) the internals are rewritten. That rewrite will be confined
4492 (later) the internals are rewritten. That rewrite will be confined
4479 to iplib and ipmaker, but the Shell interface should remain as is.
4493 to iplib and ipmaker, but the Shell interface should remain as is.
4480
4494
4481 * Added embed module which offers an embeddable IPShell object,
4495 * Added embed module which offers an embeddable IPShell object,
4482 useful to fire up IPython *inside* a running program. Great for
4496 useful to fire up IPython *inside* a running program. Great for
4483 debugging or dynamical data analysis.
4497 debugging or dynamical data analysis.
4484
4498
4485 2001-12-08 Fernando Perez <fperez@colorado.edu>
4499 2001-12-08 Fernando Perez <fperez@colorado.edu>
4486
4500
4487 * Fixed small bug preventing seeing info from methods of defined
4501 * Fixed small bug preventing seeing info from methods of defined
4488 objects (incorrect namespace in _ofind()).
4502 objects (incorrect namespace in _ofind()).
4489
4503
4490 * Documentation cleanup. Moved the main usage docstrings to a
4504 * Documentation cleanup. Moved the main usage docstrings to a
4491 separate file, usage.py (cleaner to maintain, and hopefully in the
4505 separate file, usage.py (cleaner to maintain, and hopefully in the
4492 future some perlpod-like way of producing interactive, man and
4506 future some perlpod-like way of producing interactive, man and
4493 html docs out of it will be found).
4507 html docs out of it will be found).
4494
4508
4495 * Added @profile to see your profile at any time.
4509 * Added @profile to see your profile at any time.
4496
4510
4497 * Added @p as an alias for 'print'. It's especially convenient if
4511 * Added @p as an alias for 'print'. It's especially convenient if
4498 using automagic ('p x' prints x).
4512 using automagic ('p x' prints x).
4499
4513
4500 * Small cleanups and fixes after a pychecker run.
4514 * Small cleanups and fixes after a pychecker run.
4501
4515
4502 * Changed the @cd command to handle @cd - and @cd -<n> for
4516 * Changed the @cd command to handle @cd - and @cd -<n> for
4503 visiting any directory in _dh.
4517 visiting any directory in _dh.
4504
4518
4505 * Introduced _dh, a history of visited directories. @dhist prints
4519 * Introduced _dh, a history of visited directories. @dhist prints
4506 it out with numbers.
4520 it out with numbers.
4507
4521
4508 2001-12-07 Fernando Perez <fperez@colorado.edu>
4522 2001-12-07 Fernando Perez <fperez@colorado.edu>
4509
4523
4510 * Released 0.1.22
4524 * Released 0.1.22
4511
4525
4512 * Made initialization a bit more robust against invalid color
4526 * Made initialization a bit more robust against invalid color
4513 options in user input (exit, not traceback-crash).
4527 options in user input (exit, not traceback-crash).
4514
4528
4515 * Changed the bug crash reporter to write the report only in the
4529 * Changed the bug crash reporter to write the report only in the
4516 user's .ipython directory. That way IPython won't litter people's
4530 user's .ipython directory. That way IPython won't litter people's
4517 hard disks with crash files all over the place. Also print on
4531 hard disks with crash files all over the place. Also print on
4518 screen the necessary mail command.
4532 screen the necessary mail command.
4519
4533
4520 * With the new ultraTB, implemented LightBG color scheme for light
4534 * With the new ultraTB, implemented LightBG color scheme for light
4521 background terminals. A lot of people like white backgrounds, so I
4535 background terminals. A lot of people like white backgrounds, so I
4522 guess we should at least give them something readable.
4536 guess we should at least give them something readable.
4523
4537
4524 2001-12-06 Fernando Perez <fperez@colorado.edu>
4538 2001-12-06 Fernando Perez <fperez@colorado.edu>
4525
4539
4526 * Modified the structure of ultraTB. Now there's a proper class
4540 * Modified the structure of ultraTB. Now there's a proper class
4527 for tables of color schemes which allow adding schemes easily and
4541 for tables of color schemes which allow adding schemes easily and
4528 switching the active scheme without creating a new instance every
4542 switching the active scheme without creating a new instance every
4529 time (which was ridiculous). The syntax for creating new schemes
4543 time (which was ridiculous). The syntax for creating new schemes
4530 is also cleaner. I think ultraTB is finally done, with a clean
4544 is also cleaner. I think ultraTB is finally done, with a clean
4531 class structure. Names are also much cleaner (now there's proper
4545 class structure. Names are also much cleaner (now there's proper
4532 color tables, no need for every variable to also have 'color' in
4546 color tables, no need for every variable to also have 'color' in
4533 its name).
4547 its name).
4534
4548
4535 * Broke down genutils into separate files. Now genutils only
4549 * Broke down genutils into separate files. Now genutils only
4536 contains utility functions, and classes have been moved to their
4550 contains utility functions, and classes have been moved to their
4537 own files (they had enough independent functionality to warrant
4551 own files (they had enough independent functionality to warrant
4538 it): ConfigLoader, OutputTrap, Struct.
4552 it): ConfigLoader, OutputTrap, Struct.
4539
4553
4540 2001-12-05 Fernando Perez <fperez@colorado.edu>
4554 2001-12-05 Fernando Perez <fperez@colorado.edu>
4541
4555
4542 * IPython turns 21! Released version 0.1.21, as a candidate for
4556 * IPython turns 21! Released version 0.1.21, as a candidate for
4543 public consumption. If all goes well, release in a few days.
4557 public consumption. If all goes well, release in a few days.
4544
4558
4545 * Fixed path bug (files in Extensions/ directory wouldn't be found
4559 * Fixed path bug (files in Extensions/ directory wouldn't be found
4546 unless IPython/ was explicitly in sys.path).
4560 unless IPython/ was explicitly in sys.path).
4547
4561
4548 * Extended the FlexCompleter class as MagicCompleter to allow
4562 * Extended the FlexCompleter class as MagicCompleter to allow
4549 completion of @-starting lines.
4563 completion of @-starting lines.
4550
4564
4551 * Created __release__.py file as a central repository for release
4565 * Created __release__.py file as a central repository for release
4552 info that other files can read from.
4566 info that other files can read from.
4553
4567
4554 * Fixed small bug in logging: when logging was turned on in
4568 * Fixed small bug in logging: when logging was turned on in
4555 mid-session, old lines with special meanings (!@?) were being
4569 mid-session, old lines with special meanings (!@?) were being
4556 logged without the prepended comment, which is necessary since
4570 logged without the prepended comment, which is necessary since
4557 they are not truly valid python syntax. This should make session
4571 they are not truly valid python syntax. This should make session
4558 restores produce less errors.
4572 restores produce less errors.
4559
4573
4560 * The namespace cleanup forced me to make a FlexCompleter class
4574 * The namespace cleanup forced me to make a FlexCompleter class
4561 which is nothing but a ripoff of rlcompleter, but with selectable
4575 which is nothing but a ripoff of rlcompleter, but with selectable
4562 namespace (rlcompleter only works in __main__.__dict__). I'll try
4576 namespace (rlcompleter only works in __main__.__dict__). I'll try
4563 to submit a note to the authors to see if this change can be
4577 to submit a note to the authors to see if this change can be
4564 incorporated in future rlcompleter releases (Dec.6: done)
4578 incorporated in future rlcompleter releases (Dec.6: done)
4565
4579
4566 * More fixes to namespace handling. It was a mess! Now all
4580 * More fixes to namespace handling. It was a mess! Now all
4567 explicit references to __main__.__dict__ are gone (except when
4581 explicit references to __main__.__dict__ are gone (except when
4568 really needed) and everything is handled through the namespace
4582 really needed) and everything is handled through the namespace
4569 dicts in the IPython instance. We seem to be getting somewhere
4583 dicts in the IPython instance. We seem to be getting somewhere
4570 with this, finally...
4584 with this, finally...
4571
4585
4572 * Small documentation updates.
4586 * Small documentation updates.
4573
4587
4574 * Created the Extensions directory under IPython (with an
4588 * Created the Extensions directory under IPython (with an
4575 __init__.py). Put the PhysicalQ stuff there. This directory should
4589 __init__.py). Put the PhysicalQ stuff there. This directory should
4576 be used for all special-purpose extensions.
4590 be used for all special-purpose extensions.
4577
4591
4578 * File renaming:
4592 * File renaming:
4579 ipythonlib --> ipmaker
4593 ipythonlib --> ipmaker
4580 ipplib --> iplib
4594 ipplib --> iplib
4581 This makes a bit more sense in terms of what these files actually do.
4595 This makes a bit more sense in terms of what these files actually do.
4582
4596
4583 * Moved all the classes and functions in ipythonlib to ipplib, so
4597 * Moved all the classes and functions in ipythonlib to ipplib, so
4584 now ipythonlib only has make_IPython(). This will ease up its
4598 now ipythonlib only has make_IPython(). This will ease up its
4585 splitting in smaller functional chunks later.
4599 splitting in smaller functional chunks later.
4586
4600
4587 * Cleaned up (done, I think) output of @whos. Better column
4601 * Cleaned up (done, I think) output of @whos. Better column
4588 formatting, and now shows str(var) for as much as it can, which is
4602 formatting, and now shows str(var) for as much as it can, which is
4589 typically what one gets with a 'print var'.
4603 typically what one gets with a 'print var'.
4590
4604
4591 2001-12-04 Fernando Perez <fperez@colorado.edu>
4605 2001-12-04 Fernando Perez <fperez@colorado.edu>
4592
4606
4593 * Fixed namespace problems. Now builtin/IPyhton/user names get
4607 * Fixed namespace problems. Now builtin/IPyhton/user names get
4594 properly reported in their namespace. Internal namespace handling
4608 properly reported in their namespace. Internal namespace handling
4595 is finally getting decent (not perfect yet, but much better than
4609 is finally getting decent (not perfect yet, but much better than
4596 the ad-hoc mess we had).
4610 the ad-hoc mess we had).
4597
4611
4598 * Removed -exit option. If people just want to run a python
4612 * Removed -exit option. If people just want to run a python
4599 script, that's what the normal interpreter is for. Less
4613 script, that's what the normal interpreter is for. Less
4600 unnecessary options, less chances for bugs.
4614 unnecessary options, less chances for bugs.
4601
4615
4602 * Added a crash handler which generates a complete post-mortem if
4616 * Added a crash handler which generates a complete post-mortem if
4603 IPython crashes. This will help a lot in tracking bugs down the
4617 IPython crashes. This will help a lot in tracking bugs down the
4604 road.
4618 road.
4605
4619
4606 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4620 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4607 which were boud to functions being reassigned would bypass the
4621 which were boud to functions being reassigned would bypass the
4608 logger, breaking the sync of _il with the prompt counter. This
4622 logger, breaking the sync of _il with the prompt counter. This
4609 would then crash IPython later when a new line was logged.
4623 would then crash IPython later when a new line was logged.
4610
4624
4611 2001-12-02 Fernando Perez <fperez@colorado.edu>
4625 2001-12-02 Fernando Perez <fperez@colorado.edu>
4612
4626
4613 * Made IPython a package. This means people don't have to clutter
4627 * Made IPython a package. This means people don't have to clutter
4614 their sys.path with yet another directory. Changed the INSTALL
4628 their sys.path with yet another directory. Changed the INSTALL
4615 file accordingly.
4629 file accordingly.
4616
4630
4617 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4631 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4618 sorts its output (so @who shows it sorted) and @whos formats the
4632 sorts its output (so @who shows it sorted) and @whos formats the
4619 table according to the width of the first column. Nicer, easier to
4633 table according to the width of the first column. Nicer, easier to
4620 read. Todo: write a generic table_format() which takes a list of
4634 read. Todo: write a generic table_format() which takes a list of
4621 lists and prints it nicely formatted, with optional row/column
4635 lists and prints it nicely formatted, with optional row/column
4622 separators and proper padding and justification.
4636 separators and proper padding and justification.
4623
4637
4624 * Released 0.1.20
4638 * Released 0.1.20
4625
4639
4626 * Fixed bug in @log which would reverse the inputcache list (a
4640 * Fixed bug in @log which would reverse the inputcache list (a
4627 copy operation was missing).
4641 copy operation was missing).
4628
4642
4629 * Code cleanup. @config was changed to use page(). Better, since
4643 * Code cleanup. @config was changed to use page(). Better, since
4630 its output is always quite long.
4644 its output is always quite long.
4631
4645
4632 * Itpl is back as a dependency. I was having too many problems
4646 * Itpl is back as a dependency. I was having too many problems
4633 getting the parametric aliases to work reliably, and it's just
4647 getting the parametric aliases to work reliably, and it's just
4634 easier to code weird string operations with it than playing %()s
4648 easier to code weird string operations with it than playing %()s
4635 games. It's only ~6k, so I don't think it's too big a deal.
4649 games. It's only ~6k, so I don't think it's too big a deal.
4636
4650
4637 * Found (and fixed) a very nasty bug with history. !lines weren't
4651 * Found (and fixed) a very nasty bug with history. !lines weren't
4638 getting cached, and the out of sync caches would crash
4652 getting cached, and the out of sync caches would crash
4639 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4653 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4640 division of labor a bit better. Bug fixed, cleaner structure.
4654 division of labor a bit better. Bug fixed, cleaner structure.
4641
4655
4642 2001-12-01 Fernando Perez <fperez@colorado.edu>
4656 2001-12-01 Fernando Perez <fperez@colorado.edu>
4643
4657
4644 * Released 0.1.19
4658 * Released 0.1.19
4645
4659
4646 * Added option -n to @hist to prevent line number printing. Much
4660 * Added option -n to @hist to prevent line number printing. Much
4647 easier to copy/paste code this way.
4661 easier to copy/paste code this way.
4648
4662
4649 * Created global _il to hold the input list. Allows easy
4663 * Created global _il to hold the input list. Allows easy
4650 re-execution of blocks of code by slicing it (inspired by Janko's
4664 re-execution of blocks of code by slicing it (inspired by Janko's
4651 comment on 'macros').
4665 comment on 'macros').
4652
4666
4653 * Small fixes and doc updates.
4667 * Small fixes and doc updates.
4654
4668
4655 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4669 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4656 much too fragile with automagic. Handles properly multi-line
4670 much too fragile with automagic. Handles properly multi-line
4657 statements and takes parameters.
4671 statements and takes parameters.
4658
4672
4659 2001-11-30 Fernando Perez <fperez@colorado.edu>
4673 2001-11-30 Fernando Perez <fperez@colorado.edu>
4660
4674
4661 * Version 0.1.18 released.
4675 * Version 0.1.18 released.
4662
4676
4663 * Fixed nasty namespace bug in initial module imports.
4677 * Fixed nasty namespace bug in initial module imports.
4664
4678
4665 * Added copyright/license notes to all code files (except
4679 * Added copyright/license notes to all code files (except
4666 DPyGetOpt). For the time being, LGPL. That could change.
4680 DPyGetOpt). For the time being, LGPL. That could change.
4667
4681
4668 * Rewrote a much nicer README, updated INSTALL, cleaned up
4682 * Rewrote a much nicer README, updated INSTALL, cleaned up
4669 ipythonrc-* samples.
4683 ipythonrc-* samples.
4670
4684
4671 * Overall code/documentation cleanup. Basically ready for
4685 * Overall code/documentation cleanup. Basically ready for
4672 release. Only remaining thing: licence decision (LGPL?).
4686 release. Only remaining thing: licence decision (LGPL?).
4673
4687
4674 * Converted load_config to a class, ConfigLoader. Now recursion
4688 * Converted load_config to a class, ConfigLoader. Now recursion
4675 control is better organized. Doesn't include the same file twice.
4689 control is better organized. Doesn't include the same file twice.
4676
4690
4677 2001-11-29 Fernando Perez <fperez@colorado.edu>
4691 2001-11-29 Fernando Perez <fperez@colorado.edu>
4678
4692
4679 * Got input history working. Changed output history variables from
4693 * Got input history working. Changed output history variables from
4680 _p to _o so that _i is for input and _o for output. Just cleaner
4694 _p to _o so that _i is for input and _o for output. Just cleaner
4681 convention.
4695 convention.
4682
4696
4683 * Implemented parametric aliases. This pretty much allows the
4697 * Implemented parametric aliases. This pretty much allows the
4684 alias system to offer full-blown shell convenience, I think.
4698 alias system to offer full-blown shell convenience, I think.
4685
4699
4686 * Version 0.1.17 released, 0.1.18 opened.
4700 * Version 0.1.17 released, 0.1.18 opened.
4687
4701
4688 * dot_ipython/ipythonrc (alias): added documentation.
4702 * dot_ipython/ipythonrc (alias): added documentation.
4689 (xcolor): Fixed small bug (xcolors -> xcolor)
4703 (xcolor): Fixed small bug (xcolors -> xcolor)
4690
4704
4691 * Changed the alias system. Now alias is a magic command to define
4705 * Changed the alias system. Now alias is a magic command to define
4692 aliases just like the shell. Rationale: the builtin magics should
4706 aliases just like the shell. Rationale: the builtin magics should
4693 be there for things deeply connected to IPython's
4707 be there for things deeply connected to IPython's
4694 architecture. And this is a much lighter system for what I think
4708 architecture. And this is a much lighter system for what I think
4695 is the really important feature: allowing users to define quickly
4709 is the really important feature: allowing users to define quickly
4696 magics that will do shell things for them, so they can customize
4710 magics that will do shell things for them, so they can customize
4697 IPython easily to match their work habits. If someone is really
4711 IPython easily to match their work habits. If someone is really
4698 desperate to have another name for a builtin alias, they can
4712 desperate to have another name for a builtin alias, they can
4699 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4713 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4700 works.
4714 works.
4701
4715
4702 2001-11-28 Fernando Perez <fperez@colorado.edu>
4716 2001-11-28 Fernando Perez <fperez@colorado.edu>
4703
4717
4704 * Changed @file so that it opens the source file at the proper
4718 * Changed @file so that it opens the source file at the proper
4705 line. Since it uses less, if your EDITOR environment is
4719 line. Since it uses less, if your EDITOR environment is
4706 configured, typing v will immediately open your editor of choice
4720 configured, typing v will immediately open your editor of choice
4707 right at the line where the object is defined. Not as quick as
4721 right at the line where the object is defined. Not as quick as
4708 having a direct @edit command, but for all intents and purposes it
4722 having a direct @edit command, but for all intents and purposes it
4709 works. And I don't have to worry about writing @edit to deal with
4723 works. And I don't have to worry about writing @edit to deal with
4710 all the editors, less does that.
4724 all the editors, less does that.
4711
4725
4712 * Version 0.1.16 released, 0.1.17 opened.
4726 * Version 0.1.16 released, 0.1.17 opened.
4713
4727
4714 * Fixed some nasty bugs in the page/page_dumb combo that could
4728 * Fixed some nasty bugs in the page/page_dumb combo that could
4715 crash IPython.
4729 crash IPython.
4716
4730
4717 2001-11-27 Fernando Perez <fperez@colorado.edu>
4731 2001-11-27 Fernando Perez <fperez@colorado.edu>
4718
4732
4719 * Version 0.1.15 released, 0.1.16 opened.
4733 * Version 0.1.15 released, 0.1.16 opened.
4720
4734
4721 * Finally got ? and ?? to work for undefined things: now it's
4735 * Finally got ? and ?? to work for undefined things: now it's
4722 possible to type {}.get? and get information about the get method
4736 possible to type {}.get? and get information about the get method
4723 of dicts, or os.path? even if only os is defined (so technically
4737 of dicts, or os.path? even if only os is defined (so technically
4724 os.path isn't). Works at any level. For example, after import os,
4738 os.path isn't). Works at any level. For example, after import os,
4725 os?, os.path?, os.path.abspath? all work. This is great, took some
4739 os?, os.path?, os.path.abspath? all work. This is great, took some
4726 work in _ofind.
4740 work in _ofind.
4727
4741
4728 * Fixed more bugs with logging. The sanest way to do it was to add
4742 * Fixed more bugs with logging. The sanest way to do it was to add
4729 to @log a 'mode' parameter. Killed two in one shot (this mode
4743 to @log a 'mode' parameter. Killed two in one shot (this mode
4730 option was a request of Janko's). I think it's finally clean
4744 option was a request of Janko's). I think it's finally clean
4731 (famous last words).
4745 (famous last words).
4732
4746
4733 * Added a page_dumb() pager which does a decent job of paging on
4747 * Added a page_dumb() pager which does a decent job of paging on
4734 screen, if better things (like less) aren't available. One less
4748 screen, if better things (like less) aren't available. One less
4735 unix dependency (someday maybe somebody will port this to
4749 unix dependency (someday maybe somebody will port this to
4736 windows).
4750 windows).
4737
4751
4738 * Fixed problem in magic_log: would lock of logging out if log
4752 * Fixed problem in magic_log: would lock of logging out if log
4739 creation failed (because it would still think it had succeeded).
4753 creation failed (because it would still think it had succeeded).
4740
4754
4741 * Improved the page() function using curses to auto-detect screen
4755 * Improved the page() function using curses to auto-detect screen
4742 size. Now it can make a much better decision on whether to print
4756 size. Now it can make a much better decision on whether to print
4743 or page a string. Option screen_length was modified: a value 0
4757 or page a string. Option screen_length was modified: a value 0
4744 means auto-detect, and that's the default now.
4758 means auto-detect, and that's the default now.
4745
4759
4746 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4760 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4747 go out. I'll test it for a few days, then talk to Janko about
4761 go out. I'll test it for a few days, then talk to Janko about
4748 licences and announce it.
4762 licences and announce it.
4749
4763
4750 * Fixed the length of the auto-generated ---> prompt which appears
4764 * Fixed the length of the auto-generated ---> prompt which appears
4751 for auto-parens and auto-quotes. Getting this right isn't trivial,
4765 for auto-parens and auto-quotes. Getting this right isn't trivial,
4752 with all the color escapes, different prompt types and optional
4766 with all the color escapes, different prompt types and optional
4753 separators. But it seems to be working in all the combinations.
4767 separators. But it seems to be working in all the combinations.
4754
4768
4755 2001-11-26 Fernando Perez <fperez@colorado.edu>
4769 2001-11-26 Fernando Perez <fperez@colorado.edu>
4756
4770
4757 * Wrote a regexp filter to get option types from the option names
4771 * Wrote a regexp filter to get option types from the option names
4758 string. This eliminates the need to manually keep two duplicate
4772 string. This eliminates the need to manually keep two duplicate
4759 lists.
4773 lists.
4760
4774
4761 * Removed the unneeded check_option_names. Now options are handled
4775 * Removed the unneeded check_option_names. Now options are handled
4762 in a much saner manner and it's easy to visually check that things
4776 in a much saner manner and it's easy to visually check that things
4763 are ok.
4777 are ok.
4764
4778
4765 * Updated version numbers on all files I modified to carry a
4779 * Updated version numbers on all files I modified to carry a
4766 notice so Janko and Nathan have clear version markers.
4780 notice so Janko and Nathan have clear version markers.
4767
4781
4768 * Updated docstring for ultraTB with my changes. I should send
4782 * Updated docstring for ultraTB with my changes. I should send
4769 this to Nathan.
4783 this to Nathan.
4770
4784
4771 * Lots of small fixes. Ran everything through pychecker again.
4785 * Lots of small fixes. Ran everything through pychecker again.
4772
4786
4773 * Made loading of deep_reload an cmd line option. If it's not too
4787 * Made loading of deep_reload an cmd line option. If it's not too
4774 kosher, now people can just disable it. With -nodeep_reload it's
4788 kosher, now people can just disable it. With -nodeep_reload it's
4775 still available as dreload(), it just won't overwrite reload().
4789 still available as dreload(), it just won't overwrite reload().
4776
4790
4777 * Moved many options to the no| form (-opt and -noopt
4791 * Moved many options to the no| form (-opt and -noopt
4778 accepted). Cleaner.
4792 accepted). Cleaner.
4779
4793
4780 * Changed magic_log so that if called with no parameters, it uses
4794 * Changed magic_log so that if called with no parameters, it uses
4781 'rotate' mode. That way auto-generated logs aren't automatically
4795 'rotate' mode. That way auto-generated logs aren't automatically
4782 over-written. For normal logs, now a backup is made if it exists
4796 over-written. For normal logs, now a backup is made if it exists
4783 (only 1 level of backups). A new 'backup' mode was added to the
4797 (only 1 level of backups). A new 'backup' mode was added to the
4784 Logger class to support this. This was a request by Janko.
4798 Logger class to support this. This was a request by Janko.
4785
4799
4786 * Added @logoff/@logon to stop/restart an active log.
4800 * Added @logoff/@logon to stop/restart an active log.
4787
4801
4788 * Fixed a lot of bugs in log saving/replay. It was pretty
4802 * Fixed a lot of bugs in log saving/replay. It was pretty
4789 broken. Now special lines (!@,/) appear properly in the command
4803 broken. Now special lines (!@,/) appear properly in the command
4790 history after a log replay.
4804 history after a log replay.
4791
4805
4792 * Tried and failed to implement full session saving via pickle. My
4806 * Tried and failed to implement full session saving via pickle. My
4793 idea was to pickle __main__.__dict__, but modules can't be
4807 idea was to pickle __main__.__dict__, but modules can't be
4794 pickled. This would be a better alternative to replaying logs, but
4808 pickled. This would be a better alternative to replaying logs, but
4795 seems quite tricky to get to work. Changed -session to be called
4809 seems quite tricky to get to work. Changed -session to be called
4796 -logplay, which more accurately reflects what it does. And if we
4810 -logplay, which more accurately reflects what it does. And if we
4797 ever get real session saving working, -session is now available.
4811 ever get real session saving working, -session is now available.
4798
4812
4799 * Implemented color schemes for prompts also. As for tracebacks,
4813 * Implemented color schemes for prompts also. As for tracebacks,
4800 currently only NoColor and Linux are supported. But now the
4814 currently only NoColor and Linux are supported. But now the
4801 infrastructure is in place, based on a generic ColorScheme
4815 infrastructure is in place, based on a generic ColorScheme
4802 class. So writing and activating new schemes both for the prompts
4816 class. So writing and activating new schemes both for the prompts
4803 and the tracebacks should be straightforward.
4817 and the tracebacks should be straightforward.
4804
4818
4805 * Version 0.1.13 released, 0.1.14 opened.
4819 * Version 0.1.13 released, 0.1.14 opened.
4806
4820
4807 * Changed handling of options for output cache. Now counter is
4821 * Changed handling of options for output cache. Now counter is
4808 hardwired starting at 1 and one specifies the maximum number of
4822 hardwired starting at 1 and one specifies the maximum number of
4809 entries *in the outcache* (not the max prompt counter). This is
4823 entries *in the outcache* (not the max prompt counter). This is
4810 much better, since many statements won't increase the cache
4824 much better, since many statements won't increase the cache
4811 count. It also eliminated some confusing options, now there's only
4825 count. It also eliminated some confusing options, now there's only
4812 one: cache_size.
4826 one: cache_size.
4813
4827
4814 * Added 'alias' magic function and magic_alias option in the
4828 * Added 'alias' magic function and magic_alias option in the
4815 ipythonrc file. Now the user can easily define whatever names he
4829 ipythonrc file. Now the user can easily define whatever names he
4816 wants for the magic functions without having to play weird
4830 wants for the magic functions without having to play weird
4817 namespace games. This gives IPython a real shell-like feel.
4831 namespace games. This gives IPython a real shell-like feel.
4818
4832
4819 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4833 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4820 @ or not).
4834 @ or not).
4821
4835
4822 This was one of the last remaining 'visible' bugs (that I know
4836 This was one of the last remaining 'visible' bugs (that I know
4823 of). I think if I can clean up the session loading so it works
4837 of). I think if I can clean up the session loading so it works
4824 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4838 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4825 about licensing).
4839 about licensing).
4826
4840
4827 2001-11-25 Fernando Perez <fperez@colorado.edu>
4841 2001-11-25 Fernando Perez <fperez@colorado.edu>
4828
4842
4829 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4843 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4830 there's a cleaner distinction between what ? and ?? show.
4844 there's a cleaner distinction between what ? and ?? show.
4831
4845
4832 * Added screen_length option. Now the user can define his own
4846 * Added screen_length option. Now the user can define his own
4833 screen size for page() operations.
4847 screen size for page() operations.
4834
4848
4835 * Implemented magic shell-like functions with automatic code
4849 * Implemented magic shell-like functions with automatic code
4836 generation. Now adding another function is just a matter of adding
4850 generation. Now adding another function is just a matter of adding
4837 an entry to a dict, and the function is dynamically generated at
4851 an entry to a dict, and the function is dynamically generated at
4838 run-time. Python has some really cool features!
4852 run-time. Python has some really cool features!
4839
4853
4840 * Renamed many options to cleanup conventions a little. Now all
4854 * Renamed many options to cleanup conventions a little. Now all
4841 are lowercase, and only underscores where needed. Also in the code
4855 are lowercase, and only underscores where needed. Also in the code
4842 option name tables are clearer.
4856 option name tables are clearer.
4843
4857
4844 * Changed prompts a little. Now input is 'In [n]:' instead of
4858 * Changed prompts a little. Now input is 'In [n]:' instead of
4845 'In[n]:='. This allows it the numbers to be aligned with the
4859 'In[n]:='. This allows it the numbers to be aligned with the
4846 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4860 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4847 Python (it was a Mathematica thing). The '...' continuation prompt
4861 Python (it was a Mathematica thing). The '...' continuation prompt
4848 was also changed a little to align better.
4862 was also changed a little to align better.
4849
4863
4850 * Fixed bug when flushing output cache. Not all _p<n> variables
4864 * Fixed bug when flushing output cache. Not all _p<n> variables
4851 exist, so their deletion needs to be wrapped in a try:
4865 exist, so their deletion needs to be wrapped in a try:
4852
4866
4853 * Figured out how to properly use inspect.formatargspec() (it
4867 * Figured out how to properly use inspect.formatargspec() (it
4854 requires the args preceded by *). So I removed all the code from
4868 requires the args preceded by *). So I removed all the code from
4855 _get_pdef in Magic, which was just replicating that.
4869 _get_pdef in Magic, which was just replicating that.
4856
4870
4857 * Added test to prefilter to allow redefining magic function names
4871 * Added test to prefilter to allow redefining magic function names
4858 as variables. This is ok, since the @ form is always available,
4872 as variables. This is ok, since the @ form is always available,
4859 but whe should allow the user to define a variable called 'ls' if
4873 but whe should allow the user to define a variable called 'ls' if
4860 he needs it.
4874 he needs it.
4861
4875
4862 * Moved the ToDo information from README into a separate ToDo.
4876 * Moved the ToDo information from README into a separate ToDo.
4863
4877
4864 * General code cleanup and small bugfixes. I think it's close to a
4878 * General code cleanup and small bugfixes. I think it's close to a
4865 state where it can be released, obviously with a big 'beta'
4879 state where it can be released, obviously with a big 'beta'
4866 warning on it.
4880 warning on it.
4867
4881
4868 * Got the magic function split to work. Now all magics are defined
4882 * Got the magic function split to work. Now all magics are defined
4869 in a separate class. It just organizes things a bit, and now
4883 in a separate class. It just organizes things a bit, and now
4870 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4884 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4871 was too long).
4885 was too long).
4872
4886
4873 * Changed @clear to @reset to avoid potential confusions with
4887 * Changed @clear to @reset to avoid potential confusions with
4874 the shell command clear. Also renamed @cl to @clear, which does
4888 the shell command clear. Also renamed @cl to @clear, which does
4875 exactly what people expect it to from their shell experience.
4889 exactly what people expect it to from their shell experience.
4876
4890
4877 Added a check to the @reset command (since it's so
4891 Added a check to the @reset command (since it's so
4878 destructive, it's probably a good idea to ask for confirmation).
4892 destructive, it's probably a good idea to ask for confirmation).
4879 But now reset only works for full namespace resetting. Since the
4893 But now reset only works for full namespace resetting. Since the
4880 del keyword is already there for deleting a few specific
4894 del keyword is already there for deleting a few specific
4881 variables, I don't see the point of having a redundant magic
4895 variables, I don't see the point of having a redundant magic
4882 function for the same task.
4896 function for the same task.
4883
4897
4884 2001-11-24 Fernando Perez <fperez@colorado.edu>
4898 2001-11-24 Fernando Perez <fperez@colorado.edu>
4885
4899
4886 * Updated the builtin docs (esp. the ? ones).
4900 * Updated the builtin docs (esp. the ? ones).
4887
4901
4888 * Ran all the code through pychecker. Not terribly impressed with
4902 * Ran all the code through pychecker. Not terribly impressed with
4889 it: lots of spurious warnings and didn't really find anything of
4903 it: lots of spurious warnings and didn't really find anything of
4890 substance (just a few modules being imported and not used).
4904 substance (just a few modules being imported and not used).
4891
4905
4892 * Implemented the new ultraTB functionality into IPython. New
4906 * Implemented the new ultraTB functionality into IPython. New
4893 option: xcolors. This chooses color scheme. xmode now only selects
4907 option: xcolors. This chooses color scheme. xmode now only selects
4894 between Plain and Verbose. Better orthogonality.
4908 between Plain and Verbose. Better orthogonality.
4895
4909
4896 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4910 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4897 mode and color scheme for the exception handlers. Now it's
4911 mode and color scheme for the exception handlers. Now it's
4898 possible to have the verbose traceback with no coloring.
4912 possible to have the verbose traceback with no coloring.
4899
4913
4900 2001-11-23 Fernando Perez <fperez@colorado.edu>
4914 2001-11-23 Fernando Perez <fperez@colorado.edu>
4901
4915
4902 * Version 0.1.12 released, 0.1.13 opened.
4916 * Version 0.1.12 released, 0.1.13 opened.
4903
4917
4904 * Removed option to set auto-quote and auto-paren escapes by
4918 * Removed option to set auto-quote and auto-paren escapes by
4905 user. The chances of breaking valid syntax are just too high. If
4919 user. The chances of breaking valid syntax are just too high. If
4906 someone *really* wants, they can always dig into the code.
4920 someone *really* wants, they can always dig into the code.
4907
4921
4908 * Made prompt separators configurable.
4922 * Made prompt separators configurable.
4909
4923
4910 2001-11-22 Fernando Perez <fperez@colorado.edu>
4924 2001-11-22 Fernando Perez <fperez@colorado.edu>
4911
4925
4912 * Small bugfixes in many places.
4926 * Small bugfixes in many places.
4913
4927
4914 * Removed the MyCompleter class from ipplib. It seemed redundant
4928 * Removed the MyCompleter class from ipplib. It seemed redundant
4915 with the C-p,C-n history search functionality. Less code to
4929 with the C-p,C-n history search functionality. Less code to
4916 maintain.
4930 maintain.
4917
4931
4918 * Moved all the original ipython.py code into ipythonlib.py. Right
4932 * Moved all the original ipython.py code into ipythonlib.py. Right
4919 now it's just one big dump into a function called make_IPython, so
4933 now it's just one big dump into a function called make_IPython, so
4920 no real modularity has been gained. But at least it makes the
4934 no real modularity has been gained. But at least it makes the
4921 wrapper script tiny, and since ipythonlib is a module, it gets
4935 wrapper script tiny, and since ipythonlib is a module, it gets
4922 compiled and startup is much faster.
4936 compiled and startup is much faster.
4923
4937
4924 This is a reasobably 'deep' change, so we should test it for a
4938 This is a reasobably 'deep' change, so we should test it for a
4925 while without messing too much more with the code.
4939 while without messing too much more with the code.
4926
4940
4927 2001-11-21 Fernando Perez <fperez@colorado.edu>
4941 2001-11-21 Fernando Perez <fperez@colorado.edu>
4928
4942
4929 * Version 0.1.11 released, 0.1.12 opened for further work.
4943 * Version 0.1.11 released, 0.1.12 opened for further work.
4930
4944
4931 * Removed dependency on Itpl. It was only needed in one place. It
4945 * Removed dependency on Itpl. It was only needed in one place. It
4932 would be nice if this became part of python, though. It makes life
4946 would be nice if this became part of python, though. It makes life
4933 *a lot* easier in some cases.
4947 *a lot* easier in some cases.
4934
4948
4935 * Simplified the prefilter code a bit. Now all handlers are
4949 * Simplified the prefilter code a bit. Now all handlers are
4936 expected to explicitly return a value (at least a blank string).
4950 expected to explicitly return a value (at least a blank string).
4937
4951
4938 * Heavy edits in ipplib. Removed the help system altogether. Now
4952 * Heavy edits in ipplib. Removed the help system altogether. Now
4939 obj?/?? is used for inspecting objects, a magic @doc prints
4953 obj?/?? is used for inspecting objects, a magic @doc prints
4940 docstrings, and full-blown Python help is accessed via the 'help'
4954 docstrings, and full-blown Python help is accessed via the 'help'
4941 keyword. This cleans up a lot of code (less to maintain) and does
4955 keyword. This cleans up a lot of code (less to maintain) and does
4942 the job. Since 'help' is now a standard Python component, might as
4956 the job. Since 'help' is now a standard Python component, might as
4943 well use it and remove duplicate functionality.
4957 well use it and remove duplicate functionality.
4944
4958
4945 Also removed the option to use ipplib as a standalone program. By
4959 Also removed the option to use ipplib as a standalone program. By
4946 now it's too dependent on other parts of IPython to function alone.
4960 now it's too dependent on other parts of IPython to function alone.
4947
4961
4948 * Fixed bug in genutils.pager. It would crash if the pager was
4962 * Fixed bug in genutils.pager. It would crash if the pager was
4949 exited immediately after opening (broken pipe).
4963 exited immediately after opening (broken pipe).
4950
4964
4951 * Trimmed down the VerboseTB reporting a little. The header is
4965 * Trimmed down the VerboseTB reporting a little. The header is
4952 much shorter now and the repeated exception arguments at the end
4966 much shorter now and the repeated exception arguments at the end
4953 have been removed. For interactive use the old header seemed a bit
4967 have been removed. For interactive use the old header seemed a bit
4954 excessive.
4968 excessive.
4955
4969
4956 * Fixed small bug in output of @whos for variables with multi-word
4970 * Fixed small bug in output of @whos for variables with multi-word
4957 types (only first word was displayed).
4971 types (only first word was displayed).
4958
4972
4959 2001-11-17 Fernando Perez <fperez@colorado.edu>
4973 2001-11-17 Fernando Perez <fperez@colorado.edu>
4960
4974
4961 * Version 0.1.10 released, 0.1.11 opened for further work.
4975 * Version 0.1.10 released, 0.1.11 opened for further work.
4962
4976
4963 * Modified dirs and friends. dirs now *returns* the stack (not
4977 * Modified dirs and friends. dirs now *returns* the stack (not
4964 prints), so one can manipulate it as a variable. Convenient to
4978 prints), so one can manipulate it as a variable. Convenient to
4965 travel along many directories.
4979 travel along many directories.
4966
4980
4967 * Fixed bug in magic_pdef: would only work with functions with
4981 * Fixed bug in magic_pdef: would only work with functions with
4968 arguments with default values.
4982 arguments with default values.
4969
4983
4970 2001-11-14 Fernando Perez <fperez@colorado.edu>
4984 2001-11-14 Fernando Perez <fperez@colorado.edu>
4971
4985
4972 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4986 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4973 example with IPython. Various other minor fixes and cleanups.
4987 example with IPython. Various other minor fixes and cleanups.
4974
4988
4975 * Version 0.1.9 released, 0.1.10 opened for further work.
4989 * Version 0.1.9 released, 0.1.10 opened for further work.
4976
4990
4977 * Added sys.path to the list of directories searched in the
4991 * Added sys.path to the list of directories searched in the
4978 execfile= option. It used to be the current directory and the
4992 execfile= option. It used to be the current directory and the
4979 user's IPYTHONDIR only.
4993 user's IPYTHONDIR only.
4980
4994
4981 2001-11-13 Fernando Perez <fperez@colorado.edu>
4995 2001-11-13 Fernando Perez <fperez@colorado.edu>
4982
4996
4983 * Reinstated the raw_input/prefilter separation that Janko had
4997 * Reinstated the raw_input/prefilter separation that Janko had
4984 initially. This gives a more convenient setup for extending the
4998 initially. This gives a more convenient setup for extending the
4985 pre-processor from the outside: raw_input always gets a string,
4999 pre-processor from the outside: raw_input always gets a string,
4986 and prefilter has to process it. We can then redefine prefilter
5000 and prefilter has to process it. We can then redefine prefilter
4987 from the outside and implement extensions for special
5001 from the outside and implement extensions for special
4988 purposes.
5002 purposes.
4989
5003
4990 Today I got one for inputting PhysicalQuantity objects
5004 Today I got one for inputting PhysicalQuantity objects
4991 (from Scientific) without needing any function calls at
5005 (from Scientific) without needing any function calls at
4992 all. Extremely convenient, and it's all done as a user-level
5006 all. Extremely convenient, and it's all done as a user-level
4993 extension (no IPython code was touched). Now instead of:
5007 extension (no IPython code was touched). Now instead of:
4994 a = PhysicalQuantity(4.2,'m/s**2')
5008 a = PhysicalQuantity(4.2,'m/s**2')
4995 one can simply say
5009 one can simply say
4996 a = 4.2 m/s**2
5010 a = 4.2 m/s**2
4997 or even
5011 or even
4998 a = 4.2 m/s^2
5012 a = 4.2 m/s^2
4999
5013
5000 I use this, but it's also a proof of concept: IPython really is
5014 I use this, but it's also a proof of concept: IPython really is
5001 fully user-extensible, even at the level of the parsing of the
5015 fully user-extensible, even at the level of the parsing of the
5002 command line. It's not trivial, but it's perfectly doable.
5016 command line. It's not trivial, but it's perfectly doable.
5003
5017
5004 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5018 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5005 the problem of modules being loaded in the inverse order in which
5019 the problem of modules being loaded in the inverse order in which
5006 they were defined in
5020 they were defined in
5007
5021
5008 * Version 0.1.8 released, 0.1.9 opened for further work.
5022 * Version 0.1.8 released, 0.1.9 opened for further work.
5009
5023
5010 * Added magics pdef, source and file. They respectively show the
5024 * Added magics pdef, source and file. They respectively show the
5011 definition line ('prototype' in C), source code and full python
5025 definition line ('prototype' in C), source code and full python
5012 file for any callable object. The object inspector oinfo uses
5026 file for any callable object. The object inspector oinfo uses
5013 these to show the same information.
5027 these to show the same information.
5014
5028
5015 * Version 0.1.7 released, 0.1.8 opened for further work.
5029 * Version 0.1.7 released, 0.1.8 opened for further work.
5016
5030
5017 * Separated all the magic functions into a class called Magic. The
5031 * Separated all the magic functions into a class called Magic. The
5018 InteractiveShell class was becoming too big for Xemacs to handle
5032 InteractiveShell class was becoming too big for Xemacs to handle
5019 (de-indenting a line would lock it up for 10 seconds while it
5033 (de-indenting a line would lock it up for 10 seconds while it
5020 backtracked on the whole class!)
5034 backtracked on the whole class!)
5021
5035
5022 FIXME: didn't work. It can be done, but right now namespaces are
5036 FIXME: didn't work. It can be done, but right now namespaces are
5023 all messed up. Do it later (reverted it for now, so at least
5037 all messed up. Do it later (reverted it for now, so at least
5024 everything works as before).
5038 everything works as before).
5025
5039
5026 * Got the object introspection system (magic_oinfo) working! I
5040 * Got the object introspection system (magic_oinfo) working! I
5027 think this is pretty much ready for release to Janko, so he can
5041 think this is pretty much ready for release to Janko, so he can
5028 test it for a while and then announce it. Pretty much 100% of what
5042 test it for a while and then announce it. Pretty much 100% of what
5029 I wanted for the 'phase 1' release is ready. Happy, tired.
5043 I wanted for the 'phase 1' release is ready. Happy, tired.
5030
5044
5031 2001-11-12 Fernando Perez <fperez@colorado.edu>
5045 2001-11-12 Fernando Perez <fperez@colorado.edu>
5032
5046
5033 * Version 0.1.6 released, 0.1.7 opened for further work.
5047 * Version 0.1.6 released, 0.1.7 opened for further work.
5034
5048
5035 * Fixed bug in printing: it used to test for truth before
5049 * Fixed bug in printing: it used to test for truth before
5036 printing, so 0 wouldn't print. Now checks for None.
5050 printing, so 0 wouldn't print. Now checks for None.
5037
5051
5038 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5052 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5039 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5053 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5040 reaches by hand into the outputcache. Think of a better way to do
5054 reaches by hand into the outputcache. Think of a better way to do
5041 this later.
5055 this later.
5042
5056
5043 * Various small fixes thanks to Nathan's comments.
5057 * Various small fixes thanks to Nathan's comments.
5044
5058
5045 * Changed magic_pprint to magic_Pprint. This way it doesn't
5059 * Changed magic_pprint to magic_Pprint. This way it doesn't
5046 collide with pprint() and the name is consistent with the command
5060 collide with pprint() and the name is consistent with the command
5047 line option.
5061 line option.
5048
5062
5049 * Changed prompt counter behavior to be fully like
5063 * Changed prompt counter behavior to be fully like
5050 Mathematica's. That is, even input that doesn't return a result
5064 Mathematica's. That is, even input that doesn't return a result
5051 raises the prompt counter. The old behavior was kind of confusing
5065 raises the prompt counter. The old behavior was kind of confusing
5052 (getting the same prompt number several times if the operation
5066 (getting the same prompt number several times if the operation
5053 didn't return a result).
5067 didn't return a result).
5054
5068
5055 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5069 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5056
5070
5057 * Fixed -Classic mode (wasn't working anymore).
5071 * Fixed -Classic mode (wasn't working anymore).
5058
5072
5059 * Added colored prompts using Nathan's new code. Colors are
5073 * Added colored prompts using Nathan's new code. Colors are
5060 currently hardwired, they can be user-configurable. For
5074 currently hardwired, they can be user-configurable. For
5061 developers, they can be chosen in file ipythonlib.py, at the
5075 developers, they can be chosen in file ipythonlib.py, at the
5062 beginning of the CachedOutput class def.
5076 beginning of the CachedOutput class def.
5063
5077
5064 2001-11-11 Fernando Perez <fperez@colorado.edu>
5078 2001-11-11 Fernando Perez <fperez@colorado.edu>
5065
5079
5066 * Version 0.1.5 released, 0.1.6 opened for further work.
5080 * Version 0.1.5 released, 0.1.6 opened for further work.
5067
5081
5068 * Changed magic_env to *return* the environment as a dict (not to
5082 * Changed magic_env to *return* the environment as a dict (not to
5069 print it). This way it prints, but it can also be processed.
5083 print it). This way it prints, but it can also be processed.
5070
5084
5071 * Added Verbose exception reporting to interactive
5085 * Added Verbose exception reporting to interactive
5072 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5086 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5073 traceback. Had to make some changes to the ultraTB file. This is
5087 traceback. Had to make some changes to the ultraTB file. This is
5074 probably the last 'big' thing in my mental todo list. This ties
5088 probably the last 'big' thing in my mental todo list. This ties
5075 in with the next entry:
5089 in with the next entry:
5076
5090
5077 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5091 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5078 has to specify is Plain, Color or Verbose for all exception
5092 has to specify is Plain, Color or Verbose for all exception
5079 handling.
5093 handling.
5080
5094
5081 * Removed ShellServices option. All this can really be done via
5095 * Removed ShellServices option. All this can really be done via
5082 the magic system. It's easier to extend, cleaner and has automatic
5096 the magic system. It's easier to extend, cleaner and has automatic
5083 namespace protection and documentation.
5097 namespace protection and documentation.
5084
5098
5085 2001-11-09 Fernando Perez <fperez@colorado.edu>
5099 2001-11-09 Fernando Perez <fperez@colorado.edu>
5086
5100
5087 * Fixed bug in output cache flushing (missing parameter to
5101 * Fixed bug in output cache flushing (missing parameter to
5088 __init__). Other small bugs fixed (found using pychecker).
5102 __init__). Other small bugs fixed (found using pychecker).
5089
5103
5090 * Version 0.1.4 opened for bugfixing.
5104 * Version 0.1.4 opened for bugfixing.
5091
5105
5092 2001-11-07 Fernando Perez <fperez@colorado.edu>
5106 2001-11-07 Fernando Perez <fperez@colorado.edu>
5093
5107
5094 * Version 0.1.3 released, mainly because of the raw_input bug.
5108 * Version 0.1.3 released, mainly because of the raw_input bug.
5095
5109
5096 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5110 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5097 and when testing for whether things were callable, a call could
5111 and when testing for whether things were callable, a call could
5098 actually be made to certain functions. They would get called again
5112 actually be made to certain functions. They would get called again
5099 once 'really' executed, with a resulting double call. A disaster
5113 once 'really' executed, with a resulting double call. A disaster
5100 in many cases (list.reverse() would never work!).
5114 in many cases (list.reverse() would never work!).
5101
5115
5102 * Removed prefilter() function, moved its code to raw_input (which
5116 * Removed prefilter() function, moved its code to raw_input (which
5103 after all was just a near-empty caller for prefilter). This saves
5117 after all was just a near-empty caller for prefilter). This saves
5104 a function call on every prompt, and simplifies the class a tiny bit.
5118 a function call on every prompt, and simplifies the class a tiny bit.
5105
5119
5106 * Fix _ip to __ip name in magic example file.
5120 * Fix _ip to __ip name in magic example file.
5107
5121
5108 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5122 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5109 work with non-gnu versions of tar.
5123 work with non-gnu versions of tar.
5110
5124
5111 2001-11-06 Fernando Perez <fperez@colorado.edu>
5125 2001-11-06 Fernando Perez <fperez@colorado.edu>
5112
5126
5113 * Version 0.1.2. Just to keep track of the recent changes.
5127 * Version 0.1.2. Just to keep track of the recent changes.
5114
5128
5115 * Fixed nasty bug in output prompt routine. It used to check 'if
5129 * Fixed nasty bug in output prompt routine. It used to check 'if
5116 arg != None...'. Problem is, this fails if arg implements a
5130 arg != None...'. Problem is, this fails if arg implements a
5117 special comparison (__cmp__) which disallows comparing to
5131 special comparison (__cmp__) which disallows comparing to
5118 None. Found it when trying to use the PhysicalQuantity module from
5132 None. Found it when trying to use the PhysicalQuantity module from
5119 ScientificPython.
5133 ScientificPython.
5120
5134
5121 2001-11-05 Fernando Perez <fperez@colorado.edu>
5135 2001-11-05 Fernando Perez <fperez@colorado.edu>
5122
5136
5123 * Also added dirs. Now the pushd/popd/dirs family functions
5137 * Also added dirs. Now the pushd/popd/dirs family functions
5124 basically like the shell, with the added convenience of going home
5138 basically like the shell, with the added convenience of going home
5125 when called with no args.
5139 when called with no args.
5126
5140
5127 * pushd/popd slightly modified to mimic shell behavior more
5141 * pushd/popd slightly modified to mimic shell behavior more
5128 closely.
5142 closely.
5129
5143
5130 * Added env,pushd,popd from ShellServices as magic functions. I
5144 * Added env,pushd,popd from ShellServices as magic functions. I
5131 think the cleanest will be to port all desired functions from
5145 think the cleanest will be to port all desired functions from
5132 ShellServices as magics and remove ShellServices altogether. This
5146 ShellServices as magics and remove ShellServices altogether. This
5133 will provide a single, clean way of adding functionality
5147 will provide a single, clean way of adding functionality
5134 (shell-type or otherwise) to IP.
5148 (shell-type or otherwise) to IP.
5135
5149
5136 2001-11-04 Fernando Perez <fperez@colorado.edu>
5150 2001-11-04 Fernando Perez <fperez@colorado.edu>
5137
5151
5138 * Added .ipython/ directory to sys.path. This way users can keep
5152 * Added .ipython/ directory to sys.path. This way users can keep
5139 customizations there and access them via import.
5153 customizations there and access them via import.
5140
5154
5141 2001-11-03 Fernando Perez <fperez@colorado.edu>
5155 2001-11-03 Fernando Perez <fperez@colorado.edu>
5142
5156
5143 * Opened version 0.1.1 for new changes.
5157 * Opened version 0.1.1 for new changes.
5144
5158
5145 * Changed version number to 0.1.0: first 'public' release, sent to
5159 * Changed version number to 0.1.0: first 'public' release, sent to
5146 Nathan and Janko.
5160 Nathan and Janko.
5147
5161
5148 * Lots of small fixes and tweaks.
5162 * Lots of small fixes and tweaks.
5149
5163
5150 * Minor changes to whos format. Now strings are shown, snipped if
5164 * Minor changes to whos format. Now strings are shown, snipped if
5151 too long.
5165 too long.
5152
5166
5153 * Changed ShellServices to work on __main__ so they show up in @who
5167 * Changed ShellServices to work on __main__ so they show up in @who
5154
5168
5155 * Help also works with ? at the end of a line:
5169 * Help also works with ? at the end of a line:
5156 ?sin and sin?
5170 ?sin and sin?
5157 both produce the same effect. This is nice, as often I use the
5171 both produce the same effect. This is nice, as often I use the
5158 tab-complete to find the name of a method, but I used to then have
5172 tab-complete to find the name of a method, but I used to then have
5159 to go to the beginning of the line to put a ? if I wanted more
5173 to go to the beginning of the line to put a ? if I wanted more
5160 info. Now I can just add the ? and hit return. Convenient.
5174 info. Now I can just add the ? and hit return. Convenient.
5161
5175
5162 2001-11-02 Fernando Perez <fperez@colorado.edu>
5176 2001-11-02 Fernando Perez <fperez@colorado.edu>
5163
5177
5164 * Python version check (>=2.1) added.
5178 * Python version check (>=2.1) added.
5165
5179
5166 * Added LazyPython documentation. At this point the docs are quite
5180 * Added LazyPython documentation. At this point the docs are quite
5167 a mess. A cleanup is in order.
5181 a mess. A cleanup is in order.
5168
5182
5169 * Auto-installer created. For some bizarre reason, the zipfiles
5183 * Auto-installer created. For some bizarre reason, the zipfiles
5170 module isn't working on my system. So I made a tar version
5184 module isn't working on my system. So I made a tar version
5171 (hopefully the command line options in various systems won't kill
5185 (hopefully the command line options in various systems won't kill
5172 me).
5186 me).
5173
5187
5174 * Fixes to Struct in genutils. Now all dictionary-like methods are
5188 * Fixes to Struct in genutils. Now all dictionary-like methods are
5175 protected (reasonably).
5189 protected (reasonably).
5176
5190
5177 * Added pager function to genutils and changed ? to print usage
5191 * Added pager function to genutils and changed ? to print usage
5178 note through it (it was too long).
5192 note through it (it was too long).
5179
5193
5180 * Added the LazyPython functionality. Works great! I changed the
5194 * Added the LazyPython functionality. Works great! I changed the
5181 auto-quote escape to ';', it's on home row and next to '. But
5195 auto-quote escape to ';', it's on home row and next to '. But
5182 both auto-quote and auto-paren (still /) escapes are command-line
5196 both auto-quote and auto-paren (still /) escapes are command-line
5183 parameters.
5197 parameters.
5184
5198
5185
5199
5186 2001-11-01 Fernando Perez <fperez@colorado.edu>
5200 2001-11-01 Fernando Perez <fperez@colorado.edu>
5187
5201
5188 * Version changed to 0.0.7. Fairly large change: configuration now
5202 * Version changed to 0.0.7. Fairly large change: configuration now
5189 is all stored in a directory, by default .ipython. There, all
5203 is all stored in a directory, by default .ipython. There, all
5190 config files have normal looking names (not .names)
5204 config files have normal looking names (not .names)
5191
5205
5192 * Version 0.0.6 Released first to Lucas and Archie as a test
5206 * Version 0.0.6 Released first to Lucas and Archie as a test
5193 run. Since it's the first 'semi-public' release, change version to
5207 run. Since it's the first 'semi-public' release, change version to
5194 > 0.0.6 for any changes now.
5208 > 0.0.6 for any changes now.
5195
5209
5196 * Stuff I had put in the ipplib.py changelog:
5210 * Stuff I had put in the ipplib.py changelog:
5197
5211
5198 Changes to InteractiveShell:
5212 Changes to InteractiveShell:
5199
5213
5200 - Made the usage message a parameter.
5214 - Made the usage message a parameter.
5201
5215
5202 - Require the name of the shell variable to be given. It's a bit
5216 - Require the name of the shell variable to be given. It's a bit
5203 of a hack, but allows the name 'shell' not to be hardwire in the
5217 of a hack, but allows the name 'shell' not to be hardwire in the
5204 magic (@) handler, which is problematic b/c it requires
5218 magic (@) handler, which is problematic b/c it requires
5205 polluting the global namespace with 'shell'. This in turn is
5219 polluting the global namespace with 'shell'. This in turn is
5206 fragile: if a user redefines a variable called shell, things
5220 fragile: if a user redefines a variable called shell, things
5207 break.
5221 break.
5208
5222
5209 - magic @: all functions available through @ need to be defined
5223 - magic @: all functions available through @ need to be defined
5210 as magic_<name>, even though they can be called simply as
5224 as magic_<name>, even though they can be called simply as
5211 @<name>. This allows the special command @magic to gather
5225 @<name>. This allows the special command @magic to gather
5212 information automatically about all existing magic functions,
5226 information automatically about all existing magic functions,
5213 even if they are run-time user extensions, by parsing the shell
5227 even if they are run-time user extensions, by parsing the shell
5214 instance __dict__ looking for special magic_ names.
5228 instance __dict__ looking for special magic_ names.
5215
5229
5216 - mainloop: added *two* local namespace parameters. This allows
5230 - mainloop: added *two* local namespace parameters. This allows
5217 the class to differentiate between parameters which were there
5231 the class to differentiate between parameters which were there
5218 before and after command line initialization was processed. This
5232 before and after command line initialization was processed. This
5219 way, later @who can show things loaded at startup by the
5233 way, later @who can show things loaded at startup by the
5220 user. This trick was necessary to make session saving/reloading
5234 user. This trick was necessary to make session saving/reloading
5221 really work: ideally after saving/exiting/reloading a session,
5235 really work: ideally after saving/exiting/reloading a session,
5222 *everythin* should look the same, including the output of @who. I
5236 *everythin* should look the same, including the output of @who. I
5223 was only able to make this work with this double namespace
5237 was only able to make this work with this double namespace
5224 trick.
5238 trick.
5225
5239
5226 - added a header to the logfile which allows (almost) full
5240 - added a header to the logfile which allows (almost) full
5227 session restoring.
5241 session restoring.
5228
5242
5229 - prepend lines beginning with @ or !, with a and log
5243 - prepend lines beginning with @ or !, with a and log
5230 them. Why? !lines: may be useful to know what you did @lines:
5244 them. Why? !lines: may be useful to know what you did @lines:
5231 they may affect session state. So when restoring a session, at
5245 they may affect session state. So when restoring a session, at
5232 least inform the user of their presence. I couldn't quite get
5246 least inform the user of their presence. I couldn't quite get
5233 them to properly re-execute, but at least the user is warned.
5247 them to properly re-execute, but at least the user is warned.
5234
5248
5235 * Started ChangeLog.
5249 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now