##// END OF EJS Templates
remove dir = dir /on auto alias, it broke other dir auto aliases
vivainio -
Show More
@@ -1,2536 +1,2536 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 2719 2007-09-06 18:53:34Z vivainio $
9 $Id: iplib.py 2725 2007-09-07 08:59:10Z 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 doctest
44 import doctest
45 import exceptions
45 import exceptions
46 import glob
46 import glob
47 import inspect
47 import inspect
48 import keyword
48 import keyword
49 import new
49 import new
50 import os
50 import os
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
60 from sets import Set
60 from sets import Set
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 #import IPython
64 #import IPython
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
72 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76 from IPython.strdispatch import StrDispatch
76 from IPython.strdispatch import StrDispatch
77 import IPython.ipapi
77 import IPython.ipapi
78 import IPython.history
78 import IPython.history
79 import IPython.prefilter as prefilter
79 import IPython.prefilter as prefilter
80 import IPython.shadowns
80 import IPython.shadowns
81 # Globals
81 # Globals
82
82
83 # store the builtin raw_input globally, and use this always, in case user code
83 # store the builtin raw_input globally, and use this always, in case user code
84 # overwrites it (like wx.py.PyShell does)
84 # overwrites it (like wx.py.PyShell does)
85 raw_input_original = raw_input
85 raw_input_original = raw_input
86
86
87 # compiled regexps for autoindent management
87 # compiled regexps for autoindent management
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89
89
90
90
91 #****************************************************************************
91 #****************************************************************************
92 # Some utility function definitions
92 # Some utility function definitions
93
93
94 ini_spaces_re = re.compile(r'^(\s+)')
94 ini_spaces_re = re.compile(r'^(\s+)')
95
95
96 def num_ini_spaces(strng):
96 def num_ini_spaces(strng):
97 """Return the number of initial spaces in a string"""
97 """Return the number of initial spaces in a string"""
98
98
99 ini_spaces = ini_spaces_re.match(strng)
99 ini_spaces = ini_spaces_re.match(strng)
100 if ini_spaces:
100 if ini_spaces:
101 return ini_spaces.end()
101 return ini_spaces.end()
102 else:
102 else:
103 return 0
103 return 0
104
104
105 def softspace(file, newvalue):
105 def softspace(file, newvalue):
106 """Copied from code.py, to remove the dependency"""
106 """Copied from code.py, to remove the dependency"""
107
107
108 oldvalue = 0
108 oldvalue = 0
109 try:
109 try:
110 oldvalue = file.softspace
110 oldvalue = file.softspace
111 except AttributeError:
111 except AttributeError:
112 pass
112 pass
113 try:
113 try:
114 file.softspace = newvalue
114 file.softspace = newvalue
115 except (AttributeError, TypeError):
115 except (AttributeError, TypeError):
116 # "attribute-less object" or "read-only attributes"
116 # "attribute-less object" or "read-only attributes"
117 pass
117 pass
118 return oldvalue
118 return oldvalue
119
119
120
120
121 #****************************************************************************
121 #****************************************************************************
122 # Local use exceptions
122 # Local use exceptions
123 class SpaceInInput(exceptions.Exception): pass
123 class SpaceInInput(exceptions.Exception): pass
124
124
125
125
126 #****************************************************************************
126 #****************************************************************************
127 # Local use classes
127 # Local use classes
128 class Bunch: pass
128 class Bunch: pass
129
129
130 class Undefined: pass
130 class Undefined: pass
131
131
132 class Quitter(object):
132 class Quitter(object):
133 """Simple class to handle exit, similar to Python 2.5's.
133 """Simple class to handle exit, similar to Python 2.5's.
134
134
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 doesn't do (obviously, since it doesn't know about ipython)."""
136 doesn't do (obviously, since it doesn't know about ipython)."""
137
137
138 def __init__(self,shell,name):
138 def __init__(self,shell,name):
139 self.shell = shell
139 self.shell = shell
140 self.name = name
140 self.name = name
141
141
142 def __repr__(self):
142 def __repr__(self):
143 return 'Type %s() to exit.' % self.name
143 return 'Type %s() to exit.' % self.name
144 __str__ = __repr__
144 __str__ = __repr__
145
145
146 def __call__(self):
146 def __call__(self):
147 self.shell.exit()
147 self.shell.exit()
148
148
149 class InputList(list):
149 class InputList(list):
150 """Class to store user input.
150 """Class to store user input.
151
151
152 It's basically a list, but slices return a string instead of a list, thus
152 It's basically a list, but slices return a string instead of a list, thus
153 allowing things like (assuming 'In' is an instance):
153 allowing things like (assuming 'In' is an instance):
154
154
155 exec In[4:7]
155 exec In[4:7]
156
156
157 or
157 or
158
158
159 exec In[5:9] + In[14] + In[21:25]"""
159 exec In[5:9] + In[14] + In[21:25]"""
160
160
161 def __getslice__(self,i,j):
161 def __getslice__(self,i,j):
162 return ''.join(list.__getslice__(self,i,j))
162 return ''.join(list.__getslice__(self,i,j))
163
163
164 class SyntaxTB(ultraTB.ListTB):
164 class SyntaxTB(ultraTB.ListTB):
165 """Extension which holds some state: the last exception value"""
165 """Extension which holds some state: the last exception value"""
166
166
167 def __init__(self,color_scheme = 'NoColor'):
167 def __init__(self,color_scheme = 'NoColor'):
168 ultraTB.ListTB.__init__(self,color_scheme)
168 ultraTB.ListTB.__init__(self,color_scheme)
169 self.last_syntax_error = None
169 self.last_syntax_error = None
170
170
171 def __call__(self, etype, value, elist):
171 def __call__(self, etype, value, elist):
172 self.last_syntax_error = value
172 self.last_syntax_error = value
173 ultraTB.ListTB.__call__(self,etype,value,elist)
173 ultraTB.ListTB.__call__(self,etype,value,elist)
174
174
175 def clear_err_state(self):
175 def clear_err_state(self):
176 """Return the current error state and clear it"""
176 """Return the current error state and clear it"""
177 e = self.last_syntax_error
177 e = self.last_syntax_error
178 self.last_syntax_error = None
178 self.last_syntax_error = None
179 return e
179 return e
180
180
181 #****************************************************************************
181 #****************************************************************************
182 # Main IPython class
182 # Main IPython class
183
183
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 # attributes and methods, but too much user code out there relies on the
186 # attributes and methods, but too much user code out there relies on the
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 #
188 #
189 # But at least now, all the pieces have been separated and we could, in
189 # But at least now, all the pieces have been separated and we could, in
190 # principle, stop using the mixin. This will ease the transition to the
190 # principle, stop using the mixin. This will ease the transition to the
191 # chainsaw branch.
191 # chainsaw branch.
192
192
193 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 # class, to prevent clashes.
195 # class, to prevent clashes.
196
196
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 # 'self.value']
200 # 'self.value']
201
201
202 class InteractiveShell(object,Magic):
202 class InteractiveShell(object,Magic):
203 """An enhanced console for Python."""
203 """An enhanced console for Python."""
204
204
205 # class attribute to indicate whether the class supports threads or not.
205 # class attribute to indicate whether the class supports threads or not.
206 # Subclasses with thread support should override this as needed.
206 # Subclasses with thread support should override this as needed.
207 isthreaded = False
207 isthreaded = False
208
208
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 user_ns = None,user_global_ns=None,banner2='',
210 user_ns = None,user_global_ns=None,banner2='',
211 custom_exceptions=((),None),embedded=False):
211 custom_exceptions=((),None),embedded=False):
212
212
213 # log system
213 # log system
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215
215
216 # some minimal strict typechecks. For some core data structures, I
216 # some minimal strict typechecks. For some core data structures, I
217 # want actual basic python types, not just anything that looks like
217 # want actual basic python types, not just anything that looks like
218 # one. This is especially true for namespaces.
218 # one. This is especially true for namespaces.
219 for ns in (user_ns,user_global_ns):
219 for ns in (user_ns,user_global_ns):
220 if ns is not None and type(ns) != types.DictType:
220 if ns is not None and type(ns) != types.DictType:
221 raise TypeError,'namespace must be a dictionary'
221 raise TypeError,'namespace must be a dictionary'
222
222
223 # Job manager (for jobs run as background threads)
223 # Job manager (for jobs run as background threads)
224 self.jobs = BackgroundJobManager()
224 self.jobs = BackgroundJobManager()
225
225
226 # Store the actual shell's name
226 # Store the actual shell's name
227 self.name = name
227 self.name = name
228
228
229 # We need to know whether the instance is meant for embedding, since
229 # We need to know whether the instance is meant for embedding, since
230 # global/local namespaces need to be handled differently in that case
230 # global/local namespaces need to be handled differently in that case
231 self.embedded = embedded
231 self.embedded = embedded
232 if embedded:
232 if embedded:
233 # Control variable so users can, from within the embedded instance,
233 # Control variable so users can, from within the embedded instance,
234 # permanently deactivate it.
234 # permanently deactivate it.
235 self.embedded_active = True
235 self.embedded_active = True
236
236
237 # command compiler
237 # command compiler
238 self.compile = codeop.CommandCompiler()
238 self.compile = codeop.CommandCompiler()
239
239
240 # User input buffer
240 # User input buffer
241 self.buffer = []
241 self.buffer = []
242
242
243 # Default name given in compilation of code
243 # Default name given in compilation of code
244 self.filename = '<ipython console>'
244 self.filename = '<ipython console>'
245
245
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.exit = Quitter(self,'exit')
249 __builtin__.quit = Quitter(self,'quit')
249 __builtin__.quit = Quitter(self,'quit')
250
250
251 # Make an empty namespace, which extension writers can rely on both
251 # Make an empty namespace, which extension writers can rely on both
252 # existing and NEVER being used by ipython itself. This gives them a
252 # existing and NEVER being used by ipython itself. This gives them a
253 # convenient location for storing additional information and state
253 # convenient location for storing additional information and state
254 # their extensions may require, without fear of collisions with other
254 # their extensions may require, without fear of collisions with other
255 # ipython names that may develop later.
255 # ipython names that may develop later.
256 self.meta = Struct()
256 self.meta = Struct()
257
257
258 # Create the namespace where the user will operate. user_ns is
258 # Create the namespace where the user will operate. user_ns is
259 # normally the only one used, and it is passed to the exec calls as
259 # normally the only one used, and it is passed to the exec calls as
260 # the locals argument. But we do carry a user_global_ns namespace
260 # the locals argument. But we do carry a user_global_ns namespace
261 # given as the exec 'globals' argument, This is useful in embedding
261 # given as the exec 'globals' argument, This is useful in embedding
262 # situations where the ipython shell opens in a context where the
262 # situations where the ipython shell opens in a context where the
263 # distinction between locals and globals is meaningful.
263 # distinction between locals and globals is meaningful.
264
264
265 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 # level as a dict instead of a module. This is a manual fix, but I
266 # level as a dict instead of a module. This is a manual fix, but I
267 # should really track down where the problem is coming from. Alex
267 # should really track down where the problem is coming from. Alex
268 # Schmolck reported this problem first.
268 # Schmolck reported this problem first.
269
269
270 # A useful post by Alex Martelli on this topic:
270 # A useful post by Alex Martelli on this topic:
271 # Re: inconsistent value from __builtins__
271 # Re: inconsistent value from __builtins__
272 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 # Gruppen: comp.lang.python
274 # Gruppen: comp.lang.python
275
275
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 # > <type 'dict'>
278 # > <type 'dict'>
279 # > >>> print type(__builtins__)
279 # > >>> print type(__builtins__)
280 # > <type 'module'>
280 # > <type 'module'>
281 # > Is this difference in return value intentional?
281 # > Is this difference in return value intentional?
282
282
283 # Well, it's documented that '__builtins__' can be either a dictionary
283 # Well, it's documented that '__builtins__' can be either a dictionary
284 # or a module, and it's been that way for a long time. Whether it's
284 # or a module, and it's been that way for a long time. Whether it's
285 # intentional (or sensible), I don't know. In any case, the idea is
285 # intentional (or sensible), I don't know. In any case, the idea is
286 # that if you need to access the built-in namespace directly, you
286 # that if you need to access the built-in namespace directly, you
287 # should start with "import __builtin__" (note, no 's') which will
287 # should start with "import __builtin__" (note, no 's') which will
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289
289
290 # These routines return properly built dicts as needed by the rest of
290 # These routines return properly built dicts as needed by the rest of
291 # the code, and can also be used by extension writers to generate
291 # the code, and can also be used by extension writers to generate
292 # properly initialized namespaces.
292 # properly initialized namespaces.
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295
295
296 # Assign namespaces
296 # Assign namespaces
297 # This is the namespace where all normal user variables live
297 # This is the namespace where all normal user variables live
298 self.user_ns = user_ns
298 self.user_ns = user_ns
299 # Embedded instances require a separate namespace for globals.
299 # Embedded instances require a separate namespace for globals.
300 # Normally this one is unused by non-embedded instances.
300 # Normally this one is unused by non-embedded instances.
301 self.user_global_ns = user_global_ns
301 self.user_global_ns = user_global_ns
302 # A namespace to keep track of internal data structures to prevent
302 # A namespace to keep track of internal data structures to prevent
303 # them from cluttering user-visible stuff. Will be updated later
303 # them from cluttering user-visible stuff. Will be updated later
304 self.internal_ns = {}
304 self.internal_ns = {}
305
305
306 # Namespace of system aliases. Each entry in the alias
306 # Namespace of system aliases. Each entry in the alias
307 # table must be a 2-tuple of the form (N,name), where N is the number
307 # table must be a 2-tuple of the form (N,name), where N is the number
308 # of positional arguments of the alias.
308 # of positional arguments of the alias.
309 self.alias_table = {}
309 self.alias_table = {}
310
310
311 # A table holding all the namespaces IPython deals with, so that
311 # A table holding all the namespaces IPython deals with, so that
312 # introspection facilities can search easily.
312 # introspection facilities can search easily.
313 self.ns_table = {'user':user_ns,
313 self.ns_table = {'user':user_ns,
314 'user_global':user_global_ns,
314 'user_global':user_global_ns,
315 'alias':self.alias_table,
315 'alias':self.alias_table,
316 'internal':self.internal_ns,
316 'internal':self.internal_ns,
317 'builtin':__builtin__.__dict__
317 'builtin':__builtin__.__dict__
318 }
318 }
319 # The user namespace MUST have a pointer to the shell itself.
319 # The user namespace MUST have a pointer to the shell itself.
320 self.user_ns[name] = self
320 self.user_ns[name] = self
321
321
322 # We need to insert into sys.modules something that looks like a
322 # We need to insert into sys.modules something that looks like a
323 # module but which accesses the IPython namespace, for shelve and
323 # module but which accesses the IPython namespace, for shelve and
324 # pickle to work interactively. Normally they rely on getting
324 # pickle to work interactively. Normally they rely on getting
325 # everything out of __main__, but for embedding purposes each IPython
325 # everything out of __main__, but for embedding purposes each IPython
326 # instance has its own private namespace, so we can't go shoving
326 # instance has its own private namespace, so we can't go shoving
327 # everything into __main__.
327 # everything into __main__.
328
328
329 # note, however, that we should only do this for non-embedded
329 # note, however, that we should only do this for non-embedded
330 # ipythons, which really mimic the __main__.__dict__ with their own
330 # ipythons, which really mimic the __main__.__dict__ with their own
331 # namespace. Embedded instances, on the other hand, should not do
331 # namespace. Embedded instances, on the other hand, should not do
332 # this because they need to manage the user local/global namespaces
332 # this because they need to manage the user local/global namespaces
333 # only, but they live within a 'normal' __main__ (meaning, they
333 # only, but they live within a 'normal' __main__ (meaning, they
334 # shouldn't overtake the execution environment of the script they're
334 # shouldn't overtake the execution environment of the script they're
335 # embedded in).
335 # embedded in).
336
336
337 if not embedded:
337 if not embedded:
338 try:
338 try:
339 main_name = self.user_ns['__name__']
339 main_name = self.user_ns['__name__']
340 except KeyError:
340 except KeyError:
341 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
341 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 else:
342 else:
343 #print "pickle hack in place" # dbg
343 #print "pickle hack in place" # dbg
344 #print 'main_name:',main_name # dbg
344 #print 'main_name:',main_name # dbg
345 sys.modules[main_name] = FakeModule(self.user_ns)
345 sys.modules[main_name] = FakeModule(self.user_ns)
346
346
347 # List of input with multi-line handling.
347 # List of input with multi-line handling.
348 # Fill its zero entry, user counter starts at 1
348 # Fill its zero entry, user counter starts at 1
349 self.input_hist = InputList(['\n'])
349 self.input_hist = InputList(['\n'])
350 # This one will hold the 'raw' input history, without any
350 # This one will hold the 'raw' input history, without any
351 # pre-processing. This will allow users to retrieve the input just as
351 # pre-processing. This will allow users to retrieve the input just as
352 # it was exactly typed in by the user, with %hist -r.
352 # it was exactly typed in by the user, with %hist -r.
353 self.input_hist_raw = InputList(['\n'])
353 self.input_hist_raw = InputList(['\n'])
354
354
355 # list of visited directories
355 # list of visited directories
356 try:
356 try:
357 self.dir_hist = [os.getcwd()]
357 self.dir_hist = [os.getcwd()]
358 except OSError:
358 except OSError:
359 self.dir_hist = []
359 self.dir_hist = []
360
360
361 # dict of output history
361 # dict of output history
362 self.output_hist = {}
362 self.output_hist = {}
363
363
364 # Get system encoding at startup time. Certain terminals (like Emacs
364 # Get system encoding at startup time. Certain terminals (like Emacs
365 # under Win32 have it set to None, and we need to have a known valid
365 # under Win32 have it set to None, and we need to have a known valid
366 # encoding to use in the raw_input() method
366 # encoding to use in the raw_input() method
367 self.stdin_encoding = sys.stdin.encoding or 'ascii'
367 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368
368
369 # dict of things NOT to alias (keywords, builtins and some magics)
369 # dict of things NOT to alias (keywords, builtins and some magics)
370 no_alias = {}
370 no_alias = {}
371 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
371 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 for key in keyword.kwlist + no_alias_magics:
372 for key in keyword.kwlist + no_alias_magics:
373 no_alias[key] = 1
373 no_alias[key] = 1
374 no_alias.update(__builtin__.__dict__)
374 no_alias.update(__builtin__.__dict__)
375 self.no_alias = no_alias
375 self.no_alias = no_alias
376
376
377 # make global variables for user access to these
377 # make global variables for user access to these
378 self.user_ns['_ih'] = self.input_hist
378 self.user_ns['_ih'] = self.input_hist
379 self.user_ns['_oh'] = self.output_hist
379 self.user_ns['_oh'] = self.output_hist
380 self.user_ns['_dh'] = self.dir_hist
380 self.user_ns['_dh'] = self.dir_hist
381
381
382 # user aliases to input and output histories
382 # user aliases to input and output histories
383 self.user_ns['In'] = self.input_hist
383 self.user_ns['In'] = self.input_hist
384 self.user_ns['Out'] = self.output_hist
384 self.user_ns['Out'] = self.output_hist
385
385
386 self.user_ns['_sh'] = IPython.shadowns
386 self.user_ns['_sh'] = IPython.shadowns
387 # Object variable to store code object waiting execution. This is
387 # Object variable to store code object waiting execution. This is
388 # used mainly by the multithreaded shells, but it can come in handy in
388 # used mainly by the multithreaded shells, but it can come in handy in
389 # other situations. No need to use a Queue here, since it's a single
389 # other situations. No need to use a Queue here, since it's a single
390 # item which gets cleared once run.
390 # item which gets cleared once run.
391 self.code_to_run = None
391 self.code_to_run = None
392
392
393 # escapes for automatic behavior on the command line
393 # escapes for automatic behavior on the command line
394 self.ESC_SHELL = '!'
394 self.ESC_SHELL = '!'
395 self.ESC_SH_CAP = '!!'
395 self.ESC_SH_CAP = '!!'
396 self.ESC_HELP = '?'
396 self.ESC_HELP = '?'
397 self.ESC_MAGIC = '%'
397 self.ESC_MAGIC = '%'
398 self.ESC_QUOTE = ','
398 self.ESC_QUOTE = ','
399 self.ESC_QUOTE2 = ';'
399 self.ESC_QUOTE2 = ';'
400 self.ESC_PAREN = '/'
400 self.ESC_PAREN = '/'
401
401
402 # And their associated handlers
402 # And their associated handlers
403 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
403 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 self.ESC_QUOTE : self.handle_auto,
404 self.ESC_QUOTE : self.handle_auto,
405 self.ESC_QUOTE2 : self.handle_auto,
405 self.ESC_QUOTE2 : self.handle_auto,
406 self.ESC_MAGIC : self.handle_magic,
406 self.ESC_MAGIC : self.handle_magic,
407 self.ESC_HELP : self.handle_help,
407 self.ESC_HELP : self.handle_help,
408 self.ESC_SHELL : self.handle_shell_escape,
408 self.ESC_SHELL : self.handle_shell_escape,
409 self.ESC_SH_CAP : self.handle_shell_escape,
409 self.ESC_SH_CAP : self.handle_shell_escape,
410 }
410 }
411
411
412 # class initializations
412 # class initializations
413 Magic.__init__(self,self)
413 Magic.__init__(self,self)
414
414
415 # Python source parser/formatter for syntax highlighting
415 # Python source parser/formatter for syntax highlighting
416 pyformat = PyColorize.Parser().format
416 pyformat = PyColorize.Parser().format
417 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
417 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418
418
419 # hooks holds pointers used for user-side customizations
419 # hooks holds pointers used for user-side customizations
420 self.hooks = Struct()
420 self.hooks = Struct()
421
421
422 self.strdispatchers = {}
422 self.strdispatchers = {}
423
423
424 # Set all default hooks, defined in the IPython.hooks module.
424 # Set all default hooks, defined in the IPython.hooks module.
425 hooks = IPython.hooks
425 hooks = IPython.hooks
426 for hook_name in hooks.__all__:
426 for hook_name in hooks.__all__:
427 # default hooks have priority 100, i.e. low; user hooks should have
427 # default hooks have priority 100, i.e. low; user hooks should have
428 # 0-100 priority
428 # 0-100 priority
429 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
429 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 #print "bound hook",hook_name
430 #print "bound hook",hook_name
431
431
432 # Flag to mark unconditional exit
432 # Flag to mark unconditional exit
433 self.exit_now = False
433 self.exit_now = False
434
434
435 self.usage_min = """\
435 self.usage_min = """\
436 An enhanced console for Python.
436 An enhanced console for Python.
437 Some of its features are:
437 Some of its features are:
438 - Readline support if the readline library is present.
438 - Readline support if the readline library is present.
439 - Tab completion in the local namespace.
439 - Tab completion in the local namespace.
440 - Logging of input, see command-line options.
440 - Logging of input, see command-line options.
441 - System shell escape via ! , eg !ls.
441 - System shell escape via ! , eg !ls.
442 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
442 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 - Keeps track of locally defined variables via %who, %whos.
443 - Keeps track of locally defined variables via %who, %whos.
444 - Show object information with a ? eg ?x or x? (use ?? for more info).
444 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 """
445 """
446 if usage: self.usage = usage
446 if usage: self.usage = usage
447 else: self.usage = self.usage_min
447 else: self.usage = self.usage_min
448
448
449 # Storage
449 # Storage
450 self.rc = rc # This will hold all configuration information
450 self.rc = rc # This will hold all configuration information
451 self.pager = 'less'
451 self.pager = 'less'
452 # temporary files used for various purposes. Deleted at exit.
452 # temporary files used for various purposes. Deleted at exit.
453 self.tempfiles = []
453 self.tempfiles = []
454
454
455 # Keep track of readline usage (later set by init_readline)
455 # Keep track of readline usage (later set by init_readline)
456 self.has_readline = False
456 self.has_readline = False
457
457
458 # template for logfile headers. It gets resolved at runtime by the
458 # template for logfile headers. It gets resolved at runtime by the
459 # logstart method.
459 # logstart method.
460 self.loghead_tpl = \
460 self.loghead_tpl = \
461 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
461 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
462 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 #log# opts = %s
463 #log# opts = %s
464 #log# args = %s
464 #log# args = %s
465 #log# It is safe to make manual edits below here.
465 #log# It is safe to make manual edits below here.
466 #log#-----------------------------------------------------------------------
466 #log#-----------------------------------------------------------------------
467 """
467 """
468 # for pushd/popd management
468 # for pushd/popd management
469 try:
469 try:
470 self.home_dir = get_home_dir()
470 self.home_dir = get_home_dir()
471 except HomeDirError,msg:
471 except HomeDirError,msg:
472 fatal(msg)
472 fatal(msg)
473
473
474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
474 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475
475
476 # Functions to call the underlying shell.
476 # Functions to call the underlying shell.
477
477
478 # The first is similar to os.system, but it doesn't return a value,
478 # The first is similar to os.system, but it doesn't return a value,
479 # and it allows interpolation of variables in the user's namespace.
479 # and it allows interpolation of variables in the user's namespace.
480 self.system = lambda cmd: \
480 self.system = lambda cmd: \
481 shell(self.var_expand(cmd,depth=2),
481 shell(self.var_expand(cmd,depth=2),
482 header=self.rc.system_header,
482 header=self.rc.system_header,
483 verbose=self.rc.system_verbose)
483 verbose=self.rc.system_verbose)
484
484
485 # These are for getoutput and getoutputerror:
485 # These are for getoutput and getoutputerror:
486 self.getoutput = lambda cmd: \
486 self.getoutput = lambda cmd: \
487 getoutput(self.var_expand(cmd,depth=2),
487 getoutput(self.var_expand(cmd,depth=2),
488 header=self.rc.system_header,
488 header=self.rc.system_header,
489 verbose=self.rc.system_verbose)
489 verbose=self.rc.system_verbose)
490
490
491 self.getoutputerror = lambda cmd: \
491 self.getoutputerror = lambda cmd: \
492 getoutputerror(self.var_expand(cmd,depth=2),
492 getoutputerror(self.var_expand(cmd,depth=2),
493 header=self.rc.system_header,
493 header=self.rc.system_header,
494 verbose=self.rc.system_verbose)
494 verbose=self.rc.system_verbose)
495
495
496
496
497 # keep track of where we started running (mainly for crash post-mortem)
497 # keep track of where we started running (mainly for crash post-mortem)
498 self.starting_dir = os.getcwd()
498 self.starting_dir = os.getcwd()
499
499
500 # Various switches which can be set
500 # Various switches which can be set
501 self.CACHELENGTH = 5000 # this is cheap, it's just text
501 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
502 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 self.banner2 = banner2
503 self.banner2 = banner2
504
504
505 # TraceBack handlers:
505 # TraceBack handlers:
506
506
507 # Syntax error handler.
507 # Syntax error handler.
508 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
508 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509
509
510 # The interactive one is initialized with an offset, meaning we always
510 # The interactive one is initialized with an offset, meaning we always
511 # want to remove the topmost item in the traceback, which is our own
511 # want to remove the topmost item in the traceback, which is our own
512 # internal code. Valid modes: ['Plain','Context','Verbose']
512 # internal code. Valid modes: ['Plain','Context','Verbose']
513 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
513 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 color_scheme='NoColor',
514 color_scheme='NoColor',
515 tb_offset = 1)
515 tb_offset = 1)
516
516
517 # IPython itself shouldn't crash. This will produce a detailed
517 # IPython itself shouldn't crash. This will produce a detailed
518 # post-mortem if it does. But we only install the crash handler for
518 # post-mortem if it does. But we only install the crash handler for
519 # non-threaded shells, the threaded ones use a normal verbose reporter
519 # non-threaded shells, the threaded ones use a normal verbose reporter
520 # and lose the crash handler. This is because exceptions in the main
520 # and lose the crash handler. This is because exceptions in the main
521 # thread (such as in GUI code) propagate directly to sys.excepthook,
521 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 # and there's no point in printing crash dumps for every user exception.
522 # and there's no point in printing crash dumps for every user exception.
523 if self.isthreaded:
523 if self.isthreaded:
524 ipCrashHandler = ultraTB.FormattedTB()
524 ipCrashHandler = ultraTB.FormattedTB()
525 else:
525 else:
526 from IPython import CrashHandler
526 from IPython import CrashHandler
527 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
527 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 self.set_crash_handler(ipCrashHandler)
528 self.set_crash_handler(ipCrashHandler)
529
529
530 # and add any custom exception handlers the user may have specified
530 # and add any custom exception handlers the user may have specified
531 self.set_custom_exc(*custom_exceptions)
531 self.set_custom_exc(*custom_exceptions)
532
532
533 # indentation management
533 # indentation management
534 self.autoindent = False
534 self.autoindent = False
535 self.indent_current_nsp = 0
535 self.indent_current_nsp = 0
536
536
537 # Make some aliases automatically
537 # Make some aliases automatically
538 # Prepare list of shell aliases to auto-define
538 # Prepare list of shell aliases to auto-define
539 if os.name == 'posix':
539 if os.name == 'posix':
540 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
540 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 'mv mv -i','rm rm -i','cp cp -i',
541 'mv mv -i','rm rm -i','cp cp -i',
542 'cat cat','less less','clear clear',
542 'cat cat','less less','clear clear',
543 # a better ls
543 # a better ls
544 'ls ls -F',
544 'ls ls -F',
545 # long ls
545 # long ls
546 'll ls -lF')
546 'll ls -lF')
547 # Extra ls aliases with color, which need special treatment on BSD
547 # Extra ls aliases with color, which need special treatment on BSD
548 # variants
548 # variants
549 ls_extra = ( # color ls
549 ls_extra = ( # color ls
550 'lc ls -F -o --color',
550 'lc ls -F -o --color',
551 # ls normal files only
551 # ls normal files only
552 'lf ls -F -o --color %l | grep ^-',
552 'lf ls -F -o --color %l | grep ^-',
553 # ls symbolic links
553 # ls symbolic links
554 'lk ls -F -o --color %l | grep ^l',
554 'lk ls -F -o --color %l | grep ^l',
555 # directories or links to directories,
555 # directories or links to directories,
556 'ldir ls -F -o --color %l | grep /$',
556 'ldir ls -F -o --color %l | grep /$',
557 # things which are executable
557 # things which are executable
558 'lx ls -F -o --color %l | grep ^-..x',
558 'lx ls -F -o --color %l | grep ^-..x',
559 )
559 )
560 # The BSDs don't ship GNU ls, so they don't understand the
560 # The BSDs don't ship GNU ls, so they don't understand the
561 # --color switch out of the box
561 # --color switch out of the box
562 if 'bsd' in sys.platform:
562 if 'bsd' in sys.platform:
563 ls_extra = ( # ls normal files only
563 ls_extra = ( # ls normal files only
564 'lf ls -lF | grep ^-',
564 'lf ls -lF | grep ^-',
565 # ls symbolic links
565 # ls symbolic links
566 'lk ls -lF | grep ^l',
566 'lk ls -lF | grep ^l',
567 # directories or links to directories,
567 # directories or links to directories,
568 'ldir ls -lF | grep /$',
568 'ldir ls -lF | grep /$',
569 # things which are executable
569 # things which are executable
570 'lx ls -lF | grep ^-..x',
570 'lx ls -lF | grep ^-..x',
571 )
571 )
572 auto_alias = auto_alias + ls_extra
572 auto_alias = auto_alias + ls_extra
573 elif os.name in ['nt','dos']:
573 elif os.name in ['nt','dos']:
574 auto_alias = ('dir dir /on', 'ls dir /on',
574 auto_alias = ('ls dir /on',
575 'ddir dir /ad /on', 'ldir dir /ad /on',
575 'ddir dir /ad /on', 'ldir dir /ad /on',
576 'mkdir mkdir','rmdir rmdir','echo echo',
576 'mkdir mkdir','rmdir rmdir','echo echo',
577 'ren ren','cls cls','copy copy')
577 'ren ren','cls cls','copy copy')
578 else:
578 else:
579 auto_alias = ()
579 auto_alias = ()
580 self.auto_alias = [s.split(None,1) for s in auto_alias]
580 self.auto_alias = [s.split(None,1) for s in auto_alias]
581
581
582 # Produce a public API instance
582 # Produce a public API instance
583 self.api = IPython.ipapi.IPApi(self)
583 self.api = IPython.ipapi.IPApi(self)
584
584
585 # Call the actual (public) initializer
585 # Call the actual (public) initializer
586 self.init_auto_alias()
586 self.init_auto_alias()
587
587
588 # track which builtins we add, so we can clean up later
588 # track which builtins we add, so we can clean up later
589 self.builtins_added = {}
589 self.builtins_added = {}
590 # This method will add the necessary builtins for operation, but
590 # This method will add the necessary builtins for operation, but
591 # tracking what it did via the builtins_added dict.
591 # tracking what it did via the builtins_added dict.
592 self.add_builtins()
592 self.add_builtins()
593
593
594
594
595
595
596 # end __init__
596 # end __init__
597
597
598 def var_expand(self,cmd,depth=0):
598 def var_expand(self,cmd,depth=0):
599 """Expand python variables in a string.
599 """Expand python variables in a string.
600
600
601 The depth argument indicates how many frames above the caller should
601 The depth argument indicates how many frames above the caller should
602 be walked to look for the local namespace where to expand variables.
602 be walked to look for the local namespace where to expand variables.
603
603
604 The global namespace for expansion is always the user's interactive
604 The global namespace for expansion is always the user's interactive
605 namespace.
605 namespace.
606 """
606 """
607
607
608 return str(ItplNS(cmd.replace('#','\#'),
608 return str(ItplNS(cmd.replace('#','\#'),
609 self.user_ns, # globals
609 self.user_ns, # globals
610 # Skip our own frame in searching for locals:
610 # Skip our own frame in searching for locals:
611 sys._getframe(depth+1).f_locals # locals
611 sys._getframe(depth+1).f_locals # locals
612 ))
612 ))
613
613
614 def pre_config_initialization(self):
614 def pre_config_initialization(self):
615 """Pre-configuration init method
615 """Pre-configuration init method
616
616
617 This is called before the configuration files are processed to
617 This is called before the configuration files are processed to
618 prepare the services the config files might need.
618 prepare the services the config files might need.
619
619
620 self.rc already has reasonable default values at this point.
620 self.rc already has reasonable default values at this point.
621 """
621 """
622 rc = self.rc
622 rc = self.rc
623 try:
623 try:
624 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
624 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
625 except exceptions.UnicodeDecodeError:
625 except exceptions.UnicodeDecodeError:
626 print "Your ipythondir can't be decoded to unicode!"
626 print "Your ipythondir can't be decoded to unicode!"
627 print "Please set HOME environment variable to something that"
627 print "Please set HOME environment variable to something that"
628 print r"only has ASCII characters, e.g. c:\home"
628 print r"only has ASCII characters, e.g. c:\home"
629 print "Now it is",rc.ipythondir
629 print "Now it is",rc.ipythondir
630 sys.exit()
630 sys.exit()
631 self.shadowhist = IPython.history.ShadowHist(self.db)
631 self.shadowhist = IPython.history.ShadowHist(self.db)
632
632
633
633
634 def post_config_initialization(self):
634 def post_config_initialization(self):
635 """Post configuration init method
635 """Post configuration init method
636
636
637 This is called after the configuration files have been processed to
637 This is called after the configuration files have been processed to
638 'finalize' the initialization."""
638 'finalize' the initialization."""
639
639
640 rc = self.rc
640 rc = self.rc
641
641
642 # Object inspector
642 # Object inspector
643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
644 PyColorize.ANSICodeColors,
644 PyColorize.ANSICodeColors,
645 'NoColor',
645 'NoColor',
646 rc.object_info_string_level)
646 rc.object_info_string_level)
647
647
648 self.rl_next_input = None
648 self.rl_next_input = None
649 self.rl_do_indent = False
649 self.rl_do_indent = False
650 # Load readline proper
650 # Load readline proper
651 if rc.readline:
651 if rc.readline:
652 self.init_readline()
652 self.init_readline()
653
653
654
654
655 # local shortcut, this is used a LOT
655 # local shortcut, this is used a LOT
656 self.log = self.logger.log
656 self.log = self.logger.log
657
657
658 # Initialize cache, set in/out prompts and printing system
658 # Initialize cache, set in/out prompts and printing system
659 self.outputcache = CachedOutput(self,
659 self.outputcache = CachedOutput(self,
660 rc.cache_size,
660 rc.cache_size,
661 rc.pprint,
661 rc.pprint,
662 input_sep = rc.separate_in,
662 input_sep = rc.separate_in,
663 output_sep = rc.separate_out,
663 output_sep = rc.separate_out,
664 output_sep2 = rc.separate_out2,
664 output_sep2 = rc.separate_out2,
665 ps1 = rc.prompt_in1,
665 ps1 = rc.prompt_in1,
666 ps2 = rc.prompt_in2,
666 ps2 = rc.prompt_in2,
667 ps_out = rc.prompt_out,
667 ps_out = rc.prompt_out,
668 pad_left = rc.prompts_pad_left)
668 pad_left = rc.prompts_pad_left)
669
669
670 # user may have over-ridden the default print hook:
670 # user may have over-ridden the default print hook:
671 try:
671 try:
672 self.outputcache.__class__.display = self.hooks.display
672 self.outputcache.__class__.display = self.hooks.display
673 except AttributeError:
673 except AttributeError:
674 pass
674 pass
675
675
676 # I don't like assigning globally to sys, because it means when
676 # I don't like assigning globally to sys, because it means when
677 # embedding instances, each embedded instance overrides the previous
677 # embedding instances, each embedded instance overrides the previous
678 # choice. But sys.displayhook seems to be called internally by exec,
678 # choice. But sys.displayhook seems to be called internally by exec,
679 # so I don't see a way around it. We first save the original and then
679 # so I don't see a way around it. We first save the original and then
680 # overwrite it.
680 # overwrite it.
681 self.sys_displayhook = sys.displayhook
681 self.sys_displayhook = sys.displayhook
682 sys.displayhook = self.outputcache
682 sys.displayhook = self.outputcache
683
683
684 # Monkeypatch doctest so that its core test runner method is protected
684 # Monkeypatch doctest so that its core test runner method is protected
685 # from IPython's modified displayhook. Doctest expects the default
685 # from IPython's modified displayhook. Doctest expects the default
686 # displayhook behavior deep down, so our modification breaks it
686 # displayhook behavior deep down, so our modification breaks it
687 # completely. For this reason, a hard monkeypatch seems like a
687 # completely. For this reason, a hard monkeypatch seems like a
688 # reasonable solution rather than asking users to manually use a
688 # reasonable solution rather than asking users to manually use a
689 # different doctest runner when under IPython.
689 # different doctest runner when under IPython.
690 try:
690 try:
691 doctest.DocTestRunner
691 doctest.DocTestRunner
692 except AttributeError:
692 except AttributeError:
693 # This is only for python 2.3 compatibility, remove once we move to
693 # This is only for python 2.3 compatibility, remove once we move to
694 # 2.4 only.
694 # 2.4 only.
695 pass
695 pass
696 else:
696 else:
697 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
697 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
698
698
699 # Set user colors (don't do it in the constructor above so that it
699 # Set user colors (don't do it in the constructor above so that it
700 # doesn't crash if colors option is invalid)
700 # doesn't crash if colors option is invalid)
701 self.magic_colors(rc.colors)
701 self.magic_colors(rc.colors)
702
702
703 # Set calling of pdb on exceptions
703 # Set calling of pdb on exceptions
704 self.call_pdb = rc.pdb
704 self.call_pdb = rc.pdb
705
705
706 # Load user aliases
706 # Load user aliases
707 for alias in rc.alias:
707 for alias in rc.alias:
708 self.magic_alias(alias)
708 self.magic_alias(alias)
709
709
710 self.hooks.late_startup_hook()
710 self.hooks.late_startup_hook()
711
711
712 batchrun = False
712 batchrun = False
713 for batchfile in [path(arg) for arg in self.rc.args
713 for batchfile in [path(arg) for arg in self.rc.args
714 if arg.lower().endswith('.ipy')]:
714 if arg.lower().endswith('.ipy')]:
715 if not batchfile.isfile():
715 if not batchfile.isfile():
716 print "No such batch file:", batchfile
716 print "No such batch file:", batchfile
717 continue
717 continue
718 self.api.runlines(batchfile.text())
718 self.api.runlines(batchfile.text())
719 batchrun = True
719 batchrun = True
720 # without -i option, exit after running the batch file
720 # without -i option, exit after running the batch file
721 if batchrun and not self.rc.interact:
721 if batchrun and not self.rc.interact:
722 self.exit_now = True
722 self.exit_now = True
723
723
724 def add_builtins(self):
724 def add_builtins(self):
725 """Store ipython references into the builtin namespace.
725 """Store ipython references into the builtin namespace.
726
726
727 Some parts of ipython operate via builtins injected here, which hold a
727 Some parts of ipython operate via builtins injected here, which hold a
728 reference to IPython itself."""
728 reference to IPython itself."""
729
729
730 # TODO: deprecate all except _ip; 'jobs' should be installed
730 # TODO: deprecate all except _ip; 'jobs' should be installed
731 # by an extension and the rest are under _ip, ipalias is redundant
731 # by an extension and the rest are under _ip, ipalias is redundant
732 builtins_new = dict(__IPYTHON__ = self,
732 builtins_new = dict(__IPYTHON__ = self,
733 ip_set_hook = self.set_hook,
733 ip_set_hook = self.set_hook,
734 jobs = self.jobs,
734 jobs = self.jobs,
735 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
735 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
736 ipalias = wrap_deprecated(self.ipalias),
736 ipalias = wrap_deprecated(self.ipalias),
737 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
737 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
738 _ip = self.api
738 _ip = self.api
739 )
739 )
740 for biname,bival in builtins_new.items():
740 for biname,bival in builtins_new.items():
741 try:
741 try:
742 # store the orignal value so we can restore it
742 # store the orignal value so we can restore it
743 self.builtins_added[biname] = __builtin__.__dict__[biname]
743 self.builtins_added[biname] = __builtin__.__dict__[biname]
744 except KeyError:
744 except KeyError:
745 # or mark that it wasn't defined, and we'll just delete it at
745 # or mark that it wasn't defined, and we'll just delete it at
746 # cleanup
746 # cleanup
747 self.builtins_added[biname] = Undefined
747 self.builtins_added[biname] = Undefined
748 __builtin__.__dict__[biname] = bival
748 __builtin__.__dict__[biname] = bival
749
749
750 # Keep in the builtins a flag for when IPython is active. We set it
750 # Keep in the builtins a flag for when IPython is active. We set it
751 # with setdefault so that multiple nested IPythons don't clobber one
751 # with setdefault so that multiple nested IPythons don't clobber one
752 # another. Each will increase its value by one upon being activated,
752 # another. Each will increase its value by one upon being activated,
753 # which also gives us a way to determine the nesting level.
753 # which also gives us a way to determine the nesting level.
754 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
754 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
755
755
756 def clean_builtins(self):
756 def clean_builtins(self):
757 """Remove any builtins which might have been added by add_builtins, or
757 """Remove any builtins which might have been added by add_builtins, or
758 restore overwritten ones to their previous values."""
758 restore overwritten ones to their previous values."""
759 for biname,bival in self.builtins_added.items():
759 for biname,bival in self.builtins_added.items():
760 if bival is Undefined:
760 if bival is Undefined:
761 del __builtin__.__dict__[biname]
761 del __builtin__.__dict__[biname]
762 else:
762 else:
763 __builtin__.__dict__[biname] = bival
763 __builtin__.__dict__[biname] = bival
764 self.builtins_added.clear()
764 self.builtins_added.clear()
765
765
766 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
766 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
767 """set_hook(name,hook) -> sets an internal IPython hook.
767 """set_hook(name,hook) -> sets an internal IPython hook.
768
768
769 IPython exposes some of its internal API as user-modifiable hooks. By
769 IPython exposes some of its internal API as user-modifiable hooks. By
770 adding your function to one of these hooks, you can modify IPython's
770 adding your function to one of these hooks, you can modify IPython's
771 behavior to call at runtime your own routines."""
771 behavior to call at runtime your own routines."""
772
772
773 # At some point in the future, this should validate the hook before it
773 # At some point in the future, this should validate the hook before it
774 # accepts it. Probably at least check that the hook takes the number
774 # accepts it. Probably at least check that the hook takes the number
775 # of args it's supposed to.
775 # of args it's supposed to.
776
776
777 f = new.instancemethod(hook,self,self.__class__)
777 f = new.instancemethod(hook,self,self.__class__)
778
778
779 # check if the hook is for strdispatcher first
779 # check if the hook is for strdispatcher first
780 if str_key is not None:
780 if str_key is not None:
781 sdp = self.strdispatchers.get(name, StrDispatch())
781 sdp = self.strdispatchers.get(name, StrDispatch())
782 sdp.add_s(str_key, f, priority )
782 sdp.add_s(str_key, f, priority )
783 self.strdispatchers[name] = sdp
783 self.strdispatchers[name] = sdp
784 return
784 return
785 if re_key is not None:
785 if re_key is not None:
786 sdp = self.strdispatchers.get(name, StrDispatch())
786 sdp = self.strdispatchers.get(name, StrDispatch())
787 sdp.add_re(re.compile(re_key), f, priority )
787 sdp.add_re(re.compile(re_key), f, priority )
788 self.strdispatchers[name] = sdp
788 self.strdispatchers[name] = sdp
789 return
789 return
790
790
791 dp = getattr(self.hooks, name, None)
791 dp = getattr(self.hooks, name, None)
792 if name not in IPython.hooks.__all__:
792 if name not in IPython.hooks.__all__:
793 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
793 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
794 if not dp:
794 if not dp:
795 dp = IPython.hooks.CommandChainDispatcher()
795 dp = IPython.hooks.CommandChainDispatcher()
796
796
797 try:
797 try:
798 dp.add(f,priority)
798 dp.add(f,priority)
799 except AttributeError:
799 except AttributeError:
800 # it was not commandchain, plain old func - replace
800 # it was not commandchain, plain old func - replace
801 dp = f
801 dp = f
802
802
803 setattr(self.hooks,name, dp)
803 setattr(self.hooks,name, dp)
804
804
805
805
806 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
806 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
807
807
808 def set_crash_handler(self,crashHandler):
808 def set_crash_handler(self,crashHandler):
809 """Set the IPython crash handler.
809 """Set the IPython crash handler.
810
810
811 This must be a callable with a signature suitable for use as
811 This must be a callable with a signature suitable for use as
812 sys.excepthook."""
812 sys.excepthook."""
813
813
814 # Install the given crash handler as the Python exception hook
814 # Install the given crash handler as the Python exception hook
815 sys.excepthook = crashHandler
815 sys.excepthook = crashHandler
816
816
817 # The instance will store a pointer to this, so that runtime code
817 # The instance will store a pointer to this, so that runtime code
818 # (such as magics) can access it. This is because during the
818 # (such as magics) can access it. This is because during the
819 # read-eval loop, it gets temporarily overwritten (to deal with GUI
819 # read-eval loop, it gets temporarily overwritten (to deal with GUI
820 # frameworks).
820 # frameworks).
821 self.sys_excepthook = sys.excepthook
821 self.sys_excepthook = sys.excepthook
822
822
823
823
824 def set_custom_exc(self,exc_tuple,handler):
824 def set_custom_exc(self,exc_tuple,handler):
825 """set_custom_exc(exc_tuple,handler)
825 """set_custom_exc(exc_tuple,handler)
826
826
827 Set a custom exception handler, which will be called if any of the
827 Set a custom exception handler, which will be called if any of the
828 exceptions in exc_tuple occur in the mainloop (specifically, in the
828 exceptions in exc_tuple occur in the mainloop (specifically, in the
829 runcode() method.
829 runcode() method.
830
830
831 Inputs:
831 Inputs:
832
832
833 - exc_tuple: a *tuple* of valid exceptions to call the defined
833 - exc_tuple: a *tuple* of valid exceptions to call the defined
834 handler for. It is very important that you use a tuple, and NOT A
834 handler for. It is very important that you use a tuple, and NOT A
835 LIST here, because of the way Python's except statement works. If
835 LIST here, because of the way Python's except statement works. If
836 you only want to trap a single exception, use a singleton tuple:
836 you only want to trap a single exception, use a singleton tuple:
837
837
838 exc_tuple == (MyCustomException,)
838 exc_tuple == (MyCustomException,)
839
839
840 - handler: this must be defined as a function with the following
840 - handler: this must be defined as a function with the following
841 basic interface: def my_handler(self,etype,value,tb).
841 basic interface: def my_handler(self,etype,value,tb).
842
842
843 This will be made into an instance method (via new.instancemethod)
843 This will be made into an instance method (via new.instancemethod)
844 of IPython itself, and it will be called if any of the exceptions
844 of IPython itself, and it will be called if any of the exceptions
845 listed in the exc_tuple are caught. If the handler is None, an
845 listed in the exc_tuple are caught. If the handler is None, an
846 internal basic one is used, which just prints basic info.
846 internal basic one is used, which just prints basic info.
847
847
848 WARNING: by putting in your own exception handler into IPython's main
848 WARNING: by putting in your own exception handler into IPython's main
849 execution loop, you run a very good chance of nasty crashes. This
849 execution loop, you run a very good chance of nasty crashes. This
850 facility should only be used if you really know what you are doing."""
850 facility should only be used if you really know what you are doing."""
851
851
852 assert type(exc_tuple)==type(()) , \
852 assert type(exc_tuple)==type(()) , \
853 "The custom exceptions must be given AS A TUPLE."
853 "The custom exceptions must be given AS A TUPLE."
854
854
855 def dummy_handler(self,etype,value,tb):
855 def dummy_handler(self,etype,value,tb):
856 print '*** Simple custom exception handler ***'
856 print '*** Simple custom exception handler ***'
857 print 'Exception type :',etype
857 print 'Exception type :',etype
858 print 'Exception value:',value
858 print 'Exception value:',value
859 print 'Traceback :',tb
859 print 'Traceback :',tb
860 print 'Source code :','\n'.join(self.buffer)
860 print 'Source code :','\n'.join(self.buffer)
861
861
862 if handler is None: handler = dummy_handler
862 if handler is None: handler = dummy_handler
863
863
864 self.CustomTB = new.instancemethod(handler,self,self.__class__)
864 self.CustomTB = new.instancemethod(handler,self,self.__class__)
865 self.custom_exceptions = exc_tuple
865 self.custom_exceptions = exc_tuple
866
866
867 def set_custom_completer(self,completer,pos=0):
867 def set_custom_completer(self,completer,pos=0):
868 """set_custom_completer(completer,pos=0)
868 """set_custom_completer(completer,pos=0)
869
869
870 Adds a new custom completer function.
870 Adds a new custom completer function.
871
871
872 The position argument (defaults to 0) is the index in the completers
872 The position argument (defaults to 0) is the index in the completers
873 list where you want the completer to be inserted."""
873 list where you want the completer to be inserted."""
874
874
875 newcomp = new.instancemethod(completer,self.Completer,
875 newcomp = new.instancemethod(completer,self.Completer,
876 self.Completer.__class__)
876 self.Completer.__class__)
877 self.Completer.matchers.insert(pos,newcomp)
877 self.Completer.matchers.insert(pos,newcomp)
878
878
879 def set_completer(self):
879 def set_completer(self):
880 """reset readline's completer to be our own."""
880 """reset readline's completer to be our own."""
881 self.readline.set_completer(self.Completer.complete)
881 self.readline.set_completer(self.Completer.complete)
882
882
883 def _get_call_pdb(self):
883 def _get_call_pdb(self):
884 return self._call_pdb
884 return self._call_pdb
885
885
886 def _set_call_pdb(self,val):
886 def _set_call_pdb(self,val):
887
887
888 if val not in (0,1,False,True):
888 if val not in (0,1,False,True):
889 raise ValueError,'new call_pdb value must be boolean'
889 raise ValueError,'new call_pdb value must be boolean'
890
890
891 # store value in instance
891 # store value in instance
892 self._call_pdb = val
892 self._call_pdb = val
893
893
894 # notify the actual exception handlers
894 # notify the actual exception handlers
895 self.InteractiveTB.call_pdb = val
895 self.InteractiveTB.call_pdb = val
896 if self.isthreaded:
896 if self.isthreaded:
897 try:
897 try:
898 self.sys_excepthook.call_pdb = val
898 self.sys_excepthook.call_pdb = val
899 except:
899 except:
900 warn('Failed to activate pdb for threaded exception handler')
900 warn('Failed to activate pdb for threaded exception handler')
901
901
902 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
902 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
903 'Control auto-activation of pdb at exceptions')
903 'Control auto-activation of pdb at exceptions')
904
904
905
905
906 # These special functions get installed in the builtin namespace, to
906 # These special functions get installed in the builtin namespace, to
907 # provide programmatic (pure python) access to magics, aliases and system
907 # provide programmatic (pure python) access to magics, aliases and system
908 # calls. This is important for logging, user scripting, and more.
908 # calls. This is important for logging, user scripting, and more.
909
909
910 # We are basically exposing, via normal python functions, the three
910 # We are basically exposing, via normal python functions, the three
911 # mechanisms in which ipython offers special call modes (magics for
911 # mechanisms in which ipython offers special call modes (magics for
912 # internal control, aliases for direct system access via pre-selected
912 # internal control, aliases for direct system access via pre-selected
913 # names, and !cmd for calling arbitrary system commands).
913 # names, and !cmd for calling arbitrary system commands).
914
914
915 def ipmagic(self,arg_s):
915 def ipmagic(self,arg_s):
916 """Call a magic function by name.
916 """Call a magic function by name.
917
917
918 Input: a string containing the name of the magic function to call and any
918 Input: a string containing the name of the magic function to call and any
919 additional arguments to be passed to the magic.
919 additional arguments to be passed to the magic.
920
920
921 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
921 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
922 prompt:
922 prompt:
923
923
924 In[1]: %name -opt foo bar
924 In[1]: %name -opt foo bar
925
925
926 To call a magic without arguments, simply use ipmagic('name').
926 To call a magic without arguments, simply use ipmagic('name').
927
927
928 This provides a proper Python function to call IPython's magics in any
928 This provides a proper Python function to call IPython's magics in any
929 valid Python code you can type at the interpreter, including loops and
929 valid Python code you can type at the interpreter, including loops and
930 compound statements. It is added by IPython to the Python builtin
930 compound statements. It is added by IPython to the Python builtin
931 namespace upon initialization."""
931 namespace upon initialization."""
932
932
933 args = arg_s.split(' ',1)
933 args = arg_s.split(' ',1)
934 magic_name = args[0]
934 magic_name = args[0]
935 magic_name = magic_name.lstrip(self.ESC_MAGIC)
935 magic_name = magic_name.lstrip(self.ESC_MAGIC)
936
936
937 try:
937 try:
938 magic_args = args[1]
938 magic_args = args[1]
939 except IndexError:
939 except IndexError:
940 magic_args = ''
940 magic_args = ''
941 fn = getattr(self,'magic_'+magic_name,None)
941 fn = getattr(self,'magic_'+magic_name,None)
942 if fn is None:
942 if fn is None:
943 error("Magic function `%s` not found." % magic_name)
943 error("Magic function `%s` not found." % magic_name)
944 else:
944 else:
945 magic_args = self.var_expand(magic_args,1)
945 magic_args = self.var_expand(magic_args,1)
946 return fn(magic_args)
946 return fn(magic_args)
947
947
948 def ipalias(self,arg_s):
948 def ipalias(self,arg_s):
949 """Call an alias by name.
949 """Call an alias by name.
950
950
951 Input: a string containing the name of the alias to call and any
951 Input: a string containing the name of the alias to call and any
952 additional arguments to be passed to the magic.
952 additional arguments to be passed to the magic.
953
953
954 ipalias('name -opt foo bar') is equivalent to typing at the ipython
954 ipalias('name -opt foo bar') is equivalent to typing at the ipython
955 prompt:
955 prompt:
956
956
957 In[1]: name -opt foo bar
957 In[1]: name -opt foo bar
958
958
959 To call an alias without arguments, simply use ipalias('name').
959 To call an alias without arguments, simply use ipalias('name').
960
960
961 This provides a proper Python function to call IPython's aliases in any
961 This provides a proper Python function to call IPython's aliases in any
962 valid Python code you can type at the interpreter, including loops and
962 valid Python code you can type at the interpreter, including loops and
963 compound statements. It is added by IPython to the Python builtin
963 compound statements. It is added by IPython to the Python builtin
964 namespace upon initialization."""
964 namespace upon initialization."""
965
965
966 args = arg_s.split(' ',1)
966 args = arg_s.split(' ',1)
967 alias_name = args[0]
967 alias_name = args[0]
968 try:
968 try:
969 alias_args = args[1]
969 alias_args = args[1]
970 except IndexError:
970 except IndexError:
971 alias_args = ''
971 alias_args = ''
972 if alias_name in self.alias_table:
972 if alias_name in self.alias_table:
973 self.call_alias(alias_name,alias_args)
973 self.call_alias(alias_name,alias_args)
974 else:
974 else:
975 error("Alias `%s` not found." % alias_name)
975 error("Alias `%s` not found." % alias_name)
976
976
977 def ipsystem(self,arg_s):
977 def ipsystem(self,arg_s):
978 """Make a system call, using IPython."""
978 """Make a system call, using IPython."""
979
979
980 self.system(arg_s)
980 self.system(arg_s)
981
981
982 def complete(self,text):
982 def complete(self,text):
983 """Return a sorted list of all possible completions on text.
983 """Return a sorted list of all possible completions on text.
984
984
985 Inputs:
985 Inputs:
986
986
987 - text: a string of text to be completed on.
987 - text: a string of text to be completed on.
988
988
989 This is a wrapper around the completion mechanism, similar to what
989 This is a wrapper around the completion mechanism, similar to what
990 readline does at the command line when the TAB key is hit. By
990 readline does at the command line when the TAB key is hit. By
991 exposing it as a method, it can be used by other non-readline
991 exposing it as a method, it can be used by other non-readline
992 environments (such as GUIs) for text completion.
992 environments (such as GUIs) for text completion.
993
993
994 Simple usage example:
994 Simple usage example:
995
995
996 In [1]: x = 'hello'
996 In [1]: x = 'hello'
997
997
998 In [2]: __IP.complete('x.l')
998 In [2]: __IP.complete('x.l')
999 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
999 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1000
1000
1001 complete = self.Completer.complete
1001 complete = self.Completer.complete
1002 state = 0
1002 state = 0
1003 # use a dict so we get unique keys, since ipyhton's multiple
1003 # use a dict so we get unique keys, since ipyhton's multiple
1004 # completers can return duplicates. When we make 2.4 a requirement,
1004 # completers can return duplicates. When we make 2.4 a requirement,
1005 # start using sets instead, which are faster.
1005 # start using sets instead, which are faster.
1006 comps = {}
1006 comps = {}
1007 while True:
1007 while True:
1008 newcomp = complete(text,state,line_buffer=text)
1008 newcomp = complete(text,state,line_buffer=text)
1009 if newcomp is None:
1009 if newcomp is None:
1010 break
1010 break
1011 comps[newcomp] = 1
1011 comps[newcomp] = 1
1012 state += 1
1012 state += 1
1013 outcomps = comps.keys()
1013 outcomps = comps.keys()
1014 outcomps.sort()
1014 outcomps.sort()
1015 return outcomps
1015 return outcomps
1016
1016
1017 def set_completer_frame(self, frame=None):
1017 def set_completer_frame(self, frame=None):
1018 if frame:
1018 if frame:
1019 self.Completer.namespace = frame.f_locals
1019 self.Completer.namespace = frame.f_locals
1020 self.Completer.global_namespace = frame.f_globals
1020 self.Completer.global_namespace = frame.f_globals
1021 else:
1021 else:
1022 self.Completer.namespace = self.user_ns
1022 self.Completer.namespace = self.user_ns
1023 self.Completer.global_namespace = self.user_global_ns
1023 self.Completer.global_namespace = self.user_global_ns
1024
1024
1025 def init_auto_alias(self):
1025 def init_auto_alias(self):
1026 """Define some aliases automatically.
1026 """Define some aliases automatically.
1027
1027
1028 These are ALL parameter-less aliases"""
1028 These are ALL parameter-less aliases"""
1029
1029
1030 for alias,cmd in self.auto_alias:
1030 for alias,cmd in self.auto_alias:
1031 self.getapi().defalias(alias,cmd)
1031 self.getapi().defalias(alias,cmd)
1032
1032
1033
1033
1034 def alias_table_validate(self,verbose=0):
1034 def alias_table_validate(self,verbose=0):
1035 """Update information about the alias table.
1035 """Update information about the alias table.
1036
1036
1037 In particular, make sure no Python keywords/builtins are in it."""
1037 In particular, make sure no Python keywords/builtins are in it."""
1038
1038
1039 no_alias = self.no_alias
1039 no_alias = self.no_alias
1040 for k in self.alias_table.keys():
1040 for k in self.alias_table.keys():
1041 if k in no_alias:
1041 if k in no_alias:
1042 del self.alias_table[k]
1042 del self.alias_table[k]
1043 if verbose:
1043 if verbose:
1044 print ("Deleting alias <%s>, it's a Python "
1044 print ("Deleting alias <%s>, it's a Python "
1045 "keyword or builtin." % k)
1045 "keyword or builtin." % k)
1046
1046
1047 def set_autoindent(self,value=None):
1047 def set_autoindent(self,value=None):
1048 """Set the autoindent flag, checking for readline support.
1048 """Set the autoindent flag, checking for readline support.
1049
1049
1050 If called with no arguments, it acts as a toggle."""
1050 If called with no arguments, it acts as a toggle."""
1051
1051
1052 if not self.has_readline:
1052 if not self.has_readline:
1053 if os.name == 'posix':
1053 if os.name == 'posix':
1054 warn("The auto-indent feature requires the readline library")
1054 warn("The auto-indent feature requires the readline library")
1055 self.autoindent = 0
1055 self.autoindent = 0
1056 return
1056 return
1057 if value is None:
1057 if value is None:
1058 self.autoindent = not self.autoindent
1058 self.autoindent = not self.autoindent
1059 else:
1059 else:
1060 self.autoindent = value
1060 self.autoindent = value
1061
1061
1062 def rc_set_toggle(self,rc_field,value=None):
1062 def rc_set_toggle(self,rc_field,value=None):
1063 """Set or toggle a field in IPython's rc config. structure.
1063 """Set or toggle a field in IPython's rc config. structure.
1064
1064
1065 If called with no arguments, it acts as a toggle.
1065 If called with no arguments, it acts as a toggle.
1066
1066
1067 If called with a non-existent field, the resulting AttributeError
1067 If called with a non-existent field, the resulting AttributeError
1068 exception will propagate out."""
1068 exception will propagate out."""
1069
1069
1070 rc_val = getattr(self.rc,rc_field)
1070 rc_val = getattr(self.rc,rc_field)
1071 if value is None:
1071 if value is None:
1072 value = not rc_val
1072 value = not rc_val
1073 setattr(self.rc,rc_field,value)
1073 setattr(self.rc,rc_field,value)
1074
1074
1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1076 """Install the user configuration directory.
1076 """Install the user configuration directory.
1077
1077
1078 Can be called when running for the first time or to upgrade the user's
1078 Can be called when running for the first time or to upgrade the user's
1079 .ipython/ directory with the mode parameter. Valid modes are 'install'
1079 .ipython/ directory with the mode parameter. Valid modes are 'install'
1080 and 'upgrade'."""
1080 and 'upgrade'."""
1081
1081
1082 def wait():
1082 def wait():
1083 try:
1083 try:
1084 raw_input("Please press <RETURN> to start IPython.")
1084 raw_input("Please press <RETURN> to start IPython.")
1085 except EOFError:
1085 except EOFError:
1086 print >> Term.cout
1086 print >> Term.cout
1087 print '*'*70
1087 print '*'*70
1088
1088
1089 cwd = os.getcwd() # remember where we started
1089 cwd = os.getcwd() # remember where we started
1090 glb = glob.glob
1090 glb = glob.glob
1091 print '*'*70
1091 print '*'*70
1092 if mode == 'install':
1092 if mode == 'install':
1093 print \
1093 print \
1094 """Welcome to IPython. I will try to create a personal configuration directory
1094 """Welcome to IPython. I will try to create a personal configuration directory
1095 where you can customize many aspects of IPython's functionality in:\n"""
1095 where you can customize many aspects of IPython's functionality in:\n"""
1096 else:
1096 else:
1097 print 'I am going to upgrade your configuration in:'
1097 print 'I am going to upgrade your configuration in:'
1098
1098
1099 print ipythondir
1099 print ipythondir
1100
1100
1101 rcdirend = os.path.join('IPython','UserConfig')
1101 rcdirend = os.path.join('IPython','UserConfig')
1102 cfg = lambda d: os.path.join(d,rcdirend)
1102 cfg = lambda d: os.path.join(d,rcdirend)
1103 try:
1103 try:
1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1105 except IOError:
1105 except IOError:
1106 warning = """
1106 warning = """
1107 Installation error. IPython's directory was not found.
1107 Installation error. IPython's directory was not found.
1108
1108
1109 Check the following:
1109 Check the following:
1110
1110
1111 The ipython/IPython directory should be in a directory belonging to your
1111 The ipython/IPython directory should be in a directory belonging to your
1112 PYTHONPATH environment variable (that is, it should be in a directory
1112 PYTHONPATH environment variable (that is, it should be in a directory
1113 belonging to sys.path). You can copy it explicitly there or just link to it.
1113 belonging to sys.path). You can copy it explicitly there or just link to it.
1114
1114
1115 IPython will proceed with builtin defaults.
1115 IPython will proceed with builtin defaults.
1116 """
1116 """
1117 warn(warning)
1117 warn(warning)
1118 wait()
1118 wait()
1119 return
1119 return
1120
1120
1121 if mode == 'install':
1121 if mode == 'install':
1122 try:
1122 try:
1123 shutil.copytree(rcdir,ipythondir)
1123 shutil.copytree(rcdir,ipythondir)
1124 os.chdir(ipythondir)
1124 os.chdir(ipythondir)
1125 rc_files = glb("ipythonrc*")
1125 rc_files = glb("ipythonrc*")
1126 for rc_file in rc_files:
1126 for rc_file in rc_files:
1127 os.rename(rc_file,rc_file+rc_suffix)
1127 os.rename(rc_file,rc_file+rc_suffix)
1128 except:
1128 except:
1129 warning = """
1129 warning = """
1130
1130
1131 There was a problem with the installation:
1131 There was a problem with the installation:
1132 %s
1132 %s
1133 Try to correct it or contact the developers if you think it's a bug.
1133 Try to correct it or contact the developers if you think it's a bug.
1134 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1134 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1135 warn(warning)
1135 warn(warning)
1136 wait()
1136 wait()
1137 return
1137 return
1138
1138
1139 elif mode == 'upgrade':
1139 elif mode == 'upgrade':
1140 try:
1140 try:
1141 os.chdir(ipythondir)
1141 os.chdir(ipythondir)
1142 except:
1142 except:
1143 print """
1143 print """
1144 Can not upgrade: changing to directory %s failed. Details:
1144 Can not upgrade: changing to directory %s failed. Details:
1145 %s
1145 %s
1146 """ % (ipythondir,sys.exc_info()[1])
1146 """ % (ipythondir,sys.exc_info()[1])
1147 wait()
1147 wait()
1148 return
1148 return
1149 else:
1149 else:
1150 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1150 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1151 for new_full_path in sources:
1151 for new_full_path in sources:
1152 new_filename = os.path.basename(new_full_path)
1152 new_filename = os.path.basename(new_full_path)
1153 if new_filename.startswith('ipythonrc'):
1153 if new_filename.startswith('ipythonrc'):
1154 new_filename = new_filename + rc_suffix
1154 new_filename = new_filename + rc_suffix
1155 # The config directory should only contain files, skip any
1155 # The config directory should only contain files, skip any
1156 # directories which may be there (like CVS)
1156 # directories which may be there (like CVS)
1157 if os.path.isdir(new_full_path):
1157 if os.path.isdir(new_full_path):
1158 continue
1158 continue
1159 if os.path.exists(new_filename):
1159 if os.path.exists(new_filename):
1160 old_file = new_filename+'.old'
1160 old_file = new_filename+'.old'
1161 if os.path.exists(old_file):
1161 if os.path.exists(old_file):
1162 os.remove(old_file)
1162 os.remove(old_file)
1163 os.rename(new_filename,old_file)
1163 os.rename(new_filename,old_file)
1164 shutil.copy(new_full_path,new_filename)
1164 shutil.copy(new_full_path,new_filename)
1165 else:
1165 else:
1166 raise ValueError,'unrecognized mode for install:',`mode`
1166 raise ValueError,'unrecognized mode for install:',`mode`
1167
1167
1168 # Fix line-endings to those native to each platform in the config
1168 # Fix line-endings to those native to each platform in the config
1169 # directory.
1169 # directory.
1170 try:
1170 try:
1171 os.chdir(ipythondir)
1171 os.chdir(ipythondir)
1172 except:
1172 except:
1173 print """
1173 print """
1174 Problem: changing to directory %s failed.
1174 Problem: changing to directory %s failed.
1175 Details:
1175 Details:
1176 %s
1176 %s
1177
1177
1178 Some configuration files may have incorrect line endings. This should not
1178 Some configuration files may have incorrect line endings. This should not
1179 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1179 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1180 wait()
1180 wait()
1181 else:
1181 else:
1182 for fname in glb('ipythonrc*'):
1182 for fname in glb('ipythonrc*'):
1183 try:
1183 try:
1184 native_line_ends(fname,backup=0)
1184 native_line_ends(fname,backup=0)
1185 except IOError:
1185 except IOError:
1186 pass
1186 pass
1187
1187
1188 if mode == 'install':
1188 if mode == 'install':
1189 print """
1189 print """
1190 Successful installation!
1190 Successful installation!
1191
1191
1192 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1192 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1193 IPython manual (there are both HTML and PDF versions supplied with the
1193 IPython manual (there are both HTML and PDF versions supplied with the
1194 distribution) to make sure that your system environment is properly configured
1194 distribution) to make sure that your system environment is properly configured
1195 to take advantage of IPython's features.
1195 to take advantage of IPython's features.
1196
1196
1197 Important note: the configuration system has changed! The old system is
1197 Important note: the configuration system has changed! The old system is
1198 still in place, but its setting may be partly overridden by the settings in
1198 still in place, but its setting may be partly overridden by the settings in
1199 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1199 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1200 if some of the new settings bother you.
1200 if some of the new settings bother you.
1201
1201
1202 """
1202 """
1203 else:
1203 else:
1204 print """
1204 print """
1205 Successful upgrade!
1205 Successful upgrade!
1206
1206
1207 All files in your directory:
1207 All files in your directory:
1208 %(ipythondir)s
1208 %(ipythondir)s
1209 which would have been overwritten by the upgrade were backed up with a .old
1209 which would have been overwritten by the upgrade were backed up with a .old
1210 extension. If you had made particular customizations in those files you may
1210 extension. If you had made particular customizations in those files you may
1211 want to merge them back into the new files.""" % locals()
1211 want to merge them back into the new files.""" % locals()
1212 wait()
1212 wait()
1213 os.chdir(cwd)
1213 os.chdir(cwd)
1214 # end user_setup()
1214 # end user_setup()
1215
1215
1216 def atexit_operations(self):
1216 def atexit_operations(self):
1217 """This will be executed at the time of exit.
1217 """This will be executed at the time of exit.
1218
1218
1219 Saving of persistent data should be performed here. """
1219 Saving of persistent data should be performed here. """
1220
1220
1221 #print '*** IPython exit cleanup ***' # dbg
1221 #print '*** IPython exit cleanup ***' # dbg
1222 # input history
1222 # input history
1223 self.savehist()
1223 self.savehist()
1224
1224
1225 # Cleanup all tempfiles left around
1225 # Cleanup all tempfiles left around
1226 for tfile in self.tempfiles:
1226 for tfile in self.tempfiles:
1227 try:
1227 try:
1228 os.unlink(tfile)
1228 os.unlink(tfile)
1229 except OSError:
1229 except OSError:
1230 pass
1230 pass
1231
1231
1232 self.hooks.shutdown_hook()
1232 self.hooks.shutdown_hook()
1233
1233
1234 def savehist(self):
1234 def savehist(self):
1235 """Save input history to a file (via readline library)."""
1235 """Save input history to a file (via readline library)."""
1236 try:
1236 try:
1237 self.readline.write_history_file(self.histfile)
1237 self.readline.write_history_file(self.histfile)
1238 except:
1238 except:
1239 print 'Unable to save IPython command history to file: ' + \
1239 print 'Unable to save IPython command history to file: ' + \
1240 `self.histfile`
1240 `self.histfile`
1241
1241
1242 def reloadhist(self):
1242 def reloadhist(self):
1243 """Reload the input history from disk file."""
1243 """Reload the input history from disk file."""
1244
1244
1245 if self.has_readline:
1245 if self.has_readline:
1246 self.readline.clear_history()
1246 self.readline.clear_history()
1247 self.readline.read_history_file(self.shell.histfile)
1247 self.readline.read_history_file(self.shell.histfile)
1248
1248
1249 def history_saving_wrapper(self, func):
1249 def history_saving_wrapper(self, func):
1250 """ Wrap func for readline history saving
1250 """ Wrap func for readline history saving
1251
1251
1252 Convert func into callable that saves & restores
1252 Convert func into callable that saves & restores
1253 history around the call """
1253 history around the call """
1254
1254
1255 if not self.has_readline:
1255 if not self.has_readline:
1256 return func
1256 return func
1257
1257
1258 def wrapper():
1258 def wrapper():
1259 self.savehist()
1259 self.savehist()
1260 try:
1260 try:
1261 func()
1261 func()
1262 finally:
1262 finally:
1263 readline.read_history_file(self.histfile)
1263 readline.read_history_file(self.histfile)
1264 return wrapper
1264 return wrapper
1265
1265
1266
1266
1267 def pre_readline(self):
1267 def pre_readline(self):
1268 """readline hook to be used at the start of each line.
1268 """readline hook to be used at the start of each line.
1269
1269
1270 Currently it handles auto-indent only."""
1270 Currently it handles auto-indent only."""
1271
1271
1272 #debugx('self.indent_current_nsp','pre_readline:')
1272 #debugx('self.indent_current_nsp','pre_readline:')
1273
1273
1274 if self.rl_do_indent:
1274 if self.rl_do_indent:
1275 self.readline.insert_text(self.indent_current_str())
1275 self.readline.insert_text(self.indent_current_str())
1276 if self.rl_next_input is not None:
1276 if self.rl_next_input is not None:
1277 self.readline.insert_text(self.rl_next_input)
1277 self.readline.insert_text(self.rl_next_input)
1278 self.rl_next_input = None
1278 self.rl_next_input = None
1279
1279
1280 def init_readline(self):
1280 def init_readline(self):
1281 """Command history completion/saving/reloading."""
1281 """Command history completion/saving/reloading."""
1282
1282
1283
1283
1284 import IPython.rlineimpl as readline
1284 import IPython.rlineimpl as readline
1285
1285
1286 if not readline.have_readline:
1286 if not readline.have_readline:
1287 self.has_readline = 0
1287 self.has_readline = 0
1288 self.readline = None
1288 self.readline = None
1289 # no point in bugging windows users with this every time:
1289 # no point in bugging windows users with this every time:
1290 warn('Readline services not available on this platform.')
1290 warn('Readline services not available on this platform.')
1291 else:
1291 else:
1292 sys.modules['readline'] = readline
1292 sys.modules['readline'] = readline
1293 import atexit
1293 import atexit
1294 from IPython.completer import IPCompleter
1294 from IPython.completer import IPCompleter
1295 self.Completer = IPCompleter(self,
1295 self.Completer = IPCompleter(self,
1296 self.user_ns,
1296 self.user_ns,
1297 self.user_global_ns,
1297 self.user_global_ns,
1298 self.rc.readline_omit__names,
1298 self.rc.readline_omit__names,
1299 self.alias_table)
1299 self.alias_table)
1300 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1300 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1301 self.strdispatchers['complete_command'] = sdisp
1301 self.strdispatchers['complete_command'] = sdisp
1302 self.Completer.custom_completers = sdisp
1302 self.Completer.custom_completers = sdisp
1303 # Platform-specific configuration
1303 # Platform-specific configuration
1304 if os.name == 'nt':
1304 if os.name == 'nt':
1305 self.readline_startup_hook = readline.set_pre_input_hook
1305 self.readline_startup_hook = readline.set_pre_input_hook
1306 else:
1306 else:
1307 self.readline_startup_hook = readline.set_startup_hook
1307 self.readline_startup_hook = readline.set_startup_hook
1308
1308
1309 # Load user's initrc file (readline config)
1309 # Load user's initrc file (readline config)
1310 inputrc_name = os.environ.get('INPUTRC')
1310 inputrc_name = os.environ.get('INPUTRC')
1311 if inputrc_name is None:
1311 if inputrc_name is None:
1312 home_dir = get_home_dir()
1312 home_dir = get_home_dir()
1313 if home_dir is not None:
1313 if home_dir is not None:
1314 inputrc_name = os.path.join(home_dir,'.inputrc')
1314 inputrc_name = os.path.join(home_dir,'.inputrc')
1315 if os.path.isfile(inputrc_name):
1315 if os.path.isfile(inputrc_name):
1316 try:
1316 try:
1317 readline.read_init_file(inputrc_name)
1317 readline.read_init_file(inputrc_name)
1318 except:
1318 except:
1319 warn('Problems reading readline initialization file <%s>'
1319 warn('Problems reading readline initialization file <%s>'
1320 % inputrc_name)
1320 % inputrc_name)
1321
1321
1322 self.has_readline = 1
1322 self.has_readline = 1
1323 self.readline = readline
1323 self.readline = readline
1324 # save this in sys so embedded copies can restore it properly
1324 # save this in sys so embedded copies can restore it properly
1325 sys.ipcompleter = self.Completer.complete
1325 sys.ipcompleter = self.Completer.complete
1326 self.set_completer()
1326 self.set_completer()
1327
1327
1328 # Configure readline according to user's prefs
1328 # Configure readline according to user's prefs
1329 for rlcommand in self.rc.readline_parse_and_bind:
1329 for rlcommand in self.rc.readline_parse_and_bind:
1330 readline.parse_and_bind(rlcommand)
1330 readline.parse_and_bind(rlcommand)
1331
1331
1332 # remove some chars from the delimiters list
1332 # remove some chars from the delimiters list
1333 delims = readline.get_completer_delims()
1333 delims = readline.get_completer_delims()
1334 delims = delims.translate(string._idmap,
1334 delims = delims.translate(string._idmap,
1335 self.rc.readline_remove_delims)
1335 self.rc.readline_remove_delims)
1336 readline.set_completer_delims(delims)
1336 readline.set_completer_delims(delims)
1337 # otherwise we end up with a monster history after a while:
1337 # otherwise we end up with a monster history after a while:
1338 readline.set_history_length(1000)
1338 readline.set_history_length(1000)
1339 try:
1339 try:
1340 #print '*** Reading readline history' # dbg
1340 #print '*** Reading readline history' # dbg
1341 readline.read_history_file(self.histfile)
1341 readline.read_history_file(self.histfile)
1342 except IOError:
1342 except IOError:
1343 pass # It doesn't exist yet.
1343 pass # It doesn't exist yet.
1344
1344
1345 atexit.register(self.atexit_operations)
1345 atexit.register(self.atexit_operations)
1346 del atexit
1346 del atexit
1347
1347
1348 # Configure auto-indent for all platforms
1348 # Configure auto-indent for all platforms
1349 self.set_autoindent(self.rc.autoindent)
1349 self.set_autoindent(self.rc.autoindent)
1350
1350
1351 def ask_yes_no(self,prompt,default=True):
1351 def ask_yes_no(self,prompt,default=True):
1352 if self.rc.quiet:
1352 if self.rc.quiet:
1353 return True
1353 return True
1354 return ask_yes_no(prompt,default)
1354 return ask_yes_no(prompt,default)
1355
1355
1356 def _should_recompile(self,e):
1356 def _should_recompile(self,e):
1357 """Utility routine for edit_syntax_error"""
1357 """Utility routine for edit_syntax_error"""
1358
1358
1359 if e.filename in ('<ipython console>','<input>','<string>',
1359 if e.filename in ('<ipython console>','<input>','<string>',
1360 '<console>','<BackgroundJob compilation>',
1360 '<console>','<BackgroundJob compilation>',
1361 None):
1361 None):
1362
1362
1363 return False
1363 return False
1364 try:
1364 try:
1365 if (self.rc.autoedit_syntax and
1365 if (self.rc.autoedit_syntax and
1366 not self.ask_yes_no('Return to editor to correct syntax error? '
1366 not self.ask_yes_no('Return to editor to correct syntax error? '
1367 '[Y/n] ','y')):
1367 '[Y/n] ','y')):
1368 return False
1368 return False
1369 except EOFError:
1369 except EOFError:
1370 return False
1370 return False
1371
1371
1372 def int0(x):
1372 def int0(x):
1373 try:
1373 try:
1374 return int(x)
1374 return int(x)
1375 except TypeError:
1375 except TypeError:
1376 return 0
1376 return 0
1377 # always pass integer line and offset values to editor hook
1377 # always pass integer line and offset values to editor hook
1378 self.hooks.fix_error_editor(e.filename,
1378 self.hooks.fix_error_editor(e.filename,
1379 int0(e.lineno),int0(e.offset),e.msg)
1379 int0(e.lineno),int0(e.offset),e.msg)
1380 return True
1380 return True
1381
1381
1382 def edit_syntax_error(self):
1382 def edit_syntax_error(self):
1383 """The bottom half of the syntax error handler called in the main loop.
1383 """The bottom half of the syntax error handler called in the main loop.
1384
1384
1385 Loop until syntax error is fixed or user cancels.
1385 Loop until syntax error is fixed or user cancels.
1386 """
1386 """
1387
1387
1388 while self.SyntaxTB.last_syntax_error:
1388 while self.SyntaxTB.last_syntax_error:
1389 # copy and clear last_syntax_error
1389 # copy and clear last_syntax_error
1390 err = self.SyntaxTB.clear_err_state()
1390 err = self.SyntaxTB.clear_err_state()
1391 if not self._should_recompile(err):
1391 if not self._should_recompile(err):
1392 return
1392 return
1393 try:
1393 try:
1394 # may set last_syntax_error again if a SyntaxError is raised
1394 # may set last_syntax_error again if a SyntaxError is raised
1395 self.safe_execfile(err.filename,self.user_ns)
1395 self.safe_execfile(err.filename,self.user_ns)
1396 except:
1396 except:
1397 self.showtraceback()
1397 self.showtraceback()
1398 else:
1398 else:
1399 try:
1399 try:
1400 f = file(err.filename)
1400 f = file(err.filename)
1401 try:
1401 try:
1402 sys.displayhook(f.read())
1402 sys.displayhook(f.read())
1403 finally:
1403 finally:
1404 f.close()
1404 f.close()
1405 except:
1405 except:
1406 self.showtraceback()
1406 self.showtraceback()
1407
1407
1408 def showsyntaxerror(self, filename=None):
1408 def showsyntaxerror(self, filename=None):
1409 """Display the syntax error that just occurred.
1409 """Display the syntax error that just occurred.
1410
1410
1411 This doesn't display a stack trace because there isn't one.
1411 This doesn't display a stack trace because there isn't one.
1412
1412
1413 If a filename is given, it is stuffed in the exception instead
1413 If a filename is given, it is stuffed in the exception instead
1414 of what was there before (because Python's parser always uses
1414 of what was there before (because Python's parser always uses
1415 "<string>" when reading from a string).
1415 "<string>" when reading from a string).
1416 """
1416 """
1417 etype, value, last_traceback = sys.exc_info()
1417 etype, value, last_traceback = sys.exc_info()
1418
1418
1419 # See note about these variables in showtraceback() below
1419 # See note about these variables in showtraceback() below
1420 sys.last_type = etype
1420 sys.last_type = etype
1421 sys.last_value = value
1421 sys.last_value = value
1422 sys.last_traceback = last_traceback
1422 sys.last_traceback = last_traceback
1423
1423
1424 if filename and etype is SyntaxError:
1424 if filename and etype is SyntaxError:
1425 # Work hard to stuff the correct filename in the exception
1425 # Work hard to stuff the correct filename in the exception
1426 try:
1426 try:
1427 msg, (dummy_filename, lineno, offset, line) = value
1427 msg, (dummy_filename, lineno, offset, line) = value
1428 except:
1428 except:
1429 # Not the format we expect; leave it alone
1429 # Not the format we expect; leave it alone
1430 pass
1430 pass
1431 else:
1431 else:
1432 # Stuff in the right filename
1432 # Stuff in the right filename
1433 try:
1433 try:
1434 # Assume SyntaxError is a class exception
1434 # Assume SyntaxError is a class exception
1435 value = SyntaxError(msg, (filename, lineno, offset, line))
1435 value = SyntaxError(msg, (filename, lineno, offset, line))
1436 except:
1436 except:
1437 # If that failed, assume SyntaxError is a string
1437 # If that failed, assume SyntaxError is a string
1438 value = msg, (filename, lineno, offset, line)
1438 value = msg, (filename, lineno, offset, line)
1439 self.SyntaxTB(etype,value,[])
1439 self.SyntaxTB(etype,value,[])
1440
1440
1441 def debugger(self,force=False):
1441 def debugger(self,force=False):
1442 """Call the pydb/pdb debugger.
1442 """Call the pydb/pdb debugger.
1443
1443
1444 Keywords:
1444 Keywords:
1445
1445
1446 - force(False): by default, this routine checks the instance call_pdb
1446 - force(False): by default, this routine checks the instance call_pdb
1447 flag and does not actually invoke the debugger if the flag is false.
1447 flag and does not actually invoke the debugger if the flag is false.
1448 The 'force' option forces the debugger to activate even if the flag
1448 The 'force' option forces the debugger to activate even if the flag
1449 is false.
1449 is false.
1450 """
1450 """
1451
1451
1452 if not (force or self.call_pdb):
1452 if not (force or self.call_pdb):
1453 return
1453 return
1454
1454
1455 if not hasattr(sys,'last_traceback'):
1455 if not hasattr(sys,'last_traceback'):
1456 error('No traceback has been produced, nothing to debug.')
1456 error('No traceback has been produced, nothing to debug.')
1457 return
1457 return
1458
1458
1459 # use pydb if available
1459 # use pydb if available
1460 if Debugger.has_pydb:
1460 if Debugger.has_pydb:
1461 from pydb import pm
1461 from pydb import pm
1462 else:
1462 else:
1463 # fallback to our internal debugger
1463 # fallback to our internal debugger
1464 pm = lambda : self.InteractiveTB.debugger(force=True)
1464 pm = lambda : self.InteractiveTB.debugger(force=True)
1465 self.history_saving_wrapper(pm)()
1465 self.history_saving_wrapper(pm)()
1466
1466
1467 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1467 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1468 """Display the exception that just occurred.
1468 """Display the exception that just occurred.
1469
1469
1470 If nothing is known about the exception, this is the method which
1470 If nothing is known about the exception, this is the method which
1471 should be used throughout the code for presenting user tracebacks,
1471 should be used throughout the code for presenting user tracebacks,
1472 rather than directly invoking the InteractiveTB object.
1472 rather than directly invoking the InteractiveTB object.
1473
1473
1474 A specific showsyntaxerror() also exists, but this method can take
1474 A specific showsyntaxerror() also exists, but this method can take
1475 care of calling it if needed, so unless you are explicitly catching a
1475 care of calling it if needed, so unless you are explicitly catching a
1476 SyntaxError exception, don't try to analyze the stack manually and
1476 SyntaxError exception, don't try to analyze the stack manually and
1477 simply call this method."""
1477 simply call this method."""
1478
1478
1479
1479
1480 # Though this won't be called by syntax errors in the input line,
1480 # Though this won't be called by syntax errors in the input line,
1481 # there may be SyntaxError cases whith imported code.
1481 # there may be SyntaxError cases whith imported code.
1482
1482
1483
1483
1484 if exc_tuple is None:
1484 if exc_tuple is None:
1485 etype, value, tb = sys.exc_info()
1485 etype, value, tb = sys.exc_info()
1486 else:
1486 else:
1487 etype, value, tb = exc_tuple
1487 etype, value, tb = exc_tuple
1488
1488
1489 if etype is SyntaxError:
1489 if etype is SyntaxError:
1490 self.showsyntaxerror(filename)
1490 self.showsyntaxerror(filename)
1491 else:
1491 else:
1492 # WARNING: these variables are somewhat deprecated and not
1492 # WARNING: these variables are somewhat deprecated and not
1493 # necessarily safe to use in a threaded environment, but tools
1493 # necessarily safe to use in a threaded environment, but tools
1494 # like pdb depend on their existence, so let's set them. If we
1494 # like pdb depend on their existence, so let's set them. If we
1495 # find problems in the field, we'll need to revisit their use.
1495 # find problems in the field, we'll need to revisit their use.
1496 sys.last_type = etype
1496 sys.last_type = etype
1497 sys.last_value = value
1497 sys.last_value = value
1498 sys.last_traceback = tb
1498 sys.last_traceback = tb
1499
1499
1500 if etype in self.custom_exceptions:
1500 if etype in self.custom_exceptions:
1501 self.CustomTB(etype,value,tb)
1501 self.CustomTB(etype,value,tb)
1502 else:
1502 else:
1503 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1503 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1504 if self.InteractiveTB.call_pdb and self.has_readline:
1504 if self.InteractiveTB.call_pdb and self.has_readline:
1505 # pdb mucks up readline, fix it back
1505 # pdb mucks up readline, fix it back
1506 self.set_completer()
1506 self.set_completer()
1507
1507
1508
1508
1509 def mainloop(self,banner=None):
1509 def mainloop(self,banner=None):
1510 """Creates the local namespace and starts the mainloop.
1510 """Creates the local namespace and starts the mainloop.
1511
1511
1512 If an optional banner argument is given, it will override the
1512 If an optional banner argument is given, it will override the
1513 internally created default banner."""
1513 internally created default banner."""
1514
1514
1515 if self.rc.c: # Emulate Python's -c option
1515 if self.rc.c: # Emulate Python's -c option
1516 self.exec_init_cmd()
1516 self.exec_init_cmd()
1517 if banner is None:
1517 if banner is None:
1518 if not self.rc.banner:
1518 if not self.rc.banner:
1519 banner = ''
1519 banner = ''
1520 # banner is string? Use it directly!
1520 # banner is string? Use it directly!
1521 elif isinstance(self.rc.banner,basestring):
1521 elif isinstance(self.rc.banner,basestring):
1522 banner = self.rc.banner
1522 banner = self.rc.banner
1523 else:
1523 else:
1524 banner = self.BANNER+self.banner2
1524 banner = self.BANNER+self.banner2
1525
1525
1526 self.interact(banner)
1526 self.interact(banner)
1527
1527
1528 def exec_init_cmd(self):
1528 def exec_init_cmd(self):
1529 """Execute a command given at the command line.
1529 """Execute a command given at the command line.
1530
1530
1531 This emulates Python's -c option."""
1531 This emulates Python's -c option."""
1532
1532
1533 #sys.argv = ['-c']
1533 #sys.argv = ['-c']
1534 self.push(self.prefilter(self.rc.c, False))
1534 self.push(self.prefilter(self.rc.c, False))
1535 if not self.rc.interact:
1535 if not self.rc.interact:
1536 self.exit_now = True
1536 self.exit_now = True
1537
1537
1538 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1538 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1539 """Embeds IPython into a running python program.
1539 """Embeds IPython into a running python program.
1540
1540
1541 Input:
1541 Input:
1542
1542
1543 - header: An optional header message can be specified.
1543 - header: An optional header message can be specified.
1544
1544
1545 - local_ns, global_ns: working namespaces. If given as None, the
1545 - local_ns, global_ns: working namespaces. If given as None, the
1546 IPython-initialized one is updated with __main__.__dict__, so that
1546 IPython-initialized one is updated with __main__.__dict__, so that
1547 program variables become visible but user-specific configuration
1547 program variables become visible but user-specific configuration
1548 remains possible.
1548 remains possible.
1549
1549
1550 - stack_depth: specifies how many levels in the stack to go to
1550 - stack_depth: specifies how many levels in the stack to go to
1551 looking for namespaces (when local_ns and global_ns are None). This
1551 looking for namespaces (when local_ns and global_ns are None). This
1552 allows an intermediate caller to make sure that this function gets
1552 allows an intermediate caller to make sure that this function gets
1553 the namespace from the intended level in the stack. By default (0)
1553 the namespace from the intended level in the stack. By default (0)
1554 it will get its locals and globals from the immediate caller.
1554 it will get its locals and globals from the immediate caller.
1555
1555
1556 Warning: it's possible to use this in a program which is being run by
1556 Warning: it's possible to use this in a program which is being run by
1557 IPython itself (via %run), but some funny things will happen (a few
1557 IPython itself (via %run), but some funny things will happen (a few
1558 globals get overwritten). In the future this will be cleaned up, as
1558 globals get overwritten). In the future this will be cleaned up, as
1559 there is no fundamental reason why it can't work perfectly."""
1559 there is no fundamental reason why it can't work perfectly."""
1560
1560
1561 # Get locals and globals from caller
1561 # Get locals and globals from caller
1562 if local_ns is None or global_ns is None:
1562 if local_ns is None or global_ns is None:
1563 call_frame = sys._getframe(stack_depth).f_back
1563 call_frame = sys._getframe(stack_depth).f_back
1564
1564
1565 if local_ns is None:
1565 if local_ns is None:
1566 local_ns = call_frame.f_locals
1566 local_ns = call_frame.f_locals
1567 if global_ns is None:
1567 if global_ns is None:
1568 global_ns = call_frame.f_globals
1568 global_ns = call_frame.f_globals
1569
1569
1570 # Update namespaces and fire up interpreter
1570 # Update namespaces and fire up interpreter
1571
1571
1572 # The global one is easy, we can just throw it in
1572 # The global one is easy, we can just throw it in
1573 self.user_global_ns = global_ns
1573 self.user_global_ns = global_ns
1574
1574
1575 # but the user/local one is tricky: ipython needs it to store internal
1575 # but the user/local one is tricky: ipython needs it to store internal
1576 # data, but we also need the locals. We'll copy locals in the user
1576 # data, but we also need the locals. We'll copy locals in the user
1577 # one, but will track what got copied so we can delete them at exit.
1577 # one, but will track what got copied so we can delete them at exit.
1578 # This is so that a later embedded call doesn't see locals from a
1578 # This is so that a later embedded call doesn't see locals from a
1579 # previous call (which most likely existed in a separate scope).
1579 # previous call (which most likely existed in a separate scope).
1580 local_varnames = local_ns.keys()
1580 local_varnames = local_ns.keys()
1581 self.user_ns.update(local_ns)
1581 self.user_ns.update(local_ns)
1582
1582
1583 # Patch for global embedding to make sure that things don't overwrite
1583 # Patch for global embedding to make sure that things don't overwrite
1584 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1584 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1585 # FIXME. Test this a bit more carefully (the if.. is new)
1585 # FIXME. Test this a bit more carefully (the if.. is new)
1586 if local_ns is None and global_ns is None:
1586 if local_ns is None and global_ns is None:
1587 self.user_global_ns.update(__main__.__dict__)
1587 self.user_global_ns.update(__main__.__dict__)
1588
1588
1589 # make sure the tab-completer has the correct frame information, so it
1589 # make sure the tab-completer has the correct frame information, so it
1590 # actually completes using the frame's locals/globals
1590 # actually completes using the frame's locals/globals
1591 self.set_completer_frame()
1591 self.set_completer_frame()
1592
1592
1593 # before activating the interactive mode, we need to make sure that
1593 # before activating the interactive mode, we need to make sure that
1594 # all names in the builtin namespace needed by ipython point to
1594 # all names in the builtin namespace needed by ipython point to
1595 # ourselves, and not to other instances.
1595 # ourselves, and not to other instances.
1596 self.add_builtins()
1596 self.add_builtins()
1597
1597
1598 self.interact(header)
1598 self.interact(header)
1599
1599
1600 # now, purge out the user namespace from anything we might have added
1600 # now, purge out the user namespace from anything we might have added
1601 # from the caller's local namespace
1601 # from the caller's local namespace
1602 delvar = self.user_ns.pop
1602 delvar = self.user_ns.pop
1603 for var in local_varnames:
1603 for var in local_varnames:
1604 delvar(var,None)
1604 delvar(var,None)
1605 # and clean builtins we may have overridden
1605 # and clean builtins we may have overridden
1606 self.clean_builtins()
1606 self.clean_builtins()
1607
1607
1608 def interact(self, banner=None):
1608 def interact(self, banner=None):
1609 """Closely emulate the interactive Python console.
1609 """Closely emulate the interactive Python console.
1610
1610
1611 The optional banner argument specify the banner to print
1611 The optional banner argument specify the banner to print
1612 before the first interaction; by default it prints a banner
1612 before the first interaction; by default it prints a banner
1613 similar to the one printed by the real Python interpreter,
1613 similar to the one printed by the real Python interpreter,
1614 followed by the current class name in parentheses (so as not
1614 followed by the current class name in parentheses (so as not
1615 to confuse this with the real interpreter -- since it's so
1615 to confuse this with the real interpreter -- since it's so
1616 close!).
1616 close!).
1617
1617
1618 """
1618 """
1619
1619
1620 if self.exit_now:
1620 if self.exit_now:
1621 # batch run -> do not interact
1621 # batch run -> do not interact
1622 return
1622 return
1623 cprt = 'Type "copyright", "credits" or "license" for more information.'
1623 cprt = 'Type "copyright", "credits" or "license" for more information.'
1624 if banner is None:
1624 if banner is None:
1625 self.write("Python %s on %s\n%s\n(%s)\n" %
1625 self.write("Python %s on %s\n%s\n(%s)\n" %
1626 (sys.version, sys.platform, cprt,
1626 (sys.version, sys.platform, cprt,
1627 self.__class__.__name__))
1627 self.__class__.__name__))
1628 else:
1628 else:
1629 self.write(banner)
1629 self.write(banner)
1630
1630
1631 more = 0
1631 more = 0
1632
1632
1633 # Mark activity in the builtins
1633 # Mark activity in the builtins
1634 __builtin__.__dict__['__IPYTHON__active'] += 1
1634 __builtin__.__dict__['__IPYTHON__active'] += 1
1635
1635
1636 if self.has_readline:
1636 if self.has_readline:
1637 self.readline_startup_hook(self.pre_readline)
1637 self.readline_startup_hook(self.pre_readline)
1638 # exit_now is set by a call to %Exit or %Quit
1638 # exit_now is set by a call to %Exit or %Quit
1639
1639
1640 while not self.exit_now:
1640 while not self.exit_now:
1641 if more:
1641 if more:
1642 prompt = self.hooks.generate_prompt(True)
1642 prompt = self.hooks.generate_prompt(True)
1643 if self.autoindent:
1643 if self.autoindent:
1644 self.rl_do_indent = True
1644 self.rl_do_indent = True
1645
1645
1646 else:
1646 else:
1647 prompt = self.hooks.generate_prompt(False)
1647 prompt = self.hooks.generate_prompt(False)
1648 try:
1648 try:
1649 line = self.raw_input(prompt,more)
1649 line = self.raw_input(prompt,more)
1650 if self.exit_now:
1650 if self.exit_now:
1651 # quick exit on sys.std[in|out] close
1651 # quick exit on sys.std[in|out] close
1652 break
1652 break
1653 if self.autoindent:
1653 if self.autoindent:
1654 self.rl_do_indent = False
1654 self.rl_do_indent = False
1655
1655
1656 except KeyboardInterrupt:
1656 except KeyboardInterrupt:
1657 self.write('\nKeyboardInterrupt\n')
1657 self.write('\nKeyboardInterrupt\n')
1658 self.resetbuffer()
1658 self.resetbuffer()
1659 # keep cache in sync with the prompt counter:
1659 # keep cache in sync with the prompt counter:
1660 self.outputcache.prompt_count -= 1
1660 self.outputcache.prompt_count -= 1
1661
1661
1662 if self.autoindent:
1662 if self.autoindent:
1663 self.indent_current_nsp = 0
1663 self.indent_current_nsp = 0
1664 more = 0
1664 more = 0
1665 except EOFError:
1665 except EOFError:
1666 if self.autoindent:
1666 if self.autoindent:
1667 self.rl_do_indent = False
1667 self.rl_do_indent = False
1668 self.readline_startup_hook(None)
1668 self.readline_startup_hook(None)
1669 self.write('\n')
1669 self.write('\n')
1670 self.exit()
1670 self.exit()
1671 except bdb.BdbQuit:
1671 except bdb.BdbQuit:
1672 warn('The Python debugger has exited with a BdbQuit exception.\n'
1672 warn('The Python debugger has exited with a BdbQuit exception.\n'
1673 'Because of how pdb handles the stack, it is impossible\n'
1673 'Because of how pdb handles the stack, it is impossible\n'
1674 'for IPython to properly format this particular exception.\n'
1674 'for IPython to properly format this particular exception.\n'
1675 'IPython will resume normal operation.')
1675 'IPython will resume normal operation.')
1676 except:
1676 except:
1677 # exceptions here are VERY RARE, but they can be triggered
1677 # exceptions here are VERY RARE, but they can be triggered
1678 # asynchronously by signal handlers, for example.
1678 # asynchronously by signal handlers, for example.
1679 self.showtraceback()
1679 self.showtraceback()
1680 else:
1680 else:
1681 more = self.push(line)
1681 more = self.push(line)
1682 if (self.SyntaxTB.last_syntax_error and
1682 if (self.SyntaxTB.last_syntax_error and
1683 self.rc.autoedit_syntax):
1683 self.rc.autoedit_syntax):
1684 self.edit_syntax_error()
1684 self.edit_syntax_error()
1685
1685
1686 # We are off again...
1686 # We are off again...
1687 __builtin__.__dict__['__IPYTHON__active'] -= 1
1687 __builtin__.__dict__['__IPYTHON__active'] -= 1
1688
1688
1689 def excepthook(self, etype, value, tb):
1689 def excepthook(self, etype, value, tb):
1690 """One more defense for GUI apps that call sys.excepthook.
1690 """One more defense for GUI apps that call sys.excepthook.
1691
1691
1692 GUI frameworks like wxPython trap exceptions and call
1692 GUI frameworks like wxPython trap exceptions and call
1693 sys.excepthook themselves. I guess this is a feature that
1693 sys.excepthook themselves. I guess this is a feature that
1694 enables them to keep running after exceptions that would
1694 enables them to keep running after exceptions that would
1695 otherwise kill their mainloop. This is a bother for IPython
1695 otherwise kill their mainloop. This is a bother for IPython
1696 which excepts to catch all of the program exceptions with a try:
1696 which excepts to catch all of the program exceptions with a try:
1697 except: statement.
1697 except: statement.
1698
1698
1699 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1699 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1700 any app directly invokes sys.excepthook, it will look to the user like
1700 any app directly invokes sys.excepthook, it will look to the user like
1701 IPython crashed. In order to work around this, we can disable the
1701 IPython crashed. In order to work around this, we can disable the
1702 CrashHandler and replace it with this excepthook instead, which prints a
1702 CrashHandler and replace it with this excepthook instead, which prints a
1703 regular traceback using our InteractiveTB. In this fashion, apps which
1703 regular traceback using our InteractiveTB. In this fashion, apps which
1704 call sys.excepthook will generate a regular-looking exception from
1704 call sys.excepthook will generate a regular-looking exception from
1705 IPython, and the CrashHandler will only be triggered by real IPython
1705 IPython, and the CrashHandler will only be triggered by real IPython
1706 crashes.
1706 crashes.
1707
1707
1708 This hook should be used sparingly, only in places which are not likely
1708 This hook should be used sparingly, only in places which are not likely
1709 to be true IPython errors.
1709 to be true IPython errors.
1710 """
1710 """
1711 self.showtraceback((etype,value,tb),tb_offset=0)
1711 self.showtraceback((etype,value,tb),tb_offset=0)
1712
1712
1713 def expand_aliases(self,fn,rest):
1713 def expand_aliases(self,fn,rest):
1714 """ Expand multiple levels of aliases:
1714 """ Expand multiple levels of aliases:
1715
1715
1716 if:
1716 if:
1717
1717
1718 alias foo bar /tmp
1718 alias foo bar /tmp
1719 alias baz foo
1719 alias baz foo
1720
1720
1721 then:
1721 then:
1722
1722
1723 baz huhhahhei -> bar /tmp huhhahhei
1723 baz huhhahhei -> bar /tmp huhhahhei
1724
1724
1725 """
1725 """
1726 line = fn + " " + rest
1726 line = fn + " " + rest
1727
1727
1728 done = Set()
1728 done = Set()
1729 while 1:
1729 while 1:
1730 pre,fn,rest = prefilter.splitUserInput(line,
1730 pre,fn,rest = prefilter.splitUserInput(line,
1731 prefilter.shell_line_split)
1731 prefilter.shell_line_split)
1732 if fn in self.alias_table:
1732 if fn in self.alias_table:
1733 if fn in done:
1733 if fn in done:
1734 warn("Cyclic alias definition, repeated '%s'" % fn)
1734 warn("Cyclic alias definition, repeated '%s'" % fn)
1735 return ""
1735 return ""
1736 done.add(fn)
1736 done.add(fn)
1737
1737
1738 l2 = self.transform_alias(fn,rest)
1738 l2 = self.transform_alias(fn,rest)
1739 # dir -> dir
1739 # dir -> dir
1740 # print "alias",line, "->",l2 #dbg
1740 # print "alias",line, "->",l2 #dbg
1741 if l2 == line:
1741 if l2 == line:
1742 break
1742 break
1743 # ls -> ls -F should not recurse forever
1743 # ls -> ls -F should not recurse forever
1744 if l2.split(None,1)[0] == line.split(None,1)[0]:
1744 if l2.split(None,1)[0] == line.split(None,1)[0]:
1745 line = l2
1745 line = l2
1746 break
1746 break
1747
1747
1748 line=l2
1748 line=l2
1749
1749
1750
1750
1751 # print "al expand to",line #dbg
1751 # print "al expand to",line #dbg
1752 else:
1752 else:
1753 break
1753 break
1754
1754
1755 return line
1755 return line
1756
1756
1757 def transform_alias(self, alias,rest=''):
1757 def transform_alias(self, alias,rest=''):
1758 """ Transform alias to system command string.
1758 """ Transform alias to system command string.
1759 """
1759 """
1760 trg = self.alias_table[alias]
1760 trg = self.alias_table[alias]
1761
1761
1762 nargs,cmd = trg
1762 nargs,cmd = trg
1763 # print trg #dbg
1763 # print trg #dbg
1764 if ' ' in cmd and os.path.isfile(cmd):
1764 if ' ' in cmd and os.path.isfile(cmd):
1765 cmd = '"%s"' % cmd
1765 cmd = '"%s"' % cmd
1766
1766
1767 # Expand the %l special to be the user's input line
1767 # Expand the %l special to be the user's input line
1768 if cmd.find('%l') >= 0:
1768 if cmd.find('%l') >= 0:
1769 cmd = cmd.replace('%l',rest)
1769 cmd = cmd.replace('%l',rest)
1770 rest = ''
1770 rest = ''
1771 if nargs==0:
1771 if nargs==0:
1772 # Simple, argument-less aliases
1772 # Simple, argument-less aliases
1773 cmd = '%s %s' % (cmd,rest)
1773 cmd = '%s %s' % (cmd,rest)
1774 else:
1774 else:
1775 # Handle aliases with positional arguments
1775 # Handle aliases with positional arguments
1776 args = rest.split(None,nargs)
1776 args = rest.split(None,nargs)
1777 if len(args)< nargs:
1777 if len(args)< nargs:
1778 error('Alias <%s> requires %s arguments, %s given.' %
1778 error('Alias <%s> requires %s arguments, %s given.' %
1779 (alias,nargs,len(args)))
1779 (alias,nargs,len(args)))
1780 return None
1780 return None
1781 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1781 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1782 # Now call the macro, evaluating in the user's namespace
1782 # Now call the macro, evaluating in the user's namespace
1783 #print 'new command: <%r>' % cmd # dbg
1783 #print 'new command: <%r>' % cmd # dbg
1784 return cmd
1784 return cmd
1785
1785
1786 def call_alias(self,alias,rest=''):
1786 def call_alias(self,alias,rest=''):
1787 """Call an alias given its name and the rest of the line.
1787 """Call an alias given its name and the rest of the line.
1788
1788
1789 This is only used to provide backwards compatibility for users of
1789 This is only used to provide backwards compatibility for users of
1790 ipalias(), use of which is not recommended for anymore."""
1790 ipalias(), use of which is not recommended for anymore."""
1791
1791
1792 # Now call the macro, evaluating in the user's namespace
1792 # Now call the macro, evaluating in the user's namespace
1793 cmd = self.transform_alias(alias, rest)
1793 cmd = self.transform_alias(alias, rest)
1794 try:
1794 try:
1795 self.system(cmd)
1795 self.system(cmd)
1796 except:
1796 except:
1797 self.showtraceback()
1797 self.showtraceback()
1798
1798
1799 def indent_current_str(self):
1799 def indent_current_str(self):
1800 """return the current level of indentation as a string"""
1800 """return the current level of indentation as a string"""
1801 return self.indent_current_nsp * ' '
1801 return self.indent_current_nsp * ' '
1802
1802
1803 def autoindent_update(self,line):
1803 def autoindent_update(self,line):
1804 """Keep track of the indent level."""
1804 """Keep track of the indent level."""
1805
1805
1806 #debugx('line')
1806 #debugx('line')
1807 #debugx('self.indent_current_nsp')
1807 #debugx('self.indent_current_nsp')
1808 if self.autoindent:
1808 if self.autoindent:
1809 if line:
1809 if line:
1810 inisp = num_ini_spaces(line)
1810 inisp = num_ini_spaces(line)
1811 if inisp < self.indent_current_nsp:
1811 if inisp < self.indent_current_nsp:
1812 self.indent_current_nsp = inisp
1812 self.indent_current_nsp = inisp
1813
1813
1814 if line[-1] == ':':
1814 if line[-1] == ':':
1815 self.indent_current_nsp += 4
1815 self.indent_current_nsp += 4
1816 elif dedent_re.match(line):
1816 elif dedent_re.match(line):
1817 self.indent_current_nsp -= 4
1817 self.indent_current_nsp -= 4
1818 else:
1818 else:
1819 self.indent_current_nsp = 0
1819 self.indent_current_nsp = 0
1820 def runlines(self,lines):
1820 def runlines(self,lines):
1821 """Run a string of one or more lines of source.
1821 """Run a string of one or more lines of source.
1822
1822
1823 This method is capable of running a string containing multiple source
1823 This method is capable of running a string containing multiple source
1824 lines, as if they had been entered at the IPython prompt. Since it
1824 lines, as if they had been entered at the IPython prompt. Since it
1825 exposes IPython's processing machinery, the given strings can contain
1825 exposes IPython's processing machinery, the given strings can contain
1826 magic calls (%magic), special shell access (!cmd), etc."""
1826 magic calls (%magic), special shell access (!cmd), etc."""
1827
1827
1828 # We must start with a clean buffer, in case this is run from an
1828 # We must start with a clean buffer, in case this is run from an
1829 # interactive IPython session (via a magic, for example).
1829 # interactive IPython session (via a magic, for example).
1830 self.resetbuffer()
1830 self.resetbuffer()
1831 lines = lines.split('\n')
1831 lines = lines.split('\n')
1832 more = 0
1832 more = 0
1833
1833
1834 for line in lines:
1834 for line in lines:
1835 # skip blank lines so we don't mess up the prompt counter, but do
1835 # skip blank lines so we don't mess up the prompt counter, but do
1836 # NOT skip even a blank line if we are in a code block (more is
1836 # NOT skip even a blank line if we are in a code block (more is
1837 # true)
1837 # true)
1838
1838
1839
1839
1840 if line or more:
1840 if line or more:
1841 # push to raw history, so hist line numbers stay in sync
1841 # push to raw history, so hist line numbers stay in sync
1842 self.input_hist_raw.append("# " + line + "\n")
1842 self.input_hist_raw.append("# " + line + "\n")
1843 more = self.push(self.prefilter(line,more))
1843 more = self.push(self.prefilter(line,more))
1844 # IPython's runsource returns None if there was an error
1844 # IPython's runsource returns None if there was an error
1845 # compiling the code. This allows us to stop processing right
1845 # compiling the code. This allows us to stop processing right
1846 # away, so the user gets the error message at the right place.
1846 # away, so the user gets the error message at the right place.
1847 if more is None:
1847 if more is None:
1848 break
1848 break
1849 else:
1849 else:
1850 self.input_hist_raw.append("\n")
1850 self.input_hist_raw.append("\n")
1851 # final newline in case the input didn't have it, so that the code
1851 # final newline in case the input didn't have it, so that the code
1852 # actually does get executed
1852 # actually does get executed
1853 if more:
1853 if more:
1854 self.push('\n')
1854 self.push('\n')
1855
1855
1856 def runsource(self, source, filename='<input>', symbol='single'):
1856 def runsource(self, source, filename='<input>', symbol='single'):
1857 """Compile and run some source in the interpreter.
1857 """Compile and run some source in the interpreter.
1858
1858
1859 Arguments are as for compile_command().
1859 Arguments are as for compile_command().
1860
1860
1861 One several things can happen:
1861 One several things can happen:
1862
1862
1863 1) The input is incorrect; compile_command() raised an
1863 1) The input is incorrect; compile_command() raised an
1864 exception (SyntaxError or OverflowError). A syntax traceback
1864 exception (SyntaxError or OverflowError). A syntax traceback
1865 will be printed by calling the showsyntaxerror() method.
1865 will be printed by calling the showsyntaxerror() method.
1866
1866
1867 2) The input is incomplete, and more input is required;
1867 2) The input is incomplete, and more input is required;
1868 compile_command() returned None. Nothing happens.
1868 compile_command() returned None. Nothing happens.
1869
1869
1870 3) The input is complete; compile_command() returned a code
1870 3) The input is complete; compile_command() returned a code
1871 object. The code is executed by calling self.runcode() (which
1871 object. The code is executed by calling self.runcode() (which
1872 also handles run-time exceptions, except for SystemExit).
1872 also handles run-time exceptions, except for SystemExit).
1873
1873
1874 The return value is:
1874 The return value is:
1875
1875
1876 - True in case 2
1876 - True in case 2
1877
1877
1878 - False in the other cases, unless an exception is raised, where
1878 - False in the other cases, unless an exception is raised, where
1879 None is returned instead. This can be used by external callers to
1879 None is returned instead. This can be used by external callers to
1880 know whether to continue feeding input or not.
1880 know whether to continue feeding input or not.
1881
1881
1882 The return value can be used to decide whether to use sys.ps1 or
1882 The return value can be used to decide whether to use sys.ps1 or
1883 sys.ps2 to prompt the next line."""
1883 sys.ps2 to prompt the next line."""
1884
1884
1885 # if the source code has leading blanks, add 'if 1:\n' to it
1885 # if the source code has leading blanks, add 'if 1:\n' to it
1886 # this allows execution of indented pasted code. It is tempting
1886 # this allows execution of indented pasted code. It is tempting
1887 # to add '\n' at the end of source to run commands like ' a=1'
1887 # to add '\n' at the end of source to run commands like ' a=1'
1888 # directly, but this fails for more complicated scenarios
1888 # directly, but this fails for more complicated scenarios
1889 if source[:1] in [' ', '\t']:
1889 if source[:1] in [' ', '\t']:
1890 source = 'if 1:\n%s' % source
1890 source = 'if 1:\n%s' % source
1891
1891
1892 try:
1892 try:
1893 code = self.compile(source,filename,symbol)
1893 code = self.compile(source,filename,symbol)
1894 except (OverflowError, SyntaxError, ValueError):
1894 except (OverflowError, SyntaxError, ValueError):
1895 # Case 1
1895 # Case 1
1896 self.showsyntaxerror(filename)
1896 self.showsyntaxerror(filename)
1897 return None
1897 return None
1898
1898
1899 if code is None:
1899 if code is None:
1900 # Case 2
1900 # Case 2
1901 return True
1901 return True
1902
1902
1903 # Case 3
1903 # Case 3
1904 # We store the code object so that threaded shells and
1904 # We store the code object so that threaded shells and
1905 # custom exception handlers can access all this info if needed.
1905 # custom exception handlers can access all this info if needed.
1906 # The source corresponding to this can be obtained from the
1906 # The source corresponding to this can be obtained from the
1907 # buffer attribute as '\n'.join(self.buffer).
1907 # buffer attribute as '\n'.join(self.buffer).
1908 self.code_to_run = code
1908 self.code_to_run = code
1909 # now actually execute the code object
1909 # now actually execute the code object
1910 if self.runcode(code) == 0:
1910 if self.runcode(code) == 0:
1911 return False
1911 return False
1912 else:
1912 else:
1913 return None
1913 return None
1914
1914
1915 def runcode(self,code_obj):
1915 def runcode(self,code_obj):
1916 """Execute a code object.
1916 """Execute a code object.
1917
1917
1918 When an exception occurs, self.showtraceback() is called to display a
1918 When an exception occurs, self.showtraceback() is called to display a
1919 traceback.
1919 traceback.
1920
1920
1921 Return value: a flag indicating whether the code to be run completed
1921 Return value: a flag indicating whether the code to be run completed
1922 successfully:
1922 successfully:
1923
1923
1924 - 0: successful execution.
1924 - 0: successful execution.
1925 - 1: an error occurred.
1925 - 1: an error occurred.
1926 """
1926 """
1927
1927
1928 # Set our own excepthook in case the user code tries to call it
1928 # Set our own excepthook in case the user code tries to call it
1929 # directly, so that the IPython crash handler doesn't get triggered
1929 # directly, so that the IPython crash handler doesn't get triggered
1930 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1930 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1931
1931
1932 # we save the original sys.excepthook in the instance, in case config
1932 # we save the original sys.excepthook in the instance, in case config
1933 # code (such as magics) needs access to it.
1933 # code (such as magics) needs access to it.
1934 self.sys_excepthook = old_excepthook
1934 self.sys_excepthook = old_excepthook
1935 outflag = 1 # happens in more places, so it's easier as default
1935 outflag = 1 # happens in more places, so it's easier as default
1936 try:
1936 try:
1937 try:
1937 try:
1938 # Embedded instances require separate global/local namespaces
1938 # Embedded instances require separate global/local namespaces
1939 # so they can see both the surrounding (local) namespace and
1939 # so they can see both the surrounding (local) namespace and
1940 # the module-level globals when called inside another function.
1940 # the module-level globals when called inside another function.
1941 if self.embedded:
1941 if self.embedded:
1942 exec code_obj in self.user_global_ns, self.user_ns
1942 exec code_obj in self.user_global_ns, self.user_ns
1943 # Normal (non-embedded) instances should only have a single
1943 # Normal (non-embedded) instances should only have a single
1944 # namespace for user code execution, otherwise functions won't
1944 # namespace for user code execution, otherwise functions won't
1945 # see interactive top-level globals.
1945 # see interactive top-level globals.
1946 else:
1946 else:
1947 exec code_obj in self.user_ns
1947 exec code_obj in self.user_ns
1948 finally:
1948 finally:
1949 # Reset our crash handler in place
1949 # Reset our crash handler in place
1950 sys.excepthook = old_excepthook
1950 sys.excepthook = old_excepthook
1951 except SystemExit:
1951 except SystemExit:
1952 self.resetbuffer()
1952 self.resetbuffer()
1953 self.showtraceback()
1953 self.showtraceback()
1954 warn("Type %exit or %quit to exit IPython "
1954 warn("Type %exit or %quit to exit IPython "
1955 "(%Exit or %Quit do so unconditionally).",level=1)
1955 "(%Exit or %Quit do so unconditionally).",level=1)
1956 except self.custom_exceptions:
1956 except self.custom_exceptions:
1957 etype,value,tb = sys.exc_info()
1957 etype,value,tb = sys.exc_info()
1958 self.CustomTB(etype,value,tb)
1958 self.CustomTB(etype,value,tb)
1959 except:
1959 except:
1960 self.showtraceback()
1960 self.showtraceback()
1961 else:
1961 else:
1962 outflag = 0
1962 outflag = 0
1963 if softspace(sys.stdout, 0):
1963 if softspace(sys.stdout, 0):
1964 print
1964 print
1965 # Flush out code object which has been run (and source)
1965 # Flush out code object which has been run (and source)
1966 self.code_to_run = None
1966 self.code_to_run = None
1967 return outflag
1967 return outflag
1968
1968
1969 def push(self, line):
1969 def push(self, line):
1970 """Push a line to the interpreter.
1970 """Push a line to the interpreter.
1971
1971
1972 The line should not have a trailing newline; it may have
1972 The line should not have a trailing newline; it may have
1973 internal newlines. The line is appended to a buffer and the
1973 internal newlines. The line is appended to a buffer and the
1974 interpreter's runsource() method is called with the
1974 interpreter's runsource() method is called with the
1975 concatenated contents of the buffer as source. If this
1975 concatenated contents of the buffer as source. If this
1976 indicates that the command was executed or invalid, the buffer
1976 indicates that the command was executed or invalid, the buffer
1977 is reset; otherwise, the command is incomplete, and the buffer
1977 is reset; otherwise, the command is incomplete, and the buffer
1978 is left as it was after the line was appended. The return
1978 is left as it was after the line was appended. The return
1979 value is 1 if more input is required, 0 if the line was dealt
1979 value is 1 if more input is required, 0 if the line was dealt
1980 with in some way (this is the same as runsource()).
1980 with in some way (this is the same as runsource()).
1981 """
1981 """
1982
1982
1983 # autoindent management should be done here, and not in the
1983 # autoindent management should be done here, and not in the
1984 # interactive loop, since that one is only seen by keyboard input. We
1984 # interactive loop, since that one is only seen by keyboard input. We
1985 # need this done correctly even for code run via runlines (which uses
1985 # need this done correctly even for code run via runlines (which uses
1986 # push).
1986 # push).
1987
1987
1988 #print 'push line: <%s>' % line # dbg
1988 #print 'push line: <%s>' % line # dbg
1989 for subline in line.splitlines():
1989 for subline in line.splitlines():
1990 self.autoindent_update(subline)
1990 self.autoindent_update(subline)
1991 self.buffer.append(line)
1991 self.buffer.append(line)
1992 more = self.runsource('\n'.join(self.buffer), self.filename)
1992 more = self.runsource('\n'.join(self.buffer), self.filename)
1993 if not more:
1993 if not more:
1994 self.resetbuffer()
1994 self.resetbuffer()
1995 return more
1995 return more
1996
1996
1997 def split_user_input(self, line):
1997 def split_user_input(self, line):
1998 # This is really a hold-over to support ipapi and some extensions
1998 # This is really a hold-over to support ipapi and some extensions
1999 return prefilter.splitUserInput(line)
1999 return prefilter.splitUserInput(line)
2000
2000
2001 def resetbuffer(self):
2001 def resetbuffer(self):
2002 """Reset the input buffer."""
2002 """Reset the input buffer."""
2003 self.buffer[:] = []
2003 self.buffer[:] = []
2004
2004
2005 def raw_input(self,prompt='',continue_prompt=False):
2005 def raw_input(self,prompt='',continue_prompt=False):
2006 """Write a prompt and read a line.
2006 """Write a prompt and read a line.
2007
2007
2008 The returned line does not include the trailing newline.
2008 The returned line does not include the trailing newline.
2009 When the user enters the EOF key sequence, EOFError is raised.
2009 When the user enters the EOF key sequence, EOFError is raised.
2010
2010
2011 Optional inputs:
2011 Optional inputs:
2012
2012
2013 - prompt(''): a string to be printed to prompt the user.
2013 - prompt(''): a string to be printed to prompt the user.
2014
2014
2015 - continue_prompt(False): whether this line is the first one or a
2015 - continue_prompt(False): whether this line is the first one or a
2016 continuation in a sequence of inputs.
2016 continuation in a sequence of inputs.
2017 """
2017 """
2018
2018
2019 # Code run by the user may have modified the readline completer state.
2019 # Code run by the user may have modified the readline completer state.
2020 # We must ensure that our completer is back in place.
2020 # We must ensure that our completer is back in place.
2021 if self.has_readline:
2021 if self.has_readline:
2022 self.set_completer()
2022 self.set_completer()
2023
2023
2024 try:
2024 try:
2025 line = raw_input_original(prompt).decode(self.stdin_encoding)
2025 line = raw_input_original(prompt).decode(self.stdin_encoding)
2026 except ValueError:
2026 except ValueError:
2027 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2027 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2028 " or sys.stdout.close()!\nExiting IPython!")
2028 " or sys.stdout.close()!\nExiting IPython!")
2029 self.exit_now = True
2029 self.exit_now = True
2030 return ""
2030 return ""
2031
2031
2032 # Try to be reasonably smart about not re-indenting pasted input more
2032 # Try to be reasonably smart about not re-indenting pasted input more
2033 # than necessary. We do this by trimming out the auto-indent initial
2033 # than necessary. We do this by trimming out the auto-indent initial
2034 # spaces, if the user's actual input started itself with whitespace.
2034 # spaces, if the user's actual input started itself with whitespace.
2035 #debugx('self.buffer[-1]')
2035 #debugx('self.buffer[-1]')
2036
2036
2037 if self.autoindent:
2037 if self.autoindent:
2038 if num_ini_spaces(line) > self.indent_current_nsp:
2038 if num_ini_spaces(line) > self.indent_current_nsp:
2039 line = line[self.indent_current_nsp:]
2039 line = line[self.indent_current_nsp:]
2040 self.indent_current_nsp = 0
2040 self.indent_current_nsp = 0
2041
2041
2042 # store the unfiltered input before the user has any chance to modify
2042 # store the unfiltered input before the user has any chance to modify
2043 # it.
2043 # it.
2044 if line.strip():
2044 if line.strip():
2045 if continue_prompt:
2045 if continue_prompt:
2046 self.input_hist_raw[-1] += '%s\n' % line
2046 self.input_hist_raw[-1] += '%s\n' % line
2047 if self.has_readline: # and some config option is set?
2047 if self.has_readline: # and some config option is set?
2048 try:
2048 try:
2049 histlen = self.readline.get_current_history_length()
2049 histlen = self.readline.get_current_history_length()
2050 newhist = self.input_hist_raw[-1].rstrip()
2050 newhist = self.input_hist_raw[-1].rstrip()
2051 self.readline.remove_history_item(histlen-1)
2051 self.readline.remove_history_item(histlen-1)
2052 self.readline.replace_history_item(histlen-2,newhist)
2052 self.readline.replace_history_item(histlen-2,newhist)
2053 except AttributeError:
2053 except AttributeError:
2054 pass # re{move,place}_history_item are new in 2.4.
2054 pass # re{move,place}_history_item are new in 2.4.
2055 else:
2055 else:
2056 self.input_hist_raw.append('%s\n' % line)
2056 self.input_hist_raw.append('%s\n' % line)
2057 # only entries starting at first column go to shadow history
2057 # only entries starting at first column go to shadow history
2058 if line.lstrip() == line:
2058 if line.lstrip() == line:
2059 self.shadowhist.add(line.strip())
2059 self.shadowhist.add(line.strip())
2060 elif not continue_prompt:
2060 elif not continue_prompt:
2061 self.input_hist_raw.append('\n')
2061 self.input_hist_raw.append('\n')
2062 try:
2062 try:
2063 lineout = self.prefilter(line,continue_prompt)
2063 lineout = self.prefilter(line,continue_prompt)
2064 except:
2064 except:
2065 # blanket except, in case a user-defined prefilter crashes, so it
2065 # blanket except, in case a user-defined prefilter crashes, so it
2066 # can't take all of ipython with it.
2066 # can't take all of ipython with it.
2067 self.showtraceback()
2067 self.showtraceback()
2068 return ''
2068 return ''
2069 else:
2069 else:
2070 return lineout
2070 return lineout
2071
2071
2072 def _prefilter(self, line, continue_prompt):
2072 def _prefilter(self, line, continue_prompt):
2073 """Calls different preprocessors, depending on the form of line."""
2073 """Calls different preprocessors, depending on the form of line."""
2074
2074
2075 # All handlers *must* return a value, even if it's blank ('').
2075 # All handlers *must* return a value, even if it's blank ('').
2076
2076
2077 # Lines are NOT logged here. Handlers should process the line as
2077 # Lines are NOT logged here. Handlers should process the line as
2078 # needed, update the cache AND log it (so that the input cache array
2078 # needed, update the cache AND log it (so that the input cache array
2079 # stays synced).
2079 # stays synced).
2080
2080
2081 #.....................................................................
2081 #.....................................................................
2082 # Code begins
2082 # Code begins
2083
2083
2084 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2084 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2085
2085
2086 # save the line away in case we crash, so the post-mortem handler can
2086 # save the line away in case we crash, so the post-mortem handler can
2087 # record it
2087 # record it
2088 self._last_input_line = line
2088 self._last_input_line = line
2089
2089
2090 #print '***line: <%s>' % line # dbg
2090 #print '***line: <%s>' % line # dbg
2091
2091
2092 if not line:
2092 if not line:
2093 # Return immediately on purely empty lines, so that if the user
2093 # Return immediately on purely empty lines, so that if the user
2094 # previously typed some whitespace that started a continuation
2094 # previously typed some whitespace that started a continuation
2095 # prompt, he can break out of that loop with just an empty line.
2095 # prompt, he can break out of that loop with just an empty line.
2096 # This is how the default python prompt works.
2096 # This is how the default python prompt works.
2097
2097
2098 # Only return if the accumulated input buffer was just whitespace!
2098 # Only return if the accumulated input buffer was just whitespace!
2099 if ''.join(self.buffer).isspace():
2099 if ''.join(self.buffer).isspace():
2100 self.buffer[:] = []
2100 self.buffer[:] = []
2101 return ''
2101 return ''
2102
2102
2103 line_info = prefilter.LineInfo(line, continue_prompt)
2103 line_info = prefilter.LineInfo(line, continue_prompt)
2104
2104
2105 # the input history needs to track even empty lines
2105 # the input history needs to track even empty lines
2106 stripped = line.strip()
2106 stripped = line.strip()
2107
2107
2108 if not stripped:
2108 if not stripped:
2109 if not continue_prompt:
2109 if not continue_prompt:
2110 self.outputcache.prompt_count -= 1
2110 self.outputcache.prompt_count -= 1
2111 return self.handle_normal(line_info)
2111 return self.handle_normal(line_info)
2112
2112
2113 # print '***cont',continue_prompt # dbg
2113 # print '***cont',continue_prompt # dbg
2114 # special handlers are only allowed for single line statements
2114 # special handlers are only allowed for single line statements
2115 if continue_prompt and not self.rc.multi_line_specials:
2115 if continue_prompt and not self.rc.multi_line_specials:
2116 return self.handle_normal(line_info)
2116 return self.handle_normal(line_info)
2117
2117
2118
2118
2119 # See whether any pre-existing handler can take care of it
2119 # See whether any pre-existing handler can take care of it
2120 rewritten = self.hooks.input_prefilter(stripped)
2120 rewritten = self.hooks.input_prefilter(stripped)
2121 if rewritten != stripped: # ok, some prefilter did something
2121 if rewritten != stripped: # ok, some prefilter did something
2122 rewritten = line_info.pre + rewritten # add indentation
2122 rewritten = line_info.pre + rewritten # add indentation
2123 return self.handle_normal(prefilter.LineInfo(rewritten,
2123 return self.handle_normal(prefilter.LineInfo(rewritten,
2124 continue_prompt))
2124 continue_prompt))
2125
2125
2126 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2126 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2127
2127
2128 return prefilter.prefilter(line_info, self)
2128 return prefilter.prefilter(line_info, self)
2129
2129
2130
2130
2131 def _prefilter_dumb(self, line, continue_prompt):
2131 def _prefilter_dumb(self, line, continue_prompt):
2132 """simple prefilter function, for debugging"""
2132 """simple prefilter function, for debugging"""
2133 return self.handle_normal(line,continue_prompt)
2133 return self.handle_normal(line,continue_prompt)
2134
2134
2135
2135
2136 def multiline_prefilter(self, line, continue_prompt):
2136 def multiline_prefilter(self, line, continue_prompt):
2137 """ Run _prefilter for each line of input
2137 """ Run _prefilter for each line of input
2138
2138
2139 Covers cases where there are multiple lines in the user entry,
2139 Covers cases where there are multiple lines in the user entry,
2140 which is the case when the user goes back to a multiline history
2140 which is the case when the user goes back to a multiline history
2141 entry and presses enter.
2141 entry and presses enter.
2142
2142
2143 """
2143 """
2144 out = []
2144 out = []
2145 for l in line.rstrip('\n').split('\n'):
2145 for l in line.rstrip('\n').split('\n'):
2146 out.append(self._prefilter(l, continue_prompt))
2146 out.append(self._prefilter(l, continue_prompt))
2147 return '\n'.join(out)
2147 return '\n'.join(out)
2148
2148
2149 # Set the default prefilter() function (this can be user-overridden)
2149 # Set the default prefilter() function (this can be user-overridden)
2150 prefilter = multiline_prefilter
2150 prefilter = multiline_prefilter
2151
2151
2152 def handle_normal(self,line_info):
2152 def handle_normal(self,line_info):
2153 """Handle normal input lines. Use as a template for handlers."""
2153 """Handle normal input lines. Use as a template for handlers."""
2154
2154
2155 # With autoindent on, we need some way to exit the input loop, and I
2155 # With autoindent on, we need some way to exit the input loop, and I
2156 # don't want to force the user to have to backspace all the way to
2156 # don't want to force the user to have to backspace all the way to
2157 # clear the line. The rule will be in this case, that either two
2157 # clear the line. The rule will be in this case, that either two
2158 # lines of pure whitespace in a row, or a line of pure whitespace but
2158 # lines of pure whitespace in a row, or a line of pure whitespace but
2159 # of a size different to the indent level, will exit the input loop.
2159 # of a size different to the indent level, will exit the input loop.
2160 line = line_info.line
2160 line = line_info.line
2161 continue_prompt = line_info.continue_prompt
2161 continue_prompt = line_info.continue_prompt
2162
2162
2163 if (continue_prompt and self.autoindent and line.isspace() and
2163 if (continue_prompt and self.autoindent and line.isspace() and
2164 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2164 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2165 (self.buffer[-1]).isspace() )):
2165 (self.buffer[-1]).isspace() )):
2166 line = ''
2166 line = ''
2167
2167
2168 self.log(line,line,continue_prompt)
2168 self.log(line,line,continue_prompt)
2169 return line
2169 return line
2170
2170
2171 def handle_alias(self,line_info):
2171 def handle_alias(self,line_info):
2172 """Handle alias input lines. """
2172 """Handle alias input lines. """
2173 tgt = self.alias_table[line_info.iFun]
2173 tgt = self.alias_table[line_info.iFun]
2174 # print "=>",tgt #dbg
2174 # print "=>",tgt #dbg
2175 if callable(tgt):
2175 if callable(tgt):
2176 if '$' in line_info.line:
2176 if '$' in line_info.line:
2177 call_meth = '(_ip, _ip.itpl(%s))'
2177 call_meth = '(_ip, _ip.itpl(%s))'
2178 else:
2178 else:
2179 call_meth = '(_ip,%s)'
2179 call_meth = '(_ip,%s)'
2180 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2180 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2181 line_info.iFun,
2181 line_info.iFun,
2182 make_quoted_expr(line_info.line))
2182 make_quoted_expr(line_info.line))
2183 else:
2183 else:
2184 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2184 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2185
2185
2186 # pre is needed, because it carries the leading whitespace. Otherwise
2186 # pre is needed, because it carries the leading whitespace. Otherwise
2187 # aliases won't work in indented sections.
2187 # aliases won't work in indented sections.
2188 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2188 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2189 make_quoted_expr( transformed ))
2189 make_quoted_expr( transformed ))
2190
2190
2191 self.log(line_info.line,line_out,line_info.continue_prompt)
2191 self.log(line_info.line,line_out,line_info.continue_prompt)
2192 #print 'line out:',line_out # dbg
2192 #print 'line out:',line_out # dbg
2193 return line_out
2193 return line_out
2194
2194
2195 def handle_shell_escape(self, line_info):
2195 def handle_shell_escape(self, line_info):
2196 """Execute the line in a shell, empty return value"""
2196 """Execute the line in a shell, empty return value"""
2197 #print 'line in :', `line` # dbg
2197 #print 'line in :', `line` # dbg
2198 line = line_info.line
2198 line = line_info.line
2199 if line.lstrip().startswith('!!'):
2199 if line.lstrip().startswith('!!'):
2200 # rewrite LineInfo's line, iFun and theRest to properly hold the
2200 # rewrite LineInfo's line, iFun and theRest to properly hold the
2201 # call to %sx and the actual command to be executed, so
2201 # call to %sx and the actual command to be executed, so
2202 # handle_magic can work correctly. Note that this works even if
2202 # handle_magic can work correctly. Note that this works even if
2203 # the line is indented, so it handles multi_line_specials
2203 # the line is indented, so it handles multi_line_specials
2204 # properly.
2204 # properly.
2205 new_rest = line.lstrip()[2:]
2205 new_rest = line.lstrip()[2:]
2206 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2206 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2207 line_info.iFun = 'sx'
2207 line_info.iFun = 'sx'
2208 line_info.theRest = new_rest
2208 line_info.theRest = new_rest
2209 return self.handle_magic(line_info)
2209 return self.handle_magic(line_info)
2210 else:
2210 else:
2211 cmd = line.lstrip().lstrip('!')
2211 cmd = line.lstrip().lstrip('!')
2212 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2212 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2213 make_quoted_expr(cmd))
2213 make_quoted_expr(cmd))
2214 # update cache/log and return
2214 # update cache/log and return
2215 self.log(line,line_out,line_info.continue_prompt)
2215 self.log(line,line_out,line_info.continue_prompt)
2216 return line_out
2216 return line_out
2217
2217
2218 def handle_magic(self, line_info):
2218 def handle_magic(self, line_info):
2219 """Execute magic functions."""
2219 """Execute magic functions."""
2220 iFun = line_info.iFun
2220 iFun = line_info.iFun
2221 theRest = line_info.theRest
2221 theRest = line_info.theRest
2222 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2222 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2223 make_quoted_expr(iFun + " " + theRest))
2223 make_quoted_expr(iFun + " " + theRest))
2224 self.log(line_info.line,cmd,line_info.continue_prompt)
2224 self.log(line_info.line,cmd,line_info.continue_prompt)
2225 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2225 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2226 return cmd
2226 return cmd
2227
2227
2228 def handle_auto(self, line_info):
2228 def handle_auto(self, line_info):
2229 """Hande lines which can be auto-executed, quoting if requested."""
2229 """Hande lines which can be auto-executed, quoting if requested."""
2230
2230
2231 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2231 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2232 line = line_info.line
2232 line = line_info.line
2233 iFun = line_info.iFun
2233 iFun = line_info.iFun
2234 theRest = line_info.theRest
2234 theRest = line_info.theRest
2235 pre = line_info.pre
2235 pre = line_info.pre
2236 continue_prompt = line_info.continue_prompt
2236 continue_prompt = line_info.continue_prompt
2237 obj = line_info.ofind(self)['obj']
2237 obj = line_info.ofind(self)['obj']
2238
2238
2239 # This should only be active for single-line input!
2239 # This should only be active for single-line input!
2240 if continue_prompt:
2240 if continue_prompt:
2241 self.log(line,line,continue_prompt)
2241 self.log(line,line,continue_prompt)
2242 return line
2242 return line
2243
2243
2244 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2244 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2245 auto_rewrite = True
2245 auto_rewrite = True
2246
2246
2247 if pre == self.ESC_QUOTE:
2247 if pre == self.ESC_QUOTE:
2248 # Auto-quote splitting on whitespace
2248 # Auto-quote splitting on whitespace
2249 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2249 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2250 elif pre == self.ESC_QUOTE2:
2250 elif pre == self.ESC_QUOTE2:
2251 # Auto-quote whole string
2251 # Auto-quote whole string
2252 newcmd = '%s("%s")' % (iFun,theRest)
2252 newcmd = '%s("%s")' % (iFun,theRest)
2253 elif pre == self.ESC_PAREN:
2253 elif pre == self.ESC_PAREN:
2254 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2254 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2255 else:
2255 else:
2256 # Auto-paren.
2256 # Auto-paren.
2257 # We only apply it to argument-less calls if the autocall
2257 # We only apply it to argument-less calls if the autocall
2258 # parameter is set to 2. We only need to check that autocall is <
2258 # parameter is set to 2. We only need to check that autocall is <
2259 # 2, since this function isn't called unless it's at least 1.
2259 # 2, since this function isn't called unless it's at least 1.
2260 if not theRest and (self.rc.autocall < 2) and not force_auto:
2260 if not theRest and (self.rc.autocall < 2) and not force_auto:
2261 newcmd = '%s %s' % (iFun,theRest)
2261 newcmd = '%s %s' % (iFun,theRest)
2262 auto_rewrite = False
2262 auto_rewrite = False
2263 else:
2263 else:
2264 if not force_auto and theRest.startswith('['):
2264 if not force_auto and theRest.startswith('['):
2265 if hasattr(obj,'__getitem__'):
2265 if hasattr(obj,'__getitem__'):
2266 # Don't autocall in this case: item access for an object
2266 # Don't autocall in this case: item access for an object
2267 # which is BOTH callable and implements __getitem__.
2267 # which is BOTH callable and implements __getitem__.
2268 newcmd = '%s %s' % (iFun,theRest)
2268 newcmd = '%s %s' % (iFun,theRest)
2269 auto_rewrite = False
2269 auto_rewrite = False
2270 else:
2270 else:
2271 # if the object doesn't support [] access, go ahead and
2271 # if the object doesn't support [] access, go ahead and
2272 # autocall
2272 # autocall
2273 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2273 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2274 elif theRest.endswith(';'):
2274 elif theRest.endswith(';'):
2275 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2275 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2276 else:
2276 else:
2277 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2277 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2278
2278
2279 if auto_rewrite:
2279 if auto_rewrite:
2280 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2280 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2281
2281
2282 try:
2282 try:
2283 # plain ascii works better w/ pyreadline, on some machines, so
2283 # plain ascii works better w/ pyreadline, on some machines, so
2284 # we use it and only print uncolored rewrite if we have unicode
2284 # we use it and only print uncolored rewrite if we have unicode
2285 rw = str(rw)
2285 rw = str(rw)
2286 print >>Term.cout, rw
2286 print >>Term.cout, rw
2287 except UnicodeEncodeError:
2287 except UnicodeEncodeError:
2288 print "-------------->" + newcmd
2288 print "-------------->" + newcmd
2289
2289
2290 # log what is now valid Python, not the actual user input (without the
2290 # log what is now valid Python, not the actual user input (without the
2291 # final newline)
2291 # final newline)
2292 self.log(line,newcmd,continue_prompt)
2292 self.log(line,newcmd,continue_prompt)
2293 return newcmd
2293 return newcmd
2294
2294
2295 def handle_help(self, line_info):
2295 def handle_help(self, line_info):
2296 """Try to get some help for the object.
2296 """Try to get some help for the object.
2297
2297
2298 obj? or ?obj -> basic information.
2298 obj? or ?obj -> basic information.
2299 obj?? or ??obj -> more details.
2299 obj?? or ??obj -> more details.
2300 """
2300 """
2301
2301
2302 line = line_info.line
2302 line = line_info.line
2303 # We need to make sure that we don't process lines which would be
2303 # We need to make sure that we don't process lines which would be
2304 # otherwise valid python, such as "x=1 # what?"
2304 # otherwise valid python, such as "x=1 # what?"
2305 try:
2305 try:
2306 codeop.compile_command(line)
2306 codeop.compile_command(line)
2307 except SyntaxError:
2307 except SyntaxError:
2308 # We should only handle as help stuff which is NOT valid syntax
2308 # We should only handle as help stuff which is NOT valid syntax
2309 if line[0]==self.ESC_HELP:
2309 if line[0]==self.ESC_HELP:
2310 line = line[1:]
2310 line = line[1:]
2311 elif line[-1]==self.ESC_HELP:
2311 elif line[-1]==self.ESC_HELP:
2312 line = line[:-1]
2312 line = line[:-1]
2313 self.log(line,'#?'+line,line_info.continue_prompt)
2313 self.log(line,'#?'+line,line_info.continue_prompt)
2314 if line:
2314 if line:
2315 #print 'line:<%r>' % line # dbg
2315 #print 'line:<%r>' % line # dbg
2316 self.magic_pinfo(line)
2316 self.magic_pinfo(line)
2317 else:
2317 else:
2318 page(self.usage,screen_lines=self.rc.screen_length)
2318 page(self.usage,screen_lines=self.rc.screen_length)
2319 return '' # Empty string is needed here!
2319 return '' # Empty string is needed here!
2320 except:
2320 except:
2321 # Pass any other exceptions through to the normal handler
2321 # Pass any other exceptions through to the normal handler
2322 return self.handle_normal(line_info)
2322 return self.handle_normal(line_info)
2323 else:
2323 else:
2324 # If the code compiles ok, we should handle it normally
2324 # If the code compiles ok, we should handle it normally
2325 return self.handle_normal(line_info)
2325 return self.handle_normal(line_info)
2326
2326
2327 def getapi(self):
2327 def getapi(self):
2328 """ Get an IPApi object for this shell instance
2328 """ Get an IPApi object for this shell instance
2329
2329
2330 Getting an IPApi object is always preferable to accessing the shell
2330 Getting an IPApi object is always preferable to accessing the shell
2331 directly, but this holds true especially for extensions.
2331 directly, but this holds true especially for extensions.
2332
2332
2333 It should always be possible to implement an extension with IPApi
2333 It should always be possible to implement an extension with IPApi
2334 alone. If not, contact maintainer to request an addition.
2334 alone. If not, contact maintainer to request an addition.
2335
2335
2336 """
2336 """
2337 return self.api
2337 return self.api
2338
2338
2339 def handle_emacs(self, line_info):
2339 def handle_emacs(self, line_info):
2340 """Handle input lines marked by python-mode."""
2340 """Handle input lines marked by python-mode."""
2341
2341
2342 # Currently, nothing is done. Later more functionality can be added
2342 # Currently, nothing is done. Later more functionality can be added
2343 # here if needed.
2343 # here if needed.
2344
2344
2345 # The input cache shouldn't be updated
2345 # The input cache shouldn't be updated
2346 return line_info.line
2346 return line_info.line
2347
2347
2348
2348
2349 def mktempfile(self,data=None):
2349 def mktempfile(self,data=None):
2350 """Make a new tempfile and return its filename.
2350 """Make a new tempfile and return its filename.
2351
2351
2352 This makes a call to tempfile.mktemp, but it registers the created
2352 This makes a call to tempfile.mktemp, but it registers the created
2353 filename internally so ipython cleans it up at exit time.
2353 filename internally so ipython cleans it up at exit time.
2354
2354
2355 Optional inputs:
2355 Optional inputs:
2356
2356
2357 - data(None): if data is given, it gets written out to the temp file
2357 - data(None): if data is given, it gets written out to the temp file
2358 immediately, and the file is closed again."""
2358 immediately, and the file is closed again."""
2359
2359
2360 filename = tempfile.mktemp('.py','ipython_edit_')
2360 filename = tempfile.mktemp('.py','ipython_edit_')
2361 self.tempfiles.append(filename)
2361 self.tempfiles.append(filename)
2362
2362
2363 if data:
2363 if data:
2364 tmp_file = open(filename,'w')
2364 tmp_file = open(filename,'w')
2365 tmp_file.write(data)
2365 tmp_file.write(data)
2366 tmp_file.close()
2366 tmp_file.close()
2367 return filename
2367 return filename
2368
2368
2369 def write(self,data):
2369 def write(self,data):
2370 """Write a string to the default output"""
2370 """Write a string to the default output"""
2371 Term.cout.write(data)
2371 Term.cout.write(data)
2372
2372
2373 def write_err(self,data):
2373 def write_err(self,data):
2374 """Write a string to the default error output"""
2374 """Write a string to the default error output"""
2375 Term.cerr.write(data)
2375 Term.cerr.write(data)
2376
2376
2377 def exit(self):
2377 def exit(self):
2378 """Handle interactive exit.
2378 """Handle interactive exit.
2379
2379
2380 This method sets the exit_now attribute."""
2380 This method sets the exit_now attribute."""
2381
2381
2382 if self.rc.confirm_exit:
2382 if self.rc.confirm_exit:
2383 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2383 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2384 self.exit_now = True
2384 self.exit_now = True
2385 else:
2385 else:
2386 self.exit_now = True
2386 self.exit_now = True
2387
2387
2388 def safe_execfile(self,fname,*where,**kw):
2388 def safe_execfile(self,fname,*where,**kw):
2389 """A safe version of the builtin execfile().
2389 """A safe version of the builtin execfile().
2390
2390
2391 This version will never throw an exception, and knows how to handle
2391 This version will never throw an exception, and knows how to handle
2392 ipython logs as well."""
2392 ipython logs as well."""
2393
2393
2394 def syspath_cleanup():
2394 def syspath_cleanup():
2395 """Internal cleanup routine for sys.path."""
2395 """Internal cleanup routine for sys.path."""
2396 if add_dname:
2396 if add_dname:
2397 try:
2397 try:
2398 sys.path.remove(dname)
2398 sys.path.remove(dname)
2399 except ValueError:
2399 except ValueError:
2400 # For some reason the user has already removed it, ignore.
2400 # For some reason the user has already removed it, ignore.
2401 pass
2401 pass
2402
2402
2403 fname = os.path.expanduser(fname)
2403 fname = os.path.expanduser(fname)
2404
2404
2405 # Find things also in current directory. This is needed to mimic the
2405 # Find things also in current directory. This is needed to mimic the
2406 # behavior of running a script from the system command line, where
2406 # behavior of running a script from the system command line, where
2407 # Python inserts the script's directory into sys.path
2407 # Python inserts the script's directory into sys.path
2408 dname = os.path.dirname(os.path.abspath(fname))
2408 dname = os.path.dirname(os.path.abspath(fname))
2409 add_dname = False
2409 add_dname = False
2410 if dname not in sys.path:
2410 if dname not in sys.path:
2411 sys.path.insert(0,dname)
2411 sys.path.insert(0,dname)
2412 add_dname = True
2412 add_dname = True
2413
2413
2414 try:
2414 try:
2415 xfile = open(fname)
2415 xfile = open(fname)
2416 except:
2416 except:
2417 print >> Term.cerr, \
2417 print >> Term.cerr, \
2418 'Could not open file <%s> for safe execution.' % fname
2418 'Could not open file <%s> for safe execution.' % fname
2419 syspath_cleanup()
2419 syspath_cleanup()
2420 return None
2420 return None
2421
2421
2422 kw.setdefault('islog',0)
2422 kw.setdefault('islog',0)
2423 kw.setdefault('quiet',1)
2423 kw.setdefault('quiet',1)
2424 kw.setdefault('exit_ignore',0)
2424 kw.setdefault('exit_ignore',0)
2425 first = xfile.readline()
2425 first = xfile.readline()
2426 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2426 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2427 xfile.close()
2427 xfile.close()
2428 # line by line execution
2428 # line by line execution
2429 if first.startswith(loghead) or kw['islog']:
2429 if first.startswith(loghead) or kw['islog']:
2430 print 'Loading log file <%s> one line at a time...' % fname
2430 print 'Loading log file <%s> one line at a time...' % fname
2431 if kw['quiet']:
2431 if kw['quiet']:
2432 stdout_save = sys.stdout
2432 stdout_save = sys.stdout
2433 sys.stdout = StringIO.StringIO()
2433 sys.stdout = StringIO.StringIO()
2434 try:
2434 try:
2435 globs,locs = where[0:2]
2435 globs,locs = where[0:2]
2436 except:
2436 except:
2437 try:
2437 try:
2438 globs = locs = where[0]
2438 globs = locs = where[0]
2439 except:
2439 except:
2440 globs = locs = globals()
2440 globs = locs = globals()
2441 badblocks = []
2441 badblocks = []
2442
2442
2443 # we also need to identify indented blocks of code when replaying
2443 # we also need to identify indented blocks of code when replaying
2444 # logs and put them together before passing them to an exec
2444 # logs and put them together before passing them to an exec
2445 # statement. This takes a bit of regexp and look-ahead work in the
2445 # statement. This takes a bit of regexp and look-ahead work in the
2446 # file. It's easiest if we swallow the whole thing in memory
2446 # file. It's easiest if we swallow the whole thing in memory
2447 # first, and manually walk through the lines list moving the
2447 # first, and manually walk through the lines list moving the
2448 # counter ourselves.
2448 # counter ourselves.
2449 indent_re = re.compile('\s+\S')
2449 indent_re = re.compile('\s+\S')
2450 xfile = open(fname)
2450 xfile = open(fname)
2451 filelines = xfile.readlines()
2451 filelines = xfile.readlines()
2452 xfile.close()
2452 xfile.close()
2453 nlines = len(filelines)
2453 nlines = len(filelines)
2454 lnum = 0
2454 lnum = 0
2455 while lnum < nlines:
2455 while lnum < nlines:
2456 line = filelines[lnum]
2456 line = filelines[lnum]
2457 lnum += 1
2457 lnum += 1
2458 # don't re-insert logger status info into cache
2458 # don't re-insert logger status info into cache
2459 if line.startswith('#log#'):
2459 if line.startswith('#log#'):
2460 continue
2460 continue
2461 else:
2461 else:
2462 # build a block of code (maybe a single line) for execution
2462 # build a block of code (maybe a single line) for execution
2463 block = line
2463 block = line
2464 try:
2464 try:
2465 next = filelines[lnum] # lnum has already incremented
2465 next = filelines[lnum] # lnum has already incremented
2466 except:
2466 except:
2467 next = None
2467 next = None
2468 while next and indent_re.match(next):
2468 while next and indent_re.match(next):
2469 block += next
2469 block += next
2470 lnum += 1
2470 lnum += 1
2471 try:
2471 try:
2472 next = filelines[lnum]
2472 next = filelines[lnum]
2473 except:
2473 except:
2474 next = None
2474 next = None
2475 # now execute the block of one or more lines
2475 # now execute the block of one or more lines
2476 try:
2476 try:
2477 exec block in globs,locs
2477 exec block in globs,locs
2478 except SystemExit:
2478 except SystemExit:
2479 pass
2479 pass
2480 except:
2480 except:
2481 badblocks.append(block.rstrip())
2481 badblocks.append(block.rstrip())
2482 if kw['quiet']: # restore stdout
2482 if kw['quiet']: # restore stdout
2483 sys.stdout.close()
2483 sys.stdout.close()
2484 sys.stdout = stdout_save
2484 sys.stdout = stdout_save
2485 print 'Finished replaying log file <%s>' % fname
2485 print 'Finished replaying log file <%s>' % fname
2486 if badblocks:
2486 if badblocks:
2487 print >> sys.stderr, ('\nThe following lines/blocks in file '
2487 print >> sys.stderr, ('\nThe following lines/blocks in file '
2488 '<%s> reported errors:' % fname)
2488 '<%s> reported errors:' % fname)
2489
2489
2490 for badline in badblocks:
2490 for badline in badblocks:
2491 print >> sys.stderr, badline
2491 print >> sys.stderr, badline
2492 else: # regular file execution
2492 else: # regular file execution
2493 try:
2493 try:
2494 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2494 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2495 # Work around a bug in Python for Windows. The bug was
2495 # Work around a bug in Python for Windows. The bug was
2496 # fixed in in Python 2.5 r54159 and 54158, but that's still
2496 # fixed in in Python 2.5 r54159 and 54158, but that's still
2497 # SVN Python as of March/07. For details, see:
2497 # SVN Python as of March/07. For details, see:
2498 # http://projects.scipy.org/ipython/ipython/ticket/123
2498 # http://projects.scipy.org/ipython/ipython/ticket/123
2499 try:
2499 try:
2500 globs,locs = where[0:2]
2500 globs,locs = where[0:2]
2501 except:
2501 except:
2502 try:
2502 try:
2503 globs = locs = where[0]
2503 globs = locs = where[0]
2504 except:
2504 except:
2505 globs = locs = globals()
2505 globs = locs = globals()
2506 exec file(fname) in globs,locs
2506 exec file(fname) in globs,locs
2507 else:
2507 else:
2508 execfile(fname,*where)
2508 execfile(fname,*where)
2509 except SyntaxError:
2509 except SyntaxError:
2510 self.showsyntaxerror()
2510 self.showsyntaxerror()
2511 warn('Failure executing file: <%s>' % fname)
2511 warn('Failure executing file: <%s>' % fname)
2512 except SystemExit,status:
2512 except SystemExit,status:
2513 # Code that correctly sets the exit status flag to success (0)
2513 # Code that correctly sets the exit status flag to success (0)
2514 # shouldn't be bothered with a traceback. Note that a plain
2514 # shouldn't be bothered with a traceback. Note that a plain
2515 # sys.exit() does NOT set the message to 0 (it's empty) so that
2515 # sys.exit() does NOT set the message to 0 (it's empty) so that
2516 # will still get a traceback. Note that the structure of the
2516 # will still get a traceback. Note that the structure of the
2517 # SystemExit exception changed between Python 2.4 and 2.5, so
2517 # SystemExit exception changed between Python 2.4 and 2.5, so
2518 # the checks must be done in a version-dependent way.
2518 # the checks must be done in a version-dependent way.
2519 show = False
2519 show = False
2520
2520
2521 if sys.version_info[:2] > (2,5):
2521 if sys.version_info[:2] > (2,5):
2522 if status.message!=0 and not kw['exit_ignore']:
2522 if status.message!=0 and not kw['exit_ignore']:
2523 show = True
2523 show = True
2524 else:
2524 else:
2525 if status.code and not kw['exit_ignore']:
2525 if status.code and not kw['exit_ignore']:
2526 show = True
2526 show = True
2527 if show:
2527 if show:
2528 self.showtraceback()
2528 self.showtraceback()
2529 warn('Failure executing file: <%s>' % fname)
2529 warn('Failure executing file: <%s>' % fname)
2530 except:
2530 except:
2531 self.showtraceback()
2531 self.showtraceback()
2532 warn('Failure executing file: <%s>' % fname)
2532 warn('Failure executing file: <%s>' % fname)
2533
2533
2534 syspath_cleanup()
2534 syspath_cleanup()
2535
2535
2536 #************************* end of file <iplib.py> *****************************
2536 #************************* end of file <iplib.py> *****************************
@@ -1,7139 +1,7144 b''
1 2007-09-07 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py: do not auto-alias "dir", it screws up other dir auto
4 aliases.
5
1 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
6 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
2
7
3 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
8 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
4 preventing source display in certain cases. In reality I think
9 preventing source display in certain cases. In reality I think
5 the problem is with Ubuntu's Python build, but this change works
10 the problem is with Ubuntu's Python build, but this change works
6 around the issue in some cases (not in all, unfortunately). I'd
11 around the issue in some cases (not in all, unfortunately). I'd
7 filed a Python bug on this with more details, but in the change of
12 filed a Python bug on this with more details, but in the change of
8 bug trackers it seems to have been lost.
13 bug trackers it seems to have been lost.
9
14
10 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
15 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
11 not the same, it's not self-documenting, doesn't allow range
16 not the same, it's not self-documenting, doesn't allow range
12 selection, and sorts alphabetically instead of numerically.
17 selection, and sorts alphabetically instead of numerically.
13 (magic_r): restore %r. No, "up + enter. One char magic" is not
18 (magic_r): restore %r. No, "up + enter. One char magic" is not
14 the same thing, since %r takes parameters to allow fast retrieval
19 the same thing, since %r takes parameters to allow fast retrieval
15 of old commands. I've received emails from users who use this a
20 of old commands. I've received emails from users who use this a
16 LOT, so it stays.
21 LOT, so it stays.
17 (magic_automagic): restore %automagic. "use _ip.option.automagic"
22 (magic_automagic): restore %automagic. "use _ip.option.automagic"
18 is not a valid replacement b/c it doesn't provide an complete
23 is not a valid replacement b/c it doesn't provide an complete
19 explanation (which the automagic docstring does).
24 explanation (which the automagic docstring does).
20 (magic_autocall): restore %autocall, with improved docstring.
25 (magic_autocall): restore %autocall, with improved docstring.
21 Same argument as for others, "use _ip.options.autocall" is not a
26 Same argument as for others, "use _ip.options.autocall" is not a
22 valid replacement.
27 valid replacement.
23 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
28 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
24 tutorials and online docs.
29 tutorials and online docs.
25
30
26 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
31 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
27
32
28 * IPython/usage.py (quick_reference): mention magics in quickref,
33 * IPython/usage.py (quick_reference): mention magics in quickref,
29 modified main banner to mention %quickref.
34 modified main banner to mention %quickref.
30
35
31 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
36 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
32
37
33 2007-09-06 Ville Vainio <vivainio@gmail.com>
38 2007-09-06 Ville Vainio <vivainio@gmail.com>
34
39
35 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
40 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
36 Callable aliases now pass the _ip as first arg. This breaks
41 Callable aliases now pass the _ip as first arg. This breaks
37 compatibility with earlier 0.8.2.svn series! (though they should
42 compatibility with earlier 0.8.2.svn series! (though they should
38 not have been in use yet outside these few extensions)
43 not have been in use yet outside these few extensions)
39
44
40 2007-09-05 Ville Vainio <vivainio@gmail.com>
45 2007-09-05 Ville Vainio <vivainio@gmail.com>
41
46
42 * external/mglob.py: expand('dirname') => ['dirname'], instead
47 * external/mglob.py: expand('dirname') => ['dirname'], instead
43 of ['dirname/foo','dirname/bar', ...].
48 of ['dirname/foo','dirname/bar', ...].
44
49
45 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
50 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
46 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
51 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
47 is useful for others as well).
52 is useful for others as well).
48
53
49 * iplib.py: on callable aliases (as opposed to old style aliases),
54 * iplib.py: on callable aliases (as opposed to old style aliases),
50 do var_expand() immediately, and use make_quoted_expr instead
55 do var_expand() immediately, and use make_quoted_expr instead
51 of hardcoded r"""
56 of hardcoded r"""
52
57
53 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
58 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
54 if not available load ipy_fsops.py for cp, mv, etc. replacements
59 if not available load ipy_fsops.py for cp, mv, etc. replacements
55
60
56 * OInspect.py, ipy_which.py: improve %which and obj? for callable
61 * OInspect.py, ipy_which.py: improve %which and obj? for callable
57 aliases
62 aliases
58
63
59 2007-09-04 Ville Vainio <vivainio@gmail.com>
64 2007-09-04 Ville Vainio <vivainio@gmail.com>
60
65
61 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
66 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
62 Relicensed under BSD with the authors approval.
67 Relicensed under BSD with the authors approval.
63
68
64 * ipmaker.py, usage.py: Remove %magic from default banner, improve
69 * ipmaker.py, usage.py: Remove %magic from default banner, improve
65 %quickref
70 %quickref
66
71
67 2007-09-03 Ville Vainio <vivainio@gmail.com>
72 2007-09-03 Ville Vainio <vivainio@gmail.com>
68
73
69 * Magic.py: %time now passes expression through prefilter,
74 * Magic.py: %time now passes expression through prefilter,
70 allowing IPython syntax.
75 allowing IPython syntax.
71
76
72 2007-09-01 Ville Vainio <vivainio@gmail.com>
77 2007-09-01 Ville Vainio <vivainio@gmail.com>
73
78
74 * ipmaker.py: Always show full traceback when newstyle config fails
79 * ipmaker.py: Always show full traceback when newstyle config fails
75
80
76 2007-08-27 Ville Vainio <vivainio@gmail.com>
81 2007-08-27 Ville Vainio <vivainio@gmail.com>
77
82
78 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
83 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
79
84
80 2007-08-26 Ville Vainio <vivainio@gmail.com>
85 2007-08-26 Ville Vainio <vivainio@gmail.com>
81
86
82 * ipmaker.py: Command line args have the highest priority again
87 * ipmaker.py: Command line args have the highest priority again
83
88
84 * iplib.py, ipmaker.py: -i command line argument now behaves as in
89 * iplib.py, ipmaker.py: -i command line argument now behaves as in
85 normal python, i.e. leaves the IPython session running after -c
90 normal python, i.e. leaves the IPython session running after -c
86 command or running a batch file from command line.
91 command or running a batch file from command line.
87
92
88 2007-08-22 Ville Vainio <vivainio@gmail.com>
93 2007-08-22 Ville Vainio <vivainio@gmail.com>
89
94
90 * iplib.py: no extra empty (last) line in raw hist w/ multiline
95 * iplib.py: no extra empty (last) line in raw hist w/ multiline
91 statements
96 statements
92
97
93 * logger.py: Fix bug where blank lines in history were not
98 * logger.py: Fix bug where blank lines in history were not
94 added until AFTER adding the current line; translated and raw
99 added until AFTER adding the current line; translated and raw
95 history should finally be in sync with prompt now.
100 history should finally be in sync with prompt now.
96
101
97 * ipy_completers.py: quick_completer now makes it easy to create
102 * ipy_completers.py: quick_completer now makes it easy to create
98 trivial custom completers
103 trivial custom completers
99
104
100 * clearcmd.py: shadow history compression & erasing, fixed input hist
105 * clearcmd.py: shadow history compression & erasing, fixed input hist
101 clearing.
106 clearing.
102
107
103 * envpersist.py, history.py: %env (sh profile only), %hist completers
108 * envpersist.py, history.py: %env (sh profile only), %hist completers
104
109
105 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
110 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
106 term title now include the drive letter, and always use / instead of
111 term title now include the drive letter, and always use / instead of
107 os.sep (as per recommended approach for win32 ipython in general).
112 os.sep (as per recommended approach for win32 ipython in general).
108
113
109 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
114 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
110 plain python scripts from ipykit command line by running
115 plain python scripts from ipykit command line by running
111 "py myscript.py", even w/o installed python.
116 "py myscript.py", even w/o installed python.
112
117
113 2007-08-21 Ville Vainio <vivainio@gmail.com>
118 2007-08-21 Ville Vainio <vivainio@gmail.com>
114
119
115 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
120 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
116 (for backwards compatibility)
121 (for backwards compatibility)
117
122
118 * history.py: switch back to %hist -t from %hist -r as default.
123 * history.py: switch back to %hist -t from %hist -r as default.
119 At least until raw history is fixed for good.
124 At least until raw history is fixed for good.
120
125
121 2007-08-20 Ville Vainio <vivainio@gmail.com>
126 2007-08-20 Ville Vainio <vivainio@gmail.com>
122
127
123 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
128 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
124 locate alias redeclarations etc. Also, avoid handling
129 locate alias redeclarations etc. Also, avoid handling
125 _ip.IP.alias_table directly, prefer using _ip.defalias.
130 _ip.IP.alias_table directly, prefer using _ip.defalias.
126
131
127
132
128 2007-08-15 Ville Vainio <vivainio@gmail.com>
133 2007-08-15 Ville Vainio <vivainio@gmail.com>
129
134
130 * prefilter.py: ! is now always served first
135 * prefilter.py: ! is now always served first
131
136
132 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
137 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
133
138
134 * IPython/iplib.py (safe_execfile): fix the SystemExit
139 * IPython/iplib.py (safe_execfile): fix the SystemExit
135 auto-suppression code to work in Python2.4 (the internal structure
140 auto-suppression code to work in Python2.4 (the internal structure
136 of that exception changed and I'd only tested the code with 2.5).
141 of that exception changed and I'd only tested the code with 2.5).
137 Bug reported by a SciPy attendee.
142 Bug reported by a SciPy attendee.
138
143
139 2007-08-13 Ville Vainio <vivainio@gmail.com>
144 2007-08-13 Ville Vainio <vivainio@gmail.com>
140
145
141 * prefilter.py: reverted !c:/bin/foo fix, made % in
146 * prefilter.py: reverted !c:/bin/foo fix, made % in
142 multiline specials work again
147 multiline specials work again
143
148
144 2007-08-13 Ville Vainio <vivainio@gmail.com>
149 2007-08-13 Ville Vainio <vivainio@gmail.com>
145
150
146 * prefilter.py: Take more care to special-case !, so that
151 * prefilter.py: Take more care to special-case !, so that
147 !c:/bin/foo.exe works.
152 !c:/bin/foo.exe works.
148
153
149 * setup.py: if we are building eggs, strip all docs and
154 * setup.py: if we are building eggs, strip all docs and
150 examples (it doesn't make sense to bytecompile examples,
155 examples (it doesn't make sense to bytecompile examples,
151 and docs would be in an awkward place anyway).
156 and docs would be in an awkward place anyway).
152
157
153 * Ryan Krauss' patch fixes start menu shortcuts when IPython
158 * Ryan Krauss' patch fixes start menu shortcuts when IPython
154 is installed into a directory that has spaces in the name.
159 is installed into a directory that has spaces in the name.
155
160
156 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
161 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
157
162
158 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
163 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
159 doctest profile and %doctest_mode, so they actually generate the
164 doctest profile and %doctest_mode, so they actually generate the
160 blank lines needed by doctest to separate individual tests.
165 blank lines needed by doctest to separate individual tests.
161
166
162 * IPython/iplib.py (safe_execfile): modify so that running code
167 * IPython/iplib.py (safe_execfile): modify so that running code
163 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
168 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
164 doesn't get a printed traceback. Any other value in sys.exit(),
169 doesn't get a printed traceback. Any other value in sys.exit(),
165 including the empty call, still generates a traceback. This
170 including the empty call, still generates a traceback. This
166 enables use of %run without having to pass '-e' for codes that
171 enables use of %run without having to pass '-e' for codes that
167 correctly set the exit status flag.
172 correctly set the exit status flag.
168
173
169 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
174 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
170
175
171 * IPython/iplib.py (InteractiveShell.post_config_initialization):
176 * IPython/iplib.py (InteractiveShell.post_config_initialization):
172 fix problems with doctests failing when run inside IPython due to
177 fix problems with doctests failing when run inside IPython due to
173 IPython's modifications of sys.displayhook.
178 IPython's modifications of sys.displayhook.
174
179
175 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
180 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
176
181
177 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
182 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
178 a string with names.
183 a string with names.
179
184
180 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
185 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
181
186
182 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
187 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
183 magic to toggle on/off the doctest pasting support without having
188 magic to toggle on/off the doctest pasting support without having
184 to leave a session to switch to a separate profile.
189 to leave a session to switch to a separate profile.
185
190
186 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
191 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
187
192
188 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
193 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
189 introduce a blank line between inputs, to conform to doctest
194 introduce a blank line between inputs, to conform to doctest
190 requirements.
195 requirements.
191
196
192 * IPython/OInspect.py (Inspector.pinfo): fix another part where
197 * IPython/OInspect.py (Inspector.pinfo): fix another part where
193 auto-generated docstrings for new-style classes were showing up.
198 auto-generated docstrings for new-style classes were showing up.
194
199
195 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
200 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
196
201
197 * api_changes: Add new file to track backward-incompatible
202 * api_changes: Add new file to track backward-incompatible
198 user-visible changes.
203 user-visible changes.
199
204
200 2007-08-06 Ville Vainio <vivainio@gmail.com>
205 2007-08-06 Ville Vainio <vivainio@gmail.com>
201
206
202 * ipmaker.py: fix bug where user_config_ns didn't exist at all
207 * ipmaker.py: fix bug where user_config_ns didn't exist at all
203 before all the config files were handled.
208 before all the config files were handled.
204
209
205 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
210 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
206
211
207 * IPython/irunner.py (RunnerFactory): Add new factory class for
212 * IPython/irunner.py (RunnerFactory): Add new factory class for
208 creating reusable runners based on filenames.
213 creating reusable runners based on filenames.
209
214
210 * IPython/Extensions/ipy_profile_doctest.py: New profile for
215 * IPython/Extensions/ipy_profile_doctest.py: New profile for
211 doctest support. It sets prompts/exceptions as similar to
216 doctest support. It sets prompts/exceptions as similar to
212 standard Python as possible, so that ipython sessions in this
217 standard Python as possible, so that ipython sessions in this
213 profile can be easily pasted as doctests with minimal
218 profile can be easily pasted as doctests with minimal
214 modifications. It also enables pasting of doctests from external
219 modifications. It also enables pasting of doctests from external
215 sources (even if they have leading whitespace), so that you can
220 sources (even if they have leading whitespace), so that you can
216 rerun doctests from existing sources.
221 rerun doctests from existing sources.
217
222
218 * IPython/iplib.py (_prefilter): fix a buglet where after entering
223 * IPython/iplib.py (_prefilter): fix a buglet where after entering
219 some whitespace, the prompt would become a continuation prompt
224 some whitespace, the prompt would become a continuation prompt
220 with no way of exiting it other than Ctrl-C. This fix brings us
225 with no way of exiting it other than Ctrl-C. This fix brings us
221 into conformity with how the default python prompt works.
226 into conformity with how the default python prompt works.
222
227
223 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
228 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
224 Add support for pasting not only lines that start with '>>>', but
229 Add support for pasting not only lines that start with '>>>', but
225 also with ' >>>'. That is, arbitrary whitespace can now precede
230 also with ' >>>'. That is, arbitrary whitespace can now precede
226 the prompts. This makes the system useful for pasting doctests
231 the prompts. This makes the system useful for pasting doctests
227 from docstrings back into a normal session.
232 from docstrings back into a normal session.
228
233
229 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
234 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
230
235
231 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
236 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
232 r1357, which had killed multiple invocations of an embedded
237 r1357, which had killed multiple invocations of an embedded
233 ipython (this means that example-embed has been broken for over 1
238 ipython (this means that example-embed has been broken for over 1
234 year!!!). Rather than possibly breaking the batch stuff for which
239 year!!!). Rather than possibly breaking the batch stuff for which
235 the code in iplib.py/interact was introduced, I worked around the
240 the code in iplib.py/interact was introduced, I worked around the
236 problem in the embedding class in Shell.py. We really need a
241 problem in the embedding class in Shell.py. We really need a
237 bloody test suite for this code, I'm sick of finding stuff that
242 bloody test suite for this code, I'm sick of finding stuff that
238 used to work breaking left and right every time I use an old
243 used to work breaking left and right every time I use an old
239 feature I hadn't touched in a few months.
244 feature I hadn't touched in a few months.
240 (kill_embedded): Add a new magic that only shows up in embedded
245 (kill_embedded): Add a new magic that only shows up in embedded
241 mode, to allow users to permanently deactivate an embedded instance.
246 mode, to allow users to permanently deactivate an embedded instance.
242
247
243 2007-08-01 Ville Vainio <vivainio@gmail.com>
248 2007-08-01 Ville Vainio <vivainio@gmail.com>
244
249
245 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
250 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
246 history gets out of sync on runlines (e.g. when running macros).
251 history gets out of sync on runlines (e.g. when running macros).
247
252
248 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
253 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
249
254
250 * IPython/Magic.py (magic_colors): fix win32-related error message
255 * IPython/Magic.py (magic_colors): fix win32-related error message
251 that could appear under *nix when readline was missing. Patch by
256 that could appear under *nix when readline was missing. Patch by
252 Scott Jackson, closes #175.
257 Scott Jackson, closes #175.
253
258
254 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
259 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
255
260
256 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
261 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
257 completer that it traits-aware, so that traits objects don't show
262 completer that it traits-aware, so that traits objects don't show
258 all of their internal attributes all the time.
263 all of their internal attributes all the time.
259
264
260 * IPython/genutils.py (dir2): moved this code from inside
265 * IPython/genutils.py (dir2): moved this code from inside
261 completer.py to expose it publicly, so I could use it in the
266 completer.py to expose it publicly, so I could use it in the
262 wildcards bugfix.
267 wildcards bugfix.
263
268
264 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
269 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
265 Stefan with Traits.
270 Stefan with Traits.
266
271
267 * IPython/completer.py (Completer.attr_matches): change internal
272 * IPython/completer.py (Completer.attr_matches): change internal
268 var name from 'object' to 'obj', since 'object' is now a builtin
273 var name from 'object' to 'obj', since 'object' is now a builtin
269 and this can lead to weird bugs if reusing this code elsewhere.
274 and this can lead to weird bugs if reusing this code elsewhere.
270
275
271 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
276 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
272
277
273 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
278 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
274 'foo?' and update the code to prevent printing of default
279 'foo?' and update the code to prevent printing of default
275 docstrings that started appearing after I added support for
280 docstrings that started appearing after I added support for
276 new-style classes. The approach I'm using isn't ideal (I just
281 new-style classes. The approach I'm using isn't ideal (I just
277 special-case those strings) but I'm not sure how to more robustly
282 special-case those strings) but I'm not sure how to more robustly
278 differentiate between truly user-written strings and Python's
283 differentiate between truly user-written strings and Python's
279 automatic ones.
284 automatic ones.
280
285
281 2007-07-09 Ville Vainio <vivainio@gmail.com>
286 2007-07-09 Ville Vainio <vivainio@gmail.com>
282
287
283 * completer.py: Applied Matthew Neeley's patch:
288 * completer.py: Applied Matthew Neeley's patch:
284 Dynamic attributes from trait_names and _getAttributeNames are added
289 Dynamic attributes from trait_names and _getAttributeNames are added
285 to the list of tab completions, but when this happens, the attribute
290 to the list of tab completions, but when this happens, the attribute
286 list is turned into a set, so the attributes are unordered when
291 list is turned into a set, so the attributes are unordered when
287 printed, which makes it hard to find the right completion. This patch
292 printed, which makes it hard to find the right completion. This patch
288 turns this set back into a list and sort it.
293 turns this set back into a list and sort it.
289
294
290 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
295 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
291
296
292 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
297 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
293 classes in various inspector functions.
298 classes in various inspector functions.
294
299
295 2007-06-28 Ville Vainio <vivainio@gmail.com>
300 2007-06-28 Ville Vainio <vivainio@gmail.com>
296
301
297 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
302 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
298 Implement "shadow" namespace, and callable aliases that reside there.
303 Implement "shadow" namespace, and callable aliases that reside there.
299 Use them by:
304 Use them by:
300
305
301 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
306 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
302
307
303 foo hello world
308 foo hello world
304 (gets translated to:)
309 (gets translated to:)
305 _sh.foo(r"""hello world""")
310 _sh.foo(r"""hello world""")
306
311
307 In practice, this kind of alias can take the role of a magic function
312 In practice, this kind of alias can take the role of a magic function
308
313
309 * New generic inspect_object, called on obj? and obj??
314 * New generic inspect_object, called on obj? and obj??
310
315
311 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
316 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
312
317
313 * IPython/ultraTB.py (findsource): fix a problem with
318 * IPython/ultraTB.py (findsource): fix a problem with
314 inspect.getfile that can cause crashes during traceback construction.
319 inspect.getfile that can cause crashes during traceback construction.
315
320
316 2007-06-14 Ville Vainio <vivainio@gmail.com>
321 2007-06-14 Ville Vainio <vivainio@gmail.com>
317
322
318 * iplib.py (handle_auto): Try to use ascii for printing "--->"
323 * iplib.py (handle_auto): Try to use ascii for printing "--->"
319 autocall rewrite indication, becausesometimes unicode fails to print
324 autocall rewrite indication, becausesometimes unicode fails to print
320 properly (and you get ' - - - '). Use plain uncoloured ---> for
325 properly (and you get ' - - - '). Use plain uncoloured ---> for
321 unicode.
326 unicode.
322
327
323 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
328 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
324
329
325 . pickleshare 'hash' commands (hget, hset, hcompress,
330 . pickleshare 'hash' commands (hget, hset, hcompress,
326 hdict) for efficient shadow history storage.
331 hdict) for efficient shadow history storage.
327
332
328 2007-06-13 Ville Vainio <vivainio@gmail.com>
333 2007-06-13 Ville Vainio <vivainio@gmail.com>
329
334
330 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
335 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
331 Added kw arg 'interactive', tell whether vars should be visible
336 Added kw arg 'interactive', tell whether vars should be visible
332 with %whos.
337 with %whos.
333
338
334 2007-06-11 Ville Vainio <vivainio@gmail.com>
339 2007-06-11 Ville Vainio <vivainio@gmail.com>
335
340
336 * pspersistence.py, Magic.py, iplib.py: directory history now saved
341 * pspersistence.py, Magic.py, iplib.py: directory history now saved
337 to db
342 to db
338
343
339 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
344 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
340 Also, it exits IPython immediately after evaluating the command (just like
345 Also, it exits IPython immediately after evaluating the command (just like
341 std python)
346 std python)
342
347
343 2007-06-05 Walter Doerwald <walter@livinglogic.de>
348 2007-06-05 Walter Doerwald <walter@livinglogic.de>
344
349
345 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
350 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
346 Python string and captures the output. (Idea and original patch by
351 Python string and captures the output. (Idea and original patch by
347 Stefan van der Walt)
352 Stefan van der Walt)
348
353
349 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
354 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
350
355
351 * IPython/ultraTB.py (VerboseTB.text): update printing of
356 * IPython/ultraTB.py (VerboseTB.text): update printing of
352 exception types for Python 2.5 (now all exceptions in the stdlib
357 exception types for Python 2.5 (now all exceptions in the stdlib
353 are new-style classes).
358 are new-style classes).
354
359
355 2007-05-31 Walter Doerwald <walter@livinglogic.de>
360 2007-05-31 Walter Doerwald <walter@livinglogic.de>
356
361
357 * IPython/Extensions/igrid.py: Add new commands refresh and
362 * IPython/Extensions/igrid.py: Add new commands refresh and
358 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
363 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
359 the iterator once (refresh) or after every x seconds (refresh_timer).
364 the iterator once (refresh) or after every x seconds (refresh_timer).
360 Add a working implementation of "searchexpression", where the text
365 Add a working implementation of "searchexpression", where the text
361 entered is not the text to search for, but an expression that must
366 entered is not the text to search for, but an expression that must
362 be true. Added display of shortcuts to the menu. Added commands "pickinput"
367 be true. Added display of shortcuts to the menu. Added commands "pickinput"
363 and "pickinputattr" that put the object or attribute under the cursor
368 and "pickinputattr" that put the object or attribute under the cursor
364 in the input line. Split the statusbar to be able to display the currently
369 in the input line. Split the statusbar to be able to display the currently
365 active refresh interval. (Patch by Nik Tautenhahn)
370 active refresh interval. (Patch by Nik Tautenhahn)
366
371
367 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
372 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
368
373
369 * fixing set_term_title to use ctypes as default
374 * fixing set_term_title to use ctypes as default
370
375
371 * fixing set_term_title fallback to work when curent dir
376 * fixing set_term_title fallback to work when curent dir
372 is on a windows network share
377 is on a windows network share
373
378
374 2007-05-28 Ville Vainio <vivainio@gmail.com>
379 2007-05-28 Ville Vainio <vivainio@gmail.com>
375
380
376 * %cpaste: strip + with > from left (diffs).
381 * %cpaste: strip + with > from left (diffs).
377
382
378 * iplib.py: Fix crash when readline not installed
383 * iplib.py: Fix crash when readline not installed
379
384
380 2007-05-26 Ville Vainio <vivainio@gmail.com>
385 2007-05-26 Ville Vainio <vivainio@gmail.com>
381
386
382 * generics.py: intruduce easy to extend result_display generic
387 * generics.py: intruduce easy to extend result_display generic
383 function (using simplegeneric.py).
388 function (using simplegeneric.py).
384
389
385 * Fixed the append functionality of %set.
390 * Fixed the append functionality of %set.
386
391
387 2007-05-25 Ville Vainio <vivainio@gmail.com>
392 2007-05-25 Ville Vainio <vivainio@gmail.com>
388
393
389 * New magic: %rep (fetch / run old commands from history)
394 * New magic: %rep (fetch / run old commands from history)
390
395
391 * New extension: mglob (%mglob magic), for powerful glob / find /filter
396 * New extension: mglob (%mglob magic), for powerful glob / find /filter
392 like functionality
397 like functionality
393
398
394 % maghistory.py: %hist -g PATTERM greps the history for pattern
399 % maghistory.py: %hist -g PATTERM greps the history for pattern
395
400
396 2007-05-24 Walter Doerwald <walter@livinglogic.de>
401 2007-05-24 Walter Doerwald <walter@livinglogic.de>
397
402
398 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
403 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
399 browse the IPython input history
404 browse the IPython input history
400
405
401 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
406 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
402 (mapped to "i") can be used to put the object under the curser in the input
407 (mapped to "i") can be used to put the object under the curser in the input
403 line. pickinputattr (mapped to "I") does the same for the attribute under
408 line. pickinputattr (mapped to "I") does the same for the attribute under
404 the cursor.
409 the cursor.
405
410
406 2007-05-24 Ville Vainio <vivainio@gmail.com>
411 2007-05-24 Ville Vainio <vivainio@gmail.com>
407
412
408 * Grand magic cleansing (changeset [2380]):
413 * Grand magic cleansing (changeset [2380]):
409
414
410 * Introduce ipy_legacy.py where the following magics were
415 * Introduce ipy_legacy.py where the following magics were
411 moved:
416 moved:
412
417
413 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
418 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
414
419
415 If you need them, either use default profile or "import ipy_legacy"
420 If you need them, either use default profile or "import ipy_legacy"
416 in your ipy_user_conf.py
421 in your ipy_user_conf.py
417
422
418 * Move sh and scipy profile to Extensions from UserConfig. this implies
423 * Move sh and scipy profile to Extensions from UserConfig. this implies
419 you should not edit them, but you don't need to run %upgrade when
424 you should not edit them, but you don't need to run %upgrade when
420 upgrading IPython anymore.
425 upgrading IPython anymore.
421
426
422 * %hist/%history now operates in "raw" mode by default. To get the old
427 * %hist/%history now operates in "raw" mode by default. To get the old
423 behaviour, run '%hist -n' (native mode).
428 behaviour, run '%hist -n' (native mode).
424
429
425 * split ipy_stock_completers.py to ipy_stock_completers.py and
430 * split ipy_stock_completers.py to ipy_stock_completers.py and
426 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
431 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
427 installed as default.
432 installed as default.
428
433
429 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
434 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
430 handling.
435 handling.
431
436
432 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
437 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
433 input if readline is available.
438 input if readline is available.
434
439
435 2007-05-23 Ville Vainio <vivainio@gmail.com>
440 2007-05-23 Ville Vainio <vivainio@gmail.com>
436
441
437 * macro.py: %store uses __getstate__ properly
442 * macro.py: %store uses __getstate__ properly
438
443
439 * exesetup.py: added new setup script for creating
444 * exesetup.py: added new setup script for creating
440 standalone IPython executables with py2exe (i.e.
445 standalone IPython executables with py2exe (i.e.
441 no python installation required).
446 no python installation required).
442
447
443 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
448 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
444 its place.
449 its place.
445
450
446 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
451 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
447
452
448 2007-05-21 Ville Vainio <vivainio@gmail.com>
453 2007-05-21 Ville Vainio <vivainio@gmail.com>
449
454
450 * platutil_win32.py (set_term_title): handle
455 * platutil_win32.py (set_term_title): handle
451 failure of 'title' system call properly.
456 failure of 'title' system call properly.
452
457
453 2007-05-17 Walter Doerwald <walter@livinglogic.de>
458 2007-05-17 Walter Doerwald <walter@livinglogic.de>
454
459
455 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
460 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
456 (Bug detected by Paul Mueller).
461 (Bug detected by Paul Mueller).
457
462
458 2007-05-16 Ville Vainio <vivainio@gmail.com>
463 2007-05-16 Ville Vainio <vivainio@gmail.com>
459
464
460 * ipy_profile_sci.py, ipython_win_post_install.py: Create
465 * ipy_profile_sci.py, ipython_win_post_install.py: Create
461 new "sci" profile, effectively a modern version of the old
466 new "sci" profile, effectively a modern version of the old
462 "scipy" profile (which is now slated for deprecation).
467 "scipy" profile (which is now slated for deprecation).
463
468
464 2007-05-15 Ville Vainio <vivainio@gmail.com>
469 2007-05-15 Ville Vainio <vivainio@gmail.com>
465
470
466 * pycolorize.py, pycolor.1: Paul Mueller's patches that
471 * pycolorize.py, pycolor.1: Paul Mueller's patches that
467 make pycolorize read input from stdin when run without arguments.
472 make pycolorize read input from stdin when run without arguments.
468
473
469 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
474 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
470
475
471 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
476 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
472 it in sh profile (instead of ipy_system_conf.py).
477 it in sh profile (instead of ipy_system_conf.py).
473
478
474 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
479 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
475 aliases are now lower case on windows (MyCommand.exe => mycommand).
480 aliases are now lower case on windows (MyCommand.exe => mycommand).
476
481
477 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
482 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
478 Macros are now callable objects that inherit from ipapi.IPyAutocall,
483 Macros are now callable objects that inherit from ipapi.IPyAutocall,
479 i.e. get autocalled regardless of system autocall setting.
484 i.e. get autocalled regardless of system autocall setting.
480
485
481 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
486 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
482
487
483 * IPython/rlineimpl.py: check for clear_history in readline and
488 * IPython/rlineimpl.py: check for clear_history in readline and
484 make it a dummy no-op if not available. This function isn't
489 make it a dummy no-op if not available. This function isn't
485 guaranteed to be in the API and appeared in Python 2.4, so we need
490 guaranteed to be in the API and appeared in Python 2.4, so we need
486 to check it ourselves. Also, clean up this file quite a bit.
491 to check it ourselves. Also, clean up this file quite a bit.
487
492
488 * ipython.1: update man page and full manual with information
493 * ipython.1: update man page and full manual with information
489 about threads (remove outdated warning). Closes #151.
494 about threads (remove outdated warning). Closes #151.
490
495
491 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
496 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
492
497
493 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
498 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
494 in trunk (note that this made it into the 0.8.1 release already,
499 in trunk (note that this made it into the 0.8.1 release already,
495 but the changelogs didn't get coordinated). Many thanks to Gael
500 but the changelogs didn't get coordinated). Many thanks to Gael
496 Varoquaux <gael.varoquaux-AT-normalesup.org>
501 Varoquaux <gael.varoquaux-AT-normalesup.org>
497
502
498 2007-05-09 *** Released version 0.8.1
503 2007-05-09 *** Released version 0.8.1
499
504
500 2007-05-10 Walter Doerwald <walter@livinglogic.de>
505 2007-05-10 Walter Doerwald <walter@livinglogic.de>
501
506
502 * IPython/Extensions/igrid.py: Incorporate html help into
507 * IPython/Extensions/igrid.py: Incorporate html help into
503 the module, so we don't have to search for the file.
508 the module, so we don't have to search for the file.
504
509
505 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
510 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
506
511
507 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
512 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
508
513
509 2007-04-30 Ville Vainio <vivainio@gmail.com>
514 2007-04-30 Ville Vainio <vivainio@gmail.com>
510
515
511 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
516 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
512 user has illegal (non-ascii) home directory name
517 user has illegal (non-ascii) home directory name
513
518
514 2007-04-27 Ville Vainio <vivainio@gmail.com>
519 2007-04-27 Ville Vainio <vivainio@gmail.com>
515
520
516 * platutils_win32.py: implement set_term_title for windows
521 * platutils_win32.py: implement set_term_title for windows
517
522
518 * Update version number
523 * Update version number
519
524
520 * ipy_profile_sh.py: more informative prompt (2 dir levels)
525 * ipy_profile_sh.py: more informative prompt (2 dir levels)
521
526
522 2007-04-26 Walter Doerwald <walter@livinglogic.de>
527 2007-04-26 Walter Doerwald <walter@livinglogic.de>
523
528
524 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
529 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
525 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
530 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
526 bug discovered by Ville).
531 bug discovered by Ville).
527
532
528 2007-04-26 Ville Vainio <vivainio@gmail.com>
533 2007-04-26 Ville Vainio <vivainio@gmail.com>
529
534
530 * Extensions/ipy_completers.py: Olivier's module completer now
535 * Extensions/ipy_completers.py: Olivier's module completer now
531 saves the list of root modules if it takes > 4 secs on the first run.
536 saves the list of root modules if it takes > 4 secs on the first run.
532
537
533 * Magic.py (%rehashx): %rehashx now clears the completer cache
538 * Magic.py (%rehashx): %rehashx now clears the completer cache
534
539
535
540
536 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
541 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
537
542
538 * ipython.el: fix incorrect color scheme, reported by Stefan.
543 * ipython.el: fix incorrect color scheme, reported by Stefan.
539 Closes #149.
544 Closes #149.
540
545
541 * IPython/PyColorize.py (Parser.format2): fix state-handling
546 * IPython/PyColorize.py (Parser.format2): fix state-handling
542 logic. I still don't like how that code handles state, but at
547 logic. I still don't like how that code handles state, but at
543 least now it should be correct, if inelegant. Closes #146.
548 least now it should be correct, if inelegant. Closes #146.
544
549
545 2007-04-25 Ville Vainio <vivainio@gmail.com>
550 2007-04-25 Ville Vainio <vivainio@gmail.com>
546
551
547 * Extensions/ipy_which.py: added extension for %which magic, works
552 * Extensions/ipy_which.py: added extension for %which magic, works
548 a lot like unix 'which' but also finds and expands aliases, and
553 a lot like unix 'which' but also finds and expands aliases, and
549 allows wildcards.
554 allows wildcards.
550
555
551 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
556 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
552 as opposed to returning nothing.
557 as opposed to returning nothing.
553
558
554 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
559 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
555 ipy_stock_completers on default profile, do import on sh profile.
560 ipy_stock_completers on default profile, do import on sh profile.
556
561
557 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
562 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
558
563
559 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
564 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
560 like ipython.py foo.py which raised a IndexError.
565 like ipython.py foo.py which raised a IndexError.
561
566
562 2007-04-21 Ville Vainio <vivainio@gmail.com>
567 2007-04-21 Ville Vainio <vivainio@gmail.com>
563
568
564 * Extensions/ipy_extutil.py: added extension to manage other ipython
569 * Extensions/ipy_extutil.py: added extension to manage other ipython
565 extensions. Now only supports 'ls' == list extensions.
570 extensions. Now only supports 'ls' == list extensions.
566
571
567 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
572 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
568
573
569 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
574 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
570 would prevent use of the exception system outside of a running
575 would prevent use of the exception system outside of a running
571 IPython instance.
576 IPython instance.
572
577
573 2007-04-20 Ville Vainio <vivainio@gmail.com>
578 2007-04-20 Ville Vainio <vivainio@gmail.com>
574
579
575 * Extensions/ipy_render.py: added extension for easy
580 * Extensions/ipy_render.py: added extension for easy
576 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
581 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
577 'Iptl' template notation,
582 'Iptl' template notation,
578
583
579 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
584 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
580 safer & faster 'import' completer.
585 safer & faster 'import' completer.
581
586
582 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
587 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
583 and _ip.defalias(name, command).
588 and _ip.defalias(name, command).
584
589
585 * Extensions/ipy_exportdb.py: New extension for exporting all the
590 * Extensions/ipy_exportdb.py: New extension for exporting all the
586 %store'd data in a portable format (normal ipapi calls like
591 %store'd data in a portable format (normal ipapi calls like
587 defmacro() etc.)
592 defmacro() etc.)
588
593
589 2007-04-19 Ville Vainio <vivainio@gmail.com>
594 2007-04-19 Ville Vainio <vivainio@gmail.com>
590
595
591 * upgrade_dir.py: skip junk files like *.pyc
596 * upgrade_dir.py: skip junk files like *.pyc
592
597
593 * Release.py: version number to 0.8.1
598 * Release.py: version number to 0.8.1
594
599
595 2007-04-18 Ville Vainio <vivainio@gmail.com>
600 2007-04-18 Ville Vainio <vivainio@gmail.com>
596
601
597 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
602 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
598 and later on win32.
603 and later on win32.
599
604
600 2007-04-16 Ville Vainio <vivainio@gmail.com>
605 2007-04-16 Ville Vainio <vivainio@gmail.com>
601
606
602 * iplib.py (showtraceback): Do not crash when running w/o readline.
607 * iplib.py (showtraceback): Do not crash when running w/o readline.
603
608
604 2007-04-12 Walter Doerwald <walter@livinglogic.de>
609 2007-04-12 Walter Doerwald <walter@livinglogic.de>
605
610
606 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
611 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
607 sorted (case sensitive with files and dirs mixed).
612 sorted (case sensitive with files and dirs mixed).
608
613
609 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
614 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
610
615
611 * IPython/Release.py (version): Open trunk for 0.8.1 development.
616 * IPython/Release.py (version): Open trunk for 0.8.1 development.
612
617
613 2007-04-10 *** Released version 0.8.0
618 2007-04-10 *** Released version 0.8.0
614
619
615 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
620 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
616
621
617 * Tag 0.8.0 for release.
622 * Tag 0.8.0 for release.
618
623
619 * IPython/iplib.py (reloadhist): add API function to cleanly
624 * IPython/iplib.py (reloadhist): add API function to cleanly
620 reload the readline history, which was growing inappropriately on
625 reload the readline history, which was growing inappropriately on
621 every %run call.
626 every %run call.
622
627
623 * win32_manual_post_install.py (run): apply last part of Nicolas
628 * win32_manual_post_install.py (run): apply last part of Nicolas
624 Pernetty's patch (I'd accidentally applied it in a different
629 Pernetty's patch (I'd accidentally applied it in a different
625 directory and this particular file didn't get patched).
630 directory and this particular file didn't get patched).
626
631
627 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
632 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
628
633
629 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
634 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
630 find the main thread id and use the proper API call. Thanks to
635 find the main thread id and use the proper API call. Thanks to
631 Stefan for the fix.
636 Stefan for the fix.
632
637
633 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
638 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
634 unit tests to reflect fixed ticket #52, and add more tests sent by
639 unit tests to reflect fixed ticket #52, and add more tests sent by
635 him.
640 him.
636
641
637 * IPython/iplib.py (raw_input): restore the readline completer
642 * IPython/iplib.py (raw_input): restore the readline completer
638 state on every input, in case third-party code messed it up.
643 state on every input, in case third-party code messed it up.
639 (_prefilter): revert recent addition of early-escape checks which
644 (_prefilter): revert recent addition of early-escape checks which
640 prevent many valid alias calls from working.
645 prevent many valid alias calls from working.
641
646
642 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
647 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
643 flag for sigint handler so we don't run a full signal() call on
648 flag for sigint handler so we don't run a full signal() call on
644 each runcode access.
649 each runcode access.
645
650
646 * IPython/Magic.py (magic_whos): small improvement to diagnostic
651 * IPython/Magic.py (magic_whos): small improvement to diagnostic
647 message.
652 message.
648
653
649 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
654 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
650
655
651 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
656 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
652 asynchronous exceptions working, i.e., Ctrl-C can actually
657 asynchronous exceptions working, i.e., Ctrl-C can actually
653 interrupt long-running code in the multithreaded shells.
658 interrupt long-running code in the multithreaded shells.
654
659
655 This is using Tomer Filiba's great ctypes-based trick:
660 This is using Tomer Filiba's great ctypes-based trick:
656 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
661 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
657 this in the past, but hadn't been able to make it work before. So
662 this in the past, but hadn't been able to make it work before. So
658 far it looks like it's actually running, but this needs more
663 far it looks like it's actually running, but this needs more
659 testing. If it really works, I'll be *very* happy, and we'll owe
664 testing. If it really works, I'll be *very* happy, and we'll owe
660 a huge thank you to Tomer. My current implementation is ugly,
665 a huge thank you to Tomer. My current implementation is ugly,
661 hackish and uses nasty globals, but I don't want to try and clean
666 hackish and uses nasty globals, but I don't want to try and clean
662 anything up until we know if it actually works.
667 anything up until we know if it actually works.
663
668
664 NOTE: this feature needs ctypes to work. ctypes is included in
669 NOTE: this feature needs ctypes to work. ctypes is included in
665 Python2.5, but 2.4 users will need to manually install it. This
670 Python2.5, but 2.4 users will need to manually install it. This
666 feature makes multi-threaded shells so much more usable that it's
671 feature makes multi-threaded shells so much more usable that it's
667 a minor price to pay (ctypes is very easy to install, already a
672 a minor price to pay (ctypes is very easy to install, already a
668 requirement for win32 and available in major linux distros).
673 requirement for win32 and available in major linux distros).
669
674
670 2007-04-04 Ville Vainio <vivainio@gmail.com>
675 2007-04-04 Ville Vainio <vivainio@gmail.com>
671
676
672 * Extensions/ipy_completers.py, ipy_stock_completers.py:
677 * Extensions/ipy_completers.py, ipy_stock_completers.py:
673 Moved implementations of 'bundled' completers to ipy_completers.py,
678 Moved implementations of 'bundled' completers to ipy_completers.py,
674 they are only enabled in ipy_stock_completers.py.
679 they are only enabled in ipy_stock_completers.py.
675
680
676 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
681 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
677
682
678 * IPython/PyColorize.py (Parser.format2): Fix identation of
683 * IPython/PyColorize.py (Parser.format2): Fix identation of
679 colorzied output and return early if color scheme is NoColor, to
684 colorzied output and return early if color scheme is NoColor, to
680 avoid unnecessary and expensive tokenization. Closes #131.
685 avoid unnecessary and expensive tokenization. Closes #131.
681
686
682 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
687 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
683
688
684 * IPython/Debugger.py: disable the use of pydb version 1.17. It
689 * IPython/Debugger.py: disable the use of pydb version 1.17. It
685 has a critical bug (a missing import that makes post-mortem not
690 has a critical bug (a missing import that makes post-mortem not
686 work at all). Unfortunately as of this time, this is the version
691 work at all). Unfortunately as of this time, this is the version
687 shipped with Ubuntu Edgy, so quite a few people have this one. I
692 shipped with Ubuntu Edgy, so quite a few people have this one. I
688 hope Edgy will update to a more recent package.
693 hope Edgy will update to a more recent package.
689
694
690 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
695 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
691
696
692 * IPython/iplib.py (_prefilter): close #52, second part of a patch
697 * IPython/iplib.py (_prefilter): close #52, second part of a patch
693 set by Stefan (only the first part had been applied before).
698 set by Stefan (only the first part had been applied before).
694
699
695 * IPython/Extensions/ipy_stock_completers.py (module_completer):
700 * IPython/Extensions/ipy_stock_completers.py (module_completer):
696 remove usage of the dangerous pkgutil.walk_packages(). See
701 remove usage of the dangerous pkgutil.walk_packages(). See
697 details in comments left in the code.
702 details in comments left in the code.
698
703
699 * IPython/Magic.py (magic_whos): add support for numpy arrays
704 * IPython/Magic.py (magic_whos): add support for numpy arrays
700 similar to what we had for Numeric.
705 similar to what we had for Numeric.
701
706
702 * IPython/completer.py (IPCompleter.complete): extend the
707 * IPython/completer.py (IPCompleter.complete): extend the
703 complete() call API to support completions by other mechanisms
708 complete() call API to support completions by other mechanisms
704 than readline. Closes #109.
709 than readline. Closes #109.
705
710
706 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
711 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
707 protect against a bug in Python's execfile(). Closes #123.
712 protect against a bug in Python's execfile(). Closes #123.
708
713
709 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
714 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
710
715
711 * IPython/iplib.py (split_user_input): ensure that when splitting
716 * IPython/iplib.py (split_user_input): ensure that when splitting
712 user input, the part that can be treated as a python name is pure
717 user input, the part that can be treated as a python name is pure
713 ascii (Python identifiers MUST be pure ascii). Part of the
718 ascii (Python identifiers MUST be pure ascii). Part of the
714 ongoing Unicode support work.
719 ongoing Unicode support work.
715
720
716 * IPython/Prompts.py (prompt_specials_color): Add \N for the
721 * IPython/Prompts.py (prompt_specials_color): Add \N for the
717 actual prompt number, without any coloring. This allows users to
722 actual prompt number, without any coloring. This allows users to
718 produce numbered prompts with their own colors. Added after a
723 produce numbered prompts with their own colors. Added after a
719 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
724 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
720
725
721 2007-03-31 Walter Doerwald <walter@livinglogic.de>
726 2007-03-31 Walter Doerwald <walter@livinglogic.de>
722
727
723 * IPython/Extensions/igrid.py: Map the return key
728 * IPython/Extensions/igrid.py: Map the return key
724 to enter() and shift-return to enterattr().
729 to enter() and shift-return to enterattr().
725
730
726 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
731 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
727
732
728 * IPython/Magic.py (magic_psearch): add unicode support by
733 * IPython/Magic.py (magic_psearch): add unicode support by
729 encoding to ascii the input, since this routine also only deals
734 encoding to ascii the input, since this routine also only deals
730 with valid Python names. Fixes a bug reported by Stefan.
735 with valid Python names. Fixes a bug reported by Stefan.
731
736
732 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
737 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
733
738
734 * IPython/Magic.py (_inspect): convert unicode input into ascii
739 * IPython/Magic.py (_inspect): convert unicode input into ascii
735 before trying to evaluate it as a Python identifier. This fixes a
740 before trying to evaluate it as a Python identifier. This fixes a
736 problem that the new unicode support had introduced when analyzing
741 problem that the new unicode support had introduced when analyzing
737 long definition lines for functions.
742 long definition lines for functions.
738
743
739 2007-03-24 Walter Doerwald <walter@livinglogic.de>
744 2007-03-24 Walter Doerwald <walter@livinglogic.de>
740
745
741 * IPython/Extensions/igrid.py: Fix picking. Using
746 * IPython/Extensions/igrid.py: Fix picking. Using
742 igrid with wxPython 2.6 and -wthread should work now.
747 igrid with wxPython 2.6 and -wthread should work now.
743 igrid.display() simply tries to create a frame without
748 igrid.display() simply tries to create a frame without
744 an application. Only if this fails an application is created.
749 an application. Only if this fails an application is created.
745
750
746 2007-03-23 Walter Doerwald <walter@livinglogic.de>
751 2007-03-23 Walter Doerwald <walter@livinglogic.de>
747
752
748 * IPython/Extensions/path.py: Updated to version 2.2.
753 * IPython/Extensions/path.py: Updated to version 2.2.
749
754
750 2007-03-23 Ville Vainio <vivainio@gmail.com>
755 2007-03-23 Ville Vainio <vivainio@gmail.com>
751
756
752 * iplib.py: recursive alias expansion now works better, so that
757 * iplib.py: recursive alias expansion now works better, so that
753 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
758 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
754 doesn't trip up the process, if 'd' has been aliased to 'ls'.
759 doesn't trip up the process, if 'd' has been aliased to 'ls'.
755
760
756 * Extensions/ipy_gnuglobal.py added, provides %global magic
761 * Extensions/ipy_gnuglobal.py added, provides %global magic
757 for users of http://www.gnu.org/software/global
762 for users of http://www.gnu.org/software/global
758
763
759 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
764 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
760 Closes #52. Patch by Stefan van der Walt.
765 Closes #52. Patch by Stefan van der Walt.
761
766
762 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
767 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
763
768
764 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
769 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
765 respect the __file__ attribute when using %run. Thanks to a bug
770 respect the __file__ attribute when using %run. Thanks to a bug
766 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
771 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
767
772
768 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
773 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
769
774
770 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
775 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
771 input. Patch sent by Stefan.
776 input. Patch sent by Stefan.
772
777
773 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
778 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
774 * IPython/Extensions/ipy_stock_completer.py
779 * IPython/Extensions/ipy_stock_completer.py
775 shlex_split, fix bug in shlex_split. len function
780 shlex_split, fix bug in shlex_split. len function
776 call was missing an if statement. Caused shlex_split to
781 call was missing an if statement. Caused shlex_split to
777 sometimes return "" as last element.
782 sometimes return "" as last element.
778
783
779 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
784 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
780
785
781 * IPython/completer.py
786 * IPython/completer.py
782 (IPCompleter.file_matches.single_dir_expand): fix a problem
787 (IPCompleter.file_matches.single_dir_expand): fix a problem
783 reported by Stefan, where directories containign a single subdir
788 reported by Stefan, where directories containign a single subdir
784 would be completed too early.
789 would be completed too early.
785
790
786 * IPython/Shell.py (_load_pylab): Make the execution of 'from
791 * IPython/Shell.py (_load_pylab): Make the execution of 'from
787 pylab import *' when -pylab is given be optional. A new flag,
792 pylab import *' when -pylab is given be optional. A new flag,
788 pylab_import_all controls this behavior, the default is True for
793 pylab_import_all controls this behavior, the default is True for
789 backwards compatibility.
794 backwards compatibility.
790
795
791 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
796 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
792 modified) R. Bernstein's patch for fully syntax highlighted
797 modified) R. Bernstein's patch for fully syntax highlighted
793 tracebacks. The functionality is also available under ultraTB for
798 tracebacks. The functionality is also available under ultraTB for
794 non-ipython users (someone using ultraTB but outside an ipython
799 non-ipython users (someone using ultraTB but outside an ipython
795 session). They can select the color scheme by setting the
800 session). They can select the color scheme by setting the
796 module-level global DEFAULT_SCHEME. The highlight functionality
801 module-level global DEFAULT_SCHEME. The highlight functionality
797 also works when debugging.
802 also works when debugging.
798
803
799 * IPython/genutils.py (IOStream.close): small patch by
804 * IPython/genutils.py (IOStream.close): small patch by
800 R. Bernstein for improved pydb support.
805 R. Bernstein for improved pydb support.
801
806
802 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
807 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
803 DaveS <davls@telus.net> to improve support of debugging under
808 DaveS <davls@telus.net> to improve support of debugging under
804 NTEmacs, including improved pydb behavior.
809 NTEmacs, including improved pydb behavior.
805
810
806 * IPython/Magic.py (magic_prun): Fix saving of profile info for
811 * IPython/Magic.py (magic_prun): Fix saving of profile info for
807 Python 2.5, where the stats object API changed a little. Thanks
812 Python 2.5, where the stats object API changed a little. Thanks
808 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
813 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
809
814
810 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
815 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
811 Pernetty's patch to improve support for (X)Emacs under Win32.
816 Pernetty's patch to improve support for (X)Emacs under Win32.
812
817
813 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
818 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
814
819
815 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
820 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
816 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
821 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
817 a report by Nik Tautenhahn.
822 a report by Nik Tautenhahn.
818
823
819 2007-03-16 Walter Doerwald <walter@livinglogic.de>
824 2007-03-16 Walter Doerwald <walter@livinglogic.de>
820
825
821 * setup.py: Add the igrid help files to the list of data files
826 * setup.py: Add the igrid help files to the list of data files
822 to be installed alongside igrid.
827 to be installed alongside igrid.
823 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
828 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
824 Show the input object of the igrid browser as the window tile.
829 Show the input object of the igrid browser as the window tile.
825 Show the object the cursor is on in the statusbar.
830 Show the object the cursor is on in the statusbar.
826
831
827 2007-03-15 Ville Vainio <vivainio@gmail.com>
832 2007-03-15 Ville Vainio <vivainio@gmail.com>
828
833
829 * Extensions/ipy_stock_completers.py: Fixed exception
834 * Extensions/ipy_stock_completers.py: Fixed exception
830 on mismatching quotes in %run completer. Patch by
835 on mismatching quotes in %run completer. Patch by
831 Jorgen Stenarson. Closes #127.
836 Jorgen Stenarson. Closes #127.
832
837
833 2007-03-14 Ville Vainio <vivainio@gmail.com>
838 2007-03-14 Ville Vainio <vivainio@gmail.com>
834
839
835 * Extensions/ext_rehashdir.py: Do not do auto_alias
840 * Extensions/ext_rehashdir.py: Do not do auto_alias
836 in %rehashdir, it clobbers %store'd aliases.
841 in %rehashdir, it clobbers %store'd aliases.
837
842
838 * UserConfig/ipy_profile_sh.py: envpersist.py extension
843 * UserConfig/ipy_profile_sh.py: envpersist.py extension
839 (beefed up %env) imported for sh profile.
844 (beefed up %env) imported for sh profile.
840
845
841 2007-03-10 Walter Doerwald <walter@livinglogic.de>
846 2007-03-10 Walter Doerwald <walter@livinglogic.de>
842
847
843 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
848 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
844 as the default browser.
849 as the default browser.
845 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
850 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
846 As igrid displays all attributes it ever encounters, fetch() (which has
851 As igrid displays all attributes it ever encounters, fetch() (which has
847 been renamed to _fetch()) doesn't have to recalculate the display attributes
852 been renamed to _fetch()) doesn't have to recalculate the display attributes
848 every time a new item is fetched. This should speed up scrolling.
853 every time a new item is fetched. This should speed up scrolling.
849
854
850 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
855 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
851
856
852 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
857 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
853 Schmolck's recently reported tab-completion bug (my previous one
858 Schmolck's recently reported tab-completion bug (my previous one
854 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
859 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
855
860
856 2007-03-09 Walter Doerwald <walter@livinglogic.de>
861 2007-03-09 Walter Doerwald <walter@livinglogic.de>
857
862
858 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
863 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
859 Close help window if exiting igrid.
864 Close help window if exiting igrid.
860
865
861 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
866 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
862
867
863 * IPython/Extensions/ipy_defaults.py: Check if readline is available
868 * IPython/Extensions/ipy_defaults.py: Check if readline is available
864 before calling functions from readline.
869 before calling functions from readline.
865
870
866 2007-03-02 Walter Doerwald <walter@livinglogic.de>
871 2007-03-02 Walter Doerwald <walter@livinglogic.de>
867
872
868 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
873 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
869 igrid is a wxPython-based display object for ipipe. If your system has
874 igrid is a wxPython-based display object for ipipe. If your system has
870 wx installed igrid will be the default display. Without wx ipipe falls
875 wx installed igrid will be the default display. Without wx ipipe falls
871 back to ibrowse (which needs curses). If no curses is installed ipipe
876 back to ibrowse (which needs curses). If no curses is installed ipipe
872 falls back to idump.
877 falls back to idump.
873
878
874 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
879 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
875
880
876 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
881 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
877 my changes from yesterday, they introduced bugs. Will reactivate
882 my changes from yesterday, they introduced bugs. Will reactivate
878 once I get a correct solution, which will be much easier thanks to
883 once I get a correct solution, which will be much easier thanks to
879 Dan Milstein's new prefilter test suite.
884 Dan Milstein's new prefilter test suite.
880
885
881 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
886 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
882
887
883 * IPython/iplib.py (split_user_input): fix input splitting so we
888 * IPython/iplib.py (split_user_input): fix input splitting so we
884 don't attempt attribute accesses on things that can't possibly be
889 don't attempt attribute accesses on things that can't possibly be
885 valid Python attributes. After a bug report by Alex Schmolck.
890 valid Python attributes. After a bug report by Alex Schmolck.
886 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
891 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
887 %magic with explicit % prefix.
892 %magic with explicit % prefix.
888
893
889 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
894 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
890
895
891 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
896 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
892 avoid a DeprecationWarning from GTK.
897 avoid a DeprecationWarning from GTK.
893
898
894 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
899 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
895
900
896 * IPython/genutils.py (clock): I modified clock() to return total
901 * IPython/genutils.py (clock): I modified clock() to return total
897 time, user+system. This is a more commonly needed metric. I also
902 time, user+system. This is a more commonly needed metric. I also
898 introduced the new clocku/clocks to get only user/system time if
903 introduced the new clocku/clocks to get only user/system time if
899 one wants those instead.
904 one wants those instead.
900
905
901 ***WARNING: API CHANGE*** clock() used to return only user time,
906 ***WARNING: API CHANGE*** clock() used to return only user time,
902 so if you want exactly the same results as before, use clocku
907 so if you want exactly the same results as before, use clocku
903 instead.
908 instead.
904
909
905 2007-02-22 Ville Vainio <vivainio@gmail.com>
910 2007-02-22 Ville Vainio <vivainio@gmail.com>
906
911
907 * IPython/Extensions/ipy_p4.py: Extension for improved
912 * IPython/Extensions/ipy_p4.py: Extension for improved
908 p4 (perforce version control system) experience.
913 p4 (perforce version control system) experience.
909 Adds %p4 magic with p4 command completion and
914 Adds %p4 magic with p4 command completion and
910 automatic -G argument (marshall output as python dict)
915 automatic -G argument (marshall output as python dict)
911
916
912 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
917 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
913
918
914 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
919 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
915 stop marks.
920 stop marks.
916 (ClearingMixin): a simple mixin to easily make a Demo class clear
921 (ClearingMixin): a simple mixin to easily make a Demo class clear
917 the screen in between blocks and have empty marquees. The
922 the screen in between blocks and have empty marquees. The
918 ClearDemo and ClearIPDemo classes that use it are included.
923 ClearDemo and ClearIPDemo classes that use it are included.
919
924
920 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
925 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
921
926
922 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
927 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
923 protect against exceptions at Python shutdown time. Patch
928 protect against exceptions at Python shutdown time. Patch
924 sumbmitted to upstream.
929 sumbmitted to upstream.
925
930
926 2007-02-14 Walter Doerwald <walter@livinglogic.de>
931 2007-02-14 Walter Doerwald <walter@livinglogic.de>
927
932
928 * IPython/Extensions/ibrowse.py: If entering the first object level
933 * IPython/Extensions/ibrowse.py: If entering the first object level
929 (i.e. the object for which the browser has been started) fails,
934 (i.e. the object for which the browser has been started) fails,
930 now the error is raised directly (aborting the browser) instead of
935 now the error is raised directly (aborting the browser) instead of
931 running into an empty levels list later.
936 running into an empty levels list later.
932
937
933 2007-02-03 Walter Doerwald <walter@livinglogic.de>
938 2007-02-03 Walter Doerwald <walter@livinglogic.de>
934
939
935 * IPython/Extensions/ipipe.py: Add an xrepr implementation
940 * IPython/Extensions/ipipe.py: Add an xrepr implementation
936 for the noitem object.
941 for the noitem object.
937
942
938 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
943 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
939
944
940 * IPython/completer.py (Completer.attr_matches): Fix small
945 * IPython/completer.py (Completer.attr_matches): Fix small
941 tab-completion bug with Enthought Traits objects with units.
946 tab-completion bug with Enthought Traits objects with units.
942 Thanks to a bug report by Tom Denniston
947 Thanks to a bug report by Tom Denniston
943 <tom.denniston-AT-alum.dartmouth.org>.
948 <tom.denniston-AT-alum.dartmouth.org>.
944
949
945 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
950 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
946
951
947 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
952 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
948 bug where only .ipy or .py would be completed. Once the first
953 bug where only .ipy or .py would be completed. Once the first
949 argument to %run has been given, all completions are valid because
954 argument to %run has been given, all completions are valid because
950 they are the arguments to the script, which may well be non-python
955 they are the arguments to the script, which may well be non-python
951 filenames.
956 filenames.
952
957
953 * IPython/irunner.py (InteractiveRunner.run_source): major updates
958 * IPython/irunner.py (InteractiveRunner.run_source): major updates
954 to irunner to allow it to correctly support real doctesting of
959 to irunner to allow it to correctly support real doctesting of
955 out-of-process ipython code.
960 out-of-process ipython code.
956
961
957 * IPython/Magic.py (magic_cd): Make the setting of the terminal
962 * IPython/Magic.py (magic_cd): Make the setting of the terminal
958 title an option (-noterm_title) because it completely breaks
963 title an option (-noterm_title) because it completely breaks
959 doctesting.
964 doctesting.
960
965
961 * IPython/demo.py: fix IPythonDemo class that was not actually working.
966 * IPython/demo.py: fix IPythonDemo class that was not actually working.
962
967
963 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
968 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
964
969
965 * IPython/irunner.py (main): fix small bug where extensions were
970 * IPython/irunner.py (main): fix small bug where extensions were
966 not being correctly recognized.
971 not being correctly recognized.
967
972
968 2007-01-23 Walter Doerwald <walter@livinglogic.de>
973 2007-01-23 Walter Doerwald <walter@livinglogic.de>
969
974
970 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
975 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
971 a string containing a single line yields the string itself as the
976 a string containing a single line yields the string itself as the
972 only item.
977 only item.
973
978
974 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
979 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
975 object if it's the same as the one on the last level (This avoids
980 object if it's the same as the one on the last level (This avoids
976 infinite recursion for one line strings).
981 infinite recursion for one line strings).
977
982
978 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
983 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
979
984
980 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
985 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
981 all output streams before printing tracebacks. This ensures that
986 all output streams before printing tracebacks. This ensures that
982 user output doesn't end up interleaved with traceback output.
987 user output doesn't end up interleaved with traceback output.
983
988
984 2007-01-10 Ville Vainio <vivainio@gmail.com>
989 2007-01-10 Ville Vainio <vivainio@gmail.com>
985
990
986 * Extensions/envpersist.py: Turbocharged %env that remembers
991 * Extensions/envpersist.py: Turbocharged %env that remembers
987 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
992 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
988 "%env VISUAL=jed".
993 "%env VISUAL=jed".
989
994
990 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
995 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
991
996
992 * IPython/iplib.py (showtraceback): ensure that we correctly call
997 * IPython/iplib.py (showtraceback): ensure that we correctly call
993 custom handlers in all cases (some with pdb were slipping through,
998 custom handlers in all cases (some with pdb were slipping through,
994 but I'm not exactly sure why).
999 but I'm not exactly sure why).
995
1000
996 * IPython/Debugger.py (Tracer.__init__): added new class to
1001 * IPython/Debugger.py (Tracer.__init__): added new class to
997 support set_trace-like usage of IPython's enhanced debugger.
1002 support set_trace-like usage of IPython's enhanced debugger.
998
1003
999 2006-12-24 Ville Vainio <vivainio@gmail.com>
1004 2006-12-24 Ville Vainio <vivainio@gmail.com>
1000
1005
1001 * ipmaker.py: more informative message when ipy_user_conf
1006 * ipmaker.py: more informative message when ipy_user_conf
1002 import fails (suggest running %upgrade).
1007 import fails (suggest running %upgrade).
1003
1008
1004 * tools/run_ipy_in_profiler.py: Utility to see where
1009 * tools/run_ipy_in_profiler.py: Utility to see where
1005 the time during IPython startup is spent.
1010 the time during IPython startup is spent.
1006
1011
1007 2006-12-20 Ville Vainio <vivainio@gmail.com>
1012 2006-12-20 Ville Vainio <vivainio@gmail.com>
1008
1013
1009 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1014 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1010
1015
1011 * ipapi.py: Add new ipapi method, expand_alias.
1016 * ipapi.py: Add new ipapi method, expand_alias.
1012
1017
1013 * Release.py: Bump up version to 0.7.4.svn
1018 * Release.py: Bump up version to 0.7.4.svn
1014
1019
1015 2006-12-17 Ville Vainio <vivainio@gmail.com>
1020 2006-12-17 Ville Vainio <vivainio@gmail.com>
1016
1021
1017 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1022 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1018 to work properly on posix too
1023 to work properly on posix too
1019
1024
1020 * Release.py: Update revnum (version is still just 0.7.3).
1025 * Release.py: Update revnum (version is still just 0.7.3).
1021
1026
1022 2006-12-15 Ville Vainio <vivainio@gmail.com>
1027 2006-12-15 Ville Vainio <vivainio@gmail.com>
1023
1028
1024 * scripts/ipython_win_post_install: create ipython.py in
1029 * scripts/ipython_win_post_install: create ipython.py in
1025 prefix + "/scripts".
1030 prefix + "/scripts".
1026
1031
1027 * Release.py: Update version to 0.7.3.
1032 * Release.py: Update version to 0.7.3.
1028
1033
1029 2006-12-14 Ville Vainio <vivainio@gmail.com>
1034 2006-12-14 Ville Vainio <vivainio@gmail.com>
1030
1035
1031 * scripts/ipython_win_post_install: Overwrite old shortcuts
1036 * scripts/ipython_win_post_install: Overwrite old shortcuts
1032 if they already exist
1037 if they already exist
1033
1038
1034 * Release.py: release 0.7.3rc2
1039 * Release.py: release 0.7.3rc2
1035
1040
1036 2006-12-13 Ville Vainio <vivainio@gmail.com>
1041 2006-12-13 Ville Vainio <vivainio@gmail.com>
1037
1042
1038 * Branch and update Release.py for 0.7.3rc1
1043 * Branch and update Release.py for 0.7.3rc1
1039
1044
1040 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1045 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1041
1046
1042 * IPython/Shell.py (IPShellWX): update for current WX naming
1047 * IPython/Shell.py (IPShellWX): update for current WX naming
1043 conventions, to avoid a deprecation warning with current WX
1048 conventions, to avoid a deprecation warning with current WX
1044 versions. Thanks to a report by Danny Shevitz.
1049 versions. Thanks to a report by Danny Shevitz.
1045
1050
1046 2006-12-12 Ville Vainio <vivainio@gmail.com>
1051 2006-12-12 Ville Vainio <vivainio@gmail.com>
1047
1052
1048 * ipmaker.py: apply david cournapeau's patch to make
1053 * ipmaker.py: apply david cournapeau's patch to make
1049 import_some work properly even when ipythonrc does
1054 import_some work properly even when ipythonrc does
1050 import_some on empty list (it was an old bug!).
1055 import_some on empty list (it was an old bug!).
1051
1056
1052 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1057 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1053 Add deprecation note to ipythonrc and a url to wiki
1058 Add deprecation note to ipythonrc and a url to wiki
1054 in ipy_user_conf.py
1059 in ipy_user_conf.py
1055
1060
1056
1061
1057 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1062 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1058 as if it was typed on IPython command prompt, i.e.
1063 as if it was typed on IPython command prompt, i.e.
1059 as IPython script.
1064 as IPython script.
1060
1065
1061 * example-magic.py, magic_grepl.py: remove outdated examples
1066 * example-magic.py, magic_grepl.py: remove outdated examples
1062
1067
1063 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1068 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1064
1069
1065 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1070 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1066 is called before any exception has occurred.
1071 is called before any exception has occurred.
1067
1072
1068 2006-12-08 Ville Vainio <vivainio@gmail.com>
1073 2006-12-08 Ville Vainio <vivainio@gmail.com>
1069
1074
1070 * Extensions/ipy_stock_completers.py: fix cd completer
1075 * Extensions/ipy_stock_completers.py: fix cd completer
1071 to translate /'s to \'s again.
1076 to translate /'s to \'s again.
1072
1077
1073 * completer.py: prevent traceback on file completions w/
1078 * completer.py: prevent traceback on file completions w/
1074 backslash.
1079 backslash.
1075
1080
1076 * Release.py: Update release number to 0.7.3b3 for release
1081 * Release.py: Update release number to 0.7.3b3 for release
1077
1082
1078 2006-12-07 Ville Vainio <vivainio@gmail.com>
1083 2006-12-07 Ville Vainio <vivainio@gmail.com>
1079
1084
1080 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1085 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1081 while executing external code. Provides more shell-like behaviour
1086 while executing external code. Provides more shell-like behaviour
1082 and overall better response to ctrl + C / ctrl + break.
1087 and overall better response to ctrl + C / ctrl + break.
1083
1088
1084 * tools/make_tarball.py: new script to create tarball straight from svn
1089 * tools/make_tarball.py: new script to create tarball straight from svn
1085 (setup.py sdist doesn't work on win32).
1090 (setup.py sdist doesn't work on win32).
1086
1091
1087 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1092 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1088 on dirnames with spaces and use the default completer instead.
1093 on dirnames with spaces and use the default completer instead.
1089
1094
1090 * Revision.py: Change version to 0.7.3b2 for release.
1095 * Revision.py: Change version to 0.7.3b2 for release.
1091
1096
1092 2006-12-05 Ville Vainio <vivainio@gmail.com>
1097 2006-12-05 Ville Vainio <vivainio@gmail.com>
1093
1098
1094 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1099 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1095 pydb patch 4 (rm debug printing, py 2.5 checking)
1100 pydb patch 4 (rm debug printing, py 2.5 checking)
1096
1101
1097 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1102 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1098 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1103 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1099 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1104 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1100 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1105 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1101 object the cursor was on before the refresh. The command "markrange" is
1106 object the cursor was on before the refresh. The command "markrange" is
1102 mapped to "%" now.
1107 mapped to "%" now.
1103 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1108 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1104
1109
1105 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1110 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1106
1111
1107 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1112 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1108 interactive debugger on the last traceback, without having to call
1113 interactive debugger on the last traceback, without having to call
1109 %pdb and rerun your code. Made minor changes in various modules,
1114 %pdb and rerun your code. Made minor changes in various modules,
1110 should automatically recognize pydb if available.
1115 should automatically recognize pydb if available.
1111
1116
1112 2006-11-28 Ville Vainio <vivainio@gmail.com>
1117 2006-11-28 Ville Vainio <vivainio@gmail.com>
1113
1118
1114 * completer.py: If the text start with !, show file completions
1119 * completer.py: If the text start with !, show file completions
1115 properly. This helps when trying to complete command name
1120 properly. This helps when trying to complete command name
1116 for shell escapes.
1121 for shell escapes.
1117
1122
1118 2006-11-27 Ville Vainio <vivainio@gmail.com>
1123 2006-11-27 Ville Vainio <vivainio@gmail.com>
1119
1124
1120 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1125 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1121 der Walt. Clean up svn and hg completers by using a common
1126 der Walt. Clean up svn and hg completers by using a common
1122 vcs_completer.
1127 vcs_completer.
1123
1128
1124 2006-11-26 Ville Vainio <vivainio@gmail.com>
1129 2006-11-26 Ville Vainio <vivainio@gmail.com>
1125
1130
1126 * Remove ipconfig and %config; you should use _ip.options structure
1131 * Remove ipconfig and %config; you should use _ip.options structure
1127 directly instead!
1132 directly instead!
1128
1133
1129 * genutils.py: add wrap_deprecated function for deprecating callables
1134 * genutils.py: add wrap_deprecated function for deprecating callables
1130
1135
1131 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1136 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1132 _ip.system instead. ipalias is redundant.
1137 _ip.system instead. ipalias is redundant.
1133
1138
1134 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1139 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1135 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1140 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1136 explicit.
1141 explicit.
1137
1142
1138 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1143 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1139 completer. Try it by entering 'hg ' and pressing tab.
1144 completer. Try it by entering 'hg ' and pressing tab.
1140
1145
1141 * macro.py: Give Macro a useful __repr__ method
1146 * macro.py: Give Macro a useful __repr__ method
1142
1147
1143 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1148 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1144
1149
1145 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1150 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1146 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1151 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1147 we don't get a duplicate ipipe module, where registration of the xrepr
1152 we don't get a duplicate ipipe module, where registration of the xrepr
1148 implementation for Text is useless.
1153 implementation for Text is useless.
1149
1154
1150 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1155 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1151
1156
1152 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1157 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1153
1158
1154 2006-11-24 Ville Vainio <vivainio@gmail.com>
1159 2006-11-24 Ville Vainio <vivainio@gmail.com>
1155
1160
1156 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1161 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1157 try to use "cProfile" instead of the slower pure python
1162 try to use "cProfile" instead of the slower pure python
1158 "profile"
1163 "profile"
1159
1164
1160 2006-11-23 Ville Vainio <vivainio@gmail.com>
1165 2006-11-23 Ville Vainio <vivainio@gmail.com>
1161
1166
1162 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1167 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1163 Qt+IPython+Designer link in documentation.
1168 Qt+IPython+Designer link in documentation.
1164
1169
1165 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1170 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1166 correct Pdb object to %pydb.
1171 correct Pdb object to %pydb.
1167
1172
1168
1173
1169 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1174 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1170 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1175 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1171 generic xrepr(), otherwise the list implementation would kick in.
1176 generic xrepr(), otherwise the list implementation would kick in.
1172
1177
1173 2006-11-21 Ville Vainio <vivainio@gmail.com>
1178 2006-11-21 Ville Vainio <vivainio@gmail.com>
1174
1179
1175 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1180 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1176 with one from UserConfig.
1181 with one from UserConfig.
1177
1182
1178 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1183 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1179 it was missing which broke the sh profile.
1184 it was missing which broke the sh profile.
1180
1185
1181 * completer.py: file completer now uses explicit '/' instead
1186 * completer.py: file completer now uses explicit '/' instead
1182 of os.path.join, expansion of 'foo' was broken on win32
1187 of os.path.join, expansion of 'foo' was broken on win32
1183 if there was one directory with name 'foobar'.
1188 if there was one directory with name 'foobar'.
1184
1189
1185 * A bunch of patches from Kirill Smelkov:
1190 * A bunch of patches from Kirill Smelkov:
1186
1191
1187 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1192 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1188
1193
1189 * [patch 7/9] Implement %page -r (page in raw mode) -
1194 * [patch 7/9] Implement %page -r (page in raw mode) -
1190
1195
1191 * [patch 5/9] ScientificPython webpage has moved
1196 * [patch 5/9] ScientificPython webpage has moved
1192
1197
1193 * [patch 4/9] The manual mentions %ds, should be %dhist
1198 * [patch 4/9] The manual mentions %ds, should be %dhist
1194
1199
1195 * [patch 3/9] Kill old bits from %prun doc.
1200 * [patch 3/9] Kill old bits from %prun doc.
1196
1201
1197 * [patch 1/9] Fix typos here and there.
1202 * [patch 1/9] Fix typos here and there.
1198
1203
1199 2006-11-08 Ville Vainio <vivainio@gmail.com>
1204 2006-11-08 Ville Vainio <vivainio@gmail.com>
1200
1205
1201 * completer.py (attr_matches): catch all exceptions raised
1206 * completer.py (attr_matches): catch all exceptions raised
1202 by eval of expr with dots.
1207 by eval of expr with dots.
1203
1208
1204 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1209 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1205
1210
1206 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1211 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1207 input if it starts with whitespace. This allows you to paste
1212 input if it starts with whitespace. This allows you to paste
1208 indented input from any editor without manually having to type in
1213 indented input from any editor without manually having to type in
1209 the 'if 1:', which is convenient when working interactively.
1214 the 'if 1:', which is convenient when working interactively.
1210 Slightly modifed version of a patch by Bo Peng
1215 Slightly modifed version of a patch by Bo Peng
1211 <bpeng-AT-rice.edu>.
1216 <bpeng-AT-rice.edu>.
1212
1217
1213 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1218 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1214
1219
1215 * IPython/irunner.py (main): modified irunner so it automatically
1220 * IPython/irunner.py (main): modified irunner so it automatically
1216 recognizes the right runner to use based on the extension (.py for
1221 recognizes the right runner to use based on the extension (.py for
1217 python, .ipy for ipython and .sage for sage).
1222 python, .ipy for ipython and .sage for sage).
1218
1223
1219 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1224 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1220 visible in ipapi as ip.config(), to programatically control the
1225 visible in ipapi as ip.config(), to programatically control the
1221 internal rc object. There's an accompanying %config magic for
1226 internal rc object. There's an accompanying %config magic for
1222 interactive use, which has been enhanced to match the
1227 interactive use, which has been enhanced to match the
1223 funtionality in ipconfig.
1228 funtionality in ipconfig.
1224
1229
1225 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1230 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1226 so it's not just a toggle, it now takes an argument. Add support
1231 so it's not just a toggle, it now takes an argument. Add support
1227 for a customizable header when making system calls, as the new
1232 for a customizable header when making system calls, as the new
1228 system_header variable in the ipythonrc file.
1233 system_header variable in the ipythonrc file.
1229
1234
1230 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1235 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1231
1236
1232 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1237 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1233 generic functions (using Philip J. Eby's simplegeneric package).
1238 generic functions (using Philip J. Eby's simplegeneric package).
1234 This makes it possible to customize the display of third-party classes
1239 This makes it possible to customize the display of third-party classes
1235 without having to monkeypatch them. xiter() no longer supports a mode
1240 without having to monkeypatch them. xiter() no longer supports a mode
1236 argument and the XMode class has been removed. The same functionality can
1241 argument and the XMode class has been removed. The same functionality can
1237 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1242 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1238 One consequence of the switch to generic functions is that xrepr() and
1243 One consequence of the switch to generic functions is that xrepr() and
1239 xattrs() implementation must define the default value for the mode
1244 xattrs() implementation must define the default value for the mode
1240 argument themselves and xattrs() implementations must return real
1245 argument themselves and xattrs() implementations must return real
1241 descriptors.
1246 descriptors.
1242
1247
1243 * IPython/external: This new subpackage will contain all third-party
1248 * IPython/external: This new subpackage will contain all third-party
1244 packages that are bundled with IPython. (The first one is simplegeneric).
1249 packages that are bundled with IPython. (The first one is simplegeneric).
1245
1250
1246 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1251 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1247 directory which as been dropped in r1703.
1252 directory which as been dropped in r1703.
1248
1253
1249 * IPython/Extensions/ipipe.py (iless): Fixed.
1254 * IPython/Extensions/ipipe.py (iless): Fixed.
1250
1255
1251 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1256 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1252
1257
1253 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1258 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1254
1259
1255 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1260 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1256 handling in variable expansion so that shells and magics recognize
1261 handling in variable expansion so that shells and magics recognize
1257 function local scopes correctly. Bug reported by Brian.
1262 function local scopes correctly. Bug reported by Brian.
1258
1263
1259 * scripts/ipython: remove the very first entry in sys.path which
1264 * scripts/ipython: remove the very first entry in sys.path which
1260 Python auto-inserts for scripts, so that sys.path under IPython is
1265 Python auto-inserts for scripts, so that sys.path under IPython is
1261 as similar as possible to that under plain Python.
1266 as similar as possible to that under plain Python.
1262
1267
1263 * IPython/completer.py (IPCompleter.file_matches): Fix
1268 * IPython/completer.py (IPCompleter.file_matches): Fix
1264 tab-completion so that quotes are not closed unless the completion
1269 tab-completion so that quotes are not closed unless the completion
1265 is unambiguous. After a request by Stefan. Minor cleanups in
1270 is unambiguous. After a request by Stefan. Minor cleanups in
1266 ipy_stock_completers.
1271 ipy_stock_completers.
1267
1272
1268 2006-11-02 Ville Vainio <vivainio@gmail.com>
1273 2006-11-02 Ville Vainio <vivainio@gmail.com>
1269
1274
1270 * ipy_stock_completers.py: Add %run and %cd completers.
1275 * ipy_stock_completers.py: Add %run and %cd completers.
1271
1276
1272 * completer.py: Try running custom completer for both
1277 * completer.py: Try running custom completer for both
1273 "foo" and "%foo" if the command is just "foo". Ignore case
1278 "foo" and "%foo" if the command is just "foo". Ignore case
1274 when filtering possible completions.
1279 when filtering possible completions.
1275
1280
1276 * UserConfig/ipy_user_conf.py: install stock completers as default
1281 * UserConfig/ipy_user_conf.py: install stock completers as default
1277
1282
1278 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1283 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1279 simplified readline history save / restore through a wrapper
1284 simplified readline history save / restore through a wrapper
1280 function
1285 function
1281
1286
1282
1287
1283 2006-10-31 Ville Vainio <vivainio@gmail.com>
1288 2006-10-31 Ville Vainio <vivainio@gmail.com>
1284
1289
1285 * strdispatch.py, completer.py, ipy_stock_completers.py:
1290 * strdispatch.py, completer.py, ipy_stock_completers.py:
1286 Allow str_key ("command") in completer hooks. Implement
1291 Allow str_key ("command") in completer hooks. Implement
1287 trivial completer for 'import' (stdlib modules only). Rename
1292 trivial completer for 'import' (stdlib modules only). Rename
1288 ipy_linux_package_managers.py to ipy_stock_completers.py.
1293 ipy_linux_package_managers.py to ipy_stock_completers.py.
1289 SVN completer.
1294 SVN completer.
1290
1295
1291 * Extensions/ledit.py: %magic line editor for easily and
1296 * Extensions/ledit.py: %magic line editor for easily and
1292 incrementally manipulating lists of strings. The magic command
1297 incrementally manipulating lists of strings. The magic command
1293 name is %led.
1298 name is %led.
1294
1299
1295 2006-10-30 Ville Vainio <vivainio@gmail.com>
1300 2006-10-30 Ville Vainio <vivainio@gmail.com>
1296
1301
1297 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1302 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1298 Bernsteins's patches for pydb integration.
1303 Bernsteins's patches for pydb integration.
1299 http://bashdb.sourceforge.net/pydb/
1304 http://bashdb.sourceforge.net/pydb/
1300
1305
1301 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1306 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1302 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1307 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1303 custom completer hook to allow the users to implement their own
1308 custom completer hook to allow the users to implement their own
1304 completers. See ipy_linux_package_managers.py for example. The
1309 completers. See ipy_linux_package_managers.py for example. The
1305 hook name is 'complete_command'.
1310 hook name is 'complete_command'.
1306
1311
1307 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1312 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1308
1313
1309 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1314 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1310 Numeric leftovers.
1315 Numeric leftovers.
1311
1316
1312 * ipython.el (py-execute-region): apply Stefan's patch to fix
1317 * ipython.el (py-execute-region): apply Stefan's patch to fix
1313 garbled results if the python shell hasn't been previously started.
1318 garbled results if the python shell hasn't been previously started.
1314
1319
1315 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1320 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1316 pretty generic function and useful for other things.
1321 pretty generic function and useful for other things.
1317
1322
1318 * IPython/OInspect.py (getsource): Add customizable source
1323 * IPython/OInspect.py (getsource): Add customizable source
1319 extractor. After a request/patch form W. Stein (SAGE).
1324 extractor. After a request/patch form W. Stein (SAGE).
1320
1325
1321 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1326 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1322 window size to a more reasonable value from what pexpect does,
1327 window size to a more reasonable value from what pexpect does,
1323 since their choice causes wrapping bugs with long input lines.
1328 since their choice causes wrapping bugs with long input lines.
1324
1329
1325 2006-10-28 Ville Vainio <vivainio@gmail.com>
1330 2006-10-28 Ville Vainio <vivainio@gmail.com>
1326
1331
1327 * Magic.py (%run): Save and restore the readline history from
1332 * Magic.py (%run): Save and restore the readline history from
1328 file around %run commands to prevent side effects from
1333 file around %run commands to prevent side effects from
1329 %runned programs that might use readline (e.g. pydb).
1334 %runned programs that might use readline (e.g. pydb).
1330
1335
1331 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1336 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1332 invoking the pydb enhanced debugger.
1337 invoking the pydb enhanced debugger.
1333
1338
1334 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1339 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1335
1340
1336 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1341 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1337 call the base class method and propagate the return value to
1342 call the base class method and propagate the return value to
1338 ifile. This is now done by path itself.
1343 ifile. This is now done by path itself.
1339
1344
1340 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1345 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1341
1346
1342 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1347 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1343 api: set_crash_handler(), to expose the ability to change the
1348 api: set_crash_handler(), to expose the ability to change the
1344 internal crash handler.
1349 internal crash handler.
1345
1350
1346 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1351 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1347 the various parameters of the crash handler so that apps using
1352 the various parameters of the crash handler so that apps using
1348 IPython as their engine can customize crash handling. Ipmlemented
1353 IPython as their engine can customize crash handling. Ipmlemented
1349 at the request of SAGE.
1354 at the request of SAGE.
1350
1355
1351 2006-10-14 Ville Vainio <vivainio@gmail.com>
1356 2006-10-14 Ville Vainio <vivainio@gmail.com>
1352
1357
1353 * Magic.py, ipython.el: applied first "safe" part of Rocky
1358 * Magic.py, ipython.el: applied first "safe" part of Rocky
1354 Bernstein's patch set for pydb integration.
1359 Bernstein's patch set for pydb integration.
1355
1360
1356 * Magic.py (%unalias, %alias): %store'd aliases can now be
1361 * Magic.py (%unalias, %alias): %store'd aliases can now be
1357 removed with '%unalias'. %alias w/o args now shows most
1362 removed with '%unalias'. %alias w/o args now shows most
1358 interesting (stored / manually defined) aliases last
1363 interesting (stored / manually defined) aliases last
1359 where they catch the eye w/o scrolling.
1364 where they catch the eye w/o scrolling.
1360
1365
1361 * Magic.py (%rehashx), ext_rehashdir.py: files with
1366 * Magic.py (%rehashx), ext_rehashdir.py: files with
1362 'py' extension are always considered executable, even
1367 'py' extension are always considered executable, even
1363 when not in PATHEXT environment variable.
1368 when not in PATHEXT environment variable.
1364
1369
1365 2006-10-12 Ville Vainio <vivainio@gmail.com>
1370 2006-10-12 Ville Vainio <vivainio@gmail.com>
1366
1371
1367 * jobctrl.py: Add new "jobctrl" extension for spawning background
1372 * jobctrl.py: Add new "jobctrl" extension for spawning background
1368 processes with "&find /". 'import jobctrl' to try it out. Requires
1373 processes with "&find /". 'import jobctrl' to try it out. Requires
1369 'subprocess' module, standard in python 2.4+.
1374 'subprocess' module, standard in python 2.4+.
1370
1375
1371 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1376 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1372 so if foo -> bar and bar -> baz, then foo -> baz.
1377 so if foo -> bar and bar -> baz, then foo -> baz.
1373
1378
1374 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1379 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1375
1380
1376 * IPython/Magic.py (Magic.parse_options): add a new posix option
1381 * IPython/Magic.py (Magic.parse_options): add a new posix option
1377 to allow parsing of input args in magics that doesn't strip quotes
1382 to allow parsing of input args in magics that doesn't strip quotes
1378 (if posix=False). This also closes %timeit bug reported by
1383 (if posix=False). This also closes %timeit bug reported by
1379 Stefan.
1384 Stefan.
1380
1385
1381 2006-10-03 Ville Vainio <vivainio@gmail.com>
1386 2006-10-03 Ville Vainio <vivainio@gmail.com>
1382
1387
1383 * iplib.py (raw_input, interact): Return ValueError catching for
1388 * iplib.py (raw_input, interact): Return ValueError catching for
1384 raw_input. Fixes infinite loop for sys.stdin.close() or
1389 raw_input. Fixes infinite loop for sys.stdin.close() or
1385 sys.stdout.close().
1390 sys.stdout.close().
1386
1391
1387 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1392 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1388
1393
1389 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1394 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1390 to help in handling doctests. irunner is now pretty useful for
1395 to help in handling doctests. irunner is now pretty useful for
1391 running standalone scripts and simulate a full interactive session
1396 running standalone scripts and simulate a full interactive session
1392 in a format that can be then pasted as a doctest.
1397 in a format that can be then pasted as a doctest.
1393
1398
1394 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1399 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1395 on top of the default (useless) ones. This also fixes the nasty
1400 on top of the default (useless) ones. This also fixes the nasty
1396 way in which 2.5's Quitter() exits (reverted [1785]).
1401 way in which 2.5's Quitter() exits (reverted [1785]).
1397
1402
1398 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1403 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1399 2.5.
1404 2.5.
1400
1405
1401 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1406 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1402 color scheme is updated as well when color scheme is changed
1407 color scheme is updated as well when color scheme is changed
1403 interactively.
1408 interactively.
1404
1409
1405 2006-09-27 Ville Vainio <vivainio@gmail.com>
1410 2006-09-27 Ville Vainio <vivainio@gmail.com>
1406
1411
1407 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1412 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1408 infinite loop and just exit. It's a hack, but will do for a while.
1413 infinite loop and just exit. It's a hack, but will do for a while.
1409
1414
1410 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1415 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1411
1416
1412 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1417 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1413 the constructor, this makes it possible to get a list of only directories
1418 the constructor, this makes it possible to get a list of only directories
1414 or only files.
1419 or only files.
1415
1420
1416 2006-08-12 Ville Vainio <vivainio@gmail.com>
1421 2006-08-12 Ville Vainio <vivainio@gmail.com>
1417
1422
1418 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1423 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1419 they broke unittest
1424 they broke unittest
1420
1425
1421 2006-08-11 Ville Vainio <vivainio@gmail.com>
1426 2006-08-11 Ville Vainio <vivainio@gmail.com>
1422
1427
1423 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1428 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1424 by resolving issue properly, i.e. by inheriting FakeModule
1429 by resolving issue properly, i.e. by inheriting FakeModule
1425 from types.ModuleType. Pickling ipython interactive data
1430 from types.ModuleType. Pickling ipython interactive data
1426 should still work as usual (testing appreciated).
1431 should still work as usual (testing appreciated).
1427
1432
1428 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1433 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1429
1434
1430 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1435 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1431 running under python 2.3 with code from 2.4 to fix a bug with
1436 running under python 2.3 with code from 2.4 to fix a bug with
1432 help(). Reported by the Debian maintainers, Norbert Tretkowski
1437 help(). Reported by the Debian maintainers, Norbert Tretkowski
1433 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1438 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1434 <afayolle-AT-debian.org>.
1439 <afayolle-AT-debian.org>.
1435
1440
1436 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1441 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1437
1442
1438 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1443 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1439 (which was displaying "quit" twice).
1444 (which was displaying "quit" twice).
1440
1445
1441 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1446 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1442
1447
1443 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1448 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1444 the mode argument).
1449 the mode argument).
1445
1450
1446 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1451 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1447
1452
1448 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1453 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1449 not running under IPython.
1454 not running under IPython.
1450
1455
1451 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1456 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1452 and make it iterable (iterating over the attribute itself). Add two new
1457 and make it iterable (iterating over the attribute itself). Add two new
1453 magic strings for __xattrs__(): If the string starts with "-", the attribute
1458 magic strings for __xattrs__(): If the string starts with "-", the attribute
1454 will not be displayed in ibrowse's detail view (but it can still be
1459 will not be displayed in ibrowse's detail view (but it can still be
1455 iterated over). This makes it possible to add attributes that are large
1460 iterated over). This makes it possible to add attributes that are large
1456 lists or generator methods to the detail view. Replace magic attribute names
1461 lists or generator methods to the detail view. Replace magic attribute names
1457 and _attrname() and _getattr() with "descriptors": For each type of magic
1462 and _attrname() and _getattr() with "descriptors": For each type of magic
1458 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1463 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1459 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1464 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1460 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1465 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1461 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1466 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1462 are still supported.
1467 are still supported.
1463
1468
1464 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1469 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1465 fails in ibrowse.fetch(), the exception object is added as the last item
1470 fails in ibrowse.fetch(), the exception object is added as the last item
1466 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1471 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1467 a generator throws an exception midway through execution.
1472 a generator throws an exception midway through execution.
1468
1473
1469 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1474 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1470 encoding into methods.
1475 encoding into methods.
1471
1476
1472 2006-07-26 Ville Vainio <vivainio@gmail.com>
1477 2006-07-26 Ville Vainio <vivainio@gmail.com>
1473
1478
1474 * iplib.py: history now stores multiline input as single
1479 * iplib.py: history now stores multiline input as single
1475 history entries. Patch by Jorgen Cederlof.
1480 history entries. Patch by Jorgen Cederlof.
1476
1481
1477 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1482 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1478
1483
1479 * IPython/Extensions/ibrowse.py: Make cursor visible over
1484 * IPython/Extensions/ibrowse.py: Make cursor visible over
1480 non existing attributes.
1485 non existing attributes.
1481
1486
1482 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1487 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1483
1488
1484 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1489 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1485 error output of the running command doesn't mess up the screen.
1490 error output of the running command doesn't mess up the screen.
1486
1491
1487 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1492 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1488
1493
1489 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1494 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1490 argument. This sorts the items themselves.
1495 argument. This sorts the items themselves.
1491
1496
1492 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1497 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1493
1498
1494 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1499 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1495 Compile expression strings into code objects. This should speed
1500 Compile expression strings into code objects. This should speed
1496 up ifilter and friends somewhat.
1501 up ifilter and friends somewhat.
1497
1502
1498 2006-07-08 Ville Vainio <vivainio@gmail.com>
1503 2006-07-08 Ville Vainio <vivainio@gmail.com>
1499
1504
1500 * Magic.py: %cpaste now strips > from the beginning of lines
1505 * Magic.py: %cpaste now strips > from the beginning of lines
1501 to ease pasting quoted code from emails. Contributed by
1506 to ease pasting quoted code from emails. Contributed by
1502 Stefan van der Walt.
1507 Stefan van der Walt.
1503
1508
1504 2006-06-29 Ville Vainio <vivainio@gmail.com>
1509 2006-06-29 Ville Vainio <vivainio@gmail.com>
1505
1510
1506 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1511 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1507 mode, patch contributed by Darren Dale. NEEDS TESTING!
1512 mode, patch contributed by Darren Dale. NEEDS TESTING!
1508
1513
1509 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1514 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1510
1515
1511 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1516 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1512 a blue background. Fix fetching new display rows when the browser
1517 a blue background. Fix fetching new display rows when the browser
1513 scrolls more than a screenful (e.g. by using the goto command).
1518 scrolls more than a screenful (e.g. by using the goto command).
1514
1519
1515 2006-06-27 Ville Vainio <vivainio@gmail.com>
1520 2006-06-27 Ville Vainio <vivainio@gmail.com>
1516
1521
1517 * Magic.py (_inspect, _ofind) Apply David Huard's
1522 * Magic.py (_inspect, _ofind) Apply David Huard's
1518 patch for displaying the correct docstring for 'property'
1523 patch for displaying the correct docstring for 'property'
1519 attributes.
1524 attributes.
1520
1525
1521 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1526 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1522
1527
1523 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1528 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1524 commands into the methods implementing them.
1529 commands into the methods implementing them.
1525
1530
1526 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1531 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1527
1532
1528 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1533 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1529 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1534 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1530 autoindent support was authored by Jin Liu.
1535 autoindent support was authored by Jin Liu.
1531
1536
1532 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1537 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1533
1538
1534 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1539 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1535 for keymaps with a custom class that simplifies handling.
1540 for keymaps with a custom class that simplifies handling.
1536
1541
1537 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1542 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1538
1543
1539 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1544 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1540 resizing. This requires Python 2.5 to work.
1545 resizing. This requires Python 2.5 to work.
1541
1546
1542 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1547 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1543
1548
1544 * IPython/Extensions/ibrowse.py: Add two new commands to
1549 * IPython/Extensions/ibrowse.py: Add two new commands to
1545 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1550 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1546 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1551 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1547 attributes again. Remapped the help command to "?". Display
1552 attributes again. Remapped the help command to "?". Display
1548 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1553 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1549 as keys for the "home" and "end" commands. Add three new commands
1554 as keys for the "home" and "end" commands. Add three new commands
1550 to the input mode for "find" and friends: "delend" (CTRL-K)
1555 to the input mode for "find" and friends: "delend" (CTRL-K)
1551 deletes to the end of line. "incsearchup" searches upwards in the
1556 deletes to the end of line. "incsearchup" searches upwards in the
1552 command history for an input that starts with the text before the cursor.
1557 command history for an input that starts with the text before the cursor.
1553 "incsearchdown" does the same downwards. Removed a bogus mapping of
1558 "incsearchdown" does the same downwards. Removed a bogus mapping of
1554 the x key to "delete".
1559 the x key to "delete".
1555
1560
1556 2006-06-15 Ville Vainio <vivainio@gmail.com>
1561 2006-06-15 Ville Vainio <vivainio@gmail.com>
1557
1562
1558 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1563 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1559 used to create prompts dynamically, instead of the "old" way of
1564 used to create prompts dynamically, instead of the "old" way of
1560 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1565 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1561 way still works (it's invoked by the default hook), of course.
1566 way still works (it's invoked by the default hook), of course.
1562
1567
1563 * Prompts.py: added generate_output_prompt hook for altering output
1568 * Prompts.py: added generate_output_prompt hook for altering output
1564 prompt
1569 prompt
1565
1570
1566 * Release.py: Changed version string to 0.7.3.svn.
1571 * Release.py: Changed version string to 0.7.3.svn.
1567
1572
1568 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1573 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1569
1574
1570 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1575 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1571 the call to fetch() always tries to fetch enough data for at least one
1576 the call to fetch() always tries to fetch enough data for at least one
1572 full screen. This makes it possible to simply call moveto(0,0,True) in
1577 full screen. This makes it possible to simply call moveto(0,0,True) in
1573 the constructor. Fix typos and removed the obsolete goto attribute.
1578 the constructor. Fix typos and removed the obsolete goto attribute.
1574
1579
1575 2006-06-12 Ville Vainio <vivainio@gmail.com>
1580 2006-06-12 Ville Vainio <vivainio@gmail.com>
1576
1581
1577 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1582 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1578 allowing $variable interpolation within multiline statements,
1583 allowing $variable interpolation within multiline statements,
1579 though so far only with "sh" profile for a testing period.
1584 though so far only with "sh" profile for a testing period.
1580 The patch also enables splitting long commands with \ but it
1585 The patch also enables splitting long commands with \ but it
1581 doesn't work properly yet.
1586 doesn't work properly yet.
1582
1587
1583 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1588 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1584
1589
1585 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1590 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1586 input history and the position of the cursor in the input history for
1591 input history and the position of the cursor in the input history for
1587 the find, findbackwards and goto command.
1592 the find, findbackwards and goto command.
1588
1593
1589 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1594 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1590
1595
1591 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1596 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1592 implements the basic functionality of browser commands that require
1597 implements the basic functionality of browser commands that require
1593 input. Reimplement the goto, find and findbackwards commands as
1598 input. Reimplement the goto, find and findbackwards commands as
1594 subclasses of _CommandInput. Add an input history and keymaps to those
1599 subclasses of _CommandInput. Add an input history and keymaps to those
1595 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1600 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1596 execute commands.
1601 execute commands.
1597
1602
1598 2006-06-07 Ville Vainio <vivainio@gmail.com>
1603 2006-06-07 Ville Vainio <vivainio@gmail.com>
1599
1604
1600 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1605 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1601 running the batch files instead of leaving the session open.
1606 running the batch files instead of leaving the session open.
1602
1607
1603 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1608 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1604
1609
1605 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1610 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1606 the original fix was incomplete. Patch submitted by W. Maier.
1611 the original fix was incomplete. Patch submitted by W. Maier.
1607
1612
1608 2006-06-07 Ville Vainio <vivainio@gmail.com>
1613 2006-06-07 Ville Vainio <vivainio@gmail.com>
1609
1614
1610 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1615 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1611 Confirmation prompts can be supressed by 'quiet' option.
1616 Confirmation prompts can be supressed by 'quiet' option.
1612 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1617 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1613
1618
1614 2006-06-06 *** Released version 0.7.2
1619 2006-06-06 *** Released version 0.7.2
1615
1620
1616 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1621 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1617
1622
1618 * IPython/Release.py (version): Made 0.7.2 final for release.
1623 * IPython/Release.py (version): Made 0.7.2 final for release.
1619 Repo tagged and release cut.
1624 Repo tagged and release cut.
1620
1625
1621 2006-06-05 Ville Vainio <vivainio@gmail.com>
1626 2006-06-05 Ville Vainio <vivainio@gmail.com>
1622
1627
1623 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1628 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1624 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1629 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1625
1630
1626 * upgrade_dir.py: try import 'path' module a bit harder
1631 * upgrade_dir.py: try import 'path' module a bit harder
1627 (for %upgrade)
1632 (for %upgrade)
1628
1633
1629 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1634 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1630
1635
1631 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1636 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1632 instead of looping 20 times.
1637 instead of looping 20 times.
1633
1638
1634 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1639 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1635 correctly at initialization time. Bug reported by Krishna Mohan
1640 correctly at initialization time. Bug reported by Krishna Mohan
1636 Gundu <gkmohan-AT-gmail.com> on the user list.
1641 Gundu <gkmohan-AT-gmail.com> on the user list.
1637
1642
1638 * IPython/Release.py (version): Mark 0.7.2 version to start
1643 * IPython/Release.py (version): Mark 0.7.2 version to start
1639 testing for release on 06/06.
1644 testing for release on 06/06.
1640
1645
1641 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1646 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1642
1647
1643 * scripts/irunner: thin script interface so users don't have to
1648 * scripts/irunner: thin script interface so users don't have to
1644 find the module and call it as an executable, since modules rarely
1649 find the module and call it as an executable, since modules rarely
1645 live in people's PATH.
1650 live in people's PATH.
1646
1651
1647 * IPython/irunner.py (InteractiveRunner.__init__): added
1652 * IPython/irunner.py (InteractiveRunner.__init__): added
1648 delaybeforesend attribute to control delays with newer versions of
1653 delaybeforesend attribute to control delays with newer versions of
1649 pexpect. Thanks to detailed help from pexpect's author, Noah
1654 pexpect. Thanks to detailed help from pexpect's author, Noah
1650 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1655 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1651 correctly (it works in NoColor mode).
1656 correctly (it works in NoColor mode).
1652
1657
1653 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1658 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1654 SAGE list, from improper log() calls.
1659 SAGE list, from improper log() calls.
1655
1660
1656 2006-05-31 Ville Vainio <vivainio@gmail.com>
1661 2006-05-31 Ville Vainio <vivainio@gmail.com>
1657
1662
1658 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1663 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1659 with args in parens to work correctly with dirs that have spaces.
1664 with args in parens to work correctly with dirs that have spaces.
1660
1665
1661 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1666 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1662
1667
1663 * IPython/Logger.py (Logger.logstart): add option to log raw input
1668 * IPython/Logger.py (Logger.logstart): add option to log raw input
1664 instead of the processed one. A -r flag was added to the
1669 instead of the processed one. A -r flag was added to the
1665 %logstart magic used for controlling logging.
1670 %logstart magic used for controlling logging.
1666
1671
1667 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1672 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1668
1673
1669 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1674 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1670 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1675 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1671 recognize the option. After a bug report by Will Maier. This
1676 recognize the option. After a bug report by Will Maier. This
1672 closes #64 (will do it after confirmation from W. Maier).
1677 closes #64 (will do it after confirmation from W. Maier).
1673
1678
1674 * IPython/irunner.py: New module to run scripts as if manually
1679 * IPython/irunner.py: New module to run scripts as if manually
1675 typed into an interactive environment, based on pexpect. After a
1680 typed into an interactive environment, based on pexpect. After a
1676 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1681 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1677 ipython-user list. Simple unittests in the tests/ directory.
1682 ipython-user list. Simple unittests in the tests/ directory.
1678
1683
1679 * tools/release: add Will Maier, OpenBSD port maintainer, to
1684 * tools/release: add Will Maier, OpenBSD port maintainer, to
1680 recepients list. We are now officially part of the OpenBSD ports:
1685 recepients list. We are now officially part of the OpenBSD ports:
1681 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1686 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1682 work.
1687 work.
1683
1688
1684 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1689 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1685
1690
1686 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1691 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1687 so that it doesn't break tkinter apps.
1692 so that it doesn't break tkinter apps.
1688
1693
1689 * IPython/iplib.py (_prefilter): fix bug where aliases would
1694 * IPython/iplib.py (_prefilter): fix bug where aliases would
1690 shadow variables when autocall was fully off. Reported by SAGE
1695 shadow variables when autocall was fully off. Reported by SAGE
1691 author William Stein.
1696 author William Stein.
1692
1697
1693 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1698 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1694 at what detail level strings are computed when foo? is requested.
1699 at what detail level strings are computed when foo? is requested.
1695 This allows users to ask for example that the string form of an
1700 This allows users to ask for example that the string form of an
1696 object is only computed when foo?? is called, or even never, by
1701 object is only computed when foo?? is called, or even never, by
1697 setting the object_info_string_level >= 2 in the configuration
1702 setting the object_info_string_level >= 2 in the configuration
1698 file. This new option has been added and documented. After a
1703 file. This new option has been added and documented. After a
1699 request by SAGE to be able to control the printing of very large
1704 request by SAGE to be able to control the printing of very large
1700 objects more easily.
1705 objects more easily.
1701
1706
1702 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1707 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1703
1708
1704 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1709 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1705 from sys.argv, to be 100% consistent with how Python itself works
1710 from sys.argv, to be 100% consistent with how Python itself works
1706 (as seen for example with python -i file.py). After a bug report
1711 (as seen for example with python -i file.py). After a bug report
1707 by Jeffrey Collins.
1712 by Jeffrey Collins.
1708
1713
1709 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1714 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1710 nasty bug which was preventing custom namespaces with -pylab,
1715 nasty bug which was preventing custom namespaces with -pylab,
1711 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1716 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1712 compatibility (long gone from mpl).
1717 compatibility (long gone from mpl).
1713
1718
1714 * IPython/ipapi.py (make_session): name change: create->make. We
1719 * IPython/ipapi.py (make_session): name change: create->make. We
1715 use make in other places (ipmaker,...), it's shorter and easier to
1720 use make in other places (ipmaker,...), it's shorter and easier to
1716 type and say, etc. I'm trying to clean things before 0.7.2 so
1721 type and say, etc. I'm trying to clean things before 0.7.2 so
1717 that I can keep things stable wrt to ipapi in the chainsaw branch.
1722 that I can keep things stable wrt to ipapi in the chainsaw branch.
1718
1723
1719 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1724 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1720 python-mode recognizes our debugger mode. Add support for
1725 python-mode recognizes our debugger mode. Add support for
1721 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1726 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1722 <m.liu.jin-AT-gmail.com> originally written by
1727 <m.liu.jin-AT-gmail.com> originally written by
1723 doxgen-AT-newsmth.net (with minor modifications for xemacs
1728 doxgen-AT-newsmth.net (with minor modifications for xemacs
1724 compatibility)
1729 compatibility)
1725
1730
1726 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1731 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1727 tracebacks when walking the stack so that the stack tracking system
1732 tracebacks when walking the stack so that the stack tracking system
1728 in emacs' python-mode can identify the frames correctly.
1733 in emacs' python-mode can identify the frames correctly.
1729
1734
1730 * IPython/ipmaker.py (make_IPython): make the internal (and
1735 * IPython/ipmaker.py (make_IPython): make the internal (and
1731 default config) autoedit_syntax value false by default. Too many
1736 default config) autoedit_syntax value false by default. Too many
1732 users have complained to me (both on and off-list) about problems
1737 users have complained to me (both on and off-list) about problems
1733 with this option being on by default, so I'm making it default to
1738 with this option being on by default, so I'm making it default to
1734 off. It can still be enabled by anyone via the usual mechanisms.
1739 off. It can still be enabled by anyone via the usual mechanisms.
1735
1740
1736 * IPython/completer.py (Completer.attr_matches): add support for
1741 * IPython/completer.py (Completer.attr_matches): add support for
1737 PyCrust-style _getAttributeNames magic method. Patch contributed
1742 PyCrust-style _getAttributeNames magic method. Patch contributed
1738 by <mscott-AT-goldenspud.com>. Closes #50.
1743 by <mscott-AT-goldenspud.com>. Closes #50.
1739
1744
1740 * IPython/iplib.py (InteractiveShell.__init__): remove the
1745 * IPython/iplib.py (InteractiveShell.__init__): remove the
1741 deletion of exit/quit from __builtin__, which can break
1746 deletion of exit/quit from __builtin__, which can break
1742 third-party tools like the Zope debugging console. The
1747 third-party tools like the Zope debugging console. The
1743 %exit/%quit magics remain. In general, it's probably a good idea
1748 %exit/%quit magics remain. In general, it's probably a good idea
1744 not to delete anything from __builtin__, since we never know what
1749 not to delete anything from __builtin__, since we never know what
1745 that will break. In any case, python now (for 2.5) will support
1750 that will break. In any case, python now (for 2.5) will support
1746 'real' exit/quit, so this issue is moot. Closes #55.
1751 'real' exit/quit, so this issue is moot. Closes #55.
1747
1752
1748 * IPython/genutils.py (with_obj): rename the 'with' function to
1753 * IPython/genutils.py (with_obj): rename the 'with' function to
1749 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1754 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1750 becomes a language keyword. Closes #53.
1755 becomes a language keyword. Closes #53.
1751
1756
1752 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1757 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1753 __file__ attribute to this so it fools more things into thinking
1758 __file__ attribute to this so it fools more things into thinking
1754 it is a real module. Closes #59.
1759 it is a real module. Closes #59.
1755
1760
1756 * IPython/Magic.py (magic_edit): add -n option to open the editor
1761 * IPython/Magic.py (magic_edit): add -n option to open the editor
1757 at a specific line number. After a patch by Stefan van der Walt.
1762 at a specific line number. After a patch by Stefan van der Walt.
1758
1763
1759 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1764 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1760
1765
1761 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1766 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1762 reason the file could not be opened. After automatic crash
1767 reason the file could not be opened. After automatic crash
1763 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1768 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1764 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1769 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1765 (_should_recompile): Don't fire editor if using %bg, since there
1770 (_should_recompile): Don't fire editor if using %bg, since there
1766 is no file in the first place. From the same report as above.
1771 is no file in the first place. From the same report as above.
1767 (raw_input): protect against faulty third-party prefilters. After
1772 (raw_input): protect against faulty third-party prefilters. After
1768 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1773 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1769 while running under SAGE.
1774 while running under SAGE.
1770
1775
1771 2006-05-23 Ville Vainio <vivainio@gmail.com>
1776 2006-05-23 Ville Vainio <vivainio@gmail.com>
1772
1777
1773 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1778 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1774 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1779 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1775 now returns None (again), unless dummy is specifically allowed by
1780 now returns None (again), unless dummy is specifically allowed by
1776 ipapi.get(allow_dummy=True).
1781 ipapi.get(allow_dummy=True).
1777
1782
1778 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1783 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1779
1784
1780 * IPython: remove all 2.2-compatibility objects and hacks from
1785 * IPython: remove all 2.2-compatibility objects and hacks from
1781 everywhere, since we only support 2.3 at this point. Docs
1786 everywhere, since we only support 2.3 at this point. Docs
1782 updated.
1787 updated.
1783
1788
1784 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1789 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1785 Anything requiring extra validation can be turned into a Python
1790 Anything requiring extra validation can be turned into a Python
1786 property in the future. I used a property for the db one b/c
1791 property in the future. I used a property for the db one b/c
1787 there was a nasty circularity problem with the initialization
1792 there was a nasty circularity problem with the initialization
1788 order, which right now I don't have time to clean up.
1793 order, which right now I don't have time to clean up.
1789
1794
1790 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1795 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1791 another locking bug reported by Jorgen. I'm not 100% sure though,
1796 another locking bug reported by Jorgen. I'm not 100% sure though,
1792 so more testing is needed...
1797 so more testing is needed...
1793
1798
1794 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1799 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1795
1800
1796 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1801 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1797 local variables from any routine in user code (typically executed
1802 local variables from any routine in user code (typically executed
1798 with %run) directly into the interactive namespace. Very useful
1803 with %run) directly into the interactive namespace. Very useful
1799 when doing complex debugging.
1804 when doing complex debugging.
1800 (IPythonNotRunning): Changed the default None object to a dummy
1805 (IPythonNotRunning): Changed the default None object to a dummy
1801 whose attributes can be queried as well as called without
1806 whose attributes can be queried as well as called without
1802 exploding, to ease writing code which works transparently both in
1807 exploding, to ease writing code which works transparently both in
1803 and out of ipython and uses some of this API.
1808 and out of ipython and uses some of this API.
1804
1809
1805 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1810 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1806
1811
1807 * IPython/hooks.py (result_display): Fix the fact that our display
1812 * IPython/hooks.py (result_display): Fix the fact that our display
1808 hook was using str() instead of repr(), as the default python
1813 hook was using str() instead of repr(), as the default python
1809 console does. This had gone unnoticed b/c it only happened if
1814 console does. This had gone unnoticed b/c it only happened if
1810 %Pprint was off, but the inconsistency was there.
1815 %Pprint was off, but the inconsistency was there.
1811
1816
1812 2006-05-15 Ville Vainio <vivainio@gmail.com>
1817 2006-05-15 Ville Vainio <vivainio@gmail.com>
1813
1818
1814 * Oinspect.py: Only show docstring for nonexisting/binary files
1819 * Oinspect.py: Only show docstring for nonexisting/binary files
1815 when doing object??, closing ticket #62
1820 when doing object??, closing ticket #62
1816
1821
1817 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1822 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1818
1823
1819 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1824 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1820 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1825 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1821 was being released in a routine which hadn't checked if it had
1826 was being released in a routine which hadn't checked if it had
1822 been the one to acquire it.
1827 been the one to acquire it.
1823
1828
1824 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1829 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1825
1830
1826 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1831 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1827
1832
1828 2006-04-11 Ville Vainio <vivainio@gmail.com>
1833 2006-04-11 Ville Vainio <vivainio@gmail.com>
1829
1834
1830 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1835 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1831 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1836 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1832 prefilters, allowing stuff like magics and aliases in the file.
1837 prefilters, allowing stuff like magics and aliases in the file.
1833
1838
1834 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1839 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1835 added. Supported now are "%clear in" and "%clear out" (clear input and
1840 added. Supported now are "%clear in" and "%clear out" (clear input and
1836 output history, respectively). Also fixed CachedOutput.flush to
1841 output history, respectively). Also fixed CachedOutput.flush to
1837 properly flush the output cache.
1842 properly flush the output cache.
1838
1843
1839 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1844 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1840 half-success (and fail explicitly).
1845 half-success (and fail explicitly).
1841
1846
1842 2006-03-28 Ville Vainio <vivainio@gmail.com>
1847 2006-03-28 Ville Vainio <vivainio@gmail.com>
1843
1848
1844 * iplib.py: Fix quoting of aliases so that only argless ones
1849 * iplib.py: Fix quoting of aliases so that only argless ones
1845 are quoted
1850 are quoted
1846
1851
1847 2006-03-28 Ville Vainio <vivainio@gmail.com>
1852 2006-03-28 Ville Vainio <vivainio@gmail.com>
1848
1853
1849 * iplib.py: Quote aliases with spaces in the name.
1854 * iplib.py: Quote aliases with spaces in the name.
1850 "c:\program files\blah\bin" is now legal alias target.
1855 "c:\program files\blah\bin" is now legal alias target.
1851
1856
1852 * ext_rehashdir.py: Space no longer allowed as arg
1857 * ext_rehashdir.py: Space no longer allowed as arg
1853 separator, since space is legal in path names.
1858 separator, since space is legal in path names.
1854
1859
1855 2006-03-16 Ville Vainio <vivainio@gmail.com>
1860 2006-03-16 Ville Vainio <vivainio@gmail.com>
1856
1861
1857 * upgrade_dir.py: Take path.py from Extensions, correcting
1862 * upgrade_dir.py: Take path.py from Extensions, correcting
1858 %upgrade magic
1863 %upgrade magic
1859
1864
1860 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1865 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1861
1866
1862 * hooks.py: Only enclose editor binary in quotes if legal and
1867 * hooks.py: Only enclose editor binary in quotes if legal and
1863 necessary (space in the name, and is an existing file). Fixes a bug
1868 necessary (space in the name, and is an existing file). Fixes a bug
1864 reported by Zachary Pincus.
1869 reported by Zachary Pincus.
1865
1870
1866 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1871 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1867
1872
1868 * Manual: thanks to a tip on proper color handling for Emacs, by
1873 * Manual: thanks to a tip on proper color handling for Emacs, by
1869 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1874 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1870
1875
1871 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1876 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1872 by applying the provided patch. Thanks to Liu Jin
1877 by applying the provided patch. Thanks to Liu Jin
1873 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1878 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1874 XEmacs/Linux, I'm trusting the submitter that it actually helps
1879 XEmacs/Linux, I'm trusting the submitter that it actually helps
1875 under win32/GNU Emacs. Will revisit if any problems are reported.
1880 under win32/GNU Emacs. Will revisit if any problems are reported.
1876
1881
1877 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1882 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1878
1883
1879 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1884 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1880 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1885 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1881
1886
1882 2006-03-12 Ville Vainio <vivainio@gmail.com>
1887 2006-03-12 Ville Vainio <vivainio@gmail.com>
1883
1888
1884 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1889 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1885 Torsten Marek.
1890 Torsten Marek.
1886
1891
1887 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1892 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1888
1893
1889 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1894 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1890 line ranges works again.
1895 line ranges works again.
1891
1896
1892 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1897 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1893
1898
1894 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1899 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1895 and friends, after a discussion with Zach Pincus on ipython-user.
1900 and friends, after a discussion with Zach Pincus on ipython-user.
1896 I'm not 100% sure, but after thinking about it quite a bit, it may
1901 I'm not 100% sure, but after thinking about it quite a bit, it may
1897 be OK. Testing with the multithreaded shells didn't reveal any
1902 be OK. Testing with the multithreaded shells didn't reveal any
1898 problems, but let's keep an eye out.
1903 problems, but let's keep an eye out.
1899
1904
1900 In the process, I fixed a few things which were calling
1905 In the process, I fixed a few things which were calling
1901 self.InteractiveTB() directly (like safe_execfile), which is a
1906 self.InteractiveTB() directly (like safe_execfile), which is a
1902 mistake: ALL exception reporting should be done by calling
1907 mistake: ALL exception reporting should be done by calling
1903 self.showtraceback(), which handles state and tab-completion and
1908 self.showtraceback(), which handles state and tab-completion and
1904 more.
1909 more.
1905
1910
1906 2006-03-01 Ville Vainio <vivainio@gmail.com>
1911 2006-03-01 Ville Vainio <vivainio@gmail.com>
1907
1912
1908 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1913 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1909 To use, do "from ipipe import *".
1914 To use, do "from ipipe import *".
1910
1915
1911 2006-02-24 Ville Vainio <vivainio@gmail.com>
1916 2006-02-24 Ville Vainio <vivainio@gmail.com>
1912
1917
1913 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1918 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1914 "cleanly" and safely than the older upgrade mechanism.
1919 "cleanly" and safely than the older upgrade mechanism.
1915
1920
1916 2006-02-21 Ville Vainio <vivainio@gmail.com>
1921 2006-02-21 Ville Vainio <vivainio@gmail.com>
1917
1922
1918 * Magic.py: %save works again.
1923 * Magic.py: %save works again.
1919
1924
1920 2006-02-15 Ville Vainio <vivainio@gmail.com>
1925 2006-02-15 Ville Vainio <vivainio@gmail.com>
1921
1926
1922 * Magic.py: %Pprint works again
1927 * Magic.py: %Pprint works again
1923
1928
1924 * Extensions/ipy_sane_defaults.py: Provide everything provided
1929 * Extensions/ipy_sane_defaults.py: Provide everything provided
1925 in default ipythonrc, to make it possible to have a completely empty
1930 in default ipythonrc, to make it possible to have a completely empty
1926 ipythonrc (and thus completely rc-file free configuration)
1931 ipythonrc (and thus completely rc-file free configuration)
1927
1932
1928 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1933 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1929
1934
1930 * IPython/hooks.py (editor): quote the call to the editor command,
1935 * IPython/hooks.py (editor): quote the call to the editor command,
1931 to allow commands with spaces in them. Problem noted by watching
1936 to allow commands with spaces in them. Problem noted by watching
1932 Ian Oswald's video about textpad under win32 at
1937 Ian Oswald's video about textpad under win32 at
1933 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1938 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1934
1939
1935 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1940 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1936 describing magics (we haven't used @ for a loong time).
1941 describing magics (we haven't used @ for a loong time).
1937
1942
1938 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1943 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1939 contributed by marienz to close
1944 contributed by marienz to close
1940 http://www.scipy.net/roundup/ipython/issue53.
1945 http://www.scipy.net/roundup/ipython/issue53.
1941
1946
1942 2006-02-10 Ville Vainio <vivainio@gmail.com>
1947 2006-02-10 Ville Vainio <vivainio@gmail.com>
1943
1948
1944 * genutils.py: getoutput now works in win32 too
1949 * genutils.py: getoutput now works in win32 too
1945
1950
1946 * completer.py: alias and magic completion only invoked
1951 * completer.py: alias and magic completion only invoked
1947 at the first "item" in the line, to avoid "cd %store"
1952 at the first "item" in the line, to avoid "cd %store"
1948 nonsense.
1953 nonsense.
1949
1954
1950 2006-02-09 Ville Vainio <vivainio@gmail.com>
1955 2006-02-09 Ville Vainio <vivainio@gmail.com>
1951
1956
1952 * test/*: Added a unit testing framework (finally).
1957 * test/*: Added a unit testing framework (finally).
1953 '%run runtests.py' to run test_*.
1958 '%run runtests.py' to run test_*.
1954
1959
1955 * ipapi.py: Exposed runlines and set_custom_exc
1960 * ipapi.py: Exposed runlines and set_custom_exc
1956
1961
1957 2006-02-07 Ville Vainio <vivainio@gmail.com>
1962 2006-02-07 Ville Vainio <vivainio@gmail.com>
1958
1963
1959 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1964 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1960 instead use "f(1 2)" as before.
1965 instead use "f(1 2)" as before.
1961
1966
1962 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1967 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1963
1968
1964 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1969 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1965 facilities, for demos processed by the IPython input filter
1970 facilities, for demos processed by the IPython input filter
1966 (IPythonDemo), and for running a script one-line-at-a-time as a
1971 (IPythonDemo), and for running a script one-line-at-a-time as a
1967 demo, both for pure Python (LineDemo) and for IPython-processed
1972 demo, both for pure Python (LineDemo) and for IPython-processed
1968 input (IPythonLineDemo). After a request by Dave Kohel, from the
1973 input (IPythonLineDemo). After a request by Dave Kohel, from the
1969 SAGE team.
1974 SAGE team.
1970 (Demo.edit): added an edit() method to the demo objects, to edit
1975 (Demo.edit): added an edit() method to the demo objects, to edit
1971 the in-memory copy of the last executed block.
1976 the in-memory copy of the last executed block.
1972
1977
1973 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1978 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1974 processing to %edit, %macro and %save. These commands can now be
1979 processing to %edit, %macro and %save. These commands can now be
1975 invoked on the unprocessed input as it was typed by the user
1980 invoked on the unprocessed input as it was typed by the user
1976 (without any prefilters applied). After requests by the SAGE team
1981 (without any prefilters applied). After requests by the SAGE team
1977 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1982 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1978
1983
1979 2006-02-01 Ville Vainio <vivainio@gmail.com>
1984 2006-02-01 Ville Vainio <vivainio@gmail.com>
1980
1985
1981 * setup.py, eggsetup.py: easy_install ipython==dev works
1986 * setup.py, eggsetup.py: easy_install ipython==dev works
1982 correctly now (on Linux)
1987 correctly now (on Linux)
1983
1988
1984 * ipy_user_conf,ipmaker: user config changes, removed spurious
1989 * ipy_user_conf,ipmaker: user config changes, removed spurious
1985 warnings
1990 warnings
1986
1991
1987 * iplib: if rc.banner is string, use it as is.
1992 * iplib: if rc.banner is string, use it as is.
1988
1993
1989 * Magic: %pycat accepts a string argument and pages it's contents.
1994 * Magic: %pycat accepts a string argument and pages it's contents.
1990
1995
1991
1996
1992 2006-01-30 Ville Vainio <vivainio@gmail.com>
1997 2006-01-30 Ville Vainio <vivainio@gmail.com>
1993
1998
1994 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1999 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1995 Now %store and bookmarks work through PickleShare, meaning that
2000 Now %store and bookmarks work through PickleShare, meaning that
1996 concurrent access is possible and all ipython sessions see the
2001 concurrent access is possible and all ipython sessions see the
1997 same database situation all the time, instead of snapshot of
2002 same database situation all the time, instead of snapshot of
1998 the situation when the session was started. Hence, %bookmark
2003 the situation when the session was started. Hence, %bookmark
1999 results are immediately accessible from othes sessions. The database
2004 results are immediately accessible from othes sessions. The database
2000 is also available for use by user extensions. See:
2005 is also available for use by user extensions. See:
2001 http://www.python.org/pypi/pickleshare
2006 http://www.python.org/pypi/pickleshare
2002
2007
2003 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2008 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2004
2009
2005 * aliases can now be %store'd
2010 * aliases can now be %store'd
2006
2011
2007 * path.py moved to Extensions so that pickleshare does not need
2012 * path.py moved to Extensions so that pickleshare does not need
2008 IPython-specific import. Extensions added to pythonpath right
2013 IPython-specific import. Extensions added to pythonpath right
2009 at __init__.
2014 at __init__.
2010
2015
2011 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2016 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2012 called with _ip.system and the pre-transformed command string.
2017 called with _ip.system and the pre-transformed command string.
2013
2018
2014 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2019 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2015
2020
2016 * IPython/iplib.py (interact): Fix that we were not catching
2021 * IPython/iplib.py (interact): Fix that we were not catching
2017 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2022 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2018 logic here had to change, but it's fixed now.
2023 logic here had to change, but it's fixed now.
2019
2024
2020 2006-01-29 Ville Vainio <vivainio@gmail.com>
2025 2006-01-29 Ville Vainio <vivainio@gmail.com>
2021
2026
2022 * iplib.py: Try to import pyreadline on Windows.
2027 * iplib.py: Try to import pyreadline on Windows.
2023
2028
2024 2006-01-27 Ville Vainio <vivainio@gmail.com>
2029 2006-01-27 Ville Vainio <vivainio@gmail.com>
2025
2030
2026 * iplib.py: Expose ipapi as _ip in builtin namespace.
2031 * iplib.py: Expose ipapi as _ip in builtin namespace.
2027 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2032 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2028 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2033 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2029 syntax now produce _ip.* variant of the commands.
2034 syntax now produce _ip.* variant of the commands.
2030
2035
2031 * "_ip.options().autoedit_syntax = 2" automatically throws
2036 * "_ip.options().autoedit_syntax = 2" automatically throws
2032 user to editor for syntax error correction without prompting.
2037 user to editor for syntax error correction without prompting.
2033
2038
2034 2006-01-27 Ville Vainio <vivainio@gmail.com>
2039 2006-01-27 Ville Vainio <vivainio@gmail.com>
2035
2040
2036 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2041 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2037 'ipython' at argv[0]) executed through command line.
2042 'ipython' at argv[0]) executed through command line.
2038 NOTE: this DEPRECATES calling ipython with multiple scripts
2043 NOTE: this DEPRECATES calling ipython with multiple scripts
2039 ("ipython a.py b.py c.py")
2044 ("ipython a.py b.py c.py")
2040
2045
2041 * iplib.py, hooks.py: Added configurable input prefilter,
2046 * iplib.py, hooks.py: Added configurable input prefilter,
2042 named 'input_prefilter'. See ext_rescapture.py for example
2047 named 'input_prefilter'. See ext_rescapture.py for example
2043 usage.
2048 usage.
2044
2049
2045 * ext_rescapture.py, Magic.py: Better system command output capture
2050 * ext_rescapture.py, Magic.py: Better system command output capture
2046 through 'var = !ls' (deprecates user-visible %sc). Same notation
2051 through 'var = !ls' (deprecates user-visible %sc). Same notation
2047 applies for magics, 'var = %alias' assigns alias list to var.
2052 applies for magics, 'var = %alias' assigns alias list to var.
2048
2053
2049 * ipapi.py: added meta() for accessing extension-usable data store.
2054 * ipapi.py: added meta() for accessing extension-usable data store.
2050
2055
2051 * iplib.py: added InteractiveShell.getapi(). New magics should be
2056 * iplib.py: added InteractiveShell.getapi(). New magics should be
2052 written doing self.getapi() instead of using the shell directly.
2057 written doing self.getapi() instead of using the shell directly.
2053
2058
2054 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2059 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2055 %store foo >> ~/myfoo.txt to store variables to files (in clean
2060 %store foo >> ~/myfoo.txt to store variables to files (in clean
2056 textual form, not a restorable pickle).
2061 textual form, not a restorable pickle).
2057
2062
2058 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2063 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2059
2064
2060 * usage.py, Magic.py: added %quickref
2065 * usage.py, Magic.py: added %quickref
2061
2066
2062 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2067 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2063
2068
2064 * GetoptErrors when invoking magics etc. with wrong args
2069 * GetoptErrors when invoking magics etc. with wrong args
2065 are now more helpful:
2070 are now more helpful:
2066 GetoptError: option -l not recognized (allowed: "qb" )
2071 GetoptError: option -l not recognized (allowed: "qb" )
2067
2072
2068 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2073 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2069
2074
2070 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2075 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2071 computationally intensive blocks don't appear to stall the demo.
2076 computationally intensive blocks don't appear to stall the demo.
2072
2077
2073 2006-01-24 Ville Vainio <vivainio@gmail.com>
2078 2006-01-24 Ville Vainio <vivainio@gmail.com>
2074
2079
2075 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2080 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2076 value to manipulate resulting history entry.
2081 value to manipulate resulting history entry.
2077
2082
2078 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2083 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2079 to instance methods of IPApi class, to make extending an embedded
2084 to instance methods of IPApi class, to make extending an embedded
2080 IPython feasible. See ext_rehashdir.py for example usage.
2085 IPython feasible. See ext_rehashdir.py for example usage.
2081
2086
2082 * Merged 1071-1076 from branches/0.7.1
2087 * Merged 1071-1076 from branches/0.7.1
2083
2088
2084
2089
2085 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2090 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2086
2091
2087 * tools/release (daystamp): Fix build tools to use the new
2092 * tools/release (daystamp): Fix build tools to use the new
2088 eggsetup.py script to build lightweight eggs.
2093 eggsetup.py script to build lightweight eggs.
2089
2094
2090 * Applied changesets 1062 and 1064 before 0.7.1 release.
2095 * Applied changesets 1062 and 1064 before 0.7.1 release.
2091
2096
2092 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2097 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2093 see the raw input history (without conversions like %ls ->
2098 see the raw input history (without conversions like %ls ->
2094 ipmagic("ls")). After a request from W. Stein, SAGE
2099 ipmagic("ls")). After a request from W. Stein, SAGE
2095 (http://modular.ucsd.edu/sage) developer. This information is
2100 (http://modular.ucsd.edu/sage) developer. This information is
2096 stored in the input_hist_raw attribute of the IPython instance, so
2101 stored in the input_hist_raw attribute of the IPython instance, so
2097 developers can access it if needed (it's an InputList instance).
2102 developers can access it if needed (it's an InputList instance).
2098
2103
2099 * Versionstring = 0.7.2.svn
2104 * Versionstring = 0.7.2.svn
2100
2105
2101 * eggsetup.py: A separate script for constructing eggs, creates
2106 * eggsetup.py: A separate script for constructing eggs, creates
2102 proper launch scripts even on Windows (an .exe file in
2107 proper launch scripts even on Windows (an .exe file in
2103 \python24\scripts).
2108 \python24\scripts).
2104
2109
2105 * ipapi.py: launch_new_instance, launch entry point needed for the
2110 * ipapi.py: launch_new_instance, launch entry point needed for the
2106 egg.
2111 egg.
2107
2112
2108 2006-01-23 Ville Vainio <vivainio@gmail.com>
2113 2006-01-23 Ville Vainio <vivainio@gmail.com>
2109
2114
2110 * Added %cpaste magic for pasting python code
2115 * Added %cpaste magic for pasting python code
2111
2116
2112 2006-01-22 Ville Vainio <vivainio@gmail.com>
2117 2006-01-22 Ville Vainio <vivainio@gmail.com>
2113
2118
2114 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2119 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2115
2120
2116 * Versionstring = 0.7.2.svn
2121 * Versionstring = 0.7.2.svn
2117
2122
2118 * eggsetup.py: A separate script for constructing eggs, creates
2123 * eggsetup.py: A separate script for constructing eggs, creates
2119 proper launch scripts even on Windows (an .exe file in
2124 proper launch scripts even on Windows (an .exe file in
2120 \python24\scripts).
2125 \python24\scripts).
2121
2126
2122 * ipapi.py: launch_new_instance, launch entry point needed for the
2127 * ipapi.py: launch_new_instance, launch entry point needed for the
2123 egg.
2128 egg.
2124
2129
2125 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2130 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2126
2131
2127 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2132 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2128 %pfile foo would print the file for foo even if it was a binary.
2133 %pfile foo would print the file for foo even if it was a binary.
2129 Now, extensions '.so' and '.dll' are skipped.
2134 Now, extensions '.so' and '.dll' are skipped.
2130
2135
2131 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2136 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2132 bug, where macros would fail in all threaded modes. I'm not 100%
2137 bug, where macros would fail in all threaded modes. I'm not 100%
2133 sure, so I'm going to put out an rc instead of making a release
2138 sure, so I'm going to put out an rc instead of making a release
2134 today, and wait for feedback for at least a few days.
2139 today, and wait for feedback for at least a few days.
2135
2140
2136 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2141 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2137 it...) the handling of pasting external code with autoindent on.
2142 it...) the handling of pasting external code with autoindent on.
2138 To get out of a multiline input, the rule will appear for most
2143 To get out of a multiline input, the rule will appear for most
2139 users unchanged: two blank lines or change the indent level
2144 users unchanged: two blank lines or change the indent level
2140 proposed by IPython. But there is a twist now: you can
2145 proposed by IPython. But there is a twist now: you can
2141 add/subtract only *one or two spaces*. If you add/subtract three
2146 add/subtract only *one or two spaces*. If you add/subtract three
2142 or more (unless you completely delete the line), IPython will
2147 or more (unless you completely delete the line), IPython will
2143 accept that line, and you'll need to enter a second one of pure
2148 accept that line, and you'll need to enter a second one of pure
2144 whitespace. I know it sounds complicated, but I can't find a
2149 whitespace. I know it sounds complicated, but I can't find a
2145 different solution that covers all the cases, with the right
2150 different solution that covers all the cases, with the right
2146 heuristics. Hopefully in actual use, nobody will really notice
2151 heuristics. Hopefully in actual use, nobody will really notice
2147 all these strange rules and things will 'just work'.
2152 all these strange rules and things will 'just work'.
2148
2153
2149 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2154 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2150
2155
2151 * IPython/iplib.py (interact): catch exceptions which can be
2156 * IPython/iplib.py (interact): catch exceptions which can be
2152 triggered asynchronously by signal handlers. Thanks to an
2157 triggered asynchronously by signal handlers. Thanks to an
2153 automatic crash report, submitted by Colin Kingsley
2158 automatic crash report, submitted by Colin Kingsley
2154 <tercel-AT-gentoo.org>.
2159 <tercel-AT-gentoo.org>.
2155
2160
2156 2006-01-20 Ville Vainio <vivainio@gmail.com>
2161 2006-01-20 Ville Vainio <vivainio@gmail.com>
2157
2162
2158 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2163 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2159 (%rehashdir, very useful, try it out) of how to extend ipython
2164 (%rehashdir, very useful, try it out) of how to extend ipython
2160 with new magics. Also added Extensions dir to pythonpath to make
2165 with new magics. Also added Extensions dir to pythonpath to make
2161 importing extensions easy.
2166 importing extensions easy.
2162
2167
2163 * %store now complains when trying to store interactively declared
2168 * %store now complains when trying to store interactively declared
2164 classes / instances of those classes.
2169 classes / instances of those classes.
2165
2170
2166 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2171 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2167 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2172 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2168 if they exist, and ipy_user_conf.py with some defaults is created for
2173 if they exist, and ipy_user_conf.py with some defaults is created for
2169 the user.
2174 the user.
2170
2175
2171 * Startup rehashing done by the config file, not InterpreterExec.
2176 * Startup rehashing done by the config file, not InterpreterExec.
2172 This means system commands are available even without selecting the
2177 This means system commands are available even without selecting the
2173 pysh profile. It's the sensible default after all.
2178 pysh profile. It's the sensible default after all.
2174
2179
2175 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2180 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2176
2181
2177 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2182 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2178 multiline code with autoindent on working. But I am really not
2183 multiline code with autoindent on working. But I am really not
2179 sure, so this needs more testing. Will commit a debug-enabled
2184 sure, so this needs more testing. Will commit a debug-enabled
2180 version for now, while I test it some more, so that Ville and
2185 version for now, while I test it some more, so that Ville and
2181 others may also catch any problems. Also made
2186 others may also catch any problems. Also made
2182 self.indent_current_str() a method, to ensure that there's no
2187 self.indent_current_str() a method, to ensure that there's no
2183 chance of the indent space count and the corresponding string
2188 chance of the indent space count and the corresponding string
2184 falling out of sync. All code needing the string should just call
2189 falling out of sync. All code needing the string should just call
2185 the method.
2190 the method.
2186
2191
2187 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2192 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2188
2193
2189 * IPython/Magic.py (magic_edit): fix check for when users don't
2194 * IPython/Magic.py (magic_edit): fix check for when users don't
2190 save their output files, the try/except was in the wrong section.
2195 save their output files, the try/except was in the wrong section.
2191
2196
2192 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2197 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2193
2198
2194 * IPython/Magic.py (magic_run): fix __file__ global missing from
2199 * IPython/Magic.py (magic_run): fix __file__ global missing from
2195 script's namespace when executed via %run. After a report by
2200 script's namespace when executed via %run. After a report by
2196 Vivian.
2201 Vivian.
2197
2202
2198 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2203 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2199 when using python 2.4. The parent constructor changed in 2.4, and
2204 when using python 2.4. The parent constructor changed in 2.4, and
2200 we need to track it directly (we can't call it, as it messes up
2205 we need to track it directly (we can't call it, as it messes up
2201 readline and tab-completion inside our pdb would stop working).
2206 readline and tab-completion inside our pdb would stop working).
2202 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2207 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2203
2208
2204 2006-01-16 Ville Vainio <vivainio@gmail.com>
2209 2006-01-16 Ville Vainio <vivainio@gmail.com>
2205
2210
2206 * Ipython/magic.py: Reverted back to old %edit functionality
2211 * Ipython/magic.py: Reverted back to old %edit functionality
2207 that returns file contents on exit.
2212 that returns file contents on exit.
2208
2213
2209 * IPython/path.py: Added Jason Orendorff's "path" module to
2214 * IPython/path.py: Added Jason Orendorff's "path" module to
2210 IPython tree, http://www.jorendorff.com/articles/python/path/.
2215 IPython tree, http://www.jorendorff.com/articles/python/path/.
2211 You can get path objects conveniently through %sc, and !!, e.g.:
2216 You can get path objects conveniently through %sc, and !!, e.g.:
2212 sc files=ls
2217 sc files=ls
2213 for p in files.paths: # or files.p
2218 for p in files.paths: # or files.p
2214 print p,p.mtime
2219 print p,p.mtime
2215
2220
2216 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2221 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2217 now work again without considering the exclusion regexp -
2222 now work again without considering the exclusion regexp -
2218 hence, things like ',foo my/path' turn to 'foo("my/path")'
2223 hence, things like ',foo my/path' turn to 'foo("my/path")'
2219 instead of syntax error.
2224 instead of syntax error.
2220
2225
2221
2226
2222 2006-01-14 Ville Vainio <vivainio@gmail.com>
2227 2006-01-14 Ville Vainio <vivainio@gmail.com>
2223
2228
2224 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2229 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2225 ipapi decorators for python 2.4 users, options() provides access to rc
2230 ipapi decorators for python 2.4 users, options() provides access to rc
2226 data.
2231 data.
2227
2232
2228 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2233 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2229 as path separators (even on Linux ;-). Space character after
2234 as path separators (even on Linux ;-). Space character after
2230 backslash (as yielded by tab completer) is still space;
2235 backslash (as yielded by tab completer) is still space;
2231 "%cd long\ name" works as expected.
2236 "%cd long\ name" works as expected.
2232
2237
2233 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2238 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2234 as "chain of command", with priority. API stays the same,
2239 as "chain of command", with priority. API stays the same,
2235 TryNext exception raised by a hook function signals that
2240 TryNext exception raised by a hook function signals that
2236 current hook failed and next hook should try handling it, as
2241 current hook failed and next hook should try handling it, as
2237 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2242 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2238 requested configurable display hook, which is now implemented.
2243 requested configurable display hook, which is now implemented.
2239
2244
2240 2006-01-13 Ville Vainio <vivainio@gmail.com>
2245 2006-01-13 Ville Vainio <vivainio@gmail.com>
2241
2246
2242 * IPython/platutils*.py: platform specific utility functions,
2247 * IPython/platutils*.py: platform specific utility functions,
2243 so far only set_term_title is implemented (change terminal
2248 so far only set_term_title is implemented (change terminal
2244 label in windowing systems). %cd now changes the title to
2249 label in windowing systems). %cd now changes the title to
2245 current dir.
2250 current dir.
2246
2251
2247 * IPython/Release.py: Added myself to "authors" list,
2252 * IPython/Release.py: Added myself to "authors" list,
2248 had to create new files.
2253 had to create new files.
2249
2254
2250 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2255 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2251 shell escape; not a known bug but had potential to be one in the
2256 shell escape; not a known bug but had potential to be one in the
2252 future.
2257 future.
2253
2258
2254 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2259 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2255 extension API for IPython! See the module for usage example. Fix
2260 extension API for IPython! See the module for usage example. Fix
2256 OInspect for docstring-less magic functions.
2261 OInspect for docstring-less magic functions.
2257
2262
2258
2263
2259 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2264 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2260
2265
2261 * IPython/iplib.py (raw_input): temporarily deactivate all
2266 * IPython/iplib.py (raw_input): temporarily deactivate all
2262 attempts at allowing pasting of code with autoindent on. It
2267 attempts at allowing pasting of code with autoindent on. It
2263 introduced bugs (reported by Prabhu) and I can't seem to find a
2268 introduced bugs (reported by Prabhu) and I can't seem to find a
2264 robust combination which works in all cases. Will have to revisit
2269 robust combination which works in all cases. Will have to revisit
2265 later.
2270 later.
2266
2271
2267 * IPython/genutils.py: remove isspace() function. We've dropped
2272 * IPython/genutils.py: remove isspace() function. We've dropped
2268 2.2 compatibility, so it's OK to use the string method.
2273 2.2 compatibility, so it's OK to use the string method.
2269
2274
2270 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2275 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2271
2276
2272 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2277 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2273 matching what NOT to autocall on, to include all python binary
2278 matching what NOT to autocall on, to include all python binary
2274 operators (including things like 'and', 'or', 'is' and 'in').
2279 operators (including things like 'and', 'or', 'is' and 'in').
2275 Prompted by a bug report on 'foo & bar', but I realized we had
2280 Prompted by a bug report on 'foo & bar', but I realized we had
2276 many more potential bug cases with other operators. The regexp is
2281 many more potential bug cases with other operators. The regexp is
2277 self.re_exclude_auto, it's fairly commented.
2282 self.re_exclude_auto, it's fairly commented.
2278
2283
2279 2006-01-12 Ville Vainio <vivainio@gmail.com>
2284 2006-01-12 Ville Vainio <vivainio@gmail.com>
2280
2285
2281 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2286 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2282 Prettified and hardened string/backslash quoting with ipsystem(),
2287 Prettified and hardened string/backslash quoting with ipsystem(),
2283 ipalias() and ipmagic(). Now even \ characters are passed to
2288 ipalias() and ipmagic(). Now even \ characters are passed to
2284 %magics, !shell escapes and aliases exactly as they are in the
2289 %magics, !shell escapes and aliases exactly as they are in the
2285 ipython command line. Should improve backslash experience,
2290 ipython command line. Should improve backslash experience,
2286 particularly in Windows (path delimiter for some commands that
2291 particularly in Windows (path delimiter for some commands that
2287 won't understand '/'), but Unix benefits as well (regexps). %cd
2292 won't understand '/'), but Unix benefits as well (regexps). %cd
2288 magic still doesn't support backslash path delimiters, though. Also
2293 magic still doesn't support backslash path delimiters, though. Also
2289 deleted all pretense of supporting multiline command strings in
2294 deleted all pretense of supporting multiline command strings in
2290 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2295 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2291
2296
2292 * doc/build_doc_instructions.txt added. Documentation on how to
2297 * doc/build_doc_instructions.txt added. Documentation on how to
2293 use doc/update_manual.py, added yesterday. Both files contributed
2298 use doc/update_manual.py, added yesterday. Both files contributed
2294 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2299 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2295 doc/*.sh for deprecation at a later date.
2300 doc/*.sh for deprecation at a later date.
2296
2301
2297 * /ipython.py Added ipython.py to root directory for
2302 * /ipython.py Added ipython.py to root directory for
2298 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2303 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2299 ipython.py) and development convenience (no need to keep doing
2304 ipython.py) and development convenience (no need to keep doing
2300 "setup.py install" between changes).
2305 "setup.py install" between changes).
2301
2306
2302 * Made ! and !! shell escapes work (again) in multiline expressions:
2307 * Made ! and !! shell escapes work (again) in multiline expressions:
2303 if 1:
2308 if 1:
2304 !ls
2309 !ls
2305 !!ls
2310 !!ls
2306
2311
2307 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2312 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2308
2313
2309 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2314 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2310 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2315 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2311 module in case-insensitive installation. Was causing crashes
2316 module in case-insensitive installation. Was causing crashes
2312 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2317 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2313
2318
2314 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2319 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2315 <marienz-AT-gentoo.org>, closes
2320 <marienz-AT-gentoo.org>, closes
2316 http://www.scipy.net/roundup/ipython/issue51.
2321 http://www.scipy.net/roundup/ipython/issue51.
2317
2322
2318 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2323 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2319
2324
2320 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2325 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2321 problem of excessive CPU usage under *nix and keyboard lag under
2326 problem of excessive CPU usage under *nix and keyboard lag under
2322 win32.
2327 win32.
2323
2328
2324 2006-01-10 *** Released version 0.7.0
2329 2006-01-10 *** Released version 0.7.0
2325
2330
2326 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2331 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2327
2332
2328 * IPython/Release.py (revision): tag version number to 0.7.0,
2333 * IPython/Release.py (revision): tag version number to 0.7.0,
2329 ready for release.
2334 ready for release.
2330
2335
2331 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2336 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2332 it informs the user of the name of the temp. file used. This can
2337 it informs the user of the name of the temp. file used. This can
2333 help if you decide later to reuse that same file, so you know
2338 help if you decide later to reuse that same file, so you know
2334 where to copy the info from.
2339 where to copy the info from.
2335
2340
2336 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2341 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2337
2342
2338 * setup_bdist_egg.py: little script to build an egg. Added
2343 * setup_bdist_egg.py: little script to build an egg. Added
2339 support in the release tools as well.
2344 support in the release tools as well.
2340
2345
2341 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2346 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2342
2347
2343 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2348 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2344 version selection (new -wxversion command line and ipythonrc
2349 version selection (new -wxversion command line and ipythonrc
2345 parameter). Patch contributed by Arnd Baecker
2350 parameter). Patch contributed by Arnd Baecker
2346 <arnd.baecker-AT-web.de>.
2351 <arnd.baecker-AT-web.de>.
2347
2352
2348 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2353 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2349 embedded instances, for variables defined at the interactive
2354 embedded instances, for variables defined at the interactive
2350 prompt of the embedded ipython. Reported by Arnd.
2355 prompt of the embedded ipython. Reported by Arnd.
2351
2356
2352 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2357 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2353 it can be used as a (stateful) toggle, or with a direct parameter.
2358 it can be used as a (stateful) toggle, or with a direct parameter.
2354
2359
2355 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2360 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2356 could be triggered in certain cases and cause the traceback
2361 could be triggered in certain cases and cause the traceback
2357 printer not to work.
2362 printer not to work.
2358
2363
2359 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2364 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2360
2365
2361 * IPython/iplib.py (_should_recompile): Small fix, closes
2366 * IPython/iplib.py (_should_recompile): Small fix, closes
2362 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2367 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2363
2368
2364 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2369 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2365
2370
2366 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2371 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2367 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2372 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2368 Moad for help with tracking it down.
2373 Moad for help with tracking it down.
2369
2374
2370 * IPython/iplib.py (handle_auto): fix autocall handling for
2375 * IPython/iplib.py (handle_auto): fix autocall handling for
2371 objects which support BOTH __getitem__ and __call__ (so that f [x]
2376 objects which support BOTH __getitem__ and __call__ (so that f [x]
2372 is left alone, instead of becoming f([x]) automatically).
2377 is left alone, instead of becoming f([x]) automatically).
2373
2378
2374 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2379 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2375 Ville's patch.
2380 Ville's patch.
2376
2381
2377 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2382 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2378
2383
2379 * IPython/iplib.py (handle_auto): changed autocall semantics to
2384 * IPython/iplib.py (handle_auto): changed autocall semantics to
2380 include 'smart' mode, where the autocall transformation is NOT
2385 include 'smart' mode, where the autocall transformation is NOT
2381 applied if there are no arguments on the line. This allows you to
2386 applied if there are no arguments on the line. This allows you to
2382 just type 'foo' if foo is a callable to see its internal form,
2387 just type 'foo' if foo is a callable to see its internal form,
2383 instead of having it called with no arguments (typically a
2388 instead of having it called with no arguments (typically a
2384 mistake). The old 'full' autocall still exists: for that, you
2389 mistake). The old 'full' autocall still exists: for that, you
2385 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2390 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2386
2391
2387 * IPython/completer.py (Completer.attr_matches): add
2392 * IPython/completer.py (Completer.attr_matches): add
2388 tab-completion support for Enthoughts' traits. After a report by
2393 tab-completion support for Enthoughts' traits. After a report by
2389 Arnd and a patch by Prabhu.
2394 Arnd and a patch by Prabhu.
2390
2395
2391 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2396 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2392
2397
2393 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2398 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2394 Schmolck's patch to fix inspect.getinnerframes().
2399 Schmolck's patch to fix inspect.getinnerframes().
2395
2400
2396 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2401 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2397 for embedded instances, regarding handling of namespaces and items
2402 for embedded instances, regarding handling of namespaces and items
2398 added to the __builtin__ one. Multiple embedded instances and
2403 added to the __builtin__ one. Multiple embedded instances and
2399 recursive embeddings should work better now (though I'm not sure
2404 recursive embeddings should work better now (though I'm not sure
2400 I've got all the corner cases fixed, that code is a bit of a brain
2405 I've got all the corner cases fixed, that code is a bit of a brain
2401 twister).
2406 twister).
2402
2407
2403 * IPython/Magic.py (magic_edit): added support to edit in-memory
2408 * IPython/Magic.py (magic_edit): added support to edit in-memory
2404 macros (automatically creates the necessary temp files). %edit
2409 macros (automatically creates the necessary temp files). %edit
2405 also doesn't return the file contents anymore, it's just noise.
2410 also doesn't return the file contents anymore, it's just noise.
2406
2411
2407 * IPython/completer.py (Completer.attr_matches): revert change to
2412 * IPython/completer.py (Completer.attr_matches): revert change to
2408 complete only on attributes listed in __all__. I realized it
2413 complete only on attributes listed in __all__. I realized it
2409 cripples the tab-completion system as a tool for exploring the
2414 cripples the tab-completion system as a tool for exploring the
2410 internals of unknown libraries (it renders any non-__all__
2415 internals of unknown libraries (it renders any non-__all__
2411 attribute off-limits). I got bit by this when trying to see
2416 attribute off-limits). I got bit by this when trying to see
2412 something inside the dis module.
2417 something inside the dis module.
2413
2418
2414 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2419 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2415
2420
2416 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2421 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2417 namespace for users and extension writers to hold data in. This
2422 namespace for users and extension writers to hold data in. This
2418 follows the discussion in
2423 follows the discussion in
2419 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2424 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2420
2425
2421 * IPython/completer.py (IPCompleter.complete): small patch to help
2426 * IPython/completer.py (IPCompleter.complete): small patch to help
2422 tab-completion under Emacs, after a suggestion by John Barnard
2427 tab-completion under Emacs, after a suggestion by John Barnard
2423 <barnarj-AT-ccf.org>.
2428 <barnarj-AT-ccf.org>.
2424
2429
2425 * IPython/Magic.py (Magic.extract_input_slices): added support for
2430 * IPython/Magic.py (Magic.extract_input_slices): added support for
2426 the slice notation in magics to use N-M to represent numbers N...M
2431 the slice notation in magics to use N-M to represent numbers N...M
2427 (closed endpoints). This is used by %macro and %save.
2432 (closed endpoints). This is used by %macro and %save.
2428
2433
2429 * IPython/completer.py (Completer.attr_matches): for modules which
2434 * IPython/completer.py (Completer.attr_matches): for modules which
2430 define __all__, complete only on those. After a patch by Jeffrey
2435 define __all__, complete only on those. After a patch by Jeffrey
2431 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2436 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2432 speed up this routine.
2437 speed up this routine.
2433
2438
2434 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2439 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2435 don't know if this is the end of it, but the behavior now is
2440 don't know if this is the end of it, but the behavior now is
2436 certainly much more correct. Note that coupled with macros,
2441 certainly much more correct. Note that coupled with macros,
2437 slightly surprising (at first) behavior may occur: a macro will in
2442 slightly surprising (at first) behavior may occur: a macro will in
2438 general expand to multiple lines of input, so upon exiting, the
2443 general expand to multiple lines of input, so upon exiting, the
2439 in/out counters will both be bumped by the corresponding amount
2444 in/out counters will both be bumped by the corresponding amount
2440 (as if the macro's contents had been typed interactively). Typing
2445 (as if the macro's contents had been typed interactively). Typing
2441 %hist will reveal the intermediate (silently processed) lines.
2446 %hist will reveal the intermediate (silently processed) lines.
2442
2447
2443 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2448 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2444 pickle to fail (%run was overwriting __main__ and not restoring
2449 pickle to fail (%run was overwriting __main__ and not restoring
2445 it, but pickle relies on __main__ to operate).
2450 it, but pickle relies on __main__ to operate).
2446
2451
2447 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2452 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2448 using properties, but forgot to make the main InteractiveShell
2453 using properties, but forgot to make the main InteractiveShell
2449 class a new-style class. Properties fail silently, and
2454 class a new-style class. Properties fail silently, and
2450 mysteriously, with old-style class (getters work, but
2455 mysteriously, with old-style class (getters work, but
2451 setters don't do anything).
2456 setters don't do anything).
2452
2457
2453 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2458 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2454
2459
2455 * IPython/Magic.py (magic_history): fix history reporting bug (I
2460 * IPython/Magic.py (magic_history): fix history reporting bug (I
2456 know some nasties are still there, I just can't seem to find a
2461 know some nasties are still there, I just can't seem to find a
2457 reproducible test case to track them down; the input history is
2462 reproducible test case to track them down; the input history is
2458 falling out of sync...)
2463 falling out of sync...)
2459
2464
2460 * IPython/iplib.py (handle_shell_escape): fix bug where both
2465 * IPython/iplib.py (handle_shell_escape): fix bug where both
2461 aliases and system accesses where broken for indented code (such
2466 aliases and system accesses where broken for indented code (such
2462 as loops).
2467 as loops).
2463
2468
2464 * IPython/genutils.py (shell): fix small but critical bug for
2469 * IPython/genutils.py (shell): fix small but critical bug for
2465 win32 system access.
2470 win32 system access.
2466
2471
2467 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2472 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2468
2473
2469 * IPython/iplib.py (showtraceback): remove use of the
2474 * IPython/iplib.py (showtraceback): remove use of the
2470 sys.last_{type/value/traceback} structures, which are non
2475 sys.last_{type/value/traceback} structures, which are non
2471 thread-safe.
2476 thread-safe.
2472 (_prefilter): change control flow to ensure that we NEVER
2477 (_prefilter): change control flow to ensure that we NEVER
2473 introspect objects when autocall is off. This will guarantee that
2478 introspect objects when autocall is off. This will guarantee that
2474 having an input line of the form 'x.y', where access to attribute
2479 having an input line of the form 'x.y', where access to attribute
2475 'y' has side effects, doesn't trigger the side effect TWICE. It
2480 'y' has side effects, doesn't trigger the side effect TWICE. It
2476 is important to note that, with autocall on, these side effects
2481 is important to note that, with autocall on, these side effects
2477 can still happen.
2482 can still happen.
2478 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2483 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2479 trio. IPython offers these three kinds of special calls which are
2484 trio. IPython offers these three kinds of special calls which are
2480 not python code, and it's a good thing to have their call method
2485 not python code, and it's a good thing to have their call method
2481 be accessible as pure python functions (not just special syntax at
2486 be accessible as pure python functions (not just special syntax at
2482 the command line). It gives us a better internal implementation
2487 the command line). It gives us a better internal implementation
2483 structure, as well as exposing these for user scripting more
2488 structure, as well as exposing these for user scripting more
2484 cleanly.
2489 cleanly.
2485
2490
2486 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2491 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2487 file. Now that they'll be more likely to be used with the
2492 file. Now that they'll be more likely to be used with the
2488 persistance system (%store), I want to make sure their module path
2493 persistance system (%store), I want to make sure their module path
2489 doesn't change in the future, so that we don't break things for
2494 doesn't change in the future, so that we don't break things for
2490 users' persisted data.
2495 users' persisted data.
2491
2496
2492 * IPython/iplib.py (autoindent_update): move indentation
2497 * IPython/iplib.py (autoindent_update): move indentation
2493 management into the _text_ processing loop, not the keyboard
2498 management into the _text_ processing loop, not the keyboard
2494 interactive one. This is necessary to correctly process non-typed
2499 interactive one. This is necessary to correctly process non-typed
2495 multiline input (such as macros).
2500 multiline input (such as macros).
2496
2501
2497 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2502 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2498 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2503 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2499 which was producing problems in the resulting manual.
2504 which was producing problems in the resulting manual.
2500 (magic_whos): improve reporting of instances (show their class,
2505 (magic_whos): improve reporting of instances (show their class,
2501 instead of simply printing 'instance' which isn't terribly
2506 instead of simply printing 'instance' which isn't terribly
2502 informative).
2507 informative).
2503
2508
2504 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2509 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2505 (minor mods) to support network shares under win32.
2510 (minor mods) to support network shares under win32.
2506
2511
2507 * IPython/winconsole.py (get_console_size): add new winconsole
2512 * IPython/winconsole.py (get_console_size): add new winconsole
2508 module and fixes to page_dumb() to improve its behavior under
2513 module and fixes to page_dumb() to improve its behavior under
2509 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2514 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2510
2515
2511 * IPython/Magic.py (Macro): simplified Macro class to just
2516 * IPython/Magic.py (Macro): simplified Macro class to just
2512 subclass list. We've had only 2.2 compatibility for a very long
2517 subclass list. We've had only 2.2 compatibility for a very long
2513 time, yet I was still avoiding subclassing the builtin types. No
2518 time, yet I was still avoiding subclassing the builtin types. No
2514 more (I'm also starting to use properties, though I won't shift to
2519 more (I'm also starting to use properties, though I won't shift to
2515 2.3-specific features quite yet).
2520 2.3-specific features quite yet).
2516 (magic_store): added Ville's patch for lightweight variable
2521 (magic_store): added Ville's patch for lightweight variable
2517 persistence, after a request on the user list by Matt Wilkie
2522 persistence, after a request on the user list by Matt Wilkie
2518 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2523 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2519 details.
2524 details.
2520
2525
2521 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2526 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2522 changed the default logfile name from 'ipython.log' to
2527 changed the default logfile name from 'ipython.log' to
2523 'ipython_log.py'. These logs are real python files, and now that
2528 'ipython_log.py'. These logs are real python files, and now that
2524 we have much better multiline support, people are more likely to
2529 we have much better multiline support, people are more likely to
2525 want to use them as such. Might as well name them correctly.
2530 want to use them as such. Might as well name them correctly.
2526
2531
2527 * IPython/Magic.py: substantial cleanup. While we can't stop
2532 * IPython/Magic.py: substantial cleanup. While we can't stop
2528 using magics as mixins, due to the existing customizations 'out
2533 using magics as mixins, due to the existing customizations 'out
2529 there' which rely on the mixin naming conventions, at least I
2534 there' which rely on the mixin naming conventions, at least I
2530 cleaned out all cross-class name usage. So once we are OK with
2535 cleaned out all cross-class name usage. So once we are OK with
2531 breaking compatibility, the two systems can be separated.
2536 breaking compatibility, the two systems can be separated.
2532
2537
2533 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2538 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2534 anymore, and the class is a fair bit less hideous as well. New
2539 anymore, and the class is a fair bit less hideous as well. New
2535 features were also introduced: timestamping of input, and logging
2540 features were also introduced: timestamping of input, and logging
2536 of output results. These are user-visible with the -t and -o
2541 of output results. These are user-visible with the -t and -o
2537 options to %logstart. Closes
2542 options to %logstart. Closes
2538 http://www.scipy.net/roundup/ipython/issue11 and a request by
2543 http://www.scipy.net/roundup/ipython/issue11 and a request by
2539 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2544 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2540
2545
2541 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2546 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2542
2547
2543 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2548 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2544 better handle backslashes in paths. See the thread 'More Windows
2549 better handle backslashes in paths. See the thread 'More Windows
2545 questions part 2 - \/ characters revisited' on the iypthon user
2550 questions part 2 - \/ characters revisited' on the iypthon user
2546 list:
2551 list:
2547 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2552 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2548
2553
2549 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2554 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2550
2555
2551 (InteractiveShell.__init__): change threaded shells to not use the
2556 (InteractiveShell.__init__): change threaded shells to not use the
2552 ipython crash handler. This was causing more problems than not,
2557 ipython crash handler. This was causing more problems than not,
2553 as exceptions in the main thread (GUI code, typically) would
2558 as exceptions in the main thread (GUI code, typically) would
2554 always show up as a 'crash', when they really weren't.
2559 always show up as a 'crash', when they really weren't.
2555
2560
2556 The colors and exception mode commands (%colors/%xmode) have been
2561 The colors and exception mode commands (%colors/%xmode) have been
2557 synchronized to also take this into account, so users can get
2562 synchronized to also take this into account, so users can get
2558 verbose exceptions for their threaded code as well. I also added
2563 verbose exceptions for their threaded code as well. I also added
2559 support for activating pdb inside this exception handler as well,
2564 support for activating pdb inside this exception handler as well,
2560 so now GUI authors can use IPython's enhanced pdb at runtime.
2565 so now GUI authors can use IPython's enhanced pdb at runtime.
2561
2566
2562 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2567 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2563 true by default, and add it to the shipped ipythonrc file. Since
2568 true by default, and add it to the shipped ipythonrc file. Since
2564 this asks the user before proceeding, I think it's OK to make it
2569 this asks the user before proceeding, I think it's OK to make it
2565 true by default.
2570 true by default.
2566
2571
2567 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2572 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2568 of the previous special-casing of input in the eval loop. I think
2573 of the previous special-casing of input in the eval loop. I think
2569 this is cleaner, as they really are commands and shouldn't have
2574 this is cleaner, as they really are commands and shouldn't have
2570 a special role in the middle of the core code.
2575 a special role in the middle of the core code.
2571
2576
2572 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2577 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2573
2578
2574 * IPython/iplib.py (edit_syntax_error): added support for
2579 * IPython/iplib.py (edit_syntax_error): added support for
2575 automatically reopening the editor if the file had a syntax error
2580 automatically reopening the editor if the file had a syntax error
2576 in it. Thanks to scottt who provided the patch at:
2581 in it. Thanks to scottt who provided the patch at:
2577 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2582 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2578 version committed).
2583 version committed).
2579
2584
2580 * IPython/iplib.py (handle_normal): add suport for multi-line
2585 * IPython/iplib.py (handle_normal): add suport for multi-line
2581 input with emtpy lines. This fixes
2586 input with emtpy lines. This fixes
2582 http://www.scipy.net/roundup/ipython/issue43 and a similar
2587 http://www.scipy.net/roundup/ipython/issue43 and a similar
2583 discussion on the user list.
2588 discussion on the user list.
2584
2589
2585 WARNING: a behavior change is necessarily introduced to support
2590 WARNING: a behavior change is necessarily introduced to support
2586 blank lines: now a single blank line with whitespace does NOT
2591 blank lines: now a single blank line with whitespace does NOT
2587 break the input loop, which means that when autoindent is on, by
2592 break the input loop, which means that when autoindent is on, by
2588 default hitting return on the next (indented) line does NOT exit.
2593 default hitting return on the next (indented) line does NOT exit.
2589
2594
2590 Instead, to exit a multiline input you can either have:
2595 Instead, to exit a multiline input you can either have:
2591
2596
2592 - TWO whitespace lines (just hit return again), or
2597 - TWO whitespace lines (just hit return again), or
2593 - a single whitespace line of a different length than provided
2598 - a single whitespace line of a different length than provided
2594 by the autoindent (add or remove a space).
2599 by the autoindent (add or remove a space).
2595
2600
2596 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2601 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2597 module to better organize all readline-related functionality.
2602 module to better organize all readline-related functionality.
2598 I've deleted FlexCompleter and put all completion clases here.
2603 I've deleted FlexCompleter and put all completion clases here.
2599
2604
2600 * IPython/iplib.py (raw_input): improve indentation management.
2605 * IPython/iplib.py (raw_input): improve indentation management.
2601 It is now possible to paste indented code with autoindent on, and
2606 It is now possible to paste indented code with autoindent on, and
2602 the code is interpreted correctly (though it still looks bad on
2607 the code is interpreted correctly (though it still looks bad on
2603 screen, due to the line-oriented nature of ipython).
2608 screen, due to the line-oriented nature of ipython).
2604 (MagicCompleter.complete): change behavior so that a TAB key on an
2609 (MagicCompleter.complete): change behavior so that a TAB key on an
2605 otherwise empty line actually inserts a tab, instead of completing
2610 otherwise empty line actually inserts a tab, instead of completing
2606 on the entire global namespace. This makes it easier to use the
2611 on the entire global namespace. This makes it easier to use the
2607 TAB key for indentation. After a request by Hans Meine
2612 TAB key for indentation. After a request by Hans Meine
2608 <hans_meine-AT-gmx.net>
2613 <hans_meine-AT-gmx.net>
2609 (_prefilter): add support so that typing plain 'exit' or 'quit'
2614 (_prefilter): add support so that typing plain 'exit' or 'quit'
2610 does a sensible thing. Originally I tried to deviate as little as
2615 does a sensible thing. Originally I tried to deviate as little as
2611 possible from the default python behavior, but even that one may
2616 possible from the default python behavior, but even that one may
2612 change in this direction (thread on python-dev to that effect).
2617 change in this direction (thread on python-dev to that effect).
2613 Regardless, ipython should do the right thing even if CPython's
2618 Regardless, ipython should do the right thing even if CPython's
2614 '>>>' prompt doesn't.
2619 '>>>' prompt doesn't.
2615 (InteractiveShell): removed subclassing code.InteractiveConsole
2620 (InteractiveShell): removed subclassing code.InteractiveConsole
2616 class. By now we'd overridden just about all of its methods: I've
2621 class. By now we'd overridden just about all of its methods: I've
2617 copied the remaining two over, and now ipython is a standalone
2622 copied the remaining two over, and now ipython is a standalone
2618 class. This will provide a clearer picture for the chainsaw
2623 class. This will provide a clearer picture for the chainsaw
2619 branch refactoring.
2624 branch refactoring.
2620
2625
2621 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2626 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2622
2627
2623 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2628 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2624 failures for objects which break when dir() is called on them.
2629 failures for objects which break when dir() is called on them.
2625
2630
2626 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2631 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2627 distinct local and global namespaces in the completer API. This
2632 distinct local and global namespaces in the completer API. This
2628 change allows us to properly handle completion with distinct
2633 change allows us to properly handle completion with distinct
2629 scopes, including in embedded instances (this had never really
2634 scopes, including in embedded instances (this had never really
2630 worked correctly).
2635 worked correctly).
2631
2636
2632 Note: this introduces a change in the constructor for
2637 Note: this introduces a change in the constructor for
2633 MagicCompleter, as a new global_namespace parameter is now the
2638 MagicCompleter, as a new global_namespace parameter is now the
2634 second argument (the others were bumped one position).
2639 second argument (the others were bumped one position).
2635
2640
2636 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2641 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2637
2642
2638 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2643 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2639 embedded instances (which can be done now thanks to Vivian's
2644 embedded instances (which can be done now thanks to Vivian's
2640 frame-handling fixes for pdb).
2645 frame-handling fixes for pdb).
2641 (InteractiveShell.__init__): Fix namespace handling problem in
2646 (InteractiveShell.__init__): Fix namespace handling problem in
2642 embedded instances. We were overwriting __main__ unconditionally,
2647 embedded instances. We were overwriting __main__ unconditionally,
2643 and this should only be done for 'full' (non-embedded) IPython;
2648 and this should only be done for 'full' (non-embedded) IPython;
2644 embedded instances must respect the caller's __main__. Thanks to
2649 embedded instances must respect the caller's __main__. Thanks to
2645 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2650 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2646
2651
2647 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2652 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2648
2653
2649 * setup.py: added download_url to setup(). This registers the
2654 * setup.py: added download_url to setup(). This registers the
2650 download address at PyPI, which is not only useful to humans
2655 download address at PyPI, which is not only useful to humans
2651 browsing the site, but is also picked up by setuptools (the Eggs
2656 browsing the site, but is also picked up by setuptools (the Eggs
2652 machinery). Thanks to Ville and R. Kern for the info/discussion
2657 machinery). Thanks to Ville and R. Kern for the info/discussion
2653 on this.
2658 on this.
2654
2659
2655 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2660 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2656
2661
2657 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2662 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2658 This brings a lot of nice functionality to the pdb mode, which now
2663 This brings a lot of nice functionality to the pdb mode, which now
2659 has tab-completion, syntax highlighting, and better stack handling
2664 has tab-completion, syntax highlighting, and better stack handling
2660 than before. Many thanks to Vivian De Smedt
2665 than before. Many thanks to Vivian De Smedt
2661 <vivian-AT-vdesmedt.com> for the original patches.
2666 <vivian-AT-vdesmedt.com> for the original patches.
2662
2667
2663 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2668 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2664
2669
2665 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2670 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2666 sequence to consistently accept the banner argument. The
2671 sequence to consistently accept the banner argument. The
2667 inconsistency was tripping SAGE, thanks to Gary Zablackis
2672 inconsistency was tripping SAGE, thanks to Gary Zablackis
2668 <gzabl-AT-yahoo.com> for the report.
2673 <gzabl-AT-yahoo.com> for the report.
2669
2674
2670 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2675 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2671
2676
2672 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2677 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2673 Fix bug where a naked 'alias' call in the ipythonrc file would
2678 Fix bug where a naked 'alias' call in the ipythonrc file would
2674 cause a crash. Bug reported by Jorgen Stenarson.
2679 cause a crash. Bug reported by Jorgen Stenarson.
2675
2680
2676 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2681 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2677
2682
2678 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2683 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2679 startup time.
2684 startup time.
2680
2685
2681 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2686 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2682 instances had introduced a bug with globals in normal code. Now
2687 instances had introduced a bug with globals in normal code. Now
2683 it's working in all cases.
2688 it's working in all cases.
2684
2689
2685 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2690 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2686 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2691 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2687 has been introduced to set the default case sensitivity of the
2692 has been introduced to set the default case sensitivity of the
2688 searches. Users can still select either mode at runtime on a
2693 searches. Users can still select either mode at runtime on a
2689 per-search basis.
2694 per-search basis.
2690
2695
2691 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2696 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2692
2697
2693 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2698 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2694 attributes in wildcard searches for subclasses. Modified version
2699 attributes in wildcard searches for subclasses. Modified version
2695 of a patch by Jorgen.
2700 of a patch by Jorgen.
2696
2701
2697 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2702 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2698
2703
2699 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2704 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2700 embedded instances. I added a user_global_ns attribute to the
2705 embedded instances. I added a user_global_ns attribute to the
2701 InteractiveShell class to handle this.
2706 InteractiveShell class to handle this.
2702
2707
2703 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2708 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2704
2709
2705 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2710 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2706 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2711 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2707 (reported under win32, but may happen also in other platforms).
2712 (reported under win32, but may happen also in other platforms).
2708 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2713 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2709
2714
2710 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2715 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2711
2716
2712 * IPython/Magic.py (magic_psearch): new support for wildcard
2717 * IPython/Magic.py (magic_psearch): new support for wildcard
2713 patterns. Now, typing ?a*b will list all names which begin with a
2718 patterns. Now, typing ?a*b will list all names which begin with a
2714 and end in b, for example. The %psearch magic has full
2719 and end in b, for example. The %psearch magic has full
2715 docstrings. Many thanks to JΓΆrgen Stenarson
2720 docstrings. Many thanks to JΓΆrgen Stenarson
2716 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2721 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2717 implementing this functionality.
2722 implementing this functionality.
2718
2723
2719 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2724 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2720
2725
2721 * Manual: fixed long-standing annoyance of double-dashes (as in
2726 * Manual: fixed long-standing annoyance of double-dashes (as in
2722 --prefix=~, for example) being stripped in the HTML version. This
2727 --prefix=~, for example) being stripped in the HTML version. This
2723 is a latex2html bug, but a workaround was provided. Many thanks
2728 is a latex2html bug, but a workaround was provided. Many thanks
2724 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2729 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2725 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2730 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2726 rolling. This seemingly small issue had tripped a number of users
2731 rolling. This seemingly small issue had tripped a number of users
2727 when first installing, so I'm glad to see it gone.
2732 when first installing, so I'm glad to see it gone.
2728
2733
2729 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2734 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2730
2735
2731 * IPython/Extensions/numeric_formats.py: fix missing import,
2736 * IPython/Extensions/numeric_formats.py: fix missing import,
2732 reported by Stephen Walton.
2737 reported by Stephen Walton.
2733
2738
2734 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2739 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2735
2740
2736 * IPython/demo.py: finish demo module, fully documented now.
2741 * IPython/demo.py: finish demo module, fully documented now.
2737
2742
2738 * IPython/genutils.py (file_read): simple little utility to read a
2743 * IPython/genutils.py (file_read): simple little utility to read a
2739 file and ensure it's closed afterwards.
2744 file and ensure it's closed afterwards.
2740
2745
2741 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2746 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2742
2747
2743 * IPython/demo.py (Demo.__init__): added support for individually
2748 * IPython/demo.py (Demo.__init__): added support for individually
2744 tagging blocks for automatic execution.
2749 tagging blocks for automatic execution.
2745
2750
2746 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2751 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2747 syntax-highlighted python sources, requested by John.
2752 syntax-highlighted python sources, requested by John.
2748
2753
2749 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2754 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2750
2755
2751 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2756 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2752 finishing.
2757 finishing.
2753
2758
2754 * IPython/genutils.py (shlex_split): moved from Magic to here,
2759 * IPython/genutils.py (shlex_split): moved from Magic to here,
2755 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2760 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2756
2761
2757 * IPython/demo.py (Demo.__init__): added support for silent
2762 * IPython/demo.py (Demo.__init__): added support for silent
2758 blocks, improved marks as regexps, docstrings written.
2763 blocks, improved marks as regexps, docstrings written.
2759 (Demo.__init__): better docstring, added support for sys.argv.
2764 (Demo.__init__): better docstring, added support for sys.argv.
2760
2765
2761 * IPython/genutils.py (marquee): little utility used by the demo
2766 * IPython/genutils.py (marquee): little utility used by the demo
2762 code, handy in general.
2767 code, handy in general.
2763
2768
2764 * IPython/demo.py (Demo.__init__): new class for interactive
2769 * IPython/demo.py (Demo.__init__): new class for interactive
2765 demos. Not documented yet, I just wrote it in a hurry for
2770 demos. Not documented yet, I just wrote it in a hurry for
2766 scipy'05. Will docstring later.
2771 scipy'05. Will docstring later.
2767
2772
2768 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2773 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2769
2774
2770 * IPython/Shell.py (sigint_handler): Drastic simplification which
2775 * IPython/Shell.py (sigint_handler): Drastic simplification which
2771 also seems to make Ctrl-C work correctly across threads! This is
2776 also seems to make Ctrl-C work correctly across threads! This is
2772 so simple, that I can't beleive I'd missed it before. Needs more
2777 so simple, that I can't beleive I'd missed it before. Needs more
2773 testing, though.
2778 testing, though.
2774 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2779 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2775 like this before...
2780 like this before...
2776
2781
2777 * IPython/genutils.py (get_home_dir): add protection against
2782 * IPython/genutils.py (get_home_dir): add protection against
2778 non-dirs in win32 registry.
2783 non-dirs in win32 registry.
2779
2784
2780 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2785 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2781 bug where dict was mutated while iterating (pysh crash).
2786 bug where dict was mutated while iterating (pysh crash).
2782
2787
2783 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2788 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2784
2789
2785 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2790 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2786 spurious newlines added by this routine. After a report by
2791 spurious newlines added by this routine. After a report by
2787 F. Mantegazza.
2792 F. Mantegazza.
2788
2793
2789 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2794 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2790
2795
2791 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2796 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2792 calls. These were a leftover from the GTK 1.x days, and can cause
2797 calls. These were a leftover from the GTK 1.x days, and can cause
2793 problems in certain cases (after a report by John Hunter).
2798 problems in certain cases (after a report by John Hunter).
2794
2799
2795 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2800 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2796 os.getcwd() fails at init time. Thanks to patch from David Remahl
2801 os.getcwd() fails at init time. Thanks to patch from David Remahl
2797 <chmod007-AT-mac.com>.
2802 <chmod007-AT-mac.com>.
2798 (InteractiveShell.__init__): prevent certain special magics from
2803 (InteractiveShell.__init__): prevent certain special magics from
2799 being shadowed by aliases. Closes
2804 being shadowed by aliases. Closes
2800 http://www.scipy.net/roundup/ipython/issue41.
2805 http://www.scipy.net/roundup/ipython/issue41.
2801
2806
2802 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2807 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2803
2808
2804 * IPython/iplib.py (InteractiveShell.complete): Added new
2809 * IPython/iplib.py (InteractiveShell.complete): Added new
2805 top-level completion method to expose the completion mechanism
2810 top-level completion method to expose the completion mechanism
2806 beyond readline-based environments.
2811 beyond readline-based environments.
2807
2812
2808 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2813 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2809
2814
2810 * tools/ipsvnc (svnversion): fix svnversion capture.
2815 * tools/ipsvnc (svnversion): fix svnversion capture.
2811
2816
2812 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2817 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2813 attribute to self, which was missing. Before, it was set by a
2818 attribute to self, which was missing. Before, it was set by a
2814 routine which in certain cases wasn't being called, so the
2819 routine which in certain cases wasn't being called, so the
2815 instance could end up missing the attribute. This caused a crash.
2820 instance could end up missing the attribute. This caused a crash.
2816 Closes http://www.scipy.net/roundup/ipython/issue40.
2821 Closes http://www.scipy.net/roundup/ipython/issue40.
2817
2822
2818 2005-08-16 Fernando Perez <fperez@colorado.edu>
2823 2005-08-16 Fernando Perez <fperez@colorado.edu>
2819
2824
2820 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2825 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2821 contains non-string attribute. Closes
2826 contains non-string attribute. Closes
2822 http://www.scipy.net/roundup/ipython/issue38.
2827 http://www.scipy.net/roundup/ipython/issue38.
2823
2828
2824 2005-08-14 Fernando Perez <fperez@colorado.edu>
2829 2005-08-14 Fernando Perez <fperez@colorado.edu>
2825
2830
2826 * tools/ipsvnc: Minor improvements, to add changeset info.
2831 * tools/ipsvnc: Minor improvements, to add changeset info.
2827
2832
2828 2005-08-12 Fernando Perez <fperez@colorado.edu>
2833 2005-08-12 Fernando Perez <fperez@colorado.edu>
2829
2834
2830 * IPython/iplib.py (runsource): remove self.code_to_run_src
2835 * IPython/iplib.py (runsource): remove self.code_to_run_src
2831 attribute. I realized this is nothing more than
2836 attribute. I realized this is nothing more than
2832 '\n'.join(self.buffer), and having the same data in two different
2837 '\n'.join(self.buffer), and having the same data in two different
2833 places is just asking for synchronization bugs. This may impact
2838 places is just asking for synchronization bugs. This may impact
2834 people who have custom exception handlers, so I need to warn
2839 people who have custom exception handlers, so I need to warn
2835 ipython-dev about it (F. Mantegazza may use them).
2840 ipython-dev about it (F. Mantegazza may use them).
2836
2841
2837 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2842 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2838
2843
2839 * IPython/genutils.py: fix 2.2 compatibility (generators)
2844 * IPython/genutils.py: fix 2.2 compatibility (generators)
2840
2845
2841 2005-07-18 Fernando Perez <fperez@colorado.edu>
2846 2005-07-18 Fernando Perez <fperez@colorado.edu>
2842
2847
2843 * IPython/genutils.py (get_home_dir): fix to help users with
2848 * IPython/genutils.py (get_home_dir): fix to help users with
2844 invalid $HOME under win32.
2849 invalid $HOME under win32.
2845
2850
2846 2005-07-17 Fernando Perez <fperez@colorado.edu>
2851 2005-07-17 Fernando Perez <fperez@colorado.edu>
2847
2852
2848 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2853 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2849 some old hacks and clean up a bit other routines; code should be
2854 some old hacks and clean up a bit other routines; code should be
2850 simpler and a bit faster.
2855 simpler and a bit faster.
2851
2856
2852 * IPython/iplib.py (interact): removed some last-resort attempts
2857 * IPython/iplib.py (interact): removed some last-resort attempts
2853 to survive broken stdout/stderr. That code was only making it
2858 to survive broken stdout/stderr. That code was only making it
2854 harder to abstract out the i/o (necessary for gui integration),
2859 harder to abstract out the i/o (necessary for gui integration),
2855 and the crashes it could prevent were extremely rare in practice
2860 and the crashes it could prevent were extremely rare in practice
2856 (besides being fully user-induced in a pretty violent manner).
2861 (besides being fully user-induced in a pretty violent manner).
2857
2862
2858 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2863 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2859 Nothing major yet, but the code is simpler to read; this should
2864 Nothing major yet, but the code is simpler to read; this should
2860 make it easier to do more serious modifications in the future.
2865 make it easier to do more serious modifications in the future.
2861
2866
2862 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2867 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2863 which broke in .15 (thanks to a report by Ville).
2868 which broke in .15 (thanks to a report by Ville).
2864
2869
2865 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2870 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2866 be quite correct, I know next to nothing about unicode). This
2871 be quite correct, I know next to nothing about unicode). This
2867 will allow unicode strings to be used in prompts, amongst other
2872 will allow unicode strings to be used in prompts, amongst other
2868 cases. It also will prevent ipython from crashing when unicode
2873 cases. It also will prevent ipython from crashing when unicode
2869 shows up unexpectedly in many places. If ascii encoding fails, we
2874 shows up unexpectedly in many places. If ascii encoding fails, we
2870 assume utf_8. Currently the encoding is not a user-visible
2875 assume utf_8. Currently the encoding is not a user-visible
2871 setting, though it could be made so if there is demand for it.
2876 setting, though it could be made so if there is demand for it.
2872
2877
2873 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2878 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2874
2879
2875 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2880 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2876
2881
2877 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2882 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2878
2883
2879 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2884 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2880 code can work transparently for 2.2/2.3.
2885 code can work transparently for 2.2/2.3.
2881
2886
2882 2005-07-16 Fernando Perez <fperez@colorado.edu>
2887 2005-07-16 Fernando Perez <fperez@colorado.edu>
2883
2888
2884 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2889 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2885 out of the color scheme table used for coloring exception
2890 out of the color scheme table used for coloring exception
2886 tracebacks. This allows user code to add new schemes at runtime.
2891 tracebacks. This allows user code to add new schemes at runtime.
2887 This is a minimally modified version of the patch at
2892 This is a minimally modified version of the patch at
2888 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2893 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2889 for the contribution.
2894 for the contribution.
2890
2895
2891 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2896 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2892 slightly modified version of the patch in
2897 slightly modified version of the patch in
2893 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2898 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2894 to remove the previous try/except solution (which was costlier).
2899 to remove the previous try/except solution (which was costlier).
2895 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2900 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2896
2901
2897 2005-06-08 Fernando Perez <fperez@colorado.edu>
2902 2005-06-08 Fernando Perez <fperez@colorado.edu>
2898
2903
2899 * IPython/iplib.py (write/write_err): Add methods to abstract all
2904 * IPython/iplib.py (write/write_err): Add methods to abstract all
2900 I/O a bit more.
2905 I/O a bit more.
2901
2906
2902 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2907 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2903 warning, reported by Aric Hagberg, fix by JD Hunter.
2908 warning, reported by Aric Hagberg, fix by JD Hunter.
2904
2909
2905 2005-06-02 *** Released version 0.6.15
2910 2005-06-02 *** Released version 0.6.15
2906
2911
2907 2005-06-01 Fernando Perez <fperez@colorado.edu>
2912 2005-06-01 Fernando Perez <fperez@colorado.edu>
2908
2913
2909 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2914 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2910 tab-completion of filenames within open-quoted strings. Note that
2915 tab-completion of filenames within open-quoted strings. Note that
2911 this requires that in ~/.ipython/ipythonrc, users change the
2916 this requires that in ~/.ipython/ipythonrc, users change the
2912 readline delimiters configuration to read:
2917 readline delimiters configuration to read:
2913
2918
2914 readline_remove_delims -/~
2919 readline_remove_delims -/~
2915
2920
2916
2921
2917 2005-05-31 *** Released version 0.6.14
2922 2005-05-31 *** Released version 0.6.14
2918
2923
2919 2005-05-29 Fernando Perez <fperez@colorado.edu>
2924 2005-05-29 Fernando Perez <fperez@colorado.edu>
2920
2925
2921 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2926 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2922 with files not on the filesystem. Reported by Eliyahu Sandler
2927 with files not on the filesystem. Reported by Eliyahu Sandler
2923 <eli@gondolin.net>
2928 <eli@gondolin.net>
2924
2929
2925 2005-05-22 Fernando Perez <fperez@colorado.edu>
2930 2005-05-22 Fernando Perez <fperez@colorado.edu>
2926
2931
2927 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2932 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2928 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2933 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2929
2934
2930 2005-05-19 Fernando Perez <fperez@colorado.edu>
2935 2005-05-19 Fernando Perez <fperez@colorado.edu>
2931
2936
2932 * IPython/iplib.py (safe_execfile): close a file which could be
2937 * IPython/iplib.py (safe_execfile): close a file which could be
2933 left open (causing problems in win32, which locks open files).
2938 left open (causing problems in win32, which locks open files).
2934 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2939 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2935
2940
2936 2005-05-18 Fernando Perez <fperez@colorado.edu>
2941 2005-05-18 Fernando Perez <fperez@colorado.edu>
2937
2942
2938 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2943 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2939 keyword arguments correctly to safe_execfile().
2944 keyword arguments correctly to safe_execfile().
2940
2945
2941 2005-05-13 Fernando Perez <fperez@colorado.edu>
2946 2005-05-13 Fernando Perez <fperez@colorado.edu>
2942
2947
2943 * ipython.1: Added info about Qt to manpage, and threads warning
2948 * ipython.1: Added info about Qt to manpage, and threads warning
2944 to usage page (invoked with --help).
2949 to usage page (invoked with --help).
2945
2950
2946 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2951 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2947 new matcher (it goes at the end of the priority list) to do
2952 new matcher (it goes at the end of the priority list) to do
2948 tab-completion on named function arguments. Submitted by George
2953 tab-completion on named function arguments. Submitted by George
2949 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2954 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2950 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2955 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2951 for more details.
2956 for more details.
2952
2957
2953 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2958 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2954 SystemExit exceptions in the script being run. Thanks to a report
2959 SystemExit exceptions in the script being run. Thanks to a report
2955 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2960 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2956 producing very annoying behavior when running unit tests.
2961 producing very annoying behavior when running unit tests.
2957
2962
2958 2005-05-12 Fernando Perez <fperez@colorado.edu>
2963 2005-05-12 Fernando Perez <fperez@colorado.edu>
2959
2964
2960 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2965 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2961 which I'd broken (again) due to a changed regexp. In the process,
2966 which I'd broken (again) due to a changed regexp. In the process,
2962 added ';' as an escape to auto-quote the whole line without
2967 added ';' as an escape to auto-quote the whole line without
2963 splitting its arguments. Thanks to a report by Jerry McRae
2968 splitting its arguments. Thanks to a report by Jerry McRae
2964 <qrs0xyc02-AT-sneakemail.com>.
2969 <qrs0xyc02-AT-sneakemail.com>.
2965
2970
2966 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2971 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2967 possible crashes caused by a TokenError. Reported by Ed Schofield
2972 possible crashes caused by a TokenError. Reported by Ed Schofield
2968 <schofield-AT-ftw.at>.
2973 <schofield-AT-ftw.at>.
2969
2974
2970 2005-05-06 Fernando Perez <fperez@colorado.edu>
2975 2005-05-06 Fernando Perez <fperez@colorado.edu>
2971
2976
2972 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2977 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2973
2978
2974 2005-04-29 Fernando Perez <fperez@colorado.edu>
2979 2005-04-29 Fernando Perez <fperez@colorado.edu>
2975
2980
2976 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2981 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2977 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2982 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2978 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2983 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2979 which provides support for Qt interactive usage (similar to the
2984 which provides support for Qt interactive usage (similar to the
2980 existing one for WX and GTK). This had been often requested.
2985 existing one for WX and GTK). This had been often requested.
2981
2986
2982 2005-04-14 *** Released version 0.6.13
2987 2005-04-14 *** Released version 0.6.13
2983
2988
2984 2005-04-08 Fernando Perez <fperez@colorado.edu>
2989 2005-04-08 Fernando Perez <fperez@colorado.edu>
2985
2990
2986 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2991 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2987 from _ofind, which gets called on almost every input line. Now,
2992 from _ofind, which gets called on almost every input line. Now,
2988 we only try to get docstrings if they are actually going to be
2993 we only try to get docstrings if they are actually going to be
2989 used (the overhead of fetching unnecessary docstrings can be
2994 used (the overhead of fetching unnecessary docstrings can be
2990 noticeable for certain objects, such as Pyro proxies).
2995 noticeable for certain objects, such as Pyro proxies).
2991
2996
2992 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2997 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2993 for completers. For some reason I had been passing them the state
2998 for completers. For some reason I had been passing them the state
2994 variable, which completers never actually need, and was in
2999 variable, which completers never actually need, and was in
2995 conflict with the rlcompleter API. Custom completers ONLY need to
3000 conflict with the rlcompleter API. Custom completers ONLY need to
2996 take the text parameter.
3001 take the text parameter.
2997
3002
2998 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3003 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2999 work correctly in pysh. I've also moved all the logic which used
3004 work correctly in pysh. I've also moved all the logic which used
3000 to be in pysh.py here, which will prevent problems with future
3005 to be in pysh.py here, which will prevent problems with future
3001 upgrades. However, this time I must warn users to update their
3006 upgrades. However, this time I must warn users to update their
3002 pysh profile to include the line
3007 pysh profile to include the line
3003
3008
3004 import_all IPython.Extensions.InterpreterExec
3009 import_all IPython.Extensions.InterpreterExec
3005
3010
3006 because otherwise things won't work for them. They MUST also
3011 because otherwise things won't work for them. They MUST also
3007 delete pysh.py and the line
3012 delete pysh.py and the line
3008
3013
3009 execfile pysh.py
3014 execfile pysh.py
3010
3015
3011 from their ipythonrc-pysh.
3016 from their ipythonrc-pysh.
3012
3017
3013 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3018 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3014 robust in the face of objects whose dir() returns non-strings
3019 robust in the face of objects whose dir() returns non-strings
3015 (which it shouldn't, but some broken libs like ITK do). Thanks to
3020 (which it shouldn't, but some broken libs like ITK do). Thanks to
3016 a patch by John Hunter (implemented differently, though). Also
3021 a patch by John Hunter (implemented differently, though). Also
3017 minor improvements by using .extend instead of + on lists.
3022 minor improvements by using .extend instead of + on lists.
3018
3023
3019 * pysh.py:
3024 * pysh.py:
3020
3025
3021 2005-04-06 Fernando Perez <fperez@colorado.edu>
3026 2005-04-06 Fernando Perez <fperez@colorado.edu>
3022
3027
3023 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3028 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3024 by default, so that all users benefit from it. Those who don't
3029 by default, so that all users benefit from it. Those who don't
3025 want it can still turn it off.
3030 want it can still turn it off.
3026
3031
3027 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3032 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3028 config file, I'd forgotten about this, so users were getting it
3033 config file, I'd forgotten about this, so users were getting it
3029 off by default.
3034 off by default.
3030
3035
3031 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3036 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3032 consistency. Now magics can be called in multiline statements,
3037 consistency. Now magics can be called in multiline statements,
3033 and python variables can be expanded in magic calls via $var.
3038 and python variables can be expanded in magic calls via $var.
3034 This makes the magic system behave just like aliases or !system
3039 This makes the magic system behave just like aliases or !system
3035 calls.
3040 calls.
3036
3041
3037 2005-03-28 Fernando Perez <fperez@colorado.edu>
3042 2005-03-28 Fernando Perez <fperez@colorado.edu>
3038
3043
3039 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3044 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3040 expensive string additions for building command. Add support for
3045 expensive string additions for building command. Add support for
3041 trailing ';' when autocall is used.
3046 trailing ';' when autocall is used.
3042
3047
3043 2005-03-26 Fernando Perez <fperez@colorado.edu>
3048 2005-03-26 Fernando Perez <fperez@colorado.edu>
3044
3049
3045 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3050 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3046 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3051 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3047 ipython.el robust against prompts with any number of spaces
3052 ipython.el robust against prompts with any number of spaces
3048 (including 0) after the ':' character.
3053 (including 0) after the ':' character.
3049
3054
3050 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3055 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3051 continuation prompt, which misled users to think the line was
3056 continuation prompt, which misled users to think the line was
3052 already indented. Closes debian Bug#300847, reported to me by
3057 already indented. Closes debian Bug#300847, reported to me by
3053 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3058 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3054
3059
3055 2005-03-23 Fernando Perez <fperez@colorado.edu>
3060 2005-03-23 Fernando Perez <fperez@colorado.edu>
3056
3061
3057 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3062 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3058 properly aligned if they have embedded newlines.
3063 properly aligned if they have embedded newlines.
3059
3064
3060 * IPython/iplib.py (runlines): Add a public method to expose
3065 * IPython/iplib.py (runlines): Add a public method to expose
3061 IPython's code execution machinery, so that users can run strings
3066 IPython's code execution machinery, so that users can run strings
3062 as if they had been typed at the prompt interactively.
3067 as if they had been typed at the prompt interactively.
3063 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3068 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3064 methods which can call the system shell, but with python variable
3069 methods which can call the system shell, but with python variable
3065 expansion. The three such methods are: __IPYTHON__.system,
3070 expansion. The three such methods are: __IPYTHON__.system,
3066 .getoutput and .getoutputerror. These need to be documented in a
3071 .getoutput and .getoutputerror. These need to be documented in a
3067 'public API' section (to be written) of the manual.
3072 'public API' section (to be written) of the manual.
3068
3073
3069 2005-03-20 Fernando Perez <fperez@colorado.edu>
3074 2005-03-20 Fernando Perez <fperez@colorado.edu>
3070
3075
3071 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3076 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3072 for custom exception handling. This is quite powerful, and it
3077 for custom exception handling. This is quite powerful, and it
3073 allows for user-installable exception handlers which can trap
3078 allows for user-installable exception handlers which can trap
3074 custom exceptions at runtime and treat them separately from
3079 custom exceptions at runtime and treat them separately from
3075 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3080 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3076 Mantegazza <mantegazza-AT-ill.fr>.
3081 Mantegazza <mantegazza-AT-ill.fr>.
3077 (InteractiveShell.set_custom_completer): public API function to
3082 (InteractiveShell.set_custom_completer): public API function to
3078 add new completers at runtime.
3083 add new completers at runtime.
3079
3084
3080 2005-03-19 Fernando Perez <fperez@colorado.edu>
3085 2005-03-19 Fernando Perez <fperez@colorado.edu>
3081
3086
3082 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3087 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3083 allow objects which provide their docstrings via non-standard
3088 allow objects which provide their docstrings via non-standard
3084 mechanisms (like Pyro proxies) to still be inspected by ipython's
3089 mechanisms (like Pyro proxies) to still be inspected by ipython's
3085 ? system.
3090 ? system.
3086
3091
3087 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3092 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3088 automatic capture system. I tried quite hard to make it work
3093 automatic capture system. I tried quite hard to make it work
3089 reliably, and simply failed. I tried many combinations with the
3094 reliably, and simply failed. I tried many combinations with the
3090 subprocess module, but eventually nothing worked in all needed
3095 subprocess module, but eventually nothing worked in all needed
3091 cases (not blocking stdin for the child, duplicating stdout
3096 cases (not blocking stdin for the child, duplicating stdout
3092 without blocking, etc). The new %sc/%sx still do capture to these
3097 without blocking, etc). The new %sc/%sx still do capture to these
3093 magical list/string objects which make shell use much more
3098 magical list/string objects which make shell use much more
3094 conveninent, so not all is lost.
3099 conveninent, so not all is lost.
3095
3100
3096 XXX - FIX MANUAL for the change above!
3101 XXX - FIX MANUAL for the change above!
3097
3102
3098 (runsource): I copied code.py's runsource() into ipython to modify
3103 (runsource): I copied code.py's runsource() into ipython to modify
3099 it a bit. Now the code object and source to be executed are
3104 it a bit. Now the code object and source to be executed are
3100 stored in ipython. This makes this info accessible to third-party
3105 stored in ipython. This makes this info accessible to third-party
3101 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3106 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3102 Mantegazza <mantegazza-AT-ill.fr>.
3107 Mantegazza <mantegazza-AT-ill.fr>.
3103
3108
3104 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3109 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3105 history-search via readline (like C-p/C-n). I'd wanted this for a
3110 history-search via readline (like C-p/C-n). I'd wanted this for a
3106 long time, but only recently found out how to do it. For users
3111 long time, but only recently found out how to do it. For users
3107 who already have their ipythonrc files made and want this, just
3112 who already have their ipythonrc files made and want this, just
3108 add:
3113 add:
3109
3114
3110 readline_parse_and_bind "\e[A": history-search-backward
3115 readline_parse_and_bind "\e[A": history-search-backward
3111 readline_parse_and_bind "\e[B": history-search-forward
3116 readline_parse_and_bind "\e[B": history-search-forward
3112
3117
3113 2005-03-18 Fernando Perez <fperez@colorado.edu>
3118 2005-03-18 Fernando Perez <fperez@colorado.edu>
3114
3119
3115 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3120 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3116 LSString and SList classes which allow transparent conversions
3121 LSString and SList classes which allow transparent conversions
3117 between list mode and whitespace-separated string.
3122 between list mode and whitespace-separated string.
3118 (magic_r): Fix recursion problem in %r.
3123 (magic_r): Fix recursion problem in %r.
3119
3124
3120 * IPython/genutils.py (LSString): New class to be used for
3125 * IPython/genutils.py (LSString): New class to be used for
3121 automatic storage of the results of all alias/system calls in _o
3126 automatic storage of the results of all alias/system calls in _o
3122 and _e (stdout/err). These provide a .l/.list attribute which
3127 and _e (stdout/err). These provide a .l/.list attribute which
3123 does automatic splitting on newlines. This means that for most
3128 does automatic splitting on newlines. This means that for most
3124 uses, you'll never need to do capturing of output with %sc/%sx
3129 uses, you'll never need to do capturing of output with %sc/%sx
3125 anymore, since ipython keeps this always done for you. Note that
3130 anymore, since ipython keeps this always done for you. Note that
3126 only the LAST results are stored, the _o/e variables are
3131 only the LAST results are stored, the _o/e variables are
3127 overwritten on each call. If you need to save their contents
3132 overwritten on each call. If you need to save their contents
3128 further, simply bind them to any other name.
3133 further, simply bind them to any other name.
3129
3134
3130 2005-03-17 Fernando Perez <fperez@colorado.edu>
3135 2005-03-17 Fernando Perez <fperez@colorado.edu>
3131
3136
3132 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3137 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3133 prompt namespace handling.
3138 prompt namespace handling.
3134
3139
3135 2005-03-16 Fernando Perez <fperez@colorado.edu>
3140 2005-03-16 Fernando Perez <fperez@colorado.edu>
3136
3141
3137 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3142 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3138 classic prompts to be '>>> ' (final space was missing, and it
3143 classic prompts to be '>>> ' (final space was missing, and it
3139 trips the emacs python mode).
3144 trips the emacs python mode).
3140 (BasePrompt.__str__): Added safe support for dynamic prompt
3145 (BasePrompt.__str__): Added safe support for dynamic prompt
3141 strings. Now you can set your prompt string to be '$x', and the
3146 strings. Now you can set your prompt string to be '$x', and the
3142 value of x will be printed from your interactive namespace. The
3147 value of x will be printed from your interactive namespace. The
3143 interpolation syntax includes the full Itpl support, so
3148 interpolation syntax includes the full Itpl support, so
3144 ${foo()+x+bar()} is a valid prompt string now, and the function
3149 ${foo()+x+bar()} is a valid prompt string now, and the function
3145 calls will be made at runtime.
3150 calls will be made at runtime.
3146
3151
3147 2005-03-15 Fernando Perez <fperez@colorado.edu>
3152 2005-03-15 Fernando Perez <fperez@colorado.edu>
3148
3153
3149 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3154 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3150 avoid name clashes in pylab. %hist still works, it just forwards
3155 avoid name clashes in pylab. %hist still works, it just forwards
3151 the call to %history.
3156 the call to %history.
3152
3157
3153 2005-03-02 *** Released version 0.6.12
3158 2005-03-02 *** Released version 0.6.12
3154
3159
3155 2005-03-02 Fernando Perez <fperez@colorado.edu>
3160 2005-03-02 Fernando Perez <fperez@colorado.edu>
3156
3161
3157 * IPython/iplib.py (handle_magic): log magic calls properly as
3162 * IPython/iplib.py (handle_magic): log magic calls properly as
3158 ipmagic() function calls.
3163 ipmagic() function calls.
3159
3164
3160 * IPython/Magic.py (magic_time): Improved %time to support
3165 * IPython/Magic.py (magic_time): Improved %time to support
3161 statements and provide wall-clock as well as CPU time.
3166 statements and provide wall-clock as well as CPU time.
3162
3167
3163 2005-02-27 Fernando Perez <fperez@colorado.edu>
3168 2005-02-27 Fernando Perez <fperez@colorado.edu>
3164
3169
3165 * IPython/hooks.py: New hooks module, to expose user-modifiable
3170 * IPython/hooks.py: New hooks module, to expose user-modifiable
3166 IPython functionality in a clean manner. For now only the editor
3171 IPython functionality in a clean manner. For now only the editor
3167 hook is actually written, and other thigns which I intend to turn
3172 hook is actually written, and other thigns which I intend to turn
3168 into proper hooks aren't yet there. The display and prefilter
3173 into proper hooks aren't yet there. The display and prefilter
3169 stuff, for example, should be hooks. But at least now the
3174 stuff, for example, should be hooks. But at least now the
3170 framework is in place, and the rest can be moved here with more
3175 framework is in place, and the rest can be moved here with more
3171 time later. IPython had had a .hooks variable for a long time for
3176 time later. IPython had had a .hooks variable for a long time for
3172 this purpose, but I'd never actually used it for anything.
3177 this purpose, but I'd never actually used it for anything.
3173
3178
3174 2005-02-26 Fernando Perez <fperez@colorado.edu>
3179 2005-02-26 Fernando Perez <fperez@colorado.edu>
3175
3180
3176 * IPython/ipmaker.py (make_IPython): make the default ipython
3181 * IPython/ipmaker.py (make_IPython): make the default ipython
3177 directory be called _ipython under win32, to follow more the
3182 directory be called _ipython under win32, to follow more the
3178 naming peculiarities of that platform (where buggy software like
3183 naming peculiarities of that platform (where buggy software like
3179 Visual Sourcesafe breaks with .named directories). Reported by
3184 Visual Sourcesafe breaks with .named directories). Reported by
3180 Ville Vainio.
3185 Ville Vainio.
3181
3186
3182 2005-02-23 Fernando Perez <fperez@colorado.edu>
3187 2005-02-23 Fernando Perez <fperez@colorado.edu>
3183
3188
3184 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3189 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3185 auto_aliases for win32 which were causing problems. Users can
3190 auto_aliases for win32 which were causing problems. Users can
3186 define the ones they personally like.
3191 define the ones they personally like.
3187
3192
3188 2005-02-21 Fernando Perez <fperez@colorado.edu>
3193 2005-02-21 Fernando Perez <fperez@colorado.edu>
3189
3194
3190 * IPython/Magic.py (magic_time): new magic to time execution of
3195 * IPython/Magic.py (magic_time): new magic to time execution of
3191 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3196 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3192
3197
3193 2005-02-19 Fernando Perez <fperez@colorado.edu>
3198 2005-02-19 Fernando Perez <fperez@colorado.edu>
3194
3199
3195 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3200 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3196 into keys (for prompts, for example).
3201 into keys (for prompts, for example).
3197
3202
3198 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3203 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3199 prompts in case users want them. This introduces a small behavior
3204 prompts in case users want them. This introduces a small behavior
3200 change: ipython does not automatically add a space to all prompts
3205 change: ipython does not automatically add a space to all prompts
3201 anymore. To get the old prompts with a space, users should add it
3206 anymore. To get the old prompts with a space, users should add it
3202 manually to their ipythonrc file, so for example prompt_in1 should
3207 manually to their ipythonrc file, so for example prompt_in1 should
3203 now read 'In [\#]: ' instead of 'In [\#]:'.
3208 now read 'In [\#]: ' instead of 'In [\#]:'.
3204 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3209 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3205 file) to control left-padding of secondary prompts.
3210 file) to control left-padding of secondary prompts.
3206
3211
3207 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3212 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3208 the profiler can't be imported. Fix for Debian, which removed
3213 the profiler can't be imported. Fix for Debian, which removed
3209 profile.py because of License issues. I applied a slightly
3214 profile.py because of License issues. I applied a slightly
3210 modified version of the original Debian patch at
3215 modified version of the original Debian patch at
3211 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3216 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3212
3217
3213 2005-02-17 Fernando Perez <fperez@colorado.edu>
3218 2005-02-17 Fernando Perez <fperez@colorado.edu>
3214
3219
3215 * IPython/genutils.py (native_line_ends): Fix bug which would
3220 * IPython/genutils.py (native_line_ends): Fix bug which would
3216 cause improper line-ends under win32 b/c I was not opening files
3221 cause improper line-ends under win32 b/c I was not opening files
3217 in binary mode. Bug report and fix thanks to Ville.
3222 in binary mode. Bug report and fix thanks to Ville.
3218
3223
3219 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3224 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3220 trying to catch spurious foo[1] autocalls. My fix actually broke
3225 trying to catch spurious foo[1] autocalls. My fix actually broke
3221 ',/' autoquote/call with explicit escape (bad regexp).
3226 ',/' autoquote/call with explicit escape (bad regexp).
3222
3227
3223 2005-02-15 *** Released version 0.6.11
3228 2005-02-15 *** Released version 0.6.11
3224
3229
3225 2005-02-14 Fernando Perez <fperez@colorado.edu>
3230 2005-02-14 Fernando Perez <fperez@colorado.edu>
3226
3231
3227 * IPython/background_jobs.py: New background job management
3232 * IPython/background_jobs.py: New background job management
3228 subsystem. This is implemented via a new set of classes, and
3233 subsystem. This is implemented via a new set of classes, and
3229 IPython now provides a builtin 'jobs' object for background job
3234 IPython now provides a builtin 'jobs' object for background job
3230 execution. A convenience %bg magic serves as a lightweight
3235 execution. A convenience %bg magic serves as a lightweight
3231 frontend for starting the more common type of calls. This was
3236 frontend for starting the more common type of calls. This was
3232 inspired by discussions with B. Granger and the BackgroundCommand
3237 inspired by discussions with B. Granger and the BackgroundCommand
3233 class described in the book Python Scripting for Computational
3238 class described in the book Python Scripting for Computational
3234 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3239 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3235 (although ultimately no code from this text was used, as IPython's
3240 (although ultimately no code from this text was used, as IPython's
3236 system is a separate implementation).
3241 system is a separate implementation).
3237
3242
3238 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3243 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3239 to control the completion of single/double underscore names
3244 to control the completion of single/double underscore names
3240 separately. As documented in the example ipytonrc file, the
3245 separately. As documented in the example ipytonrc file, the
3241 readline_omit__names variable can now be set to 2, to omit even
3246 readline_omit__names variable can now be set to 2, to omit even
3242 single underscore names. Thanks to a patch by Brian Wong
3247 single underscore names. Thanks to a patch by Brian Wong
3243 <BrianWong-AT-AirgoNetworks.Com>.
3248 <BrianWong-AT-AirgoNetworks.Com>.
3244 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3249 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3245 be autocalled as foo([1]) if foo were callable. A problem for
3250 be autocalled as foo([1]) if foo were callable. A problem for
3246 things which are both callable and implement __getitem__.
3251 things which are both callable and implement __getitem__.
3247 (init_readline): Fix autoindentation for win32. Thanks to a patch
3252 (init_readline): Fix autoindentation for win32. Thanks to a patch
3248 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3253 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3249
3254
3250 2005-02-12 Fernando Perez <fperez@colorado.edu>
3255 2005-02-12 Fernando Perez <fperez@colorado.edu>
3251
3256
3252 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3257 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3253 which I had written long ago to sort out user error messages which
3258 which I had written long ago to sort out user error messages which
3254 may occur during startup. This seemed like a good idea initially,
3259 may occur during startup. This seemed like a good idea initially,
3255 but it has proven a disaster in retrospect. I don't want to
3260 but it has proven a disaster in retrospect. I don't want to
3256 change much code for now, so my fix is to set the internal 'debug'
3261 change much code for now, so my fix is to set the internal 'debug'
3257 flag to true everywhere, whose only job was precisely to control
3262 flag to true everywhere, whose only job was precisely to control
3258 this subsystem. This closes issue 28 (as well as avoiding all
3263 this subsystem. This closes issue 28 (as well as avoiding all
3259 sorts of strange hangups which occur from time to time).
3264 sorts of strange hangups which occur from time to time).
3260
3265
3261 2005-02-07 Fernando Perez <fperez@colorado.edu>
3266 2005-02-07 Fernando Perez <fperez@colorado.edu>
3262
3267
3263 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3268 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3264 previous call produced a syntax error.
3269 previous call produced a syntax error.
3265
3270
3266 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3271 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3267 classes without constructor.
3272 classes without constructor.
3268
3273
3269 2005-02-06 Fernando Perez <fperez@colorado.edu>
3274 2005-02-06 Fernando Perez <fperez@colorado.edu>
3270
3275
3271 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3276 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3272 completions with the results of each matcher, so we return results
3277 completions with the results of each matcher, so we return results
3273 to the user from all namespaces. This breaks with ipython
3278 to the user from all namespaces. This breaks with ipython
3274 tradition, but I think it's a nicer behavior. Now you get all
3279 tradition, but I think it's a nicer behavior. Now you get all
3275 possible completions listed, from all possible namespaces (python,
3280 possible completions listed, from all possible namespaces (python,
3276 filesystem, magics...) After a request by John Hunter
3281 filesystem, magics...) After a request by John Hunter
3277 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3282 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3278
3283
3279 2005-02-05 Fernando Perez <fperez@colorado.edu>
3284 2005-02-05 Fernando Perez <fperez@colorado.edu>
3280
3285
3281 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3286 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3282 the call had quote characters in it (the quotes were stripped).
3287 the call had quote characters in it (the quotes were stripped).
3283
3288
3284 2005-01-31 Fernando Perez <fperez@colorado.edu>
3289 2005-01-31 Fernando Perez <fperez@colorado.edu>
3285
3290
3286 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3291 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3287 Itpl.itpl() to make the code more robust against psyco
3292 Itpl.itpl() to make the code more robust against psyco
3288 optimizations.
3293 optimizations.
3289
3294
3290 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3295 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3291 of causing an exception. Quicker, cleaner.
3296 of causing an exception. Quicker, cleaner.
3292
3297
3293 2005-01-28 Fernando Perez <fperez@colorado.edu>
3298 2005-01-28 Fernando Perez <fperez@colorado.edu>
3294
3299
3295 * scripts/ipython_win_post_install.py (install): hardcode
3300 * scripts/ipython_win_post_install.py (install): hardcode
3296 sys.prefix+'python.exe' as the executable path. It turns out that
3301 sys.prefix+'python.exe' as the executable path. It turns out that
3297 during the post-installation run, sys.executable resolves to the
3302 during the post-installation run, sys.executable resolves to the
3298 name of the binary installer! I should report this as a distutils
3303 name of the binary installer! I should report this as a distutils
3299 bug, I think. I updated the .10 release with this tiny fix, to
3304 bug, I think. I updated the .10 release with this tiny fix, to
3300 avoid annoying the lists further.
3305 avoid annoying the lists further.
3301
3306
3302 2005-01-27 *** Released version 0.6.10
3307 2005-01-27 *** Released version 0.6.10
3303
3308
3304 2005-01-27 Fernando Perez <fperez@colorado.edu>
3309 2005-01-27 Fernando Perez <fperez@colorado.edu>
3305
3310
3306 * IPython/numutils.py (norm): Added 'inf' as optional name for
3311 * IPython/numutils.py (norm): Added 'inf' as optional name for
3307 L-infinity norm, included references to mathworld.com for vector
3312 L-infinity norm, included references to mathworld.com for vector
3308 norm definitions.
3313 norm definitions.
3309 (amin/amax): added amin/amax for array min/max. Similar to what
3314 (amin/amax): added amin/amax for array min/max. Similar to what
3310 pylab ships with after the recent reorganization of names.
3315 pylab ships with after the recent reorganization of names.
3311 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3316 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3312
3317
3313 * ipython.el: committed Alex's recent fixes and improvements.
3318 * ipython.el: committed Alex's recent fixes and improvements.
3314 Tested with python-mode from CVS, and it looks excellent. Since
3319 Tested with python-mode from CVS, and it looks excellent. Since
3315 python-mode hasn't released anything in a while, I'm temporarily
3320 python-mode hasn't released anything in a while, I'm temporarily
3316 putting a copy of today's CVS (v 4.70) of python-mode in:
3321 putting a copy of today's CVS (v 4.70) of python-mode in:
3317 http://ipython.scipy.org/tmp/python-mode.el
3322 http://ipython.scipy.org/tmp/python-mode.el
3318
3323
3319 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3324 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3320 sys.executable for the executable name, instead of assuming it's
3325 sys.executable for the executable name, instead of assuming it's
3321 called 'python.exe' (the post-installer would have produced broken
3326 called 'python.exe' (the post-installer would have produced broken
3322 setups on systems with a differently named python binary).
3327 setups on systems with a differently named python binary).
3323
3328
3324 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3329 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3325 references to os.linesep, to make the code more
3330 references to os.linesep, to make the code more
3326 platform-independent. This is also part of the win32 coloring
3331 platform-independent. This is also part of the win32 coloring
3327 fixes.
3332 fixes.
3328
3333
3329 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3334 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3330 lines, which actually cause coloring bugs because the length of
3335 lines, which actually cause coloring bugs because the length of
3331 the line is very difficult to correctly compute with embedded
3336 the line is very difficult to correctly compute with embedded
3332 escapes. This was the source of all the coloring problems under
3337 escapes. This was the source of all the coloring problems under
3333 Win32. I think that _finally_, Win32 users have a properly
3338 Win32. I think that _finally_, Win32 users have a properly
3334 working ipython in all respects. This would never have happened
3339 working ipython in all respects. This would never have happened
3335 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3340 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3336
3341
3337 2005-01-26 *** Released version 0.6.9
3342 2005-01-26 *** Released version 0.6.9
3338
3343
3339 2005-01-25 Fernando Perez <fperez@colorado.edu>
3344 2005-01-25 Fernando Perez <fperez@colorado.edu>
3340
3345
3341 * setup.py: finally, we have a true Windows installer, thanks to
3346 * setup.py: finally, we have a true Windows installer, thanks to
3342 the excellent work of Viktor Ransmayr
3347 the excellent work of Viktor Ransmayr
3343 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3348 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3344 Windows users. The setup routine is quite a bit cleaner thanks to
3349 Windows users. The setup routine is quite a bit cleaner thanks to
3345 this, and the post-install script uses the proper functions to
3350 this, and the post-install script uses the proper functions to
3346 allow a clean de-installation using the standard Windows Control
3351 allow a clean de-installation using the standard Windows Control
3347 Panel.
3352 Panel.
3348
3353
3349 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3354 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3350 environment variable under all OSes (including win32) if
3355 environment variable under all OSes (including win32) if
3351 available. This will give consistency to win32 users who have set
3356 available. This will give consistency to win32 users who have set
3352 this variable for any reason. If os.environ['HOME'] fails, the
3357 this variable for any reason. If os.environ['HOME'] fails, the
3353 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3358 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3354
3359
3355 2005-01-24 Fernando Perez <fperez@colorado.edu>
3360 2005-01-24 Fernando Perez <fperez@colorado.edu>
3356
3361
3357 * IPython/numutils.py (empty_like): add empty_like(), similar to
3362 * IPython/numutils.py (empty_like): add empty_like(), similar to
3358 zeros_like() but taking advantage of the new empty() Numeric routine.
3363 zeros_like() but taking advantage of the new empty() Numeric routine.
3359
3364
3360 2005-01-23 *** Released version 0.6.8
3365 2005-01-23 *** Released version 0.6.8
3361
3366
3362 2005-01-22 Fernando Perez <fperez@colorado.edu>
3367 2005-01-22 Fernando Perez <fperez@colorado.edu>
3363
3368
3364 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3369 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3365 automatic show() calls. After discussing things with JDH, it
3370 automatic show() calls. After discussing things with JDH, it
3366 turns out there are too many corner cases where this can go wrong.
3371 turns out there are too many corner cases where this can go wrong.
3367 It's best not to try to be 'too smart', and simply have ipython
3372 It's best not to try to be 'too smart', and simply have ipython
3368 reproduce as much as possible the default behavior of a normal
3373 reproduce as much as possible the default behavior of a normal
3369 python shell.
3374 python shell.
3370
3375
3371 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3376 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3372 line-splitting regexp and _prefilter() to avoid calling getattr()
3377 line-splitting regexp and _prefilter() to avoid calling getattr()
3373 on assignments. This closes
3378 on assignments. This closes
3374 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3379 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3375 readline uses getattr(), so a simple <TAB> keypress is still
3380 readline uses getattr(), so a simple <TAB> keypress is still
3376 enough to trigger getattr() calls on an object.
3381 enough to trigger getattr() calls on an object.
3377
3382
3378 2005-01-21 Fernando Perez <fperez@colorado.edu>
3383 2005-01-21 Fernando Perez <fperez@colorado.edu>
3379
3384
3380 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3385 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3381 docstring under pylab so it doesn't mask the original.
3386 docstring under pylab so it doesn't mask the original.
3382
3387
3383 2005-01-21 *** Released version 0.6.7
3388 2005-01-21 *** Released version 0.6.7
3384
3389
3385 2005-01-21 Fernando Perez <fperez@colorado.edu>
3390 2005-01-21 Fernando Perez <fperez@colorado.edu>
3386
3391
3387 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3392 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3388 signal handling for win32 users in multithreaded mode.
3393 signal handling for win32 users in multithreaded mode.
3389
3394
3390 2005-01-17 Fernando Perez <fperez@colorado.edu>
3395 2005-01-17 Fernando Perez <fperez@colorado.edu>
3391
3396
3392 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3397 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3393 instances with no __init__. After a crash report by Norbert Nemec
3398 instances with no __init__. After a crash report by Norbert Nemec
3394 <Norbert-AT-nemec-online.de>.
3399 <Norbert-AT-nemec-online.de>.
3395
3400
3396 2005-01-14 Fernando Perez <fperez@colorado.edu>
3401 2005-01-14 Fernando Perez <fperez@colorado.edu>
3397
3402
3398 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3403 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3399 names for verbose exceptions, when multiple dotted names and the
3404 names for verbose exceptions, when multiple dotted names and the
3400 'parent' object were present on the same line.
3405 'parent' object were present on the same line.
3401
3406
3402 2005-01-11 Fernando Perez <fperez@colorado.edu>
3407 2005-01-11 Fernando Perez <fperez@colorado.edu>
3403
3408
3404 * IPython/genutils.py (flag_calls): new utility to trap and flag
3409 * IPython/genutils.py (flag_calls): new utility to trap and flag
3405 calls in functions. I need it to clean up matplotlib support.
3410 calls in functions. I need it to clean up matplotlib support.
3406 Also removed some deprecated code in genutils.
3411 Also removed some deprecated code in genutils.
3407
3412
3408 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3413 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3409 that matplotlib scripts called with %run, which don't call show()
3414 that matplotlib scripts called with %run, which don't call show()
3410 themselves, still have their plotting windows open.
3415 themselves, still have their plotting windows open.
3411
3416
3412 2005-01-05 Fernando Perez <fperez@colorado.edu>
3417 2005-01-05 Fernando Perez <fperez@colorado.edu>
3413
3418
3414 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3419 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3415 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3420 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3416
3421
3417 2004-12-19 Fernando Perez <fperez@colorado.edu>
3422 2004-12-19 Fernando Perez <fperez@colorado.edu>
3418
3423
3419 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3424 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3420 parent_runcode, which was an eyesore. The same result can be
3425 parent_runcode, which was an eyesore. The same result can be
3421 obtained with Python's regular superclass mechanisms.
3426 obtained with Python's regular superclass mechanisms.
3422
3427
3423 2004-12-17 Fernando Perez <fperez@colorado.edu>
3428 2004-12-17 Fernando Perez <fperez@colorado.edu>
3424
3429
3425 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3430 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3426 reported by Prabhu.
3431 reported by Prabhu.
3427 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3432 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3428 sys.stderr) instead of explicitly calling sys.stderr. This helps
3433 sys.stderr) instead of explicitly calling sys.stderr. This helps
3429 maintain our I/O abstractions clean, for future GUI embeddings.
3434 maintain our I/O abstractions clean, for future GUI embeddings.
3430
3435
3431 * IPython/genutils.py (info): added new utility for sys.stderr
3436 * IPython/genutils.py (info): added new utility for sys.stderr
3432 unified info message handling (thin wrapper around warn()).
3437 unified info message handling (thin wrapper around warn()).
3433
3438
3434 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3439 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3435 composite (dotted) names on verbose exceptions.
3440 composite (dotted) names on verbose exceptions.
3436 (VerboseTB.nullrepr): harden against another kind of errors which
3441 (VerboseTB.nullrepr): harden against another kind of errors which
3437 Python's inspect module can trigger, and which were crashing
3442 Python's inspect module can trigger, and which were crashing
3438 IPython. Thanks to a report by Marco Lombardi
3443 IPython. Thanks to a report by Marco Lombardi
3439 <mlombard-AT-ma010192.hq.eso.org>.
3444 <mlombard-AT-ma010192.hq.eso.org>.
3440
3445
3441 2004-12-13 *** Released version 0.6.6
3446 2004-12-13 *** Released version 0.6.6
3442
3447
3443 2004-12-12 Fernando Perez <fperez@colorado.edu>
3448 2004-12-12 Fernando Perez <fperez@colorado.edu>
3444
3449
3445 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3450 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3446 generated by pygtk upon initialization if it was built without
3451 generated by pygtk upon initialization if it was built without
3447 threads (for matplotlib users). After a crash reported by
3452 threads (for matplotlib users). After a crash reported by
3448 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3453 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3449
3454
3450 * IPython/ipmaker.py (make_IPython): fix small bug in the
3455 * IPython/ipmaker.py (make_IPython): fix small bug in the
3451 import_some parameter for multiple imports.
3456 import_some parameter for multiple imports.
3452
3457
3453 * IPython/iplib.py (ipmagic): simplified the interface of
3458 * IPython/iplib.py (ipmagic): simplified the interface of
3454 ipmagic() to take a single string argument, just as it would be
3459 ipmagic() to take a single string argument, just as it would be
3455 typed at the IPython cmd line.
3460 typed at the IPython cmd line.
3456 (ipalias): Added new ipalias() with an interface identical to
3461 (ipalias): Added new ipalias() with an interface identical to
3457 ipmagic(). This completes exposing a pure python interface to the
3462 ipmagic(). This completes exposing a pure python interface to the
3458 alias and magic system, which can be used in loops or more complex
3463 alias and magic system, which can be used in loops or more complex
3459 code where IPython's automatic line mangling is not active.
3464 code where IPython's automatic line mangling is not active.
3460
3465
3461 * IPython/genutils.py (timing): changed interface of timing to
3466 * IPython/genutils.py (timing): changed interface of timing to
3462 simply run code once, which is the most common case. timings()
3467 simply run code once, which is the most common case. timings()
3463 remains unchanged, for the cases where you want multiple runs.
3468 remains unchanged, for the cases where you want multiple runs.
3464
3469
3465 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3470 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3466 bug where Python2.2 crashes with exec'ing code which does not end
3471 bug where Python2.2 crashes with exec'ing code which does not end
3467 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3472 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3468 before.
3473 before.
3469
3474
3470 2004-12-10 Fernando Perez <fperez@colorado.edu>
3475 2004-12-10 Fernando Perez <fperez@colorado.edu>
3471
3476
3472 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3477 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3473 -t to -T, to accomodate the new -t flag in %run (the %run and
3478 -t to -T, to accomodate the new -t flag in %run (the %run and
3474 %prun options are kind of intermixed, and it's not easy to change
3479 %prun options are kind of intermixed, and it's not easy to change
3475 this with the limitations of python's getopt).
3480 this with the limitations of python's getopt).
3476
3481
3477 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3482 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3478 the execution of scripts. It's not as fine-tuned as timeit.py,
3483 the execution of scripts. It's not as fine-tuned as timeit.py,
3479 but it works from inside ipython (and under 2.2, which lacks
3484 but it works from inside ipython (and under 2.2, which lacks
3480 timeit.py). Optionally a number of runs > 1 can be given for
3485 timeit.py). Optionally a number of runs > 1 can be given for
3481 timing very short-running code.
3486 timing very short-running code.
3482
3487
3483 * IPython/genutils.py (uniq_stable): new routine which returns a
3488 * IPython/genutils.py (uniq_stable): new routine which returns a
3484 list of unique elements in any iterable, but in stable order of
3489 list of unique elements in any iterable, but in stable order of
3485 appearance. I needed this for the ultraTB fixes, and it's a handy
3490 appearance. I needed this for the ultraTB fixes, and it's a handy
3486 utility.
3491 utility.
3487
3492
3488 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3493 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3489 dotted names in Verbose exceptions. This had been broken since
3494 dotted names in Verbose exceptions. This had been broken since
3490 the very start, now x.y will properly be printed in a Verbose
3495 the very start, now x.y will properly be printed in a Verbose
3491 traceback, instead of x being shown and y appearing always as an
3496 traceback, instead of x being shown and y appearing always as an
3492 'undefined global'. Getting this to work was a bit tricky,
3497 'undefined global'. Getting this to work was a bit tricky,
3493 because by default python tokenizers are stateless. Saved by
3498 because by default python tokenizers are stateless. Saved by
3494 python's ability to easily add a bit of state to an arbitrary
3499 python's ability to easily add a bit of state to an arbitrary
3495 function (without needing to build a full-blown callable object).
3500 function (without needing to build a full-blown callable object).
3496
3501
3497 Also big cleanup of this code, which had horrendous runtime
3502 Also big cleanup of this code, which had horrendous runtime
3498 lookups of zillions of attributes for colorization. Moved all
3503 lookups of zillions of attributes for colorization. Moved all
3499 this code into a few templates, which make it cleaner and quicker.
3504 this code into a few templates, which make it cleaner and quicker.
3500
3505
3501 Printout quality was also improved for Verbose exceptions: one
3506 Printout quality was also improved for Verbose exceptions: one
3502 variable per line, and memory addresses are printed (this can be
3507 variable per line, and memory addresses are printed (this can be
3503 quite handy in nasty debugging situations, which is what Verbose
3508 quite handy in nasty debugging situations, which is what Verbose
3504 is for).
3509 is for).
3505
3510
3506 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3511 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3507 the command line as scripts to be loaded by embedded instances.
3512 the command line as scripts to be loaded by embedded instances.
3508 Doing so has the potential for an infinite recursion if there are
3513 Doing so has the potential for an infinite recursion if there are
3509 exceptions thrown in the process. This fixes a strange crash
3514 exceptions thrown in the process. This fixes a strange crash
3510 reported by Philippe MULLER <muller-AT-irit.fr>.
3515 reported by Philippe MULLER <muller-AT-irit.fr>.
3511
3516
3512 2004-12-09 Fernando Perez <fperez@colorado.edu>
3517 2004-12-09 Fernando Perez <fperez@colorado.edu>
3513
3518
3514 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3519 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3515 to reflect new names in matplotlib, which now expose the
3520 to reflect new names in matplotlib, which now expose the
3516 matlab-compatible interface via a pylab module instead of the
3521 matlab-compatible interface via a pylab module instead of the
3517 'matlab' name. The new code is backwards compatible, so users of
3522 'matlab' name. The new code is backwards compatible, so users of
3518 all matplotlib versions are OK. Patch by J. Hunter.
3523 all matplotlib versions are OK. Patch by J. Hunter.
3519
3524
3520 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3525 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3521 of __init__ docstrings for instances (class docstrings are already
3526 of __init__ docstrings for instances (class docstrings are already
3522 automatically printed). Instances with customized docstrings
3527 automatically printed). Instances with customized docstrings
3523 (indep. of the class) are also recognized and all 3 separate
3528 (indep. of the class) are also recognized and all 3 separate
3524 docstrings are printed (instance, class, constructor). After some
3529 docstrings are printed (instance, class, constructor). After some
3525 comments/suggestions by J. Hunter.
3530 comments/suggestions by J. Hunter.
3526
3531
3527 2004-12-05 Fernando Perez <fperez@colorado.edu>
3532 2004-12-05 Fernando Perez <fperez@colorado.edu>
3528
3533
3529 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3534 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3530 warnings when tab-completion fails and triggers an exception.
3535 warnings when tab-completion fails and triggers an exception.
3531
3536
3532 2004-12-03 Fernando Perez <fperez@colorado.edu>
3537 2004-12-03 Fernando Perez <fperez@colorado.edu>
3533
3538
3534 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3539 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3535 be triggered when using 'run -p'. An incorrect option flag was
3540 be triggered when using 'run -p'. An incorrect option flag was
3536 being set ('d' instead of 'D').
3541 being set ('d' instead of 'D').
3537 (manpage): fix missing escaped \- sign.
3542 (manpage): fix missing escaped \- sign.
3538
3543
3539 2004-11-30 *** Released version 0.6.5
3544 2004-11-30 *** Released version 0.6.5
3540
3545
3541 2004-11-30 Fernando Perez <fperez@colorado.edu>
3546 2004-11-30 Fernando Perez <fperez@colorado.edu>
3542
3547
3543 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3548 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3544 setting with -d option.
3549 setting with -d option.
3545
3550
3546 * setup.py (docfiles): Fix problem where the doc glob I was using
3551 * setup.py (docfiles): Fix problem where the doc glob I was using
3547 was COMPLETELY BROKEN. It was giving the right files by pure
3552 was COMPLETELY BROKEN. It was giving the right files by pure
3548 accident, but failed once I tried to include ipython.el. Note:
3553 accident, but failed once I tried to include ipython.el. Note:
3549 glob() does NOT allow you to do exclusion on multiple endings!
3554 glob() does NOT allow you to do exclusion on multiple endings!
3550
3555
3551 2004-11-29 Fernando Perez <fperez@colorado.edu>
3556 2004-11-29 Fernando Perez <fperez@colorado.edu>
3552
3557
3553 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3558 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3554 the manpage as the source. Better formatting & consistency.
3559 the manpage as the source. Better formatting & consistency.
3555
3560
3556 * IPython/Magic.py (magic_run): Added new -d option, to run
3561 * IPython/Magic.py (magic_run): Added new -d option, to run
3557 scripts under the control of the python pdb debugger. Note that
3562 scripts under the control of the python pdb debugger. Note that
3558 this required changing the %prun option -d to -D, to avoid a clash
3563 this required changing the %prun option -d to -D, to avoid a clash
3559 (since %run must pass options to %prun, and getopt is too dumb to
3564 (since %run must pass options to %prun, and getopt is too dumb to
3560 handle options with string values with embedded spaces). Thanks
3565 handle options with string values with embedded spaces). Thanks
3561 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3566 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3562 (magic_who_ls): added type matching to %who and %whos, so that one
3567 (magic_who_ls): added type matching to %who and %whos, so that one
3563 can filter their output to only include variables of certain
3568 can filter their output to only include variables of certain
3564 types. Another suggestion by Matthew.
3569 types. Another suggestion by Matthew.
3565 (magic_whos): Added memory summaries in kb and Mb for arrays.
3570 (magic_whos): Added memory summaries in kb and Mb for arrays.
3566 (magic_who): Improve formatting (break lines every 9 vars).
3571 (magic_who): Improve formatting (break lines every 9 vars).
3567
3572
3568 2004-11-28 Fernando Perez <fperez@colorado.edu>
3573 2004-11-28 Fernando Perez <fperez@colorado.edu>
3569
3574
3570 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3575 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3571 cache when empty lines were present.
3576 cache when empty lines were present.
3572
3577
3573 2004-11-24 Fernando Perez <fperez@colorado.edu>
3578 2004-11-24 Fernando Perez <fperez@colorado.edu>
3574
3579
3575 * IPython/usage.py (__doc__): document the re-activated threading
3580 * IPython/usage.py (__doc__): document the re-activated threading
3576 options for WX and GTK.
3581 options for WX and GTK.
3577
3582
3578 2004-11-23 Fernando Perez <fperez@colorado.edu>
3583 2004-11-23 Fernando Perez <fperez@colorado.edu>
3579
3584
3580 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3585 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3581 the -wthread and -gthread options, along with a new -tk one to try
3586 the -wthread and -gthread options, along with a new -tk one to try
3582 and coordinate Tk threading with wx/gtk. The tk support is very
3587 and coordinate Tk threading with wx/gtk. The tk support is very
3583 platform dependent, since it seems to require Tcl and Tk to be
3588 platform dependent, since it seems to require Tcl and Tk to be
3584 built with threads (Fedora1/2 appears NOT to have it, but in
3589 built with threads (Fedora1/2 appears NOT to have it, but in
3585 Prabhu's Debian boxes it works OK). But even with some Tk
3590 Prabhu's Debian boxes it works OK). But even with some Tk
3586 limitations, this is a great improvement.
3591 limitations, this is a great improvement.
3587
3592
3588 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3593 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3589 info in user prompts. Patch by Prabhu.
3594 info in user prompts. Patch by Prabhu.
3590
3595
3591 2004-11-18 Fernando Perez <fperez@colorado.edu>
3596 2004-11-18 Fernando Perez <fperez@colorado.edu>
3592
3597
3593 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3598 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3594 EOFErrors and bail, to avoid infinite loops if a non-terminating
3599 EOFErrors and bail, to avoid infinite loops if a non-terminating
3595 file is fed into ipython. Patch submitted in issue 19 by user,
3600 file is fed into ipython. Patch submitted in issue 19 by user,
3596 many thanks.
3601 many thanks.
3597
3602
3598 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3603 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3599 autoquote/parens in continuation prompts, which can cause lots of
3604 autoquote/parens in continuation prompts, which can cause lots of
3600 problems. Closes roundup issue 20.
3605 problems. Closes roundup issue 20.
3601
3606
3602 2004-11-17 Fernando Perez <fperez@colorado.edu>
3607 2004-11-17 Fernando Perez <fperez@colorado.edu>
3603
3608
3604 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3609 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3605 reported as debian bug #280505. I'm not sure my local changelog
3610 reported as debian bug #280505. I'm not sure my local changelog
3606 entry has the proper debian format (Jack?).
3611 entry has the proper debian format (Jack?).
3607
3612
3608 2004-11-08 *** Released version 0.6.4
3613 2004-11-08 *** Released version 0.6.4
3609
3614
3610 2004-11-08 Fernando Perez <fperez@colorado.edu>
3615 2004-11-08 Fernando Perez <fperez@colorado.edu>
3611
3616
3612 * IPython/iplib.py (init_readline): Fix exit message for Windows
3617 * IPython/iplib.py (init_readline): Fix exit message for Windows
3613 when readline is active. Thanks to a report by Eric Jones
3618 when readline is active. Thanks to a report by Eric Jones
3614 <eric-AT-enthought.com>.
3619 <eric-AT-enthought.com>.
3615
3620
3616 2004-11-07 Fernando Perez <fperez@colorado.edu>
3621 2004-11-07 Fernando Perez <fperez@colorado.edu>
3617
3622
3618 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3623 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3619 sometimes seen by win2k/cygwin users.
3624 sometimes seen by win2k/cygwin users.
3620
3625
3621 2004-11-06 Fernando Perez <fperez@colorado.edu>
3626 2004-11-06 Fernando Perez <fperez@colorado.edu>
3622
3627
3623 * IPython/iplib.py (interact): Change the handling of %Exit from
3628 * IPython/iplib.py (interact): Change the handling of %Exit from
3624 trying to propagate a SystemExit to an internal ipython flag.
3629 trying to propagate a SystemExit to an internal ipython flag.
3625 This is less elegant than using Python's exception mechanism, but
3630 This is less elegant than using Python's exception mechanism, but
3626 I can't get that to work reliably with threads, so under -pylab
3631 I can't get that to work reliably with threads, so under -pylab
3627 %Exit was hanging IPython. Cross-thread exception handling is
3632 %Exit was hanging IPython. Cross-thread exception handling is
3628 really a bitch. Thaks to a bug report by Stephen Walton
3633 really a bitch. Thaks to a bug report by Stephen Walton
3629 <stephen.walton-AT-csun.edu>.
3634 <stephen.walton-AT-csun.edu>.
3630
3635
3631 2004-11-04 Fernando Perez <fperez@colorado.edu>
3636 2004-11-04 Fernando Perez <fperez@colorado.edu>
3632
3637
3633 * IPython/iplib.py (raw_input_original): store a pointer to the
3638 * IPython/iplib.py (raw_input_original): store a pointer to the
3634 true raw_input to harden against code which can modify it
3639 true raw_input to harden against code which can modify it
3635 (wx.py.PyShell does this and would otherwise crash ipython).
3640 (wx.py.PyShell does this and would otherwise crash ipython).
3636 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3641 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3637
3642
3638 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3643 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3639 Ctrl-C problem, which does not mess up the input line.
3644 Ctrl-C problem, which does not mess up the input line.
3640
3645
3641 2004-11-03 Fernando Perez <fperez@colorado.edu>
3646 2004-11-03 Fernando Perez <fperez@colorado.edu>
3642
3647
3643 * IPython/Release.py: Changed licensing to BSD, in all files.
3648 * IPython/Release.py: Changed licensing to BSD, in all files.
3644 (name): lowercase name for tarball/RPM release.
3649 (name): lowercase name for tarball/RPM release.
3645
3650
3646 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3651 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3647 use throughout ipython.
3652 use throughout ipython.
3648
3653
3649 * IPython/Magic.py (Magic._ofind): Switch to using the new
3654 * IPython/Magic.py (Magic._ofind): Switch to using the new
3650 OInspect.getdoc() function.
3655 OInspect.getdoc() function.
3651
3656
3652 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3657 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3653 of the line currently being canceled via Ctrl-C. It's extremely
3658 of the line currently being canceled via Ctrl-C. It's extremely
3654 ugly, but I don't know how to do it better (the problem is one of
3659 ugly, but I don't know how to do it better (the problem is one of
3655 handling cross-thread exceptions).
3660 handling cross-thread exceptions).
3656
3661
3657 2004-10-28 Fernando Perez <fperez@colorado.edu>
3662 2004-10-28 Fernando Perez <fperez@colorado.edu>
3658
3663
3659 * IPython/Shell.py (signal_handler): add signal handlers to trap
3664 * IPython/Shell.py (signal_handler): add signal handlers to trap
3660 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3665 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3661 report by Francesc Alted.
3666 report by Francesc Alted.
3662
3667
3663 2004-10-21 Fernando Perez <fperez@colorado.edu>
3668 2004-10-21 Fernando Perez <fperez@colorado.edu>
3664
3669
3665 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3670 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3666 to % for pysh syntax extensions.
3671 to % for pysh syntax extensions.
3667
3672
3668 2004-10-09 Fernando Perez <fperez@colorado.edu>
3673 2004-10-09 Fernando Perez <fperez@colorado.edu>
3669
3674
3670 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3675 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3671 arrays to print a more useful summary, without calling str(arr).
3676 arrays to print a more useful summary, without calling str(arr).
3672 This avoids the problem of extremely lengthy computations which
3677 This avoids the problem of extremely lengthy computations which
3673 occur if arr is large, and appear to the user as a system lockup
3678 occur if arr is large, and appear to the user as a system lockup
3674 with 100% cpu activity. After a suggestion by Kristian Sandberg
3679 with 100% cpu activity. After a suggestion by Kristian Sandberg
3675 <Kristian.Sandberg@colorado.edu>.
3680 <Kristian.Sandberg@colorado.edu>.
3676 (Magic.__init__): fix bug in global magic escapes not being
3681 (Magic.__init__): fix bug in global magic escapes not being
3677 correctly set.
3682 correctly set.
3678
3683
3679 2004-10-08 Fernando Perez <fperez@colorado.edu>
3684 2004-10-08 Fernando Perez <fperez@colorado.edu>
3680
3685
3681 * IPython/Magic.py (__license__): change to absolute imports of
3686 * IPython/Magic.py (__license__): change to absolute imports of
3682 ipython's own internal packages, to start adapting to the absolute
3687 ipython's own internal packages, to start adapting to the absolute
3683 import requirement of PEP-328.
3688 import requirement of PEP-328.
3684
3689
3685 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3690 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3686 files, and standardize author/license marks through the Release
3691 files, and standardize author/license marks through the Release
3687 module instead of having per/file stuff (except for files with
3692 module instead of having per/file stuff (except for files with
3688 particular licenses, like the MIT/PSF-licensed codes).
3693 particular licenses, like the MIT/PSF-licensed codes).
3689
3694
3690 * IPython/Debugger.py: remove dead code for python 2.1
3695 * IPython/Debugger.py: remove dead code for python 2.1
3691
3696
3692 2004-10-04 Fernando Perez <fperez@colorado.edu>
3697 2004-10-04 Fernando Perez <fperez@colorado.edu>
3693
3698
3694 * IPython/iplib.py (ipmagic): New function for accessing magics
3699 * IPython/iplib.py (ipmagic): New function for accessing magics
3695 via a normal python function call.
3700 via a normal python function call.
3696
3701
3697 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3702 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3698 from '@' to '%', to accomodate the new @decorator syntax of python
3703 from '@' to '%', to accomodate the new @decorator syntax of python
3699 2.4.
3704 2.4.
3700
3705
3701 2004-09-29 Fernando Perez <fperez@colorado.edu>
3706 2004-09-29 Fernando Perez <fperez@colorado.edu>
3702
3707
3703 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3708 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3704 matplotlib.use to prevent running scripts which try to switch
3709 matplotlib.use to prevent running scripts which try to switch
3705 interactive backends from within ipython. This will just crash
3710 interactive backends from within ipython. This will just crash
3706 the python interpreter, so we can't allow it (but a detailed error
3711 the python interpreter, so we can't allow it (but a detailed error
3707 is given to the user).
3712 is given to the user).
3708
3713
3709 2004-09-28 Fernando Perez <fperez@colorado.edu>
3714 2004-09-28 Fernando Perez <fperez@colorado.edu>
3710
3715
3711 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3716 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3712 matplotlib-related fixes so that using @run with non-matplotlib
3717 matplotlib-related fixes so that using @run with non-matplotlib
3713 scripts doesn't pop up spurious plot windows. This requires
3718 scripts doesn't pop up spurious plot windows. This requires
3714 matplotlib >= 0.63, where I had to make some changes as well.
3719 matplotlib >= 0.63, where I had to make some changes as well.
3715
3720
3716 * IPython/ipmaker.py (make_IPython): update version requirement to
3721 * IPython/ipmaker.py (make_IPython): update version requirement to
3717 python 2.2.
3722 python 2.2.
3718
3723
3719 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3724 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3720 banner arg for embedded customization.
3725 banner arg for embedded customization.
3721
3726
3722 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3727 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3723 explicit uses of __IP as the IPython's instance name. Now things
3728 explicit uses of __IP as the IPython's instance name. Now things
3724 are properly handled via the shell.name value. The actual code
3729 are properly handled via the shell.name value. The actual code
3725 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3730 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3726 is much better than before. I'll clean things completely when the
3731 is much better than before. I'll clean things completely when the
3727 magic stuff gets a real overhaul.
3732 magic stuff gets a real overhaul.
3728
3733
3729 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3734 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3730 minor changes to debian dir.
3735 minor changes to debian dir.
3731
3736
3732 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3737 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3733 pointer to the shell itself in the interactive namespace even when
3738 pointer to the shell itself in the interactive namespace even when
3734 a user-supplied dict is provided. This is needed for embedding
3739 a user-supplied dict is provided. This is needed for embedding
3735 purposes (found by tests with Michel Sanner).
3740 purposes (found by tests with Michel Sanner).
3736
3741
3737 2004-09-27 Fernando Perez <fperez@colorado.edu>
3742 2004-09-27 Fernando Perez <fperez@colorado.edu>
3738
3743
3739 * IPython/UserConfig/ipythonrc: remove []{} from
3744 * IPython/UserConfig/ipythonrc: remove []{} from
3740 readline_remove_delims, so that things like [modname.<TAB> do
3745 readline_remove_delims, so that things like [modname.<TAB> do
3741 proper completion. This disables [].TAB, but that's a less common
3746 proper completion. This disables [].TAB, but that's a less common
3742 case than module names in list comprehensions, for example.
3747 case than module names in list comprehensions, for example.
3743 Thanks to a report by Andrea Riciputi.
3748 Thanks to a report by Andrea Riciputi.
3744
3749
3745 2004-09-09 Fernando Perez <fperez@colorado.edu>
3750 2004-09-09 Fernando Perez <fperez@colorado.edu>
3746
3751
3747 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3752 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3748 blocking problems in win32 and osx. Fix by John.
3753 blocking problems in win32 and osx. Fix by John.
3749
3754
3750 2004-09-08 Fernando Perez <fperez@colorado.edu>
3755 2004-09-08 Fernando Perez <fperez@colorado.edu>
3751
3756
3752 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3757 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3753 for Win32 and OSX. Fix by John Hunter.
3758 for Win32 and OSX. Fix by John Hunter.
3754
3759
3755 2004-08-30 *** Released version 0.6.3
3760 2004-08-30 *** Released version 0.6.3
3756
3761
3757 2004-08-30 Fernando Perez <fperez@colorado.edu>
3762 2004-08-30 Fernando Perez <fperez@colorado.edu>
3758
3763
3759 * setup.py (isfile): Add manpages to list of dependent files to be
3764 * setup.py (isfile): Add manpages to list of dependent files to be
3760 updated.
3765 updated.
3761
3766
3762 2004-08-27 Fernando Perez <fperez@colorado.edu>
3767 2004-08-27 Fernando Perez <fperez@colorado.edu>
3763
3768
3764 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3769 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3765 for now. They don't really work with standalone WX/GTK code
3770 for now. They don't really work with standalone WX/GTK code
3766 (though matplotlib IS working fine with both of those backends).
3771 (though matplotlib IS working fine with both of those backends).
3767 This will neeed much more testing. I disabled most things with
3772 This will neeed much more testing. I disabled most things with
3768 comments, so turning it back on later should be pretty easy.
3773 comments, so turning it back on later should be pretty easy.
3769
3774
3770 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3775 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3771 autocalling of expressions like r'foo', by modifying the line
3776 autocalling of expressions like r'foo', by modifying the line
3772 split regexp. Closes
3777 split regexp. Closes
3773 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3778 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3774 Riley <ipythonbugs-AT-sabi.net>.
3779 Riley <ipythonbugs-AT-sabi.net>.
3775 (InteractiveShell.mainloop): honor --nobanner with banner
3780 (InteractiveShell.mainloop): honor --nobanner with banner
3776 extensions.
3781 extensions.
3777
3782
3778 * IPython/Shell.py: Significant refactoring of all classes, so
3783 * IPython/Shell.py: Significant refactoring of all classes, so
3779 that we can really support ALL matplotlib backends and threading
3784 that we can really support ALL matplotlib backends and threading
3780 models (John spotted a bug with Tk which required this). Now we
3785 models (John spotted a bug with Tk which required this). Now we
3781 should support single-threaded, WX-threads and GTK-threads, both
3786 should support single-threaded, WX-threads and GTK-threads, both
3782 for generic code and for matplotlib.
3787 for generic code and for matplotlib.
3783
3788
3784 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3789 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3785 -pylab, to simplify things for users. Will also remove the pylab
3790 -pylab, to simplify things for users. Will also remove the pylab
3786 profile, since now all of matplotlib configuration is directly
3791 profile, since now all of matplotlib configuration is directly
3787 handled here. This also reduces startup time.
3792 handled here. This also reduces startup time.
3788
3793
3789 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3794 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3790 shell wasn't being correctly called. Also in IPShellWX.
3795 shell wasn't being correctly called. Also in IPShellWX.
3791
3796
3792 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3797 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3793 fine-tune banner.
3798 fine-tune banner.
3794
3799
3795 * IPython/numutils.py (spike): Deprecate these spike functions,
3800 * IPython/numutils.py (spike): Deprecate these spike functions,
3796 delete (long deprecated) gnuplot_exec handler.
3801 delete (long deprecated) gnuplot_exec handler.
3797
3802
3798 2004-08-26 Fernando Perez <fperez@colorado.edu>
3803 2004-08-26 Fernando Perez <fperez@colorado.edu>
3799
3804
3800 * ipython.1: Update for threading options, plus some others which
3805 * ipython.1: Update for threading options, plus some others which
3801 were missing.
3806 were missing.
3802
3807
3803 * IPython/ipmaker.py (__call__): Added -wthread option for
3808 * IPython/ipmaker.py (__call__): Added -wthread option for
3804 wxpython thread handling. Make sure threading options are only
3809 wxpython thread handling. Make sure threading options are only
3805 valid at the command line.
3810 valid at the command line.
3806
3811
3807 * scripts/ipython: moved shell selection into a factory function
3812 * scripts/ipython: moved shell selection into a factory function
3808 in Shell.py, to keep the starter script to a minimum.
3813 in Shell.py, to keep the starter script to a minimum.
3809
3814
3810 2004-08-25 Fernando Perez <fperez@colorado.edu>
3815 2004-08-25 Fernando Perez <fperez@colorado.edu>
3811
3816
3812 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3817 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3813 John. Along with some recent changes he made to matplotlib, the
3818 John. Along with some recent changes he made to matplotlib, the
3814 next versions of both systems should work very well together.
3819 next versions of both systems should work very well together.
3815
3820
3816 2004-08-24 Fernando Perez <fperez@colorado.edu>
3821 2004-08-24 Fernando Perez <fperez@colorado.edu>
3817
3822
3818 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3823 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3819 tried to switch the profiling to using hotshot, but I'm getting
3824 tried to switch the profiling to using hotshot, but I'm getting
3820 strange errors from prof.runctx() there. I may be misreading the
3825 strange errors from prof.runctx() there. I may be misreading the
3821 docs, but it looks weird. For now the profiling code will
3826 docs, but it looks weird. For now the profiling code will
3822 continue to use the standard profiler.
3827 continue to use the standard profiler.
3823
3828
3824 2004-08-23 Fernando Perez <fperez@colorado.edu>
3829 2004-08-23 Fernando Perez <fperez@colorado.edu>
3825
3830
3826 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3831 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3827 threaded shell, by John Hunter. It's not quite ready yet, but
3832 threaded shell, by John Hunter. It's not quite ready yet, but
3828 close.
3833 close.
3829
3834
3830 2004-08-22 Fernando Perez <fperez@colorado.edu>
3835 2004-08-22 Fernando Perez <fperez@colorado.edu>
3831
3836
3832 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3837 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3833 in Magic and ultraTB.
3838 in Magic and ultraTB.
3834
3839
3835 * ipython.1: document threading options in manpage.
3840 * ipython.1: document threading options in manpage.
3836
3841
3837 * scripts/ipython: Changed name of -thread option to -gthread,
3842 * scripts/ipython: Changed name of -thread option to -gthread,
3838 since this is GTK specific. I want to leave the door open for a
3843 since this is GTK specific. I want to leave the door open for a
3839 -wthread option for WX, which will most likely be necessary. This
3844 -wthread option for WX, which will most likely be necessary. This
3840 change affects usage and ipmaker as well.
3845 change affects usage and ipmaker as well.
3841
3846
3842 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3847 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3843 handle the matplotlib shell issues. Code by John Hunter
3848 handle the matplotlib shell issues. Code by John Hunter
3844 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3849 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3845 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3850 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3846 broken (and disabled for end users) for now, but it puts the
3851 broken (and disabled for end users) for now, but it puts the
3847 infrastructure in place.
3852 infrastructure in place.
3848
3853
3849 2004-08-21 Fernando Perez <fperez@colorado.edu>
3854 2004-08-21 Fernando Perez <fperez@colorado.edu>
3850
3855
3851 * ipythonrc-pylab: Add matplotlib support.
3856 * ipythonrc-pylab: Add matplotlib support.
3852
3857
3853 * matplotlib_config.py: new files for matplotlib support, part of
3858 * matplotlib_config.py: new files for matplotlib support, part of
3854 the pylab profile.
3859 the pylab profile.
3855
3860
3856 * IPython/usage.py (__doc__): documented the threading options.
3861 * IPython/usage.py (__doc__): documented the threading options.
3857
3862
3858 2004-08-20 Fernando Perez <fperez@colorado.edu>
3863 2004-08-20 Fernando Perez <fperez@colorado.edu>
3859
3864
3860 * ipython: Modified the main calling routine to handle the -thread
3865 * ipython: Modified the main calling routine to handle the -thread
3861 and -mpthread options. This needs to be done as a top-level hack,
3866 and -mpthread options. This needs to be done as a top-level hack,
3862 because it determines which class to instantiate for IPython
3867 because it determines which class to instantiate for IPython
3863 itself.
3868 itself.
3864
3869
3865 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3870 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3866 classes to support multithreaded GTK operation without blocking,
3871 classes to support multithreaded GTK operation without blocking,
3867 and matplotlib with all backends. This is a lot of still very
3872 and matplotlib with all backends. This is a lot of still very
3868 experimental code, and threads are tricky. So it may still have a
3873 experimental code, and threads are tricky. So it may still have a
3869 few rough edges... This code owes a lot to
3874 few rough edges... This code owes a lot to
3870 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3875 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3871 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3876 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3872 to John Hunter for all the matplotlib work.
3877 to John Hunter for all the matplotlib work.
3873
3878
3874 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3879 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3875 options for gtk thread and matplotlib support.
3880 options for gtk thread and matplotlib support.
3876
3881
3877 2004-08-16 Fernando Perez <fperez@colorado.edu>
3882 2004-08-16 Fernando Perez <fperez@colorado.edu>
3878
3883
3879 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3884 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3880 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3885 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3881 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3886 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3882
3887
3883 2004-08-11 Fernando Perez <fperez@colorado.edu>
3888 2004-08-11 Fernando Perez <fperez@colorado.edu>
3884
3889
3885 * setup.py (isfile): Fix build so documentation gets updated for
3890 * setup.py (isfile): Fix build so documentation gets updated for
3886 rpms (it was only done for .tgz builds).
3891 rpms (it was only done for .tgz builds).
3887
3892
3888 2004-08-10 Fernando Perez <fperez@colorado.edu>
3893 2004-08-10 Fernando Perez <fperez@colorado.edu>
3889
3894
3890 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3895 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3891
3896
3892 * iplib.py : Silence syntax error exceptions in tab-completion.
3897 * iplib.py : Silence syntax error exceptions in tab-completion.
3893
3898
3894 2004-08-05 Fernando Perez <fperez@colorado.edu>
3899 2004-08-05 Fernando Perez <fperez@colorado.edu>
3895
3900
3896 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3901 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3897 'color off' mark for continuation prompts. This was causing long
3902 'color off' mark for continuation prompts. This was causing long
3898 continuation lines to mis-wrap.
3903 continuation lines to mis-wrap.
3899
3904
3900 2004-08-01 Fernando Perez <fperez@colorado.edu>
3905 2004-08-01 Fernando Perez <fperez@colorado.edu>
3901
3906
3902 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3907 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3903 for building ipython to be a parameter. All this is necessary
3908 for building ipython to be a parameter. All this is necessary
3904 right now to have a multithreaded version, but this insane
3909 right now to have a multithreaded version, but this insane
3905 non-design will be cleaned up soon. For now, it's a hack that
3910 non-design will be cleaned up soon. For now, it's a hack that
3906 works.
3911 works.
3907
3912
3908 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3913 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3909 args in various places. No bugs so far, but it's a dangerous
3914 args in various places. No bugs so far, but it's a dangerous
3910 practice.
3915 practice.
3911
3916
3912 2004-07-31 Fernando Perez <fperez@colorado.edu>
3917 2004-07-31 Fernando Perez <fperez@colorado.edu>
3913
3918
3914 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3919 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3915 fix completion of files with dots in their names under most
3920 fix completion of files with dots in their names under most
3916 profiles (pysh was OK because the completion order is different).
3921 profiles (pysh was OK because the completion order is different).
3917
3922
3918 2004-07-27 Fernando Perez <fperez@colorado.edu>
3923 2004-07-27 Fernando Perez <fperez@colorado.edu>
3919
3924
3920 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3925 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3921 keywords manually, b/c the one in keyword.py was removed in python
3926 keywords manually, b/c the one in keyword.py was removed in python
3922 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3927 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3923 This is NOT a bug under python 2.3 and earlier.
3928 This is NOT a bug under python 2.3 and earlier.
3924
3929
3925 2004-07-26 Fernando Perez <fperez@colorado.edu>
3930 2004-07-26 Fernando Perez <fperez@colorado.edu>
3926
3931
3927 * IPython/ultraTB.py (VerboseTB.text): Add another
3932 * IPython/ultraTB.py (VerboseTB.text): Add another
3928 linecache.checkcache() call to try to prevent inspect.py from
3933 linecache.checkcache() call to try to prevent inspect.py from
3929 crashing under python 2.3. I think this fixes
3934 crashing under python 2.3. I think this fixes
3930 http://www.scipy.net/roundup/ipython/issue17.
3935 http://www.scipy.net/roundup/ipython/issue17.
3931
3936
3932 2004-07-26 *** Released version 0.6.2
3937 2004-07-26 *** Released version 0.6.2
3933
3938
3934 2004-07-26 Fernando Perez <fperez@colorado.edu>
3939 2004-07-26 Fernando Perez <fperez@colorado.edu>
3935
3940
3936 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3941 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3937 fail for any number.
3942 fail for any number.
3938 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3943 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3939 empty bookmarks.
3944 empty bookmarks.
3940
3945
3941 2004-07-26 *** Released version 0.6.1
3946 2004-07-26 *** Released version 0.6.1
3942
3947
3943 2004-07-26 Fernando Perez <fperez@colorado.edu>
3948 2004-07-26 Fernando Perez <fperez@colorado.edu>
3944
3949
3945 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3950 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3946
3951
3947 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3952 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3948 escaping '()[]{}' in filenames.
3953 escaping '()[]{}' in filenames.
3949
3954
3950 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3955 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3951 Python 2.2 users who lack a proper shlex.split.
3956 Python 2.2 users who lack a proper shlex.split.
3952
3957
3953 2004-07-19 Fernando Perez <fperez@colorado.edu>
3958 2004-07-19 Fernando Perez <fperez@colorado.edu>
3954
3959
3955 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3960 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3956 for reading readline's init file. I follow the normal chain:
3961 for reading readline's init file. I follow the normal chain:
3957 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3962 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3958 report by Mike Heeter. This closes
3963 report by Mike Heeter. This closes
3959 http://www.scipy.net/roundup/ipython/issue16.
3964 http://www.scipy.net/roundup/ipython/issue16.
3960
3965
3961 2004-07-18 Fernando Perez <fperez@colorado.edu>
3966 2004-07-18 Fernando Perez <fperez@colorado.edu>
3962
3967
3963 * IPython/iplib.py (__init__): Add better handling of '\' under
3968 * IPython/iplib.py (__init__): Add better handling of '\' under
3964 Win32 for filenames. After a patch by Ville.
3969 Win32 for filenames. After a patch by Ville.
3965
3970
3966 2004-07-17 Fernando Perez <fperez@colorado.edu>
3971 2004-07-17 Fernando Perez <fperez@colorado.edu>
3967
3972
3968 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3973 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3969 autocalling would be triggered for 'foo is bar' if foo is
3974 autocalling would be triggered for 'foo is bar' if foo is
3970 callable. I also cleaned up the autocall detection code to use a
3975 callable. I also cleaned up the autocall detection code to use a
3971 regexp, which is faster. Bug reported by Alexander Schmolck.
3976 regexp, which is faster. Bug reported by Alexander Schmolck.
3972
3977
3973 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3978 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3974 '?' in them would confuse the help system. Reported by Alex
3979 '?' in them would confuse the help system. Reported by Alex
3975 Schmolck.
3980 Schmolck.
3976
3981
3977 2004-07-16 Fernando Perez <fperez@colorado.edu>
3982 2004-07-16 Fernando Perez <fperez@colorado.edu>
3978
3983
3979 * IPython/GnuplotInteractive.py (__all__): added plot2.
3984 * IPython/GnuplotInteractive.py (__all__): added plot2.
3980
3985
3981 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3986 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3982 plotting dictionaries, lists or tuples of 1d arrays.
3987 plotting dictionaries, lists or tuples of 1d arrays.
3983
3988
3984 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3989 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3985 optimizations.
3990 optimizations.
3986
3991
3987 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3992 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3988 the information which was there from Janko's original IPP code:
3993 the information which was there from Janko's original IPP code:
3989
3994
3990 03.05.99 20:53 porto.ifm.uni-kiel.de
3995 03.05.99 20:53 porto.ifm.uni-kiel.de
3991 --Started changelog.
3996 --Started changelog.
3992 --make clear do what it say it does
3997 --make clear do what it say it does
3993 --added pretty output of lines from inputcache
3998 --added pretty output of lines from inputcache
3994 --Made Logger a mixin class, simplifies handling of switches
3999 --Made Logger a mixin class, simplifies handling of switches
3995 --Added own completer class. .string<TAB> expands to last history
4000 --Added own completer class. .string<TAB> expands to last history
3996 line which starts with string. The new expansion is also present
4001 line which starts with string. The new expansion is also present
3997 with Ctrl-r from the readline library. But this shows, who this
4002 with Ctrl-r from the readline library. But this shows, who this
3998 can be done for other cases.
4003 can be done for other cases.
3999 --Added convention that all shell functions should accept a
4004 --Added convention that all shell functions should accept a
4000 parameter_string This opens the door for different behaviour for
4005 parameter_string This opens the door for different behaviour for
4001 each function. @cd is a good example of this.
4006 each function. @cd is a good example of this.
4002
4007
4003 04.05.99 12:12 porto.ifm.uni-kiel.de
4008 04.05.99 12:12 porto.ifm.uni-kiel.de
4004 --added logfile rotation
4009 --added logfile rotation
4005 --added new mainloop method which freezes first the namespace
4010 --added new mainloop method which freezes first the namespace
4006
4011
4007 07.05.99 21:24 porto.ifm.uni-kiel.de
4012 07.05.99 21:24 porto.ifm.uni-kiel.de
4008 --added the docreader classes. Now there is a help system.
4013 --added the docreader classes. Now there is a help system.
4009 -This is only a first try. Currently it's not easy to put new
4014 -This is only a first try. Currently it's not easy to put new
4010 stuff in the indices. But this is the way to go. Info would be
4015 stuff in the indices. But this is the way to go. Info would be
4011 better, but HTML is every where and not everybody has an info
4016 better, but HTML is every where and not everybody has an info
4012 system installed and it's not so easy to change html-docs to info.
4017 system installed and it's not so easy to change html-docs to info.
4013 --added global logfile option
4018 --added global logfile option
4014 --there is now a hook for object inspection method pinfo needs to
4019 --there is now a hook for object inspection method pinfo needs to
4015 be provided for this. Can be reached by two '??'.
4020 be provided for this. Can be reached by two '??'.
4016
4021
4017 08.05.99 20:51 porto.ifm.uni-kiel.de
4022 08.05.99 20:51 porto.ifm.uni-kiel.de
4018 --added a README
4023 --added a README
4019 --bug in rc file. Something has changed so functions in the rc
4024 --bug in rc file. Something has changed so functions in the rc
4020 file need to reference the shell and not self. Not clear if it's a
4025 file need to reference the shell and not self. Not clear if it's a
4021 bug or feature.
4026 bug or feature.
4022 --changed rc file for new behavior
4027 --changed rc file for new behavior
4023
4028
4024 2004-07-15 Fernando Perez <fperez@colorado.edu>
4029 2004-07-15 Fernando Perez <fperez@colorado.edu>
4025
4030
4026 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4031 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4027 cache was falling out of sync in bizarre manners when multi-line
4032 cache was falling out of sync in bizarre manners when multi-line
4028 input was present. Minor optimizations and cleanup.
4033 input was present. Minor optimizations and cleanup.
4029
4034
4030 (Logger): Remove old Changelog info for cleanup. This is the
4035 (Logger): Remove old Changelog info for cleanup. This is the
4031 information which was there from Janko's original code:
4036 information which was there from Janko's original code:
4032
4037
4033 Changes to Logger: - made the default log filename a parameter
4038 Changes to Logger: - made the default log filename a parameter
4034
4039
4035 - put a check for lines beginning with !@? in log(). Needed
4040 - put a check for lines beginning with !@? in log(). Needed
4036 (even if the handlers properly log their lines) for mid-session
4041 (even if the handlers properly log their lines) for mid-session
4037 logging activation to work properly. Without this, lines logged
4042 logging activation to work properly. Without this, lines logged
4038 in mid session, which get read from the cache, would end up
4043 in mid session, which get read from the cache, would end up
4039 'bare' (with !@? in the open) in the log. Now they are caught
4044 'bare' (with !@? in the open) in the log. Now they are caught
4040 and prepended with a #.
4045 and prepended with a #.
4041
4046
4042 * IPython/iplib.py (InteractiveShell.init_readline): added check
4047 * IPython/iplib.py (InteractiveShell.init_readline): added check
4043 in case MagicCompleter fails to be defined, so we don't crash.
4048 in case MagicCompleter fails to be defined, so we don't crash.
4044
4049
4045 2004-07-13 Fernando Perez <fperez@colorado.edu>
4050 2004-07-13 Fernando Perez <fperez@colorado.edu>
4046
4051
4047 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4052 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4048 of EPS if the requested filename ends in '.eps'.
4053 of EPS if the requested filename ends in '.eps'.
4049
4054
4050 2004-07-04 Fernando Perez <fperez@colorado.edu>
4055 2004-07-04 Fernando Perez <fperez@colorado.edu>
4051
4056
4052 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4057 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4053 escaping of quotes when calling the shell.
4058 escaping of quotes when calling the shell.
4054
4059
4055 2004-07-02 Fernando Perez <fperez@colorado.edu>
4060 2004-07-02 Fernando Perez <fperez@colorado.edu>
4056
4061
4057 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4062 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4058 gettext not working because we were clobbering '_'. Fixes
4063 gettext not working because we were clobbering '_'. Fixes
4059 http://www.scipy.net/roundup/ipython/issue6.
4064 http://www.scipy.net/roundup/ipython/issue6.
4060
4065
4061 2004-07-01 Fernando Perez <fperez@colorado.edu>
4066 2004-07-01 Fernando Perez <fperez@colorado.edu>
4062
4067
4063 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4068 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4064 into @cd. Patch by Ville.
4069 into @cd. Patch by Ville.
4065
4070
4066 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4071 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4067 new function to store things after ipmaker runs. Patch by Ville.
4072 new function to store things after ipmaker runs. Patch by Ville.
4068 Eventually this will go away once ipmaker is removed and the class
4073 Eventually this will go away once ipmaker is removed and the class
4069 gets cleaned up, but for now it's ok. Key functionality here is
4074 gets cleaned up, but for now it's ok. Key functionality here is
4070 the addition of the persistent storage mechanism, a dict for
4075 the addition of the persistent storage mechanism, a dict for
4071 keeping data across sessions (for now just bookmarks, but more can
4076 keeping data across sessions (for now just bookmarks, but more can
4072 be implemented later).
4077 be implemented later).
4073
4078
4074 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4079 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4075 persistent across sections. Patch by Ville, I modified it
4080 persistent across sections. Patch by Ville, I modified it
4076 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4081 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4077 added a '-l' option to list all bookmarks.
4082 added a '-l' option to list all bookmarks.
4078
4083
4079 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4084 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4080 center for cleanup. Registered with atexit.register(). I moved
4085 center for cleanup. Registered with atexit.register(). I moved
4081 here the old exit_cleanup(). After a patch by Ville.
4086 here the old exit_cleanup(). After a patch by Ville.
4082
4087
4083 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4088 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4084 characters in the hacked shlex_split for python 2.2.
4089 characters in the hacked shlex_split for python 2.2.
4085
4090
4086 * IPython/iplib.py (file_matches): more fixes to filenames with
4091 * IPython/iplib.py (file_matches): more fixes to filenames with
4087 whitespace in them. It's not perfect, but limitations in python's
4092 whitespace in them. It's not perfect, but limitations in python's
4088 readline make it impossible to go further.
4093 readline make it impossible to go further.
4089
4094
4090 2004-06-29 Fernando Perez <fperez@colorado.edu>
4095 2004-06-29 Fernando Perez <fperez@colorado.edu>
4091
4096
4092 * IPython/iplib.py (file_matches): escape whitespace correctly in
4097 * IPython/iplib.py (file_matches): escape whitespace correctly in
4093 filename completions. Bug reported by Ville.
4098 filename completions. Bug reported by Ville.
4094
4099
4095 2004-06-28 Fernando Perez <fperez@colorado.edu>
4100 2004-06-28 Fernando Perez <fperez@colorado.edu>
4096
4101
4097 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4102 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4098 the history file will be called 'history-PROFNAME' (or just
4103 the history file will be called 'history-PROFNAME' (or just
4099 'history' if no profile is loaded). I was getting annoyed at
4104 'history' if no profile is loaded). I was getting annoyed at
4100 getting my Numerical work history clobbered by pysh sessions.
4105 getting my Numerical work history clobbered by pysh sessions.
4101
4106
4102 * IPython/iplib.py (InteractiveShell.__init__): Internal
4107 * IPython/iplib.py (InteractiveShell.__init__): Internal
4103 getoutputerror() function so that we can honor the system_verbose
4108 getoutputerror() function so that we can honor the system_verbose
4104 flag for _all_ system calls. I also added escaping of #
4109 flag for _all_ system calls. I also added escaping of #
4105 characters here to avoid confusing Itpl.
4110 characters here to avoid confusing Itpl.
4106
4111
4107 * IPython/Magic.py (shlex_split): removed call to shell in
4112 * IPython/Magic.py (shlex_split): removed call to shell in
4108 parse_options and replaced it with shlex.split(). The annoying
4113 parse_options and replaced it with shlex.split(). The annoying
4109 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4114 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4110 to backport it from 2.3, with several frail hacks (the shlex
4115 to backport it from 2.3, with several frail hacks (the shlex
4111 module is rather limited in 2.2). Thanks to a suggestion by Ville
4116 module is rather limited in 2.2). Thanks to a suggestion by Ville
4112 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4117 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4113 problem.
4118 problem.
4114
4119
4115 (Magic.magic_system_verbose): new toggle to print the actual
4120 (Magic.magic_system_verbose): new toggle to print the actual
4116 system calls made by ipython. Mainly for debugging purposes.
4121 system calls made by ipython. Mainly for debugging purposes.
4117
4122
4118 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4123 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4119 doesn't support persistence. Reported (and fix suggested) by
4124 doesn't support persistence. Reported (and fix suggested) by
4120 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4125 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4121
4126
4122 2004-06-26 Fernando Perez <fperez@colorado.edu>
4127 2004-06-26 Fernando Perez <fperez@colorado.edu>
4123
4128
4124 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4129 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4125 continue prompts.
4130 continue prompts.
4126
4131
4127 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4132 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4128 function (basically a big docstring) and a few more things here to
4133 function (basically a big docstring) and a few more things here to
4129 speedup startup. pysh.py is now very lightweight. We want because
4134 speedup startup. pysh.py is now very lightweight. We want because
4130 it gets execfile'd, while InterpreterExec gets imported, so
4135 it gets execfile'd, while InterpreterExec gets imported, so
4131 byte-compilation saves time.
4136 byte-compilation saves time.
4132
4137
4133 2004-06-25 Fernando Perez <fperez@colorado.edu>
4138 2004-06-25 Fernando Perez <fperez@colorado.edu>
4134
4139
4135 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4140 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4136 -NUM', which was recently broken.
4141 -NUM', which was recently broken.
4137
4142
4138 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4143 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4139 in multi-line input (but not !!, which doesn't make sense there).
4144 in multi-line input (but not !!, which doesn't make sense there).
4140
4145
4141 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4146 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4142 It's just too useful, and people can turn it off in the less
4147 It's just too useful, and people can turn it off in the less
4143 common cases where it's a problem.
4148 common cases where it's a problem.
4144
4149
4145 2004-06-24 Fernando Perez <fperez@colorado.edu>
4150 2004-06-24 Fernando Perez <fperez@colorado.edu>
4146
4151
4147 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4152 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4148 special syntaxes (like alias calling) is now allied in multi-line
4153 special syntaxes (like alias calling) is now allied in multi-line
4149 input. This is still _very_ experimental, but it's necessary for
4154 input. This is still _very_ experimental, but it's necessary for
4150 efficient shell usage combining python looping syntax with system
4155 efficient shell usage combining python looping syntax with system
4151 calls. For now it's restricted to aliases, I don't think it
4156 calls. For now it's restricted to aliases, I don't think it
4152 really even makes sense to have this for magics.
4157 really even makes sense to have this for magics.
4153
4158
4154 2004-06-23 Fernando Perez <fperez@colorado.edu>
4159 2004-06-23 Fernando Perez <fperez@colorado.edu>
4155
4160
4156 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4161 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4157 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4162 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4158
4163
4159 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4164 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4160 extensions under Windows (after code sent by Gary Bishop). The
4165 extensions under Windows (after code sent by Gary Bishop). The
4161 extensions considered 'executable' are stored in IPython's rc
4166 extensions considered 'executable' are stored in IPython's rc
4162 structure as win_exec_ext.
4167 structure as win_exec_ext.
4163
4168
4164 * IPython/genutils.py (shell): new function, like system() but
4169 * IPython/genutils.py (shell): new function, like system() but
4165 without return value. Very useful for interactive shell work.
4170 without return value. Very useful for interactive shell work.
4166
4171
4167 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4172 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4168 delete aliases.
4173 delete aliases.
4169
4174
4170 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4175 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4171 sure that the alias table doesn't contain python keywords.
4176 sure that the alias table doesn't contain python keywords.
4172
4177
4173 2004-06-21 Fernando Perez <fperez@colorado.edu>
4178 2004-06-21 Fernando Perez <fperez@colorado.edu>
4174
4179
4175 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4180 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4176 non-existent items are found in $PATH. Reported by Thorsten.
4181 non-existent items are found in $PATH. Reported by Thorsten.
4177
4182
4178 2004-06-20 Fernando Perez <fperez@colorado.edu>
4183 2004-06-20 Fernando Perez <fperez@colorado.edu>
4179
4184
4180 * IPython/iplib.py (complete): modified the completer so that the
4185 * IPython/iplib.py (complete): modified the completer so that the
4181 order of priorities can be easily changed at runtime.
4186 order of priorities can be easily changed at runtime.
4182
4187
4183 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4188 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4184 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4189 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4185
4190
4186 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4191 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4187 expand Python variables prepended with $ in all system calls. The
4192 expand Python variables prepended with $ in all system calls. The
4188 same was done to InteractiveShell.handle_shell_escape. Now all
4193 same was done to InteractiveShell.handle_shell_escape. Now all
4189 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4194 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4190 expansion of python variables and expressions according to the
4195 expansion of python variables and expressions according to the
4191 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4196 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4192
4197
4193 Though PEP-215 has been rejected, a similar (but simpler) one
4198 Though PEP-215 has been rejected, a similar (but simpler) one
4194 seems like it will go into Python 2.4, PEP-292 -
4199 seems like it will go into Python 2.4, PEP-292 -
4195 http://www.python.org/peps/pep-0292.html.
4200 http://www.python.org/peps/pep-0292.html.
4196
4201
4197 I'll keep the full syntax of PEP-215, since IPython has since the
4202 I'll keep the full syntax of PEP-215, since IPython has since the
4198 start used Ka-Ping Yee's reference implementation discussed there
4203 start used Ka-Ping Yee's reference implementation discussed there
4199 (Itpl), and I actually like the powerful semantics it offers.
4204 (Itpl), and I actually like the powerful semantics it offers.
4200
4205
4201 In order to access normal shell variables, the $ has to be escaped
4206 In order to access normal shell variables, the $ has to be escaped
4202 via an extra $. For example:
4207 via an extra $. For example:
4203
4208
4204 In [7]: PATH='a python variable'
4209 In [7]: PATH='a python variable'
4205
4210
4206 In [8]: !echo $PATH
4211 In [8]: !echo $PATH
4207 a python variable
4212 a python variable
4208
4213
4209 In [9]: !echo $$PATH
4214 In [9]: !echo $$PATH
4210 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4215 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4211
4216
4212 (Magic.parse_options): escape $ so the shell doesn't evaluate
4217 (Magic.parse_options): escape $ so the shell doesn't evaluate
4213 things prematurely.
4218 things prematurely.
4214
4219
4215 * IPython/iplib.py (InteractiveShell.call_alias): added the
4220 * IPython/iplib.py (InteractiveShell.call_alias): added the
4216 ability for aliases to expand python variables via $.
4221 ability for aliases to expand python variables via $.
4217
4222
4218 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4223 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4219 system, now there's a @rehash/@rehashx pair of magics. These work
4224 system, now there's a @rehash/@rehashx pair of magics. These work
4220 like the csh rehash command, and can be invoked at any time. They
4225 like the csh rehash command, and can be invoked at any time. They
4221 build a table of aliases to everything in the user's $PATH
4226 build a table of aliases to everything in the user's $PATH
4222 (@rehash uses everything, @rehashx is slower but only adds
4227 (@rehash uses everything, @rehashx is slower but only adds
4223 executable files). With this, the pysh.py-based shell profile can
4228 executable files). With this, the pysh.py-based shell profile can
4224 now simply call rehash upon startup, and full access to all
4229 now simply call rehash upon startup, and full access to all
4225 programs in the user's path is obtained.
4230 programs in the user's path is obtained.
4226
4231
4227 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4232 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4228 functionality is now fully in place. I removed the old dynamic
4233 functionality is now fully in place. I removed the old dynamic
4229 code generation based approach, in favor of a much lighter one
4234 code generation based approach, in favor of a much lighter one
4230 based on a simple dict. The advantage is that this allows me to
4235 based on a simple dict. The advantage is that this allows me to
4231 now have thousands of aliases with negligible cost (unthinkable
4236 now have thousands of aliases with negligible cost (unthinkable
4232 with the old system).
4237 with the old system).
4233
4238
4234 2004-06-19 Fernando Perez <fperez@colorado.edu>
4239 2004-06-19 Fernando Perez <fperez@colorado.edu>
4235
4240
4236 * IPython/iplib.py (__init__): extended MagicCompleter class to
4241 * IPython/iplib.py (__init__): extended MagicCompleter class to
4237 also complete (last in priority) on user aliases.
4242 also complete (last in priority) on user aliases.
4238
4243
4239 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4244 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4240 call to eval.
4245 call to eval.
4241 (ItplNS.__init__): Added a new class which functions like Itpl,
4246 (ItplNS.__init__): Added a new class which functions like Itpl,
4242 but allows configuring the namespace for the evaluation to occur
4247 but allows configuring the namespace for the evaluation to occur
4243 in.
4248 in.
4244
4249
4245 2004-06-18 Fernando Perez <fperez@colorado.edu>
4250 2004-06-18 Fernando Perez <fperez@colorado.edu>
4246
4251
4247 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4252 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4248 better message when 'exit' or 'quit' are typed (a common newbie
4253 better message when 'exit' or 'quit' are typed (a common newbie
4249 confusion).
4254 confusion).
4250
4255
4251 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4256 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4252 check for Windows users.
4257 check for Windows users.
4253
4258
4254 * IPython/iplib.py (InteractiveShell.user_setup): removed
4259 * IPython/iplib.py (InteractiveShell.user_setup): removed
4255 disabling of colors for Windows. I'll test at runtime and issue a
4260 disabling of colors for Windows. I'll test at runtime and issue a
4256 warning if Gary's readline isn't found, as to nudge users to
4261 warning if Gary's readline isn't found, as to nudge users to
4257 download it.
4262 download it.
4258
4263
4259 2004-06-16 Fernando Perez <fperez@colorado.edu>
4264 2004-06-16 Fernando Perez <fperez@colorado.edu>
4260
4265
4261 * IPython/genutils.py (Stream.__init__): changed to print errors
4266 * IPython/genutils.py (Stream.__init__): changed to print errors
4262 to sys.stderr. I had a circular dependency here. Now it's
4267 to sys.stderr. I had a circular dependency here. Now it's
4263 possible to run ipython as IDLE's shell (consider this pre-alpha,
4268 possible to run ipython as IDLE's shell (consider this pre-alpha,
4264 since true stdout things end up in the starting terminal instead
4269 since true stdout things end up in the starting terminal instead
4265 of IDLE's out).
4270 of IDLE's out).
4266
4271
4267 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4272 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4268 users who haven't # updated their prompt_in2 definitions. Remove
4273 users who haven't # updated their prompt_in2 definitions. Remove
4269 eventually.
4274 eventually.
4270 (multiple_replace): added credit to original ASPN recipe.
4275 (multiple_replace): added credit to original ASPN recipe.
4271
4276
4272 2004-06-15 Fernando Perez <fperez@colorado.edu>
4277 2004-06-15 Fernando Perez <fperez@colorado.edu>
4273
4278
4274 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4279 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4275 list of auto-defined aliases.
4280 list of auto-defined aliases.
4276
4281
4277 2004-06-13 Fernando Perez <fperez@colorado.edu>
4282 2004-06-13 Fernando Perez <fperez@colorado.edu>
4278
4283
4279 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4284 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4280 install was really requested (so setup.py can be used for other
4285 install was really requested (so setup.py can be used for other
4281 things under Windows).
4286 things under Windows).
4282
4287
4283 2004-06-10 Fernando Perez <fperez@colorado.edu>
4288 2004-06-10 Fernando Perez <fperez@colorado.edu>
4284
4289
4285 * IPython/Logger.py (Logger.create_log): Manually remove any old
4290 * IPython/Logger.py (Logger.create_log): Manually remove any old
4286 backup, since os.remove may fail under Windows. Fixes bug
4291 backup, since os.remove may fail under Windows. Fixes bug
4287 reported by Thorsten.
4292 reported by Thorsten.
4288
4293
4289 2004-06-09 Fernando Perez <fperez@colorado.edu>
4294 2004-06-09 Fernando Perez <fperez@colorado.edu>
4290
4295
4291 * examples/example-embed.py: fixed all references to %n (replaced
4296 * examples/example-embed.py: fixed all references to %n (replaced
4292 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4297 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4293 for all examples and the manual as well.
4298 for all examples and the manual as well.
4294
4299
4295 2004-06-08 Fernando Perez <fperez@colorado.edu>
4300 2004-06-08 Fernando Perez <fperez@colorado.edu>
4296
4301
4297 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4302 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4298 alignment and color management. All 3 prompt subsystems now
4303 alignment and color management. All 3 prompt subsystems now
4299 inherit from BasePrompt.
4304 inherit from BasePrompt.
4300
4305
4301 * tools/release: updates for windows installer build and tag rpms
4306 * tools/release: updates for windows installer build and tag rpms
4302 with python version (since paths are fixed).
4307 with python version (since paths are fixed).
4303
4308
4304 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4309 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4305 which will become eventually obsolete. Also fixed the default
4310 which will become eventually obsolete. Also fixed the default
4306 prompt_in2 to use \D, so at least new users start with the correct
4311 prompt_in2 to use \D, so at least new users start with the correct
4307 defaults.
4312 defaults.
4308 WARNING: Users with existing ipythonrc files will need to apply
4313 WARNING: Users with existing ipythonrc files will need to apply
4309 this fix manually!
4314 this fix manually!
4310
4315
4311 * setup.py: make windows installer (.exe). This is finally the
4316 * setup.py: make windows installer (.exe). This is finally the
4312 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4317 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4313 which I hadn't included because it required Python 2.3 (or recent
4318 which I hadn't included because it required Python 2.3 (or recent
4314 distutils).
4319 distutils).
4315
4320
4316 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4321 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4317 usage of new '\D' escape.
4322 usage of new '\D' escape.
4318
4323
4319 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4324 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4320 lacks os.getuid())
4325 lacks os.getuid())
4321 (CachedOutput.set_colors): Added the ability to turn coloring
4326 (CachedOutput.set_colors): Added the ability to turn coloring
4322 on/off with @colors even for manually defined prompt colors. It
4327 on/off with @colors even for manually defined prompt colors. It
4323 uses a nasty global, but it works safely and via the generic color
4328 uses a nasty global, but it works safely and via the generic color
4324 handling mechanism.
4329 handling mechanism.
4325 (Prompt2.__init__): Introduced new escape '\D' for continuation
4330 (Prompt2.__init__): Introduced new escape '\D' for continuation
4326 prompts. It represents the counter ('\#') as dots.
4331 prompts. It represents the counter ('\#') as dots.
4327 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4332 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4328 need to update their ipythonrc files and replace '%n' with '\D' in
4333 need to update their ipythonrc files and replace '%n' with '\D' in
4329 their prompt_in2 settings everywhere. Sorry, but there's
4334 their prompt_in2 settings everywhere. Sorry, but there's
4330 otherwise no clean way to get all prompts to properly align. The
4335 otherwise no clean way to get all prompts to properly align. The
4331 ipythonrc shipped with IPython has been updated.
4336 ipythonrc shipped with IPython has been updated.
4332
4337
4333 2004-06-07 Fernando Perez <fperez@colorado.edu>
4338 2004-06-07 Fernando Perez <fperez@colorado.edu>
4334
4339
4335 * setup.py (isfile): Pass local_icons option to latex2html, so the
4340 * setup.py (isfile): Pass local_icons option to latex2html, so the
4336 resulting HTML file is self-contained. Thanks to
4341 resulting HTML file is self-contained. Thanks to
4337 dryice-AT-liu.com.cn for the tip.
4342 dryice-AT-liu.com.cn for the tip.
4338
4343
4339 * pysh.py: I created a new profile 'shell', which implements a
4344 * pysh.py: I created a new profile 'shell', which implements a
4340 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4345 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4341 system shell, nor will it become one anytime soon. It's mainly
4346 system shell, nor will it become one anytime soon. It's mainly
4342 meant to illustrate the use of the new flexible bash-like prompts.
4347 meant to illustrate the use of the new flexible bash-like prompts.
4343 I guess it could be used by hardy souls for true shell management,
4348 I guess it could be used by hardy souls for true shell management,
4344 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4349 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4345 profile. This uses the InterpreterExec extension provided by
4350 profile. This uses the InterpreterExec extension provided by
4346 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4351 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4347
4352
4348 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4353 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4349 auto-align itself with the length of the previous input prompt
4354 auto-align itself with the length of the previous input prompt
4350 (taking into account the invisible color escapes).
4355 (taking into account the invisible color escapes).
4351 (CachedOutput.__init__): Large restructuring of this class. Now
4356 (CachedOutput.__init__): Large restructuring of this class. Now
4352 all three prompts (primary1, primary2, output) are proper objects,
4357 all three prompts (primary1, primary2, output) are proper objects,
4353 managed by the 'parent' CachedOutput class. The code is still a
4358 managed by the 'parent' CachedOutput class. The code is still a
4354 bit hackish (all prompts share state via a pointer to the cache),
4359 bit hackish (all prompts share state via a pointer to the cache),
4355 but it's overall far cleaner than before.
4360 but it's overall far cleaner than before.
4356
4361
4357 * IPython/genutils.py (getoutputerror): modified to add verbose,
4362 * IPython/genutils.py (getoutputerror): modified to add verbose,
4358 debug and header options. This makes the interface of all getout*
4363 debug and header options. This makes the interface of all getout*
4359 functions uniform.
4364 functions uniform.
4360 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4365 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4361
4366
4362 * IPython/Magic.py (Magic.default_option): added a function to
4367 * IPython/Magic.py (Magic.default_option): added a function to
4363 allow registering default options for any magic command. This
4368 allow registering default options for any magic command. This
4364 makes it easy to have profiles which customize the magics globally
4369 makes it easy to have profiles which customize the magics globally
4365 for a certain use. The values set through this function are
4370 for a certain use. The values set through this function are
4366 picked up by the parse_options() method, which all magics should
4371 picked up by the parse_options() method, which all magics should
4367 use to parse their options.
4372 use to parse their options.
4368
4373
4369 * IPython/genutils.py (warn): modified the warnings framework to
4374 * IPython/genutils.py (warn): modified the warnings framework to
4370 use the Term I/O class. I'm trying to slowly unify all of
4375 use the Term I/O class. I'm trying to slowly unify all of
4371 IPython's I/O operations to pass through Term.
4376 IPython's I/O operations to pass through Term.
4372
4377
4373 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4378 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4374 the secondary prompt to correctly match the length of the primary
4379 the secondary prompt to correctly match the length of the primary
4375 one for any prompt. Now multi-line code will properly line up
4380 one for any prompt. Now multi-line code will properly line up
4376 even for path dependent prompts, such as the new ones available
4381 even for path dependent prompts, such as the new ones available
4377 via the prompt_specials.
4382 via the prompt_specials.
4378
4383
4379 2004-06-06 Fernando Perez <fperez@colorado.edu>
4384 2004-06-06 Fernando Perez <fperez@colorado.edu>
4380
4385
4381 * IPython/Prompts.py (prompt_specials): Added the ability to have
4386 * IPython/Prompts.py (prompt_specials): Added the ability to have
4382 bash-like special sequences in the prompts, which get
4387 bash-like special sequences in the prompts, which get
4383 automatically expanded. Things like hostname, current working
4388 automatically expanded. Things like hostname, current working
4384 directory and username are implemented already, but it's easy to
4389 directory and username are implemented already, but it's easy to
4385 add more in the future. Thanks to a patch by W.J. van der Laan
4390 add more in the future. Thanks to a patch by W.J. van der Laan
4386 <gnufnork-AT-hetdigitalegat.nl>
4391 <gnufnork-AT-hetdigitalegat.nl>
4387 (prompt_specials): Added color support for prompt strings, so
4392 (prompt_specials): Added color support for prompt strings, so
4388 users can define arbitrary color setups for their prompts.
4393 users can define arbitrary color setups for their prompts.
4389
4394
4390 2004-06-05 Fernando Perez <fperez@colorado.edu>
4395 2004-06-05 Fernando Perez <fperez@colorado.edu>
4391
4396
4392 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4397 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4393 code to load Gary Bishop's readline and configure it
4398 code to load Gary Bishop's readline and configure it
4394 automatically. Thanks to Gary for help on this.
4399 automatically. Thanks to Gary for help on this.
4395
4400
4396 2004-06-01 Fernando Perez <fperez@colorado.edu>
4401 2004-06-01 Fernando Perez <fperez@colorado.edu>
4397
4402
4398 * IPython/Logger.py (Logger.create_log): fix bug for logging
4403 * IPython/Logger.py (Logger.create_log): fix bug for logging
4399 with no filename (previous fix was incomplete).
4404 with no filename (previous fix was incomplete).
4400
4405
4401 2004-05-25 Fernando Perez <fperez@colorado.edu>
4406 2004-05-25 Fernando Perez <fperez@colorado.edu>
4402
4407
4403 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4408 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4404 parens would get passed to the shell.
4409 parens would get passed to the shell.
4405
4410
4406 2004-05-20 Fernando Perez <fperez@colorado.edu>
4411 2004-05-20 Fernando Perez <fperez@colorado.edu>
4407
4412
4408 * IPython/Magic.py (Magic.magic_prun): changed default profile
4413 * IPython/Magic.py (Magic.magic_prun): changed default profile
4409 sort order to 'time' (the more common profiling need).
4414 sort order to 'time' (the more common profiling need).
4410
4415
4411 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4416 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4412 so that source code shown is guaranteed in sync with the file on
4417 so that source code shown is guaranteed in sync with the file on
4413 disk (also changed in psource). Similar fix to the one for
4418 disk (also changed in psource). Similar fix to the one for
4414 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4419 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4415 <yann.ledu-AT-noos.fr>.
4420 <yann.ledu-AT-noos.fr>.
4416
4421
4417 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4422 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4418 with a single option would not be correctly parsed. Closes
4423 with a single option would not be correctly parsed. Closes
4419 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4424 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4420 introduced in 0.6.0 (on 2004-05-06).
4425 introduced in 0.6.0 (on 2004-05-06).
4421
4426
4422 2004-05-13 *** Released version 0.6.0
4427 2004-05-13 *** Released version 0.6.0
4423
4428
4424 2004-05-13 Fernando Perez <fperez@colorado.edu>
4429 2004-05-13 Fernando Perez <fperez@colorado.edu>
4425
4430
4426 * debian/: Added debian/ directory to CVS, so that debian support
4431 * debian/: Added debian/ directory to CVS, so that debian support
4427 is publicly accessible. The debian package is maintained by Jack
4432 is publicly accessible. The debian package is maintained by Jack
4428 Moffit <jack-AT-xiph.org>.
4433 Moffit <jack-AT-xiph.org>.
4429
4434
4430 * Documentation: included the notes about an ipython-based system
4435 * Documentation: included the notes about an ipython-based system
4431 shell (the hypothetical 'pysh') into the new_design.pdf document,
4436 shell (the hypothetical 'pysh') into the new_design.pdf document,
4432 so that these ideas get distributed to users along with the
4437 so that these ideas get distributed to users along with the
4433 official documentation.
4438 official documentation.
4434
4439
4435 2004-05-10 Fernando Perez <fperez@colorado.edu>
4440 2004-05-10 Fernando Perez <fperez@colorado.edu>
4436
4441
4437 * IPython/Logger.py (Logger.create_log): fix recently introduced
4442 * IPython/Logger.py (Logger.create_log): fix recently introduced
4438 bug (misindented line) where logstart would fail when not given an
4443 bug (misindented line) where logstart would fail when not given an
4439 explicit filename.
4444 explicit filename.
4440
4445
4441 2004-05-09 Fernando Perez <fperez@colorado.edu>
4446 2004-05-09 Fernando Perez <fperez@colorado.edu>
4442
4447
4443 * IPython/Magic.py (Magic.parse_options): skip system call when
4448 * IPython/Magic.py (Magic.parse_options): skip system call when
4444 there are no options to look for. Faster, cleaner for the common
4449 there are no options to look for. Faster, cleaner for the common
4445 case.
4450 case.
4446
4451
4447 * Documentation: many updates to the manual: describing Windows
4452 * Documentation: many updates to the manual: describing Windows
4448 support better, Gnuplot updates, credits, misc small stuff. Also
4453 support better, Gnuplot updates, credits, misc small stuff. Also
4449 updated the new_design doc a bit.
4454 updated the new_design doc a bit.
4450
4455
4451 2004-05-06 *** Released version 0.6.0.rc1
4456 2004-05-06 *** Released version 0.6.0.rc1
4452
4457
4453 2004-05-06 Fernando Perez <fperez@colorado.edu>
4458 2004-05-06 Fernando Perez <fperez@colorado.edu>
4454
4459
4455 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4460 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4456 operations to use the vastly more efficient list/''.join() method.
4461 operations to use the vastly more efficient list/''.join() method.
4457 (FormattedTB.text): Fix
4462 (FormattedTB.text): Fix
4458 http://www.scipy.net/roundup/ipython/issue12 - exception source
4463 http://www.scipy.net/roundup/ipython/issue12 - exception source
4459 extract not updated after reload. Thanks to Mike Salib
4464 extract not updated after reload. Thanks to Mike Salib
4460 <msalib-AT-mit.edu> for pinning the source of the problem.
4465 <msalib-AT-mit.edu> for pinning the source of the problem.
4461 Fortunately, the solution works inside ipython and doesn't require
4466 Fortunately, the solution works inside ipython and doesn't require
4462 any changes to python proper.
4467 any changes to python proper.
4463
4468
4464 * IPython/Magic.py (Magic.parse_options): Improved to process the
4469 * IPython/Magic.py (Magic.parse_options): Improved to process the
4465 argument list as a true shell would (by actually using the
4470 argument list as a true shell would (by actually using the
4466 underlying system shell). This way, all @magics automatically get
4471 underlying system shell). This way, all @magics automatically get
4467 shell expansion for variables. Thanks to a comment by Alex
4472 shell expansion for variables. Thanks to a comment by Alex
4468 Schmolck.
4473 Schmolck.
4469
4474
4470 2004-04-04 Fernando Perez <fperez@colorado.edu>
4475 2004-04-04 Fernando Perez <fperez@colorado.edu>
4471
4476
4472 * IPython/iplib.py (InteractiveShell.interact): Added a special
4477 * IPython/iplib.py (InteractiveShell.interact): Added a special
4473 trap for a debugger quit exception, which is basically impossible
4478 trap for a debugger quit exception, which is basically impossible
4474 to handle by normal mechanisms, given what pdb does to the stack.
4479 to handle by normal mechanisms, given what pdb does to the stack.
4475 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4480 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4476
4481
4477 2004-04-03 Fernando Perez <fperez@colorado.edu>
4482 2004-04-03 Fernando Perez <fperez@colorado.edu>
4478
4483
4479 * IPython/genutils.py (Term): Standardized the names of the Term
4484 * IPython/genutils.py (Term): Standardized the names of the Term
4480 class streams to cin/cout/cerr, following C++ naming conventions
4485 class streams to cin/cout/cerr, following C++ naming conventions
4481 (I can't use in/out/err because 'in' is not a valid attribute
4486 (I can't use in/out/err because 'in' is not a valid attribute
4482 name).
4487 name).
4483
4488
4484 * IPython/iplib.py (InteractiveShell.interact): don't increment
4489 * IPython/iplib.py (InteractiveShell.interact): don't increment
4485 the prompt if there's no user input. By Daniel 'Dang' Griffith
4490 the prompt if there's no user input. By Daniel 'Dang' Griffith
4486 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4491 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4487 Francois Pinard.
4492 Francois Pinard.
4488
4493
4489 2004-04-02 Fernando Perez <fperez@colorado.edu>
4494 2004-04-02 Fernando Perez <fperez@colorado.edu>
4490
4495
4491 * IPython/genutils.py (Stream.__init__): Modified to survive at
4496 * IPython/genutils.py (Stream.__init__): Modified to survive at
4492 least importing in contexts where stdin/out/err aren't true file
4497 least importing in contexts where stdin/out/err aren't true file
4493 objects, such as PyCrust (they lack fileno() and mode). However,
4498 objects, such as PyCrust (they lack fileno() and mode). However,
4494 the recovery facilities which rely on these things existing will
4499 the recovery facilities which rely on these things existing will
4495 not work.
4500 not work.
4496
4501
4497 2004-04-01 Fernando Perez <fperez@colorado.edu>
4502 2004-04-01 Fernando Perez <fperez@colorado.edu>
4498
4503
4499 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4504 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4500 use the new getoutputerror() function, so it properly
4505 use the new getoutputerror() function, so it properly
4501 distinguishes stdout/err.
4506 distinguishes stdout/err.
4502
4507
4503 * IPython/genutils.py (getoutputerror): added a function to
4508 * IPython/genutils.py (getoutputerror): added a function to
4504 capture separately the standard output and error of a command.
4509 capture separately the standard output and error of a command.
4505 After a comment from dang on the mailing lists. This code is
4510 After a comment from dang on the mailing lists. This code is
4506 basically a modified version of commands.getstatusoutput(), from
4511 basically a modified version of commands.getstatusoutput(), from
4507 the standard library.
4512 the standard library.
4508
4513
4509 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4514 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4510 '!!' as a special syntax (shorthand) to access @sx.
4515 '!!' as a special syntax (shorthand) to access @sx.
4511
4516
4512 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4517 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4513 command and return its output as a list split on '\n'.
4518 command and return its output as a list split on '\n'.
4514
4519
4515 2004-03-31 Fernando Perez <fperez@colorado.edu>
4520 2004-03-31 Fernando Perez <fperez@colorado.edu>
4516
4521
4517 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4522 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4518 method to dictionaries used as FakeModule instances if they lack
4523 method to dictionaries used as FakeModule instances if they lack
4519 it. At least pydoc in python2.3 breaks for runtime-defined
4524 it. At least pydoc in python2.3 breaks for runtime-defined
4520 functions without this hack. At some point I need to _really_
4525 functions without this hack. At some point I need to _really_
4521 understand what FakeModule is doing, because it's a gross hack.
4526 understand what FakeModule is doing, because it's a gross hack.
4522 But it solves Arnd's problem for now...
4527 But it solves Arnd's problem for now...
4523
4528
4524 2004-02-27 Fernando Perez <fperez@colorado.edu>
4529 2004-02-27 Fernando Perez <fperez@colorado.edu>
4525
4530
4526 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4531 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4527 mode would behave erratically. Also increased the number of
4532 mode would behave erratically. Also increased the number of
4528 possible logs in rotate mod to 999. Thanks to Rod Holland
4533 possible logs in rotate mod to 999. Thanks to Rod Holland
4529 <rhh@StructureLABS.com> for the report and fixes.
4534 <rhh@StructureLABS.com> for the report and fixes.
4530
4535
4531 2004-02-26 Fernando Perez <fperez@colorado.edu>
4536 2004-02-26 Fernando Perez <fperez@colorado.edu>
4532
4537
4533 * IPython/genutils.py (page): Check that the curses module really
4538 * IPython/genutils.py (page): Check that the curses module really
4534 has the initscr attribute before trying to use it. For some
4539 has the initscr attribute before trying to use it. For some
4535 reason, the Solaris curses module is missing this. I think this
4540 reason, the Solaris curses module is missing this. I think this
4536 should be considered a Solaris python bug, but I'm not sure.
4541 should be considered a Solaris python bug, but I'm not sure.
4537
4542
4538 2004-01-17 Fernando Perez <fperez@colorado.edu>
4543 2004-01-17 Fernando Perez <fperez@colorado.edu>
4539
4544
4540 * IPython/genutils.py (Stream.__init__): Changes to try to make
4545 * IPython/genutils.py (Stream.__init__): Changes to try to make
4541 ipython robust against stdin/out/err being closed by the user.
4546 ipython robust against stdin/out/err being closed by the user.
4542 This is 'user error' (and blocks a normal python session, at least
4547 This is 'user error' (and blocks a normal python session, at least
4543 the stdout case). However, Ipython should be able to survive such
4548 the stdout case). However, Ipython should be able to survive such
4544 instances of abuse as gracefully as possible. To simplify the
4549 instances of abuse as gracefully as possible. To simplify the
4545 coding and maintain compatibility with Gary Bishop's Term
4550 coding and maintain compatibility with Gary Bishop's Term
4546 contributions, I've made use of classmethods for this. I think
4551 contributions, I've made use of classmethods for this. I think
4547 this introduces a dependency on python 2.2.
4552 this introduces a dependency on python 2.2.
4548
4553
4549 2004-01-13 Fernando Perez <fperez@colorado.edu>
4554 2004-01-13 Fernando Perez <fperez@colorado.edu>
4550
4555
4551 * IPython/numutils.py (exp_safe): simplified the code a bit and
4556 * IPython/numutils.py (exp_safe): simplified the code a bit and
4552 removed the need for importing the kinds module altogether.
4557 removed the need for importing the kinds module altogether.
4553
4558
4554 2004-01-06 Fernando Perez <fperez@colorado.edu>
4559 2004-01-06 Fernando Perez <fperez@colorado.edu>
4555
4560
4556 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4561 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4557 a magic function instead, after some community feedback. No
4562 a magic function instead, after some community feedback. No
4558 special syntax will exist for it, but its name is deliberately
4563 special syntax will exist for it, but its name is deliberately
4559 very short.
4564 very short.
4560
4565
4561 2003-12-20 Fernando Perez <fperez@colorado.edu>
4566 2003-12-20 Fernando Perez <fperez@colorado.edu>
4562
4567
4563 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4568 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4564 new functionality, to automagically assign the result of a shell
4569 new functionality, to automagically assign the result of a shell
4565 command to a variable. I'll solicit some community feedback on
4570 command to a variable. I'll solicit some community feedback on
4566 this before making it permanent.
4571 this before making it permanent.
4567
4572
4568 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4573 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4569 requested about callables for which inspect couldn't obtain a
4574 requested about callables for which inspect couldn't obtain a
4570 proper argspec. Thanks to a crash report sent by Etienne
4575 proper argspec. Thanks to a crash report sent by Etienne
4571 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4576 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4572
4577
4573 2003-12-09 Fernando Perez <fperez@colorado.edu>
4578 2003-12-09 Fernando Perez <fperez@colorado.edu>
4574
4579
4575 * IPython/genutils.py (page): patch for the pager to work across
4580 * IPython/genutils.py (page): patch for the pager to work across
4576 various versions of Windows. By Gary Bishop.
4581 various versions of Windows. By Gary Bishop.
4577
4582
4578 2003-12-04 Fernando Perez <fperez@colorado.edu>
4583 2003-12-04 Fernando Perez <fperez@colorado.edu>
4579
4584
4580 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4585 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4581 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4586 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4582 While I tested this and it looks ok, there may still be corner
4587 While I tested this and it looks ok, there may still be corner
4583 cases I've missed.
4588 cases I've missed.
4584
4589
4585 2003-12-01 Fernando Perez <fperez@colorado.edu>
4590 2003-12-01 Fernando Perez <fperez@colorado.edu>
4586
4591
4587 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4592 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4588 where a line like 'p,q=1,2' would fail because the automagic
4593 where a line like 'p,q=1,2' would fail because the automagic
4589 system would be triggered for @p.
4594 system would be triggered for @p.
4590
4595
4591 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4596 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4592 cleanups, code unmodified.
4597 cleanups, code unmodified.
4593
4598
4594 * IPython/genutils.py (Term): added a class for IPython to handle
4599 * IPython/genutils.py (Term): added a class for IPython to handle
4595 output. In most cases it will just be a proxy for stdout/err, but
4600 output. In most cases it will just be a proxy for stdout/err, but
4596 having this allows modifications to be made for some platforms,
4601 having this allows modifications to be made for some platforms,
4597 such as handling color escapes under Windows. All of this code
4602 such as handling color escapes under Windows. All of this code
4598 was contributed by Gary Bishop, with minor modifications by me.
4603 was contributed by Gary Bishop, with minor modifications by me.
4599 The actual changes affect many files.
4604 The actual changes affect many files.
4600
4605
4601 2003-11-30 Fernando Perez <fperez@colorado.edu>
4606 2003-11-30 Fernando Perez <fperez@colorado.edu>
4602
4607
4603 * IPython/iplib.py (file_matches): new completion code, courtesy
4608 * IPython/iplib.py (file_matches): new completion code, courtesy
4604 of Jeff Collins. This enables filename completion again under
4609 of Jeff Collins. This enables filename completion again under
4605 python 2.3, which disabled it at the C level.
4610 python 2.3, which disabled it at the C level.
4606
4611
4607 2003-11-11 Fernando Perez <fperez@colorado.edu>
4612 2003-11-11 Fernando Perez <fperez@colorado.edu>
4608
4613
4609 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4614 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4610 for Numeric.array(map(...)), but often convenient.
4615 for Numeric.array(map(...)), but often convenient.
4611
4616
4612 2003-11-05 Fernando Perez <fperez@colorado.edu>
4617 2003-11-05 Fernando Perez <fperez@colorado.edu>
4613
4618
4614 * IPython/numutils.py (frange): Changed a call from int() to
4619 * IPython/numutils.py (frange): Changed a call from int() to
4615 int(round()) to prevent a problem reported with arange() in the
4620 int(round()) to prevent a problem reported with arange() in the
4616 numpy list.
4621 numpy list.
4617
4622
4618 2003-10-06 Fernando Perez <fperez@colorado.edu>
4623 2003-10-06 Fernando Perez <fperez@colorado.edu>
4619
4624
4620 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4625 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4621 prevent crashes if sys lacks an argv attribute (it happens with
4626 prevent crashes if sys lacks an argv attribute (it happens with
4622 embedded interpreters which build a bare-bones sys module).
4627 embedded interpreters which build a bare-bones sys module).
4623 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4628 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4624
4629
4625 2003-09-24 Fernando Perez <fperez@colorado.edu>
4630 2003-09-24 Fernando Perez <fperez@colorado.edu>
4626
4631
4627 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4632 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4628 to protect against poorly written user objects where __getattr__
4633 to protect against poorly written user objects where __getattr__
4629 raises exceptions other than AttributeError. Thanks to a bug
4634 raises exceptions other than AttributeError. Thanks to a bug
4630 report by Oliver Sander <osander-AT-gmx.de>.
4635 report by Oliver Sander <osander-AT-gmx.de>.
4631
4636
4632 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4637 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4633 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4638 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4634
4639
4635 2003-09-09 Fernando Perez <fperez@colorado.edu>
4640 2003-09-09 Fernando Perez <fperez@colorado.edu>
4636
4641
4637 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4642 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4638 unpacking a list whith a callable as first element would
4643 unpacking a list whith a callable as first element would
4639 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4644 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4640 Collins.
4645 Collins.
4641
4646
4642 2003-08-25 *** Released version 0.5.0
4647 2003-08-25 *** Released version 0.5.0
4643
4648
4644 2003-08-22 Fernando Perez <fperez@colorado.edu>
4649 2003-08-22 Fernando Perez <fperez@colorado.edu>
4645
4650
4646 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4651 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4647 improperly defined user exceptions. Thanks to feedback from Mark
4652 improperly defined user exceptions. Thanks to feedback from Mark
4648 Russell <mrussell-AT-verio.net>.
4653 Russell <mrussell-AT-verio.net>.
4649
4654
4650 2003-08-20 Fernando Perez <fperez@colorado.edu>
4655 2003-08-20 Fernando Perez <fperez@colorado.edu>
4651
4656
4652 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4657 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4653 printing so that it would print multi-line string forms starting
4658 printing so that it would print multi-line string forms starting
4654 with a new line. This way the formatting is better respected for
4659 with a new line. This way the formatting is better respected for
4655 objects which work hard to make nice string forms.
4660 objects which work hard to make nice string forms.
4656
4661
4657 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4662 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4658 autocall would overtake data access for objects with both
4663 autocall would overtake data access for objects with both
4659 __getitem__ and __call__.
4664 __getitem__ and __call__.
4660
4665
4661 2003-08-19 *** Released version 0.5.0-rc1
4666 2003-08-19 *** Released version 0.5.0-rc1
4662
4667
4663 2003-08-19 Fernando Perez <fperez@colorado.edu>
4668 2003-08-19 Fernando Perez <fperez@colorado.edu>
4664
4669
4665 * IPython/deep_reload.py (load_tail): single tiny change here
4670 * IPython/deep_reload.py (load_tail): single tiny change here
4666 seems to fix the long-standing bug of dreload() failing to work
4671 seems to fix the long-standing bug of dreload() failing to work
4667 for dotted names. But this module is pretty tricky, so I may have
4672 for dotted names. But this module is pretty tricky, so I may have
4668 missed some subtlety. Needs more testing!.
4673 missed some subtlety. Needs more testing!.
4669
4674
4670 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4675 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4671 exceptions which have badly implemented __str__ methods.
4676 exceptions which have badly implemented __str__ methods.
4672 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4677 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4673 which I've been getting reports about from Python 2.3 users. I
4678 which I've been getting reports about from Python 2.3 users. I
4674 wish I had a simple test case to reproduce the problem, so I could
4679 wish I had a simple test case to reproduce the problem, so I could
4675 either write a cleaner workaround or file a bug report if
4680 either write a cleaner workaround or file a bug report if
4676 necessary.
4681 necessary.
4677
4682
4678 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4683 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4679 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4684 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4680 a bug report by Tjabo Kloppenburg.
4685 a bug report by Tjabo Kloppenburg.
4681
4686
4682 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4687 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4683 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4688 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4684 seems rather unstable. Thanks to a bug report by Tjabo
4689 seems rather unstable. Thanks to a bug report by Tjabo
4685 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4690 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4686
4691
4687 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4692 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4688 this out soon because of the critical fixes in the inner loop for
4693 this out soon because of the critical fixes in the inner loop for
4689 generators.
4694 generators.
4690
4695
4691 * IPython/Magic.py (Magic.getargspec): removed. This (and
4696 * IPython/Magic.py (Magic.getargspec): removed. This (and
4692 _get_def) have been obsoleted by OInspect for a long time, I
4697 _get_def) have been obsoleted by OInspect for a long time, I
4693 hadn't noticed that they were dead code.
4698 hadn't noticed that they were dead code.
4694 (Magic._ofind): restored _ofind functionality for a few literals
4699 (Magic._ofind): restored _ofind functionality for a few literals
4695 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4700 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4696 for things like "hello".capitalize?, since that would require a
4701 for things like "hello".capitalize?, since that would require a
4697 potentially dangerous eval() again.
4702 potentially dangerous eval() again.
4698
4703
4699 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4704 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4700 logic a bit more to clean up the escapes handling and minimize the
4705 logic a bit more to clean up the escapes handling and minimize the
4701 use of _ofind to only necessary cases. The interactive 'feel' of
4706 use of _ofind to only necessary cases. The interactive 'feel' of
4702 IPython should have improved quite a bit with the changes in
4707 IPython should have improved quite a bit with the changes in
4703 _prefilter and _ofind (besides being far safer than before).
4708 _prefilter and _ofind (besides being far safer than before).
4704
4709
4705 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4710 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4706 obscure, never reported). Edit would fail to find the object to
4711 obscure, never reported). Edit would fail to find the object to
4707 edit under some circumstances.
4712 edit under some circumstances.
4708 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4713 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4709 which were causing double-calling of generators. Those eval calls
4714 which were causing double-calling of generators. Those eval calls
4710 were _very_ dangerous, since code with side effects could be
4715 were _very_ dangerous, since code with side effects could be
4711 triggered. As they say, 'eval is evil'... These were the
4716 triggered. As they say, 'eval is evil'... These were the
4712 nastiest evals in IPython. Besides, _ofind is now far simpler,
4717 nastiest evals in IPython. Besides, _ofind is now far simpler,
4713 and it should also be quite a bit faster. Its use of inspect is
4718 and it should also be quite a bit faster. Its use of inspect is
4714 also safer, so perhaps some of the inspect-related crashes I've
4719 also safer, so perhaps some of the inspect-related crashes I've
4715 seen lately with Python 2.3 might be taken care of. That will
4720 seen lately with Python 2.3 might be taken care of. That will
4716 need more testing.
4721 need more testing.
4717
4722
4718 2003-08-17 Fernando Perez <fperez@colorado.edu>
4723 2003-08-17 Fernando Perez <fperez@colorado.edu>
4719
4724
4720 * IPython/iplib.py (InteractiveShell._prefilter): significant
4725 * IPython/iplib.py (InteractiveShell._prefilter): significant
4721 simplifications to the logic for handling user escapes. Faster
4726 simplifications to the logic for handling user escapes. Faster
4722 and simpler code.
4727 and simpler code.
4723
4728
4724 2003-08-14 Fernando Perez <fperez@colorado.edu>
4729 2003-08-14 Fernando Perez <fperez@colorado.edu>
4725
4730
4726 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4731 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4727 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4732 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4728 but it should be quite a bit faster. And the recursive version
4733 but it should be quite a bit faster. And the recursive version
4729 generated O(log N) intermediate storage for all rank>1 arrays,
4734 generated O(log N) intermediate storage for all rank>1 arrays,
4730 even if they were contiguous.
4735 even if they were contiguous.
4731 (l1norm): Added this function.
4736 (l1norm): Added this function.
4732 (norm): Added this function for arbitrary norms (including
4737 (norm): Added this function for arbitrary norms (including
4733 l-infinity). l1 and l2 are still special cases for convenience
4738 l-infinity). l1 and l2 are still special cases for convenience
4734 and speed.
4739 and speed.
4735
4740
4736 2003-08-03 Fernando Perez <fperez@colorado.edu>
4741 2003-08-03 Fernando Perez <fperez@colorado.edu>
4737
4742
4738 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4743 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4739 exceptions, which now raise PendingDeprecationWarnings in Python
4744 exceptions, which now raise PendingDeprecationWarnings in Python
4740 2.3. There were some in Magic and some in Gnuplot2.
4745 2.3. There were some in Magic and some in Gnuplot2.
4741
4746
4742 2003-06-30 Fernando Perez <fperez@colorado.edu>
4747 2003-06-30 Fernando Perez <fperez@colorado.edu>
4743
4748
4744 * IPython/genutils.py (page): modified to call curses only for
4749 * IPython/genutils.py (page): modified to call curses only for
4745 terminals where TERM=='xterm'. After problems under many other
4750 terminals where TERM=='xterm'. After problems under many other
4746 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4751 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4747
4752
4748 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4753 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4749 would be triggered when readline was absent. This was just an old
4754 would be triggered when readline was absent. This was just an old
4750 debugging statement I'd forgotten to take out.
4755 debugging statement I'd forgotten to take out.
4751
4756
4752 2003-06-20 Fernando Perez <fperez@colorado.edu>
4757 2003-06-20 Fernando Perez <fperez@colorado.edu>
4753
4758
4754 * IPython/genutils.py (clock): modified to return only user time
4759 * IPython/genutils.py (clock): modified to return only user time
4755 (not counting system time), after a discussion on scipy. While
4760 (not counting system time), after a discussion on scipy. While
4756 system time may be a useful quantity occasionally, it may much
4761 system time may be a useful quantity occasionally, it may much
4757 more easily be skewed by occasional swapping or other similar
4762 more easily be skewed by occasional swapping or other similar
4758 activity.
4763 activity.
4759
4764
4760 2003-06-05 Fernando Perez <fperez@colorado.edu>
4765 2003-06-05 Fernando Perez <fperez@colorado.edu>
4761
4766
4762 * IPython/numutils.py (identity): new function, for building
4767 * IPython/numutils.py (identity): new function, for building
4763 arbitrary rank Kronecker deltas (mostly backwards compatible with
4768 arbitrary rank Kronecker deltas (mostly backwards compatible with
4764 Numeric.identity)
4769 Numeric.identity)
4765
4770
4766 2003-06-03 Fernando Perez <fperez@colorado.edu>
4771 2003-06-03 Fernando Perez <fperez@colorado.edu>
4767
4772
4768 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4773 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4769 arguments passed to magics with spaces, to allow trailing '\' to
4774 arguments passed to magics with spaces, to allow trailing '\' to
4770 work normally (mainly for Windows users).
4775 work normally (mainly for Windows users).
4771
4776
4772 2003-05-29 Fernando Perez <fperez@colorado.edu>
4777 2003-05-29 Fernando Perez <fperez@colorado.edu>
4773
4778
4774 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4779 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4775 instead of pydoc.help. This fixes a bizarre behavior where
4780 instead of pydoc.help. This fixes a bizarre behavior where
4776 printing '%s' % locals() would trigger the help system. Now
4781 printing '%s' % locals() would trigger the help system. Now
4777 ipython behaves like normal python does.
4782 ipython behaves like normal python does.
4778
4783
4779 Note that if one does 'from pydoc import help', the bizarre
4784 Note that if one does 'from pydoc import help', the bizarre
4780 behavior returns, but this will also happen in normal python, so
4785 behavior returns, but this will also happen in normal python, so
4781 it's not an ipython bug anymore (it has to do with how pydoc.help
4786 it's not an ipython bug anymore (it has to do with how pydoc.help
4782 is implemented).
4787 is implemented).
4783
4788
4784 2003-05-22 Fernando Perez <fperez@colorado.edu>
4789 2003-05-22 Fernando Perez <fperez@colorado.edu>
4785
4790
4786 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4791 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4787 return [] instead of None when nothing matches, also match to end
4792 return [] instead of None when nothing matches, also match to end
4788 of line. Patch by Gary Bishop.
4793 of line. Patch by Gary Bishop.
4789
4794
4790 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4795 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4791 protection as before, for files passed on the command line. This
4796 protection as before, for files passed on the command line. This
4792 prevents the CrashHandler from kicking in if user files call into
4797 prevents the CrashHandler from kicking in if user files call into
4793 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4798 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4794 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4799 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4795
4800
4796 2003-05-20 *** Released version 0.4.0
4801 2003-05-20 *** Released version 0.4.0
4797
4802
4798 2003-05-20 Fernando Perez <fperez@colorado.edu>
4803 2003-05-20 Fernando Perez <fperez@colorado.edu>
4799
4804
4800 * setup.py: added support for manpages. It's a bit hackish b/c of
4805 * setup.py: added support for manpages. It's a bit hackish b/c of
4801 a bug in the way the bdist_rpm distutils target handles gzipped
4806 a bug in the way the bdist_rpm distutils target handles gzipped
4802 manpages, but it works. After a patch by Jack.
4807 manpages, but it works. After a patch by Jack.
4803
4808
4804 2003-05-19 Fernando Perez <fperez@colorado.edu>
4809 2003-05-19 Fernando Perez <fperez@colorado.edu>
4805
4810
4806 * IPython/numutils.py: added a mockup of the kinds module, since
4811 * IPython/numutils.py: added a mockup of the kinds module, since
4807 it was recently removed from Numeric. This way, numutils will
4812 it was recently removed from Numeric. This way, numutils will
4808 work for all users even if they are missing kinds.
4813 work for all users even if they are missing kinds.
4809
4814
4810 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4815 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4811 failure, which can occur with SWIG-wrapped extensions. After a
4816 failure, which can occur with SWIG-wrapped extensions. After a
4812 crash report from Prabhu.
4817 crash report from Prabhu.
4813
4818
4814 2003-05-16 Fernando Perez <fperez@colorado.edu>
4819 2003-05-16 Fernando Perez <fperez@colorado.edu>
4815
4820
4816 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4821 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4817 protect ipython from user code which may call directly
4822 protect ipython from user code which may call directly
4818 sys.excepthook (this looks like an ipython crash to the user, even
4823 sys.excepthook (this looks like an ipython crash to the user, even
4819 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4824 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4820 This is especially important to help users of WxWindows, but may
4825 This is especially important to help users of WxWindows, but may
4821 also be useful in other cases.
4826 also be useful in other cases.
4822
4827
4823 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4828 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4824 an optional tb_offset to be specified, and to preserve exception
4829 an optional tb_offset to be specified, and to preserve exception
4825 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4830 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4826
4831
4827 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4832 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4828
4833
4829 2003-05-15 Fernando Perez <fperez@colorado.edu>
4834 2003-05-15 Fernando Perez <fperez@colorado.edu>
4830
4835
4831 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4836 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4832 installing for a new user under Windows.
4837 installing for a new user under Windows.
4833
4838
4834 2003-05-12 Fernando Perez <fperez@colorado.edu>
4839 2003-05-12 Fernando Perez <fperez@colorado.edu>
4835
4840
4836 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4841 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4837 handler for Emacs comint-based lines. Currently it doesn't do
4842 handler for Emacs comint-based lines. Currently it doesn't do
4838 much (but importantly, it doesn't update the history cache). In
4843 much (but importantly, it doesn't update the history cache). In
4839 the future it may be expanded if Alex needs more functionality
4844 the future it may be expanded if Alex needs more functionality
4840 there.
4845 there.
4841
4846
4842 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4847 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4843 info to crash reports.
4848 info to crash reports.
4844
4849
4845 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4850 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4846 just like Python's -c. Also fixed crash with invalid -color
4851 just like Python's -c. Also fixed crash with invalid -color
4847 option value at startup. Thanks to Will French
4852 option value at startup. Thanks to Will French
4848 <wfrench-AT-bestweb.net> for the bug report.
4853 <wfrench-AT-bestweb.net> for the bug report.
4849
4854
4850 2003-05-09 Fernando Perez <fperez@colorado.edu>
4855 2003-05-09 Fernando Perez <fperez@colorado.edu>
4851
4856
4852 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4857 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4853 to EvalDict (it's a mapping, after all) and simplified its code
4858 to EvalDict (it's a mapping, after all) and simplified its code
4854 quite a bit, after a nice discussion on c.l.py where Gustavo
4859 quite a bit, after a nice discussion on c.l.py where Gustavo
4855 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4860 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4856
4861
4857 2003-04-30 Fernando Perez <fperez@colorado.edu>
4862 2003-04-30 Fernando Perez <fperez@colorado.edu>
4858
4863
4859 * IPython/genutils.py (timings_out): modified it to reduce its
4864 * IPython/genutils.py (timings_out): modified it to reduce its
4860 overhead in the common reps==1 case.
4865 overhead in the common reps==1 case.
4861
4866
4862 2003-04-29 Fernando Perez <fperez@colorado.edu>
4867 2003-04-29 Fernando Perez <fperez@colorado.edu>
4863
4868
4864 * IPython/genutils.py (timings_out): Modified to use the resource
4869 * IPython/genutils.py (timings_out): Modified to use the resource
4865 module, which avoids the wraparound problems of time.clock().
4870 module, which avoids the wraparound problems of time.clock().
4866
4871
4867 2003-04-17 *** Released version 0.2.15pre4
4872 2003-04-17 *** Released version 0.2.15pre4
4868
4873
4869 2003-04-17 Fernando Perez <fperez@colorado.edu>
4874 2003-04-17 Fernando Perez <fperez@colorado.edu>
4870
4875
4871 * setup.py (scriptfiles): Split windows-specific stuff over to a
4876 * setup.py (scriptfiles): Split windows-specific stuff over to a
4872 separate file, in an attempt to have a Windows GUI installer.
4877 separate file, in an attempt to have a Windows GUI installer.
4873 That didn't work, but part of the groundwork is done.
4878 That didn't work, but part of the groundwork is done.
4874
4879
4875 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4880 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4876 indent/unindent with 4 spaces. Particularly useful in combination
4881 indent/unindent with 4 spaces. Particularly useful in combination
4877 with the new auto-indent option.
4882 with the new auto-indent option.
4878
4883
4879 2003-04-16 Fernando Perez <fperez@colorado.edu>
4884 2003-04-16 Fernando Perez <fperez@colorado.edu>
4880
4885
4881 * IPython/Magic.py: various replacements of self.rc for
4886 * IPython/Magic.py: various replacements of self.rc for
4882 self.shell.rc. A lot more remains to be done to fully disentangle
4887 self.shell.rc. A lot more remains to be done to fully disentangle
4883 this class from the main Shell class.
4888 this class from the main Shell class.
4884
4889
4885 * IPython/GnuplotRuntime.py: added checks for mouse support so
4890 * IPython/GnuplotRuntime.py: added checks for mouse support so
4886 that we don't try to enable it if the current gnuplot doesn't
4891 that we don't try to enable it if the current gnuplot doesn't
4887 really support it. Also added checks so that we don't try to
4892 really support it. Also added checks so that we don't try to
4888 enable persist under Windows (where Gnuplot doesn't recognize the
4893 enable persist under Windows (where Gnuplot doesn't recognize the
4889 option).
4894 option).
4890
4895
4891 * IPython/iplib.py (InteractiveShell.interact): Added optional
4896 * IPython/iplib.py (InteractiveShell.interact): Added optional
4892 auto-indenting code, after a patch by King C. Shu
4897 auto-indenting code, after a patch by King C. Shu
4893 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4898 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4894 get along well with pasting indented code. If I ever figure out
4899 get along well with pasting indented code. If I ever figure out
4895 how to make that part go well, it will become on by default.
4900 how to make that part go well, it will become on by default.
4896
4901
4897 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4902 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4898 crash ipython if there was an unmatched '%' in the user's prompt
4903 crash ipython if there was an unmatched '%' in the user's prompt
4899 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4904 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4900
4905
4901 * IPython/iplib.py (InteractiveShell.interact): removed the
4906 * IPython/iplib.py (InteractiveShell.interact): removed the
4902 ability to ask the user whether he wants to crash or not at the
4907 ability to ask the user whether he wants to crash or not at the
4903 'last line' exception handler. Calling functions at that point
4908 'last line' exception handler. Calling functions at that point
4904 changes the stack, and the error reports would have incorrect
4909 changes the stack, and the error reports would have incorrect
4905 tracebacks.
4910 tracebacks.
4906
4911
4907 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4912 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4908 pass through a peger a pretty-printed form of any object. After a
4913 pass through a peger a pretty-printed form of any object. After a
4909 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4914 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4910
4915
4911 2003-04-14 Fernando Perez <fperez@colorado.edu>
4916 2003-04-14 Fernando Perez <fperez@colorado.edu>
4912
4917
4913 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4918 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4914 all files in ~ would be modified at first install (instead of
4919 all files in ~ would be modified at first install (instead of
4915 ~/.ipython). This could be potentially disastrous, as the
4920 ~/.ipython). This could be potentially disastrous, as the
4916 modification (make line-endings native) could damage binary files.
4921 modification (make line-endings native) could damage binary files.
4917
4922
4918 2003-04-10 Fernando Perez <fperez@colorado.edu>
4923 2003-04-10 Fernando Perez <fperez@colorado.edu>
4919
4924
4920 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4925 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4921 handle only lines which are invalid python. This now means that
4926 handle only lines which are invalid python. This now means that
4922 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4927 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4923 for the bug report.
4928 for the bug report.
4924
4929
4925 2003-04-01 Fernando Perez <fperez@colorado.edu>
4930 2003-04-01 Fernando Perez <fperez@colorado.edu>
4926
4931
4927 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4932 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4928 where failing to set sys.last_traceback would crash pdb.pm().
4933 where failing to set sys.last_traceback would crash pdb.pm().
4929 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4934 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4930 report.
4935 report.
4931
4936
4932 2003-03-25 Fernando Perez <fperez@colorado.edu>
4937 2003-03-25 Fernando Perez <fperez@colorado.edu>
4933
4938
4934 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4939 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4935 before printing it (it had a lot of spurious blank lines at the
4940 before printing it (it had a lot of spurious blank lines at the
4936 end).
4941 end).
4937
4942
4938 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4943 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4939 output would be sent 21 times! Obviously people don't use this
4944 output would be sent 21 times! Obviously people don't use this
4940 too often, or I would have heard about it.
4945 too often, or I would have heard about it.
4941
4946
4942 2003-03-24 Fernando Perez <fperez@colorado.edu>
4947 2003-03-24 Fernando Perez <fperez@colorado.edu>
4943
4948
4944 * setup.py (scriptfiles): renamed the data_files parameter from
4949 * setup.py (scriptfiles): renamed the data_files parameter from
4945 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4950 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4946 for the patch.
4951 for the patch.
4947
4952
4948 2003-03-20 Fernando Perez <fperez@colorado.edu>
4953 2003-03-20 Fernando Perez <fperez@colorado.edu>
4949
4954
4950 * IPython/genutils.py (error): added error() and fatal()
4955 * IPython/genutils.py (error): added error() and fatal()
4951 functions.
4956 functions.
4952
4957
4953 2003-03-18 *** Released version 0.2.15pre3
4958 2003-03-18 *** Released version 0.2.15pre3
4954
4959
4955 2003-03-18 Fernando Perez <fperez@colorado.edu>
4960 2003-03-18 Fernando Perez <fperez@colorado.edu>
4956
4961
4957 * setupext/install_data_ext.py
4962 * setupext/install_data_ext.py
4958 (install_data_ext.initialize_options): Class contributed by Jack
4963 (install_data_ext.initialize_options): Class contributed by Jack
4959 Moffit for fixing the old distutils hack. He is sending this to
4964 Moffit for fixing the old distutils hack. He is sending this to
4960 the distutils folks so in the future we may not need it as a
4965 the distutils folks so in the future we may not need it as a
4961 private fix.
4966 private fix.
4962
4967
4963 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4968 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4964 changes for Debian packaging. See his patch for full details.
4969 changes for Debian packaging. See his patch for full details.
4965 The old distutils hack of making the ipythonrc* files carry a
4970 The old distutils hack of making the ipythonrc* files carry a
4966 bogus .py extension is gone, at last. Examples were moved to a
4971 bogus .py extension is gone, at last. Examples were moved to a
4967 separate subdir under doc/, and the separate executable scripts
4972 separate subdir under doc/, and the separate executable scripts
4968 now live in their own directory. Overall a great cleanup. The
4973 now live in their own directory. Overall a great cleanup. The
4969 manual was updated to use the new files, and setup.py has been
4974 manual was updated to use the new files, and setup.py has been
4970 fixed for this setup.
4975 fixed for this setup.
4971
4976
4972 * IPython/PyColorize.py (Parser.usage): made non-executable and
4977 * IPython/PyColorize.py (Parser.usage): made non-executable and
4973 created a pycolor wrapper around it to be included as a script.
4978 created a pycolor wrapper around it to be included as a script.
4974
4979
4975 2003-03-12 *** Released version 0.2.15pre2
4980 2003-03-12 *** Released version 0.2.15pre2
4976
4981
4977 2003-03-12 Fernando Perez <fperez@colorado.edu>
4982 2003-03-12 Fernando Perez <fperez@colorado.edu>
4978
4983
4979 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4984 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4980 long-standing problem with garbage characters in some terminals.
4985 long-standing problem with garbage characters in some terminals.
4981 The issue was really that the \001 and \002 escapes must _only_ be
4986 The issue was really that the \001 and \002 escapes must _only_ be
4982 passed to input prompts (which call readline), but _never_ to
4987 passed to input prompts (which call readline), but _never_ to
4983 normal text to be printed on screen. I changed ColorANSI to have
4988 normal text to be printed on screen. I changed ColorANSI to have
4984 two classes: TermColors and InputTermColors, each with the
4989 two classes: TermColors and InputTermColors, each with the
4985 appropriate escapes for input prompts or normal text. The code in
4990 appropriate escapes for input prompts or normal text. The code in
4986 Prompts.py got slightly more complicated, but this very old and
4991 Prompts.py got slightly more complicated, but this very old and
4987 annoying bug is finally fixed.
4992 annoying bug is finally fixed.
4988
4993
4989 All the credit for nailing down the real origin of this problem
4994 All the credit for nailing down the real origin of this problem
4990 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4995 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4991 *Many* thanks to him for spending quite a bit of effort on this.
4996 *Many* thanks to him for spending quite a bit of effort on this.
4992
4997
4993 2003-03-05 *** Released version 0.2.15pre1
4998 2003-03-05 *** Released version 0.2.15pre1
4994
4999
4995 2003-03-03 Fernando Perez <fperez@colorado.edu>
5000 2003-03-03 Fernando Perez <fperez@colorado.edu>
4996
5001
4997 * IPython/FakeModule.py: Moved the former _FakeModule to a
5002 * IPython/FakeModule.py: Moved the former _FakeModule to a
4998 separate file, because it's also needed by Magic (to fix a similar
5003 separate file, because it's also needed by Magic (to fix a similar
4999 pickle-related issue in @run).
5004 pickle-related issue in @run).
5000
5005
5001 2003-03-02 Fernando Perez <fperez@colorado.edu>
5006 2003-03-02 Fernando Perez <fperez@colorado.edu>
5002
5007
5003 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5008 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5004 the autocall option at runtime.
5009 the autocall option at runtime.
5005 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5010 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5006 across Magic.py to start separating Magic from InteractiveShell.
5011 across Magic.py to start separating Magic from InteractiveShell.
5007 (Magic._ofind): Fixed to return proper namespace for dotted
5012 (Magic._ofind): Fixed to return proper namespace for dotted
5008 names. Before, a dotted name would always return 'not currently
5013 names. Before, a dotted name would always return 'not currently
5009 defined', because it would find the 'parent'. s.x would be found,
5014 defined', because it would find the 'parent'. s.x would be found,
5010 but since 'x' isn't defined by itself, it would get confused.
5015 but since 'x' isn't defined by itself, it would get confused.
5011 (Magic.magic_run): Fixed pickling problems reported by Ralf
5016 (Magic.magic_run): Fixed pickling problems reported by Ralf
5012 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5017 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5013 that I'd used when Mike Heeter reported similar issues at the
5018 that I'd used when Mike Heeter reported similar issues at the
5014 top-level, but now for @run. It boils down to injecting the
5019 top-level, but now for @run. It boils down to injecting the
5015 namespace where code is being executed with something that looks
5020 namespace where code is being executed with something that looks
5016 enough like a module to fool pickle.dump(). Since a pickle stores
5021 enough like a module to fool pickle.dump(). Since a pickle stores
5017 a named reference to the importing module, we need this for
5022 a named reference to the importing module, we need this for
5018 pickles to save something sensible.
5023 pickles to save something sensible.
5019
5024
5020 * IPython/ipmaker.py (make_IPython): added an autocall option.
5025 * IPython/ipmaker.py (make_IPython): added an autocall option.
5021
5026
5022 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5027 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5023 the auto-eval code. Now autocalling is an option, and the code is
5028 the auto-eval code. Now autocalling is an option, and the code is
5024 also vastly safer. There is no more eval() involved at all.
5029 also vastly safer. There is no more eval() involved at all.
5025
5030
5026 2003-03-01 Fernando Perez <fperez@colorado.edu>
5031 2003-03-01 Fernando Perez <fperez@colorado.edu>
5027
5032
5028 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5033 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5029 dict with named keys instead of a tuple.
5034 dict with named keys instead of a tuple.
5030
5035
5031 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5036 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5032
5037
5033 * setup.py (make_shortcut): Fixed message about directories
5038 * setup.py (make_shortcut): Fixed message about directories
5034 created during Windows installation (the directories were ok, just
5039 created during Windows installation (the directories were ok, just
5035 the printed message was misleading). Thanks to Chris Liechti
5040 the printed message was misleading). Thanks to Chris Liechti
5036 <cliechti-AT-gmx.net> for the heads up.
5041 <cliechti-AT-gmx.net> for the heads up.
5037
5042
5038 2003-02-21 Fernando Perez <fperez@colorado.edu>
5043 2003-02-21 Fernando Perez <fperez@colorado.edu>
5039
5044
5040 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5045 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5041 of ValueError exception when checking for auto-execution. This
5046 of ValueError exception when checking for auto-execution. This
5042 one is raised by things like Numeric arrays arr.flat when the
5047 one is raised by things like Numeric arrays arr.flat when the
5043 array is non-contiguous.
5048 array is non-contiguous.
5044
5049
5045 2003-01-31 Fernando Perez <fperez@colorado.edu>
5050 2003-01-31 Fernando Perez <fperez@colorado.edu>
5046
5051
5047 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5052 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5048 not return any value at all (even though the command would get
5053 not return any value at all (even though the command would get
5049 executed).
5054 executed).
5050 (xsys): Flush stdout right after printing the command to ensure
5055 (xsys): Flush stdout right after printing the command to ensure
5051 proper ordering of commands and command output in the total
5056 proper ordering of commands and command output in the total
5052 output.
5057 output.
5053 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5058 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5054 system/getoutput as defaults. The old ones are kept for
5059 system/getoutput as defaults. The old ones are kept for
5055 compatibility reasons, so no code which uses this library needs
5060 compatibility reasons, so no code which uses this library needs
5056 changing.
5061 changing.
5057
5062
5058 2003-01-27 *** Released version 0.2.14
5063 2003-01-27 *** Released version 0.2.14
5059
5064
5060 2003-01-25 Fernando Perez <fperez@colorado.edu>
5065 2003-01-25 Fernando Perez <fperez@colorado.edu>
5061
5066
5062 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5067 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5063 functions defined in previous edit sessions could not be re-edited
5068 functions defined in previous edit sessions could not be re-edited
5064 (because the temp files were immediately removed). Now temp files
5069 (because the temp files were immediately removed). Now temp files
5065 are removed only at IPython's exit.
5070 are removed only at IPython's exit.
5066 (Magic.magic_run): Improved @run to perform shell-like expansions
5071 (Magic.magic_run): Improved @run to perform shell-like expansions
5067 on its arguments (~users and $VARS). With this, @run becomes more
5072 on its arguments (~users and $VARS). With this, @run becomes more
5068 like a normal command-line.
5073 like a normal command-line.
5069
5074
5070 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5075 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5071 bugs related to embedding and cleaned up that code. A fairly
5076 bugs related to embedding and cleaned up that code. A fairly
5072 important one was the impossibility to access the global namespace
5077 important one was the impossibility to access the global namespace
5073 through the embedded IPython (only local variables were visible).
5078 through the embedded IPython (only local variables were visible).
5074
5079
5075 2003-01-14 Fernando Perez <fperez@colorado.edu>
5080 2003-01-14 Fernando Perez <fperez@colorado.edu>
5076
5081
5077 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5082 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5078 auto-calling to be a bit more conservative. Now it doesn't get
5083 auto-calling to be a bit more conservative. Now it doesn't get
5079 triggered if any of '!=()<>' are in the rest of the input line, to
5084 triggered if any of '!=()<>' are in the rest of the input line, to
5080 allow comparing callables. Thanks to Alex for the heads up.
5085 allow comparing callables. Thanks to Alex for the heads up.
5081
5086
5082 2003-01-07 Fernando Perez <fperez@colorado.edu>
5087 2003-01-07 Fernando Perez <fperez@colorado.edu>
5083
5088
5084 * IPython/genutils.py (page): fixed estimation of the number of
5089 * IPython/genutils.py (page): fixed estimation of the number of
5085 lines in a string to be paged to simply count newlines. This
5090 lines in a string to be paged to simply count newlines. This
5086 prevents over-guessing due to embedded escape sequences. A better
5091 prevents over-guessing due to embedded escape sequences. A better
5087 long-term solution would involve stripping out the control chars
5092 long-term solution would involve stripping out the control chars
5088 for the count, but it's potentially so expensive I just don't
5093 for the count, but it's potentially so expensive I just don't
5089 think it's worth doing.
5094 think it's worth doing.
5090
5095
5091 2002-12-19 *** Released version 0.2.14pre50
5096 2002-12-19 *** Released version 0.2.14pre50
5092
5097
5093 2002-12-19 Fernando Perez <fperez@colorado.edu>
5098 2002-12-19 Fernando Perez <fperez@colorado.edu>
5094
5099
5095 * tools/release (version): Changed release scripts to inform
5100 * tools/release (version): Changed release scripts to inform
5096 Andrea and build a NEWS file with a list of recent changes.
5101 Andrea and build a NEWS file with a list of recent changes.
5097
5102
5098 * IPython/ColorANSI.py (__all__): changed terminal detection
5103 * IPython/ColorANSI.py (__all__): changed terminal detection
5099 code. Seems to work better for xterms without breaking
5104 code. Seems to work better for xterms without breaking
5100 konsole. Will need more testing to determine if WinXP and Mac OSX
5105 konsole. Will need more testing to determine if WinXP and Mac OSX
5101 also work ok.
5106 also work ok.
5102
5107
5103 2002-12-18 *** Released version 0.2.14pre49
5108 2002-12-18 *** Released version 0.2.14pre49
5104
5109
5105 2002-12-18 Fernando Perez <fperez@colorado.edu>
5110 2002-12-18 Fernando Perez <fperez@colorado.edu>
5106
5111
5107 * Docs: added new info about Mac OSX, from Andrea.
5112 * Docs: added new info about Mac OSX, from Andrea.
5108
5113
5109 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5114 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5110 allow direct plotting of python strings whose format is the same
5115 allow direct plotting of python strings whose format is the same
5111 of gnuplot data files.
5116 of gnuplot data files.
5112
5117
5113 2002-12-16 Fernando Perez <fperez@colorado.edu>
5118 2002-12-16 Fernando Perez <fperez@colorado.edu>
5114
5119
5115 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5120 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5116 value of exit question to be acknowledged.
5121 value of exit question to be acknowledged.
5117
5122
5118 2002-12-03 Fernando Perez <fperez@colorado.edu>
5123 2002-12-03 Fernando Perez <fperez@colorado.edu>
5119
5124
5120 * IPython/ipmaker.py: removed generators, which had been added
5125 * IPython/ipmaker.py: removed generators, which had been added
5121 by mistake in an earlier debugging run. This was causing trouble
5126 by mistake in an earlier debugging run. This was causing trouble
5122 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5127 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5123 for pointing this out.
5128 for pointing this out.
5124
5129
5125 2002-11-17 Fernando Perez <fperez@colorado.edu>
5130 2002-11-17 Fernando Perez <fperez@colorado.edu>
5126
5131
5127 * Manual: updated the Gnuplot section.
5132 * Manual: updated the Gnuplot section.
5128
5133
5129 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5134 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5130 a much better split of what goes in Runtime and what goes in
5135 a much better split of what goes in Runtime and what goes in
5131 Interactive.
5136 Interactive.
5132
5137
5133 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5138 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5134 being imported from iplib.
5139 being imported from iplib.
5135
5140
5136 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5141 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5137 for command-passing. Now the global Gnuplot instance is called
5142 for command-passing. Now the global Gnuplot instance is called
5138 'gp' instead of 'g', which was really a far too fragile and
5143 'gp' instead of 'g', which was really a far too fragile and
5139 common name.
5144 common name.
5140
5145
5141 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5146 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5142 bounding boxes generated by Gnuplot for square plots.
5147 bounding boxes generated by Gnuplot for square plots.
5143
5148
5144 * IPython/genutils.py (popkey): new function added. I should
5149 * IPython/genutils.py (popkey): new function added. I should
5145 suggest this on c.l.py as a dict method, it seems useful.
5150 suggest this on c.l.py as a dict method, it seems useful.
5146
5151
5147 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5152 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5148 to transparently handle PostScript generation. MUCH better than
5153 to transparently handle PostScript generation. MUCH better than
5149 the previous plot_eps/replot_eps (which I removed now). The code
5154 the previous plot_eps/replot_eps (which I removed now). The code
5150 is also fairly clean and well documented now (including
5155 is also fairly clean and well documented now (including
5151 docstrings).
5156 docstrings).
5152
5157
5153 2002-11-13 Fernando Perez <fperez@colorado.edu>
5158 2002-11-13 Fernando Perez <fperez@colorado.edu>
5154
5159
5155 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5160 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5156 (inconsistent with options).
5161 (inconsistent with options).
5157
5162
5158 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5163 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5159 manually disabled, I don't know why. Fixed it.
5164 manually disabled, I don't know why. Fixed it.
5160 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5165 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5161 eps output.
5166 eps output.
5162
5167
5163 2002-11-12 Fernando Perez <fperez@colorado.edu>
5168 2002-11-12 Fernando Perez <fperez@colorado.edu>
5164
5169
5165 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5170 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5166 don't propagate up to caller. Fixes crash reported by François
5171 don't propagate up to caller. Fixes crash reported by François
5167 Pinard.
5172 Pinard.
5168
5173
5169 2002-11-09 Fernando Perez <fperez@colorado.edu>
5174 2002-11-09 Fernando Perez <fperez@colorado.edu>
5170
5175
5171 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5176 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5172 history file for new users.
5177 history file for new users.
5173 (make_IPython): fixed bug where initial install would leave the
5178 (make_IPython): fixed bug where initial install would leave the
5174 user running in the .ipython dir.
5179 user running in the .ipython dir.
5175 (make_IPython): fixed bug where config dir .ipython would be
5180 (make_IPython): fixed bug where config dir .ipython would be
5176 created regardless of the given -ipythondir option. Thanks to Cory
5181 created regardless of the given -ipythondir option. Thanks to Cory
5177 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5182 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5178
5183
5179 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5184 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5180 type confirmations. Will need to use it in all of IPython's code
5185 type confirmations. Will need to use it in all of IPython's code
5181 consistently.
5186 consistently.
5182
5187
5183 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5188 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5184 context to print 31 lines instead of the default 5. This will make
5189 context to print 31 lines instead of the default 5. This will make
5185 the crash reports extremely detailed in case the problem is in
5190 the crash reports extremely detailed in case the problem is in
5186 libraries I don't have access to.
5191 libraries I don't have access to.
5187
5192
5188 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5193 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5189 line of defense' code to still crash, but giving users fair
5194 line of defense' code to still crash, but giving users fair
5190 warning. I don't want internal errors to go unreported: if there's
5195 warning. I don't want internal errors to go unreported: if there's
5191 an internal problem, IPython should crash and generate a full
5196 an internal problem, IPython should crash and generate a full
5192 report.
5197 report.
5193
5198
5194 2002-11-08 Fernando Perez <fperez@colorado.edu>
5199 2002-11-08 Fernando Perez <fperez@colorado.edu>
5195
5200
5196 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5201 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5197 otherwise uncaught exceptions which can appear if people set
5202 otherwise uncaught exceptions which can appear if people set
5198 sys.stdout to something badly broken. Thanks to a crash report
5203 sys.stdout to something badly broken. Thanks to a crash report
5199 from henni-AT-mail.brainbot.com.
5204 from henni-AT-mail.brainbot.com.
5200
5205
5201 2002-11-04 Fernando Perez <fperez@colorado.edu>
5206 2002-11-04 Fernando Perez <fperez@colorado.edu>
5202
5207
5203 * IPython/iplib.py (InteractiveShell.interact): added
5208 * IPython/iplib.py (InteractiveShell.interact): added
5204 __IPYTHON__active to the builtins. It's a flag which goes on when
5209 __IPYTHON__active to the builtins. It's a flag which goes on when
5205 the interaction starts and goes off again when it stops. This
5210 the interaction starts and goes off again when it stops. This
5206 allows embedding code to detect being inside IPython. Before this
5211 allows embedding code to detect being inside IPython. Before this
5207 was done via __IPYTHON__, but that only shows that an IPython
5212 was done via __IPYTHON__, but that only shows that an IPython
5208 instance has been created.
5213 instance has been created.
5209
5214
5210 * IPython/Magic.py (Magic.magic_env): I realized that in a
5215 * IPython/Magic.py (Magic.magic_env): I realized that in a
5211 UserDict, instance.data holds the data as a normal dict. So I
5216 UserDict, instance.data holds the data as a normal dict. So I
5212 modified @env to return os.environ.data instead of rebuilding a
5217 modified @env to return os.environ.data instead of rebuilding a
5213 dict by hand.
5218 dict by hand.
5214
5219
5215 2002-11-02 Fernando Perez <fperez@colorado.edu>
5220 2002-11-02 Fernando Perez <fperez@colorado.edu>
5216
5221
5217 * IPython/genutils.py (warn): changed so that level 1 prints no
5222 * IPython/genutils.py (warn): changed so that level 1 prints no
5218 header. Level 2 is now the default (with 'WARNING' header, as
5223 header. Level 2 is now the default (with 'WARNING' header, as
5219 before). I think I tracked all places where changes were needed in
5224 before). I think I tracked all places where changes were needed in
5220 IPython, but outside code using the old level numbering may have
5225 IPython, but outside code using the old level numbering may have
5221 broken.
5226 broken.
5222
5227
5223 * IPython/iplib.py (InteractiveShell.runcode): added this to
5228 * IPython/iplib.py (InteractiveShell.runcode): added this to
5224 handle the tracebacks in SystemExit traps correctly. The previous
5229 handle the tracebacks in SystemExit traps correctly. The previous
5225 code (through interact) was printing more of the stack than
5230 code (through interact) was printing more of the stack than
5226 necessary, showing IPython internal code to the user.
5231 necessary, showing IPython internal code to the user.
5227
5232
5228 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5233 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5229 default. Now that the default at the confirmation prompt is yes,
5234 default. Now that the default at the confirmation prompt is yes,
5230 it's not so intrusive. François' argument that ipython sessions
5235 it's not so intrusive. François' argument that ipython sessions
5231 tend to be complex enough not to lose them from an accidental C-d,
5236 tend to be complex enough not to lose them from an accidental C-d,
5232 is a valid one.
5237 is a valid one.
5233
5238
5234 * IPython/iplib.py (InteractiveShell.interact): added a
5239 * IPython/iplib.py (InteractiveShell.interact): added a
5235 showtraceback() call to the SystemExit trap, and modified the exit
5240 showtraceback() call to the SystemExit trap, and modified the exit
5236 confirmation to have yes as the default.
5241 confirmation to have yes as the default.
5237
5242
5238 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5243 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5239 this file. It's been gone from the code for a long time, this was
5244 this file. It's been gone from the code for a long time, this was
5240 simply leftover junk.
5245 simply leftover junk.
5241
5246
5242 2002-11-01 Fernando Perez <fperez@colorado.edu>
5247 2002-11-01 Fernando Perez <fperez@colorado.edu>
5243
5248
5244 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5249 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5245 added. If set, IPython now traps EOF and asks for
5250 added. If set, IPython now traps EOF and asks for
5246 confirmation. After a request by François Pinard.
5251 confirmation. After a request by François Pinard.
5247
5252
5248 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5253 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5249 of @abort, and with a new (better) mechanism for handling the
5254 of @abort, and with a new (better) mechanism for handling the
5250 exceptions.
5255 exceptions.
5251
5256
5252 2002-10-27 Fernando Perez <fperez@colorado.edu>
5257 2002-10-27 Fernando Perez <fperez@colorado.edu>
5253
5258
5254 * IPython/usage.py (__doc__): updated the --help information and
5259 * IPython/usage.py (__doc__): updated the --help information and
5255 the ipythonrc file to indicate that -log generates
5260 the ipythonrc file to indicate that -log generates
5256 ./ipython.log. Also fixed the corresponding info in @logstart.
5261 ./ipython.log. Also fixed the corresponding info in @logstart.
5257 This and several other fixes in the manuals thanks to reports by
5262 This and several other fixes in the manuals thanks to reports by
5258 François Pinard <pinard-AT-iro.umontreal.ca>.
5263 François Pinard <pinard-AT-iro.umontreal.ca>.
5259
5264
5260 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5265 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5261 refer to @logstart (instead of @log, which doesn't exist).
5266 refer to @logstart (instead of @log, which doesn't exist).
5262
5267
5263 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5268 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5264 AttributeError crash. Thanks to Christopher Armstrong
5269 AttributeError crash. Thanks to Christopher Armstrong
5265 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5270 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5266 introduced recently (in 0.2.14pre37) with the fix to the eval
5271 introduced recently (in 0.2.14pre37) with the fix to the eval
5267 problem mentioned below.
5272 problem mentioned below.
5268
5273
5269 2002-10-17 Fernando Perez <fperez@colorado.edu>
5274 2002-10-17 Fernando Perez <fperez@colorado.edu>
5270
5275
5271 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5276 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5272 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5277 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5273
5278
5274 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5279 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5275 this function to fix a problem reported by Alex Schmolck. He saw
5280 this function to fix a problem reported by Alex Schmolck. He saw
5276 it with list comprehensions and generators, which were getting
5281 it with list comprehensions and generators, which were getting
5277 called twice. The real problem was an 'eval' call in testing for
5282 called twice. The real problem was an 'eval' call in testing for
5278 automagic which was evaluating the input line silently.
5283 automagic which was evaluating the input line silently.
5279
5284
5280 This is a potentially very nasty bug, if the input has side
5285 This is a potentially very nasty bug, if the input has side
5281 effects which must not be repeated. The code is much cleaner now,
5286 effects which must not be repeated. The code is much cleaner now,
5282 without any blanket 'except' left and with a regexp test for
5287 without any blanket 'except' left and with a regexp test for
5283 actual function names.
5288 actual function names.
5284
5289
5285 But an eval remains, which I'm not fully comfortable with. I just
5290 But an eval remains, which I'm not fully comfortable with. I just
5286 don't know how to find out if an expression could be a callable in
5291 don't know how to find out if an expression could be a callable in
5287 the user's namespace without doing an eval on the string. However
5292 the user's namespace without doing an eval on the string. However
5288 that string is now much more strictly checked so that no code
5293 that string is now much more strictly checked so that no code
5289 slips by, so the eval should only happen for things that can
5294 slips by, so the eval should only happen for things that can
5290 really be only function/method names.
5295 really be only function/method names.
5291
5296
5292 2002-10-15 Fernando Perez <fperez@colorado.edu>
5297 2002-10-15 Fernando Perez <fperez@colorado.edu>
5293
5298
5294 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5299 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5295 OSX information to main manual, removed README_Mac_OSX file from
5300 OSX information to main manual, removed README_Mac_OSX file from
5296 distribution. Also updated credits for recent additions.
5301 distribution. Also updated credits for recent additions.
5297
5302
5298 2002-10-10 Fernando Perez <fperez@colorado.edu>
5303 2002-10-10 Fernando Perez <fperez@colorado.edu>
5299
5304
5300 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5305 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5301 terminal-related issues. Many thanks to Andrea Riciputi
5306 terminal-related issues. Many thanks to Andrea Riciputi
5302 <andrea.riciputi-AT-libero.it> for writing it.
5307 <andrea.riciputi-AT-libero.it> for writing it.
5303
5308
5304 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5309 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5305 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5310 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5306
5311
5307 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5312 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5308 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5313 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5309 <syver-en-AT-online.no> who both submitted patches for this problem.
5314 <syver-en-AT-online.no> who both submitted patches for this problem.
5310
5315
5311 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5316 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5312 global embedding to make sure that things don't overwrite user
5317 global embedding to make sure that things don't overwrite user
5313 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5318 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5314
5319
5315 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5320 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5316 compatibility. Thanks to Hayden Callow
5321 compatibility. Thanks to Hayden Callow
5317 <h.callow-AT-elec.canterbury.ac.nz>
5322 <h.callow-AT-elec.canterbury.ac.nz>
5318
5323
5319 2002-10-04 Fernando Perez <fperez@colorado.edu>
5324 2002-10-04 Fernando Perez <fperez@colorado.edu>
5320
5325
5321 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5326 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5322 Gnuplot.File objects.
5327 Gnuplot.File objects.
5323
5328
5324 2002-07-23 Fernando Perez <fperez@colorado.edu>
5329 2002-07-23 Fernando Perez <fperez@colorado.edu>
5325
5330
5326 * IPython/genutils.py (timing): Added timings() and timing() for
5331 * IPython/genutils.py (timing): Added timings() and timing() for
5327 quick access to the most commonly needed data, the execution
5332 quick access to the most commonly needed data, the execution
5328 times. Old timing() renamed to timings_out().
5333 times. Old timing() renamed to timings_out().
5329
5334
5330 2002-07-18 Fernando Perez <fperez@colorado.edu>
5335 2002-07-18 Fernando Perez <fperez@colorado.edu>
5331
5336
5332 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5337 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5333 bug with nested instances disrupting the parent's tab completion.
5338 bug with nested instances disrupting the parent's tab completion.
5334
5339
5335 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5340 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5336 all_completions code to begin the emacs integration.
5341 all_completions code to begin the emacs integration.
5337
5342
5338 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5343 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5339 argument to allow titling individual arrays when plotting.
5344 argument to allow titling individual arrays when plotting.
5340
5345
5341 2002-07-15 Fernando Perez <fperez@colorado.edu>
5346 2002-07-15 Fernando Perez <fperez@colorado.edu>
5342
5347
5343 * setup.py (make_shortcut): changed to retrieve the value of
5348 * setup.py (make_shortcut): changed to retrieve the value of
5344 'Program Files' directory from the registry (this value changes in
5349 'Program Files' directory from the registry (this value changes in
5345 non-english versions of Windows). Thanks to Thomas Fanslau
5350 non-english versions of Windows). Thanks to Thomas Fanslau
5346 <tfanslau-AT-gmx.de> for the report.
5351 <tfanslau-AT-gmx.de> for the report.
5347
5352
5348 2002-07-10 Fernando Perez <fperez@colorado.edu>
5353 2002-07-10 Fernando Perez <fperez@colorado.edu>
5349
5354
5350 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5355 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5351 a bug in pdb, which crashes if a line with only whitespace is
5356 a bug in pdb, which crashes if a line with only whitespace is
5352 entered. Bug report submitted to sourceforge.
5357 entered. Bug report submitted to sourceforge.
5353
5358
5354 2002-07-09 Fernando Perez <fperez@colorado.edu>
5359 2002-07-09 Fernando Perez <fperez@colorado.edu>
5355
5360
5356 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5361 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5357 reporting exceptions (it's a bug in inspect.py, I just set a
5362 reporting exceptions (it's a bug in inspect.py, I just set a
5358 workaround).
5363 workaround).
5359
5364
5360 2002-07-08 Fernando Perez <fperez@colorado.edu>
5365 2002-07-08 Fernando Perez <fperez@colorado.edu>
5361
5366
5362 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5367 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5363 __IPYTHON__ in __builtins__ to show up in user_ns.
5368 __IPYTHON__ in __builtins__ to show up in user_ns.
5364
5369
5365 2002-07-03 Fernando Perez <fperez@colorado.edu>
5370 2002-07-03 Fernando Perez <fperez@colorado.edu>
5366
5371
5367 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5372 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5368 name from @gp_set_instance to @gp_set_default.
5373 name from @gp_set_instance to @gp_set_default.
5369
5374
5370 * IPython/ipmaker.py (make_IPython): default editor value set to
5375 * IPython/ipmaker.py (make_IPython): default editor value set to
5371 '0' (a string), to match the rc file. Otherwise will crash when
5376 '0' (a string), to match the rc file. Otherwise will crash when
5372 .strip() is called on it.
5377 .strip() is called on it.
5373
5378
5374
5379
5375 2002-06-28 Fernando Perez <fperez@colorado.edu>
5380 2002-06-28 Fernando Perez <fperez@colorado.edu>
5376
5381
5377 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5382 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5378 of files in current directory when a file is executed via
5383 of files in current directory when a file is executed via
5379 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5384 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5380
5385
5381 * setup.py (manfiles): fix for rpm builds, submitted by RA
5386 * setup.py (manfiles): fix for rpm builds, submitted by RA
5382 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5387 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5383
5388
5384 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5389 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5385 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5390 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5386 string!). A. Schmolck caught this one.
5391 string!). A. Schmolck caught this one.
5387
5392
5388 2002-06-27 Fernando Perez <fperez@colorado.edu>
5393 2002-06-27 Fernando Perez <fperez@colorado.edu>
5389
5394
5390 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5395 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5391 defined files at the cmd line. __name__ wasn't being set to
5396 defined files at the cmd line. __name__ wasn't being set to
5392 __main__.
5397 __main__.
5393
5398
5394 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5399 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5395 regular lists and tuples besides Numeric arrays.
5400 regular lists and tuples besides Numeric arrays.
5396
5401
5397 * IPython/Prompts.py (CachedOutput.__call__): Added output
5402 * IPython/Prompts.py (CachedOutput.__call__): Added output
5398 supression for input ending with ';'. Similar to Mathematica and
5403 supression for input ending with ';'. Similar to Mathematica and
5399 Matlab. The _* vars and Out[] list are still updated, just like
5404 Matlab. The _* vars and Out[] list are still updated, just like
5400 Mathematica behaves.
5405 Mathematica behaves.
5401
5406
5402 2002-06-25 Fernando Perez <fperez@colorado.edu>
5407 2002-06-25 Fernando Perez <fperez@colorado.edu>
5403
5408
5404 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5409 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5405 .ini extensions for profiels under Windows.
5410 .ini extensions for profiels under Windows.
5406
5411
5407 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5412 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5408 string form. Fix contributed by Alexander Schmolck
5413 string form. Fix contributed by Alexander Schmolck
5409 <a.schmolck-AT-gmx.net>
5414 <a.schmolck-AT-gmx.net>
5410
5415
5411 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5416 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5412 pre-configured Gnuplot instance.
5417 pre-configured Gnuplot instance.
5413
5418
5414 2002-06-21 Fernando Perez <fperez@colorado.edu>
5419 2002-06-21 Fernando Perez <fperez@colorado.edu>
5415
5420
5416 * IPython/numutils.py (exp_safe): new function, works around the
5421 * IPython/numutils.py (exp_safe): new function, works around the
5417 underflow problems in Numeric.
5422 underflow problems in Numeric.
5418 (log2): New fn. Safe log in base 2: returns exact integer answer
5423 (log2): New fn. Safe log in base 2: returns exact integer answer
5419 for exact integer powers of 2.
5424 for exact integer powers of 2.
5420
5425
5421 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5426 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5422 properly.
5427 properly.
5423
5428
5424 2002-06-20 Fernando Perez <fperez@colorado.edu>
5429 2002-06-20 Fernando Perez <fperez@colorado.edu>
5425
5430
5426 * IPython/genutils.py (timing): new function like
5431 * IPython/genutils.py (timing): new function like
5427 Mathematica's. Similar to time_test, but returns more info.
5432 Mathematica's. Similar to time_test, but returns more info.
5428
5433
5429 2002-06-18 Fernando Perez <fperez@colorado.edu>
5434 2002-06-18 Fernando Perez <fperez@colorado.edu>
5430
5435
5431 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5436 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5432 according to Mike Heeter's suggestions.
5437 according to Mike Heeter's suggestions.
5433
5438
5434 2002-06-16 Fernando Perez <fperez@colorado.edu>
5439 2002-06-16 Fernando Perez <fperez@colorado.edu>
5435
5440
5436 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5441 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5437 system. GnuplotMagic is gone as a user-directory option. New files
5442 system. GnuplotMagic is gone as a user-directory option. New files
5438 make it easier to use all the gnuplot stuff both from external
5443 make it easier to use all the gnuplot stuff both from external
5439 programs as well as from IPython. Had to rewrite part of
5444 programs as well as from IPython. Had to rewrite part of
5440 hardcopy() b/c of a strange bug: often the ps files simply don't
5445 hardcopy() b/c of a strange bug: often the ps files simply don't
5441 get created, and require a repeat of the command (often several
5446 get created, and require a repeat of the command (often several
5442 times).
5447 times).
5443
5448
5444 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5449 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5445 resolve output channel at call time, so that if sys.stderr has
5450 resolve output channel at call time, so that if sys.stderr has
5446 been redirected by user this gets honored.
5451 been redirected by user this gets honored.
5447
5452
5448 2002-06-13 Fernando Perez <fperez@colorado.edu>
5453 2002-06-13 Fernando Perez <fperez@colorado.edu>
5449
5454
5450 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5455 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5451 IPShell. Kept a copy with the old names to avoid breaking people's
5456 IPShell. Kept a copy with the old names to avoid breaking people's
5452 embedded code.
5457 embedded code.
5453
5458
5454 * IPython/ipython: simplified it to the bare minimum after
5459 * IPython/ipython: simplified it to the bare minimum after
5455 Holger's suggestions. Added info about how to use it in
5460 Holger's suggestions. Added info about how to use it in
5456 PYTHONSTARTUP.
5461 PYTHONSTARTUP.
5457
5462
5458 * IPython/Shell.py (IPythonShell): changed the options passing
5463 * IPython/Shell.py (IPythonShell): changed the options passing
5459 from a string with funky %s replacements to a straight list. Maybe
5464 from a string with funky %s replacements to a straight list. Maybe
5460 a bit more typing, but it follows sys.argv conventions, so there's
5465 a bit more typing, but it follows sys.argv conventions, so there's
5461 less special-casing to remember.
5466 less special-casing to remember.
5462
5467
5463 2002-06-12 Fernando Perez <fperez@colorado.edu>
5468 2002-06-12 Fernando Perez <fperez@colorado.edu>
5464
5469
5465 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5470 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5466 command. Thanks to a suggestion by Mike Heeter.
5471 command. Thanks to a suggestion by Mike Heeter.
5467 (Magic.magic_pfile): added behavior to look at filenames if given
5472 (Magic.magic_pfile): added behavior to look at filenames if given
5468 arg is not a defined object.
5473 arg is not a defined object.
5469 (Magic.magic_save): New @save function to save code snippets. Also
5474 (Magic.magic_save): New @save function to save code snippets. Also
5470 a Mike Heeter idea.
5475 a Mike Heeter idea.
5471
5476
5472 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5477 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5473 plot() and replot(). Much more convenient now, especially for
5478 plot() and replot(). Much more convenient now, especially for
5474 interactive use.
5479 interactive use.
5475
5480
5476 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5481 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5477 filenames.
5482 filenames.
5478
5483
5479 2002-06-02 Fernando Perez <fperez@colorado.edu>
5484 2002-06-02 Fernando Perez <fperez@colorado.edu>
5480
5485
5481 * IPython/Struct.py (Struct.__init__): modified to admit
5486 * IPython/Struct.py (Struct.__init__): modified to admit
5482 initialization via another struct.
5487 initialization via another struct.
5483
5488
5484 * IPython/genutils.py (SystemExec.__init__): New stateful
5489 * IPython/genutils.py (SystemExec.__init__): New stateful
5485 interface to xsys and bq. Useful for writing system scripts.
5490 interface to xsys and bq. Useful for writing system scripts.
5486
5491
5487 2002-05-30 Fernando Perez <fperez@colorado.edu>
5492 2002-05-30 Fernando Perez <fperez@colorado.edu>
5488
5493
5489 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5494 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5490 documents. This will make the user download smaller (it's getting
5495 documents. This will make the user download smaller (it's getting
5491 too big).
5496 too big).
5492
5497
5493 2002-05-29 Fernando Perez <fperez@colorado.edu>
5498 2002-05-29 Fernando Perez <fperez@colorado.edu>
5494
5499
5495 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5500 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5496 fix problems with shelve and pickle. Seems to work, but I don't
5501 fix problems with shelve and pickle. Seems to work, but I don't
5497 know if corner cases break it. Thanks to Mike Heeter
5502 know if corner cases break it. Thanks to Mike Heeter
5498 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5503 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5499
5504
5500 2002-05-24 Fernando Perez <fperez@colorado.edu>
5505 2002-05-24 Fernando Perez <fperez@colorado.edu>
5501
5506
5502 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5507 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5503 macros having broken.
5508 macros having broken.
5504
5509
5505 2002-05-21 Fernando Perez <fperez@colorado.edu>
5510 2002-05-21 Fernando Perez <fperez@colorado.edu>
5506
5511
5507 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5512 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5508 introduced logging bug: all history before logging started was
5513 introduced logging bug: all history before logging started was
5509 being written one character per line! This came from the redesign
5514 being written one character per line! This came from the redesign
5510 of the input history as a special list which slices to strings,
5515 of the input history as a special list which slices to strings,
5511 not to lists.
5516 not to lists.
5512
5517
5513 2002-05-20 Fernando Perez <fperez@colorado.edu>
5518 2002-05-20 Fernando Perez <fperez@colorado.edu>
5514
5519
5515 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5520 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5516 be an attribute of all classes in this module. The design of these
5521 be an attribute of all classes in this module. The design of these
5517 classes needs some serious overhauling.
5522 classes needs some serious overhauling.
5518
5523
5519 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5524 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5520 which was ignoring '_' in option names.
5525 which was ignoring '_' in option names.
5521
5526
5522 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5527 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5523 'Verbose_novars' to 'Context' and made it the new default. It's a
5528 'Verbose_novars' to 'Context' and made it the new default. It's a
5524 bit more readable and also safer than verbose.
5529 bit more readable and also safer than verbose.
5525
5530
5526 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5531 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5527 triple-quoted strings.
5532 triple-quoted strings.
5528
5533
5529 * IPython/OInspect.py (__all__): new module exposing the object
5534 * IPython/OInspect.py (__all__): new module exposing the object
5530 introspection facilities. Now the corresponding magics are dummy
5535 introspection facilities. Now the corresponding magics are dummy
5531 wrappers around this. Having this module will make it much easier
5536 wrappers around this. Having this module will make it much easier
5532 to put these functions into our modified pdb.
5537 to put these functions into our modified pdb.
5533 This new object inspector system uses the new colorizing module,
5538 This new object inspector system uses the new colorizing module,
5534 so source code and other things are nicely syntax highlighted.
5539 so source code and other things are nicely syntax highlighted.
5535
5540
5536 2002-05-18 Fernando Perez <fperez@colorado.edu>
5541 2002-05-18 Fernando Perez <fperez@colorado.edu>
5537
5542
5538 * IPython/ColorANSI.py: Split the coloring tools into a separate
5543 * IPython/ColorANSI.py: Split the coloring tools into a separate
5539 module so I can use them in other code easier (they were part of
5544 module so I can use them in other code easier (they were part of
5540 ultraTB).
5545 ultraTB).
5541
5546
5542 2002-05-17 Fernando Perez <fperez@colorado.edu>
5547 2002-05-17 Fernando Perez <fperez@colorado.edu>
5543
5548
5544 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5549 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5545 fixed it to set the global 'g' also to the called instance, as
5550 fixed it to set the global 'g' also to the called instance, as
5546 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5551 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5547 user's 'g' variables).
5552 user's 'g' variables).
5548
5553
5549 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5554 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5550 global variables (aliases to _ih,_oh) so that users which expect
5555 global variables (aliases to _ih,_oh) so that users which expect
5551 In[5] or Out[7] to work aren't unpleasantly surprised.
5556 In[5] or Out[7] to work aren't unpleasantly surprised.
5552 (InputList.__getslice__): new class to allow executing slices of
5557 (InputList.__getslice__): new class to allow executing slices of
5553 input history directly. Very simple class, complements the use of
5558 input history directly. Very simple class, complements the use of
5554 macros.
5559 macros.
5555
5560
5556 2002-05-16 Fernando Perez <fperez@colorado.edu>
5561 2002-05-16 Fernando Perez <fperez@colorado.edu>
5557
5562
5558 * setup.py (docdirbase): make doc directory be just doc/IPython
5563 * setup.py (docdirbase): make doc directory be just doc/IPython
5559 without version numbers, it will reduce clutter for users.
5564 without version numbers, it will reduce clutter for users.
5560
5565
5561 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5566 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5562 execfile call to prevent possible memory leak. See for details:
5567 execfile call to prevent possible memory leak. See for details:
5563 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5568 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5564
5569
5565 2002-05-15 Fernando Perez <fperez@colorado.edu>
5570 2002-05-15 Fernando Perez <fperez@colorado.edu>
5566
5571
5567 * IPython/Magic.py (Magic.magic_psource): made the object
5572 * IPython/Magic.py (Magic.magic_psource): made the object
5568 introspection names be more standard: pdoc, pdef, pfile and
5573 introspection names be more standard: pdoc, pdef, pfile and
5569 psource. They all print/page their output, and it makes
5574 psource. They all print/page their output, and it makes
5570 remembering them easier. Kept old names for compatibility as
5575 remembering them easier. Kept old names for compatibility as
5571 aliases.
5576 aliases.
5572
5577
5573 2002-05-14 Fernando Perez <fperez@colorado.edu>
5578 2002-05-14 Fernando Perez <fperez@colorado.edu>
5574
5579
5575 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5580 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5576 what the mouse problem was. The trick is to use gnuplot with temp
5581 what the mouse problem was. The trick is to use gnuplot with temp
5577 files and NOT with pipes (for data communication), because having
5582 files and NOT with pipes (for data communication), because having
5578 both pipes and the mouse on is bad news.
5583 both pipes and the mouse on is bad news.
5579
5584
5580 2002-05-13 Fernando Perez <fperez@colorado.edu>
5585 2002-05-13 Fernando Perez <fperez@colorado.edu>
5581
5586
5582 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5587 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5583 bug. Information would be reported about builtins even when
5588 bug. Information would be reported about builtins even when
5584 user-defined functions overrode them.
5589 user-defined functions overrode them.
5585
5590
5586 2002-05-11 Fernando Perez <fperez@colorado.edu>
5591 2002-05-11 Fernando Perez <fperez@colorado.edu>
5587
5592
5588 * IPython/__init__.py (__all__): removed FlexCompleter from
5593 * IPython/__init__.py (__all__): removed FlexCompleter from
5589 __all__ so that things don't fail in platforms without readline.
5594 __all__ so that things don't fail in platforms without readline.
5590
5595
5591 2002-05-10 Fernando Perez <fperez@colorado.edu>
5596 2002-05-10 Fernando Perez <fperez@colorado.edu>
5592
5597
5593 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5598 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5594 it requires Numeric, effectively making Numeric a dependency for
5599 it requires Numeric, effectively making Numeric a dependency for
5595 IPython.
5600 IPython.
5596
5601
5597 * Released 0.2.13
5602 * Released 0.2.13
5598
5603
5599 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5604 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5600 profiler interface. Now all the major options from the profiler
5605 profiler interface. Now all the major options from the profiler
5601 module are directly supported in IPython, both for single
5606 module are directly supported in IPython, both for single
5602 expressions (@prun) and for full programs (@run -p).
5607 expressions (@prun) and for full programs (@run -p).
5603
5608
5604 2002-05-09 Fernando Perez <fperez@colorado.edu>
5609 2002-05-09 Fernando Perez <fperez@colorado.edu>
5605
5610
5606 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5611 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5607 magic properly formatted for screen.
5612 magic properly formatted for screen.
5608
5613
5609 * setup.py (make_shortcut): Changed things to put pdf version in
5614 * setup.py (make_shortcut): Changed things to put pdf version in
5610 doc/ instead of doc/manual (had to change lyxport a bit).
5615 doc/ instead of doc/manual (had to change lyxport a bit).
5611
5616
5612 * IPython/Magic.py (Profile.string_stats): made profile runs go
5617 * IPython/Magic.py (Profile.string_stats): made profile runs go
5613 through pager (they are long and a pager allows searching, saving,
5618 through pager (they are long and a pager allows searching, saving,
5614 etc.)
5619 etc.)
5615
5620
5616 2002-05-08 Fernando Perez <fperez@colorado.edu>
5621 2002-05-08 Fernando Perez <fperez@colorado.edu>
5617
5622
5618 * Released 0.2.12
5623 * Released 0.2.12
5619
5624
5620 2002-05-06 Fernando Perez <fperez@colorado.edu>
5625 2002-05-06 Fernando Perez <fperez@colorado.edu>
5621
5626
5622 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5627 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5623 introduced); 'hist n1 n2' was broken.
5628 introduced); 'hist n1 n2' was broken.
5624 (Magic.magic_pdb): added optional on/off arguments to @pdb
5629 (Magic.magic_pdb): added optional on/off arguments to @pdb
5625 (Magic.magic_run): added option -i to @run, which executes code in
5630 (Magic.magic_run): added option -i to @run, which executes code in
5626 the IPython namespace instead of a clean one. Also added @irun as
5631 the IPython namespace instead of a clean one. Also added @irun as
5627 an alias to @run -i.
5632 an alias to @run -i.
5628
5633
5629 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5634 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5630 fixed (it didn't really do anything, the namespaces were wrong).
5635 fixed (it didn't really do anything, the namespaces were wrong).
5631
5636
5632 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5637 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5633
5638
5634 * IPython/__init__.py (__all__): Fixed package namespace, now
5639 * IPython/__init__.py (__all__): Fixed package namespace, now
5635 'import IPython' does give access to IPython.<all> as
5640 'import IPython' does give access to IPython.<all> as
5636 expected. Also renamed __release__ to Release.
5641 expected. Also renamed __release__ to Release.
5637
5642
5638 * IPython/Debugger.py (__license__): created new Pdb class which
5643 * IPython/Debugger.py (__license__): created new Pdb class which
5639 functions like a drop-in for the normal pdb.Pdb but does NOT
5644 functions like a drop-in for the normal pdb.Pdb but does NOT
5640 import readline by default. This way it doesn't muck up IPython's
5645 import readline by default. This way it doesn't muck up IPython's
5641 readline handling, and now tab-completion finally works in the
5646 readline handling, and now tab-completion finally works in the
5642 debugger -- sort of. It completes things globally visible, but the
5647 debugger -- sort of. It completes things globally visible, but the
5643 completer doesn't track the stack as pdb walks it. That's a bit
5648 completer doesn't track the stack as pdb walks it. That's a bit
5644 tricky, and I'll have to implement it later.
5649 tricky, and I'll have to implement it later.
5645
5650
5646 2002-05-05 Fernando Perez <fperez@colorado.edu>
5651 2002-05-05 Fernando Perez <fperez@colorado.edu>
5647
5652
5648 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5653 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5649 magic docstrings when printed via ? (explicit \'s were being
5654 magic docstrings when printed via ? (explicit \'s were being
5650 printed).
5655 printed).
5651
5656
5652 * IPython/ipmaker.py (make_IPython): fixed namespace
5657 * IPython/ipmaker.py (make_IPython): fixed namespace
5653 identification bug. Now variables loaded via logs or command-line
5658 identification bug. Now variables loaded via logs or command-line
5654 files are recognized in the interactive namespace by @who.
5659 files are recognized in the interactive namespace by @who.
5655
5660
5656 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5661 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5657 log replay system stemming from the string form of Structs.
5662 log replay system stemming from the string form of Structs.
5658
5663
5659 * IPython/Magic.py (Macro.__init__): improved macros to properly
5664 * IPython/Magic.py (Macro.__init__): improved macros to properly
5660 handle magic commands in them.
5665 handle magic commands in them.
5661 (Magic.magic_logstart): usernames are now expanded so 'logstart
5666 (Magic.magic_logstart): usernames are now expanded so 'logstart
5662 ~/mylog' now works.
5667 ~/mylog' now works.
5663
5668
5664 * IPython/iplib.py (complete): fixed bug where paths starting with
5669 * IPython/iplib.py (complete): fixed bug where paths starting with
5665 '/' would be completed as magic names.
5670 '/' would be completed as magic names.
5666
5671
5667 2002-05-04 Fernando Perez <fperez@colorado.edu>
5672 2002-05-04 Fernando Perez <fperez@colorado.edu>
5668
5673
5669 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5674 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5670 allow running full programs under the profiler's control.
5675 allow running full programs under the profiler's control.
5671
5676
5672 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5677 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5673 mode to report exceptions verbosely but without formatting
5678 mode to report exceptions verbosely but without formatting
5674 variables. This addresses the issue of ipython 'freezing' (it's
5679 variables. This addresses the issue of ipython 'freezing' (it's
5675 not frozen, but caught in an expensive formatting loop) when huge
5680 not frozen, but caught in an expensive formatting loop) when huge
5676 variables are in the context of an exception.
5681 variables are in the context of an exception.
5677 (VerboseTB.text): Added '--->' markers at line where exception was
5682 (VerboseTB.text): Added '--->' markers at line where exception was
5678 triggered. Much clearer to read, especially in NoColor modes.
5683 triggered. Much clearer to read, especially in NoColor modes.
5679
5684
5680 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5685 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5681 implemented in reverse when changing to the new parse_options().
5686 implemented in reverse when changing to the new parse_options().
5682
5687
5683 2002-05-03 Fernando Perez <fperez@colorado.edu>
5688 2002-05-03 Fernando Perez <fperez@colorado.edu>
5684
5689
5685 * IPython/Magic.py (Magic.parse_options): new function so that
5690 * IPython/Magic.py (Magic.parse_options): new function so that
5686 magics can parse options easier.
5691 magics can parse options easier.
5687 (Magic.magic_prun): new function similar to profile.run(),
5692 (Magic.magic_prun): new function similar to profile.run(),
5688 suggested by Chris Hart.
5693 suggested by Chris Hart.
5689 (Magic.magic_cd): fixed behavior so that it only changes if
5694 (Magic.magic_cd): fixed behavior so that it only changes if
5690 directory actually is in history.
5695 directory actually is in history.
5691
5696
5692 * IPython/usage.py (__doc__): added information about potential
5697 * IPython/usage.py (__doc__): added information about potential
5693 slowness of Verbose exception mode when there are huge data
5698 slowness of Verbose exception mode when there are huge data
5694 structures to be formatted (thanks to Archie Paulson).
5699 structures to be formatted (thanks to Archie Paulson).
5695
5700
5696 * IPython/ipmaker.py (make_IPython): Changed default logging
5701 * IPython/ipmaker.py (make_IPython): Changed default logging
5697 (when simply called with -log) to use curr_dir/ipython.log in
5702 (when simply called with -log) to use curr_dir/ipython.log in
5698 rotate mode. Fixed crash which was occuring with -log before
5703 rotate mode. Fixed crash which was occuring with -log before
5699 (thanks to Jim Boyle).
5704 (thanks to Jim Boyle).
5700
5705
5701 2002-05-01 Fernando Perez <fperez@colorado.edu>
5706 2002-05-01 Fernando Perez <fperez@colorado.edu>
5702
5707
5703 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5708 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5704 was nasty -- though somewhat of a corner case).
5709 was nasty -- though somewhat of a corner case).
5705
5710
5706 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5711 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5707 text (was a bug).
5712 text (was a bug).
5708
5713
5709 2002-04-30 Fernando Perez <fperez@colorado.edu>
5714 2002-04-30 Fernando Perez <fperez@colorado.edu>
5710
5715
5711 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5716 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5712 a print after ^D or ^C from the user so that the In[] prompt
5717 a print after ^D or ^C from the user so that the In[] prompt
5713 doesn't over-run the gnuplot one.
5718 doesn't over-run the gnuplot one.
5714
5719
5715 2002-04-29 Fernando Perez <fperez@colorado.edu>
5720 2002-04-29 Fernando Perez <fperez@colorado.edu>
5716
5721
5717 * Released 0.2.10
5722 * Released 0.2.10
5718
5723
5719 * IPython/__release__.py (version): get date dynamically.
5724 * IPython/__release__.py (version): get date dynamically.
5720
5725
5721 * Misc. documentation updates thanks to Arnd's comments. Also ran
5726 * Misc. documentation updates thanks to Arnd's comments. Also ran
5722 a full spellcheck on the manual (hadn't been done in a while).
5727 a full spellcheck on the manual (hadn't been done in a while).
5723
5728
5724 2002-04-27 Fernando Perez <fperez@colorado.edu>
5729 2002-04-27 Fernando Perez <fperez@colorado.edu>
5725
5730
5726 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5731 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5727 starting a log in mid-session would reset the input history list.
5732 starting a log in mid-session would reset the input history list.
5728
5733
5729 2002-04-26 Fernando Perez <fperez@colorado.edu>
5734 2002-04-26 Fernando Perez <fperez@colorado.edu>
5730
5735
5731 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5736 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5732 all files were being included in an update. Now anything in
5737 all files were being included in an update. Now anything in
5733 UserConfig that matches [A-Za-z]*.py will go (this excludes
5738 UserConfig that matches [A-Za-z]*.py will go (this excludes
5734 __init__.py)
5739 __init__.py)
5735
5740
5736 2002-04-25 Fernando Perez <fperez@colorado.edu>
5741 2002-04-25 Fernando Perez <fperez@colorado.edu>
5737
5742
5738 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5743 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5739 to __builtins__ so that any form of embedded or imported code can
5744 to __builtins__ so that any form of embedded or imported code can
5740 test for being inside IPython.
5745 test for being inside IPython.
5741
5746
5742 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5747 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5743 changed to GnuplotMagic because it's now an importable module,
5748 changed to GnuplotMagic because it's now an importable module,
5744 this makes the name follow that of the standard Gnuplot module.
5749 this makes the name follow that of the standard Gnuplot module.
5745 GnuplotMagic can now be loaded at any time in mid-session.
5750 GnuplotMagic can now be loaded at any time in mid-session.
5746
5751
5747 2002-04-24 Fernando Perez <fperez@colorado.edu>
5752 2002-04-24 Fernando Perez <fperez@colorado.edu>
5748
5753
5749 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5754 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5750 the globals (IPython has its own namespace) and the
5755 the globals (IPython has its own namespace) and the
5751 PhysicalQuantity stuff is much better anyway.
5756 PhysicalQuantity stuff is much better anyway.
5752
5757
5753 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5758 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5754 embedding example to standard user directory for
5759 embedding example to standard user directory for
5755 distribution. Also put it in the manual.
5760 distribution. Also put it in the manual.
5756
5761
5757 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5762 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5758 instance as first argument (so it doesn't rely on some obscure
5763 instance as first argument (so it doesn't rely on some obscure
5759 hidden global).
5764 hidden global).
5760
5765
5761 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5766 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5762 delimiters. While it prevents ().TAB from working, it allows
5767 delimiters. While it prevents ().TAB from working, it allows
5763 completions in open (... expressions. This is by far a more common
5768 completions in open (... expressions. This is by far a more common
5764 case.
5769 case.
5765
5770
5766 2002-04-23 Fernando Perez <fperez@colorado.edu>
5771 2002-04-23 Fernando Perez <fperez@colorado.edu>
5767
5772
5768 * IPython/Extensions/InterpreterPasteInput.py: new
5773 * IPython/Extensions/InterpreterPasteInput.py: new
5769 syntax-processing module for pasting lines with >>> or ... at the
5774 syntax-processing module for pasting lines with >>> or ... at the
5770 start.
5775 start.
5771
5776
5772 * IPython/Extensions/PhysicalQ_Interactive.py
5777 * IPython/Extensions/PhysicalQ_Interactive.py
5773 (PhysicalQuantityInteractive.__int__): fixed to work with either
5778 (PhysicalQuantityInteractive.__int__): fixed to work with either
5774 Numeric or math.
5779 Numeric or math.
5775
5780
5776 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5781 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5777 provided profiles. Now we have:
5782 provided profiles. Now we have:
5778 -math -> math module as * and cmath with its own namespace.
5783 -math -> math module as * and cmath with its own namespace.
5779 -numeric -> Numeric as *, plus gnuplot & grace
5784 -numeric -> Numeric as *, plus gnuplot & grace
5780 -physics -> same as before
5785 -physics -> same as before
5781
5786
5782 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5787 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5783 user-defined magics wouldn't be found by @magic if they were
5788 user-defined magics wouldn't be found by @magic if they were
5784 defined as class methods. Also cleaned up the namespace search
5789 defined as class methods. Also cleaned up the namespace search
5785 logic and the string building (to use %s instead of many repeated
5790 logic and the string building (to use %s instead of many repeated
5786 string adds).
5791 string adds).
5787
5792
5788 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5793 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5789 of user-defined magics to operate with class methods (cleaner, in
5794 of user-defined magics to operate with class methods (cleaner, in
5790 line with the gnuplot code).
5795 line with the gnuplot code).
5791
5796
5792 2002-04-22 Fernando Perez <fperez@colorado.edu>
5797 2002-04-22 Fernando Perez <fperez@colorado.edu>
5793
5798
5794 * setup.py: updated dependency list so that manual is updated when
5799 * setup.py: updated dependency list so that manual is updated when
5795 all included files change.
5800 all included files change.
5796
5801
5797 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5802 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5798 the delimiter removal option (the fix is ugly right now).
5803 the delimiter removal option (the fix is ugly right now).
5799
5804
5800 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5805 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5801 all of the math profile (quicker loading, no conflict between
5806 all of the math profile (quicker loading, no conflict between
5802 g-9.8 and g-gnuplot).
5807 g-9.8 and g-gnuplot).
5803
5808
5804 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5809 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5805 name of post-mortem files to IPython_crash_report.txt.
5810 name of post-mortem files to IPython_crash_report.txt.
5806
5811
5807 * Cleanup/update of the docs. Added all the new readline info and
5812 * Cleanup/update of the docs. Added all the new readline info and
5808 formatted all lists as 'real lists'.
5813 formatted all lists as 'real lists'.
5809
5814
5810 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5815 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5811 tab-completion options, since the full readline parse_and_bind is
5816 tab-completion options, since the full readline parse_and_bind is
5812 now accessible.
5817 now accessible.
5813
5818
5814 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5819 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5815 handling of readline options. Now users can specify any string to
5820 handling of readline options. Now users can specify any string to
5816 be passed to parse_and_bind(), as well as the delimiters to be
5821 be passed to parse_and_bind(), as well as the delimiters to be
5817 removed.
5822 removed.
5818 (InteractiveShell.__init__): Added __name__ to the global
5823 (InteractiveShell.__init__): Added __name__ to the global
5819 namespace so that things like Itpl which rely on its existence
5824 namespace so that things like Itpl which rely on its existence
5820 don't crash.
5825 don't crash.
5821 (InteractiveShell._prefilter): Defined the default with a _ so
5826 (InteractiveShell._prefilter): Defined the default with a _ so
5822 that prefilter() is easier to override, while the default one
5827 that prefilter() is easier to override, while the default one
5823 remains available.
5828 remains available.
5824
5829
5825 2002-04-18 Fernando Perez <fperez@colorado.edu>
5830 2002-04-18 Fernando Perez <fperez@colorado.edu>
5826
5831
5827 * Added information about pdb in the docs.
5832 * Added information about pdb in the docs.
5828
5833
5829 2002-04-17 Fernando Perez <fperez@colorado.edu>
5834 2002-04-17 Fernando Perez <fperez@colorado.edu>
5830
5835
5831 * IPython/ipmaker.py (make_IPython): added rc_override option to
5836 * IPython/ipmaker.py (make_IPython): added rc_override option to
5832 allow passing config options at creation time which may override
5837 allow passing config options at creation time which may override
5833 anything set in the config files or command line. This is
5838 anything set in the config files or command line. This is
5834 particularly useful for configuring embedded instances.
5839 particularly useful for configuring embedded instances.
5835
5840
5836 2002-04-15 Fernando Perez <fperez@colorado.edu>
5841 2002-04-15 Fernando Perez <fperez@colorado.edu>
5837
5842
5838 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5843 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5839 crash embedded instances because of the input cache falling out of
5844 crash embedded instances because of the input cache falling out of
5840 sync with the output counter.
5845 sync with the output counter.
5841
5846
5842 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5847 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5843 mode which calls pdb after an uncaught exception in IPython itself.
5848 mode which calls pdb after an uncaught exception in IPython itself.
5844
5849
5845 2002-04-14 Fernando Perez <fperez@colorado.edu>
5850 2002-04-14 Fernando Perez <fperez@colorado.edu>
5846
5851
5847 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5852 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5848 readline, fix it back after each call.
5853 readline, fix it back after each call.
5849
5854
5850 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5855 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5851 method to force all access via __call__(), which guarantees that
5856 method to force all access via __call__(), which guarantees that
5852 traceback references are properly deleted.
5857 traceback references are properly deleted.
5853
5858
5854 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5859 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5855 improve printing when pprint is in use.
5860 improve printing when pprint is in use.
5856
5861
5857 2002-04-13 Fernando Perez <fperez@colorado.edu>
5862 2002-04-13 Fernando Perez <fperez@colorado.edu>
5858
5863
5859 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5864 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5860 exceptions aren't caught anymore. If the user triggers one, he
5865 exceptions aren't caught anymore. If the user triggers one, he
5861 should know why he's doing it and it should go all the way up,
5866 should know why he's doing it and it should go all the way up,
5862 just like any other exception. So now @abort will fully kill the
5867 just like any other exception. So now @abort will fully kill the
5863 embedded interpreter and the embedding code (unless that happens
5868 embedded interpreter and the embedding code (unless that happens
5864 to catch SystemExit).
5869 to catch SystemExit).
5865
5870
5866 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5871 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5867 and a debugger() method to invoke the interactive pdb debugger
5872 and a debugger() method to invoke the interactive pdb debugger
5868 after printing exception information. Also added the corresponding
5873 after printing exception information. Also added the corresponding
5869 -pdb option and @pdb magic to control this feature, and updated
5874 -pdb option and @pdb magic to control this feature, and updated
5870 the docs. After a suggestion from Christopher Hart
5875 the docs. After a suggestion from Christopher Hart
5871 (hart-AT-caltech.edu).
5876 (hart-AT-caltech.edu).
5872
5877
5873 2002-04-12 Fernando Perez <fperez@colorado.edu>
5878 2002-04-12 Fernando Perez <fperez@colorado.edu>
5874
5879
5875 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5880 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5876 the exception handlers defined by the user (not the CrashHandler)
5881 the exception handlers defined by the user (not the CrashHandler)
5877 so that user exceptions don't trigger an ipython bug report.
5882 so that user exceptions don't trigger an ipython bug report.
5878
5883
5879 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5884 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5880 configurable (it should have always been so).
5885 configurable (it should have always been so).
5881
5886
5882 2002-03-26 Fernando Perez <fperez@colorado.edu>
5887 2002-03-26 Fernando Perez <fperez@colorado.edu>
5883
5888
5884 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5889 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5885 and there to fix embedding namespace issues. This should all be
5890 and there to fix embedding namespace issues. This should all be
5886 done in a more elegant way.
5891 done in a more elegant way.
5887
5892
5888 2002-03-25 Fernando Perez <fperez@colorado.edu>
5893 2002-03-25 Fernando Perez <fperez@colorado.edu>
5889
5894
5890 * IPython/genutils.py (get_home_dir): Try to make it work under
5895 * IPython/genutils.py (get_home_dir): Try to make it work under
5891 win9x also.
5896 win9x also.
5892
5897
5893 2002-03-20 Fernando Perez <fperez@colorado.edu>
5898 2002-03-20 Fernando Perez <fperez@colorado.edu>
5894
5899
5895 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5900 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5896 sys.displayhook untouched upon __init__.
5901 sys.displayhook untouched upon __init__.
5897
5902
5898 2002-03-19 Fernando Perez <fperez@colorado.edu>
5903 2002-03-19 Fernando Perez <fperez@colorado.edu>
5899
5904
5900 * Released 0.2.9 (for embedding bug, basically).
5905 * Released 0.2.9 (for embedding bug, basically).
5901
5906
5902 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5907 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5903 exceptions so that enclosing shell's state can be restored.
5908 exceptions so that enclosing shell's state can be restored.
5904
5909
5905 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5910 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5906 naming conventions in the .ipython/ dir.
5911 naming conventions in the .ipython/ dir.
5907
5912
5908 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5913 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5909 from delimiters list so filenames with - in them get expanded.
5914 from delimiters list so filenames with - in them get expanded.
5910
5915
5911 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5916 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5912 sys.displayhook not being properly restored after an embedded call.
5917 sys.displayhook not being properly restored after an embedded call.
5913
5918
5914 2002-03-18 Fernando Perez <fperez@colorado.edu>
5919 2002-03-18 Fernando Perez <fperez@colorado.edu>
5915
5920
5916 * Released 0.2.8
5921 * Released 0.2.8
5917
5922
5918 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5923 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5919 some files weren't being included in a -upgrade.
5924 some files weren't being included in a -upgrade.
5920 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5925 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5921 on' so that the first tab completes.
5926 on' so that the first tab completes.
5922 (InteractiveShell.handle_magic): fixed bug with spaces around
5927 (InteractiveShell.handle_magic): fixed bug with spaces around
5923 quotes breaking many magic commands.
5928 quotes breaking many magic commands.
5924
5929
5925 * setup.py: added note about ignoring the syntax error messages at
5930 * setup.py: added note about ignoring the syntax error messages at
5926 installation.
5931 installation.
5927
5932
5928 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5933 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5929 streamlining the gnuplot interface, now there's only one magic @gp.
5934 streamlining the gnuplot interface, now there's only one magic @gp.
5930
5935
5931 2002-03-17 Fernando Perez <fperez@colorado.edu>
5936 2002-03-17 Fernando Perez <fperez@colorado.edu>
5932
5937
5933 * IPython/UserConfig/magic_gnuplot.py: new name for the
5938 * IPython/UserConfig/magic_gnuplot.py: new name for the
5934 example-magic_pm.py file. Much enhanced system, now with a shell
5939 example-magic_pm.py file. Much enhanced system, now with a shell
5935 for communicating directly with gnuplot, one command at a time.
5940 for communicating directly with gnuplot, one command at a time.
5936
5941
5937 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5942 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5938 setting __name__=='__main__'.
5943 setting __name__=='__main__'.
5939
5944
5940 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5945 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5941 mini-shell for accessing gnuplot from inside ipython. Should
5946 mini-shell for accessing gnuplot from inside ipython. Should
5942 extend it later for grace access too. Inspired by Arnd's
5947 extend it later for grace access too. Inspired by Arnd's
5943 suggestion.
5948 suggestion.
5944
5949
5945 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5950 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5946 calling magic functions with () in their arguments. Thanks to Arnd
5951 calling magic functions with () in their arguments. Thanks to Arnd
5947 Baecker for pointing this to me.
5952 Baecker for pointing this to me.
5948
5953
5949 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5954 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5950 infinitely for integer or complex arrays (only worked with floats).
5955 infinitely for integer or complex arrays (only worked with floats).
5951
5956
5952 2002-03-16 Fernando Perez <fperez@colorado.edu>
5957 2002-03-16 Fernando Perez <fperez@colorado.edu>
5953
5958
5954 * setup.py: Merged setup and setup_windows into a single script
5959 * setup.py: Merged setup and setup_windows into a single script
5955 which properly handles things for windows users.
5960 which properly handles things for windows users.
5956
5961
5957 2002-03-15 Fernando Perez <fperez@colorado.edu>
5962 2002-03-15 Fernando Perez <fperez@colorado.edu>
5958
5963
5959 * Big change to the manual: now the magics are all automatically
5964 * Big change to the manual: now the magics are all automatically
5960 documented. This information is generated from their docstrings
5965 documented. This information is generated from their docstrings
5961 and put in a latex file included by the manual lyx file. This way
5966 and put in a latex file included by the manual lyx file. This way
5962 we get always up to date information for the magics. The manual
5967 we get always up to date information for the magics. The manual
5963 now also has proper version information, also auto-synced.
5968 now also has proper version information, also auto-synced.
5964
5969
5965 For this to work, an undocumented --magic_docstrings option was added.
5970 For this to work, an undocumented --magic_docstrings option was added.
5966
5971
5967 2002-03-13 Fernando Perez <fperez@colorado.edu>
5972 2002-03-13 Fernando Perez <fperez@colorado.edu>
5968
5973
5969 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5974 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5970 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5975 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5971
5976
5972 2002-03-12 Fernando Perez <fperez@colorado.edu>
5977 2002-03-12 Fernando Perez <fperez@colorado.edu>
5973
5978
5974 * IPython/ultraTB.py (TermColors): changed color escapes again to
5979 * IPython/ultraTB.py (TermColors): changed color escapes again to
5975 fix the (old, reintroduced) line-wrapping bug. Basically, if
5980 fix the (old, reintroduced) line-wrapping bug. Basically, if
5976 \001..\002 aren't given in the color escapes, lines get wrapped
5981 \001..\002 aren't given in the color escapes, lines get wrapped
5977 weirdly. But giving those screws up old xterms and emacs terms. So
5982 weirdly. But giving those screws up old xterms and emacs terms. So
5978 I added some logic for emacs terms to be ok, but I can't identify old
5983 I added some logic for emacs terms to be ok, but I can't identify old
5979 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5984 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5980
5985
5981 2002-03-10 Fernando Perez <fperez@colorado.edu>
5986 2002-03-10 Fernando Perez <fperez@colorado.edu>
5982
5987
5983 * IPython/usage.py (__doc__): Various documentation cleanups and
5988 * IPython/usage.py (__doc__): Various documentation cleanups and
5984 updates, both in usage docstrings and in the manual.
5989 updates, both in usage docstrings and in the manual.
5985
5990
5986 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5991 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5987 handling of caching. Set minimum acceptabe value for having a
5992 handling of caching. Set minimum acceptabe value for having a
5988 cache at 20 values.
5993 cache at 20 values.
5989
5994
5990 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5995 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5991 install_first_time function to a method, renamed it and added an
5996 install_first_time function to a method, renamed it and added an
5992 'upgrade' mode. Now people can update their config directory with
5997 'upgrade' mode. Now people can update their config directory with
5993 a simple command line switch (-upgrade, also new).
5998 a simple command line switch (-upgrade, also new).
5994
5999
5995 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6000 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5996 @file (convenient for automagic users under Python >= 2.2).
6001 @file (convenient for automagic users under Python >= 2.2).
5997 Removed @files (it seemed more like a plural than an abbrev. of
6002 Removed @files (it seemed more like a plural than an abbrev. of
5998 'file show').
6003 'file show').
5999
6004
6000 * IPython/iplib.py (install_first_time): Fixed crash if there were
6005 * IPython/iplib.py (install_first_time): Fixed crash if there were
6001 backup files ('~') in .ipython/ install directory.
6006 backup files ('~') in .ipython/ install directory.
6002
6007
6003 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6008 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6004 system. Things look fine, but these changes are fairly
6009 system. Things look fine, but these changes are fairly
6005 intrusive. Test them for a few days.
6010 intrusive. Test them for a few days.
6006
6011
6007 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6012 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6008 the prompts system. Now all in/out prompt strings are user
6013 the prompts system. Now all in/out prompt strings are user
6009 controllable. This is particularly useful for embedding, as one
6014 controllable. This is particularly useful for embedding, as one
6010 can tag embedded instances with particular prompts.
6015 can tag embedded instances with particular prompts.
6011
6016
6012 Also removed global use of sys.ps1/2, which now allows nested
6017 Also removed global use of sys.ps1/2, which now allows nested
6013 embeddings without any problems. Added command-line options for
6018 embeddings without any problems. Added command-line options for
6014 the prompt strings.
6019 the prompt strings.
6015
6020
6016 2002-03-08 Fernando Perez <fperez@colorado.edu>
6021 2002-03-08 Fernando Perez <fperez@colorado.edu>
6017
6022
6018 * IPython/UserConfig/example-embed-short.py (ipshell): added
6023 * IPython/UserConfig/example-embed-short.py (ipshell): added
6019 example file with the bare minimum code for embedding.
6024 example file with the bare minimum code for embedding.
6020
6025
6021 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6026 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6022 functionality for the embeddable shell to be activated/deactivated
6027 functionality for the embeddable shell to be activated/deactivated
6023 either globally or at each call.
6028 either globally or at each call.
6024
6029
6025 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6030 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6026 rewriting the prompt with '--->' for auto-inputs with proper
6031 rewriting the prompt with '--->' for auto-inputs with proper
6027 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6032 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6028 this is handled by the prompts class itself, as it should.
6033 this is handled by the prompts class itself, as it should.
6029
6034
6030 2002-03-05 Fernando Perez <fperez@colorado.edu>
6035 2002-03-05 Fernando Perez <fperez@colorado.edu>
6031
6036
6032 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6037 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6033 @logstart to avoid name clashes with the math log function.
6038 @logstart to avoid name clashes with the math log function.
6034
6039
6035 * Big updates to X/Emacs section of the manual.
6040 * Big updates to X/Emacs section of the manual.
6036
6041
6037 * Removed ipython_emacs. Milan explained to me how to pass
6042 * Removed ipython_emacs. Milan explained to me how to pass
6038 arguments to ipython through Emacs. Some day I'm going to end up
6043 arguments to ipython through Emacs. Some day I'm going to end up
6039 learning some lisp...
6044 learning some lisp...
6040
6045
6041 2002-03-04 Fernando Perez <fperez@colorado.edu>
6046 2002-03-04 Fernando Perez <fperez@colorado.edu>
6042
6047
6043 * IPython/ipython_emacs: Created script to be used as the
6048 * IPython/ipython_emacs: Created script to be used as the
6044 py-python-command Emacs variable so we can pass IPython
6049 py-python-command Emacs variable so we can pass IPython
6045 parameters. I can't figure out how to tell Emacs directly to pass
6050 parameters. I can't figure out how to tell Emacs directly to pass
6046 parameters to IPython, so a dummy shell script will do it.
6051 parameters to IPython, so a dummy shell script will do it.
6047
6052
6048 Other enhancements made for things to work better under Emacs'
6053 Other enhancements made for things to work better under Emacs'
6049 various types of terminals. Many thanks to Milan Zamazal
6054 various types of terminals. Many thanks to Milan Zamazal
6050 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6055 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6051
6056
6052 2002-03-01 Fernando Perez <fperez@colorado.edu>
6057 2002-03-01 Fernando Perez <fperez@colorado.edu>
6053
6058
6054 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6059 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6055 that loading of readline is now optional. This gives better
6060 that loading of readline is now optional. This gives better
6056 control to emacs users.
6061 control to emacs users.
6057
6062
6058 * IPython/ultraTB.py (__date__): Modified color escape sequences
6063 * IPython/ultraTB.py (__date__): Modified color escape sequences
6059 and now things work fine under xterm and in Emacs' term buffers
6064 and now things work fine under xterm and in Emacs' term buffers
6060 (though not shell ones). Well, in emacs you get colors, but all
6065 (though not shell ones). Well, in emacs you get colors, but all
6061 seem to be 'light' colors (no difference between dark and light
6066 seem to be 'light' colors (no difference between dark and light
6062 ones). But the garbage chars are gone, and also in xterms. It
6067 ones). But the garbage chars are gone, and also in xterms. It
6063 seems that now I'm using 'cleaner' ansi sequences.
6068 seems that now I'm using 'cleaner' ansi sequences.
6064
6069
6065 2002-02-21 Fernando Perez <fperez@colorado.edu>
6070 2002-02-21 Fernando Perez <fperez@colorado.edu>
6066
6071
6067 * Released 0.2.7 (mainly to publish the scoping fix).
6072 * Released 0.2.7 (mainly to publish the scoping fix).
6068
6073
6069 * IPython/Logger.py (Logger.logstate): added. A corresponding
6074 * IPython/Logger.py (Logger.logstate): added. A corresponding
6070 @logstate magic was created.
6075 @logstate magic was created.
6071
6076
6072 * IPython/Magic.py: fixed nested scoping problem under Python
6077 * IPython/Magic.py: fixed nested scoping problem under Python
6073 2.1.x (automagic wasn't working).
6078 2.1.x (automagic wasn't working).
6074
6079
6075 2002-02-20 Fernando Perez <fperez@colorado.edu>
6080 2002-02-20 Fernando Perez <fperez@colorado.edu>
6076
6081
6077 * Released 0.2.6.
6082 * Released 0.2.6.
6078
6083
6079 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6084 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6080 option so that logs can come out without any headers at all.
6085 option so that logs can come out without any headers at all.
6081
6086
6082 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6087 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6083 SciPy.
6088 SciPy.
6084
6089
6085 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6090 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6086 that embedded IPython calls don't require vars() to be explicitly
6091 that embedded IPython calls don't require vars() to be explicitly
6087 passed. Now they are extracted from the caller's frame (code
6092 passed. Now they are extracted from the caller's frame (code
6088 snatched from Eric Jones' weave). Added better documentation to
6093 snatched from Eric Jones' weave). Added better documentation to
6089 the section on embedding and the example file.
6094 the section on embedding and the example file.
6090
6095
6091 * IPython/genutils.py (page): Changed so that under emacs, it just
6096 * IPython/genutils.py (page): Changed so that under emacs, it just
6092 prints the string. You can then page up and down in the emacs
6097 prints the string. You can then page up and down in the emacs
6093 buffer itself. This is how the builtin help() works.
6098 buffer itself. This is how the builtin help() works.
6094
6099
6095 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6100 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6096 macro scoping: macros need to be executed in the user's namespace
6101 macro scoping: macros need to be executed in the user's namespace
6097 to work as if they had been typed by the user.
6102 to work as if they had been typed by the user.
6098
6103
6099 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6104 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6100 execute automatically (no need to type 'exec...'). They then
6105 execute automatically (no need to type 'exec...'). They then
6101 behave like 'true macros'. The printing system was also modified
6106 behave like 'true macros'. The printing system was also modified
6102 for this to work.
6107 for this to work.
6103
6108
6104 2002-02-19 Fernando Perez <fperez@colorado.edu>
6109 2002-02-19 Fernando Perez <fperez@colorado.edu>
6105
6110
6106 * IPython/genutils.py (page_file): new function for paging files
6111 * IPython/genutils.py (page_file): new function for paging files
6107 in an OS-independent way. Also necessary for file viewing to work
6112 in an OS-independent way. Also necessary for file viewing to work
6108 well inside Emacs buffers.
6113 well inside Emacs buffers.
6109 (page): Added checks for being in an emacs buffer.
6114 (page): Added checks for being in an emacs buffer.
6110 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6115 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6111 same bug in iplib.
6116 same bug in iplib.
6112
6117
6113 2002-02-18 Fernando Perez <fperez@colorado.edu>
6118 2002-02-18 Fernando Perez <fperez@colorado.edu>
6114
6119
6115 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6120 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6116 of readline so that IPython can work inside an Emacs buffer.
6121 of readline so that IPython can work inside an Emacs buffer.
6117
6122
6118 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6123 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6119 method signatures (they weren't really bugs, but it looks cleaner
6124 method signatures (they weren't really bugs, but it looks cleaner
6120 and keeps PyChecker happy).
6125 and keeps PyChecker happy).
6121
6126
6122 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6127 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6123 for implementing various user-defined hooks. Currently only
6128 for implementing various user-defined hooks. Currently only
6124 display is done.
6129 display is done.
6125
6130
6126 * IPython/Prompts.py (CachedOutput._display): changed display
6131 * IPython/Prompts.py (CachedOutput._display): changed display
6127 functions so that they can be dynamically changed by users easily.
6132 functions so that they can be dynamically changed by users easily.
6128
6133
6129 * IPython/Extensions/numeric_formats.py (num_display): added an
6134 * IPython/Extensions/numeric_formats.py (num_display): added an
6130 extension for printing NumPy arrays in flexible manners. It
6135 extension for printing NumPy arrays in flexible manners. It
6131 doesn't do anything yet, but all the structure is in
6136 doesn't do anything yet, but all the structure is in
6132 place. Ultimately the plan is to implement output format control
6137 place. Ultimately the plan is to implement output format control
6133 like in Octave.
6138 like in Octave.
6134
6139
6135 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6140 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6136 methods are found at run-time by all the automatic machinery.
6141 methods are found at run-time by all the automatic machinery.
6137
6142
6138 2002-02-17 Fernando Perez <fperez@colorado.edu>
6143 2002-02-17 Fernando Perez <fperez@colorado.edu>
6139
6144
6140 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6145 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6141 whole file a little.
6146 whole file a little.
6142
6147
6143 * ToDo: closed this document. Now there's a new_design.lyx
6148 * ToDo: closed this document. Now there's a new_design.lyx
6144 document for all new ideas. Added making a pdf of it for the
6149 document for all new ideas. Added making a pdf of it for the
6145 end-user distro.
6150 end-user distro.
6146
6151
6147 * IPython/Logger.py (Logger.switch_log): Created this to replace
6152 * IPython/Logger.py (Logger.switch_log): Created this to replace
6148 logon() and logoff(). It also fixes a nasty crash reported by
6153 logon() and logoff(). It also fixes a nasty crash reported by
6149 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6154 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6150
6155
6151 * IPython/iplib.py (complete): got auto-completion to work with
6156 * IPython/iplib.py (complete): got auto-completion to work with
6152 automagic (I had wanted this for a long time).
6157 automagic (I had wanted this for a long time).
6153
6158
6154 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6159 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6155 to @file, since file() is now a builtin and clashes with automagic
6160 to @file, since file() is now a builtin and clashes with automagic
6156 for @file.
6161 for @file.
6157
6162
6158 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6163 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6159 of this was previously in iplib, which had grown to more than 2000
6164 of this was previously in iplib, which had grown to more than 2000
6160 lines, way too long. No new functionality, but it makes managing
6165 lines, way too long. No new functionality, but it makes managing
6161 the code a bit easier.
6166 the code a bit easier.
6162
6167
6163 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6168 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6164 information to crash reports.
6169 information to crash reports.
6165
6170
6166 2002-02-12 Fernando Perez <fperez@colorado.edu>
6171 2002-02-12 Fernando Perez <fperez@colorado.edu>
6167
6172
6168 * Released 0.2.5.
6173 * Released 0.2.5.
6169
6174
6170 2002-02-11 Fernando Perez <fperez@colorado.edu>
6175 2002-02-11 Fernando Perez <fperez@colorado.edu>
6171
6176
6172 * Wrote a relatively complete Windows installer. It puts
6177 * Wrote a relatively complete Windows installer. It puts
6173 everything in place, creates Start Menu entries and fixes the
6178 everything in place, creates Start Menu entries and fixes the
6174 color issues. Nothing fancy, but it works.
6179 color issues. Nothing fancy, but it works.
6175
6180
6176 2002-02-10 Fernando Perez <fperez@colorado.edu>
6181 2002-02-10 Fernando Perez <fperez@colorado.edu>
6177
6182
6178 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6183 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6179 os.path.expanduser() call so that we can type @run ~/myfile.py and
6184 os.path.expanduser() call so that we can type @run ~/myfile.py and
6180 have thigs work as expected.
6185 have thigs work as expected.
6181
6186
6182 * IPython/genutils.py (page): fixed exception handling so things
6187 * IPython/genutils.py (page): fixed exception handling so things
6183 work both in Unix and Windows correctly. Quitting a pager triggers
6188 work both in Unix and Windows correctly. Quitting a pager triggers
6184 an IOError/broken pipe in Unix, and in windows not finding a pager
6189 an IOError/broken pipe in Unix, and in windows not finding a pager
6185 is also an IOError, so I had to actually look at the return value
6190 is also an IOError, so I had to actually look at the return value
6186 of the exception, not just the exception itself. Should be ok now.
6191 of the exception, not just the exception itself. Should be ok now.
6187
6192
6188 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6193 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6189 modified to allow case-insensitive color scheme changes.
6194 modified to allow case-insensitive color scheme changes.
6190
6195
6191 2002-02-09 Fernando Perez <fperez@colorado.edu>
6196 2002-02-09 Fernando Perez <fperez@colorado.edu>
6192
6197
6193 * IPython/genutils.py (native_line_ends): new function to leave
6198 * IPython/genutils.py (native_line_ends): new function to leave
6194 user config files with os-native line-endings.
6199 user config files with os-native line-endings.
6195
6200
6196 * README and manual updates.
6201 * README and manual updates.
6197
6202
6198 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6203 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6199 instead of StringType to catch Unicode strings.
6204 instead of StringType to catch Unicode strings.
6200
6205
6201 * IPython/genutils.py (filefind): fixed bug for paths with
6206 * IPython/genutils.py (filefind): fixed bug for paths with
6202 embedded spaces (very common in Windows).
6207 embedded spaces (very common in Windows).
6203
6208
6204 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6209 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6205 files under Windows, so that they get automatically associated
6210 files under Windows, so that they get automatically associated
6206 with a text editor. Windows makes it a pain to handle
6211 with a text editor. Windows makes it a pain to handle
6207 extension-less files.
6212 extension-less files.
6208
6213
6209 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6214 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6210 warning about readline only occur for Posix. In Windows there's no
6215 warning about readline only occur for Posix. In Windows there's no
6211 way to get readline, so why bother with the warning.
6216 way to get readline, so why bother with the warning.
6212
6217
6213 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6218 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6214 for __str__ instead of dir(self), since dir() changed in 2.2.
6219 for __str__ instead of dir(self), since dir() changed in 2.2.
6215
6220
6216 * Ported to Windows! Tested on XP, I suspect it should work fine
6221 * Ported to Windows! Tested on XP, I suspect it should work fine
6217 on NT/2000, but I don't think it will work on 98 et al. That
6222 on NT/2000, but I don't think it will work on 98 et al. That
6218 series of Windows is such a piece of junk anyway that I won't try
6223 series of Windows is such a piece of junk anyway that I won't try
6219 porting it there. The XP port was straightforward, showed a few
6224 porting it there. The XP port was straightforward, showed a few
6220 bugs here and there (fixed all), in particular some string
6225 bugs here and there (fixed all), in particular some string
6221 handling stuff which required considering Unicode strings (which
6226 handling stuff which required considering Unicode strings (which
6222 Windows uses). This is good, but hasn't been too tested :) No
6227 Windows uses). This is good, but hasn't been too tested :) No
6223 fancy installer yet, I'll put a note in the manual so people at
6228 fancy installer yet, I'll put a note in the manual so people at
6224 least make manually a shortcut.
6229 least make manually a shortcut.
6225
6230
6226 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6231 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6227 into a single one, "colors". This now controls both prompt and
6232 into a single one, "colors". This now controls both prompt and
6228 exception color schemes, and can be changed both at startup
6233 exception color schemes, and can be changed both at startup
6229 (either via command-line switches or via ipythonrc files) and at
6234 (either via command-line switches or via ipythonrc files) and at
6230 runtime, with @colors.
6235 runtime, with @colors.
6231 (Magic.magic_run): renamed @prun to @run and removed the old
6236 (Magic.magic_run): renamed @prun to @run and removed the old
6232 @run. The two were too similar to warrant keeping both.
6237 @run. The two were too similar to warrant keeping both.
6233
6238
6234 2002-02-03 Fernando Perez <fperez@colorado.edu>
6239 2002-02-03 Fernando Perez <fperez@colorado.edu>
6235
6240
6236 * IPython/iplib.py (install_first_time): Added comment on how to
6241 * IPython/iplib.py (install_first_time): Added comment on how to
6237 configure the color options for first-time users. Put a <return>
6242 configure the color options for first-time users. Put a <return>
6238 request at the end so that small-terminal users get a chance to
6243 request at the end so that small-terminal users get a chance to
6239 read the startup info.
6244 read the startup info.
6240
6245
6241 2002-01-23 Fernando Perez <fperez@colorado.edu>
6246 2002-01-23 Fernando Perez <fperez@colorado.edu>
6242
6247
6243 * IPython/iplib.py (CachedOutput.update): Changed output memory
6248 * IPython/iplib.py (CachedOutput.update): Changed output memory
6244 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6249 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6245 input history we still use _i. Did this b/c these variable are
6250 input history we still use _i. Did this b/c these variable are
6246 very commonly used in interactive work, so the less we need to
6251 very commonly used in interactive work, so the less we need to
6247 type the better off we are.
6252 type the better off we are.
6248 (Magic.magic_prun): updated @prun to better handle the namespaces
6253 (Magic.magic_prun): updated @prun to better handle the namespaces
6249 the file will run in, including a fix for __name__ not being set
6254 the file will run in, including a fix for __name__ not being set
6250 before.
6255 before.
6251
6256
6252 2002-01-20 Fernando Perez <fperez@colorado.edu>
6257 2002-01-20 Fernando Perez <fperez@colorado.edu>
6253
6258
6254 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6259 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6255 extra garbage for Python 2.2. Need to look more carefully into
6260 extra garbage for Python 2.2. Need to look more carefully into
6256 this later.
6261 this later.
6257
6262
6258 2002-01-19 Fernando Perez <fperez@colorado.edu>
6263 2002-01-19 Fernando Perez <fperez@colorado.edu>
6259
6264
6260 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6265 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6261 display SyntaxError exceptions properly formatted when they occur
6266 display SyntaxError exceptions properly formatted when they occur
6262 (they can be triggered by imported code).
6267 (they can be triggered by imported code).
6263
6268
6264 2002-01-18 Fernando Perez <fperez@colorado.edu>
6269 2002-01-18 Fernando Perez <fperez@colorado.edu>
6265
6270
6266 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6271 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6267 SyntaxError exceptions are reported nicely formatted, instead of
6272 SyntaxError exceptions are reported nicely formatted, instead of
6268 spitting out only offset information as before.
6273 spitting out only offset information as before.
6269 (Magic.magic_prun): Added the @prun function for executing
6274 (Magic.magic_prun): Added the @prun function for executing
6270 programs with command line args inside IPython.
6275 programs with command line args inside IPython.
6271
6276
6272 2002-01-16 Fernando Perez <fperez@colorado.edu>
6277 2002-01-16 Fernando Perez <fperez@colorado.edu>
6273
6278
6274 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6279 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6275 to *not* include the last item given in a range. This brings their
6280 to *not* include the last item given in a range. This brings their
6276 behavior in line with Python's slicing:
6281 behavior in line with Python's slicing:
6277 a[n1:n2] -> a[n1]...a[n2-1]
6282 a[n1:n2] -> a[n1]...a[n2-1]
6278 It may be a bit less convenient, but I prefer to stick to Python's
6283 It may be a bit less convenient, but I prefer to stick to Python's
6279 conventions *everywhere*, so users never have to wonder.
6284 conventions *everywhere*, so users never have to wonder.
6280 (Magic.magic_macro): Added @macro function to ease the creation of
6285 (Magic.magic_macro): Added @macro function to ease the creation of
6281 macros.
6286 macros.
6282
6287
6283 2002-01-05 Fernando Perez <fperez@colorado.edu>
6288 2002-01-05 Fernando Perez <fperez@colorado.edu>
6284
6289
6285 * Released 0.2.4.
6290 * Released 0.2.4.
6286
6291
6287 * IPython/iplib.py (Magic.magic_pdef):
6292 * IPython/iplib.py (Magic.magic_pdef):
6288 (InteractiveShell.safe_execfile): report magic lines and error
6293 (InteractiveShell.safe_execfile): report magic lines and error
6289 lines without line numbers so one can easily copy/paste them for
6294 lines without line numbers so one can easily copy/paste them for
6290 re-execution.
6295 re-execution.
6291
6296
6292 * Updated manual with recent changes.
6297 * Updated manual with recent changes.
6293
6298
6294 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6299 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6295 docstring printing when class? is called. Very handy for knowing
6300 docstring printing when class? is called. Very handy for knowing
6296 how to create class instances (as long as __init__ is well
6301 how to create class instances (as long as __init__ is well
6297 documented, of course :)
6302 documented, of course :)
6298 (Magic.magic_doc): print both class and constructor docstrings.
6303 (Magic.magic_doc): print both class and constructor docstrings.
6299 (Magic.magic_pdef): give constructor info if passed a class and
6304 (Magic.magic_pdef): give constructor info if passed a class and
6300 __call__ info for callable object instances.
6305 __call__ info for callable object instances.
6301
6306
6302 2002-01-04 Fernando Perez <fperez@colorado.edu>
6307 2002-01-04 Fernando Perez <fperez@colorado.edu>
6303
6308
6304 * Made deep_reload() off by default. It doesn't always work
6309 * Made deep_reload() off by default. It doesn't always work
6305 exactly as intended, so it's probably safer to have it off. It's
6310 exactly as intended, so it's probably safer to have it off. It's
6306 still available as dreload() anyway, so nothing is lost.
6311 still available as dreload() anyway, so nothing is lost.
6307
6312
6308 2002-01-02 Fernando Perez <fperez@colorado.edu>
6313 2002-01-02 Fernando Perez <fperez@colorado.edu>
6309
6314
6310 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6315 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6311 so I wanted an updated release).
6316 so I wanted an updated release).
6312
6317
6313 2001-12-27 Fernando Perez <fperez@colorado.edu>
6318 2001-12-27 Fernando Perez <fperez@colorado.edu>
6314
6319
6315 * IPython/iplib.py (InteractiveShell.interact): Added the original
6320 * IPython/iplib.py (InteractiveShell.interact): Added the original
6316 code from 'code.py' for this module in order to change the
6321 code from 'code.py' for this module in order to change the
6317 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6322 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6318 the history cache would break when the user hit Ctrl-C, and
6323 the history cache would break when the user hit Ctrl-C, and
6319 interact() offers no way to add any hooks to it.
6324 interact() offers no way to add any hooks to it.
6320
6325
6321 2001-12-23 Fernando Perez <fperez@colorado.edu>
6326 2001-12-23 Fernando Perez <fperez@colorado.edu>
6322
6327
6323 * setup.py: added check for 'MANIFEST' before trying to remove
6328 * setup.py: added check for 'MANIFEST' before trying to remove
6324 it. Thanks to Sean Reifschneider.
6329 it. Thanks to Sean Reifschneider.
6325
6330
6326 2001-12-22 Fernando Perez <fperez@colorado.edu>
6331 2001-12-22 Fernando Perez <fperez@colorado.edu>
6327
6332
6328 * Released 0.2.2.
6333 * Released 0.2.2.
6329
6334
6330 * Finished (reasonably) writing the manual. Later will add the
6335 * Finished (reasonably) writing the manual. Later will add the
6331 python-standard navigation stylesheets, but for the time being
6336 python-standard navigation stylesheets, but for the time being
6332 it's fairly complete. Distribution will include html and pdf
6337 it's fairly complete. Distribution will include html and pdf
6333 versions.
6338 versions.
6334
6339
6335 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6340 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6336 (MayaVi author).
6341 (MayaVi author).
6337
6342
6338 2001-12-21 Fernando Perez <fperez@colorado.edu>
6343 2001-12-21 Fernando Perez <fperez@colorado.edu>
6339
6344
6340 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6345 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6341 good public release, I think (with the manual and the distutils
6346 good public release, I think (with the manual and the distutils
6342 installer). The manual can use some work, but that can go
6347 installer). The manual can use some work, but that can go
6343 slowly. Otherwise I think it's quite nice for end users. Next
6348 slowly. Otherwise I think it's quite nice for end users. Next
6344 summer, rewrite the guts of it...
6349 summer, rewrite the guts of it...
6345
6350
6346 * Changed format of ipythonrc files to use whitespace as the
6351 * Changed format of ipythonrc files to use whitespace as the
6347 separator instead of an explicit '='. Cleaner.
6352 separator instead of an explicit '='. Cleaner.
6348
6353
6349 2001-12-20 Fernando Perez <fperez@colorado.edu>
6354 2001-12-20 Fernando Perez <fperez@colorado.edu>
6350
6355
6351 * Started a manual in LyX. For now it's just a quick merge of the
6356 * Started a manual in LyX. For now it's just a quick merge of the
6352 various internal docstrings and READMEs. Later it may grow into a
6357 various internal docstrings and READMEs. Later it may grow into a
6353 nice, full-blown manual.
6358 nice, full-blown manual.
6354
6359
6355 * Set up a distutils based installer. Installation should now be
6360 * Set up a distutils based installer. Installation should now be
6356 trivially simple for end-users.
6361 trivially simple for end-users.
6357
6362
6358 2001-12-11 Fernando Perez <fperez@colorado.edu>
6363 2001-12-11 Fernando Perez <fperez@colorado.edu>
6359
6364
6360 * Released 0.2.0. First public release, announced it at
6365 * Released 0.2.0. First public release, announced it at
6361 comp.lang.python. From now on, just bugfixes...
6366 comp.lang.python. From now on, just bugfixes...
6362
6367
6363 * Went through all the files, set copyright/license notices and
6368 * Went through all the files, set copyright/license notices and
6364 cleaned up things. Ready for release.
6369 cleaned up things. Ready for release.
6365
6370
6366 2001-12-10 Fernando Perez <fperez@colorado.edu>
6371 2001-12-10 Fernando Perez <fperez@colorado.edu>
6367
6372
6368 * Changed the first-time installer not to use tarfiles. It's more
6373 * Changed the first-time installer not to use tarfiles. It's more
6369 robust now and less unix-dependent. Also makes it easier for
6374 robust now and less unix-dependent. Also makes it easier for
6370 people to later upgrade versions.
6375 people to later upgrade versions.
6371
6376
6372 * Changed @exit to @abort to reflect the fact that it's pretty
6377 * Changed @exit to @abort to reflect the fact that it's pretty
6373 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6378 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6374 becomes significant only when IPyhton is embedded: in that case,
6379 becomes significant only when IPyhton is embedded: in that case,
6375 C-D closes IPython only, but @abort kills the enclosing program
6380 C-D closes IPython only, but @abort kills the enclosing program
6376 too (unless it had called IPython inside a try catching
6381 too (unless it had called IPython inside a try catching
6377 SystemExit).
6382 SystemExit).
6378
6383
6379 * Created Shell module which exposes the actuall IPython Shell
6384 * Created Shell module which exposes the actuall IPython Shell
6380 classes, currently the normal and the embeddable one. This at
6385 classes, currently the normal and the embeddable one. This at
6381 least offers a stable interface we won't need to change when
6386 least offers a stable interface we won't need to change when
6382 (later) the internals are rewritten. That rewrite will be confined
6387 (later) the internals are rewritten. That rewrite will be confined
6383 to iplib and ipmaker, but the Shell interface should remain as is.
6388 to iplib and ipmaker, but the Shell interface should remain as is.
6384
6389
6385 * Added embed module which offers an embeddable IPShell object,
6390 * Added embed module which offers an embeddable IPShell object,
6386 useful to fire up IPython *inside* a running program. Great for
6391 useful to fire up IPython *inside* a running program. Great for
6387 debugging or dynamical data analysis.
6392 debugging or dynamical data analysis.
6388
6393
6389 2001-12-08 Fernando Perez <fperez@colorado.edu>
6394 2001-12-08 Fernando Perez <fperez@colorado.edu>
6390
6395
6391 * Fixed small bug preventing seeing info from methods of defined
6396 * Fixed small bug preventing seeing info from methods of defined
6392 objects (incorrect namespace in _ofind()).
6397 objects (incorrect namespace in _ofind()).
6393
6398
6394 * Documentation cleanup. Moved the main usage docstrings to a
6399 * Documentation cleanup. Moved the main usage docstrings to a
6395 separate file, usage.py (cleaner to maintain, and hopefully in the
6400 separate file, usage.py (cleaner to maintain, and hopefully in the
6396 future some perlpod-like way of producing interactive, man and
6401 future some perlpod-like way of producing interactive, man and
6397 html docs out of it will be found).
6402 html docs out of it will be found).
6398
6403
6399 * Added @profile to see your profile at any time.
6404 * Added @profile to see your profile at any time.
6400
6405
6401 * Added @p as an alias for 'print'. It's especially convenient if
6406 * Added @p as an alias for 'print'. It's especially convenient if
6402 using automagic ('p x' prints x).
6407 using automagic ('p x' prints x).
6403
6408
6404 * Small cleanups and fixes after a pychecker run.
6409 * Small cleanups and fixes after a pychecker run.
6405
6410
6406 * Changed the @cd command to handle @cd - and @cd -<n> for
6411 * Changed the @cd command to handle @cd - and @cd -<n> for
6407 visiting any directory in _dh.
6412 visiting any directory in _dh.
6408
6413
6409 * Introduced _dh, a history of visited directories. @dhist prints
6414 * Introduced _dh, a history of visited directories. @dhist prints
6410 it out with numbers.
6415 it out with numbers.
6411
6416
6412 2001-12-07 Fernando Perez <fperez@colorado.edu>
6417 2001-12-07 Fernando Perez <fperez@colorado.edu>
6413
6418
6414 * Released 0.1.22
6419 * Released 0.1.22
6415
6420
6416 * Made initialization a bit more robust against invalid color
6421 * Made initialization a bit more robust against invalid color
6417 options in user input (exit, not traceback-crash).
6422 options in user input (exit, not traceback-crash).
6418
6423
6419 * Changed the bug crash reporter to write the report only in the
6424 * Changed the bug crash reporter to write the report only in the
6420 user's .ipython directory. That way IPython won't litter people's
6425 user's .ipython directory. That way IPython won't litter people's
6421 hard disks with crash files all over the place. Also print on
6426 hard disks with crash files all over the place. Also print on
6422 screen the necessary mail command.
6427 screen the necessary mail command.
6423
6428
6424 * With the new ultraTB, implemented LightBG color scheme for light
6429 * With the new ultraTB, implemented LightBG color scheme for light
6425 background terminals. A lot of people like white backgrounds, so I
6430 background terminals. A lot of people like white backgrounds, so I
6426 guess we should at least give them something readable.
6431 guess we should at least give them something readable.
6427
6432
6428 2001-12-06 Fernando Perez <fperez@colorado.edu>
6433 2001-12-06 Fernando Perez <fperez@colorado.edu>
6429
6434
6430 * Modified the structure of ultraTB. Now there's a proper class
6435 * Modified the structure of ultraTB. Now there's a proper class
6431 for tables of color schemes which allow adding schemes easily and
6436 for tables of color schemes which allow adding schemes easily and
6432 switching the active scheme without creating a new instance every
6437 switching the active scheme without creating a new instance every
6433 time (which was ridiculous). The syntax for creating new schemes
6438 time (which was ridiculous). The syntax for creating new schemes
6434 is also cleaner. I think ultraTB is finally done, with a clean
6439 is also cleaner. I think ultraTB is finally done, with a clean
6435 class structure. Names are also much cleaner (now there's proper
6440 class structure. Names are also much cleaner (now there's proper
6436 color tables, no need for every variable to also have 'color' in
6441 color tables, no need for every variable to also have 'color' in
6437 its name).
6442 its name).
6438
6443
6439 * Broke down genutils into separate files. Now genutils only
6444 * Broke down genutils into separate files. Now genutils only
6440 contains utility functions, and classes have been moved to their
6445 contains utility functions, and classes have been moved to their
6441 own files (they had enough independent functionality to warrant
6446 own files (they had enough independent functionality to warrant
6442 it): ConfigLoader, OutputTrap, Struct.
6447 it): ConfigLoader, OutputTrap, Struct.
6443
6448
6444 2001-12-05 Fernando Perez <fperez@colorado.edu>
6449 2001-12-05 Fernando Perez <fperez@colorado.edu>
6445
6450
6446 * IPython turns 21! Released version 0.1.21, as a candidate for
6451 * IPython turns 21! Released version 0.1.21, as a candidate for
6447 public consumption. If all goes well, release in a few days.
6452 public consumption. If all goes well, release in a few days.
6448
6453
6449 * Fixed path bug (files in Extensions/ directory wouldn't be found
6454 * Fixed path bug (files in Extensions/ directory wouldn't be found
6450 unless IPython/ was explicitly in sys.path).
6455 unless IPython/ was explicitly in sys.path).
6451
6456
6452 * Extended the FlexCompleter class as MagicCompleter to allow
6457 * Extended the FlexCompleter class as MagicCompleter to allow
6453 completion of @-starting lines.
6458 completion of @-starting lines.
6454
6459
6455 * Created __release__.py file as a central repository for release
6460 * Created __release__.py file as a central repository for release
6456 info that other files can read from.
6461 info that other files can read from.
6457
6462
6458 * Fixed small bug in logging: when logging was turned on in
6463 * Fixed small bug in logging: when logging was turned on in
6459 mid-session, old lines with special meanings (!@?) were being
6464 mid-session, old lines with special meanings (!@?) were being
6460 logged without the prepended comment, which is necessary since
6465 logged without the prepended comment, which is necessary since
6461 they are not truly valid python syntax. This should make session
6466 they are not truly valid python syntax. This should make session
6462 restores produce less errors.
6467 restores produce less errors.
6463
6468
6464 * The namespace cleanup forced me to make a FlexCompleter class
6469 * The namespace cleanup forced me to make a FlexCompleter class
6465 which is nothing but a ripoff of rlcompleter, but with selectable
6470 which is nothing but a ripoff of rlcompleter, but with selectable
6466 namespace (rlcompleter only works in __main__.__dict__). I'll try
6471 namespace (rlcompleter only works in __main__.__dict__). I'll try
6467 to submit a note to the authors to see if this change can be
6472 to submit a note to the authors to see if this change can be
6468 incorporated in future rlcompleter releases (Dec.6: done)
6473 incorporated in future rlcompleter releases (Dec.6: done)
6469
6474
6470 * More fixes to namespace handling. It was a mess! Now all
6475 * More fixes to namespace handling. It was a mess! Now all
6471 explicit references to __main__.__dict__ are gone (except when
6476 explicit references to __main__.__dict__ are gone (except when
6472 really needed) and everything is handled through the namespace
6477 really needed) and everything is handled through the namespace
6473 dicts in the IPython instance. We seem to be getting somewhere
6478 dicts in the IPython instance. We seem to be getting somewhere
6474 with this, finally...
6479 with this, finally...
6475
6480
6476 * Small documentation updates.
6481 * Small documentation updates.
6477
6482
6478 * Created the Extensions directory under IPython (with an
6483 * Created the Extensions directory under IPython (with an
6479 __init__.py). Put the PhysicalQ stuff there. This directory should
6484 __init__.py). Put the PhysicalQ stuff there. This directory should
6480 be used for all special-purpose extensions.
6485 be used for all special-purpose extensions.
6481
6486
6482 * File renaming:
6487 * File renaming:
6483 ipythonlib --> ipmaker
6488 ipythonlib --> ipmaker
6484 ipplib --> iplib
6489 ipplib --> iplib
6485 This makes a bit more sense in terms of what these files actually do.
6490 This makes a bit more sense in terms of what these files actually do.
6486
6491
6487 * Moved all the classes and functions in ipythonlib to ipplib, so
6492 * Moved all the classes and functions in ipythonlib to ipplib, so
6488 now ipythonlib only has make_IPython(). This will ease up its
6493 now ipythonlib only has make_IPython(). This will ease up its
6489 splitting in smaller functional chunks later.
6494 splitting in smaller functional chunks later.
6490
6495
6491 * Cleaned up (done, I think) output of @whos. Better column
6496 * Cleaned up (done, I think) output of @whos. Better column
6492 formatting, and now shows str(var) for as much as it can, which is
6497 formatting, and now shows str(var) for as much as it can, which is
6493 typically what one gets with a 'print var'.
6498 typically what one gets with a 'print var'.
6494
6499
6495 2001-12-04 Fernando Perez <fperez@colorado.edu>
6500 2001-12-04 Fernando Perez <fperez@colorado.edu>
6496
6501
6497 * Fixed namespace problems. Now builtin/IPyhton/user names get
6502 * Fixed namespace problems. Now builtin/IPyhton/user names get
6498 properly reported in their namespace. Internal namespace handling
6503 properly reported in their namespace. Internal namespace handling
6499 is finally getting decent (not perfect yet, but much better than
6504 is finally getting decent (not perfect yet, but much better than
6500 the ad-hoc mess we had).
6505 the ad-hoc mess we had).
6501
6506
6502 * Removed -exit option. If people just want to run a python
6507 * Removed -exit option. If people just want to run a python
6503 script, that's what the normal interpreter is for. Less
6508 script, that's what the normal interpreter is for. Less
6504 unnecessary options, less chances for bugs.
6509 unnecessary options, less chances for bugs.
6505
6510
6506 * Added a crash handler which generates a complete post-mortem if
6511 * Added a crash handler which generates a complete post-mortem if
6507 IPython crashes. This will help a lot in tracking bugs down the
6512 IPython crashes. This will help a lot in tracking bugs down the
6508 road.
6513 road.
6509
6514
6510 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6515 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6511 which were boud to functions being reassigned would bypass the
6516 which were boud to functions being reassigned would bypass the
6512 logger, breaking the sync of _il with the prompt counter. This
6517 logger, breaking the sync of _il with the prompt counter. This
6513 would then crash IPython later when a new line was logged.
6518 would then crash IPython later when a new line was logged.
6514
6519
6515 2001-12-02 Fernando Perez <fperez@colorado.edu>
6520 2001-12-02 Fernando Perez <fperez@colorado.edu>
6516
6521
6517 * Made IPython a package. This means people don't have to clutter
6522 * Made IPython a package. This means people don't have to clutter
6518 their sys.path with yet another directory. Changed the INSTALL
6523 their sys.path with yet another directory. Changed the INSTALL
6519 file accordingly.
6524 file accordingly.
6520
6525
6521 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6526 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6522 sorts its output (so @who shows it sorted) and @whos formats the
6527 sorts its output (so @who shows it sorted) and @whos formats the
6523 table according to the width of the first column. Nicer, easier to
6528 table according to the width of the first column. Nicer, easier to
6524 read. Todo: write a generic table_format() which takes a list of
6529 read. Todo: write a generic table_format() which takes a list of
6525 lists and prints it nicely formatted, with optional row/column
6530 lists and prints it nicely formatted, with optional row/column
6526 separators and proper padding and justification.
6531 separators and proper padding and justification.
6527
6532
6528 * Released 0.1.20
6533 * Released 0.1.20
6529
6534
6530 * Fixed bug in @log which would reverse the inputcache list (a
6535 * Fixed bug in @log which would reverse the inputcache list (a
6531 copy operation was missing).
6536 copy operation was missing).
6532
6537
6533 * Code cleanup. @config was changed to use page(). Better, since
6538 * Code cleanup. @config was changed to use page(). Better, since
6534 its output is always quite long.
6539 its output is always quite long.
6535
6540
6536 * Itpl is back as a dependency. I was having too many problems
6541 * Itpl is back as a dependency. I was having too many problems
6537 getting the parametric aliases to work reliably, and it's just
6542 getting the parametric aliases to work reliably, and it's just
6538 easier to code weird string operations with it than playing %()s
6543 easier to code weird string operations with it than playing %()s
6539 games. It's only ~6k, so I don't think it's too big a deal.
6544 games. It's only ~6k, so I don't think it's too big a deal.
6540
6545
6541 * Found (and fixed) a very nasty bug with history. !lines weren't
6546 * Found (and fixed) a very nasty bug with history. !lines weren't
6542 getting cached, and the out of sync caches would crash
6547 getting cached, and the out of sync caches would crash
6543 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6548 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6544 division of labor a bit better. Bug fixed, cleaner structure.
6549 division of labor a bit better. Bug fixed, cleaner structure.
6545
6550
6546 2001-12-01 Fernando Perez <fperez@colorado.edu>
6551 2001-12-01 Fernando Perez <fperez@colorado.edu>
6547
6552
6548 * Released 0.1.19
6553 * Released 0.1.19
6549
6554
6550 * Added option -n to @hist to prevent line number printing. Much
6555 * Added option -n to @hist to prevent line number printing. Much
6551 easier to copy/paste code this way.
6556 easier to copy/paste code this way.
6552
6557
6553 * Created global _il to hold the input list. Allows easy
6558 * Created global _il to hold the input list. Allows easy
6554 re-execution of blocks of code by slicing it (inspired by Janko's
6559 re-execution of blocks of code by slicing it (inspired by Janko's
6555 comment on 'macros').
6560 comment on 'macros').
6556
6561
6557 * Small fixes and doc updates.
6562 * Small fixes and doc updates.
6558
6563
6559 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6564 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6560 much too fragile with automagic. Handles properly multi-line
6565 much too fragile with automagic. Handles properly multi-line
6561 statements and takes parameters.
6566 statements and takes parameters.
6562
6567
6563 2001-11-30 Fernando Perez <fperez@colorado.edu>
6568 2001-11-30 Fernando Perez <fperez@colorado.edu>
6564
6569
6565 * Version 0.1.18 released.
6570 * Version 0.1.18 released.
6566
6571
6567 * Fixed nasty namespace bug in initial module imports.
6572 * Fixed nasty namespace bug in initial module imports.
6568
6573
6569 * Added copyright/license notes to all code files (except
6574 * Added copyright/license notes to all code files (except
6570 DPyGetOpt). For the time being, LGPL. That could change.
6575 DPyGetOpt). For the time being, LGPL. That could change.
6571
6576
6572 * Rewrote a much nicer README, updated INSTALL, cleaned up
6577 * Rewrote a much nicer README, updated INSTALL, cleaned up
6573 ipythonrc-* samples.
6578 ipythonrc-* samples.
6574
6579
6575 * Overall code/documentation cleanup. Basically ready for
6580 * Overall code/documentation cleanup. Basically ready for
6576 release. Only remaining thing: licence decision (LGPL?).
6581 release. Only remaining thing: licence decision (LGPL?).
6577
6582
6578 * Converted load_config to a class, ConfigLoader. Now recursion
6583 * Converted load_config to a class, ConfigLoader. Now recursion
6579 control is better organized. Doesn't include the same file twice.
6584 control is better organized. Doesn't include the same file twice.
6580
6585
6581 2001-11-29 Fernando Perez <fperez@colorado.edu>
6586 2001-11-29 Fernando Perez <fperez@colorado.edu>
6582
6587
6583 * Got input history working. Changed output history variables from
6588 * Got input history working. Changed output history variables from
6584 _p to _o so that _i is for input and _o for output. Just cleaner
6589 _p to _o so that _i is for input and _o for output. Just cleaner
6585 convention.
6590 convention.
6586
6591
6587 * Implemented parametric aliases. This pretty much allows the
6592 * Implemented parametric aliases. This pretty much allows the
6588 alias system to offer full-blown shell convenience, I think.
6593 alias system to offer full-blown shell convenience, I think.
6589
6594
6590 * Version 0.1.17 released, 0.1.18 opened.
6595 * Version 0.1.17 released, 0.1.18 opened.
6591
6596
6592 * dot_ipython/ipythonrc (alias): added documentation.
6597 * dot_ipython/ipythonrc (alias): added documentation.
6593 (xcolor): Fixed small bug (xcolors -> xcolor)
6598 (xcolor): Fixed small bug (xcolors -> xcolor)
6594
6599
6595 * Changed the alias system. Now alias is a magic command to define
6600 * Changed the alias system. Now alias is a magic command to define
6596 aliases just like the shell. Rationale: the builtin magics should
6601 aliases just like the shell. Rationale: the builtin magics should
6597 be there for things deeply connected to IPython's
6602 be there for things deeply connected to IPython's
6598 architecture. And this is a much lighter system for what I think
6603 architecture. And this is a much lighter system for what I think
6599 is the really important feature: allowing users to define quickly
6604 is the really important feature: allowing users to define quickly
6600 magics that will do shell things for them, so they can customize
6605 magics that will do shell things for them, so they can customize
6601 IPython easily to match their work habits. If someone is really
6606 IPython easily to match their work habits. If someone is really
6602 desperate to have another name for a builtin alias, they can
6607 desperate to have another name for a builtin alias, they can
6603 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6608 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6604 works.
6609 works.
6605
6610
6606 2001-11-28 Fernando Perez <fperez@colorado.edu>
6611 2001-11-28 Fernando Perez <fperez@colorado.edu>
6607
6612
6608 * Changed @file so that it opens the source file at the proper
6613 * Changed @file so that it opens the source file at the proper
6609 line. Since it uses less, if your EDITOR environment is
6614 line. Since it uses less, if your EDITOR environment is
6610 configured, typing v will immediately open your editor of choice
6615 configured, typing v will immediately open your editor of choice
6611 right at the line where the object is defined. Not as quick as
6616 right at the line where the object is defined. Not as quick as
6612 having a direct @edit command, but for all intents and purposes it
6617 having a direct @edit command, but for all intents and purposes it
6613 works. And I don't have to worry about writing @edit to deal with
6618 works. And I don't have to worry about writing @edit to deal with
6614 all the editors, less does that.
6619 all the editors, less does that.
6615
6620
6616 * Version 0.1.16 released, 0.1.17 opened.
6621 * Version 0.1.16 released, 0.1.17 opened.
6617
6622
6618 * Fixed some nasty bugs in the page/page_dumb combo that could
6623 * Fixed some nasty bugs in the page/page_dumb combo that could
6619 crash IPython.
6624 crash IPython.
6620
6625
6621 2001-11-27 Fernando Perez <fperez@colorado.edu>
6626 2001-11-27 Fernando Perez <fperez@colorado.edu>
6622
6627
6623 * Version 0.1.15 released, 0.1.16 opened.
6628 * Version 0.1.15 released, 0.1.16 opened.
6624
6629
6625 * Finally got ? and ?? to work for undefined things: now it's
6630 * Finally got ? and ?? to work for undefined things: now it's
6626 possible to type {}.get? and get information about the get method
6631 possible to type {}.get? and get information about the get method
6627 of dicts, or os.path? even if only os is defined (so technically
6632 of dicts, or os.path? even if only os is defined (so technically
6628 os.path isn't). Works at any level. For example, after import os,
6633 os.path isn't). Works at any level. For example, after import os,
6629 os?, os.path?, os.path.abspath? all work. This is great, took some
6634 os?, os.path?, os.path.abspath? all work. This is great, took some
6630 work in _ofind.
6635 work in _ofind.
6631
6636
6632 * Fixed more bugs with logging. The sanest way to do it was to add
6637 * Fixed more bugs with logging. The sanest way to do it was to add
6633 to @log a 'mode' parameter. Killed two in one shot (this mode
6638 to @log a 'mode' parameter. Killed two in one shot (this mode
6634 option was a request of Janko's). I think it's finally clean
6639 option was a request of Janko's). I think it's finally clean
6635 (famous last words).
6640 (famous last words).
6636
6641
6637 * Added a page_dumb() pager which does a decent job of paging on
6642 * Added a page_dumb() pager which does a decent job of paging on
6638 screen, if better things (like less) aren't available. One less
6643 screen, if better things (like less) aren't available. One less
6639 unix dependency (someday maybe somebody will port this to
6644 unix dependency (someday maybe somebody will port this to
6640 windows).
6645 windows).
6641
6646
6642 * Fixed problem in magic_log: would lock of logging out if log
6647 * Fixed problem in magic_log: would lock of logging out if log
6643 creation failed (because it would still think it had succeeded).
6648 creation failed (because it would still think it had succeeded).
6644
6649
6645 * Improved the page() function using curses to auto-detect screen
6650 * Improved the page() function using curses to auto-detect screen
6646 size. Now it can make a much better decision on whether to print
6651 size. Now it can make a much better decision on whether to print
6647 or page a string. Option screen_length was modified: a value 0
6652 or page a string. Option screen_length was modified: a value 0
6648 means auto-detect, and that's the default now.
6653 means auto-detect, and that's the default now.
6649
6654
6650 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6655 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6651 go out. I'll test it for a few days, then talk to Janko about
6656 go out. I'll test it for a few days, then talk to Janko about
6652 licences and announce it.
6657 licences and announce it.
6653
6658
6654 * Fixed the length of the auto-generated ---> prompt which appears
6659 * Fixed the length of the auto-generated ---> prompt which appears
6655 for auto-parens and auto-quotes. Getting this right isn't trivial,
6660 for auto-parens and auto-quotes. Getting this right isn't trivial,
6656 with all the color escapes, different prompt types and optional
6661 with all the color escapes, different prompt types and optional
6657 separators. But it seems to be working in all the combinations.
6662 separators. But it seems to be working in all the combinations.
6658
6663
6659 2001-11-26 Fernando Perez <fperez@colorado.edu>
6664 2001-11-26 Fernando Perez <fperez@colorado.edu>
6660
6665
6661 * Wrote a regexp filter to get option types from the option names
6666 * Wrote a regexp filter to get option types from the option names
6662 string. This eliminates the need to manually keep two duplicate
6667 string. This eliminates the need to manually keep two duplicate
6663 lists.
6668 lists.
6664
6669
6665 * Removed the unneeded check_option_names. Now options are handled
6670 * Removed the unneeded check_option_names. Now options are handled
6666 in a much saner manner and it's easy to visually check that things
6671 in a much saner manner and it's easy to visually check that things
6667 are ok.
6672 are ok.
6668
6673
6669 * Updated version numbers on all files I modified to carry a
6674 * Updated version numbers on all files I modified to carry a
6670 notice so Janko and Nathan have clear version markers.
6675 notice so Janko and Nathan have clear version markers.
6671
6676
6672 * Updated docstring for ultraTB with my changes. I should send
6677 * Updated docstring for ultraTB with my changes. I should send
6673 this to Nathan.
6678 this to Nathan.
6674
6679
6675 * Lots of small fixes. Ran everything through pychecker again.
6680 * Lots of small fixes. Ran everything through pychecker again.
6676
6681
6677 * Made loading of deep_reload an cmd line option. If it's not too
6682 * Made loading of deep_reload an cmd line option. If it's not too
6678 kosher, now people can just disable it. With -nodeep_reload it's
6683 kosher, now people can just disable it. With -nodeep_reload it's
6679 still available as dreload(), it just won't overwrite reload().
6684 still available as dreload(), it just won't overwrite reload().
6680
6685
6681 * Moved many options to the no| form (-opt and -noopt
6686 * Moved many options to the no| form (-opt and -noopt
6682 accepted). Cleaner.
6687 accepted). Cleaner.
6683
6688
6684 * Changed magic_log so that if called with no parameters, it uses
6689 * Changed magic_log so that if called with no parameters, it uses
6685 'rotate' mode. That way auto-generated logs aren't automatically
6690 'rotate' mode. That way auto-generated logs aren't automatically
6686 over-written. For normal logs, now a backup is made if it exists
6691 over-written. For normal logs, now a backup is made if it exists
6687 (only 1 level of backups). A new 'backup' mode was added to the
6692 (only 1 level of backups). A new 'backup' mode was added to the
6688 Logger class to support this. This was a request by Janko.
6693 Logger class to support this. This was a request by Janko.
6689
6694
6690 * Added @logoff/@logon to stop/restart an active log.
6695 * Added @logoff/@logon to stop/restart an active log.
6691
6696
6692 * Fixed a lot of bugs in log saving/replay. It was pretty
6697 * Fixed a lot of bugs in log saving/replay. It was pretty
6693 broken. Now special lines (!@,/) appear properly in the command
6698 broken. Now special lines (!@,/) appear properly in the command
6694 history after a log replay.
6699 history after a log replay.
6695
6700
6696 * Tried and failed to implement full session saving via pickle. My
6701 * Tried and failed to implement full session saving via pickle. My
6697 idea was to pickle __main__.__dict__, but modules can't be
6702 idea was to pickle __main__.__dict__, but modules can't be
6698 pickled. This would be a better alternative to replaying logs, but
6703 pickled. This would be a better alternative to replaying logs, but
6699 seems quite tricky to get to work. Changed -session to be called
6704 seems quite tricky to get to work. Changed -session to be called
6700 -logplay, which more accurately reflects what it does. And if we
6705 -logplay, which more accurately reflects what it does. And if we
6701 ever get real session saving working, -session is now available.
6706 ever get real session saving working, -session is now available.
6702
6707
6703 * Implemented color schemes for prompts also. As for tracebacks,
6708 * Implemented color schemes for prompts also. As for tracebacks,
6704 currently only NoColor and Linux are supported. But now the
6709 currently only NoColor and Linux are supported. But now the
6705 infrastructure is in place, based on a generic ColorScheme
6710 infrastructure is in place, based on a generic ColorScheme
6706 class. So writing and activating new schemes both for the prompts
6711 class. So writing and activating new schemes both for the prompts
6707 and the tracebacks should be straightforward.
6712 and the tracebacks should be straightforward.
6708
6713
6709 * Version 0.1.13 released, 0.1.14 opened.
6714 * Version 0.1.13 released, 0.1.14 opened.
6710
6715
6711 * Changed handling of options for output cache. Now counter is
6716 * Changed handling of options for output cache. Now counter is
6712 hardwired starting at 1 and one specifies the maximum number of
6717 hardwired starting at 1 and one specifies the maximum number of
6713 entries *in the outcache* (not the max prompt counter). This is
6718 entries *in the outcache* (not the max prompt counter). This is
6714 much better, since many statements won't increase the cache
6719 much better, since many statements won't increase the cache
6715 count. It also eliminated some confusing options, now there's only
6720 count. It also eliminated some confusing options, now there's only
6716 one: cache_size.
6721 one: cache_size.
6717
6722
6718 * Added 'alias' magic function and magic_alias option in the
6723 * Added 'alias' magic function and magic_alias option in the
6719 ipythonrc file. Now the user can easily define whatever names he
6724 ipythonrc file. Now the user can easily define whatever names he
6720 wants for the magic functions without having to play weird
6725 wants for the magic functions without having to play weird
6721 namespace games. This gives IPython a real shell-like feel.
6726 namespace games. This gives IPython a real shell-like feel.
6722
6727
6723 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6728 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6724 @ or not).
6729 @ or not).
6725
6730
6726 This was one of the last remaining 'visible' bugs (that I know
6731 This was one of the last remaining 'visible' bugs (that I know
6727 of). I think if I can clean up the session loading so it works
6732 of). I think if I can clean up the session loading so it works
6728 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6733 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6729 about licensing).
6734 about licensing).
6730
6735
6731 2001-11-25 Fernando Perez <fperez@colorado.edu>
6736 2001-11-25 Fernando Perez <fperez@colorado.edu>
6732
6737
6733 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6738 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6734 there's a cleaner distinction between what ? and ?? show.
6739 there's a cleaner distinction between what ? and ?? show.
6735
6740
6736 * Added screen_length option. Now the user can define his own
6741 * Added screen_length option. Now the user can define his own
6737 screen size for page() operations.
6742 screen size for page() operations.
6738
6743
6739 * Implemented magic shell-like functions with automatic code
6744 * Implemented magic shell-like functions with automatic code
6740 generation. Now adding another function is just a matter of adding
6745 generation. Now adding another function is just a matter of adding
6741 an entry to a dict, and the function is dynamically generated at
6746 an entry to a dict, and the function is dynamically generated at
6742 run-time. Python has some really cool features!
6747 run-time. Python has some really cool features!
6743
6748
6744 * Renamed many options to cleanup conventions a little. Now all
6749 * Renamed many options to cleanup conventions a little. Now all
6745 are lowercase, and only underscores where needed. Also in the code
6750 are lowercase, and only underscores where needed. Also in the code
6746 option name tables are clearer.
6751 option name tables are clearer.
6747
6752
6748 * Changed prompts a little. Now input is 'In [n]:' instead of
6753 * Changed prompts a little. Now input is 'In [n]:' instead of
6749 'In[n]:='. This allows it the numbers to be aligned with the
6754 'In[n]:='. This allows it the numbers to be aligned with the
6750 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6755 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6751 Python (it was a Mathematica thing). The '...' continuation prompt
6756 Python (it was a Mathematica thing). The '...' continuation prompt
6752 was also changed a little to align better.
6757 was also changed a little to align better.
6753
6758
6754 * Fixed bug when flushing output cache. Not all _p<n> variables
6759 * Fixed bug when flushing output cache. Not all _p<n> variables
6755 exist, so their deletion needs to be wrapped in a try:
6760 exist, so their deletion needs to be wrapped in a try:
6756
6761
6757 * Figured out how to properly use inspect.formatargspec() (it
6762 * Figured out how to properly use inspect.formatargspec() (it
6758 requires the args preceded by *). So I removed all the code from
6763 requires the args preceded by *). So I removed all the code from
6759 _get_pdef in Magic, which was just replicating that.
6764 _get_pdef in Magic, which was just replicating that.
6760
6765
6761 * Added test to prefilter to allow redefining magic function names
6766 * Added test to prefilter to allow redefining magic function names
6762 as variables. This is ok, since the @ form is always available,
6767 as variables. This is ok, since the @ form is always available,
6763 but whe should allow the user to define a variable called 'ls' if
6768 but whe should allow the user to define a variable called 'ls' if
6764 he needs it.
6769 he needs it.
6765
6770
6766 * Moved the ToDo information from README into a separate ToDo.
6771 * Moved the ToDo information from README into a separate ToDo.
6767
6772
6768 * General code cleanup and small bugfixes. I think it's close to a
6773 * General code cleanup and small bugfixes. I think it's close to a
6769 state where it can be released, obviously with a big 'beta'
6774 state where it can be released, obviously with a big 'beta'
6770 warning on it.
6775 warning on it.
6771
6776
6772 * Got the magic function split to work. Now all magics are defined
6777 * Got the magic function split to work. Now all magics are defined
6773 in a separate class. It just organizes things a bit, and now
6778 in a separate class. It just organizes things a bit, and now
6774 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6779 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6775 was too long).
6780 was too long).
6776
6781
6777 * Changed @clear to @reset to avoid potential confusions with
6782 * Changed @clear to @reset to avoid potential confusions with
6778 the shell command clear. Also renamed @cl to @clear, which does
6783 the shell command clear. Also renamed @cl to @clear, which does
6779 exactly what people expect it to from their shell experience.
6784 exactly what people expect it to from their shell experience.
6780
6785
6781 Added a check to the @reset command (since it's so
6786 Added a check to the @reset command (since it's so
6782 destructive, it's probably a good idea to ask for confirmation).
6787 destructive, it's probably a good idea to ask for confirmation).
6783 But now reset only works for full namespace resetting. Since the
6788 But now reset only works for full namespace resetting. Since the
6784 del keyword is already there for deleting a few specific
6789 del keyword is already there for deleting a few specific
6785 variables, I don't see the point of having a redundant magic
6790 variables, I don't see the point of having a redundant magic
6786 function for the same task.
6791 function for the same task.
6787
6792
6788 2001-11-24 Fernando Perez <fperez@colorado.edu>
6793 2001-11-24 Fernando Perez <fperez@colorado.edu>
6789
6794
6790 * Updated the builtin docs (esp. the ? ones).
6795 * Updated the builtin docs (esp. the ? ones).
6791
6796
6792 * Ran all the code through pychecker. Not terribly impressed with
6797 * Ran all the code through pychecker. Not terribly impressed with
6793 it: lots of spurious warnings and didn't really find anything of
6798 it: lots of spurious warnings and didn't really find anything of
6794 substance (just a few modules being imported and not used).
6799 substance (just a few modules being imported and not used).
6795
6800
6796 * Implemented the new ultraTB functionality into IPython. New
6801 * Implemented the new ultraTB functionality into IPython. New
6797 option: xcolors. This chooses color scheme. xmode now only selects
6802 option: xcolors. This chooses color scheme. xmode now only selects
6798 between Plain and Verbose. Better orthogonality.
6803 between Plain and Verbose. Better orthogonality.
6799
6804
6800 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6805 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6801 mode and color scheme for the exception handlers. Now it's
6806 mode and color scheme for the exception handlers. Now it's
6802 possible to have the verbose traceback with no coloring.
6807 possible to have the verbose traceback with no coloring.
6803
6808
6804 2001-11-23 Fernando Perez <fperez@colorado.edu>
6809 2001-11-23 Fernando Perez <fperez@colorado.edu>
6805
6810
6806 * Version 0.1.12 released, 0.1.13 opened.
6811 * Version 0.1.12 released, 0.1.13 opened.
6807
6812
6808 * Removed option to set auto-quote and auto-paren escapes by
6813 * Removed option to set auto-quote and auto-paren escapes by
6809 user. The chances of breaking valid syntax are just too high. If
6814 user. The chances of breaking valid syntax are just too high. If
6810 someone *really* wants, they can always dig into the code.
6815 someone *really* wants, they can always dig into the code.
6811
6816
6812 * Made prompt separators configurable.
6817 * Made prompt separators configurable.
6813
6818
6814 2001-11-22 Fernando Perez <fperez@colorado.edu>
6819 2001-11-22 Fernando Perez <fperez@colorado.edu>
6815
6820
6816 * Small bugfixes in many places.
6821 * Small bugfixes in many places.
6817
6822
6818 * Removed the MyCompleter class from ipplib. It seemed redundant
6823 * Removed the MyCompleter class from ipplib. It seemed redundant
6819 with the C-p,C-n history search functionality. Less code to
6824 with the C-p,C-n history search functionality. Less code to
6820 maintain.
6825 maintain.
6821
6826
6822 * Moved all the original ipython.py code into ipythonlib.py. Right
6827 * Moved all the original ipython.py code into ipythonlib.py. Right
6823 now it's just one big dump into a function called make_IPython, so
6828 now it's just one big dump into a function called make_IPython, so
6824 no real modularity has been gained. But at least it makes the
6829 no real modularity has been gained. But at least it makes the
6825 wrapper script tiny, and since ipythonlib is a module, it gets
6830 wrapper script tiny, and since ipythonlib is a module, it gets
6826 compiled and startup is much faster.
6831 compiled and startup is much faster.
6827
6832
6828 This is a reasobably 'deep' change, so we should test it for a
6833 This is a reasobably 'deep' change, so we should test it for a
6829 while without messing too much more with the code.
6834 while without messing too much more with the code.
6830
6835
6831 2001-11-21 Fernando Perez <fperez@colorado.edu>
6836 2001-11-21 Fernando Perez <fperez@colorado.edu>
6832
6837
6833 * Version 0.1.11 released, 0.1.12 opened for further work.
6838 * Version 0.1.11 released, 0.1.12 opened for further work.
6834
6839
6835 * Removed dependency on Itpl. It was only needed in one place. It
6840 * Removed dependency on Itpl. It was only needed in one place. It
6836 would be nice if this became part of python, though. It makes life
6841 would be nice if this became part of python, though. It makes life
6837 *a lot* easier in some cases.
6842 *a lot* easier in some cases.
6838
6843
6839 * Simplified the prefilter code a bit. Now all handlers are
6844 * Simplified the prefilter code a bit. Now all handlers are
6840 expected to explicitly return a value (at least a blank string).
6845 expected to explicitly return a value (at least a blank string).
6841
6846
6842 * Heavy edits in ipplib. Removed the help system altogether. Now
6847 * Heavy edits in ipplib. Removed the help system altogether. Now
6843 obj?/?? is used for inspecting objects, a magic @doc prints
6848 obj?/?? is used for inspecting objects, a magic @doc prints
6844 docstrings, and full-blown Python help is accessed via the 'help'
6849 docstrings, and full-blown Python help is accessed via the 'help'
6845 keyword. This cleans up a lot of code (less to maintain) and does
6850 keyword. This cleans up a lot of code (less to maintain) and does
6846 the job. Since 'help' is now a standard Python component, might as
6851 the job. Since 'help' is now a standard Python component, might as
6847 well use it and remove duplicate functionality.
6852 well use it and remove duplicate functionality.
6848
6853
6849 Also removed the option to use ipplib as a standalone program. By
6854 Also removed the option to use ipplib as a standalone program. By
6850 now it's too dependent on other parts of IPython to function alone.
6855 now it's too dependent on other parts of IPython to function alone.
6851
6856
6852 * Fixed bug in genutils.pager. It would crash if the pager was
6857 * Fixed bug in genutils.pager. It would crash if the pager was
6853 exited immediately after opening (broken pipe).
6858 exited immediately after opening (broken pipe).
6854
6859
6855 * Trimmed down the VerboseTB reporting a little. The header is
6860 * Trimmed down the VerboseTB reporting a little. The header is
6856 much shorter now and the repeated exception arguments at the end
6861 much shorter now and the repeated exception arguments at the end
6857 have been removed. For interactive use the old header seemed a bit
6862 have been removed. For interactive use the old header seemed a bit
6858 excessive.
6863 excessive.
6859
6864
6860 * Fixed small bug in output of @whos for variables with multi-word
6865 * Fixed small bug in output of @whos for variables with multi-word
6861 types (only first word was displayed).
6866 types (only first word was displayed).
6862
6867
6863 2001-11-17 Fernando Perez <fperez@colorado.edu>
6868 2001-11-17 Fernando Perez <fperez@colorado.edu>
6864
6869
6865 * Version 0.1.10 released, 0.1.11 opened for further work.
6870 * Version 0.1.10 released, 0.1.11 opened for further work.
6866
6871
6867 * Modified dirs and friends. dirs now *returns* the stack (not
6872 * Modified dirs and friends. dirs now *returns* the stack (not
6868 prints), so one can manipulate it as a variable. Convenient to
6873 prints), so one can manipulate it as a variable. Convenient to
6869 travel along many directories.
6874 travel along many directories.
6870
6875
6871 * Fixed bug in magic_pdef: would only work with functions with
6876 * Fixed bug in magic_pdef: would only work with functions with
6872 arguments with default values.
6877 arguments with default values.
6873
6878
6874 2001-11-14 Fernando Perez <fperez@colorado.edu>
6879 2001-11-14 Fernando Perez <fperez@colorado.edu>
6875
6880
6876 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6881 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6877 example with IPython. Various other minor fixes and cleanups.
6882 example with IPython. Various other minor fixes and cleanups.
6878
6883
6879 * Version 0.1.9 released, 0.1.10 opened for further work.
6884 * Version 0.1.9 released, 0.1.10 opened for further work.
6880
6885
6881 * Added sys.path to the list of directories searched in the
6886 * Added sys.path to the list of directories searched in the
6882 execfile= option. It used to be the current directory and the
6887 execfile= option. It used to be the current directory and the
6883 user's IPYTHONDIR only.
6888 user's IPYTHONDIR only.
6884
6889
6885 2001-11-13 Fernando Perez <fperez@colorado.edu>
6890 2001-11-13 Fernando Perez <fperez@colorado.edu>
6886
6891
6887 * Reinstated the raw_input/prefilter separation that Janko had
6892 * Reinstated the raw_input/prefilter separation that Janko had
6888 initially. This gives a more convenient setup for extending the
6893 initially. This gives a more convenient setup for extending the
6889 pre-processor from the outside: raw_input always gets a string,
6894 pre-processor from the outside: raw_input always gets a string,
6890 and prefilter has to process it. We can then redefine prefilter
6895 and prefilter has to process it. We can then redefine prefilter
6891 from the outside and implement extensions for special
6896 from the outside and implement extensions for special
6892 purposes.
6897 purposes.
6893
6898
6894 Today I got one for inputting PhysicalQuantity objects
6899 Today I got one for inputting PhysicalQuantity objects
6895 (from Scientific) without needing any function calls at
6900 (from Scientific) without needing any function calls at
6896 all. Extremely convenient, and it's all done as a user-level
6901 all. Extremely convenient, and it's all done as a user-level
6897 extension (no IPython code was touched). Now instead of:
6902 extension (no IPython code was touched). Now instead of:
6898 a = PhysicalQuantity(4.2,'m/s**2')
6903 a = PhysicalQuantity(4.2,'m/s**2')
6899 one can simply say
6904 one can simply say
6900 a = 4.2 m/s**2
6905 a = 4.2 m/s**2
6901 or even
6906 or even
6902 a = 4.2 m/s^2
6907 a = 4.2 m/s^2
6903
6908
6904 I use this, but it's also a proof of concept: IPython really is
6909 I use this, but it's also a proof of concept: IPython really is
6905 fully user-extensible, even at the level of the parsing of the
6910 fully user-extensible, even at the level of the parsing of the
6906 command line. It's not trivial, but it's perfectly doable.
6911 command line. It's not trivial, but it's perfectly doable.
6907
6912
6908 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6913 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6909 the problem of modules being loaded in the inverse order in which
6914 the problem of modules being loaded in the inverse order in which
6910 they were defined in
6915 they were defined in
6911
6916
6912 * Version 0.1.8 released, 0.1.9 opened for further work.
6917 * Version 0.1.8 released, 0.1.9 opened for further work.
6913
6918
6914 * Added magics pdef, source and file. They respectively show the
6919 * Added magics pdef, source and file. They respectively show the
6915 definition line ('prototype' in C), source code and full python
6920 definition line ('prototype' in C), source code and full python
6916 file for any callable object. The object inspector oinfo uses
6921 file for any callable object. The object inspector oinfo uses
6917 these to show the same information.
6922 these to show the same information.
6918
6923
6919 * Version 0.1.7 released, 0.1.8 opened for further work.
6924 * Version 0.1.7 released, 0.1.8 opened for further work.
6920
6925
6921 * Separated all the magic functions into a class called Magic. The
6926 * Separated all the magic functions into a class called Magic. The
6922 InteractiveShell class was becoming too big for Xemacs to handle
6927 InteractiveShell class was becoming too big for Xemacs to handle
6923 (de-indenting a line would lock it up for 10 seconds while it
6928 (de-indenting a line would lock it up for 10 seconds while it
6924 backtracked on the whole class!)
6929 backtracked on the whole class!)
6925
6930
6926 FIXME: didn't work. It can be done, but right now namespaces are
6931 FIXME: didn't work. It can be done, but right now namespaces are
6927 all messed up. Do it later (reverted it for now, so at least
6932 all messed up. Do it later (reverted it for now, so at least
6928 everything works as before).
6933 everything works as before).
6929
6934
6930 * Got the object introspection system (magic_oinfo) working! I
6935 * Got the object introspection system (magic_oinfo) working! I
6931 think this is pretty much ready for release to Janko, so he can
6936 think this is pretty much ready for release to Janko, so he can
6932 test it for a while and then announce it. Pretty much 100% of what
6937 test it for a while and then announce it. Pretty much 100% of what
6933 I wanted for the 'phase 1' release is ready. Happy, tired.
6938 I wanted for the 'phase 1' release is ready. Happy, tired.
6934
6939
6935 2001-11-12 Fernando Perez <fperez@colorado.edu>
6940 2001-11-12 Fernando Perez <fperez@colorado.edu>
6936
6941
6937 * Version 0.1.6 released, 0.1.7 opened for further work.
6942 * Version 0.1.6 released, 0.1.7 opened for further work.
6938
6943
6939 * Fixed bug in printing: it used to test for truth before
6944 * Fixed bug in printing: it used to test for truth before
6940 printing, so 0 wouldn't print. Now checks for None.
6945 printing, so 0 wouldn't print. Now checks for None.
6941
6946
6942 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6947 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6943 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6948 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6944 reaches by hand into the outputcache. Think of a better way to do
6949 reaches by hand into the outputcache. Think of a better way to do
6945 this later.
6950 this later.
6946
6951
6947 * Various small fixes thanks to Nathan's comments.
6952 * Various small fixes thanks to Nathan's comments.
6948
6953
6949 * Changed magic_pprint to magic_Pprint. This way it doesn't
6954 * Changed magic_pprint to magic_Pprint. This way it doesn't
6950 collide with pprint() and the name is consistent with the command
6955 collide with pprint() and the name is consistent with the command
6951 line option.
6956 line option.
6952
6957
6953 * Changed prompt counter behavior to be fully like
6958 * Changed prompt counter behavior to be fully like
6954 Mathematica's. That is, even input that doesn't return a result
6959 Mathematica's. That is, even input that doesn't return a result
6955 raises the prompt counter. The old behavior was kind of confusing
6960 raises the prompt counter. The old behavior was kind of confusing
6956 (getting the same prompt number several times if the operation
6961 (getting the same prompt number several times if the operation
6957 didn't return a result).
6962 didn't return a result).
6958
6963
6959 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6964 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6960
6965
6961 * Fixed -Classic mode (wasn't working anymore).
6966 * Fixed -Classic mode (wasn't working anymore).
6962
6967
6963 * Added colored prompts using Nathan's new code. Colors are
6968 * Added colored prompts using Nathan's new code. Colors are
6964 currently hardwired, they can be user-configurable. For
6969 currently hardwired, they can be user-configurable. For
6965 developers, they can be chosen in file ipythonlib.py, at the
6970 developers, they can be chosen in file ipythonlib.py, at the
6966 beginning of the CachedOutput class def.
6971 beginning of the CachedOutput class def.
6967
6972
6968 2001-11-11 Fernando Perez <fperez@colorado.edu>
6973 2001-11-11 Fernando Perez <fperez@colorado.edu>
6969
6974
6970 * Version 0.1.5 released, 0.1.6 opened for further work.
6975 * Version 0.1.5 released, 0.1.6 opened for further work.
6971
6976
6972 * Changed magic_env to *return* the environment as a dict (not to
6977 * Changed magic_env to *return* the environment as a dict (not to
6973 print it). This way it prints, but it can also be processed.
6978 print it). This way it prints, but it can also be processed.
6974
6979
6975 * Added Verbose exception reporting to interactive
6980 * Added Verbose exception reporting to interactive
6976 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6981 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6977 traceback. Had to make some changes to the ultraTB file. This is
6982 traceback. Had to make some changes to the ultraTB file. This is
6978 probably the last 'big' thing in my mental todo list. This ties
6983 probably the last 'big' thing in my mental todo list. This ties
6979 in with the next entry:
6984 in with the next entry:
6980
6985
6981 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6986 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6982 has to specify is Plain, Color or Verbose for all exception
6987 has to specify is Plain, Color or Verbose for all exception
6983 handling.
6988 handling.
6984
6989
6985 * Removed ShellServices option. All this can really be done via
6990 * Removed ShellServices option. All this can really be done via
6986 the magic system. It's easier to extend, cleaner and has automatic
6991 the magic system. It's easier to extend, cleaner and has automatic
6987 namespace protection and documentation.
6992 namespace protection and documentation.
6988
6993
6989 2001-11-09 Fernando Perez <fperez@colorado.edu>
6994 2001-11-09 Fernando Perez <fperez@colorado.edu>
6990
6995
6991 * Fixed bug in output cache flushing (missing parameter to
6996 * Fixed bug in output cache flushing (missing parameter to
6992 __init__). Other small bugs fixed (found using pychecker).
6997 __init__). Other small bugs fixed (found using pychecker).
6993
6998
6994 * Version 0.1.4 opened for bugfixing.
6999 * Version 0.1.4 opened for bugfixing.
6995
7000
6996 2001-11-07 Fernando Perez <fperez@colorado.edu>
7001 2001-11-07 Fernando Perez <fperez@colorado.edu>
6997
7002
6998 * Version 0.1.3 released, mainly because of the raw_input bug.
7003 * Version 0.1.3 released, mainly because of the raw_input bug.
6999
7004
7000 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7005 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7001 and when testing for whether things were callable, a call could
7006 and when testing for whether things were callable, a call could
7002 actually be made to certain functions. They would get called again
7007 actually be made to certain functions. They would get called again
7003 once 'really' executed, with a resulting double call. A disaster
7008 once 'really' executed, with a resulting double call. A disaster
7004 in many cases (list.reverse() would never work!).
7009 in many cases (list.reverse() would never work!).
7005
7010
7006 * Removed prefilter() function, moved its code to raw_input (which
7011 * Removed prefilter() function, moved its code to raw_input (which
7007 after all was just a near-empty caller for prefilter). This saves
7012 after all was just a near-empty caller for prefilter). This saves
7008 a function call on every prompt, and simplifies the class a tiny bit.
7013 a function call on every prompt, and simplifies the class a tiny bit.
7009
7014
7010 * Fix _ip to __ip name in magic example file.
7015 * Fix _ip to __ip name in magic example file.
7011
7016
7012 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7017 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7013 work with non-gnu versions of tar.
7018 work with non-gnu versions of tar.
7014
7019
7015 2001-11-06 Fernando Perez <fperez@colorado.edu>
7020 2001-11-06 Fernando Perez <fperez@colorado.edu>
7016
7021
7017 * Version 0.1.2. Just to keep track of the recent changes.
7022 * Version 0.1.2. Just to keep track of the recent changes.
7018
7023
7019 * Fixed nasty bug in output prompt routine. It used to check 'if
7024 * Fixed nasty bug in output prompt routine. It used to check 'if
7020 arg != None...'. Problem is, this fails if arg implements a
7025 arg != None...'. Problem is, this fails if arg implements a
7021 special comparison (__cmp__) which disallows comparing to
7026 special comparison (__cmp__) which disallows comparing to
7022 None. Found it when trying to use the PhysicalQuantity module from
7027 None. Found it when trying to use the PhysicalQuantity module from
7023 ScientificPython.
7028 ScientificPython.
7024
7029
7025 2001-11-05 Fernando Perez <fperez@colorado.edu>
7030 2001-11-05 Fernando Perez <fperez@colorado.edu>
7026
7031
7027 * Also added dirs. Now the pushd/popd/dirs family functions
7032 * Also added dirs. Now the pushd/popd/dirs family functions
7028 basically like the shell, with the added convenience of going home
7033 basically like the shell, with the added convenience of going home
7029 when called with no args.
7034 when called with no args.
7030
7035
7031 * pushd/popd slightly modified to mimic shell behavior more
7036 * pushd/popd slightly modified to mimic shell behavior more
7032 closely.
7037 closely.
7033
7038
7034 * Added env,pushd,popd from ShellServices as magic functions. I
7039 * Added env,pushd,popd from ShellServices as magic functions. I
7035 think the cleanest will be to port all desired functions from
7040 think the cleanest will be to port all desired functions from
7036 ShellServices as magics and remove ShellServices altogether. This
7041 ShellServices as magics and remove ShellServices altogether. This
7037 will provide a single, clean way of adding functionality
7042 will provide a single, clean way of adding functionality
7038 (shell-type or otherwise) to IP.
7043 (shell-type or otherwise) to IP.
7039
7044
7040 2001-11-04 Fernando Perez <fperez@colorado.edu>
7045 2001-11-04 Fernando Perez <fperez@colorado.edu>
7041
7046
7042 * Added .ipython/ directory to sys.path. This way users can keep
7047 * Added .ipython/ directory to sys.path. This way users can keep
7043 customizations there and access them via import.
7048 customizations there and access them via import.
7044
7049
7045 2001-11-03 Fernando Perez <fperez@colorado.edu>
7050 2001-11-03 Fernando Perez <fperez@colorado.edu>
7046
7051
7047 * Opened version 0.1.1 for new changes.
7052 * Opened version 0.1.1 for new changes.
7048
7053
7049 * Changed version number to 0.1.0: first 'public' release, sent to
7054 * Changed version number to 0.1.0: first 'public' release, sent to
7050 Nathan and Janko.
7055 Nathan and Janko.
7051
7056
7052 * Lots of small fixes and tweaks.
7057 * Lots of small fixes and tweaks.
7053
7058
7054 * Minor changes to whos format. Now strings are shown, snipped if
7059 * Minor changes to whos format. Now strings are shown, snipped if
7055 too long.
7060 too long.
7056
7061
7057 * Changed ShellServices to work on __main__ so they show up in @who
7062 * Changed ShellServices to work on __main__ so they show up in @who
7058
7063
7059 * Help also works with ? at the end of a line:
7064 * Help also works with ? at the end of a line:
7060 ?sin and sin?
7065 ?sin and sin?
7061 both produce the same effect. This is nice, as often I use the
7066 both produce the same effect. This is nice, as often I use the
7062 tab-complete to find the name of a method, but I used to then have
7067 tab-complete to find the name of a method, but I used to then have
7063 to go to the beginning of the line to put a ? if I wanted more
7068 to go to the beginning of the line to put a ? if I wanted more
7064 info. Now I can just add the ? and hit return. Convenient.
7069 info. Now I can just add the ? and hit return. Convenient.
7065
7070
7066 2001-11-02 Fernando Perez <fperez@colorado.edu>
7071 2001-11-02 Fernando Perez <fperez@colorado.edu>
7067
7072
7068 * Python version check (>=2.1) added.
7073 * Python version check (>=2.1) added.
7069
7074
7070 * Added LazyPython documentation. At this point the docs are quite
7075 * Added LazyPython documentation. At this point the docs are quite
7071 a mess. A cleanup is in order.
7076 a mess. A cleanup is in order.
7072
7077
7073 * Auto-installer created. For some bizarre reason, the zipfiles
7078 * Auto-installer created. For some bizarre reason, the zipfiles
7074 module isn't working on my system. So I made a tar version
7079 module isn't working on my system. So I made a tar version
7075 (hopefully the command line options in various systems won't kill
7080 (hopefully the command line options in various systems won't kill
7076 me).
7081 me).
7077
7082
7078 * Fixes to Struct in genutils. Now all dictionary-like methods are
7083 * Fixes to Struct in genutils. Now all dictionary-like methods are
7079 protected (reasonably).
7084 protected (reasonably).
7080
7085
7081 * Added pager function to genutils and changed ? to print usage
7086 * Added pager function to genutils and changed ? to print usage
7082 note through it (it was too long).
7087 note through it (it was too long).
7083
7088
7084 * Added the LazyPython functionality. Works great! I changed the
7089 * Added the LazyPython functionality. Works great! I changed the
7085 auto-quote escape to ';', it's on home row and next to '. But
7090 auto-quote escape to ';', it's on home row and next to '. But
7086 both auto-quote and auto-paren (still /) escapes are command-line
7091 both auto-quote and auto-paren (still /) escapes are command-line
7087 parameters.
7092 parameters.
7088
7093
7089
7094
7090 2001-11-01 Fernando Perez <fperez@colorado.edu>
7095 2001-11-01 Fernando Perez <fperez@colorado.edu>
7091
7096
7092 * Version changed to 0.0.7. Fairly large change: configuration now
7097 * Version changed to 0.0.7. Fairly large change: configuration now
7093 is all stored in a directory, by default .ipython. There, all
7098 is all stored in a directory, by default .ipython. There, all
7094 config files have normal looking names (not .names)
7099 config files have normal looking names (not .names)
7095
7100
7096 * Version 0.0.6 Released first to Lucas and Archie as a test
7101 * Version 0.0.6 Released first to Lucas and Archie as a test
7097 run. Since it's the first 'semi-public' release, change version to
7102 run. Since it's the first 'semi-public' release, change version to
7098 > 0.0.6 for any changes now.
7103 > 0.0.6 for any changes now.
7099
7104
7100 * Stuff I had put in the ipplib.py changelog:
7105 * Stuff I had put in the ipplib.py changelog:
7101
7106
7102 Changes to InteractiveShell:
7107 Changes to InteractiveShell:
7103
7108
7104 - Made the usage message a parameter.
7109 - Made the usage message a parameter.
7105
7110
7106 - Require the name of the shell variable to be given. It's a bit
7111 - Require the name of the shell variable to be given. It's a bit
7107 of a hack, but allows the name 'shell' not to be hardwired in the
7112 of a hack, but allows the name 'shell' not to be hardwired in the
7108 magic (@) handler, which is problematic b/c it requires
7113 magic (@) handler, which is problematic b/c it requires
7109 polluting the global namespace with 'shell'. This in turn is
7114 polluting the global namespace with 'shell'. This in turn is
7110 fragile: if a user redefines a variable called shell, things
7115 fragile: if a user redefines a variable called shell, things
7111 break.
7116 break.
7112
7117
7113 - magic @: all functions available through @ need to be defined
7118 - magic @: all functions available through @ need to be defined
7114 as magic_<name>, even though they can be called simply as
7119 as magic_<name>, even though they can be called simply as
7115 @<name>. This allows the special command @magic to gather
7120 @<name>. This allows the special command @magic to gather
7116 information automatically about all existing magic functions,
7121 information automatically about all existing magic functions,
7117 even if they are run-time user extensions, by parsing the shell
7122 even if they are run-time user extensions, by parsing the shell
7118 instance __dict__ looking for special magic_ names.
7123 instance __dict__ looking for special magic_ names.
7119
7124
7120 - mainloop: added *two* local namespace parameters. This allows
7125 - mainloop: added *two* local namespace parameters. This allows
7121 the class to differentiate between parameters which were there
7126 the class to differentiate between parameters which were there
7122 before and after command line initialization was processed. This
7127 before and after command line initialization was processed. This
7123 way, later @who can show things loaded at startup by the
7128 way, later @who can show things loaded at startup by the
7124 user. This trick was necessary to make session saving/reloading
7129 user. This trick was necessary to make session saving/reloading
7125 really work: ideally after saving/exiting/reloading a session,
7130 really work: ideally after saving/exiting/reloading a session,
7126 *everything* should look the same, including the output of @who. I
7131 *everything* should look the same, including the output of @who. I
7127 was only able to make this work with this double namespace
7132 was only able to make this work with this double namespace
7128 trick.
7133 trick.
7129
7134
7130 - added a header to the logfile which allows (almost) full
7135 - added a header to the logfile which allows (almost) full
7131 session restoring.
7136 session restoring.
7132
7137
7133 - prepend lines beginning with @ or !, with a and log
7138 - prepend lines beginning with @ or !, with a and log
7134 them. Why? !lines: may be useful to know what you did @lines:
7139 them. Why? !lines: may be useful to know what you did @lines:
7135 they may affect session state. So when restoring a session, at
7140 they may affect session state. So when restoring a session, at
7136 least inform the user of their presence. I couldn't quite get
7141 least inform the user of their presence. I couldn't quite get
7137 them to properly re-execute, but at least the user is warned.
7142 them to properly re-execute, but at least the user is warned.
7138
7143
7139 * Started ChangeLog.
7144 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now