##// END OF EJS Templates
add sys.setdefaultencoding() call after a patch by 'pan'. ChangeLogs
vivainio -
Show More
@@ -1,2579 +1,2589 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 2885 2007-12-07 10:59:06Z vivainio $
9 $Id: iplib.py 2889 2007-12-12 19:32:33Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pydoc
50 import pydoc
51 import re
51 import re
52 import shutil
52 import shutil
53 import string
53 import string
54 import sys
54 import sys
55 import tempfile
55 import tempfile
56 import traceback
56 import traceback
57 import types
57 import types
58 from sets import Set
58 from sets import Set
59 from pprint import pprint, pformat
59 from pprint import pprint, pformat
60
60
61 # IPython's own modules
61 # IPython's own modules
62 #import IPython
62 #import IPython
63 from IPython import Debugger,OInspect,PyColorize,ultraTB
63 from IPython import Debugger,OInspect,PyColorize,ultraTB
64 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
64 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 from IPython.Extensions import pickleshare
65 from IPython.Extensions import pickleshare
66 from IPython.FakeModule import FakeModule
66 from IPython.FakeModule import FakeModule
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Logger import Logger
68 from IPython.Logger import Logger
69 from IPython.Magic import Magic
69 from IPython.Magic import Magic
70 from IPython.Prompts import CachedOutput
70 from IPython.Prompts import CachedOutput
71 from IPython.ipstruct import Struct
71 from IPython.ipstruct import Struct
72 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
73 from IPython.usage import cmd_line_usage,interactive_usage
73 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.genutils import *
74 from IPython.genutils import *
75 from IPython.strdispatch import StrDispatch
75 from IPython.strdispatch import StrDispatch
76 import IPython.ipapi
76 import IPython.ipapi
77 import IPython.history
77 import IPython.history
78 import IPython.prefilter as prefilter
78 import IPython.prefilter as prefilter
79 import IPython.shadowns
79 import IPython.shadowns
80 # Globals
80 # Globals
81
81
82 # make converting between str and unicode easy, so str() will work most of the
83 # time
84
85 try:
86 sys.setappdefaultencoding(sys.stdin.encoding or 'ascii')
87 except:
88 # Many python versions don't have sys.setappdefaultencoding
89 reload(sys)
90 sys.setdefaultencoding(sys.stdin.encoding or 'ascii')
91
82 # store the builtin raw_input globally, and use this always, in case user code
92 # store the builtin raw_input globally, and use this always, in case user code
83 # overwrites it (like wx.py.PyShell does)
93 # overwrites it (like wx.py.PyShell does)
84 raw_input_original = raw_input
94 raw_input_original = raw_input
85
95
86 # compiled regexps for autoindent management
96 # compiled regexps for autoindent management
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
97 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88
98
89
99
90 #****************************************************************************
100 #****************************************************************************
91 # Some utility function definitions
101 # Some utility function definitions
92
102
93 ini_spaces_re = re.compile(r'^(\s+)')
103 ini_spaces_re = re.compile(r'^(\s+)')
94
104
95 def num_ini_spaces(strng):
105 def num_ini_spaces(strng):
96 """Return the number of initial spaces in a string"""
106 """Return the number of initial spaces in a string"""
97
107
98 ini_spaces = ini_spaces_re.match(strng)
108 ini_spaces = ini_spaces_re.match(strng)
99 if ini_spaces:
109 if ini_spaces:
100 return ini_spaces.end()
110 return ini_spaces.end()
101 else:
111 else:
102 return 0
112 return 0
103
113
104 def softspace(file, newvalue):
114 def softspace(file, newvalue):
105 """Copied from code.py, to remove the dependency"""
115 """Copied from code.py, to remove the dependency"""
106
116
107 oldvalue = 0
117 oldvalue = 0
108 try:
118 try:
109 oldvalue = file.softspace
119 oldvalue = file.softspace
110 except AttributeError:
120 except AttributeError:
111 pass
121 pass
112 try:
122 try:
113 file.softspace = newvalue
123 file.softspace = newvalue
114 except (AttributeError, TypeError):
124 except (AttributeError, TypeError):
115 # "attribute-less object" or "read-only attributes"
125 # "attribute-less object" or "read-only attributes"
116 pass
126 pass
117 return oldvalue
127 return oldvalue
118
128
119
129
120 #****************************************************************************
130 #****************************************************************************
121 # Local use exceptions
131 # Local use exceptions
122 class SpaceInInput(exceptions.Exception): pass
132 class SpaceInInput(exceptions.Exception): pass
123
133
124
134
125 #****************************************************************************
135 #****************************************************************************
126 # Local use classes
136 # Local use classes
127 class Bunch: pass
137 class Bunch: pass
128
138
129 class Undefined: pass
139 class Undefined: pass
130
140
131 class Quitter(object):
141 class Quitter(object):
132 """Simple class to handle exit, similar to Python 2.5's.
142 """Simple class to handle exit, similar to Python 2.5's.
133
143
134 It handles exiting in an ipython-safe manner, which the one in Python 2.5
144 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 doesn't do (obviously, since it doesn't know about ipython)."""
145 doesn't do (obviously, since it doesn't know about ipython)."""
136
146
137 def __init__(self,shell,name):
147 def __init__(self,shell,name):
138 self.shell = shell
148 self.shell = shell
139 self.name = name
149 self.name = name
140
150
141 def __repr__(self):
151 def __repr__(self):
142 return 'Type %s() to exit.' % self.name
152 return 'Type %s() to exit.' % self.name
143 __str__ = __repr__
153 __str__ = __repr__
144
154
145 def __call__(self):
155 def __call__(self):
146 self.shell.exit()
156 self.shell.exit()
147
157
148 class InputList(list):
158 class InputList(list):
149 """Class to store user input.
159 """Class to store user input.
150
160
151 It's basically a list, but slices return a string instead of a list, thus
161 It's basically a list, but slices return a string instead of a list, thus
152 allowing things like (assuming 'In' is an instance):
162 allowing things like (assuming 'In' is an instance):
153
163
154 exec In[4:7]
164 exec In[4:7]
155
165
156 or
166 or
157
167
158 exec In[5:9] + In[14] + In[21:25]"""
168 exec In[5:9] + In[14] + In[21:25]"""
159
169
160 def __getslice__(self,i,j):
170 def __getslice__(self,i,j):
161 return ''.join(list.__getslice__(self,i,j))
171 return ''.join(list.__getslice__(self,i,j))
162
172
163 class SyntaxTB(ultraTB.ListTB):
173 class SyntaxTB(ultraTB.ListTB):
164 """Extension which holds some state: the last exception value"""
174 """Extension which holds some state: the last exception value"""
165
175
166 def __init__(self,color_scheme = 'NoColor'):
176 def __init__(self,color_scheme = 'NoColor'):
167 ultraTB.ListTB.__init__(self,color_scheme)
177 ultraTB.ListTB.__init__(self,color_scheme)
168 self.last_syntax_error = None
178 self.last_syntax_error = None
169
179
170 def __call__(self, etype, value, elist):
180 def __call__(self, etype, value, elist):
171 self.last_syntax_error = value
181 self.last_syntax_error = value
172 ultraTB.ListTB.__call__(self,etype,value,elist)
182 ultraTB.ListTB.__call__(self,etype,value,elist)
173
183
174 def clear_err_state(self):
184 def clear_err_state(self):
175 """Return the current error state and clear it"""
185 """Return the current error state and clear it"""
176 e = self.last_syntax_error
186 e = self.last_syntax_error
177 self.last_syntax_error = None
187 self.last_syntax_error = None
178 return e
188 return e
179
189
180 #****************************************************************************
190 #****************************************************************************
181 # Main IPython class
191 # Main IPython class
182
192
183 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
193 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # until a full rewrite is made. I've cleaned all cross-class uses of
194 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # attributes and methods, but too much user code out there relies on the
195 # attributes and methods, but too much user code out there relies on the
186 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
196 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 #
197 #
188 # But at least now, all the pieces have been separated and we could, in
198 # But at least now, all the pieces have been separated and we could, in
189 # principle, stop using the mixin. This will ease the transition to the
199 # principle, stop using the mixin. This will ease the transition to the
190 # chainsaw branch.
200 # chainsaw branch.
191
201
192 # For reference, the following is the list of 'self.foo' uses in the Magic
202 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
203 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class, to prevent clashes.
204 # class, to prevent clashes.
195
205
196 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
206 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
207 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
208 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.value']
209 # 'self.value']
200
210
201 class InteractiveShell(object,Magic):
211 class InteractiveShell(object,Magic):
202 """An enhanced console for Python."""
212 """An enhanced console for Python."""
203
213
204 # class attribute to indicate whether the class supports threads or not.
214 # class attribute to indicate whether the class supports threads or not.
205 # Subclasses with thread support should override this as needed.
215 # Subclasses with thread support should override this as needed.
206 isthreaded = False
216 isthreaded = False
207
217
208 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
218 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 user_ns = None,user_global_ns=None,banner2='',
219 user_ns = None,user_global_ns=None,banner2='',
210 custom_exceptions=((),None),embedded=False):
220 custom_exceptions=((),None),embedded=False):
211
221
212 # log system
222 # log system
213 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
223 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214
224
215 # some minimal strict typechecks. For some core data structures, I
225 # some minimal strict typechecks. For some core data structures, I
216 # want actual basic python types, not just anything that looks like
226 # want actual basic python types, not just anything that looks like
217 # one. This is especially true for namespaces.
227 # one. This is especially true for namespaces.
218 for ns in (user_ns,user_global_ns):
228 for ns in (user_ns,user_global_ns):
219 if ns is not None and type(ns) != types.DictType:
229 if ns is not None and type(ns) != types.DictType:
220 raise TypeError,'namespace must be a dictionary'
230 raise TypeError,'namespace must be a dictionary'
221
231
222 # Job manager (for jobs run as background threads)
232 # Job manager (for jobs run as background threads)
223 self.jobs = BackgroundJobManager()
233 self.jobs = BackgroundJobManager()
224
234
225 # Store the actual shell's name
235 # Store the actual shell's name
226 self.name = name
236 self.name = name
227
237
228 # We need to know whether the instance is meant for embedding, since
238 # We need to know whether the instance is meant for embedding, since
229 # global/local namespaces need to be handled differently in that case
239 # global/local namespaces need to be handled differently in that case
230 self.embedded = embedded
240 self.embedded = embedded
231 if embedded:
241 if embedded:
232 # Control variable so users can, from within the embedded instance,
242 # Control variable so users can, from within the embedded instance,
233 # permanently deactivate it.
243 # permanently deactivate it.
234 self.embedded_active = True
244 self.embedded_active = True
235
245
236 # command compiler
246 # command compiler
237 self.compile = codeop.CommandCompiler()
247 self.compile = codeop.CommandCompiler()
238
248
239 # User input buffer
249 # User input buffer
240 self.buffer = []
250 self.buffer = []
241
251
242 # Default name given in compilation of code
252 # Default name given in compilation of code
243 self.filename = '<ipython console>'
253 self.filename = '<ipython console>'
244
254
245 # Install our own quitter instead of the builtins. For python2.3-2.4,
255 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # this brings in behavior like 2.5, and for 2.5 it's identical.
256 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 __builtin__.exit = Quitter(self,'exit')
257 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.quit = Quitter(self,'quit')
258 __builtin__.quit = Quitter(self,'quit')
249
259
250 # Make an empty namespace, which extension writers can rely on both
260 # Make an empty namespace, which extension writers can rely on both
251 # existing and NEVER being used by ipython itself. This gives them a
261 # existing and NEVER being used by ipython itself. This gives them a
252 # convenient location for storing additional information and state
262 # convenient location for storing additional information and state
253 # their extensions may require, without fear of collisions with other
263 # their extensions may require, without fear of collisions with other
254 # ipython names that may develop later.
264 # ipython names that may develop later.
255 self.meta = Struct()
265 self.meta = Struct()
256
266
257 # Create the namespace where the user will operate. user_ns is
267 # Create the namespace where the user will operate. user_ns is
258 # normally the only one used, and it is passed to the exec calls as
268 # normally the only one used, and it is passed to the exec calls as
259 # the locals argument. But we do carry a user_global_ns namespace
269 # the locals argument. But we do carry a user_global_ns namespace
260 # given as the exec 'globals' argument, This is useful in embedding
270 # given as the exec 'globals' argument, This is useful in embedding
261 # situations where the ipython shell opens in a context where the
271 # situations where the ipython shell opens in a context where the
262 # distinction between locals and globals is meaningful.
272 # distinction between locals and globals is meaningful.
263
273
264 # FIXME. For some strange reason, __builtins__ is showing up at user
274 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # level as a dict instead of a module. This is a manual fix, but I
275 # level as a dict instead of a module. This is a manual fix, but I
266 # should really track down where the problem is coming from. Alex
276 # should really track down where the problem is coming from. Alex
267 # Schmolck reported this problem first.
277 # Schmolck reported this problem first.
268
278
269 # A useful post by Alex Martelli on this topic:
279 # A useful post by Alex Martelli on this topic:
270 # Re: inconsistent value from __builtins__
280 # Re: inconsistent value from __builtins__
271 # Von: Alex Martelli <aleaxit@yahoo.com>
281 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
282 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Gruppen: comp.lang.python
283 # Gruppen: comp.lang.python
274
284
275 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
285 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
286 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > <type 'dict'>
287 # > <type 'dict'>
278 # > >>> print type(__builtins__)
288 # > >>> print type(__builtins__)
279 # > <type 'module'>
289 # > <type 'module'>
280 # > Is this difference in return value intentional?
290 # > Is this difference in return value intentional?
281
291
282 # Well, it's documented that '__builtins__' can be either a dictionary
292 # Well, it's documented that '__builtins__' can be either a dictionary
283 # or a module, and it's been that way for a long time. Whether it's
293 # or a module, and it's been that way for a long time. Whether it's
284 # intentional (or sensible), I don't know. In any case, the idea is
294 # intentional (or sensible), I don't know. In any case, the idea is
285 # that if you need to access the built-in namespace directly, you
295 # that if you need to access the built-in namespace directly, you
286 # should start with "import __builtin__" (note, no 's') which will
296 # should start with "import __builtin__" (note, no 's') which will
287 # definitely give you a module. Yeah, it's somewhat confusing:-(.
297 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288
298
289 # These routines return properly built dicts as needed by the rest of
299 # These routines return properly built dicts as needed by the rest of
290 # the code, and can also be used by extension writers to generate
300 # the code, and can also be used by extension writers to generate
291 # properly initialized namespaces.
301 # properly initialized namespaces.
292 user_ns = IPython.ipapi.make_user_ns(user_ns)
302 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
303 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294
304
295 # Assign namespaces
305 # Assign namespaces
296 # This is the namespace where all normal user variables live
306 # This is the namespace where all normal user variables live
297 self.user_ns = user_ns
307 self.user_ns = user_ns
298 # Embedded instances require a separate namespace for globals.
308 # Embedded instances require a separate namespace for globals.
299 # Normally this one is unused by non-embedded instances.
309 # Normally this one is unused by non-embedded instances.
300 self.user_global_ns = user_global_ns
310 self.user_global_ns = user_global_ns
301 # A namespace to keep track of internal data structures to prevent
311 # A namespace to keep track of internal data structures to prevent
302 # them from cluttering user-visible stuff. Will be updated later
312 # them from cluttering user-visible stuff. Will be updated later
303 self.internal_ns = {}
313 self.internal_ns = {}
304
314
305 # Namespace of system aliases. Each entry in the alias
315 # Namespace of system aliases. Each entry in the alias
306 # table must be a 2-tuple of the form (N,name), where N is the number
316 # table must be a 2-tuple of the form (N,name), where N is the number
307 # of positional arguments of the alias.
317 # of positional arguments of the alias.
308 self.alias_table = {}
318 self.alias_table = {}
309
319
310 # A table holding all the namespaces IPython deals with, so that
320 # A table holding all the namespaces IPython deals with, so that
311 # introspection facilities can search easily.
321 # introspection facilities can search easily.
312 self.ns_table = {'user':user_ns,
322 self.ns_table = {'user':user_ns,
313 'user_global':user_global_ns,
323 'user_global':user_global_ns,
314 'alias':self.alias_table,
324 'alias':self.alias_table,
315 'internal':self.internal_ns,
325 'internal':self.internal_ns,
316 'builtin':__builtin__.__dict__
326 'builtin':__builtin__.__dict__
317 }
327 }
318 # The user namespace MUST have a pointer to the shell itself.
328 # The user namespace MUST have a pointer to the shell itself.
319 self.user_ns[name] = self
329 self.user_ns[name] = self
320
330
321 # We need to insert into sys.modules something that looks like a
331 # We need to insert into sys.modules something that looks like a
322 # module but which accesses the IPython namespace, for shelve and
332 # module but which accesses the IPython namespace, for shelve and
323 # pickle to work interactively. Normally they rely on getting
333 # pickle to work interactively. Normally they rely on getting
324 # everything out of __main__, but for embedding purposes each IPython
334 # everything out of __main__, but for embedding purposes each IPython
325 # instance has its own private namespace, so we can't go shoving
335 # instance has its own private namespace, so we can't go shoving
326 # everything into __main__.
336 # everything into __main__.
327
337
328 # note, however, that we should only do this for non-embedded
338 # note, however, that we should only do this for non-embedded
329 # ipythons, which really mimic the __main__.__dict__ with their own
339 # ipythons, which really mimic the __main__.__dict__ with their own
330 # namespace. Embedded instances, on the other hand, should not do
340 # namespace. Embedded instances, on the other hand, should not do
331 # this because they need to manage the user local/global namespaces
341 # this because they need to manage the user local/global namespaces
332 # only, but they live within a 'normal' __main__ (meaning, they
342 # only, but they live within a 'normal' __main__ (meaning, they
333 # shouldn't overtake the execution environment of the script they're
343 # shouldn't overtake the execution environment of the script they're
334 # embedded in).
344 # embedded in).
335
345
336 if not embedded:
346 if not embedded:
337 try:
347 try:
338 main_name = self.user_ns['__name__']
348 main_name = self.user_ns['__name__']
339 except KeyError:
349 except KeyError:
340 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
350 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
341 else:
351 else:
342 #print "pickle hack in place" # dbg
352 #print "pickle hack in place" # dbg
343 #print 'main_name:',main_name # dbg
353 #print 'main_name:',main_name # dbg
344 sys.modules[main_name] = FakeModule(self.user_ns)
354 sys.modules[main_name] = FakeModule(self.user_ns)
345
355
346 # Now that FakeModule produces a real module, we've run into a nasty
356 # Now that FakeModule produces a real module, we've run into a nasty
347 # problem: after script execution (via %run), the module where the user
357 # problem: after script execution (via %run), the module where the user
348 # code ran is deleted. Now that this object is a true module (needed
358 # code ran is deleted. Now that this object is a true module (needed
349 # so docetst and other tools work correctly), the Python module
359 # so docetst and other tools work correctly), the Python module
350 # teardown mechanism runs over it, and sets to None every variable
360 # teardown mechanism runs over it, and sets to None every variable
351 # present in that module. This means that later calls to functions
361 # present in that module. This means that later calls to functions
352 # defined in the script (which have become interactively visible after
362 # defined in the script (which have become interactively visible after
353 # script exit) fail, because they hold references to objects that have
363 # script exit) fail, because they hold references to objects that have
354 # become overwritten into None. The only solution I see right now is
364 # become overwritten into None. The only solution I see right now is
355 # to protect every FakeModule used by %run by holding an internal
365 # to protect every FakeModule used by %run by holding an internal
356 # reference to it. This private list will be used for that. The
366 # reference to it. This private list will be used for that. The
357 # %reset command will flush it as well.
367 # %reset command will flush it as well.
358 self._user_main_modules = []
368 self._user_main_modules = []
359
369
360 # List of input with multi-line handling.
370 # List of input with multi-line handling.
361 # Fill its zero entry, user counter starts at 1
371 # Fill its zero entry, user counter starts at 1
362 self.input_hist = InputList(['\n'])
372 self.input_hist = InputList(['\n'])
363 # This one will hold the 'raw' input history, without any
373 # This one will hold the 'raw' input history, without any
364 # pre-processing. This will allow users to retrieve the input just as
374 # pre-processing. This will allow users to retrieve the input just as
365 # it was exactly typed in by the user, with %hist -r.
375 # it was exactly typed in by the user, with %hist -r.
366 self.input_hist_raw = InputList(['\n'])
376 self.input_hist_raw = InputList(['\n'])
367
377
368 # list of visited directories
378 # list of visited directories
369 try:
379 try:
370 self.dir_hist = [os.getcwd()]
380 self.dir_hist = [os.getcwd()]
371 except OSError:
381 except OSError:
372 self.dir_hist = []
382 self.dir_hist = []
373
383
374 # dict of output history
384 # dict of output history
375 self.output_hist = {}
385 self.output_hist = {}
376
386
377 # Get system encoding at startup time. Certain terminals (like Emacs
387 # Get system encoding at startup time. Certain terminals (like Emacs
378 # under Win32 have it set to None, and we need to have a known valid
388 # under Win32 have it set to None, and we need to have a known valid
379 # encoding to use in the raw_input() method
389 # encoding to use in the raw_input() method
380 self.stdin_encoding = sys.stdin.encoding or 'ascii'
390 self.stdin_encoding = sys.stdin.encoding or 'ascii'
381
391
382 # dict of things NOT to alias (keywords, builtins and some magics)
392 # dict of things NOT to alias (keywords, builtins and some magics)
383 no_alias = {}
393 no_alias = {}
384 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
394 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
385 for key in keyword.kwlist + no_alias_magics:
395 for key in keyword.kwlist + no_alias_magics:
386 no_alias[key] = 1
396 no_alias[key] = 1
387 no_alias.update(__builtin__.__dict__)
397 no_alias.update(__builtin__.__dict__)
388 self.no_alias = no_alias
398 self.no_alias = no_alias
389
399
390 # make global variables for user access to these
400 # make global variables for user access to these
391 self.user_ns['_ih'] = self.input_hist
401 self.user_ns['_ih'] = self.input_hist
392 self.user_ns['_oh'] = self.output_hist
402 self.user_ns['_oh'] = self.output_hist
393 self.user_ns['_dh'] = self.dir_hist
403 self.user_ns['_dh'] = self.dir_hist
394
404
395 # user aliases to input and output histories
405 # user aliases to input and output histories
396 self.user_ns['In'] = self.input_hist
406 self.user_ns['In'] = self.input_hist
397 self.user_ns['Out'] = self.output_hist
407 self.user_ns['Out'] = self.output_hist
398
408
399 self.user_ns['_sh'] = IPython.shadowns
409 self.user_ns['_sh'] = IPython.shadowns
400 # Object variable to store code object waiting execution. This is
410 # Object variable to store code object waiting execution. This is
401 # used mainly by the multithreaded shells, but it can come in handy in
411 # used mainly by the multithreaded shells, but it can come in handy in
402 # other situations. No need to use a Queue here, since it's a single
412 # other situations. No need to use a Queue here, since it's a single
403 # item which gets cleared once run.
413 # item which gets cleared once run.
404 self.code_to_run = None
414 self.code_to_run = None
405
415
406 # escapes for automatic behavior on the command line
416 # escapes for automatic behavior on the command line
407 self.ESC_SHELL = '!'
417 self.ESC_SHELL = '!'
408 self.ESC_SH_CAP = '!!'
418 self.ESC_SH_CAP = '!!'
409 self.ESC_HELP = '?'
419 self.ESC_HELP = '?'
410 self.ESC_MAGIC = '%'
420 self.ESC_MAGIC = '%'
411 self.ESC_QUOTE = ','
421 self.ESC_QUOTE = ','
412 self.ESC_QUOTE2 = ';'
422 self.ESC_QUOTE2 = ';'
413 self.ESC_PAREN = '/'
423 self.ESC_PAREN = '/'
414
424
415 # And their associated handlers
425 # And their associated handlers
416 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
426 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
417 self.ESC_QUOTE : self.handle_auto,
427 self.ESC_QUOTE : self.handle_auto,
418 self.ESC_QUOTE2 : self.handle_auto,
428 self.ESC_QUOTE2 : self.handle_auto,
419 self.ESC_MAGIC : self.handle_magic,
429 self.ESC_MAGIC : self.handle_magic,
420 self.ESC_HELP : self.handle_help,
430 self.ESC_HELP : self.handle_help,
421 self.ESC_SHELL : self.handle_shell_escape,
431 self.ESC_SHELL : self.handle_shell_escape,
422 self.ESC_SH_CAP : self.handle_shell_escape,
432 self.ESC_SH_CAP : self.handle_shell_escape,
423 }
433 }
424
434
425 # class initializations
435 # class initializations
426 Magic.__init__(self,self)
436 Magic.__init__(self,self)
427
437
428 # Python source parser/formatter for syntax highlighting
438 # Python source parser/formatter for syntax highlighting
429 pyformat = PyColorize.Parser().format
439 pyformat = PyColorize.Parser().format
430 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
440 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
431
441
432 # hooks holds pointers used for user-side customizations
442 # hooks holds pointers used for user-side customizations
433 self.hooks = Struct()
443 self.hooks = Struct()
434
444
435 self.strdispatchers = {}
445 self.strdispatchers = {}
436
446
437 # Set all default hooks, defined in the IPython.hooks module.
447 # Set all default hooks, defined in the IPython.hooks module.
438 hooks = IPython.hooks
448 hooks = IPython.hooks
439 for hook_name in hooks.__all__:
449 for hook_name in hooks.__all__:
440 # default hooks have priority 100, i.e. low; user hooks should have
450 # default hooks have priority 100, i.e. low; user hooks should have
441 # 0-100 priority
451 # 0-100 priority
442 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
452 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
443 #print "bound hook",hook_name
453 #print "bound hook",hook_name
444
454
445 # Flag to mark unconditional exit
455 # Flag to mark unconditional exit
446 self.exit_now = False
456 self.exit_now = False
447
457
448 self.usage_min = """\
458 self.usage_min = """\
449 An enhanced console for Python.
459 An enhanced console for Python.
450 Some of its features are:
460 Some of its features are:
451 - Readline support if the readline library is present.
461 - Readline support if the readline library is present.
452 - Tab completion in the local namespace.
462 - Tab completion in the local namespace.
453 - Logging of input, see command-line options.
463 - Logging of input, see command-line options.
454 - System shell escape via ! , eg !ls.
464 - System shell escape via ! , eg !ls.
455 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
465 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
456 - Keeps track of locally defined variables via %who, %whos.
466 - Keeps track of locally defined variables via %who, %whos.
457 - Show object information with a ? eg ?x or x? (use ?? for more info).
467 - Show object information with a ? eg ?x or x? (use ?? for more info).
458 """
468 """
459 if usage: self.usage = usage
469 if usage: self.usage = usage
460 else: self.usage = self.usage_min
470 else: self.usage = self.usage_min
461
471
462 # Storage
472 # Storage
463 self.rc = rc # This will hold all configuration information
473 self.rc = rc # This will hold all configuration information
464 self.pager = 'less'
474 self.pager = 'less'
465 # temporary files used for various purposes. Deleted at exit.
475 # temporary files used for various purposes. Deleted at exit.
466 self.tempfiles = []
476 self.tempfiles = []
467
477
468 # Keep track of readline usage (later set by init_readline)
478 # Keep track of readline usage (later set by init_readline)
469 self.has_readline = False
479 self.has_readline = False
470
480
471 # template for logfile headers. It gets resolved at runtime by the
481 # template for logfile headers. It gets resolved at runtime by the
472 # logstart method.
482 # logstart method.
473 self.loghead_tpl = \
483 self.loghead_tpl = \
474 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
484 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
475 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
485 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
476 #log# opts = %s
486 #log# opts = %s
477 #log# args = %s
487 #log# args = %s
478 #log# It is safe to make manual edits below here.
488 #log# It is safe to make manual edits below here.
479 #log#-----------------------------------------------------------------------
489 #log#-----------------------------------------------------------------------
480 """
490 """
481 # for pushd/popd management
491 # for pushd/popd management
482 try:
492 try:
483 self.home_dir = get_home_dir()
493 self.home_dir = get_home_dir()
484 except HomeDirError,msg:
494 except HomeDirError,msg:
485 fatal(msg)
495 fatal(msg)
486
496
487 self.dir_stack = []
497 self.dir_stack = []
488
498
489 # Functions to call the underlying shell.
499 # Functions to call the underlying shell.
490
500
491 # The first is similar to os.system, but it doesn't return a value,
501 # The first is similar to os.system, but it doesn't return a value,
492 # and it allows interpolation of variables in the user's namespace.
502 # and it allows interpolation of variables in the user's namespace.
493 self.system = lambda cmd: \
503 self.system = lambda cmd: \
494 shell(self.var_expand(cmd,depth=2),
504 shell(self.var_expand(cmd,depth=2),
495 header=self.rc.system_header,
505 header=self.rc.system_header,
496 verbose=self.rc.system_verbose)
506 verbose=self.rc.system_verbose)
497
507
498 # These are for getoutput and getoutputerror:
508 # These are for getoutput and getoutputerror:
499 self.getoutput = lambda cmd: \
509 self.getoutput = lambda cmd: \
500 getoutput(self.var_expand(cmd,depth=2),
510 getoutput(self.var_expand(cmd,depth=2),
501 header=self.rc.system_header,
511 header=self.rc.system_header,
502 verbose=self.rc.system_verbose)
512 verbose=self.rc.system_verbose)
503
513
504 self.getoutputerror = lambda cmd: \
514 self.getoutputerror = lambda cmd: \
505 getoutputerror(self.var_expand(cmd,depth=2),
515 getoutputerror(self.var_expand(cmd,depth=2),
506 header=self.rc.system_header,
516 header=self.rc.system_header,
507 verbose=self.rc.system_verbose)
517 verbose=self.rc.system_verbose)
508
518
509
519
510 # keep track of where we started running (mainly for crash post-mortem)
520 # keep track of where we started running (mainly for crash post-mortem)
511 self.starting_dir = os.getcwd()
521 self.starting_dir = os.getcwd()
512
522
513 # Various switches which can be set
523 # Various switches which can be set
514 self.CACHELENGTH = 5000 # this is cheap, it's just text
524 self.CACHELENGTH = 5000 # this is cheap, it's just text
515 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
525 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
516 self.banner2 = banner2
526 self.banner2 = banner2
517
527
518 # TraceBack handlers:
528 # TraceBack handlers:
519
529
520 # Syntax error handler.
530 # Syntax error handler.
521 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
531 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
522
532
523 # The interactive one is initialized with an offset, meaning we always
533 # The interactive one is initialized with an offset, meaning we always
524 # want to remove the topmost item in the traceback, which is our own
534 # want to remove the topmost item in the traceback, which is our own
525 # internal code. Valid modes: ['Plain','Context','Verbose']
535 # internal code. Valid modes: ['Plain','Context','Verbose']
526 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
536 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
527 color_scheme='NoColor',
537 color_scheme='NoColor',
528 tb_offset = 1)
538 tb_offset = 1)
529
539
530 # IPython itself shouldn't crash. This will produce a detailed
540 # IPython itself shouldn't crash. This will produce a detailed
531 # post-mortem if it does. But we only install the crash handler for
541 # post-mortem if it does. But we only install the crash handler for
532 # non-threaded shells, the threaded ones use a normal verbose reporter
542 # non-threaded shells, the threaded ones use a normal verbose reporter
533 # and lose the crash handler. This is because exceptions in the main
543 # and lose the crash handler. This is because exceptions in the main
534 # thread (such as in GUI code) propagate directly to sys.excepthook,
544 # thread (such as in GUI code) propagate directly to sys.excepthook,
535 # and there's no point in printing crash dumps for every user exception.
545 # and there's no point in printing crash dumps for every user exception.
536 if self.isthreaded:
546 if self.isthreaded:
537 ipCrashHandler = ultraTB.FormattedTB()
547 ipCrashHandler = ultraTB.FormattedTB()
538 else:
548 else:
539 from IPython import CrashHandler
549 from IPython import CrashHandler
540 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
550 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
541 self.set_crash_handler(ipCrashHandler)
551 self.set_crash_handler(ipCrashHandler)
542
552
543 # and add any custom exception handlers the user may have specified
553 # and add any custom exception handlers the user may have specified
544 self.set_custom_exc(*custom_exceptions)
554 self.set_custom_exc(*custom_exceptions)
545
555
546 # indentation management
556 # indentation management
547 self.autoindent = False
557 self.autoindent = False
548 self.indent_current_nsp = 0
558 self.indent_current_nsp = 0
549
559
550 # Make some aliases automatically
560 # Make some aliases automatically
551 # Prepare list of shell aliases to auto-define
561 # Prepare list of shell aliases to auto-define
552 if os.name == 'posix':
562 if os.name == 'posix':
553 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
563 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
554 'mv mv -i','rm rm -i','cp cp -i',
564 'mv mv -i','rm rm -i','cp cp -i',
555 'cat cat','less less','clear clear',
565 'cat cat','less less','clear clear',
556 # a better ls
566 # a better ls
557 'ls ls -F',
567 'ls ls -F',
558 # long ls
568 # long ls
559 'll ls -lF')
569 'll ls -lF')
560 # Extra ls aliases with color, which need special treatment on BSD
570 # Extra ls aliases with color, which need special treatment on BSD
561 # variants
571 # variants
562 ls_extra = ( # color ls
572 ls_extra = ( # color ls
563 'lc ls -F -o --color',
573 'lc ls -F -o --color',
564 # ls normal files only
574 # ls normal files only
565 'lf ls -F -o --color %l | grep ^-',
575 'lf ls -F -o --color %l | grep ^-',
566 # ls symbolic links
576 # ls symbolic links
567 'lk ls -F -o --color %l | grep ^l',
577 'lk ls -F -o --color %l | grep ^l',
568 # directories or links to directories,
578 # directories or links to directories,
569 'ldir ls -F -o --color %l | grep /$',
579 'ldir ls -F -o --color %l | grep /$',
570 # things which are executable
580 # things which are executable
571 'lx ls -F -o --color %l | grep ^-..x',
581 'lx ls -F -o --color %l | grep ^-..x',
572 )
582 )
573 # The BSDs don't ship GNU ls, so they don't understand the
583 # The BSDs don't ship GNU ls, so they don't understand the
574 # --color switch out of the box
584 # --color switch out of the box
575 if 'bsd' in sys.platform:
585 if 'bsd' in sys.platform:
576 ls_extra = ( # ls normal files only
586 ls_extra = ( # ls normal files only
577 'lf ls -lF | grep ^-',
587 'lf ls -lF | grep ^-',
578 # ls symbolic links
588 # ls symbolic links
579 'lk ls -lF | grep ^l',
589 'lk ls -lF | grep ^l',
580 # directories or links to directories,
590 # directories or links to directories,
581 'ldir ls -lF | grep /$',
591 'ldir ls -lF | grep /$',
582 # things which are executable
592 # things which are executable
583 'lx ls -lF | grep ^-..x',
593 'lx ls -lF | grep ^-..x',
584 )
594 )
585 auto_alias = auto_alias + ls_extra
595 auto_alias = auto_alias + ls_extra
586 elif os.name in ['nt','dos']:
596 elif os.name in ['nt','dos']:
587 auto_alias = ('ls dir /on',
597 auto_alias = ('ls dir /on',
588 'ddir dir /ad /on', 'ldir dir /ad /on',
598 'ddir dir /ad /on', 'ldir dir /ad /on',
589 'mkdir mkdir','rmdir rmdir','echo echo',
599 'mkdir mkdir','rmdir rmdir','echo echo',
590 'ren ren','cls cls','copy copy')
600 'ren ren','cls cls','copy copy')
591 else:
601 else:
592 auto_alias = ()
602 auto_alias = ()
593 self.auto_alias = [s.split(None,1) for s in auto_alias]
603 self.auto_alias = [s.split(None,1) for s in auto_alias]
594
604
595 # Produce a public API instance
605 # Produce a public API instance
596 self.api = IPython.ipapi.IPApi(self)
606 self.api = IPython.ipapi.IPApi(self)
597
607
598 # Call the actual (public) initializer
608 # Call the actual (public) initializer
599 self.init_auto_alias()
609 self.init_auto_alias()
600
610
601 # track which builtins we add, so we can clean up later
611 # track which builtins we add, so we can clean up later
602 self.builtins_added = {}
612 self.builtins_added = {}
603 # This method will add the necessary builtins for operation, but
613 # This method will add the necessary builtins for operation, but
604 # tracking what it did via the builtins_added dict.
614 # tracking what it did via the builtins_added dict.
605 self.add_builtins()
615 self.add_builtins()
606
616
607
617
608
618
609 # end __init__
619 # end __init__
610
620
611 def var_expand(self,cmd,depth=0):
621 def var_expand(self,cmd,depth=0):
612 """Expand python variables in a string.
622 """Expand python variables in a string.
613
623
614 The depth argument indicates how many frames above the caller should
624 The depth argument indicates how many frames above the caller should
615 be walked to look for the local namespace where to expand variables.
625 be walked to look for the local namespace where to expand variables.
616
626
617 The global namespace for expansion is always the user's interactive
627 The global namespace for expansion is always the user's interactive
618 namespace.
628 namespace.
619 """
629 """
620
630
621 return str(ItplNS(cmd,
631 return str(ItplNS(cmd,
622 self.user_ns, # globals
632 self.user_ns, # globals
623 # Skip our own frame in searching for locals:
633 # Skip our own frame in searching for locals:
624 sys._getframe(depth+1).f_locals # locals
634 sys._getframe(depth+1).f_locals # locals
625 ))
635 ))
626
636
627 def pre_config_initialization(self):
637 def pre_config_initialization(self):
628 """Pre-configuration init method
638 """Pre-configuration init method
629
639
630 This is called before the configuration files are processed to
640 This is called before the configuration files are processed to
631 prepare the services the config files might need.
641 prepare the services the config files might need.
632
642
633 self.rc already has reasonable default values at this point.
643 self.rc already has reasonable default values at this point.
634 """
644 """
635 rc = self.rc
645 rc = self.rc
636 try:
646 try:
637 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
647 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
638 except exceptions.UnicodeDecodeError:
648 except exceptions.UnicodeDecodeError:
639 print "Your ipythondir can't be decoded to unicode!"
649 print "Your ipythondir can't be decoded to unicode!"
640 print "Please set HOME environment variable to something that"
650 print "Please set HOME environment variable to something that"
641 print r"only has ASCII characters, e.g. c:\home"
651 print r"only has ASCII characters, e.g. c:\home"
642 print "Now it is",rc.ipythondir
652 print "Now it is",rc.ipythondir
643 sys.exit()
653 sys.exit()
644 self.shadowhist = IPython.history.ShadowHist(self.db)
654 self.shadowhist = IPython.history.ShadowHist(self.db)
645
655
646
656
647 def post_config_initialization(self):
657 def post_config_initialization(self):
648 """Post configuration init method
658 """Post configuration init method
649
659
650 This is called after the configuration files have been processed to
660 This is called after the configuration files have been processed to
651 'finalize' the initialization."""
661 'finalize' the initialization."""
652
662
653 rc = self.rc
663 rc = self.rc
654
664
655 # Object inspector
665 # Object inspector
656 self.inspector = OInspect.Inspector(OInspect.InspectColors,
666 self.inspector = OInspect.Inspector(OInspect.InspectColors,
657 PyColorize.ANSICodeColors,
667 PyColorize.ANSICodeColors,
658 'NoColor',
668 'NoColor',
659 rc.object_info_string_level)
669 rc.object_info_string_level)
660
670
661 self.rl_next_input = None
671 self.rl_next_input = None
662 self.rl_do_indent = False
672 self.rl_do_indent = False
663 # Load readline proper
673 # Load readline proper
664 if rc.readline:
674 if rc.readline:
665 self.init_readline()
675 self.init_readline()
666
676
667
677
668 # local shortcut, this is used a LOT
678 # local shortcut, this is used a LOT
669 self.log = self.logger.log
679 self.log = self.logger.log
670
680
671 # Initialize cache, set in/out prompts and printing system
681 # Initialize cache, set in/out prompts and printing system
672 self.outputcache = CachedOutput(self,
682 self.outputcache = CachedOutput(self,
673 rc.cache_size,
683 rc.cache_size,
674 rc.pprint,
684 rc.pprint,
675 input_sep = rc.separate_in,
685 input_sep = rc.separate_in,
676 output_sep = rc.separate_out,
686 output_sep = rc.separate_out,
677 output_sep2 = rc.separate_out2,
687 output_sep2 = rc.separate_out2,
678 ps1 = rc.prompt_in1,
688 ps1 = rc.prompt_in1,
679 ps2 = rc.prompt_in2,
689 ps2 = rc.prompt_in2,
680 ps_out = rc.prompt_out,
690 ps_out = rc.prompt_out,
681 pad_left = rc.prompts_pad_left)
691 pad_left = rc.prompts_pad_left)
682
692
683 # user may have over-ridden the default print hook:
693 # user may have over-ridden the default print hook:
684 try:
694 try:
685 self.outputcache.__class__.display = self.hooks.display
695 self.outputcache.__class__.display = self.hooks.display
686 except AttributeError:
696 except AttributeError:
687 pass
697 pass
688
698
689 # I don't like assigning globally to sys, because it means when
699 # I don't like assigning globally to sys, because it means when
690 # embedding instances, each embedded instance overrides the previous
700 # embedding instances, each embedded instance overrides the previous
691 # choice. But sys.displayhook seems to be called internally by exec,
701 # choice. But sys.displayhook seems to be called internally by exec,
692 # so I don't see a way around it. We first save the original and then
702 # so I don't see a way around it. We first save the original and then
693 # overwrite it.
703 # overwrite it.
694 self.sys_displayhook = sys.displayhook
704 self.sys_displayhook = sys.displayhook
695 sys.displayhook = self.outputcache
705 sys.displayhook = self.outputcache
696
706
697 # Do a proper resetting of doctest, including the necessary displayhook
707 # Do a proper resetting of doctest, including the necessary displayhook
698 # monkeypatching
708 # monkeypatching
699 doctest_reload()
709 doctest_reload()
700
710
701 # Set user colors (don't do it in the constructor above so that it
711 # Set user colors (don't do it in the constructor above so that it
702 # doesn't crash if colors option is invalid)
712 # doesn't crash if colors option is invalid)
703 self.magic_colors(rc.colors)
713 self.magic_colors(rc.colors)
704
714
705 # Set calling of pdb on exceptions
715 # Set calling of pdb on exceptions
706 self.call_pdb = rc.pdb
716 self.call_pdb = rc.pdb
707
717
708 # Load user aliases
718 # Load user aliases
709 for alias in rc.alias:
719 for alias in rc.alias:
710 self.magic_alias(alias)
720 self.magic_alias(alias)
711
721
712 self.hooks.late_startup_hook()
722 self.hooks.late_startup_hook()
713
723
714 batchrun = False
724 batchrun = False
715 for batchfile in [path(arg) for arg in self.rc.args
725 for batchfile in [path(arg) for arg in self.rc.args
716 if arg.lower().endswith('.ipy')]:
726 if arg.lower().endswith('.ipy')]:
717 if not batchfile.isfile():
727 if not batchfile.isfile():
718 print "No such batch file:", batchfile
728 print "No such batch file:", batchfile
719 continue
729 continue
720 self.api.runlines(batchfile.text())
730 self.api.runlines(batchfile.text())
721 batchrun = True
731 batchrun = True
722 # without -i option, exit after running the batch file
732 # without -i option, exit after running the batch file
723 if batchrun and not self.rc.interact:
733 if batchrun and not self.rc.interact:
724 self.exit_now = True
734 self.exit_now = True
725
735
726 def add_builtins(self):
736 def add_builtins(self):
727 """Store ipython references into the builtin namespace.
737 """Store ipython references into the builtin namespace.
728
738
729 Some parts of ipython operate via builtins injected here, which hold a
739 Some parts of ipython operate via builtins injected here, which hold a
730 reference to IPython itself."""
740 reference to IPython itself."""
731
741
732 # TODO: deprecate all except _ip; 'jobs' should be installed
742 # TODO: deprecate all except _ip; 'jobs' should be installed
733 # by an extension and the rest are under _ip, ipalias is redundant
743 # by an extension and the rest are under _ip, ipalias is redundant
734 builtins_new = dict(__IPYTHON__ = self,
744 builtins_new = dict(__IPYTHON__ = self,
735 ip_set_hook = self.set_hook,
745 ip_set_hook = self.set_hook,
736 jobs = self.jobs,
746 jobs = self.jobs,
737 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
747 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
738 ipalias = wrap_deprecated(self.ipalias),
748 ipalias = wrap_deprecated(self.ipalias),
739 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
749 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
740 _ip = self.api
750 _ip = self.api
741 )
751 )
742 for biname,bival in builtins_new.items():
752 for biname,bival in builtins_new.items():
743 try:
753 try:
744 # store the orignal value so we can restore it
754 # store the orignal value so we can restore it
745 self.builtins_added[biname] = __builtin__.__dict__[biname]
755 self.builtins_added[biname] = __builtin__.__dict__[biname]
746 except KeyError:
756 except KeyError:
747 # or mark that it wasn't defined, and we'll just delete it at
757 # or mark that it wasn't defined, and we'll just delete it at
748 # cleanup
758 # cleanup
749 self.builtins_added[biname] = Undefined
759 self.builtins_added[biname] = Undefined
750 __builtin__.__dict__[biname] = bival
760 __builtin__.__dict__[biname] = bival
751
761
752 # Keep in the builtins a flag for when IPython is active. We set it
762 # Keep in the builtins a flag for when IPython is active. We set it
753 # with setdefault so that multiple nested IPythons don't clobber one
763 # with setdefault so that multiple nested IPythons don't clobber one
754 # another. Each will increase its value by one upon being activated,
764 # another. Each will increase its value by one upon being activated,
755 # which also gives us a way to determine the nesting level.
765 # which also gives us a way to determine the nesting level.
756 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
766 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
757
767
758 def clean_builtins(self):
768 def clean_builtins(self):
759 """Remove any builtins which might have been added by add_builtins, or
769 """Remove any builtins which might have been added by add_builtins, or
760 restore overwritten ones to their previous values."""
770 restore overwritten ones to their previous values."""
761 for biname,bival in self.builtins_added.items():
771 for biname,bival in self.builtins_added.items():
762 if bival is Undefined:
772 if bival is Undefined:
763 del __builtin__.__dict__[biname]
773 del __builtin__.__dict__[biname]
764 else:
774 else:
765 __builtin__.__dict__[biname] = bival
775 __builtin__.__dict__[biname] = bival
766 self.builtins_added.clear()
776 self.builtins_added.clear()
767
777
768 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
778 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
769 """set_hook(name,hook) -> sets an internal IPython hook.
779 """set_hook(name,hook) -> sets an internal IPython hook.
770
780
771 IPython exposes some of its internal API as user-modifiable hooks. By
781 IPython exposes some of its internal API as user-modifiable hooks. By
772 adding your function to one of these hooks, you can modify IPython's
782 adding your function to one of these hooks, you can modify IPython's
773 behavior to call at runtime your own routines."""
783 behavior to call at runtime your own routines."""
774
784
775 # At some point in the future, this should validate the hook before it
785 # At some point in the future, this should validate the hook before it
776 # accepts it. Probably at least check that the hook takes the number
786 # accepts it. Probably at least check that the hook takes the number
777 # of args it's supposed to.
787 # of args it's supposed to.
778
788
779 f = new.instancemethod(hook,self,self.__class__)
789 f = new.instancemethod(hook,self,self.__class__)
780
790
781 # check if the hook is for strdispatcher first
791 # check if the hook is for strdispatcher first
782 if str_key is not None:
792 if str_key is not None:
783 sdp = self.strdispatchers.get(name, StrDispatch())
793 sdp = self.strdispatchers.get(name, StrDispatch())
784 sdp.add_s(str_key, f, priority )
794 sdp.add_s(str_key, f, priority )
785 self.strdispatchers[name] = sdp
795 self.strdispatchers[name] = sdp
786 return
796 return
787 if re_key is not None:
797 if re_key is not None:
788 sdp = self.strdispatchers.get(name, StrDispatch())
798 sdp = self.strdispatchers.get(name, StrDispatch())
789 sdp.add_re(re.compile(re_key), f, priority )
799 sdp.add_re(re.compile(re_key), f, priority )
790 self.strdispatchers[name] = sdp
800 self.strdispatchers[name] = sdp
791 return
801 return
792
802
793 dp = getattr(self.hooks, name, None)
803 dp = getattr(self.hooks, name, None)
794 if name not in IPython.hooks.__all__:
804 if name not in IPython.hooks.__all__:
795 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
805 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
796 if not dp:
806 if not dp:
797 dp = IPython.hooks.CommandChainDispatcher()
807 dp = IPython.hooks.CommandChainDispatcher()
798
808
799 try:
809 try:
800 dp.add(f,priority)
810 dp.add(f,priority)
801 except AttributeError:
811 except AttributeError:
802 # it was not commandchain, plain old func - replace
812 # it was not commandchain, plain old func - replace
803 dp = f
813 dp = f
804
814
805 setattr(self.hooks,name, dp)
815 setattr(self.hooks,name, dp)
806
816
807
817
808 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
818 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
809
819
810 def set_crash_handler(self,crashHandler):
820 def set_crash_handler(self,crashHandler):
811 """Set the IPython crash handler.
821 """Set the IPython crash handler.
812
822
813 This must be a callable with a signature suitable for use as
823 This must be a callable with a signature suitable for use as
814 sys.excepthook."""
824 sys.excepthook."""
815
825
816 # Install the given crash handler as the Python exception hook
826 # Install the given crash handler as the Python exception hook
817 sys.excepthook = crashHandler
827 sys.excepthook = crashHandler
818
828
819 # The instance will store a pointer to this, so that runtime code
829 # The instance will store a pointer to this, so that runtime code
820 # (such as magics) can access it. This is because during the
830 # (such as magics) can access it. This is because during the
821 # read-eval loop, it gets temporarily overwritten (to deal with GUI
831 # read-eval loop, it gets temporarily overwritten (to deal with GUI
822 # frameworks).
832 # frameworks).
823 self.sys_excepthook = sys.excepthook
833 self.sys_excepthook = sys.excepthook
824
834
825
835
826 def set_custom_exc(self,exc_tuple,handler):
836 def set_custom_exc(self,exc_tuple,handler):
827 """set_custom_exc(exc_tuple,handler)
837 """set_custom_exc(exc_tuple,handler)
828
838
829 Set a custom exception handler, which will be called if any of the
839 Set a custom exception handler, which will be called if any of the
830 exceptions in exc_tuple occur in the mainloop (specifically, in the
840 exceptions in exc_tuple occur in the mainloop (specifically, in the
831 runcode() method.
841 runcode() method.
832
842
833 Inputs:
843 Inputs:
834
844
835 - exc_tuple: a *tuple* of valid exceptions to call the defined
845 - exc_tuple: a *tuple* of valid exceptions to call the defined
836 handler for. It is very important that you use a tuple, and NOT A
846 handler for. It is very important that you use a tuple, and NOT A
837 LIST here, because of the way Python's except statement works. If
847 LIST here, because of the way Python's except statement works. If
838 you only want to trap a single exception, use a singleton tuple:
848 you only want to trap a single exception, use a singleton tuple:
839
849
840 exc_tuple == (MyCustomException,)
850 exc_tuple == (MyCustomException,)
841
851
842 - handler: this must be defined as a function with the following
852 - handler: this must be defined as a function with the following
843 basic interface: def my_handler(self,etype,value,tb).
853 basic interface: def my_handler(self,etype,value,tb).
844
854
845 This will be made into an instance method (via new.instancemethod)
855 This will be made into an instance method (via new.instancemethod)
846 of IPython itself, and it will be called if any of the exceptions
856 of IPython itself, and it will be called if any of the exceptions
847 listed in the exc_tuple are caught. If the handler is None, an
857 listed in the exc_tuple are caught. If the handler is None, an
848 internal basic one is used, which just prints basic info.
858 internal basic one is used, which just prints basic info.
849
859
850 WARNING: by putting in your own exception handler into IPython's main
860 WARNING: by putting in your own exception handler into IPython's main
851 execution loop, you run a very good chance of nasty crashes. This
861 execution loop, you run a very good chance of nasty crashes. This
852 facility should only be used if you really know what you are doing."""
862 facility should only be used if you really know what you are doing."""
853
863
854 assert type(exc_tuple)==type(()) , \
864 assert type(exc_tuple)==type(()) , \
855 "The custom exceptions must be given AS A TUPLE."
865 "The custom exceptions must be given AS A TUPLE."
856
866
857 def dummy_handler(self,etype,value,tb):
867 def dummy_handler(self,etype,value,tb):
858 print '*** Simple custom exception handler ***'
868 print '*** Simple custom exception handler ***'
859 print 'Exception type :',etype
869 print 'Exception type :',etype
860 print 'Exception value:',value
870 print 'Exception value:',value
861 print 'Traceback :',tb
871 print 'Traceback :',tb
862 print 'Source code :','\n'.join(self.buffer)
872 print 'Source code :','\n'.join(self.buffer)
863
873
864 if handler is None: handler = dummy_handler
874 if handler is None: handler = dummy_handler
865
875
866 self.CustomTB = new.instancemethod(handler,self,self.__class__)
876 self.CustomTB = new.instancemethod(handler,self,self.__class__)
867 self.custom_exceptions = exc_tuple
877 self.custom_exceptions = exc_tuple
868
878
869 def set_custom_completer(self,completer,pos=0):
879 def set_custom_completer(self,completer,pos=0):
870 """set_custom_completer(completer,pos=0)
880 """set_custom_completer(completer,pos=0)
871
881
872 Adds a new custom completer function.
882 Adds a new custom completer function.
873
883
874 The position argument (defaults to 0) is the index in the completers
884 The position argument (defaults to 0) is the index in the completers
875 list where you want the completer to be inserted."""
885 list where you want the completer to be inserted."""
876
886
877 newcomp = new.instancemethod(completer,self.Completer,
887 newcomp = new.instancemethod(completer,self.Completer,
878 self.Completer.__class__)
888 self.Completer.__class__)
879 self.Completer.matchers.insert(pos,newcomp)
889 self.Completer.matchers.insert(pos,newcomp)
880
890
881 def set_completer(self):
891 def set_completer(self):
882 """reset readline's completer to be our own."""
892 """reset readline's completer to be our own."""
883 self.readline.set_completer(self.Completer.complete)
893 self.readline.set_completer(self.Completer.complete)
884
894
885 def _get_call_pdb(self):
895 def _get_call_pdb(self):
886 return self._call_pdb
896 return self._call_pdb
887
897
888 def _set_call_pdb(self,val):
898 def _set_call_pdb(self,val):
889
899
890 if val not in (0,1,False,True):
900 if val not in (0,1,False,True):
891 raise ValueError,'new call_pdb value must be boolean'
901 raise ValueError,'new call_pdb value must be boolean'
892
902
893 # store value in instance
903 # store value in instance
894 self._call_pdb = val
904 self._call_pdb = val
895
905
896 # notify the actual exception handlers
906 # notify the actual exception handlers
897 self.InteractiveTB.call_pdb = val
907 self.InteractiveTB.call_pdb = val
898 if self.isthreaded:
908 if self.isthreaded:
899 try:
909 try:
900 self.sys_excepthook.call_pdb = val
910 self.sys_excepthook.call_pdb = val
901 except:
911 except:
902 warn('Failed to activate pdb for threaded exception handler')
912 warn('Failed to activate pdb for threaded exception handler')
903
913
904 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
914 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
905 'Control auto-activation of pdb at exceptions')
915 'Control auto-activation of pdb at exceptions')
906
916
907
917
908 # These special functions get installed in the builtin namespace, to
918 # These special functions get installed in the builtin namespace, to
909 # provide programmatic (pure python) access to magics, aliases and system
919 # provide programmatic (pure python) access to magics, aliases and system
910 # calls. This is important for logging, user scripting, and more.
920 # calls. This is important for logging, user scripting, and more.
911
921
912 # We are basically exposing, via normal python functions, the three
922 # We are basically exposing, via normal python functions, the three
913 # mechanisms in which ipython offers special call modes (magics for
923 # mechanisms in which ipython offers special call modes (magics for
914 # internal control, aliases for direct system access via pre-selected
924 # internal control, aliases for direct system access via pre-selected
915 # names, and !cmd for calling arbitrary system commands).
925 # names, and !cmd for calling arbitrary system commands).
916
926
917 def ipmagic(self,arg_s):
927 def ipmagic(self,arg_s):
918 """Call a magic function by name.
928 """Call a magic function by name.
919
929
920 Input: a string containing the name of the magic function to call and any
930 Input: a string containing the name of the magic function to call and any
921 additional arguments to be passed to the magic.
931 additional arguments to be passed to the magic.
922
932
923 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
933 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
924 prompt:
934 prompt:
925
935
926 In[1]: %name -opt foo bar
936 In[1]: %name -opt foo bar
927
937
928 To call a magic without arguments, simply use ipmagic('name').
938 To call a magic without arguments, simply use ipmagic('name').
929
939
930 This provides a proper Python function to call IPython's magics in any
940 This provides a proper Python function to call IPython's magics in any
931 valid Python code you can type at the interpreter, including loops and
941 valid Python code you can type at the interpreter, including loops and
932 compound statements. It is added by IPython to the Python builtin
942 compound statements. It is added by IPython to the Python builtin
933 namespace upon initialization."""
943 namespace upon initialization."""
934
944
935 args = arg_s.split(' ',1)
945 args = arg_s.split(' ',1)
936 magic_name = args[0]
946 magic_name = args[0]
937 magic_name = magic_name.lstrip(self.ESC_MAGIC)
947 magic_name = magic_name.lstrip(self.ESC_MAGIC)
938
948
939 try:
949 try:
940 magic_args = args[1]
950 magic_args = args[1]
941 except IndexError:
951 except IndexError:
942 magic_args = ''
952 magic_args = ''
943 fn = getattr(self,'magic_'+magic_name,None)
953 fn = getattr(self,'magic_'+magic_name,None)
944 if fn is None:
954 if fn is None:
945 error("Magic function `%s` not found." % magic_name)
955 error("Magic function `%s` not found." % magic_name)
946 else:
956 else:
947 magic_args = self.var_expand(magic_args,1)
957 magic_args = self.var_expand(magic_args,1)
948 return fn(magic_args)
958 return fn(magic_args)
949
959
950 def ipalias(self,arg_s):
960 def ipalias(self,arg_s):
951 """Call an alias by name.
961 """Call an alias by name.
952
962
953 Input: a string containing the name of the alias to call and any
963 Input: a string containing the name of the alias to call and any
954 additional arguments to be passed to the magic.
964 additional arguments to be passed to the magic.
955
965
956 ipalias('name -opt foo bar') is equivalent to typing at the ipython
966 ipalias('name -opt foo bar') is equivalent to typing at the ipython
957 prompt:
967 prompt:
958
968
959 In[1]: name -opt foo bar
969 In[1]: name -opt foo bar
960
970
961 To call an alias without arguments, simply use ipalias('name').
971 To call an alias without arguments, simply use ipalias('name').
962
972
963 This provides a proper Python function to call IPython's aliases in any
973 This provides a proper Python function to call IPython's aliases in any
964 valid Python code you can type at the interpreter, including loops and
974 valid Python code you can type at the interpreter, including loops and
965 compound statements. It is added by IPython to the Python builtin
975 compound statements. It is added by IPython to the Python builtin
966 namespace upon initialization."""
976 namespace upon initialization."""
967
977
968 args = arg_s.split(' ',1)
978 args = arg_s.split(' ',1)
969 alias_name = args[0]
979 alias_name = args[0]
970 try:
980 try:
971 alias_args = args[1]
981 alias_args = args[1]
972 except IndexError:
982 except IndexError:
973 alias_args = ''
983 alias_args = ''
974 if alias_name in self.alias_table:
984 if alias_name in self.alias_table:
975 self.call_alias(alias_name,alias_args)
985 self.call_alias(alias_name,alias_args)
976 else:
986 else:
977 error("Alias `%s` not found." % alias_name)
987 error("Alias `%s` not found." % alias_name)
978
988
979 def ipsystem(self,arg_s):
989 def ipsystem(self,arg_s):
980 """Make a system call, using IPython."""
990 """Make a system call, using IPython."""
981
991
982 self.system(arg_s)
992 self.system(arg_s)
983
993
984 def complete(self,text):
994 def complete(self,text):
985 """Return a sorted list of all possible completions on text.
995 """Return a sorted list of all possible completions on text.
986
996
987 Inputs:
997 Inputs:
988
998
989 - text: a string of text to be completed on.
999 - text: a string of text to be completed on.
990
1000
991 This is a wrapper around the completion mechanism, similar to what
1001 This is a wrapper around the completion mechanism, similar to what
992 readline does at the command line when the TAB key is hit. By
1002 readline does at the command line when the TAB key is hit. By
993 exposing it as a method, it can be used by other non-readline
1003 exposing it as a method, it can be used by other non-readline
994 environments (such as GUIs) for text completion.
1004 environments (such as GUIs) for text completion.
995
1005
996 Simple usage example:
1006 Simple usage example:
997
1007
998 In [1]: x = 'hello'
1008 In [1]: x = 'hello'
999
1009
1000 In [2]: __IP.complete('x.l')
1010 In [2]: __IP.complete('x.l')
1001 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1011 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1002
1012
1003 complete = self.Completer.complete
1013 complete = self.Completer.complete
1004 state = 0
1014 state = 0
1005 # use a dict so we get unique keys, since ipyhton's multiple
1015 # use a dict so we get unique keys, since ipyhton's multiple
1006 # completers can return duplicates. When we make 2.4 a requirement,
1016 # completers can return duplicates. When we make 2.4 a requirement,
1007 # start using sets instead, which are faster.
1017 # start using sets instead, which are faster.
1008 comps = {}
1018 comps = {}
1009 while True:
1019 while True:
1010 newcomp = complete(text,state,line_buffer=text)
1020 newcomp = complete(text,state,line_buffer=text)
1011 if newcomp is None:
1021 if newcomp is None:
1012 break
1022 break
1013 comps[newcomp] = 1
1023 comps[newcomp] = 1
1014 state += 1
1024 state += 1
1015 outcomps = comps.keys()
1025 outcomps = comps.keys()
1016 outcomps.sort()
1026 outcomps.sort()
1017 return outcomps
1027 return outcomps
1018
1028
1019 def set_completer_frame(self, frame=None):
1029 def set_completer_frame(self, frame=None):
1020 if frame:
1030 if frame:
1021 self.Completer.namespace = frame.f_locals
1031 self.Completer.namespace = frame.f_locals
1022 self.Completer.global_namespace = frame.f_globals
1032 self.Completer.global_namespace = frame.f_globals
1023 else:
1033 else:
1024 self.Completer.namespace = self.user_ns
1034 self.Completer.namespace = self.user_ns
1025 self.Completer.global_namespace = self.user_global_ns
1035 self.Completer.global_namespace = self.user_global_ns
1026
1036
1027 def init_auto_alias(self):
1037 def init_auto_alias(self):
1028 """Define some aliases automatically.
1038 """Define some aliases automatically.
1029
1039
1030 These are ALL parameter-less aliases"""
1040 These are ALL parameter-less aliases"""
1031
1041
1032 for alias,cmd in self.auto_alias:
1042 for alias,cmd in self.auto_alias:
1033 self.getapi().defalias(alias,cmd)
1043 self.getapi().defalias(alias,cmd)
1034
1044
1035
1045
1036 def alias_table_validate(self,verbose=0):
1046 def alias_table_validate(self,verbose=0):
1037 """Update information about the alias table.
1047 """Update information about the alias table.
1038
1048
1039 In particular, make sure no Python keywords/builtins are in it."""
1049 In particular, make sure no Python keywords/builtins are in it."""
1040
1050
1041 no_alias = self.no_alias
1051 no_alias = self.no_alias
1042 for k in self.alias_table.keys():
1052 for k in self.alias_table.keys():
1043 if k in no_alias:
1053 if k in no_alias:
1044 del self.alias_table[k]
1054 del self.alias_table[k]
1045 if verbose:
1055 if verbose:
1046 print ("Deleting alias <%s>, it's a Python "
1056 print ("Deleting alias <%s>, it's a Python "
1047 "keyword or builtin." % k)
1057 "keyword or builtin." % k)
1048
1058
1049 def set_autoindent(self,value=None):
1059 def set_autoindent(self,value=None):
1050 """Set the autoindent flag, checking for readline support.
1060 """Set the autoindent flag, checking for readline support.
1051
1061
1052 If called with no arguments, it acts as a toggle."""
1062 If called with no arguments, it acts as a toggle."""
1053
1063
1054 if not self.has_readline:
1064 if not self.has_readline:
1055 if os.name == 'posix':
1065 if os.name == 'posix':
1056 warn("The auto-indent feature requires the readline library")
1066 warn("The auto-indent feature requires the readline library")
1057 self.autoindent = 0
1067 self.autoindent = 0
1058 return
1068 return
1059 if value is None:
1069 if value is None:
1060 self.autoindent = not self.autoindent
1070 self.autoindent = not self.autoindent
1061 else:
1071 else:
1062 self.autoindent = value
1072 self.autoindent = value
1063
1073
1064 def rc_set_toggle(self,rc_field,value=None):
1074 def rc_set_toggle(self,rc_field,value=None):
1065 """Set or toggle a field in IPython's rc config. structure.
1075 """Set or toggle a field in IPython's rc config. structure.
1066
1076
1067 If called with no arguments, it acts as a toggle.
1077 If called with no arguments, it acts as a toggle.
1068
1078
1069 If called with a non-existent field, the resulting AttributeError
1079 If called with a non-existent field, the resulting AttributeError
1070 exception will propagate out."""
1080 exception will propagate out."""
1071
1081
1072 rc_val = getattr(self.rc,rc_field)
1082 rc_val = getattr(self.rc,rc_field)
1073 if value is None:
1083 if value is None:
1074 value = not rc_val
1084 value = not rc_val
1075 setattr(self.rc,rc_field,value)
1085 setattr(self.rc,rc_field,value)
1076
1086
1077 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1087 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1078 """Install the user configuration directory.
1088 """Install the user configuration directory.
1079
1089
1080 Can be called when running for the first time or to upgrade the user's
1090 Can be called when running for the first time or to upgrade the user's
1081 .ipython/ directory with the mode parameter. Valid modes are 'install'
1091 .ipython/ directory with the mode parameter. Valid modes are 'install'
1082 and 'upgrade'."""
1092 and 'upgrade'."""
1083
1093
1084 def wait():
1094 def wait():
1085 try:
1095 try:
1086 raw_input("Please press <RETURN> to start IPython.")
1096 raw_input("Please press <RETURN> to start IPython.")
1087 except EOFError:
1097 except EOFError:
1088 print >> Term.cout
1098 print >> Term.cout
1089 print '*'*70
1099 print '*'*70
1090
1100
1091 cwd = os.getcwd() # remember where we started
1101 cwd = os.getcwd() # remember where we started
1092 glb = glob.glob
1102 glb = glob.glob
1093 print '*'*70
1103 print '*'*70
1094 if mode == 'install':
1104 if mode == 'install':
1095 print \
1105 print \
1096 """Welcome to IPython. I will try to create a personal configuration directory
1106 """Welcome to IPython. I will try to create a personal configuration directory
1097 where you can customize many aspects of IPython's functionality in:\n"""
1107 where you can customize many aspects of IPython's functionality in:\n"""
1098 else:
1108 else:
1099 print 'I am going to upgrade your configuration in:'
1109 print 'I am going to upgrade your configuration in:'
1100
1110
1101 print ipythondir
1111 print ipythondir
1102
1112
1103 rcdirend = os.path.join('IPython','UserConfig')
1113 rcdirend = os.path.join('IPython','UserConfig')
1104 cfg = lambda d: os.path.join(d,rcdirend)
1114 cfg = lambda d: os.path.join(d,rcdirend)
1105 try:
1115 try:
1106 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1116 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1107 print "Initializing from configuration",rcdir
1117 print "Initializing from configuration",rcdir
1108 except IndexError:
1118 except IndexError:
1109 warning = """
1119 warning = """
1110 Installation error. IPython's directory was not found.
1120 Installation error. IPython's directory was not found.
1111
1121
1112 Check the following:
1122 Check the following:
1113
1123
1114 The ipython/IPython directory should be in a directory belonging to your
1124 The ipython/IPython directory should be in a directory belonging to your
1115 PYTHONPATH environment variable (that is, it should be in a directory
1125 PYTHONPATH environment variable (that is, it should be in a directory
1116 belonging to sys.path). You can copy it explicitly there or just link to it.
1126 belonging to sys.path). You can copy it explicitly there or just link to it.
1117
1127
1118 IPython will create a minimal default configuration for you.
1128 IPython will create a minimal default configuration for you.
1119
1129
1120 """
1130 """
1121 warn(warning)
1131 warn(warning)
1122 wait()
1132 wait()
1123
1133
1124 if sys.platform =='win32':
1134 if sys.platform =='win32':
1125 inif = 'ipythonrc.ini'
1135 inif = 'ipythonrc.ini'
1126 else:
1136 else:
1127 inif = 'ipythonrc'
1137 inif = 'ipythonrc'
1128 minimal_setup = {'ipy_user_conf.py' : 'import ipy_defaults', inif : '# intentionally left blank' }
1138 minimal_setup = {'ipy_user_conf.py' : 'import ipy_defaults', inif : '# intentionally left blank' }
1129 os.makedirs(ipythondir)
1139 os.makedirs(ipythondir)
1130 for f, cont in minimal_setup.items():
1140 for f, cont in minimal_setup.items():
1131 open(ipythondir + '/' + f,'w').write(cont)
1141 open(ipythondir + '/' + f,'w').write(cont)
1132
1142
1133 return
1143 return
1134
1144
1135 if mode == 'install':
1145 if mode == 'install':
1136 try:
1146 try:
1137 shutil.copytree(rcdir,ipythondir)
1147 shutil.copytree(rcdir,ipythondir)
1138 os.chdir(ipythondir)
1148 os.chdir(ipythondir)
1139 rc_files = glb("ipythonrc*")
1149 rc_files = glb("ipythonrc*")
1140 for rc_file in rc_files:
1150 for rc_file in rc_files:
1141 os.rename(rc_file,rc_file+rc_suffix)
1151 os.rename(rc_file,rc_file+rc_suffix)
1142 except:
1152 except:
1143 warning = """
1153 warning = """
1144
1154
1145 There was a problem with the installation:
1155 There was a problem with the installation:
1146 %s
1156 %s
1147 Try to correct it or contact the developers if you think it's a bug.
1157 Try to correct it or contact the developers if you think it's a bug.
1148 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1158 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1149 warn(warning)
1159 warn(warning)
1150 wait()
1160 wait()
1151 return
1161 return
1152
1162
1153 elif mode == 'upgrade':
1163 elif mode == 'upgrade':
1154 try:
1164 try:
1155 os.chdir(ipythondir)
1165 os.chdir(ipythondir)
1156 except:
1166 except:
1157 print """
1167 print """
1158 Can not upgrade: changing to directory %s failed. Details:
1168 Can not upgrade: changing to directory %s failed. Details:
1159 %s
1169 %s
1160 """ % (ipythondir,sys.exc_info()[1])
1170 """ % (ipythondir,sys.exc_info()[1])
1161 wait()
1171 wait()
1162 return
1172 return
1163 else:
1173 else:
1164 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1174 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1165 for new_full_path in sources:
1175 for new_full_path in sources:
1166 new_filename = os.path.basename(new_full_path)
1176 new_filename = os.path.basename(new_full_path)
1167 if new_filename.startswith('ipythonrc'):
1177 if new_filename.startswith('ipythonrc'):
1168 new_filename = new_filename + rc_suffix
1178 new_filename = new_filename + rc_suffix
1169 # The config directory should only contain files, skip any
1179 # The config directory should only contain files, skip any
1170 # directories which may be there (like CVS)
1180 # directories which may be there (like CVS)
1171 if os.path.isdir(new_full_path):
1181 if os.path.isdir(new_full_path):
1172 continue
1182 continue
1173 if os.path.exists(new_filename):
1183 if os.path.exists(new_filename):
1174 old_file = new_filename+'.old'
1184 old_file = new_filename+'.old'
1175 if os.path.exists(old_file):
1185 if os.path.exists(old_file):
1176 os.remove(old_file)
1186 os.remove(old_file)
1177 os.rename(new_filename,old_file)
1187 os.rename(new_filename,old_file)
1178 shutil.copy(new_full_path,new_filename)
1188 shutil.copy(new_full_path,new_filename)
1179 else:
1189 else:
1180 raise ValueError,'unrecognized mode for install:',`mode`
1190 raise ValueError,'unrecognized mode for install:',`mode`
1181
1191
1182 # Fix line-endings to those native to each platform in the config
1192 # Fix line-endings to those native to each platform in the config
1183 # directory.
1193 # directory.
1184 try:
1194 try:
1185 os.chdir(ipythondir)
1195 os.chdir(ipythondir)
1186 except:
1196 except:
1187 print """
1197 print """
1188 Problem: changing to directory %s failed.
1198 Problem: changing to directory %s failed.
1189 Details:
1199 Details:
1190 %s
1200 %s
1191
1201
1192 Some configuration files may have incorrect line endings. This should not
1202 Some configuration files may have incorrect line endings. This should not
1193 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1203 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1194 wait()
1204 wait()
1195 else:
1205 else:
1196 for fname in glb('ipythonrc*'):
1206 for fname in glb('ipythonrc*'):
1197 try:
1207 try:
1198 native_line_ends(fname,backup=0)
1208 native_line_ends(fname,backup=0)
1199 except IOError:
1209 except IOError:
1200 pass
1210 pass
1201
1211
1202 if mode == 'install':
1212 if mode == 'install':
1203 print """
1213 print """
1204 Successful installation!
1214 Successful installation!
1205
1215
1206 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1216 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1207 IPython manual (there are both HTML and PDF versions supplied with the
1217 IPython manual (there are both HTML and PDF versions supplied with the
1208 distribution) to make sure that your system environment is properly configured
1218 distribution) to make sure that your system environment is properly configured
1209 to take advantage of IPython's features.
1219 to take advantage of IPython's features.
1210
1220
1211 Important note: the configuration system has changed! The old system is
1221 Important note: the configuration system has changed! The old system is
1212 still in place, but its setting may be partly overridden by the settings in
1222 still in place, but its setting may be partly overridden by the settings in
1213 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1223 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1214 if some of the new settings bother you.
1224 if some of the new settings bother you.
1215
1225
1216 """
1226 """
1217 else:
1227 else:
1218 print """
1228 print """
1219 Successful upgrade!
1229 Successful upgrade!
1220
1230
1221 All files in your directory:
1231 All files in your directory:
1222 %(ipythondir)s
1232 %(ipythondir)s
1223 which would have been overwritten by the upgrade were backed up with a .old
1233 which would have been overwritten by the upgrade were backed up with a .old
1224 extension. If you had made particular customizations in those files you may
1234 extension. If you had made particular customizations in those files you may
1225 want to merge them back into the new files.""" % locals()
1235 want to merge them back into the new files.""" % locals()
1226 wait()
1236 wait()
1227 os.chdir(cwd)
1237 os.chdir(cwd)
1228 # end user_setup()
1238 # end user_setup()
1229
1239
1230 def atexit_operations(self):
1240 def atexit_operations(self):
1231 """This will be executed at the time of exit.
1241 """This will be executed at the time of exit.
1232
1242
1233 Saving of persistent data should be performed here. """
1243 Saving of persistent data should be performed here. """
1234
1244
1235 #print '*** IPython exit cleanup ***' # dbg
1245 #print '*** IPython exit cleanup ***' # dbg
1236 # input history
1246 # input history
1237 self.savehist()
1247 self.savehist()
1238
1248
1239 # Cleanup all tempfiles left around
1249 # Cleanup all tempfiles left around
1240 for tfile in self.tempfiles:
1250 for tfile in self.tempfiles:
1241 try:
1251 try:
1242 os.unlink(tfile)
1252 os.unlink(tfile)
1243 except OSError:
1253 except OSError:
1244 pass
1254 pass
1245
1255
1246 self.hooks.shutdown_hook()
1256 self.hooks.shutdown_hook()
1247
1257
1248 def savehist(self):
1258 def savehist(self):
1249 """Save input history to a file (via readline library)."""
1259 """Save input history to a file (via readline library)."""
1250 try:
1260 try:
1251 self.readline.write_history_file(self.histfile)
1261 self.readline.write_history_file(self.histfile)
1252 except:
1262 except:
1253 print 'Unable to save IPython command history to file: ' + \
1263 print 'Unable to save IPython command history to file: ' + \
1254 `self.histfile`
1264 `self.histfile`
1255
1265
1256 def reloadhist(self):
1266 def reloadhist(self):
1257 """Reload the input history from disk file."""
1267 """Reload the input history from disk file."""
1258
1268
1259 if self.has_readline:
1269 if self.has_readline:
1260 self.readline.clear_history()
1270 self.readline.clear_history()
1261 self.readline.read_history_file(self.shell.histfile)
1271 self.readline.read_history_file(self.shell.histfile)
1262
1272
1263 def history_saving_wrapper(self, func):
1273 def history_saving_wrapper(self, func):
1264 """ Wrap func for readline history saving
1274 """ Wrap func for readline history saving
1265
1275
1266 Convert func into callable that saves & restores
1276 Convert func into callable that saves & restores
1267 history around the call """
1277 history around the call """
1268
1278
1269 if not self.has_readline:
1279 if not self.has_readline:
1270 return func
1280 return func
1271
1281
1272 def wrapper():
1282 def wrapper():
1273 self.savehist()
1283 self.savehist()
1274 try:
1284 try:
1275 func()
1285 func()
1276 finally:
1286 finally:
1277 readline.read_history_file(self.histfile)
1287 readline.read_history_file(self.histfile)
1278 return wrapper
1288 return wrapper
1279
1289
1280
1290
1281 def pre_readline(self):
1291 def pre_readline(self):
1282 """readline hook to be used at the start of each line.
1292 """readline hook to be used at the start of each line.
1283
1293
1284 Currently it handles auto-indent only."""
1294 Currently it handles auto-indent only."""
1285
1295
1286 #debugx('self.indent_current_nsp','pre_readline:')
1296 #debugx('self.indent_current_nsp','pre_readline:')
1287
1297
1288 if self.rl_do_indent:
1298 if self.rl_do_indent:
1289 self.readline.insert_text(self.indent_current_str())
1299 self.readline.insert_text(self.indent_current_str())
1290 if self.rl_next_input is not None:
1300 if self.rl_next_input is not None:
1291 self.readline.insert_text(self.rl_next_input)
1301 self.readline.insert_text(self.rl_next_input)
1292 self.rl_next_input = None
1302 self.rl_next_input = None
1293
1303
1294 def init_readline(self):
1304 def init_readline(self):
1295 """Command history completion/saving/reloading."""
1305 """Command history completion/saving/reloading."""
1296
1306
1297
1307
1298 import IPython.rlineimpl as readline
1308 import IPython.rlineimpl as readline
1299
1309
1300 if not readline.have_readline:
1310 if not readline.have_readline:
1301 self.has_readline = 0
1311 self.has_readline = 0
1302 self.readline = None
1312 self.readline = None
1303 # no point in bugging windows users with this every time:
1313 # no point in bugging windows users with this every time:
1304 warn('Readline services not available on this platform.')
1314 warn('Readline services not available on this platform.')
1305 else:
1315 else:
1306 sys.modules['readline'] = readline
1316 sys.modules['readline'] = readline
1307 import atexit
1317 import atexit
1308 from IPython.completer import IPCompleter
1318 from IPython.completer import IPCompleter
1309 self.Completer = IPCompleter(self,
1319 self.Completer = IPCompleter(self,
1310 self.user_ns,
1320 self.user_ns,
1311 self.user_global_ns,
1321 self.user_global_ns,
1312 self.rc.readline_omit__names,
1322 self.rc.readline_omit__names,
1313 self.alias_table)
1323 self.alias_table)
1314 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1324 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1315 self.strdispatchers['complete_command'] = sdisp
1325 self.strdispatchers['complete_command'] = sdisp
1316 self.Completer.custom_completers = sdisp
1326 self.Completer.custom_completers = sdisp
1317 # Platform-specific configuration
1327 # Platform-specific configuration
1318 if os.name == 'nt':
1328 if os.name == 'nt':
1319 self.readline_startup_hook = readline.set_pre_input_hook
1329 self.readline_startup_hook = readline.set_pre_input_hook
1320 else:
1330 else:
1321 self.readline_startup_hook = readline.set_startup_hook
1331 self.readline_startup_hook = readline.set_startup_hook
1322
1332
1323 # Load user's initrc file (readline config)
1333 # Load user's initrc file (readline config)
1324 # Or if libedit is used, load editrc.
1334 # Or if libedit is used, load editrc.
1325 inputrc_name = os.environ.get('INPUTRC')
1335 inputrc_name = os.environ.get('INPUTRC')
1326 if inputrc_name is None:
1336 if inputrc_name is None:
1327 home_dir = get_home_dir()
1337 home_dir = get_home_dir()
1328 if home_dir is not None:
1338 if home_dir is not None:
1329 inputrc_name = '.inputrc'
1339 inputrc_name = '.inputrc'
1330 if readline.uses_libedit:
1340 if readline.uses_libedit:
1331 inputrc_name = '.editrc'
1341 inputrc_name = '.editrc'
1332 inputrc_name = os.path.join(home_dir, inputrc_name)
1342 inputrc_name = os.path.join(home_dir, inputrc_name)
1333 if os.path.isfile(inputrc_name):
1343 if os.path.isfile(inputrc_name):
1334 try:
1344 try:
1335 readline.read_init_file(inputrc_name)
1345 readline.read_init_file(inputrc_name)
1336 except:
1346 except:
1337 warn('Problems reading readline initialization file <%s>'
1347 warn('Problems reading readline initialization file <%s>'
1338 % inputrc_name)
1348 % inputrc_name)
1339
1349
1340 self.has_readline = 1
1350 self.has_readline = 1
1341 self.readline = readline
1351 self.readline = readline
1342 # save this in sys so embedded copies can restore it properly
1352 # save this in sys so embedded copies can restore it properly
1343 sys.ipcompleter = self.Completer.complete
1353 sys.ipcompleter = self.Completer.complete
1344 self.set_completer()
1354 self.set_completer()
1345
1355
1346 # Configure readline according to user's prefs
1356 # Configure readline according to user's prefs
1347 # This is only done if GNU readline is being used. If libedit
1357 # This is only done if GNU readline is being used. If libedit
1348 # is being used (as on Leopard) the readline config is
1358 # is being used (as on Leopard) the readline config is
1349 # not run as the syntax for libedit is different.
1359 # not run as the syntax for libedit is different.
1350 if not readline.uses_libedit:
1360 if not readline.uses_libedit:
1351 for rlcommand in self.rc.readline_parse_and_bind:
1361 for rlcommand in self.rc.readline_parse_and_bind:
1352 readline.parse_and_bind(rlcommand)
1362 readline.parse_and_bind(rlcommand)
1353
1363
1354 # remove some chars from the delimiters list
1364 # remove some chars from the delimiters list
1355 delims = readline.get_completer_delims()
1365 delims = readline.get_completer_delims()
1356 delims = delims.translate(string._idmap,
1366 delims = delims.translate(string._idmap,
1357 self.rc.readline_remove_delims)
1367 self.rc.readline_remove_delims)
1358 readline.set_completer_delims(delims)
1368 readline.set_completer_delims(delims)
1359 # otherwise we end up with a monster history after a while:
1369 # otherwise we end up with a monster history after a while:
1360 readline.set_history_length(1000)
1370 readline.set_history_length(1000)
1361 try:
1371 try:
1362 #print '*** Reading readline history' # dbg
1372 #print '*** Reading readline history' # dbg
1363 readline.read_history_file(self.histfile)
1373 readline.read_history_file(self.histfile)
1364 except IOError:
1374 except IOError:
1365 pass # It doesn't exist yet.
1375 pass # It doesn't exist yet.
1366
1376
1367 atexit.register(self.atexit_operations)
1377 atexit.register(self.atexit_operations)
1368 del atexit
1378 del atexit
1369
1379
1370 # Configure auto-indent for all platforms
1380 # Configure auto-indent for all platforms
1371 self.set_autoindent(self.rc.autoindent)
1381 self.set_autoindent(self.rc.autoindent)
1372
1382
1373 def ask_yes_no(self,prompt,default=True):
1383 def ask_yes_no(self,prompt,default=True):
1374 if self.rc.quiet:
1384 if self.rc.quiet:
1375 return True
1385 return True
1376 return ask_yes_no(prompt,default)
1386 return ask_yes_no(prompt,default)
1377
1387
1378 def _should_recompile(self,e):
1388 def _should_recompile(self,e):
1379 """Utility routine for edit_syntax_error"""
1389 """Utility routine for edit_syntax_error"""
1380
1390
1381 if e.filename in ('<ipython console>','<input>','<string>',
1391 if e.filename in ('<ipython console>','<input>','<string>',
1382 '<console>','<BackgroundJob compilation>',
1392 '<console>','<BackgroundJob compilation>',
1383 None):
1393 None):
1384
1394
1385 return False
1395 return False
1386 try:
1396 try:
1387 if (self.rc.autoedit_syntax and
1397 if (self.rc.autoedit_syntax and
1388 not self.ask_yes_no('Return to editor to correct syntax error? '
1398 not self.ask_yes_no('Return to editor to correct syntax error? '
1389 '[Y/n] ','y')):
1399 '[Y/n] ','y')):
1390 return False
1400 return False
1391 except EOFError:
1401 except EOFError:
1392 return False
1402 return False
1393
1403
1394 def int0(x):
1404 def int0(x):
1395 try:
1405 try:
1396 return int(x)
1406 return int(x)
1397 except TypeError:
1407 except TypeError:
1398 return 0
1408 return 0
1399 # always pass integer line and offset values to editor hook
1409 # always pass integer line and offset values to editor hook
1400 self.hooks.fix_error_editor(e.filename,
1410 self.hooks.fix_error_editor(e.filename,
1401 int0(e.lineno),int0(e.offset),e.msg)
1411 int0(e.lineno),int0(e.offset),e.msg)
1402 return True
1412 return True
1403
1413
1404 def edit_syntax_error(self):
1414 def edit_syntax_error(self):
1405 """The bottom half of the syntax error handler called in the main loop.
1415 """The bottom half of the syntax error handler called in the main loop.
1406
1416
1407 Loop until syntax error is fixed or user cancels.
1417 Loop until syntax error is fixed or user cancels.
1408 """
1418 """
1409
1419
1410 while self.SyntaxTB.last_syntax_error:
1420 while self.SyntaxTB.last_syntax_error:
1411 # copy and clear last_syntax_error
1421 # copy and clear last_syntax_error
1412 err = self.SyntaxTB.clear_err_state()
1422 err = self.SyntaxTB.clear_err_state()
1413 if not self._should_recompile(err):
1423 if not self._should_recompile(err):
1414 return
1424 return
1415 try:
1425 try:
1416 # may set last_syntax_error again if a SyntaxError is raised
1426 # may set last_syntax_error again if a SyntaxError is raised
1417 self.safe_execfile(err.filename,self.user_ns)
1427 self.safe_execfile(err.filename,self.user_ns)
1418 except:
1428 except:
1419 self.showtraceback()
1429 self.showtraceback()
1420 else:
1430 else:
1421 try:
1431 try:
1422 f = file(err.filename)
1432 f = file(err.filename)
1423 try:
1433 try:
1424 sys.displayhook(f.read())
1434 sys.displayhook(f.read())
1425 finally:
1435 finally:
1426 f.close()
1436 f.close()
1427 except:
1437 except:
1428 self.showtraceback()
1438 self.showtraceback()
1429
1439
1430 def showsyntaxerror(self, filename=None):
1440 def showsyntaxerror(self, filename=None):
1431 """Display the syntax error that just occurred.
1441 """Display the syntax error that just occurred.
1432
1442
1433 This doesn't display a stack trace because there isn't one.
1443 This doesn't display a stack trace because there isn't one.
1434
1444
1435 If a filename is given, it is stuffed in the exception instead
1445 If a filename is given, it is stuffed in the exception instead
1436 of what was there before (because Python's parser always uses
1446 of what was there before (because Python's parser always uses
1437 "<string>" when reading from a string).
1447 "<string>" when reading from a string).
1438 """
1448 """
1439 etype, value, last_traceback = sys.exc_info()
1449 etype, value, last_traceback = sys.exc_info()
1440
1450
1441 # See note about these variables in showtraceback() below
1451 # See note about these variables in showtraceback() below
1442 sys.last_type = etype
1452 sys.last_type = etype
1443 sys.last_value = value
1453 sys.last_value = value
1444 sys.last_traceback = last_traceback
1454 sys.last_traceback = last_traceback
1445
1455
1446 if filename and etype is SyntaxError:
1456 if filename and etype is SyntaxError:
1447 # Work hard to stuff the correct filename in the exception
1457 # Work hard to stuff the correct filename in the exception
1448 try:
1458 try:
1449 msg, (dummy_filename, lineno, offset, line) = value
1459 msg, (dummy_filename, lineno, offset, line) = value
1450 except:
1460 except:
1451 # Not the format we expect; leave it alone
1461 # Not the format we expect; leave it alone
1452 pass
1462 pass
1453 else:
1463 else:
1454 # Stuff in the right filename
1464 # Stuff in the right filename
1455 try:
1465 try:
1456 # Assume SyntaxError is a class exception
1466 # Assume SyntaxError is a class exception
1457 value = SyntaxError(msg, (filename, lineno, offset, line))
1467 value = SyntaxError(msg, (filename, lineno, offset, line))
1458 except:
1468 except:
1459 # If that failed, assume SyntaxError is a string
1469 # If that failed, assume SyntaxError is a string
1460 value = msg, (filename, lineno, offset, line)
1470 value = msg, (filename, lineno, offset, line)
1461 self.SyntaxTB(etype,value,[])
1471 self.SyntaxTB(etype,value,[])
1462
1472
1463 def debugger(self,force=False):
1473 def debugger(self,force=False):
1464 """Call the pydb/pdb debugger.
1474 """Call the pydb/pdb debugger.
1465
1475
1466 Keywords:
1476 Keywords:
1467
1477
1468 - force(False): by default, this routine checks the instance call_pdb
1478 - force(False): by default, this routine checks the instance call_pdb
1469 flag and does not actually invoke the debugger if the flag is false.
1479 flag and does not actually invoke the debugger if the flag is false.
1470 The 'force' option forces the debugger to activate even if the flag
1480 The 'force' option forces the debugger to activate even if the flag
1471 is false.
1481 is false.
1472 """
1482 """
1473
1483
1474 if not (force or self.call_pdb):
1484 if not (force or self.call_pdb):
1475 return
1485 return
1476
1486
1477 if not hasattr(sys,'last_traceback'):
1487 if not hasattr(sys,'last_traceback'):
1478 error('No traceback has been produced, nothing to debug.')
1488 error('No traceback has been produced, nothing to debug.')
1479 return
1489 return
1480
1490
1481 # use pydb if available
1491 # use pydb if available
1482 if Debugger.has_pydb:
1492 if Debugger.has_pydb:
1483 from pydb import pm
1493 from pydb import pm
1484 else:
1494 else:
1485 # fallback to our internal debugger
1495 # fallback to our internal debugger
1486 pm = lambda : self.InteractiveTB.debugger(force=True)
1496 pm = lambda : self.InteractiveTB.debugger(force=True)
1487 self.history_saving_wrapper(pm)()
1497 self.history_saving_wrapper(pm)()
1488
1498
1489 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1499 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1490 """Display the exception that just occurred.
1500 """Display the exception that just occurred.
1491
1501
1492 If nothing is known about the exception, this is the method which
1502 If nothing is known about the exception, this is the method which
1493 should be used throughout the code for presenting user tracebacks,
1503 should be used throughout the code for presenting user tracebacks,
1494 rather than directly invoking the InteractiveTB object.
1504 rather than directly invoking the InteractiveTB object.
1495
1505
1496 A specific showsyntaxerror() also exists, but this method can take
1506 A specific showsyntaxerror() also exists, but this method can take
1497 care of calling it if needed, so unless you are explicitly catching a
1507 care of calling it if needed, so unless you are explicitly catching a
1498 SyntaxError exception, don't try to analyze the stack manually and
1508 SyntaxError exception, don't try to analyze the stack manually and
1499 simply call this method."""
1509 simply call this method."""
1500
1510
1501
1511
1502 # Though this won't be called by syntax errors in the input line,
1512 # Though this won't be called by syntax errors in the input line,
1503 # there may be SyntaxError cases whith imported code.
1513 # there may be SyntaxError cases whith imported code.
1504
1514
1505
1515
1506 if exc_tuple is None:
1516 if exc_tuple is None:
1507 etype, value, tb = sys.exc_info()
1517 etype, value, tb = sys.exc_info()
1508 else:
1518 else:
1509 etype, value, tb = exc_tuple
1519 etype, value, tb = exc_tuple
1510
1520
1511 if etype is SyntaxError:
1521 if etype is SyntaxError:
1512 self.showsyntaxerror(filename)
1522 self.showsyntaxerror(filename)
1513 elif etype is IPython.ipapi.UsageError:
1523 elif etype is IPython.ipapi.UsageError:
1514 print "UsageError:", value
1524 print "UsageError:", value
1515 else:
1525 else:
1516 # WARNING: these variables are somewhat deprecated and not
1526 # WARNING: these variables are somewhat deprecated and not
1517 # necessarily safe to use in a threaded environment, but tools
1527 # necessarily safe to use in a threaded environment, but tools
1518 # like pdb depend on their existence, so let's set them. If we
1528 # like pdb depend on their existence, so let's set them. If we
1519 # find problems in the field, we'll need to revisit their use.
1529 # find problems in the field, we'll need to revisit their use.
1520 sys.last_type = etype
1530 sys.last_type = etype
1521 sys.last_value = value
1531 sys.last_value = value
1522 sys.last_traceback = tb
1532 sys.last_traceback = tb
1523
1533
1524 if etype in self.custom_exceptions:
1534 if etype in self.custom_exceptions:
1525 self.CustomTB(etype,value,tb)
1535 self.CustomTB(etype,value,tb)
1526 else:
1536 else:
1527 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1537 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1528 if self.InteractiveTB.call_pdb and self.has_readline:
1538 if self.InteractiveTB.call_pdb and self.has_readline:
1529 # pdb mucks up readline, fix it back
1539 # pdb mucks up readline, fix it back
1530 self.set_completer()
1540 self.set_completer()
1531
1541
1532
1542
1533 def mainloop(self,banner=None):
1543 def mainloop(self,banner=None):
1534 """Creates the local namespace and starts the mainloop.
1544 """Creates the local namespace and starts the mainloop.
1535
1545
1536 If an optional banner argument is given, it will override the
1546 If an optional banner argument is given, it will override the
1537 internally created default banner."""
1547 internally created default banner."""
1538
1548
1539 if self.rc.c: # Emulate Python's -c option
1549 if self.rc.c: # Emulate Python's -c option
1540 self.exec_init_cmd()
1550 self.exec_init_cmd()
1541 if banner is None:
1551 if banner is None:
1542 if not self.rc.banner:
1552 if not self.rc.banner:
1543 banner = ''
1553 banner = ''
1544 # banner is string? Use it directly!
1554 # banner is string? Use it directly!
1545 elif isinstance(self.rc.banner,basestring):
1555 elif isinstance(self.rc.banner,basestring):
1546 banner = self.rc.banner
1556 banner = self.rc.banner
1547 else:
1557 else:
1548 banner = self.BANNER+self.banner2
1558 banner = self.BANNER+self.banner2
1549
1559
1550 self.interact(banner)
1560 self.interact(banner)
1551
1561
1552 def exec_init_cmd(self):
1562 def exec_init_cmd(self):
1553 """Execute a command given at the command line.
1563 """Execute a command given at the command line.
1554
1564
1555 This emulates Python's -c option."""
1565 This emulates Python's -c option."""
1556
1566
1557 #sys.argv = ['-c']
1567 #sys.argv = ['-c']
1558 self.push(self.prefilter(self.rc.c, False))
1568 self.push(self.prefilter(self.rc.c, False))
1559 if not self.rc.interact:
1569 if not self.rc.interact:
1560 self.exit_now = True
1570 self.exit_now = True
1561
1571
1562 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1572 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1563 """Embeds IPython into a running python program.
1573 """Embeds IPython into a running python program.
1564
1574
1565 Input:
1575 Input:
1566
1576
1567 - header: An optional header message can be specified.
1577 - header: An optional header message can be specified.
1568
1578
1569 - local_ns, global_ns: working namespaces. If given as None, the
1579 - local_ns, global_ns: working namespaces. If given as None, the
1570 IPython-initialized one is updated with __main__.__dict__, so that
1580 IPython-initialized one is updated with __main__.__dict__, so that
1571 program variables become visible but user-specific configuration
1581 program variables become visible but user-specific configuration
1572 remains possible.
1582 remains possible.
1573
1583
1574 - stack_depth: specifies how many levels in the stack to go to
1584 - stack_depth: specifies how many levels in the stack to go to
1575 looking for namespaces (when local_ns and global_ns are None). This
1585 looking for namespaces (when local_ns and global_ns are None). This
1576 allows an intermediate caller to make sure that this function gets
1586 allows an intermediate caller to make sure that this function gets
1577 the namespace from the intended level in the stack. By default (0)
1587 the namespace from the intended level in the stack. By default (0)
1578 it will get its locals and globals from the immediate caller.
1588 it will get its locals and globals from the immediate caller.
1579
1589
1580 Warning: it's possible to use this in a program which is being run by
1590 Warning: it's possible to use this in a program which is being run by
1581 IPython itself (via %run), but some funny things will happen (a few
1591 IPython itself (via %run), but some funny things will happen (a few
1582 globals get overwritten). In the future this will be cleaned up, as
1592 globals get overwritten). In the future this will be cleaned up, as
1583 there is no fundamental reason why it can't work perfectly."""
1593 there is no fundamental reason why it can't work perfectly."""
1584
1594
1585 # Get locals and globals from caller
1595 # Get locals and globals from caller
1586 if local_ns is None or global_ns is None:
1596 if local_ns is None or global_ns is None:
1587 call_frame = sys._getframe(stack_depth).f_back
1597 call_frame = sys._getframe(stack_depth).f_back
1588
1598
1589 if local_ns is None:
1599 if local_ns is None:
1590 local_ns = call_frame.f_locals
1600 local_ns = call_frame.f_locals
1591 if global_ns is None:
1601 if global_ns is None:
1592 global_ns = call_frame.f_globals
1602 global_ns = call_frame.f_globals
1593
1603
1594 # Update namespaces and fire up interpreter
1604 # Update namespaces and fire up interpreter
1595
1605
1596 # The global one is easy, we can just throw it in
1606 # The global one is easy, we can just throw it in
1597 self.user_global_ns = global_ns
1607 self.user_global_ns = global_ns
1598
1608
1599 # but the user/local one is tricky: ipython needs it to store internal
1609 # but the user/local one is tricky: ipython needs it to store internal
1600 # data, but we also need the locals. We'll copy locals in the user
1610 # data, but we also need the locals. We'll copy locals in the user
1601 # one, but will track what got copied so we can delete them at exit.
1611 # one, but will track what got copied so we can delete them at exit.
1602 # This is so that a later embedded call doesn't see locals from a
1612 # This is so that a later embedded call doesn't see locals from a
1603 # previous call (which most likely existed in a separate scope).
1613 # previous call (which most likely existed in a separate scope).
1604 local_varnames = local_ns.keys()
1614 local_varnames = local_ns.keys()
1605 self.user_ns.update(local_ns)
1615 self.user_ns.update(local_ns)
1606
1616
1607 # Patch for global embedding to make sure that things don't overwrite
1617 # Patch for global embedding to make sure that things don't overwrite
1608 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1618 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1609 # FIXME. Test this a bit more carefully (the if.. is new)
1619 # FIXME. Test this a bit more carefully (the if.. is new)
1610 if local_ns is None and global_ns is None:
1620 if local_ns is None and global_ns is None:
1611 self.user_global_ns.update(__main__.__dict__)
1621 self.user_global_ns.update(__main__.__dict__)
1612
1622
1613 # make sure the tab-completer has the correct frame information, so it
1623 # make sure the tab-completer has the correct frame information, so it
1614 # actually completes using the frame's locals/globals
1624 # actually completes using the frame's locals/globals
1615 self.set_completer_frame()
1625 self.set_completer_frame()
1616
1626
1617 # before activating the interactive mode, we need to make sure that
1627 # before activating the interactive mode, we need to make sure that
1618 # all names in the builtin namespace needed by ipython point to
1628 # all names in the builtin namespace needed by ipython point to
1619 # ourselves, and not to other instances.
1629 # ourselves, and not to other instances.
1620 self.add_builtins()
1630 self.add_builtins()
1621
1631
1622 self.interact(header)
1632 self.interact(header)
1623
1633
1624 # now, purge out the user namespace from anything we might have added
1634 # now, purge out the user namespace from anything we might have added
1625 # from the caller's local namespace
1635 # from the caller's local namespace
1626 delvar = self.user_ns.pop
1636 delvar = self.user_ns.pop
1627 for var in local_varnames:
1637 for var in local_varnames:
1628 delvar(var,None)
1638 delvar(var,None)
1629 # and clean builtins we may have overridden
1639 # and clean builtins we may have overridden
1630 self.clean_builtins()
1640 self.clean_builtins()
1631
1641
1632 def interact(self, banner=None):
1642 def interact(self, banner=None):
1633 """Closely emulate the interactive Python console.
1643 """Closely emulate the interactive Python console.
1634
1644
1635 The optional banner argument specify the banner to print
1645 The optional banner argument specify the banner to print
1636 before the first interaction; by default it prints a banner
1646 before the first interaction; by default it prints a banner
1637 similar to the one printed by the real Python interpreter,
1647 similar to the one printed by the real Python interpreter,
1638 followed by the current class name in parentheses (so as not
1648 followed by the current class name in parentheses (so as not
1639 to confuse this with the real interpreter -- since it's so
1649 to confuse this with the real interpreter -- since it's so
1640 close!).
1650 close!).
1641
1651
1642 """
1652 """
1643
1653
1644 if self.exit_now:
1654 if self.exit_now:
1645 # batch run -> do not interact
1655 # batch run -> do not interact
1646 return
1656 return
1647 cprt = 'Type "copyright", "credits" or "license" for more information.'
1657 cprt = 'Type "copyright", "credits" or "license" for more information.'
1648 if banner is None:
1658 if banner is None:
1649 self.write("Python %s on %s\n%s\n(%s)\n" %
1659 self.write("Python %s on %s\n%s\n(%s)\n" %
1650 (sys.version, sys.platform, cprt,
1660 (sys.version, sys.platform, cprt,
1651 self.__class__.__name__))
1661 self.__class__.__name__))
1652 else:
1662 else:
1653 self.write(banner)
1663 self.write(banner)
1654
1664
1655 more = 0
1665 more = 0
1656
1666
1657 # Mark activity in the builtins
1667 # Mark activity in the builtins
1658 __builtin__.__dict__['__IPYTHON__active'] += 1
1668 __builtin__.__dict__['__IPYTHON__active'] += 1
1659
1669
1660 if self.has_readline:
1670 if self.has_readline:
1661 self.readline_startup_hook(self.pre_readline)
1671 self.readline_startup_hook(self.pre_readline)
1662 # exit_now is set by a call to %Exit or %Quit
1672 # exit_now is set by a call to %Exit or %Quit
1663
1673
1664 while not self.exit_now:
1674 while not self.exit_now:
1665 if more:
1675 if more:
1666 prompt = self.hooks.generate_prompt(True)
1676 prompt = self.hooks.generate_prompt(True)
1667 if self.autoindent:
1677 if self.autoindent:
1668 self.rl_do_indent = True
1678 self.rl_do_indent = True
1669
1679
1670 else:
1680 else:
1671 prompt = self.hooks.generate_prompt(False)
1681 prompt = self.hooks.generate_prompt(False)
1672 try:
1682 try:
1673 line = self.raw_input(prompt,more)
1683 line = self.raw_input(prompt,more)
1674 if self.exit_now:
1684 if self.exit_now:
1675 # quick exit on sys.std[in|out] close
1685 # quick exit on sys.std[in|out] close
1676 break
1686 break
1677 if self.autoindent:
1687 if self.autoindent:
1678 self.rl_do_indent = False
1688 self.rl_do_indent = False
1679
1689
1680 except KeyboardInterrupt:
1690 except KeyboardInterrupt:
1681 self.write('\nKeyboardInterrupt\n')
1691 self.write('\nKeyboardInterrupt\n')
1682 self.resetbuffer()
1692 self.resetbuffer()
1683 # keep cache in sync with the prompt counter:
1693 # keep cache in sync with the prompt counter:
1684 self.outputcache.prompt_count -= 1
1694 self.outputcache.prompt_count -= 1
1685
1695
1686 if self.autoindent:
1696 if self.autoindent:
1687 self.indent_current_nsp = 0
1697 self.indent_current_nsp = 0
1688 more = 0
1698 more = 0
1689 except EOFError:
1699 except EOFError:
1690 if self.autoindent:
1700 if self.autoindent:
1691 self.rl_do_indent = False
1701 self.rl_do_indent = False
1692 self.readline_startup_hook(None)
1702 self.readline_startup_hook(None)
1693 self.write('\n')
1703 self.write('\n')
1694 self.exit()
1704 self.exit()
1695 except bdb.BdbQuit:
1705 except bdb.BdbQuit:
1696 warn('The Python debugger has exited with a BdbQuit exception.\n'
1706 warn('The Python debugger has exited with a BdbQuit exception.\n'
1697 'Because of how pdb handles the stack, it is impossible\n'
1707 'Because of how pdb handles the stack, it is impossible\n'
1698 'for IPython to properly format this particular exception.\n'
1708 'for IPython to properly format this particular exception.\n'
1699 'IPython will resume normal operation.')
1709 'IPython will resume normal operation.')
1700 except:
1710 except:
1701 # exceptions here are VERY RARE, but they can be triggered
1711 # exceptions here are VERY RARE, but they can be triggered
1702 # asynchronously by signal handlers, for example.
1712 # asynchronously by signal handlers, for example.
1703 self.showtraceback()
1713 self.showtraceback()
1704 else:
1714 else:
1705 more = self.push(line)
1715 more = self.push(line)
1706 if (self.SyntaxTB.last_syntax_error and
1716 if (self.SyntaxTB.last_syntax_error and
1707 self.rc.autoedit_syntax):
1717 self.rc.autoedit_syntax):
1708 self.edit_syntax_error()
1718 self.edit_syntax_error()
1709
1719
1710 # We are off again...
1720 # We are off again...
1711 __builtin__.__dict__['__IPYTHON__active'] -= 1
1721 __builtin__.__dict__['__IPYTHON__active'] -= 1
1712
1722
1713 def excepthook(self, etype, value, tb):
1723 def excepthook(self, etype, value, tb):
1714 """One more defense for GUI apps that call sys.excepthook.
1724 """One more defense for GUI apps that call sys.excepthook.
1715
1725
1716 GUI frameworks like wxPython trap exceptions and call
1726 GUI frameworks like wxPython trap exceptions and call
1717 sys.excepthook themselves. I guess this is a feature that
1727 sys.excepthook themselves. I guess this is a feature that
1718 enables them to keep running after exceptions that would
1728 enables them to keep running after exceptions that would
1719 otherwise kill their mainloop. This is a bother for IPython
1729 otherwise kill their mainloop. This is a bother for IPython
1720 which excepts to catch all of the program exceptions with a try:
1730 which excepts to catch all of the program exceptions with a try:
1721 except: statement.
1731 except: statement.
1722
1732
1723 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1733 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1724 any app directly invokes sys.excepthook, it will look to the user like
1734 any app directly invokes sys.excepthook, it will look to the user like
1725 IPython crashed. In order to work around this, we can disable the
1735 IPython crashed. In order to work around this, we can disable the
1726 CrashHandler and replace it with this excepthook instead, which prints a
1736 CrashHandler and replace it with this excepthook instead, which prints a
1727 regular traceback using our InteractiveTB. In this fashion, apps which
1737 regular traceback using our InteractiveTB. In this fashion, apps which
1728 call sys.excepthook will generate a regular-looking exception from
1738 call sys.excepthook will generate a regular-looking exception from
1729 IPython, and the CrashHandler will only be triggered by real IPython
1739 IPython, and the CrashHandler will only be triggered by real IPython
1730 crashes.
1740 crashes.
1731
1741
1732 This hook should be used sparingly, only in places which are not likely
1742 This hook should be used sparingly, only in places which are not likely
1733 to be true IPython errors.
1743 to be true IPython errors.
1734 """
1744 """
1735 self.showtraceback((etype,value,tb),tb_offset=0)
1745 self.showtraceback((etype,value,tb),tb_offset=0)
1736
1746
1737 def expand_aliases(self,fn,rest):
1747 def expand_aliases(self,fn,rest):
1738 """ Expand multiple levels of aliases:
1748 """ Expand multiple levels of aliases:
1739
1749
1740 if:
1750 if:
1741
1751
1742 alias foo bar /tmp
1752 alias foo bar /tmp
1743 alias baz foo
1753 alias baz foo
1744
1754
1745 then:
1755 then:
1746
1756
1747 baz huhhahhei -> bar /tmp huhhahhei
1757 baz huhhahhei -> bar /tmp huhhahhei
1748
1758
1749 """
1759 """
1750 line = fn + " " + rest
1760 line = fn + " " + rest
1751
1761
1752 done = Set()
1762 done = Set()
1753 while 1:
1763 while 1:
1754 pre,fn,rest = prefilter.splitUserInput(line,
1764 pre,fn,rest = prefilter.splitUserInput(line,
1755 prefilter.shell_line_split)
1765 prefilter.shell_line_split)
1756 if fn in self.alias_table:
1766 if fn in self.alias_table:
1757 if fn in done:
1767 if fn in done:
1758 warn("Cyclic alias definition, repeated '%s'" % fn)
1768 warn("Cyclic alias definition, repeated '%s'" % fn)
1759 return ""
1769 return ""
1760 done.add(fn)
1770 done.add(fn)
1761
1771
1762 l2 = self.transform_alias(fn,rest)
1772 l2 = self.transform_alias(fn,rest)
1763 # dir -> dir
1773 # dir -> dir
1764 # print "alias",line, "->",l2 #dbg
1774 # print "alias",line, "->",l2 #dbg
1765 if l2 == line:
1775 if l2 == line:
1766 break
1776 break
1767 # ls -> ls -F should not recurse forever
1777 # ls -> ls -F should not recurse forever
1768 if l2.split(None,1)[0] == line.split(None,1)[0]:
1778 if l2.split(None,1)[0] == line.split(None,1)[0]:
1769 line = l2
1779 line = l2
1770 break
1780 break
1771
1781
1772 line=l2
1782 line=l2
1773
1783
1774
1784
1775 # print "al expand to",line #dbg
1785 # print "al expand to",line #dbg
1776 else:
1786 else:
1777 break
1787 break
1778
1788
1779 return line
1789 return line
1780
1790
1781 def transform_alias(self, alias,rest=''):
1791 def transform_alias(self, alias,rest=''):
1782 """ Transform alias to system command string.
1792 """ Transform alias to system command string.
1783 """
1793 """
1784 trg = self.alias_table[alias]
1794 trg = self.alias_table[alias]
1785
1795
1786 nargs,cmd = trg
1796 nargs,cmd = trg
1787 # print trg #dbg
1797 # print trg #dbg
1788 if ' ' in cmd and os.path.isfile(cmd):
1798 if ' ' in cmd and os.path.isfile(cmd):
1789 cmd = '"%s"' % cmd
1799 cmd = '"%s"' % cmd
1790
1800
1791 # Expand the %l special to be the user's input line
1801 # Expand the %l special to be the user's input line
1792 if cmd.find('%l') >= 0:
1802 if cmd.find('%l') >= 0:
1793 cmd = cmd.replace('%l',rest)
1803 cmd = cmd.replace('%l',rest)
1794 rest = ''
1804 rest = ''
1795 if nargs==0:
1805 if nargs==0:
1796 # Simple, argument-less aliases
1806 # Simple, argument-less aliases
1797 cmd = '%s %s' % (cmd,rest)
1807 cmd = '%s %s' % (cmd,rest)
1798 else:
1808 else:
1799 # Handle aliases with positional arguments
1809 # Handle aliases with positional arguments
1800 args = rest.split(None,nargs)
1810 args = rest.split(None,nargs)
1801 if len(args)< nargs:
1811 if len(args)< nargs:
1802 error('Alias <%s> requires %s arguments, %s given.' %
1812 error('Alias <%s> requires %s arguments, %s given.' %
1803 (alias,nargs,len(args)))
1813 (alias,nargs,len(args)))
1804 return None
1814 return None
1805 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1815 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1806 # Now call the macro, evaluating in the user's namespace
1816 # Now call the macro, evaluating in the user's namespace
1807 #print 'new command: <%r>' % cmd # dbg
1817 #print 'new command: <%r>' % cmd # dbg
1808 return cmd
1818 return cmd
1809
1819
1810 def call_alias(self,alias,rest=''):
1820 def call_alias(self,alias,rest=''):
1811 """Call an alias given its name and the rest of the line.
1821 """Call an alias given its name and the rest of the line.
1812
1822
1813 This is only used to provide backwards compatibility for users of
1823 This is only used to provide backwards compatibility for users of
1814 ipalias(), use of which is not recommended for anymore."""
1824 ipalias(), use of which is not recommended for anymore."""
1815
1825
1816 # Now call the macro, evaluating in the user's namespace
1826 # Now call the macro, evaluating in the user's namespace
1817 cmd = self.transform_alias(alias, rest)
1827 cmd = self.transform_alias(alias, rest)
1818 try:
1828 try:
1819 self.system(cmd)
1829 self.system(cmd)
1820 except:
1830 except:
1821 self.showtraceback()
1831 self.showtraceback()
1822
1832
1823 def indent_current_str(self):
1833 def indent_current_str(self):
1824 """return the current level of indentation as a string"""
1834 """return the current level of indentation as a string"""
1825 return self.indent_current_nsp * ' '
1835 return self.indent_current_nsp * ' '
1826
1836
1827 def autoindent_update(self,line):
1837 def autoindent_update(self,line):
1828 """Keep track of the indent level."""
1838 """Keep track of the indent level."""
1829
1839
1830 #debugx('line')
1840 #debugx('line')
1831 #debugx('self.indent_current_nsp')
1841 #debugx('self.indent_current_nsp')
1832 if self.autoindent:
1842 if self.autoindent:
1833 if line:
1843 if line:
1834 inisp = num_ini_spaces(line)
1844 inisp = num_ini_spaces(line)
1835 if inisp < self.indent_current_nsp:
1845 if inisp < self.indent_current_nsp:
1836 self.indent_current_nsp = inisp
1846 self.indent_current_nsp = inisp
1837
1847
1838 if line[-1] == ':':
1848 if line[-1] == ':':
1839 self.indent_current_nsp += 4
1849 self.indent_current_nsp += 4
1840 elif dedent_re.match(line):
1850 elif dedent_re.match(line):
1841 self.indent_current_nsp -= 4
1851 self.indent_current_nsp -= 4
1842 else:
1852 else:
1843 self.indent_current_nsp = 0
1853 self.indent_current_nsp = 0
1844
1854
1845 def runlines(self,lines):
1855 def runlines(self,lines):
1846 """Run a string of one or more lines of source.
1856 """Run a string of one or more lines of source.
1847
1857
1848 This method is capable of running a string containing multiple source
1858 This method is capable of running a string containing multiple source
1849 lines, as if they had been entered at the IPython prompt. Since it
1859 lines, as if they had been entered at the IPython prompt. Since it
1850 exposes IPython's processing machinery, the given strings can contain
1860 exposes IPython's processing machinery, the given strings can contain
1851 magic calls (%magic), special shell access (!cmd), etc."""
1861 magic calls (%magic), special shell access (!cmd), etc."""
1852
1862
1853 # We must start with a clean buffer, in case this is run from an
1863 # We must start with a clean buffer, in case this is run from an
1854 # interactive IPython session (via a magic, for example).
1864 # interactive IPython session (via a magic, for example).
1855 self.resetbuffer()
1865 self.resetbuffer()
1856 lines = lines.split('\n')
1866 lines = lines.split('\n')
1857 more = 0
1867 more = 0
1858
1868
1859 for line in lines:
1869 for line in lines:
1860 # skip blank lines so we don't mess up the prompt counter, but do
1870 # skip blank lines so we don't mess up the prompt counter, but do
1861 # NOT skip even a blank line if we are in a code block (more is
1871 # NOT skip even a blank line if we are in a code block (more is
1862 # true)
1872 # true)
1863
1873
1864
1874
1865 if line or more:
1875 if line or more:
1866 # push to raw history, so hist line numbers stay in sync
1876 # push to raw history, so hist line numbers stay in sync
1867 self.input_hist_raw.append("# " + line + "\n")
1877 self.input_hist_raw.append("# " + line + "\n")
1868 more = self.push(self.prefilter(line,more))
1878 more = self.push(self.prefilter(line,more))
1869 # IPython's runsource returns None if there was an error
1879 # IPython's runsource returns None if there was an error
1870 # compiling the code. This allows us to stop processing right
1880 # compiling the code. This allows us to stop processing right
1871 # away, so the user gets the error message at the right place.
1881 # away, so the user gets the error message at the right place.
1872 if more is None:
1882 if more is None:
1873 break
1883 break
1874 else:
1884 else:
1875 self.input_hist_raw.append("\n")
1885 self.input_hist_raw.append("\n")
1876 # final newline in case the input didn't have it, so that the code
1886 # final newline in case the input didn't have it, so that the code
1877 # actually does get executed
1887 # actually does get executed
1878 if more:
1888 if more:
1879 self.push('\n')
1889 self.push('\n')
1880
1890
1881 def runsource(self, source, filename='<input>', symbol='single'):
1891 def runsource(self, source, filename='<input>', symbol='single'):
1882 """Compile and run some source in the interpreter.
1892 """Compile and run some source in the interpreter.
1883
1893
1884 Arguments are as for compile_command().
1894 Arguments are as for compile_command().
1885
1895
1886 One several things can happen:
1896 One several things can happen:
1887
1897
1888 1) The input is incorrect; compile_command() raised an
1898 1) The input is incorrect; compile_command() raised an
1889 exception (SyntaxError or OverflowError). A syntax traceback
1899 exception (SyntaxError or OverflowError). A syntax traceback
1890 will be printed by calling the showsyntaxerror() method.
1900 will be printed by calling the showsyntaxerror() method.
1891
1901
1892 2) The input is incomplete, and more input is required;
1902 2) The input is incomplete, and more input is required;
1893 compile_command() returned None. Nothing happens.
1903 compile_command() returned None. Nothing happens.
1894
1904
1895 3) The input is complete; compile_command() returned a code
1905 3) The input is complete; compile_command() returned a code
1896 object. The code is executed by calling self.runcode() (which
1906 object. The code is executed by calling self.runcode() (which
1897 also handles run-time exceptions, except for SystemExit).
1907 also handles run-time exceptions, except for SystemExit).
1898
1908
1899 The return value is:
1909 The return value is:
1900
1910
1901 - True in case 2
1911 - True in case 2
1902
1912
1903 - False in the other cases, unless an exception is raised, where
1913 - False in the other cases, unless an exception is raised, where
1904 None is returned instead. This can be used by external callers to
1914 None is returned instead. This can be used by external callers to
1905 know whether to continue feeding input or not.
1915 know whether to continue feeding input or not.
1906
1916
1907 The return value can be used to decide whether to use sys.ps1 or
1917 The return value can be used to decide whether to use sys.ps1 or
1908 sys.ps2 to prompt the next line."""
1918 sys.ps2 to prompt the next line."""
1909
1919
1910 # if the source code has leading blanks, add 'if 1:\n' to it
1920 # if the source code has leading blanks, add 'if 1:\n' to it
1911 # this allows execution of indented pasted code. It is tempting
1921 # this allows execution of indented pasted code. It is tempting
1912 # to add '\n' at the end of source to run commands like ' a=1'
1922 # to add '\n' at the end of source to run commands like ' a=1'
1913 # directly, but this fails for more complicated scenarios
1923 # directly, but this fails for more complicated scenarios
1914 source=source.encode(self.stdin_encoding)
1924 source = str(source)
1915 if source[:1] in [' ', '\t']:
1925 if source[:1] in [' ', '\t']:
1916 source = 'if 1:\n%s' % source
1926 source = 'if 1:\n%s' % source
1917
1927
1918 try:
1928 try:
1919 code = self.compile(source,filename,symbol)
1929 code = self.compile(source,filename,symbol)
1920 except (OverflowError, SyntaxError, ValueError):
1930 except (OverflowError, SyntaxError, ValueError):
1921 # Case 1
1931 # Case 1
1922 self.showsyntaxerror(filename)
1932 self.showsyntaxerror(filename)
1923 return None
1933 return None
1924
1934
1925 if code is None:
1935 if code is None:
1926 # Case 2
1936 # Case 2
1927 return True
1937 return True
1928
1938
1929 # Case 3
1939 # Case 3
1930 # We store the code object so that threaded shells and
1940 # We store the code object so that threaded shells and
1931 # custom exception handlers can access all this info if needed.
1941 # custom exception handlers can access all this info if needed.
1932 # The source corresponding to this can be obtained from the
1942 # The source corresponding to this can be obtained from the
1933 # buffer attribute as '\n'.join(self.buffer).
1943 # buffer attribute as '\n'.join(self.buffer).
1934 self.code_to_run = code
1944 self.code_to_run = code
1935 # now actually execute the code object
1945 # now actually execute the code object
1936 if self.runcode(code) == 0:
1946 if self.runcode(code) == 0:
1937 return False
1947 return False
1938 else:
1948 else:
1939 return None
1949 return None
1940
1950
1941 def runcode(self,code_obj):
1951 def runcode(self,code_obj):
1942 """Execute a code object.
1952 """Execute a code object.
1943
1953
1944 When an exception occurs, self.showtraceback() is called to display a
1954 When an exception occurs, self.showtraceback() is called to display a
1945 traceback.
1955 traceback.
1946
1956
1947 Return value: a flag indicating whether the code to be run completed
1957 Return value: a flag indicating whether the code to be run completed
1948 successfully:
1958 successfully:
1949
1959
1950 - 0: successful execution.
1960 - 0: successful execution.
1951 - 1: an error occurred.
1961 - 1: an error occurred.
1952 """
1962 """
1953
1963
1954 # Set our own excepthook in case the user code tries to call it
1964 # Set our own excepthook in case the user code tries to call it
1955 # directly, so that the IPython crash handler doesn't get triggered
1965 # directly, so that the IPython crash handler doesn't get triggered
1956 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1966 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1957
1967
1958 # we save the original sys.excepthook in the instance, in case config
1968 # we save the original sys.excepthook in the instance, in case config
1959 # code (such as magics) needs access to it.
1969 # code (such as magics) needs access to it.
1960 self.sys_excepthook = old_excepthook
1970 self.sys_excepthook = old_excepthook
1961 outflag = 1 # happens in more places, so it's easier as default
1971 outflag = 1 # happens in more places, so it's easier as default
1962 try:
1972 try:
1963 try:
1973 try:
1964 # Embedded instances require separate global/local namespaces
1974 # Embedded instances require separate global/local namespaces
1965 # so they can see both the surrounding (local) namespace and
1975 # so they can see both the surrounding (local) namespace and
1966 # the module-level globals when called inside another function.
1976 # the module-level globals when called inside another function.
1967 if self.embedded:
1977 if self.embedded:
1968 exec code_obj in self.user_global_ns, self.user_ns
1978 exec code_obj in self.user_global_ns, self.user_ns
1969 # Normal (non-embedded) instances should only have a single
1979 # Normal (non-embedded) instances should only have a single
1970 # namespace for user code execution, otherwise functions won't
1980 # namespace for user code execution, otherwise functions won't
1971 # see interactive top-level globals.
1981 # see interactive top-level globals.
1972 else:
1982 else:
1973 exec code_obj in self.user_ns
1983 exec code_obj in self.user_ns
1974 finally:
1984 finally:
1975 # Reset our crash handler in place
1985 # Reset our crash handler in place
1976 sys.excepthook = old_excepthook
1986 sys.excepthook = old_excepthook
1977 except SystemExit:
1987 except SystemExit:
1978 self.resetbuffer()
1988 self.resetbuffer()
1979 self.showtraceback()
1989 self.showtraceback()
1980 warn("Type %exit or %quit to exit IPython "
1990 warn("Type %exit or %quit to exit IPython "
1981 "(%Exit or %Quit do so unconditionally).",level=1)
1991 "(%Exit or %Quit do so unconditionally).",level=1)
1982 except self.custom_exceptions:
1992 except self.custom_exceptions:
1983 etype,value,tb = sys.exc_info()
1993 etype,value,tb = sys.exc_info()
1984 self.CustomTB(etype,value,tb)
1994 self.CustomTB(etype,value,tb)
1985 except:
1995 except:
1986 self.showtraceback()
1996 self.showtraceback()
1987 else:
1997 else:
1988 outflag = 0
1998 outflag = 0
1989 if softspace(sys.stdout, 0):
1999 if softspace(sys.stdout, 0):
1990 print
2000 print
1991 # Flush out code object which has been run (and source)
2001 # Flush out code object which has been run (and source)
1992 self.code_to_run = None
2002 self.code_to_run = None
1993 return outflag
2003 return outflag
1994
2004
1995 def push(self, line):
2005 def push(self, line):
1996 """Push a line to the interpreter.
2006 """Push a line to the interpreter.
1997
2007
1998 The line should not have a trailing newline; it may have
2008 The line should not have a trailing newline; it may have
1999 internal newlines. The line is appended to a buffer and the
2009 internal newlines. The line is appended to a buffer and the
2000 interpreter's runsource() method is called with the
2010 interpreter's runsource() method is called with the
2001 concatenated contents of the buffer as source. If this
2011 concatenated contents of the buffer as source. If this
2002 indicates that the command was executed or invalid, the buffer
2012 indicates that the command was executed or invalid, the buffer
2003 is reset; otherwise, the command is incomplete, and the buffer
2013 is reset; otherwise, the command is incomplete, and the buffer
2004 is left as it was after the line was appended. The return
2014 is left as it was after the line was appended. The return
2005 value is 1 if more input is required, 0 if the line was dealt
2015 value is 1 if more input is required, 0 if the line was dealt
2006 with in some way (this is the same as runsource()).
2016 with in some way (this is the same as runsource()).
2007 """
2017 """
2008
2018
2009 # autoindent management should be done here, and not in the
2019 # autoindent management should be done here, and not in the
2010 # interactive loop, since that one is only seen by keyboard input. We
2020 # interactive loop, since that one is only seen by keyboard input. We
2011 # need this done correctly even for code run via runlines (which uses
2021 # need this done correctly even for code run via runlines (which uses
2012 # push).
2022 # push).
2013
2023
2014 #print 'push line: <%s>' % line # dbg
2024 #print 'push line: <%s>' % line # dbg
2015 for subline in line.splitlines():
2025 for subline in line.splitlines():
2016 self.autoindent_update(subline)
2026 self.autoindent_update(subline)
2017 self.buffer.append(line)
2027 self.buffer.append(line)
2018 more = self.runsource('\n'.join(self.buffer), self.filename)
2028 more = self.runsource('\n'.join(self.buffer), self.filename)
2019 if not more:
2029 if not more:
2020 self.resetbuffer()
2030 self.resetbuffer()
2021 return more
2031 return more
2022
2032
2023 def split_user_input(self, line):
2033 def split_user_input(self, line):
2024 # This is really a hold-over to support ipapi and some extensions
2034 # This is really a hold-over to support ipapi and some extensions
2025 return prefilter.splitUserInput(line)
2035 return prefilter.splitUserInput(line)
2026
2036
2027 def resetbuffer(self):
2037 def resetbuffer(self):
2028 """Reset the input buffer."""
2038 """Reset the input buffer."""
2029 self.buffer[:] = []
2039 self.buffer[:] = []
2030
2040
2031 def raw_input(self,prompt='',continue_prompt=False):
2041 def raw_input(self,prompt='',continue_prompt=False):
2032 """Write a prompt and read a line.
2042 """Write a prompt and read a line.
2033
2043
2034 The returned line does not include the trailing newline.
2044 The returned line does not include the trailing newline.
2035 When the user enters the EOF key sequence, EOFError is raised.
2045 When the user enters the EOF key sequence, EOFError is raised.
2036
2046
2037 Optional inputs:
2047 Optional inputs:
2038
2048
2039 - prompt(''): a string to be printed to prompt the user.
2049 - prompt(''): a string to be printed to prompt the user.
2040
2050
2041 - continue_prompt(False): whether this line is the first one or a
2051 - continue_prompt(False): whether this line is the first one or a
2042 continuation in a sequence of inputs.
2052 continuation in a sequence of inputs.
2043 """
2053 """
2044
2054
2045 # Code run by the user may have modified the readline completer state.
2055 # Code run by the user may have modified the readline completer state.
2046 # We must ensure that our completer is back in place.
2056 # We must ensure that our completer is back in place.
2047 if self.has_readline:
2057 if self.has_readline:
2048 self.set_completer()
2058 self.set_completer()
2049
2059
2050 try:
2060 try:
2051 line = raw_input_original(prompt).decode(self.stdin_encoding)
2061 line = raw_input_original(prompt).decode(self.stdin_encoding)
2052 except ValueError:
2062 except ValueError:
2053 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2063 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2054 " or sys.stdout.close()!\nExiting IPython!")
2064 " or sys.stdout.close()!\nExiting IPython!")
2055 self.exit_now = True
2065 self.exit_now = True
2056 return ""
2066 return ""
2057
2067
2058 # Try to be reasonably smart about not re-indenting pasted input more
2068 # Try to be reasonably smart about not re-indenting pasted input more
2059 # than necessary. We do this by trimming out the auto-indent initial
2069 # than necessary. We do this by trimming out the auto-indent initial
2060 # spaces, if the user's actual input started itself with whitespace.
2070 # spaces, if the user's actual input started itself with whitespace.
2061 #debugx('self.buffer[-1]')
2071 #debugx('self.buffer[-1]')
2062
2072
2063 if self.autoindent:
2073 if self.autoindent:
2064 if num_ini_spaces(line) > self.indent_current_nsp:
2074 if num_ini_spaces(line) > self.indent_current_nsp:
2065 line = line[self.indent_current_nsp:]
2075 line = line[self.indent_current_nsp:]
2066 self.indent_current_nsp = 0
2076 self.indent_current_nsp = 0
2067
2077
2068 # store the unfiltered input before the user has any chance to modify
2078 # store the unfiltered input before the user has any chance to modify
2069 # it.
2079 # it.
2070 if line.strip():
2080 if line.strip():
2071 if continue_prompt:
2081 if continue_prompt:
2072 self.input_hist_raw[-1] += '%s\n' % line
2082 self.input_hist_raw[-1] += '%s\n' % line
2073 if self.has_readline: # and some config option is set?
2083 if self.has_readline: # and some config option is set?
2074 try:
2084 try:
2075 histlen = self.readline.get_current_history_length()
2085 histlen = self.readline.get_current_history_length()
2076 newhist = self.input_hist_raw[-1].rstrip()
2086 newhist = self.input_hist_raw[-1].rstrip()
2077 self.readline.remove_history_item(histlen-1)
2087 self.readline.remove_history_item(histlen-1)
2078 self.readline.replace_history_item(histlen-2,newhist)
2088 self.readline.replace_history_item(histlen-2,newhist)
2079 except AttributeError:
2089 except AttributeError:
2080 pass # re{move,place}_history_item are new in 2.4.
2090 pass # re{move,place}_history_item are new in 2.4.
2081 else:
2091 else:
2082 self.input_hist_raw.append('%s\n' % line)
2092 self.input_hist_raw.append('%s\n' % line)
2083 # only entries starting at first column go to shadow history
2093 # only entries starting at first column go to shadow history
2084 if line.lstrip() == line:
2094 if line.lstrip() == line:
2085 self.shadowhist.add(line.strip())
2095 self.shadowhist.add(line.strip())
2086 elif not continue_prompt:
2096 elif not continue_prompt:
2087 self.input_hist_raw.append('\n')
2097 self.input_hist_raw.append('\n')
2088 try:
2098 try:
2089 lineout = self.prefilter(line,continue_prompt)
2099 lineout = self.prefilter(line,continue_prompt)
2090 except:
2100 except:
2091 # blanket except, in case a user-defined prefilter crashes, so it
2101 # blanket except, in case a user-defined prefilter crashes, so it
2092 # can't take all of ipython with it.
2102 # can't take all of ipython with it.
2093 self.showtraceback()
2103 self.showtraceback()
2094 return ''
2104 return ''
2095 else:
2105 else:
2096 return lineout
2106 return lineout
2097
2107
2098 def _prefilter(self, line, continue_prompt):
2108 def _prefilter(self, line, continue_prompt):
2099 """Calls different preprocessors, depending on the form of line."""
2109 """Calls different preprocessors, depending on the form of line."""
2100
2110
2101 # All handlers *must* return a value, even if it's blank ('').
2111 # All handlers *must* return a value, even if it's blank ('').
2102
2112
2103 # Lines are NOT logged here. Handlers should process the line as
2113 # Lines are NOT logged here. Handlers should process the line as
2104 # needed, update the cache AND log it (so that the input cache array
2114 # needed, update the cache AND log it (so that the input cache array
2105 # stays synced).
2115 # stays synced).
2106
2116
2107 #.....................................................................
2117 #.....................................................................
2108 # Code begins
2118 # Code begins
2109
2119
2110 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2120 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2111
2121
2112 # save the line away in case we crash, so the post-mortem handler can
2122 # save the line away in case we crash, so the post-mortem handler can
2113 # record it
2123 # record it
2114 self._last_input_line = line
2124 self._last_input_line = line
2115
2125
2116 #print '***line: <%s>' % line # dbg
2126 #print '***line: <%s>' % line # dbg
2117
2127
2118 if not line:
2128 if not line:
2119 # Return immediately on purely empty lines, so that if the user
2129 # Return immediately on purely empty lines, so that if the user
2120 # previously typed some whitespace that started a continuation
2130 # previously typed some whitespace that started a continuation
2121 # prompt, he can break out of that loop with just an empty line.
2131 # prompt, he can break out of that loop with just an empty line.
2122 # This is how the default python prompt works.
2132 # This is how the default python prompt works.
2123
2133
2124 # Only return if the accumulated input buffer was just whitespace!
2134 # Only return if the accumulated input buffer was just whitespace!
2125 if ''.join(self.buffer).isspace():
2135 if ''.join(self.buffer).isspace():
2126 self.buffer[:] = []
2136 self.buffer[:] = []
2127 return ''
2137 return ''
2128
2138
2129 line_info = prefilter.LineInfo(line, continue_prompt)
2139 line_info = prefilter.LineInfo(line, continue_prompt)
2130
2140
2131 # the input history needs to track even empty lines
2141 # the input history needs to track even empty lines
2132 stripped = line.strip()
2142 stripped = line.strip()
2133
2143
2134 if not stripped:
2144 if not stripped:
2135 if not continue_prompt:
2145 if not continue_prompt:
2136 self.outputcache.prompt_count -= 1
2146 self.outputcache.prompt_count -= 1
2137 return self.handle_normal(line_info)
2147 return self.handle_normal(line_info)
2138
2148
2139 # print '***cont',continue_prompt # dbg
2149 # print '***cont',continue_prompt # dbg
2140 # special handlers are only allowed for single line statements
2150 # special handlers are only allowed for single line statements
2141 if continue_prompt and not self.rc.multi_line_specials:
2151 if continue_prompt and not self.rc.multi_line_specials:
2142 return self.handle_normal(line_info)
2152 return self.handle_normal(line_info)
2143
2153
2144
2154
2145 # See whether any pre-existing handler can take care of it
2155 # See whether any pre-existing handler can take care of it
2146 rewritten = self.hooks.input_prefilter(stripped)
2156 rewritten = self.hooks.input_prefilter(stripped)
2147 if rewritten != stripped: # ok, some prefilter did something
2157 if rewritten != stripped: # ok, some prefilter did something
2148 rewritten = line_info.pre + rewritten # add indentation
2158 rewritten = line_info.pre + rewritten # add indentation
2149 return self.handle_normal(prefilter.LineInfo(rewritten,
2159 return self.handle_normal(prefilter.LineInfo(rewritten,
2150 continue_prompt))
2160 continue_prompt))
2151
2161
2152 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2162 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2153
2163
2154 return prefilter.prefilter(line_info, self)
2164 return prefilter.prefilter(line_info, self)
2155
2165
2156
2166
2157 def _prefilter_dumb(self, line, continue_prompt):
2167 def _prefilter_dumb(self, line, continue_prompt):
2158 """simple prefilter function, for debugging"""
2168 """simple prefilter function, for debugging"""
2159 return self.handle_normal(line,continue_prompt)
2169 return self.handle_normal(line,continue_prompt)
2160
2170
2161
2171
2162 def multiline_prefilter(self, line, continue_prompt):
2172 def multiline_prefilter(self, line, continue_prompt):
2163 """ Run _prefilter for each line of input
2173 """ Run _prefilter for each line of input
2164
2174
2165 Covers cases where there are multiple lines in the user entry,
2175 Covers cases where there are multiple lines in the user entry,
2166 which is the case when the user goes back to a multiline history
2176 which is the case when the user goes back to a multiline history
2167 entry and presses enter.
2177 entry and presses enter.
2168
2178
2169 """
2179 """
2170 out = []
2180 out = []
2171 for l in line.rstrip('\n').split('\n'):
2181 for l in line.rstrip('\n').split('\n'):
2172 out.append(self._prefilter(l, continue_prompt))
2182 out.append(self._prefilter(l, continue_prompt))
2173 return '\n'.join(out)
2183 return '\n'.join(out)
2174
2184
2175 # Set the default prefilter() function (this can be user-overridden)
2185 # Set the default prefilter() function (this can be user-overridden)
2176 prefilter = multiline_prefilter
2186 prefilter = multiline_prefilter
2177
2187
2178 def handle_normal(self,line_info):
2188 def handle_normal(self,line_info):
2179 """Handle normal input lines. Use as a template for handlers."""
2189 """Handle normal input lines. Use as a template for handlers."""
2180
2190
2181 # With autoindent on, we need some way to exit the input loop, and I
2191 # With autoindent on, we need some way to exit the input loop, and I
2182 # don't want to force the user to have to backspace all the way to
2192 # don't want to force the user to have to backspace all the way to
2183 # clear the line. The rule will be in this case, that either two
2193 # clear the line. The rule will be in this case, that either two
2184 # lines of pure whitespace in a row, or a line of pure whitespace but
2194 # lines of pure whitespace in a row, or a line of pure whitespace but
2185 # of a size different to the indent level, will exit the input loop.
2195 # of a size different to the indent level, will exit the input loop.
2186 line = line_info.line
2196 line = line_info.line
2187 continue_prompt = line_info.continue_prompt
2197 continue_prompt = line_info.continue_prompt
2188
2198
2189 if (continue_prompt and self.autoindent and line.isspace() and
2199 if (continue_prompt and self.autoindent and line.isspace() and
2190 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2200 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2191 (self.buffer[-1]).isspace() )):
2201 (self.buffer[-1]).isspace() )):
2192 line = ''
2202 line = ''
2193
2203
2194 self.log(line,line,continue_prompt)
2204 self.log(line,line,continue_prompt)
2195 return line
2205 return line
2196
2206
2197 def handle_alias(self,line_info):
2207 def handle_alias(self,line_info):
2198 """Handle alias input lines. """
2208 """Handle alias input lines. """
2199 tgt = self.alias_table[line_info.iFun]
2209 tgt = self.alias_table[line_info.iFun]
2200 # print "=>",tgt #dbg
2210 # print "=>",tgt #dbg
2201 if callable(tgt):
2211 if callable(tgt):
2202 if '$' in line_info.line:
2212 if '$' in line_info.line:
2203 call_meth = '(_ip, _ip.itpl(%s))'
2213 call_meth = '(_ip, _ip.itpl(%s))'
2204 else:
2214 else:
2205 call_meth = '(_ip,%s)'
2215 call_meth = '(_ip,%s)'
2206 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2216 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2207 line_info.iFun,
2217 line_info.iFun,
2208 make_quoted_expr(line_info.line))
2218 make_quoted_expr(line_info.line))
2209 else:
2219 else:
2210 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2220 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2211
2221
2212 # pre is needed, because it carries the leading whitespace. Otherwise
2222 # pre is needed, because it carries the leading whitespace. Otherwise
2213 # aliases won't work in indented sections.
2223 # aliases won't work in indented sections.
2214 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2224 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2215 make_quoted_expr( transformed ))
2225 make_quoted_expr( transformed ))
2216
2226
2217 self.log(line_info.line,line_out,line_info.continue_prompt)
2227 self.log(line_info.line,line_out,line_info.continue_prompt)
2218 #print 'line out:',line_out # dbg
2228 #print 'line out:',line_out # dbg
2219 return line_out
2229 return line_out
2220
2230
2221 def handle_shell_escape(self, line_info):
2231 def handle_shell_escape(self, line_info):
2222 """Execute the line in a shell, empty return value"""
2232 """Execute the line in a shell, empty return value"""
2223 #print 'line in :', `line` # dbg
2233 #print 'line in :', `line` # dbg
2224 line = line_info.line
2234 line = line_info.line
2225 if line.lstrip().startswith('!!'):
2235 if line.lstrip().startswith('!!'):
2226 # rewrite LineInfo's line, iFun and theRest to properly hold the
2236 # rewrite LineInfo's line, iFun and theRest to properly hold the
2227 # call to %sx and the actual command to be executed, so
2237 # call to %sx and the actual command to be executed, so
2228 # handle_magic can work correctly. Note that this works even if
2238 # handle_magic can work correctly. Note that this works even if
2229 # the line is indented, so it handles multi_line_specials
2239 # the line is indented, so it handles multi_line_specials
2230 # properly.
2240 # properly.
2231 new_rest = line.lstrip()[2:]
2241 new_rest = line.lstrip()[2:]
2232 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2242 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2233 line_info.iFun = 'sx'
2243 line_info.iFun = 'sx'
2234 line_info.theRest = new_rest
2244 line_info.theRest = new_rest
2235 return self.handle_magic(line_info)
2245 return self.handle_magic(line_info)
2236 else:
2246 else:
2237 cmd = line.lstrip().lstrip('!')
2247 cmd = line.lstrip().lstrip('!')
2238 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2248 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2239 make_quoted_expr(cmd))
2249 make_quoted_expr(cmd))
2240 # update cache/log and return
2250 # update cache/log and return
2241 self.log(line,line_out,line_info.continue_prompt)
2251 self.log(line,line_out,line_info.continue_prompt)
2242 return line_out
2252 return line_out
2243
2253
2244 def handle_magic(self, line_info):
2254 def handle_magic(self, line_info):
2245 """Execute magic functions."""
2255 """Execute magic functions."""
2246 iFun = line_info.iFun
2256 iFun = line_info.iFun
2247 theRest = line_info.theRest
2257 theRest = line_info.theRest
2248 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2258 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2249 make_quoted_expr(iFun + " " + theRest))
2259 make_quoted_expr(iFun + " " + theRest))
2250 self.log(line_info.line,cmd,line_info.continue_prompt)
2260 self.log(line_info.line,cmd,line_info.continue_prompt)
2251 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2261 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2252 return cmd
2262 return cmd
2253
2263
2254 def handle_auto(self, line_info):
2264 def handle_auto(self, line_info):
2255 """Hande lines which can be auto-executed, quoting if requested."""
2265 """Hande lines which can be auto-executed, quoting if requested."""
2256
2266
2257 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2267 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2258 line = line_info.line
2268 line = line_info.line
2259 iFun = line_info.iFun
2269 iFun = line_info.iFun
2260 theRest = line_info.theRest
2270 theRest = line_info.theRest
2261 pre = line_info.pre
2271 pre = line_info.pre
2262 continue_prompt = line_info.continue_prompt
2272 continue_prompt = line_info.continue_prompt
2263 obj = line_info.ofind(self)['obj']
2273 obj = line_info.ofind(self)['obj']
2264
2274
2265 # This should only be active for single-line input!
2275 # This should only be active for single-line input!
2266 if continue_prompt:
2276 if continue_prompt:
2267 self.log(line,line,continue_prompt)
2277 self.log(line,line,continue_prompt)
2268 return line
2278 return line
2269
2279
2270 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2280 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2271 auto_rewrite = True
2281 auto_rewrite = True
2272
2282
2273 if pre == self.ESC_QUOTE:
2283 if pre == self.ESC_QUOTE:
2274 # Auto-quote splitting on whitespace
2284 # Auto-quote splitting on whitespace
2275 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2285 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2276 elif pre == self.ESC_QUOTE2:
2286 elif pre == self.ESC_QUOTE2:
2277 # Auto-quote whole string
2287 # Auto-quote whole string
2278 newcmd = '%s("%s")' % (iFun,theRest)
2288 newcmd = '%s("%s")' % (iFun,theRest)
2279 elif pre == self.ESC_PAREN:
2289 elif pre == self.ESC_PAREN:
2280 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2290 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2281 else:
2291 else:
2282 # Auto-paren.
2292 # Auto-paren.
2283 # We only apply it to argument-less calls if the autocall
2293 # We only apply it to argument-less calls if the autocall
2284 # parameter is set to 2. We only need to check that autocall is <
2294 # parameter is set to 2. We only need to check that autocall is <
2285 # 2, since this function isn't called unless it's at least 1.
2295 # 2, since this function isn't called unless it's at least 1.
2286 if not theRest and (self.rc.autocall < 2) and not force_auto:
2296 if not theRest and (self.rc.autocall < 2) and not force_auto:
2287 newcmd = '%s %s' % (iFun,theRest)
2297 newcmd = '%s %s' % (iFun,theRest)
2288 auto_rewrite = False
2298 auto_rewrite = False
2289 else:
2299 else:
2290 if not force_auto and theRest.startswith('['):
2300 if not force_auto and theRest.startswith('['):
2291 if hasattr(obj,'__getitem__'):
2301 if hasattr(obj,'__getitem__'):
2292 # Don't autocall in this case: item access for an object
2302 # Don't autocall in this case: item access for an object
2293 # which is BOTH callable and implements __getitem__.
2303 # which is BOTH callable and implements __getitem__.
2294 newcmd = '%s %s' % (iFun,theRest)
2304 newcmd = '%s %s' % (iFun,theRest)
2295 auto_rewrite = False
2305 auto_rewrite = False
2296 else:
2306 else:
2297 # if the object doesn't support [] access, go ahead and
2307 # if the object doesn't support [] access, go ahead and
2298 # autocall
2308 # autocall
2299 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2309 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2300 elif theRest.endswith(';'):
2310 elif theRest.endswith(';'):
2301 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2311 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2302 else:
2312 else:
2303 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2313 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2304
2314
2305 if auto_rewrite:
2315 if auto_rewrite:
2306 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2316 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2307
2317
2308 try:
2318 try:
2309 # plain ascii works better w/ pyreadline, on some machines, so
2319 # plain ascii works better w/ pyreadline, on some machines, so
2310 # we use it and only print uncolored rewrite if we have unicode
2320 # we use it and only print uncolored rewrite if we have unicode
2311 rw = str(rw)
2321 rw = str(rw)
2312 print >>Term.cout, rw
2322 print >>Term.cout, rw
2313 except UnicodeEncodeError:
2323 except UnicodeEncodeError:
2314 print "-------------->" + newcmd
2324 print "-------------->" + newcmd
2315
2325
2316 # log what is now valid Python, not the actual user input (without the
2326 # log what is now valid Python, not the actual user input (without the
2317 # final newline)
2327 # final newline)
2318 self.log(line,newcmd,continue_prompt)
2328 self.log(line,newcmd,continue_prompt)
2319 return newcmd
2329 return newcmd
2320
2330
2321 def handle_help(self, line_info):
2331 def handle_help(self, line_info):
2322 """Try to get some help for the object.
2332 """Try to get some help for the object.
2323
2333
2324 obj? or ?obj -> basic information.
2334 obj? or ?obj -> basic information.
2325 obj?? or ??obj -> more details.
2335 obj?? or ??obj -> more details.
2326 """
2336 """
2327
2337
2328 line = line_info.line
2338 line = line_info.line
2329 # We need to make sure that we don't process lines which would be
2339 # We need to make sure that we don't process lines which would be
2330 # otherwise valid python, such as "x=1 # what?"
2340 # otherwise valid python, such as "x=1 # what?"
2331 try:
2341 try:
2332 codeop.compile_command(line)
2342 codeop.compile_command(line)
2333 except SyntaxError:
2343 except SyntaxError:
2334 # We should only handle as help stuff which is NOT valid syntax
2344 # We should only handle as help stuff which is NOT valid syntax
2335 if line[0]==self.ESC_HELP:
2345 if line[0]==self.ESC_HELP:
2336 line = line[1:]
2346 line = line[1:]
2337 elif line[-1]==self.ESC_HELP:
2347 elif line[-1]==self.ESC_HELP:
2338 line = line[:-1]
2348 line = line[:-1]
2339 self.log(line,'#?'+line,line_info.continue_prompt)
2349 self.log(line,'#?'+line,line_info.continue_prompt)
2340 if line:
2350 if line:
2341 #print 'line:<%r>' % line # dbg
2351 #print 'line:<%r>' % line # dbg
2342 self.magic_pinfo(line)
2352 self.magic_pinfo(line)
2343 else:
2353 else:
2344 page(self.usage,screen_lines=self.rc.screen_length)
2354 page(self.usage,screen_lines=self.rc.screen_length)
2345 return '' # Empty string is needed here!
2355 return '' # Empty string is needed here!
2346 except:
2356 except:
2347 # Pass any other exceptions through to the normal handler
2357 # Pass any other exceptions through to the normal handler
2348 return self.handle_normal(line_info)
2358 return self.handle_normal(line_info)
2349 else:
2359 else:
2350 # If the code compiles ok, we should handle it normally
2360 # If the code compiles ok, we should handle it normally
2351 return self.handle_normal(line_info)
2361 return self.handle_normal(line_info)
2352
2362
2353 def getapi(self):
2363 def getapi(self):
2354 """ Get an IPApi object for this shell instance
2364 """ Get an IPApi object for this shell instance
2355
2365
2356 Getting an IPApi object is always preferable to accessing the shell
2366 Getting an IPApi object is always preferable to accessing the shell
2357 directly, but this holds true especially for extensions.
2367 directly, but this holds true especially for extensions.
2358
2368
2359 It should always be possible to implement an extension with IPApi
2369 It should always be possible to implement an extension with IPApi
2360 alone. If not, contact maintainer to request an addition.
2370 alone. If not, contact maintainer to request an addition.
2361
2371
2362 """
2372 """
2363 return self.api
2373 return self.api
2364
2374
2365 def handle_emacs(self, line_info):
2375 def handle_emacs(self, line_info):
2366 """Handle input lines marked by python-mode."""
2376 """Handle input lines marked by python-mode."""
2367
2377
2368 # Currently, nothing is done. Later more functionality can be added
2378 # Currently, nothing is done. Later more functionality can be added
2369 # here if needed.
2379 # here if needed.
2370
2380
2371 # The input cache shouldn't be updated
2381 # The input cache shouldn't be updated
2372 return line_info.line
2382 return line_info.line
2373
2383
2374
2384
2375 def mktempfile(self,data=None):
2385 def mktempfile(self,data=None):
2376 """Make a new tempfile and return its filename.
2386 """Make a new tempfile and return its filename.
2377
2387
2378 This makes a call to tempfile.mktemp, but it registers the created
2388 This makes a call to tempfile.mktemp, but it registers the created
2379 filename internally so ipython cleans it up at exit time.
2389 filename internally so ipython cleans it up at exit time.
2380
2390
2381 Optional inputs:
2391 Optional inputs:
2382
2392
2383 - data(None): if data is given, it gets written out to the temp file
2393 - data(None): if data is given, it gets written out to the temp file
2384 immediately, and the file is closed again."""
2394 immediately, and the file is closed again."""
2385
2395
2386 filename = tempfile.mktemp('.py','ipython_edit_')
2396 filename = tempfile.mktemp('.py','ipython_edit_')
2387 self.tempfiles.append(filename)
2397 self.tempfiles.append(filename)
2388
2398
2389 if data:
2399 if data:
2390 tmp_file = open(filename,'w')
2400 tmp_file = open(filename,'w')
2391 tmp_file.write(data)
2401 tmp_file.write(data)
2392 tmp_file.close()
2402 tmp_file.close()
2393 return filename
2403 return filename
2394
2404
2395 def write(self,data):
2405 def write(self,data):
2396 """Write a string to the default output"""
2406 """Write a string to the default output"""
2397 Term.cout.write(data)
2407 Term.cout.write(data)
2398
2408
2399 def write_err(self,data):
2409 def write_err(self,data):
2400 """Write a string to the default error output"""
2410 """Write a string to the default error output"""
2401 Term.cerr.write(data)
2411 Term.cerr.write(data)
2402
2412
2403 def exit(self):
2413 def exit(self):
2404 """Handle interactive exit.
2414 """Handle interactive exit.
2405
2415
2406 This method sets the exit_now attribute."""
2416 This method sets the exit_now attribute."""
2407
2417
2408 if self.rc.confirm_exit:
2418 if self.rc.confirm_exit:
2409 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2419 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2410 self.exit_now = True
2420 self.exit_now = True
2411 else:
2421 else:
2412 self.exit_now = True
2422 self.exit_now = True
2413
2423
2414 def safe_execfile(self,fname,*where,**kw):
2424 def safe_execfile(self,fname,*where,**kw):
2415 """A safe version of the builtin execfile().
2425 """A safe version of the builtin execfile().
2416
2426
2417 This version will never throw an exception, and knows how to handle
2427 This version will never throw an exception, and knows how to handle
2418 ipython logs as well.
2428 ipython logs as well.
2419
2429
2420 :Parameters:
2430 :Parameters:
2421 fname : string
2431 fname : string
2422 Name of the file to be executed.
2432 Name of the file to be executed.
2423
2433
2424 where : tuple
2434 where : tuple
2425 One or two namespaces, passed to execfile() as (globals,locals).
2435 One or two namespaces, passed to execfile() as (globals,locals).
2426 If only one is given, it is passed as both.
2436 If only one is given, it is passed as both.
2427
2437
2428 :Keywords:
2438 :Keywords:
2429 islog : boolean (False)
2439 islog : boolean (False)
2430
2440
2431 quiet : boolean (True)
2441 quiet : boolean (True)
2432
2442
2433 exit_ignore : boolean (False)
2443 exit_ignore : boolean (False)
2434 """
2444 """
2435
2445
2436 def syspath_cleanup():
2446 def syspath_cleanup():
2437 """Internal cleanup routine for sys.path."""
2447 """Internal cleanup routine for sys.path."""
2438 if add_dname:
2448 if add_dname:
2439 try:
2449 try:
2440 sys.path.remove(dname)
2450 sys.path.remove(dname)
2441 except ValueError:
2451 except ValueError:
2442 # For some reason the user has already removed it, ignore.
2452 # For some reason the user has already removed it, ignore.
2443 pass
2453 pass
2444
2454
2445 fname = os.path.expanduser(fname)
2455 fname = os.path.expanduser(fname)
2446
2456
2447 # Find things also in current directory. This is needed to mimic the
2457 # Find things also in current directory. This is needed to mimic the
2448 # behavior of running a script from the system command line, where
2458 # behavior of running a script from the system command line, where
2449 # Python inserts the script's directory into sys.path
2459 # Python inserts the script's directory into sys.path
2450 dname = os.path.dirname(os.path.abspath(fname))
2460 dname = os.path.dirname(os.path.abspath(fname))
2451 add_dname = False
2461 add_dname = False
2452 if dname not in sys.path:
2462 if dname not in sys.path:
2453 sys.path.insert(0,dname)
2463 sys.path.insert(0,dname)
2454 add_dname = True
2464 add_dname = True
2455
2465
2456 try:
2466 try:
2457 xfile = open(fname)
2467 xfile = open(fname)
2458 except:
2468 except:
2459 print >> Term.cerr, \
2469 print >> Term.cerr, \
2460 'Could not open file <%s> for safe execution.' % fname
2470 'Could not open file <%s> for safe execution.' % fname
2461 syspath_cleanup()
2471 syspath_cleanup()
2462 return None
2472 return None
2463
2473
2464 kw.setdefault('islog',0)
2474 kw.setdefault('islog',0)
2465 kw.setdefault('quiet',1)
2475 kw.setdefault('quiet',1)
2466 kw.setdefault('exit_ignore',0)
2476 kw.setdefault('exit_ignore',0)
2467
2477
2468 first = xfile.readline()
2478 first = xfile.readline()
2469 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2479 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2470 xfile.close()
2480 xfile.close()
2471 # line by line execution
2481 # line by line execution
2472 if first.startswith(loghead) or kw['islog']:
2482 if first.startswith(loghead) or kw['islog']:
2473 print 'Loading log file <%s> one line at a time...' % fname
2483 print 'Loading log file <%s> one line at a time...' % fname
2474 if kw['quiet']:
2484 if kw['quiet']:
2475 stdout_save = sys.stdout
2485 stdout_save = sys.stdout
2476 sys.stdout = StringIO.StringIO()
2486 sys.stdout = StringIO.StringIO()
2477 try:
2487 try:
2478 globs,locs = where[0:2]
2488 globs,locs = where[0:2]
2479 except:
2489 except:
2480 try:
2490 try:
2481 globs = locs = where[0]
2491 globs = locs = where[0]
2482 except:
2492 except:
2483 globs = locs = globals()
2493 globs = locs = globals()
2484 badblocks = []
2494 badblocks = []
2485
2495
2486 # we also need to identify indented blocks of code when replaying
2496 # we also need to identify indented blocks of code when replaying
2487 # logs and put them together before passing them to an exec
2497 # logs and put them together before passing them to an exec
2488 # statement. This takes a bit of regexp and look-ahead work in the
2498 # statement. This takes a bit of regexp and look-ahead work in the
2489 # file. It's easiest if we swallow the whole thing in memory
2499 # file. It's easiest if we swallow the whole thing in memory
2490 # first, and manually walk through the lines list moving the
2500 # first, and manually walk through the lines list moving the
2491 # counter ourselves.
2501 # counter ourselves.
2492 indent_re = re.compile('\s+\S')
2502 indent_re = re.compile('\s+\S')
2493 xfile = open(fname)
2503 xfile = open(fname)
2494 filelines = xfile.readlines()
2504 filelines = xfile.readlines()
2495 xfile.close()
2505 xfile.close()
2496 nlines = len(filelines)
2506 nlines = len(filelines)
2497 lnum = 0
2507 lnum = 0
2498 while lnum < nlines:
2508 while lnum < nlines:
2499 line = filelines[lnum]
2509 line = filelines[lnum]
2500 lnum += 1
2510 lnum += 1
2501 # don't re-insert logger status info into cache
2511 # don't re-insert logger status info into cache
2502 if line.startswith('#log#'):
2512 if line.startswith('#log#'):
2503 continue
2513 continue
2504 else:
2514 else:
2505 # build a block of code (maybe a single line) for execution
2515 # build a block of code (maybe a single line) for execution
2506 block = line
2516 block = line
2507 try:
2517 try:
2508 next = filelines[lnum] # lnum has already incremented
2518 next = filelines[lnum] # lnum has already incremented
2509 except:
2519 except:
2510 next = None
2520 next = None
2511 while next and indent_re.match(next):
2521 while next and indent_re.match(next):
2512 block += next
2522 block += next
2513 lnum += 1
2523 lnum += 1
2514 try:
2524 try:
2515 next = filelines[lnum]
2525 next = filelines[lnum]
2516 except:
2526 except:
2517 next = None
2527 next = None
2518 # now execute the block of one or more lines
2528 # now execute the block of one or more lines
2519 try:
2529 try:
2520 exec block in globs,locs
2530 exec block in globs,locs
2521 except SystemExit:
2531 except SystemExit:
2522 pass
2532 pass
2523 except:
2533 except:
2524 badblocks.append(block.rstrip())
2534 badblocks.append(block.rstrip())
2525 if kw['quiet']: # restore stdout
2535 if kw['quiet']: # restore stdout
2526 sys.stdout.close()
2536 sys.stdout.close()
2527 sys.stdout = stdout_save
2537 sys.stdout = stdout_save
2528 print 'Finished replaying log file <%s>' % fname
2538 print 'Finished replaying log file <%s>' % fname
2529 if badblocks:
2539 if badblocks:
2530 print >> sys.stderr, ('\nThe following lines/blocks in file '
2540 print >> sys.stderr, ('\nThe following lines/blocks in file '
2531 '<%s> reported errors:' % fname)
2541 '<%s> reported errors:' % fname)
2532
2542
2533 for badline in badblocks:
2543 for badline in badblocks:
2534 print >> sys.stderr, badline
2544 print >> sys.stderr, badline
2535 else: # regular file execution
2545 else: # regular file execution
2536 try:
2546 try:
2537 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2547 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2538 # Work around a bug in Python for Windows. The bug was
2548 # Work around a bug in Python for Windows. The bug was
2539 # fixed in in Python 2.5 r54159 and 54158, but that's still
2549 # fixed in in Python 2.5 r54159 and 54158, but that's still
2540 # SVN Python as of March/07. For details, see:
2550 # SVN Python as of March/07. For details, see:
2541 # http://projects.scipy.org/ipython/ipython/ticket/123
2551 # http://projects.scipy.org/ipython/ipython/ticket/123
2542 try:
2552 try:
2543 globs,locs = where[0:2]
2553 globs,locs = where[0:2]
2544 except:
2554 except:
2545 try:
2555 try:
2546 globs = locs = where[0]
2556 globs = locs = where[0]
2547 except:
2557 except:
2548 globs = locs = globals()
2558 globs = locs = globals()
2549 exec file(fname) in globs,locs
2559 exec file(fname) in globs,locs
2550 else:
2560 else:
2551 execfile(fname,*where)
2561 execfile(fname,*where)
2552 except SyntaxError:
2562 except SyntaxError:
2553 self.showsyntaxerror()
2563 self.showsyntaxerror()
2554 warn('Failure executing file: <%s>' % fname)
2564 warn('Failure executing file: <%s>' % fname)
2555 except SystemExit,status:
2565 except SystemExit,status:
2556 # Code that correctly sets the exit status flag to success (0)
2566 # Code that correctly sets the exit status flag to success (0)
2557 # shouldn't be bothered with a traceback. Note that a plain
2567 # shouldn't be bothered with a traceback. Note that a plain
2558 # sys.exit() does NOT set the message to 0 (it's empty) so that
2568 # sys.exit() does NOT set the message to 0 (it's empty) so that
2559 # will still get a traceback. Note that the structure of the
2569 # will still get a traceback. Note that the structure of the
2560 # SystemExit exception changed between Python 2.4 and 2.5, so
2570 # SystemExit exception changed between Python 2.4 and 2.5, so
2561 # the checks must be done in a version-dependent way.
2571 # the checks must be done in a version-dependent way.
2562 show = False
2572 show = False
2563
2573
2564 if sys.version_info[:2] > (2,5):
2574 if sys.version_info[:2] > (2,5):
2565 if status.message!=0 and not kw['exit_ignore']:
2575 if status.message!=0 and not kw['exit_ignore']:
2566 show = True
2576 show = True
2567 else:
2577 else:
2568 if status.code and not kw['exit_ignore']:
2578 if status.code and not kw['exit_ignore']:
2569 show = True
2579 show = True
2570 if show:
2580 if show:
2571 self.showtraceback()
2581 self.showtraceback()
2572 warn('Failure executing file: <%s>' % fname)
2582 warn('Failure executing file: <%s>' % fname)
2573 except:
2583 except:
2574 self.showtraceback()
2584 self.showtraceback()
2575 warn('Failure executing file: <%s>' % fname)
2585 warn('Failure executing file: <%s>' % fname)
2576
2586
2577 syspath_cleanup()
2587 syspath_cleanup()
2578
2588
2579 #************************* end of file <iplib.py> *****************************
2589 #************************* end of file <iplib.py> *****************************
@@ -1,7270 +1,7294 b''
1 2007-12-12 Ville Vainio <vivainio@gmail.com>
2
3 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of current
4 directory.
5
6 * iplib.py: We now set system default encoding to sys.stdin.encoding with
7 sys.setdefaultencoding, after a patch by 'pan'. This makes str() calls that
8 IPython still has implicitly work. This should be removed when such calls
9 are cleaned.
10
1 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
11 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
2
12
3 * IPython/Shell.py (_select_shell): add support for controlling
13 * IPython/Shell.py (_select_shell): add support for controlling
4 the pylab threading mode directly at the command line, without
14 the pylab threading mode directly at the command line, without
5 having to modify MPL config files. Added unit tests for this
15 having to modify MPL config files. Added unit tests for this
6 feature, though manual/docs update is still pending, will do later.
16 feature, though manual/docs update is still pending, will do later.
7
17
18 2007-12-11 Ville Vainio <vivainio@gmail.com>
19
20 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
21 use in scripts)
22
23 2007-12-07 Ville Vainio <vivainio@gmail.com>
24
25 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
26 anymore (to \#) - even if it is a comment char that is implicitly
27 escaped in some unix shells in interactive mode, it is ok to leave
28 it in IPython as such.
29
30
8 2007-12-01 Robert Kern <robert.kern@gmail.com>
31 2007-12-01 Robert Kern <robert.kern@gmail.com>
9
32
10 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
33 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
11 inspect.findsource(). It can now find source lines inside zipped
34 inspect.findsource(). It can now find source lines inside zipped
12 packages.
35 packages.
13
36
14 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
37 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
15 in the frame's namespace before trusting the filename in the code object
38 in the frame's namespace before trusting the filename in the code object
16 which created the frame.
39 which created the frame.
17
40
18 2007-11-29 *** Released version 0.8.2
41 2007-11-29 *** Released version 0.8.2
19
42
20 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
43 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
21
44
22 * IPython/Logger.py (Logger.logstop): add a proper logstop()
45 * IPython/Logger.py (Logger.logstop): add a proper logstop()
23 method to fully stop the logger, along with a corresponding
46 method to fully stop the logger, along with a corresponding
24 %logstop magic for interactive use.
47 %logstop magic for interactive use.
25
48
26 * IPython/Extensions/ipy_host_completers.py: added new host
49 * IPython/Extensions/ipy_host_completers.py: added new host
27 completers functionality, contributed by Gael Pasgrimaud
50 completers functionality, contributed by Gael Pasgrimaud
28 <gawel-AT-afpy.org>.
51 <gawel-AT-afpy.org>.
29
52
30 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
53 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
31
54
32 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
55 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
33 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
56 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
34 options handling. Unicode fix in %whos (committed a while ago)
57 options handling. Unicode fix in %whos (committed a while ago)
35 was also contributed by Paul.
58 was also contributed by Paul.
36
59
37 2007-11-23 Darren Dale <darren.dale@cornell.edu>
60 2007-11-23 Darren Dale <darren.dale@cornell.edu>
38 * ipy_traits_completer.py: let traits_completer respect the user's
61 * ipy_traits_completer.py: let traits_completer respect the user's
39 readline_omit__names setting.
62 readline_omit__names setting.
40
63
41 2007-11-08 Ville Vainio <vivainio@gmail.com>
64 2007-11-08 Ville Vainio <vivainio@gmail.com>
65
42 * ipy_completers.py (import completer): assume 'xml' module exists.
66 * ipy_completers.py (import completer): assume 'xml' module exists.
43 Do not add every module twice anymore. Closes #196.
67 Do not add every module twice anymore. Closes #196.
44
68
45 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
69 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
46 completer that uses apt-cache to search for existing packages.
70 completer that uses apt-cache to search for existing packages.
47
71
48 2007-11-06 Ville Vainio <vivainio@gmail.com>
72 2007-11-06 Ville Vainio <vivainio@gmail.com>
49
73
50 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
74 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
51 true. Closes #194.
75 true. Closes #194.
52
76
53 2007-11-01 Brian Granger <ellisonbg@gmail.com>
77 2007-11-01 Brian Granger <ellisonbg@gmail.com>
54
78
55 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
79 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
56 working with OS X 10.5 libedit implementation of readline.
80 working with OS X 10.5 libedit implementation of readline.
57
81
58 2007-10-24 Ville Vainio <vivainio@gmail.com>
82 2007-10-24 Ville Vainio <vivainio@gmail.com>
59
83
60 * iplib.py(user_setup): To route around buggy installations where
84 * iplib.py(user_setup): To route around buggy installations where
61 UserConfig is not available, create a minimal _ipython.
85 UserConfig is not available, create a minimal _ipython.
62
86
63 * iplib.py: Unicode fixes from Jorgen.
87 * iplib.py: Unicode fixes from Jorgen.
64
88
65 * genutils.py: Slist now has new method 'fields()' for extraction of
89 * genutils.py: Slist now has new method 'fields()' for extraction of
66 whitespace-separated fields from line-oriented data.
90 whitespace-separated fields from line-oriented data.
67
91
68 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
92 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
69
93
70 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
94 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
71 when querying objects with no __class__ attribute (such as
95 when querying objects with no __class__ attribute (such as
72 f2py-generated modules).
96 f2py-generated modules).
73
97
74 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
98 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
75
99
76 * IPython/Magic.py (magic_time): track compilation time and report
100 * IPython/Magic.py (magic_time): track compilation time and report
77 it if longer than 0.1s (fix done to %time and %timeit). After a
101 it if longer than 0.1s (fix done to %time and %timeit). After a
78 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
102 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
79
103
80 2007-09-18 Ville Vainio <vivainio@gmail.com>
104 2007-09-18 Ville Vainio <vivainio@gmail.com>
81
105
82 * genutils.py(make_quoted_expr): Do not use Itpl, it does
106 * genutils.py(make_quoted_expr): Do not use Itpl, it does
83 not support unicode at the moment. Fixes (many) magic calls with
107 not support unicode at the moment. Fixes (many) magic calls with
84 special characters.
108 special characters.
85
109
86 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
110 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
87
111
88 * IPython/genutils.py (doctest_reload): expose the doctest
112 * IPython/genutils.py (doctest_reload): expose the doctest
89 reloader to the user so that people can easily reset doctest while
113 reloader to the user so that people can easily reset doctest while
90 using it interactively. Fixes a problem reported by Jorgen.
114 using it interactively. Fixes a problem reported by Jorgen.
91
115
92 * IPython/iplib.py (InteractiveShell.__init__): protect the
116 * IPython/iplib.py (InteractiveShell.__init__): protect the
93 FakeModule instances used for __main__ in %run calls from
117 FakeModule instances used for __main__ in %run calls from
94 deletion, so that user code defined in them isn't left with
118 deletion, so that user code defined in them isn't left with
95 dangling references due to the Python module deletion machinery.
119 dangling references due to the Python module deletion machinery.
96 This should fix the problems reported by Darren.
120 This should fix the problems reported by Darren.
97
121
98 2007-09-10 Darren Dale <dd55@cornell.edu>
122 2007-09-10 Darren Dale <dd55@cornell.edu>
99
123
100 * Cleanup of IPShellQt and IPShellQt4
124 * Cleanup of IPShellQt and IPShellQt4
101
125
102 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
126 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
103
127
104 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
128 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
105 doctest support.
129 doctest support.
106
130
107 * IPython/iplib.py (safe_execfile): minor docstring improvements.
131 * IPython/iplib.py (safe_execfile): minor docstring improvements.
108
132
109 2007-09-08 Ville Vainio <vivainio@gmail.com>
133 2007-09-08 Ville Vainio <vivainio@gmail.com>
110
134
111 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
135 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
112 directory, not the target directory.
136 directory, not the target directory.
113
137
114 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
138 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
115 exception that won't print the tracebacks. Switched many magics to
139 exception that won't print the tracebacks. Switched many magics to
116 raise them on error situations, also GetoptError is not printed
140 raise them on error situations, also GetoptError is not printed
117 anymore.
141 anymore.
118
142
119 2007-09-07 Ville Vainio <vivainio@gmail.com>
143 2007-09-07 Ville Vainio <vivainio@gmail.com>
120
144
121 * iplib.py: do not auto-alias "dir", it screws up other dir auto
145 * iplib.py: do not auto-alias "dir", it screws up other dir auto
122 aliases.
146 aliases.
123
147
124 * genutils.py: SList.grep() implemented.
148 * genutils.py: SList.grep() implemented.
125
149
126 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
150 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
127 for easy "out of the box" setup of several common editors, so that
151 for easy "out of the box" setup of several common editors, so that
128 e.g. '%edit os.path.isfile' will jump to the correct line
152 e.g. '%edit os.path.isfile' will jump to the correct line
129 automatically. Contributions for command lines of your favourite
153 automatically. Contributions for command lines of your favourite
130 editors welcome.
154 editors welcome.
131
155
132 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
156 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
133
157
134 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
158 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
135 preventing source display in certain cases. In reality I think
159 preventing source display in certain cases. In reality I think
136 the problem is with Ubuntu's Python build, but this change works
160 the problem is with Ubuntu's Python build, but this change works
137 around the issue in some cases (not in all, unfortunately). I'd
161 around the issue in some cases (not in all, unfortunately). I'd
138 filed a Python bug on this with more details, but in the change of
162 filed a Python bug on this with more details, but in the change of
139 bug trackers it seems to have been lost.
163 bug trackers it seems to have been lost.
140
164
141 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
165 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
142 not the same, it's not self-documenting, doesn't allow range
166 not the same, it's not self-documenting, doesn't allow range
143 selection, and sorts alphabetically instead of numerically.
167 selection, and sorts alphabetically instead of numerically.
144 (magic_r): restore %r. No, "up + enter. One char magic" is not
168 (magic_r): restore %r. No, "up + enter. One char magic" is not
145 the same thing, since %r takes parameters to allow fast retrieval
169 the same thing, since %r takes parameters to allow fast retrieval
146 of old commands. I've received emails from users who use this a
170 of old commands. I've received emails from users who use this a
147 LOT, so it stays.
171 LOT, so it stays.
148 (magic_automagic): restore %automagic. "use _ip.option.automagic"
172 (magic_automagic): restore %automagic. "use _ip.option.automagic"
149 is not a valid replacement b/c it doesn't provide an complete
173 is not a valid replacement b/c it doesn't provide an complete
150 explanation (which the automagic docstring does).
174 explanation (which the automagic docstring does).
151 (magic_autocall): restore %autocall, with improved docstring.
175 (magic_autocall): restore %autocall, with improved docstring.
152 Same argument as for others, "use _ip.options.autocall" is not a
176 Same argument as for others, "use _ip.options.autocall" is not a
153 valid replacement.
177 valid replacement.
154 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
178 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
155 tutorials and online docs.
179 tutorials and online docs.
156
180
157 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
181 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
158
182
159 * IPython/usage.py (quick_reference): mention magics in quickref,
183 * IPython/usage.py (quick_reference): mention magics in quickref,
160 modified main banner to mention %quickref.
184 modified main banner to mention %quickref.
161
185
162 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
186 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
163
187
164 2007-09-06 Ville Vainio <vivainio@gmail.com>
188 2007-09-06 Ville Vainio <vivainio@gmail.com>
165
189
166 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
190 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
167 Callable aliases now pass the _ip as first arg. This breaks
191 Callable aliases now pass the _ip as first arg. This breaks
168 compatibility with earlier 0.8.2.svn series! (though they should
192 compatibility with earlier 0.8.2.svn series! (though they should
169 not have been in use yet outside these few extensions)
193 not have been in use yet outside these few extensions)
170
194
171 2007-09-05 Ville Vainio <vivainio@gmail.com>
195 2007-09-05 Ville Vainio <vivainio@gmail.com>
172
196
173 * external/mglob.py: expand('dirname') => ['dirname'], instead
197 * external/mglob.py: expand('dirname') => ['dirname'], instead
174 of ['dirname/foo','dirname/bar', ...].
198 of ['dirname/foo','dirname/bar', ...].
175
199
176 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
200 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
177 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
201 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
178 is useful for others as well).
202 is useful for others as well).
179
203
180 * iplib.py: on callable aliases (as opposed to old style aliases),
204 * iplib.py: on callable aliases (as opposed to old style aliases),
181 do var_expand() immediately, and use make_quoted_expr instead
205 do var_expand() immediately, and use make_quoted_expr instead
182 of hardcoded r"""
206 of hardcoded r"""
183
207
184 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
208 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
185 if not available load ipy_fsops.py for cp, mv, etc. replacements
209 if not available load ipy_fsops.py for cp, mv, etc. replacements
186
210
187 * OInspect.py, ipy_which.py: improve %which and obj? for callable
211 * OInspect.py, ipy_which.py: improve %which and obj? for callable
188 aliases
212 aliases
189
213
190 2007-09-04 Ville Vainio <vivainio@gmail.com>
214 2007-09-04 Ville Vainio <vivainio@gmail.com>
191
215
192 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
216 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
193 Relicensed under BSD with the authors approval.
217 Relicensed under BSD with the authors approval.
194
218
195 * ipmaker.py, usage.py: Remove %magic from default banner, improve
219 * ipmaker.py, usage.py: Remove %magic from default banner, improve
196 %quickref
220 %quickref
197
221
198 2007-09-03 Ville Vainio <vivainio@gmail.com>
222 2007-09-03 Ville Vainio <vivainio@gmail.com>
199
223
200 * Magic.py: %time now passes expression through prefilter,
224 * Magic.py: %time now passes expression through prefilter,
201 allowing IPython syntax.
225 allowing IPython syntax.
202
226
203 2007-09-01 Ville Vainio <vivainio@gmail.com>
227 2007-09-01 Ville Vainio <vivainio@gmail.com>
204
228
205 * ipmaker.py: Always show full traceback when newstyle config fails
229 * ipmaker.py: Always show full traceback when newstyle config fails
206
230
207 2007-08-27 Ville Vainio <vivainio@gmail.com>
231 2007-08-27 Ville Vainio <vivainio@gmail.com>
208
232
209 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
233 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
210
234
211 2007-08-26 Ville Vainio <vivainio@gmail.com>
235 2007-08-26 Ville Vainio <vivainio@gmail.com>
212
236
213 * ipmaker.py: Command line args have the highest priority again
237 * ipmaker.py: Command line args have the highest priority again
214
238
215 * iplib.py, ipmaker.py: -i command line argument now behaves as in
239 * iplib.py, ipmaker.py: -i command line argument now behaves as in
216 normal python, i.e. leaves the IPython session running after -c
240 normal python, i.e. leaves the IPython session running after -c
217 command or running a batch file from command line.
241 command or running a batch file from command line.
218
242
219 2007-08-22 Ville Vainio <vivainio@gmail.com>
243 2007-08-22 Ville Vainio <vivainio@gmail.com>
220
244
221 * iplib.py: no extra empty (last) line in raw hist w/ multiline
245 * iplib.py: no extra empty (last) line in raw hist w/ multiline
222 statements
246 statements
223
247
224 * logger.py: Fix bug where blank lines in history were not
248 * logger.py: Fix bug where blank lines in history were not
225 added until AFTER adding the current line; translated and raw
249 added until AFTER adding the current line; translated and raw
226 history should finally be in sync with prompt now.
250 history should finally be in sync with prompt now.
227
251
228 * ipy_completers.py: quick_completer now makes it easy to create
252 * ipy_completers.py: quick_completer now makes it easy to create
229 trivial custom completers
253 trivial custom completers
230
254
231 * clearcmd.py: shadow history compression & erasing, fixed input hist
255 * clearcmd.py: shadow history compression & erasing, fixed input hist
232 clearing.
256 clearing.
233
257
234 * envpersist.py, history.py: %env (sh profile only), %hist completers
258 * envpersist.py, history.py: %env (sh profile only), %hist completers
235
259
236 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
260 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
237 term title now include the drive letter, and always use / instead of
261 term title now include the drive letter, and always use / instead of
238 os.sep (as per recommended approach for win32 ipython in general).
262 os.sep (as per recommended approach for win32 ipython in general).
239
263
240 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
264 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
241 plain python scripts from ipykit command line by running
265 plain python scripts from ipykit command line by running
242 "py myscript.py", even w/o installed python.
266 "py myscript.py", even w/o installed python.
243
267
244 2007-08-21 Ville Vainio <vivainio@gmail.com>
268 2007-08-21 Ville Vainio <vivainio@gmail.com>
245
269
246 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
270 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
247 (for backwards compatibility)
271 (for backwards compatibility)
248
272
249 * history.py: switch back to %hist -t from %hist -r as default.
273 * history.py: switch back to %hist -t from %hist -r as default.
250 At least until raw history is fixed for good.
274 At least until raw history is fixed for good.
251
275
252 2007-08-20 Ville Vainio <vivainio@gmail.com>
276 2007-08-20 Ville Vainio <vivainio@gmail.com>
253
277
254 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
278 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
255 locate alias redeclarations etc. Also, avoid handling
279 locate alias redeclarations etc. Also, avoid handling
256 _ip.IP.alias_table directly, prefer using _ip.defalias.
280 _ip.IP.alias_table directly, prefer using _ip.defalias.
257
281
258
282
259 2007-08-15 Ville Vainio <vivainio@gmail.com>
283 2007-08-15 Ville Vainio <vivainio@gmail.com>
260
284
261 * prefilter.py: ! is now always served first
285 * prefilter.py: ! is now always served first
262
286
263 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
287 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
264
288
265 * IPython/iplib.py (safe_execfile): fix the SystemExit
289 * IPython/iplib.py (safe_execfile): fix the SystemExit
266 auto-suppression code to work in Python2.4 (the internal structure
290 auto-suppression code to work in Python2.4 (the internal structure
267 of that exception changed and I'd only tested the code with 2.5).
291 of that exception changed and I'd only tested the code with 2.5).
268 Bug reported by a SciPy attendee.
292 Bug reported by a SciPy attendee.
269
293
270 2007-08-13 Ville Vainio <vivainio@gmail.com>
294 2007-08-13 Ville Vainio <vivainio@gmail.com>
271
295
272 * prefilter.py: reverted !c:/bin/foo fix, made % in
296 * prefilter.py: reverted !c:/bin/foo fix, made % in
273 multiline specials work again
297 multiline specials work again
274
298
275 2007-08-13 Ville Vainio <vivainio@gmail.com>
299 2007-08-13 Ville Vainio <vivainio@gmail.com>
276
300
277 * prefilter.py: Take more care to special-case !, so that
301 * prefilter.py: Take more care to special-case !, so that
278 !c:/bin/foo.exe works.
302 !c:/bin/foo.exe works.
279
303
280 * setup.py: if we are building eggs, strip all docs and
304 * setup.py: if we are building eggs, strip all docs and
281 examples (it doesn't make sense to bytecompile examples,
305 examples (it doesn't make sense to bytecompile examples,
282 and docs would be in an awkward place anyway).
306 and docs would be in an awkward place anyway).
283
307
284 * Ryan Krauss' patch fixes start menu shortcuts when IPython
308 * Ryan Krauss' patch fixes start menu shortcuts when IPython
285 is installed into a directory that has spaces in the name.
309 is installed into a directory that has spaces in the name.
286
310
287 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
311 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
288
312
289 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
313 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
290 doctest profile and %doctest_mode, so they actually generate the
314 doctest profile and %doctest_mode, so they actually generate the
291 blank lines needed by doctest to separate individual tests.
315 blank lines needed by doctest to separate individual tests.
292
316
293 * IPython/iplib.py (safe_execfile): modify so that running code
317 * IPython/iplib.py (safe_execfile): modify so that running code
294 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
318 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
295 doesn't get a printed traceback. Any other value in sys.exit(),
319 doesn't get a printed traceback. Any other value in sys.exit(),
296 including the empty call, still generates a traceback. This
320 including the empty call, still generates a traceback. This
297 enables use of %run without having to pass '-e' for codes that
321 enables use of %run without having to pass '-e' for codes that
298 correctly set the exit status flag.
322 correctly set the exit status flag.
299
323
300 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
324 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
301
325
302 * IPython/iplib.py (InteractiveShell.post_config_initialization):
326 * IPython/iplib.py (InteractiveShell.post_config_initialization):
303 fix problems with doctests failing when run inside IPython due to
327 fix problems with doctests failing when run inside IPython due to
304 IPython's modifications of sys.displayhook.
328 IPython's modifications of sys.displayhook.
305
329
306 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
330 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
307
331
308 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
332 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
309 a string with names.
333 a string with names.
310
334
311 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
335 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
312
336
313 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
337 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
314 magic to toggle on/off the doctest pasting support without having
338 magic to toggle on/off the doctest pasting support without having
315 to leave a session to switch to a separate profile.
339 to leave a session to switch to a separate profile.
316
340
317 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
341 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
318
342
319 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
343 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
320 introduce a blank line between inputs, to conform to doctest
344 introduce a blank line between inputs, to conform to doctest
321 requirements.
345 requirements.
322
346
323 * IPython/OInspect.py (Inspector.pinfo): fix another part where
347 * IPython/OInspect.py (Inspector.pinfo): fix another part where
324 auto-generated docstrings for new-style classes were showing up.
348 auto-generated docstrings for new-style classes were showing up.
325
349
326 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
350 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
327
351
328 * api_changes: Add new file to track backward-incompatible
352 * api_changes: Add new file to track backward-incompatible
329 user-visible changes.
353 user-visible changes.
330
354
331 2007-08-06 Ville Vainio <vivainio@gmail.com>
355 2007-08-06 Ville Vainio <vivainio@gmail.com>
332
356
333 * ipmaker.py: fix bug where user_config_ns didn't exist at all
357 * ipmaker.py: fix bug where user_config_ns didn't exist at all
334 before all the config files were handled.
358 before all the config files were handled.
335
359
336 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
360 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
337
361
338 * IPython/irunner.py (RunnerFactory): Add new factory class for
362 * IPython/irunner.py (RunnerFactory): Add new factory class for
339 creating reusable runners based on filenames.
363 creating reusable runners based on filenames.
340
364
341 * IPython/Extensions/ipy_profile_doctest.py: New profile for
365 * IPython/Extensions/ipy_profile_doctest.py: New profile for
342 doctest support. It sets prompts/exceptions as similar to
366 doctest support. It sets prompts/exceptions as similar to
343 standard Python as possible, so that ipython sessions in this
367 standard Python as possible, so that ipython sessions in this
344 profile can be easily pasted as doctests with minimal
368 profile can be easily pasted as doctests with minimal
345 modifications. It also enables pasting of doctests from external
369 modifications. It also enables pasting of doctests from external
346 sources (even if they have leading whitespace), so that you can
370 sources (even if they have leading whitespace), so that you can
347 rerun doctests from existing sources.
371 rerun doctests from existing sources.
348
372
349 * IPython/iplib.py (_prefilter): fix a buglet where after entering
373 * IPython/iplib.py (_prefilter): fix a buglet where after entering
350 some whitespace, the prompt would become a continuation prompt
374 some whitespace, the prompt would become a continuation prompt
351 with no way of exiting it other than Ctrl-C. This fix brings us
375 with no way of exiting it other than Ctrl-C. This fix brings us
352 into conformity with how the default python prompt works.
376 into conformity with how the default python prompt works.
353
377
354 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
378 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
355 Add support for pasting not only lines that start with '>>>', but
379 Add support for pasting not only lines that start with '>>>', but
356 also with ' >>>'. That is, arbitrary whitespace can now precede
380 also with ' >>>'. That is, arbitrary whitespace can now precede
357 the prompts. This makes the system useful for pasting doctests
381 the prompts. This makes the system useful for pasting doctests
358 from docstrings back into a normal session.
382 from docstrings back into a normal session.
359
383
360 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
384 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
361
385
362 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
386 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
363 r1357, which had killed multiple invocations of an embedded
387 r1357, which had killed multiple invocations of an embedded
364 ipython (this means that example-embed has been broken for over 1
388 ipython (this means that example-embed has been broken for over 1
365 year!!!). Rather than possibly breaking the batch stuff for which
389 year!!!). Rather than possibly breaking the batch stuff for which
366 the code in iplib.py/interact was introduced, I worked around the
390 the code in iplib.py/interact was introduced, I worked around the
367 problem in the embedding class in Shell.py. We really need a
391 problem in the embedding class in Shell.py. We really need a
368 bloody test suite for this code, I'm sick of finding stuff that
392 bloody test suite for this code, I'm sick of finding stuff that
369 used to work breaking left and right every time I use an old
393 used to work breaking left and right every time I use an old
370 feature I hadn't touched in a few months.
394 feature I hadn't touched in a few months.
371 (kill_embedded): Add a new magic that only shows up in embedded
395 (kill_embedded): Add a new magic that only shows up in embedded
372 mode, to allow users to permanently deactivate an embedded instance.
396 mode, to allow users to permanently deactivate an embedded instance.
373
397
374 2007-08-01 Ville Vainio <vivainio@gmail.com>
398 2007-08-01 Ville Vainio <vivainio@gmail.com>
375
399
376 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
400 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
377 history gets out of sync on runlines (e.g. when running macros).
401 history gets out of sync on runlines (e.g. when running macros).
378
402
379 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
403 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
380
404
381 * IPython/Magic.py (magic_colors): fix win32-related error message
405 * IPython/Magic.py (magic_colors): fix win32-related error message
382 that could appear under *nix when readline was missing. Patch by
406 that could appear under *nix when readline was missing. Patch by
383 Scott Jackson, closes #175.
407 Scott Jackson, closes #175.
384
408
385 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
409 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
386
410
387 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
411 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
388 completer that it traits-aware, so that traits objects don't show
412 completer that it traits-aware, so that traits objects don't show
389 all of their internal attributes all the time.
413 all of their internal attributes all the time.
390
414
391 * IPython/genutils.py (dir2): moved this code from inside
415 * IPython/genutils.py (dir2): moved this code from inside
392 completer.py to expose it publicly, so I could use it in the
416 completer.py to expose it publicly, so I could use it in the
393 wildcards bugfix.
417 wildcards bugfix.
394
418
395 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
419 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
396 Stefan with Traits.
420 Stefan with Traits.
397
421
398 * IPython/completer.py (Completer.attr_matches): change internal
422 * IPython/completer.py (Completer.attr_matches): change internal
399 var name from 'object' to 'obj', since 'object' is now a builtin
423 var name from 'object' to 'obj', since 'object' is now a builtin
400 and this can lead to weird bugs if reusing this code elsewhere.
424 and this can lead to weird bugs if reusing this code elsewhere.
401
425
402 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
426 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
403
427
404 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
428 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
405 'foo?' and update the code to prevent printing of default
429 'foo?' and update the code to prevent printing of default
406 docstrings that started appearing after I added support for
430 docstrings that started appearing after I added support for
407 new-style classes. The approach I'm using isn't ideal (I just
431 new-style classes. The approach I'm using isn't ideal (I just
408 special-case those strings) but I'm not sure how to more robustly
432 special-case those strings) but I'm not sure how to more robustly
409 differentiate between truly user-written strings and Python's
433 differentiate between truly user-written strings and Python's
410 automatic ones.
434 automatic ones.
411
435
412 2007-07-09 Ville Vainio <vivainio@gmail.com>
436 2007-07-09 Ville Vainio <vivainio@gmail.com>
413
437
414 * completer.py: Applied Matthew Neeley's patch:
438 * completer.py: Applied Matthew Neeley's patch:
415 Dynamic attributes from trait_names and _getAttributeNames are added
439 Dynamic attributes from trait_names and _getAttributeNames are added
416 to the list of tab completions, but when this happens, the attribute
440 to the list of tab completions, but when this happens, the attribute
417 list is turned into a set, so the attributes are unordered when
441 list is turned into a set, so the attributes are unordered when
418 printed, which makes it hard to find the right completion. This patch
442 printed, which makes it hard to find the right completion. This patch
419 turns this set back into a list and sort it.
443 turns this set back into a list and sort it.
420
444
421 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
445 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
422
446
423 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
447 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
424 classes in various inspector functions.
448 classes in various inspector functions.
425
449
426 2007-06-28 Ville Vainio <vivainio@gmail.com>
450 2007-06-28 Ville Vainio <vivainio@gmail.com>
427
451
428 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
452 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
429 Implement "shadow" namespace, and callable aliases that reside there.
453 Implement "shadow" namespace, and callable aliases that reside there.
430 Use them by:
454 Use them by:
431
455
432 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
456 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
433
457
434 foo hello world
458 foo hello world
435 (gets translated to:)
459 (gets translated to:)
436 _sh.foo(r"""hello world""")
460 _sh.foo(r"""hello world""")
437
461
438 In practice, this kind of alias can take the role of a magic function
462 In practice, this kind of alias can take the role of a magic function
439
463
440 * New generic inspect_object, called on obj? and obj??
464 * New generic inspect_object, called on obj? and obj??
441
465
442 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
466 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
443
467
444 * IPython/ultraTB.py (findsource): fix a problem with
468 * IPython/ultraTB.py (findsource): fix a problem with
445 inspect.getfile that can cause crashes during traceback construction.
469 inspect.getfile that can cause crashes during traceback construction.
446
470
447 2007-06-14 Ville Vainio <vivainio@gmail.com>
471 2007-06-14 Ville Vainio <vivainio@gmail.com>
448
472
449 * iplib.py (handle_auto): Try to use ascii for printing "--->"
473 * iplib.py (handle_auto): Try to use ascii for printing "--->"
450 autocall rewrite indication, becausesometimes unicode fails to print
474 autocall rewrite indication, becausesometimes unicode fails to print
451 properly (and you get ' - - - '). Use plain uncoloured ---> for
475 properly (and you get ' - - - '). Use plain uncoloured ---> for
452 unicode.
476 unicode.
453
477
454 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
478 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
455
479
456 . pickleshare 'hash' commands (hget, hset, hcompress,
480 . pickleshare 'hash' commands (hget, hset, hcompress,
457 hdict) for efficient shadow history storage.
481 hdict) for efficient shadow history storage.
458
482
459 2007-06-13 Ville Vainio <vivainio@gmail.com>
483 2007-06-13 Ville Vainio <vivainio@gmail.com>
460
484
461 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
485 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
462 Added kw arg 'interactive', tell whether vars should be visible
486 Added kw arg 'interactive', tell whether vars should be visible
463 with %whos.
487 with %whos.
464
488
465 2007-06-11 Ville Vainio <vivainio@gmail.com>
489 2007-06-11 Ville Vainio <vivainio@gmail.com>
466
490
467 * pspersistence.py, Magic.py, iplib.py: directory history now saved
491 * pspersistence.py, Magic.py, iplib.py: directory history now saved
468 to db
492 to db
469
493
470 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
494 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
471 Also, it exits IPython immediately after evaluating the command (just like
495 Also, it exits IPython immediately after evaluating the command (just like
472 std python)
496 std python)
473
497
474 2007-06-05 Walter Doerwald <walter@livinglogic.de>
498 2007-06-05 Walter Doerwald <walter@livinglogic.de>
475
499
476 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
500 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
477 Python string and captures the output. (Idea and original patch by
501 Python string and captures the output. (Idea and original patch by
478 Stefan van der Walt)
502 Stefan van der Walt)
479
503
480 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
504 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
481
505
482 * IPython/ultraTB.py (VerboseTB.text): update printing of
506 * IPython/ultraTB.py (VerboseTB.text): update printing of
483 exception types for Python 2.5 (now all exceptions in the stdlib
507 exception types for Python 2.5 (now all exceptions in the stdlib
484 are new-style classes).
508 are new-style classes).
485
509
486 2007-05-31 Walter Doerwald <walter@livinglogic.de>
510 2007-05-31 Walter Doerwald <walter@livinglogic.de>
487
511
488 * IPython/Extensions/igrid.py: Add new commands refresh and
512 * IPython/Extensions/igrid.py: Add new commands refresh and
489 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
513 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
490 the iterator once (refresh) or after every x seconds (refresh_timer).
514 the iterator once (refresh) or after every x seconds (refresh_timer).
491 Add a working implementation of "searchexpression", where the text
515 Add a working implementation of "searchexpression", where the text
492 entered is not the text to search for, but an expression that must
516 entered is not the text to search for, but an expression that must
493 be true. Added display of shortcuts to the menu. Added commands "pickinput"
517 be true. Added display of shortcuts to the menu. Added commands "pickinput"
494 and "pickinputattr" that put the object or attribute under the cursor
518 and "pickinputattr" that put the object or attribute under the cursor
495 in the input line. Split the statusbar to be able to display the currently
519 in the input line. Split the statusbar to be able to display the currently
496 active refresh interval. (Patch by Nik Tautenhahn)
520 active refresh interval. (Patch by Nik Tautenhahn)
497
521
498 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
522 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
499
523
500 * fixing set_term_title to use ctypes as default
524 * fixing set_term_title to use ctypes as default
501
525
502 * fixing set_term_title fallback to work when curent dir
526 * fixing set_term_title fallback to work when curent dir
503 is on a windows network share
527 is on a windows network share
504
528
505 2007-05-28 Ville Vainio <vivainio@gmail.com>
529 2007-05-28 Ville Vainio <vivainio@gmail.com>
506
530
507 * %cpaste: strip + with > from left (diffs).
531 * %cpaste: strip + with > from left (diffs).
508
532
509 * iplib.py: Fix crash when readline not installed
533 * iplib.py: Fix crash when readline not installed
510
534
511 2007-05-26 Ville Vainio <vivainio@gmail.com>
535 2007-05-26 Ville Vainio <vivainio@gmail.com>
512
536
513 * generics.py: intruduce easy to extend result_display generic
537 * generics.py: intruduce easy to extend result_display generic
514 function (using simplegeneric.py).
538 function (using simplegeneric.py).
515
539
516 * Fixed the append functionality of %set.
540 * Fixed the append functionality of %set.
517
541
518 2007-05-25 Ville Vainio <vivainio@gmail.com>
542 2007-05-25 Ville Vainio <vivainio@gmail.com>
519
543
520 * New magic: %rep (fetch / run old commands from history)
544 * New magic: %rep (fetch / run old commands from history)
521
545
522 * New extension: mglob (%mglob magic), for powerful glob / find /filter
546 * New extension: mglob (%mglob magic), for powerful glob / find /filter
523 like functionality
547 like functionality
524
548
525 % maghistory.py: %hist -g PATTERM greps the history for pattern
549 % maghistory.py: %hist -g PATTERM greps the history for pattern
526
550
527 2007-05-24 Walter Doerwald <walter@livinglogic.de>
551 2007-05-24 Walter Doerwald <walter@livinglogic.de>
528
552
529 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
553 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
530 browse the IPython input history
554 browse the IPython input history
531
555
532 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
556 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
533 (mapped to "i") can be used to put the object under the curser in the input
557 (mapped to "i") can be used to put the object under the curser in the input
534 line. pickinputattr (mapped to "I") does the same for the attribute under
558 line. pickinputattr (mapped to "I") does the same for the attribute under
535 the cursor.
559 the cursor.
536
560
537 2007-05-24 Ville Vainio <vivainio@gmail.com>
561 2007-05-24 Ville Vainio <vivainio@gmail.com>
538
562
539 * Grand magic cleansing (changeset [2380]):
563 * Grand magic cleansing (changeset [2380]):
540
564
541 * Introduce ipy_legacy.py where the following magics were
565 * Introduce ipy_legacy.py where the following magics were
542 moved:
566 moved:
543
567
544 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
568 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
545
569
546 If you need them, either use default profile or "import ipy_legacy"
570 If you need them, either use default profile or "import ipy_legacy"
547 in your ipy_user_conf.py
571 in your ipy_user_conf.py
548
572
549 * Move sh and scipy profile to Extensions from UserConfig. this implies
573 * Move sh and scipy profile to Extensions from UserConfig. this implies
550 you should not edit them, but you don't need to run %upgrade when
574 you should not edit them, but you don't need to run %upgrade when
551 upgrading IPython anymore.
575 upgrading IPython anymore.
552
576
553 * %hist/%history now operates in "raw" mode by default. To get the old
577 * %hist/%history now operates in "raw" mode by default. To get the old
554 behaviour, run '%hist -n' (native mode).
578 behaviour, run '%hist -n' (native mode).
555
579
556 * split ipy_stock_completers.py to ipy_stock_completers.py and
580 * split ipy_stock_completers.py to ipy_stock_completers.py and
557 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
581 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
558 installed as default.
582 installed as default.
559
583
560 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
584 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
561 handling.
585 handling.
562
586
563 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
587 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
564 input if readline is available.
588 input if readline is available.
565
589
566 2007-05-23 Ville Vainio <vivainio@gmail.com>
590 2007-05-23 Ville Vainio <vivainio@gmail.com>
567
591
568 * macro.py: %store uses __getstate__ properly
592 * macro.py: %store uses __getstate__ properly
569
593
570 * exesetup.py: added new setup script for creating
594 * exesetup.py: added new setup script for creating
571 standalone IPython executables with py2exe (i.e.
595 standalone IPython executables with py2exe (i.e.
572 no python installation required).
596 no python installation required).
573
597
574 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
598 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
575 its place.
599 its place.
576
600
577 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
601 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
578
602
579 2007-05-21 Ville Vainio <vivainio@gmail.com>
603 2007-05-21 Ville Vainio <vivainio@gmail.com>
580
604
581 * platutil_win32.py (set_term_title): handle
605 * platutil_win32.py (set_term_title): handle
582 failure of 'title' system call properly.
606 failure of 'title' system call properly.
583
607
584 2007-05-17 Walter Doerwald <walter@livinglogic.de>
608 2007-05-17 Walter Doerwald <walter@livinglogic.de>
585
609
586 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
610 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
587 (Bug detected by Paul Mueller).
611 (Bug detected by Paul Mueller).
588
612
589 2007-05-16 Ville Vainio <vivainio@gmail.com>
613 2007-05-16 Ville Vainio <vivainio@gmail.com>
590
614
591 * ipy_profile_sci.py, ipython_win_post_install.py: Create
615 * ipy_profile_sci.py, ipython_win_post_install.py: Create
592 new "sci" profile, effectively a modern version of the old
616 new "sci" profile, effectively a modern version of the old
593 "scipy" profile (which is now slated for deprecation).
617 "scipy" profile (which is now slated for deprecation).
594
618
595 2007-05-15 Ville Vainio <vivainio@gmail.com>
619 2007-05-15 Ville Vainio <vivainio@gmail.com>
596
620
597 * pycolorize.py, pycolor.1: Paul Mueller's patches that
621 * pycolorize.py, pycolor.1: Paul Mueller's patches that
598 make pycolorize read input from stdin when run without arguments.
622 make pycolorize read input from stdin when run without arguments.
599
623
600 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
624 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
601
625
602 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
626 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
603 it in sh profile (instead of ipy_system_conf.py).
627 it in sh profile (instead of ipy_system_conf.py).
604
628
605 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
629 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
606 aliases are now lower case on windows (MyCommand.exe => mycommand).
630 aliases are now lower case on windows (MyCommand.exe => mycommand).
607
631
608 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
632 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
609 Macros are now callable objects that inherit from ipapi.IPyAutocall,
633 Macros are now callable objects that inherit from ipapi.IPyAutocall,
610 i.e. get autocalled regardless of system autocall setting.
634 i.e. get autocalled regardless of system autocall setting.
611
635
612 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
636 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
613
637
614 * IPython/rlineimpl.py: check for clear_history in readline and
638 * IPython/rlineimpl.py: check for clear_history in readline and
615 make it a dummy no-op if not available. This function isn't
639 make it a dummy no-op if not available. This function isn't
616 guaranteed to be in the API and appeared in Python 2.4, so we need
640 guaranteed to be in the API and appeared in Python 2.4, so we need
617 to check it ourselves. Also, clean up this file quite a bit.
641 to check it ourselves. Also, clean up this file quite a bit.
618
642
619 * ipython.1: update man page and full manual with information
643 * ipython.1: update man page and full manual with information
620 about threads (remove outdated warning). Closes #151.
644 about threads (remove outdated warning). Closes #151.
621
645
622 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
646 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
623
647
624 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
648 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
625 in trunk (note that this made it into the 0.8.1 release already,
649 in trunk (note that this made it into the 0.8.1 release already,
626 but the changelogs didn't get coordinated). Many thanks to Gael
650 but the changelogs didn't get coordinated). Many thanks to Gael
627 Varoquaux <gael.varoquaux-AT-normalesup.org>
651 Varoquaux <gael.varoquaux-AT-normalesup.org>
628
652
629 2007-05-09 *** Released version 0.8.1
653 2007-05-09 *** Released version 0.8.1
630
654
631 2007-05-10 Walter Doerwald <walter@livinglogic.de>
655 2007-05-10 Walter Doerwald <walter@livinglogic.de>
632
656
633 * IPython/Extensions/igrid.py: Incorporate html help into
657 * IPython/Extensions/igrid.py: Incorporate html help into
634 the module, so we don't have to search for the file.
658 the module, so we don't have to search for the file.
635
659
636 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
660 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
637
661
638 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
662 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
639
663
640 2007-04-30 Ville Vainio <vivainio@gmail.com>
664 2007-04-30 Ville Vainio <vivainio@gmail.com>
641
665
642 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
666 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
643 user has illegal (non-ascii) home directory name
667 user has illegal (non-ascii) home directory name
644
668
645 2007-04-27 Ville Vainio <vivainio@gmail.com>
669 2007-04-27 Ville Vainio <vivainio@gmail.com>
646
670
647 * platutils_win32.py: implement set_term_title for windows
671 * platutils_win32.py: implement set_term_title for windows
648
672
649 * Update version number
673 * Update version number
650
674
651 * ipy_profile_sh.py: more informative prompt (2 dir levels)
675 * ipy_profile_sh.py: more informative prompt (2 dir levels)
652
676
653 2007-04-26 Walter Doerwald <walter@livinglogic.de>
677 2007-04-26 Walter Doerwald <walter@livinglogic.de>
654
678
655 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
679 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
656 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
680 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
657 bug discovered by Ville).
681 bug discovered by Ville).
658
682
659 2007-04-26 Ville Vainio <vivainio@gmail.com>
683 2007-04-26 Ville Vainio <vivainio@gmail.com>
660
684
661 * Extensions/ipy_completers.py: Olivier's module completer now
685 * Extensions/ipy_completers.py: Olivier's module completer now
662 saves the list of root modules if it takes > 4 secs on the first run.
686 saves the list of root modules if it takes > 4 secs on the first run.
663
687
664 * Magic.py (%rehashx): %rehashx now clears the completer cache
688 * Magic.py (%rehashx): %rehashx now clears the completer cache
665
689
666
690
667 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
691 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
668
692
669 * ipython.el: fix incorrect color scheme, reported by Stefan.
693 * ipython.el: fix incorrect color scheme, reported by Stefan.
670 Closes #149.
694 Closes #149.
671
695
672 * IPython/PyColorize.py (Parser.format2): fix state-handling
696 * IPython/PyColorize.py (Parser.format2): fix state-handling
673 logic. I still don't like how that code handles state, but at
697 logic. I still don't like how that code handles state, but at
674 least now it should be correct, if inelegant. Closes #146.
698 least now it should be correct, if inelegant. Closes #146.
675
699
676 2007-04-25 Ville Vainio <vivainio@gmail.com>
700 2007-04-25 Ville Vainio <vivainio@gmail.com>
677
701
678 * Extensions/ipy_which.py: added extension for %which magic, works
702 * Extensions/ipy_which.py: added extension for %which magic, works
679 a lot like unix 'which' but also finds and expands aliases, and
703 a lot like unix 'which' but also finds and expands aliases, and
680 allows wildcards.
704 allows wildcards.
681
705
682 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
706 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
683 as opposed to returning nothing.
707 as opposed to returning nothing.
684
708
685 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
709 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
686 ipy_stock_completers on default profile, do import on sh profile.
710 ipy_stock_completers on default profile, do import on sh profile.
687
711
688 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
712 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
689
713
690 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
714 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
691 like ipython.py foo.py which raised a IndexError.
715 like ipython.py foo.py which raised a IndexError.
692
716
693 2007-04-21 Ville Vainio <vivainio@gmail.com>
717 2007-04-21 Ville Vainio <vivainio@gmail.com>
694
718
695 * Extensions/ipy_extutil.py: added extension to manage other ipython
719 * Extensions/ipy_extutil.py: added extension to manage other ipython
696 extensions. Now only supports 'ls' == list extensions.
720 extensions. Now only supports 'ls' == list extensions.
697
721
698 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
722 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
699
723
700 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
724 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
701 would prevent use of the exception system outside of a running
725 would prevent use of the exception system outside of a running
702 IPython instance.
726 IPython instance.
703
727
704 2007-04-20 Ville Vainio <vivainio@gmail.com>
728 2007-04-20 Ville Vainio <vivainio@gmail.com>
705
729
706 * Extensions/ipy_render.py: added extension for easy
730 * Extensions/ipy_render.py: added extension for easy
707 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
731 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
708 'Iptl' template notation,
732 'Iptl' template notation,
709
733
710 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
734 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
711 safer & faster 'import' completer.
735 safer & faster 'import' completer.
712
736
713 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
737 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
714 and _ip.defalias(name, command).
738 and _ip.defalias(name, command).
715
739
716 * Extensions/ipy_exportdb.py: New extension for exporting all the
740 * Extensions/ipy_exportdb.py: New extension for exporting all the
717 %store'd data in a portable format (normal ipapi calls like
741 %store'd data in a portable format (normal ipapi calls like
718 defmacro() etc.)
742 defmacro() etc.)
719
743
720 2007-04-19 Ville Vainio <vivainio@gmail.com>
744 2007-04-19 Ville Vainio <vivainio@gmail.com>
721
745
722 * upgrade_dir.py: skip junk files like *.pyc
746 * upgrade_dir.py: skip junk files like *.pyc
723
747
724 * Release.py: version number to 0.8.1
748 * Release.py: version number to 0.8.1
725
749
726 2007-04-18 Ville Vainio <vivainio@gmail.com>
750 2007-04-18 Ville Vainio <vivainio@gmail.com>
727
751
728 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
752 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
729 and later on win32.
753 and later on win32.
730
754
731 2007-04-16 Ville Vainio <vivainio@gmail.com>
755 2007-04-16 Ville Vainio <vivainio@gmail.com>
732
756
733 * iplib.py (showtraceback): Do not crash when running w/o readline.
757 * iplib.py (showtraceback): Do not crash when running w/o readline.
734
758
735 2007-04-12 Walter Doerwald <walter@livinglogic.de>
759 2007-04-12 Walter Doerwald <walter@livinglogic.de>
736
760
737 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
761 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
738 sorted (case sensitive with files and dirs mixed).
762 sorted (case sensitive with files and dirs mixed).
739
763
740 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
764 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
741
765
742 * IPython/Release.py (version): Open trunk for 0.8.1 development.
766 * IPython/Release.py (version): Open trunk for 0.8.1 development.
743
767
744 2007-04-10 *** Released version 0.8.0
768 2007-04-10 *** Released version 0.8.0
745
769
746 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
770 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
747
771
748 * Tag 0.8.0 for release.
772 * Tag 0.8.0 for release.
749
773
750 * IPython/iplib.py (reloadhist): add API function to cleanly
774 * IPython/iplib.py (reloadhist): add API function to cleanly
751 reload the readline history, which was growing inappropriately on
775 reload the readline history, which was growing inappropriately on
752 every %run call.
776 every %run call.
753
777
754 * win32_manual_post_install.py (run): apply last part of Nicolas
778 * win32_manual_post_install.py (run): apply last part of Nicolas
755 Pernetty's patch (I'd accidentally applied it in a different
779 Pernetty's patch (I'd accidentally applied it in a different
756 directory and this particular file didn't get patched).
780 directory and this particular file didn't get patched).
757
781
758 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
782 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
759
783
760 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
784 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
761 find the main thread id and use the proper API call. Thanks to
785 find the main thread id and use the proper API call. Thanks to
762 Stefan for the fix.
786 Stefan for the fix.
763
787
764 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
788 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
765 unit tests to reflect fixed ticket #52, and add more tests sent by
789 unit tests to reflect fixed ticket #52, and add more tests sent by
766 him.
790 him.
767
791
768 * IPython/iplib.py (raw_input): restore the readline completer
792 * IPython/iplib.py (raw_input): restore the readline completer
769 state on every input, in case third-party code messed it up.
793 state on every input, in case third-party code messed it up.
770 (_prefilter): revert recent addition of early-escape checks which
794 (_prefilter): revert recent addition of early-escape checks which
771 prevent many valid alias calls from working.
795 prevent many valid alias calls from working.
772
796
773 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
797 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
774 flag for sigint handler so we don't run a full signal() call on
798 flag for sigint handler so we don't run a full signal() call on
775 each runcode access.
799 each runcode access.
776
800
777 * IPython/Magic.py (magic_whos): small improvement to diagnostic
801 * IPython/Magic.py (magic_whos): small improvement to diagnostic
778 message.
802 message.
779
803
780 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
804 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
781
805
782 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
806 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
783 asynchronous exceptions working, i.e., Ctrl-C can actually
807 asynchronous exceptions working, i.e., Ctrl-C can actually
784 interrupt long-running code in the multithreaded shells.
808 interrupt long-running code in the multithreaded shells.
785
809
786 This is using Tomer Filiba's great ctypes-based trick:
810 This is using Tomer Filiba's great ctypes-based trick:
787 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
811 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
788 this in the past, but hadn't been able to make it work before. So
812 this in the past, but hadn't been able to make it work before. So
789 far it looks like it's actually running, but this needs more
813 far it looks like it's actually running, but this needs more
790 testing. If it really works, I'll be *very* happy, and we'll owe
814 testing. If it really works, I'll be *very* happy, and we'll owe
791 a huge thank you to Tomer. My current implementation is ugly,
815 a huge thank you to Tomer. My current implementation is ugly,
792 hackish and uses nasty globals, but I don't want to try and clean
816 hackish and uses nasty globals, but I don't want to try and clean
793 anything up until we know if it actually works.
817 anything up until we know if it actually works.
794
818
795 NOTE: this feature needs ctypes to work. ctypes is included in
819 NOTE: this feature needs ctypes to work. ctypes is included in
796 Python2.5, but 2.4 users will need to manually install it. This
820 Python2.5, but 2.4 users will need to manually install it. This
797 feature makes multi-threaded shells so much more usable that it's
821 feature makes multi-threaded shells so much more usable that it's
798 a minor price to pay (ctypes is very easy to install, already a
822 a minor price to pay (ctypes is very easy to install, already a
799 requirement for win32 and available in major linux distros).
823 requirement for win32 and available in major linux distros).
800
824
801 2007-04-04 Ville Vainio <vivainio@gmail.com>
825 2007-04-04 Ville Vainio <vivainio@gmail.com>
802
826
803 * Extensions/ipy_completers.py, ipy_stock_completers.py:
827 * Extensions/ipy_completers.py, ipy_stock_completers.py:
804 Moved implementations of 'bundled' completers to ipy_completers.py,
828 Moved implementations of 'bundled' completers to ipy_completers.py,
805 they are only enabled in ipy_stock_completers.py.
829 they are only enabled in ipy_stock_completers.py.
806
830
807 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
831 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
808
832
809 * IPython/PyColorize.py (Parser.format2): Fix identation of
833 * IPython/PyColorize.py (Parser.format2): Fix identation of
810 colorzied output and return early if color scheme is NoColor, to
834 colorzied output and return early if color scheme is NoColor, to
811 avoid unnecessary and expensive tokenization. Closes #131.
835 avoid unnecessary and expensive tokenization. Closes #131.
812
836
813 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
837 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
814
838
815 * IPython/Debugger.py: disable the use of pydb version 1.17. It
839 * IPython/Debugger.py: disable the use of pydb version 1.17. It
816 has a critical bug (a missing import that makes post-mortem not
840 has a critical bug (a missing import that makes post-mortem not
817 work at all). Unfortunately as of this time, this is the version
841 work at all). Unfortunately as of this time, this is the version
818 shipped with Ubuntu Edgy, so quite a few people have this one. I
842 shipped with Ubuntu Edgy, so quite a few people have this one. I
819 hope Edgy will update to a more recent package.
843 hope Edgy will update to a more recent package.
820
844
821 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
845 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
822
846
823 * IPython/iplib.py (_prefilter): close #52, second part of a patch
847 * IPython/iplib.py (_prefilter): close #52, second part of a patch
824 set by Stefan (only the first part had been applied before).
848 set by Stefan (only the first part had been applied before).
825
849
826 * IPython/Extensions/ipy_stock_completers.py (module_completer):
850 * IPython/Extensions/ipy_stock_completers.py (module_completer):
827 remove usage of the dangerous pkgutil.walk_packages(). See
851 remove usage of the dangerous pkgutil.walk_packages(). See
828 details in comments left in the code.
852 details in comments left in the code.
829
853
830 * IPython/Magic.py (magic_whos): add support for numpy arrays
854 * IPython/Magic.py (magic_whos): add support for numpy arrays
831 similar to what we had for Numeric.
855 similar to what we had for Numeric.
832
856
833 * IPython/completer.py (IPCompleter.complete): extend the
857 * IPython/completer.py (IPCompleter.complete): extend the
834 complete() call API to support completions by other mechanisms
858 complete() call API to support completions by other mechanisms
835 than readline. Closes #109.
859 than readline. Closes #109.
836
860
837 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
861 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
838 protect against a bug in Python's execfile(). Closes #123.
862 protect against a bug in Python's execfile(). Closes #123.
839
863
840 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
864 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
841
865
842 * IPython/iplib.py (split_user_input): ensure that when splitting
866 * IPython/iplib.py (split_user_input): ensure that when splitting
843 user input, the part that can be treated as a python name is pure
867 user input, the part that can be treated as a python name is pure
844 ascii (Python identifiers MUST be pure ascii). Part of the
868 ascii (Python identifiers MUST be pure ascii). Part of the
845 ongoing Unicode support work.
869 ongoing Unicode support work.
846
870
847 * IPython/Prompts.py (prompt_specials_color): Add \N for the
871 * IPython/Prompts.py (prompt_specials_color): Add \N for the
848 actual prompt number, without any coloring. This allows users to
872 actual prompt number, without any coloring. This allows users to
849 produce numbered prompts with their own colors. Added after a
873 produce numbered prompts with their own colors. Added after a
850 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
874 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
851
875
852 2007-03-31 Walter Doerwald <walter@livinglogic.de>
876 2007-03-31 Walter Doerwald <walter@livinglogic.de>
853
877
854 * IPython/Extensions/igrid.py: Map the return key
878 * IPython/Extensions/igrid.py: Map the return key
855 to enter() and shift-return to enterattr().
879 to enter() and shift-return to enterattr().
856
880
857 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
881 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
858
882
859 * IPython/Magic.py (magic_psearch): add unicode support by
883 * IPython/Magic.py (magic_psearch): add unicode support by
860 encoding to ascii the input, since this routine also only deals
884 encoding to ascii the input, since this routine also only deals
861 with valid Python names. Fixes a bug reported by Stefan.
885 with valid Python names. Fixes a bug reported by Stefan.
862
886
863 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
887 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
864
888
865 * IPython/Magic.py (_inspect): convert unicode input into ascii
889 * IPython/Magic.py (_inspect): convert unicode input into ascii
866 before trying to evaluate it as a Python identifier. This fixes a
890 before trying to evaluate it as a Python identifier. This fixes a
867 problem that the new unicode support had introduced when analyzing
891 problem that the new unicode support had introduced when analyzing
868 long definition lines for functions.
892 long definition lines for functions.
869
893
870 2007-03-24 Walter Doerwald <walter@livinglogic.de>
894 2007-03-24 Walter Doerwald <walter@livinglogic.de>
871
895
872 * IPython/Extensions/igrid.py: Fix picking. Using
896 * IPython/Extensions/igrid.py: Fix picking. Using
873 igrid with wxPython 2.6 and -wthread should work now.
897 igrid with wxPython 2.6 and -wthread should work now.
874 igrid.display() simply tries to create a frame without
898 igrid.display() simply tries to create a frame without
875 an application. Only if this fails an application is created.
899 an application. Only if this fails an application is created.
876
900
877 2007-03-23 Walter Doerwald <walter@livinglogic.de>
901 2007-03-23 Walter Doerwald <walter@livinglogic.de>
878
902
879 * IPython/Extensions/path.py: Updated to version 2.2.
903 * IPython/Extensions/path.py: Updated to version 2.2.
880
904
881 2007-03-23 Ville Vainio <vivainio@gmail.com>
905 2007-03-23 Ville Vainio <vivainio@gmail.com>
882
906
883 * iplib.py: recursive alias expansion now works better, so that
907 * iplib.py: recursive alias expansion now works better, so that
884 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
908 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
885 doesn't trip up the process, if 'd' has been aliased to 'ls'.
909 doesn't trip up the process, if 'd' has been aliased to 'ls'.
886
910
887 * Extensions/ipy_gnuglobal.py added, provides %global magic
911 * Extensions/ipy_gnuglobal.py added, provides %global magic
888 for users of http://www.gnu.org/software/global
912 for users of http://www.gnu.org/software/global
889
913
890 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
914 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
891 Closes #52. Patch by Stefan van der Walt.
915 Closes #52. Patch by Stefan van der Walt.
892
916
893 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
917 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
894
918
895 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
919 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
896 respect the __file__ attribute when using %run. Thanks to a bug
920 respect the __file__ attribute when using %run. Thanks to a bug
897 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
921 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
898
922
899 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
923 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
900
924
901 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
925 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
902 input. Patch sent by Stefan.
926 input. Patch sent by Stefan.
903
927
904 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
928 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
905 * IPython/Extensions/ipy_stock_completer.py
929 * IPython/Extensions/ipy_stock_completer.py
906 shlex_split, fix bug in shlex_split. len function
930 shlex_split, fix bug in shlex_split. len function
907 call was missing an if statement. Caused shlex_split to
931 call was missing an if statement. Caused shlex_split to
908 sometimes return "" as last element.
932 sometimes return "" as last element.
909
933
910 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
934 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
911
935
912 * IPython/completer.py
936 * IPython/completer.py
913 (IPCompleter.file_matches.single_dir_expand): fix a problem
937 (IPCompleter.file_matches.single_dir_expand): fix a problem
914 reported by Stefan, where directories containign a single subdir
938 reported by Stefan, where directories containign a single subdir
915 would be completed too early.
939 would be completed too early.
916
940
917 * IPython/Shell.py (_load_pylab): Make the execution of 'from
941 * IPython/Shell.py (_load_pylab): Make the execution of 'from
918 pylab import *' when -pylab is given be optional. A new flag,
942 pylab import *' when -pylab is given be optional. A new flag,
919 pylab_import_all controls this behavior, the default is True for
943 pylab_import_all controls this behavior, the default is True for
920 backwards compatibility.
944 backwards compatibility.
921
945
922 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
946 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
923 modified) R. Bernstein's patch for fully syntax highlighted
947 modified) R. Bernstein's patch for fully syntax highlighted
924 tracebacks. The functionality is also available under ultraTB for
948 tracebacks. The functionality is also available under ultraTB for
925 non-ipython users (someone using ultraTB but outside an ipython
949 non-ipython users (someone using ultraTB but outside an ipython
926 session). They can select the color scheme by setting the
950 session). They can select the color scheme by setting the
927 module-level global DEFAULT_SCHEME. The highlight functionality
951 module-level global DEFAULT_SCHEME. The highlight functionality
928 also works when debugging.
952 also works when debugging.
929
953
930 * IPython/genutils.py (IOStream.close): small patch by
954 * IPython/genutils.py (IOStream.close): small patch by
931 R. Bernstein for improved pydb support.
955 R. Bernstein for improved pydb support.
932
956
933 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
957 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
934 DaveS <davls@telus.net> to improve support of debugging under
958 DaveS <davls@telus.net> to improve support of debugging under
935 NTEmacs, including improved pydb behavior.
959 NTEmacs, including improved pydb behavior.
936
960
937 * IPython/Magic.py (magic_prun): Fix saving of profile info for
961 * IPython/Magic.py (magic_prun): Fix saving of profile info for
938 Python 2.5, where the stats object API changed a little. Thanks
962 Python 2.5, where the stats object API changed a little. Thanks
939 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
963 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
940
964
941 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
965 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
942 Pernetty's patch to improve support for (X)Emacs under Win32.
966 Pernetty's patch to improve support for (X)Emacs under Win32.
943
967
944 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
968 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
945
969
946 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
970 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
947 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
971 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
948 a report by Nik Tautenhahn.
972 a report by Nik Tautenhahn.
949
973
950 2007-03-16 Walter Doerwald <walter@livinglogic.de>
974 2007-03-16 Walter Doerwald <walter@livinglogic.de>
951
975
952 * setup.py: Add the igrid help files to the list of data files
976 * setup.py: Add the igrid help files to the list of data files
953 to be installed alongside igrid.
977 to be installed alongside igrid.
954 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
978 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
955 Show the input object of the igrid browser as the window tile.
979 Show the input object of the igrid browser as the window tile.
956 Show the object the cursor is on in the statusbar.
980 Show the object the cursor is on in the statusbar.
957
981
958 2007-03-15 Ville Vainio <vivainio@gmail.com>
982 2007-03-15 Ville Vainio <vivainio@gmail.com>
959
983
960 * Extensions/ipy_stock_completers.py: Fixed exception
984 * Extensions/ipy_stock_completers.py: Fixed exception
961 on mismatching quotes in %run completer. Patch by
985 on mismatching quotes in %run completer. Patch by
962 Jorgen Stenarson. Closes #127.
986 Jorgen Stenarson. Closes #127.
963
987
964 2007-03-14 Ville Vainio <vivainio@gmail.com>
988 2007-03-14 Ville Vainio <vivainio@gmail.com>
965
989
966 * Extensions/ext_rehashdir.py: Do not do auto_alias
990 * Extensions/ext_rehashdir.py: Do not do auto_alias
967 in %rehashdir, it clobbers %store'd aliases.
991 in %rehashdir, it clobbers %store'd aliases.
968
992
969 * UserConfig/ipy_profile_sh.py: envpersist.py extension
993 * UserConfig/ipy_profile_sh.py: envpersist.py extension
970 (beefed up %env) imported for sh profile.
994 (beefed up %env) imported for sh profile.
971
995
972 2007-03-10 Walter Doerwald <walter@livinglogic.de>
996 2007-03-10 Walter Doerwald <walter@livinglogic.de>
973
997
974 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
998 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
975 as the default browser.
999 as the default browser.
976 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1000 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
977 As igrid displays all attributes it ever encounters, fetch() (which has
1001 As igrid displays all attributes it ever encounters, fetch() (which has
978 been renamed to _fetch()) doesn't have to recalculate the display attributes
1002 been renamed to _fetch()) doesn't have to recalculate the display attributes
979 every time a new item is fetched. This should speed up scrolling.
1003 every time a new item is fetched. This should speed up scrolling.
980
1004
981 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1005 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
982
1006
983 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1007 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
984 Schmolck's recently reported tab-completion bug (my previous one
1008 Schmolck's recently reported tab-completion bug (my previous one
985 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1009 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
986
1010
987 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1011 2007-03-09 Walter Doerwald <walter@livinglogic.de>
988
1012
989 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1013 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
990 Close help window if exiting igrid.
1014 Close help window if exiting igrid.
991
1015
992 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1016 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
993
1017
994 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1018 * IPython/Extensions/ipy_defaults.py: Check if readline is available
995 before calling functions from readline.
1019 before calling functions from readline.
996
1020
997 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1021 2007-03-02 Walter Doerwald <walter@livinglogic.de>
998
1022
999 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1023 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1000 igrid is a wxPython-based display object for ipipe. If your system has
1024 igrid is a wxPython-based display object for ipipe. If your system has
1001 wx installed igrid will be the default display. Without wx ipipe falls
1025 wx installed igrid will be the default display. Without wx ipipe falls
1002 back to ibrowse (which needs curses). If no curses is installed ipipe
1026 back to ibrowse (which needs curses). If no curses is installed ipipe
1003 falls back to idump.
1027 falls back to idump.
1004
1028
1005 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1029 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1006
1030
1007 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1031 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1008 my changes from yesterday, they introduced bugs. Will reactivate
1032 my changes from yesterday, they introduced bugs. Will reactivate
1009 once I get a correct solution, which will be much easier thanks to
1033 once I get a correct solution, which will be much easier thanks to
1010 Dan Milstein's new prefilter test suite.
1034 Dan Milstein's new prefilter test suite.
1011
1035
1012 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1036 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1013
1037
1014 * IPython/iplib.py (split_user_input): fix input splitting so we
1038 * IPython/iplib.py (split_user_input): fix input splitting so we
1015 don't attempt attribute accesses on things that can't possibly be
1039 don't attempt attribute accesses on things that can't possibly be
1016 valid Python attributes. After a bug report by Alex Schmolck.
1040 valid Python attributes. After a bug report by Alex Schmolck.
1017 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1041 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1018 %magic with explicit % prefix.
1042 %magic with explicit % prefix.
1019
1043
1020 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1044 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1021
1045
1022 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1046 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1023 avoid a DeprecationWarning from GTK.
1047 avoid a DeprecationWarning from GTK.
1024
1048
1025 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1049 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1026
1050
1027 * IPython/genutils.py (clock): I modified clock() to return total
1051 * IPython/genutils.py (clock): I modified clock() to return total
1028 time, user+system. This is a more commonly needed metric. I also
1052 time, user+system. This is a more commonly needed metric. I also
1029 introduced the new clocku/clocks to get only user/system time if
1053 introduced the new clocku/clocks to get only user/system time if
1030 one wants those instead.
1054 one wants those instead.
1031
1055
1032 ***WARNING: API CHANGE*** clock() used to return only user time,
1056 ***WARNING: API CHANGE*** clock() used to return only user time,
1033 so if you want exactly the same results as before, use clocku
1057 so if you want exactly the same results as before, use clocku
1034 instead.
1058 instead.
1035
1059
1036 2007-02-22 Ville Vainio <vivainio@gmail.com>
1060 2007-02-22 Ville Vainio <vivainio@gmail.com>
1037
1061
1038 * IPython/Extensions/ipy_p4.py: Extension for improved
1062 * IPython/Extensions/ipy_p4.py: Extension for improved
1039 p4 (perforce version control system) experience.
1063 p4 (perforce version control system) experience.
1040 Adds %p4 magic with p4 command completion and
1064 Adds %p4 magic with p4 command completion and
1041 automatic -G argument (marshall output as python dict)
1065 automatic -G argument (marshall output as python dict)
1042
1066
1043 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1067 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1044
1068
1045 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1069 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1046 stop marks.
1070 stop marks.
1047 (ClearingMixin): a simple mixin to easily make a Demo class clear
1071 (ClearingMixin): a simple mixin to easily make a Demo class clear
1048 the screen in between blocks and have empty marquees. The
1072 the screen in between blocks and have empty marquees. The
1049 ClearDemo and ClearIPDemo classes that use it are included.
1073 ClearDemo and ClearIPDemo classes that use it are included.
1050
1074
1051 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1075 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1052
1076
1053 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1077 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1054 protect against exceptions at Python shutdown time. Patch
1078 protect against exceptions at Python shutdown time. Patch
1055 sumbmitted to upstream.
1079 sumbmitted to upstream.
1056
1080
1057 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1081 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1058
1082
1059 * IPython/Extensions/ibrowse.py: If entering the first object level
1083 * IPython/Extensions/ibrowse.py: If entering the first object level
1060 (i.e. the object for which the browser has been started) fails,
1084 (i.e. the object for which the browser has been started) fails,
1061 now the error is raised directly (aborting the browser) instead of
1085 now the error is raised directly (aborting the browser) instead of
1062 running into an empty levels list later.
1086 running into an empty levels list later.
1063
1087
1064 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1088 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1065
1089
1066 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1090 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1067 for the noitem object.
1091 for the noitem object.
1068
1092
1069 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1093 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1070
1094
1071 * IPython/completer.py (Completer.attr_matches): Fix small
1095 * IPython/completer.py (Completer.attr_matches): Fix small
1072 tab-completion bug with Enthought Traits objects with units.
1096 tab-completion bug with Enthought Traits objects with units.
1073 Thanks to a bug report by Tom Denniston
1097 Thanks to a bug report by Tom Denniston
1074 <tom.denniston-AT-alum.dartmouth.org>.
1098 <tom.denniston-AT-alum.dartmouth.org>.
1075
1099
1076 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1100 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1077
1101
1078 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1102 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1079 bug where only .ipy or .py would be completed. Once the first
1103 bug where only .ipy or .py would be completed. Once the first
1080 argument to %run has been given, all completions are valid because
1104 argument to %run has been given, all completions are valid because
1081 they are the arguments to the script, which may well be non-python
1105 they are the arguments to the script, which may well be non-python
1082 filenames.
1106 filenames.
1083
1107
1084 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1108 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1085 to irunner to allow it to correctly support real doctesting of
1109 to irunner to allow it to correctly support real doctesting of
1086 out-of-process ipython code.
1110 out-of-process ipython code.
1087
1111
1088 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1112 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1089 title an option (-noterm_title) because it completely breaks
1113 title an option (-noterm_title) because it completely breaks
1090 doctesting.
1114 doctesting.
1091
1115
1092 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1116 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1093
1117
1094 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1118 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1095
1119
1096 * IPython/irunner.py (main): fix small bug where extensions were
1120 * IPython/irunner.py (main): fix small bug where extensions were
1097 not being correctly recognized.
1121 not being correctly recognized.
1098
1122
1099 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1123 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1100
1124
1101 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1125 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1102 a string containing a single line yields the string itself as the
1126 a string containing a single line yields the string itself as the
1103 only item.
1127 only item.
1104
1128
1105 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1129 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1106 object if it's the same as the one on the last level (This avoids
1130 object if it's the same as the one on the last level (This avoids
1107 infinite recursion for one line strings).
1131 infinite recursion for one line strings).
1108
1132
1109 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1133 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1110
1134
1111 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1135 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1112 all output streams before printing tracebacks. This ensures that
1136 all output streams before printing tracebacks. This ensures that
1113 user output doesn't end up interleaved with traceback output.
1137 user output doesn't end up interleaved with traceback output.
1114
1138
1115 2007-01-10 Ville Vainio <vivainio@gmail.com>
1139 2007-01-10 Ville Vainio <vivainio@gmail.com>
1116
1140
1117 * Extensions/envpersist.py: Turbocharged %env that remembers
1141 * Extensions/envpersist.py: Turbocharged %env that remembers
1118 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1142 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1119 "%env VISUAL=jed".
1143 "%env VISUAL=jed".
1120
1144
1121 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1145 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1122
1146
1123 * IPython/iplib.py (showtraceback): ensure that we correctly call
1147 * IPython/iplib.py (showtraceback): ensure that we correctly call
1124 custom handlers in all cases (some with pdb were slipping through,
1148 custom handlers in all cases (some with pdb were slipping through,
1125 but I'm not exactly sure why).
1149 but I'm not exactly sure why).
1126
1150
1127 * IPython/Debugger.py (Tracer.__init__): added new class to
1151 * IPython/Debugger.py (Tracer.__init__): added new class to
1128 support set_trace-like usage of IPython's enhanced debugger.
1152 support set_trace-like usage of IPython's enhanced debugger.
1129
1153
1130 2006-12-24 Ville Vainio <vivainio@gmail.com>
1154 2006-12-24 Ville Vainio <vivainio@gmail.com>
1131
1155
1132 * ipmaker.py: more informative message when ipy_user_conf
1156 * ipmaker.py: more informative message when ipy_user_conf
1133 import fails (suggest running %upgrade).
1157 import fails (suggest running %upgrade).
1134
1158
1135 * tools/run_ipy_in_profiler.py: Utility to see where
1159 * tools/run_ipy_in_profiler.py: Utility to see where
1136 the time during IPython startup is spent.
1160 the time during IPython startup is spent.
1137
1161
1138 2006-12-20 Ville Vainio <vivainio@gmail.com>
1162 2006-12-20 Ville Vainio <vivainio@gmail.com>
1139
1163
1140 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1164 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1141
1165
1142 * ipapi.py: Add new ipapi method, expand_alias.
1166 * ipapi.py: Add new ipapi method, expand_alias.
1143
1167
1144 * Release.py: Bump up version to 0.7.4.svn
1168 * Release.py: Bump up version to 0.7.4.svn
1145
1169
1146 2006-12-17 Ville Vainio <vivainio@gmail.com>
1170 2006-12-17 Ville Vainio <vivainio@gmail.com>
1147
1171
1148 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1172 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1149 to work properly on posix too
1173 to work properly on posix too
1150
1174
1151 * Release.py: Update revnum (version is still just 0.7.3).
1175 * Release.py: Update revnum (version is still just 0.7.3).
1152
1176
1153 2006-12-15 Ville Vainio <vivainio@gmail.com>
1177 2006-12-15 Ville Vainio <vivainio@gmail.com>
1154
1178
1155 * scripts/ipython_win_post_install: create ipython.py in
1179 * scripts/ipython_win_post_install: create ipython.py in
1156 prefix + "/scripts".
1180 prefix + "/scripts".
1157
1181
1158 * Release.py: Update version to 0.7.3.
1182 * Release.py: Update version to 0.7.3.
1159
1183
1160 2006-12-14 Ville Vainio <vivainio@gmail.com>
1184 2006-12-14 Ville Vainio <vivainio@gmail.com>
1161
1185
1162 * scripts/ipython_win_post_install: Overwrite old shortcuts
1186 * scripts/ipython_win_post_install: Overwrite old shortcuts
1163 if they already exist
1187 if they already exist
1164
1188
1165 * Release.py: release 0.7.3rc2
1189 * Release.py: release 0.7.3rc2
1166
1190
1167 2006-12-13 Ville Vainio <vivainio@gmail.com>
1191 2006-12-13 Ville Vainio <vivainio@gmail.com>
1168
1192
1169 * Branch and update Release.py for 0.7.3rc1
1193 * Branch and update Release.py for 0.7.3rc1
1170
1194
1171 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1195 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1172
1196
1173 * IPython/Shell.py (IPShellWX): update for current WX naming
1197 * IPython/Shell.py (IPShellWX): update for current WX naming
1174 conventions, to avoid a deprecation warning with current WX
1198 conventions, to avoid a deprecation warning with current WX
1175 versions. Thanks to a report by Danny Shevitz.
1199 versions. Thanks to a report by Danny Shevitz.
1176
1200
1177 2006-12-12 Ville Vainio <vivainio@gmail.com>
1201 2006-12-12 Ville Vainio <vivainio@gmail.com>
1178
1202
1179 * ipmaker.py: apply david cournapeau's patch to make
1203 * ipmaker.py: apply david cournapeau's patch to make
1180 import_some work properly even when ipythonrc does
1204 import_some work properly even when ipythonrc does
1181 import_some on empty list (it was an old bug!).
1205 import_some on empty list (it was an old bug!).
1182
1206
1183 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1207 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1184 Add deprecation note to ipythonrc and a url to wiki
1208 Add deprecation note to ipythonrc and a url to wiki
1185 in ipy_user_conf.py
1209 in ipy_user_conf.py
1186
1210
1187
1211
1188 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1212 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1189 as if it was typed on IPython command prompt, i.e.
1213 as if it was typed on IPython command prompt, i.e.
1190 as IPython script.
1214 as IPython script.
1191
1215
1192 * example-magic.py, magic_grepl.py: remove outdated examples
1216 * example-magic.py, magic_grepl.py: remove outdated examples
1193
1217
1194 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1218 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1195
1219
1196 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1220 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1197 is called before any exception has occurred.
1221 is called before any exception has occurred.
1198
1222
1199 2006-12-08 Ville Vainio <vivainio@gmail.com>
1223 2006-12-08 Ville Vainio <vivainio@gmail.com>
1200
1224
1201 * Extensions/ipy_stock_completers.py: fix cd completer
1225 * Extensions/ipy_stock_completers.py: fix cd completer
1202 to translate /'s to \'s again.
1226 to translate /'s to \'s again.
1203
1227
1204 * completer.py: prevent traceback on file completions w/
1228 * completer.py: prevent traceback on file completions w/
1205 backslash.
1229 backslash.
1206
1230
1207 * Release.py: Update release number to 0.7.3b3 for release
1231 * Release.py: Update release number to 0.7.3b3 for release
1208
1232
1209 2006-12-07 Ville Vainio <vivainio@gmail.com>
1233 2006-12-07 Ville Vainio <vivainio@gmail.com>
1210
1234
1211 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1235 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1212 while executing external code. Provides more shell-like behaviour
1236 while executing external code. Provides more shell-like behaviour
1213 and overall better response to ctrl + C / ctrl + break.
1237 and overall better response to ctrl + C / ctrl + break.
1214
1238
1215 * tools/make_tarball.py: new script to create tarball straight from svn
1239 * tools/make_tarball.py: new script to create tarball straight from svn
1216 (setup.py sdist doesn't work on win32).
1240 (setup.py sdist doesn't work on win32).
1217
1241
1218 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1242 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1219 on dirnames with spaces and use the default completer instead.
1243 on dirnames with spaces and use the default completer instead.
1220
1244
1221 * Revision.py: Change version to 0.7.3b2 for release.
1245 * Revision.py: Change version to 0.7.3b2 for release.
1222
1246
1223 2006-12-05 Ville Vainio <vivainio@gmail.com>
1247 2006-12-05 Ville Vainio <vivainio@gmail.com>
1224
1248
1225 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1249 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1226 pydb patch 4 (rm debug printing, py 2.5 checking)
1250 pydb patch 4 (rm debug printing, py 2.5 checking)
1227
1251
1228 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1252 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1229 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1253 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1230 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1254 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1231 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1255 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1232 object the cursor was on before the refresh. The command "markrange" is
1256 object the cursor was on before the refresh. The command "markrange" is
1233 mapped to "%" now.
1257 mapped to "%" now.
1234 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1258 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1235
1259
1236 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1260 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1237
1261
1238 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1262 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1239 interactive debugger on the last traceback, without having to call
1263 interactive debugger on the last traceback, without having to call
1240 %pdb and rerun your code. Made minor changes in various modules,
1264 %pdb and rerun your code. Made minor changes in various modules,
1241 should automatically recognize pydb if available.
1265 should automatically recognize pydb if available.
1242
1266
1243 2006-11-28 Ville Vainio <vivainio@gmail.com>
1267 2006-11-28 Ville Vainio <vivainio@gmail.com>
1244
1268
1245 * completer.py: If the text start with !, show file completions
1269 * completer.py: If the text start with !, show file completions
1246 properly. This helps when trying to complete command name
1270 properly. This helps when trying to complete command name
1247 for shell escapes.
1271 for shell escapes.
1248
1272
1249 2006-11-27 Ville Vainio <vivainio@gmail.com>
1273 2006-11-27 Ville Vainio <vivainio@gmail.com>
1250
1274
1251 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1275 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1252 der Walt. Clean up svn and hg completers by using a common
1276 der Walt. Clean up svn and hg completers by using a common
1253 vcs_completer.
1277 vcs_completer.
1254
1278
1255 2006-11-26 Ville Vainio <vivainio@gmail.com>
1279 2006-11-26 Ville Vainio <vivainio@gmail.com>
1256
1280
1257 * Remove ipconfig and %config; you should use _ip.options structure
1281 * Remove ipconfig and %config; you should use _ip.options structure
1258 directly instead!
1282 directly instead!
1259
1283
1260 * genutils.py: add wrap_deprecated function for deprecating callables
1284 * genutils.py: add wrap_deprecated function for deprecating callables
1261
1285
1262 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1286 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1263 _ip.system instead. ipalias is redundant.
1287 _ip.system instead. ipalias is redundant.
1264
1288
1265 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1289 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1266 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1290 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1267 explicit.
1291 explicit.
1268
1292
1269 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1293 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1270 completer. Try it by entering 'hg ' and pressing tab.
1294 completer. Try it by entering 'hg ' and pressing tab.
1271
1295
1272 * macro.py: Give Macro a useful __repr__ method
1296 * macro.py: Give Macro a useful __repr__ method
1273
1297
1274 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1298 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1275
1299
1276 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1300 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1277 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1301 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1278 we don't get a duplicate ipipe module, where registration of the xrepr
1302 we don't get a duplicate ipipe module, where registration of the xrepr
1279 implementation for Text is useless.
1303 implementation for Text is useless.
1280
1304
1281 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1305 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1282
1306
1283 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1307 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1284
1308
1285 2006-11-24 Ville Vainio <vivainio@gmail.com>
1309 2006-11-24 Ville Vainio <vivainio@gmail.com>
1286
1310
1287 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1311 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1288 try to use "cProfile" instead of the slower pure python
1312 try to use "cProfile" instead of the slower pure python
1289 "profile"
1313 "profile"
1290
1314
1291 2006-11-23 Ville Vainio <vivainio@gmail.com>
1315 2006-11-23 Ville Vainio <vivainio@gmail.com>
1292
1316
1293 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1317 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1294 Qt+IPython+Designer link in documentation.
1318 Qt+IPython+Designer link in documentation.
1295
1319
1296 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1320 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1297 correct Pdb object to %pydb.
1321 correct Pdb object to %pydb.
1298
1322
1299
1323
1300 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1324 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1301 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1325 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1302 generic xrepr(), otherwise the list implementation would kick in.
1326 generic xrepr(), otherwise the list implementation would kick in.
1303
1327
1304 2006-11-21 Ville Vainio <vivainio@gmail.com>
1328 2006-11-21 Ville Vainio <vivainio@gmail.com>
1305
1329
1306 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1330 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1307 with one from UserConfig.
1331 with one from UserConfig.
1308
1332
1309 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1333 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1310 it was missing which broke the sh profile.
1334 it was missing which broke the sh profile.
1311
1335
1312 * completer.py: file completer now uses explicit '/' instead
1336 * completer.py: file completer now uses explicit '/' instead
1313 of os.path.join, expansion of 'foo' was broken on win32
1337 of os.path.join, expansion of 'foo' was broken on win32
1314 if there was one directory with name 'foobar'.
1338 if there was one directory with name 'foobar'.
1315
1339
1316 * A bunch of patches from Kirill Smelkov:
1340 * A bunch of patches from Kirill Smelkov:
1317
1341
1318 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1342 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1319
1343
1320 * [patch 7/9] Implement %page -r (page in raw mode) -
1344 * [patch 7/9] Implement %page -r (page in raw mode) -
1321
1345
1322 * [patch 5/9] ScientificPython webpage has moved
1346 * [patch 5/9] ScientificPython webpage has moved
1323
1347
1324 * [patch 4/9] The manual mentions %ds, should be %dhist
1348 * [patch 4/9] The manual mentions %ds, should be %dhist
1325
1349
1326 * [patch 3/9] Kill old bits from %prun doc.
1350 * [patch 3/9] Kill old bits from %prun doc.
1327
1351
1328 * [patch 1/9] Fix typos here and there.
1352 * [patch 1/9] Fix typos here and there.
1329
1353
1330 2006-11-08 Ville Vainio <vivainio@gmail.com>
1354 2006-11-08 Ville Vainio <vivainio@gmail.com>
1331
1355
1332 * completer.py (attr_matches): catch all exceptions raised
1356 * completer.py (attr_matches): catch all exceptions raised
1333 by eval of expr with dots.
1357 by eval of expr with dots.
1334
1358
1335 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1359 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1336
1360
1337 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1361 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1338 input if it starts with whitespace. This allows you to paste
1362 input if it starts with whitespace. This allows you to paste
1339 indented input from any editor without manually having to type in
1363 indented input from any editor without manually having to type in
1340 the 'if 1:', which is convenient when working interactively.
1364 the 'if 1:', which is convenient when working interactively.
1341 Slightly modifed version of a patch by Bo Peng
1365 Slightly modifed version of a patch by Bo Peng
1342 <bpeng-AT-rice.edu>.
1366 <bpeng-AT-rice.edu>.
1343
1367
1344 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1368 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1345
1369
1346 * IPython/irunner.py (main): modified irunner so it automatically
1370 * IPython/irunner.py (main): modified irunner so it automatically
1347 recognizes the right runner to use based on the extension (.py for
1371 recognizes the right runner to use based on the extension (.py for
1348 python, .ipy for ipython and .sage for sage).
1372 python, .ipy for ipython and .sage for sage).
1349
1373
1350 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1374 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1351 visible in ipapi as ip.config(), to programatically control the
1375 visible in ipapi as ip.config(), to programatically control the
1352 internal rc object. There's an accompanying %config magic for
1376 internal rc object. There's an accompanying %config magic for
1353 interactive use, which has been enhanced to match the
1377 interactive use, which has been enhanced to match the
1354 funtionality in ipconfig.
1378 funtionality in ipconfig.
1355
1379
1356 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1380 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1357 so it's not just a toggle, it now takes an argument. Add support
1381 so it's not just a toggle, it now takes an argument. Add support
1358 for a customizable header when making system calls, as the new
1382 for a customizable header when making system calls, as the new
1359 system_header variable in the ipythonrc file.
1383 system_header variable in the ipythonrc file.
1360
1384
1361 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1385 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1362
1386
1363 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1387 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1364 generic functions (using Philip J. Eby's simplegeneric package).
1388 generic functions (using Philip J. Eby's simplegeneric package).
1365 This makes it possible to customize the display of third-party classes
1389 This makes it possible to customize the display of third-party classes
1366 without having to monkeypatch them. xiter() no longer supports a mode
1390 without having to monkeypatch them. xiter() no longer supports a mode
1367 argument and the XMode class has been removed. The same functionality can
1391 argument and the XMode class has been removed. The same functionality can
1368 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1392 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1369 One consequence of the switch to generic functions is that xrepr() and
1393 One consequence of the switch to generic functions is that xrepr() and
1370 xattrs() implementation must define the default value for the mode
1394 xattrs() implementation must define the default value for the mode
1371 argument themselves and xattrs() implementations must return real
1395 argument themselves and xattrs() implementations must return real
1372 descriptors.
1396 descriptors.
1373
1397
1374 * IPython/external: This new subpackage will contain all third-party
1398 * IPython/external: This new subpackage will contain all third-party
1375 packages that are bundled with IPython. (The first one is simplegeneric).
1399 packages that are bundled with IPython. (The first one is simplegeneric).
1376
1400
1377 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1401 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1378 directory which as been dropped in r1703.
1402 directory which as been dropped in r1703.
1379
1403
1380 * IPython/Extensions/ipipe.py (iless): Fixed.
1404 * IPython/Extensions/ipipe.py (iless): Fixed.
1381
1405
1382 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1406 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1383
1407
1384 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1408 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1385
1409
1386 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1410 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1387 handling in variable expansion so that shells and magics recognize
1411 handling in variable expansion so that shells and magics recognize
1388 function local scopes correctly. Bug reported by Brian.
1412 function local scopes correctly. Bug reported by Brian.
1389
1413
1390 * scripts/ipython: remove the very first entry in sys.path which
1414 * scripts/ipython: remove the very first entry in sys.path which
1391 Python auto-inserts for scripts, so that sys.path under IPython is
1415 Python auto-inserts for scripts, so that sys.path under IPython is
1392 as similar as possible to that under plain Python.
1416 as similar as possible to that under plain Python.
1393
1417
1394 * IPython/completer.py (IPCompleter.file_matches): Fix
1418 * IPython/completer.py (IPCompleter.file_matches): Fix
1395 tab-completion so that quotes are not closed unless the completion
1419 tab-completion so that quotes are not closed unless the completion
1396 is unambiguous. After a request by Stefan. Minor cleanups in
1420 is unambiguous. After a request by Stefan. Minor cleanups in
1397 ipy_stock_completers.
1421 ipy_stock_completers.
1398
1422
1399 2006-11-02 Ville Vainio <vivainio@gmail.com>
1423 2006-11-02 Ville Vainio <vivainio@gmail.com>
1400
1424
1401 * ipy_stock_completers.py: Add %run and %cd completers.
1425 * ipy_stock_completers.py: Add %run and %cd completers.
1402
1426
1403 * completer.py: Try running custom completer for both
1427 * completer.py: Try running custom completer for both
1404 "foo" and "%foo" if the command is just "foo". Ignore case
1428 "foo" and "%foo" if the command is just "foo". Ignore case
1405 when filtering possible completions.
1429 when filtering possible completions.
1406
1430
1407 * UserConfig/ipy_user_conf.py: install stock completers as default
1431 * UserConfig/ipy_user_conf.py: install stock completers as default
1408
1432
1409 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1433 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1410 simplified readline history save / restore through a wrapper
1434 simplified readline history save / restore through a wrapper
1411 function
1435 function
1412
1436
1413
1437
1414 2006-10-31 Ville Vainio <vivainio@gmail.com>
1438 2006-10-31 Ville Vainio <vivainio@gmail.com>
1415
1439
1416 * strdispatch.py, completer.py, ipy_stock_completers.py:
1440 * strdispatch.py, completer.py, ipy_stock_completers.py:
1417 Allow str_key ("command") in completer hooks. Implement
1441 Allow str_key ("command") in completer hooks. Implement
1418 trivial completer for 'import' (stdlib modules only). Rename
1442 trivial completer for 'import' (stdlib modules only). Rename
1419 ipy_linux_package_managers.py to ipy_stock_completers.py.
1443 ipy_linux_package_managers.py to ipy_stock_completers.py.
1420 SVN completer.
1444 SVN completer.
1421
1445
1422 * Extensions/ledit.py: %magic line editor for easily and
1446 * Extensions/ledit.py: %magic line editor for easily and
1423 incrementally manipulating lists of strings. The magic command
1447 incrementally manipulating lists of strings. The magic command
1424 name is %led.
1448 name is %led.
1425
1449
1426 2006-10-30 Ville Vainio <vivainio@gmail.com>
1450 2006-10-30 Ville Vainio <vivainio@gmail.com>
1427
1451
1428 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1452 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1429 Bernsteins's patches for pydb integration.
1453 Bernsteins's patches for pydb integration.
1430 http://bashdb.sourceforge.net/pydb/
1454 http://bashdb.sourceforge.net/pydb/
1431
1455
1432 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1456 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1433 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1457 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1434 custom completer hook to allow the users to implement their own
1458 custom completer hook to allow the users to implement their own
1435 completers. See ipy_linux_package_managers.py for example. The
1459 completers. See ipy_linux_package_managers.py for example. The
1436 hook name is 'complete_command'.
1460 hook name is 'complete_command'.
1437
1461
1438 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1462 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1439
1463
1440 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1464 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1441 Numeric leftovers.
1465 Numeric leftovers.
1442
1466
1443 * ipython.el (py-execute-region): apply Stefan's patch to fix
1467 * ipython.el (py-execute-region): apply Stefan's patch to fix
1444 garbled results if the python shell hasn't been previously started.
1468 garbled results if the python shell hasn't been previously started.
1445
1469
1446 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1470 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1447 pretty generic function and useful for other things.
1471 pretty generic function and useful for other things.
1448
1472
1449 * IPython/OInspect.py (getsource): Add customizable source
1473 * IPython/OInspect.py (getsource): Add customizable source
1450 extractor. After a request/patch form W. Stein (SAGE).
1474 extractor. After a request/patch form W. Stein (SAGE).
1451
1475
1452 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1476 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1453 window size to a more reasonable value from what pexpect does,
1477 window size to a more reasonable value from what pexpect does,
1454 since their choice causes wrapping bugs with long input lines.
1478 since their choice causes wrapping bugs with long input lines.
1455
1479
1456 2006-10-28 Ville Vainio <vivainio@gmail.com>
1480 2006-10-28 Ville Vainio <vivainio@gmail.com>
1457
1481
1458 * Magic.py (%run): Save and restore the readline history from
1482 * Magic.py (%run): Save and restore the readline history from
1459 file around %run commands to prevent side effects from
1483 file around %run commands to prevent side effects from
1460 %runned programs that might use readline (e.g. pydb).
1484 %runned programs that might use readline (e.g. pydb).
1461
1485
1462 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1486 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1463 invoking the pydb enhanced debugger.
1487 invoking the pydb enhanced debugger.
1464
1488
1465 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1489 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1466
1490
1467 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1491 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1468 call the base class method and propagate the return value to
1492 call the base class method and propagate the return value to
1469 ifile. This is now done by path itself.
1493 ifile. This is now done by path itself.
1470
1494
1471 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1495 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1472
1496
1473 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1497 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1474 api: set_crash_handler(), to expose the ability to change the
1498 api: set_crash_handler(), to expose the ability to change the
1475 internal crash handler.
1499 internal crash handler.
1476
1500
1477 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1501 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1478 the various parameters of the crash handler so that apps using
1502 the various parameters of the crash handler so that apps using
1479 IPython as their engine can customize crash handling. Ipmlemented
1503 IPython as their engine can customize crash handling. Ipmlemented
1480 at the request of SAGE.
1504 at the request of SAGE.
1481
1505
1482 2006-10-14 Ville Vainio <vivainio@gmail.com>
1506 2006-10-14 Ville Vainio <vivainio@gmail.com>
1483
1507
1484 * Magic.py, ipython.el: applied first "safe" part of Rocky
1508 * Magic.py, ipython.el: applied first "safe" part of Rocky
1485 Bernstein's patch set for pydb integration.
1509 Bernstein's patch set for pydb integration.
1486
1510
1487 * Magic.py (%unalias, %alias): %store'd aliases can now be
1511 * Magic.py (%unalias, %alias): %store'd aliases can now be
1488 removed with '%unalias'. %alias w/o args now shows most
1512 removed with '%unalias'. %alias w/o args now shows most
1489 interesting (stored / manually defined) aliases last
1513 interesting (stored / manually defined) aliases last
1490 where they catch the eye w/o scrolling.
1514 where they catch the eye w/o scrolling.
1491
1515
1492 * Magic.py (%rehashx), ext_rehashdir.py: files with
1516 * Magic.py (%rehashx), ext_rehashdir.py: files with
1493 'py' extension are always considered executable, even
1517 'py' extension are always considered executable, even
1494 when not in PATHEXT environment variable.
1518 when not in PATHEXT environment variable.
1495
1519
1496 2006-10-12 Ville Vainio <vivainio@gmail.com>
1520 2006-10-12 Ville Vainio <vivainio@gmail.com>
1497
1521
1498 * jobctrl.py: Add new "jobctrl" extension for spawning background
1522 * jobctrl.py: Add new "jobctrl" extension for spawning background
1499 processes with "&find /". 'import jobctrl' to try it out. Requires
1523 processes with "&find /". 'import jobctrl' to try it out. Requires
1500 'subprocess' module, standard in python 2.4+.
1524 'subprocess' module, standard in python 2.4+.
1501
1525
1502 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1526 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1503 so if foo -> bar and bar -> baz, then foo -> baz.
1527 so if foo -> bar and bar -> baz, then foo -> baz.
1504
1528
1505 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1529 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1506
1530
1507 * IPython/Magic.py (Magic.parse_options): add a new posix option
1531 * IPython/Magic.py (Magic.parse_options): add a new posix option
1508 to allow parsing of input args in magics that doesn't strip quotes
1532 to allow parsing of input args in magics that doesn't strip quotes
1509 (if posix=False). This also closes %timeit bug reported by
1533 (if posix=False). This also closes %timeit bug reported by
1510 Stefan.
1534 Stefan.
1511
1535
1512 2006-10-03 Ville Vainio <vivainio@gmail.com>
1536 2006-10-03 Ville Vainio <vivainio@gmail.com>
1513
1537
1514 * iplib.py (raw_input, interact): Return ValueError catching for
1538 * iplib.py (raw_input, interact): Return ValueError catching for
1515 raw_input. Fixes infinite loop for sys.stdin.close() or
1539 raw_input. Fixes infinite loop for sys.stdin.close() or
1516 sys.stdout.close().
1540 sys.stdout.close().
1517
1541
1518 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1542 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1519
1543
1520 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1544 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1521 to help in handling doctests. irunner is now pretty useful for
1545 to help in handling doctests. irunner is now pretty useful for
1522 running standalone scripts and simulate a full interactive session
1546 running standalone scripts and simulate a full interactive session
1523 in a format that can be then pasted as a doctest.
1547 in a format that can be then pasted as a doctest.
1524
1548
1525 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1549 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1526 on top of the default (useless) ones. This also fixes the nasty
1550 on top of the default (useless) ones. This also fixes the nasty
1527 way in which 2.5's Quitter() exits (reverted [1785]).
1551 way in which 2.5's Quitter() exits (reverted [1785]).
1528
1552
1529 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1553 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1530 2.5.
1554 2.5.
1531
1555
1532 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1556 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1533 color scheme is updated as well when color scheme is changed
1557 color scheme is updated as well when color scheme is changed
1534 interactively.
1558 interactively.
1535
1559
1536 2006-09-27 Ville Vainio <vivainio@gmail.com>
1560 2006-09-27 Ville Vainio <vivainio@gmail.com>
1537
1561
1538 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1562 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1539 infinite loop and just exit. It's a hack, but will do for a while.
1563 infinite loop and just exit. It's a hack, but will do for a while.
1540
1564
1541 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1565 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1542
1566
1543 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1567 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1544 the constructor, this makes it possible to get a list of only directories
1568 the constructor, this makes it possible to get a list of only directories
1545 or only files.
1569 or only files.
1546
1570
1547 2006-08-12 Ville Vainio <vivainio@gmail.com>
1571 2006-08-12 Ville Vainio <vivainio@gmail.com>
1548
1572
1549 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1573 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1550 they broke unittest
1574 they broke unittest
1551
1575
1552 2006-08-11 Ville Vainio <vivainio@gmail.com>
1576 2006-08-11 Ville Vainio <vivainio@gmail.com>
1553
1577
1554 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1578 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1555 by resolving issue properly, i.e. by inheriting FakeModule
1579 by resolving issue properly, i.e. by inheriting FakeModule
1556 from types.ModuleType. Pickling ipython interactive data
1580 from types.ModuleType. Pickling ipython interactive data
1557 should still work as usual (testing appreciated).
1581 should still work as usual (testing appreciated).
1558
1582
1559 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1583 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1560
1584
1561 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1585 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1562 running under python 2.3 with code from 2.4 to fix a bug with
1586 running under python 2.3 with code from 2.4 to fix a bug with
1563 help(). Reported by the Debian maintainers, Norbert Tretkowski
1587 help(). Reported by the Debian maintainers, Norbert Tretkowski
1564 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1588 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1565 <afayolle-AT-debian.org>.
1589 <afayolle-AT-debian.org>.
1566
1590
1567 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1591 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1568
1592
1569 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1593 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1570 (which was displaying "quit" twice).
1594 (which was displaying "quit" twice).
1571
1595
1572 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1596 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1573
1597
1574 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1598 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1575 the mode argument).
1599 the mode argument).
1576
1600
1577 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1601 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1578
1602
1579 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1603 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1580 not running under IPython.
1604 not running under IPython.
1581
1605
1582 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1606 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1583 and make it iterable (iterating over the attribute itself). Add two new
1607 and make it iterable (iterating over the attribute itself). Add two new
1584 magic strings for __xattrs__(): If the string starts with "-", the attribute
1608 magic strings for __xattrs__(): If the string starts with "-", the attribute
1585 will not be displayed in ibrowse's detail view (but it can still be
1609 will not be displayed in ibrowse's detail view (but it can still be
1586 iterated over). This makes it possible to add attributes that are large
1610 iterated over). This makes it possible to add attributes that are large
1587 lists or generator methods to the detail view. Replace magic attribute names
1611 lists or generator methods to the detail view. Replace magic attribute names
1588 and _attrname() and _getattr() with "descriptors": For each type of magic
1612 and _attrname() and _getattr() with "descriptors": For each type of magic
1589 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1613 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1590 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1614 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1591 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1615 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1592 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1616 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1593 are still supported.
1617 are still supported.
1594
1618
1595 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1619 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1596 fails in ibrowse.fetch(), the exception object is added as the last item
1620 fails in ibrowse.fetch(), the exception object is added as the last item
1597 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1621 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1598 a generator throws an exception midway through execution.
1622 a generator throws an exception midway through execution.
1599
1623
1600 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1624 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1601 encoding into methods.
1625 encoding into methods.
1602
1626
1603 2006-07-26 Ville Vainio <vivainio@gmail.com>
1627 2006-07-26 Ville Vainio <vivainio@gmail.com>
1604
1628
1605 * iplib.py: history now stores multiline input as single
1629 * iplib.py: history now stores multiline input as single
1606 history entries. Patch by Jorgen Cederlof.
1630 history entries. Patch by Jorgen Cederlof.
1607
1631
1608 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1632 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1609
1633
1610 * IPython/Extensions/ibrowse.py: Make cursor visible over
1634 * IPython/Extensions/ibrowse.py: Make cursor visible over
1611 non existing attributes.
1635 non existing attributes.
1612
1636
1613 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1637 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1614
1638
1615 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1639 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1616 error output of the running command doesn't mess up the screen.
1640 error output of the running command doesn't mess up the screen.
1617
1641
1618 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1642 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1619
1643
1620 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1644 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1621 argument. This sorts the items themselves.
1645 argument. This sorts the items themselves.
1622
1646
1623 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1647 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1624
1648
1625 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1649 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1626 Compile expression strings into code objects. This should speed
1650 Compile expression strings into code objects. This should speed
1627 up ifilter and friends somewhat.
1651 up ifilter and friends somewhat.
1628
1652
1629 2006-07-08 Ville Vainio <vivainio@gmail.com>
1653 2006-07-08 Ville Vainio <vivainio@gmail.com>
1630
1654
1631 * Magic.py: %cpaste now strips > from the beginning of lines
1655 * Magic.py: %cpaste now strips > from the beginning of lines
1632 to ease pasting quoted code from emails. Contributed by
1656 to ease pasting quoted code from emails. Contributed by
1633 Stefan van der Walt.
1657 Stefan van der Walt.
1634
1658
1635 2006-06-29 Ville Vainio <vivainio@gmail.com>
1659 2006-06-29 Ville Vainio <vivainio@gmail.com>
1636
1660
1637 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1661 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1638 mode, patch contributed by Darren Dale. NEEDS TESTING!
1662 mode, patch contributed by Darren Dale. NEEDS TESTING!
1639
1663
1640 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1664 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1641
1665
1642 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1666 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1643 a blue background. Fix fetching new display rows when the browser
1667 a blue background. Fix fetching new display rows when the browser
1644 scrolls more than a screenful (e.g. by using the goto command).
1668 scrolls more than a screenful (e.g. by using the goto command).
1645
1669
1646 2006-06-27 Ville Vainio <vivainio@gmail.com>
1670 2006-06-27 Ville Vainio <vivainio@gmail.com>
1647
1671
1648 * Magic.py (_inspect, _ofind) Apply David Huard's
1672 * Magic.py (_inspect, _ofind) Apply David Huard's
1649 patch for displaying the correct docstring for 'property'
1673 patch for displaying the correct docstring for 'property'
1650 attributes.
1674 attributes.
1651
1675
1652 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1676 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1653
1677
1654 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1678 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1655 commands into the methods implementing them.
1679 commands into the methods implementing them.
1656
1680
1657 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1681 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1658
1682
1659 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1683 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1660 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1684 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1661 autoindent support was authored by Jin Liu.
1685 autoindent support was authored by Jin Liu.
1662
1686
1663 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1687 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1664
1688
1665 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1689 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1666 for keymaps with a custom class that simplifies handling.
1690 for keymaps with a custom class that simplifies handling.
1667
1691
1668 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1692 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1669
1693
1670 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1694 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1671 resizing. This requires Python 2.5 to work.
1695 resizing. This requires Python 2.5 to work.
1672
1696
1673 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1697 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1674
1698
1675 * IPython/Extensions/ibrowse.py: Add two new commands to
1699 * IPython/Extensions/ibrowse.py: Add two new commands to
1676 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1700 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1677 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1701 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1678 attributes again. Remapped the help command to "?". Display
1702 attributes again. Remapped the help command to "?". Display
1679 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1703 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1680 as keys for the "home" and "end" commands. Add three new commands
1704 as keys for the "home" and "end" commands. Add three new commands
1681 to the input mode for "find" and friends: "delend" (CTRL-K)
1705 to the input mode for "find" and friends: "delend" (CTRL-K)
1682 deletes to the end of line. "incsearchup" searches upwards in the
1706 deletes to the end of line. "incsearchup" searches upwards in the
1683 command history for an input that starts with the text before the cursor.
1707 command history for an input that starts with the text before the cursor.
1684 "incsearchdown" does the same downwards. Removed a bogus mapping of
1708 "incsearchdown" does the same downwards. Removed a bogus mapping of
1685 the x key to "delete".
1709 the x key to "delete".
1686
1710
1687 2006-06-15 Ville Vainio <vivainio@gmail.com>
1711 2006-06-15 Ville Vainio <vivainio@gmail.com>
1688
1712
1689 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1713 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1690 used to create prompts dynamically, instead of the "old" way of
1714 used to create prompts dynamically, instead of the "old" way of
1691 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1715 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1692 way still works (it's invoked by the default hook), of course.
1716 way still works (it's invoked by the default hook), of course.
1693
1717
1694 * Prompts.py: added generate_output_prompt hook for altering output
1718 * Prompts.py: added generate_output_prompt hook for altering output
1695 prompt
1719 prompt
1696
1720
1697 * Release.py: Changed version string to 0.7.3.svn.
1721 * Release.py: Changed version string to 0.7.3.svn.
1698
1722
1699 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1723 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1700
1724
1701 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1725 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1702 the call to fetch() always tries to fetch enough data for at least one
1726 the call to fetch() always tries to fetch enough data for at least one
1703 full screen. This makes it possible to simply call moveto(0,0,True) in
1727 full screen. This makes it possible to simply call moveto(0,0,True) in
1704 the constructor. Fix typos and removed the obsolete goto attribute.
1728 the constructor. Fix typos and removed the obsolete goto attribute.
1705
1729
1706 2006-06-12 Ville Vainio <vivainio@gmail.com>
1730 2006-06-12 Ville Vainio <vivainio@gmail.com>
1707
1731
1708 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1732 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1709 allowing $variable interpolation within multiline statements,
1733 allowing $variable interpolation within multiline statements,
1710 though so far only with "sh" profile for a testing period.
1734 though so far only with "sh" profile for a testing period.
1711 The patch also enables splitting long commands with \ but it
1735 The patch also enables splitting long commands with \ but it
1712 doesn't work properly yet.
1736 doesn't work properly yet.
1713
1737
1714 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1738 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1715
1739
1716 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1740 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1717 input history and the position of the cursor in the input history for
1741 input history and the position of the cursor in the input history for
1718 the find, findbackwards and goto command.
1742 the find, findbackwards and goto command.
1719
1743
1720 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1744 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1721
1745
1722 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1746 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1723 implements the basic functionality of browser commands that require
1747 implements the basic functionality of browser commands that require
1724 input. Reimplement the goto, find and findbackwards commands as
1748 input. Reimplement the goto, find and findbackwards commands as
1725 subclasses of _CommandInput. Add an input history and keymaps to those
1749 subclasses of _CommandInput. Add an input history and keymaps to those
1726 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1750 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1727 execute commands.
1751 execute commands.
1728
1752
1729 2006-06-07 Ville Vainio <vivainio@gmail.com>
1753 2006-06-07 Ville Vainio <vivainio@gmail.com>
1730
1754
1731 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1755 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1732 running the batch files instead of leaving the session open.
1756 running the batch files instead of leaving the session open.
1733
1757
1734 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1758 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1735
1759
1736 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1760 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1737 the original fix was incomplete. Patch submitted by W. Maier.
1761 the original fix was incomplete. Patch submitted by W. Maier.
1738
1762
1739 2006-06-07 Ville Vainio <vivainio@gmail.com>
1763 2006-06-07 Ville Vainio <vivainio@gmail.com>
1740
1764
1741 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1765 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1742 Confirmation prompts can be supressed by 'quiet' option.
1766 Confirmation prompts can be supressed by 'quiet' option.
1743 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1767 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1744
1768
1745 2006-06-06 *** Released version 0.7.2
1769 2006-06-06 *** Released version 0.7.2
1746
1770
1747 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1771 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1748
1772
1749 * IPython/Release.py (version): Made 0.7.2 final for release.
1773 * IPython/Release.py (version): Made 0.7.2 final for release.
1750 Repo tagged and release cut.
1774 Repo tagged and release cut.
1751
1775
1752 2006-06-05 Ville Vainio <vivainio@gmail.com>
1776 2006-06-05 Ville Vainio <vivainio@gmail.com>
1753
1777
1754 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1778 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1755 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1779 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1756
1780
1757 * upgrade_dir.py: try import 'path' module a bit harder
1781 * upgrade_dir.py: try import 'path' module a bit harder
1758 (for %upgrade)
1782 (for %upgrade)
1759
1783
1760 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1784 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1761
1785
1762 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1786 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1763 instead of looping 20 times.
1787 instead of looping 20 times.
1764
1788
1765 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1789 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1766 correctly at initialization time. Bug reported by Krishna Mohan
1790 correctly at initialization time. Bug reported by Krishna Mohan
1767 Gundu <gkmohan-AT-gmail.com> on the user list.
1791 Gundu <gkmohan-AT-gmail.com> on the user list.
1768
1792
1769 * IPython/Release.py (version): Mark 0.7.2 version to start
1793 * IPython/Release.py (version): Mark 0.7.2 version to start
1770 testing for release on 06/06.
1794 testing for release on 06/06.
1771
1795
1772 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1796 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1773
1797
1774 * scripts/irunner: thin script interface so users don't have to
1798 * scripts/irunner: thin script interface so users don't have to
1775 find the module and call it as an executable, since modules rarely
1799 find the module and call it as an executable, since modules rarely
1776 live in people's PATH.
1800 live in people's PATH.
1777
1801
1778 * IPython/irunner.py (InteractiveRunner.__init__): added
1802 * IPython/irunner.py (InteractiveRunner.__init__): added
1779 delaybeforesend attribute to control delays with newer versions of
1803 delaybeforesend attribute to control delays with newer versions of
1780 pexpect. Thanks to detailed help from pexpect's author, Noah
1804 pexpect. Thanks to detailed help from pexpect's author, Noah
1781 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1805 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1782 correctly (it works in NoColor mode).
1806 correctly (it works in NoColor mode).
1783
1807
1784 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1808 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1785 SAGE list, from improper log() calls.
1809 SAGE list, from improper log() calls.
1786
1810
1787 2006-05-31 Ville Vainio <vivainio@gmail.com>
1811 2006-05-31 Ville Vainio <vivainio@gmail.com>
1788
1812
1789 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1813 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1790 with args in parens to work correctly with dirs that have spaces.
1814 with args in parens to work correctly with dirs that have spaces.
1791
1815
1792 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1816 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1793
1817
1794 * IPython/Logger.py (Logger.logstart): add option to log raw input
1818 * IPython/Logger.py (Logger.logstart): add option to log raw input
1795 instead of the processed one. A -r flag was added to the
1819 instead of the processed one. A -r flag was added to the
1796 %logstart magic used for controlling logging.
1820 %logstart magic used for controlling logging.
1797
1821
1798 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1822 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1799
1823
1800 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1824 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1801 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1825 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1802 recognize the option. After a bug report by Will Maier. This
1826 recognize the option. After a bug report by Will Maier. This
1803 closes #64 (will do it after confirmation from W. Maier).
1827 closes #64 (will do it after confirmation from W. Maier).
1804
1828
1805 * IPython/irunner.py: New module to run scripts as if manually
1829 * IPython/irunner.py: New module to run scripts as if manually
1806 typed into an interactive environment, based on pexpect. After a
1830 typed into an interactive environment, based on pexpect. After a
1807 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1831 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1808 ipython-user list. Simple unittests in the tests/ directory.
1832 ipython-user list. Simple unittests in the tests/ directory.
1809
1833
1810 * tools/release: add Will Maier, OpenBSD port maintainer, to
1834 * tools/release: add Will Maier, OpenBSD port maintainer, to
1811 recepients list. We are now officially part of the OpenBSD ports:
1835 recepients list. We are now officially part of the OpenBSD ports:
1812 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1836 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1813 work.
1837 work.
1814
1838
1815 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1839 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1816
1840
1817 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1841 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1818 so that it doesn't break tkinter apps.
1842 so that it doesn't break tkinter apps.
1819
1843
1820 * IPython/iplib.py (_prefilter): fix bug where aliases would
1844 * IPython/iplib.py (_prefilter): fix bug where aliases would
1821 shadow variables when autocall was fully off. Reported by SAGE
1845 shadow variables when autocall was fully off. Reported by SAGE
1822 author William Stein.
1846 author William Stein.
1823
1847
1824 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1848 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1825 at what detail level strings are computed when foo? is requested.
1849 at what detail level strings are computed when foo? is requested.
1826 This allows users to ask for example that the string form of an
1850 This allows users to ask for example that the string form of an
1827 object is only computed when foo?? is called, or even never, by
1851 object is only computed when foo?? is called, or even never, by
1828 setting the object_info_string_level >= 2 in the configuration
1852 setting the object_info_string_level >= 2 in the configuration
1829 file. This new option has been added and documented. After a
1853 file. This new option has been added and documented. After a
1830 request by SAGE to be able to control the printing of very large
1854 request by SAGE to be able to control the printing of very large
1831 objects more easily.
1855 objects more easily.
1832
1856
1833 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1857 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1834
1858
1835 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1859 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1836 from sys.argv, to be 100% consistent with how Python itself works
1860 from sys.argv, to be 100% consistent with how Python itself works
1837 (as seen for example with python -i file.py). After a bug report
1861 (as seen for example with python -i file.py). After a bug report
1838 by Jeffrey Collins.
1862 by Jeffrey Collins.
1839
1863
1840 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1864 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1841 nasty bug which was preventing custom namespaces with -pylab,
1865 nasty bug which was preventing custom namespaces with -pylab,
1842 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1866 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1843 compatibility (long gone from mpl).
1867 compatibility (long gone from mpl).
1844
1868
1845 * IPython/ipapi.py (make_session): name change: create->make. We
1869 * IPython/ipapi.py (make_session): name change: create->make. We
1846 use make in other places (ipmaker,...), it's shorter and easier to
1870 use make in other places (ipmaker,...), it's shorter and easier to
1847 type and say, etc. I'm trying to clean things before 0.7.2 so
1871 type and say, etc. I'm trying to clean things before 0.7.2 so
1848 that I can keep things stable wrt to ipapi in the chainsaw branch.
1872 that I can keep things stable wrt to ipapi in the chainsaw branch.
1849
1873
1850 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1874 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1851 python-mode recognizes our debugger mode. Add support for
1875 python-mode recognizes our debugger mode. Add support for
1852 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1876 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1853 <m.liu.jin-AT-gmail.com> originally written by
1877 <m.liu.jin-AT-gmail.com> originally written by
1854 doxgen-AT-newsmth.net (with minor modifications for xemacs
1878 doxgen-AT-newsmth.net (with minor modifications for xemacs
1855 compatibility)
1879 compatibility)
1856
1880
1857 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1881 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1858 tracebacks when walking the stack so that the stack tracking system
1882 tracebacks when walking the stack so that the stack tracking system
1859 in emacs' python-mode can identify the frames correctly.
1883 in emacs' python-mode can identify the frames correctly.
1860
1884
1861 * IPython/ipmaker.py (make_IPython): make the internal (and
1885 * IPython/ipmaker.py (make_IPython): make the internal (and
1862 default config) autoedit_syntax value false by default. Too many
1886 default config) autoedit_syntax value false by default. Too many
1863 users have complained to me (both on and off-list) about problems
1887 users have complained to me (both on and off-list) about problems
1864 with this option being on by default, so I'm making it default to
1888 with this option being on by default, so I'm making it default to
1865 off. It can still be enabled by anyone via the usual mechanisms.
1889 off. It can still be enabled by anyone via the usual mechanisms.
1866
1890
1867 * IPython/completer.py (Completer.attr_matches): add support for
1891 * IPython/completer.py (Completer.attr_matches): add support for
1868 PyCrust-style _getAttributeNames magic method. Patch contributed
1892 PyCrust-style _getAttributeNames magic method. Patch contributed
1869 by <mscott-AT-goldenspud.com>. Closes #50.
1893 by <mscott-AT-goldenspud.com>. Closes #50.
1870
1894
1871 * IPython/iplib.py (InteractiveShell.__init__): remove the
1895 * IPython/iplib.py (InteractiveShell.__init__): remove the
1872 deletion of exit/quit from __builtin__, which can break
1896 deletion of exit/quit from __builtin__, which can break
1873 third-party tools like the Zope debugging console. The
1897 third-party tools like the Zope debugging console. The
1874 %exit/%quit magics remain. In general, it's probably a good idea
1898 %exit/%quit magics remain. In general, it's probably a good idea
1875 not to delete anything from __builtin__, since we never know what
1899 not to delete anything from __builtin__, since we never know what
1876 that will break. In any case, python now (for 2.5) will support
1900 that will break. In any case, python now (for 2.5) will support
1877 'real' exit/quit, so this issue is moot. Closes #55.
1901 'real' exit/quit, so this issue is moot. Closes #55.
1878
1902
1879 * IPython/genutils.py (with_obj): rename the 'with' function to
1903 * IPython/genutils.py (with_obj): rename the 'with' function to
1880 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1904 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1881 becomes a language keyword. Closes #53.
1905 becomes a language keyword. Closes #53.
1882
1906
1883 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1907 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1884 __file__ attribute to this so it fools more things into thinking
1908 __file__ attribute to this so it fools more things into thinking
1885 it is a real module. Closes #59.
1909 it is a real module. Closes #59.
1886
1910
1887 * IPython/Magic.py (magic_edit): add -n option to open the editor
1911 * IPython/Magic.py (magic_edit): add -n option to open the editor
1888 at a specific line number. After a patch by Stefan van der Walt.
1912 at a specific line number. After a patch by Stefan van der Walt.
1889
1913
1890 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1914 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1891
1915
1892 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1916 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1893 reason the file could not be opened. After automatic crash
1917 reason the file could not be opened. After automatic crash
1894 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1918 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1895 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1919 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1896 (_should_recompile): Don't fire editor if using %bg, since there
1920 (_should_recompile): Don't fire editor if using %bg, since there
1897 is no file in the first place. From the same report as above.
1921 is no file in the first place. From the same report as above.
1898 (raw_input): protect against faulty third-party prefilters. After
1922 (raw_input): protect against faulty third-party prefilters. After
1899 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1923 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1900 while running under SAGE.
1924 while running under SAGE.
1901
1925
1902 2006-05-23 Ville Vainio <vivainio@gmail.com>
1926 2006-05-23 Ville Vainio <vivainio@gmail.com>
1903
1927
1904 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1928 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1905 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1929 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1906 now returns None (again), unless dummy is specifically allowed by
1930 now returns None (again), unless dummy is specifically allowed by
1907 ipapi.get(allow_dummy=True).
1931 ipapi.get(allow_dummy=True).
1908
1932
1909 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1933 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1910
1934
1911 * IPython: remove all 2.2-compatibility objects and hacks from
1935 * IPython: remove all 2.2-compatibility objects and hacks from
1912 everywhere, since we only support 2.3 at this point. Docs
1936 everywhere, since we only support 2.3 at this point. Docs
1913 updated.
1937 updated.
1914
1938
1915 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1939 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1916 Anything requiring extra validation can be turned into a Python
1940 Anything requiring extra validation can be turned into a Python
1917 property in the future. I used a property for the db one b/c
1941 property in the future. I used a property for the db one b/c
1918 there was a nasty circularity problem with the initialization
1942 there was a nasty circularity problem with the initialization
1919 order, which right now I don't have time to clean up.
1943 order, which right now I don't have time to clean up.
1920
1944
1921 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1945 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1922 another locking bug reported by Jorgen. I'm not 100% sure though,
1946 another locking bug reported by Jorgen. I'm not 100% sure though,
1923 so more testing is needed...
1947 so more testing is needed...
1924
1948
1925 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1949 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1926
1950
1927 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1951 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1928 local variables from any routine in user code (typically executed
1952 local variables from any routine in user code (typically executed
1929 with %run) directly into the interactive namespace. Very useful
1953 with %run) directly into the interactive namespace. Very useful
1930 when doing complex debugging.
1954 when doing complex debugging.
1931 (IPythonNotRunning): Changed the default None object to a dummy
1955 (IPythonNotRunning): Changed the default None object to a dummy
1932 whose attributes can be queried as well as called without
1956 whose attributes can be queried as well as called without
1933 exploding, to ease writing code which works transparently both in
1957 exploding, to ease writing code which works transparently both in
1934 and out of ipython and uses some of this API.
1958 and out of ipython and uses some of this API.
1935
1959
1936 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1960 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1937
1961
1938 * IPython/hooks.py (result_display): Fix the fact that our display
1962 * IPython/hooks.py (result_display): Fix the fact that our display
1939 hook was using str() instead of repr(), as the default python
1963 hook was using str() instead of repr(), as the default python
1940 console does. This had gone unnoticed b/c it only happened if
1964 console does. This had gone unnoticed b/c it only happened if
1941 %Pprint was off, but the inconsistency was there.
1965 %Pprint was off, but the inconsistency was there.
1942
1966
1943 2006-05-15 Ville Vainio <vivainio@gmail.com>
1967 2006-05-15 Ville Vainio <vivainio@gmail.com>
1944
1968
1945 * Oinspect.py: Only show docstring for nonexisting/binary files
1969 * Oinspect.py: Only show docstring for nonexisting/binary files
1946 when doing object??, closing ticket #62
1970 when doing object??, closing ticket #62
1947
1971
1948 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1972 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1949
1973
1950 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1974 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1951 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1975 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1952 was being released in a routine which hadn't checked if it had
1976 was being released in a routine which hadn't checked if it had
1953 been the one to acquire it.
1977 been the one to acquire it.
1954
1978
1955 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1979 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1956
1980
1957 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1981 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1958
1982
1959 2006-04-11 Ville Vainio <vivainio@gmail.com>
1983 2006-04-11 Ville Vainio <vivainio@gmail.com>
1960
1984
1961 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1985 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1962 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1986 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1963 prefilters, allowing stuff like magics and aliases in the file.
1987 prefilters, allowing stuff like magics and aliases in the file.
1964
1988
1965 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1989 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1966 added. Supported now are "%clear in" and "%clear out" (clear input and
1990 added. Supported now are "%clear in" and "%clear out" (clear input and
1967 output history, respectively). Also fixed CachedOutput.flush to
1991 output history, respectively). Also fixed CachedOutput.flush to
1968 properly flush the output cache.
1992 properly flush the output cache.
1969
1993
1970 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1994 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1971 half-success (and fail explicitly).
1995 half-success (and fail explicitly).
1972
1996
1973 2006-03-28 Ville Vainio <vivainio@gmail.com>
1997 2006-03-28 Ville Vainio <vivainio@gmail.com>
1974
1998
1975 * iplib.py: Fix quoting of aliases so that only argless ones
1999 * iplib.py: Fix quoting of aliases so that only argless ones
1976 are quoted
2000 are quoted
1977
2001
1978 2006-03-28 Ville Vainio <vivainio@gmail.com>
2002 2006-03-28 Ville Vainio <vivainio@gmail.com>
1979
2003
1980 * iplib.py: Quote aliases with spaces in the name.
2004 * iplib.py: Quote aliases with spaces in the name.
1981 "c:\program files\blah\bin" is now legal alias target.
2005 "c:\program files\blah\bin" is now legal alias target.
1982
2006
1983 * ext_rehashdir.py: Space no longer allowed as arg
2007 * ext_rehashdir.py: Space no longer allowed as arg
1984 separator, since space is legal in path names.
2008 separator, since space is legal in path names.
1985
2009
1986 2006-03-16 Ville Vainio <vivainio@gmail.com>
2010 2006-03-16 Ville Vainio <vivainio@gmail.com>
1987
2011
1988 * upgrade_dir.py: Take path.py from Extensions, correcting
2012 * upgrade_dir.py: Take path.py from Extensions, correcting
1989 %upgrade magic
2013 %upgrade magic
1990
2014
1991 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2015 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1992
2016
1993 * hooks.py: Only enclose editor binary in quotes if legal and
2017 * hooks.py: Only enclose editor binary in quotes if legal and
1994 necessary (space in the name, and is an existing file). Fixes a bug
2018 necessary (space in the name, and is an existing file). Fixes a bug
1995 reported by Zachary Pincus.
2019 reported by Zachary Pincus.
1996
2020
1997 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2021 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1998
2022
1999 * Manual: thanks to a tip on proper color handling for Emacs, by
2023 * Manual: thanks to a tip on proper color handling for Emacs, by
2000 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2024 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2001
2025
2002 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2026 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2003 by applying the provided patch. Thanks to Liu Jin
2027 by applying the provided patch. Thanks to Liu Jin
2004 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2028 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2005 XEmacs/Linux, I'm trusting the submitter that it actually helps
2029 XEmacs/Linux, I'm trusting the submitter that it actually helps
2006 under win32/GNU Emacs. Will revisit if any problems are reported.
2030 under win32/GNU Emacs. Will revisit if any problems are reported.
2007
2031
2008 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2032 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2009
2033
2010 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2034 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2011 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2035 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2012
2036
2013 2006-03-12 Ville Vainio <vivainio@gmail.com>
2037 2006-03-12 Ville Vainio <vivainio@gmail.com>
2014
2038
2015 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2039 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2016 Torsten Marek.
2040 Torsten Marek.
2017
2041
2018 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2042 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2019
2043
2020 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2044 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2021 line ranges works again.
2045 line ranges works again.
2022
2046
2023 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2047 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2024
2048
2025 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2049 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2026 and friends, after a discussion with Zach Pincus on ipython-user.
2050 and friends, after a discussion with Zach Pincus on ipython-user.
2027 I'm not 100% sure, but after thinking about it quite a bit, it may
2051 I'm not 100% sure, but after thinking about it quite a bit, it may
2028 be OK. Testing with the multithreaded shells didn't reveal any
2052 be OK. Testing with the multithreaded shells didn't reveal any
2029 problems, but let's keep an eye out.
2053 problems, but let's keep an eye out.
2030
2054
2031 In the process, I fixed a few things which were calling
2055 In the process, I fixed a few things which were calling
2032 self.InteractiveTB() directly (like safe_execfile), which is a
2056 self.InteractiveTB() directly (like safe_execfile), which is a
2033 mistake: ALL exception reporting should be done by calling
2057 mistake: ALL exception reporting should be done by calling
2034 self.showtraceback(), which handles state and tab-completion and
2058 self.showtraceback(), which handles state and tab-completion and
2035 more.
2059 more.
2036
2060
2037 2006-03-01 Ville Vainio <vivainio@gmail.com>
2061 2006-03-01 Ville Vainio <vivainio@gmail.com>
2038
2062
2039 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2063 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2040 To use, do "from ipipe import *".
2064 To use, do "from ipipe import *".
2041
2065
2042 2006-02-24 Ville Vainio <vivainio@gmail.com>
2066 2006-02-24 Ville Vainio <vivainio@gmail.com>
2043
2067
2044 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2068 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2045 "cleanly" and safely than the older upgrade mechanism.
2069 "cleanly" and safely than the older upgrade mechanism.
2046
2070
2047 2006-02-21 Ville Vainio <vivainio@gmail.com>
2071 2006-02-21 Ville Vainio <vivainio@gmail.com>
2048
2072
2049 * Magic.py: %save works again.
2073 * Magic.py: %save works again.
2050
2074
2051 2006-02-15 Ville Vainio <vivainio@gmail.com>
2075 2006-02-15 Ville Vainio <vivainio@gmail.com>
2052
2076
2053 * Magic.py: %Pprint works again
2077 * Magic.py: %Pprint works again
2054
2078
2055 * Extensions/ipy_sane_defaults.py: Provide everything provided
2079 * Extensions/ipy_sane_defaults.py: Provide everything provided
2056 in default ipythonrc, to make it possible to have a completely empty
2080 in default ipythonrc, to make it possible to have a completely empty
2057 ipythonrc (and thus completely rc-file free configuration)
2081 ipythonrc (and thus completely rc-file free configuration)
2058
2082
2059 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2083 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2060
2084
2061 * IPython/hooks.py (editor): quote the call to the editor command,
2085 * IPython/hooks.py (editor): quote the call to the editor command,
2062 to allow commands with spaces in them. Problem noted by watching
2086 to allow commands with spaces in them. Problem noted by watching
2063 Ian Oswald's video about textpad under win32 at
2087 Ian Oswald's video about textpad under win32 at
2064 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2088 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2065
2089
2066 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2090 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2067 describing magics (we haven't used @ for a loong time).
2091 describing magics (we haven't used @ for a loong time).
2068
2092
2069 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2093 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2070 contributed by marienz to close
2094 contributed by marienz to close
2071 http://www.scipy.net/roundup/ipython/issue53.
2095 http://www.scipy.net/roundup/ipython/issue53.
2072
2096
2073 2006-02-10 Ville Vainio <vivainio@gmail.com>
2097 2006-02-10 Ville Vainio <vivainio@gmail.com>
2074
2098
2075 * genutils.py: getoutput now works in win32 too
2099 * genutils.py: getoutput now works in win32 too
2076
2100
2077 * completer.py: alias and magic completion only invoked
2101 * completer.py: alias and magic completion only invoked
2078 at the first "item" in the line, to avoid "cd %store"
2102 at the first "item" in the line, to avoid "cd %store"
2079 nonsense.
2103 nonsense.
2080
2104
2081 2006-02-09 Ville Vainio <vivainio@gmail.com>
2105 2006-02-09 Ville Vainio <vivainio@gmail.com>
2082
2106
2083 * test/*: Added a unit testing framework (finally).
2107 * test/*: Added a unit testing framework (finally).
2084 '%run runtests.py' to run test_*.
2108 '%run runtests.py' to run test_*.
2085
2109
2086 * ipapi.py: Exposed runlines and set_custom_exc
2110 * ipapi.py: Exposed runlines and set_custom_exc
2087
2111
2088 2006-02-07 Ville Vainio <vivainio@gmail.com>
2112 2006-02-07 Ville Vainio <vivainio@gmail.com>
2089
2113
2090 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2114 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2091 instead use "f(1 2)" as before.
2115 instead use "f(1 2)" as before.
2092
2116
2093 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2117 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2094
2118
2095 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2119 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2096 facilities, for demos processed by the IPython input filter
2120 facilities, for demos processed by the IPython input filter
2097 (IPythonDemo), and for running a script one-line-at-a-time as a
2121 (IPythonDemo), and for running a script one-line-at-a-time as a
2098 demo, both for pure Python (LineDemo) and for IPython-processed
2122 demo, both for pure Python (LineDemo) and for IPython-processed
2099 input (IPythonLineDemo). After a request by Dave Kohel, from the
2123 input (IPythonLineDemo). After a request by Dave Kohel, from the
2100 SAGE team.
2124 SAGE team.
2101 (Demo.edit): added an edit() method to the demo objects, to edit
2125 (Demo.edit): added an edit() method to the demo objects, to edit
2102 the in-memory copy of the last executed block.
2126 the in-memory copy of the last executed block.
2103
2127
2104 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2128 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2105 processing to %edit, %macro and %save. These commands can now be
2129 processing to %edit, %macro and %save. These commands can now be
2106 invoked on the unprocessed input as it was typed by the user
2130 invoked on the unprocessed input as it was typed by the user
2107 (without any prefilters applied). After requests by the SAGE team
2131 (without any prefilters applied). After requests by the SAGE team
2108 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2132 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2109
2133
2110 2006-02-01 Ville Vainio <vivainio@gmail.com>
2134 2006-02-01 Ville Vainio <vivainio@gmail.com>
2111
2135
2112 * setup.py, eggsetup.py: easy_install ipython==dev works
2136 * setup.py, eggsetup.py: easy_install ipython==dev works
2113 correctly now (on Linux)
2137 correctly now (on Linux)
2114
2138
2115 * ipy_user_conf,ipmaker: user config changes, removed spurious
2139 * ipy_user_conf,ipmaker: user config changes, removed spurious
2116 warnings
2140 warnings
2117
2141
2118 * iplib: if rc.banner is string, use it as is.
2142 * iplib: if rc.banner is string, use it as is.
2119
2143
2120 * Magic: %pycat accepts a string argument and pages it's contents.
2144 * Magic: %pycat accepts a string argument and pages it's contents.
2121
2145
2122
2146
2123 2006-01-30 Ville Vainio <vivainio@gmail.com>
2147 2006-01-30 Ville Vainio <vivainio@gmail.com>
2124
2148
2125 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2149 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2126 Now %store and bookmarks work through PickleShare, meaning that
2150 Now %store and bookmarks work through PickleShare, meaning that
2127 concurrent access is possible and all ipython sessions see the
2151 concurrent access is possible and all ipython sessions see the
2128 same database situation all the time, instead of snapshot of
2152 same database situation all the time, instead of snapshot of
2129 the situation when the session was started. Hence, %bookmark
2153 the situation when the session was started. Hence, %bookmark
2130 results are immediately accessible from othes sessions. The database
2154 results are immediately accessible from othes sessions. The database
2131 is also available for use by user extensions. See:
2155 is also available for use by user extensions. See:
2132 http://www.python.org/pypi/pickleshare
2156 http://www.python.org/pypi/pickleshare
2133
2157
2134 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2158 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2135
2159
2136 * aliases can now be %store'd
2160 * aliases can now be %store'd
2137
2161
2138 * path.py moved to Extensions so that pickleshare does not need
2162 * path.py moved to Extensions so that pickleshare does not need
2139 IPython-specific import. Extensions added to pythonpath right
2163 IPython-specific import. Extensions added to pythonpath right
2140 at __init__.
2164 at __init__.
2141
2165
2142 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2166 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2143 called with _ip.system and the pre-transformed command string.
2167 called with _ip.system and the pre-transformed command string.
2144
2168
2145 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2169 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2146
2170
2147 * IPython/iplib.py (interact): Fix that we were not catching
2171 * IPython/iplib.py (interact): Fix that we were not catching
2148 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2172 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2149 logic here had to change, but it's fixed now.
2173 logic here had to change, but it's fixed now.
2150
2174
2151 2006-01-29 Ville Vainio <vivainio@gmail.com>
2175 2006-01-29 Ville Vainio <vivainio@gmail.com>
2152
2176
2153 * iplib.py: Try to import pyreadline on Windows.
2177 * iplib.py: Try to import pyreadline on Windows.
2154
2178
2155 2006-01-27 Ville Vainio <vivainio@gmail.com>
2179 2006-01-27 Ville Vainio <vivainio@gmail.com>
2156
2180
2157 * iplib.py: Expose ipapi as _ip in builtin namespace.
2181 * iplib.py: Expose ipapi as _ip in builtin namespace.
2158 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2182 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2159 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2183 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2160 syntax now produce _ip.* variant of the commands.
2184 syntax now produce _ip.* variant of the commands.
2161
2185
2162 * "_ip.options().autoedit_syntax = 2" automatically throws
2186 * "_ip.options().autoedit_syntax = 2" automatically throws
2163 user to editor for syntax error correction without prompting.
2187 user to editor for syntax error correction without prompting.
2164
2188
2165 2006-01-27 Ville Vainio <vivainio@gmail.com>
2189 2006-01-27 Ville Vainio <vivainio@gmail.com>
2166
2190
2167 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2191 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2168 'ipython' at argv[0]) executed through command line.
2192 'ipython' at argv[0]) executed through command line.
2169 NOTE: this DEPRECATES calling ipython with multiple scripts
2193 NOTE: this DEPRECATES calling ipython with multiple scripts
2170 ("ipython a.py b.py c.py")
2194 ("ipython a.py b.py c.py")
2171
2195
2172 * iplib.py, hooks.py: Added configurable input prefilter,
2196 * iplib.py, hooks.py: Added configurable input prefilter,
2173 named 'input_prefilter'. See ext_rescapture.py for example
2197 named 'input_prefilter'. See ext_rescapture.py for example
2174 usage.
2198 usage.
2175
2199
2176 * ext_rescapture.py, Magic.py: Better system command output capture
2200 * ext_rescapture.py, Magic.py: Better system command output capture
2177 through 'var = !ls' (deprecates user-visible %sc). Same notation
2201 through 'var = !ls' (deprecates user-visible %sc). Same notation
2178 applies for magics, 'var = %alias' assigns alias list to var.
2202 applies for magics, 'var = %alias' assigns alias list to var.
2179
2203
2180 * ipapi.py: added meta() for accessing extension-usable data store.
2204 * ipapi.py: added meta() for accessing extension-usable data store.
2181
2205
2182 * iplib.py: added InteractiveShell.getapi(). New magics should be
2206 * iplib.py: added InteractiveShell.getapi(). New magics should be
2183 written doing self.getapi() instead of using the shell directly.
2207 written doing self.getapi() instead of using the shell directly.
2184
2208
2185 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2209 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2186 %store foo >> ~/myfoo.txt to store variables to files (in clean
2210 %store foo >> ~/myfoo.txt to store variables to files (in clean
2187 textual form, not a restorable pickle).
2211 textual form, not a restorable pickle).
2188
2212
2189 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2213 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2190
2214
2191 * usage.py, Magic.py: added %quickref
2215 * usage.py, Magic.py: added %quickref
2192
2216
2193 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2217 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2194
2218
2195 * GetoptErrors when invoking magics etc. with wrong args
2219 * GetoptErrors when invoking magics etc. with wrong args
2196 are now more helpful:
2220 are now more helpful:
2197 GetoptError: option -l not recognized (allowed: "qb" )
2221 GetoptError: option -l not recognized (allowed: "qb" )
2198
2222
2199 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2223 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2200
2224
2201 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2225 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2202 computationally intensive blocks don't appear to stall the demo.
2226 computationally intensive blocks don't appear to stall the demo.
2203
2227
2204 2006-01-24 Ville Vainio <vivainio@gmail.com>
2228 2006-01-24 Ville Vainio <vivainio@gmail.com>
2205
2229
2206 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2230 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2207 value to manipulate resulting history entry.
2231 value to manipulate resulting history entry.
2208
2232
2209 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2233 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2210 to instance methods of IPApi class, to make extending an embedded
2234 to instance methods of IPApi class, to make extending an embedded
2211 IPython feasible. See ext_rehashdir.py for example usage.
2235 IPython feasible. See ext_rehashdir.py for example usage.
2212
2236
2213 * Merged 1071-1076 from branches/0.7.1
2237 * Merged 1071-1076 from branches/0.7.1
2214
2238
2215
2239
2216 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2240 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2217
2241
2218 * tools/release (daystamp): Fix build tools to use the new
2242 * tools/release (daystamp): Fix build tools to use the new
2219 eggsetup.py script to build lightweight eggs.
2243 eggsetup.py script to build lightweight eggs.
2220
2244
2221 * Applied changesets 1062 and 1064 before 0.7.1 release.
2245 * Applied changesets 1062 and 1064 before 0.7.1 release.
2222
2246
2223 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2247 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2224 see the raw input history (without conversions like %ls ->
2248 see the raw input history (without conversions like %ls ->
2225 ipmagic("ls")). After a request from W. Stein, SAGE
2249 ipmagic("ls")). After a request from W. Stein, SAGE
2226 (http://modular.ucsd.edu/sage) developer. This information is
2250 (http://modular.ucsd.edu/sage) developer. This information is
2227 stored in the input_hist_raw attribute of the IPython instance, so
2251 stored in the input_hist_raw attribute of the IPython instance, so
2228 developers can access it if needed (it's an InputList instance).
2252 developers can access it if needed (it's an InputList instance).
2229
2253
2230 * Versionstring = 0.7.2.svn
2254 * Versionstring = 0.7.2.svn
2231
2255
2232 * eggsetup.py: A separate script for constructing eggs, creates
2256 * eggsetup.py: A separate script for constructing eggs, creates
2233 proper launch scripts even on Windows (an .exe file in
2257 proper launch scripts even on Windows (an .exe file in
2234 \python24\scripts).
2258 \python24\scripts).
2235
2259
2236 * ipapi.py: launch_new_instance, launch entry point needed for the
2260 * ipapi.py: launch_new_instance, launch entry point needed for the
2237 egg.
2261 egg.
2238
2262
2239 2006-01-23 Ville Vainio <vivainio@gmail.com>
2263 2006-01-23 Ville Vainio <vivainio@gmail.com>
2240
2264
2241 * Added %cpaste magic for pasting python code
2265 * Added %cpaste magic for pasting python code
2242
2266
2243 2006-01-22 Ville Vainio <vivainio@gmail.com>
2267 2006-01-22 Ville Vainio <vivainio@gmail.com>
2244
2268
2245 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2269 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2246
2270
2247 * Versionstring = 0.7.2.svn
2271 * Versionstring = 0.7.2.svn
2248
2272
2249 * eggsetup.py: A separate script for constructing eggs, creates
2273 * eggsetup.py: A separate script for constructing eggs, creates
2250 proper launch scripts even on Windows (an .exe file in
2274 proper launch scripts even on Windows (an .exe file in
2251 \python24\scripts).
2275 \python24\scripts).
2252
2276
2253 * ipapi.py: launch_new_instance, launch entry point needed for the
2277 * ipapi.py: launch_new_instance, launch entry point needed for the
2254 egg.
2278 egg.
2255
2279
2256 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2280 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2257
2281
2258 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2282 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2259 %pfile foo would print the file for foo even if it was a binary.
2283 %pfile foo would print the file for foo even if it was a binary.
2260 Now, extensions '.so' and '.dll' are skipped.
2284 Now, extensions '.so' and '.dll' are skipped.
2261
2285
2262 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2286 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2263 bug, where macros would fail in all threaded modes. I'm not 100%
2287 bug, where macros would fail in all threaded modes. I'm not 100%
2264 sure, so I'm going to put out an rc instead of making a release
2288 sure, so I'm going to put out an rc instead of making a release
2265 today, and wait for feedback for at least a few days.
2289 today, and wait for feedback for at least a few days.
2266
2290
2267 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2291 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2268 it...) the handling of pasting external code with autoindent on.
2292 it...) the handling of pasting external code with autoindent on.
2269 To get out of a multiline input, the rule will appear for most
2293 To get out of a multiline input, the rule will appear for most
2270 users unchanged: two blank lines or change the indent level
2294 users unchanged: two blank lines or change the indent level
2271 proposed by IPython. But there is a twist now: you can
2295 proposed by IPython. But there is a twist now: you can
2272 add/subtract only *one or two spaces*. If you add/subtract three
2296 add/subtract only *one or two spaces*. If you add/subtract three
2273 or more (unless you completely delete the line), IPython will
2297 or more (unless you completely delete the line), IPython will
2274 accept that line, and you'll need to enter a second one of pure
2298 accept that line, and you'll need to enter a second one of pure
2275 whitespace. I know it sounds complicated, but I can't find a
2299 whitespace. I know it sounds complicated, but I can't find a
2276 different solution that covers all the cases, with the right
2300 different solution that covers all the cases, with the right
2277 heuristics. Hopefully in actual use, nobody will really notice
2301 heuristics. Hopefully in actual use, nobody will really notice
2278 all these strange rules and things will 'just work'.
2302 all these strange rules and things will 'just work'.
2279
2303
2280 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2304 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2281
2305
2282 * IPython/iplib.py (interact): catch exceptions which can be
2306 * IPython/iplib.py (interact): catch exceptions which can be
2283 triggered asynchronously by signal handlers. Thanks to an
2307 triggered asynchronously by signal handlers. Thanks to an
2284 automatic crash report, submitted by Colin Kingsley
2308 automatic crash report, submitted by Colin Kingsley
2285 <tercel-AT-gentoo.org>.
2309 <tercel-AT-gentoo.org>.
2286
2310
2287 2006-01-20 Ville Vainio <vivainio@gmail.com>
2311 2006-01-20 Ville Vainio <vivainio@gmail.com>
2288
2312
2289 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2313 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2290 (%rehashdir, very useful, try it out) of how to extend ipython
2314 (%rehashdir, very useful, try it out) of how to extend ipython
2291 with new magics. Also added Extensions dir to pythonpath to make
2315 with new magics. Also added Extensions dir to pythonpath to make
2292 importing extensions easy.
2316 importing extensions easy.
2293
2317
2294 * %store now complains when trying to store interactively declared
2318 * %store now complains when trying to store interactively declared
2295 classes / instances of those classes.
2319 classes / instances of those classes.
2296
2320
2297 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2321 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2298 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2322 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2299 if they exist, and ipy_user_conf.py with some defaults is created for
2323 if they exist, and ipy_user_conf.py with some defaults is created for
2300 the user.
2324 the user.
2301
2325
2302 * Startup rehashing done by the config file, not InterpreterExec.
2326 * Startup rehashing done by the config file, not InterpreterExec.
2303 This means system commands are available even without selecting the
2327 This means system commands are available even without selecting the
2304 pysh profile. It's the sensible default after all.
2328 pysh profile. It's the sensible default after all.
2305
2329
2306 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2330 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2307
2331
2308 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2332 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2309 multiline code with autoindent on working. But I am really not
2333 multiline code with autoindent on working. But I am really not
2310 sure, so this needs more testing. Will commit a debug-enabled
2334 sure, so this needs more testing. Will commit a debug-enabled
2311 version for now, while I test it some more, so that Ville and
2335 version for now, while I test it some more, so that Ville and
2312 others may also catch any problems. Also made
2336 others may also catch any problems. Also made
2313 self.indent_current_str() a method, to ensure that there's no
2337 self.indent_current_str() a method, to ensure that there's no
2314 chance of the indent space count and the corresponding string
2338 chance of the indent space count and the corresponding string
2315 falling out of sync. All code needing the string should just call
2339 falling out of sync. All code needing the string should just call
2316 the method.
2340 the method.
2317
2341
2318 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2342 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2319
2343
2320 * IPython/Magic.py (magic_edit): fix check for when users don't
2344 * IPython/Magic.py (magic_edit): fix check for when users don't
2321 save their output files, the try/except was in the wrong section.
2345 save their output files, the try/except was in the wrong section.
2322
2346
2323 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2347 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2324
2348
2325 * IPython/Magic.py (magic_run): fix __file__ global missing from
2349 * IPython/Magic.py (magic_run): fix __file__ global missing from
2326 script's namespace when executed via %run. After a report by
2350 script's namespace when executed via %run. After a report by
2327 Vivian.
2351 Vivian.
2328
2352
2329 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2353 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2330 when using python 2.4. The parent constructor changed in 2.4, and
2354 when using python 2.4. The parent constructor changed in 2.4, and
2331 we need to track it directly (we can't call it, as it messes up
2355 we need to track it directly (we can't call it, as it messes up
2332 readline and tab-completion inside our pdb would stop working).
2356 readline and tab-completion inside our pdb would stop working).
2333 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2357 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2334
2358
2335 2006-01-16 Ville Vainio <vivainio@gmail.com>
2359 2006-01-16 Ville Vainio <vivainio@gmail.com>
2336
2360
2337 * Ipython/magic.py: Reverted back to old %edit functionality
2361 * Ipython/magic.py: Reverted back to old %edit functionality
2338 that returns file contents on exit.
2362 that returns file contents on exit.
2339
2363
2340 * IPython/path.py: Added Jason Orendorff's "path" module to
2364 * IPython/path.py: Added Jason Orendorff's "path" module to
2341 IPython tree, http://www.jorendorff.com/articles/python/path/.
2365 IPython tree, http://www.jorendorff.com/articles/python/path/.
2342 You can get path objects conveniently through %sc, and !!, e.g.:
2366 You can get path objects conveniently through %sc, and !!, e.g.:
2343 sc files=ls
2367 sc files=ls
2344 for p in files.paths: # or files.p
2368 for p in files.paths: # or files.p
2345 print p,p.mtime
2369 print p,p.mtime
2346
2370
2347 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2371 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2348 now work again without considering the exclusion regexp -
2372 now work again without considering the exclusion regexp -
2349 hence, things like ',foo my/path' turn to 'foo("my/path")'
2373 hence, things like ',foo my/path' turn to 'foo("my/path")'
2350 instead of syntax error.
2374 instead of syntax error.
2351
2375
2352
2376
2353 2006-01-14 Ville Vainio <vivainio@gmail.com>
2377 2006-01-14 Ville Vainio <vivainio@gmail.com>
2354
2378
2355 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2379 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2356 ipapi decorators for python 2.4 users, options() provides access to rc
2380 ipapi decorators for python 2.4 users, options() provides access to rc
2357 data.
2381 data.
2358
2382
2359 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2383 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2360 as path separators (even on Linux ;-). Space character after
2384 as path separators (even on Linux ;-). Space character after
2361 backslash (as yielded by tab completer) is still space;
2385 backslash (as yielded by tab completer) is still space;
2362 "%cd long\ name" works as expected.
2386 "%cd long\ name" works as expected.
2363
2387
2364 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2388 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2365 as "chain of command", with priority. API stays the same,
2389 as "chain of command", with priority. API stays the same,
2366 TryNext exception raised by a hook function signals that
2390 TryNext exception raised by a hook function signals that
2367 current hook failed and next hook should try handling it, as
2391 current hook failed and next hook should try handling it, as
2368 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2392 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2369 requested configurable display hook, which is now implemented.
2393 requested configurable display hook, which is now implemented.
2370
2394
2371 2006-01-13 Ville Vainio <vivainio@gmail.com>
2395 2006-01-13 Ville Vainio <vivainio@gmail.com>
2372
2396
2373 * IPython/platutils*.py: platform specific utility functions,
2397 * IPython/platutils*.py: platform specific utility functions,
2374 so far only set_term_title is implemented (change terminal
2398 so far only set_term_title is implemented (change terminal
2375 label in windowing systems). %cd now changes the title to
2399 label in windowing systems). %cd now changes the title to
2376 current dir.
2400 current dir.
2377
2401
2378 * IPython/Release.py: Added myself to "authors" list,
2402 * IPython/Release.py: Added myself to "authors" list,
2379 had to create new files.
2403 had to create new files.
2380
2404
2381 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2405 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2382 shell escape; not a known bug but had potential to be one in the
2406 shell escape; not a known bug but had potential to be one in the
2383 future.
2407 future.
2384
2408
2385 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2409 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2386 extension API for IPython! See the module for usage example. Fix
2410 extension API for IPython! See the module for usage example. Fix
2387 OInspect for docstring-less magic functions.
2411 OInspect for docstring-less magic functions.
2388
2412
2389
2413
2390 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2414 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2391
2415
2392 * IPython/iplib.py (raw_input): temporarily deactivate all
2416 * IPython/iplib.py (raw_input): temporarily deactivate all
2393 attempts at allowing pasting of code with autoindent on. It
2417 attempts at allowing pasting of code with autoindent on. It
2394 introduced bugs (reported by Prabhu) and I can't seem to find a
2418 introduced bugs (reported by Prabhu) and I can't seem to find a
2395 robust combination which works in all cases. Will have to revisit
2419 robust combination which works in all cases. Will have to revisit
2396 later.
2420 later.
2397
2421
2398 * IPython/genutils.py: remove isspace() function. We've dropped
2422 * IPython/genutils.py: remove isspace() function. We've dropped
2399 2.2 compatibility, so it's OK to use the string method.
2423 2.2 compatibility, so it's OK to use the string method.
2400
2424
2401 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2425 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2402
2426
2403 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2427 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2404 matching what NOT to autocall on, to include all python binary
2428 matching what NOT to autocall on, to include all python binary
2405 operators (including things like 'and', 'or', 'is' and 'in').
2429 operators (including things like 'and', 'or', 'is' and 'in').
2406 Prompted by a bug report on 'foo & bar', but I realized we had
2430 Prompted by a bug report on 'foo & bar', but I realized we had
2407 many more potential bug cases with other operators. The regexp is
2431 many more potential bug cases with other operators. The regexp is
2408 self.re_exclude_auto, it's fairly commented.
2432 self.re_exclude_auto, it's fairly commented.
2409
2433
2410 2006-01-12 Ville Vainio <vivainio@gmail.com>
2434 2006-01-12 Ville Vainio <vivainio@gmail.com>
2411
2435
2412 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2436 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2413 Prettified and hardened string/backslash quoting with ipsystem(),
2437 Prettified and hardened string/backslash quoting with ipsystem(),
2414 ipalias() and ipmagic(). Now even \ characters are passed to
2438 ipalias() and ipmagic(). Now even \ characters are passed to
2415 %magics, !shell escapes and aliases exactly as they are in the
2439 %magics, !shell escapes and aliases exactly as they are in the
2416 ipython command line. Should improve backslash experience,
2440 ipython command line. Should improve backslash experience,
2417 particularly in Windows (path delimiter for some commands that
2441 particularly in Windows (path delimiter for some commands that
2418 won't understand '/'), but Unix benefits as well (regexps). %cd
2442 won't understand '/'), but Unix benefits as well (regexps). %cd
2419 magic still doesn't support backslash path delimiters, though. Also
2443 magic still doesn't support backslash path delimiters, though. Also
2420 deleted all pretense of supporting multiline command strings in
2444 deleted all pretense of supporting multiline command strings in
2421 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2445 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2422
2446
2423 * doc/build_doc_instructions.txt added. Documentation on how to
2447 * doc/build_doc_instructions.txt added. Documentation on how to
2424 use doc/update_manual.py, added yesterday. Both files contributed
2448 use doc/update_manual.py, added yesterday. Both files contributed
2425 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2449 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2426 doc/*.sh for deprecation at a later date.
2450 doc/*.sh for deprecation at a later date.
2427
2451
2428 * /ipython.py Added ipython.py to root directory for
2452 * /ipython.py Added ipython.py to root directory for
2429 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2453 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2430 ipython.py) and development convenience (no need to keep doing
2454 ipython.py) and development convenience (no need to keep doing
2431 "setup.py install" between changes).
2455 "setup.py install" between changes).
2432
2456
2433 * Made ! and !! shell escapes work (again) in multiline expressions:
2457 * Made ! and !! shell escapes work (again) in multiline expressions:
2434 if 1:
2458 if 1:
2435 !ls
2459 !ls
2436 !!ls
2460 !!ls
2437
2461
2438 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2462 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2439
2463
2440 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2464 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2441 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2465 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2442 module in case-insensitive installation. Was causing crashes
2466 module in case-insensitive installation. Was causing crashes
2443 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2467 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2444
2468
2445 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2469 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2446 <marienz-AT-gentoo.org>, closes
2470 <marienz-AT-gentoo.org>, closes
2447 http://www.scipy.net/roundup/ipython/issue51.
2471 http://www.scipy.net/roundup/ipython/issue51.
2448
2472
2449 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2473 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2450
2474
2451 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2475 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2452 problem of excessive CPU usage under *nix and keyboard lag under
2476 problem of excessive CPU usage under *nix and keyboard lag under
2453 win32.
2477 win32.
2454
2478
2455 2006-01-10 *** Released version 0.7.0
2479 2006-01-10 *** Released version 0.7.0
2456
2480
2457 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2481 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2458
2482
2459 * IPython/Release.py (revision): tag version number to 0.7.0,
2483 * IPython/Release.py (revision): tag version number to 0.7.0,
2460 ready for release.
2484 ready for release.
2461
2485
2462 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2486 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2463 it informs the user of the name of the temp. file used. This can
2487 it informs the user of the name of the temp. file used. This can
2464 help if you decide later to reuse that same file, so you know
2488 help if you decide later to reuse that same file, so you know
2465 where to copy the info from.
2489 where to copy the info from.
2466
2490
2467 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2491 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2468
2492
2469 * setup_bdist_egg.py: little script to build an egg. Added
2493 * setup_bdist_egg.py: little script to build an egg. Added
2470 support in the release tools as well.
2494 support in the release tools as well.
2471
2495
2472 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2496 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2473
2497
2474 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2498 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2475 version selection (new -wxversion command line and ipythonrc
2499 version selection (new -wxversion command line and ipythonrc
2476 parameter). Patch contributed by Arnd Baecker
2500 parameter). Patch contributed by Arnd Baecker
2477 <arnd.baecker-AT-web.de>.
2501 <arnd.baecker-AT-web.de>.
2478
2502
2479 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2503 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2480 embedded instances, for variables defined at the interactive
2504 embedded instances, for variables defined at the interactive
2481 prompt of the embedded ipython. Reported by Arnd.
2505 prompt of the embedded ipython. Reported by Arnd.
2482
2506
2483 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2507 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2484 it can be used as a (stateful) toggle, or with a direct parameter.
2508 it can be used as a (stateful) toggle, or with a direct parameter.
2485
2509
2486 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2510 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2487 could be triggered in certain cases and cause the traceback
2511 could be triggered in certain cases and cause the traceback
2488 printer not to work.
2512 printer not to work.
2489
2513
2490 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2514 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2491
2515
2492 * IPython/iplib.py (_should_recompile): Small fix, closes
2516 * IPython/iplib.py (_should_recompile): Small fix, closes
2493 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2517 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2494
2518
2495 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2519 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2496
2520
2497 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2521 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2498 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2522 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2499 Moad for help with tracking it down.
2523 Moad for help with tracking it down.
2500
2524
2501 * IPython/iplib.py (handle_auto): fix autocall handling for
2525 * IPython/iplib.py (handle_auto): fix autocall handling for
2502 objects which support BOTH __getitem__ and __call__ (so that f [x]
2526 objects which support BOTH __getitem__ and __call__ (so that f [x]
2503 is left alone, instead of becoming f([x]) automatically).
2527 is left alone, instead of becoming f([x]) automatically).
2504
2528
2505 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2529 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2506 Ville's patch.
2530 Ville's patch.
2507
2531
2508 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2532 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2509
2533
2510 * IPython/iplib.py (handle_auto): changed autocall semantics to
2534 * IPython/iplib.py (handle_auto): changed autocall semantics to
2511 include 'smart' mode, where the autocall transformation is NOT
2535 include 'smart' mode, where the autocall transformation is NOT
2512 applied if there are no arguments on the line. This allows you to
2536 applied if there are no arguments on the line. This allows you to
2513 just type 'foo' if foo is a callable to see its internal form,
2537 just type 'foo' if foo is a callable to see its internal form,
2514 instead of having it called with no arguments (typically a
2538 instead of having it called with no arguments (typically a
2515 mistake). The old 'full' autocall still exists: for that, you
2539 mistake). The old 'full' autocall still exists: for that, you
2516 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2540 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2517
2541
2518 * IPython/completer.py (Completer.attr_matches): add
2542 * IPython/completer.py (Completer.attr_matches): add
2519 tab-completion support for Enthoughts' traits. After a report by
2543 tab-completion support for Enthoughts' traits. After a report by
2520 Arnd and a patch by Prabhu.
2544 Arnd and a patch by Prabhu.
2521
2545
2522 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2546 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2523
2547
2524 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2548 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2525 Schmolck's patch to fix inspect.getinnerframes().
2549 Schmolck's patch to fix inspect.getinnerframes().
2526
2550
2527 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2551 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2528 for embedded instances, regarding handling of namespaces and items
2552 for embedded instances, regarding handling of namespaces and items
2529 added to the __builtin__ one. Multiple embedded instances and
2553 added to the __builtin__ one. Multiple embedded instances and
2530 recursive embeddings should work better now (though I'm not sure
2554 recursive embeddings should work better now (though I'm not sure
2531 I've got all the corner cases fixed, that code is a bit of a brain
2555 I've got all the corner cases fixed, that code is a bit of a brain
2532 twister).
2556 twister).
2533
2557
2534 * IPython/Magic.py (magic_edit): added support to edit in-memory
2558 * IPython/Magic.py (magic_edit): added support to edit in-memory
2535 macros (automatically creates the necessary temp files). %edit
2559 macros (automatically creates the necessary temp files). %edit
2536 also doesn't return the file contents anymore, it's just noise.
2560 also doesn't return the file contents anymore, it's just noise.
2537
2561
2538 * IPython/completer.py (Completer.attr_matches): revert change to
2562 * IPython/completer.py (Completer.attr_matches): revert change to
2539 complete only on attributes listed in __all__. I realized it
2563 complete only on attributes listed in __all__. I realized it
2540 cripples the tab-completion system as a tool for exploring the
2564 cripples the tab-completion system as a tool for exploring the
2541 internals of unknown libraries (it renders any non-__all__
2565 internals of unknown libraries (it renders any non-__all__
2542 attribute off-limits). I got bit by this when trying to see
2566 attribute off-limits). I got bit by this when trying to see
2543 something inside the dis module.
2567 something inside the dis module.
2544
2568
2545 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2569 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2546
2570
2547 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2571 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2548 namespace for users and extension writers to hold data in. This
2572 namespace for users and extension writers to hold data in. This
2549 follows the discussion in
2573 follows the discussion in
2550 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2574 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2551
2575
2552 * IPython/completer.py (IPCompleter.complete): small patch to help
2576 * IPython/completer.py (IPCompleter.complete): small patch to help
2553 tab-completion under Emacs, after a suggestion by John Barnard
2577 tab-completion under Emacs, after a suggestion by John Barnard
2554 <barnarj-AT-ccf.org>.
2578 <barnarj-AT-ccf.org>.
2555
2579
2556 * IPython/Magic.py (Magic.extract_input_slices): added support for
2580 * IPython/Magic.py (Magic.extract_input_slices): added support for
2557 the slice notation in magics to use N-M to represent numbers N...M
2581 the slice notation in magics to use N-M to represent numbers N...M
2558 (closed endpoints). This is used by %macro and %save.
2582 (closed endpoints). This is used by %macro and %save.
2559
2583
2560 * IPython/completer.py (Completer.attr_matches): for modules which
2584 * IPython/completer.py (Completer.attr_matches): for modules which
2561 define __all__, complete only on those. After a patch by Jeffrey
2585 define __all__, complete only on those. After a patch by Jeffrey
2562 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2586 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2563 speed up this routine.
2587 speed up this routine.
2564
2588
2565 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2589 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2566 don't know if this is the end of it, but the behavior now is
2590 don't know if this is the end of it, but the behavior now is
2567 certainly much more correct. Note that coupled with macros,
2591 certainly much more correct. Note that coupled with macros,
2568 slightly surprising (at first) behavior may occur: a macro will in
2592 slightly surprising (at first) behavior may occur: a macro will in
2569 general expand to multiple lines of input, so upon exiting, the
2593 general expand to multiple lines of input, so upon exiting, the
2570 in/out counters will both be bumped by the corresponding amount
2594 in/out counters will both be bumped by the corresponding amount
2571 (as if the macro's contents had been typed interactively). Typing
2595 (as if the macro's contents had been typed interactively). Typing
2572 %hist will reveal the intermediate (silently processed) lines.
2596 %hist will reveal the intermediate (silently processed) lines.
2573
2597
2574 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2598 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2575 pickle to fail (%run was overwriting __main__ and not restoring
2599 pickle to fail (%run was overwriting __main__ and not restoring
2576 it, but pickle relies on __main__ to operate).
2600 it, but pickle relies on __main__ to operate).
2577
2601
2578 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2602 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2579 using properties, but forgot to make the main InteractiveShell
2603 using properties, but forgot to make the main InteractiveShell
2580 class a new-style class. Properties fail silently, and
2604 class a new-style class. Properties fail silently, and
2581 mysteriously, with old-style class (getters work, but
2605 mysteriously, with old-style class (getters work, but
2582 setters don't do anything).
2606 setters don't do anything).
2583
2607
2584 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2608 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2585
2609
2586 * IPython/Magic.py (magic_history): fix history reporting bug (I
2610 * IPython/Magic.py (magic_history): fix history reporting bug (I
2587 know some nasties are still there, I just can't seem to find a
2611 know some nasties are still there, I just can't seem to find a
2588 reproducible test case to track them down; the input history is
2612 reproducible test case to track them down; the input history is
2589 falling out of sync...)
2613 falling out of sync...)
2590
2614
2591 * IPython/iplib.py (handle_shell_escape): fix bug where both
2615 * IPython/iplib.py (handle_shell_escape): fix bug where both
2592 aliases and system accesses where broken for indented code (such
2616 aliases and system accesses where broken for indented code (such
2593 as loops).
2617 as loops).
2594
2618
2595 * IPython/genutils.py (shell): fix small but critical bug for
2619 * IPython/genutils.py (shell): fix small but critical bug for
2596 win32 system access.
2620 win32 system access.
2597
2621
2598 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2622 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2599
2623
2600 * IPython/iplib.py (showtraceback): remove use of the
2624 * IPython/iplib.py (showtraceback): remove use of the
2601 sys.last_{type/value/traceback} structures, which are non
2625 sys.last_{type/value/traceback} structures, which are non
2602 thread-safe.
2626 thread-safe.
2603 (_prefilter): change control flow to ensure that we NEVER
2627 (_prefilter): change control flow to ensure that we NEVER
2604 introspect objects when autocall is off. This will guarantee that
2628 introspect objects when autocall is off. This will guarantee that
2605 having an input line of the form 'x.y', where access to attribute
2629 having an input line of the form 'x.y', where access to attribute
2606 'y' has side effects, doesn't trigger the side effect TWICE. It
2630 'y' has side effects, doesn't trigger the side effect TWICE. It
2607 is important to note that, with autocall on, these side effects
2631 is important to note that, with autocall on, these side effects
2608 can still happen.
2632 can still happen.
2609 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2633 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2610 trio. IPython offers these three kinds of special calls which are
2634 trio. IPython offers these three kinds of special calls which are
2611 not python code, and it's a good thing to have their call method
2635 not python code, and it's a good thing to have their call method
2612 be accessible as pure python functions (not just special syntax at
2636 be accessible as pure python functions (not just special syntax at
2613 the command line). It gives us a better internal implementation
2637 the command line). It gives us a better internal implementation
2614 structure, as well as exposing these for user scripting more
2638 structure, as well as exposing these for user scripting more
2615 cleanly.
2639 cleanly.
2616
2640
2617 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2641 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2618 file. Now that they'll be more likely to be used with the
2642 file. Now that they'll be more likely to be used with the
2619 persistance system (%store), I want to make sure their module path
2643 persistance system (%store), I want to make sure their module path
2620 doesn't change in the future, so that we don't break things for
2644 doesn't change in the future, so that we don't break things for
2621 users' persisted data.
2645 users' persisted data.
2622
2646
2623 * IPython/iplib.py (autoindent_update): move indentation
2647 * IPython/iplib.py (autoindent_update): move indentation
2624 management into the _text_ processing loop, not the keyboard
2648 management into the _text_ processing loop, not the keyboard
2625 interactive one. This is necessary to correctly process non-typed
2649 interactive one. This is necessary to correctly process non-typed
2626 multiline input (such as macros).
2650 multiline input (such as macros).
2627
2651
2628 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2652 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2629 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2653 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2630 which was producing problems in the resulting manual.
2654 which was producing problems in the resulting manual.
2631 (magic_whos): improve reporting of instances (show their class,
2655 (magic_whos): improve reporting of instances (show their class,
2632 instead of simply printing 'instance' which isn't terribly
2656 instead of simply printing 'instance' which isn't terribly
2633 informative).
2657 informative).
2634
2658
2635 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2659 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2636 (minor mods) to support network shares under win32.
2660 (minor mods) to support network shares under win32.
2637
2661
2638 * IPython/winconsole.py (get_console_size): add new winconsole
2662 * IPython/winconsole.py (get_console_size): add new winconsole
2639 module and fixes to page_dumb() to improve its behavior under
2663 module and fixes to page_dumb() to improve its behavior under
2640 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2664 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2641
2665
2642 * IPython/Magic.py (Macro): simplified Macro class to just
2666 * IPython/Magic.py (Macro): simplified Macro class to just
2643 subclass list. We've had only 2.2 compatibility for a very long
2667 subclass list. We've had only 2.2 compatibility for a very long
2644 time, yet I was still avoiding subclassing the builtin types. No
2668 time, yet I was still avoiding subclassing the builtin types. No
2645 more (I'm also starting to use properties, though I won't shift to
2669 more (I'm also starting to use properties, though I won't shift to
2646 2.3-specific features quite yet).
2670 2.3-specific features quite yet).
2647 (magic_store): added Ville's patch for lightweight variable
2671 (magic_store): added Ville's patch for lightweight variable
2648 persistence, after a request on the user list by Matt Wilkie
2672 persistence, after a request on the user list by Matt Wilkie
2649 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2673 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2650 details.
2674 details.
2651
2675
2652 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2676 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2653 changed the default logfile name from 'ipython.log' to
2677 changed the default logfile name from 'ipython.log' to
2654 'ipython_log.py'. These logs are real python files, and now that
2678 'ipython_log.py'. These logs are real python files, and now that
2655 we have much better multiline support, people are more likely to
2679 we have much better multiline support, people are more likely to
2656 want to use them as such. Might as well name them correctly.
2680 want to use them as such. Might as well name them correctly.
2657
2681
2658 * IPython/Magic.py: substantial cleanup. While we can't stop
2682 * IPython/Magic.py: substantial cleanup. While we can't stop
2659 using magics as mixins, due to the existing customizations 'out
2683 using magics as mixins, due to the existing customizations 'out
2660 there' which rely on the mixin naming conventions, at least I
2684 there' which rely on the mixin naming conventions, at least I
2661 cleaned out all cross-class name usage. So once we are OK with
2685 cleaned out all cross-class name usage. So once we are OK with
2662 breaking compatibility, the two systems can be separated.
2686 breaking compatibility, the two systems can be separated.
2663
2687
2664 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2688 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2665 anymore, and the class is a fair bit less hideous as well. New
2689 anymore, and the class is a fair bit less hideous as well. New
2666 features were also introduced: timestamping of input, and logging
2690 features were also introduced: timestamping of input, and logging
2667 of output results. These are user-visible with the -t and -o
2691 of output results. These are user-visible with the -t and -o
2668 options to %logstart. Closes
2692 options to %logstart. Closes
2669 http://www.scipy.net/roundup/ipython/issue11 and a request by
2693 http://www.scipy.net/roundup/ipython/issue11 and a request by
2670 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2694 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2671
2695
2672 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2696 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2673
2697
2674 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2698 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2675 better handle backslashes in paths. See the thread 'More Windows
2699 better handle backslashes in paths. See the thread 'More Windows
2676 questions part 2 - \/ characters revisited' on the iypthon user
2700 questions part 2 - \/ characters revisited' on the iypthon user
2677 list:
2701 list:
2678 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2702 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2679
2703
2680 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2704 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2681
2705
2682 (InteractiveShell.__init__): change threaded shells to not use the
2706 (InteractiveShell.__init__): change threaded shells to not use the
2683 ipython crash handler. This was causing more problems than not,
2707 ipython crash handler. This was causing more problems than not,
2684 as exceptions in the main thread (GUI code, typically) would
2708 as exceptions in the main thread (GUI code, typically) would
2685 always show up as a 'crash', when they really weren't.
2709 always show up as a 'crash', when they really weren't.
2686
2710
2687 The colors and exception mode commands (%colors/%xmode) have been
2711 The colors and exception mode commands (%colors/%xmode) have been
2688 synchronized to also take this into account, so users can get
2712 synchronized to also take this into account, so users can get
2689 verbose exceptions for their threaded code as well. I also added
2713 verbose exceptions for their threaded code as well. I also added
2690 support for activating pdb inside this exception handler as well,
2714 support for activating pdb inside this exception handler as well,
2691 so now GUI authors can use IPython's enhanced pdb at runtime.
2715 so now GUI authors can use IPython's enhanced pdb at runtime.
2692
2716
2693 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2717 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2694 true by default, and add it to the shipped ipythonrc file. Since
2718 true by default, and add it to the shipped ipythonrc file. Since
2695 this asks the user before proceeding, I think it's OK to make it
2719 this asks the user before proceeding, I think it's OK to make it
2696 true by default.
2720 true by default.
2697
2721
2698 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2722 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2699 of the previous special-casing of input in the eval loop. I think
2723 of the previous special-casing of input in the eval loop. I think
2700 this is cleaner, as they really are commands and shouldn't have
2724 this is cleaner, as they really are commands and shouldn't have
2701 a special role in the middle of the core code.
2725 a special role in the middle of the core code.
2702
2726
2703 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2727 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2704
2728
2705 * IPython/iplib.py (edit_syntax_error): added support for
2729 * IPython/iplib.py (edit_syntax_error): added support for
2706 automatically reopening the editor if the file had a syntax error
2730 automatically reopening the editor if the file had a syntax error
2707 in it. Thanks to scottt who provided the patch at:
2731 in it. Thanks to scottt who provided the patch at:
2708 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2732 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2709 version committed).
2733 version committed).
2710
2734
2711 * IPython/iplib.py (handle_normal): add suport for multi-line
2735 * IPython/iplib.py (handle_normal): add suport for multi-line
2712 input with emtpy lines. This fixes
2736 input with emtpy lines. This fixes
2713 http://www.scipy.net/roundup/ipython/issue43 and a similar
2737 http://www.scipy.net/roundup/ipython/issue43 and a similar
2714 discussion on the user list.
2738 discussion on the user list.
2715
2739
2716 WARNING: a behavior change is necessarily introduced to support
2740 WARNING: a behavior change is necessarily introduced to support
2717 blank lines: now a single blank line with whitespace does NOT
2741 blank lines: now a single blank line with whitespace does NOT
2718 break the input loop, which means that when autoindent is on, by
2742 break the input loop, which means that when autoindent is on, by
2719 default hitting return on the next (indented) line does NOT exit.
2743 default hitting return on the next (indented) line does NOT exit.
2720
2744
2721 Instead, to exit a multiline input you can either have:
2745 Instead, to exit a multiline input you can either have:
2722
2746
2723 - TWO whitespace lines (just hit return again), or
2747 - TWO whitespace lines (just hit return again), or
2724 - a single whitespace line of a different length than provided
2748 - a single whitespace line of a different length than provided
2725 by the autoindent (add or remove a space).
2749 by the autoindent (add or remove a space).
2726
2750
2727 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2751 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2728 module to better organize all readline-related functionality.
2752 module to better organize all readline-related functionality.
2729 I've deleted FlexCompleter and put all completion clases here.
2753 I've deleted FlexCompleter and put all completion clases here.
2730
2754
2731 * IPython/iplib.py (raw_input): improve indentation management.
2755 * IPython/iplib.py (raw_input): improve indentation management.
2732 It is now possible to paste indented code with autoindent on, and
2756 It is now possible to paste indented code with autoindent on, and
2733 the code is interpreted correctly (though it still looks bad on
2757 the code is interpreted correctly (though it still looks bad on
2734 screen, due to the line-oriented nature of ipython).
2758 screen, due to the line-oriented nature of ipython).
2735 (MagicCompleter.complete): change behavior so that a TAB key on an
2759 (MagicCompleter.complete): change behavior so that a TAB key on an
2736 otherwise empty line actually inserts a tab, instead of completing
2760 otherwise empty line actually inserts a tab, instead of completing
2737 on the entire global namespace. This makes it easier to use the
2761 on the entire global namespace. This makes it easier to use the
2738 TAB key for indentation. After a request by Hans Meine
2762 TAB key for indentation. After a request by Hans Meine
2739 <hans_meine-AT-gmx.net>
2763 <hans_meine-AT-gmx.net>
2740 (_prefilter): add support so that typing plain 'exit' or 'quit'
2764 (_prefilter): add support so that typing plain 'exit' or 'quit'
2741 does a sensible thing. Originally I tried to deviate as little as
2765 does a sensible thing. Originally I tried to deviate as little as
2742 possible from the default python behavior, but even that one may
2766 possible from the default python behavior, but even that one may
2743 change in this direction (thread on python-dev to that effect).
2767 change in this direction (thread on python-dev to that effect).
2744 Regardless, ipython should do the right thing even if CPython's
2768 Regardless, ipython should do the right thing even if CPython's
2745 '>>>' prompt doesn't.
2769 '>>>' prompt doesn't.
2746 (InteractiveShell): removed subclassing code.InteractiveConsole
2770 (InteractiveShell): removed subclassing code.InteractiveConsole
2747 class. By now we'd overridden just about all of its methods: I've
2771 class. By now we'd overridden just about all of its methods: I've
2748 copied the remaining two over, and now ipython is a standalone
2772 copied the remaining two over, and now ipython is a standalone
2749 class. This will provide a clearer picture for the chainsaw
2773 class. This will provide a clearer picture for the chainsaw
2750 branch refactoring.
2774 branch refactoring.
2751
2775
2752 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2776 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2753
2777
2754 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2778 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2755 failures for objects which break when dir() is called on them.
2779 failures for objects which break when dir() is called on them.
2756
2780
2757 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2781 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2758 distinct local and global namespaces in the completer API. This
2782 distinct local and global namespaces in the completer API. This
2759 change allows us to properly handle completion with distinct
2783 change allows us to properly handle completion with distinct
2760 scopes, including in embedded instances (this had never really
2784 scopes, including in embedded instances (this had never really
2761 worked correctly).
2785 worked correctly).
2762
2786
2763 Note: this introduces a change in the constructor for
2787 Note: this introduces a change in the constructor for
2764 MagicCompleter, as a new global_namespace parameter is now the
2788 MagicCompleter, as a new global_namespace parameter is now the
2765 second argument (the others were bumped one position).
2789 second argument (the others were bumped one position).
2766
2790
2767 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2791 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2768
2792
2769 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2793 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2770 embedded instances (which can be done now thanks to Vivian's
2794 embedded instances (which can be done now thanks to Vivian's
2771 frame-handling fixes for pdb).
2795 frame-handling fixes for pdb).
2772 (InteractiveShell.__init__): Fix namespace handling problem in
2796 (InteractiveShell.__init__): Fix namespace handling problem in
2773 embedded instances. We were overwriting __main__ unconditionally,
2797 embedded instances. We were overwriting __main__ unconditionally,
2774 and this should only be done for 'full' (non-embedded) IPython;
2798 and this should only be done for 'full' (non-embedded) IPython;
2775 embedded instances must respect the caller's __main__. Thanks to
2799 embedded instances must respect the caller's __main__. Thanks to
2776 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2800 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2777
2801
2778 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2802 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2779
2803
2780 * setup.py: added download_url to setup(). This registers the
2804 * setup.py: added download_url to setup(). This registers the
2781 download address at PyPI, which is not only useful to humans
2805 download address at PyPI, which is not only useful to humans
2782 browsing the site, but is also picked up by setuptools (the Eggs
2806 browsing the site, but is also picked up by setuptools (the Eggs
2783 machinery). Thanks to Ville and R. Kern for the info/discussion
2807 machinery). Thanks to Ville and R. Kern for the info/discussion
2784 on this.
2808 on this.
2785
2809
2786 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2810 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2787
2811
2788 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2812 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2789 This brings a lot of nice functionality to the pdb mode, which now
2813 This brings a lot of nice functionality to the pdb mode, which now
2790 has tab-completion, syntax highlighting, and better stack handling
2814 has tab-completion, syntax highlighting, and better stack handling
2791 than before. Many thanks to Vivian De Smedt
2815 than before. Many thanks to Vivian De Smedt
2792 <vivian-AT-vdesmedt.com> for the original patches.
2816 <vivian-AT-vdesmedt.com> for the original patches.
2793
2817
2794 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2818 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2795
2819
2796 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2820 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2797 sequence to consistently accept the banner argument. The
2821 sequence to consistently accept the banner argument. The
2798 inconsistency was tripping SAGE, thanks to Gary Zablackis
2822 inconsistency was tripping SAGE, thanks to Gary Zablackis
2799 <gzabl-AT-yahoo.com> for the report.
2823 <gzabl-AT-yahoo.com> for the report.
2800
2824
2801 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2825 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2802
2826
2803 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2827 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2804 Fix bug where a naked 'alias' call in the ipythonrc file would
2828 Fix bug where a naked 'alias' call in the ipythonrc file would
2805 cause a crash. Bug reported by Jorgen Stenarson.
2829 cause a crash. Bug reported by Jorgen Stenarson.
2806
2830
2807 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2831 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2808
2832
2809 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2833 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2810 startup time.
2834 startup time.
2811
2835
2812 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2836 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2813 instances had introduced a bug with globals in normal code. Now
2837 instances had introduced a bug with globals in normal code. Now
2814 it's working in all cases.
2838 it's working in all cases.
2815
2839
2816 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2840 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2817 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2841 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2818 has been introduced to set the default case sensitivity of the
2842 has been introduced to set the default case sensitivity of the
2819 searches. Users can still select either mode at runtime on a
2843 searches. Users can still select either mode at runtime on a
2820 per-search basis.
2844 per-search basis.
2821
2845
2822 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2846 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2823
2847
2824 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2848 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2825 attributes in wildcard searches for subclasses. Modified version
2849 attributes in wildcard searches for subclasses. Modified version
2826 of a patch by Jorgen.
2850 of a patch by Jorgen.
2827
2851
2828 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2852 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2829
2853
2830 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2854 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2831 embedded instances. I added a user_global_ns attribute to the
2855 embedded instances. I added a user_global_ns attribute to the
2832 InteractiveShell class to handle this.
2856 InteractiveShell class to handle this.
2833
2857
2834 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2858 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2835
2859
2836 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2860 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2837 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2861 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2838 (reported under win32, but may happen also in other platforms).
2862 (reported under win32, but may happen also in other platforms).
2839 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2863 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2840
2864
2841 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2865 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2842
2866
2843 * IPython/Magic.py (magic_psearch): new support for wildcard
2867 * IPython/Magic.py (magic_psearch): new support for wildcard
2844 patterns. Now, typing ?a*b will list all names which begin with a
2868 patterns. Now, typing ?a*b will list all names which begin with a
2845 and end in b, for example. The %psearch magic has full
2869 and end in b, for example. The %psearch magic has full
2846 docstrings. Many thanks to JΓΆrgen Stenarson
2870 docstrings. Many thanks to JΓΆrgen Stenarson
2847 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2871 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2848 implementing this functionality.
2872 implementing this functionality.
2849
2873
2850 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2874 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2851
2875
2852 * Manual: fixed long-standing annoyance of double-dashes (as in
2876 * Manual: fixed long-standing annoyance of double-dashes (as in
2853 --prefix=~, for example) being stripped in the HTML version. This
2877 --prefix=~, for example) being stripped in the HTML version. This
2854 is a latex2html bug, but a workaround was provided. Many thanks
2878 is a latex2html bug, but a workaround was provided. Many thanks
2855 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2879 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2856 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2880 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2857 rolling. This seemingly small issue had tripped a number of users
2881 rolling. This seemingly small issue had tripped a number of users
2858 when first installing, so I'm glad to see it gone.
2882 when first installing, so I'm glad to see it gone.
2859
2883
2860 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2884 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2861
2885
2862 * IPython/Extensions/numeric_formats.py: fix missing import,
2886 * IPython/Extensions/numeric_formats.py: fix missing import,
2863 reported by Stephen Walton.
2887 reported by Stephen Walton.
2864
2888
2865 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2889 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2866
2890
2867 * IPython/demo.py: finish demo module, fully documented now.
2891 * IPython/demo.py: finish demo module, fully documented now.
2868
2892
2869 * IPython/genutils.py (file_read): simple little utility to read a
2893 * IPython/genutils.py (file_read): simple little utility to read a
2870 file and ensure it's closed afterwards.
2894 file and ensure it's closed afterwards.
2871
2895
2872 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2896 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2873
2897
2874 * IPython/demo.py (Demo.__init__): added support for individually
2898 * IPython/demo.py (Demo.__init__): added support for individually
2875 tagging blocks for automatic execution.
2899 tagging blocks for automatic execution.
2876
2900
2877 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2901 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2878 syntax-highlighted python sources, requested by John.
2902 syntax-highlighted python sources, requested by John.
2879
2903
2880 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2904 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2881
2905
2882 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2906 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2883 finishing.
2907 finishing.
2884
2908
2885 * IPython/genutils.py (shlex_split): moved from Magic to here,
2909 * IPython/genutils.py (shlex_split): moved from Magic to here,
2886 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2910 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2887
2911
2888 * IPython/demo.py (Demo.__init__): added support for silent
2912 * IPython/demo.py (Demo.__init__): added support for silent
2889 blocks, improved marks as regexps, docstrings written.
2913 blocks, improved marks as regexps, docstrings written.
2890 (Demo.__init__): better docstring, added support for sys.argv.
2914 (Demo.__init__): better docstring, added support for sys.argv.
2891
2915
2892 * IPython/genutils.py (marquee): little utility used by the demo
2916 * IPython/genutils.py (marquee): little utility used by the demo
2893 code, handy in general.
2917 code, handy in general.
2894
2918
2895 * IPython/demo.py (Demo.__init__): new class for interactive
2919 * IPython/demo.py (Demo.__init__): new class for interactive
2896 demos. Not documented yet, I just wrote it in a hurry for
2920 demos. Not documented yet, I just wrote it in a hurry for
2897 scipy'05. Will docstring later.
2921 scipy'05. Will docstring later.
2898
2922
2899 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2923 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2900
2924
2901 * IPython/Shell.py (sigint_handler): Drastic simplification which
2925 * IPython/Shell.py (sigint_handler): Drastic simplification which
2902 also seems to make Ctrl-C work correctly across threads! This is
2926 also seems to make Ctrl-C work correctly across threads! This is
2903 so simple, that I can't beleive I'd missed it before. Needs more
2927 so simple, that I can't beleive I'd missed it before. Needs more
2904 testing, though.
2928 testing, though.
2905 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2929 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2906 like this before...
2930 like this before...
2907
2931
2908 * IPython/genutils.py (get_home_dir): add protection against
2932 * IPython/genutils.py (get_home_dir): add protection against
2909 non-dirs in win32 registry.
2933 non-dirs in win32 registry.
2910
2934
2911 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2935 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2912 bug where dict was mutated while iterating (pysh crash).
2936 bug where dict was mutated while iterating (pysh crash).
2913
2937
2914 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2938 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2915
2939
2916 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2940 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2917 spurious newlines added by this routine. After a report by
2941 spurious newlines added by this routine. After a report by
2918 F. Mantegazza.
2942 F. Mantegazza.
2919
2943
2920 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2944 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2921
2945
2922 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2946 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2923 calls. These were a leftover from the GTK 1.x days, and can cause
2947 calls. These were a leftover from the GTK 1.x days, and can cause
2924 problems in certain cases (after a report by John Hunter).
2948 problems in certain cases (after a report by John Hunter).
2925
2949
2926 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2950 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2927 os.getcwd() fails at init time. Thanks to patch from David Remahl
2951 os.getcwd() fails at init time. Thanks to patch from David Remahl
2928 <chmod007-AT-mac.com>.
2952 <chmod007-AT-mac.com>.
2929 (InteractiveShell.__init__): prevent certain special magics from
2953 (InteractiveShell.__init__): prevent certain special magics from
2930 being shadowed by aliases. Closes
2954 being shadowed by aliases. Closes
2931 http://www.scipy.net/roundup/ipython/issue41.
2955 http://www.scipy.net/roundup/ipython/issue41.
2932
2956
2933 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2957 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2934
2958
2935 * IPython/iplib.py (InteractiveShell.complete): Added new
2959 * IPython/iplib.py (InteractiveShell.complete): Added new
2936 top-level completion method to expose the completion mechanism
2960 top-level completion method to expose the completion mechanism
2937 beyond readline-based environments.
2961 beyond readline-based environments.
2938
2962
2939 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2963 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2940
2964
2941 * tools/ipsvnc (svnversion): fix svnversion capture.
2965 * tools/ipsvnc (svnversion): fix svnversion capture.
2942
2966
2943 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2967 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2944 attribute to self, which was missing. Before, it was set by a
2968 attribute to self, which was missing. Before, it was set by a
2945 routine which in certain cases wasn't being called, so the
2969 routine which in certain cases wasn't being called, so the
2946 instance could end up missing the attribute. This caused a crash.
2970 instance could end up missing the attribute. This caused a crash.
2947 Closes http://www.scipy.net/roundup/ipython/issue40.
2971 Closes http://www.scipy.net/roundup/ipython/issue40.
2948
2972
2949 2005-08-16 Fernando Perez <fperez@colorado.edu>
2973 2005-08-16 Fernando Perez <fperez@colorado.edu>
2950
2974
2951 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2975 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2952 contains non-string attribute. Closes
2976 contains non-string attribute. Closes
2953 http://www.scipy.net/roundup/ipython/issue38.
2977 http://www.scipy.net/roundup/ipython/issue38.
2954
2978
2955 2005-08-14 Fernando Perez <fperez@colorado.edu>
2979 2005-08-14 Fernando Perez <fperez@colorado.edu>
2956
2980
2957 * tools/ipsvnc: Minor improvements, to add changeset info.
2981 * tools/ipsvnc: Minor improvements, to add changeset info.
2958
2982
2959 2005-08-12 Fernando Perez <fperez@colorado.edu>
2983 2005-08-12 Fernando Perez <fperez@colorado.edu>
2960
2984
2961 * IPython/iplib.py (runsource): remove self.code_to_run_src
2985 * IPython/iplib.py (runsource): remove self.code_to_run_src
2962 attribute. I realized this is nothing more than
2986 attribute. I realized this is nothing more than
2963 '\n'.join(self.buffer), and having the same data in two different
2987 '\n'.join(self.buffer), and having the same data in two different
2964 places is just asking for synchronization bugs. This may impact
2988 places is just asking for synchronization bugs. This may impact
2965 people who have custom exception handlers, so I need to warn
2989 people who have custom exception handlers, so I need to warn
2966 ipython-dev about it (F. Mantegazza may use them).
2990 ipython-dev about it (F. Mantegazza may use them).
2967
2991
2968 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2992 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2969
2993
2970 * IPython/genutils.py: fix 2.2 compatibility (generators)
2994 * IPython/genutils.py: fix 2.2 compatibility (generators)
2971
2995
2972 2005-07-18 Fernando Perez <fperez@colorado.edu>
2996 2005-07-18 Fernando Perez <fperez@colorado.edu>
2973
2997
2974 * IPython/genutils.py (get_home_dir): fix to help users with
2998 * IPython/genutils.py (get_home_dir): fix to help users with
2975 invalid $HOME under win32.
2999 invalid $HOME under win32.
2976
3000
2977 2005-07-17 Fernando Perez <fperez@colorado.edu>
3001 2005-07-17 Fernando Perez <fperez@colorado.edu>
2978
3002
2979 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3003 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2980 some old hacks and clean up a bit other routines; code should be
3004 some old hacks and clean up a bit other routines; code should be
2981 simpler and a bit faster.
3005 simpler and a bit faster.
2982
3006
2983 * IPython/iplib.py (interact): removed some last-resort attempts
3007 * IPython/iplib.py (interact): removed some last-resort attempts
2984 to survive broken stdout/stderr. That code was only making it
3008 to survive broken stdout/stderr. That code was only making it
2985 harder to abstract out the i/o (necessary for gui integration),
3009 harder to abstract out the i/o (necessary for gui integration),
2986 and the crashes it could prevent were extremely rare in practice
3010 and the crashes it could prevent were extremely rare in practice
2987 (besides being fully user-induced in a pretty violent manner).
3011 (besides being fully user-induced in a pretty violent manner).
2988
3012
2989 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3013 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2990 Nothing major yet, but the code is simpler to read; this should
3014 Nothing major yet, but the code is simpler to read; this should
2991 make it easier to do more serious modifications in the future.
3015 make it easier to do more serious modifications in the future.
2992
3016
2993 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3017 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2994 which broke in .15 (thanks to a report by Ville).
3018 which broke in .15 (thanks to a report by Ville).
2995
3019
2996 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3020 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2997 be quite correct, I know next to nothing about unicode). This
3021 be quite correct, I know next to nothing about unicode). This
2998 will allow unicode strings to be used in prompts, amongst other
3022 will allow unicode strings to be used in prompts, amongst other
2999 cases. It also will prevent ipython from crashing when unicode
3023 cases. It also will prevent ipython from crashing when unicode
3000 shows up unexpectedly in many places. If ascii encoding fails, we
3024 shows up unexpectedly in many places. If ascii encoding fails, we
3001 assume utf_8. Currently the encoding is not a user-visible
3025 assume utf_8. Currently the encoding is not a user-visible
3002 setting, though it could be made so if there is demand for it.
3026 setting, though it could be made so if there is demand for it.
3003
3027
3004 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3028 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3005
3029
3006 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3030 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3007
3031
3008 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3032 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3009
3033
3010 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3034 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3011 code can work transparently for 2.2/2.3.
3035 code can work transparently for 2.2/2.3.
3012
3036
3013 2005-07-16 Fernando Perez <fperez@colorado.edu>
3037 2005-07-16 Fernando Perez <fperez@colorado.edu>
3014
3038
3015 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3039 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3016 out of the color scheme table used for coloring exception
3040 out of the color scheme table used for coloring exception
3017 tracebacks. This allows user code to add new schemes at runtime.
3041 tracebacks. This allows user code to add new schemes at runtime.
3018 This is a minimally modified version of the patch at
3042 This is a minimally modified version of the patch at
3019 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3043 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3020 for the contribution.
3044 for the contribution.
3021
3045
3022 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3046 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3023 slightly modified version of the patch in
3047 slightly modified version of the patch in
3024 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3048 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3025 to remove the previous try/except solution (which was costlier).
3049 to remove the previous try/except solution (which was costlier).
3026 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3050 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3027
3051
3028 2005-06-08 Fernando Perez <fperez@colorado.edu>
3052 2005-06-08 Fernando Perez <fperez@colorado.edu>
3029
3053
3030 * IPython/iplib.py (write/write_err): Add methods to abstract all
3054 * IPython/iplib.py (write/write_err): Add methods to abstract all
3031 I/O a bit more.
3055 I/O a bit more.
3032
3056
3033 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3057 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3034 warning, reported by Aric Hagberg, fix by JD Hunter.
3058 warning, reported by Aric Hagberg, fix by JD Hunter.
3035
3059
3036 2005-06-02 *** Released version 0.6.15
3060 2005-06-02 *** Released version 0.6.15
3037
3061
3038 2005-06-01 Fernando Perez <fperez@colorado.edu>
3062 2005-06-01 Fernando Perez <fperez@colorado.edu>
3039
3063
3040 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3064 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3041 tab-completion of filenames within open-quoted strings. Note that
3065 tab-completion of filenames within open-quoted strings. Note that
3042 this requires that in ~/.ipython/ipythonrc, users change the
3066 this requires that in ~/.ipython/ipythonrc, users change the
3043 readline delimiters configuration to read:
3067 readline delimiters configuration to read:
3044
3068
3045 readline_remove_delims -/~
3069 readline_remove_delims -/~
3046
3070
3047
3071
3048 2005-05-31 *** Released version 0.6.14
3072 2005-05-31 *** Released version 0.6.14
3049
3073
3050 2005-05-29 Fernando Perez <fperez@colorado.edu>
3074 2005-05-29 Fernando Perez <fperez@colorado.edu>
3051
3075
3052 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3076 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3053 with files not on the filesystem. Reported by Eliyahu Sandler
3077 with files not on the filesystem. Reported by Eliyahu Sandler
3054 <eli@gondolin.net>
3078 <eli@gondolin.net>
3055
3079
3056 2005-05-22 Fernando Perez <fperez@colorado.edu>
3080 2005-05-22 Fernando Perez <fperez@colorado.edu>
3057
3081
3058 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3082 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3059 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3083 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3060
3084
3061 2005-05-19 Fernando Perez <fperez@colorado.edu>
3085 2005-05-19 Fernando Perez <fperez@colorado.edu>
3062
3086
3063 * IPython/iplib.py (safe_execfile): close a file which could be
3087 * IPython/iplib.py (safe_execfile): close a file which could be
3064 left open (causing problems in win32, which locks open files).
3088 left open (causing problems in win32, which locks open files).
3065 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3089 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3066
3090
3067 2005-05-18 Fernando Perez <fperez@colorado.edu>
3091 2005-05-18 Fernando Perez <fperez@colorado.edu>
3068
3092
3069 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3093 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3070 keyword arguments correctly to safe_execfile().
3094 keyword arguments correctly to safe_execfile().
3071
3095
3072 2005-05-13 Fernando Perez <fperez@colorado.edu>
3096 2005-05-13 Fernando Perez <fperez@colorado.edu>
3073
3097
3074 * ipython.1: Added info about Qt to manpage, and threads warning
3098 * ipython.1: Added info about Qt to manpage, and threads warning
3075 to usage page (invoked with --help).
3099 to usage page (invoked with --help).
3076
3100
3077 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3101 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3078 new matcher (it goes at the end of the priority list) to do
3102 new matcher (it goes at the end of the priority list) to do
3079 tab-completion on named function arguments. Submitted by George
3103 tab-completion on named function arguments. Submitted by George
3080 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3104 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3081 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3105 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3082 for more details.
3106 for more details.
3083
3107
3084 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3108 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3085 SystemExit exceptions in the script being run. Thanks to a report
3109 SystemExit exceptions in the script being run. Thanks to a report
3086 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3110 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3087 producing very annoying behavior when running unit tests.
3111 producing very annoying behavior when running unit tests.
3088
3112
3089 2005-05-12 Fernando Perez <fperez@colorado.edu>
3113 2005-05-12 Fernando Perez <fperez@colorado.edu>
3090
3114
3091 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3115 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3092 which I'd broken (again) due to a changed regexp. In the process,
3116 which I'd broken (again) due to a changed regexp. In the process,
3093 added ';' as an escape to auto-quote the whole line without
3117 added ';' as an escape to auto-quote the whole line without
3094 splitting its arguments. Thanks to a report by Jerry McRae
3118 splitting its arguments. Thanks to a report by Jerry McRae
3095 <qrs0xyc02-AT-sneakemail.com>.
3119 <qrs0xyc02-AT-sneakemail.com>.
3096
3120
3097 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3121 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3098 possible crashes caused by a TokenError. Reported by Ed Schofield
3122 possible crashes caused by a TokenError. Reported by Ed Schofield
3099 <schofield-AT-ftw.at>.
3123 <schofield-AT-ftw.at>.
3100
3124
3101 2005-05-06 Fernando Perez <fperez@colorado.edu>
3125 2005-05-06 Fernando Perez <fperez@colorado.edu>
3102
3126
3103 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3127 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3104
3128
3105 2005-04-29 Fernando Perez <fperez@colorado.edu>
3129 2005-04-29 Fernando Perez <fperez@colorado.edu>
3106
3130
3107 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3131 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3108 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3132 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3109 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3133 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3110 which provides support for Qt interactive usage (similar to the
3134 which provides support for Qt interactive usage (similar to the
3111 existing one for WX and GTK). This had been often requested.
3135 existing one for WX and GTK). This had been often requested.
3112
3136
3113 2005-04-14 *** Released version 0.6.13
3137 2005-04-14 *** Released version 0.6.13
3114
3138
3115 2005-04-08 Fernando Perez <fperez@colorado.edu>
3139 2005-04-08 Fernando Perez <fperez@colorado.edu>
3116
3140
3117 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3141 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3118 from _ofind, which gets called on almost every input line. Now,
3142 from _ofind, which gets called on almost every input line. Now,
3119 we only try to get docstrings if they are actually going to be
3143 we only try to get docstrings if they are actually going to be
3120 used (the overhead of fetching unnecessary docstrings can be
3144 used (the overhead of fetching unnecessary docstrings can be
3121 noticeable for certain objects, such as Pyro proxies).
3145 noticeable for certain objects, such as Pyro proxies).
3122
3146
3123 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3147 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3124 for completers. For some reason I had been passing them the state
3148 for completers. For some reason I had been passing them the state
3125 variable, which completers never actually need, and was in
3149 variable, which completers never actually need, and was in
3126 conflict with the rlcompleter API. Custom completers ONLY need to
3150 conflict with the rlcompleter API. Custom completers ONLY need to
3127 take the text parameter.
3151 take the text parameter.
3128
3152
3129 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3153 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3130 work correctly in pysh. I've also moved all the logic which used
3154 work correctly in pysh. I've also moved all the logic which used
3131 to be in pysh.py here, which will prevent problems with future
3155 to be in pysh.py here, which will prevent problems with future
3132 upgrades. However, this time I must warn users to update their
3156 upgrades. However, this time I must warn users to update their
3133 pysh profile to include the line
3157 pysh profile to include the line
3134
3158
3135 import_all IPython.Extensions.InterpreterExec
3159 import_all IPython.Extensions.InterpreterExec
3136
3160
3137 because otherwise things won't work for them. They MUST also
3161 because otherwise things won't work for them. They MUST also
3138 delete pysh.py and the line
3162 delete pysh.py and the line
3139
3163
3140 execfile pysh.py
3164 execfile pysh.py
3141
3165
3142 from their ipythonrc-pysh.
3166 from their ipythonrc-pysh.
3143
3167
3144 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3168 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3145 robust in the face of objects whose dir() returns non-strings
3169 robust in the face of objects whose dir() returns non-strings
3146 (which it shouldn't, but some broken libs like ITK do). Thanks to
3170 (which it shouldn't, but some broken libs like ITK do). Thanks to
3147 a patch by John Hunter (implemented differently, though). Also
3171 a patch by John Hunter (implemented differently, though). Also
3148 minor improvements by using .extend instead of + on lists.
3172 minor improvements by using .extend instead of + on lists.
3149
3173
3150 * pysh.py:
3174 * pysh.py:
3151
3175
3152 2005-04-06 Fernando Perez <fperez@colorado.edu>
3176 2005-04-06 Fernando Perez <fperez@colorado.edu>
3153
3177
3154 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3178 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3155 by default, so that all users benefit from it. Those who don't
3179 by default, so that all users benefit from it. Those who don't
3156 want it can still turn it off.
3180 want it can still turn it off.
3157
3181
3158 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3182 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3159 config file, I'd forgotten about this, so users were getting it
3183 config file, I'd forgotten about this, so users were getting it
3160 off by default.
3184 off by default.
3161
3185
3162 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3186 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3163 consistency. Now magics can be called in multiline statements,
3187 consistency. Now magics can be called in multiline statements,
3164 and python variables can be expanded in magic calls via $var.
3188 and python variables can be expanded in magic calls via $var.
3165 This makes the magic system behave just like aliases or !system
3189 This makes the magic system behave just like aliases or !system
3166 calls.
3190 calls.
3167
3191
3168 2005-03-28 Fernando Perez <fperez@colorado.edu>
3192 2005-03-28 Fernando Perez <fperez@colorado.edu>
3169
3193
3170 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3194 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3171 expensive string additions for building command. Add support for
3195 expensive string additions for building command. Add support for
3172 trailing ';' when autocall is used.
3196 trailing ';' when autocall is used.
3173
3197
3174 2005-03-26 Fernando Perez <fperez@colorado.edu>
3198 2005-03-26 Fernando Perez <fperez@colorado.edu>
3175
3199
3176 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3200 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3177 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3201 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3178 ipython.el robust against prompts with any number of spaces
3202 ipython.el robust against prompts with any number of spaces
3179 (including 0) after the ':' character.
3203 (including 0) after the ':' character.
3180
3204
3181 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3205 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3182 continuation prompt, which misled users to think the line was
3206 continuation prompt, which misled users to think the line was
3183 already indented. Closes debian Bug#300847, reported to me by
3207 already indented. Closes debian Bug#300847, reported to me by
3184 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3208 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3185
3209
3186 2005-03-23 Fernando Perez <fperez@colorado.edu>
3210 2005-03-23 Fernando Perez <fperez@colorado.edu>
3187
3211
3188 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3212 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3189 properly aligned if they have embedded newlines.
3213 properly aligned if they have embedded newlines.
3190
3214
3191 * IPython/iplib.py (runlines): Add a public method to expose
3215 * IPython/iplib.py (runlines): Add a public method to expose
3192 IPython's code execution machinery, so that users can run strings
3216 IPython's code execution machinery, so that users can run strings
3193 as if they had been typed at the prompt interactively.
3217 as if they had been typed at the prompt interactively.
3194 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3218 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3195 methods which can call the system shell, but with python variable
3219 methods which can call the system shell, but with python variable
3196 expansion. The three such methods are: __IPYTHON__.system,
3220 expansion. The three such methods are: __IPYTHON__.system,
3197 .getoutput and .getoutputerror. These need to be documented in a
3221 .getoutput and .getoutputerror. These need to be documented in a
3198 'public API' section (to be written) of the manual.
3222 'public API' section (to be written) of the manual.
3199
3223
3200 2005-03-20 Fernando Perez <fperez@colorado.edu>
3224 2005-03-20 Fernando Perez <fperez@colorado.edu>
3201
3225
3202 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3226 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3203 for custom exception handling. This is quite powerful, and it
3227 for custom exception handling. This is quite powerful, and it
3204 allows for user-installable exception handlers which can trap
3228 allows for user-installable exception handlers which can trap
3205 custom exceptions at runtime and treat them separately from
3229 custom exceptions at runtime and treat them separately from
3206 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3230 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3207 Mantegazza <mantegazza-AT-ill.fr>.
3231 Mantegazza <mantegazza-AT-ill.fr>.
3208 (InteractiveShell.set_custom_completer): public API function to
3232 (InteractiveShell.set_custom_completer): public API function to
3209 add new completers at runtime.
3233 add new completers at runtime.
3210
3234
3211 2005-03-19 Fernando Perez <fperez@colorado.edu>
3235 2005-03-19 Fernando Perez <fperez@colorado.edu>
3212
3236
3213 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3237 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3214 allow objects which provide their docstrings via non-standard
3238 allow objects which provide their docstrings via non-standard
3215 mechanisms (like Pyro proxies) to still be inspected by ipython's
3239 mechanisms (like Pyro proxies) to still be inspected by ipython's
3216 ? system.
3240 ? system.
3217
3241
3218 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3242 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3219 automatic capture system. I tried quite hard to make it work
3243 automatic capture system. I tried quite hard to make it work
3220 reliably, and simply failed. I tried many combinations with the
3244 reliably, and simply failed. I tried many combinations with the
3221 subprocess module, but eventually nothing worked in all needed
3245 subprocess module, but eventually nothing worked in all needed
3222 cases (not blocking stdin for the child, duplicating stdout
3246 cases (not blocking stdin for the child, duplicating stdout
3223 without blocking, etc). The new %sc/%sx still do capture to these
3247 without blocking, etc). The new %sc/%sx still do capture to these
3224 magical list/string objects which make shell use much more
3248 magical list/string objects which make shell use much more
3225 conveninent, so not all is lost.
3249 conveninent, so not all is lost.
3226
3250
3227 XXX - FIX MANUAL for the change above!
3251 XXX - FIX MANUAL for the change above!
3228
3252
3229 (runsource): I copied code.py's runsource() into ipython to modify
3253 (runsource): I copied code.py's runsource() into ipython to modify
3230 it a bit. Now the code object and source to be executed are
3254 it a bit. Now the code object and source to be executed are
3231 stored in ipython. This makes this info accessible to third-party
3255 stored in ipython. This makes this info accessible to third-party
3232 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3256 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3233 Mantegazza <mantegazza-AT-ill.fr>.
3257 Mantegazza <mantegazza-AT-ill.fr>.
3234
3258
3235 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3259 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3236 history-search via readline (like C-p/C-n). I'd wanted this for a
3260 history-search via readline (like C-p/C-n). I'd wanted this for a
3237 long time, but only recently found out how to do it. For users
3261 long time, but only recently found out how to do it. For users
3238 who already have their ipythonrc files made and want this, just
3262 who already have their ipythonrc files made and want this, just
3239 add:
3263 add:
3240
3264
3241 readline_parse_and_bind "\e[A": history-search-backward
3265 readline_parse_and_bind "\e[A": history-search-backward
3242 readline_parse_and_bind "\e[B": history-search-forward
3266 readline_parse_and_bind "\e[B": history-search-forward
3243
3267
3244 2005-03-18 Fernando Perez <fperez@colorado.edu>
3268 2005-03-18 Fernando Perez <fperez@colorado.edu>
3245
3269
3246 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3270 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3247 LSString and SList classes which allow transparent conversions
3271 LSString and SList classes which allow transparent conversions
3248 between list mode and whitespace-separated string.
3272 between list mode and whitespace-separated string.
3249 (magic_r): Fix recursion problem in %r.
3273 (magic_r): Fix recursion problem in %r.
3250
3274
3251 * IPython/genutils.py (LSString): New class to be used for
3275 * IPython/genutils.py (LSString): New class to be used for
3252 automatic storage of the results of all alias/system calls in _o
3276 automatic storage of the results of all alias/system calls in _o
3253 and _e (stdout/err). These provide a .l/.list attribute which
3277 and _e (stdout/err). These provide a .l/.list attribute which
3254 does automatic splitting on newlines. This means that for most
3278 does automatic splitting on newlines. This means that for most
3255 uses, you'll never need to do capturing of output with %sc/%sx
3279 uses, you'll never need to do capturing of output with %sc/%sx
3256 anymore, since ipython keeps this always done for you. Note that
3280 anymore, since ipython keeps this always done for you. Note that
3257 only the LAST results are stored, the _o/e variables are
3281 only the LAST results are stored, the _o/e variables are
3258 overwritten on each call. If you need to save their contents
3282 overwritten on each call. If you need to save their contents
3259 further, simply bind them to any other name.
3283 further, simply bind them to any other name.
3260
3284
3261 2005-03-17 Fernando Perez <fperez@colorado.edu>
3285 2005-03-17 Fernando Perez <fperez@colorado.edu>
3262
3286
3263 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3287 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3264 prompt namespace handling.
3288 prompt namespace handling.
3265
3289
3266 2005-03-16 Fernando Perez <fperez@colorado.edu>
3290 2005-03-16 Fernando Perez <fperez@colorado.edu>
3267
3291
3268 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3292 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3269 classic prompts to be '>>> ' (final space was missing, and it
3293 classic prompts to be '>>> ' (final space was missing, and it
3270 trips the emacs python mode).
3294 trips the emacs python mode).
3271 (BasePrompt.__str__): Added safe support for dynamic prompt
3295 (BasePrompt.__str__): Added safe support for dynamic prompt
3272 strings. Now you can set your prompt string to be '$x', and the
3296 strings. Now you can set your prompt string to be '$x', and the
3273 value of x will be printed from your interactive namespace. The
3297 value of x will be printed from your interactive namespace. The
3274 interpolation syntax includes the full Itpl support, so
3298 interpolation syntax includes the full Itpl support, so
3275 ${foo()+x+bar()} is a valid prompt string now, and the function
3299 ${foo()+x+bar()} is a valid prompt string now, and the function
3276 calls will be made at runtime.
3300 calls will be made at runtime.
3277
3301
3278 2005-03-15 Fernando Perez <fperez@colorado.edu>
3302 2005-03-15 Fernando Perez <fperez@colorado.edu>
3279
3303
3280 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3304 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3281 avoid name clashes in pylab. %hist still works, it just forwards
3305 avoid name clashes in pylab. %hist still works, it just forwards
3282 the call to %history.
3306 the call to %history.
3283
3307
3284 2005-03-02 *** Released version 0.6.12
3308 2005-03-02 *** Released version 0.6.12
3285
3309
3286 2005-03-02 Fernando Perez <fperez@colorado.edu>
3310 2005-03-02 Fernando Perez <fperez@colorado.edu>
3287
3311
3288 * IPython/iplib.py (handle_magic): log magic calls properly as
3312 * IPython/iplib.py (handle_magic): log magic calls properly as
3289 ipmagic() function calls.
3313 ipmagic() function calls.
3290
3314
3291 * IPython/Magic.py (magic_time): Improved %time to support
3315 * IPython/Magic.py (magic_time): Improved %time to support
3292 statements and provide wall-clock as well as CPU time.
3316 statements and provide wall-clock as well as CPU time.
3293
3317
3294 2005-02-27 Fernando Perez <fperez@colorado.edu>
3318 2005-02-27 Fernando Perez <fperez@colorado.edu>
3295
3319
3296 * IPython/hooks.py: New hooks module, to expose user-modifiable
3320 * IPython/hooks.py: New hooks module, to expose user-modifiable
3297 IPython functionality in a clean manner. For now only the editor
3321 IPython functionality in a clean manner. For now only the editor
3298 hook is actually written, and other thigns which I intend to turn
3322 hook is actually written, and other thigns which I intend to turn
3299 into proper hooks aren't yet there. The display and prefilter
3323 into proper hooks aren't yet there. The display and prefilter
3300 stuff, for example, should be hooks. But at least now the
3324 stuff, for example, should be hooks. But at least now the
3301 framework is in place, and the rest can be moved here with more
3325 framework is in place, and the rest can be moved here with more
3302 time later. IPython had had a .hooks variable for a long time for
3326 time later. IPython had had a .hooks variable for a long time for
3303 this purpose, but I'd never actually used it for anything.
3327 this purpose, but I'd never actually used it for anything.
3304
3328
3305 2005-02-26 Fernando Perez <fperez@colorado.edu>
3329 2005-02-26 Fernando Perez <fperez@colorado.edu>
3306
3330
3307 * IPython/ipmaker.py (make_IPython): make the default ipython
3331 * IPython/ipmaker.py (make_IPython): make the default ipython
3308 directory be called _ipython under win32, to follow more the
3332 directory be called _ipython under win32, to follow more the
3309 naming peculiarities of that platform (where buggy software like
3333 naming peculiarities of that platform (where buggy software like
3310 Visual Sourcesafe breaks with .named directories). Reported by
3334 Visual Sourcesafe breaks with .named directories). Reported by
3311 Ville Vainio.
3335 Ville Vainio.
3312
3336
3313 2005-02-23 Fernando Perez <fperez@colorado.edu>
3337 2005-02-23 Fernando Perez <fperez@colorado.edu>
3314
3338
3315 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3339 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3316 auto_aliases for win32 which were causing problems. Users can
3340 auto_aliases for win32 which were causing problems. Users can
3317 define the ones they personally like.
3341 define the ones they personally like.
3318
3342
3319 2005-02-21 Fernando Perez <fperez@colorado.edu>
3343 2005-02-21 Fernando Perez <fperez@colorado.edu>
3320
3344
3321 * IPython/Magic.py (magic_time): new magic to time execution of
3345 * IPython/Magic.py (magic_time): new magic to time execution of
3322 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3346 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3323
3347
3324 2005-02-19 Fernando Perez <fperez@colorado.edu>
3348 2005-02-19 Fernando Perez <fperez@colorado.edu>
3325
3349
3326 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3350 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3327 into keys (for prompts, for example).
3351 into keys (for prompts, for example).
3328
3352
3329 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3353 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3330 prompts in case users want them. This introduces a small behavior
3354 prompts in case users want them. This introduces a small behavior
3331 change: ipython does not automatically add a space to all prompts
3355 change: ipython does not automatically add a space to all prompts
3332 anymore. To get the old prompts with a space, users should add it
3356 anymore. To get the old prompts with a space, users should add it
3333 manually to their ipythonrc file, so for example prompt_in1 should
3357 manually to their ipythonrc file, so for example prompt_in1 should
3334 now read 'In [\#]: ' instead of 'In [\#]:'.
3358 now read 'In [\#]: ' instead of 'In [\#]:'.
3335 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3359 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3336 file) to control left-padding of secondary prompts.
3360 file) to control left-padding of secondary prompts.
3337
3361
3338 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3362 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3339 the profiler can't be imported. Fix for Debian, which removed
3363 the profiler can't be imported. Fix for Debian, which removed
3340 profile.py because of License issues. I applied a slightly
3364 profile.py because of License issues. I applied a slightly
3341 modified version of the original Debian patch at
3365 modified version of the original Debian patch at
3342 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3366 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3343
3367
3344 2005-02-17 Fernando Perez <fperez@colorado.edu>
3368 2005-02-17 Fernando Perez <fperez@colorado.edu>
3345
3369
3346 * IPython/genutils.py (native_line_ends): Fix bug which would
3370 * IPython/genutils.py (native_line_ends): Fix bug which would
3347 cause improper line-ends under win32 b/c I was not opening files
3371 cause improper line-ends under win32 b/c I was not opening files
3348 in binary mode. Bug report and fix thanks to Ville.
3372 in binary mode. Bug report and fix thanks to Ville.
3349
3373
3350 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3374 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3351 trying to catch spurious foo[1] autocalls. My fix actually broke
3375 trying to catch spurious foo[1] autocalls. My fix actually broke
3352 ',/' autoquote/call with explicit escape (bad regexp).
3376 ',/' autoquote/call with explicit escape (bad regexp).
3353
3377
3354 2005-02-15 *** Released version 0.6.11
3378 2005-02-15 *** Released version 0.6.11
3355
3379
3356 2005-02-14 Fernando Perez <fperez@colorado.edu>
3380 2005-02-14 Fernando Perez <fperez@colorado.edu>
3357
3381
3358 * IPython/background_jobs.py: New background job management
3382 * IPython/background_jobs.py: New background job management
3359 subsystem. This is implemented via a new set of classes, and
3383 subsystem. This is implemented via a new set of classes, and
3360 IPython now provides a builtin 'jobs' object for background job
3384 IPython now provides a builtin 'jobs' object for background job
3361 execution. A convenience %bg magic serves as a lightweight
3385 execution. A convenience %bg magic serves as a lightweight
3362 frontend for starting the more common type of calls. This was
3386 frontend for starting the more common type of calls. This was
3363 inspired by discussions with B. Granger and the BackgroundCommand
3387 inspired by discussions with B. Granger and the BackgroundCommand
3364 class described in the book Python Scripting for Computational
3388 class described in the book Python Scripting for Computational
3365 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3389 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3366 (although ultimately no code from this text was used, as IPython's
3390 (although ultimately no code from this text was used, as IPython's
3367 system is a separate implementation).
3391 system is a separate implementation).
3368
3392
3369 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3393 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3370 to control the completion of single/double underscore names
3394 to control the completion of single/double underscore names
3371 separately. As documented in the example ipytonrc file, the
3395 separately. As documented in the example ipytonrc file, the
3372 readline_omit__names variable can now be set to 2, to omit even
3396 readline_omit__names variable can now be set to 2, to omit even
3373 single underscore names. Thanks to a patch by Brian Wong
3397 single underscore names. Thanks to a patch by Brian Wong
3374 <BrianWong-AT-AirgoNetworks.Com>.
3398 <BrianWong-AT-AirgoNetworks.Com>.
3375 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3399 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3376 be autocalled as foo([1]) if foo were callable. A problem for
3400 be autocalled as foo([1]) if foo were callable. A problem for
3377 things which are both callable and implement __getitem__.
3401 things which are both callable and implement __getitem__.
3378 (init_readline): Fix autoindentation for win32. Thanks to a patch
3402 (init_readline): Fix autoindentation for win32. Thanks to a patch
3379 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3403 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3380
3404
3381 2005-02-12 Fernando Perez <fperez@colorado.edu>
3405 2005-02-12 Fernando Perez <fperez@colorado.edu>
3382
3406
3383 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3407 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3384 which I had written long ago to sort out user error messages which
3408 which I had written long ago to sort out user error messages which
3385 may occur during startup. This seemed like a good idea initially,
3409 may occur during startup. This seemed like a good idea initially,
3386 but it has proven a disaster in retrospect. I don't want to
3410 but it has proven a disaster in retrospect. I don't want to
3387 change much code for now, so my fix is to set the internal 'debug'
3411 change much code for now, so my fix is to set the internal 'debug'
3388 flag to true everywhere, whose only job was precisely to control
3412 flag to true everywhere, whose only job was precisely to control
3389 this subsystem. This closes issue 28 (as well as avoiding all
3413 this subsystem. This closes issue 28 (as well as avoiding all
3390 sorts of strange hangups which occur from time to time).
3414 sorts of strange hangups which occur from time to time).
3391
3415
3392 2005-02-07 Fernando Perez <fperez@colorado.edu>
3416 2005-02-07 Fernando Perez <fperez@colorado.edu>
3393
3417
3394 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3418 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3395 previous call produced a syntax error.
3419 previous call produced a syntax error.
3396
3420
3397 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3421 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3398 classes without constructor.
3422 classes without constructor.
3399
3423
3400 2005-02-06 Fernando Perez <fperez@colorado.edu>
3424 2005-02-06 Fernando Perez <fperez@colorado.edu>
3401
3425
3402 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3426 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3403 completions with the results of each matcher, so we return results
3427 completions with the results of each matcher, so we return results
3404 to the user from all namespaces. This breaks with ipython
3428 to the user from all namespaces. This breaks with ipython
3405 tradition, but I think it's a nicer behavior. Now you get all
3429 tradition, but I think it's a nicer behavior. Now you get all
3406 possible completions listed, from all possible namespaces (python,
3430 possible completions listed, from all possible namespaces (python,
3407 filesystem, magics...) After a request by John Hunter
3431 filesystem, magics...) After a request by John Hunter
3408 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3432 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3409
3433
3410 2005-02-05 Fernando Perez <fperez@colorado.edu>
3434 2005-02-05 Fernando Perez <fperez@colorado.edu>
3411
3435
3412 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3436 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3413 the call had quote characters in it (the quotes were stripped).
3437 the call had quote characters in it (the quotes were stripped).
3414
3438
3415 2005-01-31 Fernando Perez <fperez@colorado.edu>
3439 2005-01-31 Fernando Perez <fperez@colorado.edu>
3416
3440
3417 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3441 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3418 Itpl.itpl() to make the code more robust against psyco
3442 Itpl.itpl() to make the code more robust against psyco
3419 optimizations.
3443 optimizations.
3420
3444
3421 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3445 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3422 of causing an exception. Quicker, cleaner.
3446 of causing an exception. Quicker, cleaner.
3423
3447
3424 2005-01-28 Fernando Perez <fperez@colorado.edu>
3448 2005-01-28 Fernando Perez <fperez@colorado.edu>
3425
3449
3426 * scripts/ipython_win_post_install.py (install): hardcode
3450 * scripts/ipython_win_post_install.py (install): hardcode
3427 sys.prefix+'python.exe' as the executable path. It turns out that
3451 sys.prefix+'python.exe' as the executable path. It turns out that
3428 during the post-installation run, sys.executable resolves to the
3452 during the post-installation run, sys.executable resolves to the
3429 name of the binary installer! I should report this as a distutils
3453 name of the binary installer! I should report this as a distutils
3430 bug, I think. I updated the .10 release with this tiny fix, to
3454 bug, I think. I updated the .10 release with this tiny fix, to
3431 avoid annoying the lists further.
3455 avoid annoying the lists further.
3432
3456
3433 2005-01-27 *** Released version 0.6.10
3457 2005-01-27 *** Released version 0.6.10
3434
3458
3435 2005-01-27 Fernando Perez <fperez@colorado.edu>
3459 2005-01-27 Fernando Perez <fperez@colorado.edu>
3436
3460
3437 * IPython/numutils.py (norm): Added 'inf' as optional name for
3461 * IPython/numutils.py (norm): Added 'inf' as optional name for
3438 L-infinity norm, included references to mathworld.com for vector
3462 L-infinity norm, included references to mathworld.com for vector
3439 norm definitions.
3463 norm definitions.
3440 (amin/amax): added amin/amax for array min/max. Similar to what
3464 (amin/amax): added amin/amax for array min/max. Similar to what
3441 pylab ships with after the recent reorganization of names.
3465 pylab ships with after the recent reorganization of names.
3442 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3466 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3443
3467
3444 * ipython.el: committed Alex's recent fixes and improvements.
3468 * ipython.el: committed Alex's recent fixes and improvements.
3445 Tested with python-mode from CVS, and it looks excellent. Since
3469 Tested with python-mode from CVS, and it looks excellent. Since
3446 python-mode hasn't released anything in a while, I'm temporarily
3470 python-mode hasn't released anything in a while, I'm temporarily
3447 putting a copy of today's CVS (v 4.70) of python-mode in:
3471 putting a copy of today's CVS (v 4.70) of python-mode in:
3448 http://ipython.scipy.org/tmp/python-mode.el
3472 http://ipython.scipy.org/tmp/python-mode.el
3449
3473
3450 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3474 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3451 sys.executable for the executable name, instead of assuming it's
3475 sys.executable for the executable name, instead of assuming it's
3452 called 'python.exe' (the post-installer would have produced broken
3476 called 'python.exe' (the post-installer would have produced broken
3453 setups on systems with a differently named python binary).
3477 setups on systems with a differently named python binary).
3454
3478
3455 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3479 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3456 references to os.linesep, to make the code more
3480 references to os.linesep, to make the code more
3457 platform-independent. This is also part of the win32 coloring
3481 platform-independent. This is also part of the win32 coloring
3458 fixes.
3482 fixes.
3459
3483
3460 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3484 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3461 lines, which actually cause coloring bugs because the length of
3485 lines, which actually cause coloring bugs because the length of
3462 the line is very difficult to correctly compute with embedded
3486 the line is very difficult to correctly compute with embedded
3463 escapes. This was the source of all the coloring problems under
3487 escapes. This was the source of all the coloring problems under
3464 Win32. I think that _finally_, Win32 users have a properly
3488 Win32. I think that _finally_, Win32 users have a properly
3465 working ipython in all respects. This would never have happened
3489 working ipython in all respects. This would never have happened
3466 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3490 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3467
3491
3468 2005-01-26 *** Released version 0.6.9
3492 2005-01-26 *** Released version 0.6.9
3469
3493
3470 2005-01-25 Fernando Perez <fperez@colorado.edu>
3494 2005-01-25 Fernando Perez <fperez@colorado.edu>
3471
3495
3472 * setup.py: finally, we have a true Windows installer, thanks to
3496 * setup.py: finally, we have a true Windows installer, thanks to
3473 the excellent work of Viktor Ransmayr
3497 the excellent work of Viktor Ransmayr
3474 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3498 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3475 Windows users. The setup routine is quite a bit cleaner thanks to
3499 Windows users. The setup routine is quite a bit cleaner thanks to
3476 this, and the post-install script uses the proper functions to
3500 this, and the post-install script uses the proper functions to
3477 allow a clean de-installation using the standard Windows Control
3501 allow a clean de-installation using the standard Windows Control
3478 Panel.
3502 Panel.
3479
3503
3480 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3504 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3481 environment variable under all OSes (including win32) if
3505 environment variable under all OSes (including win32) if
3482 available. This will give consistency to win32 users who have set
3506 available. This will give consistency to win32 users who have set
3483 this variable for any reason. If os.environ['HOME'] fails, the
3507 this variable for any reason. If os.environ['HOME'] fails, the
3484 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3508 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3485
3509
3486 2005-01-24 Fernando Perez <fperez@colorado.edu>
3510 2005-01-24 Fernando Perez <fperez@colorado.edu>
3487
3511
3488 * IPython/numutils.py (empty_like): add empty_like(), similar to
3512 * IPython/numutils.py (empty_like): add empty_like(), similar to
3489 zeros_like() but taking advantage of the new empty() Numeric routine.
3513 zeros_like() but taking advantage of the new empty() Numeric routine.
3490
3514
3491 2005-01-23 *** Released version 0.6.8
3515 2005-01-23 *** Released version 0.6.8
3492
3516
3493 2005-01-22 Fernando Perez <fperez@colorado.edu>
3517 2005-01-22 Fernando Perez <fperez@colorado.edu>
3494
3518
3495 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3519 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3496 automatic show() calls. After discussing things with JDH, it
3520 automatic show() calls. After discussing things with JDH, it
3497 turns out there are too many corner cases where this can go wrong.
3521 turns out there are too many corner cases where this can go wrong.
3498 It's best not to try to be 'too smart', and simply have ipython
3522 It's best not to try to be 'too smart', and simply have ipython
3499 reproduce as much as possible the default behavior of a normal
3523 reproduce as much as possible the default behavior of a normal
3500 python shell.
3524 python shell.
3501
3525
3502 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3526 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3503 line-splitting regexp and _prefilter() to avoid calling getattr()
3527 line-splitting regexp and _prefilter() to avoid calling getattr()
3504 on assignments. This closes
3528 on assignments. This closes
3505 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3529 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3506 readline uses getattr(), so a simple <TAB> keypress is still
3530 readline uses getattr(), so a simple <TAB> keypress is still
3507 enough to trigger getattr() calls on an object.
3531 enough to trigger getattr() calls on an object.
3508
3532
3509 2005-01-21 Fernando Perez <fperez@colorado.edu>
3533 2005-01-21 Fernando Perez <fperez@colorado.edu>
3510
3534
3511 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3535 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3512 docstring under pylab so it doesn't mask the original.
3536 docstring under pylab so it doesn't mask the original.
3513
3537
3514 2005-01-21 *** Released version 0.6.7
3538 2005-01-21 *** Released version 0.6.7
3515
3539
3516 2005-01-21 Fernando Perez <fperez@colorado.edu>
3540 2005-01-21 Fernando Perez <fperez@colorado.edu>
3517
3541
3518 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3542 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3519 signal handling for win32 users in multithreaded mode.
3543 signal handling for win32 users in multithreaded mode.
3520
3544
3521 2005-01-17 Fernando Perez <fperez@colorado.edu>
3545 2005-01-17 Fernando Perez <fperez@colorado.edu>
3522
3546
3523 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3547 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3524 instances with no __init__. After a crash report by Norbert Nemec
3548 instances with no __init__. After a crash report by Norbert Nemec
3525 <Norbert-AT-nemec-online.de>.
3549 <Norbert-AT-nemec-online.de>.
3526
3550
3527 2005-01-14 Fernando Perez <fperez@colorado.edu>
3551 2005-01-14 Fernando Perez <fperez@colorado.edu>
3528
3552
3529 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3553 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3530 names for verbose exceptions, when multiple dotted names and the
3554 names for verbose exceptions, when multiple dotted names and the
3531 'parent' object were present on the same line.
3555 'parent' object were present on the same line.
3532
3556
3533 2005-01-11 Fernando Perez <fperez@colorado.edu>
3557 2005-01-11 Fernando Perez <fperez@colorado.edu>
3534
3558
3535 * IPython/genutils.py (flag_calls): new utility to trap and flag
3559 * IPython/genutils.py (flag_calls): new utility to trap and flag
3536 calls in functions. I need it to clean up matplotlib support.
3560 calls in functions. I need it to clean up matplotlib support.
3537 Also removed some deprecated code in genutils.
3561 Also removed some deprecated code in genutils.
3538
3562
3539 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3563 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3540 that matplotlib scripts called with %run, which don't call show()
3564 that matplotlib scripts called with %run, which don't call show()
3541 themselves, still have their plotting windows open.
3565 themselves, still have their plotting windows open.
3542
3566
3543 2005-01-05 Fernando Perez <fperez@colorado.edu>
3567 2005-01-05 Fernando Perez <fperez@colorado.edu>
3544
3568
3545 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3569 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3546 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3570 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3547
3571
3548 2004-12-19 Fernando Perez <fperez@colorado.edu>
3572 2004-12-19 Fernando Perez <fperez@colorado.edu>
3549
3573
3550 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3574 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3551 parent_runcode, which was an eyesore. The same result can be
3575 parent_runcode, which was an eyesore. The same result can be
3552 obtained with Python's regular superclass mechanisms.
3576 obtained with Python's regular superclass mechanisms.
3553
3577
3554 2004-12-17 Fernando Perez <fperez@colorado.edu>
3578 2004-12-17 Fernando Perez <fperez@colorado.edu>
3555
3579
3556 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3580 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3557 reported by Prabhu.
3581 reported by Prabhu.
3558 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3582 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3559 sys.stderr) instead of explicitly calling sys.stderr. This helps
3583 sys.stderr) instead of explicitly calling sys.stderr. This helps
3560 maintain our I/O abstractions clean, for future GUI embeddings.
3584 maintain our I/O abstractions clean, for future GUI embeddings.
3561
3585
3562 * IPython/genutils.py (info): added new utility for sys.stderr
3586 * IPython/genutils.py (info): added new utility for sys.stderr
3563 unified info message handling (thin wrapper around warn()).
3587 unified info message handling (thin wrapper around warn()).
3564
3588
3565 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3589 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3566 composite (dotted) names on verbose exceptions.
3590 composite (dotted) names on verbose exceptions.
3567 (VerboseTB.nullrepr): harden against another kind of errors which
3591 (VerboseTB.nullrepr): harden against another kind of errors which
3568 Python's inspect module can trigger, and which were crashing
3592 Python's inspect module can trigger, and which were crashing
3569 IPython. Thanks to a report by Marco Lombardi
3593 IPython. Thanks to a report by Marco Lombardi
3570 <mlombard-AT-ma010192.hq.eso.org>.
3594 <mlombard-AT-ma010192.hq.eso.org>.
3571
3595
3572 2004-12-13 *** Released version 0.6.6
3596 2004-12-13 *** Released version 0.6.6
3573
3597
3574 2004-12-12 Fernando Perez <fperez@colorado.edu>
3598 2004-12-12 Fernando Perez <fperez@colorado.edu>
3575
3599
3576 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3600 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3577 generated by pygtk upon initialization if it was built without
3601 generated by pygtk upon initialization if it was built without
3578 threads (for matplotlib users). After a crash reported by
3602 threads (for matplotlib users). After a crash reported by
3579 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3603 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3580
3604
3581 * IPython/ipmaker.py (make_IPython): fix small bug in the
3605 * IPython/ipmaker.py (make_IPython): fix small bug in the
3582 import_some parameter for multiple imports.
3606 import_some parameter for multiple imports.
3583
3607
3584 * IPython/iplib.py (ipmagic): simplified the interface of
3608 * IPython/iplib.py (ipmagic): simplified the interface of
3585 ipmagic() to take a single string argument, just as it would be
3609 ipmagic() to take a single string argument, just as it would be
3586 typed at the IPython cmd line.
3610 typed at the IPython cmd line.
3587 (ipalias): Added new ipalias() with an interface identical to
3611 (ipalias): Added new ipalias() with an interface identical to
3588 ipmagic(). This completes exposing a pure python interface to the
3612 ipmagic(). This completes exposing a pure python interface to the
3589 alias and magic system, which can be used in loops or more complex
3613 alias and magic system, which can be used in loops or more complex
3590 code where IPython's automatic line mangling is not active.
3614 code where IPython's automatic line mangling is not active.
3591
3615
3592 * IPython/genutils.py (timing): changed interface of timing to
3616 * IPython/genutils.py (timing): changed interface of timing to
3593 simply run code once, which is the most common case. timings()
3617 simply run code once, which is the most common case. timings()
3594 remains unchanged, for the cases where you want multiple runs.
3618 remains unchanged, for the cases where you want multiple runs.
3595
3619
3596 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3620 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3597 bug where Python2.2 crashes with exec'ing code which does not end
3621 bug where Python2.2 crashes with exec'ing code which does not end
3598 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3622 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3599 before.
3623 before.
3600
3624
3601 2004-12-10 Fernando Perez <fperez@colorado.edu>
3625 2004-12-10 Fernando Perez <fperez@colorado.edu>
3602
3626
3603 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3627 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3604 -t to -T, to accomodate the new -t flag in %run (the %run and
3628 -t to -T, to accomodate the new -t flag in %run (the %run and
3605 %prun options are kind of intermixed, and it's not easy to change
3629 %prun options are kind of intermixed, and it's not easy to change
3606 this with the limitations of python's getopt).
3630 this with the limitations of python's getopt).
3607
3631
3608 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3632 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3609 the execution of scripts. It's not as fine-tuned as timeit.py,
3633 the execution of scripts. It's not as fine-tuned as timeit.py,
3610 but it works from inside ipython (and under 2.2, which lacks
3634 but it works from inside ipython (and under 2.2, which lacks
3611 timeit.py). Optionally a number of runs > 1 can be given for
3635 timeit.py). Optionally a number of runs > 1 can be given for
3612 timing very short-running code.
3636 timing very short-running code.
3613
3637
3614 * IPython/genutils.py (uniq_stable): new routine which returns a
3638 * IPython/genutils.py (uniq_stable): new routine which returns a
3615 list of unique elements in any iterable, but in stable order of
3639 list of unique elements in any iterable, but in stable order of
3616 appearance. I needed this for the ultraTB fixes, and it's a handy
3640 appearance. I needed this for the ultraTB fixes, and it's a handy
3617 utility.
3641 utility.
3618
3642
3619 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3643 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3620 dotted names in Verbose exceptions. This had been broken since
3644 dotted names in Verbose exceptions. This had been broken since
3621 the very start, now x.y will properly be printed in a Verbose
3645 the very start, now x.y will properly be printed in a Verbose
3622 traceback, instead of x being shown and y appearing always as an
3646 traceback, instead of x being shown and y appearing always as an
3623 'undefined global'. Getting this to work was a bit tricky,
3647 'undefined global'. Getting this to work was a bit tricky,
3624 because by default python tokenizers are stateless. Saved by
3648 because by default python tokenizers are stateless. Saved by
3625 python's ability to easily add a bit of state to an arbitrary
3649 python's ability to easily add a bit of state to an arbitrary
3626 function (without needing to build a full-blown callable object).
3650 function (without needing to build a full-blown callable object).
3627
3651
3628 Also big cleanup of this code, which had horrendous runtime
3652 Also big cleanup of this code, which had horrendous runtime
3629 lookups of zillions of attributes for colorization. Moved all
3653 lookups of zillions of attributes for colorization. Moved all
3630 this code into a few templates, which make it cleaner and quicker.
3654 this code into a few templates, which make it cleaner and quicker.
3631
3655
3632 Printout quality was also improved for Verbose exceptions: one
3656 Printout quality was also improved for Verbose exceptions: one
3633 variable per line, and memory addresses are printed (this can be
3657 variable per line, and memory addresses are printed (this can be
3634 quite handy in nasty debugging situations, which is what Verbose
3658 quite handy in nasty debugging situations, which is what Verbose
3635 is for).
3659 is for).
3636
3660
3637 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3661 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3638 the command line as scripts to be loaded by embedded instances.
3662 the command line as scripts to be loaded by embedded instances.
3639 Doing so has the potential for an infinite recursion if there are
3663 Doing so has the potential for an infinite recursion if there are
3640 exceptions thrown in the process. This fixes a strange crash
3664 exceptions thrown in the process. This fixes a strange crash
3641 reported by Philippe MULLER <muller-AT-irit.fr>.
3665 reported by Philippe MULLER <muller-AT-irit.fr>.
3642
3666
3643 2004-12-09 Fernando Perez <fperez@colorado.edu>
3667 2004-12-09 Fernando Perez <fperez@colorado.edu>
3644
3668
3645 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3669 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3646 to reflect new names in matplotlib, which now expose the
3670 to reflect new names in matplotlib, which now expose the
3647 matlab-compatible interface via a pylab module instead of the
3671 matlab-compatible interface via a pylab module instead of the
3648 'matlab' name. The new code is backwards compatible, so users of
3672 'matlab' name. The new code is backwards compatible, so users of
3649 all matplotlib versions are OK. Patch by J. Hunter.
3673 all matplotlib versions are OK. Patch by J. Hunter.
3650
3674
3651 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3675 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3652 of __init__ docstrings for instances (class docstrings are already
3676 of __init__ docstrings for instances (class docstrings are already
3653 automatically printed). Instances with customized docstrings
3677 automatically printed). Instances with customized docstrings
3654 (indep. of the class) are also recognized and all 3 separate
3678 (indep. of the class) are also recognized and all 3 separate
3655 docstrings are printed (instance, class, constructor). After some
3679 docstrings are printed (instance, class, constructor). After some
3656 comments/suggestions by J. Hunter.
3680 comments/suggestions by J. Hunter.
3657
3681
3658 2004-12-05 Fernando Perez <fperez@colorado.edu>
3682 2004-12-05 Fernando Perez <fperez@colorado.edu>
3659
3683
3660 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3684 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3661 warnings when tab-completion fails and triggers an exception.
3685 warnings when tab-completion fails and triggers an exception.
3662
3686
3663 2004-12-03 Fernando Perez <fperez@colorado.edu>
3687 2004-12-03 Fernando Perez <fperez@colorado.edu>
3664
3688
3665 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3689 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3666 be triggered when using 'run -p'. An incorrect option flag was
3690 be triggered when using 'run -p'. An incorrect option flag was
3667 being set ('d' instead of 'D').
3691 being set ('d' instead of 'D').
3668 (manpage): fix missing escaped \- sign.
3692 (manpage): fix missing escaped \- sign.
3669
3693
3670 2004-11-30 *** Released version 0.6.5
3694 2004-11-30 *** Released version 0.6.5
3671
3695
3672 2004-11-30 Fernando Perez <fperez@colorado.edu>
3696 2004-11-30 Fernando Perez <fperez@colorado.edu>
3673
3697
3674 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3698 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3675 setting with -d option.
3699 setting with -d option.
3676
3700
3677 * setup.py (docfiles): Fix problem where the doc glob I was using
3701 * setup.py (docfiles): Fix problem where the doc glob I was using
3678 was COMPLETELY BROKEN. It was giving the right files by pure
3702 was COMPLETELY BROKEN. It was giving the right files by pure
3679 accident, but failed once I tried to include ipython.el. Note:
3703 accident, but failed once I tried to include ipython.el. Note:
3680 glob() does NOT allow you to do exclusion on multiple endings!
3704 glob() does NOT allow you to do exclusion on multiple endings!
3681
3705
3682 2004-11-29 Fernando Perez <fperez@colorado.edu>
3706 2004-11-29 Fernando Perez <fperez@colorado.edu>
3683
3707
3684 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3708 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3685 the manpage as the source. Better formatting & consistency.
3709 the manpage as the source. Better formatting & consistency.
3686
3710
3687 * IPython/Magic.py (magic_run): Added new -d option, to run
3711 * IPython/Magic.py (magic_run): Added new -d option, to run
3688 scripts under the control of the python pdb debugger. Note that
3712 scripts under the control of the python pdb debugger. Note that
3689 this required changing the %prun option -d to -D, to avoid a clash
3713 this required changing the %prun option -d to -D, to avoid a clash
3690 (since %run must pass options to %prun, and getopt is too dumb to
3714 (since %run must pass options to %prun, and getopt is too dumb to
3691 handle options with string values with embedded spaces). Thanks
3715 handle options with string values with embedded spaces). Thanks
3692 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3716 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3693 (magic_who_ls): added type matching to %who and %whos, so that one
3717 (magic_who_ls): added type matching to %who and %whos, so that one
3694 can filter their output to only include variables of certain
3718 can filter their output to only include variables of certain
3695 types. Another suggestion by Matthew.
3719 types. Another suggestion by Matthew.
3696 (magic_whos): Added memory summaries in kb and Mb for arrays.
3720 (magic_whos): Added memory summaries in kb and Mb for arrays.
3697 (magic_who): Improve formatting (break lines every 9 vars).
3721 (magic_who): Improve formatting (break lines every 9 vars).
3698
3722
3699 2004-11-28 Fernando Perez <fperez@colorado.edu>
3723 2004-11-28 Fernando Perez <fperez@colorado.edu>
3700
3724
3701 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3725 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3702 cache when empty lines were present.
3726 cache when empty lines were present.
3703
3727
3704 2004-11-24 Fernando Perez <fperez@colorado.edu>
3728 2004-11-24 Fernando Perez <fperez@colorado.edu>
3705
3729
3706 * IPython/usage.py (__doc__): document the re-activated threading
3730 * IPython/usage.py (__doc__): document the re-activated threading
3707 options for WX and GTK.
3731 options for WX and GTK.
3708
3732
3709 2004-11-23 Fernando Perez <fperez@colorado.edu>
3733 2004-11-23 Fernando Perez <fperez@colorado.edu>
3710
3734
3711 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3735 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3712 the -wthread and -gthread options, along with a new -tk one to try
3736 the -wthread and -gthread options, along with a new -tk one to try
3713 and coordinate Tk threading with wx/gtk. The tk support is very
3737 and coordinate Tk threading with wx/gtk. The tk support is very
3714 platform dependent, since it seems to require Tcl and Tk to be
3738 platform dependent, since it seems to require Tcl and Tk to be
3715 built with threads (Fedora1/2 appears NOT to have it, but in
3739 built with threads (Fedora1/2 appears NOT to have it, but in
3716 Prabhu's Debian boxes it works OK). But even with some Tk
3740 Prabhu's Debian boxes it works OK). But even with some Tk
3717 limitations, this is a great improvement.
3741 limitations, this is a great improvement.
3718
3742
3719 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3743 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3720 info in user prompts. Patch by Prabhu.
3744 info in user prompts. Patch by Prabhu.
3721
3745
3722 2004-11-18 Fernando Perez <fperez@colorado.edu>
3746 2004-11-18 Fernando Perez <fperez@colorado.edu>
3723
3747
3724 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3748 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3725 EOFErrors and bail, to avoid infinite loops if a non-terminating
3749 EOFErrors and bail, to avoid infinite loops if a non-terminating
3726 file is fed into ipython. Patch submitted in issue 19 by user,
3750 file is fed into ipython. Patch submitted in issue 19 by user,
3727 many thanks.
3751 many thanks.
3728
3752
3729 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3753 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3730 autoquote/parens in continuation prompts, which can cause lots of
3754 autoquote/parens in continuation prompts, which can cause lots of
3731 problems. Closes roundup issue 20.
3755 problems. Closes roundup issue 20.
3732
3756
3733 2004-11-17 Fernando Perez <fperez@colorado.edu>
3757 2004-11-17 Fernando Perez <fperez@colorado.edu>
3734
3758
3735 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3759 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3736 reported as debian bug #280505. I'm not sure my local changelog
3760 reported as debian bug #280505. I'm not sure my local changelog
3737 entry has the proper debian format (Jack?).
3761 entry has the proper debian format (Jack?).
3738
3762
3739 2004-11-08 *** Released version 0.6.4
3763 2004-11-08 *** Released version 0.6.4
3740
3764
3741 2004-11-08 Fernando Perez <fperez@colorado.edu>
3765 2004-11-08 Fernando Perez <fperez@colorado.edu>
3742
3766
3743 * IPython/iplib.py (init_readline): Fix exit message for Windows
3767 * IPython/iplib.py (init_readline): Fix exit message for Windows
3744 when readline is active. Thanks to a report by Eric Jones
3768 when readline is active. Thanks to a report by Eric Jones
3745 <eric-AT-enthought.com>.
3769 <eric-AT-enthought.com>.
3746
3770
3747 2004-11-07 Fernando Perez <fperez@colorado.edu>
3771 2004-11-07 Fernando Perez <fperez@colorado.edu>
3748
3772
3749 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3773 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3750 sometimes seen by win2k/cygwin users.
3774 sometimes seen by win2k/cygwin users.
3751
3775
3752 2004-11-06 Fernando Perez <fperez@colorado.edu>
3776 2004-11-06 Fernando Perez <fperez@colorado.edu>
3753
3777
3754 * IPython/iplib.py (interact): Change the handling of %Exit from
3778 * IPython/iplib.py (interact): Change the handling of %Exit from
3755 trying to propagate a SystemExit to an internal ipython flag.
3779 trying to propagate a SystemExit to an internal ipython flag.
3756 This is less elegant than using Python's exception mechanism, but
3780 This is less elegant than using Python's exception mechanism, but
3757 I can't get that to work reliably with threads, so under -pylab
3781 I can't get that to work reliably with threads, so under -pylab
3758 %Exit was hanging IPython. Cross-thread exception handling is
3782 %Exit was hanging IPython. Cross-thread exception handling is
3759 really a bitch. Thaks to a bug report by Stephen Walton
3783 really a bitch. Thaks to a bug report by Stephen Walton
3760 <stephen.walton-AT-csun.edu>.
3784 <stephen.walton-AT-csun.edu>.
3761
3785
3762 2004-11-04 Fernando Perez <fperez@colorado.edu>
3786 2004-11-04 Fernando Perez <fperez@colorado.edu>
3763
3787
3764 * IPython/iplib.py (raw_input_original): store a pointer to the
3788 * IPython/iplib.py (raw_input_original): store a pointer to the
3765 true raw_input to harden against code which can modify it
3789 true raw_input to harden against code which can modify it
3766 (wx.py.PyShell does this and would otherwise crash ipython).
3790 (wx.py.PyShell does this and would otherwise crash ipython).
3767 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3791 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3768
3792
3769 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3793 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3770 Ctrl-C problem, which does not mess up the input line.
3794 Ctrl-C problem, which does not mess up the input line.
3771
3795
3772 2004-11-03 Fernando Perez <fperez@colorado.edu>
3796 2004-11-03 Fernando Perez <fperez@colorado.edu>
3773
3797
3774 * IPython/Release.py: Changed licensing to BSD, in all files.
3798 * IPython/Release.py: Changed licensing to BSD, in all files.
3775 (name): lowercase name for tarball/RPM release.
3799 (name): lowercase name for tarball/RPM release.
3776
3800
3777 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3801 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3778 use throughout ipython.
3802 use throughout ipython.
3779
3803
3780 * IPython/Magic.py (Magic._ofind): Switch to using the new
3804 * IPython/Magic.py (Magic._ofind): Switch to using the new
3781 OInspect.getdoc() function.
3805 OInspect.getdoc() function.
3782
3806
3783 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3807 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3784 of the line currently being canceled via Ctrl-C. It's extremely
3808 of the line currently being canceled via Ctrl-C. It's extremely
3785 ugly, but I don't know how to do it better (the problem is one of
3809 ugly, but I don't know how to do it better (the problem is one of
3786 handling cross-thread exceptions).
3810 handling cross-thread exceptions).
3787
3811
3788 2004-10-28 Fernando Perez <fperez@colorado.edu>
3812 2004-10-28 Fernando Perez <fperez@colorado.edu>
3789
3813
3790 * IPython/Shell.py (signal_handler): add signal handlers to trap
3814 * IPython/Shell.py (signal_handler): add signal handlers to trap
3791 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3815 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3792 report by Francesc Alted.
3816 report by Francesc Alted.
3793
3817
3794 2004-10-21 Fernando Perez <fperez@colorado.edu>
3818 2004-10-21 Fernando Perez <fperez@colorado.edu>
3795
3819
3796 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3820 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3797 to % for pysh syntax extensions.
3821 to % for pysh syntax extensions.
3798
3822
3799 2004-10-09 Fernando Perez <fperez@colorado.edu>
3823 2004-10-09 Fernando Perez <fperez@colorado.edu>
3800
3824
3801 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3825 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3802 arrays to print a more useful summary, without calling str(arr).
3826 arrays to print a more useful summary, without calling str(arr).
3803 This avoids the problem of extremely lengthy computations which
3827 This avoids the problem of extremely lengthy computations which
3804 occur if arr is large, and appear to the user as a system lockup
3828 occur if arr is large, and appear to the user as a system lockup
3805 with 100% cpu activity. After a suggestion by Kristian Sandberg
3829 with 100% cpu activity. After a suggestion by Kristian Sandberg
3806 <Kristian.Sandberg@colorado.edu>.
3830 <Kristian.Sandberg@colorado.edu>.
3807 (Magic.__init__): fix bug in global magic escapes not being
3831 (Magic.__init__): fix bug in global magic escapes not being
3808 correctly set.
3832 correctly set.
3809
3833
3810 2004-10-08 Fernando Perez <fperez@colorado.edu>
3834 2004-10-08 Fernando Perez <fperez@colorado.edu>
3811
3835
3812 * IPython/Magic.py (__license__): change to absolute imports of
3836 * IPython/Magic.py (__license__): change to absolute imports of
3813 ipython's own internal packages, to start adapting to the absolute
3837 ipython's own internal packages, to start adapting to the absolute
3814 import requirement of PEP-328.
3838 import requirement of PEP-328.
3815
3839
3816 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3840 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3817 files, and standardize author/license marks through the Release
3841 files, and standardize author/license marks through the Release
3818 module instead of having per/file stuff (except for files with
3842 module instead of having per/file stuff (except for files with
3819 particular licenses, like the MIT/PSF-licensed codes).
3843 particular licenses, like the MIT/PSF-licensed codes).
3820
3844
3821 * IPython/Debugger.py: remove dead code for python 2.1
3845 * IPython/Debugger.py: remove dead code for python 2.1
3822
3846
3823 2004-10-04 Fernando Perez <fperez@colorado.edu>
3847 2004-10-04 Fernando Perez <fperez@colorado.edu>
3824
3848
3825 * IPython/iplib.py (ipmagic): New function for accessing magics
3849 * IPython/iplib.py (ipmagic): New function for accessing magics
3826 via a normal python function call.
3850 via a normal python function call.
3827
3851
3828 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3852 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3829 from '@' to '%', to accomodate the new @decorator syntax of python
3853 from '@' to '%', to accomodate the new @decorator syntax of python
3830 2.4.
3854 2.4.
3831
3855
3832 2004-09-29 Fernando Perez <fperez@colorado.edu>
3856 2004-09-29 Fernando Perez <fperez@colorado.edu>
3833
3857
3834 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3858 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3835 matplotlib.use to prevent running scripts which try to switch
3859 matplotlib.use to prevent running scripts which try to switch
3836 interactive backends from within ipython. This will just crash
3860 interactive backends from within ipython. This will just crash
3837 the python interpreter, so we can't allow it (but a detailed error
3861 the python interpreter, so we can't allow it (but a detailed error
3838 is given to the user).
3862 is given to the user).
3839
3863
3840 2004-09-28 Fernando Perez <fperez@colorado.edu>
3864 2004-09-28 Fernando Perez <fperez@colorado.edu>
3841
3865
3842 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3866 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3843 matplotlib-related fixes so that using @run with non-matplotlib
3867 matplotlib-related fixes so that using @run with non-matplotlib
3844 scripts doesn't pop up spurious plot windows. This requires
3868 scripts doesn't pop up spurious plot windows. This requires
3845 matplotlib >= 0.63, where I had to make some changes as well.
3869 matplotlib >= 0.63, where I had to make some changes as well.
3846
3870
3847 * IPython/ipmaker.py (make_IPython): update version requirement to
3871 * IPython/ipmaker.py (make_IPython): update version requirement to
3848 python 2.2.
3872 python 2.2.
3849
3873
3850 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3874 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3851 banner arg for embedded customization.
3875 banner arg for embedded customization.
3852
3876
3853 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3877 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3854 explicit uses of __IP as the IPython's instance name. Now things
3878 explicit uses of __IP as the IPython's instance name. Now things
3855 are properly handled via the shell.name value. The actual code
3879 are properly handled via the shell.name value. The actual code
3856 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3880 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3857 is much better than before. I'll clean things completely when the
3881 is much better than before. I'll clean things completely when the
3858 magic stuff gets a real overhaul.
3882 magic stuff gets a real overhaul.
3859
3883
3860 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3884 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3861 minor changes to debian dir.
3885 minor changes to debian dir.
3862
3886
3863 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3887 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3864 pointer to the shell itself in the interactive namespace even when
3888 pointer to the shell itself in the interactive namespace even when
3865 a user-supplied dict is provided. This is needed for embedding
3889 a user-supplied dict is provided. This is needed for embedding
3866 purposes (found by tests with Michel Sanner).
3890 purposes (found by tests with Michel Sanner).
3867
3891
3868 2004-09-27 Fernando Perez <fperez@colorado.edu>
3892 2004-09-27 Fernando Perez <fperez@colorado.edu>
3869
3893
3870 * IPython/UserConfig/ipythonrc: remove []{} from
3894 * IPython/UserConfig/ipythonrc: remove []{} from
3871 readline_remove_delims, so that things like [modname.<TAB> do
3895 readline_remove_delims, so that things like [modname.<TAB> do
3872 proper completion. This disables [].TAB, but that's a less common
3896 proper completion. This disables [].TAB, but that's a less common
3873 case than module names in list comprehensions, for example.
3897 case than module names in list comprehensions, for example.
3874 Thanks to a report by Andrea Riciputi.
3898 Thanks to a report by Andrea Riciputi.
3875
3899
3876 2004-09-09 Fernando Perez <fperez@colorado.edu>
3900 2004-09-09 Fernando Perez <fperez@colorado.edu>
3877
3901
3878 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3902 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3879 blocking problems in win32 and osx. Fix by John.
3903 blocking problems in win32 and osx. Fix by John.
3880
3904
3881 2004-09-08 Fernando Perez <fperez@colorado.edu>
3905 2004-09-08 Fernando Perez <fperez@colorado.edu>
3882
3906
3883 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3907 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3884 for Win32 and OSX. Fix by John Hunter.
3908 for Win32 and OSX. Fix by John Hunter.
3885
3909
3886 2004-08-30 *** Released version 0.6.3
3910 2004-08-30 *** Released version 0.6.3
3887
3911
3888 2004-08-30 Fernando Perez <fperez@colorado.edu>
3912 2004-08-30 Fernando Perez <fperez@colorado.edu>
3889
3913
3890 * setup.py (isfile): Add manpages to list of dependent files to be
3914 * setup.py (isfile): Add manpages to list of dependent files to be
3891 updated.
3915 updated.
3892
3916
3893 2004-08-27 Fernando Perez <fperez@colorado.edu>
3917 2004-08-27 Fernando Perez <fperez@colorado.edu>
3894
3918
3895 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3919 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3896 for now. They don't really work with standalone WX/GTK code
3920 for now. They don't really work with standalone WX/GTK code
3897 (though matplotlib IS working fine with both of those backends).
3921 (though matplotlib IS working fine with both of those backends).
3898 This will neeed much more testing. I disabled most things with
3922 This will neeed much more testing. I disabled most things with
3899 comments, so turning it back on later should be pretty easy.
3923 comments, so turning it back on later should be pretty easy.
3900
3924
3901 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3925 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3902 autocalling of expressions like r'foo', by modifying the line
3926 autocalling of expressions like r'foo', by modifying the line
3903 split regexp. Closes
3927 split regexp. Closes
3904 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3928 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3905 Riley <ipythonbugs-AT-sabi.net>.
3929 Riley <ipythonbugs-AT-sabi.net>.
3906 (InteractiveShell.mainloop): honor --nobanner with banner
3930 (InteractiveShell.mainloop): honor --nobanner with banner
3907 extensions.
3931 extensions.
3908
3932
3909 * IPython/Shell.py: Significant refactoring of all classes, so
3933 * IPython/Shell.py: Significant refactoring of all classes, so
3910 that we can really support ALL matplotlib backends and threading
3934 that we can really support ALL matplotlib backends and threading
3911 models (John spotted a bug with Tk which required this). Now we
3935 models (John spotted a bug with Tk which required this). Now we
3912 should support single-threaded, WX-threads and GTK-threads, both
3936 should support single-threaded, WX-threads and GTK-threads, both
3913 for generic code and for matplotlib.
3937 for generic code and for matplotlib.
3914
3938
3915 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3939 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3916 -pylab, to simplify things for users. Will also remove the pylab
3940 -pylab, to simplify things for users. Will also remove the pylab
3917 profile, since now all of matplotlib configuration is directly
3941 profile, since now all of matplotlib configuration is directly
3918 handled here. This also reduces startup time.
3942 handled here. This also reduces startup time.
3919
3943
3920 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3944 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3921 shell wasn't being correctly called. Also in IPShellWX.
3945 shell wasn't being correctly called. Also in IPShellWX.
3922
3946
3923 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3947 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3924 fine-tune banner.
3948 fine-tune banner.
3925
3949
3926 * IPython/numutils.py (spike): Deprecate these spike functions,
3950 * IPython/numutils.py (spike): Deprecate these spike functions,
3927 delete (long deprecated) gnuplot_exec handler.
3951 delete (long deprecated) gnuplot_exec handler.
3928
3952
3929 2004-08-26 Fernando Perez <fperez@colorado.edu>
3953 2004-08-26 Fernando Perez <fperez@colorado.edu>
3930
3954
3931 * ipython.1: Update for threading options, plus some others which
3955 * ipython.1: Update for threading options, plus some others which
3932 were missing.
3956 were missing.
3933
3957
3934 * IPython/ipmaker.py (__call__): Added -wthread option for
3958 * IPython/ipmaker.py (__call__): Added -wthread option for
3935 wxpython thread handling. Make sure threading options are only
3959 wxpython thread handling. Make sure threading options are only
3936 valid at the command line.
3960 valid at the command line.
3937
3961
3938 * scripts/ipython: moved shell selection into a factory function
3962 * scripts/ipython: moved shell selection into a factory function
3939 in Shell.py, to keep the starter script to a minimum.
3963 in Shell.py, to keep the starter script to a minimum.
3940
3964
3941 2004-08-25 Fernando Perez <fperez@colorado.edu>
3965 2004-08-25 Fernando Perez <fperez@colorado.edu>
3942
3966
3943 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3967 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3944 John. Along with some recent changes he made to matplotlib, the
3968 John. Along with some recent changes he made to matplotlib, the
3945 next versions of both systems should work very well together.
3969 next versions of both systems should work very well together.
3946
3970
3947 2004-08-24 Fernando Perez <fperez@colorado.edu>
3971 2004-08-24 Fernando Perez <fperez@colorado.edu>
3948
3972
3949 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3973 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3950 tried to switch the profiling to using hotshot, but I'm getting
3974 tried to switch the profiling to using hotshot, but I'm getting
3951 strange errors from prof.runctx() there. I may be misreading the
3975 strange errors from prof.runctx() there. I may be misreading the
3952 docs, but it looks weird. For now the profiling code will
3976 docs, but it looks weird. For now the profiling code will
3953 continue to use the standard profiler.
3977 continue to use the standard profiler.
3954
3978
3955 2004-08-23 Fernando Perez <fperez@colorado.edu>
3979 2004-08-23 Fernando Perez <fperez@colorado.edu>
3956
3980
3957 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3981 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3958 threaded shell, by John Hunter. It's not quite ready yet, but
3982 threaded shell, by John Hunter. It's not quite ready yet, but
3959 close.
3983 close.
3960
3984
3961 2004-08-22 Fernando Perez <fperez@colorado.edu>
3985 2004-08-22 Fernando Perez <fperez@colorado.edu>
3962
3986
3963 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3987 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3964 in Magic and ultraTB.
3988 in Magic and ultraTB.
3965
3989
3966 * ipython.1: document threading options in manpage.
3990 * ipython.1: document threading options in manpage.
3967
3991
3968 * scripts/ipython: Changed name of -thread option to -gthread,
3992 * scripts/ipython: Changed name of -thread option to -gthread,
3969 since this is GTK specific. I want to leave the door open for a
3993 since this is GTK specific. I want to leave the door open for a
3970 -wthread option for WX, which will most likely be necessary. This
3994 -wthread option for WX, which will most likely be necessary. This
3971 change affects usage and ipmaker as well.
3995 change affects usage and ipmaker as well.
3972
3996
3973 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3997 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3974 handle the matplotlib shell issues. Code by John Hunter
3998 handle the matplotlib shell issues. Code by John Hunter
3975 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3999 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3976 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4000 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3977 broken (and disabled for end users) for now, but it puts the
4001 broken (and disabled for end users) for now, but it puts the
3978 infrastructure in place.
4002 infrastructure in place.
3979
4003
3980 2004-08-21 Fernando Perez <fperez@colorado.edu>
4004 2004-08-21 Fernando Perez <fperez@colorado.edu>
3981
4005
3982 * ipythonrc-pylab: Add matplotlib support.
4006 * ipythonrc-pylab: Add matplotlib support.
3983
4007
3984 * matplotlib_config.py: new files for matplotlib support, part of
4008 * matplotlib_config.py: new files for matplotlib support, part of
3985 the pylab profile.
4009 the pylab profile.
3986
4010
3987 * IPython/usage.py (__doc__): documented the threading options.
4011 * IPython/usage.py (__doc__): documented the threading options.
3988
4012
3989 2004-08-20 Fernando Perez <fperez@colorado.edu>
4013 2004-08-20 Fernando Perez <fperez@colorado.edu>
3990
4014
3991 * ipython: Modified the main calling routine to handle the -thread
4015 * ipython: Modified the main calling routine to handle the -thread
3992 and -mpthread options. This needs to be done as a top-level hack,
4016 and -mpthread options. This needs to be done as a top-level hack,
3993 because it determines which class to instantiate for IPython
4017 because it determines which class to instantiate for IPython
3994 itself.
4018 itself.
3995
4019
3996 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4020 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3997 classes to support multithreaded GTK operation without blocking,
4021 classes to support multithreaded GTK operation without blocking,
3998 and matplotlib with all backends. This is a lot of still very
4022 and matplotlib with all backends. This is a lot of still very
3999 experimental code, and threads are tricky. So it may still have a
4023 experimental code, and threads are tricky. So it may still have a
4000 few rough edges... This code owes a lot to
4024 few rough edges... This code owes a lot to
4001 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4025 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4002 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4026 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4003 to John Hunter for all the matplotlib work.
4027 to John Hunter for all the matplotlib work.
4004
4028
4005 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4029 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4006 options for gtk thread and matplotlib support.
4030 options for gtk thread and matplotlib support.
4007
4031
4008 2004-08-16 Fernando Perez <fperez@colorado.edu>
4032 2004-08-16 Fernando Perez <fperez@colorado.edu>
4009
4033
4010 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4034 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4011 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4035 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4012 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4036 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4013
4037
4014 2004-08-11 Fernando Perez <fperez@colorado.edu>
4038 2004-08-11 Fernando Perez <fperez@colorado.edu>
4015
4039
4016 * setup.py (isfile): Fix build so documentation gets updated for
4040 * setup.py (isfile): Fix build so documentation gets updated for
4017 rpms (it was only done for .tgz builds).
4041 rpms (it was only done for .tgz builds).
4018
4042
4019 2004-08-10 Fernando Perez <fperez@colorado.edu>
4043 2004-08-10 Fernando Perez <fperez@colorado.edu>
4020
4044
4021 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4045 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4022
4046
4023 * iplib.py : Silence syntax error exceptions in tab-completion.
4047 * iplib.py : Silence syntax error exceptions in tab-completion.
4024
4048
4025 2004-08-05 Fernando Perez <fperez@colorado.edu>
4049 2004-08-05 Fernando Perez <fperez@colorado.edu>
4026
4050
4027 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4051 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4028 'color off' mark for continuation prompts. This was causing long
4052 'color off' mark for continuation prompts. This was causing long
4029 continuation lines to mis-wrap.
4053 continuation lines to mis-wrap.
4030
4054
4031 2004-08-01 Fernando Perez <fperez@colorado.edu>
4055 2004-08-01 Fernando Perez <fperez@colorado.edu>
4032
4056
4033 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4057 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4034 for building ipython to be a parameter. All this is necessary
4058 for building ipython to be a parameter. All this is necessary
4035 right now to have a multithreaded version, but this insane
4059 right now to have a multithreaded version, but this insane
4036 non-design will be cleaned up soon. For now, it's a hack that
4060 non-design will be cleaned up soon. For now, it's a hack that
4037 works.
4061 works.
4038
4062
4039 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4063 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4040 args in various places. No bugs so far, but it's a dangerous
4064 args in various places. No bugs so far, but it's a dangerous
4041 practice.
4065 practice.
4042
4066
4043 2004-07-31 Fernando Perez <fperez@colorado.edu>
4067 2004-07-31 Fernando Perez <fperez@colorado.edu>
4044
4068
4045 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4069 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4046 fix completion of files with dots in their names under most
4070 fix completion of files with dots in their names under most
4047 profiles (pysh was OK because the completion order is different).
4071 profiles (pysh was OK because the completion order is different).
4048
4072
4049 2004-07-27 Fernando Perez <fperez@colorado.edu>
4073 2004-07-27 Fernando Perez <fperez@colorado.edu>
4050
4074
4051 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4075 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4052 keywords manually, b/c the one in keyword.py was removed in python
4076 keywords manually, b/c the one in keyword.py was removed in python
4053 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4077 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4054 This is NOT a bug under python 2.3 and earlier.
4078 This is NOT a bug under python 2.3 and earlier.
4055
4079
4056 2004-07-26 Fernando Perez <fperez@colorado.edu>
4080 2004-07-26 Fernando Perez <fperez@colorado.edu>
4057
4081
4058 * IPython/ultraTB.py (VerboseTB.text): Add another
4082 * IPython/ultraTB.py (VerboseTB.text): Add another
4059 linecache.checkcache() call to try to prevent inspect.py from
4083 linecache.checkcache() call to try to prevent inspect.py from
4060 crashing under python 2.3. I think this fixes
4084 crashing under python 2.3. I think this fixes
4061 http://www.scipy.net/roundup/ipython/issue17.
4085 http://www.scipy.net/roundup/ipython/issue17.
4062
4086
4063 2004-07-26 *** Released version 0.6.2
4087 2004-07-26 *** Released version 0.6.2
4064
4088
4065 2004-07-26 Fernando Perez <fperez@colorado.edu>
4089 2004-07-26 Fernando Perez <fperez@colorado.edu>
4066
4090
4067 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4091 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4068 fail for any number.
4092 fail for any number.
4069 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4093 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4070 empty bookmarks.
4094 empty bookmarks.
4071
4095
4072 2004-07-26 *** Released version 0.6.1
4096 2004-07-26 *** Released version 0.6.1
4073
4097
4074 2004-07-26 Fernando Perez <fperez@colorado.edu>
4098 2004-07-26 Fernando Perez <fperez@colorado.edu>
4075
4099
4076 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4100 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4077
4101
4078 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4102 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4079 escaping '()[]{}' in filenames.
4103 escaping '()[]{}' in filenames.
4080
4104
4081 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4105 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4082 Python 2.2 users who lack a proper shlex.split.
4106 Python 2.2 users who lack a proper shlex.split.
4083
4107
4084 2004-07-19 Fernando Perez <fperez@colorado.edu>
4108 2004-07-19 Fernando Perez <fperez@colorado.edu>
4085
4109
4086 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4110 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4087 for reading readline's init file. I follow the normal chain:
4111 for reading readline's init file. I follow the normal chain:
4088 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4112 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4089 report by Mike Heeter. This closes
4113 report by Mike Heeter. This closes
4090 http://www.scipy.net/roundup/ipython/issue16.
4114 http://www.scipy.net/roundup/ipython/issue16.
4091
4115
4092 2004-07-18 Fernando Perez <fperez@colorado.edu>
4116 2004-07-18 Fernando Perez <fperez@colorado.edu>
4093
4117
4094 * IPython/iplib.py (__init__): Add better handling of '\' under
4118 * IPython/iplib.py (__init__): Add better handling of '\' under
4095 Win32 for filenames. After a patch by Ville.
4119 Win32 for filenames. After a patch by Ville.
4096
4120
4097 2004-07-17 Fernando Perez <fperez@colorado.edu>
4121 2004-07-17 Fernando Perez <fperez@colorado.edu>
4098
4122
4099 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4123 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4100 autocalling would be triggered for 'foo is bar' if foo is
4124 autocalling would be triggered for 'foo is bar' if foo is
4101 callable. I also cleaned up the autocall detection code to use a
4125 callable. I also cleaned up the autocall detection code to use a
4102 regexp, which is faster. Bug reported by Alexander Schmolck.
4126 regexp, which is faster. Bug reported by Alexander Schmolck.
4103
4127
4104 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4128 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4105 '?' in them would confuse the help system. Reported by Alex
4129 '?' in them would confuse the help system. Reported by Alex
4106 Schmolck.
4130 Schmolck.
4107
4131
4108 2004-07-16 Fernando Perez <fperez@colorado.edu>
4132 2004-07-16 Fernando Perez <fperez@colorado.edu>
4109
4133
4110 * IPython/GnuplotInteractive.py (__all__): added plot2.
4134 * IPython/GnuplotInteractive.py (__all__): added plot2.
4111
4135
4112 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4136 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4113 plotting dictionaries, lists or tuples of 1d arrays.
4137 plotting dictionaries, lists or tuples of 1d arrays.
4114
4138
4115 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4139 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4116 optimizations.
4140 optimizations.
4117
4141
4118 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4142 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4119 the information which was there from Janko's original IPP code:
4143 the information which was there from Janko's original IPP code:
4120
4144
4121 03.05.99 20:53 porto.ifm.uni-kiel.de
4145 03.05.99 20:53 porto.ifm.uni-kiel.de
4122 --Started changelog.
4146 --Started changelog.
4123 --make clear do what it say it does
4147 --make clear do what it say it does
4124 --added pretty output of lines from inputcache
4148 --added pretty output of lines from inputcache
4125 --Made Logger a mixin class, simplifies handling of switches
4149 --Made Logger a mixin class, simplifies handling of switches
4126 --Added own completer class. .string<TAB> expands to last history
4150 --Added own completer class. .string<TAB> expands to last history
4127 line which starts with string. The new expansion is also present
4151 line which starts with string. The new expansion is also present
4128 with Ctrl-r from the readline library. But this shows, who this
4152 with Ctrl-r from the readline library. But this shows, who this
4129 can be done for other cases.
4153 can be done for other cases.
4130 --Added convention that all shell functions should accept a
4154 --Added convention that all shell functions should accept a
4131 parameter_string This opens the door for different behaviour for
4155 parameter_string This opens the door for different behaviour for
4132 each function. @cd is a good example of this.
4156 each function. @cd is a good example of this.
4133
4157
4134 04.05.99 12:12 porto.ifm.uni-kiel.de
4158 04.05.99 12:12 porto.ifm.uni-kiel.de
4135 --added logfile rotation
4159 --added logfile rotation
4136 --added new mainloop method which freezes first the namespace
4160 --added new mainloop method which freezes first the namespace
4137
4161
4138 07.05.99 21:24 porto.ifm.uni-kiel.de
4162 07.05.99 21:24 porto.ifm.uni-kiel.de
4139 --added the docreader classes. Now there is a help system.
4163 --added the docreader classes. Now there is a help system.
4140 -This is only a first try. Currently it's not easy to put new
4164 -This is only a first try. Currently it's not easy to put new
4141 stuff in the indices. But this is the way to go. Info would be
4165 stuff in the indices. But this is the way to go. Info would be
4142 better, but HTML is every where and not everybody has an info
4166 better, but HTML is every where and not everybody has an info
4143 system installed and it's not so easy to change html-docs to info.
4167 system installed and it's not so easy to change html-docs to info.
4144 --added global logfile option
4168 --added global logfile option
4145 --there is now a hook for object inspection method pinfo needs to
4169 --there is now a hook for object inspection method pinfo needs to
4146 be provided for this. Can be reached by two '??'.
4170 be provided for this. Can be reached by two '??'.
4147
4171
4148 08.05.99 20:51 porto.ifm.uni-kiel.de
4172 08.05.99 20:51 porto.ifm.uni-kiel.de
4149 --added a README
4173 --added a README
4150 --bug in rc file. Something has changed so functions in the rc
4174 --bug in rc file. Something has changed so functions in the rc
4151 file need to reference the shell and not self. Not clear if it's a
4175 file need to reference the shell and not self. Not clear if it's a
4152 bug or feature.
4176 bug or feature.
4153 --changed rc file for new behavior
4177 --changed rc file for new behavior
4154
4178
4155 2004-07-15 Fernando Perez <fperez@colorado.edu>
4179 2004-07-15 Fernando Perez <fperez@colorado.edu>
4156
4180
4157 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4181 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4158 cache was falling out of sync in bizarre manners when multi-line
4182 cache was falling out of sync in bizarre manners when multi-line
4159 input was present. Minor optimizations and cleanup.
4183 input was present. Minor optimizations and cleanup.
4160
4184
4161 (Logger): Remove old Changelog info for cleanup. This is the
4185 (Logger): Remove old Changelog info for cleanup. This is the
4162 information which was there from Janko's original code:
4186 information which was there from Janko's original code:
4163
4187
4164 Changes to Logger: - made the default log filename a parameter
4188 Changes to Logger: - made the default log filename a parameter
4165
4189
4166 - put a check for lines beginning with !@? in log(). Needed
4190 - put a check for lines beginning with !@? in log(). Needed
4167 (even if the handlers properly log their lines) for mid-session
4191 (even if the handlers properly log their lines) for mid-session
4168 logging activation to work properly. Without this, lines logged
4192 logging activation to work properly. Without this, lines logged
4169 in mid session, which get read from the cache, would end up
4193 in mid session, which get read from the cache, would end up
4170 'bare' (with !@? in the open) in the log. Now they are caught
4194 'bare' (with !@? in the open) in the log. Now they are caught
4171 and prepended with a #.
4195 and prepended with a #.
4172
4196
4173 * IPython/iplib.py (InteractiveShell.init_readline): added check
4197 * IPython/iplib.py (InteractiveShell.init_readline): added check
4174 in case MagicCompleter fails to be defined, so we don't crash.
4198 in case MagicCompleter fails to be defined, so we don't crash.
4175
4199
4176 2004-07-13 Fernando Perez <fperez@colorado.edu>
4200 2004-07-13 Fernando Perez <fperez@colorado.edu>
4177
4201
4178 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4202 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4179 of EPS if the requested filename ends in '.eps'.
4203 of EPS if the requested filename ends in '.eps'.
4180
4204
4181 2004-07-04 Fernando Perez <fperez@colorado.edu>
4205 2004-07-04 Fernando Perez <fperez@colorado.edu>
4182
4206
4183 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4207 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4184 escaping of quotes when calling the shell.
4208 escaping of quotes when calling the shell.
4185
4209
4186 2004-07-02 Fernando Perez <fperez@colorado.edu>
4210 2004-07-02 Fernando Perez <fperez@colorado.edu>
4187
4211
4188 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4212 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4189 gettext not working because we were clobbering '_'. Fixes
4213 gettext not working because we were clobbering '_'. Fixes
4190 http://www.scipy.net/roundup/ipython/issue6.
4214 http://www.scipy.net/roundup/ipython/issue6.
4191
4215
4192 2004-07-01 Fernando Perez <fperez@colorado.edu>
4216 2004-07-01 Fernando Perez <fperez@colorado.edu>
4193
4217
4194 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4218 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4195 into @cd. Patch by Ville.
4219 into @cd. Patch by Ville.
4196
4220
4197 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4221 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4198 new function to store things after ipmaker runs. Patch by Ville.
4222 new function to store things after ipmaker runs. Patch by Ville.
4199 Eventually this will go away once ipmaker is removed and the class
4223 Eventually this will go away once ipmaker is removed and the class
4200 gets cleaned up, but for now it's ok. Key functionality here is
4224 gets cleaned up, but for now it's ok. Key functionality here is
4201 the addition of the persistent storage mechanism, a dict for
4225 the addition of the persistent storage mechanism, a dict for
4202 keeping data across sessions (for now just bookmarks, but more can
4226 keeping data across sessions (for now just bookmarks, but more can
4203 be implemented later).
4227 be implemented later).
4204
4228
4205 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4229 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4206 persistent across sections. Patch by Ville, I modified it
4230 persistent across sections. Patch by Ville, I modified it
4207 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4231 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4208 added a '-l' option to list all bookmarks.
4232 added a '-l' option to list all bookmarks.
4209
4233
4210 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4234 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4211 center for cleanup. Registered with atexit.register(). I moved
4235 center for cleanup. Registered with atexit.register(). I moved
4212 here the old exit_cleanup(). After a patch by Ville.
4236 here the old exit_cleanup(). After a patch by Ville.
4213
4237
4214 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4238 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4215 characters in the hacked shlex_split for python 2.2.
4239 characters in the hacked shlex_split for python 2.2.
4216
4240
4217 * IPython/iplib.py (file_matches): more fixes to filenames with
4241 * IPython/iplib.py (file_matches): more fixes to filenames with
4218 whitespace in them. It's not perfect, but limitations in python's
4242 whitespace in them. It's not perfect, but limitations in python's
4219 readline make it impossible to go further.
4243 readline make it impossible to go further.
4220
4244
4221 2004-06-29 Fernando Perez <fperez@colorado.edu>
4245 2004-06-29 Fernando Perez <fperez@colorado.edu>
4222
4246
4223 * IPython/iplib.py (file_matches): escape whitespace correctly in
4247 * IPython/iplib.py (file_matches): escape whitespace correctly in
4224 filename completions. Bug reported by Ville.
4248 filename completions. Bug reported by Ville.
4225
4249
4226 2004-06-28 Fernando Perez <fperez@colorado.edu>
4250 2004-06-28 Fernando Perez <fperez@colorado.edu>
4227
4251
4228 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4252 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4229 the history file will be called 'history-PROFNAME' (or just
4253 the history file will be called 'history-PROFNAME' (or just
4230 'history' if no profile is loaded). I was getting annoyed at
4254 'history' if no profile is loaded). I was getting annoyed at
4231 getting my Numerical work history clobbered by pysh sessions.
4255 getting my Numerical work history clobbered by pysh sessions.
4232
4256
4233 * IPython/iplib.py (InteractiveShell.__init__): Internal
4257 * IPython/iplib.py (InteractiveShell.__init__): Internal
4234 getoutputerror() function so that we can honor the system_verbose
4258 getoutputerror() function so that we can honor the system_verbose
4235 flag for _all_ system calls. I also added escaping of #
4259 flag for _all_ system calls. I also added escaping of #
4236 characters here to avoid confusing Itpl.
4260 characters here to avoid confusing Itpl.
4237
4261
4238 * IPython/Magic.py (shlex_split): removed call to shell in
4262 * IPython/Magic.py (shlex_split): removed call to shell in
4239 parse_options and replaced it with shlex.split(). The annoying
4263 parse_options and replaced it with shlex.split(). The annoying
4240 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4264 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4241 to backport it from 2.3, with several frail hacks (the shlex
4265 to backport it from 2.3, with several frail hacks (the shlex
4242 module is rather limited in 2.2). Thanks to a suggestion by Ville
4266 module is rather limited in 2.2). Thanks to a suggestion by Ville
4243 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4267 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4244 problem.
4268 problem.
4245
4269
4246 (Magic.magic_system_verbose): new toggle to print the actual
4270 (Magic.magic_system_verbose): new toggle to print the actual
4247 system calls made by ipython. Mainly for debugging purposes.
4271 system calls made by ipython. Mainly for debugging purposes.
4248
4272
4249 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4273 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4250 doesn't support persistence. Reported (and fix suggested) by
4274 doesn't support persistence. Reported (and fix suggested) by
4251 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4275 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4252
4276
4253 2004-06-26 Fernando Perez <fperez@colorado.edu>
4277 2004-06-26 Fernando Perez <fperez@colorado.edu>
4254
4278
4255 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4279 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4256 continue prompts.
4280 continue prompts.
4257
4281
4258 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4282 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4259 function (basically a big docstring) and a few more things here to
4283 function (basically a big docstring) and a few more things here to
4260 speedup startup. pysh.py is now very lightweight. We want because
4284 speedup startup. pysh.py is now very lightweight. We want because
4261 it gets execfile'd, while InterpreterExec gets imported, so
4285 it gets execfile'd, while InterpreterExec gets imported, so
4262 byte-compilation saves time.
4286 byte-compilation saves time.
4263
4287
4264 2004-06-25 Fernando Perez <fperez@colorado.edu>
4288 2004-06-25 Fernando Perez <fperez@colorado.edu>
4265
4289
4266 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4290 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4267 -NUM', which was recently broken.
4291 -NUM', which was recently broken.
4268
4292
4269 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4293 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4270 in multi-line input (but not !!, which doesn't make sense there).
4294 in multi-line input (but not !!, which doesn't make sense there).
4271
4295
4272 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4296 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4273 It's just too useful, and people can turn it off in the less
4297 It's just too useful, and people can turn it off in the less
4274 common cases where it's a problem.
4298 common cases where it's a problem.
4275
4299
4276 2004-06-24 Fernando Perez <fperez@colorado.edu>
4300 2004-06-24 Fernando Perez <fperez@colorado.edu>
4277
4301
4278 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4302 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4279 special syntaxes (like alias calling) is now allied in multi-line
4303 special syntaxes (like alias calling) is now allied in multi-line
4280 input. This is still _very_ experimental, but it's necessary for
4304 input. This is still _very_ experimental, but it's necessary for
4281 efficient shell usage combining python looping syntax with system
4305 efficient shell usage combining python looping syntax with system
4282 calls. For now it's restricted to aliases, I don't think it
4306 calls. For now it's restricted to aliases, I don't think it
4283 really even makes sense to have this for magics.
4307 really even makes sense to have this for magics.
4284
4308
4285 2004-06-23 Fernando Perez <fperez@colorado.edu>
4309 2004-06-23 Fernando Perez <fperez@colorado.edu>
4286
4310
4287 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4311 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4288 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4312 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4289
4313
4290 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4314 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4291 extensions under Windows (after code sent by Gary Bishop). The
4315 extensions under Windows (after code sent by Gary Bishop). The
4292 extensions considered 'executable' are stored in IPython's rc
4316 extensions considered 'executable' are stored in IPython's rc
4293 structure as win_exec_ext.
4317 structure as win_exec_ext.
4294
4318
4295 * IPython/genutils.py (shell): new function, like system() but
4319 * IPython/genutils.py (shell): new function, like system() but
4296 without return value. Very useful for interactive shell work.
4320 without return value. Very useful for interactive shell work.
4297
4321
4298 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4322 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4299 delete aliases.
4323 delete aliases.
4300
4324
4301 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4325 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4302 sure that the alias table doesn't contain python keywords.
4326 sure that the alias table doesn't contain python keywords.
4303
4327
4304 2004-06-21 Fernando Perez <fperez@colorado.edu>
4328 2004-06-21 Fernando Perez <fperez@colorado.edu>
4305
4329
4306 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4330 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4307 non-existent items are found in $PATH. Reported by Thorsten.
4331 non-existent items are found in $PATH. Reported by Thorsten.
4308
4332
4309 2004-06-20 Fernando Perez <fperez@colorado.edu>
4333 2004-06-20 Fernando Perez <fperez@colorado.edu>
4310
4334
4311 * IPython/iplib.py (complete): modified the completer so that the
4335 * IPython/iplib.py (complete): modified the completer so that the
4312 order of priorities can be easily changed at runtime.
4336 order of priorities can be easily changed at runtime.
4313
4337
4314 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4338 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4315 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4339 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4316
4340
4317 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4341 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4318 expand Python variables prepended with $ in all system calls. The
4342 expand Python variables prepended with $ in all system calls. The
4319 same was done to InteractiveShell.handle_shell_escape. Now all
4343 same was done to InteractiveShell.handle_shell_escape. Now all
4320 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4344 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4321 expansion of python variables and expressions according to the
4345 expansion of python variables and expressions according to the
4322 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4346 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4323
4347
4324 Though PEP-215 has been rejected, a similar (but simpler) one
4348 Though PEP-215 has been rejected, a similar (but simpler) one
4325 seems like it will go into Python 2.4, PEP-292 -
4349 seems like it will go into Python 2.4, PEP-292 -
4326 http://www.python.org/peps/pep-0292.html.
4350 http://www.python.org/peps/pep-0292.html.
4327
4351
4328 I'll keep the full syntax of PEP-215, since IPython has since the
4352 I'll keep the full syntax of PEP-215, since IPython has since the
4329 start used Ka-Ping Yee's reference implementation discussed there
4353 start used Ka-Ping Yee's reference implementation discussed there
4330 (Itpl), and I actually like the powerful semantics it offers.
4354 (Itpl), and I actually like the powerful semantics it offers.
4331
4355
4332 In order to access normal shell variables, the $ has to be escaped
4356 In order to access normal shell variables, the $ has to be escaped
4333 via an extra $. For example:
4357 via an extra $. For example:
4334
4358
4335 In [7]: PATH='a python variable'
4359 In [7]: PATH='a python variable'
4336
4360
4337 In [8]: !echo $PATH
4361 In [8]: !echo $PATH
4338 a python variable
4362 a python variable
4339
4363
4340 In [9]: !echo $$PATH
4364 In [9]: !echo $$PATH
4341 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4365 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4342
4366
4343 (Magic.parse_options): escape $ so the shell doesn't evaluate
4367 (Magic.parse_options): escape $ so the shell doesn't evaluate
4344 things prematurely.
4368 things prematurely.
4345
4369
4346 * IPython/iplib.py (InteractiveShell.call_alias): added the
4370 * IPython/iplib.py (InteractiveShell.call_alias): added the
4347 ability for aliases to expand python variables via $.
4371 ability for aliases to expand python variables via $.
4348
4372
4349 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4373 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4350 system, now there's a @rehash/@rehashx pair of magics. These work
4374 system, now there's a @rehash/@rehashx pair of magics. These work
4351 like the csh rehash command, and can be invoked at any time. They
4375 like the csh rehash command, and can be invoked at any time. They
4352 build a table of aliases to everything in the user's $PATH
4376 build a table of aliases to everything in the user's $PATH
4353 (@rehash uses everything, @rehashx is slower but only adds
4377 (@rehash uses everything, @rehashx is slower but only adds
4354 executable files). With this, the pysh.py-based shell profile can
4378 executable files). With this, the pysh.py-based shell profile can
4355 now simply call rehash upon startup, and full access to all
4379 now simply call rehash upon startup, and full access to all
4356 programs in the user's path is obtained.
4380 programs in the user's path is obtained.
4357
4381
4358 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4382 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4359 functionality is now fully in place. I removed the old dynamic
4383 functionality is now fully in place. I removed the old dynamic
4360 code generation based approach, in favor of a much lighter one
4384 code generation based approach, in favor of a much lighter one
4361 based on a simple dict. The advantage is that this allows me to
4385 based on a simple dict. The advantage is that this allows me to
4362 now have thousands of aliases with negligible cost (unthinkable
4386 now have thousands of aliases with negligible cost (unthinkable
4363 with the old system).
4387 with the old system).
4364
4388
4365 2004-06-19 Fernando Perez <fperez@colorado.edu>
4389 2004-06-19 Fernando Perez <fperez@colorado.edu>
4366
4390
4367 * IPython/iplib.py (__init__): extended MagicCompleter class to
4391 * IPython/iplib.py (__init__): extended MagicCompleter class to
4368 also complete (last in priority) on user aliases.
4392 also complete (last in priority) on user aliases.
4369
4393
4370 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4394 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4371 call to eval.
4395 call to eval.
4372 (ItplNS.__init__): Added a new class which functions like Itpl,
4396 (ItplNS.__init__): Added a new class which functions like Itpl,
4373 but allows configuring the namespace for the evaluation to occur
4397 but allows configuring the namespace for the evaluation to occur
4374 in.
4398 in.
4375
4399
4376 2004-06-18 Fernando Perez <fperez@colorado.edu>
4400 2004-06-18 Fernando Perez <fperez@colorado.edu>
4377
4401
4378 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4402 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4379 better message when 'exit' or 'quit' are typed (a common newbie
4403 better message when 'exit' or 'quit' are typed (a common newbie
4380 confusion).
4404 confusion).
4381
4405
4382 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4406 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4383 check for Windows users.
4407 check for Windows users.
4384
4408
4385 * IPython/iplib.py (InteractiveShell.user_setup): removed
4409 * IPython/iplib.py (InteractiveShell.user_setup): removed
4386 disabling of colors for Windows. I'll test at runtime and issue a
4410 disabling of colors for Windows. I'll test at runtime and issue a
4387 warning if Gary's readline isn't found, as to nudge users to
4411 warning if Gary's readline isn't found, as to nudge users to
4388 download it.
4412 download it.
4389
4413
4390 2004-06-16 Fernando Perez <fperez@colorado.edu>
4414 2004-06-16 Fernando Perez <fperez@colorado.edu>
4391
4415
4392 * IPython/genutils.py (Stream.__init__): changed to print errors
4416 * IPython/genutils.py (Stream.__init__): changed to print errors
4393 to sys.stderr. I had a circular dependency here. Now it's
4417 to sys.stderr. I had a circular dependency here. Now it's
4394 possible to run ipython as IDLE's shell (consider this pre-alpha,
4418 possible to run ipython as IDLE's shell (consider this pre-alpha,
4395 since true stdout things end up in the starting terminal instead
4419 since true stdout things end up in the starting terminal instead
4396 of IDLE's out).
4420 of IDLE's out).
4397
4421
4398 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4422 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4399 users who haven't # updated their prompt_in2 definitions. Remove
4423 users who haven't # updated their prompt_in2 definitions. Remove
4400 eventually.
4424 eventually.
4401 (multiple_replace): added credit to original ASPN recipe.
4425 (multiple_replace): added credit to original ASPN recipe.
4402
4426
4403 2004-06-15 Fernando Perez <fperez@colorado.edu>
4427 2004-06-15 Fernando Perez <fperez@colorado.edu>
4404
4428
4405 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4429 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4406 list of auto-defined aliases.
4430 list of auto-defined aliases.
4407
4431
4408 2004-06-13 Fernando Perez <fperez@colorado.edu>
4432 2004-06-13 Fernando Perez <fperez@colorado.edu>
4409
4433
4410 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4434 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4411 install was really requested (so setup.py can be used for other
4435 install was really requested (so setup.py can be used for other
4412 things under Windows).
4436 things under Windows).
4413
4437
4414 2004-06-10 Fernando Perez <fperez@colorado.edu>
4438 2004-06-10 Fernando Perez <fperez@colorado.edu>
4415
4439
4416 * IPython/Logger.py (Logger.create_log): Manually remove any old
4440 * IPython/Logger.py (Logger.create_log): Manually remove any old
4417 backup, since os.remove may fail under Windows. Fixes bug
4441 backup, since os.remove may fail under Windows. Fixes bug
4418 reported by Thorsten.
4442 reported by Thorsten.
4419
4443
4420 2004-06-09 Fernando Perez <fperez@colorado.edu>
4444 2004-06-09 Fernando Perez <fperez@colorado.edu>
4421
4445
4422 * examples/example-embed.py: fixed all references to %n (replaced
4446 * examples/example-embed.py: fixed all references to %n (replaced
4423 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4447 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4424 for all examples and the manual as well.
4448 for all examples and the manual as well.
4425
4449
4426 2004-06-08 Fernando Perez <fperez@colorado.edu>
4450 2004-06-08 Fernando Perez <fperez@colorado.edu>
4427
4451
4428 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4452 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4429 alignment and color management. All 3 prompt subsystems now
4453 alignment and color management. All 3 prompt subsystems now
4430 inherit from BasePrompt.
4454 inherit from BasePrompt.
4431
4455
4432 * tools/release: updates for windows installer build and tag rpms
4456 * tools/release: updates for windows installer build and tag rpms
4433 with python version (since paths are fixed).
4457 with python version (since paths are fixed).
4434
4458
4435 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4459 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4436 which will become eventually obsolete. Also fixed the default
4460 which will become eventually obsolete. Also fixed the default
4437 prompt_in2 to use \D, so at least new users start with the correct
4461 prompt_in2 to use \D, so at least new users start with the correct
4438 defaults.
4462 defaults.
4439 WARNING: Users with existing ipythonrc files will need to apply
4463 WARNING: Users with existing ipythonrc files will need to apply
4440 this fix manually!
4464 this fix manually!
4441
4465
4442 * setup.py: make windows installer (.exe). This is finally the
4466 * setup.py: make windows installer (.exe). This is finally the
4443 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4467 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4444 which I hadn't included because it required Python 2.3 (or recent
4468 which I hadn't included because it required Python 2.3 (or recent
4445 distutils).
4469 distutils).
4446
4470
4447 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4471 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4448 usage of new '\D' escape.
4472 usage of new '\D' escape.
4449
4473
4450 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4474 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4451 lacks os.getuid())
4475 lacks os.getuid())
4452 (CachedOutput.set_colors): Added the ability to turn coloring
4476 (CachedOutput.set_colors): Added the ability to turn coloring
4453 on/off with @colors even for manually defined prompt colors. It
4477 on/off with @colors even for manually defined prompt colors. It
4454 uses a nasty global, but it works safely and via the generic color
4478 uses a nasty global, but it works safely and via the generic color
4455 handling mechanism.
4479 handling mechanism.
4456 (Prompt2.__init__): Introduced new escape '\D' for continuation
4480 (Prompt2.__init__): Introduced new escape '\D' for continuation
4457 prompts. It represents the counter ('\#') as dots.
4481 prompts. It represents the counter ('\#') as dots.
4458 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4482 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4459 need to update their ipythonrc files and replace '%n' with '\D' in
4483 need to update their ipythonrc files and replace '%n' with '\D' in
4460 their prompt_in2 settings everywhere. Sorry, but there's
4484 their prompt_in2 settings everywhere. Sorry, but there's
4461 otherwise no clean way to get all prompts to properly align. The
4485 otherwise no clean way to get all prompts to properly align. The
4462 ipythonrc shipped with IPython has been updated.
4486 ipythonrc shipped with IPython has been updated.
4463
4487
4464 2004-06-07 Fernando Perez <fperez@colorado.edu>
4488 2004-06-07 Fernando Perez <fperez@colorado.edu>
4465
4489
4466 * setup.py (isfile): Pass local_icons option to latex2html, so the
4490 * setup.py (isfile): Pass local_icons option to latex2html, so the
4467 resulting HTML file is self-contained. Thanks to
4491 resulting HTML file is self-contained. Thanks to
4468 dryice-AT-liu.com.cn for the tip.
4492 dryice-AT-liu.com.cn for the tip.
4469
4493
4470 * pysh.py: I created a new profile 'shell', which implements a
4494 * pysh.py: I created a new profile 'shell', which implements a
4471 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4495 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4472 system shell, nor will it become one anytime soon. It's mainly
4496 system shell, nor will it become one anytime soon. It's mainly
4473 meant to illustrate the use of the new flexible bash-like prompts.
4497 meant to illustrate the use of the new flexible bash-like prompts.
4474 I guess it could be used by hardy souls for true shell management,
4498 I guess it could be used by hardy souls for true shell management,
4475 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4499 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4476 profile. This uses the InterpreterExec extension provided by
4500 profile. This uses the InterpreterExec extension provided by
4477 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4501 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4478
4502
4479 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4503 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4480 auto-align itself with the length of the previous input prompt
4504 auto-align itself with the length of the previous input prompt
4481 (taking into account the invisible color escapes).
4505 (taking into account the invisible color escapes).
4482 (CachedOutput.__init__): Large restructuring of this class. Now
4506 (CachedOutput.__init__): Large restructuring of this class. Now
4483 all three prompts (primary1, primary2, output) are proper objects,
4507 all three prompts (primary1, primary2, output) are proper objects,
4484 managed by the 'parent' CachedOutput class. The code is still a
4508 managed by the 'parent' CachedOutput class. The code is still a
4485 bit hackish (all prompts share state via a pointer to the cache),
4509 bit hackish (all prompts share state via a pointer to the cache),
4486 but it's overall far cleaner than before.
4510 but it's overall far cleaner than before.
4487
4511
4488 * IPython/genutils.py (getoutputerror): modified to add verbose,
4512 * IPython/genutils.py (getoutputerror): modified to add verbose,
4489 debug and header options. This makes the interface of all getout*
4513 debug and header options. This makes the interface of all getout*
4490 functions uniform.
4514 functions uniform.
4491 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4515 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4492
4516
4493 * IPython/Magic.py (Magic.default_option): added a function to
4517 * IPython/Magic.py (Magic.default_option): added a function to
4494 allow registering default options for any magic command. This
4518 allow registering default options for any magic command. This
4495 makes it easy to have profiles which customize the magics globally
4519 makes it easy to have profiles which customize the magics globally
4496 for a certain use. The values set through this function are
4520 for a certain use. The values set through this function are
4497 picked up by the parse_options() method, which all magics should
4521 picked up by the parse_options() method, which all magics should
4498 use to parse their options.
4522 use to parse their options.
4499
4523
4500 * IPython/genutils.py (warn): modified the warnings framework to
4524 * IPython/genutils.py (warn): modified the warnings framework to
4501 use the Term I/O class. I'm trying to slowly unify all of
4525 use the Term I/O class. I'm trying to slowly unify all of
4502 IPython's I/O operations to pass through Term.
4526 IPython's I/O operations to pass through Term.
4503
4527
4504 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4528 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4505 the secondary prompt to correctly match the length of the primary
4529 the secondary prompt to correctly match the length of the primary
4506 one for any prompt. Now multi-line code will properly line up
4530 one for any prompt. Now multi-line code will properly line up
4507 even for path dependent prompts, such as the new ones available
4531 even for path dependent prompts, such as the new ones available
4508 via the prompt_specials.
4532 via the prompt_specials.
4509
4533
4510 2004-06-06 Fernando Perez <fperez@colorado.edu>
4534 2004-06-06 Fernando Perez <fperez@colorado.edu>
4511
4535
4512 * IPython/Prompts.py (prompt_specials): Added the ability to have
4536 * IPython/Prompts.py (prompt_specials): Added the ability to have
4513 bash-like special sequences in the prompts, which get
4537 bash-like special sequences in the prompts, which get
4514 automatically expanded. Things like hostname, current working
4538 automatically expanded. Things like hostname, current working
4515 directory and username are implemented already, but it's easy to
4539 directory and username are implemented already, but it's easy to
4516 add more in the future. Thanks to a patch by W.J. van der Laan
4540 add more in the future. Thanks to a patch by W.J. van der Laan
4517 <gnufnork-AT-hetdigitalegat.nl>
4541 <gnufnork-AT-hetdigitalegat.nl>
4518 (prompt_specials): Added color support for prompt strings, so
4542 (prompt_specials): Added color support for prompt strings, so
4519 users can define arbitrary color setups for their prompts.
4543 users can define arbitrary color setups for their prompts.
4520
4544
4521 2004-06-05 Fernando Perez <fperez@colorado.edu>
4545 2004-06-05 Fernando Perez <fperez@colorado.edu>
4522
4546
4523 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4547 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4524 code to load Gary Bishop's readline and configure it
4548 code to load Gary Bishop's readline and configure it
4525 automatically. Thanks to Gary for help on this.
4549 automatically. Thanks to Gary for help on this.
4526
4550
4527 2004-06-01 Fernando Perez <fperez@colorado.edu>
4551 2004-06-01 Fernando Perez <fperez@colorado.edu>
4528
4552
4529 * IPython/Logger.py (Logger.create_log): fix bug for logging
4553 * IPython/Logger.py (Logger.create_log): fix bug for logging
4530 with no filename (previous fix was incomplete).
4554 with no filename (previous fix was incomplete).
4531
4555
4532 2004-05-25 Fernando Perez <fperez@colorado.edu>
4556 2004-05-25 Fernando Perez <fperez@colorado.edu>
4533
4557
4534 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4558 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4535 parens would get passed to the shell.
4559 parens would get passed to the shell.
4536
4560
4537 2004-05-20 Fernando Perez <fperez@colorado.edu>
4561 2004-05-20 Fernando Perez <fperez@colorado.edu>
4538
4562
4539 * IPython/Magic.py (Magic.magic_prun): changed default profile
4563 * IPython/Magic.py (Magic.magic_prun): changed default profile
4540 sort order to 'time' (the more common profiling need).
4564 sort order to 'time' (the more common profiling need).
4541
4565
4542 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4566 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4543 so that source code shown is guaranteed in sync with the file on
4567 so that source code shown is guaranteed in sync with the file on
4544 disk (also changed in psource). Similar fix to the one for
4568 disk (also changed in psource). Similar fix to the one for
4545 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4569 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4546 <yann.ledu-AT-noos.fr>.
4570 <yann.ledu-AT-noos.fr>.
4547
4571
4548 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4572 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4549 with a single option would not be correctly parsed. Closes
4573 with a single option would not be correctly parsed. Closes
4550 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4574 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4551 introduced in 0.6.0 (on 2004-05-06).
4575 introduced in 0.6.0 (on 2004-05-06).
4552
4576
4553 2004-05-13 *** Released version 0.6.0
4577 2004-05-13 *** Released version 0.6.0
4554
4578
4555 2004-05-13 Fernando Perez <fperez@colorado.edu>
4579 2004-05-13 Fernando Perez <fperez@colorado.edu>
4556
4580
4557 * debian/: Added debian/ directory to CVS, so that debian support
4581 * debian/: Added debian/ directory to CVS, so that debian support
4558 is publicly accessible. The debian package is maintained by Jack
4582 is publicly accessible. The debian package is maintained by Jack
4559 Moffit <jack-AT-xiph.org>.
4583 Moffit <jack-AT-xiph.org>.
4560
4584
4561 * Documentation: included the notes about an ipython-based system
4585 * Documentation: included the notes about an ipython-based system
4562 shell (the hypothetical 'pysh') into the new_design.pdf document,
4586 shell (the hypothetical 'pysh') into the new_design.pdf document,
4563 so that these ideas get distributed to users along with the
4587 so that these ideas get distributed to users along with the
4564 official documentation.
4588 official documentation.
4565
4589
4566 2004-05-10 Fernando Perez <fperez@colorado.edu>
4590 2004-05-10 Fernando Perez <fperez@colorado.edu>
4567
4591
4568 * IPython/Logger.py (Logger.create_log): fix recently introduced
4592 * IPython/Logger.py (Logger.create_log): fix recently introduced
4569 bug (misindented line) where logstart would fail when not given an
4593 bug (misindented line) where logstart would fail when not given an
4570 explicit filename.
4594 explicit filename.
4571
4595
4572 2004-05-09 Fernando Perez <fperez@colorado.edu>
4596 2004-05-09 Fernando Perez <fperez@colorado.edu>
4573
4597
4574 * IPython/Magic.py (Magic.parse_options): skip system call when
4598 * IPython/Magic.py (Magic.parse_options): skip system call when
4575 there are no options to look for. Faster, cleaner for the common
4599 there are no options to look for. Faster, cleaner for the common
4576 case.
4600 case.
4577
4601
4578 * Documentation: many updates to the manual: describing Windows
4602 * Documentation: many updates to the manual: describing Windows
4579 support better, Gnuplot updates, credits, misc small stuff. Also
4603 support better, Gnuplot updates, credits, misc small stuff. Also
4580 updated the new_design doc a bit.
4604 updated the new_design doc a bit.
4581
4605
4582 2004-05-06 *** Released version 0.6.0.rc1
4606 2004-05-06 *** Released version 0.6.0.rc1
4583
4607
4584 2004-05-06 Fernando Perez <fperez@colorado.edu>
4608 2004-05-06 Fernando Perez <fperez@colorado.edu>
4585
4609
4586 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4610 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4587 operations to use the vastly more efficient list/''.join() method.
4611 operations to use the vastly more efficient list/''.join() method.
4588 (FormattedTB.text): Fix
4612 (FormattedTB.text): Fix
4589 http://www.scipy.net/roundup/ipython/issue12 - exception source
4613 http://www.scipy.net/roundup/ipython/issue12 - exception source
4590 extract not updated after reload. Thanks to Mike Salib
4614 extract not updated after reload. Thanks to Mike Salib
4591 <msalib-AT-mit.edu> for pinning the source of the problem.
4615 <msalib-AT-mit.edu> for pinning the source of the problem.
4592 Fortunately, the solution works inside ipython and doesn't require
4616 Fortunately, the solution works inside ipython and doesn't require
4593 any changes to python proper.
4617 any changes to python proper.
4594
4618
4595 * IPython/Magic.py (Magic.parse_options): Improved to process the
4619 * IPython/Magic.py (Magic.parse_options): Improved to process the
4596 argument list as a true shell would (by actually using the
4620 argument list as a true shell would (by actually using the
4597 underlying system shell). This way, all @magics automatically get
4621 underlying system shell). This way, all @magics automatically get
4598 shell expansion for variables. Thanks to a comment by Alex
4622 shell expansion for variables. Thanks to a comment by Alex
4599 Schmolck.
4623 Schmolck.
4600
4624
4601 2004-04-04 Fernando Perez <fperez@colorado.edu>
4625 2004-04-04 Fernando Perez <fperez@colorado.edu>
4602
4626
4603 * IPython/iplib.py (InteractiveShell.interact): Added a special
4627 * IPython/iplib.py (InteractiveShell.interact): Added a special
4604 trap for a debugger quit exception, which is basically impossible
4628 trap for a debugger quit exception, which is basically impossible
4605 to handle by normal mechanisms, given what pdb does to the stack.
4629 to handle by normal mechanisms, given what pdb does to the stack.
4606 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4630 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4607
4631
4608 2004-04-03 Fernando Perez <fperez@colorado.edu>
4632 2004-04-03 Fernando Perez <fperez@colorado.edu>
4609
4633
4610 * IPython/genutils.py (Term): Standardized the names of the Term
4634 * IPython/genutils.py (Term): Standardized the names of the Term
4611 class streams to cin/cout/cerr, following C++ naming conventions
4635 class streams to cin/cout/cerr, following C++ naming conventions
4612 (I can't use in/out/err because 'in' is not a valid attribute
4636 (I can't use in/out/err because 'in' is not a valid attribute
4613 name).
4637 name).
4614
4638
4615 * IPython/iplib.py (InteractiveShell.interact): don't increment
4639 * IPython/iplib.py (InteractiveShell.interact): don't increment
4616 the prompt if there's no user input. By Daniel 'Dang' Griffith
4640 the prompt if there's no user input. By Daniel 'Dang' Griffith
4617 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4641 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4618 Francois Pinard.
4642 Francois Pinard.
4619
4643
4620 2004-04-02 Fernando Perez <fperez@colorado.edu>
4644 2004-04-02 Fernando Perez <fperez@colorado.edu>
4621
4645
4622 * IPython/genutils.py (Stream.__init__): Modified to survive at
4646 * IPython/genutils.py (Stream.__init__): Modified to survive at
4623 least importing in contexts where stdin/out/err aren't true file
4647 least importing in contexts where stdin/out/err aren't true file
4624 objects, such as PyCrust (they lack fileno() and mode). However,
4648 objects, such as PyCrust (they lack fileno() and mode). However,
4625 the recovery facilities which rely on these things existing will
4649 the recovery facilities which rely on these things existing will
4626 not work.
4650 not work.
4627
4651
4628 2004-04-01 Fernando Perez <fperez@colorado.edu>
4652 2004-04-01 Fernando Perez <fperez@colorado.edu>
4629
4653
4630 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4654 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4631 use the new getoutputerror() function, so it properly
4655 use the new getoutputerror() function, so it properly
4632 distinguishes stdout/err.
4656 distinguishes stdout/err.
4633
4657
4634 * IPython/genutils.py (getoutputerror): added a function to
4658 * IPython/genutils.py (getoutputerror): added a function to
4635 capture separately the standard output and error of a command.
4659 capture separately the standard output and error of a command.
4636 After a comment from dang on the mailing lists. This code is
4660 After a comment from dang on the mailing lists. This code is
4637 basically a modified version of commands.getstatusoutput(), from
4661 basically a modified version of commands.getstatusoutput(), from
4638 the standard library.
4662 the standard library.
4639
4663
4640 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4664 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4641 '!!' as a special syntax (shorthand) to access @sx.
4665 '!!' as a special syntax (shorthand) to access @sx.
4642
4666
4643 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4667 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4644 command and return its output as a list split on '\n'.
4668 command and return its output as a list split on '\n'.
4645
4669
4646 2004-03-31 Fernando Perez <fperez@colorado.edu>
4670 2004-03-31 Fernando Perez <fperez@colorado.edu>
4647
4671
4648 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4672 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4649 method to dictionaries used as FakeModule instances if they lack
4673 method to dictionaries used as FakeModule instances if they lack
4650 it. At least pydoc in python2.3 breaks for runtime-defined
4674 it. At least pydoc in python2.3 breaks for runtime-defined
4651 functions without this hack. At some point I need to _really_
4675 functions without this hack. At some point I need to _really_
4652 understand what FakeModule is doing, because it's a gross hack.
4676 understand what FakeModule is doing, because it's a gross hack.
4653 But it solves Arnd's problem for now...
4677 But it solves Arnd's problem for now...
4654
4678
4655 2004-02-27 Fernando Perez <fperez@colorado.edu>
4679 2004-02-27 Fernando Perez <fperez@colorado.edu>
4656
4680
4657 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4681 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4658 mode would behave erratically. Also increased the number of
4682 mode would behave erratically. Also increased the number of
4659 possible logs in rotate mod to 999. Thanks to Rod Holland
4683 possible logs in rotate mod to 999. Thanks to Rod Holland
4660 <rhh@StructureLABS.com> for the report and fixes.
4684 <rhh@StructureLABS.com> for the report and fixes.
4661
4685
4662 2004-02-26 Fernando Perez <fperez@colorado.edu>
4686 2004-02-26 Fernando Perez <fperez@colorado.edu>
4663
4687
4664 * IPython/genutils.py (page): Check that the curses module really
4688 * IPython/genutils.py (page): Check that the curses module really
4665 has the initscr attribute before trying to use it. For some
4689 has the initscr attribute before trying to use it. For some
4666 reason, the Solaris curses module is missing this. I think this
4690 reason, the Solaris curses module is missing this. I think this
4667 should be considered a Solaris python bug, but I'm not sure.
4691 should be considered a Solaris python bug, but I'm not sure.
4668
4692
4669 2004-01-17 Fernando Perez <fperez@colorado.edu>
4693 2004-01-17 Fernando Perez <fperez@colorado.edu>
4670
4694
4671 * IPython/genutils.py (Stream.__init__): Changes to try to make
4695 * IPython/genutils.py (Stream.__init__): Changes to try to make
4672 ipython robust against stdin/out/err being closed by the user.
4696 ipython robust against stdin/out/err being closed by the user.
4673 This is 'user error' (and blocks a normal python session, at least
4697 This is 'user error' (and blocks a normal python session, at least
4674 the stdout case). However, Ipython should be able to survive such
4698 the stdout case). However, Ipython should be able to survive such
4675 instances of abuse as gracefully as possible. To simplify the
4699 instances of abuse as gracefully as possible. To simplify the
4676 coding and maintain compatibility with Gary Bishop's Term
4700 coding and maintain compatibility with Gary Bishop's Term
4677 contributions, I've made use of classmethods for this. I think
4701 contributions, I've made use of classmethods for this. I think
4678 this introduces a dependency on python 2.2.
4702 this introduces a dependency on python 2.2.
4679
4703
4680 2004-01-13 Fernando Perez <fperez@colorado.edu>
4704 2004-01-13 Fernando Perez <fperez@colorado.edu>
4681
4705
4682 * IPython/numutils.py (exp_safe): simplified the code a bit and
4706 * IPython/numutils.py (exp_safe): simplified the code a bit and
4683 removed the need for importing the kinds module altogether.
4707 removed the need for importing the kinds module altogether.
4684
4708
4685 2004-01-06 Fernando Perez <fperez@colorado.edu>
4709 2004-01-06 Fernando Perez <fperez@colorado.edu>
4686
4710
4687 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4711 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4688 a magic function instead, after some community feedback. No
4712 a magic function instead, after some community feedback. No
4689 special syntax will exist for it, but its name is deliberately
4713 special syntax will exist for it, but its name is deliberately
4690 very short.
4714 very short.
4691
4715
4692 2003-12-20 Fernando Perez <fperez@colorado.edu>
4716 2003-12-20 Fernando Perez <fperez@colorado.edu>
4693
4717
4694 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4718 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4695 new functionality, to automagically assign the result of a shell
4719 new functionality, to automagically assign the result of a shell
4696 command to a variable. I'll solicit some community feedback on
4720 command to a variable. I'll solicit some community feedback on
4697 this before making it permanent.
4721 this before making it permanent.
4698
4722
4699 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4723 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4700 requested about callables for which inspect couldn't obtain a
4724 requested about callables for which inspect couldn't obtain a
4701 proper argspec. Thanks to a crash report sent by Etienne
4725 proper argspec. Thanks to a crash report sent by Etienne
4702 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4726 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4703
4727
4704 2003-12-09 Fernando Perez <fperez@colorado.edu>
4728 2003-12-09 Fernando Perez <fperez@colorado.edu>
4705
4729
4706 * IPython/genutils.py (page): patch for the pager to work across
4730 * IPython/genutils.py (page): patch for the pager to work across
4707 various versions of Windows. By Gary Bishop.
4731 various versions of Windows. By Gary Bishop.
4708
4732
4709 2003-12-04 Fernando Perez <fperez@colorado.edu>
4733 2003-12-04 Fernando Perez <fperez@colorado.edu>
4710
4734
4711 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4735 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4712 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4736 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4713 While I tested this and it looks ok, there may still be corner
4737 While I tested this and it looks ok, there may still be corner
4714 cases I've missed.
4738 cases I've missed.
4715
4739
4716 2003-12-01 Fernando Perez <fperez@colorado.edu>
4740 2003-12-01 Fernando Perez <fperez@colorado.edu>
4717
4741
4718 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4742 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4719 where a line like 'p,q=1,2' would fail because the automagic
4743 where a line like 'p,q=1,2' would fail because the automagic
4720 system would be triggered for @p.
4744 system would be triggered for @p.
4721
4745
4722 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4746 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4723 cleanups, code unmodified.
4747 cleanups, code unmodified.
4724
4748
4725 * IPython/genutils.py (Term): added a class for IPython to handle
4749 * IPython/genutils.py (Term): added a class for IPython to handle
4726 output. In most cases it will just be a proxy for stdout/err, but
4750 output. In most cases it will just be a proxy for stdout/err, but
4727 having this allows modifications to be made for some platforms,
4751 having this allows modifications to be made for some platforms,
4728 such as handling color escapes under Windows. All of this code
4752 such as handling color escapes under Windows. All of this code
4729 was contributed by Gary Bishop, with minor modifications by me.
4753 was contributed by Gary Bishop, with minor modifications by me.
4730 The actual changes affect many files.
4754 The actual changes affect many files.
4731
4755
4732 2003-11-30 Fernando Perez <fperez@colorado.edu>
4756 2003-11-30 Fernando Perez <fperez@colorado.edu>
4733
4757
4734 * IPython/iplib.py (file_matches): new completion code, courtesy
4758 * IPython/iplib.py (file_matches): new completion code, courtesy
4735 of Jeff Collins. This enables filename completion again under
4759 of Jeff Collins. This enables filename completion again under
4736 python 2.3, which disabled it at the C level.
4760 python 2.3, which disabled it at the C level.
4737
4761
4738 2003-11-11 Fernando Perez <fperez@colorado.edu>
4762 2003-11-11 Fernando Perez <fperez@colorado.edu>
4739
4763
4740 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4764 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4741 for Numeric.array(map(...)), but often convenient.
4765 for Numeric.array(map(...)), but often convenient.
4742
4766
4743 2003-11-05 Fernando Perez <fperez@colorado.edu>
4767 2003-11-05 Fernando Perez <fperez@colorado.edu>
4744
4768
4745 * IPython/numutils.py (frange): Changed a call from int() to
4769 * IPython/numutils.py (frange): Changed a call from int() to
4746 int(round()) to prevent a problem reported with arange() in the
4770 int(round()) to prevent a problem reported with arange() in the
4747 numpy list.
4771 numpy list.
4748
4772
4749 2003-10-06 Fernando Perez <fperez@colorado.edu>
4773 2003-10-06 Fernando Perez <fperez@colorado.edu>
4750
4774
4751 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4775 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4752 prevent crashes if sys lacks an argv attribute (it happens with
4776 prevent crashes if sys lacks an argv attribute (it happens with
4753 embedded interpreters which build a bare-bones sys module).
4777 embedded interpreters which build a bare-bones sys module).
4754 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4778 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4755
4779
4756 2003-09-24 Fernando Perez <fperez@colorado.edu>
4780 2003-09-24 Fernando Perez <fperez@colorado.edu>
4757
4781
4758 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4782 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4759 to protect against poorly written user objects where __getattr__
4783 to protect against poorly written user objects where __getattr__
4760 raises exceptions other than AttributeError. Thanks to a bug
4784 raises exceptions other than AttributeError. Thanks to a bug
4761 report by Oliver Sander <osander-AT-gmx.de>.
4785 report by Oliver Sander <osander-AT-gmx.de>.
4762
4786
4763 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4787 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4764 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4788 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4765
4789
4766 2003-09-09 Fernando Perez <fperez@colorado.edu>
4790 2003-09-09 Fernando Perez <fperez@colorado.edu>
4767
4791
4768 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4792 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4769 unpacking a list whith a callable as first element would
4793 unpacking a list whith a callable as first element would
4770 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4794 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4771 Collins.
4795 Collins.
4772
4796
4773 2003-08-25 *** Released version 0.5.0
4797 2003-08-25 *** Released version 0.5.0
4774
4798
4775 2003-08-22 Fernando Perez <fperez@colorado.edu>
4799 2003-08-22 Fernando Perez <fperez@colorado.edu>
4776
4800
4777 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4801 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4778 improperly defined user exceptions. Thanks to feedback from Mark
4802 improperly defined user exceptions. Thanks to feedback from Mark
4779 Russell <mrussell-AT-verio.net>.
4803 Russell <mrussell-AT-verio.net>.
4780
4804
4781 2003-08-20 Fernando Perez <fperez@colorado.edu>
4805 2003-08-20 Fernando Perez <fperez@colorado.edu>
4782
4806
4783 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4807 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4784 printing so that it would print multi-line string forms starting
4808 printing so that it would print multi-line string forms starting
4785 with a new line. This way the formatting is better respected for
4809 with a new line. This way the formatting is better respected for
4786 objects which work hard to make nice string forms.
4810 objects which work hard to make nice string forms.
4787
4811
4788 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4812 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4789 autocall would overtake data access for objects with both
4813 autocall would overtake data access for objects with both
4790 __getitem__ and __call__.
4814 __getitem__ and __call__.
4791
4815
4792 2003-08-19 *** Released version 0.5.0-rc1
4816 2003-08-19 *** Released version 0.5.0-rc1
4793
4817
4794 2003-08-19 Fernando Perez <fperez@colorado.edu>
4818 2003-08-19 Fernando Perez <fperez@colorado.edu>
4795
4819
4796 * IPython/deep_reload.py (load_tail): single tiny change here
4820 * IPython/deep_reload.py (load_tail): single tiny change here
4797 seems to fix the long-standing bug of dreload() failing to work
4821 seems to fix the long-standing bug of dreload() failing to work
4798 for dotted names. But this module is pretty tricky, so I may have
4822 for dotted names. But this module is pretty tricky, so I may have
4799 missed some subtlety. Needs more testing!.
4823 missed some subtlety. Needs more testing!.
4800
4824
4801 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4825 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4802 exceptions which have badly implemented __str__ methods.
4826 exceptions which have badly implemented __str__ methods.
4803 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4827 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4804 which I've been getting reports about from Python 2.3 users. I
4828 which I've been getting reports about from Python 2.3 users. I
4805 wish I had a simple test case to reproduce the problem, so I could
4829 wish I had a simple test case to reproduce the problem, so I could
4806 either write a cleaner workaround or file a bug report if
4830 either write a cleaner workaround or file a bug report if
4807 necessary.
4831 necessary.
4808
4832
4809 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4833 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4810 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4834 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4811 a bug report by Tjabo Kloppenburg.
4835 a bug report by Tjabo Kloppenburg.
4812
4836
4813 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4837 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4814 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4838 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4815 seems rather unstable. Thanks to a bug report by Tjabo
4839 seems rather unstable. Thanks to a bug report by Tjabo
4816 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4840 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4817
4841
4818 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4842 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4819 this out soon because of the critical fixes in the inner loop for
4843 this out soon because of the critical fixes in the inner loop for
4820 generators.
4844 generators.
4821
4845
4822 * IPython/Magic.py (Magic.getargspec): removed. This (and
4846 * IPython/Magic.py (Magic.getargspec): removed. This (and
4823 _get_def) have been obsoleted by OInspect for a long time, I
4847 _get_def) have been obsoleted by OInspect for a long time, I
4824 hadn't noticed that they were dead code.
4848 hadn't noticed that they were dead code.
4825 (Magic._ofind): restored _ofind functionality for a few literals
4849 (Magic._ofind): restored _ofind functionality for a few literals
4826 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4850 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4827 for things like "hello".capitalize?, since that would require a
4851 for things like "hello".capitalize?, since that would require a
4828 potentially dangerous eval() again.
4852 potentially dangerous eval() again.
4829
4853
4830 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4854 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4831 logic a bit more to clean up the escapes handling and minimize the
4855 logic a bit more to clean up the escapes handling and minimize the
4832 use of _ofind to only necessary cases. The interactive 'feel' of
4856 use of _ofind to only necessary cases. The interactive 'feel' of
4833 IPython should have improved quite a bit with the changes in
4857 IPython should have improved quite a bit with the changes in
4834 _prefilter and _ofind (besides being far safer than before).
4858 _prefilter and _ofind (besides being far safer than before).
4835
4859
4836 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4860 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4837 obscure, never reported). Edit would fail to find the object to
4861 obscure, never reported). Edit would fail to find the object to
4838 edit under some circumstances.
4862 edit under some circumstances.
4839 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4863 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4840 which were causing double-calling of generators. Those eval calls
4864 which were causing double-calling of generators. Those eval calls
4841 were _very_ dangerous, since code with side effects could be
4865 were _very_ dangerous, since code with side effects could be
4842 triggered. As they say, 'eval is evil'... These were the
4866 triggered. As they say, 'eval is evil'... These were the
4843 nastiest evals in IPython. Besides, _ofind is now far simpler,
4867 nastiest evals in IPython. Besides, _ofind is now far simpler,
4844 and it should also be quite a bit faster. Its use of inspect is
4868 and it should also be quite a bit faster. Its use of inspect is
4845 also safer, so perhaps some of the inspect-related crashes I've
4869 also safer, so perhaps some of the inspect-related crashes I've
4846 seen lately with Python 2.3 might be taken care of. That will
4870 seen lately with Python 2.3 might be taken care of. That will
4847 need more testing.
4871 need more testing.
4848
4872
4849 2003-08-17 Fernando Perez <fperez@colorado.edu>
4873 2003-08-17 Fernando Perez <fperez@colorado.edu>
4850
4874
4851 * IPython/iplib.py (InteractiveShell._prefilter): significant
4875 * IPython/iplib.py (InteractiveShell._prefilter): significant
4852 simplifications to the logic for handling user escapes. Faster
4876 simplifications to the logic for handling user escapes. Faster
4853 and simpler code.
4877 and simpler code.
4854
4878
4855 2003-08-14 Fernando Perez <fperez@colorado.edu>
4879 2003-08-14 Fernando Perez <fperez@colorado.edu>
4856
4880
4857 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4881 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4858 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4882 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4859 but it should be quite a bit faster. And the recursive version
4883 but it should be quite a bit faster. And the recursive version
4860 generated O(log N) intermediate storage for all rank>1 arrays,
4884 generated O(log N) intermediate storage for all rank>1 arrays,
4861 even if they were contiguous.
4885 even if they were contiguous.
4862 (l1norm): Added this function.
4886 (l1norm): Added this function.
4863 (norm): Added this function for arbitrary norms (including
4887 (norm): Added this function for arbitrary norms (including
4864 l-infinity). l1 and l2 are still special cases for convenience
4888 l-infinity). l1 and l2 are still special cases for convenience
4865 and speed.
4889 and speed.
4866
4890
4867 2003-08-03 Fernando Perez <fperez@colorado.edu>
4891 2003-08-03 Fernando Perez <fperez@colorado.edu>
4868
4892
4869 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4893 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4870 exceptions, which now raise PendingDeprecationWarnings in Python
4894 exceptions, which now raise PendingDeprecationWarnings in Python
4871 2.3. There were some in Magic and some in Gnuplot2.
4895 2.3. There were some in Magic and some in Gnuplot2.
4872
4896
4873 2003-06-30 Fernando Perez <fperez@colorado.edu>
4897 2003-06-30 Fernando Perez <fperez@colorado.edu>
4874
4898
4875 * IPython/genutils.py (page): modified to call curses only for
4899 * IPython/genutils.py (page): modified to call curses only for
4876 terminals where TERM=='xterm'. After problems under many other
4900 terminals where TERM=='xterm'. After problems under many other
4877 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4901 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4878
4902
4879 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4903 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4880 would be triggered when readline was absent. This was just an old
4904 would be triggered when readline was absent. This was just an old
4881 debugging statement I'd forgotten to take out.
4905 debugging statement I'd forgotten to take out.
4882
4906
4883 2003-06-20 Fernando Perez <fperez@colorado.edu>
4907 2003-06-20 Fernando Perez <fperez@colorado.edu>
4884
4908
4885 * IPython/genutils.py (clock): modified to return only user time
4909 * IPython/genutils.py (clock): modified to return only user time
4886 (not counting system time), after a discussion on scipy. While
4910 (not counting system time), after a discussion on scipy. While
4887 system time may be a useful quantity occasionally, it may much
4911 system time may be a useful quantity occasionally, it may much
4888 more easily be skewed by occasional swapping or other similar
4912 more easily be skewed by occasional swapping or other similar
4889 activity.
4913 activity.
4890
4914
4891 2003-06-05 Fernando Perez <fperez@colorado.edu>
4915 2003-06-05 Fernando Perez <fperez@colorado.edu>
4892
4916
4893 * IPython/numutils.py (identity): new function, for building
4917 * IPython/numutils.py (identity): new function, for building
4894 arbitrary rank Kronecker deltas (mostly backwards compatible with
4918 arbitrary rank Kronecker deltas (mostly backwards compatible with
4895 Numeric.identity)
4919 Numeric.identity)
4896
4920
4897 2003-06-03 Fernando Perez <fperez@colorado.edu>
4921 2003-06-03 Fernando Perez <fperez@colorado.edu>
4898
4922
4899 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4923 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4900 arguments passed to magics with spaces, to allow trailing '\' to
4924 arguments passed to magics with spaces, to allow trailing '\' to
4901 work normally (mainly for Windows users).
4925 work normally (mainly for Windows users).
4902
4926
4903 2003-05-29 Fernando Perez <fperez@colorado.edu>
4927 2003-05-29 Fernando Perez <fperez@colorado.edu>
4904
4928
4905 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4929 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4906 instead of pydoc.help. This fixes a bizarre behavior where
4930 instead of pydoc.help. This fixes a bizarre behavior where
4907 printing '%s' % locals() would trigger the help system. Now
4931 printing '%s' % locals() would trigger the help system. Now
4908 ipython behaves like normal python does.
4932 ipython behaves like normal python does.
4909
4933
4910 Note that if one does 'from pydoc import help', the bizarre
4934 Note that if one does 'from pydoc import help', the bizarre
4911 behavior returns, but this will also happen in normal python, so
4935 behavior returns, but this will also happen in normal python, so
4912 it's not an ipython bug anymore (it has to do with how pydoc.help
4936 it's not an ipython bug anymore (it has to do with how pydoc.help
4913 is implemented).
4937 is implemented).
4914
4938
4915 2003-05-22 Fernando Perez <fperez@colorado.edu>
4939 2003-05-22 Fernando Perez <fperez@colorado.edu>
4916
4940
4917 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4941 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4918 return [] instead of None when nothing matches, also match to end
4942 return [] instead of None when nothing matches, also match to end
4919 of line. Patch by Gary Bishop.
4943 of line. Patch by Gary Bishop.
4920
4944
4921 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4945 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4922 protection as before, for files passed on the command line. This
4946 protection as before, for files passed on the command line. This
4923 prevents the CrashHandler from kicking in if user files call into
4947 prevents the CrashHandler from kicking in if user files call into
4924 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4948 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4925 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4949 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4926
4950
4927 2003-05-20 *** Released version 0.4.0
4951 2003-05-20 *** Released version 0.4.0
4928
4952
4929 2003-05-20 Fernando Perez <fperez@colorado.edu>
4953 2003-05-20 Fernando Perez <fperez@colorado.edu>
4930
4954
4931 * setup.py: added support for manpages. It's a bit hackish b/c of
4955 * setup.py: added support for manpages. It's a bit hackish b/c of
4932 a bug in the way the bdist_rpm distutils target handles gzipped
4956 a bug in the way the bdist_rpm distutils target handles gzipped
4933 manpages, but it works. After a patch by Jack.
4957 manpages, but it works. After a patch by Jack.
4934
4958
4935 2003-05-19 Fernando Perez <fperez@colorado.edu>
4959 2003-05-19 Fernando Perez <fperez@colorado.edu>
4936
4960
4937 * IPython/numutils.py: added a mockup of the kinds module, since
4961 * IPython/numutils.py: added a mockup of the kinds module, since
4938 it was recently removed from Numeric. This way, numutils will
4962 it was recently removed from Numeric. This way, numutils will
4939 work for all users even if they are missing kinds.
4963 work for all users even if they are missing kinds.
4940
4964
4941 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4965 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4942 failure, which can occur with SWIG-wrapped extensions. After a
4966 failure, which can occur with SWIG-wrapped extensions. After a
4943 crash report from Prabhu.
4967 crash report from Prabhu.
4944
4968
4945 2003-05-16 Fernando Perez <fperez@colorado.edu>
4969 2003-05-16 Fernando Perez <fperez@colorado.edu>
4946
4970
4947 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4971 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4948 protect ipython from user code which may call directly
4972 protect ipython from user code which may call directly
4949 sys.excepthook (this looks like an ipython crash to the user, even
4973 sys.excepthook (this looks like an ipython crash to the user, even
4950 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4974 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4951 This is especially important to help users of WxWindows, but may
4975 This is especially important to help users of WxWindows, but may
4952 also be useful in other cases.
4976 also be useful in other cases.
4953
4977
4954 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4978 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4955 an optional tb_offset to be specified, and to preserve exception
4979 an optional tb_offset to be specified, and to preserve exception
4956 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4980 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4957
4981
4958 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4982 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4959
4983
4960 2003-05-15 Fernando Perez <fperez@colorado.edu>
4984 2003-05-15 Fernando Perez <fperez@colorado.edu>
4961
4985
4962 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4986 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4963 installing for a new user under Windows.
4987 installing for a new user under Windows.
4964
4988
4965 2003-05-12 Fernando Perez <fperez@colorado.edu>
4989 2003-05-12 Fernando Perez <fperez@colorado.edu>
4966
4990
4967 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4991 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4968 handler for Emacs comint-based lines. Currently it doesn't do
4992 handler for Emacs comint-based lines. Currently it doesn't do
4969 much (but importantly, it doesn't update the history cache). In
4993 much (but importantly, it doesn't update the history cache). In
4970 the future it may be expanded if Alex needs more functionality
4994 the future it may be expanded if Alex needs more functionality
4971 there.
4995 there.
4972
4996
4973 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4997 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4974 info to crash reports.
4998 info to crash reports.
4975
4999
4976 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5000 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4977 just like Python's -c. Also fixed crash with invalid -color
5001 just like Python's -c. Also fixed crash with invalid -color
4978 option value at startup. Thanks to Will French
5002 option value at startup. Thanks to Will French
4979 <wfrench-AT-bestweb.net> for the bug report.
5003 <wfrench-AT-bestweb.net> for the bug report.
4980
5004
4981 2003-05-09 Fernando Perez <fperez@colorado.edu>
5005 2003-05-09 Fernando Perez <fperez@colorado.edu>
4982
5006
4983 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5007 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4984 to EvalDict (it's a mapping, after all) and simplified its code
5008 to EvalDict (it's a mapping, after all) and simplified its code
4985 quite a bit, after a nice discussion on c.l.py where Gustavo
5009 quite a bit, after a nice discussion on c.l.py where Gustavo
4986 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
5010 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4987
5011
4988 2003-04-30 Fernando Perez <fperez@colorado.edu>
5012 2003-04-30 Fernando Perez <fperez@colorado.edu>
4989
5013
4990 * IPython/genutils.py (timings_out): modified it to reduce its
5014 * IPython/genutils.py (timings_out): modified it to reduce its
4991 overhead in the common reps==1 case.
5015 overhead in the common reps==1 case.
4992
5016
4993 2003-04-29 Fernando Perez <fperez@colorado.edu>
5017 2003-04-29 Fernando Perez <fperez@colorado.edu>
4994
5018
4995 * IPython/genutils.py (timings_out): Modified to use the resource
5019 * IPython/genutils.py (timings_out): Modified to use the resource
4996 module, which avoids the wraparound problems of time.clock().
5020 module, which avoids the wraparound problems of time.clock().
4997
5021
4998 2003-04-17 *** Released version 0.2.15pre4
5022 2003-04-17 *** Released version 0.2.15pre4
4999
5023
5000 2003-04-17 Fernando Perez <fperez@colorado.edu>
5024 2003-04-17 Fernando Perez <fperez@colorado.edu>
5001
5025
5002 * setup.py (scriptfiles): Split windows-specific stuff over to a
5026 * setup.py (scriptfiles): Split windows-specific stuff over to a
5003 separate file, in an attempt to have a Windows GUI installer.
5027 separate file, in an attempt to have a Windows GUI installer.
5004 That didn't work, but part of the groundwork is done.
5028 That didn't work, but part of the groundwork is done.
5005
5029
5006 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5030 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5007 indent/unindent with 4 spaces. Particularly useful in combination
5031 indent/unindent with 4 spaces. Particularly useful in combination
5008 with the new auto-indent option.
5032 with the new auto-indent option.
5009
5033
5010 2003-04-16 Fernando Perez <fperez@colorado.edu>
5034 2003-04-16 Fernando Perez <fperez@colorado.edu>
5011
5035
5012 * IPython/Magic.py: various replacements of self.rc for
5036 * IPython/Magic.py: various replacements of self.rc for
5013 self.shell.rc. A lot more remains to be done to fully disentangle
5037 self.shell.rc. A lot more remains to be done to fully disentangle
5014 this class from the main Shell class.
5038 this class from the main Shell class.
5015
5039
5016 * IPython/GnuplotRuntime.py: added checks for mouse support so
5040 * IPython/GnuplotRuntime.py: added checks for mouse support so
5017 that we don't try to enable it if the current gnuplot doesn't
5041 that we don't try to enable it if the current gnuplot doesn't
5018 really support it. Also added checks so that we don't try to
5042 really support it. Also added checks so that we don't try to
5019 enable persist under Windows (where Gnuplot doesn't recognize the
5043 enable persist under Windows (where Gnuplot doesn't recognize the
5020 option).
5044 option).
5021
5045
5022 * IPython/iplib.py (InteractiveShell.interact): Added optional
5046 * IPython/iplib.py (InteractiveShell.interact): Added optional
5023 auto-indenting code, after a patch by King C. Shu
5047 auto-indenting code, after a patch by King C. Shu
5024 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5048 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5025 get along well with pasting indented code. If I ever figure out
5049 get along well with pasting indented code. If I ever figure out
5026 how to make that part go well, it will become on by default.
5050 how to make that part go well, it will become on by default.
5027
5051
5028 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5052 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5029 crash ipython if there was an unmatched '%' in the user's prompt
5053 crash ipython if there was an unmatched '%' in the user's prompt
5030 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5054 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5031
5055
5032 * IPython/iplib.py (InteractiveShell.interact): removed the
5056 * IPython/iplib.py (InteractiveShell.interact): removed the
5033 ability to ask the user whether he wants to crash or not at the
5057 ability to ask the user whether he wants to crash or not at the
5034 'last line' exception handler. Calling functions at that point
5058 'last line' exception handler. Calling functions at that point
5035 changes the stack, and the error reports would have incorrect
5059 changes the stack, and the error reports would have incorrect
5036 tracebacks.
5060 tracebacks.
5037
5061
5038 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5062 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5039 pass through a peger a pretty-printed form of any object. After a
5063 pass through a peger a pretty-printed form of any object. After a
5040 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5064 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5041
5065
5042 2003-04-14 Fernando Perez <fperez@colorado.edu>
5066 2003-04-14 Fernando Perez <fperez@colorado.edu>
5043
5067
5044 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5068 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5045 all files in ~ would be modified at first install (instead of
5069 all files in ~ would be modified at first install (instead of
5046 ~/.ipython). This could be potentially disastrous, as the
5070 ~/.ipython). This could be potentially disastrous, as the
5047 modification (make line-endings native) could damage binary files.
5071 modification (make line-endings native) could damage binary files.
5048
5072
5049 2003-04-10 Fernando Perez <fperez@colorado.edu>
5073 2003-04-10 Fernando Perez <fperez@colorado.edu>
5050
5074
5051 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5075 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5052 handle only lines which are invalid python. This now means that
5076 handle only lines which are invalid python. This now means that
5053 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5077 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5054 for the bug report.
5078 for the bug report.
5055
5079
5056 2003-04-01 Fernando Perez <fperez@colorado.edu>
5080 2003-04-01 Fernando Perez <fperez@colorado.edu>
5057
5081
5058 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5082 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5059 where failing to set sys.last_traceback would crash pdb.pm().
5083 where failing to set sys.last_traceback would crash pdb.pm().
5060 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5084 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5061 report.
5085 report.
5062
5086
5063 2003-03-25 Fernando Perez <fperez@colorado.edu>
5087 2003-03-25 Fernando Perez <fperez@colorado.edu>
5064
5088
5065 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5089 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5066 before printing it (it had a lot of spurious blank lines at the
5090 before printing it (it had a lot of spurious blank lines at the
5067 end).
5091 end).
5068
5092
5069 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5093 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5070 output would be sent 21 times! Obviously people don't use this
5094 output would be sent 21 times! Obviously people don't use this
5071 too often, or I would have heard about it.
5095 too often, or I would have heard about it.
5072
5096
5073 2003-03-24 Fernando Perez <fperez@colorado.edu>
5097 2003-03-24 Fernando Perez <fperez@colorado.edu>
5074
5098
5075 * setup.py (scriptfiles): renamed the data_files parameter from
5099 * setup.py (scriptfiles): renamed the data_files parameter from
5076 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5100 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5077 for the patch.
5101 for the patch.
5078
5102
5079 2003-03-20 Fernando Perez <fperez@colorado.edu>
5103 2003-03-20 Fernando Perez <fperez@colorado.edu>
5080
5104
5081 * IPython/genutils.py (error): added error() and fatal()
5105 * IPython/genutils.py (error): added error() and fatal()
5082 functions.
5106 functions.
5083
5107
5084 2003-03-18 *** Released version 0.2.15pre3
5108 2003-03-18 *** Released version 0.2.15pre3
5085
5109
5086 2003-03-18 Fernando Perez <fperez@colorado.edu>
5110 2003-03-18 Fernando Perez <fperez@colorado.edu>
5087
5111
5088 * setupext/install_data_ext.py
5112 * setupext/install_data_ext.py
5089 (install_data_ext.initialize_options): Class contributed by Jack
5113 (install_data_ext.initialize_options): Class contributed by Jack
5090 Moffit for fixing the old distutils hack. He is sending this to
5114 Moffit for fixing the old distutils hack. He is sending this to
5091 the distutils folks so in the future we may not need it as a
5115 the distutils folks so in the future we may not need it as a
5092 private fix.
5116 private fix.
5093
5117
5094 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5118 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5095 changes for Debian packaging. See his patch for full details.
5119 changes for Debian packaging. See his patch for full details.
5096 The old distutils hack of making the ipythonrc* files carry a
5120 The old distutils hack of making the ipythonrc* files carry a
5097 bogus .py extension is gone, at last. Examples were moved to a
5121 bogus .py extension is gone, at last. Examples were moved to a
5098 separate subdir under doc/, and the separate executable scripts
5122 separate subdir under doc/, and the separate executable scripts
5099 now live in their own directory. Overall a great cleanup. The
5123 now live in their own directory. Overall a great cleanup. The
5100 manual was updated to use the new files, and setup.py has been
5124 manual was updated to use the new files, and setup.py has been
5101 fixed for this setup.
5125 fixed for this setup.
5102
5126
5103 * IPython/PyColorize.py (Parser.usage): made non-executable and
5127 * IPython/PyColorize.py (Parser.usage): made non-executable and
5104 created a pycolor wrapper around it to be included as a script.
5128 created a pycolor wrapper around it to be included as a script.
5105
5129
5106 2003-03-12 *** Released version 0.2.15pre2
5130 2003-03-12 *** Released version 0.2.15pre2
5107
5131
5108 2003-03-12 Fernando Perez <fperez@colorado.edu>
5132 2003-03-12 Fernando Perez <fperez@colorado.edu>
5109
5133
5110 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5134 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5111 long-standing problem with garbage characters in some terminals.
5135 long-standing problem with garbage characters in some terminals.
5112 The issue was really that the \001 and \002 escapes must _only_ be
5136 The issue was really that the \001 and \002 escapes must _only_ be
5113 passed to input prompts (which call readline), but _never_ to
5137 passed to input prompts (which call readline), but _never_ to
5114 normal text to be printed on screen. I changed ColorANSI to have
5138 normal text to be printed on screen. I changed ColorANSI to have
5115 two classes: TermColors and InputTermColors, each with the
5139 two classes: TermColors and InputTermColors, each with the
5116 appropriate escapes for input prompts or normal text. The code in
5140 appropriate escapes for input prompts or normal text. The code in
5117 Prompts.py got slightly more complicated, but this very old and
5141 Prompts.py got slightly more complicated, but this very old and
5118 annoying bug is finally fixed.
5142 annoying bug is finally fixed.
5119
5143
5120 All the credit for nailing down the real origin of this problem
5144 All the credit for nailing down the real origin of this problem
5121 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5145 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5122 *Many* thanks to him for spending quite a bit of effort on this.
5146 *Many* thanks to him for spending quite a bit of effort on this.
5123
5147
5124 2003-03-05 *** Released version 0.2.15pre1
5148 2003-03-05 *** Released version 0.2.15pre1
5125
5149
5126 2003-03-03 Fernando Perez <fperez@colorado.edu>
5150 2003-03-03 Fernando Perez <fperez@colorado.edu>
5127
5151
5128 * IPython/FakeModule.py: Moved the former _FakeModule to a
5152 * IPython/FakeModule.py: Moved the former _FakeModule to a
5129 separate file, because it's also needed by Magic (to fix a similar
5153 separate file, because it's also needed by Magic (to fix a similar
5130 pickle-related issue in @run).
5154 pickle-related issue in @run).
5131
5155
5132 2003-03-02 Fernando Perez <fperez@colorado.edu>
5156 2003-03-02 Fernando Perez <fperez@colorado.edu>
5133
5157
5134 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5158 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5135 the autocall option at runtime.
5159 the autocall option at runtime.
5136 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5160 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5137 across Magic.py to start separating Magic from InteractiveShell.
5161 across Magic.py to start separating Magic from InteractiveShell.
5138 (Magic._ofind): Fixed to return proper namespace for dotted
5162 (Magic._ofind): Fixed to return proper namespace for dotted
5139 names. Before, a dotted name would always return 'not currently
5163 names. Before, a dotted name would always return 'not currently
5140 defined', because it would find the 'parent'. s.x would be found,
5164 defined', because it would find the 'parent'. s.x would be found,
5141 but since 'x' isn't defined by itself, it would get confused.
5165 but since 'x' isn't defined by itself, it would get confused.
5142 (Magic.magic_run): Fixed pickling problems reported by Ralf
5166 (Magic.magic_run): Fixed pickling problems reported by Ralf
5143 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5167 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5144 that I'd used when Mike Heeter reported similar issues at the
5168 that I'd used when Mike Heeter reported similar issues at the
5145 top-level, but now for @run. It boils down to injecting the
5169 top-level, but now for @run. It boils down to injecting the
5146 namespace where code is being executed with something that looks
5170 namespace where code is being executed with something that looks
5147 enough like a module to fool pickle.dump(). Since a pickle stores
5171 enough like a module to fool pickle.dump(). Since a pickle stores
5148 a named reference to the importing module, we need this for
5172 a named reference to the importing module, we need this for
5149 pickles to save something sensible.
5173 pickles to save something sensible.
5150
5174
5151 * IPython/ipmaker.py (make_IPython): added an autocall option.
5175 * IPython/ipmaker.py (make_IPython): added an autocall option.
5152
5176
5153 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5177 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5154 the auto-eval code. Now autocalling is an option, and the code is
5178 the auto-eval code. Now autocalling is an option, and the code is
5155 also vastly safer. There is no more eval() involved at all.
5179 also vastly safer. There is no more eval() involved at all.
5156
5180
5157 2003-03-01 Fernando Perez <fperez@colorado.edu>
5181 2003-03-01 Fernando Perez <fperez@colorado.edu>
5158
5182
5159 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5183 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5160 dict with named keys instead of a tuple.
5184 dict with named keys instead of a tuple.
5161
5185
5162 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5186 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5163
5187
5164 * setup.py (make_shortcut): Fixed message about directories
5188 * setup.py (make_shortcut): Fixed message about directories
5165 created during Windows installation (the directories were ok, just
5189 created during Windows installation (the directories were ok, just
5166 the printed message was misleading). Thanks to Chris Liechti
5190 the printed message was misleading). Thanks to Chris Liechti
5167 <cliechti-AT-gmx.net> for the heads up.
5191 <cliechti-AT-gmx.net> for the heads up.
5168
5192
5169 2003-02-21 Fernando Perez <fperez@colorado.edu>
5193 2003-02-21 Fernando Perez <fperez@colorado.edu>
5170
5194
5171 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5195 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5172 of ValueError exception when checking for auto-execution. This
5196 of ValueError exception when checking for auto-execution. This
5173 one is raised by things like Numeric arrays arr.flat when the
5197 one is raised by things like Numeric arrays arr.flat when the
5174 array is non-contiguous.
5198 array is non-contiguous.
5175
5199
5176 2003-01-31 Fernando Perez <fperez@colorado.edu>
5200 2003-01-31 Fernando Perez <fperez@colorado.edu>
5177
5201
5178 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5202 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5179 not return any value at all (even though the command would get
5203 not return any value at all (even though the command would get
5180 executed).
5204 executed).
5181 (xsys): Flush stdout right after printing the command to ensure
5205 (xsys): Flush stdout right after printing the command to ensure
5182 proper ordering of commands and command output in the total
5206 proper ordering of commands and command output in the total
5183 output.
5207 output.
5184 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5208 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5185 system/getoutput as defaults. The old ones are kept for
5209 system/getoutput as defaults. The old ones are kept for
5186 compatibility reasons, so no code which uses this library needs
5210 compatibility reasons, so no code which uses this library needs
5187 changing.
5211 changing.
5188
5212
5189 2003-01-27 *** Released version 0.2.14
5213 2003-01-27 *** Released version 0.2.14
5190
5214
5191 2003-01-25 Fernando Perez <fperez@colorado.edu>
5215 2003-01-25 Fernando Perez <fperez@colorado.edu>
5192
5216
5193 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5217 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5194 functions defined in previous edit sessions could not be re-edited
5218 functions defined in previous edit sessions could not be re-edited
5195 (because the temp files were immediately removed). Now temp files
5219 (because the temp files were immediately removed). Now temp files
5196 are removed only at IPython's exit.
5220 are removed only at IPython's exit.
5197 (Magic.magic_run): Improved @run to perform shell-like expansions
5221 (Magic.magic_run): Improved @run to perform shell-like expansions
5198 on its arguments (~users and $VARS). With this, @run becomes more
5222 on its arguments (~users and $VARS). With this, @run becomes more
5199 like a normal command-line.
5223 like a normal command-line.
5200
5224
5201 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5225 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5202 bugs related to embedding and cleaned up that code. A fairly
5226 bugs related to embedding and cleaned up that code. A fairly
5203 important one was the impossibility to access the global namespace
5227 important one was the impossibility to access the global namespace
5204 through the embedded IPython (only local variables were visible).
5228 through the embedded IPython (only local variables were visible).
5205
5229
5206 2003-01-14 Fernando Perez <fperez@colorado.edu>
5230 2003-01-14 Fernando Perez <fperez@colorado.edu>
5207
5231
5208 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5232 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5209 auto-calling to be a bit more conservative. Now it doesn't get
5233 auto-calling to be a bit more conservative. Now it doesn't get
5210 triggered if any of '!=()<>' are in the rest of the input line, to
5234 triggered if any of '!=()<>' are in the rest of the input line, to
5211 allow comparing callables. Thanks to Alex for the heads up.
5235 allow comparing callables. Thanks to Alex for the heads up.
5212
5236
5213 2003-01-07 Fernando Perez <fperez@colorado.edu>
5237 2003-01-07 Fernando Perez <fperez@colorado.edu>
5214
5238
5215 * IPython/genutils.py (page): fixed estimation of the number of
5239 * IPython/genutils.py (page): fixed estimation of the number of
5216 lines in a string to be paged to simply count newlines. This
5240 lines in a string to be paged to simply count newlines. This
5217 prevents over-guessing due to embedded escape sequences. A better
5241 prevents over-guessing due to embedded escape sequences. A better
5218 long-term solution would involve stripping out the control chars
5242 long-term solution would involve stripping out the control chars
5219 for the count, but it's potentially so expensive I just don't
5243 for the count, but it's potentially so expensive I just don't
5220 think it's worth doing.
5244 think it's worth doing.
5221
5245
5222 2002-12-19 *** Released version 0.2.14pre50
5246 2002-12-19 *** Released version 0.2.14pre50
5223
5247
5224 2002-12-19 Fernando Perez <fperez@colorado.edu>
5248 2002-12-19 Fernando Perez <fperez@colorado.edu>
5225
5249
5226 * tools/release (version): Changed release scripts to inform
5250 * tools/release (version): Changed release scripts to inform
5227 Andrea and build a NEWS file with a list of recent changes.
5251 Andrea and build a NEWS file with a list of recent changes.
5228
5252
5229 * IPython/ColorANSI.py (__all__): changed terminal detection
5253 * IPython/ColorANSI.py (__all__): changed terminal detection
5230 code. Seems to work better for xterms without breaking
5254 code. Seems to work better for xterms without breaking
5231 konsole. Will need more testing to determine if WinXP and Mac OSX
5255 konsole. Will need more testing to determine if WinXP and Mac OSX
5232 also work ok.
5256 also work ok.
5233
5257
5234 2002-12-18 *** Released version 0.2.14pre49
5258 2002-12-18 *** Released version 0.2.14pre49
5235
5259
5236 2002-12-18 Fernando Perez <fperez@colorado.edu>
5260 2002-12-18 Fernando Perez <fperez@colorado.edu>
5237
5261
5238 * Docs: added new info about Mac OSX, from Andrea.
5262 * Docs: added new info about Mac OSX, from Andrea.
5239
5263
5240 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5264 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5241 allow direct plotting of python strings whose format is the same
5265 allow direct plotting of python strings whose format is the same
5242 of gnuplot data files.
5266 of gnuplot data files.
5243
5267
5244 2002-12-16 Fernando Perez <fperez@colorado.edu>
5268 2002-12-16 Fernando Perez <fperez@colorado.edu>
5245
5269
5246 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5270 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5247 value of exit question to be acknowledged.
5271 value of exit question to be acknowledged.
5248
5272
5249 2002-12-03 Fernando Perez <fperez@colorado.edu>
5273 2002-12-03 Fernando Perez <fperez@colorado.edu>
5250
5274
5251 * IPython/ipmaker.py: removed generators, which had been added
5275 * IPython/ipmaker.py: removed generators, which had been added
5252 by mistake in an earlier debugging run. This was causing trouble
5276 by mistake in an earlier debugging run. This was causing trouble
5253 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5277 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5254 for pointing this out.
5278 for pointing this out.
5255
5279
5256 2002-11-17 Fernando Perez <fperez@colorado.edu>
5280 2002-11-17 Fernando Perez <fperez@colorado.edu>
5257
5281
5258 * Manual: updated the Gnuplot section.
5282 * Manual: updated the Gnuplot section.
5259
5283
5260 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5284 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5261 a much better split of what goes in Runtime and what goes in
5285 a much better split of what goes in Runtime and what goes in
5262 Interactive.
5286 Interactive.
5263
5287
5264 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5288 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5265 being imported from iplib.
5289 being imported from iplib.
5266
5290
5267 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5291 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5268 for command-passing. Now the global Gnuplot instance is called
5292 for command-passing. Now the global Gnuplot instance is called
5269 'gp' instead of 'g', which was really a far too fragile and
5293 'gp' instead of 'g', which was really a far too fragile and
5270 common name.
5294 common name.
5271
5295
5272 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5296 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5273 bounding boxes generated by Gnuplot for square plots.
5297 bounding boxes generated by Gnuplot for square plots.
5274
5298
5275 * IPython/genutils.py (popkey): new function added. I should
5299 * IPython/genutils.py (popkey): new function added. I should
5276 suggest this on c.l.py as a dict method, it seems useful.
5300 suggest this on c.l.py as a dict method, it seems useful.
5277
5301
5278 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5302 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5279 to transparently handle PostScript generation. MUCH better than
5303 to transparently handle PostScript generation. MUCH better than
5280 the previous plot_eps/replot_eps (which I removed now). The code
5304 the previous plot_eps/replot_eps (which I removed now). The code
5281 is also fairly clean and well documented now (including
5305 is also fairly clean and well documented now (including
5282 docstrings).
5306 docstrings).
5283
5307
5284 2002-11-13 Fernando Perez <fperez@colorado.edu>
5308 2002-11-13 Fernando Perez <fperez@colorado.edu>
5285
5309
5286 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5310 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5287 (inconsistent with options).
5311 (inconsistent with options).
5288
5312
5289 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5313 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5290 manually disabled, I don't know why. Fixed it.
5314 manually disabled, I don't know why. Fixed it.
5291 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5315 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5292 eps output.
5316 eps output.
5293
5317
5294 2002-11-12 Fernando Perez <fperez@colorado.edu>
5318 2002-11-12 Fernando Perez <fperez@colorado.edu>
5295
5319
5296 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5320 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5297 don't propagate up to caller. Fixes crash reported by François
5321 don't propagate up to caller. Fixes crash reported by François
5298 Pinard.
5322 Pinard.
5299
5323
5300 2002-11-09 Fernando Perez <fperez@colorado.edu>
5324 2002-11-09 Fernando Perez <fperez@colorado.edu>
5301
5325
5302 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5326 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5303 history file for new users.
5327 history file for new users.
5304 (make_IPython): fixed bug where initial install would leave the
5328 (make_IPython): fixed bug where initial install would leave the
5305 user running in the .ipython dir.
5329 user running in the .ipython dir.
5306 (make_IPython): fixed bug where config dir .ipython would be
5330 (make_IPython): fixed bug where config dir .ipython would be
5307 created regardless of the given -ipythondir option. Thanks to Cory
5331 created regardless of the given -ipythondir option. Thanks to Cory
5308 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5332 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5309
5333
5310 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5334 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5311 type confirmations. Will need to use it in all of IPython's code
5335 type confirmations. Will need to use it in all of IPython's code
5312 consistently.
5336 consistently.
5313
5337
5314 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5338 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5315 context to print 31 lines instead of the default 5. This will make
5339 context to print 31 lines instead of the default 5. This will make
5316 the crash reports extremely detailed in case the problem is in
5340 the crash reports extremely detailed in case the problem is in
5317 libraries I don't have access to.
5341 libraries I don't have access to.
5318
5342
5319 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5343 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5320 line of defense' code to still crash, but giving users fair
5344 line of defense' code to still crash, but giving users fair
5321 warning. I don't want internal errors to go unreported: if there's
5345 warning. I don't want internal errors to go unreported: if there's
5322 an internal problem, IPython should crash and generate a full
5346 an internal problem, IPython should crash and generate a full
5323 report.
5347 report.
5324
5348
5325 2002-11-08 Fernando Perez <fperez@colorado.edu>
5349 2002-11-08 Fernando Perez <fperez@colorado.edu>
5326
5350
5327 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5351 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5328 otherwise uncaught exceptions which can appear if people set
5352 otherwise uncaught exceptions which can appear if people set
5329 sys.stdout to something badly broken. Thanks to a crash report
5353 sys.stdout to something badly broken. Thanks to a crash report
5330 from henni-AT-mail.brainbot.com.
5354 from henni-AT-mail.brainbot.com.
5331
5355
5332 2002-11-04 Fernando Perez <fperez@colorado.edu>
5356 2002-11-04 Fernando Perez <fperez@colorado.edu>
5333
5357
5334 * IPython/iplib.py (InteractiveShell.interact): added
5358 * IPython/iplib.py (InteractiveShell.interact): added
5335 __IPYTHON__active to the builtins. It's a flag which goes on when
5359 __IPYTHON__active to the builtins. It's a flag which goes on when
5336 the interaction starts and goes off again when it stops. This
5360 the interaction starts and goes off again when it stops. This
5337 allows embedding code to detect being inside IPython. Before this
5361 allows embedding code to detect being inside IPython. Before this
5338 was done via __IPYTHON__, but that only shows that an IPython
5362 was done via __IPYTHON__, but that only shows that an IPython
5339 instance has been created.
5363 instance has been created.
5340
5364
5341 * IPython/Magic.py (Magic.magic_env): I realized that in a
5365 * IPython/Magic.py (Magic.magic_env): I realized that in a
5342 UserDict, instance.data holds the data as a normal dict. So I
5366 UserDict, instance.data holds the data as a normal dict. So I
5343 modified @env to return os.environ.data instead of rebuilding a
5367 modified @env to return os.environ.data instead of rebuilding a
5344 dict by hand.
5368 dict by hand.
5345
5369
5346 2002-11-02 Fernando Perez <fperez@colorado.edu>
5370 2002-11-02 Fernando Perez <fperez@colorado.edu>
5347
5371
5348 * IPython/genutils.py (warn): changed so that level 1 prints no
5372 * IPython/genutils.py (warn): changed so that level 1 prints no
5349 header. Level 2 is now the default (with 'WARNING' header, as
5373 header. Level 2 is now the default (with 'WARNING' header, as
5350 before). I think I tracked all places where changes were needed in
5374 before). I think I tracked all places where changes were needed in
5351 IPython, but outside code using the old level numbering may have
5375 IPython, but outside code using the old level numbering may have
5352 broken.
5376 broken.
5353
5377
5354 * IPython/iplib.py (InteractiveShell.runcode): added this to
5378 * IPython/iplib.py (InteractiveShell.runcode): added this to
5355 handle the tracebacks in SystemExit traps correctly. The previous
5379 handle the tracebacks in SystemExit traps correctly. The previous
5356 code (through interact) was printing more of the stack than
5380 code (through interact) was printing more of the stack than
5357 necessary, showing IPython internal code to the user.
5381 necessary, showing IPython internal code to the user.
5358
5382
5359 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5383 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5360 default. Now that the default at the confirmation prompt is yes,
5384 default. Now that the default at the confirmation prompt is yes,
5361 it's not so intrusive. François' argument that ipython sessions
5385 it's not so intrusive. François' argument that ipython sessions
5362 tend to be complex enough not to lose them from an accidental C-d,
5386 tend to be complex enough not to lose them from an accidental C-d,
5363 is a valid one.
5387 is a valid one.
5364
5388
5365 * IPython/iplib.py (InteractiveShell.interact): added a
5389 * IPython/iplib.py (InteractiveShell.interact): added a
5366 showtraceback() call to the SystemExit trap, and modified the exit
5390 showtraceback() call to the SystemExit trap, and modified the exit
5367 confirmation to have yes as the default.
5391 confirmation to have yes as the default.
5368
5392
5369 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5393 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5370 this file. It's been gone from the code for a long time, this was
5394 this file. It's been gone from the code for a long time, this was
5371 simply leftover junk.
5395 simply leftover junk.
5372
5396
5373 2002-11-01 Fernando Perez <fperez@colorado.edu>
5397 2002-11-01 Fernando Perez <fperez@colorado.edu>
5374
5398
5375 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5399 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5376 added. If set, IPython now traps EOF and asks for
5400 added. If set, IPython now traps EOF and asks for
5377 confirmation. After a request by François Pinard.
5401 confirmation. After a request by François Pinard.
5378
5402
5379 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5403 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5380 of @abort, and with a new (better) mechanism for handling the
5404 of @abort, and with a new (better) mechanism for handling the
5381 exceptions.
5405 exceptions.
5382
5406
5383 2002-10-27 Fernando Perez <fperez@colorado.edu>
5407 2002-10-27 Fernando Perez <fperez@colorado.edu>
5384
5408
5385 * IPython/usage.py (__doc__): updated the --help information and
5409 * IPython/usage.py (__doc__): updated the --help information and
5386 the ipythonrc file to indicate that -log generates
5410 the ipythonrc file to indicate that -log generates
5387 ./ipython.log. Also fixed the corresponding info in @logstart.
5411 ./ipython.log. Also fixed the corresponding info in @logstart.
5388 This and several other fixes in the manuals thanks to reports by
5412 This and several other fixes in the manuals thanks to reports by
5389 François Pinard <pinard-AT-iro.umontreal.ca>.
5413 François Pinard <pinard-AT-iro.umontreal.ca>.
5390
5414
5391 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5415 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5392 refer to @logstart (instead of @log, which doesn't exist).
5416 refer to @logstart (instead of @log, which doesn't exist).
5393
5417
5394 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5418 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5395 AttributeError crash. Thanks to Christopher Armstrong
5419 AttributeError crash. Thanks to Christopher Armstrong
5396 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5420 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5397 introduced recently (in 0.2.14pre37) with the fix to the eval
5421 introduced recently (in 0.2.14pre37) with the fix to the eval
5398 problem mentioned below.
5422 problem mentioned below.
5399
5423
5400 2002-10-17 Fernando Perez <fperez@colorado.edu>
5424 2002-10-17 Fernando Perez <fperez@colorado.edu>
5401
5425
5402 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5426 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5403 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5427 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5404
5428
5405 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5429 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5406 this function to fix a problem reported by Alex Schmolck. He saw
5430 this function to fix a problem reported by Alex Schmolck. He saw
5407 it with list comprehensions and generators, which were getting
5431 it with list comprehensions and generators, which were getting
5408 called twice. The real problem was an 'eval' call in testing for
5432 called twice. The real problem was an 'eval' call in testing for
5409 automagic which was evaluating the input line silently.
5433 automagic which was evaluating the input line silently.
5410
5434
5411 This is a potentially very nasty bug, if the input has side
5435 This is a potentially very nasty bug, if the input has side
5412 effects which must not be repeated. The code is much cleaner now,
5436 effects which must not be repeated. The code is much cleaner now,
5413 without any blanket 'except' left and with a regexp test for
5437 without any blanket 'except' left and with a regexp test for
5414 actual function names.
5438 actual function names.
5415
5439
5416 But an eval remains, which I'm not fully comfortable with. I just
5440 But an eval remains, which I'm not fully comfortable with. I just
5417 don't know how to find out if an expression could be a callable in
5441 don't know how to find out if an expression could be a callable in
5418 the user's namespace without doing an eval on the string. However
5442 the user's namespace without doing an eval on the string. However
5419 that string is now much more strictly checked so that no code
5443 that string is now much more strictly checked so that no code
5420 slips by, so the eval should only happen for things that can
5444 slips by, so the eval should only happen for things that can
5421 really be only function/method names.
5445 really be only function/method names.
5422
5446
5423 2002-10-15 Fernando Perez <fperez@colorado.edu>
5447 2002-10-15 Fernando Perez <fperez@colorado.edu>
5424
5448
5425 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5449 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5426 OSX information to main manual, removed README_Mac_OSX file from
5450 OSX information to main manual, removed README_Mac_OSX file from
5427 distribution. Also updated credits for recent additions.
5451 distribution. Also updated credits for recent additions.
5428
5452
5429 2002-10-10 Fernando Perez <fperez@colorado.edu>
5453 2002-10-10 Fernando Perez <fperez@colorado.edu>
5430
5454
5431 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5455 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5432 terminal-related issues. Many thanks to Andrea Riciputi
5456 terminal-related issues. Many thanks to Andrea Riciputi
5433 <andrea.riciputi-AT-libero.it> for writing it.
5457 <andrea.riciputi-AT-libero.it> for writing it.
5434
5458
5435 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5459 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5436 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5460 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5437
5461
5438 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5462 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5439 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5463 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5440 <syver-en-AT-online.no> who both submitted patches for this problem.
5464 <syver-en-AT-online.no> who both submitted patches for this problem.
5441
5465
5442 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5466 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5443 global embedding to make sure that things don't overwrite user
5467 global embedding to make sure that things don't overwrite user
5444 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5468 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5445
5469
5446 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5470 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5447 compatibility. Thanks to Hayden Callow
5471 compatibility. Thanks to Hayden Callow
5448 <h.callow-AT-elec.canterbury.ac.nz>
5472 <h.callow-AT-elec.canterbury.ac.nz>
5449
5473
5450 2002-10-04 Fernando Perez <fperez@colorado.edu>
5474 2002-10-04 Fernando Perez <fperez@colorado.edu>
5451
5475
5452 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5476 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5453 Gnuplot.File objects.
5477 Gnuplot.File objects.
5454
5478
5455 2002-07-23 Fernando Perez <fperez@colorado.edu>
5479 2002-07-23 Fernando Perez <fperez@colorado.edu>
5456
5480
5457 * IPython/genutils.py (timing): Added timings() and timing() for
5481 * IPython/genutils.py (timing): Added timings() and timing() for
5458 quick access to the most commonly needed data, the execution
5482 quick access to the most commonly needed data, the execution
5459 times. Old timing() renamed to timings_out().
5483 times. Old timing() renamed to timings_out().
5460
5484
5461 2002-07-18 Fernando Perez <fperez@colorado.edu>
5485 2002-07-18 Fernando Perez <fperez@colorado.edu>
5462
5486
5463 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5487 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5464 bug with nested instances disrupting the parent's tab completion.
5488 bug with nested instances disrupting the parent's tab completion.
5465
5489
5466 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5490 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5467 all_completions code to begin the emacs integration.
5491 all_completions code to begin the emacs integration.
5468
5492
5469 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5493 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5470 argument to allow titling individual arrays when plotting.
5494 argument to allow titling individual arrays when plotting.
5471
5495
5472 2002-07-15 Fernando Perez <fperez@colorado.edu>
5496 2002-07-15 Fernando Perez <fperez@colorado.edu>
5473
5497
5474 * setup.py (make_shortcut): changed to retrieve the value of
5498 * setup.py (make_shortcut): changed to retrieve the value of
5475 'Program Files' directory from the registry (this value changes in
5499 'Program Files' directory from the registry (this value changes in
5476 non-english versions of Windows). Thanks to Thomas Fanslau
5500 non-english versions of Windows). Thanks to Thomas Fanslau
5477 <tfanslau-AT-gmx.de> for the report.
5501 <tfanslau-AT-gmx.de> for the report.
5478
5502
5479 2002-07-10 Fernando Perez <fperez@colorado.edu>
5503 2002-07-10 Fernando Perez <fperez@colorado.edu>
5480
5504
5481 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5505 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5482 a bug in pdb, which crashes if a line with only whitespace is
5506 a bug in pdb, which crashes if a line with only whitespace is
5483 entered. Bug report submitted to sourceforge.
5507 entered. Bug report submitted to sourceforge.
5484
5508
5485 2002-07-09 Fernando Perez <fperez@colorado.edu>
5509 2002-07-09 Fernando Perez <fperez@colorado.edu>
5486
5510
5487 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5511 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5488 reporting exceptions (it's a bug in inspect.py, I just set a
5512 reporting exceptions (it's a bug in inspect.py, I just set a
5489 workaround).
5513 workaround).
5490
5514
5491 2002-07-08 Fernando Perez <fperez@colorado.edu>
5515 2002-07-08 Fernando Perez <fperez@colorado.edu>
5492
5516
5493 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5517 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5494 __IPYTHON__ in __builtins__ to show up in user_ns.
5518 __IPYTHON__ in __builtins__ to show up in user_ns.
5495
5519
5496 2002-07-03 Fernando Perez <fperez@colorado.edu>
5520 2002-07-03 Fernando Perez <fperez@colorado.edu>
5497
5521
5498 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5522 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5499 name from @gp_set_instance to @gp_set_default.
5523 name from @gp_set_instance to @gp_set_default.
5500
5524
5501 * IPython/ipmaker.py (make_IPython): default editor value set to
5525 * IPython/ipmaker.py (make_IPython): default editor value set to
5502 '0' (a string), to match the rc file. Otherwise will crash when
5526 '0' (a string), to match the rc file. Otherwise will crash when
5503 .strip() is called on it.
5527 .strip() is called on it.
5504
5528
5505
5529
5506 2002-06-28 Fernando Perez <fperez@colorado.edu>
5530 2002-06-28 Fernando Perez <fperez@colorado.edu>
5507
5531
5508 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5532 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5509 of files in current directory when a file is executed via
5533 of files in current directory when a file is executed via
5510 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5534 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5511
5535
5512 * setup.py (manfiles): fix for rpm builds, submitted by RA
5536 * setup.py (manfiles): fix for rpm builds, submitted by RA
5513 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5537 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5514
5538
5515 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5539 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5516 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5540 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5517 string!). A. Schmolck caught this one.
5541 string!). A. Schmolck caught this one.
5518
5542
5519 2002-06-27 Fernando Perez <fperez@colorado.edu>
5543 2002-06-27 Fernando Perez <fperez@colorado.edu>
5520
5544
5521 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5545 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5522 defined files at the cmd line. __name__ wasn't being set to
5546 defined files at the cmd line. __name__ wasn't being set to
5523 __main__.
5547 __main__.
5524
5548
5525 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5549 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5526 regular lists and tuples besides Numeric arrays.
5550 regular lists and tuples besides Numeric arrays.
5527
5551
5528 * IPython/Prompts.py (CachedOutput.__call__): Added output
5552 * IPython/Prompts.py (CachedOutput.__call__): Added output
5529 supression for input ending with ';'. Similar to Mathematica and
5553 supression for input ending with ';'. Similar to Mathematica and
5530 Matlab. The _* vars and Out[] list are still updated, just like
5554 Matlab. The _* vars and Out[] list are still updated, just like
5531 Mathematica behaves.
5555 Mathematica behaves.
5532
5556
5533 2002-06-25 Fernando Perez <fperez@colorado.edu>
5557 2002-06-25 Fernando Perez <fperez@colorado.edu>
5534
5558
5535 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5559 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5536 .ini extensions for profiels under Windows.
5560 .ini extensions for profiels under Windows.
5537
5561
5538 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5562 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5539 string form. Fix contributed by Alexander Schmolck
5563 string form. Fix contributed by Alexander Schmolck
5540 <a.schmolck-AT-gmx.net>
5564 <a.schmolck-AT-gmx.net>
5541
5565
5542 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5566 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5543 pre-configured Gnuplot instance.
5567 pre-configured Gnuplot instance.
5544
5568
5545 2002-06-21 Fernando Perez <fperez@colorado.edu>
5569 2002-06-21 Fernando Perez <fperez@colorado.edu>
5546
5570
5547 * IPython/numutils.py (exp_safe): new function, works around the
5571 * IPython/numutils.py (exp_safe): new function, works around the
5548 underflow problems in Numeric.
5572 underflow problems in Numeric.
5549 (log2): New fn. Safe log in base 2: returns exact integer answer
5573 (log2): New fn. Safe log in base 2: returns exact integer answer
5550 for exact integer powers of 2.
5574 for exact integer powers of 2.
5551
5575
5552 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5576 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5553 properly.
5577 properly.
5554
5578
5555 2002-06-20 Fernando Perez <fperez@colorado.edu>
5579 2002-06-20 Fernando Perez <fperez@colorado.edu>
5556
5580
5557 * IPython/genutils.py (timing): new function like
5581 * IPython/genutils.py (timing): new function like
5558 Mathematica's. Similar to time_test, but returns more info.
5582 Mathematica's. Similar to time_test, but returns more info.
5559
5583
5560 2002-06-18 Fernando Perez <fperez@colorado.edu>
5584 2002-06-18 Fernando Perez <fperez@colorado.edu>
5561
5585
5562 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5586 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5563 according to Mike Heeter's suggestions.
5587 according to Mike Heeter's suggestions.
5564
5588
5565 2002-06-16 Fernando Perez <fperez@colorado.edu>
5589 2002-06-16 Fernando Perez <fperez@colorado.edu>
5566
5590
5567 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5591 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5568 system. GnuplotMagic is gone as a user-directory option. New files
5592 system. GnuplotMagic is gone as a user-directory option. New files
5569 make it easier to use all the gnuplot stuff both from external
5593 make it easier to use all the gnuplot stuff both from external
5570 programs as well as from IPython. Had to rewrite part of
5594 programs as well as from IPython. Had to rewrite part of
5571 hardcopy() b/c of a strange bug: often the ps files simply don't
5595 hardcopy() b/c of a strange bug: often the ps files simply don't
5572 get created, and require a repeat of the command (often several
5596 get created, and require a repeat of the command (often several
5573 times).
5597 times).
5574
5598
5575 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5599 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5576 resolve output channel at call time, so that if sys.stderr has
5600 resolve output channel at call time, so that if sys.stderr has
5577 been redirected by user this gets honored.
5601 been redirected by user this gets honored.
5578
5602
5579 2002-06-13 Fernando Perez <fperez@colorado.edu>
5603 2002-06-13 Fernando Perez <fperez@colorado.edu>
5580
5604
5581 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5605 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5582 IPShell. Kept a copy with the old names to avoid breaking people's
5606 IPShell. Kept a copy with the old names to avoid breaking people's
5583 embedded code.
5607 embedded code.
5584
5608
5585 * IPython/ipython: simplified it to the bare minimum after
5609 * IPython/ipython: simplified it to the bare minimum after
5586 Holger's suggestions. Added info about how to use it in
5610 Holger's suggestions. Added info about how to use it in
5587 PYTHONSTARTUP.
5611 PYTHONSTARTUP.
5588
5612
5589 * IPython/Shell.py (IPythonShell): changed the options passing
5613 * IPython/Shell.py (IPythonShell): changed the options passing
5590 from a string with funky %s replacements to a straight list. Maybe
5614 from a string with funky %s replacements to a straight list. Maybe
5591 a bit more typing, but it follows sys.argv conventions, so there's
5615 a bit more typing, but it follows sys.argv conventions, so there's
5592 less special-casing to remember.
5616 less special-casing to remember.
5593
5617
5594 2002-06-12 Fernando Perez <fperez@colorado.edu>
5618 2002-06-12 Fernando Perez <fperez@colorado.edu>
5595
5619
5596 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5620 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5597 command. Thanks to a suggestion by Mike Heeter.
5621 command. Thanks to a suggestion by Mike Heeter.
5598 (Magic.magic_pfile): added behavior to look at filenames if given
5622 (Magic.magic_pfile): added behavior to look at filenames if given
5599 arg is not a defined object.
5623 arg is not a defined object.
5600 (Magic.magic_save): New @save function to save code snippets. Also
5624 (Magic.magic_save): New @save function to save code snippets. Also
5601 a Mike Heeter idea.
5625 a Mike Heeter idea.
5602
5626
5603 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5627 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5604 plot() and replot(). Much more convenient now, especially for
5628 plot() and replot(). Much more convenient now, especially for
5605 interactive use.
5629 interactive use.
5606
5630
5607 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5631 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5608 filenames.
5632 filenames.
5609
5633
5610 2002-06-02 Fernando Perez <fperez@colorado.edu>
5634 2002-06-02 Fernando Perez <fperez@colorado.edu>
5611
5635
5612 * IPython/Struct.py (Struct.__init__): modified to admit
5636 * IPython/Struct.py (Struct.__init__): modified to admit
5613 initialization via another struct.
5637 initialization via another struct.
5614
5638
5615 * IPython/genutils.py (SystemExec.__init__): New stateful
5639 * IPython/genutils.py (SystemExec.__init__): New stateful
5616 interface to xsys and bq. Useful for writing system scripts.
5640 interface to xsys and bq. Useful for writing system scripts.
5617
5641
5618 2002-05-30 Fernando Perez <fperez@colorado.edu>
5642 2002-05-30 Fernando Perez <fperez@colorado.edu>
5619
5643
5620 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5644 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5621 documents. This will make the user download smaller (it's getting
5645 documents. This will make the user download smaller (it's getting
5622 too big).
5646 too big).
5623
5647
5624 2002-05-29 Fernando Perez <fperez@colorado.edu>
5648 2002-05-29 Fernando Perez <fperez@colorado.edu>
5625
5649
5626 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5650 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5627 fix problems with shelve and pickle. Seems to work, but I don't
5651 fix problems with shelve and pickle. Seems to work, but I don't
5628 know if corner cases break it. Thanks to Mike Heeter
5652 know if corner cases break it. Thanks to Mike Heeter
5629 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5653 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5630
5654
5631 2002-05-24 Fernando Perez <fperez@colorado.edu>
5655 2002-05-24 Fernando Perez <fperez@colorado.edu>
5632
5656
5633 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5657 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5634 macros having broken.
5658 macros having broken.
5635
5659
5636 2002-05-21 Fernando Perez <fperez@colorado.edu>
5660 2002-05-21 Fernando Perez <fperez@colorado.edu>
5637
5661
5638 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5662 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5639 introduced logging bug: all history before logging started was
5663 introduced logging bug: all history before logging started was
5640 being written one character per line! This came from the redesign
5664 being written one character per line! This came from the redesign
5641 of the input history as a special list which slices to strings,
5665 of the input history as a special list which slices to strings,
5642 not to lists.
5666 not to lists.
5643
5667
5644 2002-05-20 Fernando Perez <fperez@colorado.edu>
5668 2002-05-20 Fernando Perez <fperez@colorado.edu>
5645
5669
5646 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5670 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5647 be an attribute of all classes in this module. The design of these
5671 be an attribute of all classes in this module. The design of these
5648 classes needs some serious overhauling.
5672 classes needs some serious overhauling.
5649
5673
5650 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5674 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5651 which was ignoring '_' in option names.
5675 which was ignoring '_' in option names.
5652
5676
5653 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5677 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5654 'Verbose_novars' to 'Context' and made it the new default. It's a
5678 'Verbose_novars' to 'Context' and made it the new default. It's a
5655 bit more readable and also safer than verbose.
5679 bit more readable and also safer than verbose.
5656
5680
5657 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5681 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5658 triple-quoted strings.
5682 triple-quoted strings.
5659
5683
5660 * IPython/OInspect.py (__all__): new module exposing the object
5684 * IPython/OInspect.py (__all__): new module exposing the object
5661 introspection facilities. Now the corresponding magics are dummy
5685 introspection facilities. Now the corresponding magics are dummy
5662 wrappers around this. Having this module will make it much easier
5686 wrappers around this. Having this module will make it much easier
5663 to put these functions into our modified pdb.
5687 to put these functions into our modified pdb.
5664 This new object inspector system uses the new colorizing module,
5688 This new object inspector system uses the new colorizing module,
5665 so source code and other things are nicely syntax highlighted.
5689 so source code and other things are nicely syntax highlighted.
5666
5690
5667 2002-05-18 Fernando Perez <fperez@colorado.edu>
5691 2002-05-18 Fernando Perez <fperez@colorado.edu>
5668
5692
5669 * IPython/ColorANSI.py: Split the coloring tools into a separate
5693 * IPython/ColorANSI.py: Split the coloring tools into a separate
5670 module so I can use them in other code easier (they were part of
5694 module so I can use them in other code easier (they were part of
5671 ultraTB).
5695 ultraTB).
5672
5696
5673 2002-05-17 Fernando Perez <fperez@colorado.edu>
5697 2002-05-17 Fernando Perez <fperez@colorado.edu>
5674
5698
5675 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5699 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5676 fixed it to set the global 'g' also to the called instance, as
5700 fixed it to set the global 'g' also to the called instance, as
5677 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5701 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5678 user's 'g' variables).
5702 user's 'g' variables).
5679
5703
5680 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5704 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5681 global variables (aliases to _ih,_oh) so that users which expect
5705 global variables (aliases to _ih,_oh) so that users which expect
5682 In[5] or Out[7] to work aren't unpleasantly surprised.
5706 In[5] or Out[7] to work aren't unpleasantly surprised.
5683 (InputList.__getslice__): new class to allow executing slices of
5707 (InputList.__getslice__): new class to allow executing slices of
5684 input history directly. Very simple class, complements the use of
5708 input history directly. Very simple class, complements the use of
5685 macros.
5709 macros.
5686
5710
5687 2002-05-16 Fernando Perez <fperez@colorado.edu>
5711 2002-05-16 Fernando Perez <fperez@colorado.edu>
5688
5712
5689 * setup.py (docdirbase): make doc directory be just doc/IPython
5713 * setup.py (docdirbase): make doc directory be just doc/IPython
5690 without version numbers, it will reduce clutter for users.
5714 without version numbers, it will reduce clutter for users.
5691
5715
5692 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5716 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5693 execfile call to prevent possible memory leak. See for details:
5717 execfile call to prevent possible memory leak. See for details:
5694 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5718 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5695
5719
5696 2002-05-15 Fernando Perez <fperez@colorado.edu>
5720 2002-05-15 Fernando Perez <fperez@colorado.edu>
5697
5721
5698 * IPython/Magic.py (Magic.magic_psource): made the object
5722 * IPython/Magic.py (Magic.magic_psource): made the object
5699 introspection names be more standard: pdoc, pdef, pfile and
5723 introspection names be more standard: pdoc, pdef, pfile and
5700 psource. They all print/page their output, and it makes
5724 psource. They all print/page their output, and it makes
5701 remembering them easier. Kept old names for compatibility as
5725 remembering them easier. Kept old names for compatibility as
5702 aliases.
5726 aliases.
5703
5727
5704 2002-05-14 Fernando Perez <fperez@colorado.edu>
5728 2002-05-14 Fernando Perez <fperez@colorado.edu>
5705
5729
5706 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5730 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5707 what the mouse problem was. The trick is to use gnuplot with temp
5731 what the mouse problem was. The trick is to use gnuplot with temp
5708 files and NOT with pipes (for data communication), because having
5732 files and NOT with pipes (for data communication), because having
5709 both pipes and the mouse on is bad news.
5733 both pipes and the mouse on is bad news.
5710
5734
5711 2002-05-13 Fernando Perez <fperez@colorado.edu>
5735 2002-05-13 Fernando Perez <fperez@colorado.edu>
5712
5736
5713 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5737 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5714 bug. Information would be reported about builtins even when
5738 bug. Information would be reported about builtins even when
5715 user-defined functions overrode them.
5739 user-defined functions overrode them.
5716
5740
5717 2002-05-11 Fernando Perez <fperez@colorado.edu>
5741 2002-05-11 Fernando Perez <fperez@colorado.edu>
5718
5742
5719 * IPython/__init__.py (__all__): removed FlexCompleter from
5743 * IPython/__init__.py (__all__): removed FlexCompleter from
5720 __all__ so that things don't fail in platforms without readline.
5744 __all__ so that things don't fail in platforms without readline.
5721
5745
5722 2002-05-10 Fernando Perez <fperez@colorado.edu>
5746 2002-05-10 Fernando Perez <fperez@colorado.edu>
5723
5747
5724 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5748 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5725 it requires Numeric, effectively making Numeric a dependency for
5749 it requires Numeric, effectively making Numeric a dependency for
5726 IPython.
5750 IPython.
5727
5751
5728 * Released 0.2.13
5752 * Released 0.2.13
5729
5753
5730 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5754 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5731 profiler interface. Now all the major options from the profiler
5755 profiler interface. Now all the major options from the profiler
5732 module are directly supported in IPython, both for single
5756 module are directly supported in IPython, both for single
5733 expressions (@prun) and for full programs (@run -p).
5757 expressions (@prun) and for full programs (@run -p).
5734
5758
5735 2002-05-09 Fernando Perez <fperez@colorado.edu>
5759 2002-05-09 Fernando Perez <fperez@colorado.edu>
5736
5760
5737 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5761 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5738 magic properly formatted for screen.
5762 magic properly formatted for screen.
5739
5763
5740 * setup.py (make_shortcut): Changed things to put pdf version in
5764 * setup.py (make_shortcut): Changed things to put pdf version in
5741 doc/ instead of doc/manual (had to change lyxport a bit).
5765 doc/ instead of doc/manual (had to change lyxport a bit).
5742
5766
5743 * IPython/Magic.py (Profile.string_stats): made profile runs go
5767 * IPython/Magic.py (Profile.string_stats): made profile runs go
5744 through pager (they are long and a pager allows searching, saving,
5768 through pager (they are long and a pager allows searching, saving,
5745 etc.)
5769 etc.)
5746
5770
5747 2002-05-08 Fernando Perez <fperez@colorado.edu>
5771 2002-05-08 Fernando Perez <fperez@colorado.edu>
5748
5772
5749 * Released 0.2.12
5773 * Released 0.2.12
5750
5774
5751 2002-05-06 Fernando Perez <fperez@colorado.edu>
5775 2002-05-06 Fernando Perez <fperez@colorado.edu>
5752
5776
5753 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5777 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5754 introduced); 'hist n1 n2' was broken.
5778 introduced); 'hist n1 n2' was broken.
5755 (Magic.magic_pdb): added optional on/off arguments to @pdb
5779 (Magic.magic_pdb): added optional on/off arguments to @pdb
5756 (Magic.magic_run): added option -i to @run, which executes code in
5780 (Magic.magic_run): added option -i to @run, which executes code in
5757 the IPython namespace instead of a clean one. Also added @irun as
5781 the IPython namespace instead of a clean one. Also added @irun as
5758 an alias to @run -i.
5782 an alias to @run -i.
5759
5783
5760 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5784 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5761 fixed (it didn't really do anything, the namespaces were wrong).
5785 fixed (it didn't really do anything, the namespaces were wrong).
5762
5786
5763 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5787 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5764
5788
5765 * IPython/__init__.py (__all__): Fixed package namespace, now
5789 * IPython/__init__.py (__all__): Fixed package namespace, now
5766 'import IPython' does give access to IPython.<all> as
5790 'import IPython' does give access to IPython.<all> as
5767 expected. Also renamed __release__ to Release.
5791 expected. Also renamed __release__ to Release.
5768
5792
5769 * IPython/Debugger.py (__license__): created new Pdb class which
5793 * IPython/Debugger.py (__license__): created new Pdb class which
5770 functions like a drop-in for the normal pdb.Pdb but does NOT
5794 functions like a drop-in for the normal pdb.Pdb but does NOT
5771 import readline by default. This way it doesn't muck up IPython's
5795 import readline by default. This way it doesn't muck up IPython's
5772 readline handling, and now tab-completion finally works in the
5796 readline handling, and now tab-completion finally works in the
5773 debugger -- sort of. It completes things globally visible, but the
5797 debugger -- sort of. It completes things globally visible, but the
5774 completer doesn't track the stack as pdb walks it. That's a bit
5798 completer doesn't track the stack as pdb walks it. That's a bit
5775 tricky, and I'll have to implement it later.
5799 tricky, and I'll have to implement it later.
5776
5800
5777 2002-05-05 Fernando Perez <fperez@colorado.edu>
5801 2002-05-05 Fernando Perez <fperez@colorado.edu>
5778
5802
5779 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5803 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5780 magic docstrings when printed via ? (explicit \'s were being
5804 magic docstrings when printed via ? (explicit \'s were being
5781 printed).
5805 printed).
5782
5806
5783 * IPython/ipmaker.py (make_IPython): fixed namespace
5807 * IPython/ipmaker.py (make_IPython): fixed namespace
5784 identification bug. Now variables loaded via logs or command-line
5808 identification bug. Now variables loaded via logs or command-line
5785 files are recognized in the interactive namespace by @who.
5809 files are recognized in the interactive namespace by @who.
5786
5810
5787 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5811 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5788 log replay system stemming from the string form of Structs.
5812 log replay system stemming from the string form of Structs.
5789
5813
5790 * IPython/Magic.py (Macro.__init__): improved macros to properly
5814 * IPython/Magic.py (Macro.__init__): improved macros to properly
5791 handle magic commands in them.
5815 handle magic commands in them.
5792 (Magic.magic_logstart): usernames are now expanded so 'logstart
5816 (Magic.magic_logstart): usernames are now expanded so 'logstart
5793 ~/mylog' now works.
5817 ~/mylog' now works.
5794
5818
5795 * IPython/iplib.py (complete): fixed bug where paths starting with
5819 * IPython/iplib.py (complete): fixed bug where paths starting with
5796 '/' would be completed as magic names.
5820 '/' would be completed as magic names.
5797
5821
5798 2002-05-04 Fernando Perez <fperez@colorado.edu>
5822 2002-05-04 Fernando Perez <fperez@colorado.edu>
5799
5823
5800 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5824 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5801 allow running full programs under the profiler's control.
5825 allow running full programs under the profiler's control.
5802
5826
5803 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5827 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5804 mode to report exceptions verbosely but without formatting
5828 mode to report exceptions verbosely but without formatting
5805 variables. This addresses the issue of ipython 'freezing' (it's
5829 variables. This addresses the issue of ipython 'freezing' (it's
5806 not frozen, but caught in an expensive formatting loop) when huge
5830 not frozen, but caught in an expensive formatting loop) when huge
5807 variables are in the context of an exception.
5831 variables are in the context of an exception.
5808 (VerboseTB.text): Added '--->' markers at line where exception was
5832 (VerboseTB.text): Added '--->' markers at line where exception was
5809 triggered. Much clearer to read, especially in NoColor modes.
5833 triggered. Much clearer to read, especially in NoColor modes.
5810
5834
5811 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5835 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5812 implemented in reverse when changing to the new parse_options().
5836 implemented in reverse when changing to the new parse_options().
5813
5837
5814 2002-05-03 Fernando Perez <fperez@colorado.edu>
5838 2002-05-03 Fernando Perez <fperez@colorado.edu>
5815
5839
5816 * IPython/Magic.py (Magic.parse_options): new function so that
5840 * IPython/Magic.py (Magic.parse_options): new function so that
5817 magics can parse options easier.
5841 magics can parse options easier.
5818 (Magic.magic_prun): new function similar to profile.run(),
5842 (Magic.magic_prun): new function similar to profile.run(),
5819 suggested by Chris Hart.
5843 suggested by Chris Hart.
5820 (Magic.magic_cd): fixed behavior so that it only changes if
5844 (Magic.magic_cd): fixed behavior so that it only changes if
5821 directory actually is in history.
5845 directory actually is in history.
5822
5846
5823 * IPython/usage.py (__doc__): added information about potential
5847 * IPython/usage.py (__doc__): added information about potential
5824 slowness of Verbose exception mode when there are huge data
5848 slowness of Verbose exception mode when there are huge data
5825 structures to be formatted (thanks to Archie Paulson).
5849 structures to be formatted (thanks to Archie Paulson).
5826
5850
5827 * IPython/ipmaker.py (make_IPython): Changed default logging
5851 * IPython/ipmaker.py (make_IPython): Changed default logging
5828 (when simply called with -log) to use curr_dir/ipython.log in
5852 (when simply called with -log) to use curr_dir/ipython.log in
5829 rotate mode. Fixed crash which was occuring with -log before
5853 rotate mode. Fixed crash which was occuring with -log before
5830 (thanks to Jim Boyle).
5854 (thanks to Jim Boyle).
5831
5855
5832 2002-05-01 Fernando Perez <fperez@colorado.edu>
5856 2002-05-01 Fernando Perez <fperez@colorado.edu>
5833
5857
5834 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5858 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5835 was nasty -- though somewhat of a corner case).
5859 was nasty -- though somewhat of a corner case).
5836
5860
5837 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5861 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5838 text (was a bug).
5862 text (was a bug).
5839
5863
5840 2002-04-30 Fernando Perez <fperez@colorado.edu>
5864 2002-04-30 Fernando Perez <fperez@colorado.edu>
5841
5865
5842 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5866 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5843 a print after ^D or ^C from the user so that the In[] prompt
5867 a print after ^D or ^C from the user so that the In[] prompt
5844 doesn't over-run the gnuplot one.
5868 doesn't over-run the gnuplot one.
5845
5869
5846 2002-04-29 Fernando Perez <fperez@colorado.edu>
5870 2002-04-29 Fernando Perez <fperez@colorado.edu>
5847
5871
5848 * Released 0.2.10
5872 * Released 0.2.10
5849
5873
5850 * IPython/__release__.py (version): get date dynamically.
5874 * IPython/__release__.py (version): get date dynamically.
5851
5875
5852 * Misc. documentation updates thanks to Arnd's comments. Also ran
5876 * Misc. documentation updates thanks to Arnd's comments. Also ran
5853 a full spellcheck on the manual (hadn't been done in a while).
5877 a full spellcheck on the manual (hadn't been done in a while).
5854
5878
5855 2002-04-27 Fernando Perez <fperez@colorado.edu>
5879 2002-04-27 Fernando Perez <fperez@colorado.edu>
5856
5880
5857 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5881 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5858 starting a log in mid-session would reset the input history list.
5882 starting a log in mid-session would reset the input history list.
5859
5883
5860 2002-04-26 Fernando Perez <fperez@colorado.edu>
5884 2002-04-26 Fernando Perez <fperez@colorado.edu>
5861
5885
5862 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5886 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5863 all files were being included in an update. Now anything in
5887 all files were being included in an update. Now anything in
5864 UserConfig that matches [A-Za-z]*.py will go (this excludes
5888 UserConfig that matches [A-Za-z]*.py will go (this excludes
5865 __init__.py)
5889 __init__.py)
5866
5890
5867 2002-04-25 Fernando Perez <fperez@colorado.edu>
5891 2002-04-25 Fernando Perez <fperez@colorado.edu>
5868
5892
5869 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5893 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5870 to __builtins__ so that any form of embedded or imported code can
5894 to __builtins__ so that any form of embedded or imported code can
5871 test for being inside IPython.
5895 test for being inside IPython.
5872
5896
5873 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5897 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5874 changed to GnuplotMagic because it's now an importable module,
5898 changed to GnuplotMagic because it's now an importable module,
5875 this makes the name follow that of the standard Gnuplot module.
5899 this makes the name follow that of the standard Gnuplot module.
5876 GnuplotMagic can now be loaded at any time in mid-session.
5900 GnuplotMagic can now be loaded at any time in mid-session.
5877
5901
5878 2002-04-24 Fernando Perez <fperez@colorado.edu>
5902 2002-04-24 Fernando Perez <fperez@colorado.edu>
5879
5903
5880 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5904 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5881 the globals (IPython has its own namespace) and the
5905 the globals (IPython has its own namespace) and the
5882 PhysicalQuantity stuff is much better anyway.
5906 PhysicalQuantity stuff is much better anyway.
5883
5907
5884 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5908 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5885 embedding example to standard user directory for
5909 embedding example to standard user directory for
5886 distribution. Also put it in the manual.
5910 distribution. Also put it in the manual.
5887
5911
5888 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5912 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5889 instance as first argument (so it doesn't rely on some obscure
5913 instance as first argument (so it doesn't rely on some obscure
5890 hidden global).
5914 hidden global).
5891
5915
5892 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5916 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5893 delimiters. While it prevents ().TAB from working, it allows
5917 delimiters. While it prevents ().TAB from working, it allows
5894 completions in open (... expressions. This is by far a more common
5918 completions in open (... expressions. This is by far a more common
5895 case.
5919 case.
5896
5920
5897 2002-04-23 Fernando Perez <fperez@colorado.edu>
5921 2002-04-23 Fernando Perez <fperez@colorado.edu>
5898
5922
5899 * IPython/Extensions/InterpreterPasteInput.py: new
5923 * IPython/Extensions/InterpreterPasteInput.py: new
5900 syntax-processing module for pasting lines with >>> or ... at the
5924 syntax-processing module for pasting lines with >>> or ... at the
5901 start.
5925 start.
5902
5926
5903 * IPython/Extensions/PhysicalQ_Interactive.py
5927 * IPython/Extensions/PhysicalQ_Interactive.py
5904 (PhysicalQuantityInteractive.__int__): fixed to work with either
5928 (PhysicalQuantityInteractive.__int__): fixed to work with either
5905 Numeric or math.
5929 Numeric or math.
5906
5930
5907 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5931 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5908 provided profiles. Now we have:
5932 provided profiles. Now we have:
5909 -math -> math module as * and cmath with its own namespace.
5933 -math -> math module as * and cmath with its own namespace.
5910 -numeric -> Numeric as *, plus gnuplot & grace
5934 -numeric -> Numeric as *, plus gnuplot & grace
5911 -physics -> same as before
5935 -physics -> same as before
5912
5936
5913 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5937 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5914 user-defined magics wouldn't be found by @magic if they were
5938 user-defined magics wouldn't be found by @magic if they were
5915 defined as class methods. Also cleaned up the namespace search
5939 defined as class methods. Also cleaned up the namespace search
5916 logic and the string building (to use %s instead of many repeated
5940 logic and the string building (to use %s instead of many repeated
5917 string adds).
5941 string adds).
5918
5942
5919 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5943 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5920 of user-defined magics to operate with class methods (cleaner, in
5944 of user-defined magics to operate with class methods (cleaner, in
5921 line with the gnuplot code).
5945 line with the gnuplot code).
5922
5946
5923 2002-04-22 Fernando Perez <fperez@colorado.edu>
5947 2002-04-22 Fernando Perez <fperez@colorado.edu>
5924
5948
5925 * setup.py: updated dependency list so that manual is updated when
5949 * setup.py: updated dependency list so that manual is updated when
5926 all included files change.
5950 all included files change.
5927
5951
5928 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5952 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5929 the delimiter removal option (the fix is ugly right now).
5953 the delimiter removal option (the fix is ugly right now).
5930
5954
5931 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5955 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5932 all of the math profile (quicker loading, no conflict between
5956 all of the math profile (quicker loading, no conflict between
5933 g-9.8 and g-gnuplot).
5957 g-9.8 and g-gnuplot).
5934
5958
5935 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5959 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5936 name of post-mortem files to IPython_crash_report.txt.
5960 name of post-mortem files to IPython_crash_report.txt.
5937
5961
5938 * Cleanup/update of the docs. Added all the new readline info and
5962 * Cleanup/update of the docs. Added all the new readline info and
5939 formatted all lists as 'real lists'.
5963 formatted all lists as 'real lists'.
5940
5964
5941 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5965 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5942 tab-completion options, since the full readline parse_and_bind is
5966 tab-completion options, since the full readline parse_and_bind is
5943 now accessible.
5967 now accessible.
5944
5968
5945 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5969 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5946 handling of readline options. Now users can specify any string to
5970 handling of readline options. Now users can specify any string to
5947 be passed to parse_and_bind(), as well as the delimiters to be
5971 be passed to parse_and_bind(), as well as the delimiters to be
5948 removed.
5972 removed.
5949 (InteractiveShell.__init__): Added __name__ to the global
5973 (InteractiveShell.__init__): Added __name__ to the global
5950 namespace so that things like Itpl which rely on its existence
5974 namespace so that things like Itpl which rely on its existence
5951 don't crash.
5975 don't crash.
5952 (InteractiveShell._prefilter): Defined the default with a _ so
5976 (InteractiveShell._prefilter): Defined the default with a _ so
5953 that prefilter() is easier to override, while the default one
5977 that prefilter() is easier to override, while the default one
5954 remains available.
5978 remains available.
5955
5979
5956 2002-04-18 Fernando Perez <fperez@colorado.edu>
5980 2002-04-18 Fernando Perez <fperez@colorado.edu>
5957
5981
5958 * Added information about pdb in the docs.
5982 * Added information about pdb in the docs.
5959
5983
5960 2002-04-17 Fernando Perez <fperez@colorado.edu>
5984 2002-04-17 Fernando Perez <fperez@colorado.edu>
5961
5985
5962 * IPython/ipmaker.py (make_IPython): added rc_override option to
5986 * IPython/ipmaker.py (make_IPython): added rc_override option to
5963 allow passing config options at creation time which may override
5987 allow passing config options at creation time which may override
5964 anything set in the config files or command line. This is
5988 anything set in the config files or command line. This is
5965 particularly useful for configuring embedded instances.
5989 particularly useful for configuring embedded instances.
5966
5990
5967 2002-04-15 Fernando Perez <fperez@colorado.edu>
5991 2002-04-15 Fernando Perez <fperez@colorado.edu>
5968
5992
5969 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5993 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5970 crash embedded instances because of the input cache falling out of
5994 crash embedded instances because of the input cache falling out of
5971 sync with the output counter.
5995 sync with the output counter.
5972
5996
5973 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5997 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5974 mode which calls pdb after an uncaught exception in IPython itself.
5998 mode which calls pdb after an uncaught exception in IPython itself.
5975
5999
5976 2002-04-14 Fernando Perez <fperez@colorado.edu>
6000 2002-04-14 Fernando Perez <fperez@colorado.edu>
5977
6001
5978 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6002 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5979 readline, fix it back after each call.
6003 readline, fix it back after each call.
5980
6004
5981 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6005 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5982 method to force all access via __call__(), which guarantees that
6006 method to force all access via __call__(), which guarantees that
5983 traceback references are properly deleted.
6007 traceback references are properly deleted.
5984
6008
5985 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6009 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5986 improve printing when pprint is in use.
6010 improve printing when pprint is in use.
5987
6011
5988 2002-04-13 Fernando Perez <fperez@colorado.edu>
6012 2002-04-13 Fernando Perez <fperez@colorado.edu>
5989
6013
5990 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6014 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5991 exceptions aren't caught anymore. If the user triggers one, he
6015 exceptions aren't caught anymore. If the user triggers one, he
5992 should know why he's doing it and it should go all the way up,
6016 should know why he's doing it and it should go all the way up,
5993 just like any other exception. So now @abort will fully kill the
6017 just like any other exception. So now @abort will fully kill the
5994 embedded interpreter and the embedding code (unless that happens
6018 embedded interpreter and the embedding code (unless that happens
5995 to catch SystemExit).
6019 to catch SystemExit).
5996
6020
5997 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6021 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5998 and a debugger() method to invoke the interactive pdb debugger
6022 and a debugger() method to invoke the interactive pdb debugger
5999 after printing exception information. Also added the corresponding
6023 after printing exception information. Also added the corresponding
6000 -pdb option and @pdb magic to control this feature, and updated
6024 -pdb option and @pdb magic to control this feature, and updated
6001 the docs. After a suggestion from Christopher Hart
6025 the docs. After a suggestion from Christopher Hart
6002 (hart-AT-caltech.edu).
6026 (hart-AT-caltech.edu).
6003
6027
6004 2002-04-12 Fernando Perez <fperez@colorado.edu>
6028 2002-04-12 Fernando Perez <fperez@colorado.edu>
6005
6029
6006 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6030 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6007 the exception handlers defined by the user (not the CrashHandler)
6031 the exception handlers defined by the user (not the CrashHandler)
6008 so that user exceptions don't trigger an ipython bug report.
6032 so that user exceptions don't trigger an ipython bug report.
6009
6033
6010 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6034 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6011 configurable (it should have always been so).
6035 configurable (it should have always been so).
6012
6036
6013 2002-03-26 Fernando Perez <fperez@colorado.edu>
6037 2002-03-26 Fernando Perez <fperez@colorado.edu>
6014
6038
6015 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6039 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6016 and there to fix embedding namespace issues. This should all be
6040 and there to fix embedding namespace issues. This should all be
6017 done in a more elegant way.
6041 done in a more elegant way.
6018
6042
6019 2002-03-25 Fernando Perez <fperez@colorado.edu>
6043 2002-03-25 Fernando Perez <fperez@colorado.edu>
6020
6044
6021 * IPython/genutils.py (get_home_dir): Try to make it work under
6045 * IPython/genutils.py (get_home_dir): Try to make it work under
6022 win9x also.
6046 win9x also.
6023
6047
6024 2002-03-20 Fernando Perez <fperez@colorado.edu>
6048 2002-03-20 Fernando Perez <fperez@colorado.edu>
6025
6049
6026 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6050 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6027 sys.displayhook untouched upon __init__.
6051 sys.displayhook untouched upon __init__.
6028
6052
6029 2002-03-19 Fernando Perez <fperez@colorado.edu>
6053 2002-03-19 Fernando Perez <fperez@colorado.edu>
6030
6054
6031 * Released 0.2.9 (for embedding bug, basically).
6055 * Released 0.2.9 (for embedding bug, basically).
6032
6056
6033 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6057 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6034 exceptions so that enclosing shell's state can be restored.
6058 exceptions so that enclosing shell's state can be restored.
6035
6059
6036 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6060 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6037 naming conventions in the .ipython/ dir.
6061 naming conventions in the .ipython/ dir.
6038
6062
6039 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6063 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6040 from delimiters list so filenames with - in them get expanded.
6064 from delimiters list so filenames with - in them get expanded.
6041
6065
6042 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6066 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6043 sys.displayhook not being properly restored after an embedded call.
6067 sys.displayhook not being properly restored after an embedded call.
6044
6068
6045 2002-03-18 Fernando Perez <fperez@colorado.edu>
6069 2002-03-18 Fernando Perez <fperez@colorado.edu>
6046
6070
6047 * Released 0.2.8
6071 * Released 0.2.8
6048
6072
6049 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6073 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6050 some files weren't being included in a -upgrade.
6074 some files weren't being included in a -upgrade.
6051 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6075 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6052 on' so that the first tab completes.
6076 on' so that the first tab completes.
6053 (InteractiveShell.handle_magic): fixed bug with spaces around
6077 (InteractiveShell.handle_magic): fixed bug with spaces around
6054 quotes breaking many magic commands.
6078 quotes breaking many magic commands.
6055
6079
6056 * setup.py: added note about ignoring the syntax error messages at
6080 * setup.py: added note about ignoring the syntax error messages at
6057 installation.
6081 installation.
6058
6082
6059 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6083 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6060 streamlining the gnuplot interface, now there's only one magic @gp.
6084 streamlining the gnuplot interface, now there's only one magic @gp.
6061
6085
6062 2002-03-17 Fernando Perez <fperez@colorado.edu>
6086 2002-03-17 Fernando Perez <fperez@colorado.edu>
6063
6087
6064 * IPython/UserConfig/magic_gnuplot.py: new name for the
6088 * IPython/UserConfig/magic_gnuplot.py: new name for the
6065 example-magic_pm.py file. Much enhanced system, now with a shell
6089 example-magic_pm.py file. Much enhanced system, now with a shell
6066 for communicating directly with gnuplot, one command at a time.
6090 for communicating directly with gnuplot, one command at a time.
6067
6091
6068 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6092 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6069 setting __name__=='__main__'.
6093 setting __name__=='__main__'.
6070
6094
6071 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6095 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6072 mini-shell for accessing gnuplot from inside ipython. Should
6096 mini-shell for accessing gnuplot from inside ipython. Should
6073 extend it later for grace access too. Inspired by Arnd's
6097 extend it later for grace access too. Inspired by Arnd's
6074 suggestion.
6098 suggestion.
6075
6099
6076 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6100 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6077 calling magic functions with () in their arguments. Thanks to Arnd
6101 calling magic functions with () in their arguments. Thanks to Arnd
6078 Baecker for pointing this to me.
6102 Baecker for pointing this to me.
6079
6103
6080 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6104 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6081 infinitely for integer or complex arrays (only worked with floats).
6105 infinitely for integer or complex arrays (only worked with floats).
6082
6106
6083 2002-03-16 Fernando Perez <fperez@colorado.edu>
6107 2002-03-16 Fernando Perez <fperez@colorado.edu>
6084
6108
6085 * setup.py: Merged setup and setup_windows into a single script
6109 * setup.py: Merged setup and setup_windows into a single script
6086 which properly handles things for windows users.
6110 which properly handles things for windows users.
6087
6111
6088 2002-03-15 Fernando Perez <fperez@colorado.edu>
6112 2002-03-15 Fernando Perez <fperez@colorado.edu>
6089
6113
6090 * Big change to the manual: now the magics are all automatically
6114 * Big change to the manual: now the magics are all automatically
6091 documented. This information is generated from their docstrings
6115 documented. This information is generated from their docstrings
6092 and put in a latex file included by the manual lyx file. This way
6116 and put in a latex file included by the manual lyx file. This way
6093 we get always up to date information for the magics. The manual
6117 we get always up to date information for the magics. The manual
6094 now also has proper version information, also auto-synced.
6118 now also has proper version information, also auto-synced.
6095
6119
6096 For this to work, an undocumented --magic_docstrings option was added.
6120 For this to work, an undocumented --magic_docstrings option was added.
6097
6121
6098 2002-03-13 Fernando Perez <fperez@colorado.edu>
6122 2002-03-13 Fernando Perez <fperez@colorado.edu>
6099
6123
6100 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6124 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6101 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6125 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6102
6126
6103 2002-03-12 Fernando Perez <fperez@colorado.edu>
6127 2002-03-12 Fernando Perez <fperez@colorado.edu>
6104
6128
6105 * IPython/ultraTB.py (TermColors): changed color escapes again to
6129 * IPython/ultraTB.py (TermColors): changed color escapes again to
6106 fix the (old, reintroduced) line-wrapping bug. Basically, if
6130 fix the (old, reintroduced) line-wrapping bug. Basically, if
6107 \001..\002 aren't given in the color escapes, lines get wrapped
6131 \001..\002 aren't given in the color escapes, lines get wrapped
6108 weirdly. But giving those screws up old xterms and emacs terms. So
6132 weirdly. But giving those screws up old xterms and emacs terms. So
6109 I added some logic for emacs terms to be ok, but I can't identify old
6133 I added some logic for emacs terms to be ok, but I can't identify old
6110 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6134 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6111
6135
6112 2002-03-10 Fernando Perez <fperez@colorado.edu>
6136 2002-03-10 Fernando Perez <fperez@colorado.edu>
6113
6137
6114 * IPython/usage.py (__doc__): Various documentation cleanups and
6138 * IPython/usage.py (__doc__): Various documentation cleanups and
6115 updates, both in usage docstrings and in the manual.
6139 updates, both in usage docstrings and in the manual.
6116
6140
6117 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6141 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6118 handling of caching. Set minimum acceptabe value for having a
6142 handling of caching. Set minimum acceptabe value for having a
6119 cache at 20 values.
6143 cache at 20 values.
6120
6144
6121 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6145 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6122 install_first_time function to a method, renamed it and added an
6146 install_first_time function to a method, renamed it and added an
6123 'upgrade' mode. Now people can update their config directory with
6147 'upgrade' mode. Now people can update their config directory with
6124 a simple command line switch (-upgrade, also new).
6148 a simple command line switch (-upgrade, also new).
6125
6149
6126 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6150 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6127 @file (convenient for automagic users under Python >= 2.2).
6151 @file (convenient for automagic users under Python >= 2.2).
6128 Removed @files (it seemed more like a plural than an abbrev. of
6152 Removed @files (it seemed more like a plural than an abbrev. of
6129 'file show').
6153 'file show').
6130
6154
6131 * IPython/iplib.py (install_first_time): Fixed crash if there were
6155 * IPython/iplib.py (install_first_time): Fixed crash if there were
6132 backup files ('~') in .ipython/ install directory.
6156 backup files ('~') in .ipython/ install directory.
6133
6157
6134 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6158 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6135 system. Things look fine, but these changes are fairly
6159 system. Things look fine, but these changes are fairly
6136 intrusive. Test them for a few days.
6160 intrusive. Test them for a few days.
6137
6161
6138 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6162 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6139 the prompts system. Now all in/out prompt strings are user
6163 the prompts system. Now all in/out prompt strings are user
6140 controllable. This is particularly useful for embedding, as one
6164 controllable. This is particularly useful for embedding, as one
6141 can tag embedded instances with particular prompts.
6165 can tag embedded instances with particular prompts.
6142
6166
6143 Also removed global use of sys.ps1/2, which now allows nested
6167 Also removed global use of sys.ps1/2, which now allows nested
6144 embeddings without any problems. Added command-line options for
6168 embeddings without any problems. Added command-line options for
6145 the prompt strings.
6169 the prompt strings.
6146
6170
6147 2002-03-08 Fernando Perez <fperez@colorado.edu>
6171 2002-03-08 Fernando Perez <fperez@colorado.edu>
6148
6172
6149 * IPython/UserConfig/example-embed-short.py (ipshell): added
6173 * IPython/UserConfig/example-embed-short.py (ipshell): added
6150 example file with the bare minimum code for embedding.
6174 example file with the bare minimum code for embedding.
6151
6175
6152 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6176 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6153 functionality for the embeddable shell to be activated/deactivated
6177 functionality for the embeddable shell to be activated/deactivated
6154 either globally or at each call.
6178 either globally or at each call.
6155
6179
6156 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6180 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6157 rewriting the prompt with '--->' for auto-inputs with proper
6181 rewriting the prompt with '--->' for auto-inputs with proper
6158 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6182 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6159 this is handled by the prompts class itself, as it should.
6183 this is handled by the prompts class itself, as it should.
6160
6184
6161 2002-03-05 Fernando Perez <fperez@colorado.edu>
6185 2002-03-05 Fernando Perez <fperez@colorado.edu>
6162
6186
6163 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6187 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6164 @logstart to avoid name clashes with the math log function.
6188 @logstart to avoid name clashes with the math log function.
6165
6189
6166 * Big updates to X/Emacs section of the manual.
6190 * Big updates to X/Emacs section of the manual.
6167
6191
6168 * Removed ipython_emacs. Milan explained to me how to pass
6192 * Removed ipython_emacs. Milan explained to me how to pass
6169 arguments to ipython through Emacs. Some day I'm going to end up
6193 arguments to ipython through Emacs. Some day I'm going to end up
6170 learning some lisp...
6194 learning some lisp...
6171
6195
6172 2002-03-04 Fernando Perez <fperez@colorado.edu>
6196 2002-03-04 Fernando Perez <fperez@colorado.edu>
6173
6197
6174 * IPython/ipython_emacs: Created script to be used as the
6198 * IPython/ipython_emacs: Created script to be used as the
6175 py-python-command Emacs variable so we can pass IPython
6199 py-python-command Emacs variable so we can pass IPython
6176 parameters. I can't figure out how to tell Emacs directly to pass
6200 parameters. I can't figure out how to tell Emacs directly to pass
6177 parameters to IPython, so a dummy shell script will do it.
6201 parameters to IPython, so a dummy shell script will do it.
6178
6202
6179 Other enhancements made for things to work better under Emacs'
6203 Other enhancements made for things to work better under Emacs'
6180 various types of terminals. Many thanks to Milan Zamazal
6204 various types of terminals. Many thanks to Milan Zamazal
6181 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6205 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6182
6206
6183 2002-03-01 Fernando Perez <fperez@colorado.edu>
6207 2002-03-01 Fernando Perez <fperez@colorado.edu>
6184
6208
6185 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6209 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6186 that loading of readline is now optional. This gives better
6210 that loading of readline is now optional. This gives better
6187 control to emacs users.
6211 control to emacs users.
6188
6212
6189 * IPython/ultraTB.py (__date__): Modified color escape sequences
6213 * IPython/ultraTB.py (__date__): Modified color escape sequences
6190 and now things work fine under xterm and in Emacs' term buffers
6214 and now things work fine under xterm and in Emacs' term buffers
6191 (though not shell ones). Well, in emacs you get colors, but all
6215 (though not shell ones). Well, in emacs you get colors, but all
6192 seem to be 'light' colors (no difference between dark and light
6216 seem to be 'light' colors (no difference between dark and light
6193 ones). But the garbage chars are gone, and also in xterms. It
6217 ones). But the garbage chars are gone, and also in xterms. It
6194 seems that now I'm using 'cleaner' ansi sequences.
6218 seems that now I'm using 'cleaner' ansi sequences.
6195
6219
6196 2002-02-21 Fernando Perez <fperez@colorado.edu>
6220 2002-02-21 Fernando Perez <fperez@colorado.edu>
6197
6221
6198 * Released 0.2.7 (mainly to publish the scoping fix).
6222 * Released 0.2.7 (mainly to publish the scoping fix).
6199
6223
6200 * IPython/Logger.py (Logger.logstate): added. A corresponding
6224 * IPython/Logger.py (Logger.logstate): added. A corresponding
6201 @logstate magic was created.
6225 @logstate magic was created.
6202
6226
6203 * IPython/Magic.py: fixed nested scoping problem under Python
6227 * IPython/Magic.py: fixed nested scoping problem under Python
6204 2.1.x (automagic wasn't working).
6228 2.1.x (automagic wasn't working).
6205
6229
6206 2002-02-20 Fernando Perez <fperez@colorado.edu>
6230 2002-02-20 Fernando Perez <fperez@colorado.edu>
6207
6231
6208 * Released 0.2.6.
6232 * Released 0.2.6.
6209
6233
6210 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6234 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6211 option so that logs can come out without any headers at all.
6235 option so that logs can come out without any headers at all.
6212
6236
6213 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6237 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6214 SciPy.
6238 SciPy.
6215
6239
6216 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6240 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6217 that embedded IPython calls don't require vars() to be explicitly
6241 that embedded IPython calls don't require vars() to be explicitly
6218 passed. Now they are extracted from the caller's frame (code
6242 passed. Now they are extracted from the caller's frame (code
6219 snatched from Eric Jones' weave). Added better documentation to
6243 snatched from Eric Jones' weave). Added better documentation to
6220 the section on embedding and the example file.
6244 the section on embedding and the example file.
6221
6245
6222 * IPython/genutils.py (page): Changed so that under emacs, it just
6246 * IPython/genutils.py (page): Changed so that under emacs, it just
6223 prints the string. You can then page up and down in the emacs
6247 prints the string. You can then page up and down in the emacs
6224 buffer itself. This is how the builtin help() works.
6248 buffer itself. This is how the builtin help() works.
6225
6249
6226 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6250 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6227 macro scoping: macros need to be executed in the user's namespace
6251 macro scoping: macros need to be executed in the user's namespace
6228 to work as if they had been typed by the user.
6252 to work as if they had been typed by the user.
6229
6253
6230 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6254 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6231 execute automatically (no need to type 'exec...'). They then
6255 execute automatically (no need to type 'exec...'). They then
6232 behave like 'true macros'. The printing system was also modified
6256 behave like 'true macros'. The printing system was also modified
6233 for this to work.
6257 for this to work.
6234
6258
6235 2002-02-19 Fernando Perez <fperez@colorado.edu>
6259 2002-02-19 Fernando Perez <fperez@colorado.edu>
6236
6260
6237 * IPython/genutils.py (page_file): new function for paging files
6261 * IPython/genutils.py (page_file): new function for paging files
6238 in an OS-independent way. Also necessary for file viewing to work
6262 in an OS-independent way. Also necessary for file viewing to work
6239 well inside Emacs buffers.
6263 well inside Emacs buffers.
6240 (page): Added checks for being in an emacs buffer.
6264 (page): Added checks for being in an emacs buffer.
6241 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6265 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6242 same bug in iplib.
6266 same bug in iplib.
6243
6267
6244 2002-02-18 Fernando Perez <fperez@colorado.edu>
6268 2002-02-18 Fernando Perez <fperez@colorado.edu>
6245
6269
6246 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6270 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6247 of readline so that IPython can work inside an Emacs buffer.
6271 of readline so that IPython can work inside an Emacs buffer.
6248
6272
6249 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6273 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6250 method signatures (they weren't really bugs, but it looks cleaner
6274 method signatures (they weren't really bugs, but it looks cleaner
6251 and keeps PyChecker happy).
6275 and keeps PyChecker happy).
6252
6276
6253 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6277 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6254 for implementing various user-defined hooks. Currently only
6278 for implementing various user-defined hooks. Currently only
6255 display is done.
6279 display is done.
6256
6280
6257 * IPython/Prompts.py (CachedOutput._display): changed display
6281 * IPython/Prompts.py (CachedOutput._display): changed display
6258 functions so that they can be dynamically changed by users easily.
6282 functions so that they can be dynamically changed by users easily.
6259
6283
6260 * IPython/Extensions/numeric_formats.py (num_display): added an
6284 * IPython/Extensions/numeric_formats.py (num_display): added an
6261 extension for printing NumPy arrays in flexible manners. It
6285 extension for printing NumPy arrays in flexible manners. It
6262 doesn't do anything yet, but all the structure is in
6286 doesn't do anything yet, but all the structure is in
6263 place. Ultimately the plan is to implement output format control
6287 place. Ultimately the plan is to implement output format control
6264 like in Octave.
6288 like in Octave.
6265
6289
6266 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6290 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6267 methods are found at run-time by all the automatic machinery.
6291 methods are found at run-time by all the automatic machinery.
6268
6292
6269 2002-02-17 Fernando Perez <fperez@colorado.edu>
6293 2002-02-17 Fernando Perez <fperez@colorado.edu>
6270
6294
6271 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6295 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6272 whole file a little.
6296 whole file a little.
6273
6297
6274 * ToDo: closed this document. Now there's a new_design.lyx
6298 * ToDo: closed this document. Now there's a new_design.lyx
6275 document for all new ideas. Added making a pdf of it for the
6299 document for all new ideas. Added making a pdf of it for the
6276 end-user distro.
6300 end-user distro.
6277
6301
6278 * IPython/Logger.py (Logger.switch_log): Created this to replace
6302 * IPython/Logger.py (Logger.switch_log): Created this to replace
6279 logon() and logoff(). It also fixes a nasty crash reported by
6303 logon() and logoff(). It also fixes a nasty crash reported by
6280 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6304 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6281
6305
6282 * IPython/iplib.py (complete): got auto-completion to work with
6306 * IPython/iplib.py (complete): got auto-completion to work with
6283 automagic (I had wanted this for a long time).
6307 automagic (I had wanted this for a long time).
6284
6308
6285 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6309 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6286 to @file, since file() is now a builtin and clashes with automagic
6310 to @file, since file() is now a builtin and clashes with automagic
6287 for @file.
6311 for @file.
6288
6312
6289 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6313 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6290 of this was previously in iplib, which had grown to more than 2000
6314 of this was previously in iplib, which had grown to more than 2000
6291 lines, way too long. No new functionality, but it makes managing
6315 lines, way too long. No new functionality, but it makes managing
6292 the code a bit easier.
6316 the code a bit easier.
6293
6317
6294 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6318 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6295 information to crash reports.
6319 information to crash reports.
6296
6320
6297 2002-02-12 Fernando Perez <fperez@colorado.edu>
6321 2002-02-12 Fernando Perez <fperez@colorado.edu>
6298
6322
6299 * Released 0.2.5.
6323 * Released 0.2.5.
6300
6324
6301 2002-02-11 Fernando Perez <fperez@colorado.edu>
6325 2002-02-11 Fernando Perez <fperez@colorado.edu>
6302
6326
6303 * Wrote a relatively complete Windows installer. It puts
6327 * Wrote a relatively complete Windows installer. It puts
6304 everything in place, creates Start Menu entries and fixes the
6328 everything in place, creates Start Menu entries and fixes the
6305 color issues. Nothing fancy, but it works.
6329 color issues. Nothing fancy, but it works.
6306
6330
6307 2002-02-10 Fernando Perez <fperez@colorado.edu>
6331 2002-02-10 Fernando Perez <fperez@colorado.edu>
6308
6332
6309 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6333 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6310 os.path.expanduser() call so that we can type @run ~/myfile.py and
6334 os.path.expanduser() call so that we can type @run ~/myfile.py and
6311 have thigs work as expected.
6335 have thigs work as expected.
6312
6336
6313 * IPython/genutils.py (page): fixed exception handling so things
6337 * IPython/genutils.py (page): fixed exception handling so things
6314 work both in Unix and Windows correctly. Quitting a pager triggers
6338 work both in Unix and Windows correctly. Quitting a pager triggers
6315 an IOError/broken pipe in Unix, and in windows not finding a pager
6339 an IOError/broken pipe in Unix, and in windows not finding a pager
6316 is also an IOError, so I had to actually look at the return value
6340 is also an IOError, so I had to actually look at the return value
6317 of the exception, not just the exception itself. Should be ok now.
6341 of the exception, not just the exception itself. Should be ok now.
6318
6342
6319 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6343 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6320 modified to allow case-insensitive color scheme changes.
6344 modified to allow case-insensitive color scheme changes.
6321
6345
6322 2002-02-09 Fernando Perez <fperez@colorado.edu>
6346 2002-02-09 Fernando Perez <fperez@colorado.edu>
6323
6347
6324 * IPython/genutils.py (native_line_ends): new function to leave
6348 * IPython/genutils.py (native_line_ends): new function to leave
6325 user config files with os-native line-endings.
6349 user config files with os-native line-endings.
6326
6350
6327 * README and manual updates.
6351 * README and manual updates.
6328
6352
6329 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6353 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6330 instead of StringType to catch Unicode strings.
6354 instead of StringType to catch Unicode strings.
6331
6355
6332 * IPython/genutils.py (filefind): fixed bug for paths with
6356 * IPython/genutils.py (filefind): fixed bug for paths with
6333 embedded spaces (very common in Windows).
6357 embedded spaces (very common in Windows).
6334
6358
6335 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6359 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6336 files under Windows, so that they get automatically associated
6360 files under Windows, so that they get automatically associated
6337 with a text editor. Windows makes it a pain to handle
6361 with a text editor. Windows makes it a pain to handle
6338 extension-less files.
6362 extension-less files.
6339
6363
6340 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6364 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6341 warning about readline only occur for Posix. In Windows there's no
6365 warning about readline only occur for Posix. In Windows there's no
6342 way to get readline, so why bother with the warning.
6366 way to get readline, so why bother with the warning.
6343
6367
6344 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6368 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6345 for __str__ instead of dir(self), since dir() changed in 2.2.
6369 for __str__ instead of dir(self), since dir() changed in 2.2.
6346
6370
6347 * Ported to Windows! Tested on XP, I suspect it should work fine
6371 * Ported to Windows! Tested on XP, I suspect it should work fine
6348 on NT/2000, but I don't think it will work on 98 et al. That
6372 on NT/2000, but I don't think it will work on 98 et al. That
6349 series of Windows is such a piece of junk anyway that I won't try
6373 series of Windows is such a piece of junk anyway that I won't try
6350 porting it there. The XP port was straightforward, showed a few
6374 porting it there. The XP port was straightforward, showed a few
6351 bugs here and there (fixed all), in particular some string
6375 bugs here and there (fixed all), in particular some string
6352 handling stuff which required considering Unicode strings (which
6376 handling stuff which required considering Unicode strings (which
6353 Windows uses). This is good, but hasn't been too tested :) No
6377 Windows uses). This is good, but hasn't been too tested :) No
6354 fancy installer yet, I'll put a note in the manual so people at
6378 fancy installer yet, I'll put a note in the manual so people at
6355 least make manually a shortcut.
6379 least make manually a shortcut.
6356
6380
6357 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6381 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6358 into a single one, "colors". This now controls both prompt and
6382 into a single one, "colors". This now controls both prompt and
6359 exception color schemes, and can be changed both at startup
6383 exception color schemes, and can be changed both at startup
6360 (either via command-line switches or via ipythonrc files) and at
6384 (either via command-line switches or via ipythonrc files) and at
6361 runtime, with @colors.
6385 runtime, with @colors.
6362 (Magic.magic_run): renamed @prun to @run and removed the old
6386 (Magic.magic_run): renamed @prun to @run and removed the old
6363 @run. The two were too similar to warrant keeping both.
6387 @run. The two were too similar to warrant keeping both.
6364
6388
6365 2002-02-03 Fernando Perez <fperez@colorado.edu>
6389 2002-02-03 Fernando Perez <fperez@colorado.edu>
6366
6390
6367 * IPython/iplib.py (install_first_time): Added comment on how to
6391 * IPython/iplib.py (install_first_time): Added comment on how to
6368 configure the color options for first-time users. Put a <return>
6392 configure the color options for first-time users. Put a <return>
6369 request at the end so that small-terminal users get a chance to
6393 request at the end so that small-terminal users get a chance to
6370 read the startup info.
6394 read the startup info.
6371
6395
6372 2002-01-23 Fernando Perez <fperez@colorado.edu>
6396 2002-01-23 Fernando Perez <fperez@colorado.edu>
6373
6397
6374 * IPython/iplib.py (CachedOutput.update): Changed output memory
6398 * IPython/iplib.py (CachedOutput.update): Changed output memory
6375 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6399 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6376 input history we still use _i. Did this b/c these variable are
6400 input history we still use _i. Did this b/c these variable are
6377 very commonly used in interactive work, so the less we need to
6401 very commonly used in interactive work, so the less we need to
6378 type the better off we are.
6402 type the better off we are.
6379 (Magic.magic_prun): updated @prun to better handle the namespaces
6403 (Magic.magic_prun): updated @prun to better handle the namespaces
6380 the file will run in, including a fix for __name__ not being set
6404 the file will run in, including a fix for __name__ not being set
6381 before.
6405 before.
6382
6406
6383 2002-01-20 Fernando Perez <fperez@colorado.edu>
6407 2002-01-20 Fernando Perez <fperez@colorado.edu>
6384
6408
6385 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6409 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6386 extra garbage for Python 2.2. Need to look more carefully into
6410 extra garbage for Python 2.2. Need to look more carefully into
6387 this later.
6411 this later.
6388
6412
6389 2002-01-19 Fernando Perez <fperez@colorado.edu>
6413 2002-01-19 Fernando Perez <fperez@colorado.edu>
6390
6414
6391 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6415 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6392 display SyntaxError exceptions properly formatted when they occur
6416 display SyntaxError exceptions properly formatted when they occur
6393 (they can be triggered by imported code).
6417 (they can be triggered by imported code).
6394
6418
6395 2002-01-18 Fernando Perez <fperez@colorado.edu>
6419 2002-01-18 Fernando Perez <fperez@colorado.edu>
6396
6420
6397 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6421 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6398 SyntaxError exceptions are reported nicely formatted, instead of
6422 SyntaxError exceptions are reported nicely formatted, instead of
6399 spitting out only offset information as before.
6423 spitting out only offset information as before.
6400 (Magic.magic_prun): Added the @prun function for executing
6424 (Magic.magic_prun): Added the @prun function for executing
6401 programs with command line args inside IPython.
6425 programs with command line args inside IPython.
6402
6426
6403 2002-01-16 Fernando Perez <fperez@colorado.edu>
6427 2002-01-16 Fernando Perez <fperez@colorado.edu>
6404
6428
6405 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6429 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6406 to *not* include the last item given in a range. This brings their
6430 to *not* include the last item given in a range. This brings their
6407 behavior in line with Python's slicing:
6431 behavior in line with Python's slicing:
6408 a[n1:n2] -> a[n1]...a[n2-1]
6432 a[n1:n2] -> a[n1]...a[n2-1]
6409 It may be a bit less convenient, but I prefer to stick to Python's
6433 It may be a bit less convenient, but I prefer to stick to Python's
6410 conventions *everywhere*, so users never have to wonder.
6434 conventions *everywhere*, so users never have to wonder.
6411 (Magic.magic_macro): Added @macro function to ease the creation of
6435 (Magic.magic_macro): Added @macro function to ease the creation of
6412 macros.
6436 macros.
6413
6437
6414 2002-01-05 Fernando Perez <fperez@colorado.edu>
6438 2002-01-05 Fernando Perez <fperez@colorado.edu>
6415
6439
6416 * Released 0.2.4.
6440 * Released 0.2.4.
6417
6441
6418 * IPython/iplib.py (Magic.magic_pdef):
6442 * IPython/iplib.py (Magic.magic_pdef):
6419 (InteractiveShell.safe_execfile): report magic lines and error
6443 (InteractiveShell.safe_execfile): report magic lines and error
6420 lines without line numbers so one can easily copy/paste them for
6444 lines without line numbers so one can easily copy/paste them for
6421 re-execution.
6445 re-execution.
6422
6446
6423 * Updated manual with recent changes.
6447 * Updated manual with recent changes.
6424
6448
6425 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6449 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6426 docstring printing when class? is called. Very handy for knowing
6450 docstring printing when class? is called. Very handy for knowing
6427 how to create class instances (as long as __init__ is well
6451 how to create class instances (as long as __init__ is well
6428 documented, of course :)
6452 documented, of course :)
6429 (Magic.magic_doc): print both class and constructor docstrings.
6453 (Magic.magic_doc): print both class and constructor docstrings.
6430 (Magic.magic_pdef): give constructor info if passed a class and
6454 (Magic.magic_pdef): give constructor info if passed a class and
6431 __call__ info for callable object instances.
6455 __call__ info for callable object instances.
6432
6456
6433 2002-01-04 Fernando Perez <fperez@colorado.edu>
6457 2002-01-04 Fernando Perez <fperez@colorado.edu>
6434
6458
6435 * Made deep_reload() off by default. It doesn't always work
6459 * Made deep_reload() off by default. It doesn't always work
6436 exactly as intended, so it's probably safer to have it off. It's
6460 exactly as intended, so it's probably safer to have it off. It's
6437 still available as dreload() anyway, so nothing is lost.
6461 still available as dreload() anyway, so nothing is lost.
6438
6462
6439 2002-01-02 Fernando Perez <fperez@colorado.edu>
6463 2002-01-02 Fernando Perez <fperez@colorado.edu>
6440
6464
6441 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6465 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6442 so I wanted an updated release).
6466 so I wanted an updated release).
6443
6467
6444 2001-12-27 Fernando Perez <fperez@colorado.edu>
6468 2001-12-27 Fernando Perez <fperez@colorado.edu>
6445
6469
6446 * IPython/iplib.py (InteractiveShell.interact): Added the original
6470 * IPython/iplib.py (InteractiveShell.interact): Added the original
6447 code from 'code.py' for this module in order to change the
6471 code from 'code.py' for this module in order to change the
6448 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6472 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6449 the history cache would break when the user hit Ctrl-C, and
6473 the history cache would break when the user hit Ctrl-C, and
6450 interact() offers no way to add any hooks to it.
6474 interact() offers no way to add any hooks to it.
6451
6475
6452 2001-12-23 Fernando Perez <fperez@colorado.edu>
6476 2001-12-23 Fernando Perez <fperez@colorado.edu>
6453
6477
6454 * setup.py: added check for 'MANIFEST' before trying to remove
6478 * setup.py: added check for 'MANIFEST' before trying to remove
6455 it. Thanks to Sean Reifschneider.
6479 it. Thanks to Sean Reifschneider.
6456
6480
6457 2001-12-22 Fernando Perez <fperez@colorado.edu>
6481 2001-12-22 Fernando Perez <fperez@colorado.edu>
6458
6482
6459 * Released 0.2.2.
6483 * Released 0.2.2.
6460
6484
6461 * Finished (reasonably) writing the manual. Later will add the
6485 * Finished (reasonably) writing the manual. Later will add the
6462 python-standard navigation stylesheets, but for the time being
6486 python-standard navigation stylesheets, but for the time being
6463 it's fairly complete. Distribution will include html and pdf
6487 it's fairly complete. Distribution will include html and pdf
6464 versions.
6488 versions.
6465
6489
6466 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6490 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6467 (MayaVi author).
6491 (MayaVi author).
6468
6492
6469 2001-12-21 Fernando Perez <fperez@colorado.edu>
6493 2001-12-21 Fernando Perez <fperez@colorado.edu>
6470
6494
6471 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6495 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6472 good public release, I think (with the manual and the distutils
6496 good public release, I think (with the manual and the distutils
6473 installer). The manual can use some work, but that can go
6497 installer). The manual can use some work, but that can go
6474 slowly. Otherwise I think it's quite nice for end users. Next
6498 slowly. Otherwise I think it's quite nice for end users. Next
6475 summer, rewrite the guts of it...
6499 summer, rewrite the guts of it...
6476
6500
6477 * Changed format of ipythonrc files to use whitespace as the
6501 * Changed format of ipythonrc files to use whitespace as the
6478 separator instead of an explicit '='. Cleaner.
6502 separator instead of an explicit '='. Cleaner.
6479
6503
6480 2001-12-20 Fernando Perez <fperez@colorado.edu>
6504 2001-12-20 Fernando Perez <fperez@colorado.edu>
6481
6505
6482 * Started a manual in LyX. For now it's just a quick merge of the
6506 * Started a manual in LyX. For now it's just a quick merge of the
6483 various internal docstrings and READMEs. Later it may grow into a
6507 various internal docstrings and READMEs. Later it may grow into a
6484 nice, full-blown manual.
6508 nice, full-blown manual.
6485
6509
6486 * Set up a distutils based installer. Installation should now be
6510 * Set up a distutils based installer. Installation should now be
6487 trivially simple for end-users.
6511 trivially simple for end-users.
6488
6512
6489 2001-12-11 Fernando Perez <fperez@colorado.edu>
6513 2001-12-11 Fernando Perez <fperez@colorado.edu>
6490
6514
6491 * Released 0.2.0. First public release, announced it at
6515 * Released 0.2.0. First public release, announced it at
6492 comp.lang.python. From now on, just bugfixes...
6516 comp.lang.python. From now on, just bugfixes...
6493
6517
6494 * Went through all the files, set copyright/license notices and
6518 * Went through all the files, set copyright/license notices and
6495 cleaned up things. Ready for release.
6519 cleaned up things. Ready for release.
6496
6520
6497 2001-12-10 Fernando Perez <fperez@colorado.edu>
6521 2001-12-10 Fernando Perez <fperez@colorado.edu>
6498
6522
6499 * Changed the first-time installer not to use tarfiles. It's more
6523 * Changed the first-time installer not to use tarfiles. It's more
6500 robust now and less unix-dependent. Also makes it easier for
6524 robust now and less unix-dependent. Also makes it easier for
6501 people to later upgrade versions.
6525 people to later upgrade versions.
6502
6526
6503 * Changed @exit to @abort to reflect the fact that it's pretty
6527 * Changed @exit to @abort to reflect the fact that it's pretty
6504 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6528 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6505 becomes significant only when IPyhton is embedded: in that case,
6529 becomes significant only when IPyhton is embedded: in that case,
6506 C-D closes IPython only, but @abort kills the enclosing program
6530 C-D closes IPython only, but @abort kills the enclosing program
6507 too (unless it had called IPython inside a try catching
6531 too (unless it had called IPython inside a try catching
6508 SystemExit).
6532 SystemExit).
6509
6533
6510 * Created Shell module which exposes the actuall IPython Shell
6534 * Created Shell module which exposes the actuall IPython Shell
6511 classes, currently the normal and the embeddable one. This at
6535 classes, currently the normal and the embeddable one. This at
6512 least offers a stable interface we won't need to change when
6536 least offers a stable interface we won't need to change when
6513 (later) the internals are rewritten. That rewrite will be confined
6537 (later) the internals are rewritten. That rewrite will be confined
6514 to iplib and ipmaker, but the Shell interface should remain as is.
6538 to iplib and ipmaker, but the Shell interface should remain as is.
6515
6539
6516 * Added embed module which offers an embeddable IPShell object,
6540 * Added embed module which offers an embeddable IPShell object,
6517 useful to fire up IPython *inside* a running program. Great for
6541 useful to fire up IPython *inside* a running program. Great for
6518 debugging or dynamical data analysis.
6542 debugging or dynamical data analysis.
6519
6543
6520 2001-12-08 Fernando Perez <fperez@colorado.edu>
6544 2001-12-08 Fernando Perez <fperez@colorado.edu>
6521
6545
6522 * Fixed small bug preventing seeing info from methods of defined
6546 * Fixed small bug preventing seeing info from methods of defined
6523 objects (incorrect namespace in _ofind()).
6547 objects (incorrect namespace in _ofind()).
6524
6548
6525 * Documentation cleanup. Moved the main usage docstrings to a
6549 * Documentation cleanup. Moved the main usage docstrings to a
6526 separate file, usage.py (cleaner to maintain, and hopefully in the
6550 separate file, usage.py (cleaner to maintain, and hopefully in the
6527 future some perlpod-like way of producing interactive, man and
6551 future some perlpod-like way of producing interactive, man and
6528 html docs out of it will be found).
6552 html docs out of it will be found).
6529
6553
6530 * Added @profile to see your profile at any time.
6554 * Added @profile to see your profile at any time.
6531
6555
6532 * Added @p as an alias for 'print'. It's especially convenient if
6556 * Added @p as an alias for 'print'. It's especially convenient if
6533 using automagic ('p x' prints x).
6557 using automagic ('p x' prints x).
6534
6558
6535 * Small cleanups and fixes after a pychecker run.
6559 * Small cleanups and fixes after a pychecker run.
6536
6560
6537 * Changed the @cd command to handle @cd - and @cd -<n> for
6561 * Changed the @cd command to handle @cd - and @cd -<n> for
6538 visiting any directory in _dh.
6562 visiting any directory in _dh.
6539
6563
6540 * Introduced _dh, a history of visited directories. @dhist prints
6564 * Introduced _dh, a history of visited directories. @dhist prints
6541 it out with numbers.
6565 it out with numbers.
6542
6566
6543 2001-12-07 Fernando Perez <fperez@colorado.edu>
6567 2001-12-07 Fernando Perez <fperez@colorado.edu>
6544
6568
6545 * Released 0.1.22
6569 * Released 0.1.22
6546
6570
6547 * Made initialization a bit more robust against invalid color
6571 * Made initialization a bit more robust against invalid color
6548 options in user input (exit, not traceback-crash).
6572 options in user input (exit, not traceback-crash).
6549
6573
6550 * Changed the bug crash reporter to write the report only in the
6574 * Changed the bug crash reporter to write the report only in the
6551 user's .ipython directory. That way IPython won't litter people's
6575 user's .ipython directory. That way IPython won't litter people's
6552 hard disks with crash files all over the place. Also print on
6576 hard disks with crash files all over the place. Also print on
6553 screen the necessary mail command.
6577 screen the necessary mail command.
6554
6578
6555 * With the new ultraTB, implemented LightBG color scheme for light
6579 * With the new ultraTB, implemented LightBG color scheme for light
6556 background terminals. A lot of people like white backgrounds, so I
6580 background terminals. A lot of people like white backgrounds, so I
6557 guess we should at least give them something readable.
6581 guess we should at least give them something readable.
6558
6582
6559 2001-12-06 Fernando Perez <fperez@colorado.edu>
6583 2001-12-06 Fernando Perez <fperez@colorado.edu>
6560
6584
6561 * Modified the structure of ultraTB. Now there's a proper class
6585 * Modified the structure of ultraTB. Now there's a proper class
6562 for tables of color schemes which allow adding schemes easily and
6586 for tables of color schemes which allow adding schemes easily and
6563 switching the active scheme without creating a new instance every
6587 switching the active scheme without creating a new instance every
6564 time (which was ridiculous). The syntax for creating new schemes
6588 time (which was ridiculous). The syntax for creating new schemes
6565 is also cleaner. I think ultraTB is finally done, with a clean
6589 is also cleaner. I think ultraTB is finally done, with a clean
6566 class structure. Names are also much cleaner (now there's proper
6590 class structure. Names are also much cleaner (now there's proper
6567 color tables, no need for every variable to also have 'color' in
6591 color tables, no need for every variable to also have 'color' in
6568 its name).
6592 its name).
6569
6593
6570 * Broke down genutils into separate files. Now genutils only
6594 * Broke down genutils into separate files. Now genutils only
6571 contains utility functions, and classes have been moved to their
6595 contains utility functions, and classes have been moved to their
6572 own files (they had enough independent functionality to warrant
6596 own files (they had enough independent functionality to warrant
6573 it): ConfigLoader, OutputTrap, Struct.
6597 it): ConfigLoader, OutputTrap, Struct.
6574
6598
6575 2001-12-05 Fernando Perez <fperez@colorado.edu>
6599 2001-12-05 Fernando Perez <fperez@colorado.edu>
6576
6600
6577 * IPython turns 21! Released version 0.1.21, as a candidate for
6601 * IPython turns 21! Released version 0.1.21, as a candidate for
6578 public consumption. If all goes well, release in a few days.
6602 public consumption. If all goes well, release in a few days.
6579
6603
6580 * Fixed path bug (files in Extensions/ directory wouldn't be found
6604 * Fixed path bug (files in Extensions/ directory wouldn't be found
6581 unless IPython/ was explicitly in sys.path).
6605 unless IPython/ was explicitly in sys.path).
6582
6606
6583 * Extended the FlexCompleter class as MagicCompleter to allow
6607 * Extended the FlexCompleter class as MagicCompleter to allow
6584 completion of @-starting lines.
6608 completion of @-starting lines.
6585
6609
6586 * Created __release__.py file as a central repository for release
6610 * Created __release__.py file as a central repository for release
6587 info that other files can read from.
6611 info that other files can read from.
6588
6612
6589 * Fixed small bug in logging: when logging was turned on in
6613 * Fixed small bug in logging: when logging was turned on in
6590 mid-session, old lines with special meanings (!@?) were being
6614 mid-session, old lines with special meanings (!@?) were being
6591 logged without the prepended comment, which is necessary since
6615 logged without the prepended comment, which is necessary since
6592 they are not truly valid python syntax. This should make session
6616 they are not truly valid python syntax. This should make session
6593 restores produce less errors.
6617 restores produce less errors.
6594
6618
6595 * The namespace cleanup forced me to make a FlexCompleter class
6619 * The namespace cleanup forced me to make a FlexCompleter class
6596 which is nothing but a ripoff of rlcompleter, but with selectable
6620 which is nothing but a ripoff of rlcompleter, but with selectable
6597 namespace (rlcompleter only works in __main__.__dict__). I'll try
6621 namespace (rlcompleter only works in __main__.__dict__). I'll try
6598 to submit a note to the authors to see if this change can be
6622 to submit a note to the authors to see if this change can be
6599 incorporated in future rlcompleter releases (Dec.6: done)
6623 incorporated in future rlcompleter releases (Dec.6: done)
6600
6624
6601 * More fixes to namespace handling. It was a mess! Now all
6625 * More fixes to namespace handling. It was a mess! Now all
6602 explicit references to __main__.__dict__ are gone (except when
6626 explicit references to __main__.__dict__ are gone (except when
6603 really needed) and everything is handled through the namespace
6627 really needed) and everything is handled through the namespace
6604 dicts in the IPython instance. We seem to be getting somewhere
6628 dicts in the IPython instance. We seem to be getting somewhere
6605 with this, finally...
6629 with this, finally...
6606
6630
6607 * Small documentation updates.
6631 * Small documentation updates.
6608
6632
6609 * Created the Extensions directory under IPython (with an
6633 * Created the Extensions directory under IPython (with an
6610 __init__.py). Put the PhysicalQ stuff there. This directory should
6634 __init__.py). Put the PhysicalQ stuff there. This directory should
6611 be used for all special-purpose extensions.
6635 be used for all special-purpose extensions.
6612
6636
6613 * File renaming:
6637 * File renaming:
6614 ipythonlib --> ipmaker
6638 ipythonlib --> ipmaker
6615 ipplib --> iplib
6639 ipplib --> iplib
6616 This makes a bit more sense in terms of what these files actually do.
6640 This makes a bit more sense in terms of what these files actually do.
6617
6641
6618 * Moved all the classes and functions in ipythonlib to ipplib, so
6642 * Moved all the classes and functions in ipythonlib to ipplib, so
6619 now ipythonlib only has make_IPython(). This will ease up its
6643 now ipythonlib only has make_IPython(). This will ease up its
6620 splitting in smaller functional chunks later.
6644 splitting in smaller functional chunks later.
6621
6645
6622 * Cleaned up (done, I think) output of @whos. Better column
6646 * Cleaned up (done, I think) output of @whos. Better column
6623 formatting, and now shows str(var) for as much as it can, which is
6647 formatting, and now shows str(var) for as much as it can, which is
6624 typically what one gets with a 'print var'.
6648 typically what one gets with a 'print var'.
6625
6649
6626 2001-12-04 Fernando Perez <fperez@colorado.edu>
6650 2001-12-04 Fernando Perez <fperez@colorado.edu>
6627
6651
6628 * Fixed namespace problems. Now builtin/IPyhton/user names get
6652 * Fixed namespace problems. Now builtin/IPyhton/user names get
6629 properly reported in their namespace. Internal namespace handling
6653 properly reported in their namespace. Internal namespace handling
6630 is finally getting decent (not perfect yet, but much better than
6654 is finally getting decent (not perfect yet, but much better than
6631 the ad-hoc mess we had).
6655 the ad-hoc mess we had).
6632
6656
6633 * Removed -exit option. If people just want to run a python
6657 * Removed -exit option. If people just want to run a python
6634 script, that's what the normal interpreter is for. Less
6658 script, that's what the normal interpreter is for. Less
6635 unnecessary options, less chances for bugs.
6659 unnecessary options, less chances for bugs.
6636
6660
6637 * Added a crash handler which generates a complete post-mortem if
6661 * Added a crash handler which generates a complete post-mortem if
6638 IPython crashes. This will help a lot in tracking bugs down the
6662 IPython crashes. This will help a lot in tracking bugs down the
6639 road.
6663 road.
6640
6664
6641 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6665 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6642 which were boud to functions being reassigned would bypass the
6666 which were boud to functions being reassigned would bypass the
6643 logger, breaking the sync of _il with the prompt counter. This
6667 logger, breaking the sync of _il with the prompt counter. This
6644 would then crash IPython later when a new line was logged.
6668 would then crash IPython later when a new line was logged.
6645
6669
6646 2001-12-02 Fernando Perez <fperez@colorado.edu>
6670 2001-12-02 Fernando Perez <fperez@colorado.edu>
6647
6671
6648 * Made IPython a package. This means people don't have to clutter
6672 * Made IPython a package. This means people don't have to clutter
6649 their sys.path with yet another directory. Changed the INSTALL
6673 their sys.path with yet another directory. Changed the INSTALL
6650 file accordingly.
6674 file accordingly.
6651
6675
6652 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6676 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6653 sorts its output (so @who shows it sorted) and @whos formats the
6677 sorts its output (so @who shows it sorted) and @whos formats the
6654 table according to the width of the first column. Nicer, easier to
6678 table according to the width of the first column. Nicer, easier to
6655 read. Todo: write a generic table_format() which takes a list of
6679 read. Todo: write a generic table_format() which takes a list of
6656 lists and prints it nicely formatted, with optional row/column
6680 lists and prints it nicely formatted, with optional row/column
6657 separators and proper padding and justification.
6681 separators and proper padding and justification.
6658
6682
6659 * Released 0.1.20
6683 * Released 0.1.20
6660
6684
6661 * Fixed bug in @log which would reverse the inputcache list (a
6685 * Fixed bug in @log which would reverse the inputcache list (a
6662 copy operation was missing).
6686 copy operation was missing).
6663
6687
6664 * Code cleanup. @config was changed to use page(). Better, since
6688 * Code cleanup. @config was changed to use page(). Better, since
6665 its output is always quite long.
6689 its output is always quite long.
6666
6690
6667 * Itpl is back as a dependency. I was having too many problems
6691 * Itpl is back as a dependency. I was having too many problems
6668 getting the parametric aliases to work reliably, and it's just
6692 getting the parametric aliases to work reliably, and it's just
6669 easier to code weird string operations with it than playing %()s
6693 easier to code weird string operations with it than playing %()s
6670 games. It's only ~6k, so I don't think it's too big a deal.
6694 games. It's only ~6k, so I don't think it's too big a deal.
6671
6695
6672 * Found (and fixed) a very nasty bug with history. !lines weren't
6696 * Found (and fixed) a very nasty bug with history. !lines weren't
6673 getting cached, and the out of sync caches would crash
6697 getting cached, and the out of sync caches would crash
6674 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6698 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6675 division of labor a bit better. Bug fixed, cleaner structure.
6699 division of labor a bit better. Bug fixed, cleaner structure.
6676
6700
6677 2001-12-01 Fernando Perez <fperez@colorado.edu>
6701 2001-12-01 Fernando Perez <fperez@colorado.edu>
6678
6702
6679 * Released 0.1.19
6703 * Released 0.1.19
6680
6704
6681 * Added option -n to @hist to prevent line number printing. Much
6705 * Added option -n to @hist to prevent line number printing. Much
6682 easier to copy/paste code this way.
6706 easier to copy/paste code this way.
6683
6707
6684 * Created global _il to hold the input list. Allows easy
6708 * Created global _il to hold the input list. Allows easy
6685 re-execution of blocks of code by slicing it (inspired by Janko's
6709 re-execution of blocks of code by slicing it (inspired by Janko's
6686 comment on 'macros').
6710 comment on 'macros').
6687
6711
6688 * Small fixes and doc updates.
6712 * Small fixes and doc updates.
6689
6713
6690 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6714 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6691 much too fragile with automagic. Handles properly multi-line
6715 much too fragile with automagic. Handles properly multi-line
6692 statements and takes parameters.
6716 statements and takes parameters.
6693
6717
6694 2001-11-30 Fernando Perez <fperez@colorado.edu>
6718 2001-11-30 Fernando Perez <fperez@colorado.edu>
6695
6719
6696 * Version 0.1.18 released.
6720 * Version 0.1.18 released.
6697
6721
6698 * Fixed nasty namespace bug in initial module imports.
6722 * Fixed nasty namespace bug in initial module imports.
6699
6723
6700 * Added copyright/license notes to all code files (except
6724 * Added copyright/license notes to all code files (except
6701 DPyGetOpt). For the time being, LGPL. That could change.
6725 DPyGetOpt). For the time being, LGPL. That could change.
6702
6726
6703 * Rewrote a much nicer README, updated INSTALL, cleaned up
6727 * Rewrote a much nicer README, updated INSTALL, cleaned up
6704 ipythonrc-* samples.
6728 ipythonrc-* samples.
6705
6729
6706 * Overall code/documentation cleanup. Basically ready for
6730 * Overall code/documentation cleanup. Basically ready for
6707 release. Only remaining thing: licence decision (LGPL?).
6731 release. Only remaining thing: licence decision (LGPL?).
6708
6732
6709 * Converted load_config to a class, ConfigLoader. Now recursion
6733 * Converted load_config to a class, ConfigLoader. Now recursion
6710 control is better organized. Doesn't include the same file twice.
6734 control is better organized. Doesn't include the same file twice.
6711
6735
6712 2001-11-29 Fernando Perez <fperez@colorado.edu>
6736 2001-11-29 Fernando Perez <fperez@colorado.edu>
6713
6737
6714 * Got input history working. Changed output history variables from
6738 * Got input history working. Changed output history variables from
6715 _p to _o so that _i is for input and _o for output. Just cleaner
6739 _p to _o so that _i is for input and _o for output. Just cleaner
6716 convention.
6740 convention.
6717
6741
6718 * Implemented parametric aliases. This pretty much allows the
6742 * Implemented parametric aliases. This pretty much allows the
6719 alias system to offer full-blown shell convenience, I think.
6743 alias system to offer full-blown shell convenience, I think.
6720
6744
6721 * Version 0.1.17 released, 0.1.18 opened.
6745 * Version 0.1.17 released, 0.1.18 opened.
6722
6746
6723 * dot_ipython/ipythonrc (alias): added documentation.
6747 * dot_ipython/ipythonrc (alias): added documentation.
6724 (xcolor): Fixed small bug (xcolors -> xcolor)
6748 (xcolor): Fixed small bug (xcolors -> xcolor)
6725
6749
6726 * Changed the alias system. Now alias is a magic command to define
6750 * Changed the alias system. Now alias is a magic command to define
6727 aliases just like the shell. Rationale: the builtin magics should
6751 aliases just like the shell. Rationale: the builtin magics should
6728 be there for things deeply connected to IPython's
6752 be there for things deeply connected to IPython's
6729 architecture. And this is a much lighter system for what I think
6753 architecture. And this is a much lighter system for what I think
6730 is the really important feature: allowing users to define quickly
6754 is the really important feature: allowing users to define quickly
6731 magics that will do shell things for them, so they can customize
6755 magics that will do shell things for them, so they can customize
6732 IPython easily to match their work habits. If someone is really
6756 IPython easily to match their work habits. If someone is really
6733 desperate to have another name for a builtin alias, they can
6757 desperate to have another name for a builtin alias, they can
6734 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6758 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6735 works.
6759 works.
6736
6760
6737 2001-11-28 Fernando Perez <fperez@colorado.edu>
6761 2001-11-28 Fernando Perez <fperez@colorado.edu>
6738
6762
6739 * Changed @file so that it opens the source file at the proper
6763 * Changed @file so that it opens the source file at the proper
6740 line. Since it uses less, if your EDITOR environment is
6764 line. Since it uses less, if your EDITOR environment is
6741 configured, typing v will immediately open your editor of choice
6765 configured, typing v will immediately open your editor of choice
6742 right at the line where the object is defined. Not as quick as
6766 right at the line where the object is defined. Not as quick as
6743 having a direct @edit command, but for all intents and purposes it
6767 having a direct @edit command, but for all intents and purposes it
6744 works. And I don't have to worry about writing @edit to deal with
6768 works. And I don't have to worry about writing @edit to deal with
6745 all the editors, less does that.
6769 all the editors, less does that.
6746
6770
6747 * Version 0.1.16 released, 0.1.17 opened.
6771 * Version 0.1.16 released, 0.1.17 opened.
6748
6772
6749 * Fixed some nasty bugs in the page/page_dumb combo that could
6773 * Fixed some nasty bugs in the page/page_dumb combo that could
6750 crash IPython.
6774 crash IPython.
6751
6775
6752 2001-11-27 Fernando Perez <fperez@colorado.edu>
6776 2001-11-27 Fernando Perez <fperez@colorado.edu>
6753
6777
6754 * Version 0.1.15 released, 0.1.16 opened.
6778 * Version 0.1.15 released, 0.1.16 opened.
6755
6779
6756 * Finally got ? and ?? to work for undefined things: now it's
6780 * Finally got ? and ?? to work for undefined things: now it's
6757 possible to type {}.get? and get information about the get method
6781 possible to type {}.get? and get information about the get method
6758 of dicts, or os.path? even if only os is defined (so technically
6782 of dicts, or os.path? even if only os is defined (so technically
6759 os.path isn't). Works at any level. For example, after import os,
6783 os.path isn't). Works at any level. For example, after import os,
6760 os?, os.path?, os.path.abspath? all work. This is great, took some
6784 os?, os.path?, os.path.abspath? all work. This is great, took some
6761 work in _ofind.
6785 work in _ofind.
6762
6786
6763 * Fixed more bugs with logging. The sanest way to do it was to add
6787 * Fixed more bugs with logging. The sanest way to do it was to add
6764 to @log a 'mode' parameter. Killed two in one shot (this mode
6788 to @log a 'mode' parameter. Killed two in one shot (this mode
6765 option was a request of Janko's). I think it's finally clean
6789 option was a request of Janko's). I think it's finally clean
6766 (famous last words).
6790 (famous last words).
6767
6791
6768 * Added a page_dumb() pager which does a decent job of paging on
6792 * Added a page_dumb() pager which does a decent job of paging on
6769 screen, if better things (like less) aren't available. One less
6793 screen, if better things (like less) aren't available. One less
6770 unix dependency (someday maybe somebody will port this to
6794 unix dependency (someday maybe somebody will port this to
6771 windows).
6795 windows).
6772
6796
6773 * Fixed problem in magic_log: would lock of logging out if log
6797 * Fixed problem in magic_log: would lock of logging out if log
6774 creation failed (because it would still think it had succeeded).
6798 creation failed (because it would still think it had succeeded).
6775
6799
6776 * Improved the page() function using curses to auto-detect screen
6800 * Improved the page() function using curses to auto-detect screen
6777 size. Now it can make a much better decision on whether to print
6801 size. Now it can make a much better decision on whether to print
6778 or page a string. Option screen_length was modified: a value 0
6802 or page a string. Option screen_length was modified: a value 0
6779 means auto-detect, and that's the default now.
6803 means auto-detect, and that's the default now.
6780
6804
6781 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6805 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6782 go out. I'll test it for a few days, then talk to Janko about
6806 go out. I'll test it for a few days, then talk to Janko about
6783 licences and announce it.
6807 licences and announce it.
6784
6808
6785 * Fixed the length of the auto-generated ---> prompt which appears
6809 * Fixed the length of the auto-generated ---> prompt which appears
6786 for auto-parens and auto-quotes. Getting this right isn't trivial,
6810 for auto-parens and auto-quotes. Getting this right isn't trivial,
6787 with all the color escapes, different prompt types and optional
6811 with all the color escapes, different prompt types and optional
6788 separators. But it seems to be working in all the combinations.
6812 separators. But it seems to be working in all the combinations.
6789
6813
6790 2001-11-26 Fernando Perez <fperez@colorado.edu>
6814 2001-11-26 Fernando Perez <fperez@colorado.edu>
6791
6815
6792 * Wrote a regexp filter to get option types from the option names
6816 * Wrote a regexp filter to get option types from the option names
6793 string. This eliminates the need to manually keep two duplicate
6817 string. This eliminates the need to manually keep two duplicate
6794 lists.
6818 lists.
6795
6819
6796 * Removed the unneeded check_option_names. Now options are handled
6820 * Removed the unneeded check_option_names. Now options are handled
6797 in a much saner manner and it's easy to visually check that things
6821 in a much saner manner and it's easy to visually check that things
6798 are ok.
6822 are ok.
6799
6823
6800 * Updated version numbers on all files I modified to carry a
6824 * Updated version numbers on all files I modified to carry a
6801 notice so Janko and Nathan have clear version markers.
6825 notice so Janko and Nathan have clear version markers.
6802
6826
6803 * Updated docstring for ultraTB with my changes. I should send
6827 * Updated docstring for ultraTB with my changes. I should send
6804 this to Nathan.
6828 this to Nathan.
6805
6829
6806 * Lots of small fixes. Ran everything through pychecker again.
6830 * Lots of small fixes. Ran everything through pychecker again.
6807
6831
6808 * Made loading of deep_reload an cmd line option. If it's not too
6832 * Made loading of deep_reload an cmd line option. If it's not too
6809 kosher, now people can just disable it. With -nodeep_reload it's
6833 kosher, now people can just disable it. With -nodeep_reload it's
6810 still available as dreload(), it just won't overwrite reload().
6834 still available as dreload(), it just won't overwrite reload().
6811
6835
6812 * Moved many options to the no| form (-opt and -noopt
6836 * Moved many options to the no| form (-opt and -noopt
6813 accepted). Cleaner.
6837 accepted). Cleaner.
6814
6838
6815 * Changed magic_log so that if called with no parameters, it uses
6839 * Changed magic_log so that if called with no parameters, it uses
6816 'rotate' mode. That way auto-generated logs aren't automatically
6840 'rotate' mode. That way auto-generated logs aren't automatically
6817 over-written. For normal logs, now a backup is made if it exists
6841 over-written. For normal logs, now a backup is made if it exists
6818 (only 1 level of backups). A new 'backup' mode was added to the
6842 (only 1 level of backups). A new 'backup' mode was added to the
6819 Logger class to support this. This was a request by Janko.
6843 Logger class to support this. This was a request by Janko.
6820
6844
6821 * Added @logoff/@logon to stop/restart an active log.
6845 * Added @logoff/@logon to stop/restart an active log.
6822
6846
6823 * Fixed a lot of bugs in log saving/replay. It was pretty
6847 * Fixed a lot of bugs in log saving/replay. It was pretty
6824 broken. Now special lines (!@,/) appear properly in the command
6848 broken. Now special lines (!@,/) appear properly in the command
6825 history after a log replay.
6849 history after a log replay.
6826
6850
6827 * Tried and failed to implement full session saving via pickle. My
6851 * Tried and failed to implement full session saving via pickle. My
6828 idea was to pickle __main__.__dict__, but modules can't be
6852 idea was to pickle __main__.__dict__, but modules can't be
6829 pickled. This would be a better alternative to replaying logs, but
6853 pickled. This would be a better alternative to replaying logs, but
6830 seems quite tricky to get to work. Changed -session to be called
6854 seems quite tricky to get to work. Changed -session to be called
6831 -logplay, which more accurately reflects what it does. And if we
6855 -logplay, which more accurately reflects what it does. And if we
6832 ever get real session saving working, -session is now available.
6856 ever get real session saving working, -session is now available.
6833
6857
6834 * Implemented color schemes for prompts also. As for tracebacks,
6858 * Implemented color schemes for prompts also. As for tracebacks,
6835 currently only NoColor and Linux are supported. But now the
6859 currently only NoColor and Linux are supported. But now the
6836 infrastructure is in place, based on a generic ColorScheme
6860 infrastructure is in place, based on a generic ColorScheme
6837 class. So writing and activating new schemes both for the prompts
6861 class. So writing and activating new schemes both for the prompts
6838 and the tracebacks should be straightforward.
6862 and the tracebacks should be straightforward.
6839
6863
6840 * Version 0.1.13 released, 0.1.14 opened.
6864 * Version 0.1.13 released, 0.1.14 opened.
6841
6865
6842 * Changed handling of options for output cache. Now counter is
6866 * Changed handling of options for output cache. Now counter is
6843 hardwired starting at 1 and one specifies the maximum number of
6867 hardwired starting at 1 and one specifies the maximum number of
6844 entries *in the outcache* (not the max prompt counter). This is
6868 entries *in the outcache* (not the max prompt counter). This is
6845 much better, since many statements won't increase the cache
6869 much better, since many statements won't increase the cache
6846 count. It also eliminated some confusing options, now there's only
6870 count. It also eliminated some confusing options, now there's only
6847 one: cache_size.
6871 one: cache_size.
6848
6872
6849 * Added 'alias' magic function and magic_alias option in the
6873 * Added 'alias' magic function and magic_alias option in the
6850 ipythonrc file. Now the user can easily define whatever names he
6874 ipythonrc file. Now the user can easily define whatever names he
6851 wants for the magic functions without having to play weird
6875 wants for the magic functions without having to play weird
6852 namespace games. This gives IPython a real shell-like feel.
6876 namespace games. This gives IPython a real shell-like feel.
6853
6877
6854 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6878 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6855 @ or not).
6879 @ or not).
6856
6880
6857 This was one of the last remaining 'visible' bugs (that I know
6881 This was one of the last remaining 'visible' bugs (that I know
6858 of). I think if I can clean up the session loading so it works
6882 of). I think if I can clean up the session loading so it works
6859 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6883 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6860 about licensing).
6884 about licensing).
6861
6885
6862 2001-11-25 Fernando Perez <fperez@colorado.edu>
6886 2001-11-25 Fernando Perez <fperez@colorado.edu>
6863
6887
6864 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6888 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6865 there's a cleaner distinction between what ? and ?? show.
6889 there's a cleaner distinction between what ? and ?? show.
6866
6890
6867 * Added screen_length option. Now the user can define his own
6891 * Added screen_length option. Now the user can define his own
6868 screen size for page() operations.
6892 screen size for page() operations.
6869
6893
6870 * Implemented magic shell-like functions with automatic code
6894 * Implemented magic shell-like functions with automatic code
6871 generation. Now adding another function is just a matter of adding
6895 generation. Now adding another function is just a matter of adding
6872 an entry to a dict, and the function is dynamically generated at
6896 an entry to a dict, and the function is dynamically generated at
6873 run-time. Python has some really cool features!
6897 run-time. Python has some really cool features!
6874
6898
6875 * Renamed many options to cleanup conventions a little. Now all
6899 * Renamed many options to cleanup conventions a little. Now all
6876 are lowercase, and only underscores where needed. Also in the code
6900 are lowercase, and only underscores where needed. Also in the code
6877 option name tables are clearer.
6901 option name tables are clearer.
6878
6902
6879 * Changed prompts a little. Now input is 'In [n]:' instead of
6903 * Changed prompts a little. Now input is 'In [n]:' instead of
6880 'In[n]:='. This allows it the numbers to be aligned with the
6904 'In[n]:='. This allows it the numbers to be aligned with the
6881 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6905 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6882 Python (it was a Mathematica thing). The '...' continuation prompt
6906 Python (it was a Mathematica thing). The '...' continuation prompt
6883 was also changed a little to align better.
6907 was also changed a little to align better.
6884
6908
6885 * Fixed bug when flushing output cache. Not all _p<n> variables
6909 * Fixed bug when flushing output cache. Not all _p<n> variables
6886 exist, so their deletion needs to be wrapped in a try:
6910 exist, so their deletion needs to be wrapped in a try:
6887
6911
6888 * Figured out how to properly use inspect.formatargspec() (it
6912 * Figured out how to properly use inspect.formatargspec() (it
6889 requires the args preceded by *). So I removed all the code from
6913 requires the args preceded by *). So I removed all the code from
6890 _get_pdef in Magic, which was just replicating that.
6914 _get_pdef in Magic, which was just replicating that.
6891
6915
6892 * Added test to prefilter to allow redefining magic function names
6916 * Added test to prefilter to allow redefining magic function names
6893 as variables. This is ok, since the @ form is always available,
6917 as variables. This is ok, since the @ form is always available,
6894 but whe should allow the user to define a variable called 'ls' if
6918 but whe should allow the user to define a variable called 'ls' if
6895 he needs it.
6919 he needs it.
6896
6920
6897 * Moved the ToDo information from README into a separate ToDo.
6921 * Moved the ToDo information from README into a separate ToDo.
6898
6922
6899 * General code cleanup and small bugfixes. I think it's close to a
6923 * General code cleanup and small bugfixes. I think it's close to a
6900 state where it can be released, obviously with a big 'beta'
6924 state where it can be released, obviously with a big 'beta'
6901 warning on it.
6925 warning on it.
6902
6926
6903 * Got the magic function split to work. Now all magics are defined
6927 * Got the magic function split to work. Now all magics are defined
6904 in a separate class. It just organizes things a bit, and now
6928 in a separate class. It just organizes things a bit, and now
6905 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6929 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6906 was too long).
6930 was too long).
6907
6931
6908 * Changed @clear to @reset to avoid potential confusions with
6932 * Changed @clear to @reset to avoid potential confusions with
6909 the shell command clear. Also renamed @cl to @clear, which does
6933 the shell command clear. Also renamed @cl to @clear, which does
6910 exactly what people expect it to from their shell experience.
6934 exactly what people expect it to from their shell experience.
6911
6935
6912 Added a check to the @reset command (since it's so
6936 Added a check to the @reset command (since it's so
6913 destructive, it's probably a good idea to ask for confirmation).
6937 destructive, it's probably a good idea to ask for confirmation).
6914 But now reset only works for full namespace resetting. Since the
6938 But now reset only works for full namespace resetting. Since the
6915 del keyword is already there for deleting a few specific
6939 del keyword is already there for deleting a few specific
6916 variables, I don't see the point of having a redundant magic
6940 variables, I don't see the point of having a redundant magic
6917 function for the same task.
6941 function for the same task.
6918
6942
6919 2001-11-24 Fernando Perez <fperez@colorado.edu>
6943 2001-11-24 Fernando Perez <fperez@colorado.edu>
6920
6944
6921 * Updated the builtin docs (esp. the ? ones).
6945 * Updated the builtin docs (esp. the ? ones).
6922
6946
6923 * Ran all the code through pychecker. Not terribly impressed with
6947 * Ran all the code through pychecker. Not terribly impressed with
6924 it: lots of spurious warnings and didn't really find anything of
6948 it: lots of spurious warnings and didn't really find anything of
6925 substance (just a few modules being imported and not used).
6949 substance (just a few modules being imported and not used).
6926
6950
6927 * Implemented the new ultraTB functionality into IPython. New
6951 * Implemented the new ultraTB functionality into IPython. New
6928 option: xcolors. This chooses color scheme. xmode now only selects
6952 option: xcolors. This chooses color scheme. xmode now only selects
6929 between Plain and Verbose. Better orthogonality.
6953 between Plain and Verbose. Better orthogonality.
6930
6954
6931 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6955 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6932 mode and color scheme for the exception handlers. Now it's
6956 mode and color scheme for the exception handlers. Now it's
6933 possible to have the verbose traceback with no coloring.
6957 possible to have the verbose traceback with no coloring.
6934
6958
6935 2001-11-23 Fernando Perez <fperez@colorado.edu>
6959 2001-11-23 Fernando Perez <fperez@colorado.edu>
6936
6960
6937 * Version 0.1.12 released, 0.1.13 opened.
6961 * Version 0.1.12 released, 0.1.13 opened.
6938
6962
6939 * Removed option to set auto-quote and auto-paren escapes by
6963 * Removed option to set auto-quote and auto-paren escapes by
6940 user. The chances of breaking valid syntax are just too high. If
6964 user. The chances of breaking valid syntax are just too high. If
6941 someone *really* wants, they can always dig into the code.
6965 someone *really* wants, they can always dig into the code.
6942
6966
6943 * Made prompt separators configurable.
6967 * Made prompt separators configurable.
6944
6968
6945 2001-11-22 Fernando Perez <fperez@colorado.edu>
6969 2001-11-22 Fernando Perez <fperez@colorado.edu>
6946
6970
6947 * Small bugfixes in many places.
6971 * Small bugfixes in many places.
6948
6972
6949 * Removed the MyCompleter class from ipplib. It seemed redundant
6973 * Removed the MyCompleter class from ipplib. It seemed redundant
6950 with the C-p,C-n history search functionality. Less code to
6974 with the C-p,C-n history search functionality. Less code to
6951 maintain.
6975 maintain.
6952
6976
6953 * Moved all the original ipython.py code into ipythonlib.py. Right
6977 * Moved all the original ipython.py code into ipythonlib.py. Right
6954 now it's just one big dump into a function called make_IPython, so
6978 now it's just one big dump into a function called make_IPython, so
6955 no real modularity has been gained. But at least it makes the
6979 no real modularity has been gained. But at least it makes the
6956 wrapper script tiny, and since ipythonlib is a module, it gets
6980 wrapper script tiny, and since ipythonlib is a module, it gets
6957 compiled and startup is much faster.
6981 compiled and startup is much faster.
6958
6982
6959 This is a reasobably 'deep' change, so we should test it for a
6983 This is a reasobably 'deep' change, so we should test it for a
6960 while without messing too much more with the code.
6984 while without messing too much more with the code.
6961
6985
6962 2001-11-21 Fernando Perez <fperez@colorado.edu>
6986 2001-11-21 Fernando Perez <fperez@colorado.edu>
6963
6987
6964 * Version 0.1.11 released, 0.1.12 opened for further work.
6988 * Version 0.1.11 released, 0.1.12 opened for further work.
6965
6989
6966 * Removed dependency on Itpl. It was only needed in one place. It
6990 * Removed dependency on Itpl. It was only needed in one place. It
6967 would be nice if this became part of python, though. It makes life
6991 would be nice if this became part of python, though. It makes life
6968 *a lot* easier in some cases.
6992 *a lot* easier in some cases.
6969
6993
6970 * Simplified the prefilter code a bit. Now all handlers are
6994 * Simplified the prefilter code a bit. Now all handlers are
6971 expected to explicitly return a value (at least a blank string).
6995 expected to explicitly return a value (at least a blank string).
6972
6996
6973 * Heavy edits in ipplib. Removed the help system altogether. Now
6997 * Heavy edits in ipplib. Removed the help system altogether. Now
6974 obj?/?? is used for inspecting objects, a magic @doc prints
6998 obj?/?? is used for inspecting objects, a magic @doc prints
6975 docstrings, and full-blown Python help is accessed via the 'help'
6999 docstrings, and full-blown Python help is accessed via the 'help'
6976 keyword. This cleans up a lot of code (less to maintain) and does
7000 keyword. This cleans up a lot of code (less to maintain) and does
6977 the job. Since 'help' is now a standard Python component, might as
7001 the job. Since 'help' is now a standard Python component, might as
6978 well use it and remove duplicate functionality.
7002 well use it and remove duplicate functionality.
6979
7003
6980 Also removed the option to use ipplib as a standalone program. By
7004 Also removed the option to use ipplib as a standalone program. By
6981 now it's too dependent on other parts of IPython to function alone.
7005 now it's too dependent on other parts of IPython to function alone.
6982
7006
6983 * Fixed bug in genutils.pager. It would crash if the pager was
7007 * Fixed bug in genutils.pager. It would crash if the pager was
6984 exited immediately after opening (broken pipe).
7008 exited immediately after opening (broken pipe).
6985
7009
6986 * Trimmed down the VerboseTB reporting a little. The header is
7010 * Trimmed down the VerboseTB reporting a little. The header is
6987 much shorter now and the repeated exception arguments at the end
7011 much shorter now and the repeated exception arguments at the end
6988 have been removed. For interactive use the old header seemed a bit
7012 have been removed. For interactive use the old header seemed a bit
6989 excessive.
7013 excessive.
6990
7014
6991 * Fixed small bug in output of @whos for variables with multi-word
7015 * Fixed small bug in output of @whos for variables with multi-word
6992 types (only first word was displayed).
7016 types (only first word was displayed).
6993
7017
6994 2001-11-17 Fernando Perez <fperez@colorado.edu>
7018 2001-11-17 Fernando Perez <fperez@colorado.edu>
6995
7019
6996 * Version 0.1.10 released, 0.1.11 opened for further work.
7020 * Version 0.1.10 released, 0.1.11 opened for further work.
6997
7021
6998 * Modified dirs and friends. dirs now *returns* the stack (not
7022 * Modified dirs and friends. dirs now *returns* the stack (not
6999 prints), so one can manipulate it as a variable. Convenient to
7023 prints), so one can manipulate it as a variable. Convenient to
7000 travel along many directories.
7024 travel along many directories.
7001
7025
7002 * Fixed bug in magic_pdef: would only work with functions with
7026 * Fixed bug in magic_pdef: would only work with functions with
7003 arguments with default values.
7027 arguments with default values.
7004
7028
7005 2001-11-14 Fernando Perez <fperez@colorado.edu>
7029 2001-11-14 Fernando Perez <fperez@colorado.edu>
7006
7030
7007 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7031 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7008 example with IPython. Various other minor fixes and cleanups.
7032 example with IPython. Various other minor fixes and cleanups.
7009
7033
7010 * Version 0.1.9 released, 0.1.10 opened for further work.
7034 * Version 0.1.9 released, 0.1.10 opened for further work.
7011
7035
7012 * Added sys.path to the list of directories searched in the
7036 * Added sys.path to the list of directories searched in the
7013 execfile= option. It used to be the current directory and the
7037 execfile= option. It used to be the current directory and the
7014 user's IPYTHONDIR only.
7038 user's IPYTHONDIR only.
7015
7039
7016 2001-11-13 Fernando Perez <fperez@colorado.edu>
7040 2001-11-13 Fernando Perez <fperez@colorado.edu>
7017
7041
7018 * Reinstated the raw_input/prefilter separation that Janko had
7042 * Reinstated the raw_input/prefilter separation that Janko had
7019 initially. This gives a more convenient setup for extending the
7043 initially. This gives a more convenient setup for extending the
7020 pre-processor from the outside: raw_input always gets a string,
7044 pre-processor from the outside: raw_input always gets a string,
7021 and prefilter has to process it. We can then redefine prefilter
7045 and prefilter has to process it. We can then redefine prefilter
7022 from the outside and implement extensions for special
7046 from the outside and implement extensions for special
7023 purposes.
7047 purposes.
7024
7048
7025 Today I got one for inputting PhysicalQuantity objects
7049 Today I got one for inputting PhysicalQuantity objects
7026 (from Scientific) without needing any function calls at
7050 (from Scientific) without needing any function calls at
7027 all. Extremely convenient, and it's all done as a user-level
7051 all. Extremely convenient, and it's all done as a user-level
7028 extension (no IPython code was touched). Now instead of:
7052 extension (no IPython code was touched). Now instead of:
7029 a = PhysicalQuantity(4.2,'m/s**2')
7053 a = PhysicalQuantity(4.2,'m/s**2')
7030 one can simply say
7054 one can simply say
7031 a = 4.2 m/s**2
7055 a = 4.2 m/s**2
7032 or even
7056 or even
7033 a = 4.2 m/s^2
7057 a = 4.2 m/s^2
7034
7058
7035 I use this, but it's also a proof of concept: IPython really is
7059 I use this, but it's also a proof of concept: IPython really is
7036 fully user-extensible, even at the level of the parsing of the
7060 fully user-extensible, even at the level of the parsing of the
7037 command line. It's not trivial, but it's perfectly doable.
7061 command line. It's not trivial, but it's perfectly doable.
7038
7062
7039 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7063 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7040 the problem of modules being loaded in the inverse order in which
7064 the problem of modules being loaded in the inverse order in which
7041 they were defined in
7065 they were defined in
7042
7066
7043 * Version 0.1.8 released, 0.1.9 opened for further work.
7067 * Version 0.1.8 released, 0.1.9 opened for further work.
7044
7068
7045 * Added magics pdef, source and file. They respectively show the
7069 * Added magics pdef, source and file. They respectively show the
7046 definition line ('prototype' in C), source code and full python
7070 definition line ('prototype' in C), source code and full python
7047 file for any callable object. The object inspector oinfo uses
7071 file for any callable object. The object inspector oinfo uses
7048 these to show the same information.
7072 these to show the same information.
7049
7073
7050 * Version 0.1.7 released, 0.1.8 opened for further work.
7074 * Version 0.1.7 released, 0.1.8 opened for further work.
7051
7075
7052 * Separated all the magic functions into a class called Magic. The
7076 * Separated all the magic functions into a class called Magic. The
7053 InteractiveShell class was becoming too big for Xemacs to handle
7077 InteractiveShell class was becoming too big for Xemacs to handle
7054 (de-indenting a line would lock it up for 10 seconds while it
7078 (de-indenting a line would lock it up for 10 seconds while it
7055 backtracked on the whole class!)
7079 backtracked on the whole class!)
7056
7080
7057 FIXME: didn't work. It can be done, but right now namespaces are
7081 FIXME: didn't work. It can be done, but right now namespaces are
7058 all messed up. Do it later (reverted it for now, so at least
7082 all messed up. Do it later (reverted it for now, so at least
7059 everything works as before).
7083 everything works as before).
7060
7084
7061 * Got the object introspection system (magic_oinfo) working! I
7085 * Got the object introspection system (magic_oinfo) working! I
7062 think this is pretty much ready for release to Janko, so he can
7086 think this is pretty much ready for release to Janko, so he can
7063 test it for a while and then announce it. Pretty much 100% of what
7087 test it for a while and then announce it. Pretty much 100% of what
7064 I wanted for the 'phase 1' release is ready. Happy, tired.
7088 I wanted for the 'phase 1' release is ready. Happy, tired.
7065
7089
7066 2001-11-12 Fernando Perez <fperez@colorado.edu>
7090 2001-11-12 Fernando Perez <fperez@colorado.edu>
7067
7091
7068 * Version 0.1.6 released, 0.1.7 opened for further work.
7092 * Version 0.1.6 released, 0.1.7 opened for further work.
7069
7093
7070 * Fixed bug in printing: it used to test for truth before
7094 * Fixed bug in printing: it used to test for truth before
7071 printing, so 0 wouldn't print. Now checks for None.
7095 printing, so 0 wouldn't print. Now checks for None.
7072
7096
7073 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7097 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7074 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7098 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7075 reaches by hand into the outputcache. Think of a better way to do
7099 reaches by hand into the outputcache. Think of a better way to do
7076 this later.
7100 this later.
7077
7101
7078 * Various small fixes thanks to Nathan's comments.
7102 * Various small fixes thanks to Nathan's comments.
7079
7103
7080 * Changed magic_pprint to magic_Pprint. This way it doesn't
7104 * Changed magic_pprint to magic_Pprint. This way it doesn't
7081 collide with pprint() and the name is consistent with the command
7105 collide with pprint() and the name is consistent with the command
7082 line option.
7106 line option.
7083
7107
7084 * Changed prompt counter behavior to be fully like
7108 * Changed prompt counter behavior to be fully like
7085 Mathematica's. That is, even input that doesn't return a result
7109 Mathematica's. That is, even input that doesn't return a result
7086 raises the prompt counter. The old behavior was kind of confusing
7110 raises the prompt counter. The old behavior was kind of confusing
7087 (getting the same prompt number several times if the operation
7111 (getting the same prompt number several times if the operation
7088 didn't return a result).
7112 didn't return a result).
7089
7113
7090 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7114 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7091
7115
7092 * Fixed -Classic mode (wasn't working anymore).
7116 * Fixed -Classic mode (wasn't working anymore).
7093
7117
7094 * Added colored prompts using Nathan's new code. Colors are
7118 * Added colored prompts using Nathan's new code. Colors are
7095 currently hardwired, they can be user-configurable. For
7119 currently hardwired, they can be user-configurable. For
7096 developers, they can be chosen in file ipythonlib.py, at the
7120 developers, they can be chosen in file ipythonlib.py, at the
7097 beginning of the CachedOutput class def.
7121 beginning of the CachedOutput class def.
7098
7122
7099 2001-11-11 Fernando Perez <fperez@colorado.edu>
7123 2001-11-11 Fernando Perez <fperez@colorado.edu>
7100
7124
7101 * Version 0.1.5 released, 0.1.6 opened for further work.
7125 * Version 0.1.5 released, 0.1.6 opened for further work.
7102
7126
7103 * Changed magic_env to *return* the environment as a dict (not to
7127 * Changed magic_env to *return* the environment as a dict (not to
7104 print it). This way it prints, but it can also be processed.
7128 print it). This way it prints, but it can also be processed.
7105
7129
7106 * Added Verbose exception reporting to interactive
7130 * Added Verbose exception reporting to interactive
7107 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7131 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7108 traceback. Had to make some changes to the ultraTB file. This is
7132 traceback. Had to make some changes to the ultraTB file. This is
7109 probably the last 'big' thing in my mental todo list. This ties
7133 probably the last 'big' thing in my mental todo list. This ties
7110 in with the next entry:
7134 in with the next entry:
7111
7135
7112 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7136 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7113 has to specify is Plain, Color or Verbose for all exception
7137 has to specify is Plain, Color or Verbose for all exception
7114 handling.
7138 handling.
7115
7139
7116 * Removed ShellServices option. All this can really be done via
7140 * Removed ShellServices option. All this can really be done via
7117 the magic system. It's easier to extend, cleaner and has automatic
7141 the magic system. It's easier to extend, cleaner and has automatic
7118 namespace protection and documentation.
7142 namespace protection and documentation.
7119
7143
7120 2001-11-09 Fernando Perez <fperez@colorado.edu>
7144 2001-11-09 Fernando Perez <fperez@colorado.edu>
7121
7145
7122 * Fixed bug in output cache flushing (missing parameter to
7146 * Fixed bug in output cache flushing (missing parameter to
7123 __init__). Other small bugs fixed (found using pychecker).
7147 __init__). Other small bugs fixed (found using pychecker).
7124
7148
7125 * Version 0.1.4 opened for bugfixing.
7149 * Version 0.1.4 opened for bugfixing.
7126
7150
7127 2001-11-07 Fernando Perez <fperez@colorado.edu>
7151 2001-11-07 Fernando Perez <fperez@colorado.edu>
7128
7152
7129 * Version 0.1.3 released, mainly because of the raw_input bug.
7153 * Version 0.1.3 released, mainly because of the raw_input bug.
7130
7154
7131 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7155 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7132 and when testing for whether things were callable, a call could
7156 and when testing for whether things were callable, a call could
7133 actually be made to certain functions. They would get called again
7157 actually be made to certain functions. They would get called again
7134 once 'really' executed, with a resulting double call. A disaster
7158 once 'really' executed, with a resulting double call. A disaster
7135 in many cases (list.reverse() would never work!).
7159 in many cases (list.reverse() would never work!).
7136
7160
7137 * Removed prefilter() function, moved its code to raw_input (which
7161 * Removed prefilter() function, moved its code to raw_input (which
7138 after all was just a near-empty caller for prefilter). This saves
7162 after all was just a near-empty caller for prefilter). This saves
7139 a function call on every prompt, and simplifies the class a tiny bit.
7163 a function call on every prompt, and simplifies the class a tiny bit.
7140
7164
7141 * Fix _ip to __ip name in magic example file.
7165 * Fix _ip to __ip name in magic example file.
7142
7166
7143 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7167 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7144 work with non-gnu versions of tar.
7168 work with non-gnu versions of tar.
7145
7169
7146 2001-11-06 Fernando Perez <fperez@colorado.edu>
7170 2001-11-06 Fernando Perez <fperez@colorado.edu>
7147
7171
7148 * Version 0.1.2. Just to keep track of the recent changes.
7172 * Version 0.1.2. Just to keep track of the recent changes.
7149
7173
7150 * Fixed nasty bug in output prompt routine. It used to check 'if
7174 * Fixed nasty bug in output prompt routine. It used to check 'if
7151 arg != None...'. Problem is, this fails if arg implements a
7175 arg != None...'. Problem is, this fails if arg implements a
7152 special comparison (__cmp__) which disallows comparing to
7176 special comparison (__cmp__) which disallows comparing to
7153 None. Found it when trying to use the PhysicalQuantity module from
7177 None. Found it when trying to use the PhysicalQuantity module from
7154 ScientificPython.
7178 ScientificPython.
7155
7179
7156 2001-11-05 Fernando Perez <fperez@colorado.edu>
7180 2001-11-05 Fernando Perez <fperez@colorado.edu>
7157
7181
7158 * Also added dirs. Now the pushd/popd/dirs family functions
7182 * Also added dirs. Now the pushd/popd/dirs family functions
7159 basically like the shell, with the added convenience of going home
7183 basically like the shell, with the added convenience of going home
7160 when called with no args.
7184 when called with no args.
7161
7185
7162 * pushd/popd slightly modified to mimic shell behavior more
7186 * pushd/popd slightly modified to mimic shell behavior more
7163 closely.
7187 closely.
7164
7188
7165 * Added env,pushd,popd from ShellServices as magic functions. I
7189 * Added env,pushd,popd from ShellServices as magic functions. I
7166 think the cleanest will be to port all desired functions from
7190 think the cleanest will be to port all desired functions from
7167 ShellServices as magics and remove ShellServices altogether. This
7191 ShellServices as magics and remove ShellServices altogether. This
7168 will provide a single, clean way of adding functionality
7192 will provide a single, clean way of adding functionality
7169 (shell-type or otherwise) to IP.
7193 (shell-type or otherwise) to IP.
7170
7194
7171 2001-11-04 Fernando Perez <fperez@colorado.edu>
7195 2001-11-04 Fernando Perez <fperez@colorado.edu>
7172
7196
7173 * Added .ipython/ directory to sys.path. This way users can keep
7197 * Added .ipython/ directory to sys.path. This way users can keep
7174 customizations there and access them via import.
7198 customizations there and access them via import.
7175
7199
7176 2001-11-03 Fernando Perez <fperez@colorado.edu>
7200 2001-11-03 Fernando Perez <fperez@colorado.edu>
7177
7201
7178 * Opened version 0.1.1 for new changes.
7202 * Opened version 0.1.1 for new changes.
7179
7203
7180 * Changed version number to 0.1.0: first 'public' release, sent to
7204 * Changed version number to 0.1.0: first 'public' release, sent to
7181 Nathan and Janko.
7205 Nathan and Janko.
7182
7206
7183 * Lots of small fixes and tweaks.
7207 * Lots of small fixes and tweaks.
7184
7208
7185 * Minor changes to whos format. Now strings are shown, snipped if
7209 * Minor changes to whos format. Now strings are shown, snipped if
7186 too long.
7210 too long.
7187
7211
7188 * Changed ShellServices to work on __main__ so they show up in @who
7212 * Changed ShellServices to work on __main__ so they show up in @who
7189
7213
7190 * Help also works with ? at the end of a line:
7214 * Help also works with ? at the end of a line:
7191 ?sin and sin?
7215 ?sin and sin?
7192 both produce the same effect. This is nice, as often I use the
7216 both produce the same effect. This is nice, as often I use the
7193 tab-complete to find the name of a method, but I used to then have
7217 tab-complete to find the name of a method, but I used to then have
7194 to go to the beginning of the line to put a ? if I wanted more
7218 to go to the beginning of the line to put a ? if I wanted more
7195 info. Now I can just add the ? and hit return. Convenient.
7219 info. Now I can just add the ? and hit return. Convenient.
7196
7220
7197 2001-11-02 Fernando Perez <fperez@colorado.edu>
7221 2001-11-02 Fernando Perez <fperez@colorado.edu>
7198
7222
7199 * Python version check (>=2.1) added.
7223 * Python version check (>=2.1) added.
7200
7224
7201 * Added LazyPython documentation. At this point the docs are quite
7225 * Added LazyPython documentation. At this point the docs are quite
7202 a mess. A cleanup is in order.
7226 a mess. A cleanup is in order.
7203
7227
7204 * Auto-installer created. For some bizarre reason, the zipfiles
7228 * Auto-installer created. For some bizarre reason, the zipfiles
7205 module isn't working on my system. So I made a tar version
7229 module isn't working on my system. So I made a tar version
7206 (hopefully the command line options in various systems won't kill
7230 (hopefully the command line options in various systems won't kill
7207 me).
7231 me).
7208
7232
7209 * Fixes to Struct in genutils. Now all dictionary-like methods are
7233 * Fixes to Struct in genutils. Now all dictionary-like methods are
7210 protected (reasonably).
7234 protected (reasonably).
7211
7235
7212 * Added pager function to genutils and changed ? to print usage
7236 * Added pager function to genutils and changed ? to print usage
7213 note through it (it was too long).
7237 note through it (it was too long).
7214
7238
7215 * Added the LazyPython functionality. Works great! I changed the
7239 * Added the LazyPython functionality. Works great! I changed the
7216 auto-quote escape to ';', it's on home row and next to '. But
7240 auto-quote escape to ';', it's on home row and next to '. But
7217 both auto-quote and auto-paren (still /) escapes are command-line
7241 both auto-quote and auto-paren (still /) escapes are command-line
7218 parameters.
7242 parameters.
7219
7243
7220
7244
7221 2001-11-01 Fernando Perez <fperez@colorado.edu>
7245 2001-11-01 Fernando Perez <fperez@colorado.edu>
7222
7246
7223 * Version changed to 0.0.7. Fairly large change: configuration now
7247 * Version changed to 0.0.7. Fairly large change: configuration now
7224 is all stored in a directory, by default .ipython. There, all
7248 is all stored in a directory, by default .ipython. There, all
7225 config files have normal looking names (not .names)
7249 config files have normal looking names (not .names)
7226
7250
7227 * Version 0.0.6 Released first to Lucas and Archie as a test
7251 * Version 0.0.6 Released first to Lucas and Archie as a test
7228 run. Since it's the first 'semi-public' release, change version to
7252 run. Since it's the first 'semi-public' release, change version to
7229 > 0.0.6 for any changes now.
7253 > 0.0.6 for any changes now.
7230
7254
7231 * Stuff I had put in the ipplib.py changelog:
7255 * Stuff I had put in the ipplib.py changelog:
7232
7256
7233 Changes to InteractiveShell:
7257 Changes to InteractiveShell:
7234
7258
7235 - Made the usage message a parameter.
7259 - Made the usage message a parameter.
7236
7260
7237 - Require the name of the shell variable to be given. It's a bit
7261 - Require the name of the shell variable to be given. It's a bit
7238 of a hack, but allows the name 'shell' not to be hardwired in the
7262 of a hack, but allows the name 'shell' not to be hardwired in the
7239 magic (@) handler, which is problematic b/c it requires
7263 magic (@) handler, which is problematic b/c it requires
7240 polluting the global namespace with 'shell'. This in turn is
7264 polluting the global namespace with 'shell'. This in turn is
7241 fragile: if a user redefines a variable called shell, things
7265 fragile: if a user redefines a variable called shell, things
7242 break.
7266 break.
7243
7267
7244 - magic @: all functions available through @ need to be defined
7268 - magic @: all functions available through @ need to be defined
7245 as magic_<name>, even though they can be called simply as
7269 as magic_<name>, even though they can be called simply as
7246 @<name>. This allows the special command @magic to gather
7270 @<name>. This allows the special command @magic to gather
7247 information automatically about all existing magic functions,
7271 information automatically about all existing magic functions,
7248 even if they are run-time user extensions, by parsing the shell
7272 even if they are run-time user extensions, by parsing the shell
7249 instance __dict__ looking for special magic_ names.
7273 instance __dict__ looking for special magic_ names.
7250
7274
7251 - mainloop: added *two* local namespace parameters. This allows
7275 - mainloop: added *two* local namespace parameters. This allows
7252 the class to differentiate between parameters which were there
7276 the class to differentiate between parameters which were there
7253 before and after command line initialization was processed. This
7277 before and after command line initialization was processed. This
7254 way, later @who can show things loaded at startup by the
7278 way, later @who can show things loaded at startup by the
7255 user. This trick was necessary to make session saving/reloading
7279 user. This trick was necessary to make session saving/reloading
7256 really work: ideally after saving/exiting/reloading a session,
7280 really work: ideally after saving/exiting/reloading a session,
7257 *everything* should look the same, including the output of @who. I
7281 *everything* should look the same, including the output of @who. I
7258 was only able to make this work with this double namespace
7282 was only able to make this work with this double namespace
7259 trick.
7283 trick.
7260
7284
7261 - added a header to the logfile which allows (almost) full
7285 - added a header to the logfile which allows (almost) full
7262 session restoring.
7286 session restoring.
7263
7287
7264 - prepend lines beginning with @ or !, with a and log
7288 - prepend lines beginning with @ or !, with a and log
7265 them. Why? !lines: may be useful to know what you did @lines:
7289 them. Why? !lines: may be useful to know what you did @lines:
7266 they may affect session state. So when restoring a session, at
7290 they may affect session state. So when restoring a session, at
7267 least inform the user of their presence. I couldn't quite get
7291 least inform the user of their presence. I couldn't quite get
7268 them to properly re-execute, but at least the user is warned.
7292 them to properly re-execute, but at least the user is warned.
7269
7293
7270 * Started ChangeLog.
7294 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now