##// END OF EJS Templates
add autoexec option
vivainio -
Show More
@@ -1,82 +1,86 b''
1 """ User configuration file for IPython
1 """ User configuration file for IPython
2
2
3 This is a more flexible and safe way to configure ipython than *rc files
3 This is a more flexible and safe way to configure ipython than *rc files
4 (ipythonrc, ipythonrc-pysh etc.)
4 (ipythonrc, ipythonrc-pysh etc.)
5
5
6 This file is always imported on ipython startup. You can import the
6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
7 ipython extensions you need here (see IPython/Extensions directory).
8
8
9 Feel free to edit this file to customize your ipython experience.
9 Feel free to edit this file to customize your ipython experience.
10
10
11 Note that as such this file does nothing, for backwards compatibility.
11 Note that as such this file does nothing, for backwards compatibility.
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
13 you can do here.
13 you can do here.
14
14
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
16 description on what you could do here.
16 description on what you could do here.
17 """
17 """
18
18
19 # Most of your config files and extensions will probably start with this import
19 # Most of your config files and extensions will probably start with this import
20
20
21 import IPython.ipapi
21 import IPython.ipapi
22 ip = IPython.ipapi.get()
22 ip = IPython.ipapi.get()
23
23
24 # You probably want to uncomment this if you did %upgrade -nolegacy
24 # You probably want to uncomment this if you did %upgrade -nolegacy
25 # import ipy_defaults
25 # import ipy_defaults
26
26
27 import os
27 import os
28
28
29 def main():
29 def main():
30 # Handy tab-completers for %cd, %run, import etc.
30
31 # Try commenting this out if you have completion problems/slowness
32 # import ipy_stock_completers
33
34 # uncomment if you want to get ipython -p sh behaviour
31 # uncomment if you want to get ipython -p sh behaviour
35 # without having to use command line switches
32 # without having to use command line switches
36
37 # import ipy_profile_sh
33 # import ipy_profile_sh
38
34
39
40 # Configure your favourite editor?
35 # Configure your favourite editor?
41 # Good idea e.g. for %edit os.path.isfile
36 # Good idea e.g. for %edit os.path.isfile
42
37
43 #import ipy_editors
38 #import ipy_editors
44
39
45 # Choose one of these:
40 # Choose one of these:
46
41
47 #ipy_editors.scite()
42 #ipy_editors.scite()
48 #ipy_editors.scite('c:/opt/scite/scite.exe')
43 #ipy_editors.scite('c:/opt/scite/scite.exe')
49 #ipy_editors.komodo()
44 #ipy_editors.komodo()
50 #ipy_editors.idle()
45 #ipy_editors.idle()
51 # ... or many others, try 'ipy_editors??' after import to see them
46 # ... or many others, try 'ipy_editors??' after import to see them
52
47
53 # Or roll your own:
48 # Or roll your own:
54 #ipy_editors.install_editor("c:/opt/jed +$line $file")
49 #ipy_editors.install_editor("c:/opt/jed +$line $file")
55
50
56
51
57 o = ip.options
52 o = ip.options
58 # An example on how to set options
53 # An example on how to set options
59 #o.autocall = 1
54 #o.autocall = 1
60 o.system_verbose = 0
55 o.system_verbose = 0
61
56
62 #import_all("os sys")
57 #import_all("os sys")
63 #execf('~/_ipython/ns.py')
58 #execf('~/_ipython/ns.py')
64
59
60
61 # -- prompt
65 # A different, more compact set of prompts from the default ones, that
62 # A different, more compact set of prompts from the default ones, that
66 # always show your current location in the filesystem:
63 # always show your current location in the filesystem:
67
64
68 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
65 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
69 #o.prompt_in2 = r'.\D: '
66 #o.prompt_in2 = r'.\D: '
70 #o.prompt_out = r'[\#] '
67 #o.prompt_out = r'[\#] '
71
68
69 # Try one of these color settings if you can't read the text easily
70 # autoexec is a list of IPython commands to execute on startup
71 #o.autoexec.append('%colors LightBG')
72 #o.autoexec.append('%colors NoColor')
73 #o.autoexec.append('%colors Linux')
74
75
72 # some config helper functions you can use
76 # some config helper functions you can use
73 def import_all(modules):
77 def import_all(modules):
74 """ Usage: import_all("os sys") """
78 """ Usage: import_all("os sys") """
75 for m in modules.split():
79 for m in modules.split():
76 ip.ex("from %s import *" % m)
80 ip.ex("from %s import *" % m)
77
81
78 def execf(fname):
82 def execf(fname):
79 """ Execute a file in user namespace """
83 """ Execute a file in user namespace """
80 ip.ex('execfile("%s")' % os.path.expanduser(fname))
84 ip.ex('execfile("%s")' % os.path.expanduser(fname))
81
85
82 main()
86 main()
@@ -1,2603 +1,2611 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 2919 2007-12-31 14:45:55Z vivainio $
9 $Id: iplib.py 2930 2008-01-11 07:03:11Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import exceptions
44 import exceptions
45 import glob
45 import glob
46 import inspect
46 import inspect
47 import keyword
47 import keyword
48 import new
48 import new
49 import os
49 import os
50 import pydoc
50 import pydoc
51 import re
51 import re
52 import shutil
52 import shutil
53 import string
53 import string
54 import sys
54 import sys
55 import tempfile
55 import tempfile
56 import traceback
56 import traceback
57 import types
57 import types
58 from sets import Set
58 from sets import Set
59 from pprint import pprint, pformat
59 from pprint import pprint, pformat
60
60
61 # IPython's own modules
61 # IPython's own modules
62 #import IPython
62 #import IPython
63 from IPython import Debugger,OInspect,PyColorize,ultraTB
63 from IPython import Debugger,OInspect,PyColorize,ultraTB
64 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
64 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
65 from IPython.Extensions import pickleshare
65 from IPython.Extensions import pickleshare
66 from IPython.FakeModule import FakeModule
66 from IPython.FakeModule import FakeModule
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Logger import Logger
68 from IPython.Logger import Logger
69 from IPython.Magic import Magic
69 from IPython.Magic import Magic
70 from IPython.Prompts import CachedOutput
70 from IPython.Prompts import CachedOutput
71 from IPython.ipstruct import Struct
71 from IPython.ipstruct import Struct
72 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
73 from IPython.usage import cmd_line_usage,interactive_usage
73 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.genutils import *
74 from IPython.genutils import *
75 from IPython.strdispatch import StrDispatch
75 from IPython.strdispatch import StrDispatch
76 import IPython.ipapi
76 import IPython.ipapi
77 import IPython.history
77 import IPython.history
78 import IPython.prefilter as prefilter
78 import IPython.prefilter as prefilter
79 import IPython.shadowns
79 import IPython.shadowns
80 # Globals
80 # Globals
81
81
82 # store the builtin raw_input globally, and use this always, in case user code
82 # store the builtin raw_input globally, and use this always, in case user code
83 # overwrites it (like wx.py.PyShell does)
83 # overwrites it (like wx.py.PyShell does)
84 raw_input_original = raw_input
84 raw_input_original = raw_input
85
85
86 # compiled regexps for autoindent management
86 # compiled regexps for autoindent management
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
87 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88
88
89
89
90 #****************************************************************************
90 #****************************************************************************
91 # Some utility function definitions
91 # Some utility function definitions
92
92
93 ini_spaces_re = re.compile(r'^(\s+)')
93 ini_spaces_re = re.compile(r'^(\s+)')
94
94
95 def num_ini_spaces(strng):
95 def num_ini_spaces(strng):
96 """Return the number of initial spaces in a string"""
96 """Return the number of initial spaces in a string"""
97
97
98 ini_spaces = ini_spaces_re.match(strng)
98 ini_spaces = ini_spaces_re.match(strng)
99 if ini_spaces:
99 if ini_spaces:
100 return ini_spaces.end()
100 return ini_spaces.end()
101 else:
101 else:
102 return 0
102 return 0
103
103
104 def softspace(file, newvalue):
104 def softspace(file, newvalue):
105 """Copied from code.py, to remove the dependency"""
105 """Copied from code.py, to remove the dependency"""
106
106
107 oldvalue = 0
107 oldvalue = 0
108 try:
108 try:
109 oldvalue = file.softspace
109 oldvalue = file.softspace
110 except AttributeError:
110 except AttributeError:
111 pass
111 pass
112 try:
112 try:
113 file.softspace = newvalue
113 file.softspace = newvalue
114 except (AttributeError, TypeError):
114 except (AttributeError, TypeError):
115 # "attribute-less object" or "read-only attributes"
115 # "attribute-less object" or "read-only attributes"
116 pass
116 pass
117 return oldvalue
117 return oldvalue
118
118
119
119
120 #****************************************************************************
120 #****************************************************************************
121 # Local use exceptions
121 # Local use exceptions
122 class SpaceInInput(exceptions.Exception): pass
122 class SpaceInInput(exceptions.Exception): pass
123
123
124
124
125 #****************************************************************************
125 #****************************************************************************
126 # Local use classes
126 # Local use classes
127 class Bunch: pass
127 class Bunch: pass
128
128
129 class Undefined: pass
129 class Undefined: pass
130
130
131 class Quitter(object):
131 class Quitter(object):
132 """Simple class to handle exit, similar to Python 2.5's.
132 """Simple class to handle exit, similar to Python 2.5's.
133
133
134 It handles exiting in an ipython-safe manner, which the one in Python 2.5
134 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 doesn't do (obviously, since it doesn't know about ipython)."""
135 doesn't do (obviously, since it doesn't know about ipython)."""
136
136
137 def __init__(self,shell,name):
137 def __init__(self,shell,name):
138 self.shell = shell
138 self.shell = shell
139 self.name = name
139 self.name = name
140
140
141 def __repr__(self):
141 def __repr__(self):
142 return 'Type %s() to exit.' % self.name
142 return 'Type %s() to exit.' % self.name
143 __str__ = __repr__
143 __str__ = __repr__
144
144
145 def __call__(self):
145 def __call__(self):
146 self.shell.exit()
146 self.shell.exit()
147
147
148 class InputList(list):
148 class InputList(list):
149 """Class to store user input.
149 """Class to store user input.
150
150
151 It's basically a list, but slices return a string instead of a list, thus
151 It's basically a list, but slices return a string instead of a list, thus
152 allowing things like (assuming 'In' is an instance):
152 allowing things like (assuming 'In' is an instance):
153
153
154 exec In[4:7]
154 exec In[4:7]
155
155
156 or
156 or
157
157
158 exec In[5:9] + In[14] + In[21:25]"""
158 exec In[5:9] + In[14] + In[21:25]"""
159
159
160 def __getslice__(self,i,j):
160 def __getslice__(self,i,j):
161 return ''.join(list.__getslice__(self,i,j))
161 return ''.join(list.__getslice__(self,i,j))
162
162
163 class SyntaxTB(ultraTB.ListTB):
163 class SyntaxTB(ultraTB.ListTB):
164 """Extension which holds some state: the last exception value"""
164 """Extension which holds some state: the last exception value"""
165
165
166 def __init__(self,color_scheme = 'NoColor'):
166 def __init__(self,color_scheme = 'NoColor'):
167 ultraTB.ListTB.__init__(self,color_scheme)
167 ultraTB.ListTB.__init__(self,color_scheme)
168 self.last_syntax_error = None
168 self.last_syntax_error = None
169
169
170 def __call__(self, etype, value, elist):
170 def __call__(self, etype, value, elist):
171 self.last_syntax_error = value
171 self.last_syntax_error = value
172 ultraTB.ListTB.__call__(self,etype,value,elist)
172 ultraTB.ListTB.__call__(self,etype,value,elist)
173
173
174 def clear_err_state(self):
174 def clear_err_state(self):
175 """Return the current error state and clear it"""
175 """Return the current error state and clear it"""
176 e = self.last_syntax_error
176 e = self.last_syntax_error
177 self.last_syntax_error = None
177 self.last_syntax_error = None
178 return e
178 return e
179
179
180 #****************************************************************************
180 #****************************************************************************
181 # Main IPython class
181 # Main IPython class
182
182
183 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
183 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # until a full rewrite is made. I've cleaned all cross-class uses of
184 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # attributes and methods, but too much user code out there relies on the
185 # attributes and methods, but too much user code out there relies on the
186 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
186 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 #
187 #
188 # But at least now, all the pieces have been separated and we could, in
188 # But at least now, all the pieces have been separated and we could, in
189 # principle, stop using the mixin. This will ease the transition to the
189 # principle, stop using the mixin. This will ease the transition to the
190 # chainsaw branch.
190 # chainsaw branch.
191
191
192 # For reference, the following is the list of 'self.foo' uses in the Magic
192 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
193 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class, to prevent clashes.
194 # class, to prevent clashes.
195
195
196 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
196 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
197 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
198 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.value']
199 # 'self.value']
200
200
201 class InteractiveShell(object,Magic):
201 class InteractiveShell(object,Magic):
202 """An enhanced console for Python."""
202 """An enhanced console for Python."""
203
203
204 # class attribute to indicate whether the class supports threads or not.
204 # class attribute to indicate whether the class supports threads or not.
205 # Subclasses with thread support should override this as needed.
205 # Subclasses with thread support should override this as needed.
206 isthreaded = False
206 isthreaded = False
207
207
208 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
208 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 user_ns = None,user_global_ns=None,banner2='',
209 user_ns = None,user_global_ns=None,banner2='',
210 custom_exceptions=((),None),embedded=False):
210 custom_exceptions=((),None),embedded=False):
211
211
212 # log system
212 # log system
213 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
213 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214
214
215 # some minimal strict typechecks. For some core data structures, I
215 # some minimal strict typechecks. For some core data structures, I
216 # want actual basic python types, not just anything that looks like
216 # want actual basic python types, not just anything that looks like
217 # one. This is especially true for namespaces.
217 # one. This is especially true for namespaces.
218 for ns in (user_ns,user_global_ns):
218 for ns in (user_ns,user_global_ns):
219 if ns is not None and type(ns) != types.DictType:
219 if ns is not None and type(ns) != types.DictType:
220 raise TypeError,'namespace must be a dictionary'
220 raise TypeError,'namespace must be a dictionary'
221 # Job manager (for jobs run as background threads)
221 # Job manager (for jobs run as background threads)
222 self.jobs = BackgroundJobManager()
222 self.jobs = BackgroundJobManager()
223
223
224 # Store the actual shell's name
224 # Store the actual shell's name
225 self.name = name
225 self.name = name
226
226
227 # We need to know whether the instance is meant for embedding, since
227 # We need to know whether the instance is meant for embedding, since
228 # global/local namespaces need to be handled differently in that case
228 # global/local namespaces need to be handled differently in that case
229 self.embedded = embedded
229 self.embedded = embedded
230 if embedded:
230 if embedded:
231 # Control variable so users can, from within the embedded instance,
231 # Control variable so users can, from within the embedded instance,
232 # permanently deactivate it.
232 # permanently deactivate it.
233 self.embedded_active = True
233 self.embedded_active = True
234
234
235 # command compiler
235 # command compiler
236 self.compile = codeop.CommandCompiler()
236 self.compile = codeop.CommandCompiler()
237
237
238 # User input buffer
238 # User input buffer
239 self.buffer = []
239 self.buffer = []
240
240
241 # Default name given in compilation of code
241 # Default name given in compilation of code
242 self.filename = '<ipython console>'
242 self.filename = '<ipython console>'
243
243
244 # Install our own quitter instead of the builtins. For python2.3-2.4,
244 # Install our own quitter instead of the builtins. For python2.3-2.4,
245 # this brings in behavior like 2.5, and for 2.5 it's identical.
245 # this brings in behavior like 2.5, and for 2.5 it's identical.
246 __builtin__.exit = Quitter(self,'exit')
246 __builtin__.exit = Quitter(self,'exit')
247 __builtin__.quit = Quitter(self,'quit')
247 __builtin__.quit = Quitter(self,'quit')
248
248
249 # Make an empty namespace, which extension writers can rely on both
249 # Make an empty namespace, which extension writers can rely on both
250 # existing and NEVER being used by ipython itself. This gives them a
250 # existing and NEVER being used by ipython itself. This gives them a
251 # convenient location for storing additional information and state
251 # convenient location for storing additional information and state
252 # their extensions may require, without fear of collisions with other
252 # their extensions may require, without fear of collisions with other
253 # ipython names that may develop later.
253 # ipython names that may develop later.
254 self.meta = Struct()
254 self.meta = Struct()
255
255
256 # Create the namespace where the user will operate. user_ns is
256 # Create the namespace where the user will operate. user_ns is
257 # normally the only one used, and it is passed to the exec calls as
257 # normally the only one used, and it is passed to the exec calls as
258 # the locals argument. But we do carry a user_global_ns namespace
258 # the locals argument. But we do carry a user_global_ns namespace
259 # given as the exec 'globals' argument, This is useful in embedding
259 # given as the exec 'globals' argument, This is useful in embedding
260 # situations where the ipython shell opens in a context where the
260 # situations where the ipython shell opens in a context where the
261 # distinction between locals and globals is meaningful.
261 # distinction between locals and globals is meaningful.
262
262
263 # FIXME. For some strange reason, __builtins__ is showing up at user
263 # FIXME. For some strange reason, __builtins__ is showing up at user
264 # level as a dict instead of a module. This is a manual fix, but I
264 # level as a dict instead of a module. This is a manual fix, but I
265 # should really track down where the problem is coming from. Alex
265 # should really track down where the problem is coming from. Alex
266 # Schmolck reported this problem first.
266 # Schmolck reported this problem first.
267
267
268 # A useful post by Alex Martelli on this topic:
268 # A useful post by Alex Martelli on this topic:
269 # Re: inconsistent value from __builtins__
269 # Re: inconsistent value from __builtins__
270 # Von: Alex Martelli <aleaxit@yahoo.com>
270 # Von: Alex Martelli <aleaxit@yahoo.com>
271 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
271 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
272 # Gruppen: comp.lang.python
272 # Gruppen: comp.lang.python
273
273
274 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
274 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
275 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
275 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
276 # > <type 'dict'>
276 # > <type 'dict'>
277 # > >>> print type(__builtins__)
277 # > >>> print type(__builtins__)
278 # > <type 'module'>
278 # > <type 'module'>
279 # > Is this difference in return value intentional?
279 # > Is this difference in return value intentional?
280
280
281 # Well, it's documented that '__builtins__' can be either a dictionary
281 # Well, it's documented that '__builtins__' can be either a dictionary
282 # or a module, and it's been that way for a long time. Whether it's
282 # or a module, and it's been that way for a long time. Whether it's
283 # intentional (or sensible), I don't know. In any case, the idea is
283 # intentional (or sensible), I don't know. In any case, the idea is
284 # that if you need to access the built-in namespace directly, you
284 # that if you need to access the built-in namespace directly, you
285 # should start with "import __builtin__" (note, no 's') which will
285 # should start with "import __builtin__" (note, no 's') which will
286 # definitely give you a module. Yeah, it's somewhat confusing:-(.
286 # definitely give you a module. Yeah, it's somewhat confusing:-(.
287
287
288 # These routines return properly built dicts as needed by the rest of
288 # These routines return properly built dicts as needed by the rest of
289 # the code, and can also be used by extension writers to generate
289 # the code, and can also be used by extension writers to generate
290 # properly initialized namespaces.
290 # properly initialized namespaces.
291 user_ns = IPython.ipapi.make_user_ns(user_ns)
291 user_ns = IPython.ipapi.make_user_ns(user_ns)
292 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
292 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
293
293
294 # Assign namespaces
294 # Assign namespaces
295 # This is the namespace where all normal user variables live
295 # This is the namespace where all normal user variables live
296 self.user_ns = user_ns
296 self.user_ns = user_ns
297 # Embedded instances require a separate namespace for globals.
297 # Embedded instances require a separate namespace for globals.
298 # Normally this one is unused by non-embedded instances.
298 # Normally this one is unused by non-embedded instances.
299 self.user_global_ns = user_global_ns
299 self.user_global_ns = user_global_ns
300 # A namespace to keep track of internal data structures to prevent
300 # A namespace to keep track of internal data structures to prevent
301 # them from cluttering user-visible stuff. Will be updated later
301 # them from cluttering user-visible stuff. Will be updated later
302 self.internal_ns = {}
302 self.internal_ns = {}
303
303
304 # Namespace of system aliases. Each entry in the alias
304 # Namespace of system aliases. Each entry in the alias
305 # table must be a 2-tuple of the form (N,name), where N is the number
305 # table must be a 2-tuple of the form (N,name), where N is the number
306 # of positional arguments of the alias.
306 # of positional arguments of the alias.
307 self.alias_table = {}
307 self.alias_table = {}
308
308
309 # A table holding all the namespaces IPython deals with, so that
309 # A table holding all the namespaces IPython deals with, so that
310 # introspection facilities can search easily.
310 # introspection facilities can search easily.
311 self.ns_table = {'user':user_ns,
311 self.ns_table = {'user':user_ns,
312 'user_global':user_global_ns,
312 'user_global':user_global_ns,
313 'alias':self.alias_table,
313 'alias':self.alias_table,
314 'internal':self.internal_ns,
314 'internal':self.internal_ns,
315 'builtin':__builtin__.__dict__
315 'builtin':__builtin__.__dict__
316 }
316 }
317 # The user namespace MUST have a pointer to the shell itself.
317 # The user namespace MUST have a pointer to the shell itself.
318 self.user_ns[name] = self
318 self.user_ns[name] = self
319
319
320 # We need to insert into sys.modules something that looks like a
320 # We need to insert into sys.modules something that looks like a
321 # module but which accesses the IPython namespace, for shelve and
321 # module but which accesses the IPython namespace, for shelve and
322 # pickle to work interactively. Normally they rely on getting
322 # pickle to work interactively. Normally they rely on getting
323 # everything out of __main__, but for embedding purposes each IPython
323 # everything out of __main__, but for embedding purposes each IPython
324 # instance has its own private namespace, so we can't go shoving
324 # instance has its own private namespace, so we can't go shoving
325 # everything into __main__.
325 # everything into __main__.
326
326
327 # note, however, that we should only do this for non-embedded
327 # note, however, that we should only do this for non-embedded
328 # ipythons, which really mimic the __main__.__dict__ with their own
328 # ipythons, which really mimic the __main__.__dict__ with their own
329 # namespace. Embedded instances, on the other hand, should not do
329 # namespace. Embedded instances, on the other hand, should not do
330 # this because they need to manage the user local/global namespaces
330 # this because they need to manage the user local/global namespaces
331 # only, but they live within a 'normal' __main__ (meaning, they
331 # only, but they live within a 'normal' __main__ (meaning, they
332 # shouldn't overtake the execution environment of the script they're
332 # shouldn't overtake the execution environment of the script they're
333 # embedded in).
333 # embedded in).
334
334
335 if not embedded:
335 if not embedded:
336 try:
336 try:
337 main_name = self.user_ns['__name__']
337 main_name = self.user_ns['__name__']
338 except KeyError:
338 except KeyError:
339 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
339 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
340 else:
340 else:
341 #print "pickle hack in place" # dbg
341 #print "pickle hack in place" # dbg
342 #print 'main_name:',main_name # dbg
342 #print 'main_name:',main_name # dbg
343 sys.modules[main_name] = FakeModule(self.user_ns)
343 sys.modules[main_name] = FakeModule(self.user_ns)
344
344
345 # Now that FakeModule produces a real module, we've run into a nasty
345 # Now that FakeModule produces a real module, we've run into a nasty
346 # problem: after script execution (via %run), the module where the user
346 # problem: after script execution (via %run), the module where the user
347 # code ran is deleted. Now that this object is a true module (needed
347 # code ran is deleted. Now that this object is a true module (needed
348 # so docetst and other tools work correctly), the Python module
348 # so docetst and other tools work correctly), the Python module
349 # teardown mechanism runs over it, and sets to None every variable
349 # teardown mechanism runs over it, and sets to None every variable
350 # present in that module. This means that later calls to functions
350 # present in that module. This means that later calls to functions
351 # defined in the script (which have become interactively visible after
351 # defined in the script (which have become interactively visible after
352 # script exit) fail, because they hold references to objects that have
352 # script exit) fail, because they hold references to objects that have
353 # become overwritten into None. The only solution I see right now is
353 # become overwritten into None. The only solution I see right now is
354 # to protect every FakeModule used by %run by holding an internal
354 # to protect every FakeModule used by %run by holding an internal
355 # reference to it. This private list will be used for that. The
355 # reference to it. This private list will be used for that. The
356 # %reset command will flush it as well.
356 # %reset command will flush it as well.
357 self._user_main_modules = []
357 self._user_main_modules = []
358
358
359 # List of input with multi-line handling.
359 # List of input with multi-line handling.
360 # Fill its zero entry, user counter starts at 1
360 # Fill its zero entry, user counter starts at 1
361 self.input_hist = InputList(['\n'])
361 self.input_hist = InputList(['\n'])
362 # This one will hold the 'raw' input history, without any
362 # This one will hold the 'raw' input history, without any
363 # pre-processing. This will allow users to retrieve the input just as
363 # pre-processing. This will allow users to retrieve the input just as
364 # it was exactly typed in by the user, with %hist -r.
364 # it was exactly typed in by the user, with %hist -r.
365 self.input_hist_raw = InputList(['\n'])
365 self.input_hist_raw = InputList(['\n'])
366
366
367 # list of visited directories
367 # list of visited directories
368 try:
368 try:
369 self.dir_hist = [os.getcwd()]
369 self.dir_hist = [os.getcwd()]
370 except OSError:
370 except OSError:
371 self.dir_hist = []
371 self.dir_hist = []
372
372
373 # dict of output history
373 # dict of output history
374 self.output_hist = {}
374 self.output_hist = {}
375
375
376 # Get system encoding at startup time. Certain terminals (like Emacs
376 # Get system encoding at startup time. Certain terminals (like Emacs
377 # under Win32 have it set to None, and we need to have a known valid
377 # under Win32 have it set to None, and we need to have a known valid
378 # encoding to use in the raw_input() method
378 # encoding to use in the raw_input() method
379 self.stdin_encoding = sys.stdin.encoding or 'ascii'
379 self.stdin_encoding = sys.stdin.encoding or 'ascii'
380
380
381 # dict of things NOT to alias (keywords, builtins and some magics)
381 # dict of things NOT to alias (keywords, builtins and some magics)
382 no_alias = {}
382 no_alias = {}
383 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
383 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
384 for key in keyword.kwlist + no_alias_magics:
384 for key in keyword.kwlist + no_alias_magics:
385 no_alias[key] = 1
385 no_alias[key] = 1
386 no_alias.update(__builtin__.__dict__)
386 no_alias.update(__builtin__.__dict__)
387 self.no_alias = no_alias
387 self.no_alias = no_alias
388
388
389 # make global variables for user access to these
389 # make global variables for user access to these
390 self.user_ns['_ih'] = self.input_hist
390 self.user_ns['_ih'] = self.input_hist
391 self.user_ns['_oh'] = self.output_hist
391 self.user_ns['_oh'] = self.output_hist
392 self.user_ns['_dh'] = self.dir_hist
392 self.user_ns['_dh'] = self.dir_hist
393
393
394 # user aliases to input and output histories
394 # user aliases to input and output histories
395 self.user_ns['In'] = self.input_hist
395 self.user_ns['In'] = self.input_hist
396 self.user_ns['Out'] = self.output_hist
396 self.user_ns['Out'] = self.output_hist
397
397
398 self.user_ns['_sh'] = IPython.shadowns
398 self.user_ns['_sh'] = IPython.shadowns
399 # Object variable to store code object waiting execution. This is
399 # Object variable to store code object waiting execution. This is
400 # used mainly by the multithreaded shells, but it can come in handy in
400 # used mainly by the multithreaded shells, but it can come in handy in
401 # other situations. No need to use a Queue here, since it's a single
401 # other situations. No need to use a Queue here, since it's a single
402 # item which gets cleared once run.
402 # item which gets cleared once run.
403 self.code_to_run = None
403 self.code_to_run = None
404
404
405 # escapes for automatic behavior on the command line
405 # escapes for automatic behavior on the command line
406 self.ESC_SHELL = '!'
406 self.ESC_SHELL = '!'
407 self.ESC_SH_CAP = '!!'
407 self.ESC_SH_CAP = '!!'
408 self.ESC_HELP = '?'
408 self.ESC_HELP = '?'
409 self.ESC_MAGIC = '%'
409 self.ESC_MAGIC = '%'
410 self.ESC_QUOTE = ','
410 self.ESC_QUOTE = ','
411 self.ESC_QUOTE2 = ';'
411 self.ESC_QUOTE2 = ';'
412 self.ESC_PAREN = '/'
412 self.ESC_PAREN = '/'
413
413
414 # And their associated handlers
414 # And their associated handlers
415 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
415 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
416 self.ESC_QUOTE : self.handle_auto,
416 self.ESC_QUOTE : self.handle_auto,
417 self.ESC_QUOTE2 : self.handle_auto,
417 self.ESC_QUOTE2 : self.handle_auto,
418 self.ESC_MAGIC : self.handle_magic,
418 self.ESC_MAGIC : self.handle_magic,
419 self.ESC_HELP : self.handle_help,
419 self.ESC_HELP : self.handle_help,
420 self.ESC_SHELL : self.handle_shell_escape,
420 self.ESC_SHELL : self.handle_shell_escape,
421 self.ESC_SH_CAP : self.handle_shell_escape,
421 self.ESC_SH_CAP : self.handle_shell_escape,
422 }
422 }
423
423
424 # class initializations
424 # class initializations
425 Magic.__init__(self,self)
425 Magic.__init__(self,self)
426
426
427 # Python source parser/formatter for syntax highlighting
427 # Python source parser/formatter for syntax highlighting
428 pyformat = PyColorize.Parser().format
428 pyformat = PyColorize.Parser().format
429 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
429 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
430
430
431 # hooks holds pointers used for user-side customizations
431 # hooks holds pointers used for user-side customizations
432 self.hooks = Struct()
432 self.hooks = Struct()
433
433
434 self.strdispatchers = {}
434 self.strdispatchers = {}
435
435
436 # Set all default hooks, defined in the IPython.hooks module.
436 # Set all default hooks, defined in the IPython.hooks module.
437 hooks = IPython.hooks
437 hooks = IPython.hooks
438 for hook_name in hooks.__all__:
438 for hook_name in hooks.__all__:
439 # default hooks have priority 100, i.e. low; user hooks should have
439 # default hooks have priority 100, i.e. low; user hooks should have
440 # 0-100 priority
440 # 0-100 priority
441 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
441 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
442 #print "bound hook",hook_name
442 #print "bound hook",hook_name
443
443
444 # Flag to mark unconditional exit
444 # Flag to mark unconditional exit
445 self.exit_now = False
445 self.exit_now = False
446
446
447 self.usage_min = """\
447 self.usage_min = """\
448 An enhanced console for Python.
448 An enhanced console for Python.
449 Some of its features are:
449 Some of its features are:
450 - Readline support if the readline library is present.
450 - Readline support if the readline library is present.
451 - Tab completion in the local namespace.
451 - Tab completion in the local namespace.
452 - Logging of input, see command-line options.
452 - Logging of input, see command-line options.
453 - System shell escape via ! , eg !ls.
453 - System shell escape via ! , eg !ls.
454 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
454 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
455 - Keeps track of locally defined variables via %who, %whos.
455 - Keeps track of locally defined variables via %who, %whos.
456 - Show object information with a ? eg ?x or x? (use ?? for more info).
456 - Show object information with a ? eg ?x or x? (use ?? for more info).
457 """
457 """
458 if usage: self.usage = usage
458 if usage: self.usage = usage
459 else: self.usage = self.usage_min
459 else: self.usage = self.usage_min
460
460
461 # Storage
461 # Storage
462 self.rc = rc # This will hold all configuration information
462 self.rc = rc # This will hold all configuration information
463 self.pager = 'less'
463 self.pager = 'less'
464 # temporary files used for various purposes. Deleted at exit.
464 # temporary files used for various purposes. Deleted at exit.
465 self.tempfiles = []
465 self.tempfiles = []
466
466
467 # Keep track of readline usage (later set by init_readline)
467 # Keep track of readline usage (later set by init_readline)
468 self.has_readline = False
468 self.has_readline = False
469
469
470 # template for logfile headers. It gets resolved at runtime by the
470 # template for logfile headers. It gets resolved at runtime by the
471 # logstart method.
471 # logstart method.
472 self.loghead_tpl = \
472 self.loghead_tpl = \
473 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
473 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
474 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
474 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
475 #log# opts = %s
475 #log# opts = %s
476 #log# args = %s
476 #log# args = %s
477 #log# It is safe to make manual edits below here.
477 #log# It is safe to make manual edits below here.
478 #log#-----------------------------------------------------------------------
478 #log#-----------------------------------------------------------------------
479 """
479 """
480 # for pushd/popd management
480 # for pushd/popd management
481 try:
481 try:
482 self.home_dir = get_home_dir()
482 self.home_dir = get_home_dir()
483 except HomeDirError,msg:
483 except HomeDirError,msg:
484 fatal(msg)
484 fatal(msg)
485
485
486 self.dir_stack = []
486 self.dir_stack = []
487
487
488 # Functions to call the underlying shell.
488 # Functions to call the underlying shell.
489
489
490 # The first is similar to os.system, but it doesn't return a value,
490 # The first is similar to os.system, but it doesn't return a value,
491 # and it allows interpolation of variables in the user's namespace.
491 # and it allows interpolation of variables in the user's namespace.
492 self.system = lambda cmd: \
492 self.system = lambda cmd: \
493 shell(self.var_expand(cmd,depth=2),
493 shell(self.var_expand(cmd,depth=2),
494 header=self.rc.system_header,
494 header=self.rc.system_header,
495 verbose=self.rc.system_verbose)
495 verbose=self.rc.system_verbose)
496
496
497 # These are for getoutput and getoutputerror:
497 # These are for getoutput and getoutputerror:
498 self.getoutput = lambda cmd: \
498 self.getoutput = lambda cmd: \
499 getoutput(self.var_expand(cmd,depth=2),
499 getoutput(self.var_expand(cmd,depth=2),
500 header=self.rc.system_header,
500 header=self.rc.system_header,
501 verbose=self.rc.system_verbose)
501 verbose=self.rc.system_verbose)
502
502
503 self.getoutputerror = lambda cmd: \
503 self.getoutputerror = lambda cmd: \
504 getoutputerror(self.var_expand(cmd,depth=2),
504 getoutputerror(self.var_expand(cmd,depth=2),
505 header=self.rc.system_header,
505 header=self.rc.system_header,
506 verbose=self.rc.system_verbose)
506 verbose=self.rc.system_verbose)
507
507
508
508
509 # keep track of where we started running (mainly for crash post-mortem)
509 # keep track of where we started running (mainly for crash post-mortem)
510 self.starting_dir = os.getcwd()
510 self.starting_dir = os.getcwd()
511
511
512 # Various switches which can be set
512 # Various switches which can be set
513 self.CACHELENGTH = 5000 # this is cheap, it's just text
513 self.CACHELENGTH = 5000 # this is cheap, it's just text
514 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
514 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
515 self.banner2 = banner2
515 self.banner2 = banner2
516
516
517 # TraceBack handlers:
517 # TraceBack handlers:
518
518
519 # Syntax error handler.
519 # Syntax error handler.
520 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
520 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
521
521
522 # The interactive one is initialized with an offset, meaning we always
522 # The interactive one is initialized with an offset, meaning we always
523 # want to remove the topmost item in the traceback, which is our own
523 # want to remove the topmost item in the traceback, which is our own
524 # internal code. Valid modes: ['Plain','Context','Verbose']
524 # internal code. Valid modes: ['Plain','Context','Verbose']
525 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
525 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
526 color_scheme='NoColor',
526 color_scheme='NoColor',
527 tb_offset = 1)
527 tb_offset = 1)
528
528
529 # IPython itself shouldn't crash. This will produce a detailed
529 # IPython itself shouldn't crash. This will produce a detailed
530 # post-mortem if it does. But we only install the crash handler for
530 # post-mortem if it does. But we only install the crash handler for
531 # non-threaded shells, the threaded ones use a normal verbose reporter
531 # non-threaded shells, the threaded ones use a normal verbose reporter
532 # and lose the crash handler. This is because exceptions in the main
532 # and lose the crash handler. This is because exceptions in the main
533 # thread (such as in GUI code) propagate directly to sys.excepthook,
533 # thread (such as in GUI code) propagate directly to sys.excepthook,
534 # and there's no point in printing crash dumps for every user exception.
534 # and there's no point in printing crash dumps for every user exception.
535 if self.isthreaded:
535 if self.isthreaded:
536 ipCrashHandler = ultraTB.FormattedTB()
536 ipCrashHandler = ultraTB.FormattedTB()
537 else:
537 else:
538 from IPython import CrashHandler
538 from IPython import CrashHandler
539 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
539 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
540 self.set_crash_handler(ipCrashHandler)
540 self.set_crash_handler(ipCrashHandler)
541
541
542 # and add any custom exception handlers the user may have specified
542 # and add any custom exception handlers the user may have specified
543 self.set_custom_exc(*custom_exceptions)
543 self.set_custom_exc(*custom_exceptions)
544
544
545 # indentation management
545 # indentation management
546 self.autoindent = False
546 self.autoindent = False
547 self.indent_current_nsp = 0
547 self.indent_current_nsp = 0
548
548
549 # Make some aliases automatically
549 # Make some aliases automatically
550 # Prepare list of shell aliases to auto-define
550 # Prepare list of shell aliases to auto-define
551 if os.name == 'posix':
551 if os.name == 'posix':
552 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
552 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
553 'mv mv -i','rm rm -i','cp cp -i',
553 'mv mv -i','rm rm -i','cp cp -i',
554 'cat cat','less less','clear clear',
554 'cat cat','less less','clear clear',
555 # a better ls
555 # a better ls
556 'ls ls -F',
556 'ls ls -F',
557 # long ls
557 # long ls
558 'll ls -lF')
558 'll ls -lF')
559 # Extra ls aliases with color, which need special treatment on BSD
559 # Extra ls aliases with color, which need special treatment on BSD
560 # variants
560 # variants
561 ls_extra = ( # color ls
561 ls_extra = ( # color ls
562 'lc ls -F -o --color',
562 'lc ls -F -o --color',
563 # ls normal files only
563 # ls normal files only
564 'lf ls -F -o --color %l | grep ^-',
564 'lf ls -F -o --color %l | grep ^-',
565 # ls symbolic links
565 # ls symbolic links
566 'lk ls -F -o --color %l | grep ^l',
566 'lk ls -F -o --color %l | grep ^l',
567 # directories or links to directories,
567 # directories or links to directories,
568 'ldir ls -F -o --color %l | grep /$',
568 'ldir ls -F -o --color %l | grep /$',
569 # things which are executable
569 # things which are executable
570 'lx ls -F -o --color %l | grep ^-..x',
570 'lx ls -F -o --color %l | grep ^-..x',
571 )
571 )
572 # The BSDs don't ship GNU ls, so they don't understand the
572 # The BSDs don't ship GNU ls, so they don't understand the
573 # --color switch out of the box
573 # --color switch out of the box
574 if 'bsd' in sys.platform:
574 if 'bsd' in sys.platform:
575 ls_extra = ( # ls normal files only
575 ls_extra = ( # ls normal files only
576 'lf ls -lF | grep ^-',
576 'lf ls -lF | grep ^-',
577 # ls symbolic links
577 # ls symbolic links
578 'lk ls -lF | grep ^l',
578 'lk ls -lF | grep ^l',
579 # directories or links to directories,
579 # directories or links to directories,
580 'ldir ls -lF | grep /$',
580 'ldir ls -lF | grep /$',
581 # things which are executable
581 # things which are executable
582 'lx ls -lF | grep ^-..x',
582 'lx ls -lF | grep ^-..x',
583 )
583 )
584 auto_alias = auto_alias + ls_extra
584 auto_alias = auto_alias + ls_extra
585 elif os.name in ['nt','dos']:
585 elif os.name in ['nt','dos']:
586 auto_alias = ('ls dir /on',
586 auto_alias = ('ls dir /on',
587 'ddir dir /ad /on', 'ldir dir /ad /on',
587 'ddir dir /ad /on', 'ldir dir /ad /on',
588 'mkdir mkdir','rmdir rmdir','echo echo',
588 'mkdir mkdir','rmdir rmdir','echo echo',
589 'ren ren','cls cls','copy copy')
589 'ren ren','cls cls','copy copy')
590 else:
590 else:
591 auto_alias = ()
591 auto_alias = ()
592 self.auto_alias = [s.split(None,1) for s in auto_alias]
592 self.auto_alias = [s.split(None,1) for s in auto_alias]
593
593
594
594 # Produce a public API instance
595 # Produce a public API instance
595 self.api = IPython.ipapi.IPApi(self)
596 self.api = IPython.ipapi.IPApi(self)
596
597
597 # Call the actual (public) initializer
598 # Call the actual (public) initializer
598 self.init_auto_alias()
599 self.init_auto_alias()
599
600
600 # track which builtins we add, so we can clean up later
601 # track which builtins we add, so we can clean up later
601 self.builtins_added = {}
602 self.builtins_added = {}
602 # This method will add the necessary builtins for operation, but
603 # This method will add the necessary builtins for operation, but
603 # tracking what it did via the builtins_added dict.
604 # tracking what it did via the builtins_added dict.
605
606 #TODO: remove this, redundant
604 self.add_builtins()
607 self.add_builtins()
605
608
606
609
610
607
611
608 # end __init__
612 # end __init__
609
613
610 def var_expand(self,cmd,depth=0):
614 def var_expand(self,cmd,depth=0):
611 """Expand python variables in a string.
615 """Expand python variables in a string.
612
616
613 The depth argument indicates how many frames above the caller should
617 The depth argument indicates how many frames above the caller should
614 be walked to look for the local namespace where to expand variables.
618 be walked to look for the local namespace where to expand variables.
615
619
616 The global namespace for expansion is always the user's interactive
620 The global namespace for expansion is always the user's interactive
617 namespace.
621 namespace.
618 """
622 """
619
623
620 return str(ItplNS(cmd,
624 return str(ItplNS(cmd,
621 self.user_ns, # globals
625 self.user_ns, # globals
622 # Skip our own frame in searching for locals:
626 # Skip our own frame in searching for locals:
623 sys._getframe(depth+1).f_locals # locals
627 sys._getframe(depth+1).f_locals # locals
624 ))
628 ))
625
629
626 def pre_config_initialization(self):
630 def pre_config_initialization(self):
627 """Pre-configuration init method
631 """Pre-configuration init method
628
632
629 This is called before the configuration files are processed to
633 This is called before the configuration files are processed to
630 prepare the services the config files might need.
634 prepare the services the config files might need.
631
635
632 self.rc already has reasonable default values at this point.
636 self.rc already has reasonable default values at this point.
633 """
637 """
634 rc = self.rc
638 rc = self.rc
635 try:
639 try:
636 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
640 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
637 except exceptions.UnicodeDecodeError:
641 except exceptions.UnicodeDecodeError:
638 print "Your ipythondir can't be decoded to unicode!"
642 print "Your ipythondir can't be decoded to unicode!"
639 print "Please set HOME environment variable to something that"
643 print "Please set HOME environment variable to something that"
640 print r"only has ASCII characters, e.g. c:\home"
644 print r"only has ASCII characters, e.g. c:\home"
641 print "Now it is",rc.ipythondir
645 print "Now it is",rc.ipythondir
642 sys.exit()
646 sys.exit()
643 self.shadowhist = IPython.history.ShadowHist(self.db)
647 self.shadowhist = IPython.history.ShadowHist(self.db)
644
648
645
649
646 def post_config_initialization(self):
650 def post_config_initialization(self):
647 """Post configuration init method
651 """Post configuration init method
648
652
649 This is called after the configuration files have been processed to
653 This is called after the configuration files have been processed to
650 'finalize' the initialization."""
654 'finalize' the initialization."""
651
655
652 rc = self.rc
656 rc = self.rc
653
657
654 # Object inspector
658 # Object inspector
655 self.inspector = OInspect.Inspector(OInspect.InspectColors,
659 self.inspector = OInspect.Inspector(OInspect.InspectColors,
656 PyColorize.ANSICodeColors,
660 PyColorize.ANSICodeColors,
657 'NoColor',
661 'NoColor',
658 rc.object_info_string_level)
662 rc.object_info_string_level)
659
663
660 self.rl_next_input = None
664 self.rl_next_input = None
661 self.rl_do_indent = False
665 self.rl_do_indent = False
662 # Load readline proper
666 # Load readline proper
663 if rc.readline:
667 if rc.readline:
664 self.init_readline()
668 self.init_readline()
665
669
666
670
667 # local shortcut, this is used a LOT
671 # local shortcut, this is used a LOT
668 self.log = self.logger.log
672 self.log = self.logger.log
669
673
670 # Initialize cache, set in/out prompts and printing system
674 # Initialize cache, set in/out prompts and printing system
671 self.outputcache = CachedOutput(self,
675 self.outputcache = CachedOutput(self,
672 rc.cache_size,
676 rc.cache_size,
673 rc.pprint,
677 rc.pprint,
674 input_sep = rc.separate_in,
678 input_sep = rc.separate_in,
675 output_sep = rc.separate_out,
679 output_sep = rc.separate_out,
676 output_sep2 = rc.separate_out2,
680 output_sep2 = rc.separate_out2,
677 ps1 = rc.prompt_in1,
681 ps1 = rc.prompt_in1,
678 ps2 = rc.prompt_in2,
682 ps2 = rc.prompt_in2,
679 ps_out = rc.prompt_out,
683 ps_out = rc.prompt_out,
680 pad_left = rc.prompts_pad_left)
684 pad_left = rc.prompts_pad_left)
681
685
682 # user may have over-ridden the default print hook:
686 # user may have over-ridden the default print hook:
683 try:
687 try:
684 self.outputcache.__class__.display = self.hooks.display
688 self.outputcache.__class__.display = self.hooks.display
685 except AttributeError:
689 except AttributeError:
686 pass
690 pass
687
691
688 # I don't like assigning globally to sys, because it means when
692 # I don't like assigning globally to sys, because it means when
689 # embedding instances, each embedded instance overrides the previous
693 # embedding instances, each embedded instance overrides the previous
690 # choice. But sys.displayhook seems to be called internally by exec,
694 # choice. But sys.displayhook seems to be called internally by exec,
691 # so I don't see a way around it. We first save the original and then
695 # so I don't see a way around it. We first save the original and then
692 # overwrite it.
696 # overwrite it.
693 self.sys_displayhook = sys.displayhook
697 self.sys_displayhook = sys.displayhook
694 sys.displayhook = self.outputcache
698 sys.displayhook = self.outputcache
695
699
696 # Do a proper resetting of doctest, including the necessary displayhook
700 # Do a proper resetting of doctest, including the necessary displayhook
697 # monkeypatching
701 # monkeypatching
698 doctest_reload()
702 doctest_reload()
699
703
700 # Set user colors (don't do it in the constructor above so that it
704 # Set user colors (don't do it in the constructor above so that it
701 # doesn't crash if colors option is invalid)
705 # doesn't crash if colors option is invalid)
702 self.magic_colors(rc.colors)
706 self.magic_colors(rc.colors)
703
707
704 # Set calling of pdb on exceptions
708 # Set calling of pdb on exceptions
705 self.call_pdb = rc.pdb
709 self.call_pdb = rc.pdb
706
710
707 # Load user aliases
711 # Load user aliases
708 for alias in rc.alias:
712 for alias in rc.alias:
709 self.magic_alias(alias)
713 self.magic_alias(alias)
710
714
711 self.hooks.late_startup_hook()
715 self.hooks.late_startup_hook()
712
716
717 for cmd in self.rc.autoexec:
718 #print "autoexec>",cmd #dbg
719 self.api.runlines(cmd)
720
713 batchrun = False
721 batchrun = False
714 for batchfile in [path(arg) for arg in self.rc.args
722 for batchfile in [path(arg) for arg in self.rc.args
715 if arg.lower().endswith('.ipy')]:
723 if arg.lower().endswith('.ipy')]:
716 if not batchfile.isfile():
724 if not batchfile.isfile():
717 print "No such batch file:", batchfile
725 print "No such batch file:", batchfile
718 continue
726 continue
719 self.api.runlines(batchfile.text())
727 self.api.runlines(batchfile.text())
720 batchrun = True
728 batchrun = True
721 # without -i option, exit after running the batch file
729 # without -i option, exit after running the batch file
722 if batchrun and not self.rc.interact:
730 if batchrun and not self.rc.interact:
723 self.exit_now = True
731 self.exit_now = True
724
732
725 def add_builtins(self):
733 def add_builtins(self):
726 """Store ipython references into the builtin namespace.
734 """Store ipython references into the builtin namespace.
727
735
728 Some parts of ipython operate via builtins injected here, which hold a
736 Some parts of ipython operate via builtins injected here, which hold a
729 reference to IPython itself."""
737 reference to IPython itself."""
730
738
731 # TODO: deprecate all of these, they are unsafe
739 # TODO: deprecate all of these, they are unsafe
732 builtins_new = dict(__IPYTHON__ = self,
740 builtins_new = dict(__IPYTHON__ = self,
733 ip_set_hook = self.set_hook,
741 ip_set_hook = self.set_hook,
734 jobs = self.jobs,
742 jobs = self.jobs,
735 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
743 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
736 ipalias = wrap_deprecated(self.ipalias),
744 ipalias = wrap_deprecated(self.ipalias),
737 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
745 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
738 #_ip = self.api
746 #_ip = self.api
739 )
747 )
740 for biname,bival in builtins_new.items():
748 for biname,bival in builtins_new.items():
741 try:
749 try:
742 # store the orignal value so we can restore it
750 # store the orignal value so we can restore it
743 self.builtins_added[biname] = __builtin__.__dict__[biname]
751 self.builtins_added[biname] = __builtin__.__dict__[biname]
744 except KeyError:
752 except KeyError:
745 # or mark that it wasn't defined, and we'll just delete it at
753 # or mark that it wasn't defined, and we'll just delete it at
746 # cleanup
754 # cleanup
747 self.builtins_added[biname] = Undefined
755 self.builtins_added[biname] = Undefined
748 __builtin__.__dict__[biname] = bival
756 __builtin__.__dict__[biname] = bival
749
757
750 # Keep in the builtins a flag for when IPython is active. We set it
758 # 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
759 # with setdefault so that multiple nested IPythons don't clobber one
752 # another. Each will increase its value by one upon being activated,
760 # another. Each will increase its value by one upon being activated,
753 # which also gives us a way to determine the nesting level.
761 # which also gives us a way to determine the nesting level.
754 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
762 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
755
763
756 def clean_builtins(self):
764 def clean_builtins(self):
757 """Remove any builtins which might have been added by add_builtins, or
765 """Remove any builtins which might have been added by add_builtins, or
758 restore overwritten ones to their previous values."""
766 restore overwritten ones to their previous values."""
759 for biname,bival in self.builtins_added.items():
767 for biname,bival in self.builtins_added.items():
760 if bival is Undefined:
768 if bival is Undefined:
761 del __builtin__.__dict__[biname]
769 del __builtin__.__dict__[biname]
762 else:
770 else:
763 __builtin__.__dict__[biname] = bival
771 __builtin__.__dict__[biname] = bival
764 self.builtins_added.clear()
772 self.builtins_added.clear()
765
773
766 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
774 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
767 """set_hook(name,hook) -> sets an internal IPython hook.
775 """set_hook(name,hook) -> sets an internal IPython hook.
768
776
769 IPython exposes some of its internal API as user-modifiable hooks. By
777 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
778 adding your function to one of these hooks, you can modify IPython's
771 behavior to call at runtime your own routines."""
779 behavior to call at runtime your own routines."""
772
780
773 # At some point in the future, this should validate the hook before it
781 # 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
782 # accepts it. Probably at least check that the hook takes the number
775 # of args it's supposed to.
783 # of args it's supposed to.
776
784
777 f = new.instancemethod(hook,self,self.__class__)
785 f = new.instancemethod(hook,self,self.__class__)
778
786
779 # check if the hook is for strdispatcher first
787 # check if the hook is for strdispatcher first
780 if str_key is not None:
788 if str_key is not None:
781 sdp = self.strdispatchers.get(name, StrDispatch())
789 sdp = self.strdispatchers.get(name, StrDispatch())
782 sdp.add_s(str_key, f, priority )
790 sdp.add_s(str_key, f, priority )
783 self.strdispatchers[name] = sdp
791 self.strdispatchers[name] = sdp
784 return
792 return
785 if re_key is not None:
793 if re_key is not None:
786 sdp = self.strdispatchers.get(name, StrDispatch())
794 sdp = self.strdispatchers.get(name, StrDispatch())
787 sdp.add_re(re.compile(re_key), f, priority )
795 sdp.add_re(re.compile(re_key), f, priority )
788 self.strdispatchers[name] = sdp
796 self.strdispatchers[name] = sdp
789 return
797 return
790
798
791 dp = getattr(self.hooks, name, None)
799 dp = getattr(self.hooks, name, None)
792 if name not in IPython.hooks.__all__:
800 if name not in IPython.hooks.__all__:
793 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
801 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
794 if not dp:
802 if not dp:
795 dp = IPython.hooks.CommandChainDispatcher()
803 dp = IPython.hooks.CommandChainDispatcher()
796
804
797 try:
805 try:
798 dp.add(f,priority)
806 dp.add(f,priority)
799 except AttributeError:
807 except AttributeError:
800 # it was not commandchain, plain old func - replace
808 # it was not commandchain, plain old func - replace
801 dp = f
809 dp = f
802
810
803 setattr(self.hooks,name, dp)
811 setattr(self.hooks,name, dp)
804
812
805
813
806 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
814 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
807
815
808 def set_crash_handler(self,crashHandler):
816 def set_crash_handler(self,crashHandler):
809 """Set the IPython crash handler.
817 """Set the IPython crash handler.
810
818
811 This must be a callable with a signature suitable for use as
819 This must be a callable with a signature suitable for use as
812 sys.excepthook."""
820 sys.excepthook."""
813
821
814 # Install the given crash handler as the Python exception hook
822 # Install the given crash handler as the Python exception hook
815 sys.excepthook = crashHandler
823 sys.excepthook = crashHandler
816
824
817 # The instance will store a pointer to this, so that runtime code
825 # The instance will store a pointer to this, so that runtime code
818 # (such as magics) can access it. This is because during the
826 # (such as magics) can access it. This is because during the
819 # read-eval loop, it gets temporarily overwritten (to deal with GUI
827 # read-eval loop, it gets temporarily overwritten (to deal with GUI
820 # frameworks).
828 # frameworks).
821 self.sys_excepthook = sys.excepthook
829 self.sys_excepthook = sys.excepthook
822
830
823
831
824 def set_custom_exc(self,exc_tuple,handler):
832 def set_custom_exc(self,exc_tuple,handler):
825 """set_custom_exc(exc_tuple,handler)
833 """set_custom_exc(exc_tuple,handler)
826
834
827 Set a custom exception handler, which will be called if any of the
835 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
836 exceptions in exc_tuple occur in the mainloop (specifically, in the
829 runcode() method.
837 runcode() method.
830
838
831 Inputs:
839 Inputs:
832
840
833 - exc_tuple: a *tuple* of valid exceptions to call the defined
841 - 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
842 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
843 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:
844 you only want to trap a single exception, use a singleton tuple:
837
845
838 exc_tuple == (MyCustomException,)
846 exc_tuple == (MyCustomException,)
839
847
840 - handler: this must be defined as a function with the following
848 - handler: this must be defined as a function with the following
841 basic interface: def my_handler(self,etype,value,tb).
849 basic interface: def my_handler(self,etype,value,tb).
842
850
843 This will be made into an instance method (via new.instancemethod)
851 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
852 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
853 listed in the exc_tuple are caught. If the handler is None, an
846 internal basic one is used, which just prints basic info.
854 internal basic one is used, which just prints basic info.
847
855
848 WARNING: by putting in your own exception handler into IPython's main
856 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
857 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."""
858 facility should only be used if you really know what you are doing."""
851
859
852 assert type(exc_tuple)==type(()) , \
860 assert type(exc_tuple)==type(()) , \
853 "The custom exceptions must be given AS A TUPLE."
861 "The custom exceptions must be given AS A TUPLE."
854
862
855 def dummy_handler(self,etype,value,tb):
863 def dummy_handler(self,etype,value,tb):
856 print '*** Simple custom exception handler ***'
864 print '*** Simple custom exception handler ***'
857 print 'Exception type :',etype
865 print 'Exception type :',etype
858 print 'Exception value:',value
866 print 'Exception value:',value
859 print 'Traceback :',tb
867 print 'Traceback :',tb
860 print 'Source code :','\n'.join(self.buffer)
868 print 'Source code :','\n'.join(self.buffer)
861
869
862 if handler is None: handler = dummy_handler
870 if handler is None: handler = dummy_handler
863
871
864 self.CustomTB = new.instancemethod(handler,self,self.__class__)
872 self.CustomTB = new.instancemethod(handler,self,self.__class__)
865 self.custom_exceptions = exc_tuple
873 self.custom_exceptions = exc_tuple
866
874
867 def set_custom_completer(self,completer,pos=0):
875 def set_custom_completer(self,completer,pos=0):
868 """set_custom_completer(completer,pos=0)
876 """set_custom_completer(completer,pos=0)
869
877
870 Adds a new custom completer function.
878 Adds a new custom completer function.
871
879
872 The position argument (defaults to 0) is the index in the completers
880 The position argument (defaults to 0) is the index in the completers
873 list where you want the completer to be inserted."""
881 list where you want the completer to be inserted."""
874
882
875 newcomp = new.instancemethod(completer,self.Completer,
883 newcomp = new.instancemethod(completer,self.Completer,
876 self.Completer.__class__)
884 self.Completer.__class__)
877 self.Completer.matchers.insert(pos,newcomp)
885 self.Completer.matchers.insert(pos,newcomp)
878
886
879 def set_completer(self):
887 def set_completer(self):
880 """reset readline's completer to be our own."""
888 """reset readline's completer to be our own."""
881 self.readline.set_completer(self.Completer.complete)
889 self.readline.set_completer(self.Completer.complete)
882
890
883 def _get_call_pdb(self):
891 def _get_call_pdb(self):
884 return self._call_pdb
892 return self._call_pdb
885
893
886 def _set_call_pdb(self,val):
894 def _set_call_pdb(self,val):
887
895
888 if val not in (0,1,False,True):
896 if val not in (0,1,False,True):
889 raise ValueError,'new call_pdb value must be boolean'
897 raise ValueError,'new call_pdb value must be boolean'
890
898
891 # store value in instance
899 # store value in instance
892 self._call_pdb = val
900 self._call_pdb = val
893
901
894 # notify the actual exception handlers
902 # notify the actual exception handlers
895 self.InteractiveTB.call_pdb = val
903 self.InteractiveTB.call_pdb = val
896 if self.isthreaded:
904 if self.isthreaded:
897 try:
905 try:
898 self.sys_excepthook.call_pdb = val
906 self.sys_excepthook.call_pdb = val
899 except:
907 except:
900 warn('Failed to activate pdb for threaded exception handler')
908 warn('Failed to activate pdb for threaded exception handler')
901
909
902 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
910 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
903 'Control auto-activation of pdb at exceptions')
911 'Control auto-activation of pdb at exceptions')
904
912
905
913
906 # These special functions get installed in the builtin namespace, to
914 # These special functions get installed in the builtin namespace, to
907 # provide programmatic (pure python) access to magics, aliases and system
915 # provide programmatic (pure python) access to magics, aliases and system
908 # calls. This is important for logging, user scripting, and more.
916 # calls. This is important for logging, user scripting, and more.
909
917
910 # We are basically exposing, via normal python functions, the three
918 # We are basically exposing, via normal python functions, the three
911 # mechanisms in which ipython offers special call modes (magics for
919 # mechanisms in which ipython offers special call modes (magics for
912 # internal control, aliases for direct system access via pre-selected
920 # internal control, aliases for direct system access via pre-selected
913 # names, and !cmd for calling arbitrary system commands).
921 # names, and !cmd for calling arbitrary system commands).
914
922
915 def ipmagic(self,arg_s):
923 def ipmagic(self,arg_s):
916 """Call a magic function by name.
924 """Call a magic function by name.
917
925
918 Input: a string containing the name of the magic function to call and any
926 Input: a string containing the name of the magic function to call and any
919 additional arguments to be passed to the magic.
927 additional arguments to be passed to the magic.
920
928
921 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
929 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
922 prompt:
930 prompt:
923
931
924 In[1]: %name -opt foo bar
932 In[1]: %name -opt foo bar
925
933
926 To call a magic without arguments, simply use ipmagic('name').
934 To call a magic without arguments, simply use ipmagic('name').
927
935
928 This provides a proper Python function to call IPython's magics in any
936 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
937 valid Python code you can type at the interpreter, including loops and
930 compound statements. It is added by IPython to the Python builtin
938 compound statements. It is added by IPython to the Python builtin
931 namespace upon initialization."""
939 namespace upon initialization."""
932
940
933 args = arg_s.split(' ',1)
941 args = arg_s.split(' ',1)
934 magic_name = args[0]
942 magic_name = args[0]
935 magic_name = magic_name.lstrip(self.ESC_MAGIC)
943 magic_name = magic_name.lstrip(self.ESC_MAGIC)
936
944
937 try:
945 try:
938 magic_args = args[1]
946 magic_args = args[1]
939 except IndexError:
947 except IndexError:
940 magic_args = ''
948 magic_args = ''
941 fn = getattr(self,'magic_'+magic_name,None)
949 fn = getattr(self,'magic_'+magic_name,None)
942 if fn is None:
950 if fn is None:
943 error("Magic function `%s` not found." % magic_name)
951 error("Magic function `%s` not found." % magic_name)
944 else:
952 else:
945 magic_args = self.var_expand(magic_args,1)
953 magic_args = self.var_expand(magic_args,1)
946 return fn(magic_args)
954 return fn(magic_args)
947
955
948 def ipalias(self,arg_s):
956 def ipalias(self,arg_s):
949 """Call an alias by name.
957 """Call an alias by name.
950
958
951 Input: a string containing the name of the alias to call and any
959 Input: a string containing the name of the alias to call and any
952 additional arguments to be passed to the magic.
960 additional arguments to be passed to the magic.
953
961
954 ipalias('name -opt foo bar') is equivalent to typing at the ipython
962 ipalias('name -opt foo bar') is equivalent to typing at the ipython
955 prompt:
963 prompt:
956
964
957 In[1]: name -opt foo bar
965 In[1]: name -opt foo bar
958
966
959 To call an alias without arguments, simply use ipalias('name').
967 To call an alias without arguments, simply use ipalias('name').
960
968
961 This provides a proper Python function to call IPython's aliases in any
969 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
970 valid Python code you can type at the interpreter, including loops and
963 compound statements. It is added by IPython to the Python builtin
971 compound statements. It is added by IPython to the Python builtin
964 namespace upon initialization."""
972 namespace upon initialization."""
965
973
966 args = arg_s.split(' ',1)
974 args = arg_s.split(' ',1)
967 alias_name = args[0]
975 alias_name = args[0]
968 try:
976 try:
969 alias_args = args[1]
977 alias_args = args[1]
970 except IndexError:
978 except IndexError:
971 alias_args = ''
979 alias_args = ''
972 if alias_name in self.alias_table:
980 if alias_name in self.alias_table:
973 self.call_alias(alias_name,alias_args)
981 self.call_alias(alias_name,alias_args)
974 else:
982 else:
975 error("Alias `%s` not found." % alias_name)
983 error("Alias `%s` not found." % alias_name)
976
984
977 def ipsystem(self,arg_s):
985 def ipsystem(self,arg_s):
978 """Make a system call, using IPython."""
986 """Make a system call, using IPython."""
979
987
980 self.system(arg_s)
988 self.system(arg_s)
981
989
982 def complete(self,text):
990 def complete(self,text):
983 """Return a sorted list of all possible completions on text.
991 """Return a sorted list of all possible completions on text.
984
992
985 Inputs:
993 Inputs:
986
994
987 - text: a string of text to be completed on.
995 - text: a string of text to be completed on.
988
996
989 This is a wrapper around the completion mechanism, similar to what
997 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
998 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
999 exposing it as a method, it can be used by other non-readline
992 environments (such as GUIs) for text completion.
1000 environments (such as GUIs) for text completion.
993
1001
994 Simple usage example:
1002 Simple usage example:
995
1003
996 In [1]: x = 'hello'
1004 In [1]: x = 'hello'
997
1005
998 In [2]: __IP.complete('x.l')
1006 In [2]: __IP.complete('x.l')
999 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1007 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
1000
1008
1001 complete = self.Completer.complete
1009 complete = self.Completer.complete
1002 state = 0
1010 state = 0
1003 # use a dict so we get unique keys, since ipyhton's multiple
1011 # use a dict so we get unique keys, since ipyhton's multiple
1004 # completers can return duplicates. When we make 2.4 a requirement,
1012 # completers can return duplicates. When we make 2.4 a requirement,
1005 # start using sets instead, which are faster.
1013 # start using sets instead, which are faster.
1006 comps = {}
1014 comps = {}
1007 while True:
1015 while True:
1008 newcomp = complete(text,state,line_buffer=text)
1016 newcomp = complete(text,state,line_buffer=text)
1009 if newcomp is None:
1017 if newcomp is None:
1010 break
1018 break
1011 comps[newcomp] = 1
1019 comps[newcomp] = 1
1012 state += 1
1020 state += 1
1013 outcomps = comps.keys()
1021 outcomps = comps.keys()
1014 outcomps.sort()
1022 outcomps.sort()
1015 return outcomps
1023 return outcomps
1016
1024
1017 def set_completer_frame(self, frame=None):
1025 def set_completer_frame(self, frame=None):
1018 if frame:
1026 if frame:
1019 self.Completer.namespace = frame.f_locals
1027 self.Completer.namespace = frame.f_locals
1020 self.Completer.global_namespace = frame.f_globals
1028 self.Completer.global_namespace = frame.f_globals
1021 else:
1029 else:
1022 self.Completer.namespace = self.user_ns
1030 self.Completer.namespace = self.user_ns
1023 self.Completer.global_namespace = self.user_global_ns
1031 self.Completer.global_namespace = self.user_global_ns
1024
1032
1025 def init_auto_alias(self):
1033 def init_auto_alias(self):
1026 """Define some aliases automatically.
1034 """Define some aliases automatically.
1027
1035
1028 These are ALL parameter-less aliases"""
1036 These are ALL parameter-less aliases"""
1029
1037
1030 for alias,cmd in self.auto_alias:
1038 for alias,cmd in self.auto_alias:
1031 self.getapi().defalias(alias,cmd)
1039 self.getapi().defalias(alias,cmd)
1032
1040
1033
1041
1034 def alias_table_validate(self,verbose=0):
1042 def alias_table_validate(self,verbose=0):
1035 """Update information about the alias table.
1043 """Update information about the alias table.
1036
1044
1037 In particular, make sure no Python keywords/builtins are in it."""
1045 In particular, make sure no Python keywords/builtins are in it."""
1038
1046
1039 no_alias = self.no_alias
1047 no_alias = self.no_alias
1040 for k in self.alias_table.keys():
1048 for k in self.alias_table.keys():
1041 if k in no_alias:
1049 if k in no_alias:
1042 del self.alias_table[k]
1050 del self.alias_table[k]
1043 if verbose:
1051 if verbose:
1044 print ("Deleting alias <%s>, it's a Python "
1052 print ("Deleting alias <%s>, it's a Python "
1045 "keyword or builtin." % k)
1053 "keyword or builtin." % k)
1046
1054
1047 def set_autoindent(self,value=None):
1055 def set_autoindent(self,value=None):
1048 """Set the autoindent flag, checking for readline support.
1056 """Set the autoindent flag, checking for readline support.
1049
1057
1050 If called with no arguments, it acts as a toggle."""
1058 If called with no arguments, it acts as a toggle."""
1051
1059
1052 if not self.has_readline:
1060 if not self.has_readline:
1053 if os.name == 'posix':
1061 if os.name == 'posix':
1054 warn("The auto-indent feature requires the readline library")
1062 warn("The auto-indent feature requires the readline library")
1055 self.autoindent = 0
1063 self.autoindent = 0
1056 return
1064 return
1057 if value is None:
1065 if value is None:
1058 self.autoindent = not self.autoindent
1066 self.autoindent = not self.autoindent
1059 else:
1067 else:
1060 self.autoindent = value
1068 self.autoindent = value
1061
1069
1062 def rc_set_toggle(self,rc_field,value=None):
1070 def rc_set_toggle(self,rc_field,value=None):
1063 """Set or toggle a field in IPython's rc config. structure.
1071 """Set or toggle a field in IPython's rc config. structure.
1064
1072
1065 If called with no arguments, it acts as a toggle.
1073 If called with no arguments, it acts as a toggle.
1066
1074
1067 If called with a non-existent field, the resulting AttributeError
1075 If called with a non-existent field, the resulting AttributeError
1068 exception will propagate out."""
1076 exception will propagate out."""
1069
1077
1070 rc_val = getattr(self.rc,rc_field)
1078 rc_val = getattr(self.rc,rc_field)
1071 if value is None:
1079 if value is None:
1072 value = not rc_val
1080 value = not rc_val
1073 setattr(self.rc,rc_field,value)
1081 setattr(self.rc,rc_field,value)
1074
1082
1075 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1083 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1076 """Install the user configuration directory.
1084 """Install the user configuration directory.
1077
1085
1078 Can be called when running for the first time or to upgrade the user's
1086 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'
1087 .ipython/ directory with the mode parameter. Valid modes are 'install'
1080 and 'upgrade'."""
1088 and 'upgrade'."""
1081
1089
1082 def wait():
1090 def wait():
1083 try:
1091 try:
1084 raw_input("Please press <RETURN> to start IPython.")
1092 raw_input("Please press <RETURN> to start IPython.")
1085 except EOFError:
1093 except EOFError:
1086 print >> Term.cout
1094 print >> Term.cout
1087 print '*'*70
1095 print '*'*70
1088
1096
1089 cwd = os.getcwd() # remember where we started
1097 cwd = os.getcwd() # remember where we started
1090 glb = glob.glob
1098 glb = glob.glob
1091 print '*'*70
1099 print '*'*70
1092 if mode == 'install':
1100 if mode == 'install':
1093 print \
1101 print \
1094 """Welcome to IPython. I will try to create a personal configuration directory
1102 """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"""
1103 where you can customize many aspects of IPython's functionality in:\n"""
1096 else:
1104 else:
1097 print 'I am going to upgrade your configuration in:'
1105 print 'I am going to upgrade your configuration in:'
1098
1106
1099 print ipythondir
1107 print ipythondir
1100
1108
1101 rcdirend = os.path.join('IPython','UserConfig')
1109 rcdirend = os.path.join('IPython','UserConfig')
1102 cfg = lambda d: os.path.join(d,rcdirend)
1110 cfg = lambda d: os.path.join(d,rcdirend)
1103 try:
1111 try:
1104 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1112 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1105 print "Initializing from configuration",rcdir
1113 print "Initializing from configuration",rcdir
1106 except IndexError:
1114 except IndexError:
1107 warning = """
1115 warning = """
1108 Installation error. IPython's directory was not found.
1116 Installation error. IPython's directory was not found.
1109
1117
1110 Check the following:
1118 Check the following:
1111
1119
1112 The ipython/IPython directory should be in a directory belonging to your
1120 The ipython/IPython directory should be in a directory belonging to your
1113 PYTHONPATH environment variable (that is, it should be in a directory
1121 PYTHONPATH environment variable (that is, it should be in a directory
1114 belonging to sys.path). You can copy it explicitly there or just link to it.
1122 belonging to sys.path). You can copy it explicitly there or just link to it.
1115
1123
1116 IPython will create a minimal default configuration for you.
1124 IPython will create a minimal default configuration for you.
1117
1125
1118 """
1126 """
1119 warn(warning)
1127 warn(warning)
1120 wait()
1128 wait()
1121
1129
1122 if sys.platform =='win32':
1130 if sys.platform =='win32':
1123 inif = 'ipythonrc.ini'
1131 inif = 'ipythonrc.ini'
1124 else:
1132 else:
1125 inif = 'ipythonrc'
1133 inif = 'ipythonrc'
1126 minimal_setup = {'ipy_user_conf.py' : 'import ipy_defaults', inif : '# intentionally left blank' }
1134 minimal_setup = {'ipy_user_conf.py' : 'import ipy_defaults', inif : '# intentionally left blank' }
1127 os.makedirs(ipythondir, mode = 0777)
1135 os.makedirs(ipythondir, mode = 0777)
1128 for f, cont in minimal_setup.items():
1136 for f, cont in minimal_setup.items():
1129 open(ipythondir + '/' + f,'w').write(cont)
1137 open(ipythondir + '/' + f,'w').write(cont)
1130
1138
1131 return
1139 return
1132
1140
1133 if mode == 'install':
1141 if mode == 'install':
1134 try:
1142 try:
1135 shutil.copytree(rcdir,ipythondir)
1143 shutil.copytree(rcdir,ipythondir)
1136 os.chdir(ipythondir)
1144 os.chdir(ipythondir)
1137 rc_files = glb("ipythonrc*")
1145 rc_files = glb("ipythonrc*")
1138 for rc_file in rc_files:
1146 for rc_file in rc_files:
1139 os.rename(rc_file,rc_file+rc_suffix)
1147 os.rename(rc_file,rc_file+rc_suffix)
1140 except:
1148 except:
1141 warning = """
1149 warning = """
1142
1150
1143 There was a problem with the installation:
1151 There was a problem with the installation:
1144 %s
1152 %s
1145 Try to correct it or contact the developers if you think it's a bug.
1153 Try to correct it or contact the developers if you think it's a bug.
1146 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1154 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1147 warn(warning)
1155 warn(warning)
1148 wait()
1156 wait()
1149 return
1157 return
1150
1158
1151 elif mode == 'upgrade':
1159 elif mode == 'upgrade':
1152 try:
1160 try:
1153 os.chdir(ipythondir)
1161 os.chdir(ipythondir)
1154 except:
1162 except:
1155 print """
1163 print """
1156 Can not upgrade: changing to directory %s failed. Details:
1164 Can not upgrade: changing to directory %s failed. Details:
1157 %s
1165 %s
1158 """ % (ipythondir,sys.exc_info()[1])
1166 """ % (ipythondir,sys.exc_info()[1])
1159 wait()
1167 wait()
1160 return
1168 return
1161 else:
1169 else:
1162 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1170 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1163 for new_full_path in sources:
1171 for new_full_path in sources:
1164 new_filename = os.path.basename(new_full_path)
1172 new_filename = os.path.basename(new_full_path)
1165 if new_filename.startswith('ipythonrc'):
1173 if new_filename.startswith('ipythonrc'):
1166 new_filename = new_filename + rc_suffix
1174 new_filename = new_filename + rc_suffix
1167 # The config directory should only contain files, skip any
1175 # The config directory should only contain files, skip any
1168 # directories which may be there (like CVS)
1176 # directories which may be there (like CVS)
1169 if os.path.isdir(new_full_path):
1177 if os.path.isdir(new_full_path):
1170 continue
1178 continue
1171 if os.path.exists(new_filename):
1179 if os.path.exists(new_filename):
1172 old_file = new_filename+'.old'
1180 old_file = new_filename+'.old'
1173 if os.path.exists(old_file):
1181 if os.path.exists(old_file):
1174 os.remove(old_file)
1182 os.remove(old_file)
1175 os.rename(new_filename,old_file)
1183 os.rename(new_filename,old_file)
1176 shutil.copy(new_full_path,new_filename)
1184 shutil.copy(new_full_path,new_filename)
1177 else:
1185 else:
1178 raise ValueError,'unrecognized mode for install:',`mode`
1186 raise ValueError,'unrecognized mode for install:',`mode`
1179
1187
1180 # Fix line-endings to those native to each platform in the config
1188 # Fix line-endings to those native to each platform in the config
1181 # directory.
1189 # directory.
1182 try:
1190 try:
1183 os.chdir(ipythondir)
1191 os.chdir(ipythondir)
1184 except:
1192 except:
1185 print """
1193 print """
1186 Problem: changing to directory %s failed.
1194 Problem: changing to directory %s failed.
1187 Details:
1195 Details:
1188 %s
1196 %s
1189
1197
1190 Some configuration files may have incorrect line endings. This should not
1198 Some configuration files may have incorrect line endings. This should not
1191 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1199 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1192 wait()
1200 wait()
1193 else:
1201 else:
1194 for fname in glb('ipythonrc*'):
1202 for fname in glb('ipythonrc*'):
1195 try:
1203 try:
1196 native_line_ends(fname,backup=0)
1204 native_line_ends(fname,backup=0)
1197 except IOError:
1205 except IOError:
1198 pass
1206 pass
1199
1207
1200 if mode == 'install':
1208 if mode == 'install':
1201 print """
1209 print """
1202 Successful installation!
1210 Successful installation!
1203
1211
1204 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1212 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1205 IPython manual (there are both HTML and PDF versions supplied with the
1213 IPython manual (there are both HTML and PDF versions supplied with the
1206 distribution) to make sure that your system environment is properly configured
1214 distribution) to make sure that your system environment is properly configured
1207 to take advantage of IPython's features.
1215 to take advantage of IPython's features.
1208
1216
1209 Important note: the configuration system has changed! The old system is
1217 Important note: the configuration system has changed! The old system is
1210 still in place, but its setting may be partly overridden by the settings in
1218 still in place, but its setting may be partly overridden by the settings in
1211 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1219 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1212 if some of the new settings bother you.
1220 if some of the new settings bother you.
1213
1221
1214 """
1222 """
1215 else:
1223 else:
1216 print """
1224 print """
1217 Successful upgrade!
1225 Successful upgrade!
1218
1226
1219 All files in your directory:
1227 All files in your directory:
1220 %(ipythondir)s
1228 %(ipythondir)s
1221 which would have been overwritten by the upgrade were backed up with a .old
1229 which would have been overwritten by the upgrade were backed up with a .old
1222 extension. If you had made particular customizations in those files you may
1230 extension. If you had made particular customizations in those files you may
1223 want to merge them back into the new files.""" % locals()
1231 want to merge them back into the new files.""" % locals()
1224 wait()
1232 wait()
1225 os.chdir(cwd)
1233 os.chdir(cwd)
1226 # end user_setup()
1234 # end user_setup()
1227
1235
1228 def atexit_operations(self):
1236 def atexit_operations(self):
1229 """This will be executed at the time of exit.
1237 """This will be executed at the time of exit.
1230
1238
1231 Saving of persistent data should be performed here. """
1239 Saving of persistent data should be performed here. """
1232
1240
1233 #print '*** IPython exit cleanup ***' # dbg
1241 #print '*** IPython exit cleanup ***' # dbg
1234 # input history
1242 # input history
1235 self.savehist()
1243 self.savehist()
1236
1244
1237 # Cleanup all tempfiles left around
1245 # Cleanup all tempfiles left around
1238 for tfile in self.tempfiles:
1246 for tfile in self.tempfiles:
1239 try:
1247 try:
1240 os.unlink(tfile)
1248 os.unlink(tfile)
1241 except OSError:
1249 except OSError:
1242 pass
1250 pass
1243
1251
1244 self.hooks.shutdown_hook()
1252 self.hooks.shutdown_hook()
1245
1253
1246 def savehist(self):
1254 def savehist(self):
1247 """Save input history to a file (via readline library)."""
1255 """Save input history to a file (via readline library)."""
1248
1256
1249 if not self.has_readline:
1257 if not self.has_readline:
1250 return
1258 return
1251
1259
1252 try:
1260 try:
1253 self.readline.write_history_file(self.histfile)
1261 self.readline.write_history_file(self.histfile)
1254 except:
1262 except:
1255 print 'Unable to save IPython command history to file: ' + \
1263 print 'Unable to save IPython command history to file: ' + \
1256 `self.histfile`
1264 `self.histfile`
1257
1265
1258 def reloadhist(self):
1266 def reloadhist(self):
1259 """Reload the input history from disk file."""
1267 """Reload the input history from disk file."""
1260
1268
1261 if self.has_readline:
1269 if self.has_readline:
1262 self.readline.clear_history()
1270 self.readline.clear_history()
1263 self.readline.read_history_file(self.shell.histfile)
1271 self.readline.read_history_file(self.shell.histfile)
1264
1272
1265 def history_saving_wrapper(self, func):
1273 def history_saving_wrapper(self, func):
1266 """ Wrap func for readline history saving
1274 """ Wrap func for readline history saving
1267
1275
1268 Convert func into callable that saves & restores
1276 Convert func into callable that saves & restores
1269 history around the call """
1277 history around the call """
1270
1278
1271 if not self.has_readline:
1279 if not self.has_readline:
1272 return func
1280 return func
1273
1281
1274 def wrapper():
1282 def wrapper():
1275 self.savehist()
1283 self.savehist()
1276 try:
1284 try:
1277 func()
1285 func()
1278 finally:
1286 finally:
1279 readline.read_history_file(self.histfile)
1287 readline.read_history_file(self.histfile)
1280 return wrapper
1288 return wrapper
1281
1289
1282
1290
1283 def pre_readline(self):
1291 def pre_readline(self):
1284 """readline hook to be used at the start of each line.
1292 """readline hook to be used at the start of each line.
1285
1293
1286 Currently it handles auto-indent only."""
1294 Currently it handles auto-indent only."""
1287
1295
1288 #debugx('self.indent_current_nsp','pre_readline:')
1296 #debugx('self.indent_current_nsp','pre_readline:')
1289
1297
1290 if self.rl_do_indent:
1298 if self.rl_do_indent:
1291 self.readline.insert_text(self.indent_current_str())
1299 self.readline.insert_text(self.indent_current_str())
1292 if self.rl_next_input is not None:
1300 if self.rl_next_input is not None:
1293 self.readline.insert_text(self.rl_next_input)
1301 self.readline.insert_text(self.rl_next_input)
1294 self.rl_next_input = None
1302 self.rl_next_input = None
1295
1303
1296 def init_readline(self):
1304 def init_readline(self):
1297 """Command history completion/saving/reloading."""
1305 """Command history completion/saving/reloading."""
1298
1306
1299
1307
1300 import IPython.rlineimpl as readline
1308 import IPython.rlineimpl as readline
1301
1309
1302 if not readline.have_readline:
1310 if not readline.have_readline:
1303 self.has_readline = 0
1311 self.has_readline = 0
1304 self.readline = None
1312 self.readline = None
1305 # no point in bugging windows users with this every time:
1313 # no point in bugging windows users with this every time:
1306 warn('Readline services not available on this platform.')
1314 warn('Readline services not available on this platform.')
1307 else:
1315 else:
1308 sys.modules['readline'] = readline
1316 sys.modules['readline'] = readline
1309 import atexit
1317 import atexit
1310 from IPython.completer import IPCompleter
1318 from IPython.completer import IPCompleter
1311 self.Completer = IPCompleter(self,
1319 self.Completer = IPCompleter(self,
1312 self.user_ns,
1320 self.user_ns,
1313 self.user_global_ns,
1321 self.user_global_ns,
1314 self.rc.readline_omit__names,
1322 self.rc.readline_omit__names,
1315 self.alias_table)
1323 self.alias_table)
1316 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1324 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1317 self.strdispatchers['complete_command'] = sdisp
1325 self.strdispatchers['complete_command'] = sdisp
1318 self.Completer.custom_completers = sdisp
1326 self.Completer.custom_completers = sdisp
1319 # Platform-specific configuration
1327 # Platform-specific configuration
1320 if os.name == 'nt':
1328 if os.name == 'nt':
1321 self.readline_startup_hook = readline.set_pre_input_hook
1329 self.readline_startup_hook = readline.set_pre_input_hook
1322 else:
1330 else:
1323 self.readline_startup_hook = readline.set_startup_hook
1331 self.readline_startup_hook = readline.set_startup_hook
1324
1332
1325 # Load user's initrc file (readline config)
1333 # Load user's initrc file (readline config)
1326 # Or if libedit is used, load editrc.
1334 # Or if libedit is used, load editrc.
1327 inputrc_name = os.environ.get('INPUTRC')
1335 inputrc_name = os.environ.get('INPUTRC')
1328 if inputrc_name is None:
1336 if inputrc_name is None:
1329 home_dir = get_home_dir()
1337 home_dir = get_home_dir()
1330 if home_dir is not None:
1338 if home_dir is not None:
1331 inputrc_name = '.inputrc'
1339 inputrc_name = '.inputrc'
1332 if readline.uses_libedit:
1340 if readline.uses_libedit:
1333 inputrc_name = '.editrc'
1341 inputrc_name = '.editrc'
1334 inputrc_name = os.path.join(home_dir, inputrc_name)
1342 inputrc_name = os.path.join(home_dir, inputrc_name)
1335 if os.path.isfile(inputrc_name):
1343 if os.path.isfile(inputrc_name):
1336 try:
1344 try:
1337 readline.read_init_file(inputrc_name)
1345 readline.read_init_file(inputrc_name)
1338 except:
1346 except:
1339 warn('Problems reading readline initialization file <%s>'
1347 warn('Problems reading readline initialization file <%s>'
1340 % inputrc_name)
1348 % inputrc_name)
1341
1349
1342 self.has_readline = 1
1350 self.has_readline = 1
1343 self.readline = readline
1351 self.readline = readline
1344 # save this in sys so embedded copies can restore it properly
1352 # save this in sys so embedded copies can restore it properly
1345 sys.ipcompleter = self.Completer.complete
1353 sys.ipcompleter = self.Completer.complete
1346 self.set_completer()
1354 self.set_completer()
1347
1355
1348 # Configure readline according to user's prefs
1356 # Configure readline according to user's prefs
1349 # This is only done if GNU readline is being used. If libedit
1357 # This is only done if GNU readline is being used. If libedit
1350 # is being used (as on Leopard) the readline config is
1358 # is being used (as on Leopard) the readline config is
1351 # not run as the syntax for libedit is different.
1359 # not run as the syntax for libedit is different.
1352 if not readline.uses_libedit:
1360 if not readline.uses_libedit:
1353 for rlcommand in self.rc.readline_parse_and_bind:
1361 for rlcommand in self.rc.readline_parse_and_bind:
1354 readline.parse_and_bind(rlcommand)
1362 readline.parse_and_bind(rlcommand)
1355
1363
1356 # remove some chars from the delimiters list
1364 # remove some chars from the delimiters list
1357 delims = readline.get_completer_delims()
1365 delims = readline.get_completer_delims()
1358 delims = delims.translate(string._idmap,
1366 delims = delims.translate(string._idmap,
1359 self.rc.readline_remove_delims)
1367 self.rc.readline_remove_delims)
1360 readline.set_completer_delims(delims)
1368 readline.set_completer_delims(delims)
1361 # otherwise we end up with a monster history after a while:
1369 # otherwise we end up with a monster history after a while:
1362 readline.set_history_length(1000)
1370 readline.set_history_length(1000)
1363 try:
1371 try:
1364 #print '*** Reading readline history' # dbg
1372 #print '*** Reading readline history' # dbg
1365 readline.read_history_file(self.histfile)
1373 readline.read_history_file(self.histfile)
1366 except IOError:
1374 except IOError:
1367 pass # It doesn't exist yet.
1375 pass # It doesn't exist yet.
1368
1376
1369 atexit.register(self.atexit_operations)
1377 atexit.register(self.atexit_operations)
1370 del atexit
1378 del atexit
1371
1379
1372 # Configure auto-indent for all platforms
1380 # Configure auto-indent for all platforms
1373 self.set_autoindent(self.rc.autoindent)
1381 self.set_autoindent(self.rc.autoindent)
1374
1382
1375 def ask_yes_no(self,prompt,default=True):
1383 def ask_yes_no(self,prompt,default=True):
1376 if self.rc.quiet:
1384 if self.rc.quiet:
1377 return True
1385 return True
1378 return ask_yes_no(prompt,default)
1386 return ask_yes_no(prompt,default)
1379
1387
1380 def _should_recompile(self,e):
1388 def _should_recompile(self,e):
1381 """Utility routine for edit_syntax_error"""
1389 """Utility routine for edit_syntax_error"""
1382
1390
1383 if e.filename in ('<ipython console>','<input>','<string>',
1391 if e.filename in ('<ipython console>','<input>','<string>',
1384 '<console>','<BackgroundJob compilation>',
1392 '<console>','<BackgroundJob compilation>',
1385 None):
1393 None):
1386
1394
1387 return False
1395 return False
1388 try:
1396 try:
1389 if (self.rc.autoedit_syntax and
1397 if (self.rc.autoedit_syntax and
1390 not self.ask_yes_no('Return to editor to correct syntax error? '
1398 not self.ask_yes_no('Return to editor to correct syntax error? '
1391 '[Y/n] ','y')):
1399 '[Y/n] ','y')):
1392 return False
1400 return False
1393 except EOFError:
1401 except EOFError:
1394 return False
1402 return False
1395
1403
1396 def int0(x):
1404 def int0(x):
1397 try:
1405 try:
1398 return int(x)
1406 return int(x)
1399 except TypeError:
1407 except TypeError:
1400 return 0
1408 return 0
1401 # always pass integer line and offset values to editor hook
1409 # always pass integer line and offset values to editor hook
1402 self.hooks.fix_error_editor(e.filename,
1410 self.hooks.fix_error_editor(e.filename,
1403 int0(e.lineno),int0(e.offset),e.msg)
1411 int0(e.lineno),int0(e.offset),e.msg)
1404 return True
1412 return True
1405
1413
1406 def edit_syntax_error(self):
1414 def edit_syntax_error(self):
1407 """The bottom half of the syntax error handler called in the main loop.
1415 """The bottom half of the syntax error handler called in the main loop.
1408
1416
1409 Loop until syntax error is fixed or user cancels.
1417 Loop until syntax error is fixed or user cancels.
1410 """
1418 """
1411
1419
1412 while self.SyntaxTB.last_syntax_error:
1420 while self.SyntaxTB.last_syntax_error:
1413 # copy and clear last_syntax_error
1421 # copy and clear last_syntax_error
1414 err = self.SyntaxTB.clear_err_state()
1422 err = self.SyntaxTB.clear_err_state()
1415 if not self._should_recompile(err):
1423 if not self._should_recompile(err):
1416 return
1424 return
1417 try:
1425 try:
1418 # may set last_syntax_error again if a SyntaxError is raised
1426 # may set last_syntax_error again if a SyntaxError is raised
1419 self.safe_execfile(err.filename,self.user_ns)
1427 self.safe_execfile(err.filename,self.user_ns)
1420 except:
1428 except:
1421 self.showtraceback()
1429 self.showtraceback()
1422 else:
1430 else:
1423 try:
1431 try:
1424 f = file(err.filename)
1432 f = file(err.filename)
1425 try:
1433 try:
1426 sys.displayhook(f.read())
1434 sys.displayhook(f.read())
1427 finally:
1435 finally:
1428 f.close()
1436 f.close()
1429 except:
1437 except:
1430 self.showtraceback()
1438 self.showtraceback()
1431
1439
1432 def showsyntaxerror(self, filename=None):
1440 def showsyntaxerror(self, filename=None):
1433 """Display the syntax error that just occurred.
1441 """Display the syntax error that just occurred.
1434
1442
1435 This doesn't display a stack trace because there isn't one.
1443 This doesn't display a stack trace because there isn't one.
1436
1444
1437 If a filename is given, it is stuffed in the exception instead
1445 If a filename is given, it is stuffed in the exception instead
1438 of what was there before (because Python's parser always uses
1446 of what was there before (because Python's parser always uses
1439 "<string>" when reading from a string).
1447 "<string>" when reading from a string).
1440 """
1448 """
1441 etype, value, last_traceback = sys.exc_info()
1449 etype, value, last_traceback = sys.exc_info()
1442
1450
1443 # See note about these variables in showtraceback() below
1451 # See note about these variables in showtraceback() below
1444 sys.last_type = etype
1452 sys.last_type = etype
1445 sys.last_value = value
1453 sys.last_value = value
1446 sys.last_traceback = last_traceback
1454 sys.last_traceback = last_traceback
1447
1455
1448 if filename and etype is SyntaxError:
1456 if filename and etype is SyntaxError:
1449 # Work hard to stuff the correct filename in the exception
1457 # Work hard to stuff the correct filename in the exception
1450 try:
1458 try:
1451 msg, (dummy_filename, lineno, offset, line) = value
1459 msg, (dummy_filename, lineno, offset, line) = value
1452 except:
1460 except:
1453 # Not the format we expect; leave it alone
1461 # Not the format we expect; leave it alone
1454 pass
1462 pass
1455 else:
1463 else:
1456 # Stuff in the right filename
1464 # Stuff in the right filename
1457 try:
1465 try:
1458 # Assume SyntaxError is a class exception
1466 # Assume SyntaxError is a class exception
1459 value = SyntaxError(msg, (filename, lineno, offset, line))
1467 value = SyntaxError(msg, (filename, lineno, offset, line))
1460 except:
1468 except:
1461 # If that failed, assume SyntaxError is a string
1469 # If that failed, assume SyntaxError is a string
1462 value = msg, (filename, lineno, offset, line)
1470 value = msg, (filename, lineno, offset, line)
1463 self.SyntaxTB(etype,value,[])
1471 self.SyntaxTB(etype,value,[])
1464
1472
1465 def debugger(self,force=False):
1473 def debugger(self,force=False):
1466 """Call the pydb/pdb debugger.
1474 """Call the pydb/pdb debugger.
1467
1475
1468 Keywords:
1476 Keywords:
1469
1477
1470 - force(False): by default, this routine checks the instance call_pdb
1478 - force(False): by default, this routine checks the instance call_pdb
1471 flag and does not actually invoke the debugger if the flag is false.
1479 flag and does not actually invoke the debugger if the flag is false.
1472 The 'force' option forces the debugger to activate even if the flag
1480 The 'force' option forces the debugger to activate even if the flag
1473 is false.
1481 is false.
1474 """
1482 """
1475
1483
1476 if not (force or self.call_pdb):
1484 if not (force or self.call_pdb):
1477 return
1485 return
1478
1486
1479 if not hasattr(sys,'last_traceback'):
1487 if not hasattr(sys,'last_traceback'):
1480 error('No traceback has been produced, nothing to debug.')
1488 error('No traceback has been produced, nothing to debug.')
1481 return
1489 return
1482
1490
1483 # use pydb if available
1491 # use pydb if available
1484 if Debugger.has_pydb:
1492 if Debugger.has_pydb:
1485 from pydb import pm
1493 from pydb import pm
1486 else:
1494 else:
1487 # fallback to our internal debugger
1495 # fallback to our internal debugger
1488 pm = lambda : self.InteractiveTB.debugger(force=True)
1496 pm = lambda : self.InteractiveTB.debugger(force=True)
1489 self.history_saving_wrapper(pm)()
1497 self.history_saving_wrapper(pm)()
1490
1498
1491 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1499 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1492 """Display the exception that just occurred.
1500 """Display the exception that just occurred.
1493
1501
1494 If nothing is known about the exception, this is the method which
1502 If nothing is known about the exception, this is the method which
1495 should be used throughout the code for presenting user tracebacks,
1503 should be used throughout the code for presenting user tracebacks,
1496 rather than directly invoking the InteractiveTB object.
1504 rather than directly invoking the InteractiveTB object.
1497
1505
1498 A specific showsyntaxerror() also exists, but this method can take
1506 A specific showsyntaxerror() also exists, but this method can take
1499 care of calling it if needed, so unless you are explicitly catching a
1507 care of calling it if needed, so unless you are explicitly catching a
1500 SyntaxError exception, don't try to analyze the stack manually and
1508 SyntaxError exception, don't try to analyze the stack manually and
1501 simply call this method."""
1509 simply call this method."""
1502
1510
1503
1511
1504 # Though this won't be called by syntax errors in the input line,
1512 # Though this won't be called by syntax errors in the input line,
1505 # there may be SyntaxError cases whith imported code.
1513 # there may be SyntaxError cases whith imported code.
1506
1514
1507 try:
1515 try:
1508 if exc_tuple is None:
1516 if exc_tuple is None:
1509 etype, value, tb = sys.exc_info()
1517 etype, value, tb = sys.exc_info()
1510 else:
1518 else:
1511 etype, value, tb = exc_tuple
1519 etype, value, tb = exc_tuple
1512
1520
1513 if etype is SyntaxError:
1521 if etype is SyntaxError:
1514 self.showsyntaxerror(filename)
1522 self.showsyntaxerror(filename)
1515 elif etype is IPython.ipapi.UsageError:
1523 elif etype is IPython.ipapi.UsageError:
1516 print "UsageError:", value
1524 print "UsageError:", value
1517 else:
1525 else:
1518 # WARNING: these variables are somewhat deprecated and not
1526 # WARNING: these variables are somewhat deprecated and not
1519 # necessarily safe to use in a threaded environment, but tools
1527 # necessarily safe to use in a threaded environment, but tools
1520 # like pdb depend on their existence, so let's set them. If we
1528 # like pdb depend on their existence, so let's set them. If we
1521 # find problems in the field, we'll need to revisit their use.
1529 # find problems in the field, we'll need to revisit their use.
1522 sys.last_type = etype
1530 sys.last_type = etype
1523 sys.last_value = value
1531 sys.last_value = value
1524 sys.last_traceback = tb
1532 sys.last_traceback = tb
1525
1533
1526 if etype in self.custom_exceptions:
1534 if etype in self.custom_exceptions:
1527 self.CustomTB(etype,value,tb)
1535 self.CustomTB(etype,value,tb)
1528 else:
1536 else:
1529 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1537 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1530 if self.InteractiveTB.call_pdb and self.has_readline:
1538 if self.InteractiveTB.call_pdb and self.has_readline:
1531 # pdb mucks up readline, fix it back
1539 # pdb mucks up readline, fix it back
1532 self.set_completer()
1540 self.set_completer()
1533 except KeyboardInterrupt:
1541 except KeyboardInterrupt:
1534 self.write("\nKeyboardInterrupt\n")
1542 self.write("\nKeyboardInterrupt\n")
1535
1543
1536
1544
1537
1545
1538 def mainloop(self,banner=None):
1546 def mainloop(self,banner=None):
1539 """Creates the local namespace and starts the mainloop.
1547 """Creates the local namespace and starts the mainloop.
1540
1548
1541 If an optional banner argument is given, it will override the
1549 If an optional banner argument is given, it will override the
1542 internally created default banner."""
1550 internally created default banner."""
1543
1551
1544 if self.rc.c: # Emulate Python's -c option
1552 if self.rc.c: # Emulate Python's -c option
1545 self.exec_init_cmd()
1553 self.exec_init_cmd()
1546 if banner is None:
1554 if banner is None:
1547 if not self.rc.banner:
1555 if not self.rc.banner:
1548 banner = ''
1556 banner = ''
1549 # banner is string? Use it directly!
1557 # banner is string? Use it directly!
1550 elif isinstance(self.rc.banner,basestring):
1558 elif isinstance(self.rc.banner,basestring):
1551 banner = self.rc.banner
1559 banner = self.rc.banner
1552 else:
1560 else:
1553 banner = self.BANNER+self.banner2
1561 banner = self.BANNER+self.banner2
1554
1562
1555 while 1:
1563 while 1:
1556 try:
1564 try:
1557 self.interact(banner)
1565 self.interact(banner)
1558 break
1566 break
1559 except KeyboardInterrupt:
1567 except KeyboardInterrupt:
1560 # this should not be necessary, but KeyboardInterrupt
1568 # this should not be necessary, but KeyboardInterrupt
1561 # handling seems rather unpredictable...
1569 # handling seems rather unpredictable...
1562 self.write("\nKeyboardInterrupt in interact()\n")
1570 self.write("\nKeyboardInterrupt in interact()\n")
1563
1571
1564 def exec_init_cmd(self):
1572 def exec_init_cmd(self):
1565 """Execute a command given at the command line.
1573 """Execute a command given at the command line.
1566
1574
1567 This emulates Python's -c option."""
1575 This emulates Python's -c option."""
1568
1576
1569 #sys.argv = ['-c']
1577 #sys.argv = ['-c']
1570 self.push(self.prefilter(self.rc.c, False))
1578 self.push(self.prefilter(self.rc.c, False))
1571 if not self.rc.interact:
1579 if not self.rc.interact:
1572 self.exit_now = True
1580 self.exit_now = True
1573
1581
1574 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1582 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1575 """Embeds IPython into a running python program.
1583 """Embeds IPython into a running python program.
1576
1584
1577 Input:
1585 Input:
1578
1586
1579 - header: An optional header message can be specified.
1587 - header: An optional header message can be specified.
1580
1588
1581 - local_ns, global_ns: working namespaces. If given as None, the
1589 - local_ns, global_ns: working namespaces. If given as None, the
1582 IPython-initialized one is updated with __main__.__dict__, so that
1590 IPython-initialized one is updated with __main__.__dict__, so that
1583 program variables become visible but user-specific configuration
1591 program variables become visible but user-specific configuration
1584 remains possible.
1592 remains possible.
1585
1593
1586 - stack_depth: specifies how many levels in the stack to go to
1594 - stack_depth: specifies how many levels in the stack to go to
1587 looking for namespaces (when local_ns and global_ns are None). This
1595 looking for namespaces (when local_ns and global_ns are None). This
1588 allows an intermediate caller to make sure that this function gets
1596 allows an intermediate caller to make sure that this function gets
1589 the namespace from the intended level in the stack. By default (0)
1597 the namespace from the intended level in the stack. By default (0)
1590 it will get its locals and globals from the immediate caller.
1598 it will get its locals and globals from the immediate caller.
1591
1599
1592 Warning: it's possible to use this in a program which is being run by
1600 Warning: it's possible to use this in a program which is being run by
1593 IPython itself (via %run), but some funny things will happen (a few
1601 IPython itself (via %run), but some funny things will happen (a few
1594 globals get overwritten). In the future this will be cleaned up, as
1602 globals get overwritten). In the future this will be cleaned up, as
1595 there is no fundamental reason why it can't work perfectly."""
1603 there is no fundamental reason why it can't work perfectly."""
1596
1604
1597 # Get locals and globals from caller
1605 # Get locals and globals from caller
1598 if local_ns is None or global_ns is None:
1606 if local_ns is None or global_ns is None:
1599 call_frame = sys._getframe(stack_depth).f_back
1607 call_frame = sys._getframe(stack_depth).f_back
1600
1608
1601 if local_ns is None:
1609 if local_ns is None:
1602 local_ns = call_frame.f_locals
1610 local_ns = call_frame.f_locals
1603 if global_ns is None:
1611 if global_ns is None:
1604 global_ns = call_frame.f_globals
1612 global_ns = call_frame.f_globals
1605
1613
1606 # Update namespaces and fire up interpreter
1614 # Update namespaces and fire up interpreter
1607
1615
1608 # The global one is easy, we can just throw it in
1616 # The global one is easy, we can just throw it in
1609 self.user_global_ns = global_ns
1617 self.user_global_ns = global_ns
1610
1618
1611 # but the user/local one is tricky: ipython needs it to store internal
1619 # but the user/local one is tricky: ipython needs it to store internal
1612 # data, but we also need the locals. We'll copy locals in the user
1620 # data, but we also need the locals. We'll copy locals in the user
1613 # one, but will track what got copied so we can delete them at exit.
1621 # one, but will track what got copied so we can delete them at exit.
1614 # This is so that a later embedded call doesn't see locals from a
1622 # This is so that a later embedded call doesn't see locals from a
1615 # previous call (which most likely existed in a separate scope).
1623 # previous call (which most likely existed in a separate scope).
1616 local_varnames = local_ns.keys()
1624 local_varnames = local_ns.keys()
1617 self.user_ns.update(local_ns)
1625 self.user_ns.update(local_ns)
1618
1626
1619 # Patch for global embedding to make sure that things don't overwrite
1627 # Patch for global embedding to make sure that things don't overwrite
1620 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1628 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1621 # FIXME. Test this a bit more carefully (the if.. is new)
1629 # FIXME. Test this a bit more carefully (the if.. is new)
1622 if local_ns is None and global_ns is None:
1630 if local_ns is None and global_ns is None:
1623 self.user_global_ns.update(__main__.__dict__)
1631 self.user_global_ns.update(__main__.__dict__)
1624
1632
1625 # make sure the tab-completer has the correct frame information, so it
1633 # make sure the tab-completer has the correct frame information, so it
1626 # actually completes using the frame's locals/globals
1634 # actually completes using the frame's locals/globals
1627 self.set_completer_frame()
1635 self.set_completer_frame()
1628
1636
1629 # before activating the interactive mode, we need to make sure that
1637 # before activating the interactive mode, we need to make sure that
1630 # all names in the builtin namespace needed by ipython point to
1638 # all names in the builtin namespace needed by ipython point to
1631 # ourselves, and not to other instances.
1639 # ourselves, and not to other instances.
1632 self.add_builtins()
1640 self.add_builtins()
1633
1641
1634 self.interact(header)
1642 self.interact(header)
1635
1643
1636 # now, purge out the user namespace from anything we might have added
1644 # now, purge out the user namespace from anything we might have added
1637 # from the caller's local namespace
1645 # from the caller's local namespace
1638 delvar = self.user_ns.pop
1646 delvar = self.user_ns.pop
1639 for var in local_varnames:
1647 for var in local_varnames:
1640 delvar(var,None)
1648 delvar(var,None)
1641 # and clean builtins we may have overridden
1649 # and clean builtins we may have overridden
1642 self.clean_builtins()
1650 self.clean_builtins()
1643
1651
1644 def interact(self, banner=None):
1652 def interact(self, banner=None):
1645 """Closely emulate the interactive Python console.
1653 """Closely emulate the interactive Python console.
1646
1654
1647 The optional banner argument specify the banner to print
1655 The optional banner argument specify the banner to print
1648 before the first interaction; by default it prints a banner
1656 before the first interaction; by default it prints a banner
1649 similar to the one printed by the real Python interpreter,
1657 similar to the one printed by the real Python interpreter,
1650 followed by the current class name in parentheses (so as not
1658 followed by the current class name in parentheses (so as not
1651 to confuse this with the real interpreter -- since it's so
1659 to confuse this with the real interpreter -- since it's so
1652 close!).
1660 close!).
1653
1661
1654 """
1662 """
1655
1663
1656 if self.exit_now:
1664 if self.exit_now:
1657 # batch run -> do not interact
1665 # batch run -> do not interact
1658 return
1666 return
1659 cprt = 'Type "copyright", "credits" or "license" for more information.'
1667 cprt = 'Type "copyright", "credits" or "license" for more information.'
1660 if banner is None:
1668 if banner is None:
1661 self.write("Python %s on %s\n%s\n(%s)\n" %
1669 self.write("Python %s on %s\n%s\n(%s)\n" %
1662 (sys.version, sys.platform, cprt,
1670 (sys.version, sys.platform, cprt,
1663 self.__class__.__name__))
1671 self.__class__.__name__))
1664 else:
1672 else:
1665 self.write(banner)
1673 self.write(banner)
1666
1674
1667 more = 0
1675 more = 0
1668
1676
1669 # Mark activity in the builtins
1677 # Mark activity in the builtins
1670 __builtin__.__dict__['__IPYTHON__active'] += 1
1678 __builtin__.__dict__['__IPYTHON__active'] += 1
1671
1679
1672 if self.has_readline:
1680 if self.has_readline:
1673 self.readline_startup_hook(self.pre_readline)
1681 self.readline_startup_hook(self.pre_readline)
1674 # exit_now is set by a call to %Exit or %Quit
1682 # exit_now is set by a call to %Exit or %Quit
1675
1683
1676 while not self.exit_now:
1684 while not self.exit_now:
1677 if more:
1685 if more:
1678 try:
1686 try:
1679 prompt = self.hooks.generate_prompt(True)
1687 prompt = self.hooks.generate_prompt(True)
1680 except:
1688 except:
1681 self.showtraceback()
1689 self.showtraceback()
1682 if self.autoindent:
1690 if self.autoindent:
1683 self.rl_do_indent = True
1691 self.rl_do_indent = True
1684
1692
1685 else:
1693 else:
1686 try:
1694 try:
1687 prompt = self.hooks.generate_prompt(False)
1695 prompt = self.hooks.generate_prompt(False)
1688 except:
1696 except:
1689 self.showtraceback()
1697 self.showtraceback()
1690 try:
1698 try:
1691 line = self.raw_input(prompt,more)
1699 line = self.raw_input(prompt,more)
1692 if self.exit_now:
1700 if self.exit_now:
1693 # quick exit on sys.std[in|out] close
1701 # quick exit on sys.std[in|out] close
1694 break
1702 break
1695 if self.autoindent:
1703 if self.autoindent:
1696 self.rl_do_indent = False
1704 self.rl_do_indent = False
1697
1705
1698 except KeyboardInterrupt:
1706 except KeyboardInterrupt:
1699 #double-guard against keyboardinterrupts during kbdint handling
1707 #double-guard against keyboardinterrupts during kbdint handling
1700 try:
1708 try:
1701 self.write('\nKeyboardInterrupt\n')
1709 self.write('\nKeyboardInterrupt\n')
1702 self.resetbuffer()
1710 self.resetbuffer()
1703 # keep cache in sync with the prompt counter:
1711 # keep cache in sync with the prompt counter:
1704 self.outputcache.prompt_count -= 1
1712 self.outputcache.prompt_count -= 1
1705
1713
1706 if self.autoindent:
1714 if self.autoindent:
1707 self.indent_current_nsp = 0
1715 self.indent_current_nsp = 0
1708 more = 0
1716 more = 0
1709 except KeyboardInterrupt:
1717 except KeyboardInterrupt:
1710 pass
1718 pass
1711 except EOFError:
1719 except EOFError:
1712 if self.autoindent:
1720 if self.autoindent:
1713 self.rl_do_indent = False
1721 self.rl_do_indent = False
1714 self.readline_startup_hook(None)
1722 self.readline_startup_hook(None)
1715 self.write('\n')
1723 self.write('\n')
1716 self.exit()
1724 self.exit()
1717 except bdb.BdbQuit:
1725 except bdb.BdbQuit:
1718 warn('The Python debugger has exited with a BdbQuit exception.\n'
1726 warn('The Python debugger has exited with a BdbQuit exception.\n'
1719 'Because of how pdb handles the stack, it is impossible\n'
1727 'Because of how pdb handles the stack, it is impossible\n'
1720 'for IPython to properly format this particular exception.\n'
1728 'for IPython to properly format this particular exception.\n'
1721 'IPython will resume normal operation.')
1729 'IPython will resume normal operation.')
1722 except:
1730 except:
1723 # exceptions here are VERY RARE, but they can be triggered
1731 # exceptions here are VERY RARE, but they can be triggered
1724 # asynchronously by signal handlers, for example.
1732 # asynchronously by signal handlers, for example.
1725 self.showtraceback()
1733 self.showtraceback()
1726 else:
1734 else:
1727 more = self.push(line)
1735 more = self.push(line)
1728 if (self.SyntaxTB.last_syntax_error and
1736 if (self.SyntaxTB.last_syntax_error and
1729 self.rc.autoedit_syntax):
1737 self.rc.autoedit_syntax):
1730 self.edit_syntax_error()
1738 self.edit_syntax_error()
1731
1739
1732 # We are off again...
1740 # We are off again...
1733 __builtin__.__dict__['__IPYTHON__active'] -= 1
1741 __builtin__.__dict__['__IPYTHON__active'] -= 1
1734
1742
1735 def excepthook(self, etype, value, tb):
1743 def excepthook(self, etype, value, tb):
1736 """One more defense for GUI apps that call sys.excepthook.
1744 """One more defense for GUI apps that call sys.excepthook.
1737
1745
1738 GUI frameworks like wxPython trap exceptions and call
1746 GUI frameworks like wxPython trap exceptions and call
1739 sys.excepthook themselves. I guess this is a feature that
1747 sys.excepthook themselves. I guess this is a feature that
1740 enables them to keep running after exceptions that would
1748 enables them to keep running after exceptions that would
1741 otherwise kill their mainloop. This is a bother for IPython
1749 otherwise kill their mainloop. This is a bother for IPython
1742 which excepts to catch all of the program exceptions with a try:
1750 which excepts to catch all of the program exceptions with a try:
1743 except: statement.
1751 except: statement.
1744
1752
1745 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1753 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1746 any app directly invokes sys.excepthook, it will look to the user like
1754 any app directly invokes sys.excepthook, it will look to the user like
1747 IPython crashed. In order to work around this, we can disable the
1755 IPython crashed. In order to work around this, we can disable the
1748 CrashHandler and replace it with this excepthook instead, which prints a
1756 CrashHandler and replace it with this excepthook instead, which prints a
1749 regular traceback using our InteractiveTB. In this fashion, apps which
1757 regular traceback using our InteractiveTB. In this fashion, apps which
1750 call sys.excepthook will generate a regular-looking exception from
1758 call sys.excepthook will generate a regular-looking exception from
1751 IPython, and the CrashHandler will only be triggered by real IPython
1759 IPython, and the CrashHandler will only be triggered by real IPython
1752 crashes.
1760 crashes.
1753
1761
1754 This hook should be used sparingly, only in places which are not likely
1762 This hook should be used sparingly, only in places which are not likely
1755 to be true IPython errors.
1763 to be true IPython errors.
1756 """
1764 """
1757 self.showtraceback((etype,value,tb),tb_offset=0)
1765 self.showtraceback((etype,value,tb),tb_offset=0)
1758
1766
1759 def expand_aliases(self,fn,rest):
1767 def expand_aliases(self,fn,rest):
1760 """ Expand multiple levels of aliases:
1768 """ Expand multiple levels of aliases:
1761
1769
1762 if:
1770 if:
1763
1771
1764 alias foo bar /tmp
1772 alias foo bar /tmp
1765 alias baz foo
1773 alias baz foo
1766
1774
1767 then:
1775 then:
1768
1776
1769 baz huhhahhei -> bar /tmp huhhahhei
1777 baz huhhahhei -> bar /tmp huhhahhei
1770
1778
1771 """
1779 """
1772 line = fn + " " + rest
1780 line = fn + " " + rest
1773
1781
1774 done = Set()
1782 done = Set()
1775 while 1:
1783 while 1:
1776 pre,fn,rest = prefilter.splitUserInput(line,
1784 pre,fn,rest = prefilter.splitUserInput(line,
1777 prefilter.shell_line_split)
1785 prefilter.shell_line_split)
1778 if fn in self.alias_table:
1786 if fn in self.alias_table:
1779 if fn in done:
1787 if fn in done:
1780 warn("Cyclic alias definition, repeated '%s'" % fn)
1788 warn("Cyclic alias definition, repeated '%s'" % fn)
1781 return ""
1789 return ""
1782 done.add(fn)
1790 done.add(fn)
1783
1791
1784 l2 = self.transform_alias(fn,rest)
1792 l2 = self.transform_alias(fn,rest)
1785 # dir -> dir
1793 # dir -> dir
1786 # print "alias",line, "->",l2 #dbg
1794 # print "alias",line, "->",l2 #dbg
1787 if l2 == line:
1795 if l2 == line:
1788 break
1796 break
1789 # ls -> ls -F should not recurse forever
1797 # ls -> ls -F should not recurse forever
1790 if l2.split(None,1)[0] == line.split(None,1)[0]:
1798 if l2.split(None,1)[0] == line.split(None,1)[0]:
1791 line = l2
1799 line = l2
1792 break
1800 break
1793
1801
1794 line=l2
1802 line=l2
1795
1803
1796
1804
1797 # print "al expand to",line #dbg
1805 # print "al expand to",line #dbg
1798 else:
1806 else:
1799 break
1807 break
1800
1808
1801 return line
1809 return line
1802
1810
1803 def transform_alias(self, alias,rest=''):
1811 def transform_alias(self, alias,rest=''):
1804 """ Transform alias to system command string.
1812 """ Transform alias to system command string.
1805 """
1813 """
1806 trg = self.alias_table[alias]
1814 trg = self.alias_table[alias]
1807
1815
1808 nargs,cmd = trg
1816 nargs,cmd = trg
1809 # print trg #dbg
1817 # print trg #dbg
1810 if ' ' in cmd and os.path.isfile(cmd):
1818 if ' ' in cmd and os.path.isfile(cmd):
1811 cmd = '"%s"' % cmd
1819 cmd = '"%s"' % cmd
1812
1820
1813 # Expand the %l special to be the user's input line
1821 # Expand the %l special to be the user's input line
1814 if cmd.find('%l') >= 0:
1822 if cmd.find('%l') >= 0:
1815 cmd = cmd.replace('%l',rest)
1823 cmd = cmd.replace('%l',rest)
1816 rest = ''
1824 rest = ''
1817 if nargs==0:
1825 if nargs==0:
1818 # Simple, argument-less aliases
1826 # Simple, argument-less aliases
1819 cmd = '%s %s' % (cmd,rest)
1827 cmd = '%s %s' % (cmd,rest)
1820 else:
1828 else:
1821 # Handle aliases with positional arguments
1829 # Handle aliases with positional arguments
1822 args = rest.split(None,nargs)
1830 args = rest.split(None,nargs)
1823 if len(args)< nargs:
1831 if len(args)< nargs:
1824 error('Alias <%s> requires %s arguments, %s given.' %
1832 error('Alias <%s> requires %s arguments, %s given.' %
1825 (alias,nargs,len(args)))
1833 (alias,nargs,len(args)))
1826 return None
1834 return None
1827 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1835 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1828 # Now call the macro, evaluating in the user's namespace
1836 # Now call the macro, evaluating in the user's namespace
1829 #print 'new command: <%r>' % cmd # dbg
1837 #print 'new command: <%r>' % cmd # dbg
1830 return cmd
1838 return cmd
1831
1839
1832 def call_alias(self,alias,rest=''):
1840 def call_alias(self,alias,rest=''):
1833 """Call an alias given its name and the rest of the line.
1841 """Call an alias given its name and the rest of the line.
1834
1842
1835 This is only used to provide backwards compatibility for users of
1843 This is only used to provide backwards compatibility for users of
1836 ipalias(), use of which is not recommended for anymore."""
1844 ipalias(), use of which is not recommended for anymore."""
1837
1845
1838 # Now call the macro, evaluating in the user's namespace
1846 # Now call the macro, evaluating in the user's namespace
1839 cmd = self.transform_alias(alias, rest)
1847 cmd = self.transform_alias(alias, rest)
1840 try:
1848 try:
1841 self.system(cmd)
1849 self.system(cmd)
1842 except:
1850 except:
1843 self.showtraceback()
1851 self.showtraceback()
1844
1852
1845 def indent_current_str(self):
1853 def indent_current_str(self):
1846 """return the current level of indentation as a string"""
1854 """return the current level of indentation as a string"""
1847 return self.indent_current_nsp * ' '
1855 return self.indent_current_nsp * ' '
1848
1856
1849 def autoindent_update(self,line):
1857 def autoindent_update(self,line):
1850 """Keep track of the indent level."""
1858 """Keep track of the indent level."""
1851
1859
1852 #debugx('line')
1860 #debugx('line')
1853 #debugx('self.indent_current_nsp')
1861 #debugx('self.indent_current_nsp')
1854 if self.autoindent:
1862 if self.autoindent:
1855 if line:
1863 if line:
1856 inisp = num_ini_spaces(line)
1864 inisp = num_ini_spaces(line)
1857 if inisp < self.indent_current_nsp:
1865 if inisp < self.indent_current_nsp:
1858 self.indent_current_nsp = inisp
1866 self.indent_current_nsp = inisp
1859
1867
1860 if line[-1] == ':':
1868 if line[-1] == ':':
1861 self.indent_current_nsp += 4
1869 self.indent_current_nsp += 4
1862 elif dedent_re.match(line):
1870 elif dedent_re.match(line):
1863 self.indent_current_nsp -= 4
1871 self.indent_current_nsp -= 4
1864 else:
1872 else:
1865 self.indent_current_nsp = 0
1873 self.indent_current_nsp = 0
1866
1874
1867 def runlines(self,lines):
1875 def runlines(self,lines):
1868 """Run a string of one or more lines of source.
1876 """Run a string of one or more lines of source.
1869
1877
1870 This method is capable of running a string containing multiple source
1878 This method is capable of running a string containing multiple source
1871 lines, as if they had been entered at the IPython prompt. Since it
1879 lines, as if they had been entered at the IPython prompt. Since it
1872 exposes IPython's processing machinery, the given strings can contain
1880 exposes IPython's processing machinery, the given strings can contain
1873 magic calls (%magic), special shell access (!cmd), etc."""
1881 magic calls (%magic), special shell access (!cmd), etc."""
1874
1882
1875 # We must start with a clean buffer, in case this is run from an
1883 # We must start with a clean buffer, in case this is run from an
1876 # interactive IPython session (via a magic, for example).
1884 # interactive IPython session (via a magic, for example).
1877 self.resetbuffer()
1885 self.resetbuffer()
1878 lines = lines.split('\n')
1886 lines = lines.split('\n')
1879 more = 0
1887 more = 0
1880
1888
1881 for line in lines:
1889 for line in lines:
1882 # skip blank lines so we don't mess up the prompt counter, but do
1890 # skip blank lines so we don't mess up the prompt counter, but do
1883 # NOT skip even a blank line if we are in a code block (more is
1891 # NOT skip even a blank line if we are in a code block (more is
1884 # true)
1892 # true)
1885
1893
1886
1894
1887 if line or more:
1895 if line or more:
1888 # push to raw history, so hist line numbers stay in sync
1896 # push to raw history, so hist line numbers stay in sync
1889 self.input_hist_raw.append("# " + line + "\n")
1897 self.input_hist_raw.append("# " + line + "\n")
1890 more = self.push(self.prefilter(line,more))
1898 more = self.push(self.prefilter(line,more))
1891 # IPython's runsource returns None if there was an error
1899 # IPython's runsource returns None if there was an error
1892 # compiling the code. This allows us to stop processing right
1900 # compiling the code. This allows us to stop processing right
1893 # away, so the user gets the error message at the right place.
1901 # away, so the user gets the error message at the right place.
1894 if more is None:
1902 if more is None:
1895 break
1903 break
1896 else:
1904 else:
1897 self.input_hist_raw.append("\n")
1905 self.input_hist_raw.append("\n")
1898 # final newline in case the input didn't have it, so that the code
1906 # final newline in case the input didn't have it, so that the code
1899 # actually does get executed
1907 # actually does get executed
1900 if more:
1908 if more:
1901 self.push('\n')
1909 self.push('\n')
1902
1910
1903 def runsource(self, source, filename='<input>', symbol='single'):
1911 def runsource(self, source, filename='<input>', symbol='single'):
1904 """Compile and run some source in the interpreter.
1912 """Compile and run some source in the interpreter.
1905
1913
1906 Arguments are as for compile_command().
1914 Arguments are as for compile_command().
1907
1915
1908 One several things can happen:
1916 One several things can happen:
1909
1917
1910 1) The input is incorrect; compile_command() raised an
1918 1) The input is incorrect; compile_command() raised an
1911 exception (SyntaxError or OverflowError). A syntax traceback
1919 exception (SyntaxError or OverflowError). A syntax traceback
1912 will be printed by calling the showsyntaxerror() method.
1920 will be printed by calling the showsyntaxerror() method.
1913
1921
1914 2) The input is incomplete, and more input is required;
1922 2) The input is incomplete, and more input is required;
1915 compile_command() returned None. Nothing happens.
1923 compile_command() returned None. Nothing happens.
1916
1924
1917 3) The input is complete; compile_command() returned a code
1925 3) The input is complete; compile_command() returned a code
1918 object. The code is executed by calling self.runcode() (which
1926 object. The code is executed by calling self.runcode() (which
1919 also handles run-time exceptions, except for SystemExit).
1927 also handles run-time exceptions, except for SystemExit).
1920
1928
1921 The return value is:
1929 The return value is:
1922
1930
1923 - True in case 2
1931 - True in case 2
1924
1932
1925 - False in the other cases, unless an exception is raised, where
1933 - False in the other cases, unless an exception is raised, where
1926 None is returned instead. This can be used by external callers to
1934 None is returned instead. This can be used by external callers to
1927 know whether to continue feeding input or not.
1935 know whether to continue feeding input or not.
1928
1936
1929 The return value can be used to decide whether to use sys.ps1 or
1937 The return value can be used to decide whether to use sys.ps1 or
1930 sys.ps2 to prompt the next line."""
1938 sys.ps2 to prompt the next line."""
1931
1939
1932 # if the source code has leading blanks, add 'if 1:\n' to it
1940 # if the source code has leading blanks, add 'if 1:\n' to it
1933 # this allows execution of indented pasted code. It is tempting
1941 # this allows execution of indented pasted code. It is tempting
1934 # to add '\n' at the end of source to run commands like ' a=1'
1942 # to add '\n' at the end of source to run commands like ' a=1'
1935 # directly, but this fails for more complicated scenarios
1943 # directly, but this fails for more complicated scenarios
1936 source=source.encode(self.stdin_encoding)
1944 source=source.encode(self.stdin_encoding)
1937 if source[:1] in [' ', '\t']:
1945 if source[:1] in [' ', '\t']:
1938 source = 'if 1:\n%s' % source
1946 source = 'if 1:\n%s' % source
1939
1947
1940 try:
1948 try:
1941 code = self.compile(source,filename,symbol)
1949 code = self.compile(source,filename,symbol)
1942 except (OverflowError, SyntaxError, ValueError):
1950 except (OverflowError, SyntaxError, ValueError):
1943 # Case 1
1951 # Case 1
1944 self.showsyntaxerror(filename)
1952 self.showsyntaxerror(filename)
1945 return None
1953 return None
1946
1954
1947 if code is None:
1955 if code is None:
1948 # Case 2
1956 # Case 2
1949 return True
1957 return True
1950
1958
1951 # Case 3
1959 # Case 3
1952 # We store the code object so that threaded shells and
1960 # We store the code object so that threaded shells and
1953 # custom exception handlers can access all this info if needed.
1961 # custom exception handlers can access all this info if needed.
1954 # The source corresponding to this can be obtained from the
1962 # The source corresponding to this can be obtained from the
1955 # buffer attribute as '\n'.join(self.buffer).
1963 # buffer attribute as '\n'.join(self.buffer).
1956 self.code_to_run = code
1964 self.code_to_run = code
1957 # now actually execute the code object
1965 # now actually execute the code object
1958 if self.runcode(code) == 0:
1966 if self.runcode(code) == 0:
1959 return False
1967 return False
1960 else:
1968 else:
1961 return None
1969 return None
1962
1970
1963 def runcode(self,code_obj):
1971 def runcode(self,code_obj):
1964 """Execute a code object.
1972 """Execute a code object.
1965
1973
1966 When an exception occurs, self.showtraceback() is called to display a
1974 When an exception occurs, self.showtraceback() is called to display a
1967 traceback.
1975 traceback.
1968
1976
1969 Return value: a flag indicating whether the code to be run completed
1977 Return value: a flag indicating whether the code to be run completed
1970 successfully:
1978 successfully:
1971
1979
1972 - 0: successful execution.
1980 - 0: successful execution.
1973 - 1: an error occurred.
1981 - 1: an error occurred.
1974 """
1982 """
1975
1983
1976 # Set our own excepthook in case the user code tries to call it
1984 # Set our own excepthook in case the user code tries to call it
1977 # directly, so that the IPython crash handler doesn't get triggered
1985 # directly, so that the IPython crash handler doesn't get triggered
1978 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1986 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1979
1987
1980 # we save the original sys.excepthook in the instance, in case config
1988 # we save the original sys.excepthook in the instance, in case config
1981 # code (such as magics) needs access to it.
1989 # code (such as magics) needs access to it.
1982 self.sys_excepthook = old_excepthook
1990 self.sys_excepthook = old_excepthook
1983 outflag = 1 # happens in more places, so it's easier as default
1991 outflag = 1 # happens in more places, so it's easier as default
1984 try:
1992 try:
1985 try:
1993 try:
1986 # Embedded instances require separate global/local namespaces
1994 # Embedded instances require separate global/local namespaces
1987 # so they can see both the surrounding (local) namespace and
1995 # so they can see both the surrounding (local) namespace and
1988 # the module-level globals when called inside another function.
1996 # the module-level globals when called inside another function.
1989 if self.embedded:
1997 if self.embedded:
1990 exec code_obj in self.user_global_ns, self.user_ns
1998 exec code_obj in self.user_global_ns, self.user_ns
1991 # Normal (non-embedded) instances should only have a single
1999 # Normal (non-embedded) instances should only have a single
1992 # namespace for user code execution, otherwise functions won't
2000 # namespace for user code execution, otherwise functions won't
1993 # see interactive top-level globals.
2001 # see interactive top-level globals.
1994 else:
2002 else:
1995 exec code_obj in self.user_ns
2003 exec code_obj in self.user_ns
1996 finally:
2004 finally:
1997 # Reset our crash handler in place
2005 # Reset our crash handler in place
1998 sys.excepthook = old_excepthook
2006 sys.excepthook = old_excepthook
1999 except SystemExit:
2007 except SystemExit:
2000 self.resetbuffer()
2008 self.resetbuffer()
2001 self.showtraceback()
2009 self.showtraceback()
2002 warn("Type %exit or %quit to exit IPython "
2010 warn("Type %exit or %quit to exit IPython "
2003 "(%Exit or %Quit do so unconditionally).",level=1)
2011 "(%Exit or %Quit do so unconditionally).",level=1)
2004 except self.custom_exceptions:
2012 except self.custom_exceptions:
2005 etype,value,tb = sys.exc_info()
2013 etype,value,tb = sys.exc_info()
2006 self.CustomTB(etype,value,tb)
2014 self.CustomTB(etype,value,tb)
2007 except:
2015 except:
2008 self.showtraceback()
2016 self.showtraceback()
2009 else:
2017 else:
2010 outflag = 0
2018 outflag = 0
2011 if softspace(sys.stdout, 0):
2019 if softspace(sys.stdout, 0):
2012 print
2020 print
2013 # Flush out code object which has been run (and source)
2021 # Flush out code object which has been run (and source)
2014 self.code_to_run = None
2022 self.code_to_run = None
2015 return outflag
2023 return outflag
2016
2024
2017 def push(self, line):
2025 def push(self, line):
2018 """Push a line to the interpreter.
2026 """Push a line to the interpreter.
2019
2027
2020 The line should not have a trailing newline; it may have
2028 The line should not have a trailing newline; it may have
2021 internal newlines. The line is appended to a buffer and the
2029 internal newlines. The line is appended to a buffer and the
2022 interpreter's runsource() method is called with the
2030 interpreter's runsource() method is called with the
2023 concatenated contents of the buffer as source. If this
2031 concatenated contents of the buffer as source. If this
2024 indicates that the command was executed or invalid, the buffer
2032 indicates that the command was executed or invalid, the buffer
2025 is reset; otherwise, the command is incomplete, and the buffer
2033 is reset; otherwise, the command is incomplete, and the buffer
2026 is left as it was after the line was appended. The return
2034 is left as it was after the line was appended. The return
2027 value is 1 if more input is required, 0 if the line was dealt
2035 value is 1 if more input is required, 0 if the line was dealt
2028 with in some way (this is the same as runsource()).
2036 with in some way (this is the same as runsource()).
2029 """
2037 """
2030
2038
2031 # autoindent management should be done here, and not in the
2039 # autoindent management should be done here, and not in the
2032 # interactive loop, since that one is only seen by keyboard input. We
2040 # interactive loop, since that one is only seen by keyboard input. We
2033 # need this done correctly even for code run via runlines (which uses
2041 # need this done correctly even for code run via runlines (which uses
2034 # push).
2042 # push).
2035
2043
2036 #print 'push line: <%s>' % line # dbg
2044 #print 'push line: <%s>' % line # dbg
2037 for subline in line.splitlines():
2045 for subline in line.splitlines():
2038 self.autoindent_update(subline)
2046 self.autoindent_update(subline)
2039 self.buffer.append(line)
2047 self.buffer.append(line)
2040 more = self.runsource('\n'.join(self.buffer), self.filename)
2048 more = self.runsource('\n'.join(self.buffer), self.filename)
2041 if not more:
2049 if not more:
2042 self.resetbuffer()
2050 self.resetbuffer()
2043 return more
2051 return more
2044
2052
2045 def split_user_input(self, line):
2053 def split_user_input(self, line):
2046 # This is really a hold-over to support ipapi and some extensions
2054 # This is really a hold-over to support ipapi and some extensions
2047 return prefilter.splitUserInput(line)
2055 return prefilter.splitUserInput(line)
2048
2056
2049 def resetbuffer(self):
2057 def resetbuffer(self):
2050 """Reset the input buffer."""
2058 """Reset the input buffer."""
2051 self.buffer[:] = []
2059 self.buffer[:] = []
2052
2060
2053 def raw_input(self,prompt='',continue_prompt=False):
2061 def raw_input(self,prompt='',continue_prompt=False):
2054 """Write a prompt and read a line.
2062 """Write a prompt and read a line.
2055
2063
2056 The returned line does not include the trailing newline.
2064 The returned line does not include the trailing newline.
2057 When the user enters the EOF key sequence, EOFError is raised.
2065 When the user enters the EOF key sequence, EOFError is raised.
2058
2066
2059 Optional inputs:
2067 Optional inputs:
2060
2068
2061 - prompt(''): a string to be printed to prompt the user.
2069 - prompt(''): a string to be printed to prompt the user.
2062
2070
2063 - continue_prompt(False): whether this line is the first one or a
2071 - continue_prompt(False): whether this line is the first one or a
2064 continuation in a sequence of inputs.
2072 continuation in a sequence of inputs.
2065 """
2073 """
2066
2074
2067 # Code run by the user may have modified the readline completer state.
2075 # Code run by the user may have modified the readline completer state.
2068 # We must ensure that our completer is back in place.
2076 # We must ensure that our completer is back in place.
2069 if self.has_readline:
2077 if self.has_readline:
2070 self.set_completer()
2078 self.set_completer()
2071
2079
2072 try:
2080 try:
2073 line = raw_input_original(prompt).decode(self.stdin_encoding)
2081 line = raw_input_original(prompt).decode(self.stdin_encoding)
2074 except ValueError:
2082 except ValueError:
2075 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2083 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2076 " or sys.stdout.close()!\nExiting IPython!")
2084 " or sys.stdout.close()!\nExiting IPython!")
2077 self.exit_now = True
2085 self.exit_now = True
2078 return ""
2086 return ""
2079
2087
2080 # Try to be reasonably smart about not re-indenting pasted input more
2088 # Try to be reasonably smart about not re-indenting pasted input more
2081 # than necessary. We do this by trimming out the auto-indent initial
2089 # than necessary. We do this by trimming out the auto-indent initial
2082 # spaces, if the user's actual input started itself with whitespace.
2090 # spaces, if the user's actual input started itself with whitespace.
2083 #debugx('self.buffer[-1]')
2091 #debugx('self.buffer[-1]')
2084
2092
2085 if self.autoindent:
2093 if self.autoindent:
2086 if num_ini_spaces(line) > self.indent_current_nsp:
2094 if num_ini_spaces(line) > self.indent_current_nsp:
2087 line = line[self.indent_current_nsp:]
2095 line = line[self.indent_current_nsp:]
2088 self.indent_current_nsp = 0
2096 self.indent_current_nsp = 0
2089
2097
2090 # store the unfiltered input before the user has any chance to modify
2098 # store the unfiltered input before the user has any chance to modify
2091 # it.
2099 # it.
2092 if line.strip():
2100 if line.strip():
2093 if continue_prompt:
2101 if continue_prompt:
2094 self.input_hist_raw[-1] += '%s\n' % line
2102 self.input_hist_raw[-1] += '%s\n' % line
2095 if self.has_readline: # and some config option is set?
2103 if self.has_readline: # and some config option is set?
2096 try:
2104 try:
2097 histlen = self.readline.get_current_history_length()
2105 histlen = self.readline.get_current_history_length()
2098 if histlen > 1:
2106 if histlen > 1:
2099 newhist = self.input_hist_raw[-1].rstrip()
2107 newhist = self.input_hist_raw[-1].rstrip()
2100 self.readline.remove_history_item(histlen-1)
2108 self.readline.remove_history_item(histlen-1)
2101 self.readline.replace_history_item(histlen-2,
2109 self.readline.replace_history_item(histlen-2,
2102 newhist.encode(self.stdin_encoding))
2110 newhist.encode(self.stdin_encoding))
2103 except AttributeError:
2111 except AttributeError:
2104 pass # re{move,place}_history_item are new in 2.4.
2112 pass # re{move,place}_history_item are new in 2.4.
2105 else:
2113 else:
2106 self.input_hist_raw.append('%s\n' % line)
2114 self.input_hist_raw.append('%s\n' % line)
2107 # only entries starting at first column go to shadow history
2115 # only entries starting at first column go to shadow history
2108 if line.lstrip() == line:
2116 if line.lstrip() == line:
2109 self.shadowhist.add(line.strip())
2117 self.shadowhist.add(line.strip())
2110 elif not continue_prompt:
2118 elif not continue_prompt:
2111 self.input_hist_raw.append('\n')
2119 self.input_hist_raw.append('\n')
2112 try:
2120 try:
2113 lineout = self.prefilter(line,continue_prompt)
2121 lineout = self.prefilter(line,continue_prompt)
2114 except:
2122 except:
2115 # blanket except, in case a user-defined prefilter crashes, so it
2123 # blanket except, in case a user-defined prefilter crashes, so it
2116 # can't take all of ipython with it.
2124 # can't take all of ipython with it.
2117 self.showtraceback()
2125 self.showtraceback()
2118 return ''
2126 return ''
2119 else:
2127 else:
2120 return lineout
2128 return lineout
2121
2129
2122 def _prefilter(self, line, continue_prompt):
2130 def _prefilter(self, line, continue_prompt):
2123 """Calls different preprocessors, depending on the form of line."""
2131 """Calls different preprocessors, depending on the form of line."""
2124
2132
2125 # All handlers *must* return a value, even if it's blank ('').
2133 # All handlers *must* return a value, even if it's blank ('').
2126
2134
2127 # Lines are NOT logged here. Handlers should process the line as
2135 # Lines are NOT logged here. Handlers should process the line as
2128 # needed, update the cache AND log it (so that the input cache array
2136 # needed, update the cache AND log it (so that the input cache array
2129 # stays synced).
2137 # stays synced).
2130
2138
2131 #.....................................................................
2139 #.....................................................................
2132 # Code begins
2140 # Code begins
2133
2141
2134 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2142 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2135
2143
2136 # save the line away in case we crash, so the post-mortem handler can
2144 # save the line away in case we crash, so the post-mortem handler can
2137 # record it
2145 # record it
2138 self._last_input_line = line
2146 self._last_input_line = line
2139
2147
2140 #print '***line: <%s>' % line # dbg
2148 #print '***line: <%s>' % line # dbg
2141
2149
2142 if not line:
2150 if not line:
2143 # Return immediately on purely empty lines, so that if the user
2151 # Return immediately on purely empty lines, so that if the user
2144 # previously typed some whitespace that started a continuation
2152 # previously typed some whitespace that started a continuation
2145 # prompt, he can break out of that loop with just an empty line.
2153 # prompt, he can break out of that loop with just an empty line.
2146 # This is how the default python prompt works.
2154 # This is how the default python prompt works.
2147
2155
2148 # Only return if the accumulated input buffer was just whitespace!
2156 # Only return if the accumulated input buffer was just whitespace!
2149 if ''.join(self.buffer).isspace():
2157 if ''.join(self.buffer).isspace():
2150 self.buffer[:] = []
2158 self.buffer[:] = []
2151 return ''
2159 return ''
2152
2160
2153 line_info = prefilter.LineInfo(line, continue_prompt)
2161 line_info = prefilter.LineInfo(line, continue_prompt)
2154
2162
2155 # the input history needs to track even empty lines
2163 # the input history needs to track even empty lines
2156 stripped = line.strip()
2164 stripped = line.strip()
2157
2165
2158 if not stripped:
2166 if not stripped:
2159 if not continue_prompt:
2167 if not continue_prompt:
2160 self.outputcache.prompt_count -= 1
2168 self.outputcache.prompt_count -= 1
2161 return self.handle_normal(line_info)
2169 return self.handle_normal(line_info)
2162
2170
2163 # print '***cont',continue_prompt # dbg
2171 # print '***cont',continue_prompt # dbg
2164 # special handlers are only allowed for single line statements
2172 # special handlers are only allowed for single line statements
2165 if continue_prompt and not self.rc.multi_line_specials:
2173 if continue_prompt and not self.rc.multi_line_specials:
2166 return self.handle_normal(line_info)
2174 return self.handle_normal(line_info)
2167
2175
2168
2176
2169 # See whether any pre-existing handler can take care of it
2177 # See whether any pre-existing handler can take care of it
2170 rewritten = self.hooks.input_prefilter(stripped)
2178 rewritten = self.hooks.input_prefilter(stripped)
2171 if rewritten != stripped: # ok, some prefilter did something
2179 if rewritten != stripped: # ok, some prefilter did something
2172 rewritten = line_info.pre + rewritten # add indentation
2180 rewritten = line_info.pre + rewritten # add indentation
2173 return self.handle_normal(prefilter.LineInfo(rewritten,
2181 return self.handle_normal(prefilter.LineInfo(rewritten,
2174 continue_prompt))
2182 continue_prompt))
2175
2183
2176 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2184 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2177
2185
2178 return prefilter.prefilter(line_info, self)
2186 return prefilter.prefilter(line_info, self)
2179
2187
2180
2188
2181 def _prefilter_dumb(self, line, continue_prompt):
2189 def _prefilter_dumb(self, line, continue_prompt):
2182 """simple prefilter function, for debugging"""
2190 """simple prefilter function, for debugging"""
2183 return self.handle_normal(line,continue_prompt)
2191 return self.handle_normal(line,continue_prompt)
2184
2192
2185
2193
2186 def multiline_prefilter(self, line, continue_prompt):
2194 def multiline_prefilter(self, line, continue_prompt):
2187 """ Run _prefilter for each line of input
2195 """ Run _prefilter for each line of input
2188
2196
2189 Covers cases where there are multiple lines in the user entry,
2197 Covers cases where there are multiple lines in the user entry,
2190 which is the case when the user goes back to a multiline history
2198 which is the case when the user goes back to a multiline history
2191 entry and presses enter.
2199 entry and presses enter.
2192
2200
2193 """
2201 """
2194 out = []
2202 out = []
2195 for l in line.rstrip('\n').split('\n'):
2203 for l in line.rstrip('\n').split('\n'):
2196 out.append(self._prefilter(l, continue_prompt))
2204 out.append(self._prefilter(l, continue_prompt))
2197 return '\n'.join(out)
2205 return '\n'.join(out)
2198
2206
2199 # Set the default prefilter() function (this can be user-overridden)
2207 # Set the default prefilter() function (this can be user-overridden)
2200 prefilter = multiline_prefilter
2208 prefilter = multiline_prefilter
2201
2209
2202 def handle_normal(self,line_info):
2210 def handle_normal(self,line_info):
2203 """Handle normal input lines. Use as a template for handlers."""
2211 """Handle normal input lines. Use as a template for handlers."""
2204
2212
2205 # With autoindent on, we need some way to exit the input loop, and I
2213 # With autoindent on, we need some way to exit the input loop, and I
2206 # don't want to force the user to have to backspace all the way to
2214 # don't want to force the user to have to backspace all the way to
2207 # clear the line. The rule will be in this case, that either two
2215 # clear the line. The rule will be in this case, that either two
2208 # lines of pure whitespace in a row, or a line of pure whitespace but
2216 # lines of pure whitespace in a row, or a line of pure whitespace but
2209 # of a size different to the indent level, will exit the input loop.
2217 # of a size different to the indent level, will exit the input loop.
2210 line = line_info.line
2218 line = line_info.line
2211 continue_prompt = line_info.continue_prompt
2219 continue_prompt = line_info.continue_prompt
2212
2220
2213 if (continue_prompt and self.autoindent and line.isspace() and
2221 if (continue_prompt and self.autoindent and line.isspace() and
2214 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2222 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2215 (self.buffer[-1]).isspace() )):
2223 (self.buffer[-1]).isspace() )):
2216 line = ''
2224 line = ''
2217
2225
2218 self.log(line,line,continue_prompt)
2226 self.log(line,line,continue_prompt)
2219 return line
2227 return line
2220
2228
2221 def handle_alias(self,line_info):
2229 def handle_alias(self,line_info):
2222 """Handle alias input lines. """
2230 """Handle alias input lines. """
2223 tgt = self.alias_table[line_info.iFun]
2231 tgt = self.alias_table[line_info.iFun]
2224 # print "=>",tgt #dbg
2232 # print "=>",tgt #dbg
2225 if callable(tgt):
2233 if callable(tgt):
2226 if '$' in line_info.line:
2234 if '$' in line_info.line:
2227 call_meth = '(_ip, _ip.itpl(%s))'
2235 call_meth = '(_ip, _ip.itpl(%s))'
2228 else:
2236 else:
2229 call_meth = '(_ip,%s)'
2237 call_meth = '(_ip,%s)'
2230 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2238 line_out = ("%s_sh.%s" + call_meth) % (line_info.preWhitespace,
2231 line_info.iFun,
2239 line_info.iFun,
2232 make_quoted_expr(line_info.line))
2240 make_quoted_expr(line_info.line))
2233 else:
2241 else:
2234 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2242 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2235
2243
2236 # pre is needed, because it carries the leading whitespace. Otherwise
2244 # pre is needed, because it carries the leading whitespace. Otherwise
2237 # aliases won't work in indented sections.
2245 # aliases won't work in indented sections.
2238 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2246 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2239 make_quoted_expr( transformed ))
2247 make_quoted_expr( transformed ))
2240
2248
2241 self.log(line_info.line,line_out,line_info.continue_prompt)
2249 self.log(line_info.line,line_out,line_info.continue_prompt)
2242 #print 'line out:',line_out # dbg
2250 #print 'line out:',line_out # dbg
2243 return line_out
2251 return line_out
2244
2252
2245 def handle_shell_escape(self, line_info):
2253 def handle_shell_escape(self, line_info):
2246 """Execute the line in a shell, empty return value"""
2254 """Execute the line in a shell, empty return value"""
2247 #print 'line in :', `line` # dbg
2255 #print 'line in :', `line` # dbg
2248 line = line_info.line
2256 line = line_info.line
2249 if line.lstrip().startswith('!!'):
2257 if line.lstrip().startswith('!!'):
2250 # rewrite LineInfo's line, iFun and theRest to properly hold the
2258 # rewrite LineInfo's line, iFun and theRest to properly hold the
2251 # call to %sx and the actual command to be executed, so
2259 # call to %sx and the actual command to be executed, so
2252 # handle_magic can work correctly. Note that this works even if
2260 # handle_magic can work correctly. Note that this works even if
2253 # the line is indented, so it handles multi_line_specials
2261 # the line is indented, so it handles multi_line_specials
2254 # properly.
2262 # properly.
2255 new_rest = line.lstrip()[2:]
2263 new_rest = line.lstrip()[2:]
2256 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2264 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2257 line_info.iFun = 'sx'
2265 line_info.iFun = 'sx'
2258 line_info.theRest = new_rest
2266 line_info.theRest = new_rest
2259 return self.handle_magic(line_info)
2267 return self.handle_magic(line_info)
2260 else:
2268 else:
2261 cmd = line.lstrip().lstrip('!')
2269 cmd = line.lstrip().lstrip('!')
2262 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2270 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2263 make_quoted_expr(cmd))
2271 make_quoted_expr(cmd))
2264 # update cache/log and return
2272 # update cache/log and return
2265 self.log(line,line_out,line_info.continue_prompt)
2273 self.log(line,line_out,line_info.continue_prompt)
2266 return line_out
2274 return line_out
2267
2275
2268 def handle_magic(self, line_info):
2276 def handle_magic(self, line_info):
2269 """Execute magic functions."""
2277 """Execute magic functions."""
2270 iFun = line_info.iFun
2278 iFun = line_info.iFun
2271 theRest = line_info.theRest
2279 theRest = line_info.theRest
2272 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2280 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2273 make_quoted_expr(iFun + " " + theRest))
2281 make_quoted_expr(iFun + " " + theRest))
2274 self.log(line_info.line,cmd,line_info.continue_prompt)
2282 self.log(line_info.line,cmd,line_info.continue_prompt)
2275 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2283 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2276 return cmd
2284 return cmd
2277
2285
2278 def handle_auto(self, line_info):
2286 def handle_auto(self, line_info):
2279 """Hande lines which can be auto-executed, quoting if requested."""
2287 """Hande lines which can be auto-executed, quoting if requested."""
2280
2288
2281 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2289 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2282 line = line_info.line
2290 line = line_info.line
2283 iFun = line_info.iFun
2291 iFun = line_info.iFun
2284 theRest = line_info.theRest
2292 theRest = line_info.theRest
2285 pre = line_info.pre
2293 pre = line_info.pre
2286 continue_prompt = line_info.continue_prompt
2294 continue_prompt = line_info.continue_prompt
2287 obj = line_info.ofind(self)['obj']
2295 obj = line_info.ofind(self)['obj']
2288
2296
2289 # This should only be active for single-line input!
2297 # This should only be active for single-line input!
2290 if continue_prompt:
2298 if continue_prompt:
2291 self.log(line,line,continue_prompt)
2299 self.log(line,line,continue_prompt)
2292 return line
2300 return line
2293
2301
2294 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2302 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2295 auto_rewrite = True
2303 auto_rewrite = True
2296
2304
2297 if pre == self.ESC_QUOTE:
2305 if pre == self.ESC_QUOTE:
2298 # Auto-quote splitting on whitespace
2306 # Auto-quote splitting on whitespace
2299 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2307 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2300 elif pre == self.ESC_QUOTE2:
2308 elif pre == self.ESC_QUOTE2:
2301 # Auto-quote whole string
2309 # Auto-quote whole string
2302 newcmd = '%s("%s")' % (iFun,theRest)
2310 newcmd = '%s("%s")' % (iFun,theRest)
2303 elif pre == self.ESC_PAREN:
2311 elif pre == self.ESC_PAREN:
2304 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2312 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2305 else:
2313 else:
2306 # Auto-paren.
2314 # Auto-paren.
2307 # We only apply it to argument-less calls if the autocall
2315 # We only apply it to argument-less calls if the autocall
2308 # parameter is set to 2. We only need to check that autocall is <
2316 # parameter is set to 2. We only need to check that autocall is <
2309 # 2, since this function isn't called unless it's at least 1.
2317 # 2, since this function isn't called unless it's at least 1.
2310 if not theRest and (self.rc.autocall < 2) and not force_auto:
2318 if not theRest and (self.rc.autocall < 2) and not force_auto:
2311 newcmd = '%s %s' % (iFun,theRest)
2319 newcmd = '%s %s' % (iFun,theRest)
2312 auto_rewrite = False
2320 auto_rewrite = False
2313 else:
2321 else:
2314 if not force_auto and theRest.startswith('['):
2322 if not force_auto and theRest.startswith('['):
2315 if hasattr(obj,'__getitem__'):
2323 if hasattr(obj,'__getitem__'):
2316 # Don't autocall in this case: item access for an object
2324 # Don't autocall in this case: item access for an object
2317 # which is BOTH callable and implements __getitem__.
2325 # which is BOTH callable and implements __getitem__.
2318 newcmd = '%s %s' % (iFun,theRest)
2326 newcmd = '%s %s' % (iFun,theRest)
2319 auto_rewrite = False
2327 auto_rewrite = False
2320 else:
2328 else:
2321 # if the object doesn't support [] access, go ahead and
2329 # if the object doesn't support [] access, go ahead and
2322 # autocall
2330 # autocall
2323 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2331 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2324 elif theRest.endswith(';'):
2332 elif theRest.endswith(';'):
2325 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2333 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2326 else:
2334 else:
2327 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2335 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2328
2336
2329 if auto_rewrite:
2337 if auto_rewrite:
2330 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2338 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2331
2339
2332 try:
2340 try:
2333 # plain ascii works better w/ pyreadline, on some machines, so
2341 # plain ascii works better w/ pyreadline, on some machines, so
2334 # we use it and only print uncolored rewrite if we have unicode
2342 # we use it and only print uncolored rewrite if we have unicode
2335 rw = str(rw)
2343 rw = str(rw)
2336 print >>Term.cout, rw
2344 print >>Term.cout, rw
2337 except UnicodeEncodeError:
2345 except UnicodeEncodeError:
2338 print "-------------->" + newcmd
2346 print "-------------->" + newcmd
2339
2347
2340 # log what is now valid Python, not the actual user input (without the
2348 # log what is now valid Python, not the actual user input (without the
2341 # final newline)
2349 # final newline)
2342 self.log(line,newcmd,continue_prompt)
2350 self.log(line,newcmd,continue_prompt)
2343 return newcmd
2351 return newcmd
2344
2352
2345 def handle_help(self, line_info):
2353 def handle_help(self, line_info):
2346 """Try to get some help for the object.
2354 """Try to get some help for the object.
2347
2355
2348 obj? or ?obj -> basic information.
2356 obj? or ?obj -> basic information.
2349 obj?? or ??obj -> more details.
2357 obj?? or ??obj -> more details.
2350 """
2358 """
2351
2359
2352 line = line_info.line
2360 line = line_info.line
2353 # We need to make sure that we don't process lines which would be
2361 # We need to make sure that we don't process lines which would be
2354 # otherwise valid python, such as "x=1 # what?"
2362 # otherwise valid python, such as "x=1 # what?"
2355 try:
2363 try:
2356 codeop.compile_command(line)
2364 codeop.compile_command(line)
2357 except SyntaxError:
2365 except SyntaxError:
2358 # We should only handle as help stuff which is NOT valid syntax
2366 # We should only handle as help stuff which is NOT valid syntax
2359 if line[0]==self.ESC_HELP:
2367 if line[0]==self.ESC_HELP:
2360 line = line[1:]
2368 line = line[1:]
2361 elif line[-1]==self.ESC_HELP:
2369 elif line[-1]==self.ESC_HELP:
2362 line = line[:-1]
2370 line = line[:-1]
2363 self.log(line,'#?'+line,line_info.continue_prompt)
2371 self.log(line,'#?'+line,line_info.continue_prompt)
2364 if line:
2372 if line:
2365 #print 'line:<%r>' % line # dbg
2373 #print 'line:<%r>' % line # dbg
2366 self.magic_pinfo(line)
2374 self.magic_pinfo(line)
2367 else:
2375 else:
2368 page(self.usage,screen_lines=self.rc.screen_length)
2376 page(self.usage,screen_lines=self.rc.screen_length)
2369 return '' # Empty string is needed here!
2377 return '' # Empty string is needed here!
2370 except:
2378 except:
2371 # Pass any other exceptions through to the normal handler
2379 # Pass any other exceptions through to the normal handler
2372 return self.handle_normal(line_info)
2380 return self.handle_normal(line_info)
2373 else:
2381 else:
2374 # If the code compiles ok, we should handle it normally
2382 # If the code compiles ok, we should handle it normally
2375 return self.handle_normal(line_info)
2383 return self.handle_normal(line_info)
2376
2384
2377 def getapi(self):
2385 def getapi(self):
2378 """ Get an IPApi object for this shell instance
2386 """ Get an IPApi object for this shell instance
2379
2387
2380 Getting an IPApi object is always preferable to accessing the shell
2388 Getting an IPApi object is always preferable to accessing the shell
2381 directly, but this holds true especially for extensions.
2389 directly, but this holds true especially for extensions.
2382
2390
2383 It should always be possible to implement an extension with IPApi
2391 It should always be possible to implement an extension with IPApi
2384 alone. If not, contact maintainer to request an addition.
2392 alone. If not, contact maintainer to request an addition.
2385
2393
2386 """
2394 """
2387 return self.api
2395 return self.api
2388
2396
2389 def handle_emacs(self, line_info):
2397 def handle_emacs(self, line_info):
2390 """Handle input lines marked by python-mode."""
2398 """Handle input lines marked by python-mode."""
2391
2399
2392 # Currently, nothing is done. Later more functionality can be added
2400 # Currently, nothing is done. Later more functionality can be added
2393 # here if needed.
2401 # here if needed.
2394
2402
2395 # The input cache shouldn't be updated
2403 # The input cache shouldn't be updated
2396 return line_info.line
2404 return line_info.line
2397
2405
2398
2406
2399 def mktempfile(self,data=None):
2407 def mktempfile(self,data=None):
2400 """Make a new tempfile and return its filename.
2408 """Make a new tempfile and return its filename.
2401
2409
2402 This makes a call to tempfile.mktemp, but it registers the created
2410 This makes a call to tempfile.mktemp, but it registers the created
2403 filename internally so ipython cleans it up at exit time.
2411 filename internally so ipython cleans it up at exit time.
2404
2412
2405 Optional inputs:
2413 Optional inputs:
2406
2414
2407 - data(None): if data is given, it gets written out to the temp file
2415 - data(None): if data is given, it gets written out to the temp file
2408 immediately, and the file is closed again."""
2416 immediately, and the file is closed again."""
2409
2417
2410 filename = tempfile.mktemp('.py','ipython_edit_')
2418 filename = tempfile.mktemp('.py','ipython_edit_')
2411 self.tempfiles.append(filename)
2419 self.tempfiles.append(filename)
2412
2420
2413 if data:
2421 if data:
2414 tmp_file = open(filename,'w')
2422 tmp_file = open(filename,'w')
2415 tmp_file.write(data)
2423 tmp_file.write(data)
2416 tmp_file.close()
2424 tmp_file.close()
2417 return filename
2425 return filename
2418
2426
2419 def write(self,data):
2427 def write(self,data):
2420 """Write a string to the default output"""
2428 """Write a string to the default output"""
2421 Term.cout.write(data)
2429 Term.cout.write(data)
2422
2430
2423 def write_err(self,data):
2431 def write_err(self,data):
2424 """Write a string to the default error output"""
2432 """Write a string to the default error output"""
2425 Term.cerr.write(data)
2433 Term.cerr.write(data)
2426
2434
2427 def exit(self):
2435 def exit(self):
2428 """Handle interactive exit.
2436 """Handle interactive exit.
2429
2437
2430 This method sets the exit_now attribute."""
2438 This method sets the exit_now attribute."""
2431
2439
2432 if self.rc.confirm_exit:
2440 if self.rc.confirm_exit:
2433 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2441 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2434 self.exit_now = True
2442 self.exit_now = True
2435 else:
2443 else:
2436 self.exit_now = True
2444 self.exit_now = True
2437
2445
2438 def safe_execfile(self,fname,*where,**kw):
2446 def safe_execfile(self,fname,*where,**kw):
2439 """A safe version of the builtin execfile().
2447 """A safe version of the builtin execfile().
2440
2448
2441 This version will never throw an exception, and knows how to handle
2449 This version will never throw an exception, and knows how to handle
2442 ipython logs as well.
2450 ipython logs as well.
2443
2451
2444 :Parameters:
2452 :Parameters:
2445 fname : string
2453 fname : string
2446 Name of the file to be executed.
2454 Name of the file to be executed.
2447
2455
2448 where : tuple
2456 where : tuple
2449 One or two namespaces, passed to execfile() as (globals,locals).
2457 One or two namespaces, passed to execfile() as (globals,locals).
2450 If only one is given, it is passed as both.
2458 If only one is given, it is passed as both.
2451
2459
2452 :Keywords:
2460 :Keywords:
2453 islog : boolean (False)
2461 islog : boolean (False)
2454
2462
2455 quiet : boolean (True)
2463 quiet : boolean (True)
2456
2464
2457 exit_ignore : boolean (False)
2465 exit_ignore : boolean (False)
2458 """
2466 """
2459
2467
2460 def syspath_cleanup():
2468 def syspath_cleanup():
2461 """Internal cleanup routine for sys.path."""
2469 """Internal cleanup routine for sys.path."""
2462 if add_dname:
2470 if add_dname:
2463 try:
2471 try:
2464 sys.path.remove(dname)
2472 sys.path.remove(dname)
2465 except ValueError:
2473 except ValueError:
2466 # For some reason the user has already removed it, ignore.
2474 # For some reason the user has already removed it, ignore.
2467 pass
2475 pass
2468
2476
2469 fname = os.path.expanduser(fname)
2477 fname = os.path.expanduser(fname)
2470
2478
2471 # Find things also in current directory. This is needed to mimic the
2479 # Find things also in current directory. This is needed to mimic the
2472 # behavior of running a script from the system command line, where
2480 # behavior of running a script from the system command line, where
2473 # Python inserts the script's directory into sys.path
2481 # Python inserts the script's directory into sys.path
2474 dname = os.path.dirname(os.path.abspath(fname))
2482 dname = os.path.dirname(os.path.abspath(fname))
2475 add_dname = False
2483 add_dname = False
2476 if dname not in sys.path:
2484 if dname not in sys.path:
2477 sys.path.insert(0,dname)
2485 sys.path.insert(0,dname)
2478 add_dname = True
2486 add_dname = True
2479
2487
2480 try:
2488 try:
2481 xfile = open(fname)
2489 xfile = open(fname)
2482 except:
2490 except:
2483 print >> Term.cerr, \
2491 print >> Term.cerr, \
2484 'Could not open file <%s> for safe execution.' % fname
2492 'Could not open file <%s> for safe execution.' % fname
2485 syspath_cleanup()
2493 syspath_cleanup()
2486 return None
2494 return None
2487
2495
2488 kw.setdefault('islog',0)
2496 kw.setdefault('islog',0)
2489 kw.setdefault('quiet',1)
2497 kw.setdefault('quiet',1)
2490 kw.setdefault('exit_ignore',0)
2498 kw.setdefault('exit_ignore',0)
2491
2499
2492 first = xfile.readline()
2500 first = xfile.readline()
2493 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2501 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2494 xfile.close()
2502 xfile.close()
2495 # line by line execution
2503 # line by line execution
2496 if first.startswith(loghead) or kw['islog']:
2504 if first.startswith(loghead) or kw['islog']:
2497 print 'Loading log file <%s> one line at a time...' % fname
2505 print 'Loading log file <%s> one line at a time...' % fname
2498 if kw['quiet']:
2506 if kw['quiet']:
2499 stdout_save = sys.stdout
2507 stdout_save = sys.stdout
2500 sys.stdout = StringIO.StringIO()
2508 sys.stdout = StringIO.StringIO()
2501 try:
2509 try:
2502 globs,locs = where[0:2]
2510 globs,locs = where[0:2]
2503 except:
2511 except:
2504 try:
2512 try:
2505 globs = locs = where[0]
2513 globs = locs = where[0]
2506 except:
2514 except:
2507 globs = locs = globals()
2515 globs = locs = globals()
2508 badblocks = []
2516 badblocks = []
2509
2517
2510 # we also need to identify indented blocks of code when replaying
2518 # we also need to identify indented blocks of code when replaying
2511 # logs and put them together before passing them to an exec
2519 # logs and put them together before passing them to an exec
2512 # statement. This takes a bit of regexp and look-ahead work in the
2520 # statement. This takes a bit of regexp and look-ahead work in the
2513 # file. It's easiest if we swallow the whole thing in memory
2521 # file. It's easiest if we swallow the whole thing in memory
2514 # first, and manually walk through the lines list moving the
2522 # first, and manually walk through the lines list moving the
2515 # counter ourselves.
2523 # counter ourselves.
2516 indent_re = re.compile('\s+\S')
2524 indent_re = re.compile('\s+\S')
2517 xfile = open(fname)
2525 xfile = open(fname)
2518 filelines = xfile.readlines()
2526 filelines = xfile.readlines()
2519 xfile.close()
2527 xfile.close()
2520 nlines = len(filelines)
2528 nlines = len(filelines)
2521 lnum = 0
2529 lnum = 0
2522 while lnum < nlines:
2530 while lnum < nlines:
2523 line = filelines[lnum]
2531 line = filelines[lnum]
2524 lnum += 1
2532 lnum += 1
2525 # don't re-insert logger status info into cache
2533 # don't re-insert logger status info into cache
2526 if line.startswith('#log#'):
2534 if line.startswith('#log#'):
2527 continue
2535 continue
2528 else:
2536 else:
2529 # build a block of code (maybe a single line) for execution
2537 # build a block of code (maybe a single line) for execution
2530 block = line
2538 block = line
2531 try:
2539 try:
2532 next = filelines[lnum] # lnum has already incremented
2540 next = filelines[lnum] # lnum has already incremented
2533 except:
2541 except:
2534 next = None
2542 next = None
2535 while next and indent_re.match(next):
2543 while next and indent_re.match(next):
2536 block += next
2544 block += next
2537 lnum += 1
2545 lnum += 1
2538 try:
2546 try:
2539 next = filelines[lnum]
2547 next = filelines[lnum]
2540 except:
2548 except:
2541 next = None
2549 next = None
2542 # now execute the block of one or more lines
2550 # now execute the block of one or more lines
2543 try:
2551 try:
2544 exec block in globs,locs
2552 exec block in globs,locs
2545 except SystemExit:
2553 except SystemExit:
2546 pass
2554 pass
2547 except:
2555 except:
2548 badblocks.append(block.rstrip())
2556 badblocks.append(block.rstrip())
2549 if kw['quiet']: # restore stdout
2557 if kw['quiet']: # restore stdout
2550 sys.stdout.close()
2558 sys.stdout.close()
2551 sys.stdout = stdout_save
2559 sys.stdout = stdout_save
2552 print 'Finished replaying log file <%s>' % fname
2560 print 'Finished replaying log file <%s>' % fname
2553 if badblocks:
2561 if badblocks:
2554 print >> sys.stderr, ('\nThe following lines/blocks in file '
2562 print >> sys.stderr, ('\nThe following lines/blocks in file '
2555 '<%s> reported errors:' % fname)
2563 '<%s> reported errors:' % fname)
2556
2564
2557 for badline in badblocks:
2565 for badline in badblocks:
2558 print >> sys.stderr, badline
2566 print >> sys.stderr, badline
2559 else: # regular file execution
2567 else: # regular file execution
2560 try:
2568 try:
2561 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2569 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2562 # Work around a bug in Python for Windows. The bug was
2570 # Work around a bug in Python for Windows. The bug was
2563 # fixed in in Python 2.5 r54159 and 54158, but that's still
2571 # fixed in in Python 2.5 r54159 and 54158, but that's still
2564 # SVN Python as of March/07. For details, see:
2572 # SVN Python as of March/07. For details, see:
2565 # http://projects.scipy.org/ipython/ipython/ticket/123
2573 # http://projects.scipy.org/ipython/ipython/ticket/123
2566 try:
2574 try:
2567 globs,locs = where[0:2]
2575 globs,locs = where[0:2]
2568 except:
2576 except:
2569 try:
2577 try:
2570 globs = locs = where[0]
2578 globs = locs = where[0]
2571 except:
2579 except:
2572 globs = locs = globals()
2580 globs = locs = globals()
2573 exec file(fname) in globs,locs
2581 exec file(fname) in globs,locs
2574 else:
2582 else:
2575 execfile(fname,*where)
2583 execfile(fname,*where)
2576 except SyntaxError:
2584 except SyntaxError:
2577 self.showsyntaxerror()
2585 self.showsyntaxerror()
2578 warn('Failure executing file: <%s>' % fname)
2586 warn('Failure executing file: <%s>' % fname)
2579 except SystemExit,status:
2587 except SystemExit,status:
2580 # Code that correctly sets the exit status flag to success (0)
2588 # Code that correctly sets the exit status flag to success (0)
2581 # shouldn't be bothered with a traceback. Note that a plain
2589 # shouldn't be bothered with a traceback. Note that a plain
2582 # sys.exit() does NOT set the message to 0 (it's empty) so that
2590 # sys.exit() does NOT set the message to 0 (it's empty) so that
2583 # will still get a traceback. Note that the structure of the
2591 # will still get a traceback. Note that the structure of the
2584 # SystemExit exception changed between Python 2.4 and 2.5, so
2592 # SystemExit exception changed between Python 2.4 and 2.5, so
2585 # the checks must be done in a version-dependent way.
2593 # the checks must be done in a version-dependent way.
2586 show = False
2594 show = False
2587
2595
2588 if sys.version_info[:2] > (2,5):
2596 if sys.version_info[:2] > (2,5):
2589 if status.message!=0 and not kw['exit_ignore']:
2597 if status.message!=0 and not kw['exit_ignore']:
2590 show = True
2598 show = True
2591 else:
2599 else:
2592 if status.code and not kw['exit_ignore']:
2600 if status.code and not kw['exit_ignore']:
2593 show = True
2601 show = True
2594 if show:
2602 if show:
2595 self.showtraceback()
2603 self.showtraceback()
2596 warn('Failure executing file: <%s>' % fname)
2604 warn('Failure executing file: <%s>' % fname)
2597 except:
2605 except:
2598 self.showtraceback()
2606 self.showtraceback()
2599 warn('Failure executing file: <%s>' % fname)
2607 warn('Failure executing file: <%s>' % fname)
2600
2608
2601 syspath_cleanup()
2609 syspath_cleanup()
2602
2610
2603 #************************* end of file <iplib.py> *****************************
2611 #************************* end of file <iplib.py> *****************************
@@ -1,764 +1,765 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.1 or better.
5 Requires Python 2.1 or better.
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 2913 2007-12-31 12:42:14Z vivainio $"""
9 $Id: ipmaker.py 2930 2008-01-11 07:03:11Z vivainio $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 #
13 #
14 # Distributed under the terms of the BSD License. The full license is in
14 # Distributed under the terms of the BSD License. The full license is in
15 # the file COPYING, distributed as part of this software.
15 # the file COPYING, distributed as part of this software.
16 #*****************************************************************************
16 #*****************************************************************************
17
17
18 from IPython import Release
18 from IPython import Release
19 __author__ = '%s <%s>' % Release.authors['Fernando']
19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 __license__ = Release.license
20 __license__ = Release.license
21 __version__ = Release.version
21 __version__ = Release.version
22
22
23 try:
23 try:
24 credits._Printer__data = """
24 credits._Printer__data = """
25 Python: %s
25 Python: %s
26
26
27 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
27 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
28 See http://ipython.scipy.org for more information.""" \
28 See http://ipython.scipy.org for more information.""" \
29 % credits._Printer__data
29 % credits._Printer__data
30
30
31 copyright._Printer__data += """
31 copyright._Printer__data += """
32
32
33 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
33 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
34 All Rights Reserved."""
34 All Rights Reserved."""
35 except NameError:
35 except NameError:
36 # Can happen if ipython was started with 'python -S', so that site.py is
36 # Can happen if ipython was started with 'python -S', so that site.py is
37 # not loaded
37 # not loaded
38 pass
38 pass
39
39
40 #****************************************************************************
40 #****************************************************************************
41 # Required modules
41 # Required modules
42
42
43 # From the standard library
43 # From the standard library
44 import __main__
44 import __main__
45 import __builtin__
45 import __builtin__
46 import os
46 import os
47 import re
47 import re
48 import sys
48 import sys
49 import types
49 import types
50 from pprint import pprint,pformat
50 from pprint import pprint,pformat
51
51
52 # Our own
52 # Our own
53 from IPython import DPyGetOpt
53 from IPython import DPyGetOpt
54 from IPython.ipstruct import Struct
54 from IPython.ipstruct import Struct
55 from IPython.OutputTrap import OutputTrap
55 from IPython.OutputTrap import OutputTrap
56 from IPython.ConfigLoader import ConfigLoader
56 from IPython.ConfigLoader import ConfigLoader
57 from IPython.iplib import InteractiveShell
57 from IPython.iplib import InteractiveShell
58 from IPython.usage import cmd_line_usage,interactive_usage
58 from IPython.usage import cmd_line_usage,interactive_usage
59 from IPython.genutils import *
59 from IPython.genutils import *
60
60
61 #-----------------------------------------------------------------------------
61 #-----------------------------------------------------------------------------
62 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
62 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
63 rc_override=None,shell_class=InteractiveShell,
63 rc_override=None,shell_class=InteractiveShell,
64 embedded=False,**kw):
64 embedded=False,**kw):
65 """This is a dump of IPython into a single function.
65 """This is a dump of IPython into a single function.
66
66
67 Later it will have to be broken up in a sensible manner.
67 Later it will have to be broken up in a sensible manner.
68
68
69 Arguments:
69 Arguments:
70
70
71 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
71 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
72 script name, b/c DPyGetOpt strips the first argument only for the real
72 script name, b/c DPyGetOpt strips the first argument only for the real
73 sys.argv.
73 sys.argv.
74
74
75 - user_ns: a dict to be used as the user's namespace."""
75 - user_ns: a dict to be used as the user's namespace."""
76
76
77 #----------------------------------------------------------------------
77 #----------------------------------------------------------------------
78 # Defaults and initialization
78 # Defaults and initialization
79
79
80 # For developer debugging, deactivates crash handler and uses pdb.
80 # For developer debugging, deactivates crash handler and uses pdb.
81 DEVDEBUG = False
81 DEVDEBUG = False
82
82
83 if argv is None:
83 if argv is None:
84 argv = sys.argv
84 argv = sys.argv
85
85
86 # __IP is the main global that lives throughout and represents the whole
86 # __IP is the main global that lives throughout and represents the whole
87 # application. If the user redefines it, all bets are off as to what
87 # application. If the user redefines it, all bets are off as to what
88 # happens.
88 # happens.
89
89
90 # __IP is the name of he global which the caller will have accessible as
90 # __IP is the name of he global which the caller will have accessible as
91 # __IP.name. We set its name via the first parameter passed to
91 # __IP.name. We set its name via the first parameter passed to
92 # InteractiveShell:
92 # InteractiveShell:
93
93
94 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
94 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
95 embedded=embedded,**kw)
95 embedded=embedded,**kw)
96
96
97 # Put 'help' in the user namespace
97 # Put 'help' in the user namespace
98 from site import _Helper
98 from site import _Helper
99 IP.user_config_ns = {}
99 IP.user_config_ns = {}
100 IP.user_ns['help'] = _Helper()
100 IP.user_ns['help'] = _Helper()
101
101
102
102
103 if DEVDEBUG:
103 if DEVDEBUG:
104 # For developer debugging only (global flag)
104 # For developer debugging only (global flag)
105 from IPython import ultraTB
105 from IPython import ultraTB
106 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
106 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
107
107
108 IP.BANNER_PARTS = ['Python %s\n'
108 IP.BANNER_PARTS = ['Python %s\n'
109 'Type "copyright", "credits" or "license" '
109 'Type "copyright", "credits" or "license" '
110 'for more information.\n'
110 'for more information.\n'
111 % (sys.version.split('\n')[0],),
111 % (sys.version.split('\n')[0],),
112 "IPython %s -- An enhanced Interactive Python."
112 "IPython %s -- An enhanced Interactive Python."
113 % (__version__,),
113 % (__version__,),
114 """\
114 """\
115 ? -> Introduction and overview of IPython's features.
115 ? -> Introduction and overview of IPython's features.
116 %quickref -> Quick reference.
116 %quickref -> Quick reference.
117 help -> Python's own help system.
117 help -> Python's own help system.
118 object? -> Details about 'object'. ?object also works, ?? prints more.
118 object? -> Details about 'object'. ?object also works, ?? prints more.
119 """ ]
119 """ ]
120
120
121 IP.usage = interactive_usage
121 IP.usage = interactive_usage
122
122
123 # Platform-dependent suffix and directory names. We use _ipython instead
123 # Platform-dependent suffix and directory names. We use _ipython instead
124 # of .ipython under win32 b/c there's software that breaks with .named
124 # of .ipython under win32 b/c there's software that breaks with .named
125 # directories on that platform.
125 # directories on that platform.
126 if os.name == 'posix':
126 if os.name == 'posix':
127 rc_suffix = ''
127 rc_suffix = ''
128 ipdir_def = '.ipython'
128 ipdir_def = '.ipython'
129 else:
129 else:
130 rc_suffix = '.ini'
130 rc_suffix = '.ini'
131 ipdir_def = '_ipython'
131 ipdir_def = '_ipython'
132
132
133 # default directory for configuration
133 # default directory for configuration
134 ipythondir_def = os.path.abspath(os.environ.get('IPYTHONDIR',
134 ipythondir_def = os.path.abspath(os.environ.get('IPYTHONDIR',
135 os.path.join(IP.home_dir,ipdir_def)))
135 os.path.join(IP.home_dir,ipdir_def)))
136
136
137 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
137 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
138
138
139 # we need the directory where IPython itself is installed
139 # we need the directory where IPython itself is installed
140 import IPython
140 import IPython
141 IPython_dir = os.path.dirname(IPython.__file__)
141 IPython_dir = os.path.dirname(IPython.__file__)
142 del IPython
142 del IPython
143
143
144 #-------------------------------------------------------------------------
144 #-------------------------------------------------------------------------
145 # Command line handling
145 # Command line handling
146
146
147 # Valid command line options (uses DPyGetOpt syntax, like Perl's
147 # Valid command line options (uses DPyGetOpt syntax, like Perl's
148 # GetOpt::Long)
148 # GetOpt::Long)
149
149
150 # Any key not listed here gets deleted even if in the file (like session
150 # Any key not listed here gets deleted even if in the file (like session
151 # or profile). That's deliberate, to maintain the rc namespace clean.
151 # or profile). That's deliberate, to maintain the rc namespace clean.
152
152
153 # Each set of options appears twice: under _conv only the names are
153 # Each set of options appears twice: under _conv only the names are
154 # listed, indicating which type they must be converted to when reading the
154 # listed, indicating which type they must be converted to when reading the
155 # ipythonrc file. And under DPyGetOpt they are listed with the regular
155 # ipythonrc file. And under DPyGetOpt they are listed with the regular
156 # DPyGetOpt syntax (=s,=i,:f,etc).
156 # DPyGetOpt syntax (=s,=i,:f,etc).
157
157
158 # Make sure there's a space before each end of line (they get auto-joined!)
158 # Make sure there's a space before each end of line (they get auto-joined!)
159 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
159 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
160 'c=s classic|cl color_info! colors=s confirm_exit! '
160 'c=s classic|cl color_info! colors=s confirm_exit! '
161 'debug! deep_reload! editor=s log|l messages! nosep '
161 'debug! deep_reload! editor=s log|l messages! nosep '
162 'object_info_string_level=i pdb! '
162 'object_info_string_level=i pdb! '
163 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
163 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
164 'pydb! '
164 'pydb! '
165 'pylab_import_all! '
165 'pylab_import_all! '
166 'quick screen_length|sl=i prompts_pad_left=i '
166 'quick screen_length|sl=i prompts_pad_left=i '
167 'logfile|lf=s logplay|lp=s profile|p=s '
167 'logfile|lf=s logplay|lp=s profile|p=s '
168 'readline! readline_merge_completions! '
168 'readline! readline_merge_completions! '
169 'readline_omit__names! '
169 'readline_omit__names! '
170 'rcfile=s separate_in|si=s separate_out|so=s '
170 'rcfile=s separate_in|si=s separate_out|so=s '
171 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
171 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
172 'magic_docstrings system_verbose! '
172 'magic_docstrings system_verbose! '
173 'multi_line_specials! '
173 'multi_line_specials! '
174 'term_title! wxversion=s '
174 'term_title! wxversion=s '
175 'autoedit_syntax!')
175 'autoedit_syntax!')
176
176
177 # Options that can *only* appear at the cmd line (not in rcfiles).
177 # Options that can *only* appear at the cmd line (not in rcfiles).
178
178
179 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
179 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
180 # the 'C-c !' command in emacs automatically appends a -i option at the end.
180 # the 'C-c !' command in emacs automatically appends a -i option at the end.
181 cmdline_only = ('help interact|i ipythondir=s Version upgrade '
181 cmdline_only = ('help interact|i ipythondir=s Version upgrade '
182 'gthread! qthread! q4thread! wthread! tkthread! pylab! tk!')
182 'gthread! qthread! q4thread! wthread! tkthread! pylab! tk!')
183
183
184 # Build the actual name list to be used by DPyGetOpt
184 # Build the actual name list to be used by DPyGetOpt
185 opts_names = qw(cmdline_opts) + qw(cmdline_only)
185 opts_names = qw(cmdline_opts) + qw(cmdline_only)
186
186
187 # Set sensible command line defaults.
187 # Set sensible command line defaults.
188 # This should have everything from cmdline_opts and cmdline_only
188 # This should have everything from cmdline_opts and cmdline_only
189 opts_def = Struct(autocall = 1,
189 opts_def = Struct(autocall = 1,
190 autoedit_syntax = 0,
190 autoedit_syntax = 0,
191 autoindent = 0,
191 autoindent = 0,
192 automagic = 1,
192 automagic = 1,
193 autoexec = [],
193 banner = 1,
194 banner = 1,
194 c = '',
195 c = '',
195 cache_size = 1000,
196 cache_size = 1000,
196 classic = 0,
197 classic = 0,
197 color_info = 0,
198 color_info = 0,
198 colors = 'NoColor',
199 colors = 'NoColor',
199 confirm_exit = 1,
200 confirm_exit = 1,
200 debug = 0,
201 debug = 0,
201 deep_reload = 0,
202 deep_reload = 0,
202 editor = '0',
203 editor = '0',
203 gthread = 0,
204 gthread = 0,
204 help = 0,
205 help = 0,
205 interact = 1,
206 interact = 1,
206 ipythondir = ipythondir_def,
207 ipythondir = ipythondir_def,
207 log = 0,
208 log = 0,
208 logfile = '',
209 logfile = '',
209 logplay = '',
210 logplay = '',
210 messages = 1,
211 messages = 1,
211 multi_line_specials = 1,
212 multi_line_specials = 1,
212 nosep = 0,
213 nosep = 0,
213 object_info_string_level = 0,
214 object_info_string_level = 0,
214 pdb = 0,
215 pdb = 0,
215 pprint = 0,
216 pprint = 0,
216 profile = '',
217 profile = '',
217 prompt_in1 = 'In [\\#]: ',
218 prompt_in1 = 'In [\\#]: ',
218 prompt_in2 = ' .\\D.: ',
219 prompt_in2 = ' .\\D.: ',
219 prompt_out = 'Out[\\#]: ',
220 prompt_out = 'Out[\\#]: ',
220 prompts_pad_left = 1,
221 prompts_pad_left = 1,
221 pylab = 0,
222 pylab = 0,
222 pylab_import_all = 1,
223 pylab_import_all = 1,
223 q4thread = 0,
224 q4thread = 0,
224 qthread = 0,
225 qthread = 0,
225 quick = 0,
226 quick = 0,
226 quiet = 0,
227 quiet = 0,
227 rcfile = 'ipythonrc' + rc_suffix,
228 rcfile = 'ipythonrc' + rc_suffix,
228 readline = 1,
229 readline = 1,
229 readline_merge_completions = 1,
230 readline_merge_completions = 1,
230 readline_omit__names = 0,
231 readline_omit__names = 0,
231 screen_length = 0,
232 screen_length = 0,
232 separate_in = '\n',
233 separate_in = '\n',
233 separate_out = '\n',
234 separate_out = '\n',
234 separate_out2 = '',
235 separate_out2 = '',
235 system_header = 'IPython system call: ',
236 system_header = 'IPython system call: ',
236 system_verbose = 0,
237 system_verbose = 0,
237 term_title = 1,
238 term_title = 1,
238 tk = 0,
239 tk = 0,
239 upgrade = 0,
240 upgrade = 0,
240 Version = 0,
241 Version = 0,
241 wildcards_case_sensitive = 1,
242 wildcards_case_sensitive = 1,
242 wthread = 0,
243 wthread = 0,
243 wxversion = '0',
244 wxversion = '0',
244 xmode = 'Context',
245 xmode = 'Context',
245 magic_docstrings = 0, # undocumented, for doc generation
246 magic_docstrings = 0, # undocumented, for doc generation
246 )
247 )
247
248
248 # Things that will *only* appear in rcfiles (not at the command line).
249 # Things that will *only* appear in rcfiles (not at the command line).
249 # Make sure there's a space before each end of line (they get auto-joined!)
250 # Make sure there's a space before each end of line (they get auto-joined!)
250 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
251 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
251 qw_lol: 'import_some ',
252 qw_lol: 'import_some ',
252 # for things with embedded whitespace:
253 # for things with embedded whitespace:
253 list_strings:'execute alias readline_parse_and_bind ',
254 list_strings:'execute alias readline_parse_and_bind ',
254 # Regular strings need no conversion:
255 # Regular strings need no conversion:
255 None:'readline_remove_delims ',
256 None:'readline_remove_delims ',
256 }
257 }
257 # Default values for these
258 # Default values for these
258 rc_def = Struct(include = [],
259 rc_def = Struct(include = [],
259 import_mod = [],
260 import_mod = [],
260 import_all = [],
261 import_all = [],
261 import_some = [[]],
262 import_some = [[]],
262 execute = [],
263 execute = [],
263 execfile = [],
264 execfile = [],
264 alias = [],
265 alias = [],
265 readline_parse_and_bind = [],
266 readline_parse_and_bind = [],
266 readline_remove_delims = '',
267 readline_remove_delims = '',
267 )
268 )
268
269
269 # Build the type conversion dictionary from the above tables:
270 # Build the type conversion dictionary from the above tables:
270 typeconv = rcfile_opts.copy()
271 typeconv = rcfile_opts.copy()
271 typeconv.update(optstr2types(cmdline_opts))
272 typeconv.update(optstr2types(cmdline_opts))
272
273
273 # FIXME: the None key appears in both, put that back together by hand. Ugly!
274 # FIXME: the None key appears in both, put that back together by hand. Ugly!
274 typeconv[None] += ' ' + rcfile_opts[None]
275 typeconv[None] += ' ' + rcfile_opts[None]
275
276
276 # Remove quotes at ends of all strings (used to protect spaces)
277 # Remove quotes at ends of all strings (used to protect spaces)
277 typeconv[unquote_ends] = typeconv[None]
278 typeconv[unquote_ends] = typeconv[None]
278 del typeconv[None]
279 del typeconv[None]
279
280
280 # Build the list we'll use to make all config decisions with defaults:
281 # Build the list we'll use to make all config decisions with defaults:
281 opts_all = opts_def.copy()
282 opts_all = opts_def.copy()
282 opts_all.update(rc_def)
283 opts_all.update(rc_def)
283
284
284 # Build conflict resolver for recursive loading of config files:
285 # Build conflict resolver for recursive loading of config files:
285 # - preserve means the outermost file maintains the value, it is not
286 # - preserve means the outermost file maintains the value, it is not
286 # overwritten if an included file has the same key.
287 # overwritten if an included file has the same key.
287 # - add_flip applies + to the two values, so it better make sense to add
288 # - add_flip applies + to the two values, so it better make sense to add
288 # those types of keys. But it flips them first so that things loaded
289 # those types of keys. But it flips them first so that things loaded
289 # deeper in the inclusion chain have lower precedence.
290 # deeper in the inclusion chain have lower precedence.
290 conflict = {'preserve': ' '.join([ typeconv[int],
291 conflict = {'preserve': ' '.join([ typeconv[int],
291 typeconv[unquote_ends] ]),
292 typeconv[unquote_ends] ]),
292 'add_flip': ' '.join([ typeconv[qwflat],
293 'add_flip': ' '.join([ typeconv[qwflat],
293 typeconv[qw_lol],
294 typeconv[qw_lol],
294 typeconv[list_strings] ])
295 typeconv[list_strings] ])
295 }
296 }
296
297
297 # Now actually process the command line
298 # Now actually process the command line
298 getopt = DPyGetOpt.DPyGetOpt()
299 getopt = DPyGetOpt.DPyGetOpt()
299 getopt.setIgnoreCase(0)
300 getopt.setIgnoreCase(0)
300
301
301 getopt.parseConfiguration(opts_names)
302 getopt.parseConfiguration(opts_names)
302
303
303 try:
304 try:
304 getopt.processArguments(argv)
305 getopt.processArguments(argv)
305 except DPyGetOpt.ArgumentError, exc:
306 except DPyGetOpt.ArgumentError, exc:
306 print cmd_line_usage
307 print cmd_line_usage
307 warn('\nError in Arguments: "%s"' % exc)
308 warn('\nError in Arguments: "%s"' % exc)
308 sys.exit(1)
309 sys.exit(1)
309
310
310 # convert the options dict to a struct for much lighter syntax later
311 # convert the options dict to a struct for much lighter syntax later
311 opts = Struct(getopt.optionValues)
312 opts = Struct(getopt.optionValues)
312 args = getopt.freeValues
313 args = getopt.freeValues
313
314
314 # this is the struct (which has default values at this point) with which
315 # this is the struct (which has default values at this point) with which
315 # we make all decisions:
316 # we make all decisions:
316 opts_all.update(opts)
317 opts_all.update(opts)
317
318
318 # Options that force an immediate exit
319 # Options that force an immediate exit
319 if opts_all.help:
320 if opts_all.help:
320 page(cmd_line_usage)
321 page(cmd_line_usage)
321 sys.exit()
322 sys.exit()
322
323
323 if opts_all.Version:
324 if opts_all.Version:
324 print __version__
325 print __version__
325 sys.exit()
326 sys.exit()
326
327
327 if opts_all.magic_docstrings:
328 if opts_all.magic_docstrings:
328 IP.magic_magic('-latex')
329 IP.magic_magic('-latex')
329 sys.exit()
330 sys.exit()
330
331
331 # add personal ipythondir to sys.path so that users can put things in
332 # add personal ipythondir to sys.path so that users can put things in
332 # there for customization
333 # there for customization
333 sys.path.append(os.path.abspath(opts_all.ipythondir))
334 sys.path.append(os.path.abspath(opts_all.ipythondir))
334
335
335 # Create user config directory if it doesn't exist. This must be done
336 # Create user config directory if it doesn't exist. This must be done
336 # *after* getting the cmd line options.
337 # *after* getting the cmd line options.
337 if not os.path.isdir(opts_all.ipythondir):
338 if not os.path.isdir(opts_all.ipythondir):
338 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
339 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
339
340
340 # upgrade user config files while preserving a copy of the originals
341 # upgrade user config files while preserving a copy of the originals
341 if opts_all.upgrade:
342 if opts_all.upgrade:
342 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
343 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
343
344
344 # check mutually exclusive options in the *original* command line
345 # check mutually exclusive options in the *original* command line
345 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
346 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
346 qw('classic profile'),qw('classic rcfile')])
347 qw('classic profile'),qw('classic rcfile')])
347
348
348 #---------------------------------------------------------------------------
349 #---------------------------------------------------------------------------
349 # Log replay
350 # Log replay
350
351
351 # if -logplay, we need to 'become' the other session. That basically means
352 # if -logplay, we need to 'become' the other session. That basically means
352 # replacing the current command line environment with that of the old
353 # replacing the current command line environment with that of the old
353 # session and moving on.
354 # session and moving on.
354
355
355 # this is needed so that later we know we're in session reload mode, as
356 # this is needed so that later we know we're in session reload mode, as
356 # opts_all will get overwritten:
357 # opts_all will get overwritten:
357 load_logplay = 0
358 load_logplay = 0
358
359
359 if opts_all.logplay:
360 if opts_all.logplay:
360 load_logplay = opts_all.logplay
361 load_logplay = opts_all.logplay
361 opts_debug_save = opts_all.debug
362 opts_debug_save = opts_all.debug
362 try:
363 try:
363 logplay = open(opts_all.logplay)
364 logplay = open(opts_all.logplay)
364 except IOError:
365 except IOError:
365 if opts_all.debug: IP.InteractiveTB()
366 if opts_all.debug: IP.InteractiveTB()
366 warn('Could not open logplay file '+`opts_all.logplay`)
367 warn('Could not open logplay file '+`opts_all.logplay`)
367 # restore state as if nothing had happened and move on, but make
368 # restore state as if nothing had happened and move on, but make
368 # sure that later we don't try to actually load the session file
369 # sure that later we don't try to actually load the session file
369 logplay = None
370 logplay = None
370 load_logplay = 0
371 load_logplay = 0
371 del opts_all.logplay
372 del opts_all.logplay
372 else:
373 else:
373 try:
374 try:
374 logplay.readline()
375 logplay.readline()
375 logplay.readline();
376 logplay.readline();
376 # this reloads that session's command line
377 # this reloads that session's command line
377 cmd = logplay.readline()[6:]
378 cmd = logplay.readline()[6:]
378 exec cmd
379 exec cmd
379 # restore the true debug flag given so that the process of
380 # restore the true debug flag given so that the process of
380 # session loading itself can be monitored.
381 # session loading itself can be monitored.
381 opts.debug = opts_debug_save
382 opts.debug = opts_debug_save
382 # save the logplay flag so later we don't overwrite the log
383 # save the logplay flag so later we don't overwrite the log
383 opts.logplay = load_logplay
384 opts.logplay = load_logplay
384 # now we must update our own structure with defaults
385 # now we must update our own structure with defaults
385 opts_all.update(opts)
386 opts_all.update(opts)
386 # now load args
387 # now load args
387 cmd = logplay.readline()[6:]
388 cmd = logplay.readline()[6:]
388 exec cmd
389 exec cmd
389 logplay.close()
390 logplay.close()
390 except:
391 except:
391 logplay.close()
392 logplay.close()
392 if opts_all.debug: IP.InteractiveTB()
393 if opts_all.debug: IP.InteractiveTB()
393 warn("Logplay file lacking full configuration information.\n"
394 warn("Logplay file lacking full configuration information.\n"
394 "I'll try to read it, but some things may not work.")
395 "I'll try to read it, but some things may not work.")
395
396
396 #-------------------------------------------------------------------------
397 #-------------------------------------------------------------------------
397 # set up output traps: catch all output from files, being run, modules
398 # set up output traps: catch all output from files, being run, modules
398 # loaded, etc. Then give it to the user in a clean form at the end.
399 # loaded, etc. Then give it to the user in a clean form at the end.
399
400
400 msg_out = 'Output messages. '
401 msg_out = 'Output messages. '
401 msg_err = 'Error messages. '
402 msg_err = 'Error messages. '
402 msg_sep = '\n'
403 msg_sep = '\n'
403 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
404 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
404 msg_err,msg_sep,debug,
405 msg_err,msg_sep,debug,
405 quiet_out=1),
406 quiet_out=1),
406 user_exec = OutputTrap('User File Execution',msg_out,
407 user_exec = OutputTrap('User File Execution',msg_out,
407 msg_err,msg_sep,debug),
408 msg_err,msg_sep,debug),
408 logplay = OutputTrap('Log Loader',msg_out,
409 logplay = OutputTrap('Log Loader',msg_out,
409 msg_err,msg_sep,debug),
410 msg_err,msg_sep,debug),
410 summary = ''
411 summary = ''
411 )
412 )
412
413
413 #-------------------------------------------------------------------------
414 #-------------------------------------------------------------------------
414 # Process user ipythonrc-type configuration files
415 # Process user ipythonrc-type configuration files
415
416
416 # turn on output trapping and log to msg.config
417 # turn on output trapping and log to msg.config
417 # remember that with debug on, trapping is actually disabled
418 # remember that with debug on, trapping is actually disabled
418 msg.config.trap_all()
419 msg.config.trap_all()
419
420
420 # look for rcfile in current or default directory
421 # look for rcfile in current or default directory
421 try:
422 try:
422 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
423 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
423 except IOError:
424 except IOError:
424 if opts_all.debug: IP.InteractiveTB()
425 if opts_all.debug: IP.InteractiveTB()
425 warn('Configuration file %s not found. Ignoring request.'
426 warn('Configuration file %s not found. Ignoring request.'
426 % (opts_all.rcfile) )
427 % (opts_all.rcfile) )
427
428
428 # 'profiles' are a shorthand notation for config filenames
429 # 'profiles' are a shorthand notation for config filenames
429 profile_handled_by_legacy = False
430 profile_handled_by_legacy = False
430 if opts_all.profile:
431 if opts_all.profile:
431
432
432 try:
433 try:
433 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
434 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
434 + rc_suffix,
435 + rc_suffix,
435 opts_all.ipythondir)
436 opts_all.ipythondir)
436 profile_handled_by_legacy = True
437 profile_handled_by_legacy = True
437 except IOError:
438 except IOError:
438 if opts_all.debug: IP.InteractiveTB()
439 if opts_all.debug: IP.InteractiveTB()
439 opts.profile = '' # remove profile from options if invalid
440 opts.profile = '' # remove profile from options if invalid
440 # We won't warn anymore, primary method is ipy_profile_PROFNAME
441 # We won't warn anymore, primary method is ipy_profile_PROFNAME
441 # which does trigger a warning.
442 # which does trigger a warning.
442
443
443 # load the config file
444 # load the config file
444 rcfiledata = None
445 rcfiledata = None
445 if opts_all.quick:
446 if opts_all.quick:
446 print 'Launching IPython in quick mode. No config file read.'
447 print 'Launching IPython in quick mode. No config file read.'
447 elif opts_all.rcfile:
448 elif opts_all.rcfile:
448 try:
449 try:
449 cfg_loader = ConfigLoader(conflict)
450 cfg_loader = ConfigLoader(conflict)
450 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
451 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
451 'include',opts_all.ipythondir,
452 'include',opts_all.ipythondir,
452 purge = 1,
453 purge = 1,
453 unique = conflict['preserve'])
454 unique = conflict['preserve'])
454 except:
455 except:
455 IP.InteractiveTB()
456 IP.InteractiveTB()
456 warn('Problems loading configuration file '+
457 warn('Problems loading configuration file '+
457 `opts_all.rcfile`+
458 `opts_all.rcfile`+
458 '\nStarting with default -bare bones- configuration.')
459 '\nStarting with default -bare bones- configuration.')
459 else:
460 else:
460 warn('No valid configuration file found in either currrent directory\n'+
461 warn('No valid configuration file found in either currrent directory\n'+
461 'or in the IPython config. directory: '+`opts_all.ipythondir`+
462 'or in the IPython config. directory: '+`opts_all.ipythondir`+
462 '\nProceeding with internal defaults.')
463 '\nProceeding with internal defaults.')
463
464
464 #------------------------------------------------------------------------
465 #------------------------------------------------------------------------
465 # Set exception handlers in mode requested by user.
466 # Set exception handlers in mode requested by user.
466 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
467 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
467 IP.magic_xmode(opts_all.xmode)
468 IP.magic_xmode(opts_all.xmode)
468 otrap.release_out()
469 otrap.release_out()
469
470
470 #------------------------------------------------------------------------
471 #------------------------------------------------------------------------
471 # Execute user config
472 # Execute user config
472
473
473 # Create a valid config structure with the right precedence order:
474 # Create a valid config structure with the right precedence order:
474 # defaults < rcfile < command line. This needs to be in the instance, so
475 # defaults < rcfile < command line. This needs to be in the instance, so
475 # that method calls below that rely on it find it.
476 # that method calls below that rely on it find it.
476 IP.rc = rc_def.copy()
477 IP.rc = rc_def.copy()
477
478
478 # Work with a local alias inside this routine to avoid unnecessary
479 # Work with a local alias inside this routine to avoid unnecessary
479 # attribute lookups.
480 # attribute lookups.
480 IP_rc = IP.rc
481 IP_rc = IP.rc
481
482
482 IP_rc.update(opts_def)
483 IP_rc.update(opts_def)
483 if rcfiledata:
484 if rcfiledata:
484 # now we can update
485 # now we can update
485 IP_rc.update(rcfiledata)
486 IP_rc.update(rcfiledata)
486 IP_rc.update(opts)
487 IP_rc.update(opts)
487 IP_rc.update(rc_override)
488 IP_rc.update(rc_override)
488
489
489 # Store the original cmd line for reference:
490 # Store the original cmd line for reference:
490 IP_rc.opts = opts
491 IP_rc.opts = opts
491 IP_rc.args = args
492 IP_rc.args = args
492
493
493 # create a *runtime* Struct like rc for holding parameters which may be
494 # create a *runtime* Struct like rc for holding parameters which may be
494 # created and/or modified by runtime user extensions.
495 # created and/or modified by runtime user extensions.
495 IP.runtime_rc = Struct()
496 IP.runtime_rc = Struct()
496
497
497 # from this point on, all config should be handled through IP_rc,
498 # from this point on, all config should be handled through IP_rc,
498 # opts* shouldn't be used anymore.
499 # opts* shouldn't be used anymore.
499
500
500
501
501 # update IP_rc with some special things that need manual
502 # update IP_rc with some special things that need manual
502 # tweaks. Basically options which affect other options. I guess this
503 # tweaks. Basically options which affect other options. I guess this
503 # should just be written so that options are fully orthogonal and we
504 # should just be written so that options are fully orthogonal and we
504 # wouldn't worry about this stuff!
505 # wouldn't worry about this stuff!
505
506
506 if IP_rc.classic:
507 if IP_rc.classic:
507 IP_rc.quick = 1
508 IP_rc.quick = 1
508 IP_rc.cache_size = 0
509 IP_rc.cache_size = 0
509 IP_rc.pprint = 0
510 IP_rc.pprint = 0
510 IP_rc.prompt_in1 = '>>> '
511 IP_rc.prompt_in1 = '>>> '
511 IP_rc.prompt_in2 = '... '
512 IP_rc.prompt_in2 = '... '
512 IP_rc.prompt_out = ''
513 IP_rc.prompt_out = ''
513 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
514 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
514 IP_rc.colors = 'NoColor'
515 IP_rc.colors = 'NoColor'
515 IP_rc.xmode = 'Plain'
516 IP_rc.xmode = 'Plain'
516
517
517 IP.pre_config_initialization()
518 IP.pre_config_initialization()
518 # configure readline
519 # configure readline
519 # Define the history file for saving commands in between sessions
520 # Define the history file for saving commands in between sessions
520 if IP_rc.profile:
521 if IP_rc.profile:
521 histfname = 'history-%s' % IP_rc.profile
522 histfname = 'history-%s' % IP_rc.profile
522 else:
523 else:
523 histfname = 'history'
524 histfname = 'history'
524 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
525 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
525
526
526 # update exception handlers with rc file status
527 # update exception handlers with rc file status
527 otrap.trap_out() # I don't want these messages ever.
528 otrap.trap_out() # I don't want these messages ever.
528 IP.magic_xmode(IP_rc.xmode)
529 IP.magic_xmode(IP_rc.xmode)
529 otrap.release_out()
530 otrap.release_out()
530
531
531 # activate logging if requested and not reloading a log
532 # activate logging if requested and not reloading a log
532 if IP_rc.logplay:
533 if IP_rc.logplay:
533 IP.magic_logstart(IP_rc.logplay + ' append')
534 IP.magic_logstart(IP_rc.logplay + ' append')
534 elif IP_rc.logfile:
535 elif IP_rc.logfile:
535 IP.magic_logstart(IP_rc.logfile)
536 IP.magic_logstart(IP_rc.logfile)
536 elif IP_rc.log:
537 elif IP_rc.log:
537 IP.magic_logstart()
538 IP.magic_logstart()
538
539
539 # find user editor so that it we don't have to look it up constantly
540 # find user editor so that it we don't have to look it up constantly
540 if IP_rc.editor.strip()=='0':
541 if IP_rc.editor.strip()=='0':
541 try:
542 try:
542 ed = os.environ['EDITOR']
543 ed = os.environ['EDITOR']
543 except KeyError:
544 except KeyError:
544 if os.name == 'posix':
545 if os.name == 'posix':
545 ed = 'vi' # the only one guaranteed to be there!
546 ed = 'vi' # the only one guaranteed to be there!
546 else:
547 else:
547 ed = 'notepad' # same in Windows!
548 ed = 'notepad' # same in Windows!
548 IP_rc.editor = ed
549 IP_rc.editor = ed
549
550
550 # Keep track of whether this is an embedded instance or not (useful for
551 # Keep track of whether this is an embedded instance or not (useful for
551 # post-mortems).
552 # post-mortems).
552 IP_rc.embedded = IP.embedded
553 IP_rc.embedded = IP.embedded
553
554
554 # Recursive reload
555 # Recursive reload
555 try:
556 try:
556 from IPython import deep_reload
557 from IPython import deep_reload
557 if IP_rc.deep_reload:
558 if IP_rc.deep_reload:
558 __builtin__.reload = deep_reload.reload
559 __builtin__.reload = deep_reload.reload
559 else:
560 else:
560 __builtin__.dreload = deep_reload.reload
561 __builtin__.dreload = deep_reload.reload
561 del deep_reload
562 del deep_reload
562 except ImportError:
563 except ImportError:
563 pass
564 pass
564
565
565 # Save the current state of our namespace so that the interactive shell
566 # Save the current state of our namespace so that the interactive shell
566 # can later know which variables have been created by us from config files
567 # can later know which variables have been created by us from config files
567 # and loading. This way, loading a file (in any way) is treated just like
568 # and loading. This way, loading a file (in any way) is treated just like
568 # defining things on the command line, and %who works as expected.
569 # defining things on the command line, and %who works as expected.
569
570
570 # DON'T do anything that affects the namespace beyond this point!
571 # DON'T do anything that affects the namespace beyond this point!
571 IP.internal_ns.update(__main__.__dict__)
572 IP.internal_ns.update(__main__.__dict__)
572
573
573 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
574 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
574
575
575 # Now run through the different sections of the users's config
576 # Now run through the different sections of the users's config
576 if IP_rc.debug:
577 if IP_rc.debug:
577 print 'Trying to execute the following configuration structure:'
578 print 'Trying to execute the following configuration structure:'
578 print '(Things listed first are deeper in the inclusion tree and get'
579 print '(Things listed first are deeper in the inclusion tree and get'
579 print 'loaded first).\n'
580 print 'loaded first).\n'
580 pprint(IP_rc.__dict__)
581 pprint(IP_rc.__dict__)
581
582
582 for mod in IP_rc.import_mod:
583 for mod in IP_rc.import_mod:
583 try:
584 try:
584 exec 'import '+mod in IP.user_ns
585 exec 'import '+mod in IP.user_ns
585 except :
586 except :
586 IP.InteractiveTB()
587 IP.InteractiveTB()
587 import_fail_info(mod)
588 import_fail_info(mod)
588
589
589 for mod_fn in IP_rc.import_some:
590 for mod_fn in IP_rc.import_some:
590 if not mod_fn == []:
591 if not mod_fn == []:
591 mod,fn = mod_fn[0],','.join(mod_fn[1:])
592 mod,fn = mod_fn[0],','.join(mod_fn[1:])
592 try:
593 try:
593 exec 'from '+mod+' import '+fn in IP.user_ns
594 exec 'from '+mod+' import '+fn in IP.user_ns
594 except :
595 except :
595 IP.InteractiveTB()
596 IP.InteractiveTB()
596 import_fail_info(mod,fn)
597 import_fail_info(mod,fn)
597
598
598 for mod in IP_rc.import_all:
599 for mod in IP_rc.import_all:
599 try:
600 try:
600 exec 'from '+mod+' import *' in IP.user_ns
601 exec 'from '+mod+' import *' in IP.user_ns
601 except :
602 except :
602 IP.InteractiveTB()
603 IP.InteractiveTB()
603 import_fail_info(mod)
604 import_fail_info(mod)
604
605
605 for code in IP_rc.execute:
606 for code in IP_rc.execute:
606 try:
607 try:
607 exec code in IP.user_ns
608 exec code in IP.user_ns
608 except:
609 except:
609 IP.InteractiveTB()
610 IP.InteractiveTB()
610 warn('Failure executing code: ' + `code`)
611 warn('Failure executing code: ' + `code`)
611
612
612 # Execute the files the user wants in ipythonrc
613 # Execute the files the user wants in ipythonrc
613 for file in IP_rc.execfile:
614 for file in IP_rc.execfile:
614 try:
615 try:
615 file = filefind(file,sys.path+[IPython_dir])
616 file = filefind(file,sys.path+[IPython_dir])
616 except IOError:
617 except IOError:
617 warn(itpl('File $file not found. Skipping it.'))
618 warn(itpl('File $file not found. Skipping it.'))
618 else:
619 else:
619 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
620 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
620
621
621 # finally, try importing ipy_*_conf for final configuration
622 # finally, try importing ipy_*_conf for final configuration
622 try:
623 try:
623 import ipy_system_conf
624 import ipy_system_conf
624 except ImportError:
625 except ImportError:
625 if opts_all.debug: IP.InteractiveTB()
626 if opts_all.debug: IP.InteractiveTB()
626 warn("Could not import 'ipy_system_conf'")
627 warn("Could not import 'ipy_system_conf'")
627 except:
628 except:
628 IP.InteractiveTB()
629 IP.InteractiveTB()
629 import_fail_info('ipy_system_conf')
630 import_fail_info('ipy_system_conf')
630
631
631 # only import prof module if ipythonrc-PROF was not found
632 # only import prof module if ipythonrc-PROF was not found
632 if opts_all.profile and not profile_handled_by_legacy:
633 if opts_all.profile and not profile_handled_by_legacy:
633 profmodname = 'ipy_profile_' + opts_all.profile
634 profmodname = 'ipy_profile_' + opts_all.profile
634 try:
635 try:
635 __import__(profmodname)
636 __import__(profmodname)
636 except:
637 except:
637 IP.InteractiveTB()
638 IP.InteractiveTB()
638 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
639 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
639 import_fail_info(profmodname)
640 import_fail_info(profmodname)
640 else:
641 else:
641 import ipy_profile_none
642 import ipy_profile_none
642 try:
643 try:
643 import ipy_user_conf
644 import ipy_user_conf
644
645
645 except:
646 except:
646 conf = opts_all.ipythondir + "/ipy_user_conf.py"
647 conf = opts_all.ipythondir + "/ipy_user_conf.py"
647 IP.InteractiveTB()
648 IP.InteractiveTB()
648 if not os.path.isfile(conf):
649 if not os.path.isfile(conf):
649 warn(conf + ' does not exist, please run %upgrade!')
650 warn(conf + ' does not exist, please run %upgrade!')
650
651
651 import_fail_info("ipy_user_conf")
652 import_fail_info("ipy_user_conf")
652
653
653 # finally, push the argv to options again to ensure highest priority
654 # finally, push the argv to options again to ensure highest priority
654 IP_rc.update(opts)
655 IP_rc.update(opts)
655
656
656 # release stdout and stderr and save config log into a global summary
657 # release stdout and stderr and save config log into a global summary
657 msg.config.release_all()
658 msg.config.release_all()
658 if IP_rc.messages:
659 if IP_rc.messages:
659 msg.summary += msg.config.summary_all()
660 msg.summary += msg.config.summary_all()
660
661
661 #------------------------------------------------------------------------
662 #------------------------------------------------------------------------
662 # Setup interactive session
663 # Setup interactive session
663
664
664 # Now we should be fully configured. We can then execute files or load
665 # Now we should be fully configured. We can then execute files or load
665 # things only needed for interactive use. Then we'll open the shell.
666 # things only needed for interactive use. Then we'll open the shell.
666
667
667 # Take a snapshot of the user namespace before opening the shell. That way
668 # Take a snapshot of the user namespace before opening the shell. That way
668 # we'll be able to identify which things were interactively defined and
669 # we'll be able to identify which things were interactively defined and
669 # which were defined through config files.
670 # which were defined through config files.
670 IP.user_config_ns.update(IP.user_ns)
671 IP.user_config_ns.update(IP.user_ns)
671
672
672 # Force reading a file as if it were a session log. Slower but safer.
673 # Force reading a file as if it were a session log. Slower but safer.
673 if load_logplay:
674 if load_logplay:
674 print 'Replaying log...'
675 print 'Replaying log...'
675 try:
676 try:
676 if IP_rc.debug:
677 if IP_rc.debug:
677 logplay_quiet = 0
678 logplay_quiet = 0
678 else:
679 else:
679 logplay_quiet = 1
680 logplay_quiet = 1
680
681
681 msg.logplay.trap_all()
682 msg.logplay.trap_all()
682 IP.safe_execfile(load_logplay,IP.user_ns,
683 IP.safe_execfile(load_logplay,IP.user_ns,
683 islog = 1, quiet = logplay_quiet)
684 islog = 1, quiet = logplay_quiet)
684 msg.logplay.release_all()
685 msg.logplay.release_all()
685 if IP_rc.messages:
686 if IP_rc.messages:
686 msg.summary += msg.logplay.summary_all()
687 msg.summary += msg.logplay.summary_all()
687 except:
688 except:
688 warn('Problems replaying logfile %s.' % load_logplay)
689 warn('Problems replaying logfile %s.' % load_logplay)
689 IP.InteractiveTB()
690 IP.InteractiveTB()
690
691
691 # Load remaining files in command line
692 # Load remaining files in command line
692 msg.user_exec.trap_all()
693 msg.user_exec.trap_all()
693
694
694 # Do NOT execute files named in the command line as scripts to be loaded
695 # Do NOT execute files named in the command line as scripts to be loaded
695 # by embedded instances. Doing so has the potential for an infinite
696 # by embedded instances. Doing so has the potential for an infinite
696 # recursion if there are exceptions thrown in the process.
697 # recursion if there are exceptions thrown in the process.
697
698
698 # XXX FIXME: the execution of user files should be moved out to after
699 # XXX FIXME: the execution of user files should be moved out to after
699 # ipython is fully initialized, just as if they were run via %run at the
700 # ipython is fully initialized, just as if they were run via %run at the
700 # ipython prompt. This would also give them the benefit of ipython's
701 # ipython prompt. This would also give them the benefit of ipython's
701 # nice tracebacks.
702 # nice tracebacks.
702
703
703 if (not embedded and IP_rc.args and
704 if (not embedded and IP_rc.args and
704 not IP_rc.args[0].lower().endswith('.ipy')):
705 not IP_rc.args[0].lower().endswith('.ipy')):
705 name_save = IP.user_ns['__name__']
706 name_save = IP.user_ns['__name__']
706 IP.user_ns['__name__'] = '__main__'
707 IP.user_ns['__name__'] = '__main__'
707 # Set our own excepthook in case the user code tries to call it
708 # Set our own excepthook in case the user code tries to call it
708 # directly. This prevents triggering the IPython crash handler.
709 # directly. This prevents triggering the IPython crash handler.
709 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
710 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
710
711
711 save_argv = sys.argv[1:] # save it for later restoring
712 save_argv = sys.argv[1:] # save it for later restoring
712
713
713 sys.argv = args
714 sys.argv = args
714
715
715 try:
716 try:
716 IP.safe_execfile(args[0], IP.user_ns)
717 IP.safe_execfile(args[0], IP.user_ns)
717 finally:
718 finally:
718 # Reset our crash handler in place
719 # Reset our crash handler in place
719 sys.excepthook = old_excepthook
720 sys.excepthook = old_excepthook
720 sys.argv[:] = save_argv
721 sys.argv[:] = save_argv
721 IP.user_ns['__name__'] = name_save
722 IP.user_ns['__name__'] = name_save
722
723
723 msg.user_exec.release_all()
724 msg.user_exec.release_all()
724
725
725 if IP_rc.messages:
726 if IP_rc.messages:
726 msg.summary += msg.user_exec.summary_all()
727 msg.summary += msg.user_exec.summary_all()
727
728
728 # since we can't specify a null string on the cmd line, 0 is the equivalent:
729 # since we can't specify a null string on the cmd line, 0 is the equivalent:
729 if IP_rc.nosep:
730 if IP_rc.nosep:
730 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
731 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
731 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
732 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
732 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
733 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
733 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
734 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
734 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
735 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
735 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
736 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
736 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
737 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
737
738
738 # Determine how many lines at the bottom of the screen are needed for
739 # Determine how many lines at the bottom of the screen are needed for
739 # showing prompts, so we can know wheter long strings are to be printed or
740 # showing prompts, so we can know wheter long strings are to be printed or
740 # paged:
741 # paged:
741 num_lines_bot = IP_rc.separate_in.count('\n')+1
742 num_lines_bot = IP_rc.separate_in.count('\n')+1
742 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
743 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
743
744
744 # configure startup banner
745 # configure startup banner
745 if IP_rc.c: # regular python doesn't print the banner with -c
746 if IP_rc.c: # regular python doesn't print the banner with -c
746 IP_rc.banner = 0
747 IP_rc.banner = 0
747 if IP_rc.banner:
748 if IP_rc.banner:
748 BANN_P = IP.BANNER_PARTS
749 BANN_P = IP.BANNER_PARTS
749 else:
750 else:
750 BANN_P = []
751 BANN_P = []
751
752
752 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
753 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
753
754
754 # add message log (possibly empty)
755 # add message log (possibly empty)
755 if msg.summary: BANN_P.append(msg.summary)
756 if msg.summary: BANN_P.append(msg.summary)
756 # Final banner is a string
757 # Final banner is a string
757 IP.BANNER = '\n'.join(BANN_P)
758 IP.BANNER = '\n'.join(BANN_P)
758
759
759 # Finalize the IPython instance. This assumes the rc structure is fully
760 # Finalize the IPython instance. This assumes the rc structure is fully
760 # in place.
761 # in place.
761 IP.post_config_initialization()
762 IP.post_config_initialization()
762
763
763 return IP
764 return IP
764 #************************ end of file <ipmaker.py> **************************
765 #************************ end of file <ipmaker.py> **************************
@@ -1,7357 +1,7366 b''
1 2008-01-11 Ville Vainio <vivainio@gmail.com>
2
3 * iplib.py, ipmaker.py: new rc option - autoexec. It's a list
4 of ipython commands to be run when IPython has started up
5 (just before running the scripts and -c arg on command line).
6
7 * ipy_user_conf.py: Added an example on how to change term
8 colors in config file (through using autoexec).
9
1 2008-01-10 Ville Vainio <vivainio@gmail.com>
10 2008-01-10 Ville Vainio <vivainio@gmail.com>
2
11
3 * Prompts.py (set_p_str): do not crash on illegal prompt strings
12 * Prompts.py (set_p_str): do not crash on illegal prompt strings
4
13
5 2008-01-08 Ville Vainio <vivainio@gmail.com>
14 2008-01-08 Ville Vainio <vivainio@gmail.com>
6
15
7 * '%macro -r' (raw mode) is now default in sh profile.
16 * '%macro -r' (raw mode) is now default in sh profile.
8
17
9 2007-12-31 Ville Vainio <vivainio@gmail.com>
18 2007-12-31 Ville Vainio <vivainio@gmail.com>
10
19
11 * completer.py: custom completer matching is now case sensitive
20 * completer.py: custom completer matching is now case sensitive
12 (#207).
21 (#207).
13
22
14 * ultraTB.py, iplib.py: Add some KeyboardInterrupt catching in
23 * ultraTB.py, iplib.py: Add some KeyboardInterrupt catching in
15 an attempt to prevent occasional crashes.
24 an attempt to prevent occasional crashes.
16
25
17 * CrashHandler.py: Crash log dump now asks user to press enter
26 * CrashHandler.py: Crash log dump now asks user to press enter
18 before exiting.
27 before exiting.
19
28
20 * Store _ip in user_ns instead of __builtin__, enabling safer
29 * Store _ip in user_ns instead of __builtin__, enabling safer
21 coexistence of multiple IPython instances in the same python
30 coexistence of multiple IPython instances in the same python
22 interpreter (#197).
31 interpreter (#197).
23
32
24 * Debugger.py, ipmaker.py: Need to add '-pydb' command line
33 * Debugger.py, ipmaker.py: Need to add '-pydb' command line
25 switch to enable pydb in post-mortem debugging and %run -d.
34 switch to enable pydb in post-mortem debugging and %run -d.
26
35
27 2007-12-28 Ville Vainio <vivainio@gmail.com>
36 2007-12-28 Ville Vainio <vivainio@gmail.com>
28
37
29 * ipy_server.py: TCP socket server for "remote control" of an IPython
38 * ipy_server.py: TCP socket server for "remote control" of an IPython
30 instance.
39 instance.
31
40
32 * Debugger.py: Change to PSF license
41 * Debugger.py: Change to PSF license
33
42
34 * simplegeneric.py: Add license & author notes.
43 * simplegeneric.py: Add license & author notes.
35
44
36 * ipy_fsops.py: Added PathObj and FileObj, an object-oriented way
45 * ipy_fsops.py: Added PathObj and FileObj, an object-oriented way
37 to navigate file system with a custom completer. Run
46 to navigate file system with a custom completer. Run
38 ipy_fsops.test_pathobj() to play with it.
47 ipy_fsops.test_pathobj() to play with it.
39
48
40 2007-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
49 2007-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
41
50
42 * IPython/dtutils.py: Add utilities for interactively running
51 * IPython/dtutils.py: Add utilities for interactively running
43 doctests. Still needs work to more easily handle the namespace of
52 doctests. Still needs work to more easily handle the namespace of
44 the package one may be working on, but the basics are in place.
53 the package one may be working on, but the basics are in place.
45
54
46 2007-12-27 Ville Vainio <vivainio@gmail.com>
55 2007-12-27 Ville Vainio <vivainio@gmail.com>
47
56
48 * ipy_completers.py: Applied arno's patch to get proper list of
57 * ipy_completers.py: Applied arno's patch to get proper list of
49 packages in import completer. Closes #196.
58 packages in import completer. Closes #196.
50
59
51 2007-12-20 Ville Vainio <vivainio@gmail.com>
60 2007-12-20 Ville Vainio <vivainio@gmail.com>
52
61
53 * completer.py, generics.py(complete_object): Allow
62 * completer.py, generics.py(complete_object): Allow
54 custom complers based on python objects via simplegeneric.
63 custom complers based on python objects via simplegeneric.
55 See generics.py / my_demo_complete_object
64 See generics.py / my_demo_complete_object
56
65
57 2007-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
66 2007-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
58
67
59 * IPython/Prompts.py (BasePrompt.__nonzero__): add proper boolean
68 * IPython/Prompts.py (BasePrompt.__nonzero__): add proper boolean
60 behavior to prompt objects, useful for display hooks to adjust
69 behavior to prompt objects, useful for display hooks to adjust
61 themselves depending on whether prompts will be there or not.
70 themselves depending on whether prompts will be there or not.
62
71
63 2007-12-13 Ville Vainio <vivainio@gmail.com>
72 2007-12-13 Ville Vainio <vivainio@gmail.com>
64
73
65 * iplib.py(raw_input): unix readline does not allow unicode in
74 * iplib.py(raw_input): unix readline does not allow unicode in
66 history, encode to normal string. After patch by Tiago.
75 history, encode to normal string. After patch by Tiago.
67 Close #201
76 Close #201
68
77
69 2007-12-12 Ville Vainio <vivainio@gmail.com>
78 2007-12-12 Ville Vainio <vivainio@gmail.com>
70
79
71 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of
80 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of
72 current directory.
81 current directory.
73
82
74 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
83 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
75
84
76 * IPython/Shell.py (_select_shell): add support for controlling
85 * IPython/Shell.py (_select_shell): add support for controlling
77 the pylab threading mode directly at the command line, without
86 the pylab threading mode directly at the command line, without
78 having to modify MPL config files. Added unit tests for this
87 having to modify MPL config files. Added unit tests for this
79 feature, though manual/docs update is still pending, will do later.
88 feature, though manual/docs update is still pending, will do later.
80
89
81 2007-12-11 Ville Vainio <vivainio@gmail.com>
90 2007-12-11 Ville Vainio <vivainio@gmail.com>
82
91
83 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
92 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
84 use in scripts)
93 use in scripts)
85
94
86 2007-12-07 Ville Vainio <vivainio@gmail.com>
95 2007-12-07 Ville Vainio <vivainio@gmail.com>
87
96
88 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
97 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
89 anymore (to \#) - even if it is a comment char that is implicitly
98 anymore (to \#) - even if it is a comment char that is implicitly
90 escaped in some unix shells in interactive mode, it is ok to leave
99 escaped in some unix shells in interactive mode, it is ok to leave
91 it in IPython as such.
100 it in IPython as such.
92
101
93
102
94 2007-12-01 Robert Kern <robert.kern@gmail.com>
103 2007-12-01 Robert Kern <robert.kern@gmail.com>
95
104
96 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
105 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
97 inspect.findsource(). It can now find source lines inside zipped
106 inspect.findsource(). It can now find source lines inside zipped
98 packages.
107 packages.
99
108
100 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
109 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
101 in the frame's namespace before trusting the filename in the code object
110 in the frame's namespace before trusting the filename in the code object
102 which created the frame.
111 which created the frame.
103
112
104 2007-11-29 *** Released version 0.8.2
113 2007-11-29 *** Released version 0.8.2
105
114
106 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
115 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
107
116
108 * IPython/Logger.py (Logger.logstop): add a proper logstop()
117 * IPython/Logger.py (Logger.logstop): add a proper logstop()
109 method to fully stop the logger, along with a corresponding
118 method to fully stop the logger, along with a corresponding
110 %logstop magic for interactive use.
119 %logstop magic for interactive use.
111
120
112 * IPython/Extensions/ipy_host_completers.py: added new host
121 * IPython/Extensions/ipy_host_completers.py: added new host
113 completers functionality, contributed by Gael Pasgrimaud
122 completers functionality, contributed by Gael Pasgrimaud
114 <gawel-AT-afpy.org>.
123 <gawel-AT-afpy.org>.
115
124
116 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
125 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
117
126
118 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
127 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
119 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
128 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
120 options handling. Unicode fix in %whos (committed a while ago)
129 options handling. Unicode fix in %whos (committed a while ago)
121 was also contributed by Paul.
130 was also contributed by Paul.
122
131
123 2007-11-23 Darren Dale <darren.dale@cornell.edu>
132 2007-11-23 Darren Dale <darren.dale@cornell.edu>
124 * ipy_traits_completer.py: let traits_completer respect the user's
133 * ipy_traits_completer.py: let traits_completer respect the user's
125 readline_omit__names setting.
134 readline_omit__names setting.
126
135
127 2007-11-08 Ville Vainio <vivainio@gmail.com>
136 2007-11-08 Ville Vainio <vivainio@gmail.com>
128
137
129 * ipy_completers.py (import completer): assume 'xml' module exists.
138 * ipy_completers.py (import completer): assume 'xml' module exists.
130 Do not add every module twice anymore. Closes #196.
139 Do not add every module twice anymore. Closes #196.
131
140
132 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
141 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
133 completer that uses apt-cache to search for existing packages.
142 completer that uses apt-cache to search for existing packages.
134
143
135 2007-11-06 Ville Vainio <vivainio@gmail.com>
144 2007-11-06 Ville Vainio <vivainio@gmail.com>
136
145
137 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
146 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
138 true. Closes #194.
147 true. Closes #194.
139
148
140 2007-11-01 Brian Granger <ellisonbg@gmail.com>
149 2007-11-01 Brian Granger <ellisonbg@gmail.com>
141
150
142 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
151 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
143 working with OS X 10.5 libedit implementation of readline.
152 working with OS X 10.5 libedit implementation of readline.
144
153
145 2007-10-24 Ville Vainio <vivainio@gmail.com>
154 2007-10-24 Ville Vainio <vivainio@gmail.com>
146
155
147 * iplib.py(user_setup): To route around buggy installations where
156 * iplib.py(user_setup): To route around buggy installations where
148 UserConfig is not available, create a minimal _ipython.
157 UserConfig is not available, create a minimal _ipython.
149
158
150 * iplib.py: Unicode fixes from Jorgen.
159 * iplib.py: Unicode fixes from Jorgen.
151
160
152 * genutils.py: Slist now has new method 'fields()' for extraction of
161 * genutils.py: Slist now has new method 'fields()' for extraction of
153 whitespace-separated fields from line-oriented data.
162 whitespace-separated fields from line-oriented data.
154
163
155 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
164 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
156
165
157 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
166 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
158 when querying objects with no __class__ attribute (such as
167 when querying objects with no __class__ attribute (such as
159 f2py-generated modules).
168 f2py-generated modules).
160
169
161 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
170 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
162
171
163 * IPython/Magic.py (magic_time): track compilation time and report
172 * IPython/Magic.py (magic_time): track compilation time and report
164 it if longer than 0.1s (fix done to %time and %timeit). After a
173 it if longer than 0.1s (fix done to %time and %timeit). After a
165 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
174 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
166
175
167 2007-09-18 Ville Vainio <vivainio@gmail.com>
176 2007-09-18 Ville Vainio <vivainio@gmail.com>
168
177
169 * genutils.py(make_quoted_expr): Do not use Itpl, it does
178 * genutils.py(make_quoted_expr): Do not use Itpl, it does
170 not support unicode at the moment. Fixes (many) magic calls with
179 not support unicode at the moment. Fixes (many) magic calls with
171 special characters.
180 special characters.
172
181
173 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
182 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
174
183
175 * IPython/genutils.py (doctest_reload): expose the doctest
184 * IPython/genutils.py (doctest_reload): expose the doctest
176 reloader to the user so that people can easily reset doctest while
185 reloader to the user so that people can easily reset doctest while
177 using it interactively. Fixes a problem reported by Jorgen.
186 using it interactively. Fixes a problem reported by Jorgen.
178
187
179 * IPython/iplib.py (InteractiveShell.__init__): protect the
188 * IPython/iplib.py (InteractiveShell.__init__): protect the
180 FakeModule instances used for __main__ in %run calls from
189 FakeModule instances used for __main__ in %run calls from
181 deletion, so that user code defined in them isn't left with
190 deletion, so that user code defined in them isn't left with
182 dangling references due to the Python module deletion machinery.
191 dangling references due to the Python module deletion machinery.
183 This should fix the problems reported by Darren.
192 This should fix the problems reported by Darren.
184
193
185 2007-09-10 Darren Dale <dd55@cornell.edu>
194 2007-09-10 Darren Dale <dd55@cornell.edu>
186
195
187 * Cleanup of IPShellQt and IPShellQt4
196 * Cleanup of IPShellQt and IPShellQt4
188
197
189 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
198 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
190
199
191 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
200 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
192 doctest support.
201 doctest support.
193
202
194 * IPython/iplib.py (safe_execfile): minor docstring improvements.
203 * IPython/iplib.py (safe_execfile): minor docstring improvements.
195
204
196 2007-09-08 Ville Vainio <vivainio@gmail.com>
205 2007-09-08 Ville Vainio <vivainio@gmail.com>
197
206
198 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
207 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
199 directory, not the target directory.
208 directory, not the target directory.
200
209
201 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
210 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
202 exception that won't print the tracebacks. Switched many magics to
211 exception that won't print the tracebacks. Switched many magics to
203 raise them on error situations, also GetoptError is not printed
212 raise them on error situations, also GetoptError is not printed
204 anymore.
213 anymore.
205
214
206 2007-09-07 Ville Vainio <vivainio@gmail.com>
215 2007-09-07 Ville Vainio <vivainio@gmail.com>
207
216
208 * iplib.py: do not auto-alias "dir", it screws up other dir auto
217 * iplib.py: do not auto-alias "dir", it screws up other dir auto
209 aliases.
218 aliases.
210
219
211 * genutils.py: SList.grep() implemented.
220 * genutils.py: SList.grep() implemented.
212
221
213 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
222 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
214 for easy "out of the box" setup of several common editors, so that
223 for easy "out of the box" setup of several common editors, so that
215 e.g. '%edit os.path.isfile' will jump to the correct line
224 e.g. '%edit os.path.isfile' will jump to the correct line
216 automatically. Contributions for command lines of your favourite
225 automatically. Contributions for command lines of your favourite
217 editors welcome.
226 editors welcome.
218
227
219 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
228 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
220
229
221 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
230 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
222 preventing source display in certain cases. In reality I think
231 preventing source display in certain cases. In reality I think
223 the problem is with Ubuntu's Python build, but this change works
232 the problem is with Ubuntu's Python build, but this change works
224 around the issue in some cases (not in all, unfortunately). I'd
233 around the issue in some cases (not in all, unfortunately). I'd
225 filed a Python bug on this with more details, but in the change of
234 filed a Python bug on this with more details, but in the change of
226 bug trackers it seems to have been lost.
235 bug trackers it seems to have been lost.
227
236
228 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
237 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
229 not the same, it's not self-documenting, doesn't allow range
238 not the same, it's not self-documenting, doesn't allow range
230 selection, and sorts alphabetically instead of numerically.
239 selection, and sorts alphabetically instead of numerically.
231 (magic_r): restore %r. No, "up + enter. One char magic" is not
240 (magic_r): restore %r. No, "up + enter. One char magic" is not
232 the same thing, since %r takes parameters to allow fast retrieval
241 the same thing, since %r takes parameters to allow fast retrieval
233 of old commands. I've received emails from users who use this a
242 of old commands. I've received emails from users who use this a
234 LOT, so it stays.
243 LOT, so it stays.
235 (magic_automagic): restore %automagic. "use _ip.option.automagic"
244 (magic_automagic): restore %automagic. "use _ip.option.automagic"
236 is not a valid replacement b/c it doesn't provide an complete
245 is not a valid replacement b/c it doesn't provide an complete
237 explanation (which the automagic docstring does).
246 explanation (which the automagic docstring does).
238 (magic_autocall): restore %autocall, with improved docstring.
247 (magic_autocall): restore %autocall, with improved docstring.
239 Same argument as for others, "use _ip.options.autocall" is not a
248 Same argument as for others, "use _ip.options.autocall" is not a
240 valid replacement.
249 valid replacement.
241 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
250 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
242 tutorials and online docs.
251 tutorials and online docs.
243
252
244 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
253 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
245
254
246 * IPython/usage.py (quick_reference): mention magics in quickref,
255 * IPython/usage.py (quick_reference): mention magics in quickref,
247 modified main banner to mention %quickref.
256 modified main banner to mention %quickref.
248
257
249 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
258 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
250
259
251 2007-09-06 Ville Vainio <vivainio@gmail.com>
260 2007-09-06 Ville Vainio <vivainio@gmail.com>
252
261
253 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
262 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
254 Callable aliases now pass the _ip as first arg. This breaks
263 Callable aliases now pass the _ip as first arg. This breaks
255 compatibility with earlier 0.8.2.svn series! (though they should
264 compatibility with earlier 0.8.2.svn series! (though they should
256 not have been in use yet outside these few extensions)
265 not have been in use yet outside these few extensions)
257
266
258 2007-09-05 Ville Vainio <vivainio@gmail.com>
267 2007-09-05 Ville Vainio <vivainio@gmail.com>
259
268
260 * external/mglob.py: expand('dirname') => ['dirname'], instead
269 * external/mglob.py: expand('dirname') => ['dirname'], instead
261 of ['dirname/foo','dirname/bar', ...].
270 of ['dirname/foo','dirname/bar', ...].
262
271
263 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
272 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
264 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
273 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
265 is useful for others as well).
274 is useful for others as well).
266
275
267 * iplib.py: on callable aliases (as opposed to old style aliases),
276 * iplib.py: on callable aliases (as opposed to old style aliases),
268 do var_expand() immediately, and use make_quoted_expr instead
277 do var_expand() immediately, and use make_quoted_expr instead
269 of hardcoded r"""
278 of hardcoded r"""
270
279
271 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
280 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
272 if not available load ipy_fsops.py for cp, mv, etc. replacements
281 if not available load ipy_fsops.py for cp, mv, etc. replacements
273
282
274 * OInspect.py, ipy_which.py: improve %which and obj? for callable
283 * OInspect.py, ipy_which.py: improve %which and obj? for callable
275 aliases
284 aliases
276
285
277 2007-09-04 Ville Vainio <vivainio@gmail.com>
286 2007-09-04 Ville Vainio <vivainio@gmail.com>
278
287
279 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
288 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
280 Relicensed under BSD with the authors approval.
289 Relicensed under BSD with the authors approval.
281
290
282 * ipmaker.py, usage.py: Remove %magic from default banner, improve
291 * ipmaker.py, usage.py: Remove %magic from default banner, improve
283 %quickref
292 %quickref
284
293
285 2007-09-03 Ville Vainio <vivainio@gmail.com>
294 2007-09-03 Ville Vainio <vivainio@gmail.com>
286
295
287 * Magic.py: %time now passes expression through prefilter,
296 * Magic.py: %time now passes expression through prefilter,
288 allowing IPython syntax.
297 allowing IPython syntax.
289
298
290 2007-09-01 Ville Vainio <vivainio@gmail.com>
299 2007-09-01 Ville Vainio <vivainio@gmail.com>
291
300
292 * ipmaker.py: Always show full traceback when newstyle config fails
301 * ipmaker.py: Always show full traceback when newstyle config fails
293
302
294 2007-08-27 Ville Vainio <vivainio@gmail.com>
303 2007-08-27 Ville Vainio <vivainio@gmail.com>
295
304
296 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
305 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
297
306
298 2007-08-26 Ville Vainio <vivainio@gmail.com>
307 2007-08-26 Ville Vainio <vivainio@gmail.com>
299
308
300 * ipmaker.py: Command line args have the highest priority again
309 * ipmaker.py: Command line args have the highest priority again
301
310
302 * iplib.py, ipmaker.py: -i command line argument now behaves as in
311 * iplib.py, ipmaker.py: -i command line argument now behaves as in
303 normal python, i.e. leaves the IPython session running after -c
312 normal python, i.e. leaves the IPython session running after -c
304 command or running a batch file from command line.
313 command or running a batch file from command line.
305
314
306 2007-08-22 Ville Vainio <vivainio@gmail.com>
315 2007-08-22 Ville Vainio <vivainio@gmail.com>
307
316
308 * iplib.py: no extra empty (last) line in raw hist w/ multiline
317 * iplib.py: no extra empty (last) line in raw hist w/ multiline
309 statements
318 statements
310
319
311 * logger.py: Fix bug where blank lines in history were not
320 * logger.py: Fix bug where blank lines in history were not
312 added until AFTER adding the current line; translated and raw
321 added until AFTER adding the current line; translated and raw
313 history should finally be in sync with prompt now.
322 history should finally be in sync with prompt now.
314
323
315 * ipy_completers.py: quick_completer now makes it easy to create
324 * ipy_completers.py: quick_completer now makes it easy to create
316 trivial custom completers
325 trivial custom completers
317
326
318 * clearcmd.py: shadow history compression & erasing, fixed input hist
327 * clearcmd.py: shadow history compression & erasing, fixed input hist
319 clearing.
328 clearing.
320
329
321 * envpersist.py, history.py: %env (sh profile only), %hist completers
330 * envpersist.py, history.py: %env (sh profile only), %hist completers
322
331
323 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
332 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
324 term title now include the drive letter, and always use / instead of
333 term title now include the drive letter, and always use / instead of
325 os.sep (as per recommended approach for win32 ipython in general).
334 os.sep (as per recommended approach for win32 ipython in general).
326
335
327 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
336 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
328 plain python scripts from ipykit command line by running
337 plain python scripts from ipykit command line by running
329 "py myscript.py", even w/o installed python.
338 "py myscript.py", even w/o installed python.
330
339
331 2007-08-21 Ville Vainio <vivainio@gmail.com>
340 2007-08-21 Ville Vainio <vivainio@gmail.com>
332
341
333 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
342 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
334 (for backwards compatibility)
343 (for backwards compatibility)
335
344
336 * history.py: switch back to %hist -t from %hist -r as default.
345 * history.py: switch back to %hist -t from %hist -r as default.
337 At least until raw history is fixed for good.
346 At least until raw history is fixed for good.
338
347
339 2007-08-20 Ville Vainio <vivainio@gmail.com>
348 2007-08-20 Ville Vainio <vivainio@gmail.com>
340
349
341 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
350 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
342 locate alias redeclarations etc. Also, avoid handling
351 locate alias redeclarations etc. Also, avoid handling
343 _ip.IP.alias_table directly, prefer using _ip.defalias.
352 _ip.IP.alias_table directly, prefer using _ip.defalias.
344
353
345
354
346 2007-08-15 Ville Vainio <vivainio@gmail.com>
355 2007-08-15 Ville Vainio <vivainio@gmail.com>
347
356
348 * prefilter.py: ! is now always served first
357 * prefilter.py: ! is now always served first
349
358
350 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
359 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
351
360
352 * IPython/iplib.py (safe_execfile): fix the SystemExit
361 * IPython/iplib.py (safe_execfile): fix the SystemExit
353 auto-suppression code to work in Python2.4 (the internal structure
362 auto-suppression code to work in Python2.4 (the internal structure
354 of that exception changed and I'd only tested the code with 2.5).
363 of that exception changed and I'd only tested the code with 2.5).
355 Bug reported by a SciPy attendee.
364 Bug reported by a SciPy attendee.
356
365
357 2007-08-13 Ville Vainio <vivainio@gmail.com>
366 2007-08-13 Ville Vainio <vivainio@gmail.com>
358
367
359 * prefilter.py: reverted !c:/bin/foo fix, made % in
368 * prefilter.py: reverted !c:/bin/foo fix, made % in
360 multiline specials work again
369 multiline specials work again
361
370
362 2007-08-13 Ville Vainio <vivainio@gmail.com>
371 2007-08-13 Ville Vainio <vivainio@gmail.com>
363
372
364 * prefilter.py: Take more care to special-case !, so that
373 * prefilter.py: Take more care to special-case !, so that
365 !c:/bin/foo.exe works.
374 !c:/bin/foo.exe works.
366
375
367 * setup.py: if we are building eggs, strip all docs and
376 * setup.py: if we are building eggs, strip all docs and
368 examples (it doesn't make sense to bytecompile examples,
377 examples (it doesn't make sense to bytecompile examples,
369 and docs would be in an awkward place anyway).
378 and docs would be in an awkward place anyway).
370
379
371 * Ryan Krauss' patch fixes start menu shortcuts when IPython
380 * Ryan Krauss' patch fixes start menu shortcuts when IPython
372 is installed into a directory that has spaces in the name.
381 is installed into a directory that has spaces in the name.
373
382
374 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
383 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
375
384
376 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
385 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
377 doctest profile and %doctest_mode, so they actually generate the
386 doctest profile and %doctest_mode, so they actually generate the
378 blank lines needed by doctest to separate individual tests.
387 blank lines needed by doctest to separate individual tests.
379
388
380 * IPython/iplib.py (safe_execfile): modify so that running code
389 * IPython/iplib.py (safe_execfile): modify so that running code
381 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
390 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
382 doesn't get a printed traceback. Any other value in sys.exit(),
391 doesn't get a printed traceback. Any other value in sys.exit(),
383 including the empty call, still generates a traceback. This
392 including the empty call, still generates a traceback. This
384 enables use of %run without having to pass '-e' for codes that
393 enables use of %run without having to pass '-e' for codes that
385 correctly set the exit status flag.
394 correctly set the exit status flag.
386
395
387 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
396 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
388
397
389 * IPython/iplib.py (InteractiveShell.post_config_initialization):
398 * IPython/iplib.py (InteractiveShell.post_config_initialization):
390 fix problems with doctests failing when run inside IPython due to
399 fix problems with doctests failing when run inside IPython due to
391 IPython's modifications of sys.displayhook.
400 IPython's modifications of sys.displayhook.
392
401
393 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
402 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
394
403
395 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
404 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
396 a string with names.
405 a string with names.
397
406
398 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
407 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
399
408
400 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
409 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
401 magic to toggle on/off the doctest pasting support without having
410 magic to toggle on/off the doctest pasting support without having
402 to leave a session to switch to a separate profile.
411 to leave a session to switch to a separate profile.
403
412
404 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
413 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
405
414
406 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
415 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
407 introduce a blank line between inputs, to conform to doctest
416 introduce a blank line between inputs, to conform to doctest
408 requirements.
417 requirements.
409
418
410 * IPython/OInspect.py (Inspector.pinfo): fix another part where
419 * IPython/OInspect.py (Inspector.pinfo): fix another part where
411 auto-generated docstrings for new-style classes were showing up.
420 auto-generated docstrings for new-style classes were showing up.
412
421
413 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
422 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
414
423
415 * api_changes: Add new file to track backward-incompatible
424 * api_changes: Add new file to track backward-incompatible
416 user-visible changes.
425 user-visible changes.
417
426
418 2007-08-06 Ville Vainio <vivainio@gmail.com>
427 2007-08-06 Ville Vainio <vivainio@gmail.com>
419
428
420 * ipmaker.py: fix bug where user_config_ns didn't exist at all
429 * ipmaker.py: fix bug where user_config_ns didn't exist at all
421 before all the config files were handled.
430 before all the config files were handled.
422
431
423 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
432 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
424
433
425 * IPython/irunner.py (RunnerFactory): Add new factory class for
434 * IPython/irunner.py (RunnerFactory): Add new factory class for
426 creating reusable runners based on filenames.
435 creating reusable runners based on filenames.
427
436
428 * IPython/Extensions/ipy_profile_doctest.py: New profile for
437 * IPython/Extensions/ipy_profile_doctest.py: New profile for
429 doctest support. It sets prompts/exceptions as similar to
438 doctest support. It sets prompts/exceptions as similar to
430 standard Python as possible, so that ipython sessions in this
439 standard Python as possible, so that ipython sessions in this
431 profile can be easily pasted as doctests with minimal
440 profile can be easily pasted as doctests with minimal
432 modifications. It also enables pasting of doctests from external
441 modifications. It also enables pasting of doctests from external
433 sources (even if they have leading whitespace), so that you can
442 sources (even if they have leading whitespace), so that you can
434 rerun doctests from existing sources.
443 rerun doctests from existing sources.
435
444
436 * IPython/iplib.py (_prefilter): fix a buglet where after entering
445 * IPython/iplib.py (_prefilter): fix a buglet where after entering
437 some whitespace, the prompt would become a continuation prompt
446 some whitespace, the prompt would become a continuation prompt
438 with no way of exiting it other than Ctrl-C. This fix brings us
447 with no way of exiting it other than Ctrl-C. This fix brings us
439 into conformity with how the default python prompt works.
448 into conformity with how the default python prompt works.
440
449
441 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
450 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
442 Add support for pasting not only lines that start with '>>>', but
451 Add support for pasting not only lines that start with '>>>', but
443 also with ' >>>'. That is, arbitrary whitespace can now precede
452 also with ' >>>'. That is, arbitrary whitespace can now precede
444 the prompts. This makes the system useful for pasting doctests
453 the prompts. This makes the system useful for pasting doctests
445 from docstrings back into a normal session.
454 from docstrings back into a normal session.
446
455
447 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
456 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
448
457
449 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
458 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
450 r1357, which had killed multiple invocations of an embedded
459 r1357, which had killed multiple invocations of an embedded
451 ipython (this means that example-embed has been broken for over 1
460 ipython (this means that example-embed has been broken for over 1
452 year!!!). Rather than possibly breaking the batch stuff for which
461 year!!!). Rather than possibly breaking the batch stuff for which
453 the code in iplib.py/interact was introduced, I worked around the
462 the code in iplib.py/interact was introduced, I worked around the
454 problem in the embedding class in Shell.py. We really need a
463 problem in the embedding class in Shell.py. We really need a
455 bloody test suite for this code, I'm sick of finding stuff that
464 bloody test suite for this code, I'm sick of finding stuff that
456 used to work breaking left and right every time I use an old
465 used to work breaking left and right every time I use an old
457 feature I hadn't touched in a few months.
466 feature I hadn't touched in a few months.
458 (kill_embedded): Add a new magic that only shows up in embedded
467 (kill_embedded): Add a new magic that only shows up in embedded
459 mode, to allow users to permanently deactivate an embedded instance.
468 mode, to allow users to permanently deactivate an embedded instance.
460
469
461 2007-08-01 Ville Vainio <vivainio@gmail.com>
470 2007-08-01 Ville Vainio <vivainio@gmail.com>
462
471
463 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
472 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
464 history gets out of sync on runlines (e.g. when running macros).
473 history gets out of sync on runlines (e.g. when running macros).
465
474
466 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
475 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
467
476
468 * IPython/Magic.py (magic_colors): fix win32-related error message
477 * IPython/Magic.py (magic_colors): fix win32-related error message
469 that could appear under *nix when readline was missing. Patch by
478 that could appear under *nix when readline was missing. Patch by
470 Scott Jackson, closes #175.
479 Scott Jackson, closes #175.
471
480
472 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
481 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
473
482
474 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
483 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
475 completer that it traits-aware, so that traits objects don't show
484 completer that it traits-aware, so that traits objects don't show
476 all of their internal attributes all the time.
485 all of their internal attributes all the time.
477
486
478 * IPython/genutils.py (dir2): moved this code from inside
487 * IPython/genutils.py (dir2): moved this code from inside
479 completer.py to expose it publicly, so I could use it in the
488 completer.py to expose it publicly, so I could use it in the
480 wildcards bugfix.
489 wildcards bugfix.
481
490
482 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
491 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
483 Stefan with Traits.
492 Stefan with Traits.
484
493
485 * IPython/completer.py (Completer.attr_matches): change internal
494 * IPython/completer.py (Completer.attr_matches): change internal
486 var name from 'object' to 'obj', since 'object' is now a builtin
495 var name from 'object' to 'obj', since 'object' is now a builtin
487 and this can lead to weird bugs if reusing this code elsewhere.
496 and this can lead to weird bugs if reusing this code elsewhere.
488
497
489 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
498 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
490
499
491 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
500 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
492 'foo?' and update the code to prevent printing of default
501 'foo?' and update the code to prevent printing of default
493 docstrings that started appearing after I added support for
502 docstrings that started appearing after I added support for
494 new-style classes. The approach I'm using isn't ideal (I just
503 new-style classes. The approach I'm using isn't ideal (I just
495 special-case those strings) but I'm not sure how to more robustly
504 special-case those strings) but I'm not sure how to more robustly
496 differentiate between truly user-written strings and Python's
505 differentiate between truly user-written strings and Python's
497 automatic ones.
506 automatic ones.
498
507
499 2007-07-09 Ville Vainio <vivainio@gmail.com>
508 2007-07-09 Ville Vainio <vivainio@gmail.com>
500
509
501 * completer.py: Applied Matthew Neeley's patch:
510 * completer.py: Applied Matthew Neeley's patch:
502 Dynamic attributes from trait_names and _getAttributeNames are added
511 Dynamic attributes from trait_names and _getAttributeNames are added
503 to the list of tab completions, but when this happens, the attribute
512 to the list of tab completions, but when this happens, the attribute
504 list is turned into a set, so the attributes are unordered when
513 list is turned into a set, so the attributes are unordered when
505 printed, which makes it hard to find the right completion. This patch
514 printed, which makes it hard to find the right completion. This patch
506 turns this set back into a list and sort it.
515 turns this set back into a list and sort it.
507
516
508 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
517 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
509
518
510 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
519 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
511 classes in various inspector functions.
520 classes in various inspector functions.
512
521
513 2007-06-28 Ville Vainio <vivainio@gmail.com>
522 2007-06-28 Ville Vainio <vivainio@gmail.com>
514
523
515 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
524 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
516 Implement "shadow" namespace, and callable aliases that reside there.
525 Implement "shadow" namespace, and callable aliases that reside there.
517 Use them by:
526 Use them by:
518
527
519 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
528 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
520
529
521 foo hello world
530 foo hello world
522 (gets translated to:)
531 (gets translated to:)
523 _sh.foo(r"""hello world""")
532 _sh.foo(r"""hello world""")
524
533
525 In practice, this kind of alias can take the role of a magic function
534 In practice, this kind of alias can take the role of a magic function
526
535
527 * New generic inspect_object, called on obj? and obj??
536 * New generic inspect_object, called on obj? and obj??
528
537
529 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
538 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
530
539
531 * IPython/ultraTB.py (findsource): fix a problem with
540 * IPython/ultraTB.py (findsource): fix a problem with
532 inspect.getfile that can cause crashes during traceback construction.
541 inspect.getfile that can cause crashes during traceback construction.
533
542
534 2007-06-14 Ville Vainio <vivainio@gmail.com>
543 2007-06-14 Ville Vainio <vivainio@gmail.com>
535
544
536 * iplib.py (handle_auto): Try to use ascii for printing "--->"
545 * iplib.py (handle_auto): Try to use ascii for printing "--->"
537 autocall rewrite indication, becausesometimes unicode fails to print
546 autocall rewrite indication, becausesometimes unicode fails to print
538 properly (and you get ' - - - '). Use plain uncoloured ---> for
547 properly (and you get ' - - - '). Use plain uncoloured ---> for
539 unicode.
548 unicode.
540
549
541 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
550 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
542
551
543 . pickleshare 'hash' commands (hget, hset, hcompress,
552 . pickleshare 'hash' commands (hget, hset, hcompress,
544 hdict) for efficient shadow history storage.
553 hdict) for efficient shadow history storage.
545
554
546 2007-06-13 Ville Vainio <vivainio@gmail.com>
555 2007-06-13 Ville Vainio <vivainio@gmail.com>
547
556
548 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
557 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
549 Added kw arg 'interactive', tell whether vars should be visible
558 Added kw arg 'interactive', tell whether vars should be visible
550 with %whos.
559 with %whos.
551
560
552 2007-06-11 Ville Vainio <vivainio@gmail.com>
561 2007-06-11 Ville Vainio <vivainio@gmail.com>
553
562
554 * pspersistence.py, Magic.py, iplib.py: directory history now saved
563 * pspersistence.py, Magic.py, iplib.py: directory history now saved
555 to db
564 to db
556
565
557 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
566 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
558 Also, it exits IPython immediately after evaluating the command (just like
567 Also, it exits IPython immediately after evaluating the command (just like
559 std python)
568 std python)
560
569
561 2007-06-05 Walter Doerwald <walter@livinglogic.de>
570 2007-06-05 Walter Doerwald <walter@livinglogic.de>
562
571
563 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
572 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
564 Python string and captures the output. (Idea and original patch by
573 Python string and captures the output. (Idea and original patch by
565 Stefan van der Walt)
574 Stefan van der Walt)
566
575
567 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
576 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
568
577
569 * IPython/ultraTB.py (VerboseTB.text): update printing of
578 * IPython/ultraTB.py (VerboseTB.text): update printing of
570 exception types for Python 2.5 (now all exceptions in the stdlib
579 exception types for Python 2.5 (now all exceptions in the stdlib
571 are new-style classes).
580 are new-style classes).
572
581
573 2007-05-31 Walter Doerwald <walter@livinglogic.de>
582 2007-05-31 Walter Doerwald <walter@livinglogic.de>
574
583
575 * IPython/Extensions/igrid.py: Add new commands refresh and
584 * IPython/Extensions/igrid.py: Add new commands refresh and
576 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
585 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
577 the iterator once (refresh) or after every x seconds (refresh_timer).
586 the iterator once (refresh) or after every x seconds (refresh_timer).
578 Add a working implementation of "searchexpression", where the text
587 Add a working implementation of "searchexpression", where the text
579 entered is not the text to search for, but an expression that must
588 entered is not the text to search for, but an expression that must
580 be true. Added display of shortcuts to the menu. Added commands "pickinput"
589 be true. Added display of shortcuts to the menu. Added commands "pickinput"
581 and "pickinputattr" that put the object or attribute under the cursor
590 and "pickinputattr" that put the object or attribute under the cursor
582 in the input line. Split the statusbar to be able to display the currently
591 in the input line. Split the statusbar to be able to display the currently
583 active refresh interval. (Patch by Nik Tautenhahn)
592 active refresh interval. (Patch by Nik Tautenhahn)
584
593
585 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
594 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
586
595
587 * fixing set_term_title to use ctypes as default
596 * fixing set_term_title to use ctypes as default
588
597
589 * fixing set_term_title fallback to work when curent dir
598 * fixing set_term_title fallback to work when curent dir
590 is on a windows network share
599 is on a windows network share
591
600
592 2007-05-28 Ville Vainio <vivainio@gmail.com>
601 2007-05-28 Ville Vainio <vivainio@gmail.com>
593
602
594 * %cpaste: strip + with > from left (diffs).
603 * %cpaste: strip + with > from left (diffs).
595
604
596 * iplib.py: Fix crash when readline not installed
605 * iplib.py: Fix crash when readline not installed
597
606
598 2007-05-26 Ville Vainio <vivainio@gmail.com>
607 2007-05-26 Ville Vainio <vivainio@gmail.com>
599
608
600 * generics.py: intruduce easy to extend result_display generic
609 * generics.py: intruduce easy to extend result_display generic
601 function (using simplegeneric.py).
610 function (using simplegeneric.py).
602
611
603 * Fixed the append functionality of %set.
612 * Fixed the append functionality of %set.
604
613
605 2007-05-25 Ville Vainio <vivainio@gmail.com>
614 2007-05-25 Ville Vainio <vivainio@gmail.com>
606
615
607 * New magic: %rep (fetch / run old commands from history)
616 * New magic: %rep (fetch / run old commands from history)
608
617
609 * New extension: mglob (%mglob magic), for powerful glob / find /filter
618 * New extension: mglob (%mglob magic), for powerful glob / find /filter
610 like functionality
619 like functionality
611
620
612 % maghistory.py: %hist -g PATTERM greps the history for pattern
621 % maghistory.py: %hist -g PATTERM greps the history for pattern
613
622
614 2007-05-24 Walter Doerwald <walter@livinglogic.de>
623 2007-05-24 Walter Doerwald <walter@livinglogic.de>
615
624
616 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
625 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
617 browse the IPython input history
626 browse the IPython input history
618
627
619 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
628 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
620 (mapped to "i") can be used to put the object under the curser in the input
629 (mapped to "i") can be used to put the object under the curser in the input
621 line. pickinputattr (mapped to "I") does the same for the attribute under
630 line. pickinputattr (mapped to "I") does the same for the attribute under
622 the cursor.
631 the cursor.
623
632
624 2007-05-24 Ville Vainio <vivainio@gmail.com>
633 2007-05-24 Ville Vainio <vivainio@gmail.com>
625
634
626 * Grand magic cleansing (changeset [2380]):
635 * Grand magic cleansing (changeset [2380]):
627
636
628 * Introduce ipy_legacy.py where the following magics were
637 * Introduce ipy_legacy.py where the following magics were
629 moved:
638 moved:
630
639
631 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
640 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
632
641
633 If you need them, either use default profile or "import ipy_legacy"
642 If you need them, either use default profile or "import ipy_legacy"
634 in your ipy_user_conf.py
643 in your ipy_user_conf.py
635
644
636 * Move sh and scipy profile to Extensions from UserConfig. this implies
645 * Move sh and scipy profile to Extensions from UserConfig. this implies
637 you should not edit them, but you don't need to run %upgrade when
646 you should not edit them, but you don't need to run %upgrade when
638 upgrading IPython anymore.
647 upgrading IPython anymore.
639
648
640 * %hist/%history now operates in "raw" mode by default. To get the old
649 * %hist/%history now operates in "raw" mode by default. To get the old
641 behaviour, run '%hist -n' (native mode).
650 behaviour, run '%hist -n' (native mode).
642
651
643 * split ipy_stock_completers.py to ipy_stock_completers.py and
652 * split ipy_stock_completers.py to ipy_stock_completers.py and
644 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
653 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
645 installed as default.
654 installed as default.
646
655
647 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
656 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
648 handling.
657 handling.
649
658
650 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
659 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
651 input if readline is available.
660 input if readline is available.
652
661
653 2007-05-23 Ville Vainio <vivainio@gmail.com>
662 2007-05-23 Ville Vainio <vivainio@gmail.com>
654
663
655 * macro.py: %store uses __getstate__ properly
664 * macro.py: %store uses __getstate__ properly
656
665
657 * exesetup.py: added new setup script for creating
666 * exesetup.py: added new setup script for creating
658 standalone IPython executables with py2exe (i.e.
667 standalone IPython executables with py2exe (i.e.
659 no python installation required).
668 no python installation required).
660
669
661 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
670 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
662 its place.
671 its place.
663
672
664 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
673 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
665
674
666 2007-05-21 Ville Vainio <vivainio@gmail.com>
675 2007-05-21 Ville Vainio <vivainio@gmail.com>
667
676
668 * platutil_win32.py (set_term_title): handle
677 * platutil_win32.py (set_term_title): handle
669 failure of 'title' system call properly.
678 failure of 'title' system call properly.
670
679
671 2007-05-17 Walter Doerwald <walter@livinglogic.de>
680 2007-05-17 Walter Doerwald <walter@livinglogic.de>
672
681
673 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
682 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
674 (Bug detected by Paul Mueller).
683 (Bug detected by Paul Mueller).
675
684
676 2007-05-16 Ville Vainio <vivainio@gmail.com>
685 2007-05-16 Ville Vainio <vivainio@gmail.com>
677
686
678 * ipy_profile_sci.py, ipython_win_post_install.py: Create
687 * ipy_profile_sci.py, ipython_win_post_install.py: Create
679 new "sci" profile, effectively a modern version of the old
688 new "sci" profile, effectively a modern version of the old
680 "scipy" profile (which is now slated for deprecation).
689 "scipy" profile (which is now slated for deprecation).
681
690
682 2007-05-15 Ville Vainio <vivainio@gmail.com>
691 2007-05-15 Ville Vainio <vivainio@gmail.com>
683
692
684 * pycolorize.py, pycolor.1: Paul Mueller's patches that
693 * pycolorize.py, pycolor.1: Paul Mueller's patches that
685 make pycolorize read input from stdin when run without arguments.
694 make pycolorize read input from stdin when run without arguments.
686
695
687 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
696 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
688
697
689 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
698 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
690 it in sh profile (instead of ipy_system_conf.py).
699 it in sh profile (instead of ipy_system_conf.py).
691
700
692 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
701 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
693 aliases are now lower case on windows (MyCommand.exe => mycommand).
702 aliases are now lower case on windows (MyCommand.exe => mycommand).
694
703
695 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
704 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
696 Macros are now callable objects that inherit from ipapi.IPyAutocall,
705 Macros are now callable objects that inherit from ipapi.IPyAutocall,
697 i.e. get autocalled regardless of system autocall setting.
706 i.e. get autocalled regardless of system autocall setting.
698
707
699 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
708 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
700
709
701 * IPython/rlineimpl.py: check for clear_history in readline and
710 * IPython/rlineimpl.py: check for clear_history in readline and
702 make it a dummy no-op if not available. This function isn't
711 make it a dummy no-op if not available. This function isn't
703 guaranteed to be in the API and appeared in Python 2.4, so we need
712 guaranteed to be in the API and appeared in Python 2.4, so we need
704 to check it ourselves. Also, clean up this file quite a bit.
713 to check it ourselves. Also, clean up this file quite a bit.
705
714
706 * ipython.1: update man page and full manual with information
715 * ipython.1: update man page and full manual with information
707 about threads (remove outdated warning). Closes #151.
716 about threads (remove outdated warning). Closes #151.
708
717
709 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
718 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
710
719
711 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
720 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
712 in trunk (note that this made it into the 0.8.1 release already,
721 in trunk (note that this made it into the 0.8.1 release already,
713 but the changelogs didn't get coordinated). Many thanks to Gael
722 but the changelogs didn't get coordinated). Many thanks to Gael
714 Varoquaux <gael.varoquaux-AT-normalesup.org>
723 Varoquaux <gael.varoquaux-AT-normalesup.org>
715
724
716 2007-05-09 *** Released version 0.8.1
725 2007-05-09 *** Released version 0.8.1
717
726
718 2007-05-10 Walter Doerwald <walter@livinglogic.de>
727 2007-05-10 Walter Doerwald <walter@livinglogic.de>
719
728
720 * IPython/Extensions/igrid.py: Incorporate html help into
729 * IPython/Extensions/igrid.py: Incorporate html help into
721 the module, so we don't have to search for the file.
730 the module, so we don't have to search for the file.
722
731
723 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
732 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
724
733
725 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
734 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
726
735
727 2007-04-30 Ville Vainio <vivainio@gmail.com>
736 2007-04-30 Ville Vainio <vivainio@gmail.com>
728
737
729 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
738 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
730 user has illegal (non-ascii) home directory name
739 user has illegal (non-ascii) home directory name
731
740
732 2007-04-27 Ville Vainio <vivainio@gmail.com>
741 2007-04-27 Ville Vainio <vivainio@gmail.com>
733
742
734 * platutils_win32.py: implement set_term_title for windows
743 * platutils_win32.py: implement set_term_title for windows
735
744
736 * Update version number
745 * Update version number
737
746
738 * ipy_profile_sh.py: more informative prompt (2 dir levels)
747 * ipy_profile_sh.py: more informative prompt (2 dir levels)
739
748
740 2007-04-26 Walter Doerwald <walter@livinglogic.de>
749 2007-04-26 Walter Doerwald <walter@livinglogic.de>
741
750
742 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
751 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
743 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
752 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
744 bug discovered by Ville).
753 bug discovered by Ville).
745
754
746 2007-04-26 Ville Vainio <vivainio@gmail.com>
755 2007-04-26 Ville Vainio <vivainio@gmail.com>
747
756
748 * Extensions/ipy_completers.py: Olivier's module completer now
757 * Extensions/ipy_completers.py: Olivier's module completer now
749 saves the list of root modules if it takes > 4 secs on the first run.
758 saves the list of root modules if it takes > 4 secs on the first run.
750
759
751 * Magic.py (%rehashx): %rehashx now clears the completer cache
760 * Magic.py (%rehashx): %rehashx now clears the completer cache
752
761
753
762
754 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
763 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
755
764
756 * ipython.el: fix incorrect color scheme, reported by Stefan.
765 * ipython.el: fix incorrect color scheme, reported by Stefan.
757 Closes #149.
766 Closes #149.
758
767
759 * IPython/PyColorize.py (Parser.format2): fix state-handling
768 * IPython/PyColorize.py (Parser.format2): fix state-handling
760 logic. I still don't like how that code handles state, but at
769 logic. I still don't like how that code handles state, but at
761 least now it should be correct, if inelegant. Closes #146.
770 least now it should be correct, if inelegant. Closes #146.
762
771
763 2007-04-25 Ville Vainio <vivainio@gmail.com>
772 2007-04-25 Ville Vainio <vivainio@gmail.com>
764
773
765 * Extensions/ipy_which.py: added extension for %which magic, works
774 * Extensions/ipy_which.py: added extension for %which magic, works
766 a lot like unix 'which' but also finds and expands aliases, and
775 a lot like unix 'which' but also finds and expands aliases, and
767 allows wildcards.
776 allows wildcards.
768
777
769 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
778 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
770 as opposed to returning nothing.
779 as opposed to returning nothing.
771
780
772 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
781 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
773 ipy_stock_completers on default profile, do import on sh profile.
782 ipy_stock_completers on default profile, do import on sh profile.
774
783
775 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
784 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
776
785
777 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
786 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
778 like ipython.py foo.py which raised a IndexError.
787 like ipython.py foo.py which raised a IndexError.
779
788
780 2007-04-21 Ville Vainio <vivainio@gmail.com>
789 2007-04-21 Ville Vainio <vivainio@gmail.com>
781
790
782 * Extensions/ipy_extutil.py: added extension to manage other ipython
791 * Extensions/ipy_extutil.py: added extension to manage other ipython
783 extensions. Now only supports 'ls' == list extensions.
792 extensions. Now only supports 'ls' == list extensions.
784
793
785 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
794 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
786
795
787 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
796 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
788 would prevent use of the exception system outside of a running
797 would prevent use of the exception system outside of a running
789 IPython instance.
798 IPython instance.
790
799
791 2007-04-20 Ville Vainio <vivainio@gmail.com>
800 2007-04-20 Ville Vainio <vivainio@gmail.com>
792
801
793 * Extensions/ipy_render.py: added extension for easy
802 * Extensions/ipy_render.py: added extension for easy
794 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
803 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
795 'Iptl' template notation,
804 'Iptl' template notation,
796
805
797 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
806 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
798 safer & faster 'import' completer.
807 safer & faster 'import' completer.
799
808
800 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
809 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
801 and _ip.defalias(name, command).
810 and _ip.defalias(name, command).
802
811
803 * Extensions/ipy_exportdb.py: New extension for exporting all the
812 * Extensions/ipy_exportdb.py: New extension for exporting all the
804 %store'd data in a portable format (normal ipapi calls like
813 %store'd data in a portable format (normal ipapi calls like
805 defmacro() etc.)
814 defmacro() etc.)
806
815
807 2007-04-19 Ville Vainio <vivainio@gmail.com>
816 2007-04-19 Ville Vainio <vivainio@gmail.com>
808
817
809 * upgrade_dir.py: skip junk files like *.pyc
818 * upgrade_dir.py: skip junk files like *.pyc
810
819
811 * Release.py: version number to 0.8.1
820 * Release.py: version number to 0.8.1
812
821
813 2007-04-18 Ville Vainio <vivainio@gmail.com>
822 2007-04-18 Ville Vainio <vivainio@gmail.com>
814
823
815 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
824 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
816 and later on win32.
825 and later on win32.
817
826
818 2007-04-16 Ville Vainio <vivainio@gmail.com>
827 2007-04-16 Ville Vainio <vivainio@gmail.com>
819
828
820 * iplib.py (showtraceback): Do not crash when running w/o readline.
829 * iplib.py (showtraceback): Do not crash when running w/o readline.
821
830
822 2007-04-12 Walter Doerwald <walter@livinglogic.de>
831 2007-04-12 Walter Doerwald <walter@livinglogic.de>
823
832
824 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
833 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
825 sorted (case sensitive with files and dirs mixed).
834 sorted (case sensitive with files and dirs mixed).
826
835
827 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
836 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
828
837
829 * IPython/Release.py (version): Open trunk for 0.8.1 development.
838 * IPython/Release.py (version): Open trunk for 0.8.1 development.
830
839
831 2007-04-10 *** Released version 0.8.0
840 2007-04-10 *** Released version 0.8.0
832
841
833 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
842 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
834
843
835 * Tag 0.8.0 for release.
844 * Tag 0.8.0 for release.
836
845
837 * IPython/iplib.py (reloadhist): add API function to cleanly
846 * IPython/iplib.py (reloadhist): add API function to cleanly
838 reload the readline history, which was growing inappropriately on
847 reload the readline history, which was growing inappropriately on
839 every %run call.
848 every %run call.
840
849
841 * win32_manual_post_install.py (run): apply last part of Nicolas
850 * win32_manual_post_install.py (run): apply last part of Nicolas
842 Pernetty's patch (I'd accidentally applied it in a different
851 Pernetty's patch (I'd accidentally applied it in a different
843 directory and this particular file didn't get patched).
852 directory and this particular file didn't get patched).
844
853
845 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
854 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
846
855
847 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
856 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
848 find the main thread id and use the proper API call. Thanks to
857 find the main thread id and use the proper API call. Thanks to
849 Stefan for the fix.
858 Stefan for the fix.
850
859
851 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
860 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
852 unit tests to reflect fixed ticket #52, and add more tests sent by
861 unit tests to reflect fixed ticket #52, and add more tests sent by
853 him.
862 him.
854
863
855 * IPython/iplib.py (raw_input): restore the readline completer
864 * IPython/iplib.py (raw_input): restore the readline completer
856 state on every input, in case third-party code messed it up.
865 state on every input, in case third-party code messed it up.
857 (_prefilter): revert recent addition of early-escape checks which
866 (_prefilter): revert recent addition of early-escape checks which
858 prevent many valid alias calls from working.
867 prevent many valid alias calls from working.
859
868
860 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
869 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
861 flag for sigint handler so we don't run a full signal() call on
870 flag for sigint handler so we don't run a full signal() call on
862 each runcode access.
871 each runcode access.
863
872
864 * IPython/Magic.py (magic_whos): small improvement to diagnostic
873 * IPython/Magic.py (magic_whos): small improvement to diagnostic
865 message.
874 message.
866
875
867 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
876 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
868
877
869 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
878 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
870 asynchronous exceptions working, i.e., Ctrl-C can actually
879 asynchronous exceptions working, i.e., Ctrl-C can actually
871 interrupt long-running code in the multithreaded shells.
880 interrupt long-running code in the multithreaded shells.
872
881
873 This is using Tomer Filiba's great ctypes-based trick:
882 This is using Tomer Filiba's great ctypes-based trick:
874 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
883 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
875 this in the past, but hadn't been able to make it work before. So
884 this in the past, but hadn't been able to make it work before. So
876 far it looks like it's actually running, but this needs more
885 far it looks like it's actually running, but this needs more
877 testing. If it really works, I'll be *very* happy, and we'll owe
886 testing. If it really works, I'll be *very* happy, and we'll owe
878 a huge thank you to Tomer. My current implementation is ugly,
887 a huge thank you to Tomer. My current implementation is ugly,
879 hackish and uses nasty globals, but I don't want to try and clean
888 hackish and uses nasty globals, but I don't want to try and clean
880 anything up until we know if it actually works.
889 anything up until we know if it actually works.
881
890
882 NOTE: this feature needs ctypes to work. ctypes is included in
891 NOTE: this feature needs ctypes to work. ctypes is included in
883 Python2.5, but 2.4 users will need to manually install it. This
892 Python2.5, but 2.4 users will need to manually install it. This
884 feature makes multi-threaded shells so much more usable that it's
893 feature makes multi-threaded shells so much more usable that it's
885 a minor price to pay (ctypes is very easy to install, already a
894 a minor price to pay (ctypes is very easy to install, already a
886 requirement for win32 and available in major linux distros).
895 requirement for win32 and available in major linux distros).
887
896
888 2007-04-04 Ville Vainio <vivainio@gmail.com>
897 2007-04-04 Ville Vainio <vivainio@gmail.com>
889
898
890 * Extensions/ipy_completers.py, ipy_stock_completers.py:
899 * Extensions/ipy_completers.py, ipy_stock_completers.py:
891 Moved implementations of 'bundled' completers to ipy_completers.py,
900 Moved implementations of 'bundled' completers to ipy_completers.py,
892 they are only enabled in ipy_stock_completers.py.
901 they are only enabled in ipy_stock_completers.py.
893
902
894 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
903 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
895
904
896 * IPython/PyColorize.py (Parser.format2): Fix identation of
905 * IPython/PyColorize.py (Parser.format2): Fix identation of
897 colorzied output and return early if color scheme is NoColor, to
906 colorzied output and return early if color scheme is NoColor, to
898 avoid unnecessary and expensive tokenization. Closes #131.
907 avoid unnecessary and expensive tokenization. Closes #131.
899
908
900 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
909 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
901
910
902 * IPython/Debugger.py: disable the use of pydb version 1.17. It
911 * IPython/Debugger.py: disable the use of pydb version 1.17. It
903 has a critical bug (a missing import that makes post-mortem not
912 has a critical bug (a missing import that makes post-mortem not
904 work at all). Unfortunately as of this time, this is the version
913 work at all). Unfortunately as of this time, this is the version
905 shipped with Ubuntu Edgy, so quite a few people have this one. I
914 shipped with Ubuntu Edgy, so quite a few people have this one. I
906 hope Edgy will update to a more recent package.
915 hope Edgy will update to a more recent package.
907
916
908 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
917 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
909
918
910 * IPython/iplib.py (_prefilter): close #52, second part of a patch
919 * IPython/iplib.py (_prefilter): close #52, second part of a patch
911 set by Stefan (only the first part had been applied before).
920 set by Stefan (only the first part had been applied before).
912
921
913 * IPython/Extensions/ipy_stock_completers.py (module_completer):
922 * IPython/Extensions/ipy_stock_completers.py (module_completer):
914 remove usage of the dangerous pkgutil.walk_packages(). See
923 remove usage of the dangerous pkgutil.walk_packages(). See
915 details in comments left in the code.
924 details in comments left in the code.
916
925
917 * IPython/Magic.py (magic_whos): add support for numpy arrays
926 * IPython/Magic.py (magic_whos): add support for numpy arrays
918 similar to what we had for Numeric.
927 similar to what we had for Numeric.
919
928
920 * IPython/completer.py (IPCompleter.complete): extend the
929 * IPython/completer.py (IPCompleter.complete): extend the
921 complete() call API to support completions by other mechanisms
930 complete() call API to support completions by other mechanisms
922 than readline. Closes #109.
931 than readline. Closes #109.
923
932
924 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
933 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
925 protect against a bug in Python's execfile(). Closes #123.
934 protect against a bug in Python's execfile(). Closes #123.
926
935
927 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
936 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
928
937
929 * IPython/iplib.py (split_user_input): ensure that when splitting
938 * IPython/iplib.py (split_user_input): ensure that when splitting
930 user input, the part that can be treated as a python name is pure
939 user input, the part that can be treated as a python name is pure
931 ascii (Python identifiers MUST be pure ascii). Part of the
940 ascii (Python identifiers MUST be pure ascii). Part of the
932 ongoing Unicode support work.
941 ongoing Unicode support work.
933
942
934 * IPython/Prompts.py (prompt_specials_color): Add \N for the
943 * IPython/Prompts.py (prompt_specials_color): Add \N for the
935 actual prompt number, without any coloring. This allows users to
944 actual prompt number, without any coloring. This allows users to
936 produce numbered prompts with their own colors. Added after a
945 produce numbered prompts with their own colors. Added after a
937 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
946 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
938
947
939 2007-03-31 Walter Doerwald <walter@livinglogic.de>
948 2007-03-31 Walter Doerwald <walter@livinglogic.de>
940
949
941 * IPython/Extensions/igrid.py: Map the return key
950 * IPython/Extensions/igrid.py: Map the return key
942 to enter() and shift-return to enterattr().
951 to enter() and shift-return to enterattr().
943
952
944 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
953 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
945
954
946 * IPython/Magic.py (magic_psearch): add unicode support by
955 * IPython/Magic.py (magic_psearch): add unicode support by
947 encoding to ascii the input, since this routine also only deals
956 encoding to ascii the input, since this routine also only deals
948 with valid Python names. Fixes a bug reported by Stefan.
957 with valid Python names. Fixes a bug reported by Stefan.
949
958
950 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
959 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
951
960
952 * IPython/Magic.py (_inspect): convert unicode input into ascii
961 * IPython/Magic.py (_inspect): convert unicode input into ascii
953 before trying to evaluate it as a Python identifier. This fixes a
962 before trying to evaluate it as a Python identifier. This fixes a
954 problem that the new unicode support had introduced when analyzing
963 problem that the new unicode support had introduced when analyzing
955 long definition lines for functions.
964 long definition lines for functions.
956
965
957 2007-03-24 Walter Doerwald <walter@livinglogic.de>
966 2007-03-24 Walter Doerwald <walter@livinglogic.de>
958
967
959 * IPython/Extensions/igrid.py: Fix picking. Using
968 * IPython/Extensions/igrid.py: Fix picking. Using
960 igrid with wxPython 2.6 and -wthread should work now.
969 igrid with wxPython 2.6 and -wthread should work now.
961 igrid.display() simply tries to create a frame without
970 igrid.display() simply tries to create a frame without
962 an application. Only if this fails an application is created.
971 an application. Only if this fails an application is created.
963
972
964 2007-03-23 Walter Doerwald <walter@livinglogic.de>
973 2007-03-23 Walter Doerwald <walter@livinglogic.de>
965
974
966 * IPython/Extensions/path.py: Updated to version 2.2.
975 * IPython/Extensions/path.py: Updated to version 2.2.
967
976
968 2007-03-23 Ville Vainio <vivainio@gmail.com>
977 2007-03-23 Ville Vainio <vivainio@gmail.com>
969
978
970 * iplib.py: recursive alias expansion now works better, so that
979 * iplib.py: recursive alias expansion now works better, so that
971 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
980 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
972 doesn't trip up the process, if 'd' has been aliased to 'ls'.
981 doesn't trip up the process, if 'd' has been aliased to 'ls'.
973
982
974 * Extensions/ipy_gnuglobal.py added, provides %global magic
983 * Extensions/ipy_gnuglobal.py added, provides %global magic
975 for users of http://www.gnu.org/software/global
984 for users of http://www.gnu.org/software/global
976
985
977 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
986 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
978 Closes #52. Patch by Stefan van der Walt.
987 Closes #52. Patch by Stefan van der Walt.
979
988
980 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
989 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
981
990
982 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
991 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
983 respect the __file__ attribute when using %run. Thanks to a bug
992 respect the __file__ attribute when using %run. Thanks to a bug
984 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
993 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
985
994
986 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
995 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
987
996
988 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
997 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
989 input. Patch sent by Stefan.
998 input. Patch sent by Stefan.
990
999
991 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1000 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
992 * IPython/Extensions/ipy_stock_completer.py
1001 * IPython/Extensions/ipy_stock_completer.py
993 shlex_split, fix bug in shlex_split. len function
1002 shlex_split, fix bug in shlex_split. len function
994 call was missing an if statement. Caused shlex_split to
1003 call was missing an if statement. Caused shlex_split to
995 sometimes return "" as last element.
1004 sometimes return "" as last element.
996
1005
997 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
1006 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
998
1007
999 * IPython/completer.py
1008 * IPython/completer.py
1000 (IPCompleter.file_matches.single_dir_expand): fix a problem
1009 (IPCompleter.file_matches.single_dir_expand): fix a problem
1001 reported by Stefan, where directories containign a single subdir
1010 reported by Stefan, where directories containign a single subdir
1002 would be completed too early.
1011 would be completed too early.
1003
1012
1004 * IPython/Shell.py (_load_pylab): Make the execution of 'from
1013 * IPython/Shell.py (_load_pylab): Make the execution of 'from
1005 pylab import *' when -pylab is given be optional. A new flag,
1014 pylab import *' when -pylab is given be optional. A new flag,
1006 pylab_import_all controls this behavior, the default is True for
1015 pylab_import_all controls this behavior, the default is True for
1007 backwards compatibility.
1016 backwards compatibility.
1008
1017
1009 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
1018 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
1010 modified) R. Bernstein's patch for fully syntax highlighted
1019 modified) R. Bernstein's patch for fully syntax highlighted
1011 tracebacks. The functionality is also available under ultraTB for
1020 tracebacks. The functionality is also available under ultraTB for
1012 non-ipython users (someone using ultraTB but outside an ipython
1021 non-ipython users (someone using ultraTB but outside an ipython
1013 session). They can select the color scheme by setting the
1022 session). They can select the color scheme by setting the
1014 module-level global DEFAULT_SCHEME. The highlight functionality
1023 module-level global DEFAULT_SCHEME. The highlight functionality
1015 also works when debugging.
1024 also works when debugging.
1016
1025
1017 * IPython/genutils.py (IOStream.close): small patch by
1026 * IPython/genutils.py (IOStream.close): small patch by
1018 R. Bernstein for improved pydb support.
1027 R. Bernstein for improved pydb support.
1019
1028
1020 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
1029 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
1021 DaveS <davls@telus.net> to improve support of debugging under
1030 DaveS <davls@telus.net> to improve support of debugging under
1022 NTEmacs, including improved pydb behavior.
1031 NTEmacs, including improved pydb behavior.
1023
1032
1024 * IPython/Magic.py (magic_prun): Fix saving of profile info for
1033 * IPython/Magic.py (magic_prun): Fix saving of profile info for
1025 Python 2.5, where the stats object API changed a little. Thanks
1034 Python 2.5, where the stats object API changed a little. Thanks
1026 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
1035 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
1027
1036
1028 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
1037 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
1029 Pernetty's patch to improve support for (X)Emacs under Win32.
1038 Pernetty's patch to improve support for (X)Emacs under Win32.
1030
1039
1031 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
1040 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
1032
1041
1033 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
1042 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
1034 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
1043 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
1035 a report by Nik Tautenhahn.
1044 a report by Nik Tautenhahn.
1036
1045
1037 2007-03-16 Walter Doerwald <walter@livinglogic.de>
1046 2007-03-16 Walter Doerwald <walter@livinglogic.de>
1038
1047
1039 * setup.py: Add the igrid help files to the list of data files
1048 * setup.py: Add the igrid help files to the list of data files
1040 to be installed alongside igrid.
1049 to be installed alongside igrid.
1041 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
1050 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
1042 Show the input object of the igrid browser as the window tile.
1051 Show the input object of the igrid browser as the window tile.
1043 Show the object the cursor is on in the statusbar.
1052 Show the object the cursor is on in the statusbar.
1044
1053
1045 2007-03-15 Ville Vainio <vivainio@gmail.com>
1054 2007-03-15 Ville Vainio <vivainio@gmail.com>
1046
1055
1047 * Extensions/ipy_stock_completers.py: Fixed exception
1056 * Extensions/ipy_stock_completers.py: Fixed exception
1048 on mismatching quotes in %run completer. Patch by
1057 on mismatching quotes in %run completer. Patch by
1049 Jorgen Stenarson. Closes #127.
1058 Jorgen Stenarson. Closes #127.
1050
1059
1051 2007-03-14 Ville Vainio <vivainio@gmail.com>
1060 2007-03-14 Ville Vainio <vivainio@gmail.com>
1052
1061
1053 * Extensions/ext_rehashdir.py: Do not do auto_alias
1062 * Extensions/ext_rehashdir.py: Do not do auto_alias
1054 in %rehashdir, it clobbers %store'd aliases.
1063 in %rehashdir, it clobbers %store'd aliases.
1055
1064
1056 * UserConfig/ipy_profile_sh.py: envpersist.py extension
1065 * UserConfig/ipy_profile_sh.py: envpersist.py extension
1057 (beefed up %env) imported for sh profile.
1066 (beefed up %env) imported for sh profile.
1058
1067
1059 2007-03-10 Walter Doerwald <walter@livinglogic.de>
1068 2007-03-10 Walter Doerwald <walter@livinglogic.de>
1060
1069
1061 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
1070 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
1062 as the default browser.
1071 as the default browser.
1063 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1072 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1064 As igrid displays all attributes it ever encounters, fetch() (which has
1073 As igrid displays all attributes it ever encounters, fetch() (which has
1065 been renamed to _fetch()) doesn't have to recalculate the display attributes
1074 been renamed to _fetch()) doesn't have to recalculate the display attributes
1066 every time a new item is fetched. This should speed up scrolling.
1075 every time a new item is fetched. This should speed up scrolling.
1067
1076
1068 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1077 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1069
1078
1070 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1079 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1071 Schmolck's recently reported tab-completion bug (my previous one
1080 Schmolck's recently reported tab-completion bug (my previous one
1072 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1081 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1073
1082
1074 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1083 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1075
1084
1076 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1085 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1077 Close help window if exiting igrid.
1086 Close help window if exiting igrid.
1078
1087
1079 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1088 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1080
1089
1081 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1090 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1082 before calling functions from readline.
1091 before calling functions from readline.
1083
1092
1084 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1093 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1085
1094
1086 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1095 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1087 igrid is a wxPython-based display object for ipipe. If your system has
1096 igrid is a wxPython-based display object for ipipe. If your system has
1088 wx installed igrid will be the default display. Without wx ipipe falls
1097 wx installed igrid will be the default display. Without wx ipipe falls
1089 back to ibrowse (which needs curses). If no curses is installed ipipe
1098 back to ibrowse (which needs curses). If no curses is installed ipipe
1090 falls back to idump.
1099 falls back to idump.
1091
1100
1092 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1101 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1093
1102
1094 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1103 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1095 my changes from yesterday, they introduced bugs. Will reactivate
1104 my changes from yesterday, they introduced bugs. Will reactivate
1096 once I get a correct solution, which will be much easier thanks to
1105 once I get a correct solution, which will be much easier thanks to
1097 Dan Milstein's new prefilter test suite.
1106 Dan Milstein's new prefilter test suite.
1098
1107
1099 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1108 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1100
1109
1101 * IPython/iplib.py (split_user_input): fix input splitting so we
1110 * IPython/iplib.py (split_user_input): fix input splitting so we
1102 don't attempt attribute accesses on things that can't possibly be
1111 don't attempt attribute accesses on things that can't possibly be
1103 valid Python attributes. After a bug report by Alex Schmolck.
1112 valid Python attributes. After a bug report by Alex Schmolck.
1104 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1113 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1105 %magic with explicit % prefix.
1114 %magic with explicit % prefix.
1106
1115
1107 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1116 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1108
1117
1109 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1118 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1110 avoid a DeprecationWarning from GTK.
1119 avoid a DeprecationWarning from GTK.
1111
1120
1112 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1121 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1113
1122
1114 * IPython/genutils.py (clock): I modified clock() to return total
1123 * IPython/genutils.py (clock): I modified clock() to return total
1115 time, user+system. This is a more commonly needed metric. I also
1124 time, user+system. This is a more commonly needed metric. I also
1116 introduced the new clocku/clocks to get only user/system time if
1125 introduced the new clocku/clocks to get only user/system time if
1117 one wants those instead.
1126 one wants those instead.
1118
1127
1119 ***WARNING: API CHANGE*** clock() used to return only user time,
1128 ***WARNING: API CHANGE*** clock() used to return only user time,
1120 so if you want exactly the same results as before, use clocku
1129 so if you want exactly the same results as before, use clocku
1121 instead.
1130 instead.
1122
1131
1123 2007-02-22 Ville Vainio <vivainio@gmail.com>
1132 2007-02-22 Ville Vainio <vivainio@gmail.com>
1124
1133
1125 * IPython/Extensions/ipy_p4.py: Extension for improved
1134 * IPython/Extensions/ipy_p4.py: Extension for improved
1126 p4 (perforce version control system) experience.
1135 p4 (perforce version control system) experience.
1127 Adds %p4 magic with p4 command completion and
1136 Adds %p4 magic with p4 command completion and
1128 automatic -G argument (marshall output as python dict)
1137 automatic -G argument (marshall output as python dict)
1129
1138
1130 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1139 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1131
1140
1132 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1141 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1133 stop marks.
1142 stop marks.
1134 (ClearingMixin): a simple mixin to easily make a Demo class clear
1143 (ClearingMixin): a simple mixin to easily make a Demo class clear
1135 the screen in between blocks and have empty marquees. The
1144 the screen in between blocks and have empty marquees. The
1136 ClearDemo and ClearIPDemo classes that use it are included.
1145 ClearDemo and ClearIPDemo classes that use it are included.
1137
1146
1138 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1147 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1139
1148
1140 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1149 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1141 protect against exceptions at Python shutdown time. Patch
1150 protect against exceptions at Python shutdown time. Patch
1142 sumbmitted to upstream.
1151 sumbmitted to upstream.
1143
1152
1144 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1153 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1145
1154
1146 * IPython/Extensions/ibrowse.py: If entering the first object level
1155 * IPython/Extensions/ibrowse.py: If entering the first object level
1147 (i.e. the object for which the browser has been started) fails,
1156 (i.e. the object for which the browser has been started) fails,
1148 now the error is raised directly (aborting the browser) instead of
1157 now the error is raised directly (aborting the browser) instead of
1149 running into an empty levels list later.
1158 running into an empty levels list later.
1150
1159
1151 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1160 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1152
1161
1153 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1162 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1154 for the noitem object.
1163 for the noitem object.
1155
1164
1156 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1165 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1157
1166
1158 * IPython/completer.py (Completer.attr_matches): Fix small
1167 * IPython/completer.py (Completer.attr_matches): Fix small
1159 tab-completion bug with Enthought Traits objects with units.
1168 tab-completion bug with Enthought Traits objects with units.
1160 Thanks to a bug report by Tom Denniston
1169 Thanks to a bug report by Tom Denniston
1161 <tom.denniston-AT-alum.dartmouth.org>.
1170 <tom.denniston-AT-alum.dartmouth.org>.
1162
1171
1163 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1172 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1164
1173
1165 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1174 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1166 bug where only .ipy or .py would be completed. Once the first
1175 bug where only .ipy or .py would be completed. Once the first
1167 argument to %run has been given, all completions are valid because
1176 argument to %run has been given, all completions are valid because
1168 they are the arguments to the script, which may well be non-python
1177 they are the arguments to the script, which may well be non-python
1169 filenames.
1178 filenames.
1170
1179
1171 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1180 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1172 to irunner to allow it to correctly support real doctesting of
1181 to irunner to allow it to correctly support real doctesting of
1173 out-of-process ipython code.
1182 out-of-process ipython code.
1174
1183
1175 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1184 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1176 title an option (-noterm_title) because it completely breaks
1185 title an option (-noterm_title) because it completely breaks
1177 doctesting.
1186 doctesting.
1178
1187
1179 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1188 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1180
1189
1181 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1190 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1182
1191
1183 * IPython/irunner.py (main): fix small bug where extensions were
1192 * IPython/irunner.py (main): fix small bug where extensions were
1184 not being correctly recognized.
1193 not being correctly recognized.
1185
1194
1186 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1195 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1187
1196
1188 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1197 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1189 a string containing a single line yields the string itself as the
1198 a string containing a single line yields the string itself as the
1190 only item.
1199 only item.
1191
1200
1192 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1201 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1193 object if it's the same as the one on the last level (This avoids
1202 object if it's the same as the one on the last level (This avoids
1194 infinite recursion for one line strings).
1203 infinite recursion for one line strings).
1195
1204
1196 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1205 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1197
1206
1198 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1207 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1199 all output streams before printing tracebacks. This ensures that
1208 all output streams before printing tracebacks. This ensures that
1200 user output doesn't end up interleaved with traceback output.
1209 user output doesn't end up interleaved with traceback output.
1201
1210
1202 2007-01-10 Ville Vainio <vivainio@gmail.com>
1211 2007-01-10 Ville Vainio <vivainio@gmail.com>
1203
1212
1204 * Extensions/envpersist.py: Turbocharged %env that remembers
1213 * Extensions/envpersist.py: Turbocharged %env that remembers
1205 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1214 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1206 "%env VISUAL=jed".
1215 "%env VISUAL=jed".
1207
1216
1208 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1217 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1209
1218
1210 * IPython/iplib.py (showtraceback): ensure that we correctly call
1219 * IPython/iplib.py (showtraceback): ensure that we correctly call
1211 custom handlers in all cases (some with pdb were slipping through,
1220 custom handlers in all cases (some with pdb were slipping through,
1212 but I'm not exactly sure why).
1221 but I'm not exactly sure why).
1213
1222
1214 * IPython/Debugger.py (Tracer.__init__): added new class to
1223 * IPython/Debugger.py (Tracer.__init__): added new class to
1215 support set_trace-like usage of IPython's enhanced debugger.
1224 support set_trace-like usage of IPython's enhanced debugger.
1216
1225
1217 2006-12-24 Ville Vainio <vivainio@gmail.com>
1226 2006-12-24 Ville Vainio <vivainio@gmail.com>
1218
1227
1219 * ipmaker.py: more informative message when ipy_user_conf
1228 * ipmaker.py: more informative message when ipy_user_conf
1220 import fails (suggest running %upgrade).
1229 import fails (suggest running %upgrade).
1221
1230
1222 * tools/run_ipy_in_profiler.py: Utility to see where
1231 * tools/run_ipy_in_profiler.py: Utility to see where
1223 the time during IPython startup is spent.
1232 the time during IPython startup is spent.
1224
1233
1225 2006-12-20 Ville Vainio <vivainio@gmail.com>
1234 2006-12-20 Ville Vainio <vivainio@gmail.com>
1226
1235
1227 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1236 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1228
1237
1229 * ipapi.py: Add new ipapi method, expand_alias.
1238 * ipapi.py: Add new ipapi method, expand_alias.
1230
1239
1231 * Release.py: Bump up version to 0.7.4.svn
1240 * Release.py: Bump up version to 0.7.4.svn
1232
1241
1233 2006-12-17 Ville Vainio <vivainio@gmail.com>
1242 2006-12-17 Ville Vainio <vivainio@gmail.com>
1234
1243
1235 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1244 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1236 to work properly on posix too
1245 to work properly on posix too
1237
1246
1238 * Release.py: Update revnum (version is still just 0.7.3).
1247 * Release.py: Update revnum (version is still just 0.7.3).
1239
1248
1240 2006-12-15 Ville Vainio <vivainio@gmail.com>
1249 2006-12-15 Ville Vainio <vivainio@gmail.com>
1241
1250
1242 * scripts/ipython_win_post_install: create ipython.py in
1251 * scripts/ipython_win_post_install: create ipython.py in
1243 prefix + "/scripts".
1252 prefix + "/scripts".
1244
1253
1245 * Release.py: Update version to 0.7.3.
1254 * Release.py: Update version to 0.7.3.
1246
1255
1247 2006-12-14 Ville Vainio <vivainio@gmail.com>
1256 2006-12-14 Ville Vainio <vivainio@gmail.com>
1248
1257
1249 * scripts/ipython_win_post_install: Overwrite old shortcuts
1258 * scripts/ipython_win_post_install: Overwrite old shortcuts
1250 if they already exist
1259 if they already exist
1251
1260
1252 * Release.py: release 0.7.3rc2
1261 * Release.py: release 0.7.3rc2
1253
1262
1254 2006-12-13 Ville Vainio <vivainio@gmail.com>
1263 2006-12-13 Ville Vainio <vivainio@gmail.com>
1255
1264
1256 * Branch and update Release.py for 0.7.3rc1
1265 * Branch and update Release.py for 0.7.3rc1
1257
1266
1258 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1267 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1259
1268
1260 * IPython/Shell.py (IPShellWX): update for current WX naming
1269 * IPython/Shell.py (IPShellWX): update for current WX naming
1261 conventions, to avoid a deprecation warning with current WX
1270 conventions, to avoid a deprecation warning with current WX
1262 versions. Thanks to a report by Danny Shevitz.
1271 versions. Thanks to a report by Danny Shevitz.
1263
1272
1264 2006-12-12 Ville Vainio <vivainio@gmail.com>
1273 2006-12-12 Ville Vainio <vivainio@gmail.com>
1265
1274
1266 * ipmaker.py: apply david cournapeau's patch to make
1275 * ipmaker.py: apply david cournapeau's patch to make
1267 import_some work properly even when ipythonrc does
1276 import_some work properly even when ipythonrc does
1268 import_some on empty list (it was an old bug!).
1277 import_some on empty list (it was an old bug!).
1269
1278
1270 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1279 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1271 Add deprecation note to ipythonrc and a url to wiki
1280 Add deprecation note to ipythonrc and a url to wiki
1272 in ipy_user_conf.py
1281 in ipy_user_conf.py
1273
1282
1274
1283
1275 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1284 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1276 as if it was typed on IPython command prompt, i.e.
1285 as if it was typed on IPython command prompt, i.e.
1277 as IPython script.
1286 as IPython script.
1278
1287
1279 * example-magic.py, magic_grepl.py: remove outdated examples
1288 * example-magic.py, magic_grepl.py: remove outdated examples
1280
1289
1281 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1290 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1282
1291
1283 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1292 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1284 is called before any exception has occurred.
1293 is called before any exception has occurred.
1285
1294
1286 2006-12-08 Ville Vainio <vivainio@gmail.com>
1295 2006-12-08 Ville Vainio <vivainio@gmail.com>
1287
1296
1288 * Extensions/ipy_stock_completers.py: fix cd completer
1297 * Extensions/ipy_stock_completers.py: fix cd completer
1289 to translate /'s to \'s again.
1298 to translate /'s to \'s again.
1290
1299
1291 * completer.py: prevent traceback on file completions w/
1300 * completer.py: prevent traceback on file completions w/
1292 backslash.
1301 backslash.
1293
1302
1294 * Release.py: Update release number to 0.7.3b3 for release
1303 * Release.py: Update release number to 0.7.3b3 for release
1295
1304
1296 2006-12-07 Ville Vainio <vivainio@gmail.com>
1305 2006-12-07 Ville Vainio <vivainio@gmail.com>
1297
1306
1298 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1307 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1299 while executing external code. Provides more shell-like behaviour
1308 while executing external code. Provides more shell-like behaviour
1300 and overall better response to ctrl + C / ctrl + break.
1309 and overall better response to ctrl + C / ctrl + break.
1301
1310
1302 * tools/make_tarball.py: new script to create tarball straight from svn
1311 * tools/make_tarball.py: new script to create tarball straight from svn
1303 (setup.py sdist doesn't work on win32).
1312 (setup.py sdist doesn't work on win32).
1304
1313
1305 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1314 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1306 on dirnames with spaces and use the default completer instead.
1315 on dirnames with spaces and use the default completer instead.
1307
1316
1308 * Revision.py: Change version to 0.7.3b2 for release.
1317 * Revision.py: Change version to 0.7.3b2 for release.
1309
1318
1310 2006-12-05 Ville Vainio <vivainio@gmail.com>
1319 2006-12-05 Ville Vainio <vivainio@gmail.com>
1311
1320
1312 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1321 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1313 pydb patch 4 (rm debug printing, py 2.5 checking)
1322 pydb patch 4 (rm debug printing, py 2.5 checking)
1314
1323
1315 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1324 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1316 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1325 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1317 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1326 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1318 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1327 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1319 object the cursor was on before the refresh. The command "markrange" is
1328 object the cursor was on before the refresh. The command "markrange" is
1320 mapped to "%" now.
1329 mapped to "%" now.
1321 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1330 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1322
1331
1323 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1332 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1324
1333
1325 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1334 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1326 interactive debugger on the last traceback, without having to call
1335 interactive debugger on the last traceback, without having to call
1327 %pdb and rerun your code. Made minor changes in various modules,
1336 %pdb and rerun your code. Made minor changes in various modules,
1328 should automatically recognize pydb if available.
1337 should automatically recognize pydb if available.
1329
1338
1330 2006-11-28 Ville Vainio <vivainio@gmail.com>
1339 2006-11-28 Ville Vainio <vivainio@gmail.com>
1331
1340
1332 * completer.py: If the text start with !, show file completions
1341 * completer.py: If the text start with !, show file completions
1333 properly. This helps when trying to complete command name
1342 properly. This helps when trying to complete command name
1334 for shell escapes.
1343 for shell escapes.
1335
1344
1336 2006-11-27 Ville Vainio <vivainio@gmail.com>
1345 2006-11-27 Ville Vainio <vivainio@gmail.com>
1337
1346
1338 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1347 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1339 der Walt. Clean up svn and hg completers by using a common
1348 der Walt. Clean up svn and hg completers by using a common
1340 vcs_completer.
1349 vcs_completer.
1341
1350
1342 2006-11-26 Ville Vainio <vivainio@gmail.com>
1351 2006-11-26 Ville Vainio <vivainio@gmail.com>
1343
1352
1344 * Remove ipconfig and %config; you should use _ip.options structure
1353 * Remove ipconfig and %config; you should use _ip.options structure
1345 directly instead!
1354 directly instead!
1346
1355
1347 * genutils.py: add wrap_deprecated function for deprecating callables
1356 * genutils.py: add wrap_deprecated function for deprecating callables
1348
1357
1349 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1358 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1350 _ip.system instead. ipalias is redundant.
1359 _ip.system instead. ipalias is redundant.
1351
1360
1352 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1361 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1353 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1362 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1354 explicit.
1363 explicit.
1355
1364
1356 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1365 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1357 completer. Try it by entering 'hg ' and pressing tab.
1366 completer. Try it by entering 'hg ' and pressing tab.
1358
1367
1359 * macro.py: Give Macro a useful __repr__ method
1368 * macro.py: Give Macro a useful __repr__ method
1360
1369
1361 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1370 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1362
1371
1363 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1372 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1364 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1373 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1365 we don't get a duplicate ipipe module, where registration of the xrepr
1374 we don't get a duplicate ipipe module, where registration of the xrepr
1366 implementation for Text is useless.
1375 implementation for Text is useless.
1367
1376
1368 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1377 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1369
1378
1370 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1379 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1371
1380
1372 2006-11-24 Ville Vainio <vivainio@gmail.com>
1381 2006-11-24 Ville Vainio <vivainio@gmail.com>
1373
1382
1374 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1383 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1375 try to use "cProfile" instead of the slower pure python
1384 try to use "cProfile" instead of the slower pure python
1376 "profile"
1385 "profile"
1377
1386
1378 2006-11-23 Ville Vainio <vivainio@gmail.com>
1387 2006-11-23 Ville Vainio <vivainio@gmail.com>
1379
1388
1380 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1389 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1381 Qt+IPython+Designer link in documentation.
1390 Qt+IPython+Designer link in documentation.
1382
1391
1383 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1392 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1384 correct Pdb object to %pydb.
1393 correct Pdb object to %pydb.
1385
1394
1386
1395
1387 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1396 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1388 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1397 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1389 generic xrepr(), otherwise the list implementation would kick in.
1398 generic xrepr(), otherwise the list implementation would kick in.
1390
1399
1391 2006-11-21 Ville Vainio <vivainio@gmail.com>
1400 2006-11-21 Ville Vainio <vivainio@gmail.com>
1392
1401
1393 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1402 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1394 with one from UserConfig.
1403 with one from UserConfig.
1395
1404
1396 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1405 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1397 it was missing which broke the sh profile.
1406 it was missing which broke the sh profile.
1398
1407
1399 * completer.py: file completer now uses explicit '/' instead
1408 * completer.py: file completer now uses explicit '/' instead
1400 of os.path.join, expansion of 'foo' was broken on win32
1409 of os.path.join, expansion of 'foo' was broken on win32
1401 if there was one directory with name 'foobar'.
1410 if there was one directory with name 'foobar'.
1402
1411
1403 * A bunch of patches from Kirill Smelkov:
1412 * A bunch of patches from Kirill Smelkov:
1404
1413
1405 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1414 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1406
1415
1407 * [patch 7/9] Implement %page -r (page in raw mode) -
1416 * [patch 7/9] Implement %page -r (page in raw mode) -
1408
1417
1409 * [patch 5/9] ScientificPython webpage has moved
1418 * [patch 5/9] ScientificPython webpage has moved
1410
1419
1411 * [patch 4/9] The manual mentions %ds, should be %dhist
1420 * [patch 4/9] The manual mentions %ds, should be %dhist
1412
1421
1413 * [patch 3/9] Kill old bits from %prun doc.
1422 * [patch 3/9] Kill old bits from %prun doc.
1414
1423
1415 * [patch 1/9] Fix typos here and there.
1424 * [patch 1/9] Fix typos here and there.
1416
1425
1417 2006-11-08 Ville Vainio <vivainio@gmail.com>
1426 2006-11-08 Ville Vainio <vivainio@gmail.com>
1418
1427
1419 * completer.py (attr_matches): catch all exceptions raised
1428 * completer.py (attr_matches): catch all exceptions raised
1420 by eval of expr with dots.
1429 by eval of expr with dots.
1421
1430
1422 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1431 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1423
1432
1424 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1433 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1425 input if it starts with whitespace. This allows you to paste
1434 input if it starts with whitespace. This allows you to paste
1426 indented input from any editor without manually having to type in
1435 indented input from any editor without manually having to type in
1427 the 'if 1:', which is convenient when working interactively.
1436 the 'if 1:', which is convenient when working interactively.
1428 Slightly modifed version of a patch by Bo Peng
1437 Slightly modifed version of a patch by Bo Peng
1429 <bpeng-AT-rice.edu>.
1438 <bpeng-AT-rice.edu>.
1430
1439
1431 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1440 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1432
1441
1433 * IPython/irunner.py (main): modified irunner so it automatically
1442 * IPython/irunner.py (main): modified irunner so it automatically
1434 recognizes the right runner to use based on the extension (.py for
1443 recognizes the right runner to use based on the extension (.py for
1435 python, .ipy for ipython and .sage for sage).
1444 python, .ipy for ipython and .sage for sage).
1436
1445
1437 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1446 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1438 visible in ipapi as ip.config(), to programatically control the
1447 visible in ipapi as ip.config(), to programatically control the
1439 internal rc object. There's an accompanying %config magic for
1448 internal rc object. There's an accompanying %config magic for
1440 interactive use, which has been enhanced to match the
1449 interactive use, which has been enhanced to match the
1441 funtionality in ipconfig.
1450 funtionality in ipconfig.
1442
1451
1443 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1452 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1444 so it's not just a toggle, it now takes an argument. Add support
1453 so it's not just a toggle, it now takes an argument. Add support
1445 for a customizable header when making system calls, as the new
1454 for a customizable header when making system calls, as the new
1446 system_header variable in the ipythonrc file.
1455 system_header variable in the ipythonrc file.
1447
1456
1448 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1457 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1449
1458
1450 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1459 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1451 generic functions (using Philip J. Eby's simplegeneric package).
1460 generic functions (using Philip J. Eby's simplegeneric package).
1452 This makes it possible to customize the display of third-party classes
1461 This makes it possible to customize the display of third-party classes
1453 without having to monkeypatch them. xiter() no longer supports a mode
1462 without having to monkeypatch them. xiter() no longer supports a mode
1454 argument and the XMode class has been removed. The same functionality can
1463 argument and the XMode class has been removed. The same functionality can
1455 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1464 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1456 One consequence of the switch to generic functions is that xrepr() and
1465 One consequence of the switch to generic functions is that xrepr() and
1457 xattrs() implementation must define the default value for the mode
1466 xattrs() implementation must define the default value for the mode
1458 argument themselves and xattrs() implementations must return real
1467 argument themselves and xattrs() implementations must return real
1459 descriptors.
1468 descriptors.
1460
1469
1461 * IPython/external: This new subpackage will contain all third-party
1470 * IPython/external: This new subpackage will contain all third-party
1462 packages that are bundled with IPython. (The first one is simplegeneric).
1471 packages that are bundled with IPython. (The first one is simplegeneric).
1463
1472
1464 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1473 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1465 directory which as been dropped in r1703.
1474 directory which as been dropped in r1703.
1466
1475
1467 * IPython/Extensions/ipipe.py (iless): Fixed.
1476 * IPython/Extensions/ipipe.py (iless): Fixed.
1468
1477
1469 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1478 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1470
1479
1471 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1480 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1472
1481
1473 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1482 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1474 handling in variable expansion so that shells and magics recognize
1483 handling in variable expansion so that shells and magics recognize
1475 function local scopes correctly. Bug reported by Brian.
1484 function local scopes correctly. Bug reported by Brian.
1476
1485
1477 * scripts/ipython: remove the very first entry in sys.path which
1486 * scripts/ipython: remove the very first entry in sys.path which
1478 Python auto-inserts for scripts, so that sys.path under IPython is
1487 Python auto-inserts for scripts, so that sys.path under IPython is
1479 as similar as possible to that under plain Python.
1488 as similar as possible to that under plain Python.
1480
1489
1481 * IPython/completer.py (IPCompleter.file_matches): Fix
1490 * IPython/completer.py (IPCompleter.file_matches): Fix
1482 tab-completion so that quotes are not closed unless the completion
1491 tab-completion so that quotes are not closed unless the completion
1483 is unambiguous. After a request by Stefan. Minor cleanups in
1492 is unambiguous. After a request by Stefan. Minor cleanups in
1484 ipy_stock_completers.
1493 ipy_stock_completers.
1485
1494
1486 2006-11-02 Ville Vainio <vivainio@gmail.com>
1495 2006-11-02 Ville Vainio <vivainio@gmail.com>
1487
1496
1488 * ipy_stock_completers.py: Add %run and %cd completers.
1497 * ipy_stock_completers.py: Add %run and %cd completers.
1489
1498
1490 * completer.py: Try running custom completer for both
1499 * completer.py: Try running custom completer for both
1491 "foo" and "%foo" if the command is just "foo". Ignore case
1500 "foo" and "%foo" if the command is just "foo". Ignore case
1492 when filtering possible completions.
1501 when filtering possible completions.
1493
1502
1494 * UserConfig/ipy_user_conf.py: install stock completers as default
1503 * UserConfig/ipy_user_conf.py: install stock completers as default
1495
1504
1496 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1505 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1497 simplified readline history save / restore through a wrapper
1506 simplified readline history save / restore through a wrapper
1498 function
1507 function
1499
1508
1500
1509
1501 2006-10-31 Ville Vainio <vivainio@gmail.com>
1510 2006-10-31 Ville Vainio <vivainio@gmail.com>
1502
1511
1503 * strdispatch.py, completer.py, ipy_stock_completers.py:
1512 * strdispatch.py, completer.py, ipy_stock_completers.py:
1504 Allow str_key ("command") in completer hooks. Implement
1513 Allow str_key ("command") in completer hooks. Implement
1505 trivial completer for 'import' (stdlib modules only). Rename
1514 trivial completer for 'import' (stdlib modules only). Rename
1506 ipy_linux_package_managers.py to ipy_stock_completers.py.
1515 ipy_linux_package_managers.py to ipy_stock_completers.py.
1507 SVN completer.
1516 SVN completer.
1508
1517
1509 * Extensions/ledit.py: %magic line editor for easily and
1518 * Extensions/ledit.py: %magic line editor for easily and
1510 incrementally manipulating lists of strings. The magic command
1519 incrementally manipulating lists of strings. The magic command
1511 name is %led.
1520 name is %led.
1512
1521
1513 2006-10-30 Ville Vainio <vivainio@gmail.com>
1522 2006-10-30 Ville Vainio <vivainio@gmail.com>
1514
1523
1515 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1524 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1516 Bernsteins's patches for pydb integration.
1525 Bernsteins's patches for pydb integration.
1517 http://bashdb.sourceforge.net/pydb/
1526 http://bashdb.sourceforge.net/pydb/
1518
1527
1519 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1528 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1520 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1529 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1521 custom completer hook to allow the users to implement their own
1530 custom completer hook to allow the users to implement their own
1522 completers. See ipy_linux_package_managers.py for example. The
1531 completers. See ipy_linux_package_managers.py for example. The
1523 hook name is 'complete_command'.
1532 hook name is 'complete_command'.
1524
1533
1525 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1534 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1526
1535
1527 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1536 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1528 Numeric leftovers.
1537 Numeric leftovers.
1529
1538
1530 * ipython.el (py-execute-region): apply Stefan's patch to fix
1539 * ipython.el (py-execute-region): apply Stefan's patch to fix
1531 garbled results if the python shell hasn't been previously started.
1540 garbled results if the python shell hasn't been previously started.
1532
1541
1533 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1542 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1534 pretty generic function and useful for other things.
1543 pretty generic function and useful for other things.
1535
1544
1536 * IPython/OInspect.py (getsource): Add customizable source
1545 * IPython/OInspect.py (getsource): Add customizable source
1537 extractor. After a request/patch form W. Stein (SAGE).
1546 extractor. After a request/patch form W. Stein (SAGE).
1538
1547
1539 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1548 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1540 window size to a more reasonable value from what pexpect does,
1549 window size to a more reasonable value from what pexpect does,
1541 since their choice causes wrapping bugs with long input lines.
1550 since their choice causes wrapping bugs with long input lines.
1542
1551
1543 2006-10-28 Ville Vainio <vivainio@gmail.com>
1552 2006-10-28 Ville Vainio <vivainio@gmail.com>
1544
1553
1545 * Magic.py (%run): Save and restore the readline history from
1554 * Magic.py (%run): Save and restore the readline history from
1546 file around %run commands to prevent side effects from
1555 file around %run commands to prevent side effects from
1547 %runned programs that might use readline (e.g. pydb).
1556 %runned programs that might use readline (e.g. pydb).
1548
1557
1549 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1558 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1550 invoking the pydb enhanced debugger.
1559 invoking the pydb enhanced debugger.
1551
1560
1552 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1561 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1553
1562
1554 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1563 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1555 call the base class method and propagate the return value to
1564 call the base class method and propagate the return value to
1556 ifile. This is now done by path itself.
1565 ifile. This is now done by path itself.
1557
1566
1558 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1567 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1559
1568
1560 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1569 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1561 api: set_crash_handler(), to expose the ability to change the
1570 api: set_crash_handler(), to expose the ability to change the
1562 internal crash handler.
1571 internal crash handler.
1563
1572
1564 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1573 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1565 the various parameters of the crash handler so that apps using
1574 the various parameters of the crash handler so that apps using
1566 IPython as their engine can customize crash handling. Ipmlemented
1575 IPython as their engine can customize crash handling. Ipmlemented
1567 at the request of SAGE.
1576 at the request of SAGE.
1568
1577
1569 2006-10-14 Ville Vainio <vivainio@gmail.com>
1578 2006-10-14 Ville Vainio <vivainio@gmail.com>
1570
1579
1571 * Magic.py, ipython.el: applied first "safe" part of Rocky
1580 * Magic.py, ipython.el: applied first "safe" part of Rocky
1572 Bernstein's patch set for pydb integration.
1581 Bernstein's patch set for pydb integration.
1573
1582
1574 * Magic.py (%unalias, %alias): %store'd aliases can now be
1583 * Magic.py (%unalias, %alias): %store'd aliases can now be
1575 removed with '%unalias'. %alias w/o args now shows most
1584 removed with '%unalias'. %alias w/o args now shows most
1576 interesting (stored / manually defined) aliases last
1585 interesting (stored / manually defined) aliases last
1577 where they catch the eye w/o scrolling.
1586 where they catch the eye w/o scrolling.
1578
1587
1579 * Magic.py (%rehashx), ext_rehashdir.py: files with
1588 * Magic.py (%rehashx), ext_rehashdir.py: files with
1580 'py' extension are always considered executable, even
1589 'py' extension are always considered executable, even
1581 when not in PATHEXT environment variable.
1590 when not in PATHEXT environment variable.
1582
1591
1583 2006-10-12 Ville Vainio <vivainio@gmail.com>
1592 2006-10-12 Ville Vainio <vivainio@gmail.com>
1584
1593
1585 * jobctrl.py: Add new "jobctrl" extension for spawning background
1594 * jobctrl.py: Add new "jobctrl" extension for spawning background
1586 processes with "&find /". 'import jobctrl' to try it out. Requires
1595 processes with "&find /". 'import jobctrl' to try it out. Requires
1587 'subprocess' module, standard in python 2.4+.
1596 'subprocess' module, standard in python 2.4+.
1588
1597
1589 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1598 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1590 so if foo -> bar and bar -> baz, then foo -> baz.
1599 so if foo -> bar and bar -> baz, then foo -> baz.
1591
1600
1592 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1601 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1593
1602
1594 * IPython/Magic.py (Magic.parse_options): add a new posix option
1603 * IPython/Magic.py (Magic.parse_options): add a new posix option
1595 to allow parsing of input args in magics that doesn't strip quotes
1604 to allow parsing of input args in magics that doesn't strip quotes
1596 (if posix=False). This also closes %timeit bug reported by
1605 (if posix=False). This also closes %timeit bug reported by
1597 Stefan.
1606 Stefan.
1598
1607
1599 2006-10-03 Ville Vainio <vivainio@gmail.com>
1608 2006-10-03 Ville Vainio <vivainio@gmail.com>
1600
1609
1601 * iplib.py (raw_input, interact): Return ValueError catching for
1610 * iplib.py (raw_input, interact): Return ValueError catching for
1602 raw_input. Fixes infinite loop for sys.stdin.close() or
1611 raw_input. Fixes infinite loop for sys.stdin.close() or
1603 sys.stdout.close().
1612 sys.stdout.close().
1604
1613
1605 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1614 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1606
1615
1607 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1616 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1608 to help in handling doctests. irunner is now pretty useful for
1617 to help in handling doctests. irunner is now pretty useful for
1609 running standalone scripts and simulate a full interactive session
1618 running standalone scripts and simulate a full interactive session
1610 in a format that can be then pasted as a doctest.
1619 in a format that can be then pasted as a doctest.
1611
1620
1612 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1621 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1613 on top of the default (useless) ones. This also fixes the nasty
1622 on top of the default (useless) ones. This also fixes the nasty
1614 way in which 2.5's Quitter() exits (reverted [1785]).
1623 way in which 2.5's Quitter() exits (reverted [1785]).
1615
1624
1616 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1625 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1617 2.5.
1626 2.5.
1618
1627
1619 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1628 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1620 color scheme is updated as well when color scheme is changed
1629 color scheme is updated as well when color scheme is changed
1621 interactively.
1630 interactively.
1622
1631
1623 2006-09-27 Ville Vainio <vivainio@gmail.com>
1632 2006-09-27 Ville Vainio <vivainio@gmail.com>
1624
1633
1625 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1634 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1626 infinite loop and just exit. It's a hack, but will do for a while.
1635 infinite loop and just exit. It's a hack, but will do for a while.
1627
1636
1628 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1637 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1629
1638
1630 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1639 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1631 the constructor, this makes it possible to get a list of only directories
1640 the constructor, this makes it possible to get a list of only directories
1632 or only files.
1641 or only files.
1633
1642
1634 2006-08-12 Ville Vainio <vivainio@gmail.com>
1643 2006-08-12 Ville Vainio <vivainio@gmail.com>
1635
1644
1636 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1645 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1637 they broke unittest
1646 they broke unittest
1638
1647
1639 2006-08-11 Ville Vainio <vivainio@gmail.com>
1648 2006-08-11 Ville Vainio <vivainio@gmail.com>
1640
1649
1641 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1650 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1642 by resolving issue properly, i.e. by inheriting FakeModule
1651 by resolving issue properly, i.e. by inheriting FakeModule
1643 from types.ModuleType. Pickling ipython interactive data
1652 from types.ModuleType. Pickling ipython interactive data
1644 should still work as usual (testing appreciated).
1653 should still work as usual (testing appreciated).
1645
1654
1646 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1655 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1647
1656
1648 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1657 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1649 running under python 2.3 with code from 2.4 to fix a bug with
1658 running under python 2.3 with code from 2.4 to fix a bug with
1650 help(). Reported by the Debian maintainers, Norbert Tretkowski
1659 help(). Reported by the Debian maintainers, Norbert Tretkowski
1651 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1660 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1652 <afayolle-AT-debian.org>.
1661 <afayolle-AT-debian.org>.
1653
1662
1654 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1663 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1655
1664
1656 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1665 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1657 (which was displaying "quit" twice).
1666 (which was displaying "quit" twice).
1658
1667
1659 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1668 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1660
1669
1661 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1670 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1662 the mode argument).
1671 the mode argument).
1663
1672
1664 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1673 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1665
1674
1666 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1675 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1667 not running under IPython.
1676 not running under IPython.
1668
1677
1669 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1678 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1670 and make it iterable (iterating over the attribute itself). Add two new
1679 and make it iterable (iterating over the attribute itself). Add two new
1671 magic strings for __xattrs__(): If the string starts with "-", the attribute
1680 magic strings for __xattrs__(): If the string starts with "-", the attribute
1672 will not be displayed in ibrowse's detail view (but it can still be
1681 will not be displayed in ibrowse's detail view (but it can still be
1673 iterated over). This makes it possible to add attributes that are large
1682 iterated over). This makes it possible to add attributes that are large
1674 lists or generator methods to the detail view. Replace magic attribute names
1683 lists or generator methods to the detail view. Replace magic attribute names
1675 and _attrname() and _getattr() with "descriptors": For each type of magic
1684 and _attrname() and _getattr() with "descriptors": For each type of magic
1676 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1685 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1677 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1686 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1678 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1687 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1679 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1688 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1680 are still supported.
1689 are still supported.
1681
1690
1682 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1691 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1683 fails in ibrowse.fetch(), the exception object is added as the last item
1692 fails in ibrowse.fetch(), the exception object is added as the last item
1684 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1693 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1685 a generator throws an exception midway through execution.
1694 a generator throws an exception midway through execution.
1686
1695
1687 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1696 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1688 encoding into methods.
1697 encoding into methods.
1689
1698
1690 2006-07-26 Ville Vainio <vivainio@gmail.com>
1699 2006-07-26 Ville Vainio <vivainio@gmail.com>
1691
1700
1692 * iplib.py: history now stores multiline input as single
1701 * iplib.py: history now stores multiline input as single
1693 history entries. Patch by Jorgen Cederlof.
1702 history entries. Patch by Jorgen Cederlof.
1694
1703
1695 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1704 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1696
1705
1697 * IPython/Extensions/ibrowse.py: Make cursor visible over
1706 * IPython/Extensions/ibrowse.py: Make cursor visible over
1698 non existing attributes.
1707 non existing attributes.
1699
1708
1700 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1709 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1701
1710
1702 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1711 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1703 error output of the running command doesn't mess up the screen.
1712 error output of the running command doesn't mess up the screen.
1704
1713
1705 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1714 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1706
1715
1707 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1716 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1708 argument. This sorts the items themselves.
1717 argument. This sorts the items themselves.
1709
1718
1710 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1719 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1711
1720
1712 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1721 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1713 Compile expression strings into code objects. This should speed
1722 Compile expression strings into code objects. This should speed
1714 up ifilter and friends somewhat.
1723 up ifilter and friends somewhat.
1715
1724
1716 2006-07-08 Ville Vainio <vivainio@gmail.com>
1725 2006-07-08 Ville Vainio <vivainio@gmail.com>
1717
1726
1718 * Magic.py: %cpaste now strips > from the beginning of lines
1727 * Magic.py: %cpaste now strips > from the beginning of lines
1719 to ease pasting quoted code from emails. Contributed by
1728 to ease pasting quoted code from emails. Contributed by
1720 Stefan van der Walt.
1729 Stefan van der Walt.
1721
1730
1722 2006-06-29 Ville Vainio <vivainio@gmail.com>
1731 2006-06-29 Ville Vainio <vivainio@gmail.com>
1723
1732
1724 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1733 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1725 mode, patch contributed by Darren Dale. NEEDS TESTING!
1734 mode, patch contributed by Darren Dale. NEEDS TESTING!
1726
1735
1727 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1736 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1728
1737
1729 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1738 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1730 a blue background. Fix fetching new display rows when the browser
1739 a blue background. Fix fetching new display rows when the browser
1731 scrolls more than a screenful (e.g. by using the goto command).
1740 scrolls more than a screenful (e.g. by using the goto command).
1732
1741
1733 2006-06-27 Ville Vainio <vivainio@gmail.com>
1742 2006-06-27 Ville Vainio <vivainio@gmail.com>
1734
1743
1735 * Magic.py (_inspect, _ofind) Apply David Huard's
1744 * Magic.py (_inspect, _ofind) Apply David Huard's
1736 patch for displaying the correct docstring for 'property'
1745 patch for displaying the correct docstring for 'property'
1737 attributes.
1746 attributes.
1738
1747
1739 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1748 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1740
1749
1741 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1750 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1742 commands into the methods implementing them.
1751 commands into the methods implementing them.
1743
1752
1744 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1753 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1745
1754
1746 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1755 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1747 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1756 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1748 autoindent support was authored by Jin Liu.
1757 autoindent support was authored by Jin Liu.
1749
1758
1750 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1759 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1751
1760
1752 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1761 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1753 for keymaps with a custom class that simplifies handling.
1762 for keymaps with a custom class that simplifies handling.
1754
1763
1755 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1764 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1756
1765
1757 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1766 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1758 resizing. This requires Python 2.5 to work.
1767 resizing. This requires Python 2.5 to work.
1759
1768
1760 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1769 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1761
1770
1762 * IPython/Extensions/ibrowse.py: Add two new commands to
1771 * IPython/Extensions/ibrowse.py: Add two new commands to
1763 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1772 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1764 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1773 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1765 attributes again. Remapped the help command to "?". Display
1774 attributes again. Remapped the help command to "?". Display
1766 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1775 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1767 as keys for the "home" and "end" commands. Add three new commands
1776 as keys for the "home" and "end" commands. Add three new commands
1768 to the input mode for "find" and friends: "delend" (CTRL-K)
1777 to the input mode for "find" and friends: "delend" (CTRL-K)
1769 deletes to the end of line. "incsearchup" searches upwards in the
1778 deletes to the end of line. "incsearchup" searches upwards in the
1770 command history for an input that starts with the text before the cursor.
1779 command history for an input that starts with the text before the cursor.
1771 "incsearchdown" does the same downwards. Removed a bogus mapping of
1780 "incsearchdown" does the same downwards. Removed a bogus mapping of
1772 the x key to "delete".
1781 the x key to "delete".
1773
1782
1774 2006-06-15 Ville Vainio <vivainio@gmail.com>
1783 2006-06-15 Ville Vainio <vivainio@gmail.com>
1775
1784
1776 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1785 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1777 used to create prompts dynamically, instead of the "old" way of
1786 used to create prompts dynamically, instead of the "old" way of
1778 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1787 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1779 way still works (it's invoked by the default hook), of course.
1788 way still works (it's invoked by the default hook), of course.
1780
1789
1781 * Prompts.py: added generate_output_prompt hook for altering output
1790 * Prompts.py: added generate_output_prompt hook for altering output
1782 prompt
1791 prompt
1783
1792
1784 * Release.py: Changed version string to 0.7.3.svn.
1793 * Release.py: Changed version string to 0.7.3.svn.
1785
1794
1786 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1795 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1787
1796
1788 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1797 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1789 the call to fetch() always tries to fetch enough data for at least one
1798 the call to fetch() always tries to fetch enough data for at least one
1790 full screen. This makes it possible to simply call moveto(0,0,True) in
1799 full screen. This makes it possible to simply call moveto(0,0,True) in
1791 the constructor. Fix typos and removed the obsolete goto attribute.
1800 the constructor. Fix typos and removed the obsolete goto attribute.
1792
1801
1793 2006-06-12 Ville Vainio <vivainio@gmail.com>
1802 2006-06-12 Ville Vainio <vivainio@gmail.com>
1794
1803
1795 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1804 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1796 allowing $variable interpolation within multiline statements,
1805 allowing $variable interpolation within multiline statements,
1797 though so far only with "sh" profile for a testing period.
1806 though so far only with "sh" profile for a testing period.
1798 The patch also enables splitting long commands with \ but it
1807 The patch also enables splitting long commands with \ but it
1799 doesn't work properly yet.
1808 doesn't work properly yet.
1800
1809
1801 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1810 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1802
1811
1803 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1812 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1804 input history and the position of the cursor in the input history for
1813 input history and the position of the cursor in the input history for
1805 the find, findbackwards and goto command.
1814 the find, findbackwards and goto command.
1806
1815
1807 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1816 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1808
1817
1809 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1818 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1810 implements the basic functionality of browser commands that require
1819 implements the basic functionality of browser commands that require
1811 input. Reimplement the goto, find and findbackwards commands as
1820 input. Reimplement the goto, find and findbackwards commands as
1812 subclasses of _CommandInput. Add an input history and keymaps to those
1821 subclasses of _CommandInput. Add an input history and keymaps to those
1813 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1822 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1814 execute commands.
1823 execute commands.
1815
1824
1816 2006-06-07 Ville Vainio <vivainio@gmail.com>
1825 2006-06-07 Ville Vainio <vivainio@gmail.com>
1817
1826
1818 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1827 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1819 running the batch files instead of leaving the session open.
1828 running the batch files instead of leaving the session open.
1820
1829
1821 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1830 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1822
1831
1823 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1832 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1824 the original fix was incomplete. Patch submitted by W. Maier.
1833 the original fix was incomplete. Patch submitted by W. Maier.
1825
1834
1826 2006-06-07 Ville Vainio <vivainio@gmail.com>
1835 2006-06-07 Ville Vainio <vivainio@gmail.com>
1827
1836
1828 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1837 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1829 Confirmation prompts can be supressed by 'quiet' option.
1838 Confirmation prompts can be supressed by 'quiet' option.
1830 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1839 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1831
1840
1832 2006-06-06 *** Released version 0.7.2
1841 2006-06-06 *** Released version 0.7.2
1833
1842
1834 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1843 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1835
1844
1836 * IPython/Release.py (version): Made 0.7.2 final for release.
1845 * IPython/Release.py (version): Made 0.7.2 final for release.
1837 Repo tagged and release cut.
1846 Repo tagged and release cut.
1838
1847
1839 2006-06-05 Ville Vainio <vivainio@gmail.com>
1848 2006-06-05 Ville Vainio <vivainio@gmail.com>
1840
1849
1841 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1850 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1842 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1851 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1843
1852
1844 * upgrade_dir.py: try import 'path' module a bit harder
1853 * upgrade_dir.py: try import 'path' module a bit harder
1845 (for %upgrade)
1854 (for %upgrade)
1846
1855
1847 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1856 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1848
1857
1849 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1858 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1850 instead of looping 20 times.
1859 instead of looping 20 times.
1851
1860
1852 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1861 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1853 correctly at initialization time. Bug reported by Krishna Mohan
1862 correctly at initialization time. Bug reported by Krishna Mohan
1854 Gundu <gkmohan-AT-gmail.com> on the user list.
1863 Gundu <gkmohan-AT-gmail.com> on the user list.
1855
1864
1856 * IPython/Release.py (version): Mark 0.7.2 version to start
1865 * IPython/Release.py (version): Mark 0.7.2 version to start
1857 testing for release on 06/06.
1866 testing for release on 06/06.
1858
1867
1859 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1868 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1860
1869
1861 * scripts/irunner: thin script interface so users don't have to
1870 * scripts/irunner: thin script interface so users don't have to
1862 find the module and call it as an executable, since modules rarely
1871 find the module and call it as an executable, since modules rarely
1863 live in people's PATH.
1872 live in people's PATH.
1864
1873
1865 * IPython/irunner.py (InteractiveRunner.__init__): added
1874 * IPython/irunner.py (InteractiveRunner.__init__): added
1866 delaybeforesend attribute to control delays with newer versions of
1875 delaybeforesend attribute to control delays with newer versions of
1867 pexpect. Thanks to detailed help from pexpect's author, Noah
1876 pexpect. Thanks to detailed help from pexpect's author, Noah
1868 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1877 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1869 correctly (it works in NoColor mode).
1878 correctly (it works in NoColor mode).
1870
1879
1871 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1880 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1872 SAGE list, from improper log() calls.
1881 SAGE list, from improper log() calls.
1873
1882
1874 2006-05-31 Ville Vainio <vivainio@gmail.com>
1883 2006-05-31 Ville Vainio <vivainio@gmail.com>
1875
1884
1876 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1885 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1877 with args in parens to work correctly with dirs that have spaces.
1886 with args in parens to work correctly with dirs that have spaces.
1878
1887
1879 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1888 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1880
1889
1881 * IPython/Logger.py (Logger.logstart): add option to log raw input
1890 * IPython/Logger.py (Logger.logstart): add option to log raw input
1882 instead of the processed one. A -r flag was added to the
1891 instead of the processed one. A -r flag was added to the
1883 %logstart magic used for controlling logging.
1892 %logstart magic used for controlling logging.
1884
1893
1885 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1894 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1886
1895
1887 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1896 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1888 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1897 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1889 recognize the option. After a bug report by Will Maier. This
1898 recognize the option. After a bug report by Will Maier. This
1890 closes #64 (will do it after confirmation from W. Maier).
1899 closes #64 (will do it after confirmation from W. Maier).
1891
1900
1892 * IPython/irunner.py: New module to run scripts as if manually
1901 * IPython/irunner.py: New module to run scripts as if manually
1893 typed into an interactive environment, based on pexpect. After a
1902 typed into an interactive environment, based on pexpect. After a
1894 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1903 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1895 ipython-user list. Simple unittests in the tests/ directory.
1904 ipython-user list. Simple unittests in the tests/ directory.
1896
1905
1897 * tools/release: add Will Maier, OpenBSD port maintainer, to
1906 * tools/release: add Will Maier, OpenBSD port maintainer, to
1898 recepients list. We are now officially part of the OpenBSD ports:
1907 recepients list. We are now officially part of the OpenBSD ports:
1899 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1908 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1900 work.
1909 work.
1901
1910
1902 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1911 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1903
1912
1904 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1913 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1905 so that it doesn't break tkinter apps.
1914 so that it doesn't break tkinter apps.
1906
1915
1907 * IPython/iplib.py (_prefilter): fix bug where aliases would
1916 * IPython/iplib.py (_prefilter): fix bug where aliases would
1908 shadow variables when autocall was fully off. Reported by SAGE
1917 shadow variables when autocall was fully off. Reported by SAGE
1909 author William Stein.
1918 author William Stein.
1910
1919
1911 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1920 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1912 at what detail level strings are computed when foo? is requested.
1921 at what detail level strings are computed when foo? is requested.
1913 This allows users to ask for example that the string form of an
1922 This allows users to ask for example that the string form of an
1914 object is only computed when foo?? is called, or even never, by
1923 object is only computed when foo?? is called, or even never, by
1915 setting the object_info_string_level >= 2 in the configuration
1924 setting the object_info_string_level >= 2 in the configuration
1916 file. This new option has been added and documented. After a
1925 file. This new option has been added and documented. After a
1917 request by SAGE to be able to control the printing of very large
1926 request by SAGE to be able to control the printing of very large
1918 objects more easily.
1927 objects more easily.
1919
1928
1920 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1929 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1921
1930
1922 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1931 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1923 from sys.argv, to be 100% consistent with how Python itself works
1932 from sys.argv, to be 100% consistent with how Python itself works
1924 (as seen for example with python -i file.py). After a bug report
1933 (as seen for example with python -i file.py). After a bug report
1925 by Jeffrey Collins.
1934 by Jeffrey Collins.
1926
1935
1927 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1936 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1928 nasty bug which was preventing custom namespaces with -pylab,
1937 nasty bug which was preventing custom namespaces with -pylab,
1929 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1938 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1930 compatibility (long gone from mpl).
1939 compatibility (long gone from mpl).
1931
1940
1932 * IPython/ipapi.py (make_session): name change: create->make. We
1941 * IPython/ipapi.py (make_session): name change: create->make. We
1933 use make in other places (ipmaker,...), it's shorter and easier to
1942 use make in other places (ipmaker,...), it's shorter and easier to
1934 type and say, etc. I'm trying to clean things before 0.7.2 so
1943 type and say, etc. I'm trying to clean things before 0.7.2 so
1935 that I can keep things stable wrt to ipapi in the chainsaw branch.
1944 that I can keep things stable wrt to ipapi in the chainsaw branch.
1936
1945
1937 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1946 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1938 python-mode recognizes our debugger mode. Add support for
1947 python-mode recognizes our debugger mode. Add support for
1939 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1948 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1940 <m.liu.jin-AT-gmail.com> originally written by
1949 <m.liu.jin-AT-gmail.com> originally written by
1941 doxgen-AT-newsmth.net (with minor modifications for xemacs
1950 doxgen-AT-newsmth.net (with minor modifications for xemacs
1942 compatibility)
1951 compatibility)
1943
1952
1944 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1953 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1945 tracebacks when walking the stack so that the stack tracking system
1954 tracebacks when walking the stack so that the stack tracking system
1946 in emacs' python-mode can identify the frames correctly.
1955 in emacs' python-mode can identify the frames correctly.
1947
1956
1948 * IPython/ipmaker.py (make_IPython): make the internal (and
1957 * IPython/ipmaker.py (make_IPython): make the internal (and
1949 default config) autoedit_syntax value false by default. Too many
1958 default config) autoedit_syntax value false by default. Too many
1950 users have complained to me (both on and off-list) about problems
1959 users have complained to me (both on and off-list) about problems
1951 with this option being on by default, so I'm making it default to
1960 with this option being on by default, so I'm making it default to
1952 off. It can still be enabled by anyone via the usual mechanisms.
1961 off. It can still be enabled by anyone via the usual mechanisms.
1953
1962
1954 * IPython/completer.py (Completer.attr_matches): add support for
1963 * IPython/completer.py (Completer.attr_matches): add support for
1955 PyCrust-style _getAttributeNames magic method. Patch contributed
1964 PyCrust-style _getAttributeNames magic method. Patch contributed
1956 by <mscott-AT-goldenspud.com>. Closes #50.
1965 by <mscott-AT-goldenspud.com>. Closes #50.
1957
1966
1958 * IPython/iplib.py (InteractiveShell.__init__): remove the
1967 * IPython/iplib.py (InteractiveShell.__init__): remove the
1959 deletion of exit/quit from __builtin__, which can break
1968 deletion of exit/quit from __builtin__, which can break
1960 third-party tools like the Zope debugging console. The
1969 third-party tools like the Zope debugging console. The
1961 %exit/%quit magics remain. In general, it's probably a good idea
1970 %exit/%quit magics remain. In general, it's probably a good idea
1962 not to delete anything from __builtin__, since we never know what
1971 not to delete anything from __builtin__, since we never know what
1963 that will break. In any case, python now (for 2.5) will support
1972 that will break. In any case, python now (for 2.5) will support
1964 'real' exit/quit, so this issue is moot. Closes #55.
1973 'real' exit/quit, so this issue is moot. Closes #55.
1965
1974
1966 * IPython/genutils.py (with_obj): rename the 'with' function to
1975 * IPython/genutils.py (with_obj): rename the 'with' function to
1967 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1976 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1968 becomes a language keyword. Closes #53.
1977 becomes a language keyword. Closes #53.
1969
1978
1970 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1979 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1971 __file__ attribute to this so it fools more things into thinking
1980 __file__ attribute to this so it fools more things into thinking
1972 it is a real module. Closes #59.
1981 it is a real module. Closes #59.
1973
1982
1974 * IPython/Magic.py (magic_edit): add -n option to open the editor
1983 * IPython/Magic.py (magic_edit): add -n option to open the editor
1975 at a specific line number. After a patch by Stefan van der Walt.
1984 at a specific line number. After a patch by Stefan van der Walt.
1976
1985
1977 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1986 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1978
1987
1979 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1988 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1980 reason the file could not be opened. After automatic crash
1989 reason the file could not be opened. After automatic crash
1981 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1990 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1982 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1991 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1983 (_should_recompile): Don't fire editor if using %bg, since there
1992 (_should_recompile): Don't fire editor if using %bg, since there
1984 is no file in the first place. From the same report as above.
1993 is no file in the first place. From the same report as above.
1985 (raw_input): protect against faulty third-party prefilters. After
1994 (raw_input): protect against faulty third-party prefilters. After
1986 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1995 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1987 while running under SAGE.
1996 while running under SAGE.
1988
1997
1989 2006-05-23 Ville Vainio <vivainio@gmail.com>
1998 2006-05-23 Ville Vainio <vivainio@gmail.com>
1990
1999
1991 * ipapi.py: Stripped down ip.to_user_ns() to work only as
2000 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1992 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
2001 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1993 now returns None (again), unless dummy is specifically allowed by
2002 now returns None (again), unless dummy is specifically allowed by
1994 ipapi.get(allow_dummy=True).
2003 ipapi.get(allow_dummy=True).
1995
2004
1996 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
2005 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1997
2006
1998 * IPython: remove all 2.2-compatibility objects and hacks from
2007 * IPython: remove all 2.2-compatibility objects and hacks from
1999 everywhere, since we only support 2.3 at this point. Docs
2008 everywhere, since we only support 2.3 at this point. Docs
2000 updated.
2009 updated.
2001
2010
2002 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
2011 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
2003 Anything requiring extra validation can be turned into a Python
2012 Anything requiring extra validation can be turned into a Python
2004 property in the future. I used a property for the db one b/c
2013 property in the future. I used a property for the db one b/c
2005 there was a nasty circularity problem with the initialization
2014 there was a nasty circularity problem with the initialization
2006 order, which right now I don't have time to clean up.
2015 order, which right now I don't have time to clean up.
2007
2016
2008 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
2017 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
2009 another locking bug reported by Jorgen. I'm not 100% sure though,
2018 another locking bug reported by Jorgen. I'm not 100% sure though,
2010 so more testing is needed...
2019 so more testing is needed...
2011
2020
2012 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
2021 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
2013
2022
2014 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
2023 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
2015 local variables from any routine in user code (typically executed
2024 local variables from any routine in user code (typically executed
2016 with %run) directly into the interactive namespace. Very useful
2025 with %run) directly into the interactive namespace. Very useful
2017 when doing complex debugging.
2026 when doing complex debugging.
2018 (IPythonNotRunning): Changed the default None object to a dummy
2027 (IPythonNotRunning): Changed the default None object to a dummy
2019 whose attributes can be queried as well as called without
2028 whose attributes can be queried as well as called without
2020 exploding, to ease writing code which works transparently both in
2029 exploding, to ease writing code which works transparently both in
2021 and out of ipython and uses some of this API.
2030 and out of ipython and uses some of this API.
2022
2031
2023 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
2032 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
2024
2033
2025 * IPython/hooks.py (result_display): Fix the fact that our display
2034 * IPython/hooks.py (result_display): Fix the fact that our display
2026 hook was using str() instead of repr(), as the default python
2035 hook was using str() instead of repr(), as the default python
2027 console does. This had gone unnoticed b/c it only happened if
2036 console does. This had gone unnoticed b/c it only happened if
2028 %Pprint was off, but the inconsistency was there.
2037 %Pprint was off, but the inconsistency was there.
2029
2038
2030 2006-05-15 Ville Vainio <vivainio@gmail.com>
2039 2006-05-15 Ville Vainio <vivainio@gmail.com>
2031
2040
2032 * Oinspect.py: Only show docstring for nonexisting/binary files
2041 * Oinspect.py: Only show docstring for nonexisting/binary files
2033 when doing object??, closing ticket #62
2042 when doing object??, closing ticket #62
2034
2043
2035 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
2044 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
2036
2045
2037 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
2046 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
2038 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
2047 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
2039 was being released in a routine which hadn't checked if it had
2048 was being released in a routine which hadn't checked if it had
2040 been the one to acquire it.
2049 been the one to acquire it.
2041
2050
2042 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
2051 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
2043
2052
2044 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
2053 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
2045
2054
2046 2006-04-11 Ville Vainio <vivainio@gmail.com>
2055 2006-04-11 Ville Vainio <vivainio@gmail.com>
2047
2056
2048 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
2057 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
2049 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
2058 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
2050 prefilters, allowing stuff like magics and aliases in the file.
2059 prefilters, allowing stuff like magics and aliases in the file.
2051
2060
2052 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
2061 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
2053 added. Supported now are "%clear in" and "%clear out" (clear input and
2062 added. Supported now are "%clear in" and "%clear out" (clear input and
2054 output history, respectively). Also fixed CachedOutput.flush to
2063 output history, respectively). Also fixed CachedOutput.flush to
2055 properly flush the output cache.
2064 properly flush the output cache.
2056
2065
2057 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
2066 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
2058 half-success (and fail explicitly).
2067 half-success (and fail explicitly).
2059
2068
2060 2006-03-28 Ville Vainio <vivainio@gmail.com>
2069 2006-03-28 Ville Vainio <vivainio@gmail.com>
2061
2070
2062 * iplib.py: Fix quoting of aliases so that only argless ones
2071 * iplib.py: Fix quoting of aliases so that only argless ones
2063 are quoted
2072 are quoted
2064
2073
2065 2006-03-28 Ville Vainio <vivainio@gmail.com>
2074 2006-03-28 Ville Vainio <vivainio@gmail.com>
2066
2075
2067 * iplib.py: Quote aliases with spaces in the name.
2076 * iplib.py: Quote aliases with spaces in the name.
2068 "c:\program files\blah\bin" is now legal alias target.
2077 "c:\program files\blah\bin" is now legal alias target.
2069
2078
2070 * ext_rehashdir.py: Space no longer allowed as arg
2079 * ext_rehashdir.py: Space no longer allowed as arg
2071 separator, since space is legal in path names.
2080 separator, since space is legal in path names.
2072
2081
2073 2006-03-16 Ville Vainio <vivainio@gmail.com>
2082 2006-03-16 Ville Vainio <vivainio@gmail.com>
2074
2083
2075 * upgrade_dir.py: Take path.py from Extensions, correcting
2084 * upgrade_dir.py: Take path.py from Extensions, correcting
2076 %upgrade magic
2085 %upgrade magic
2077
2086
2078 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2087 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2079
2088
2080 * hooks.py: Only enclose editor binary in quotes if legal and
2089 * hooks.py: Only enclose editor binary in quotes if legal and
2081 necessary (space in the name, and is an existing file). Fixes a bug
2090 necessary (space in the name, and is an existing file). Fixes a bug
2082 reported by Zachary Pincus.
2091 reported by Zachary Pincus.
2083
2092
2084 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2093 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2085
2094
2086 * Manual: thanks to a tip on proper color handling for Emacs, by
2095 * Manual: thanks to a tip on proper color handling for Emacs, by
2087 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2096 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2088
2097
2089 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2098 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2090 by applying the provided patch. Thanks to Liu Jin
2099 by applying the provided patch. Thanks to Liu Jin
2091 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2100 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2092 XEmacs/Linux, I'm trusting the submitter that it actually helps
2101 XEmacs/Linux, I'm trusting the submitter that it actually helps
2093 under win32/GNU Emacs. Will revisit if any problems are reported.
2102 under win32/GNU Emacs. Will revisit if any problems are reported.
2094
2103
2095 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2104 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2096
2105
2097 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2106 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2098 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2107 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2099
2108
2100 2006-03-12 Ville Vainio <vivainio@gmail.com>
2109 2006-03-12 Ville Vainio <vivainio@gmail.com>
2101
2110
2102 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2111 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2103 Torsten Marek.
2112 Torsten Marek.
2104
2113
2105 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2114 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2106
2115
2107 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2116 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2108 line ranges works again.
2117 line ranges works again.
2109
2118
2110 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2119 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2111
2120
2112 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2121 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2113 and friends, after a discussion with Zach Pincus on ipython-user.
2122 and friends, after a discussion with Zach Pincus on ipython-user.
2114 I'm not 100% sure, but after thinking about it quite a bit, it may
2123 I'm not 100% sure, but after thinking about it quite a bit, it may
2115 be OK. Testing with the multithreaded shells didn't reveal any
2124 be OK. Testing with the multithreaded shells didn't reveal any
2116 problems, but let's keep an eye out.
2125 problems, but let's keep an eye out.
2117
2126
2118 In the process, I fixed a few things which were calling
2127 In the process, I fixed a few things which were calling
2119 self.InteractiveTB() directly (like safe_execfile), which is a
2128 self.InteractiveTB() directly (like safe_execfile), which is a
2120 mistake: ALL exception reporting should be done by calling
2129 mistake: ALL exception reporting should be done by calling
2121 self.showtraceback(), which handles state and tab-completion and
2130 self.showtraceback(), which handles state and tab-completion and
2122 more.
2131 more.
2123
2132
2124 2006-03-01 Ville Vainio <vivainio@gmail.com>
2133 2006-03-01 Ville Vainio <vivainio@gmail.com>
2125
2134
2126 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2135 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2127 To use, do "from ipipe import *".
2136 To use, do "from ipipe import *".
2128
2137
2129 2006-02-24 Ville Vainio <vivainio@gmail.com>
2138 2006-02-24 Ville Vainio <vivainio@gmail.com>
2130
2139
2131 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2140 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2132 "cleanly" and safely than the older upgrade mechanism.
2141 "cleanly" and safely than the older upgrade mechanism.
2133
2142
2134 2006-02-21 Ville Vainio <vivainio@gmail.com>
2143 2006-02-21 Ville Vainio <vivainio@gmail.com>
2135
2144
2136 * Magic.py: %save works again.
2145 * Magic.py: %save works again.
2137
2146
2138 2006-02-15 Ville Vainio <vivainio@gmail.com>
2147 2006-02-15 Ville Vainio <vivainio@gmail.com>
2139
2148
2140 * Magic.py: %Pprint works again
2149 * Magic.py: %Pprint works again
2141
2150
2142 * Extensions/ipy_sane_defaults.py: Provide everything provided
2151 * Extensions/ipy_sane_defaults.py: Provide everything provided
2143 in default ipythonrc, to make it possible to have a completely empty
2152 in default ipythonrc, to make it possible to have a completely empty
2144 ipythonrc (and thus completely rc-file free configuration)
2153 ipythonrc (and thus completely rc-file free configuration)
2145
2154
2146 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2155 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2147
2156
2148 * IPython/hooks.py (editor): quote the call to the editor command,
2157 * IPython/hooks.py (editor): quote the call to the editor command,
2149 to allow commands with spaces in them. Problem noted by watching
2158 to allow commands with spaces in them. Problem noted by watching
2150 Ian Oswald's video about textpad under win32 at
2159 Ian Oswald's video about textpad under win32 at
2151 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2160 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2152
2161
2153 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2162 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2154 describing magics (we haven't used @ for a loong time).
2163 describing magics (we haven't used @ for a loong time).
2155
2164
2156 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2165 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2157 contributed by marienz to close
2166 contributed by marienz to close
2158 http://www.scipy.net/roundup/ipython/issue53.
2167 http://www.scipy.net/roundup/ipython/issue53.
2159
2168
2160 2006-02-10 Ville Vainio <vivainio@gmail.com>
2169 2006-02-10 Ville Vainio <vivainio@gmail.com>
2161
2170
2162 * genutils.py: getoutput now works in win32 too
2171 * genutils.py: getoutput now works in win32 too
2163
2172
2164 * completer.py: alias and magic completion only invoked
2173 * completer.py: alias and magic completion only invoked
2165 at the first "item" in the line, to avoid "cd %store"
2174 at the first "item" in the line, to avoid "cd %store"
2166 nonsense.
2175 nonsense.
2167
2176
2168 2006-02-09 Ville Vainio <vivainio@gmail.com>
2177 2006-02-09 Ville Vainio <vivainio@gmail.com>
2169
2178
2170 * test/*: Added a unit testing framework (finally).
2179 * test/*: Added a unit testing framework (finally).
2171 '%run runtests.py' to run test_*.
2180 '%run runtests.py' to run test_*.
2172
2181
2173 * ipapi.py: Exposed runlines and set_custom_exc
2182 * ipapi.py: Exposed runlines and set_custom_exc
2174
2183
2175 2006-02-07 Ville Vainio <vivainio@gmail.com>
2184 2006-02-07 Ville Vainio <vivainio@gmail.com>
2176
2185
2177 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2186 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2178 instead use "f(1 2)" as before.
2187 instead use "f(1 2)" as before.
2179
2188
2180 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2189 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2181
2190
2182 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2191 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2183 facilities, for demos processed by the IPython input filter
2192 facilities, for demos processed by the IPython input filter
2184 (IPythonDemo), and for running a script one-line-at-a-time as a
2193 (IPythonDemo), and for running a script one-line-at-a-time as a
2185 demo, both for pure Python (LineDemo) and for IPython-processed
2194 demo, both for pure Python (LineDemo) and for IPython-processed
2186 input (IPythonLineDemo). After a request by Dave Kohel, from the
2195 input (IPythonLineDemo). After a request by Dave Kohel, from the
2187 SAGE team.
2196 SAGE team.
2188 (Demo.edit): added an edit() method to the demo objects, to edit
2197 (Demo.edit): added an edit() method to the demo objects, to edit
2189 the in-memory copy of the last executed block.
2198 the in-memory copy of the last executed block.
2190
2199
2191 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2200 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2192 processing to %edit, %macro and %save. These commands can now be
2201 processing to %edit, %macro and %save. These commands can now be
2193 invoked on the unprocessed input as it was typed by the user
2202 invoked on the unprocessed input as it was typed by the user
2194 (without any prefilters applied). After requests by the SAGE team
2203 (without any prefilters applied). After requests by the SAGE team
2195 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2204 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2196
2205
2197 2006-02-01 Ville Vainio <vivainio@gmail.com>
2206 2006-02-01 Ville Vainio <vivainio@gmail.com>
2198
2207
2199 * setup.py, eggsetup.py: easy_install ipython==dev works
2208 * setup.py, eggsetup.py: easy_install ipython==dev works
2200 correctly now (on Linux)
2209 correctly now (on Linux)
2201
2210
2202 * ipy_user_conf,ipmaker: user config changes, removed spurious
2211 * ipy_user_conf,ipmaker: user config changes, removed spurious
2203 warnings
2212 warnings
2204
2213
2205 * iplib: if rc.banner is string, use it as is.
2214 * iplib: if rc.banner is string, use it as is.
2206
2215
2207 * Magic: %pycat accepts a string argument and pages it's contents.
2216 * Magic: %pycat accepts a string argument and pages it's contents.
2208
2217
2209
2218
2210 2006-01-30 Ville Vainio <vivainio@gmail.com>
2219 2006-01-30 Ville Vainio <vivainio@gmail.com>
2211
2220
2212 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2221 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2213 Now %store and bookmarks work through PickleShare, meaning that
2222 Now %store and bookmarks work through PickleShare, meaning that
2214 concurrent access is possible and all ipython sessions see the
2223 concurrent access is possible and all ipython sessions see the
2215 same database situation all the time, instead of snapshot of
2224 same database situation all the time, instead of snapshot of
2216 the situation when the session was started. Hence, %bookmark
2225 the situation when the session was started. Hence, %bookmark
2217 results are immediately accessible from othes sessions. The database
2226 results are immediately accessible from othes sessions. The database
2218 is also available for use by user extensions. See:
2227 is also available for use by user extensions. See:
2219 http://www.python.org/pypi/pickleshare
2228 http://www.python.org/pypi/pickleshare
2220
2229
2221 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2230 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2222
2231
2223 * aliases can now be %store'd
2232 * aliases can now be %store'd
2224
2233
2225 * path.py moved to Extensions so that pickleshare does not need
2234 * path.py moved to Extensions so that pickleshare does not need
2226 IPython-specific import. Extensions added to pythonpath right
2235 IPython-specific import. Extensions added to pythonpath right
2227 at __init__.
2236 at __init__.
2228
2237
2229 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2238 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2230 called with _ip.system and the pre-transformed command string.
2239 called with _ip.system and the pre-transformed command string.
2231
2240
2232 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2241 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2233
2242
2234 * IPython/iplib.py (interact): Fix that we were not catching
2243 * IPython/iplib.py (interact): Fix that we were not catching
2235 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2244 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2236 logic here had to change, but it's fixed now.
2245 logic here had to change, but it's fixed now.
2237
2246
2238 2006-01-29 Ville Vainio <vivainio@gmail.com>
2247 2006-01-29 Ville Vainio <vivainio@gmail.com>
2239
2248
2240 * iplib.py: Try to import pyreadline on Windows.
2249 * iplib.py: Try to import pyreadline on Windows.
2241
2250
2242 2006-01-27 Ville Vainio <vivainio@gmail.com>
2251 2006-01-27 Ville Vainio <vivainio@gmail.com>
2243
2252
2244 * iplib.py: Expose ipapi as _ip in builtin namespace.
2253 * iplib.py: Expose ipapi as _ip in builtin namespace.
2245 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2254 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2246 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2255 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2247 syntax now produce _ip.* variant of the commands.
2256 syntax now produce _ip.* variant of the commands.
2248
2257
2249 * "_ip.options().autoedit_syntax = 2" automatically throws
2258 * "_ip.options().autoedit_syntax = 2" automatically throws
2250 user to editor for syntax error correction without prompting.
2259 user to editor for syntax error correction without prompting.
2251
2260
2252 2006-01-27 Ville Vainio <vivainio@gmail.com>
2261 2006-01-27 Ville Vainio <vivainio@gmail.com>
2253
2262
2254 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2263 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2255 'ipython' at argv[0]) executed through command line.
2264 'ipython' at argv[0]) executed through command line.
2256 NOTE: this DEPRECATES calling ipython with multiple scripts
2265 NOTE: this DEPRECATES calling ipython with multiple scripts
2257 ("ipython a.py b.py c.py")
2266 ("ipython a.py b.py c.py")
2258
2267
2259 * iplib.py, hooks.py: Added configurable input prefilter,
2268 * iplib.py, hooks.py: Added configurable input prefilter,
2260 named 'input_prefilter'. See ext_rescapture.py for example
2269 named 'input_prefilter'. See ext_rescapture.py for example
2261 usage.
2270 usage.
2262
2271
2263 * ext_rescapture.py, Magic.py: Better system command output capture
2272 * ext_rescapture.py, Magic.py: Better system command output capture
2264 through 'var = !ls' (deprecates user-visible %sc). Same notation
2273 through 'var = !ls' (deprecates user-visible %sc). Same notation
2265 applies for magics, 'var = %alias' assigns alias list to var.
2274 applies for magics, 'var = %alias' assigns alias list to var.
2266
2275
2267 * ipapi.py: added meta() for accessing extension-usable data store.
2276 * ipapi.py: added meta() for accessing extension-usable data store.
2268
2277
2269 * iplib.py: added InteractiveShell.getapi(). New magics should be
2278 * iplib.py: added InteractiveShell.getapi(). New magics should be
2270 written doing self.getapi() instead of using the shell directly.
2279 written doing self.getapi() instead of using the shell directly.
2271
2280
2272 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2281 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2273 %store foo >> ~/myfoo.txt to store variables to files (in clean
2282 %store foo >> ~/myfoo.txt to store variables to files (in clean
2274 textual form, not a restorable pickle).
2283 textual form, not a restorable pickle).
2275
2284
2276 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2285 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2277
2286
2278 * usage.py, Magic.py: added %quickref
2287 * usage.py, Magic.py: added %quickref
2279
2288
2280 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2289 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2281
2290
2282 * GetoptErrors when invoking magics etc. with wrong args
2291 * GetoptErrors when invoking magics etc. with wrong args
2283 are now more helpful:
2292 are now more helpful:
2284 GetoptError: option -l not recognized (allowed: "qb" )
2293 GetoptError: option -l not recognized (allowed: "qb" )
2285
2294
2286 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2295 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2287
2296
2288 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2297 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2289 computationally intensive blocks don't appear to stall the demo.
2298 computationally intensive blocks don't appear to stall the demo.
2290
2299
2291 2006-01-24 Ville Vainio <vivainio@gmail.com>
2300 2006-01-24 Ville Vainio <vivainio@gmail.com>
2292
2301
2293 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2302 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2294 value to manipulate resulting history entry.
2303 value to manipulate resulting history entry.
2295
2304
2296 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2305 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2297 to instance methods of IPApi class, to make extending an embedded
2306 to instance methods of IPApi class, to make extending an embedded
2298 IPython feasible. See ext_rehashdir.py for example usage.
2307 IPython feasible. See ext_rehashdir.py for example usage.
2299
2308
2300 * Merged 1071-1076 from branches/0.7.1
2309 * Merged 1071-1076 from branches/0.7.1
2301
2310
2302
2311
2303 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2312 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2304
2313
2305 * tools/release (daystamp): Fix build tools to use the new
2314 * tools/release (daystamp): Fix build tools to use the new
2306 eggsetup.py script to build lightweight eggs.
2315 eggsetup.py script to build lightweight eggs.
2307
2316
2308 * Applied changesets 1062 and 1064 before 0.7.1 release.
2317 * Applied changesets 1062 and 1064 before 0.7.1 release.
2309
2318
2310 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2319 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2311 see the raw input history (without conversions like %ls ->
2320 see the raw input history (without conversions like %ls ->
2312 ipmagic("ls")). After a request from W. Stein, SAGE
2321 ipmagic("ls")). After a request from W. Stein, SAGE
2313 (http://modular.ucsd.edu/sage) developer. This information is
2322 (http://modular.ucsd.edu/sage) developer. This information is
2314 stored in the input_hist_raw attribute of the IPython instance, so
2323 stored in the input_hist_raw attribute of the IPython instance, so
2315 developers can access it if needed (it's an InputList instance).
2324 developers can access it if needed (it's an InputList instance).
2316
2325
2317 * Versionstring = 0.7.2.svn
2326 * Versionstring = 0.7.2.svn
2318
2327
2319 * eggsetup.py: A separate script for constructing eggs, creates
2328 * eggsetup.py: A separate script for constructing eggs, creates
2320 proper launch scripts even on Windows (an .exe file in
2329 proper launch scripts even on Windows (an .exe file in
2321 \python24\scripts).
2330 \python24\scripts).
2322
2331
2323 * ipapi.py: launch_new_instance, launch entry point needed for the
2332 * ipapi.py: launch_new_instance, launch entry point needed for the
2324 egg.
2333 egg.
2325
2334
2326 2006-01-23 Ville Vainio <vivainio@gmail.com>
2335 2006-01-23 Ville Vainio <vivainio@gmail.com>
2327
2336
2328 * Added %cpaste magic for pasting python code
2337 * Added %cpaste magic for pasting python code
2329
2338
2330 2006-01-22 Ville Vainio <vivainio@gmail.com>
2339 2006-01-22 Ville Vainio <vivainio@gmail.com>
2331
2340
2332 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2341 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2333
2342
2334 * Versionstring = 0.7.2.svn
2343 * Versionstring = 0.7.2.svn
2335
2344
2336 * eggsetup.py: A separate script for constructing eggs, creates
2345 * eggsetup.py: A separate script for constructing eggs, creates
2337 proper launch scripts even on Windows (an .exe file in
2346 proper launch scripts even on Windows (an .exe file in
2338 \python24\scripts).
2347 \python24\scripts).
2339
2348
2340 * ipapi.py: launch_new_instance, launch entry point needed for the
2349 * ipapi.py: launch_new_instance, launch entry point needed for the
2341 egg.
2350 egg.
2342
2351
2343 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2352 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2344
2353
2345 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2354 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2346 %pfile foo would print the file for foo even if it was a binary.
2355 %pfile foo would print the file for foo even if it was a binary.
2347 Now, extensions '.so' and '.dll' are skipped.
2356 Now, extensions '.so' and '.dll' are skipped.
2348
2357
2349 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2358 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2350 bug, where macros would fail in all threaded modes. I'm not 100%
2359 bug, where macros would fail in all threaded modes. I'm not 100%
2351 sure, so I'm going to put out an rc instead of making a release
2360 sure, so I'm going to put out an rc instead of making a release
2352 today, and wait for feedback for at least a few days.
2361 today, and wait for feedback for at least a few days.
2353
2362
2354 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2363 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2355 it...) the handling of pasting external code with autoindent on.
2364 it...) the handling of pasting external code with autoindent on.
2356 To get out of a multiline input, the rule will appear for most
2365 To get out of a multiline input, the rule will appear for most
2357 users unchanged: two blank lines or change the indent level
2366 users unchanged: two blank lines or change the indent level
2358 proposed by IPython. But there is a twist now: you can
2367 proposed by IPython. But there is a twist now: you can
2359 add/subtract only *one or two spaces*. If you add/subtract three
2368 add/subtract only *one or two spaces*. If you add/subtract three
2360 or more (unless you completely delete the line), IPython will
2369 or more (unless you completely delete the line), IPython will
2361 accept that line, and you'll need to enter a second one of pure
2370 accept that line, and you'll need to enter a second one of pure
2362 whitespace. I know it sounds complicated, but I can't find a
2371 whitespace. I know it sounds complicated, but I can't find a
2363 different solution that covers all the cases, with the right
2372 different solution that covers all the cases, with the right
2364 heuristics. Hopefully in actual use, nobody will really notice
2373 heuristics. Hopefully in actual use, nobody will really notice
2365 all these strange rules and things will 'just work'.
2374 all these strange rules and things will 'just work'.
2366
2375
2367 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2376 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2368
2377
2369 * IPython/iplib.py (interact): catch exceptions which can be
2378 * IPython/iplib.py (interact): catch exceptions which can be
2370 triggered asynchronously by signal handlers. Thanks to an
2379 triggered asynchronously by signal handlers. Thanks to an
2371 automatic crash report, submitted by Colin Kingsley
2380 automatic crash report, submitted by Colin Kingsley
2372 <tercel-AT-gentoo.org>.
2381 <tercel-AT-gentoo.org>.
2373
2382
2374 2006-01-20 Ville Vainio <vivainio@gmail.com>
2383 2006-01-20 Ville Vainio <vivainio@gmail.com>
2375
2384
2376 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2385 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2377 (%rehashdir, very useful, try it out) of how to extend ipython
2386 (%rehashdir, very useful, try it out) of how to extend ipython
2378 with new magics. Also added Extensions dir to pythonpath to make
2387 with new magics. Also added Extensions dir to pythonpath to make
2379 importing extensions easy.
2388 importing extensions easy.
2380
2389
2381 * %store now complains when trying to store interactively declared
2390 * %store now complains when trying to store interactively declared
2382 classes / instances of those classes.
2391 classes / instances of those classes.
2383
2392
2384 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2393 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2385 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2394 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2386 if they exist, and ipy_user_conf.py with some defaults is created for
2395 if they exist, and ipy_user_conf.py with some defaults is created for
2387 the user.
2396 the user.
2388
2397
2389 * Startup rehashing done by the config file, not InterpreterExec.
2398 * Startup rehashing done by the config file, not InterpreterExec.
2390 This means system commands are available even without selecting the
2399 This means system commands are available even without selecting the
2391 pysh profile. It's the sensible default after all.
2400 pysh profile. It's the sensible default after all.
2392
2401
2393 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2402 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2394
2403
2395 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2404 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2396 multiline code with autoindent on working. But I am really not
2405 multiline code with autoindent on working. But I am really not
2397 sure, so this needs more testing. Will commit a debug-enabled
2406 sure, so this needs more testing. Will commit a debug-enabled
2398 version for now, while I test it some more, so that Ville and
2407 version for now, while I test it some more, so that Ville and
2399 others may also catch any problems. Also made
2408 others may also catch any problems. Also made
2400 self.indent_current_str() a method, to ensure that there's no
2409 self.indent_current_str() a method, to ensure that there's no
2401 chance of the indent space count and the corresponding string
2410 chance of the indent space count and the corresponding string
2402 falling out of sync. All code needing the string should just call
2411 falling out of sync. All code needing the string should just call
2403 the method.
2412 the method.
2404
2413
2405 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2414 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2406
2415
2407 * IPython/Magic.py (magic_edit): fix check for when users don't
2416 * IPython/Magic.py (magic_edit): fix check for when users don't
2408 save their output files, the try/except was in the wrong section.
2417 save their output files, the try/except was in the wrong section.
2409
2418
2410 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2419 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2411
2420
2412 * IPython/Magic.py (magic_run): fix __file__ global missing from
2421 * IPython/Magic.py (magic_run): fix __file__ global missing from
2413 script's namespace when executed via %run. After a report by
2422 script's namespace when executed via %run. After a report by
2414 Vivian.
2423 Vivian.
2415
2424
2416 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2425 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2417 when using python 2.4. The parent constructor changed in 2.4, and
2426 when using python 2.4. The parent constructor changed in 2.4, and
2418 we need to track it directly (we can't call it, as it messes up
2427 we need to track it directly (we can't call it, as it messes up
2419 readline and tab-completion inside our pdb would stop working).
2428 readline and tab-completion inside our pdb would stop working).
2420 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2429 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2421
2430
2422 2006-01-16 Ville Vainio <vivainio@gmail.com>
2431 2006-01-16 Ville Vainio <vivainio@gmail.com>
2423
2432
2424 * Ipython/magic.py: Reverted back to old %edit functionality
2433 * Ipython/magic.py: Reverted back to old %edit functionality
2425 that returns file contents on exit.
2434 that returns file contents on exit.
2426
2435
2427 * IPython/path.py: Added Jason Orendorff's "path" module to
2436 * IPython/path.py: Added Jason Orendorff's "path" module to
2428 IPython tree, http://www.jorendorff.com/articles/python/path/.
2437 IPython tree, http://www.jorendorff.com/articles/python/path/.
2429 You can get path objects conveniently through %sc, and !!, e.g.:
2438 You can get path objects conveniently through %sc, and !!, e.g.:
2430 sc files=ls
2439 sc files=ls
2431 for p in files.paths: # or files.p
2440 for p in files.paths: # or files.p
2432 print p,p.mtime
2441 print p,p.mtime
2433
2442
2434 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2443 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2435 now work again without considering the exclusion regexp -
2444 now work again without considering the exclusion regexp -
2436 hence, things like ',foo my/path' turn to 'foo("my/path")'
2445 hence, things like ',foo my/path' turn to 'foo("my/path")'
2437 instead of syntax error.
2446 instead of syntax error.
2438
2447
2439
2448
2440 2006-01-14 Ville Vainio <vivainio@gmail.com>
2449 2006-01-14 Ville Vainio <vivainio@gmail.com>
2441
2450
2442 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2451 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2443 ipapi decorators for python 2.4 users, options() provides access to rc
2452 ipapi decorators for python 2.4 users, options() provides access to rc
2444 data.
2453 data.
2445
2454
2446 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2455 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2447 as path separators (even on Linux ;-). Space character after
2456 as path separators (even on Linux ;-). Space character after
2448 backslash (as yielded by tab completer) is still space;
2457 backslash (as yielded by tab completer) is still space;
2449 "%cd long\ name" works as expected.
2458 "%cd long\ name" works as expected.
2450
2459
2451 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2460 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2452 as "chain of command", with priority. API stays the same,
2461 as "chain of command", with priority. API stays the same,
2453 TryNext exception raised by a hook function signals that
2462 TryNext exception raised by a hook function signals that
2454 current hook failed and next hook should try handling it, as
2463 current hook failed and next hook should try handling it, as
2455 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2464 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2456 requested configurable display hook, which is now implemented.
2465 requested configurable display hook, which is now implemented.
2457
2466
2458 2006-01-13 Ville Vainio <vivainio@gmail.com>
2467 2006-01-13 Ville Vainio <vivainio@gmail.com>
2459
2468
2460 * IPython/platutils*.py: platform specific utility functions,
2469 * IPython/platutils*.py: platform specific utility functions,
2461 so far only set_term_title is implemented (change terminal
2470 so far only set_term_title is implemented (change terminal
2462 label in windowing systems). %cd now changes the title to
2471 label in windowing systems). %cd now changes the title to
2463 current dir.
2472 current dir.
2464
2473
2465 * IPython/Release.py: Added myself to "authors" list,
2474 * IPython/Release.py: Added myself to "authors" list,
2466 had to create new files.
2475 had to create new files.
2467
2476
2468 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2477 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2469 shell escape; not a known bug but had potential to be one in the
2478 shell escape; not a known bug but had potential to be one in the
2470 future.
2479 future.
2471
2480
2472 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2481 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2473 extension API for IPython! See the module for usage example. Fix
2482 extension API for IPython! See the module for usage example. Fix
2474 OInspect for docstring-less magic functions.
2483 OInspect for docstring-less magic functions.
2475
2484
2476
2485
2477 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2486 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2478
2487
2479 * IPython/iplib.py (raw_input): temporarily deactivate all
2488 * IPython/iplib.py (raw_input): temporarily deactivate all
2480 attempts at allowing pasting of code with autoindent on. It
2489 attempts at allowing pasting of code with autoindent on. It
2481 introduced bugs (reported by Prabhu) and I can't seem to find a
2490 introduced bugs (reported by Prabhu) and I can't seem to find a
2482 robust combination which works in all cases. Will have to revisit
2491 robust combination which works in all cases. Will have to revisit
2483 later.
2492 later.
2484
2493
2485 * IPython/genutils.py: remove isspace() function. We've dropped
2494 * IPython/genutils.py: remove isspace() function. We've dropped
2486 2.2 compatibility, so it's OK to use the string method.
2495 2.2 compatibility, so it's OK to use the string method.
2487
2496
2488 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2497 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2489
2498
2490 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2499 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2491 matching what NOT to autocall on, to include all python binary
2500 matching what NOT to autocall on, to include all python binary
2492 operators (including things like 'and', 'or', 'is' and 'in').
2501 operators (including things like 'and', 'or', 'is' and 'in').
2493 Prompted by a bug report on 'foo & bar', but I realized we had
2502 Prompted by a bug report on 'foo & bar', but I realized we had
2494 many more potential bug cases with other operators. The regexp is
2503 many more potential bug cases with other operators. The regexp is
2495 self.re_exclude_auto, it's fairly commented.
2504 self.re_exclude_auto, it's fairly commented.
2496
2505
2497 2006-01-12 Ville Vainio <vivainio@gmail.com>
2506 2006-01-12 Ville Vainio <vivainio@gmail.com>
2498
2507
2499 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2508 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2500 Prettified and hardened string/backslash quoting with ipsystem(),
2509 Prettified and hardened string/backslash quoting with ipsystem(),
2501 ipalias() and ipmagic(). Now even \ characters are passed to
2510 ipalias() and ipmagic(). Now even \ characters are passed to
2502 %magics, !shell escapes and aliases exactly as they are in the
2511 %magics, !shell escapes and aliases exactly as they are in the
2503 ipython command line. Should improve backslash experience,
2512 ipython command line. Should improve backslash experience,
2504 particularly in Windows (path delimiter for some commands that
2513 particularly in Windows (path delimiter for some commands that
2505 won't understand '/'), but Unix benefits as well (regexps). %cd
2514 won't understand '/'), but Unix benefits as well (regexps). %cd
2506 magic still doesn't support backslash path delimiters, though. Also
2515 magic still doesn't support backslash path delimiters, though. Also
2507 deleted all pretense of supporting multiline command strings in
2516 deleted all pretense of supporting multiline command strings in
2508 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2517 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2509
2518
2510 * doc/build_doc_instructions.txt added. Documentation on how to
2519 * doc/build_doc_instructions.txt added. Documentation on how to
2511 use doc/update_manual.py, added yesterday. Both files contributed
2520 use doc/update_manual.py, added yesterday. Both files contributed
2512 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2521 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2513 doc/*.sh for deprecation at a later date.
2522 doc/*.sh for deprecation at a later date.
2514
2523
2515 * /ipython.py Added ipython.py to root directory for
2524 * /ipython.py Added ipython.py to root directory for
2516 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2525 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2517 ipython.py) and development convenience (no need to keep doing
2526 ipython.py) and development convenience (no need to keep doing
2518 "setup.py install" between changes).
2527 "setup.py install" between changes).
2519
2528
2520 * Made ! and !! shell escapes work (again) in multiline expressions:
2529 * Made ! and !! shell escapes work (again) in multiline expressions:
2521 if 1:
2530 if 1:
2522 !ls
2531 !ls
2523 !!ls
2532 !!ls
2524
2533
2525 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2534 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2526
2535
2527 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2536 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2528 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2537 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2529 module in case-insensitive installation. Was causing crashes
2538 module in case-insensitive installation. Was causing crashes
2530 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2539 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2531
2540
2532 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2541 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2533 <marienz-AT-gentoo.org>, closes
2542 <marienz-AT-gentoo.org>, closes
2534 http://www.scipy.net/roundup/ipython/issue51.
2543 http://www.scipy.net/roundup/ipython/issue51.
2535
2544
2536 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2545 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2537
2546
2538 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2547 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2539 problem of excessive CPU usage under *nix and keyboard lag under
2548 problem of excessive CPU usage under *nix and keyboard lag under
2540 win32.
2549 win32.
2541
2550
2542 2006-01-10 *** Released version 0.7.0
2551 2006-01-10 *** Released version 0.7.0
2543
2552
2544 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2553 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2545
2554
2546 * IPython/Release.py (revision): tag version number to 0.7.0,
2555 * IPython/Release.py (revision): tag version number to 0.7.0,
2547 ready for release.
2556 ready for release.
2548
2557
2549 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2558 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2550 it informs the user of the name of the temp. file used. This can
2559 it informs the user of the name of the temp. file used. This can
2551 help if you decide later to reuse that same file, so you know
2560 help if you decide later to reuse that same file, so you know
2552 where to copy the info from.
2561 where to copy the info from.
2553
2562
2554 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2563 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2555
2564
2556 * setup_bdist_egg.py: little script to build an egg. Added
2565 * setup_bdist_egg.py: little script to build an egg. Added
2557 support in the release tools as well.
2566 support in the release tools as well.
2558
2567
2559 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2568 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2560
2569
2561 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2570 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2562 version selection (new -wxversion command line and ipythonrc
2571 version selection (new -wxversion command line and ipythonrc
2563 parameter). Patch contributed by Arnd Baecker
2572 parameter). Patch contributed by Arnd Baecker
2564 <arnd.baecker-AT-web.de>.
2573 <arnd.baecker-AT-web.de>.
2565
2574
2566 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2575 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2567 embedded instances, for variables defined at the interactive
2576 embedded instances, for variables defined at the interactive
2568 prompt of the embedded ipython. Reported by Arnd.
2577 prompt of the embedded ipython. Reported by Arnd.
2569
2578
2570 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2579 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2571 it can be used as a (stateful) toggle, or with a direct parameter.
2580 it can be used as a (stateful) toggle, or with a direct parameter.
2572
2581
2573 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2582 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2574 could be triggered in certain cases and cause the traceback
2583 could be triggered in certain cases and cause the traceback
2575 printer not to work.
2584 printer not to work.
2576
2585
2577 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2586 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2578
2587
2579 * IPython/iplib.py (_should_recompile): Small fix, closes
2588 * IPython/iplib.py (_should_recompile): Small fix, closes
2580 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2589 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2581
2590
2582 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2591 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2583
2592
2584 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2593 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2585 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2594 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2586 Moad for help with tracking it down.
2595 Moad for help with tracking it down.
2587
2596
2588 * IPython/iplib.py (handle_auto): fix autocall handling for
2597 * IPython/iplib.py (handle_auto): fix autocall handling for
2589 objects which support BOTH __getitem__ and __call__ (so that f [x]
2598 objects which support BOTH __getitem__ and __call__ (so that f [x]
2590 is left alone, instead of becoming f([x]) automatically).
2599 is left alone, instead of becoming f([x]) automatically).
2591
2600
2592 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2601 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2593 Ville's patch.
2602 Ville's patch.
2594
2603
2595 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2604 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2596
2605
2597 * IPython/iplib.py (handle_auto): changed autocall semantics to
2606 * IPython/iplib.py (handle_auto): changed autocall semantics to
2598 include 'smart' mode, where the autocall transformation is NOT
2607 include 'smart' mode, where the autocall transformation is NOT
2599 applied if there are no arguments on the line. This allows you to
2608 applied if there are no arguments on the line. This allows you to
2600 just type 'foo' if foo is a callable to see its internal form,
2609 just type 'foo' if foo is a callable to see its internal form,
2601 instead of having it called with no arguments (typically a
2610 instead of having it called with no arguments (typically a
2602 mistake). The old 'full' autocall still exists: for that, you
2611 mistake). The old 'full' autocall still exists: for that, you
2603 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2612 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2604
2613
2605 * IPython/completer.py (Completer.attr_matches): add
2614 * IPython/completer.py (Completer.attr_matches): add
2606 tab-completion support for Enthoughts' traits. After a report by
2615 tab-completion support for Enthoughts' traits. After a report by
2607 Arnd and a patch by Prabhu.
2616 Arnd and a patch by Prabhu.
2608
2617
2609 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2618 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2610
2619
2611 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2620 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2612 Schmolck's patch to fix inspect.getinnerframes().
2621 Schmolck's patch to fix inspect.getinnerframes().
2613
2622
2614 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2623 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2615 for embedded instances, regarding handling of namespaces and items
2624 for embedded instances, regarding handling of namespaces and items
2616 added to the __builtin__ one. Multiple embedded instances and
2625 added to the __builtin__ one. Multiple embedded instances and
2617 recursive embeddings should work better now (though I'm not sure
2626 recursive embeddings should work better now (though I'm not sure
2618 I've got all the corner cases fixed, that code is a bit of a brain
2627 I've got all the corner cases fixed, that code is a bit of a brain
2619 twister).
2628 twister).
2620
2629
2621 * IPython/Magic.py (magic_edit): added support to edit in-memory
2630 * IPython/Magic.py (magic_edit): added support to edit in-memory
2622 macros (automatically creates the necessary temp files). %edit
2631 macros (automatically creates the necessary temp files). %edit
2623 also doesn't return the file contents anymore, it's just noise.
2632 also doesn't return the file contents anymore, it's just noise.
2624
2633
2625 * IPython/completer.py (Completer.attr_matches): revert change to
2634 * IPython/completer.py (Completer.attr_matches): revert change to
2626 complete only on attributes listed in __all__. I realized it
2635 complete only on attributes listed in __all__. I realized it
2627 cripples the tab-completion system as a tool for exploring the
2636 cripples the tab-completion system as a tool for exploring the
2628 internals of unknown libraries (it renders any non-__all__
2637 internals of unknown libraries (it renders any non-__all__
2629 attribute off-limits). I got bit by this when trying to see
2638 attribute off-limits). I got bit by this when trying to see
2630 something inside the dis module.
2639 something inside the dis module.
2631
2640
2632 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2641 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2633
2642
2634 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2643 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2635 namespace for users and extension writers to hold data in. This
2644 namespace for users and extension writers to hold data in. This
2636 follows the discussion in
2645 follows the discussion in
2637 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2646 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2638
2647
2639 * IPython/completer.py (IPCompleter.complete): small patch to help
2648 * IPython/completer.py (IPCompleter.complete): small patch to help
2640 tab-completion under Emacs, after a suggestion by John Barnard
2649 tab-completion under Emacs, after a suggestion by John Barnard
2641 <barnarj-AT-ccf.org>.
2650 <barnarj-AT-ccf.org>.
2642
2651
2643 * IPython/Magic.py (Magic.extract_input_slices): added support for
2652 * IPython/Magic.py (Magic.extract_input_slices): added support for
2644 the slice notation in magics to use N-M to represent numbers N...M
2653 the slice notation in magics to use N-M to represent numbers N...M
2645 (closed endpoints). This is used by %macro and %save.
2654 (closed endpoints). This is used by %macro and %save.
2646
2655
2647 * IPython/completer.py (Completer.attr_matches): for modules which
2656 * IPython/completer.py (Completer.attr_matches): for modules which
2648 define __all__, complete only on those. After a patch by Jeffrey
2657 define __all__, complete only on those. After a patch by Jeffrey
2649 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2658 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2650 speed up this routine.
2659 speed up this routine.
2651
2660
2652 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2661 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2653 don't know if this is the end of it, but the behavior now is
2662 don't know if this is the end of it, but the behavior now is
2654 certainly much more correct. Note that coupled with macros,
2663 certainly much more correct. Note that coupled with macros,
2655 slightly surprising (at first) behavior may occur: a macro will in
2664 slightly surprising (at first) behavior may occur: a macro will in
2656 general expand to multiple lines of input, so upon exiting, the
2665 general expand to multiple lines of input, so upon exiting, the
2657 in/out counters will both be bumped by the corresponding amount
2666 in/out counters will both be bumped by the corresponding amount
2658 (as if the macro's contents had been typed interactively). Typing
2667 (as if the macro's contents had been typed interactively). Typing
2659 %hist will reveal the intermediate (silently processed) lines.
2668 %hist will reveal the intermediate (silently processed) lines.
2660
2669
2661 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2670 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2662 pickle to fail (%run was overwriting __main__ and not restoring
2671 pickle to fail (%run was overwriting __main__ and not restoring
2663 it, but pickle relies on __main__ to operate).
2672 it, but pickle relies on __main__ to operate).
2664
2673
2665 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2674 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2666 using properties, but forgot to make the main InteractiveShell
2675 using properties, but forgot to make the main InteractiveShell
2667 class a new-style class. Properties fail silently, and
2676 class a new-style class. Properties fail silently, and
2668 mysteriously, with old-style class (getters work, but
2677 mysteriously, with old-style class (getters work, but
2669 setters don't do anything).
2678 setters don't do anything).
2670
2679
2671 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2680 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2672
2681
2673 * IPython/Magic.py (magic_history): fix history reporting bug (I
2682 * IPython/Magic.py (magic_history): fix history reporting bug (I
2674 know some nasties are still there, I just can't seem to find a
2683 know some nasties are still there, I just can't seem to find a
2675 reproducible test case to track them down; the input history is
2684 reproducible test case to track them down; the input history is
2676 falling out of sync...)
2685 falling out of sync...)
2677
2686
2678 * IPython/iplib.py (handle_shell_escape): fix bug where both
2687 * IPython/iplib.py (handle_shell_escape): fix bug where both
2679 aliases and system accesses where broken for indented code (such
2688 aliases and system accesses where broken for indented code (such
2680 as loops).
2689 as loops).
2681
2690
2682 * IPython/genutils.py (shell): fix small but critical bug for
2691 * IPython/genutils.py (shell): fix small but critical bug for
2683 win32 system access.
2692 win32 system access.
2684
2693
2685 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2694 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2686
2695
2687 * IPython/iplib.py (showtraceback): remove use of the
2696 * IPython/iplib.py (showtraceback): remove use of the
2688 sys.last_{type/value/traceback} structures, which are non
2697 sys.last_{type/value/traceback} structures, which are non
2689 thread-safe.
2698 thread-safe.
2690 (_prefilter): change control flow to ensure that we NEVER
2699 (_prefilter): change control flow to ensure that we NEVER
2691 introspect objects when autocall is off. This will guarantee that
2700 introspect objects when autocall is off. This will guarantee that
2692 having an input line of the form 'x.y', where access to attribute
2701 having an input line of the form 'x.y', where access to attribute
2693 'y' has side effects, doesn't trigger the side effect TWICE. It
2702 'y' has side effects, doesn't trigger the side effect TWICE. It
2694 is important to note that, with autocall on, these side effects
2703 is important to note that, with autocall on, these side effects
2695 can still happen.
2704 can still happen.
2696 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2705 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2697 trio. IPython offers these three kinds of special calls which are
2706 trio. IPython offers these three kinds of special calls which are
2698 not python code, and it's a good thing to have their call method
2707 not python code, and it's a good thing to have their call method
2699 be accessible as pure python functions (not just special syntax at
2708 be accessible as pure python functions (not just special syntax at
2700 the command line). It gives us a better internal implementation
2709 the command line). It gives us a better internal implementation
2701 structure, as well as exposing these for user scripting more
2710 structure, as well as exposing these for user scripting more
2702 cleanly.
2711 cleanly.
2703
2712
2704 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2713 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2705 file. Now that they'll be more likely to be used with the
2714 file. Now that they'll be more likely to be used with the
2706 persistance system (%store), I want to make sure their module path
2715 persistance system (%store), I want to make sure their module path
2707 doesn't change in the future, so that we don't break things for
2716 doesn't change in the future, so that we don't break things for
2708 users' persisted data.
2717 users' persisted data.
2709
2718
2710 * IPython/iplib.py (autoindent_update): move indentation
2719 * IPython/iplib.py (autoindent_update): move indentation
2711 management into the _text_ processing loop, not the keyboard
2720 management into the _text_ processing loop, not the keyboard
2712 interactive one. This is necessary to correctly process non-typed
2721 interactive one. This is necessary to correctly process non-typed
2713 multiline input (such as macros).
2722 multiline input (such as macros).
2714
2723
2715 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2724 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2716 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2725 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2717 which was producing problems in the resulting manual.
2726 which was producing problems in the resulting manual.
2718 (magic_whos): improve reporting of instances (show their class,
2727 (magic_whos): improve reporting of instances (show their class,
2719 instead of simply printing 'instance' which isn't terribly
2728 instead of simply printing 'instance' which isn't terribly
2720 informative).
2729 informative).
2721
2730
2722 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2731 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2723 (minor mods) to support network shares under win32.
2732 (minor mods) to support network shares under win32.
2724
2733
2725 * IPython/winconsole.py (get_console_size): add new winconsole
2734 * IPython/winconsole.py (get_console_size): add new winconsole
2726 module and fixes to page_dumb() to improve its behavior under
2735 module and fixes to page_dumb() to improve its behavior under
2727 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2736 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2728
2737
2729 * IPython/Magic.py (Macro): simplified Macro class to just
2738 * IPython/Magic.py (Macro): simplified Macro class to just
2730 subclass list. We've had only 2.2 compatibility for a very long
2739 subclass list. We've had only 2.2 compatibility for a very long
2731 time, yet I was still avoiding subclassing the builtin types. No
2740 time, yet I was still avoiding subclassing the builtin types. No
2732 more (I'm also starting to use properties, though I won't shift to
2741 more (I'm also starting to use properties, though I won't shift to
2733 2.3-specific features quite yet).
2742 2.3-specific features quite yet).
2734 (magic_store): added Ville's patch for lightweight variable
2743 (magic_store): added Ville's patch for lightweight variable
2735 persistence, after a request on the user list by Matt Wilkie
2744 persistence, after a request on the user list by Matt Wilkie
2736 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2745 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2737 details.
2746 details.
2738
2747
2739 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2748 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2740 changed the default logfile name from 'ipython.log' to
2749 changed the default logfile name from 'ipython.log' to
2741 'ipython_log.py'. These logs are real python files, and now that
2750 'ipython_log.py'. These logs are real python files, and now that
2742 we have much better multiline support, people are more likely to
2751 we have much better multiline support, people are more likely to
2743 want to use them as such. Might as well name them correctly.
2752 want to use them as such. Might as well name them correctly.
2744
2753
2745 * IPython/Magic.py: substantial cleanup. While we can't stop
2754 * IPython/Magic.py: substantial cleanup. While we can't stop
2746 using magics as mixins, due to the existing customizations 'out
2755 using magics as mixins, due to the existing customizations 'out
2747 there' which rely on the mixin naming conventions, at least I
2756 there' which rely on the mixin naming conventions, at least I
2748 cleaned out all cross-class name usage. So once we are OK with
2757 cleaned out all cross-class name usage. So once we are OK with
2749 breaking compatibility, the two systems can be separated.
2758 breaking compatibility, the two systems can be separated.
2750
2759
2751 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2760 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2752 anymore, and the class is a fair bit less hideous as well. New
2761 anymore, and the class is a fair bit less hideous as well. New
2753 features were also introduced: timestamping of input, and logging
2762 features were also introduced: timestamping of input, and logging
2754 of output results. These are user-visible with the -t and -o
2763 of output results. These are user-visible with the -t and -o
2755 options to %logstart. Closes
2764 options to %logstart. Closes
2756 http://www.scipy.net/roundup/ipython/issue11 and a request by
2765 http://www.scipy.net/roundup/ipython/issue11 and a request by
2757 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2766 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2758
2767
2759 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2768 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2760
2769
2761 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2770 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2762 better handle backslashes in paths. See the thread 'More Windows
2771 better handle backslashes in paths. See the thread 'More Windows
2763 questions part 2 - \/ characters revisited' on the iypthon user
2772 questions part 2 - \/ characters revisited' on the iypthon user
2764 list:
2773 list:
2765 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2774 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2766
2775
2767 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2776 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2768
2777
2769 (InteractiveShell.__init__): change threaded shells to not use the
2778 (InteractiveShell.__init__): change threaded shells to not use the
2770 ipython crash handler. This was causing more problems than not,
2779 ipython crash handler. This was causing more problems than not,
2771 as exceptions in the main thread (GUI code, typically) would
2780 as exceptions in the main thread (GUI code, typically) would
2772 always show up as a 'crash', when they really weren't.
2781 always show up as a 'crash', when they really weren't.
2773
2782
2774 The colors and exception mode commands (%colors/%xmode) have been
2783 The colors and exception mode commands (%colors/%xmode) have been
2775 synchronized to also take this into account, so users can get
2784 synchronized to also take this into account, so users can get
2776 verbose exceptions for their threaded code as well. I also added
2785 verbose exceptions for their threaded code as well. I also added
2777 support for activating pdb inside this exception handler as well,
2786 support for activating pdb inside this exception handler as well,
2778 so now GUI authors can use IPython's enhanced pdb at runtime.
2787 so now GUI authors can use IPython's enhanced pdb at runtime.
2779
2788
2780 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2789 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2781 true by default, and add it to the shipped ipythonrc file. Since
2790 true by default, and add it to the shipped ipythonrc file. Since
2782 this asks the user before proceeding, I think it's OK to make it
2791 this asks the user before proceeding, I think it's OK to make it
2783 true by default.
2792 true by default.
2784
2793
2785 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2794 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2786 of the previous special-casing of input in the eval loop. I think
2795 of the previous special-casing of input in the eval loop. I think
2787 this is cleaner, as they really are commands and shouldn't have
2796 this is cleaner, as they really are commands and shouldn't have
2788 a special role in the middle of the core code.
2797 a special role in the middle of the core code.
2789
2798
2790 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2799 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2791
2800
2792 * IPython/iplib.py (edit_syntax_error): added support for
2801 * IPython/iplib.py (edit_syntax_error): added support for
2793 automatically reopening the editor if the file had a syntax error
2802 automatically reopening the editor if the file had a syntax error
2794 in it. Thanks to scottt who provided the patch at:
2803 in it. Thanks to scottt who provided the patch at:
2795 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2804 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2796 version committed).
2805 version committed).
2797
2806
2798 * IPython/iplib.py (handle_normal): add suport for multi-line
2807 * IPython/iplib.py (handle_normal): add suport for multi-line
2799 input with emtpy lines. This fixes
2808 input with emtpy lines. This fixes
2800 http://www.scipy.net/roundup/ipython/issue43 and a similar
2809 http://www.scipy.net/roundup/ipython/issue43 and a similar
2801 discussion on the user list.
2810 discussion on the user list.
2802
2811
2803 WARNING: a behavior change is necessarily introduced to support
2812 WARNING: a behavior change is necessarily introduced to support
2804 blank lines: now a single blank line with whitespace does NOT
2813 blank lines: now a single blank line with whitespace does NOT
2805 break the input loop, which means that when autoindent is on, by
2814 break the input loop, which means that when autoindent is on, by
2806 default hitting return on the next (indented) line does NOT exit.
2815 default hitting return on the next (indented) line does NOT exit.
2807
2816
2808 Instead, to exit a multiline input you can either have:
2817 Instead, to exit a multiline input you can either have:
2809
2818
2810 - TWO whitespace lines (just hit return again), or
2819 - TWO whitespace lines (just hit return again), or
2811 - a single whitespace line of a different length than provided
2820 - a single whitespace line of a different length than provided
2812 by the autoindent (add or remove a space).
2821 by the autoindent (add or remove a space).
2813
2822
2814 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2823 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2815 module to better organize all readline-related functionality.
2824 module to better organize all readline-related functionality.
2816 I've deleted FlexCompleter and put all completion clases here.
2825 I've deleted FlexCompleter and put all completion clases here.
2817
2826
2818 * IPython/iplib.py (raw_input): improve indentation management.
2827 * IPython/iplib.py (raw_input): improve indentation management.
2819 It is now possible to paste indented code with autoindent on, and
2828 It is now possible to paste indented code with autoindent on, and
2820 the code is interpreted correctly (though it still looks bad on
2829 the code is interpreted correctly (though it still looks bad on
2821 screen, due to the line-oriented nature of ipython).
2830 screen, due to the line-oriented nature of ipython).
2822 (MagicCompleter.complete): change behavior so that a TAB key on an
2831 (MagicCompleter.complete): change behavior so that a TAB key on an
2823 otherwise empty line actually inserts a tab, instead of completing
2832 otherwise empty line actually inserts a tab, instead of completing
2824 on the entire global namespace. This makes it easier to use the
2833 on the entire global namespace. This makes it easier to use the
2825 TAB key for indentation. After a request by Hans Meine
2834 TAB key for indentation. After a request by Hans Meine
2826 <hans_meine-AT-gmx.net>
2835 <hans_meine-AT-gmx.net>
2827 (_prefilter): add support so that typing plain 'exit' or 'quit'
2836 (_prefilter): add support so that typing plain 'exit' or 'quit'
2828 does a sensible thing. Originally I tried to deviate as little as
2837 does a sensible thing. Originally I tried to deviate as little as
2829 possible from the default python behavior, but even that one may
2838 possible from the default python behavior, but even that one may
2830 change in this direction (thread on python-dev to that effect).
2839 change in this direction (thread on python-dev to that effect).
2831 Regardless, ipython should do the right thing even if CPython's
2840 Regardless, ipython should do the right thing even if CPython's
2832 '>>>' prompt doesn't.
2841 '>>>' prompt doesn't.
2833 (InteractiveShell): removed subclassing code.InteractiveConsole
2842 (InteractiveShell): removed subclassing code.InteractiveConsole
2834 class. By now we'd overridden just about all of its methods: I've
2843 class. By now we'd overridden just about all of its methods: I've
2835 copied the remaining two over, and now ipython is a standalone
2844 copied the remaining two over, and now ipython is a standalone
2836 class. This will provide a clearer picture for the chainsaw
2845 class. This will provide a clearer picture for the chainsaw
2837 branch refactoring.
2846 branch refactoring.
2838
2847
2839 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2848 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2840
2849
2841 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2850 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2842 failures for objects which break when dir() is called on them.
2851 failures for objects which break when dir() is called on them.
2843
2852
2844 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2853 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2845 distinct local and global namespaces in the completer API. This
2854 distinct local and global namespaces in the completer API. This
2846 change allows us to properly handle completion with distinct
2855 change allows us to properly handle completion with distinct
2847 scopes, including in embedded instances (this had never really
2856 scopes, including in embedded instances (this had never really
2848 worked correctly).
2857 worked correctly).
2849
2858
2850 Note: this introduces a change in the constructor for
2859 Note: this introduces a change in the constructor for
2851 MagicCompleter, as a new global_namespace parameter is now the
2860 MagicCompleter, as a new global_namespace parameter is now the
2852 second argument (the others were bumped one position).
2861 second argument (the others were bumped one position).
2853
2862
2854 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2863 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2855
2864
2856 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2865 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2857 embedded instances (which can be done now thanks to Vivian's
2866 embedded instances (which can be done now thanks to Vivian's
2858 frame-handling fixes for pdb).
2867 frame-handling fixes for pdb).
2859 (InteractiveShell.__init__): Fix namespace handling problem in
2868 (InteractiveShell.__init__): Fix namespace handling problem in
2860 embedded instances. We were overwriting __main__ unconditionally,
2869 embedded instances. We were overwriting __main__ unconditionally,
2861 and this should only be done for 'full' (non-embedded) IPython;
2870 and this should only be done for 'full' (non-embedded) IPython;
2862 embedded instances must respect the caller's __main__. Thanks to
2871 embedded instances must respect the caller's __main__. Thanks to
2863 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2872 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2864
2873
2865 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2874 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2866
2875
2867 * setup.py: added download_url to setup(). This registers the
2876 * setup.py: added download_url to setup(). This registers the
2868 download address at PyPI, which is not only useful to humans
2877 download address at PyPI, which is not only useful to humans
2869 browsing the site, but is also picked up by setuptools (the Eggs
2878 browsing the site, but is also picked up by setuptools (the Eggs
2870 machinery). Thanks to Ville and R. Kern for the info/discussion
2879 machinery). Thanks to Ville and R. Kern for the info/discussion
2871 on this.
2880 on this.
2872
2881
2873 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2882 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2874
2883
2875 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2884 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2876 This brings a lot of nice functionality to the pdb mode, which now
2885 This brings a lot of nice functionality to the pdb mode, which now
2877 has tab-completion, syntax highlighting, and better stack handling
2886 has tab-completion, syntax highlighting, and better stack handling
2878 than before. Many thanks to Vivian De Smedt
2887 than before. Many thanks to Vivian De Smedt
2879 <vivian-AT-vdesmedt.com> for the original patches.
2888 <vivian-AT-vdesmedt.com> for the original patches.
2880
2889
2881 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2890 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2882
2891
2883 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2892 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2884 sequence to consistently accept the banner argument. The
2893 sequence to consistently accept the banner argument. The
2885 inconsistency was tripping SAGE, thanks to Gary Zablackis
2894 inconsistency was tripping SAGE, thanks to Gary Zablackis
2886 <gzabl-AT-yahoo.com> for the report.
2895 <gzabl-AT-yahoo.com> for the report.
2887
2896
2888 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2897 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2889
2898
2890 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2899 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2891 Fix bug where a naked 'alias' call in the ipythonrc file would
2900 Fix bug where a naked 'alias' call in the ipythonrc file would
2892 cause a crash. Bug reported by Jorgen Stenarson.
2901 cause a crash. Bug reported by Jorgen Stenarson.
2893
2902
2894 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2903 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2895
2904
2896 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2905 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2897 startup time.
2906 startup time.
2898
2907
2899 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2908 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2900 instances had introduced a bug with globals in normal code. Now
2909 instances had introduced a bug with globals in normal code. Now
2901 it's working in all cases.
2910 it's working in all cases.
2902
2911
2903 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2912 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2904 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2913 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2905 has been introduced to set the default case sensitivity of the
2914 has been introduced to set the default case sensitivity of the
2906 searches. Users can still select either mode at runtime on a
2915 searches. Users can still select either mode at runtime on a
2907 per-search basis.
2916 per-search basis.
2908
2917
2909 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2918 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2910
2919
2911 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2920 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2912 attributes in wildcard searches for subclasses. Modified version
2921 attributes in wildcard searches for subclasses. Modified version
2913 of a patch by Jorgen.
2922 of a patch by Jorgen.
2914
2923
2915 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2924 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2916
2925
2917 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2926 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2918 embedded instances. I added a user_global_ns attribute to the
2927 embedded instances. I added a user_global_ns attribute to the
2919 InteractiveShell class to handle this.
2928 InteractiveShell class to handle this.
2920
2929
2921 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2930 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2922
2931
2923 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2932 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2924 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2933 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2925 (reported under win32, but may happen also in other platforms).
2934 (reported under win32, but may happen also in other platforms).
2926 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2935 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2927
2936
2928 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2937 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2929
2938
2930 * IPython/Magic.py (magic_psearch): new support for wildcard
2939 * IPython/Magic.py (magic_psearch): new support for wildcard
2931 patterns. Now, typing ?a*b will list all names which begin with a
2940 patterns. Now, typing ?a*b will list all names which begin with a
2932 and end in b, for example. The %psearch magic has full
2941 and end in b, for example. The %psearch magic has full
2933 docstrings. Many thanks to JΓΆrgen Stenarson
2942 docstrings. Many thanks to JΓΆrgen Stenarson
2934 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2943 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2935 implementing this functionality.
2944 implementing this functionality.
2936
2945
2937 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2946 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2938
2947
2939 * Manual: fixed long-standing annoyance of double-dashes (as in
2948 * Manual: fixed long-standing annoyance of double-dashes (as in
2940 --prefix=~, for example) being stripped in the HTML version. This
2949 --prefix=~, for example) being stripped in the HTML version. This
2941 is a latex2html bug, but a workaround was provided. Many thanks
2950 is a latex2html bug, but a workaround was provided. Many thanks
2942 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2951 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2943 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2952 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2944 rolling. This seemingly small issue had tripped a number of users
2953 rolling. This seemingly small issue had tripped a number of users
2945 when first installing, so I'm glad to see it gone.
2954 when first installing, so I'm glad to see it gone.
2946
2955
2947 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2956 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2948
2957
2949 * IPython/Extensions/numeric_formats.py: fix missing import,
2958 * IPython/Extensions/numeric_formats.py: fix missing import,
2950 reported by Stephen Walton.
2959 reported by Stephen Walton.
2951
2960
2952 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2961 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2953
2962
2954 * IPython/demo.py: finish demo module, fully documented now.
2963 * IPython/demo.py: finish demo module, fully documented now.
2955
2964
2956 * IPython/genutils.py (file_read): simple little utility to read a
2965 * IPython/genutils.py (file_read): simple little utility to read a
2957 file and ensure it's closed afterwards.
2966 file and ensure it's closed afterwards.
2958
2967
2959 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2968 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2960
2969
2961 * IPython/demo.py (Demo.__init__): added support for individually
2970 * IPython/demo.py (Demo.__init__): added support for individually
2962 tagging blocks for automatic execution.
2971 tagging blocks for automatic execution.
2963
2972
2964 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2973 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2965 syntax-highlighted python sources, requested by John.
2974 syntax-highlighted python sources, requested by John.
2966
2975
2967 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2976 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2968
2977
2969 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2978 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2970 finishing.
2979 finishing.
2971
2980
2972 * IPython/genutils.py (shlex_split): moved from Magic to here,
2981 * IPython/genutils.py (shlex_split): moved from Magic to here,
2973 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2982 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2974
2983
2975 * IPython/demo.py (Demo.__init__): added support for silent
2984 * IPython/demo.py (Demo.__init__): added support for silent
2976 blocks, improved marks as regexps, docstrings written.
2985 blocks, improved marks as regexps, docstrings written.
2977 (Demo.__init__): better docstring, added support for sys.argv.
2986 (Demo.__init__): better docstring, added support for sys.argv.
2978
2987
2979 * IPython/genutils.py (marquee): little utility used by the demo
2988 * IPython/genutils.py (marquee): little utility used by the demo
2980 code, handy in general.
2989 code, handy in general.
2981
2990
2982 * IPython/demo.py (Demo.__init__): new class for interactive
2991 * IPython/demo.py (Demo.__init__): new class for interactive
2983 demos. Not documented yet, I just wrote it in a hurry for
2992 demos. Not documented yet, I just wrote it in a hurry for
2984 scipy'05. Will docstring later.
2993 scipy'05. Will docstring later.
2985
2994
2986 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2995 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2987
2996
2988 * IPython/Shell.py (sigint_handler): Drastic simplification which
2997 * IPython/Shell.py (sigint_handler): Drastic simplification which
2989 also seems to make Ctrl-C work correctly across threads! This is
2998 also seems to make Ctrl-C work correctly across threads! This is
2990 so simple, that I can't beleive I'd missed it before. Needs more
2999 so simple, that I can't beleive I'd missed it before. Needs more
2991 testing, though.
3000 testing, though.
2992 (KBINT): Never mind, revert changes. I'm sure I'd tried something
3001 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2993 like this before...
3002 like this before...
2994
3003
2995 * IPython/genutils.py (get_home_dir): add protection against
3004 * IPython/genutils.py (get_home_dir): add protection against
2996 non-dirs in win32 registry.
3005 non-dirs in win32 registry.
2997
3006
2998 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
3007 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2999 bug where dict was mutated while iterating (pysh crash).
3008 bug where dict was mutated while iterating (pysh crash).
3000
3009
3001 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
3010 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
3002
3011
3003 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
3012 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
3004 spurious newlines added by this routine. After a report by
3013 spurious newlines added by this routine. After a report by
3005 F. Mantegazza.
3014 F. Mantegazza.
3006
3015
3007 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
3016 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
3008
3017
3009 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
3018 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
3010 calls. These were a leftover from the GTK 1.x days, and can cause
3019 calls. These were a leftover from the GTK 1.x days, and can cause
3011 problems in certain cases (after a report by John Hunter).
3020 problems in certain cases (after a report by John Hunter).
3012
3021
3013 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
3022 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
3014 os.getcwd() fails at init time. Thanks to patch from David Remahl
3023 os.getcwd() fails at init time. Thanks to patch from David Remahl
3015 <chmod007-AT-mac.com>.
3024 <chmod007-AT-mac.com>.
3016 (InteractiveShell.__init__): prevent certain special magics from
3025 (InteractiveShell.__init__): prevent certain special magics from
3017 being shadowed by aliases. Closes
3026 being shadowed by aliases. Closes
3018 http://www.scipy.net/roundup/ipython/issue41.
3027 http://www.scipy.net/roundup/ipython/issue41.
3019
3028
3020 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
3029 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
3021
3030
3022 * IPython/iplib.py (InteractiveShell.complete): Added new
3031 * IPython/iplib.py (InteractiveShell.complete): Added new
3023 top-level completion method to expose the completion mechanism
3032 top-level completion method to expose the completion mechanism
3024 beyond readline-based environments.
3033 beyond readline-based environments.
3025
3034
3026 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
3035 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
3027
3036
3028 * tools/ipsvnc (svnversion): fix svnversion capture.
3037 * tools/ipsvnc (svnversion): fix svnversion capture.
3029
3038
3030 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
3039 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
3031 attribute to self, which was missing. Before, it was set by a
3040 attribute to self, which was missing. Before, it was set by a
3032 routine which in certain cases wasn't being called, so the
3041 routine which in certain cases wasn't being called, so the
3033 instance could end up missing the attribute. This caused a crash.
3042 instance could end up missing the attribute. This caused a crash.
3034 Closes http://www.scipy.net/roundup/ipython/issue40.
3043 Closes http://www.scipy.net/roundup/ipython/issue40.
3035
3044
3036 2005-08-16 Fernando Perez <fperez@colorado.edu>
3045 2005-08-16 Fernando Perez <fperez@colorado.edu>
3037
3046
3038 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
3047 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
3039 contains non-string attribute. Closes
3048 contains non-string attribute. Closes
3040 http://www.scipy.net/roundup/ipython/issue38.
3049 http://www.scipy.net/roundup/ipython/issue38.
3041
3050
3042 2005-08-14 Fernando Perez <fperez@colorado.edu>
3051 2005-08-14 Fernando Perez <fperez@colorado.edu>
3043
3052
3044 * tools/ipsvnc: Minor improvements, to add changeset info.
3053 * tools/ipsvnc: Minor improvements, to add changeset info.
3045
3054
3046 2005-08-12 Fernando Perez <fperez@colorado.edu>
3055 2005-08-12 Fernando Perez <fperez@colorado.edu>
3047
3056
3048 * IPython/iplib.py (runsource): remove self.code_to_run_src
3057 * IPython/iplib.py (runsource): remove self.code_to_run_src
3049 attribute. I realized this is nothing more than
3058 attribute. I realized this is nothing more than
3050 '\n'.join(self.buffer), and having the same data in two different
3059 '\n'.join(self.buffer), and having the same data in two different
3051 places is just asking for synchronization bugs. This may impact
3060 places is just asking for synchronization bugs. This may impact
3052 people who have custom exception handlers, so I need to warn
3061 people who have custom exception handlers, so I need to warn
3053 ipython-dev about it (F. Mantegazza may use them).
3062 ipython-dev about it (F. Mantegazza may use them).
3054
3063
3055 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
3064 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
3056
3065
3057 * IPython/genutils.py: fix 2.2 compatibility (generators)
3066 * IPython/genutils.py: fix 2.2 compatibility (generators)
3058
3067
3059 2005-07-18 Fernando Perez <fperez@colorado.edu>
3068 2005-07-18 Fernando Perez <fperez@colorado.edu>
3060
3069
3061 * IPython/genutils.py (get_home_dir): fix to help users with
3070 * IPython/genutils.py (get_home_dir): fix to help users with
3062 invalid $HOME under win32.
3071 invalid $HOME under win32.
3063
3072
3064 2005-07-17 Fernando Perez <fperez@colorado.edu>
3073 2005-07-17 Fernando Perez <fperez@colorado.edu>
3065
3074
3066 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3075 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3067 some old hacks and clean up a bit other routines; code should be
3076 some old hacks and clean up a bit other routines; code should be
3068 simpler and a bit faster.
3077 simpler and a bit faster.
3069
3078
3070 * IPython/iplib.py (interact): removed some last-resort attempts
3079 * IPython/iplib.py (interact): removed some last-resort attempts
3071 to survive broken stdout/stderr. That code was only making it
3080 to survive broken stdout/stderr. That code was only making it
3072 harder to abstract out the i/o (necessary for gui integration),
3081 harder to abstract out the i/o (necessary for gui integration),
3073 and the crashes it could prevent were extremely rare in practice
3082 and the crashes it could prevent were extremely rare in practice
3074 (besides being fully user-induced in a pretty violent manner).
3083 (besides being fully user-induced in a pretty violent manner).
3075
3084
3076 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3085 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3077 Nothing major yet, but the code is simpler to read; this should
3086 Nothing major yet, but the code is simpler to read; this should
3078 make it easier to do more serious modifications in the future.
3087 make it easier to do more serious modifications in the future.
3079
3088
3080 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3089 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3081 which broke in .15 (thanks to a report by Ville).
3090 which broke in .15 (thanks to a report by Ville).
3082
3091
3083 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3092 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3084 be quite correct, I know next to nothing about unicode). This
3093 be quite correct, I know next to nothing about unicode). This
3085 will allow unicode strings to be used in prompts, amongst other
3094 will allow unicode strings to be used in prompts, amongst other
3086 cases. It also will prevent ipython from crashing when unicode
3095 cases. It also will prevent ipython from crashing when unicode
3087 shows up unexpectedly in many places. If ascii encoding fails, we
3096 shows up unexpectedly in many places. If ascii encoding fails, we
3088 assume utf_8. Currently the encoding is not a user-visible
3097 assume utf_8. Currently the encoding is not a user-visible
3089 setting, though it could be made so if there is demand for it.
3098 setting, though it could be made so if there is demand for it.
3090
3099
3091 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3100 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3092
3101
3093 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3102 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3094
3103
3095 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3104 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3096
3105
3097 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3106 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3098 code can work transparently for 2.2/2.3.
3107 code can work transparently for 2.2/2.3.
3099
3108
3100 2005-07-16 Fernando Perez <fperez@colorado.edu>
3109 2005-07-16 Fernando Perez <fperez@colorado.edu>
3101
3110
3102 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3111 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3103 out of the color scheme table used for coloring exception
3112 out of the color scheme table used for coloring exception
3104 tracebacks. This allows user code to add new schemes at runtime.
3113 tracebacks. This allows user code to add new schemes at runtime.
3105 This is a minimally modified version of the patch at
3114 This is a minimally modified version of the patch at
3106 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3115 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3107 for the contribution.
3116 for the contribution.
3108
3117
3109 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3118 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3110 slightly modified version of the patch in
3119 slightly modified version of the patch in
3111 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3120 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3112 to remove the previous try/except solution (which was costlier).
3121 to remove the previous try/except solution (which was costlier).
3113 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3122 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3114
3123
3115 2005-06-08 Fernando Perez <fperez@colorado.edu>
3124 2005-06-08 Fernando Perez <fperez@colorado.edu>
3116
3125
3117 * IPython/iplib.py (write/write_err): Add methods to abstract all
3126 * IPython/iplib.py (write/write_err): Add methods to abstract all
3118 I/O a bit more.
3127 I/O a bit more.
3119
3128
3120 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3129 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3121 warning, reported by Aric Hagberg, fix by JD Hunter.
3130 warning, reported by Aric Hagberg, fix by JD Hunter.
3122
3131
3123 2005-06-02 *** Released version 0.6.15
3132 2005-06-02 *** Released version 0.6.15
3124
3133
3125 2005-06-01 Fernando Perez <fperez@colorado.edu>
3134 2005-06-01 Fernando Perez <fperez@colorado.edu>
3126
3135
3127 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3136 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3128 tab-completion of filenames within open-quoted strings. Note that
3137 tab-completion of filenames within open-quoted strings. Note that
3129 this requires that in ~/.ipython/ipythonrc, users change the
3138 this requires that in ~/.ipython/ipythonrc, users change the
3130 readline delimiters configuration to read:
3139 readline delimiters configuration to read:
3131
3140
3132 readline_remove_delims -/~
3141 readline_remove_delims -/~
3133
3142
3134
3143
3135 2005-05-31 *** Released version 0.6.14
3144 2005-05-31 *** Released version 0.6.14
3136
3145
3137 2005-05-29 Fernando Perez <fperez@colorado.edu>
3146 2005-05-29 Fernando Perez <fperez@colorado.edu>
3138
3147
3139 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3148 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3140 with files not on the filesystem. Reported by Eliyahu Sandler
3149 with files not on the filesystem. Reported by Eliyahu Sandler
3141 <eli@gondolin.net>
3150 <eli@gondolin.net>
3142
3151
3143 2005-05-22 Fernando Perez <fperez@colorado.edu>
3152 2005-05-22 Fernando Perez <fperez@colorado.edu>
3144
3153
3145 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3154 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3146 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3155 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3147
3156
3148 2005-05-19 Fernando Perez <fperez@colorado.edu>
3157 2005-05-19 Fernando Perez <fperez@colorado.edu>
3149
3158
3150 * IPython/iplib.py (safe_execfile): close a file which could be
3159 * IPython/iplib.py (safe_execfile): close a file which could be
3151 left open (causing problems in win32, which locks open files).
3160 left open (causing problems in win32, which locks open files).
3152 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3161 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3153
3162
3154 2005-05-18 Fernando Perez <fperez@colorado.edu>
3163 2005-05-18 Fernando Perez <fperez@colorado.edu>
3155
3164
3156 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3165 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3157 keyword arguments correctly to safe_execfile().
3166 keyword arguments correctly to safe_execfile().
3158
3167
3159 2005-05-13 Fernando Perez <fperez@colorado.edu>
3168 2005-05-13 Fernando Perez <fperez@colorado.edu>
3160
3169
3161 * ipython.1: Added info about Qt to manpage, and threads warning
3170 * ipython.1: Added info about Qt to manpage, and threads warning
3162 to usage page (invoked with --help).
3171 to usage page (invoked with --help).
3163
3172
3164 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3173 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3165 new matcher (it goes at the end of the priority list) to do
3174 new matcher (it goes at the end of the priority list) to do
3166 tab-completion on named function arguments. Submitted by George
3175 tab-completion on named function arguments. Submitted by George
3167 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3176 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3168 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3177 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3169 for more details.
3178 for more details.
3170
3179
3171 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3180 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3172 SystemExit exceptions in the script being run. Thanks to a report
3181 SystemExit exceptions in the script being run. Thanks to a report
3173 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3182 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3174 producing very annoying behavior when running unit tests.
3183 producing very annoying behavior when running unit tests.
3175
3184
3176 2005-05-12 Fernando Perez <fperez@colorado.edu>
3185 2005-05-12 Fernando Perez <fperez@colorado.edu>
3177
3186
3178 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3187 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3179 which I'd broken (again) due to a changed regexp. In the process,
3188 which I'd broken (again) due to a changed regexp. In the process,
3180 added ';' as an escape to auto-quote the whole line without
3189 added ';' as an escape to auto-quote the whole line without
3181 splitting its arguments. Thanks to a report by Jerry McRae
3190 splitting its arguments. Thanks to a report by Jerry McRae
3182 <qrs0xyc02-AT-sneakemail.com>.
3191 <qrs0xyc02-AT-sneakemail.com>.
3183
3192
3184 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3193 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3185 possible crashes caused by a TokenError. Reported by Ed Schofield
3194 possible crashes caused by a TokenError. Reported by Ed Schofield
3186 <schofield-AT-ftw.at>.
3195 <schofield-AT-ftw.at>.
3187
3196
3188 2005-05-06 Fernando Perez <fperez@colorado.edu>
3197 2005-05-06 Fernando Perez <fperez@colorado.edu>
3189
3198
3190 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3199 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3191
3200
3192 2005-04-29 Fernando Perez <fperez@colorado.edu>
3201 2005-04-29 Fernando Perez <fperez@colorado.edu>
3193
3202
3194 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3203 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3195 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3204 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3196 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3205 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3197 which provides support for Qt interactive usage (similar to the
3206 which provides support for Qt interactive usage (similar to the
3198 existing one for WX and GTK). This had been often requested.
3207 existing one for WX and GTK). This had been often requested.
3199
3208
3200 2005-04-14 *** Released version 0.6.13
3209 2005-04-14 *** Released version 0.6.13
3201
3210
3202 2005-04-08 Fernando Perez <fperez@colorado.edu>
3211 2005-04-08 Fernando Perez <fperez@colorado.edu>
3203
3212
3204 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3213 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3205 from _ofind, which gets called on almost every input line. Now,
3214 from _ofind, which gets called on almost every input line. Now,
3206 we only try to get docstrings if they are actually going to be
3215 we only try to get docstrings if they are actually going to be
3207 used (the overhead of fetching unnecessary docstrings can be
3216 used (the overhead of fetching unnecessary docstrings can be
3208 noticeable for certain objects, such as Pyro proxies).
3217 noticeable for certain objects, such as Pyro proxies).
3209
3218
3210 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3219 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3211 for completers. For some reason I had been passing them the state
3220 for completers. For some reason I had been passing them the state
3212 variable, which completers never actually need, and was in
3221 variable, which completers never actually need, and was in
3213 conflict with the rlcompleter API. Custom completers ONLY need to
3222 conflict with the rlcompleter API. Custom completers ONLY need to
3214 take the text parameter.
3223 take the text parameter.
3215
3224
3216 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3225 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3217 work correctly in pysh. I've also moved all the logic which used
3226 work correctly in pysh. I've also moved all the logic which used
3218 to be in pysh.py here, which will prevent problems with future
3227 to be in pysh.py here, which will prevent problems with future
3219 upgrades. However, this time I must warn users to update their
3228 upgrades. However, this time I must warn users to update their
3220 pysh profile to include the line
3229 pysh profile to include the line
3221
3230
3222 import_all IPython.Extensions.InterpreterExec
3231 import_all IPython.Extensions.InterpreterExec
3223
3232
3224 because otherwise things won't work for them. They MUST also
3233 because otherwise things won't work for them. They MUST also
3225 delete pysh.py and the line
3234 delete pysh.py and the line
3226
3235
3227 execfile pysh.py
3236 execfile pysh.py
3228
3237
3229 from their ipythonrc-pysh.
3238 from their ipythonrc-pysh.
3230
3239
3231 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3240 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3232 robust in the face of objects whose dir() returns non-strings
3241 robust in the face of objects whose dir() returns non-strings
3233 (which it shouldn't, but some broken libs like ITK do). Thanks to
3242 (which it shouldn't, but some broken libs like ITK do). Thanks to
3234 a patch by John Hunter (implemented differently, though). Also
3243 a patch by John Hunter (implemented differently, though). Also
3235 minor improvements by using .extend instead of + on lists.
3244 minor improvements by using .extend instead of + on lists.
3236
3245
3237 * pysh.py:
3246 * pysh.py:
3238
3247
3239 2005-04-06 Fernando Perez <fperez@colorado.edu>
3248 2005-04-06 Fernando Perez <fperez@colorado.edu>
3240
3249
3241 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3250 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3242 by default, so that all users benefit from it. Those who don't
3251 by default, so that all users benefit from it. Those who don't
3243 want it can still turn it off.
3252 want it can still turn it off.
3244
3253
3245 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3254 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3246 config file, I'd forgotten about this, so users were getting it
3255 config file, I'd forgotten about this, so users were getting it
3247 off by default.
3256 off by default.
3248
3257
3249 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3258 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3250 consistency. Now magics can be called in multiline statements,
3259 consistency. Now magics can be called in multiline statements,
3251 and python variables can be expanded in magic calls via $var.
3260 and python variables can be expanded in magic calls via $var.
3252 This makes the magic system behave just like aliases or !system
3261 This makes the magic system behave just like aliases or !system
3253 calls.
3262 calls.
3254
3263
3255 2005-03-28 Fernando Perez <fperez@colorado.edu>
3264 2005-03-28 Fernando Perez <fperez@colorado.edu>
3256
3265
3257 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3266 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3258 expensive string additions for building command. Add support for
3267 expensive string additions for building command. Add support for
3259 trailing ';' when autocall is used.
3268 trailing ';' when autocall is used.
3260
3269
3261 2005-03-26 Fernando Perez <fperez@colorado.edu>
3270 2005-03-26 Fernando Perez <fperez@colorado.edu>
3262
3271
3263 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3272 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3264 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3273 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3265 ipython.el robust against prompts with any number of spaces
3274 ipython.el robust against prompts with any number of spaces
3266 (including 0) after the ':' character.
3275 (including 0) after the ':' character.
3267
3276
3268 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3277 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3269 continuation prompt, which misled users to think the line was
3278 continuation prompt, which misled users to think the line was
3270 already indented. Closes debian Bug#300847, reported to me by
3279 already indented. Closes debian Bug#300847, reported to me by
3271 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3280 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3272
3281
3273 2005-03-23 Fernando Perez <fperez@colorado.edu>
3282 2005-03-23 Fernando Perez <fperez@colorado.edu>
3274
3283
3275 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3284 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3276 properly aligned if they have embedded newlines.
3285 properly aligned if they have embedded newlines.
3277
3286
3278 * IPython/iplib.py (runlines): Add a public method to expose
3287 * IPython/iplib.py (runlines): Add a public method to expose
3279 IPython's code execution machinery, so that users can run strings
3288 IPython's code execution machinery, so that users can run strings
3280 as if they had been typed at the prompt interactively.
3289 as if they had been typed at the prompt interactively.
3281 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3290 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3282 methods which can call the system shell, but with python variable
3291 methods which can call the system shell, but with python variable
3283 expansion. The three such methods are: __IPYTHON__.system,
3292 expansion. The three such methods are: __IPYTHON__.system,
3284 .getoutput and .getoutputerror. These need to be documented in a
3293 .getoutput and .getoutputerror. These need to be documented in a
3285 'public API' section (to be written) of the manual.
3294 'public API' section (to be written) of the manual.
3286
3295
3287 2005-03-20 Fernando Perez <fperez@colorado.edu>
3296 2005-03-20 Fernando Perez <fperez@colorado.edu>
3288
3297
3289 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3298 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3290 for custom exception handling. This is quite powerful, and it
3299 for custom exception handling. This is quite powerful, and it
3291 allows for user-installable exception handlers which can trap
3300 allows for user-installable exception handlers which can trap
3292 custom exceptions at runtime and treat them separately from
3301 custom exceptions at runtime and treat them separately from
3293 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3302 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
3294 Mantegazza <mantegazza-AT-ill.fr>.
3303 Mantegazza <mantegazza-AT-ill.fr>.
3295 (InteractiveShell.set_custom_completer): public API function to
3304 (InteractiveShell.set_custom_completer): public API function to
3296 add new completers at runtime.
3305 add new completers at runtime.
3297
3306
3298 2005-03-19 Fernando Perez <fperez@colorado.edu>
3307 2005-03-19 Fernando Perez <fperez@colorado.edu>
3299
3308
3300 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3309 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3301 allow objects which provide their docstrings via non-standard
3310 allow objects which provide their docstrings via non-standard
3302 mechanisms (like Pyro proxies) to still be inspected by ipython's
3311 mechanisms (like Pyro proxies) to still be inspected by ipython's
3303 ? system.
3312 ? system.
3304
3313
3305 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3314 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3306 automatic capture system. I tried quite hard to make it work
3315 automatic capture system. I tried quite hard to make it work
3307 reliably, and simply failed. I tried many combinations with the
3316 reliably, and simply failed. I tried many combinations with the
3308 subprocess module, but eventually nothing worked in all needed
3317 subprocess module, but eventually nothing worked in all needed
3309 cases (not blocking stdin for the child, duplicating stdout
3318 cases (not blocking stdin for the child, duplicating stdout
3310 without blocking, etc). The new %sc/%sx still do capture to these
3319 without blocking, etc). The new %sc/%sx still do capture to these
3311 magical list/string objects which make shell use much more
3320 magical list/string objects which make shell use much more
3312 conveninent, so not all is lost.
3321 conveninent, so not all is lost.
3313
3322
3314 XXX - FIX MANUAL for the change above!
3323 XXX - FIX MANUAL for the change above!
3315
3324
3316 (runsource): I copied code.py's runsource() into ipython to modify
3325 (runsource): I copied code.py's runsource() into ipython to modify
3317 it a bit. Now the code object and source to be executed are
3326 it a bit. Now the code object and source to be executed are
3318 stored in ipython. This makes this info accessible to third-party
3327 stored in ipython. This makes this info accessible to third-party
3319 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3328 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3320 Mantegazza <mantegazza-AT-ill.fr>.
3329 Mantegazza <mantegazza-AT-ill.fr>.
3321
3330
3322 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3331 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3323 history-search via readline (like C-p/C-n). I'd wanted this for a
3332 history-search via readline (like C-p/C-n). I'd wanted this for a
3324 long time, but only recently found out how to do it. For users
3333 long time, but only recently found out how to do it. For users
3325 who already have their ipythonrc files made and want this, just
3334 who already have their ipythonrc files made and want this, just
3326 add:
3335 add:
3327
3336
3328 readline_parse_and_bind "\e[A": history-search-backward
3337 readline_parse_and_bind "\e[A": history-search-backward
3329 readline_parse_and_bind "\e[B": history-search-forward
3338 readline_parse_and_bind "\e[B": history-search-forward
3330
3339
3331 2005-03-18 Fernando Perez <fperez@colorado.edu>
3340 2005-03-18 Fernando Perez <fperez@colorado.edu>
3332
3341
3333 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3342 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3334 LSString and SList classes which allow transparent conversions
3343 LSString and SList classes which allow transparent conversions
3335 between list mode and whitespace-separated string.
3344 between list mode and whitespace-separated string.
3336 (magic_r): Fix recursion problem in %r.
3345 (magic_r): Fix recursion problem in %r.
3337
3346
3338 * IPython/genutils.py (LSString): New class to be used for
3347 * IPython/genutils.py (LSString): New class to be used for
3339 automatic storage of the results of all alias/system calls in _o
3348 automatic storage of the results of all alias/system calls in _o
3340 and _e (stdout/err). These provide a .l/.list attribute which
3349 and _e (stdout/err). These provide a .l/.list attribute which
3341 does automatic splitting on newlines. This means that for most
3350 does automatic splitting on newlines. This means that for most
3342 uses, you'll never need to do capturing of output with %sc/%sx
3351 uses, you'll never need to do capturing of output with %sc/%sx
3343 anymore, since ipython keeps this always done for you. Note that
3352 anymore, since ipython keeps this always done for you. Note that
3344 only the LAST results are stored, the _o/e variables are
3353 only the LAST results are stored, the _o/e variables are
3345 overwritten on each call. If you need to save their contents
3354 overwritten on each call. If you need to save their contents
3346 further, simply bind them to any other name.
3355 further, simply bind them to any other name.
3347
3356
3348 2005-03-17 Fernando Perez <fperez@colorado.edu>
3357 2005-03-17 Fernando Perez <fperez@colorado.edu>
3349
3358
3350 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3359 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3351 prompt namespace handling.
3360 prompt namespace handling.
3352
3361
3353 2005-03-16 Fernando Perez <fperez@colorado.edu>
3362 2005-03-16 Fernando Perez <fperez@colorado.edu>
3354
3363
3355 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3364 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3356 classic prompts to be '>>> ' (final space was missing, and it
3365 classic prompts to be '>>> ' (final space was missing, and it
3357 trips the emacs python mode).
3366 trips the emacs python mode).
3358 (BasePrompt.__str__): Added safe support for dynamic prompt
3367 (BasePrompt.__str__): Added safe support for dynamic prompt
3359 strings. Now you can set your prompt string to be '$x', and the
3368 strings. Now you can set your prompt string to be '$x', and the
3360 value of x will be printed from your interactive namespace. The
3369 value of x will be printed from your interactive namespace. The
3361 interpolation syntax includes the full Itpl support, so
3370 interpolation syntax includes the full Itpl support, so
3362 ${foo()+x+bar()} is a valid prompt string now, and the function
3371 ${foo()+x+bar()} is a valid prompt string now, and the function
3363 calls will be made at runtime.
3372 calls will be made at runtime.
3364
3373
3365 2005-03-15 Fernando Perez <fperez@colorado.edu>
3374 2005-03-15 Fernando Perez <fperez@colorado.edu>
3366
3375
3367 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3376 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3368 avoid name clashes in pylab. %hist still works, it just forwards
3377 avoid name clashes in pylab. %hist still works, it just forwards
3369 the call to %history.
3378 the call to %history.
3370
3379
3371 2005-03-02 *** Released version 0.6.12
3380 2005-03-02 *** Released version 0.6.12
3372
3381
3373 2005-03-02 Fernando Perez <fperez@colorado.edu>
3382 2005-03-02 Fernando Perez <fperez@colorado.edu>
3374
3383
3375 * IPython/iplib.py (handle_magic): log magic calls properly as
3384 * IPython/iplib.py (handle_magic): log magic calls properly as
3376 ipmagic() function calls.
3385 ipmagic() function calls.
3377
3386
3378 * IPython/Magic.py (magic_time): Improved %time to support
3387 * IPython/Magic.py (magic_time): Improved %time to support
3379 statements and provide wall-clock as well as CPU time.
3388 statements and provide wall-clock as well as CPU time.
3380
3389
3381 2005-02-27 Fernando Perez <fperez@colorado.edu>
3390 2005-02-27 Fernando Perez <fperez@colorado.edu>
3382
3391
3383 * IPython/hooks.py: New hooks module, to expose user-modifiable
3392 * IPython/hooks.py: New hooks module, to expose user-modifiable
3384 IPython functionality in a clean manner. For now only the editor
3393 IPython functionality in a clean manner. For now only the editor
3385 hook is actually written, and other thigns which I intend to turn
3394 hook is actually written, and other thigns which I intend to turn
3386 into proper hooks aren't yet there. The display and prefilter
3395 into proper hooks aren't yet there. The display and prefilter
3387 stuff, for example, should be hooks. But at least now the
3396 stuff, for example, should be hooks. But at least now the
3388 framework is in place, and the rest can be moved here with more
3397 framework is in place, and the rest can be moved here with more
3389 time later. IPython had had a .hooks variable for a long time for
3398 time later. IPython had had a .hooks variable for a long time for
3390 this purpose, but I'd never actually used it for anything.
3399 this purpose, but I'd never actually used it for anything.
3391
3400
3392 2005-02-26 Fernando Perez <fperez@colorado.edu>
3401 2005-02-26 Fernando Perez <fperez@colorado.edu>
3393
3402
3394 * IPython/ipmaker.py (make_IPython): make the default ipython
3403 * IPython/ipmaker.py (make_IPython): make the default ipython
3395 directory be called _ipython under win32, to follow more the
3404 directory be called _ipython under win32, to follow more the
3396 naming peculiarities of that platform (where buggy software like
3405 naming peculiarities of that platform (where buggy software like
3397 Visual Sourcesafe breaks with .named directories). Reported by
3406 Visual Sourcesafe breaks with .named directories). Reported by
3398 Ville Vainio.
3407 Ville Vainio.
3399
3408
3400 2005-02-23 Fernando Perez <fperez@colorado.edu>
3409 2005-02-23 Fernando Perez <fperez@colorado.edu>
3401
3410
3402 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3411 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3403 auto_aliases for win32 which were causing problems. Users can
3412 auto_aliases for win32 which were causing problems. Users can
3404 define the ones they personally like.
3413 define the ones they personally like.
3405
3414
3406 2005-02-21 Fernando Perez <fperez@colorado.edu>
3415 2005-02-21 Fernando Perez <fperez@colorado.edu>
3407
3416
3408 * IPython/Magic.py (magic_time): new magic to time execution of
3417 * IPython/Magic.py (magic_time): new magic to time execution of
3409 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3418 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3410
3419
3411 2005-02-19 Fernando Perez <fperez@colorado.edu>
3420 2005-02-19 Fernando Perez <fperez@colorado.edu>
3412
3421
3413 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3422 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3414 into keys (for prompts, for example).
3423 into keys (for prompts, for example).
3415
3424
3416 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3425 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3417 prompts in case users want them. This introduces a small behavior
3426 prompts in case users want them. This introduces a small behavior
3418 change: ipython does not automatically add a space to all prompts
3427 change: ipython does not automatically add a space to all prompts
3419 anymore. To get the old prompts with a space, users should add it
3428 anymore. To get the old prompts with a space, users should add it
3420 manually to their ipythonrc file, so for example prompt_in1 should
3429 manually to their ipythonrc file, so for example prompt_in1 should
3421 now read 'In [\#]: ' instead of 'In [\#]:'.
3430 now read 'In [\#]: ' instead of 'In [\#]:'.
3422 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3431 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3423 file) to control left-padding of secondary prompts.
3432 file) to control left-padding of secondary prompts.
3424
3433
3425 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3434 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3426 the profiler can't be imported. Fix for Debian, which removed
3435 the profiler can't be imported. Fix for Debian, which removed
3427 profile.py because of License issues. I applied a slightly
3436 profile.py because of License issues. I applied a slightly
3428 modified version of the original Debian patch at
3437 modified version of the original Debian patch at
3429 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3438 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3430
3439
3431 2005-02-17 Fernando Perez <fperez@colorado.edu>
3440 2005-02-17 Fernando Perez <fperez@colorado.edu>
3432
3441
3433 * IPython/genutils.py (native_line_ends): Fix bug which would
3442 * IPython/genutils.py (native_line_ends): Fix bug which would
3434 cause improper line-ends under win32 b/c I was not opening files
3443 cause improper line-ends under win32 b/c I was not opening files
3435 in binary mode. Bug report and fix thanks to Ville.
3444 in binary mode. Bug report and fix thanks to Ville.
3436
3445
3437 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3446 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3438 trying to catch spurious foo[1] autocalls. My fix actually broke
3447 trying to catch spurious foo[1] autocalls. My fix actually broke
3439 ',/' autoquote/call with explicit escape (bad regexp).
3448 ',/' autoquote/call with explicit escape (bad regexp).
3440
3449
3441 2005-02-15 *** Released version 0.6.11
3450 2005-02-15 *** Released version 0.6.11
3442
3451
3443 2005-02-14 Fernando Perez <fperez@colorado.edu>
3452 2005-02-14 Fernando Perez <fperez@colorado.edu>
3444
3453
3445 * IPython/background_jobs.py: New background job management
3454 * IPython/background_jobs.py: New background job management
3446 subsystem. This is implemented via a new set of classes, and
3455 subsystem. This is implemented via a new set of classes, and
3447 IPython now provides a builtin 'jobs' object for background job
3456 IPython now provides a builtin 'jobs' object for background job
3448 execution. A convenience %bg magic serves as a lightweight
3457 execution. A convenience %bg magic serves as a lightweight
3449 frontend for starting the more common type of calls. This was
3458 frontend for starting the more common type of calls. This was
3450 inspired by discussions with B. Granger and the BackgroundCommand
3459 inspired by discussions with B. Granger and the BackgroundCommand
3451 class described in the book Python Scripting for Computational
3460 class described in the book Python Scripting for Computational
3452 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3461 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3453 (although ultimately no code from this text was used, as IPython's
3462 (although ultimately no code from this text was used, as IPython's
3454 system is a separate implementation).
3463 system is a separate implementation).
3455
3464
3456 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3465 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3457 to control the completion of single/double underscore names
3466 to control the completion of single/double underscore names
3458 separately. As documented in the example ipytonrc file, the
3467 separately. As documented in the example ipytonrc file, the
3459 readline_omit__names variable can now be set to 2, to omit even
3468 readline_omit__names variable can now be set to 2, to omit even
3460 single underscore names. Thanks to a patch by Brian Wong
3469 single underscore names. Thanks to a patch by Brian Wong
3461 <BrianWong-AT-AirgoNetworks.Com>.
3470 <BrianWong-AT-AirgoNetworks.Com>.
3462 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3471 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3463 be autocalled as foo([1]) if foo were callable. A problem for
3472 be autocalled as foo([1]) if foo were callable. A problem for
3464 things which are both callable and implement __getitem__.
3473 things which are both callable and implement __getitem__.
3465 (init_readline): Fix autoindentation for win32. Thanks to a patch
3474 (init_readline): Fix autoindentation for win32. Thanks to a patch
3466 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3475 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3467
3476
3468 2005-02-12 Fernando Perez <fperez@colorado.edu>
3477 2005-02-12 Fernando Perez <fperez@colorado.edu>
3469
3478
3470 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3479 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3471 which I had written long ago to sort out user error messages which
3480 which I had written long ago to sort out user error messages which
3472 may occur during startup. This seemed like a good idea initially,
3481 may occur during startup. This seemed like a good idea initially,
3473 but it has proven a disaster in retrospect. I don't want to
3482 but it has proven a disaster in retrospect. I don't want to
3474 change much code for now, so my fix is to set the internal 'debug'
3483 change much code for now, so my fix is to set the internal 'debug'
3475 flag to true everywhere, whose only job was precisely to control
3484 flag to true everywhere, whose only job was precisely to control
3476 this subsystem. This closes issue 28 (as well as avoiding all
3485 this subsystem. This closes issue 28 (as well as avoiding all
3477 sorts of strange hangups which occur from time to time).
3486 sorts of strange hangups which occur from time to time).
3478
3487
3479 2005-02-07 Fernando Perez <fperez@colorado.edu>
3488 2005-02-07 Fernando Perez <fperez@colorado.edu>
3480
3489
3481 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3490 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3482 previous call produced a syntax error.
3491 previous call produced a syntax error.
3483
3492
3484 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3493 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3485 classes without constructor.
3494 classes without constructor.
3486
3495
3487 2005-02-06 Fernando Perez <fperez@colorado.edu>
3496 2005-02-06 Fernando Perez <fperez@colorado.edu>
3488
3497
3489 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3498 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3490 completions with the results of each matcher, so we return results
3499 completions with the results of each matcher, so we return results
3491 to the user from all namespaces. This breaks with ipython
3500 to the user from all namespaces. This breaks with ipython
3492 tradition, but I think it's a nicer behavior. Now you get all
3501 tradition, but I think it's a nicer behavior. Now you get all
3493 possible completions listed, from all possible namespaces (python,
3502 possible completions listed, from all possible namespaces (python,
3494 filesystem, magics...) After a request by John Hunter
3503 filesystem, magics...) After a request by John Hunter
3495 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3504 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3496
3505
3497 2005-02-05 Fernando Perez <fperez@colorado.edu>
3506 2005-02-05 Fernando Perez <fperez@colorado.edu>
3498
3507
3499 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3508 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3500 the call had quote characters in it (the quotes were stripped).
3509 the call had quote characters in it (the quotes were stripped).
3501
3510
3502 2005-01-31 Fernando Perez <fperez@colorado.edu>
3511 2005-01-31 Fernando Perez <fperez@colorado.edu>
3503
3512
3504 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3513 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3505 Itpl.itpl() to make the code more robust against psyco
3514 Itpl.itpl() to make the code more robust against psyco
3506 optimizations.
3515 optimizations.
3507
3516
3508 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3517 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3509 of causing an exception. Quicker, cleaner.
3518 of causing an exception. Quicker, cleaner.
3510
3519
3511 2005-01-28 Fernando Perez <fperez@colorado.edu>
3520 2005-01-28 Fernando Perez <fperez@colorado.edu>
3512
3521
3513 * scripts/ipython_win_post_install.py (install): hardcode
3522 * scripts/ipython_win_post_install.py (install): hardcode
3514 sys.prefix+'python.exe' as the executable path. It turns out that
3523 sys.prefix+'python.exe' as the executable path. It turns out that
3515 during the post-installation run, sys.executable resolves to the
3524 during the post-installation run, sys.executable resolves to the
3516 name of the binary installer! I should report this as a distutils
3525 name of the binary installer! I should report this as a distutils
3517 bug, I think. I updated the .10 release with this tiny fix, to
3526 bug, I think. I updated the .10 release with this tiny fix, to
3518 avoid annoying the lists further.
3527 avoid annoying the lists further.
3519
3528
3520 2005-01-27 *** Released version 0.6.10
3529 2005-01-27 *** Released version 0.6.10
3521
3530
3522 2005-01-27 Fernando Perez <fperez@colorado.edu>
3531 2005-01-27 Fernando Perez <fperez@colorado.edu>
3523
3532
3524 * IPython/numutils.py (norm): Added 'inf' as optional name for
3533 * IPython/numutils.py (norm): Added 'inf' as optional name for
3525 L-infinity norm, included references to mathworld.com for vector
3534 L-infinity norm, included references to mathworld.com for vector
3526 norm definitions.
3535 norm definitions.
3527 (amin/amax): added amin/amax for array min/max. Similar to what
3536 (amin/amax): added amin/amax for array min/max. Similar to what
3528 pylab ships with after the recent reorganization of names.
3537 pylab ships with after the recent reorganization of names.
3529 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3538 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3530
3539
3531 * ipython.el: committed Alex's recent fixes and improvements.
3540 * ipython.el: committed Alex's recent fixes and improvements.
3532 Tested with python-mode from CVS, and it looks excellent. Since
3541 Tested with python-mode from CVS, and it looks excellent. Since
3533 python-mode hasn't released anything in a while, I'm temporarily
3542 python-mode hasn't released anything in a while, I'm temporarily
3534 putting a copy of today's CVS (v 4.70) of python-mode in:
3543 putting a copy of today's CVS (v 4.70) of python-mode in:
3535 http://ipython.scipy.org/tmp/python-mode.el
3544 http://ipython.scipy.org/tmp/python-mode.el
3536
3545
3537 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3546 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3538 sys.executable for the executable name, instead of assuming it's
3547 sys.executable for the executable name, instead of assuming it's
3539 called 'python.exe' (the post-installer would have produced broken
3548 called 'python.exe' (the post-installer would have produced broken
3540 setups on systems with a differently named python binary).
3549 setups on systems with a differently named python binary).
3541
3550
3542 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3551 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3543 references to os.linesep, to make the code more
3552 references to os.linesep, to make the code more
3544 platform-independent. This is also part of the win32 coloring
3553 platform-independent. This is also part of the win32 coloring
3545 fixes.
3554 fixes.
3546
3555
3547 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3556 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3548 lines, which actually cause coloring bugs because the length of
3557 lines, which actually cause coloring bugs because the length of
3549 the line is very difficult to correctly compute with embedded
3558 the line is very difficult to correctly compute with embedded
3550 escapes. This was the source of all the coloring problems under
3559 escapes. This was the source of all the coloring problems under
3551 Win32. I think that _finally_, Win32 users have a properly
3560 Win32. I think that _finally_, Win32 users have a properly
3552 working ipython in all respects. This would never have happened
3561 working ipython in all respects. This would never have happened
3553 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3562 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3554
3563
3555 2005-01-26 *** Released version 0.6.9
3564 2005-01-26 *** Released version 0.6.9
3556
3565
3557 2005-01-25 Fernando Perez <fperez@colorado.edu>
3566 2005-01-25 Fernando Perez <fperez@colorado.edu>
3558
3567
3559 * setup.py: finally, we have a true Windows installer, thanks to
3568 * setup.py: finally, we have a true Windows installer, thanks to
3560 the excellent work of Viktor Ransmayr
3569 the excellent work of Viktor Ransmayr
3561 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3570 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3562 Windows users. The setup routine is quite a bit cleaner thanks to
3571 Windows users. The setup routine is quite a bit cleaner thanks to
3563 this, and the post-install script uses the proper functions to
3572 this, and the post-install script uses the proper functions to
3564 allow a clean de-installation using the standard Windows Control
3573 allow a clean de-installation using the standard Windows Control
3565 Panel.
3574 Panel.
3566
3575
3567 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3576 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3568 environment variable under all OSes (including win32) if
3577 environment variable under all OSes (including win32) if
3569 available. This will give consistency to win32 users who have set
3578 available. This will give consistency to win32 users who have set
3570 this variable for any reason. If os.environ['HOME'] fails, the
3579 this variable for any reason. If os.environ['HOME'] fails, the
3571 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3580 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3572
3581
3573 2005-01-24 Fernando Perez <fperez@colorado.edu>
3582 2005-01-24 Fernando Perez <fperez@colorado.edu>
3574
3583
3575 * IPython/numutils.py (empty_like): add empty_like(), similar to
3584 * IPython/numutils.py (empty_like): add empty_like(), similar to
3576 zeros_like() but taking advantage of the new empty() Numeric routine.
3585 zeros_like() but taking advantage of the new empty() Numeric routine.
3577
3586
3578 2005-01-23 *** Released version 0.6.8
3587 2005-01-23 *** Released version 0.6.8
3579
3588
3580 2005-01-22 Fernando Perez <fperez@colorado.edu>
3589 2005-01-22 Fernando Perez <fperez@colorado.edu>
3581
3590
3582 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3591 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3583 automatic show() calls. After discussing things with JDH, it
3592 automatic show() calls. After discussing things with JDH, it
3584 turns out there are too many corner cases where this can go wrong.
3593 turns out there are too many corner cases where this can go wrong.
3585 It's best not to try to be 'too smart', and simply have ipython
3594 It's best not to try to be 'too smart', and simply have ipython
3586 reproduce as much as possible the default behavior of a normal
3595 reproduce as much as possible the default behavior of a normal
3587 python shell.
3596 python shell.
3588
3597
3589 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3598 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3590 line-splitting regexp and _prefilter() to avoid calling getattr()
3599 line-splitting regexp and _prefilter() to avoid calling getattr()
3591 on assignments. This closes
3600 on assignments. This closes
3592 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3601 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3593 readline uses getattr(), so a simple <TAB> keypress is still
3602 readline uses getattr(), so a simple <TAB> keypress is still
3594 enough to trigger getattr() calls on an object.
3603 enough to trigger getattr() calls on an object.
3595
3604
3596 2005-01-21 Fernando Perez <fperez@colorado.edu>
3605 2005-01-21 Fernando Perez <fperez@colorado.edu>
3597
3606
3598 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3607 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3599 docstring under pylab so it doesn't mask the original.
3608 docstring under pylab so it doesn't mask the original.
3600
3609
3601 2005-01-21 *** Released version 0.6.7
3610 2005-01-21 *** Released version 0.6.7
3602
3611
3603 2005-01-21 Fernando Perez <fperez@colorado.edu>
3612 2005-01-21 Fernando Perez <fperez@colorado.edu>
3604
3613
3605 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3614 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3606 signal handling for win32 users in multithreaded mode.
3615 signal handling for win32 users in multithreaded mode.
3607
3616
3608 2005-01-17 Fernando Perez <fperez@colorado.edu>
3617 2005-01-17 Fernando Perez <fperez@colorado.edu>
3609
3618
3610 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3619 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3611 instances with no __init__. After a crash report by Norbert Nemec
3620 instances with no __init__. After a crash report by Norbert Nemec
3612 <Norbert-AT-nemec-online.de>.
3621 <Norbert-AT-nemec-online.de>.
3613
3622
3614 2005-01-14 Fernando Perez <fperez@colorado.edu>
3623 2005-01-14 Fernando Perez <fperez@colorado.edu>
3615
3624
3616 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3625 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3617 names for verbose exceptions, when multiple dotted names and the
3626 names for verbose exceptions, when multiple dotted names and the
3618 'parent' object were present on the same line.
3627 'parent' object were present on the same line.
3619
3628
3620 2005-01-11 Fernando Perez <fperez@colorado.edu>
3629 2005-01-11 Fernando Perez <fperez@colorado.edu>
3621
3630
3622 * IPython/genutils.py (flag_calls): new utility to trap and flag
3631 * IPython/genutils.py (flag_calls): new utility to trap and flag
3623 calls in functions. I need it to clean up matplotlib support.
3632 calls in functions. I need it to clean up matplotlib support.
3624 Also removed some deprecated code in genutils.
3633 Also removed some deprecated code in genutils.
3625
3634
3626 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3635 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3627 that matplotlib scripts called with %run, which don't call show()
3636 that matplotlib scripts called with %run, which don't call show()
3628 themselves, still have their plotting windows open.
3637 themselves, still have their plotting windows open.
3629
3638
3630 2005-01-05 Fernando Perez <fperez@colorado.edu>
3639 2005-01-05 Fernando Perez <fperez@colorado.edu>
3631
3640
3632 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3641 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3633 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3642 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3634
3643
3635 2004-12-19 Fernando Perez <fperez@colorado.edu>
3644 2004-12-19 Fernando Perez <fperez@colorado.edu>
3636
3645
3637 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3646 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3638 parent_runcode, which was an eyesore. The same result can be
3647 parent_runcode, which was an eyesore. The same result can be
3639 obtained with Python's regular superclass mechanisms.
3648 obtained with Python's regular superclass mechanisms.
3640
3649
3641 2004-12-17 Fernando Perez <fperez@colorado.edu>
3650 2004-12-17 Fernando Perez <fperez@colorado.edu>
3642
3651
3643 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3652 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3644 reported by Prabhu.
3653 reported by Prabhu.
3645 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3654 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3646 sys.stderr) instead of explicitly calling sys.stderr. This helps
3655 sys.stderr) instead of explicitly calling sys.stderr. This helps
3647 maintain our I/O abstractions clean, for future GUI embeddings.
3656 maintain our I/O abstractions clean, for future GUI embeddings.
3648
3657
3649 * IPython/genutils.py (info): added new utility for sys.stderr
3658 * IPython/genutils.py (info): added new utility for sys.stderr
3650 unified info message handling (thin wrapper around warn()).
3659 unified info message handling (thin wrapper around warn()).
3651
3660
3652 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3661 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3653 composite (dotted) names on verbose exceptions.
3662 composite (dotted) names on verbose exceptions.
3654 (VerboseTB.nullrepr): harden against another kind of errors which
3663 (VerboseTB.nullrepr): harden against another kind of errors which
3655 Python's inspect module can trigger, and which were crashing
3664 Python's inspect module can trigger, and which were crashing
3656 IPython. Thanks to a report by Marco Lombardi
3665 IPython. Thanks to a report by Marco Lombardi
3657 <mlombard-AT-ma010192.hq.eso.org>.
3666 <mlombard-AT-ma010192.hq.eso.org>.
3658
3667
3659 2004-12-13 *** Released version 0.6.6
3668 2004-12-13 *** Released version 0.6.6
3660
3669
3661 2004-12-12 Fernando Perez <fperez@colorado.edu>
3670 2004-12-12 Fernando Perez <fperez@colorado.edu>
3662
3671
3663 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3672 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3664 generated by pygtk upon initialization if it was built without
3673 generated by pygtk upon initialization if it was built without
3665 threads (for matplotlib users). After a crash reported by
3674 threads (for matplotlib users). After a crash reported by
3666 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3675 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3667
3676
3668 * IPython/ipmaker.py (make_IPython): fix small bug in the
3677 * IPython/ipmaker.py (make_IPython): fix small bug in the
3669 import_some parameter for multiple imports.
3678 import_some parameter for multiple imports.
3670
3679
3671 * IPython/iplib.py (ipmagic): simplified the interface of
3680 * IPython/iplib.py (ipmagic): simplified the interface of
3672 ipmagic() to take a single string argument, just as it would be
3681 ipmagic() to take a single string argument, just as it would be
3673 typed at the IPython cmd line.
3682 typed at the IPython cmd line.
3674 (ipalias): Added new ipalias() with an interface identical to
3683 (ipalias): Added new ipalias() with an interface identical to
3675 ipmagic(). This completes exposing a pure python interface to the
3684 ipmagic(). This completes exposing a pure python interface to the
3676 alias and magic system, which can be used in loops or more complex
3685 alias and magic system, which can be used in loops or more complex
3677 code where IPython's automatic line mangling is not active.
3686 code where IPython's automatic line mangling is not active.
3678
3687
3679 * IPython/genutils.py (timing): changed interface of timing to
3688 * IPython/genutils.py (timing): changed interface of timing to
3680 simply run code once, which is the most common case. timings()
3689 simply run code once, which is the most common case. timings()
3681 remains unchanged, for the cases where you want multiple runs.
3690 remains unchanged, for the cases where you want multiple runs.
3682
3691
3683 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3692 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3684 bug where Python2.2 crashes with exec'ing code which does not end
3693 bug where Python2.2 crashes with exec'ing code which does not end
3685 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3694 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3686 before.
3695 before.
3687
3696
3688 2004-12-10 Fernando Perez <fperez@colorado.edu>
3697 2004-12-10 Fernando Perez <fperez@colorado.edu>
3689
3698
3690 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3699 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3691 -t to -T, to accomodate the new -t flag in %run (the %run and
3700 -t to -T, to accomodate the new -t flag in %run (the %run and
3692 %prun options are kind of intermixed, and it's not easy to change
3701 %prun options are kind of intermixed, and it's not easy to change
3693 this with the limitations of python's getopt).
3702 this with the limitations of python's getopt).
3694
3703
3695 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3704 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3696 the execution of scripts. It's not as fine-tuned as timeit.py,
3705 the execution of scripts. It's not as fine-tuned as timeit.py,
3697 but it works from inside ipython (and under 2.2, which lacks
3706 but it works from inside ipython (and under 2.2, which lacks
3698 timeit.py). Optionally a number of runs > 1 can be given for
3707 timeit.py). Optionally a number of runs > 1 can be given for
3699 timing very short-running code.
3708 timing very short-running code.
3700
3709
3701 * IPython/genutils.py (uniq_stable): new routine which returns a
3710 * IPython/genutils.py (uniq_stable): new routine which returns a
3702 list of unique elements in any iterable, but in stable order of
3711 list of unique elements in any iterable, but in stable order of
3703 appearance. I needed this for the ultraTB fixes, and it's a handy
3712 appearance. I needed this for the ultraTB fixes, and it's a handy
3704 utility.
3713 utility.
3705
3714
3706 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3715 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3707 dotted names in Verbose exceptions. This had been broken since
3716 dotted names in Verbose exceptions. This had been broken since
3708 the very start, now x.y will properly be printed in a Verbose
3717 the very start, now x.y will properly be printed in a Verbose
3709 traceback, instead of x being shown and y appearing always as an
3718 traceback, instead of x being shown and y appearing always as an
3710 'undefined global'. Getting this to work was a bit tricky,
3719 'undefined global'. Getting this to work was a bit tricky,
3711 because by default python tokenizers are stateless. Saved by
3720 because by default python tokenizers are stateless. Saved by
3712 python's ability to easily add a bit of state to an arbitrary
3721 python's ability to easily add a bit of state to an arbitrary
3713 function (without needing to build a full-blown callable object).
3722 function (without needing to build a full-blown callable object).
3714
3723
3715 Also big cleanup of this code, which had horrendous runtime
3724 Also big cleanup of this code, which had horrendous runtime
3716 lookups of zillions of attributes for colorization. Moved all
3725 lookups of zillions of attributes for colorization. Moved all
3717 this code into a few templates, which make it cleaner and quicker.
3726 this code into a few templates, which make it cleaner and quicker.
3718
3727
3719 Printout quality was also improved for Verbose exceptions: one
3728 Printout quality was also improved for Verbose exceptions: one
3720 variable per line, and memory addresses are printed (this can be
3729 variable per line, and memory addresses are printed (this can be
3721 quite handy in nasty debugging situations, which is what Verbose
3730 quite handy in nasty debugging situations, which is what Verbose
3722 is for).
3731 is for).
3723
3732
3724 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3733 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3725 the command line as scripts to be loaded by embedded instances.
3734 the command line as scripts to be loaded by embedded instances.
3726 Doing so has the potential for an infinite recursion if there are
3735 Doing so has the potential for an infinite recursion if there are
3727 exceptions thrown in the process. This fixes a strange crash
3736 exceptions thrown in the process. This fixes a strange crash
3728 reported by Philippe MULLER <muller-AT-irit.fr>.
3737 reported by Philippe MULLER <muller-AT-irit.fr>.
3729
3738
3730 2004-12-09 Fernando Perez <fperez@colorado.edu>
3739 2004-12-09 Fernando Perez <fperez@colorado.edu>
3731
3740
3732 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3741 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3733 to reflect new names in matplotlib, which now expose the
3742 to reflect new names in matplotlib, which now expose the
3734 matlab-compatible interface via a pylab module instead of the
3743 matlab-compatible interface via a pylab module instead of the
3735 'matlab' name. The new code is backwards compatible, so users of
3744 'matlab' name. The new code is backwards compatible, so users of
3736 all matplotlib versions are OK. Patch by J. Hunter.
3745 all matplotlib versions are OK. Patch by J. Hunter.
3737
3746
3738 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3747 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3739 of __init__ docstrings for instances (class docstrings are already
3748 of __init__ docstrings for instances (class docstrings are already
3740 automatically printed). Instances with customized docstrings
3749 automatically printed). Instances with customized docstrings
3741 (indep. of the class) are also recognized and all 3 separate
3750 (indep. of the class) are also recognized and all 3 separate
3742 docstrings are printed (instance, class, constructor). After some
3751 docstrings are printed (instance, class, constructor). After some
3743 comments/suggestions by J. Hunter.
3752 comments/suggestions by J. Hunter.
3744
3753
3745 2004-12-05 Fernando Perez <fperez@colorado.edu>
3754 2004-12-05 Fernando Perez <fperez@colorado.edu>
3746
3755
3747 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3756 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3748 warnings when tab-completion fails and triggers an exception.
3757 warnings when tab-completion fails and triggers an exception.
3749
3758
3750 2004-12-03 Fernando Perez <fperez@colorado.edu>
3759 2004-12-03 Fernando Perez <fperez@colorado.edu>
3751
3760
3752 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3761 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3753 be triggered when using 'run -p'. An incorrect option flag was
3762 be triggered when using 'run -p'. An incorrect option flag was
3754 being set ('d' instead of 'D').
3763 being set ('d' instead of 'D').
3755 (manpage): fix missing escaped \- sign.
3764 (manpage): fix missing escaped \- sign.
3756
3765
3757 2004-11-30 *** Released version 0.6.5
3766 2004-11-30 *** Released version 0.6.5
3758
3767
3759 2004-11-30 Fernando Perez <fperez@colorado.edu>
3768 2004-11-30 Fernando Perez <fperez@colorado.edu>
3760
3769
3761 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3770 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3762 setting with -d option.
3771 setting with -d option.
3763
3772
3764 * setup.py (docfiles): Fix problem where the doc glob I was using
3773 * setup.py (docfiles): Fix problem where the doc glob I was using
3765 was COMPLETELY BROKEN. It was giving the right files by pure
3774 was COMPLETELY BROKEN. It was giving the right files by pure
3766 accident, but failed once I tried to include ipython.el. Note:
3775 accident, but failed once I tried to include ipython.el. Note:
3767 glob() does NOT allow you to do exclusion on multiple endings!
3776 glob() does NOT allow you to do exclusion on multiple endings!
3768
3777
3769 2004-11-29 Fernando Perez <fperez@colorado.edu>
3778 2004-11-29 Fernando Perez <fperez@colorado.edu>
3770
3779
3771 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3780 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3772 the manpage as the source. Better formatting & consistency.
3781 the manpage as the source. Better formatting & consistency.
3773
3782
3774 * IPython/Magic.py (magic_run): Added new -d option, to run
3783 * IPython/Magic.py (magic_run): Added new -d option, to run
3775 scripts under the control of the python pdb debugger. Note that
3784 scripts under the control of the python pdb debugger. Note that
3776 this required changing the %prun option -d to -D, to avoid a clash
3785 this required changing the %prun option -d to -D, to avoid a clash
3777 (since %run must pass options to %prun, and getopt is too dumb to
3786 (since %run must pass options to %prun, and getopt is too dumb to
3778 handle options with string values with embedded spaces). Thanks
3787 handle options with string values with embedded spaces). Thanks
3779 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3788 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3780 (magic_who_ls): added type matching to %who and %whos, so that one
3789 (magic_who_ls): added type matching to %who and %whos, so that one
3781 can filter their output to only include variables of certain
3790 can filter their output to only include variables of certain
3782 types. Another suggestion by Matthew.
3791 types. Another suggestion by Matthew.
3783 (magic_whos): Added memory summaries in kb and Mb for arrays.
3792 (magic_whos): Added memory summaries in kb and Mb for arrays.
3784 (magic_who): Improve formatting (break lines every 9 vars).
3793 (magic_who): Improve formatting (break lines every 9 vars).
3785
3794
3786 2004-11-28 Fernando Perez <fperez@colorado.edu>
3795 2004-11-28 Fernando Perez <fperez@colorado.edu>
3787
3796
3788 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3797 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3789 cache when empty lines were present.
3798 cache when empty lines were present.
3790
3799
3791 2004-11-24 Fernando Perez <fperez@colorado.edu>
3800 2004-11-24 Fernando Perez <fperez@colorado.edu>
3792
3801
3793 * IPython/usage.py (__doc__): document the re-activated threading
3802 * IPython/usage.py (__doc__): document the re-activated threading
3794 options for WX and GTK.
3803 options for WX and GTK.
3795
3804
3796 2004-11-23 Fernando Perez <fperez@colorado.edu>
3805 2004-11-23 Fernando Perez <fperez@colorado.edu>
3797
3806
3798 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3807 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3799 the -wthread and -gthread options, along with a new -tk one to try
3808 the -wthread and -gthread options, along with a new -tk one to try
3800 and coordinate Tk threading with wx/gtk. The tk support is very
3809 and coordinate Tk threading with wx/gtk. The tk support is very
3801 platform dependent, since it seems to require Tcl and Tk to be
3810 platform dependent, since it seems to require Tcl and Tk to be
3802 built with threads (Fedora1/2 appears NOT to have it, but in
3811 built with threads (Fedora1/2 appears NOT to have it, but in
3803 Prabhu's Debian boxes it works OK). But even with some Tk
3812 Prabhu's Debian boxes it works OK). But even with some Tk
3804 limitations, this is a great improvement.
3813 limitations, this is a great improvement.
3805
3814
3806 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3815 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3807 info in user prompts. Patch by Prabhu.
3816 info in user prompts. Patch by Prabhu.
3808
3817
3809 2004-11-18 Fernando Perez <fperez@colorado.edu>
3818 2004-11-18 Fernando Perez <fperez@colorado.edu>
3810
3819
3811 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3820 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3812 EOFErrors and bail, to avoid infinite loops if a non-terminating
3821 EOFErrors and bail, to avoid infinite loops if a non-terminating
3813 file is fed into ipython. Patch submitted in issue 19 by user,
3822 file is fed into ipython. Patch submitted in issue 19 by user,
3814 many thanks.
3823 many thanks.
3815
3824
3816 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3825 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3817 autoquote/parens in continuation prompts, which can cause lots of
3826 autoquote/parens in continuation prompts, which can cause lots of
3818 problems. Closes roundup issue 20.
3827 problems. Closes roundup issue 20.
3819
3828
3820 2004-11-17 Fernando Perez <fperez@colorado.edu>
3829 2004-11-17 Fernando Perez <fperez@colorado.edu>
3821
3830
3822 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3831 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3823 reported as debian bug #280505. I'm not sure my local changelog
3832 reported as debian bug #280505. I'm not sure my local changelog
3824 entry has the proper debian format (Jack?).
3833 entry has the proper debian format (Jack?).
3825
3834
3826 2004-11-08 *** Released version 0.6.4
3835 2004-11-08 *** Released version 0.6.4
3827
3836
3828 2004-11-08 Fernando Perez <fperez@colorado.edu>
3837 2004-11-08 Fernando Perez <fperez@colorado.edu>
3829
3838
3830 * IPython/iplib.py (init_readline): Fix exit message for Windows
3839 * IPython/iplib.py (init_readline): Fix exit message for Windows
3831 when readline is active. Thanks to a report by Eric Jones
3840 when readline is active. Thanks to a report by Eric Jones
3832 <eric-AT-enthought.com>.
3841 <eric-AT-enthought.com>.
3833
3842
3834 2004-11-07 Fernando Perez <fperez@colorado.edu>
3843 2004-11-07 Fernando Perez <fperez@colorado.edu>
3835
3844
3836 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3845 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3837 sometimes seen by win2k/cygwin users.
3846 sometimes seen by win2k/cygwin users.
3838
3847
3839 2004-11-06 Fernando Perez <fperez@colorado.edu>
3848 2004-11-06 Fernando Perez <fperez@colorado.edu>
3840
3849
3841 * IPython/iplib.py (interact): Change the handling of %Exit from
3850 * IPython/iplib.py (interact): Change the handling of %Exit from
3842 trying to propagate a SystemExit to an internal ipython flag.
3851 trying to propagate a SystemExit to an internal ipython flag.
3843 This is less elegant than using Python's exception mechanism, but
3852 This is less elegant than using Python's exception mechanism, but
3844 I can't get that to work reliably with threads, so under -pylab
3853 I can't get that to work reliably with threads, so under -pylab
3845 %Exit was hanging IPython. Cross-thread exception handling is
3854 %Exit was hanging IPython. Cross-thread exception handling is
3846 really a bitch. Thaks to a bug report by Stephen Walton
3855 really a bitch. Thaks to a bug report by Stephen Walton
3847 <stephen.walton-AT-csun.edu>.
3856 <stephen.walton-AT-csun.edu>.
3848
3857
3849 2004-11-04 Fernando Perez <fperez@colorado.edu>
3858 2004-11-04 Fernando Perez <fperez@colorado.edu>
3850
3859
3851 * IPython/iplib.py (raw_input_original): store a pointer to the
3860 * IPython/iplib.py (raw_input_original): store a pointer to the
3852 true raw_input to harden against code which can modify it
3861 true raw_input to harden against code which can modify it
3853 (wx.py.PyShell does this and would otherwise crash ipython).
3862 (wx.py.PyShell does this and would otherwise crash ipython).
3854 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3863 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3855
3864
3856 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3865 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3857 Ctrl-C problem, which does not mess up the input line.
3866 Ctrl-C problem, which does not mess up the input line.
3858
3867
3859 2004-11-03 Fernando Perez <fperez@colorado.edu>
3868 2004-11-03 Fernando Perez <fperez@colorado.edu>
3860
3869
3861 * IPython/Release.py: Changed licensing to BSD, in all files.
3870 * IPython/Release.py: Changed licensing to BSD, in all files.
3862 (name): lowercase name for tarball/RPM release.
3871 (name): lowercase name for tarball/RPM release.
3863
3872
3864 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3873 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3865 use throughout ipython.
3874 use throughout ipython.
3866
3875
3867 * IPython/Magic.py (Magic._ofind): Switch to using the new
3876 * IPython/Magic.py (Magic._ofind): Switch to using the new
3868 OInspect.getdoc() function.
3877 OInspect.getdoc() function.
3869
3878
3870 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3879 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3871 of the line currently being canceled via Ctrl-C. It's extremely
3880 of the line currently being canceled via Ctrl-C. It's extremely
3872 ugly, but I don't know how to do it better (the problem is one of
3881 ugly, but I don't know how to do it better (the problem is one of
3873 handling cross-thread exceptions).
3882 handling cross-thread exceptions).
3874
3883
3875 2004-10-28 Fernando Perez <fperez@colorado.edu>
3884 2004-10-28 Fernando Perez <fperez@colorado.edu>
3876
3885
3877 * IPython/Shell.py (signal_handler): add signal handlers to trap
3886 * IPython/Shell.py (signal_handler): add signal handlers to trap
3878 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3887 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3879 report by Francesc Alted.
3888 report by Francesc Alted.
3880
3889
3881 2004-10-21 Fernando Perez <fperez@colorado.edu>
3890 2004-10-21 Fernando Perez <fperez@colorado.edu>
3882
3891
3883 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3892 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3884 to % for pysh syntax extensions.
3893 to % for pysh syntax extensions.
3885
3894
3886 2004-10-09 Fernando Perez <fperez@colorado.edu>
3895 2004-10-09 Fernando Perez <fperez@colorado.edu>
3887
3896
3888 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3897 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3889 arrays to print a more useful summary, without calling str(arr).
3898 arrays to print a more useful summary, without calling str(arr).
3890 This avoids the problem of extremely lengthy computations which
3899 This avoids the problem of extremely lengthy computations which
3891 occur if arr is large, and appear to the user as a system lockup
3900 occur if arr is large, and appear to the user as a system lockup
3892 with 100% cpu activity. After a suggestion by Kristian Sandberg
3901 with 100% cpu activity. After a suggestion by Kristian Sandberg
3893 <Kristian.Sandberg@colorado.edu>.
3902 <Kristian.Sandberg@colorado.edu>.
3894 (Magic.__init__): fix bug in global magic escapes not being
3903 (Magic.__init__): fix bug in global magic escapes not being
3895 correctly set.
3904 correctly set.
3896
3905
3897 2004-10-08 Fernando Perez <fperez@colorado.edu>
3906 2004-10-08 Fernando Perez <fperez@colorado.edu>
3898
3907
3899 * IPython/Magic.py (__license__): change to absolute imports of
3908 * IPython/Magic.py (__license__): change to absolute imports of
3900 ipython's own internal packages, to start adapting to the absolute
3909 ipython's own internal packages, to start adapting to the absolute
3901 import requirement of PEP-328.
3910 import requirement of PEP-328.
3902
3911
3903 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3912 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3904 files, and standardize author/license marks through the Release
3913 files, and standardize author/license marks through the Release
3905 module instead of having per/file stuff (except for files with
3914 module instead of having per/file stuff (except for files with
3906 particular licenses, like the MIT/PSF-licensed codes).
3915 particular licenses, like the MIT/PSF-licensed codes).
3907
3916
3908 * IPython/Debugger.py: remove dead code for python 2.1
3917 * IPython/Debugger.py: remove dead code for python 2.1
3909
3918
3910 2004-10-04 Fernando Perez <fperez@colorado.edu>
3919 2004-10-04 Fernando Perez <fperez@colorado.edu>
3911
3920
3912 * IPython/iplib.py (ipmagic): New function for accessing magics
3921 * IPython/iplib.py (ipmagic): New function for accessing magics
3913 via a normal python function call.
3922 via a normal python function call.
3914
3923
3915 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3924 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3916 from '@' to '%', to accomodate the new @decorator syntax of python
3925 from '@' to '%', to accomodate the new @decorator syntax of python
3917 2.4.
3926 2.4.
3918
3927
3919 2004-09-29 Fernando Perez <fperez@colorado.edu>
3928 2004-09-29 Fernando Perez <fperez@colorado.edu>
3920
3929
3921 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3930 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3922 matplotlib.use to prevent running scripts which try to switch
3931 matplotlib.use to prevent running scripts which try to switch
3923 interactive backends from within ipython. This will just crash
3932 interactive backends from within ipython. This will just crash
3924 the python interpreter, so we can't allow it (but a detailed error
3933 the python interpreter, so we can't allow it (but a detailed error
3925 is given to the user).
3934 is given to the user).
3926
3935
3927 2004-09-28 Fernando Perez <fperez@colorado.edu>
3936 2004-09-28 Fernando Perez <fperez@colorado.edu>
3928
3937
3929 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3938 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3930 matplotlib-related fixes so that using @run with non-matplotlib
3939 matplotlib-related fixes so that using @run with non-matplotlib
3931 scripts doesn't pop up spurious plot windows. This requires
3940 scripts doesn't pop up spurious plot windows. This requires
3932 matplotlib >= 0.63, where I had to make some changes as well.
3941 matplotlib >= 0.63, where I had to make some changes as well.
3933
3942
3934 * IPython/ipmaker.py (make_IPython): update version requirement to
3943 * IPython/ipmaker.py (make_IPython): update version requirement to
3935 python 2.2.
3944 python 2.2.
3936
3945
3937 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3946 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3938 banner arg for embedded customization.
3947 banner arg for embedded customization.
3939
3948
3940 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3949 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3941 explicit uses of __IP as the IPython's instance name. Now things
3950 explicit uses of __IP as the IPython's instance name. Now things
3942 are properly handled via the shell.name value. The actual code
3951 are properly handled via the shell.name value. The actual code
3943 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3952 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3944 is much better than before. I'll clean things completely when the
3953 is much better than before. I'll clean things completely when the
3945 magic stuff gets a real overhaul.
3954 magic stuff gets a real overhaul.
3946
3955
3947 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3956 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3948 minor changes to debian dir.
3957 minor changes to debian dir.
3949
3958
3950 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3959 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3951 pointer to the shell itself in the interactive namespace even when
3960 pointer to the shell itself in the interactive namespace even when
3952 a user-supplied dict is provided. This is needed for embedding
3961 a user-supplied dict is provided. This is needed for embedding
3953 purposes (found by tests with Michel Sanner).
3962 purposes (found by tests with Michel Sanner).
3954
3963
3955 2004-09-27 Fernando Perez <fperez@colorado.edu>
3964 2004-09-27 Fernando Perez <fperez@colorado.edu>
3956
3965
3957 * IPython/UserConfig/ipythonrc: remove []{} from
3966 * IPython/UserConfig/ipythonrc: remove []{} from
3958 readline_remove_delims, so that things like [modname.<TAB> do
3967 readline_remove_delims, so that things like [modname.<TAB> do
3959 proper completion. This disables [].TAB, but that's a less common
3968 proper completion. This disables [].TAB, but that's a less common
3960 case than module names in list comprehensions, for example.
3969 case than module names in list comprehensions, for example.
3961 Thanks to a report by Andrea Riciputi.
3970 Thanks to a report by Andrea Riciputi.
3962
3971
3963 2004-09-09 Fernando Perez <fperez@colorado.edu>
3972 2004-09-09 Fernando Perez <fperez@colorado.edu>
3964
3973
3965 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3974 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3966 blocking problems in win32 and osx. Fix by John.
3975 blocking problems in win32 and osx. Fix by John.
3967
3976
3968 2004-09-08 Fernando Perez <fperez@colorado.edu>
3977 2004-09-08 Fernando Perez <fperez@colorado.edu>
3969
3978
3970 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3979 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3971 for Win32 and OSX. Fix by John Hunter.
3980 for Win32 and OSX. Fix by John Hunter.
3972
3981
3973 2004-08-30 *** Released version 0.6.3
3982 2004-08-30 *** Released version 0.6.3
3974
3983
3975 2004-08-30 Fernando Perez <fperez@colorado.edu>
3984 2004-08-30 Fernando Perez <fperez@colorado.edu>
3976
3985
3977 * setup.py (isfile): Add manpages to list of dependent files to be
3986 * setup.py (isfile): Add manpages to list of dependent files to be
3978 updated.
3987 updated.
3979
3988
3980 2004-08-27 Fernando Perez <fperez@colorado.edu>
3989 2004-08-27 Fernando Perez <fperez@colorado.edu>
3981
3990
3982 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3991 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3983 for now. They don't really work with standalone WX/GTK code
3992 for now. They don't really work with standalone WX/GTK code
3984 (though matplotlib IS working fine with both of those backends).
3993 (though matplotlib IS working fine with both of those backends).
3985 This will neeed much more testing. I disabled most things with
3994 This will neeed much more testing. I disabled most things with
3986 comments, so turning it back on later should be pretty easy.
3995 comments, so turning it back on later should be pretty easy.
3987
3996
3988 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3997 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3989 autocalling of expressions like r'foo', by modifying the line
3998 autocalling of expressions like r'foo', by modifying the line
3990 split regexp. Closes
3999 split regexp. Closes
3991 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
4000 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3992 Riley <ipythonbugs-AT-sabi.net>.
4001 Riley <ipythonbugs-AT-sabi.net>.
3993 (InteractiveShell.mainloop): honor --nobanner with banner
4002 (InteractiveShell.mainloop): honor --nobanner with banner
3994 extensions.
4003 extensions.
3995
4004
3996 * IPython/Shell.py: Significant refactoring of all classes, so
4005 * IPython/Shell.py: Significant refactoring of all classes, so
3997 that we can really support ALL matplotlib backends and threading
4006 that we can really support ALL matplotlib backends and threading
3998 models (John spotted a bug with Tk which required this). Now we
4007 models (John spotted a bug with Tk which required this). Now we
3999 should support single-threaded, WX-threads and GTK-threads, both
4008 should support single-threaded, WX-threads and GTK-threads, both
4000 for generic code and for matplotlib.
4009 for generic code and for matplotlib.
4001
4010
4002 * IPython/ipmaker.py (__call__): Changed -mpthread option to
4011 * IPython/ipmaker.py (__call__): Changed -mpthread option to
4003 -pylab, to simplify things for users. Will also remove the pylab
4012 -pylab, to simplify things for users. Will also remove the pylab
4004 profile, since now all of matplotlib configuration is directly
4013 profile, since now all of matplotlib configuration is directly
4005 handled here. This also reduces startup time.
4014 handled here. This also reduces startup time.
4006
4015
4007 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
4016 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
4008 shell wasn't being correctly called. Also in IPShellWX.
4017 shell wasn't being correctly called. Also in IPShellWX.
4009
4018
4010 * IPython/iplib.py (InteractiveShell.__init__): Added option to
4019 * IPython/iplib.py (InteractiveShell.__init__): Added option to
4011 fine-tune banner.
4020 fine-tune banner.
4012
4021
4013 * IPython/numutils.py (spike): Deprecate these spike functions,
4022 * IPython/numutils.py (spike): Deprecate these spike functions,
4014 delete (long deprecated) gnuplot_exec handler.
4023 delete (long deprecated) gnuplot_exec handler.
4015
4024
4016 2004-08-26 Fernando Perez <fperez@colorado.edu>
4025 2004-08-26 Fernando Perez <fperez@colorado.edu>
4017
4026
4018 * ipython.1: Update for threading options, plus some others which
4027 * ipython.1: Update for threading options, plus some others which
4019 were missing.
4028 were missing.
4020
4029
4021 * IPython/ipmaker.py (__call__): Added -wthread option for
4030 * IPython/ipmaker.py (__call__): Added -wthread option for
4022 wxpython thread handling. Make sure threading options are only
4031 wxpython thread handling. Make sure threading options are only
4023 valid at the command line.
4032 valid at the command line.
4024
4033
4025 * scripts/ipython: moved shell selection into a factory function
4034 * scripts/ipython: moved shell selection into a factory function
4026 in Shell.py, to keep the starter script to a minimum.
4035 in Shell.py, to keep the starter script to a minimum.
4027
4036
4028 2004-08-25 Fernando Perez <fperez@colorado.edu>
4037 2004-08-25 Fernando Perez <fperez@colorado.edu>
4029
4038
4030 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
4039 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
4031 John. Along with some recent changes he made to matplotlib, the
4040 John. Along with some recent changes he made to matplotlib, the
4032 next versions of both systems should work very well together.
4041 next versions of both systems should work very well together.
4033
4042
4034 2004-08-24 Fernando Perez <fperez@colorado.edu>
4043 2004-08-24 Fernando Perez <fperez@colorado.edu>
4035
4044
4036 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
4045 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
4037 tried to switch the profiling to using hotshot, but I'm getting
4046 tried to switch the profiling to using hotshot, but I'm getting
4038 strange errors from prof.runctx() there. I may be misreading the
4047 strange errors from prof.runctx() there. I may be misreading the
4039 docs, but it looks weird. For now the profiling code will
4048 docs, but it looks weird. For now the profiling code will
4040 continue to use the standard profiler.
4049 continue to use the standard profiler.
4041
4050
4042 2004-08-23 Fernando Perez <fperez@colorado.edu>
4051 2004-08-23 Fernando Perez <fperez@colorado.edu>
4043
4052
4044 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
4053 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
4045 threaded shell, by John Hunter. It's not quite ready yet, but
4054 threaded shell, by John Hunter. It's not quite ready yet, but
4046 close.
4055 close.
4047
4056
4048 2004-08-22 Fernando Perez <fperez@colorado.edu>
4057 2004-08-22 Fernando Perez <fperez@colorado.edu>
4049
4058
4050 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
4059 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
4051 in Magic and ultraTB.
4060 in Magic and ultraTB.
4052
4061
4053 * ipython.1: document threading options in manpage.
4062 * ipython.1: document threading options in manpage.
4054
4063
4055 * scripts/ipython: Changed name of -thread option to -gthread,
4064 * scripts/ipython: Changed name of -thread option to -gthread,
4056 since this is GTK specific. I want to leave the door open for a
4065 since this is GTK specific. I want to leave the door open for a
4057 -wthread option for WX, which will most likely be necessary. This
4066 -wthread option for WX, which will most likely be necessary. This
4058 change affects usage and ipmaker as well.
4067 change affects usage and ipmaker as well.
4059
4068
4060 * IPython/Shell.py (matplotlib_shell): Add a factory function to
4069 * IPython/Shell.py (matplotlib_shell): Add a factory function to
4061 handle the matplotlib shell issues. Code by John Hunter
4070 handle the matplotlib shell issues. Code by John Hunter
4062 <jdhunter-AT-nitace.bsd.uchicago.edu>.
4071 <jdhunter-AT-nitace.bsd.uchicago.edu>.
4063 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4072 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4064 broken (and disabled for end users) for now, but it puts the
4073 broken (and disabled for end users) for now, but it puts the
4065 infrastructure in place.
4074 infrastructure in place.
4066
4075
4067 2004-08-21 Fernando Perez <fperez@colorado.edu>
4076 2004-08-21 Fernando Perez <fperez@colorado.edu>
4068
4077
4069 * ipythonrc-pylab: Add matplotlib support.
4078 * ipythonrc-pylab: Add matplotlib support.
4070
4079
4071 * matplotlib_config.py: new files for matplotlib support, part of
4080 * matplotlib_config.py: new files for matplotlib support, part of
4072 the pylab profile.
4081 the pylab profile.
4073
4082
4074 * IPython/usage.py (__doc__): documented the threading options.
4083 * IPython/usage.py (__doc__): documented the threading options.
4075
4084
4076 2004-08-20 Fernando Perez <fperez@colorado.edu>
4085 2004-08-20 Fernando Perez <fperez@colorado.edu>
4077
4086
4078 * ipython: Modified the main calling routine to handle the -thread
4087 * ipython: Modified the main calling routine to handle the -thread
4079 and -mpthread options. This needs to be done as a top-level hack,
4088 and -mpthread options. This needs to be done as a top-level hack,
4080 because it determines which class to instantiate for IPython
4089 because it determines which class to instantiate for IPython
4081 itself.
4090 itself.
4082
4091
4083 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4092 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4084 classes to support multithreaded GTK operation without blocking,
4093 classes to support multithreaded GTK operation without blocking,
4085 and matplotlib with all backends. This is a lot of still very
4094 and matplotlib with all backends. This is a lot of still very
4086 experimental code, and threads are tricky. So it may still have a
4095 experimental code, and threads are tricky. So it may still have a
4087 few rough edges... This code owes a lot to
4096 few rough edges... This code owes a lot to
4088 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4097 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4089 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4098 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4090 to John Hunter for all the matplotlib work.
4099 to John Hunter for all the matplotlib work.
4091
4100
4092 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4101 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4093 options for gtk thread and matplotlib support.
4102 options for gtk thread and matplotlib support.
4094
4103
4095 2004-08-16 Fernando Perez <fperez@colorado.edu>
4104 2004-08-16 Fernando Perez <fperez@colorado.edu>
4096
4105
4097 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4106 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4098 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4107 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4099 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4108 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4100
4109
4101 2004-08-11 Fernando Perez <fperez@colorado.edu>
4110 2004-08-11 Fernando Perez <fperez@colorado.edu>
4102
4111
4103 * setup.py (isfile): Fix build so documentation gets updated for
4112 * setup.py (isfile): Fix build so documentation gets updated for
4104 rpms (it was only done for .tgz builds).
4113 rpms (it was only done for .tgz builds).
4105
4114
4106 2004-08-10 Fernando Perez <fperez@colorado.edu>
4115 2004-08-10 Fernando Perez <fperez@colorado.edu>
4107
4116
4108 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4117 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4109
4118
4110 * iplib.py : Silence syntax error exceptions in tab-completion.
4119 * iplib.py : Silence syntax error exceptions in tab-completion.
4111
4120
4112 2004-08-05 Fernando Perez <fperez@colorado.edu>
4121 2004-08-05 Fernando Perez <fperez@colorado.edu>
4113
4122
4114 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4123 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4115 'color off' mark for continuation prompts. This was causing long
4124 'color off' mark for continuation prompts. This was causing long
4116 continuation lines to mis-wrap.
4125 continuation lines to mis-wrap.
4117
4126
4118 2004-08-01 Fernando Perez <fperez@colorado.edu>
4127 2004-08-01 Fernando Perez <fperez@colorado.edu>
4119
4128
4120 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4129 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4121 for building ipython to be a parameter. All this is necessary
4130 for building ipython to be a parameter. All this is necessary
4122 right now to have a multithreaded version, but this insane
4131 right now to have a multithreaded version, but this insane
4123 non-design will be cleaned up soon. For now, it's a hack that
4132 non-design will be cleaned up soon. For now, it's a hack that
4124 works.
4133 works.
4125
4134
4126 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4135 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4127 args in various places. No bugs so far, but it's a dangerous
4136 args in various places. No bugs so far, but it's a dangerous
4128 practice.
4137 practice.
4129
4138
4130 2004-07-31 Fernando Perez <fperez@colorado.edu>
4139 2004-07-31 Fernando Perez <fperez@colorado.edu>
4131
4140
4132 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4141 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4133 fix completion of files with dots in their names under most
4142 fix completion of files with dots in their names under most
4134 profiles (pysh was OK because the completion order is different).
4143 profiles (pysh was OK because the completion order is different).
4135
4144
4136 2004-07-27 Fernando Perez <fperez@colorado.edu>
4145 2004-07-27 Fernando Perez <fperez@colorado.edu>
4137
4146
4138 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4147 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4139 keywords manually, b/c the one in keyword.py was removed in python
4148 keywords manually, b/c the one in keyword.py was removed in python
4140 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4149 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4141 This is NOT a bug under python 2.3 and earlier.
4150 This is NOT a bug under python 2.3 and earlier.
4142
4151
4143 2004-07-26 Fernando Perez <fperez@colorado.edu>
4152 2004-07-26 Fernando Perez <fperez@colorado.edu>
4144
4153
4145 * IPython/ultraTB.py (VerboseTB.text): Add another
4154 * IPython/ultraTB.py (VerboseTB.text): Add another
4146 linecache.checkcache() call to try to prevent inspect.py from
4155 linecache.checkcache() call to try to prevent inspect.py from
4147 crashing under python 2.3. I think this fixes
4156 crashing under python 2.3. I think this fixes
4148 http://www.scipy.net/roundup/ipython/issue17.
4157 http://www.scipy.net/roundup/ipython/issue17.
4149
4158
4150 2004-07-26 *** Released version 0.6.2
4159 2004-07-26 *** Released version 0.6.2
4151
4160
4152 2004-07-26 Fernando Perez <fperez@colorado.edu>
4161 2004-07-26 Fernando Perez <fperez@colorado.edu>
4153
4162
4154 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4163 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4155 fail for any number.
4164 fail for any number.
4156 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4165 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4157 empty bookmarks.
4166 empty bookmarks.
4158
4167
4159 2004-07-26 *** Released version 0.6.1
4168 2004-07-26 *** Released version 0.6.1
4160
4169
4161 2004-07-26 Fernando Perez <fperez@colorado.edu>
4170 2004-07-26 Fernando Perez <fperez@colorado.edu>
4162
4171
4163 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4172 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4164
4173
4165 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4174 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4166 escaping '()[]{}' in filenames.
4175 escaping '()[]{}' in filenames.
4167
4176
4168 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4177 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4169 Python 2.2 users who lack a proper shlex.split.
4178 Python 2.2 users who lack a proper shlex.split.
4170
4179
4171 2004-07-19 Fernando Perez <fperez@colorado.edu>
4180 2004-07-19 Fernando Perez <fperez@colorado.edu>
4172
4181
4173 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4182 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4174 for reading readline's init file. I follow the normal chain:
4183 for reading readline's init file. I follow the normal chain:
4175 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4184 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4176 report by Mike Heeter. This closes
4185 report by Mike Heeter. This closes
4177 http://www.scipy.net/roundup/ipython/issue16.
4186 http://www.scipy.net/roundup/ipython/issue16.
4178
4187
4179 2004-07-18 Fernando Perez <fperez@colorado.edu>
4188 2004-07-18 Fernando Perez <fperez@colorado.edu>
4180
4189
4181 * IPython/iplib.py (__init__): Add better handling of '\' under
4190 * IPython/iplib.py (__init__): Add better handling of '\' under
4182 Win32 for filenames. After a patch by Ville.
4191 Win32 for filenames. After a patch by Ville.
4183
4192
4184 2004-07-17 Fernando Perez <fperez@colorado.edu>
4193 2004-07-17 Fernando Perez <fperez@colorado.edu>
4185
4194
4186 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4195 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4187 autocalling would be triggered for 'foo is bar' if foo is
4196 autocalling would be triggered for 'foo is bar' if foo is
4188 callable. I also cleaned up the autocall detection code to use a
4197 callable. I also cleaned up the autocall detection code to use a
4189 regexp, which is faster. Bug reported by Alexander Schmolck.
4198 regexp, which is faster. Bug reported by Alexander Schmolck.
4190
4199
4191 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4200 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4192 '?' in them would confuse the help system. Reported by Alex
4201 '?' in them would confuse the help system. Reported by Alex
4193 Schmolck.
4202 Schmolck.
4194
4203
4195 2004-07-16 Fernando Perez <fperez@colorado.edu>
4204 2004-07-16 Fernando Perez <fperez@colorado.edu>
4196
4205
4197 * IPython/GnuplotInteractive.py (__all__): added plot2.
4206 * IPython/GnuplotInteractive.py (__all__): added plot2.
4198
4207
4199 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4208 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4200 plotting dictionaries, lists or tuples of 1d arrays.
4209 plotting dictionaries, lists or tuples of 1d arrays.
4201
4210
4202 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4211 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4203 optimizations.
4212 optimizations.
4204
4213
4205 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4214 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4206 the information which was there from Janko's original IPP code:
4215 the information which was there from Janko's original IPP code:
4207
4216
4208 03.05.99 20:53 porto.ifm.uni-kiel.de
4217 03.05.99 20:53 porto.ifm.uni-kiel.de
4209 --Started changelog.
4218 --Started changelog.
4210 --make clear do what it say it does
4219 --make clear do what it say it does
4211 --added pretty output of lines from inputcache
4220 --added pretty output of lines from inputcache
4212 --Made Logger a mixin class, simplifies handling of switches
4221 --Made Logger a mixin class, simplifies handling of switches
4213 --Added own completer class. .string<TAB> expands to last history
4222 --Added own completer class. .string<TAB> expands to last history
4214 line which starts with string. The new expansion is also present
4223 line which starts with string. The new expansion is also present
4215 with Ctrl-r from the readline library. But this shows, who this
4224 with Ctrl-r from the readline library. But this shows, who this
4216 can be done for other cases.
4225 can be done for other cases.
4217 --Added convention that all shell functions should accept a
4226 --Added convention that all shell functions should accept a
4218 parameter_string This opens the door for different behaviour for
4227 parameter_string This opens the door for different behaviour for
4219 each function. @cd is a good example of this.
4228 each function. @cd is a good example of this.
4220
4229
4221 04.05.99 12:12 porto.ifm.uni-kiel.de
4230 04.05.99 12:12 porto.ifm.uni-kiel.de
4222 --added logfile rotation
4231 --added logfile rotation
4223 --added new mainloop method which freezes first the namespace
4232 --added new mainloop method which freezes first the namespace
4224
4233
4225 07.05.99 21:24 porto.ifm.uni-kiel.de
4234 07.05.99 21:24 porto.ifm.uni-kiel.de
4226 --added the docreader classes. Now there is a help system.
4235 --added the docreader classes. Now there is a help system.
4227 -This is only a first try. Currently it's not easy to put new
4236 -This is only a first try. Currently it's not easy to put new
4228 stuff in the indices. But this is the way to go. Info would be
4237 stuff in the indices. But this is the way to go. Info would be
4229 better, but HTML is every where and not everybody has an info
4238 better, but HTML is every where and not everybody has an info
4230 system installed and it's not so easy to change html-docs to info.
4239 system installed and it's not so easy to change html-docs to info.
4231 --added global logfile option
4240 --added global logfile option
4232 --there is now a hook for object inspection method pinfo needs to
4241 --there is now a hook for object inspection method pinfo needs to
4233 be provided for this. Can be reached by two '??'.
4242 be provided for this. Can be reached by two '??'.
4234
4243
4235 08.05.99 20:51 porto.ifm.uni-kiel.de
4244 08.05.99 20:51 porto.ifm.uni-kiel.de
4236 --added a README
4245 --added a README
4237 --bug in rc file. Something has changed so functions in the rc
4246 --bug in rc file. Something has changed so functions in the rc
4238 file need to reference the shell and not self. Not clear if it's a
4247 file need to reference the shell and not self. Not clear if it's a
4239 bug or feature.
4248 bug or feature.
4240 --changed rc file for new behavior
4249 --changed rc file for new behavior
4241
4250
4242 2004-07-15 Fernando Perez <fperez@colorado.edu>
4251 2004-07-15 Fernando Perez <fperez@colorado.edu>
4243
4252
4244 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4253 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4245 cache was falling out of sync in bizarre manners when multi-line
4254 cache was falling out of sync in bizarre manners when multi-line
4246 input was present. Minor optimizations and cleanup.
4255 input was present. Minor optimizations and cleanup.
4247
4256
4248 (Logger): Remove old Changelog info for cleanup. This is the
4257 (Logger): Remove old Changelog info for cleanup. This is the
4249 information which was there from Janko's original code:
4258 information which was there from Janko's original code:
4250
4259
4251 Changes to Logger: - made the default log filename a parameter
4260 Changes to Logger: - made the default log filename a parameter
4252
4261
4253 - put a check for lines beginning with !@? in log(). Needed
4262 - put a check for lines beginning with !@? in log(). Needed
4254 (even if the handlers properly log their lines) for mid-session
4263 (even if the handlers properly log their lines) for mid-session
4255 logging activation to work properly. Without this, lines logged
4264 logging activation to work properly. Without this, lines logged
4256 in mid session, which get read from the cache, would end up
4265 in mid session, which get read from the cache, would end up
4257 'bare' (with !@? in the open) in the log. Now they are caught
4266 'bare' (with !@? in the open) in the log. Now they are caught
4258 and prepended with a #.
4267 and prepended with a #.
4259
4268
4260 * IPython/iplib.py (InteractiveShell.init_readline): added check
4269 * IPython/iplib.py (InteractiveShell.init_readline): added check
4261 in case MagicCompleter fails to be defined, so we don't crash.
4270 in case MagicCompleter fails to be defined, so we don't crash.
4262
4271
4263 2004-07-13 Fernando Perez <fperez@colorado.edu>
4272 2004-07-13 Fernando Perez <fperez@colorado.edu>
4264
4273
4265 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4274 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4266 of EPS if the requested filename ends in '.eps'.
4275 of EPS if the requested filename ends in '.eps'.
4267
4276
4268 2004-07-04 Fernando Perez <fperez@colorado.edu>
4277 2004-07-04 Fernando Perez <fperez@colorado.edu>
4269
4278
4270 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4279 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4271 escaping of quotes when calling the shell.
4280 escaping of quotes when calling the shell.
4272
4281
4273 2004-07-02 Fernando Perez <fperez@colorado.edu>
4282 2004-07-02 Fernando Perez <fperez@colorado.edu>
4274
4283
4275 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4284 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4276 gettext not working because we were clobbering '_'. Fixes
4285 gettext not working because we were clobbering '_'. Fixes
4277 http://www.scipy.net/roundup/ipython/issue6.
4286 http://www.scipy.net/roundup/ipython/issue6.
4278
4287
4279 2004-07-01 Fernando Perez <fperez@colorado.edu>
4288 2004-07-01 Fernando Perez <fperez@colorado.edu>
4280
4289
4281 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4290 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4282 into @cd. Patch by Ville.
4291 into @cd. Patch by Ville.
4283
4292
4284 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4293 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4285 new function to store things after ipmaker runs. Patch by Ville.
4294 new function to store things after ipmaker runs. Patch by Ville.
4286 Eventually this will go away once ipmaker is removed and the class
4295 Eventually this will go away once ipmaker is removed and the class
4287 gets cleaned up, but for now it's ok. Key functionality here is
4296 gets cleaned up, but for now it's ok. Key functionality here is
4288 the addition of the persistent storage mechanism, a dict for
4297 the addition of the persistent storage mechanism, a dict for
4289 keeping data across sessions (for now just bookmarks, but more can
4298 keeping data across sessions (for now just bookmarks, but more can
4290 be implemented later).
4299 be implemented later).
4291
4300
4292 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4301 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4293 persistent across sections. Patch by Ville, I modified it
4302 persistent across sections. Patch by Ville, I modified it
4294 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4303 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4295 added a '-l' option to list all bookmarks.
4304 added a '-l' option to list all bookmarks.
4296
4305
4297 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4306 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4298 center for cleanup. Registered with atexit.register(). I moved
4307 center for cleanup. Registered with atexit.register(). I moved
4299 here the old exit_cleanup(). After a patch by Ville.
4308 here the old exit_cleanup(). After a patch by Ville.
4300
4309
4301 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4310 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4302 characters in the hacked shlex_split for python 2.2.
4311 characters in the hacked shlex_split for python 2.2.
4303
4312
4304 * IPython/iplib.py (file_matches): more fixes to filenames with
4313 * IPython/iplib.py (file_matches): more fixes to filenames with
4305 whitespace in them. It's not perfect, but limitations in python's
4314 whitespace in them. It's not perfect, but limitations in python's
4306 readline make it impossible to go further.
4315 readline make it impossible to go further.
4307
4316
4308 2004-06-29 Fernando Perez <fperez@colorado.edu>
4317 2004-06-29 Fernando Perez <fperez@colorado.edu>
4309
4318
4310 * IPython/iplib.py (file_matches): escape whitespace correctly in
4319 * IPython/iplib.py (file_matches): escape whitespace correctly in
4311 filename completions. Bug reported by Ville.
4320 filename completions. Bug reported by Ville.
4312
4321
4313 2004-06-28 Fernando Perez <fperez@colorado.edu>
4322 2004-06-28 Fernando Perez <fperez@colorado.edu>
4314
4323
4315 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4324 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4316 the history file will be called 'history-PROFNAME' (or just
4325 the history file will be called 'history-PROFNAME' (or just
4317 'history' if no profile is loaded). I was getting annoyed at
4326 'history' if no profile is loaded). I was getting annoyed at
4318 getting my Numerical work history clobbered by pysh sessions.
4327 getting my Numerical work history clobbered by pysh sessions.
4319
4328
4320 * IPython/iplib.py (InteractiveShell.__init__): Internal
4329 * IPython/iplib.py (InteractiveShell.__init__): Internal
4321 getoutputerror() function so that we can honor the system_verbose
4330 getoutputerror() function so that we can honor the system_verbose
4322 flag for _all_ system calls. I also added escaping of #
4331 flag for _all_ system calls. I also added escaping of #
4323 characters here to avoid confusing Itpl.
4332 characters here to avoid confusing Itpl.
4324
4333
4325 * IPython/Magic.py (shlex_split): removed call to shell in
4334 * IPython/Magic.py (shlex_split): removed call to shell in
4326 parse_options and replaced it with shlex.split(). The annoying
4335 parse_options and replaced it with shlex.split(). The annoying
4327 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4336 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4328 to backport it from 2.3, with several frail hacks (the shlex
4337 to backport it from 2.3, with several frail hacks (the shlex
4329 module is rather limited in 2.2). Thanks to a suggestion by Ville
4338 module is rather limited in 2.2). Thanks to a suggestion by Ville
4330 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4339 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4331 problem.
4340 problem.
4332
4341
4333 (Magic.magic_system_verbose): new toggle to print the actual
4342 (Magic.magic_system_verbose): new toggle to print the actual
4334 system calls made by ipython. Mainly for debugging purposes.
4343 system calls made by ipython. Mainly for debugging purposes.
4335
4344
4336 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4345 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4337 doesn't support persistence. Reported (and fix suggested) by
4346 doesn't support persistence. Reported (and fix suggested) by
4338 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4347 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4339
4348
4340 2004-06-26 Fernando Perez <fperez@colorado.edu>
4349 2004-06-26 Fernando Perez <fperez@colorado.edu>
4341
4350
4342 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4351 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4343 continue prompts.
4352 continue prompts.
4344
4353
4345 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4354 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4346 function (basically a big docstring) and a few more things here to
4355 function (basically a big docstring) and a few more things here to
4347 speedup startup. pysh.py is now very lightweight. We want because
4356 speedup startup. pysh.py is now very lightweight. We want because
4348 it gets execfile'd, while InterpreterExec gets imported, so
4357 it gets execfile'd, while InterpreterExec gets imported, so
4349 byte-compilation saves time.
4358 byte-compilation saves time.
4350
4359
4351 2004-06-25 Fernando Perez <fperez@colorado.edu>
4360 2004-06-25 Fernando Perez <fperez@colorado.edu>
4352
4361
4353 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4362 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4354 -NUM', which was recently broken.
4363 -NUM', which was recently broken.
4355
4364
4356 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4365 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4357 in multi-line input (but not !!, which doesn't make sense there).
4366 in multi-line input (but not !!, which doesn't make sense there).
4358
4367
4359 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4368 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4360 It's just too useful, and people can turn it off in the less
4369 It's just too useful, and people can turn it off in the less
4361 common cases where it's a problem.
4370 common cases where it's a problem.
4362
4371
4363 2004-06-24 Fernando Perez <fperez@colorado.edu>
4372 2004-06-24 Fernando Perez <fperez@colorado.edu>
4364
4373
4365 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4374 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4366 special syntaxes (like alias calling) is now allied in multi-line
4375 special syntaxes (like alias calling) is now allied in multi-line
4367 input. This is still _very_ experimental, but it's necessary for
4376 input. This is still _very_ experimental, but it's necessary for
4368 efficient shell usage combining python looping syntax with system
4377 efficient shell usage combining python looping syntax with system
4369 calls. For now it's restricted to aliases, I don't think it
4378 calls. For now it's restricted to aliases, I don't think it
4370 really even makes sense to have this for magics.
4379 really even makes sense to have this for magics.
4371
4380
4372 2004-06-23 Fernando Perez <fperez@colorado.edu>
4381 2004-06-23 Fernando Perez <fperez@colorado.edu>
4373
4382
4374 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4383 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4375 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4384 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4376
4385
4377 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4386 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4378 extensions under Windows (after code sent by Gary Bishop). The
4387 extensions under Windows (after code sent by Gary Bishop). The
4379 extensions considered 'executable' are stored in IPython's rc
4388 extensions considered 'executable' are stored in IPython's rc
4380 structure as win_exec_ext.
4389 structure as win_exec_ext.
4381
4390
4382 * IPython/genutils.py (shell): new function, like system() but
4391 * IPython/genutils.py (shell): new function, like system() but
4383 without return value. Very useful for interactive shell work.
4392 without return value. Very useful for interactive shell work.
4384
4393
4385 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4394 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4386 delete aliases.
4395 delete aliases.
4387
4396
4388 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4397 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4389 sure that the alias table doesn't contain python keywords.
4398 sure that the alias table doesn't contain python keywords.
4390
4399
4391 2004-06-21 Fernando Perez <fperez@colorado.edu>
4400 2004-06-21 Fernando Perez <fperez@colorado.edu>
4392
4401
4393 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4402 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4394 non-existent items are found in $PATH. Reported by Thorsten.
4403 non-existent items are found in $PATH. Reported by Thorsten.
4395
4404
4396 2004-06-20 Fernando Perez <fperez@colorado.edu>
4405 2004-06-20 Fernando Perez <fperez@colorado.edu>
4397
4406
4398 * IPython/iplib.py (complete): modified the completer so that the
4407 * IPython/iplib.py (complete): modified the completer so that the
4399 order of priorities can be easily changed at runtime.
4408 order of priorities can be easily changed at runtime.
4400
4409
4401 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4410 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4402 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4411 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4403
4412
4404 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4413 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4405 expand Python variables prepended with $ in all system calls. The
4414 expand Python variables prepended with $ in all system calls. The
4406 same was done to InteractiveShell.handle_shell_escape. Now all
4415 same was done to InteractiveShell.handle_shell_escape. Now all
4407 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4416 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4408 expansion of python variables and expressions according to the
4417 expansion of python variables and expressions according to the
4409 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4418 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4410
4419
4411 Though PEP-215 has been rejected, a similar (but simpler) one
4420 Though PEP-215 has been rejected, a similar (but simpler) one
4412 seems like it will go into Python 2.4, PEP-292 -
4421 seems like it will go into Python 2.4, PEP-292 -
4413 http://www.python.org/peps/pep-0292.html.
4422 http://www.python.org/peps/pep-0292.html.
4414
4423
4415 I'll keep the full syntax of PEP-215, since IPython has since the
4424 I'll keep the full syntax of PEP-215, since IPython has since the
4416 start used Ka-Ping Yee's reference implementation discussed there
4425 start used Ka-Ping Yee's reference implementation discussed there
4417 (Itpl), and I actually like the powerful semantics it offers.
4426 (Itpl), and I actually like the powerful semantics it offers.
4418
4427
4419 In order to access normal shell variables, the $ has to be escaped
4428 In order to access normal shell variables, the $ has to be escaped
4420 via an extra $. For example:
4429 via an extra $. For example:
4421
4430
4422 In [7]: PATH='a python variable'
4431 In [7]: PATH='a python variable'
4423
4432
4424 In [8]: !echo $PATH
4433 In [8]: !echo $PATH
4425 a python variable
4434 a python variable
4426
4435
4427 In [9]: !echo $$PATH
4436 In [9]: !echo $$PATH
4428 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4437 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4429
4438
4430 (Magic.parse_options): escape $ so the shell doesn't evaluate
4439 (Magic.parse_options): escape $ so the shell doesn't evaluate
4431 things prematurely.
4440 things prematurely.
4432
4441
4433 * IPython/iplib.py (InteractiveShell.call_alias): added the
4442 * IPython/iplib.py (InteractiveShell.call_alias): added the
4434 ability for aliases to expand python variables via $.
4443 ability for aliases to expand python variables via $.
4435
4444
4436 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4445 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4437 system, now there's a @rehash/@rehashx pair of magics. These work
4446 system, now there's a @rehash/@rehashx pair of magics. These work
4438 like the csh rehash command, and can be invoked at any time. They
4447 like the csh rehash command, and can be invoked at any time. They
4439 build a table of aliases to everything in the user's $PATH
4448 build a table of aliases to everything in the user's $PATH
4440 (@rehash uses everything, @rehashx is slower but only adds
4449 (@rehash uses everything, @rehashx is slower but only adds
4441 executable files). With this, the pysh.py-based shell profile can
4450 executable files). With this, the pysh.py-based shell profile can
4442 now simply call rehash upon startup, and full access to all
4451 now simply call rehash upon startup, and full access to all
4443 programs in the user's path is obtained.
4452 programs in the user's path is obtained.
4444
4453
4445 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4454 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4446 functionality is now fully in place. I removed the old dynamic
4455 functionality is now fully in place. I removed the old dynamic
4447 code generation based approach, in favor of a much lighter one
4456 code generation based approach, in favor of a much lighter one
4448 based on a simple dict. The advantage is that this allows me to
4457 based on a simple dict. The advantage is that this allows me to
4449 now have thousands of aliases with negligible cost (unthinkable
4458 now have thousands of aliases with negligible cost (unthinkable
4450 with the old system).
4459 with the old system).
4451
4460
4452 2004-06-19 Fernando Perez <fperez@colorado.edu>
4461 2004-06-19 Fernando Perez <fperez@colorado.edu>
4453
4462
4454 * IPython/iplib.py (__init__): extended MagicCompleter class to
4463 * IPython/iplib.py (__init__): extended MagicCompleter class to
4455 also complete (last in priority) on user aliases.
4464 also complete (last in priority) on user aliases.
4456
4465
4457 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4466 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4458 call to eval.
4467 call to eval.
4459 (ItplNS.__init__): Added a new class which functions like Itpl,
4468 (ItplNS.__init__): Added a new class which functions like Itpl,
4460 but allows configuring the namespace for the evaluation to occur
4469 but allows configuring the namespace for the evaluation to occur
4461 in.
4470 in.
4462
4471
4463 2004-06-18 Fernando Perez <fperez@colorado.edu>
4472 2004-06-18 Fernando Perez <fperez@colorado.edu>
4464
4473
4465 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4474 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4466 better message when 'exit' or 'quit' are typed (a common newbie
4475 better message when 'exit' or 'quit' are typed (a common newbie
4467 confusion).
4476 confusion).
4468
4477
4469 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4478 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4470 check for Windows users.
4479 check for Windows users.
4471
4480
4472 * IPython/iplib.py (InteractiveShell.user_setup): removed
4481 * IPython/iplib.py (InteractiveShell.user_setup): removed
4473 disabling of colors for Windows. I'll test at runtime and issue a
4482 disabling of colors for Windows. I'll test at runtime and issue a
4474 warning if Gary's readline isn't found, as to nudge users to
4483 warning if Gary's readline isn't found, as to nudge users to
4475 download it.
4484 download it.
4476
4485
4477 2004-06-16 Fernando Perez <fperez@colorado.edu>
4486 2004-06-16 Fernando Perez <fperez@colorado.edu>
4478
4487
4479 * IPython/genutils.py (Stream.__init__): changed to print errors
4488 * IPython/genutils.py (Stream.__init__): changed to print errors
4480 to sys.stderr. I had a circular dependency here. Now it's
4489 to sys.stderr. I had a circular dependency here. Now it's
4481 possible to run ipython as IDLE's shell (consider this pre-alpha,
4490 possible to run ipython as IDLE's shell (consider this pre-alpha,
4482 since true stdout things end up in the starting terminal instead
4491 since true stdout things end up in the starting terminal instead
4483 of IDLE's out).
4492 of IDLE's out).
4484
4493
4485 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4494 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4486 users who haven't # updated their prompt_in2 definitions. Remove
4495 users who haven't # updated their prompt_in2 definitions. Remove
4487 eventually.
4496 eventually.
4488 (multiple_replace): added credit to original ASPN recipe.
4497 (multiple_replace): added credit to original ASPN recipe.
4489
4498
4490 2004-06-15 Fernando Perez <fperez@colorado.edu>
4499 2004-06-15 Fernando Perez <fperez@colorado.edu>
4491
4500
4492 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4501 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4493 list of auto-defined aliases.
4502 list of auto-defined aliases.
4494
4503
4495 2004-06-13 Fernando Perez <fperez@colorado.edu>
4504 2004-06-13 Fernando Perez <fperez@colorado.edu>
4496
4505
4497 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4506 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4498 install was really requested (so setup.py can be used for other
4507 install was really requested (so setup.py can be used for other
4499 things under Windows).
4508 things under Windows).
4500
4509
4501 2004-06-10 Fernando Perez <fperez@colorado.edu>
4510 2004-06-10 Fernando Perez <fperez@colorado.edu>
4502
4511
4503 * IPython/Logger.py (Logger.create_log): Manually remove any old
4512 * IPython/Logger.py (Logger.create_log): Manually remove any old
4504 backup, since os.remove may fail under Windows. Fixes bug
4513 backup, since os.remove may fail under Windows. Fixes bug
4505 reported by Thorsten.
4514 reported by Thorsten.
4506
4515
4507 2004-06-09 Fernando Perez <fperez@colorado.edu>
4516 2004-06-09 Fernando Perez <fperez@colorado.edu>
4508
4517
4509 * examples/example-embed.py: fixed all references to %n (replaced
4518 * examples/example-embed.py: fixed all references to %n (replaced
4510 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4519 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4511 for all examples and the manual as well.
4520 for all examples and the manual as well.
4512
4521
4513 2004-06-08 Fernando Perez <fperez@colorado.edu>
4522 2004-06-08 Fernando Perez <fperez@colorado.edu>
4514
4523
4515 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4524 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4516 alignment and color management. All 3 prompt subsystems now
4525 alignment and color management. All 3 prompt subsystems now
4517 inherit from BasePrompt.
4526 inherit from BasePrompt.
4518
4527
4519 * tools/release: updates for windows installer build and tag rpms
4528 * tools/release: updates for windows installer build and tag rpms
4520 with python version (since paths are fixed).
4529 with python version (since paths are fixed).
4521
4530
4522 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4531 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4523 which will become eventually obsolete. Also fixed the default
4532 which will become eventually obsolete. Also fixed the default
4524 prompt_in2 to use \D, so at least new users start with the correct
4533 prompt_in2 to use \D, so at least new users start with the correct
4525 defaults.
4534 defaults.
4526 WARNING: Users with existing ipythonrc files will need to apply
4535 WARNING: Users with existing ipythonrc files will need to apply
4527 this fix manually!
4536 this fix manually!
4528
4537
4529 * setup.py: make windows installer (.exe). This is finally the
4538 * setup.py: make windows installer (.exe). This is finally the
4530 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4539 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4531 which I hadn't included because it required Python 2.3 (or recent
4540 which I hadn't included because it required Python 2.3 (or recent
4532 distutils).
4541 distutils).
4533
4542
4534 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4543 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4535 usage of new '\D' escape.
4544 usage of new '\D' escape.
4536
4545
4537 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4546 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4538 lacks os.getuid())
4547 lacks os.getuid())
4539 (CachedOutput.set_colors): Added the ability to turn coloring
4548 (CachedOutput.set_colors): Added the ability to turn coloring
4540 on/off with @colors even for manually defined prompt colors. It
4549 on/off with @colors even for manually defined prompt colors. It
4541 uses a nasty global, but it works safely and via the generic color
4550 uses a nasty global, but it works safely and via the generic color
4542 handling mechanism.
4551 handling mechanism.
4543 (Prompt2.__init__): Introduced new escape '\D' for continuation
4552 (Prompt2.__init__): Introduced new escape '\D' for continuation
4544 prompts. It represents the counter ('\#') as dots.
4553 prompts. It represents the counter ('\#') as dots.
4545 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4554 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4546 need to update their ipythonrc files and replace '%n' with '\D' in
4555 need to update their ipythonrc files and replace '%n' with '\D' in
4547 their prompt_in2 settings everywhere. Sorry, but there's
4556 their prompt_in2 settings everywhere. Sorry, but there's
4548 otherwise no clean way to get all prompts to properly align. The
4557 otherwise no clean way to get all prompts to properly align. The
4549 ipythonrc shipped with IPython has been updated.
4558 ipythonrc shipped with IPython has been updated.
4550
4559
4551 2004-06-07 Fernando Perez <fperez@colorado.edu>
4560 2004-06-07 Fernando Perez <fperez@colorado.edu>
4552
4561
4553 * setup.py (isfile): Pass local_icons option to latex2html, so the
4562 * setup.py (isfile): Pass local_icons option to latex2html, so the
4554 resulting HTML file is self-contained. Thanks to
4563 resulting HTML file is self-contained. Thanks to
4555 dryice-AT-liu.com.cn for the tip.
4564 dryice-AT-liu.com.cn for the tip.
4556
4565
4557 * pysh.py: I created a new profile 'shell', which implements a
4566 * pysh.py: I created a new profile 'shell', which implements a
4558 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4567 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4559 system shell, nor will it become one anytime soon. It's mainly
4568 system shell, nor will it become one anytime soon. It's mainly
4560 meant to illustrate the use of the new flexible bash-like prompts.
4569 meant to illustrate the use of the new flexible bash-like prompts.
4561 I guess it could be used by hardy souls for true shell management,
4570 I guess it could be used by hardy souls for true shell management,
4562 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4571 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4563 profile. This uses the InterpreterExec extension provided by
4572 profile. This uses the InterpreterExec extension provided by
4564 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4573 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4565
4574
4566 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4575 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4567 auto-align itself with the length of the previous input prompt
4576 auto-align itself with the length of the previous input prompt
4568 (taking into account the invisible color escapes).
4577 (taking into account the invisible color escapes).
4569 (CachedOutput.__init__): Large restructuring of this class. Now
4578 (CachedOutput.__init__): Large restructuring of this class. Now
4570 all three prompts (primary1, primary2, output) are proper objects,
4579 all three prompts (primary1, primary2, output) are proper objects,
4571 managed by the 'parent' CachedOutput class. The code is still a
4580 managed by the 'parent' CachedOutput class. The code is still a
4572 bit hackish (all prompts share state via a pointer to the cache),
4581 bit hackish (all prompts share state via a pointer to the cache),
4573 but it's overall far cleaner than before.
4582 but it's overall far cleaner than before.
4574
4583
4575 * IPython/genutils.py (getoutputerror): modified to add verbose,
4584 * IPython/genutils.py (getoutputerror): modified to add verbose,
4576 debug and header options. This makes the interface of all getout*
4585 debug and header options. This makes the interface of all getout*
4577 functions uniform.
4586 functions uniform.
4578 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4587 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4579
4588
4580 * IPython/Magic.py (Magic.default_option): added a function to
4589 * IPython/Magic.py (Magic.default_option): added a function to
4581 allow registering default options for any magic command. This
4590 allow registering default options for any magic command. This
4582 makes it easy to have profiles which customize the magics globally
4591 makes it easy to have profiles which customize the magics globally
4583 for a certain use. The values set through this function are
4592 for a certain use. The values set through this function are
4584 picked up by the parse_options() method, which all magics should
4593 picked up by the parse_options() method, which all magics should
4585 use to parse their options.
4594 use to parse their options.
4586
4595
4587 * IPython/genutils.py (warn): modified the warnings framework to
4596 * IPython/genutils.py (warn): modified the warnings framework to
4588 use the Term I/O class. I'm trying to slowly unify all of
4597 use the Term I/O class. I'm trying to slowly unify all of
4589 IPython's I/O operations to pass through Term.
4598 IPython's I/O operations to pass through Term.
4590
4599
4591 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4600 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4592 the secondary prompt to correctly match the length of the primary
4601 the secondary prompt to correctly match the length of the primary
4593 one for any prompt. Now multi-line code will properly line up
4602 one for any prompt. Now multi-line code will properly line up
4594 even for path dependent prompts, such as the new ones available
4603 even for path dependent prompts, such as the new ones available
4595 via the prompt_specials.
4604 via the prompt_specials.
4596
4605
4597 2004-06-06 Fernando Perez <fperez@colorado.edu>
4606 2004-06-06 Fernando Perez <fperez@colorado.edu>
4598
4607
4599 * IPython/Prompts.py (prompt_specials): Added the ability to have
4608 * IPython/Prompts.py (prompt_specials): Added the ability to have
4600 bash-like special sequences in the prompts, which get
4609 bash-like special sequences in the prompts, which get
4601 automatically expanded. Things like hostname, current working
4610 automatically expanded. Things like hostname, current working
4602 directory and username are implemented already, but it's easy to
4611 directory and username are implemented already, but it's easy to
4603 add more in the future. Thanks to a patch by W.J. van der Laan
4612 add more in the future. Thanks to a patch by W.J. van der Laan
4604 <gnufnork-AT-hetdigitalegat.nl>
4613 <gnufnork-AT-hetdigitalegat.nl>
4605 (prompt_specials): Added color support for prompt strings, so
4614 (prompt_specials): Added color support for prompt strings, so
4606 users can define arbitrary color setups for their prompts.
4615 users can define arbitrary color setups for their prompts.
4607
4616
4608 2004-06-05 Fernando Perez <fperez@colorado.edu>
4617 2004-06-05 Fernando Perez <fperez@colorado.edu>
4609
4618
4610 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4619 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4611 code to load Gary Bishop's readline and configure it
4620 code to load Gary Bishop's readline and configure it
4612 automatically. Thanks to Gary for help on this.
4621 automatically. Thanks to Gary for help on this.
4613
4622
4614 2004-06-01 Fernando Perez <fperez@colorado.edu>
4623 2004-06-01 Fernando Perez <fperez@colorado.edu>
4615
4624
4616 * IPython/Logger.py (Logger.create_log): fix bug for logging
4625 * IPython/Logger.py (Logger.create_log): fix bug for logging
4617 with no filename (previous fix was incomplete).
4626 with no filename (previous fix was incomplete).
4618
4627
4619 2004-05-25 Fernando Perez <fperez@colorado.edu>
4628 2004-05-25 Fernando Perez <fperez@colorado.edu>
4620
4629
4621 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4630 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4622 parens would get passed to the shell.
4631 parens would get passed to the shell.
4623
4632
4624 2004-05-20 Fernando Perez <fperez@colorado.edu>
4633 2004-05-20 Fernando Perez <fperez@colorado.edu>
4625
4634
4626 * IPython/Magic.py (Magic.magic_prun): changed default profile
4635 * IPython/Magic.py (Magic.magic_prun): changed default profile
4627 sort order to 'time' (the more common profiling need).
4636 sort order to 'time' (the more common profiling need).
4628
4637
4629 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4638 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4630 so that source code shown is guaranteed in sync with the file on
4639 so that source code shown is guaranteed in sync with the file on
4631 disk (also changed in psource). Similar fix to the one for
4640 disk (also changed in psource). Similar fix to the one for
4632 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4641 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4633 <yann.ledu-AT-noos.fr>.
4642 <yann.ledu-AT-noos.fr>.
4634
4643
4635 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4644 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4636 with a single option would not be correctly parsed. Closes
4645 with a single option would not be correctly parsed. Closes
4637 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4646 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4638 introduced in 0.6.0 (on 2004-05-06).
4647 introduced in 0.6.0 (on 2004-05-06).
4639
4648
4640 2004-05-13 *** Released version 0.6.0
4649 2004-05-13 *** Released version 0.6.0
4641
4650
4642 2004-05-13 Fernando Perez <fperez@colorado.edu>
4651 2004-05-13 Fernando Perez <fperez@colorado.edu>
4643
4652
4644 * debian/: Added debian/ directory to CVS, so that debian support
4653 * debian/: Added debian/ directory to CVS, so that debian support
4645 is publicly accessible. The debian package is maintained by Jack
4654 is publicly accessible. The debian package is maintained by Jack
4646 Moffit <jack-AT-xiph.org>.
4655 Moffit <jack-AT-xiph.org>.
4647
4656
4648 * Documentation: included the notes about an ipython-based system
4657 * Documentation: included the notes about an ipython-based system
4649 shell (the hypothetical 'pysh') into the new_design.pdf document,
4658 shell (the hypothetical 'pysh') into the new_design.pdf document,
4650 so that these ideas get distributed to users along with the
4659 so that these ideas get distributed to users along with the
4651 official documentation.
4660 official documentation.
4652
4661
4653 2004-05-10 Fernando Perez <fperez@colorado.edu>
4662 2004-05-10 Fernando Perez <fperez@colorado.edu>
4654
4663
4655 * IPython/Logger.py (Logger.create_log): fix recently introduced
4664 * IPython/Logger.py (Logger.create_log): fix recently introduced
4656 bug (misindented line) where logstart would fail when not given an
4665 bug (misindented line) where logstart would fail when not given an
4657 explicit filename.
4666 explicit filename.
4658
4667
4659 2004-05-09 Fernando Perez <fperez@colorado.edu>
4668 2004-05-09 Fernando Perez <fperez@colorado.edu>
4660
4669
4661 * IPython/Magic.py (Magic.parse_options): skip system call when
4670 * IPython/Magic.py (Magic.parse_options): skip system call when
4662 there are no options to look for. Faster, cleaner for the common
4671 there are no options to look for. Faster, cleaner for the common
4663 case.
4672 case.
4664
4673
4665 * Documentation: many updates to the manual: describing Windows
4674 * Documentation: many updates to the manual: describing Windows
4666 support better, Gnuplot updates, credits, misc small stuff. Also
4675 support better, Gnuplot updates, credits, misc small stuff. Also
4667 updated the new_design doc a bit.
4676 updated the new_design doc a bit.
4668
4677
4669 2004-05-06 *** Released version 0.6.0.rc1
4678 2004-05-06 *** Released version 0.6.0.rc1
4670
4679
4671 2004-05-06 Fernando Perez <fperez@colorado.edu>
4680 2004-05-06 Fernando Perez <fperez@colorado.edu>
4672
4681
4673 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4682 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4674 operations to use the vastly more efficient list/''.join() method.
4683 operations to use the vastly more efficient list/''.join() method.
4675 (FormattedTB.text): Fix
4684 (FormattedTB.text): Fix
4676 http://www.scipy.net/roundup/ipython/issue12 - exception source
4685 http://www.scipy.net/roundup/ipython/issue12 - exception source
4677 extract not updated after reload. Thanks to Mike Salib
4686 extract not updated after reload. Thanks to Mike Salib
4678 <msalib-AT-mit.edu> for pinning the source of the problem.
4687 <msalib-AT-mit.edu> for pinning the source of the problem.
4679 Fortunately, the solution works inside ipython and doesn't require
4688 Fortunately, the solution works inside ipython and doesn't require
4680 any changes to python proper.
4689 any changes to python proper.
4681
4690
4682 * IPython/Magic.py (Magic.parse_options): Improved to process the
4691 * IPython/Magic.py (Magic.parse_options): Improved to process the
4683 argument list as a true shell would (by actually using the
4692 argument list as a true shell would (by actually using the
4684 underlying system shell). This way, all @magics automatically get
4693 underlying system shell). This way, all @magics automatically get
4685 shell expansion for variables. Thanks to a comment by Alex
4694 shell expansion for variables. Thanks to a comment by Alex
4686 Schmolck.
4695 Schmolck.
4687
4696
4688 2004-04-04 Fernando Perez <fperez@colorado.edu>
4697 2004-04-04 Fernando Perez <fperez@colorado.edu>
4689
4698
4690 * IPython/iplib.py (InteractiveShell.interact): Added a special
4699 * IPython/iplib.py (InteractiveShell.interact): Added a special
4691 trap for a debugger quit exception, which is basically impossible
4700 trap for a debugger quit exception, which is basically impossible
4692 to handle by normal mechanisms, given what pdb does to the stack.
4701 to handle by normal mechanisms, given what pdb does to the stack.
4693 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4702 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4694
4703
4695 2004-04-03 Fernando Perez <fperez@colorado.edu>
4704 2004-04-03 Fernando Perez <fperez@colorado.edu>
4696
4705
4697 * IPython/genutils.py (Term): Standardized the names of the Term
4706 * IPython/genutils.py (Term): Standardized the names of the Term
4698 class streams to cin/cout/cerr, following C++ naming conventions
4707 class streams to cin/cout/cerr, following C++ naming conventions
4699 (I can't use in/out/err because 'in' is not a valid attribute
4708 (I can't use in/out/err because 'in' is not a valid attribute
4700 name).
4709 name).
4701
4710
4702 * IPython/iplib.py (InteractiveShell.interact): don't increment
4711 * IPython/iplib.py (InteractiveShell.interact): don't increment
4703 the prompt if there's no user input. By Daniel 'Dang' Griffith
4712 the prompt if there's no user input. By Daniel 'Dang' Griffith
4704 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4713 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4705 Francois Pinard.
4714 Francois Pinard.
4706
4715
4707 2004-04-02 Fernando Perez <fperez@colorado.edu>
4716 2004-04-02 Fernando Perez <fperez@colorado.edu>
4708
4717
4709 * IPython/genutils.py (Stream.__init__): Modified to survive at
4718 * IPython/genutils.py (Stream.__init__): Modified to survive at
4710 least importing in contexts where stdin/out/err aren't true file
4719 least importing in contexts where stdin/out/err aren't true file
4711 objects, such as PyCrust (they lack fileno() and mode). However,
4720 objects, such as PyCrust (they lack fileno() and mode). However,
4712 the recovery facilities which rely on these things existing will
4721 the recovery facilities which rely on these things existing will
4713 not work.
4722 not work.
4714
4723
4715 2004-04-01 Fernando Perez <fperez@colorado.edu>
4724 2004-04-01 Fernando Perez <fperez@colorado.edu>
4716
4725
4717 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4726 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4718 use the new getoutputerror() function, so it properly
4727 use the new getoutputerror() function, so it properly
4719 distinguishes stdout/err.
4728 distinguishes stdout/err.
4720
4729
4721 * IPython/genutils.py (getoutputerror): added a function to
4730 * IPython/genutils.py (getoutputerror): added a function to
4722 capture separately the standard output and error of a command.
4731 capture separately the standard output and error of a command.
4723 After a comment from dang on the mailing lists. This code is
4732 After a comment from dang on the mailing lists. This code is
4724 basically a modified version of commands.getstatusoutput(), from
4733 basically a modified version of commands.getstatusoutput(), from
4725 the standard library.
4734 the standard library.
4726
4735
4727 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4736 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4728 '!!' as a special syntax (shorthand) to access @sx.
4737 '!!' as a special syntax (shorthand) to access @sx.
4729
4738
4730 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4739 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4731 command and return its output as a list split on '\n'.
4740 command and return its output as a list split on '\n'.
4732
4741
4733 2004-03-31 Fernando Perez <fperez@colorado.edu>
4742 2004-03-31 Fernando Perez <fperez@colorado.edu>
4734
4743
4735 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4744 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4736 method to dictionaries used as FakeModule instances if they lack
4745 method to dictionaries used as FakeModule instances if they lack
4737 it. At least pydoc in python2.3 breaks for runtime-defined
4746 it. At least pydoc in python2.3 breaks for runtime-defined
4738 functions without this hack. At some point I need to _really_
4747 functions without this hack. At some point I need to _really_
4739 understand what FakeModule is doing, because it's a gross hack.
4748 understand what FakeModule is doing, because it's a gross hack.
4740 But it solves Arnd's problem for now...
4749 But it solves Arnd's problem for now...
4741
4750
4742 2004-02-27 Fernando Perez <fperez@colorado.edu>
4751 2004-02-27 Fernando Perez <fperez@colorado.edu>
4743
4752
4744 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4753 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4745 mode would behave erratically. Also increased the number of
4754 mode would behave erratically. Also increased the number of
4746 possible logs in rotate mod to 999. Thanks to Rod Holland
4755 possible logs in rotate mod to 999. Thanks to Rod Holland
4747 <rhh@StructureLABS.com> for the report and fixes.
4756 <rhh@StructureLABS.com> for the report and fixes.
4748
4757
4749 2004-02-26 Fernando Perez <fperez@colorado.edu>
4758 2004-02-26 Fernando Perez <fperez@colorado.edu>
4750
4759
4751 * IPython/genutils.py (page): Check that the curses module really
4760 * IPython/genutils.py (page): Check that the curses module really
4752 has the initscr attribute before trying to use it. For some
4761 has the initscr attribute before trying to use it. For some
4753 reason, the Solaris curses module is missing this. I think this
4762 reason, the Solaris curses module is missing this. I think this
4754 should be considered a Solaris python bug, but I'm not sure.
4763 should be considered a Solaris python bug, but I'm not sure.
4755
4764
4756 2004-01-17 Fernando Perez <fperez@colorado.edu>
4765 2004-01-17 Fernando Perez <fperez@colorado.edu>
4757
4766
4758 * IPython/genutils.py (Stream.__init__): Changes to try to make
4767 * IPython/genutils.py (Stream.__init__): Changes to try to make
4759 ipython robust against stdin/out/err being closed by the user.
4768 ipython robust against stdin/out/err being closed by the user.
4760 This is 'user error' (and blocks a normal python session, at least
4769 This is 'user error' (and blocks a normal python session, at least
4761 the stdout case). However, Ipython should be able to survive such
4770 the stdout case). However, Ipython should be able to survive such
4762 instances of abuse as gracefully as possible. To simplify the
4771 instances of abuse as gracefully as possible. To simplify the
4763 coding and maintain compatibility with Gary Bishop's Term
4772 coding and maintain compatibility with Gary Bishop's Term
4764 contributions, I've made use of classmethods for this. I think
4773 contributions, I've made use of classmethods for this. I think
4765 this introduces a dependency on python 2.2.
4774 this introduces a dependency on python 2.2.
4766
4775
4767 2004-01-13 Fernando Perez <fperez@colorado.edu>
4776 2004-01-13 Fernando Perez <fperez@colorado.edu>
4768
4777
4769 * IPython/numutils.py (exp_safe): simplified the code a bit and
4778 * IPython/numutils.py (exp_safe): simplified the code a bit and
4770 removed the need for importing the kinds module altogether.
4779 removed the need for importing the kinds module altogether.
4771
4780
4772 2004-01-06 Fernando Perez <fperez@colorado.edu>
4781 2004-01-06 Fernando Perez <fperez@colorado.edu>
4773
4782
4774 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4783 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4775 a magic function instead, after some community feedback. No
4784 a magic function instead, after some community feedback. No
4776 special syntax will exist for it, but its name is deliberately
4785 special syntax will exist for it, but its name is deliberately
4777 very short.
4786 very short.
4778
4787
4779 2003-12-20 Fernando Perez <fperez@colorado.edu>
4788 2003-12-20 Fernando Perez <fperez@colorado.edu>
4780
4789
4781 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4790 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4782 new functionality, to automagically assign the result of a shell
4791 new functionality, to automagically assign the result of a shell
4783 command to a variable. I'll solicit some community feedback on
4792 command to a variable. I'll solicit some community feedback on
4784 this before making it permanent.
4793 this before making it permanent.
4785
4794
4786 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4795 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4787 requested about callables for which inspect couldn't obtain a
4796 requested about callables for which inspect couldn't obtain a
4788 proper argspec. Thanks to a crash report sent by Etienne
4797 proper argspec. Thanks to a crash report sent by Etienne
4789 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4798 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4790
4799
4791 2003-12-09 Fernando Perez <fperez@colorado.edu>
4800 2003-12-09 Fernando Perez <fperez@colorado.edu>
4792
4801
4793 * IPython/genutils.py (page): patch for the pager to work across
4802 * IPython/genutils.py (page): patch for the pager to work across
4794 various versions of Windows. By Gary Bishop.
4803 various versions of Windows. By Gary Bishop.
4795
4804
4796 2003-12-04 Fernando Perez <fperez@colorado.edu>
4805 2003-12-04 Fernando Perez <fperez@colorado.edu>
4797
4806
4798 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4807 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4799 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4808 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4800 While I tested this and it looks ok, there may still be corner
4809 While I tested this and it looks ok, there may still be corner
4801 cases I've missed.
4810 cases I've missed.
4802
4811
4803 2003-12-01 Fernando Perez <fperez@colorado.edu>
4812 2003-12-01 Fernando Perez <fperez@colorado.edu>
4804
4813
4805 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4814 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4806 where a line like 'p,q=1,2' would fail because the automagic
4815 where a line like 'p,q=1,2' would fail because the automagic
4807 system would be triggered for @p.
4816 system would be triggered for @p.
4808
4817
4809 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4818 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4810 cleanups, code unmodified.
4819 cleanups, code unmodified.
4811
4820
4812 * IPython/genutils.py (Term): added a class for IPython to handle
4821 * IPython/genutils.py (Term): added a class for IPython to handle
4813 output. In most cases it will just be a proxy for stdout/err, but
4822 output. In most cases it will just be a proxy for stdout/err, but
4814 having this allows modifications to be made for some platforms,
4823 having this allows modifications to be made for some platforms,
4815 such as handling color escapes under Windows. All of this code
4824 such as handling color escapes under Windows. All of this code
4816 was contributed by Gary Bishop, with minor modifications by me.
4825 was contributed by Gary Bishop, with minor modifications by me.
4817 The actual changes affect many files.
4826 The actual changes affect many files.
4818
4827
4819 2003-11-30 Fernando Perez <fperez@colorado.edu>
4828 2003-11-30 Fernando Perez <fperez@colorado.edu>
4820
4829
4821 * IPython/iplib.py (file_matches): new completion code, courtesy
4830 * IPython/iplib.py (file_matches): new completion code, courtesy
4822 of Jeff Collins. This enables filename completion again under
4831 of Jeff Collins. This enables filename completion again under
4823 python 2.3, which disabled it at the C level.
4832 python 2.3, which disabled it at the C level.
4824
4833
4825 2003-11-11 Fernando Perez <fperez@colorado.edu>
4834 2003-11-11 Fernando Perez <fperez@colorado.edu>
4826
4835
4827 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4836 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4828 for Numeric.array(map(...)), but often convenient.
4837 for Numeric.array(map(...)), but often convenient.
4829
4838
4830 2003-11-05 Fernando Perez <fperez@colorado.edu>
4839 2003-11-05 Fernando Perez <fperez@colorado.edu>
4831
4840
4832 * IPython/numutils.py (frange): Changed a call from int() to
4841 * IPython/numutils.py (frange): Changed a call from int() to
4833 int(round()) to prevent a problem reported with arange() in the
4842 int(round()) to prevent a problem reported with arange() in the
4834 numpy list.
4843 numpy list.
4835
4844
4836 2003-10-06 Fernando Perez <fperez@colorado.edu>
4845 2003-10-06 Fernando Perez <fperez@colorado.edu>
4837
4846
4838 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4847 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4839 prevent crashes if sys lacks an argv attribute (it happens with
4848 prevent crashes if sys lacks an argv attribute (it happens with
4840 embedded interpreters which build a bare-bones sys module).
4849 embedded interpreters which build a bare-bones sys module).
4841 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4850 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4842
4851
4843 2003-09-24 Fernando Perez <fperez@colorado.edu>
4852 2003-09-24 Fernando Perez <fperez@colorado.edu>
4844
4853
4845 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4854 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4846 to protect against poorly written user objects where __getattr__
4855 to protect against poorly written user objects where __getattr__
4847 raises exceptions other than AttributeError. Thanks to a bug
4856 raises exceptions other than AttributeError. Thanks to a bug
4848 report by Oliver Sander <osander-AT-gmx.de>.
4857 report by Oliver Sander <osander-AT-gmx.de>.
4849
4858
4850 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4859 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4851 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4860 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4852
4861
4853 2003-09-09 Fernando Perez <fperez@colorado.edu>
4862 2003-09-09 Fernando Perez <fperez@colorado.edu>
4854
4863
4855 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4864 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4856 unpacking a list whith a callable as first element would
4865 unpacking a list whith a callable as first element would
4857 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4866 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4858 Collins.
4867 Collins.
4859
4868
4860 2003-08-25 *** Released version 0.5.0
4869 2003-08-25 *** Released version 0.5.0
4861
4870
4862 2003-08-22 Fernando Perez <fperez@colorado.edu>
4871 2003-08-22 Fernando Perez <fperez@colorado.edu>
4863
4872
4864 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4873 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4865 improperly defined user exceptions. Thanks to feedback from Mark
4874 improperly defined user exceptions. Thanks to feedback from Mark
4866 Russell <mrussell-AT-verio.net>.
4875 Russell <mrussell-AT-verio.net>.
4867
4876
4868 2003-08-20 Fernando Perez <fperez@colorado.edu>
4877 2003-08-20 Fernando Perez <fperez@colorado.edu>
4869
4878
4870 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4879 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4871 printing so that it would print multi-line string forms starting
4880 printing so that it would print multi-line string forms starting
4872 with a new line. This way the formatting is better respected for
4881 with a new line. This way the formatting is better respected for
4873 objects which work hard to make nice string forms.
4882 objects which work hard to make nice string forms.
4874
4883
4875 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4884 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4876 autocall would overtake data access for objects with both
4885 autocall would overtake data access for objects with both
4877 __getitem__ and __call__.
4886 __getitem__ and __call__.
4878
4887
4879 2003-08-19 *** Released version 0.5.0-rc1
4888 2003-08-19 *** Released version 0.5.0-rc1
4880
4889
4881 2003-08-19 Fernando Perez <fperez@colorado.edu>
4890 2003-08-19 Fernando Perez <fperez@colorado.edu>
4882
4891
4883 * IPython/deep_reload.py (load_tail): single tiny change here
4892 * IPython/deep_reload.py (load_tail): single tiny change here
4884 seems to fix the long-standing bug of dreload() failing to work
4893 seems to fix the long-standing bug of dreload() failing to work
4885 for dotted names. But this module is pretty tricky, so I may have
4894 for dotted names. But this module is pretty tricky, so I may have
4886 missed some subtlety. Needs more testing!.
4895 missed some subtlety. Needs more testing!.
4887
4896
4888 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4897 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4889 exceptions which have badly implemented __str__ methods.
4898 exceptions which have badly implemented __str__ methods.
4890 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4899 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4891 which I've been getting reports about from Python 2.3 users. I
4900 which I've been getting reports about from Python 2.3 users. I
4892 wish I had a simple test case to reproduce the problem, so I could
4901 wish I had a simple test case to reproduce the problem, so I could
4893 either write a cleaner workaround or file a bug report if
4902 either write a cleaner workaround or file a bug report if
4894 necessary.
4903 necessary.
4895
4904
4896 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4905 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4897 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4906 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4898 a bug report by Tjabo Kloppenburg.
4907 a bug report by Tjabo Kloppenburg.
4899
4908
4900 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4909 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4901 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4910 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4902 seems rather unstable. Thanks to a bug report by Tjabo
4911 seems rather unstable. Thanks to a bug report by Tjabo
4903 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4912 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4904
4913
4905 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4914 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4906 this out soon because of the critical fixes in the inner loop for
4915 this out soon because of the critical fixes in the inner loop for
4907 generators.
4916 generators.
4908
4917
4909 * IPython/Magic.py (Magic.getargspec): removed. This (and
4918 * IPython/Magic.py (Magic.getargspec): removed. This (and
4910 _get_def) have been obsoleted by OInspect for a long time, I
4919 _get_def) have been obsoleted by OInspect for a long time, I
4911 hadn't noticed that they were dead code.
4920 hadn't noticed that they were dead code.
4912 (Magic._ofind): restored _ofind functionality for a few literals
4921 (Magic._ofind): restored _ofind functionality for a few literals
4913 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4922 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4914 for things like "hello".capitalize?, since that would require a
4923 for things like "hello".capitalize?, since that would require a
4915 potentially dangerous eval() again.
4924 potentially dangerous eval() again.
4916
4925
4917 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4926 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4918 logic a bit more to clean up the escapes handling and minimize the
4927 logic a bit more to clean up the escapes handling and minimize the
4919 use of _ofind to only necessary cases. The interactive 'feel' of
4928 use of _ofind to only necessary cases. The interactive 'feel' of
4920 IPython should have improved quite a bit with the changes in
4929 IPython should have improved quite a bit with the changes in
4921 _prefilter and _ofind (besides being far safer than before).
4930 _prefilter and _ofind (besides being far safer than before).
4922
4931
4923 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4932 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4924 obscure, never reported). Edit would fail to find the object to
4933 obscure, never reported). Edit would fail to find the object to
4925 edit under some circumstances.
4934 edit under some circumstances.
4926 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4935 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4927 which were causing double-calling of generators. Those eval calls
4936 which were causing double-calling of generators. Those eval calls
4928 were _very_ dangerous, since code with side effects could be
4937 were _very_ dangerous, since code with side effects could be
4929 triggered. As they say, 'eval is evil'... These were the
4938 triggered. As they say, 'eval is evil'... These were the
4930 nastiest evals in IPython. Besides, _ofind is now far simpler,
4939 nastiest evals in IPython. Besides, _ofind is now far simpler,
4931 and it should also be quite a bit faster. Its use of inspect is
4940 and it should also be quite a bit faster. Its use of inspect is
4932 also safer, so perhaps some of the inspect-related crashes I've
4941 also safer, so perhaps some of the inspect-related crashes I've
4933 seen lately with Python 2.3 might be taken care of. That will
4942 seen lately with Python 2.3 might be taken care of. That will
4934 need more testing.
4943 need more testing.
4935
4944
4936 2003-08-17 Fernando Perez <fperez@colorado.edu>
4945 2003-08-17 Fernando Perez <fperez@colorado.edu>
4937
4946
4938 * IPython/iplib.py (InteractiveShell._prefilter): significant
4947 * IPython/iplib.py (InteractiveShell._prefilter): significant
4939 simplifications to the logic for handling user escapes. Faster
4948 simplifications to the logic for handling user escapes. Faster
4940 and simpler code.
4949 and simpler code.
4941
4950
4942 2003-08-14 Fernando Perez <fperez@colorado.edu>
4951 2003-08-14 Fernando Perez <fperez@colorado.edu>
4943
4952
4944 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4953 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4945 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4954 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4946 but it should be quite a bit faster. And the recursive version
4955 but it should be quite a bit faster. And the recursive version
4947 generated O(log N) intermediate storage for all rank>1 arrays,
4956 generated O(log N) intermediate storage for all rank>1 arrays,
4948 even if they were contiguous.
4957 even if they were contiguous.
4949 (l1norm): Added this function.
4958 (l1norm): Added this function.
4950 (norm): Added this function for arbitrary norms (including
4959 (norm): Added this function for arbitrary norms (including
4951 l-infinity). l1 and l2 are still special cases for convenience
4960 l-infinity). l1 and l2 are still special cases for convenience
4952 and speed.
4961 and speed.
4953
4962
4954 2003-08-03 Fernando Perez <fperez@colorado.edu>
4963 2003-08-03 Fernando Perez <fperez@colorado.edu>
4955
4964
4956 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4965 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4957 exceptions, which now raise PendingDeprecationWarnings in Python
4966 exceptions, which now raise PendingDeprecationWarnings in Python
4958 2.3. There were some in Magic and some in Gnuplot2.
4967 2.3. There were some in Magic and some in Gnuplot2.
4959
4968
4960 2003-06-30 Fernando Perez <fperez@colorado.edu>
4969 2003-06-30 Fernando Perez <fperez@colorado.edu>
4961
4970
4962 * IPython/genutils.py (page): modified to call curses only for
4971 * IPython/genutils.py (page): modified to call curses only for
4963 terminals where TERM=='xterm'. After problems under many other
4972 terminals where TERM=='xterm'. After problems under many other
4964 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4973 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4965
4974
4966 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4975 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4967 would be triggered when readline was absent. This was just an old
4976 would be triggered when readline was absent. This was just an old
4968 debugging statement I'd forgotten to take out.
4977 debugging statement I'd forgotten to take out.
4969
4978
4970 2003-06-20 Fernando Perez <fperez@colorado.edu>
4979 2003-06-20 Fernando Perez <fperez@colorado.edu>
4971
4980
4972 * IPython/genutils.py (clock): modified to return only user time
4981 * IPython/genutils.py (clock): modified to return only user time
4973 (not counting system time), after a discussion on scipy. While
4982 (not counting system time), after a discussion on scipy. While
4974 system time may be a useful quantity occasionally, it may much
4983 system time may be a useful quantity occasionally, it may much
4975 more easily be skewed by occasional swapping or other similar
4984 more easily be skewed by occasional swapping or other similar
4976 activity.
4985 activity.
4977
4986
4978 2003-06-05 Fernando Perez <fperez@colorado.edu>
4987 2003-06-05 Fernando Perez <fperez@colorado.edu>
4979
4988
4980 * IPython/numutils.py (identity): new function, for building
4989 * IPython/numutils.py (identity): new function, for building
4981 arbitrary rank Kronecker deltas (mostly backwards compatible with
4990 arbitrary rank Kronecker deltas (mostly backwards compatible with
4982 Numeric.identity)
4991 Numeric.identity)
4983
4992
4984 2003-06-03 Fernando Perez <fperez@colorado.edu>
4993 2003-06-03 Fernando Perez <fperez@colorado.edu>
4985
4994
4986 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4995 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4987 arguments passed to magics with spaces, to allow trailing '\' to
4996 arguments passed to magics with spaces, to allow trailing '\' to
4988 work normally (mainly for Windows users).
4997 work normally (mainly for Windows users).
4989
4998
4990 2003-05-29 Fernando Perez <fperez@colorado.edu>
4999 2003-05-29 Fernando Perez <fperez@colorado.edu>
4991
5000
4992 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
5001 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4993 instead of pydoc.help. This fixes a bizarre behavior where
5002 instead of pydoc.help. This fixes a bizarre behavior where
4994 printing '%s' % locals() would trigger the help system. Now
5003 printing '%s' % locals() would trigger the help system. Now
4995 ipython behaves like normal python does.
5004 ipython behaves like normal python does.
4996
5005
4997 Note that if one does 'from pydoc import help', the bizarre
5006 Note that if one does 'from pydoc import help', the bizarre
4998 behavior returns, but this will also happen in normal python, so
5007 behavior returns, but this will also happen in normal python, so
4999 it's not an ipython bug anymore (it has to do with how pydoc.help
5008 it's not an ipython bug anymore (it has to do with how pydoc.help
5000 is implemented).
5009 is implemented).
5001
5010
5002 2003-05-22 Fernando Perez <fperez@colorado.edu>
5011 2003-05-22 Fernando Perez <fperez@colorado.edu>
5003
5012
5004 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
5013 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
5005 return [] instead of None when nothing matches, also match to end
5014 return [] instead of None when nothing matches, also match to end
5006 of line. Patch by Gary Bishop.
5015 of line. Patch by Gary Bishop.
5007
5016
5008 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
5017 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
5009 protection as before, for files passed on the command line. This
5018 protection as before, for files passed on the command line. This
5010 prevents the CrashHandler from kicking in if user files call into
5019 prevents the CrashHandler from kicking in if user files call into
5011 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
5020 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
5012 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
5021 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
5013
5022
5014 2003-05-20 *** Released version 0.4.0
5023 2003-05-20 *** Released version 0.4.0
5015
5024
5016 2003-05-20 Fernando Perez <fperez@colorado.edu>
5025 2003-05-20 Fernando Perez <fperez@colorado.edu>
5017
5026
5018 * setup.py: added support for manpages. It's a bit hackish b/c of
5027 * setup.py: added support for manpages. It's a bit hackish b/c of
5019 a bug in the way the bdist_rpm distutils target handles gzipped
5028 a bug in the way the bdist_rpm distutils target handles gzipped
5020 manpages, but it works. After a patch by Jack.
5029 manpages, but it works. After a patch by Jack.
5021
5030
5022 2003-05-19 Fernando Perez <fperez@colorado.edu>
5031 2003-05-19 Fernando Perez <fperez@colorado.edu>
5023
5032
5024 * IPython/numutils.py: added a mockup of the kinds module, since
5033 * IPython/numutils.py: added a mockup of the kinds module, since
5025 it was recently removed from Numeric. This way, numutils will
5034 it was recently removed from Numeric. This way, numutils will
5026 work for all users even if they are missing kinds.
5035 work for all users even if they are missing kinds.
5027
5036
5028 * IPython/Magic.py (Magic._ofind): Harden against an inspect
5037 * IPython/Magic.py (Magic._ofind): Harden against an inspect
5029 failure, which can occur with SWIG-wrapped extensions. After a
5038 failure, which can occur with SWIG-wrapped extensions. After a
5030 crash report from Prabhu.
5039 crash report from Prabhu.
5031
5040
5032 2003-05-16 Fernando Perez <fperez@colorado.edu>
5041 2003-05-16 Fernando Perez <fperez@colorado.edu>
5033
5042
5034 * IPython/iplib.py (InteractiveShell.excepthook): New method to
5043 * IPython/iplib.py (InteractiveShell.excepthook): New method to
5035 protect ipython from user code which may call directly
5044 protect ipython from user code which may call directly
5036 sys.excepthook (this looks like an ipython crash to the user, even
5045 sys.excepthook (this looks like an ipython crash to the user, even
5037 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5046 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5038 This is especially important to help users of WxWindows, but may
5047 This is especially important to help users of WxWindows, but may
5039 also be useful in other cases.
5048 also be useful in other cases.
5040
5049
5041 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
5050 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
5042 an optional tb_offset to be specified, and to preserve exception
5051 an optional tb_offset to be specified, and to preserve exception
5043 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5052 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5044
5053
5045 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
5054 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
5046
5055
5047 2003-05-15 Fernando Perez <fperez@colorado.edu>
5056 2003-05-15 Fernando Perez <fperez@colorado.edu>
5048
5057
5049 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
5058 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
5050 installing for a new user under Windows.
5059 installing for a new user under Windows.
5051
5060
5052 2003-05-12 Fernando Perez <fperez@colorado.edu>
5061 2003-05-12 Fernando Perez <fperez@colorado.edu>
5053
5062
5054 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
5063 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
5055 handler for Emacs comint-based lines. Currently it doesn't do
5064 handler for Emacs comint-based lines. Currently it doesn't do
5056 much (but importantly, it doesn't update the history cache). In
5065 much (but importantly, it doesn't update the history cache). In
5057 the future it may be expanded if Alex needs more functionality
5066 the future it may be expanded if Alex needs more functionality
5058 there.
5067 there.
5059
5068
5060 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
5069 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
5061 info to crash reports.
5070 info to crash reports.
5062
5071
5063 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5072 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5064 just like Python's -c. Also fixed crash with invalid -color
5073 just like Python's -c. Also fixed crash with invalid -color
5065 option value at startup. Thanks to Will French
5074 option value at startup. Thanks to Will French
5066 <wfrench-AT-bestweb.net> for the bug report.
5075 <wfrench-AT-bestweb.net> for the bug report.
5067
5076
5068 2003-05-09 Fernando Perez <fperez@colorado.edu>
5077 2003-05-09 Fernando Perez <fperez@colorado.edu>
5069
5078
5070 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5079 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5071 to EvalDict (it's a mapping, after all) and simplified its code
5080 to EvalDict (it's a mapping, after all) and simplified its code
5072 quite a bit, after a nice discussion on c.l.py where Gustavo
5081 quite a bit, after a nice discussion on c.l.py where Gustavo
5073 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
5082 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
5074
5083
5075 2003-04-30 Fernando Perez <fperez@colorado.edu>
5084 2003-04-30 Fernando Perez <fperez@colorado.edu>
5076
5085
5077 * IPython/genutils.py (timings_out): modified it to reduce its
5086 * IPython/genutils.py (timings_out): modified it to reduce its
5078 overhead in the common reps==1 case.
5087 overhead in the common reps==1 case.
5079
5088
5080 2003-04-29 Fernando Perez <fperez@colorado.edu>
5089 2003-04-29 Fernando Perez <fperez@colorado.edu>
5081
5090
5082 * IPython/genutils.py (timings_out): Modified to use the resource
5091 * IPython/genutils.py (timings_out): Modified to use the resource
5083 module, which avoids the wraparound problems of time.clock().
5092 module, which avoids the wraparound problems of time.clock().
5084
5093
5085 2003-04-17 *** Released version 0.2.15pre4
5094 2003-04-17 *** Released version 0.2.15pre4
5086
5095
5087 2003-04-17 Fernando Perez <fperez@colorado.edu>
5096 2003-04-17 Fernando Perez <fperez@colorado.edu>
5088
5097
5089 * setup.py (scriptfiles): Split windows-specific stuff over to a
5098 * setup.py (scriptfiles): Split windows-specific stuff over to a
5090 separate file, in an attempt to have a Windows GUI installer.
5099 separate file, in an attempt to have a Windows GUI installer.
5091 That didn't work, but part of the groundwork is done.
5100 That didn't work, but part of the groundwork is done.
5092
5101
5093 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5102 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5094 indent/unindent with 4 spaces. Particularly useful in combination
5103 indent/unindent with 4 spaces. Particularly useful in combination
5095 with the new auto-indent option.
5104 with the new auto-indent option.
5096
5105
5097 2003-04-16 Fernando Perez <fperez@colorado.edu>
5106 2003-04-16 Fernando Perez <fperez@colorado.edu>
5098
5107
5099 * IPython/Magic.py: various replacements of self.rc for
5108 * IPython/Magic.py: various replacements of self.rc for
5100 self.shell.rc. A lot more remains to be done to fully disentangle
5109 self.shell.rc. A lot more remains to be done to fully disentangle
5101 this class from the main Shell class.
5110 this class from the main Shell class.
5102
5111
5103 * IPython/GnuplotRuntime.py: added checks for mouse support so
5112 * IPython/GnuplotRuntime.py: added checks for mouse support so
5104 that we don't try to enable it if the current gnuplot doesn't
5113 that we don't try to enable it if the current gnuplot doesn't
5105 really support it. Also added checks so that we don't try to
5114 really support it. Also added checks so that we don't try to
5106 enable persist under Windows (where Gnuplot doesn't recognize the
5115 enable persist under Windows (where Gnuplot doesn't recognize the
5107 option).
5116 option).
5108
5117
5109 * IPython/iplib.py (InteractiveShell.interact): Added optional
5118 * IPython/iplib.py (InteractiveShell.interact): Added optional
5110 auto-indenting code, after a patch by King C. Shu
5119 auto-indenting code, after a patch by King C. Shu
5111 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5120 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5112 get along well with pasting indented code. If I ever figure out
5121 get along well with pasting indented code. If I ever figure out
5113 how to make that part go well, it will become on by default.
5122 how to make that part go well, it will become on by default.
5114
5123
5115 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5124 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5116 crash ipython if there was an unmatched '%' in the user's prompt
5125 crash ipython if there was an unmatched '%' in the user's prompt
5117 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5126 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5118
5127
5119 * IPython/iplib.py (InteractiveShell.interact): removed the
5128 * IPython/iplib.py (InteractiveShell.interact): removed the
5120 ability to ask the user whether he wants to crash or not at the
5129 ability to ask the user whether he wants to crash or not at the
5121 'last line' exception handler. Calling functions at that point
5130 'last line' exception handler. Calling functions at that point
5122 changes the stack, and the error reports would have incorrect
5131 changes the stack, and the error reports would have incorrect
5123 tracebacks.
5132 tracebacks.
5124
5133
5125 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5134 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5126 pass through a peger a pretty-printed form of any object. After a
5135 pass through a peger a pretty-printed form of any object. After a
5127 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5136 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5128
5137
5129 2003-04-14 Fernando Perez <fperez@colorado.edu>
5138 2003-04-14 Fernando Perez <fperez@colorado.edu>
5130
5139
5131 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5140 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5132 all files in ~ would be modified at first install (instead of
5141 all files in ~ would be modified at first install (instead of
5133 ~/.ipython). This could be potentially disastrous, as the
5142 ~/.ipython). This could be potentially disastrous, as the
5134 modification (make line-endings native) could damage binary files.
5143 modification (make line-endings native) could damage binary files.
5135
5144
5136 2003-04-10 Fernando Perez <fperez@colorado.edu>
5145 2003-04-10 Fernando Perez <fperez@colorado.edu>
5137
5146
5138 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5147 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5139 handle only lines which are invalid python. This now means that
5148 handle only lines which are invalid python. This now means that
5140 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5149 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5141 for the bug report.
5150 for the bug report.
5142
5151
5143 2003-04-01 Fernando Perez <fperez@colorado.edu>
5152 2003-04-01 Fernando Perez <fperez@colorado.edu>
5144
5153
5145 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5154 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5146 where failing to set sys.last_traceback would crash pdb.pm().
5155 where failing to set sys.last_traceback would crash pdb.pm().
5147 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5156 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5148 report.
5157 report.
5149
5158
5150 2003-03-25 Fernando Perez <fperez@colorado.edu>
5159 2003-03-25 Fernando Perez <fperez@colorado.edu>
5151
5160
5152 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5161 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5153 before printing it (it had a lot of spurious blank lines at the
5162 before printing it (it had a lot of spurious blank lines at the
5154 end).
5163 end).
5155
5164
5156 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5165 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5157 output would be sent 21 times! Obviously people don't use this
5166 output would be sent 21 times! Obviously people don't use this
5158 too often, or I would have heard about it.
5167 too often, or I would have heard about it.
5159
5168
5160 2003-03-24 Fernando Perez <fperez@colorado.edu>
5169 2003-03-24 Fernando Perez <fperez@colorado.edu>
5161
5170
5162 * setup.py (scriptfiles): renamed the data_files parameter from
5171 * setup.py (scriptfiles): renamed the data_files parameter from
5163 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5172 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5164 for the patch.
5173 for the patch.
5165
5174
5166 2003-03-20 Fernando Perez <fperez@colorado.edu>
5175 2003-03-20 Fernando Perez <fperez@colorado.edu>
5167
5176
5168 * IPython/genutils.py (error): added error() and fatal()
5177 * IPython/genutils.py (error): added error() and fatal()
5169 functions.
5178 functions.
5170
5179
5171 2003-03-18 *** Released version 0.2.15pre3
5180 2003-03-18 *** Released version 0.2.15pre3
5172
5181
5173 2003-03-18 Fernando Perez <fperez@colorado.edu>
5182 2003-03-18 Fernando Perez <fperez@colorado.edu>
5174
5183
5175 * setupext/install_data_ext.py
5184 * setupext/install_data_ext.py
5176 (install_data_ext.initialize_options): Class contributed by Jack
5185 (install_data_ext.initialize_options): Class contributed by Jack
5177 Moffit for fixing the old distutils hack. He is sending this to
5186 Moffit for fixing the old distutils hack. He is sending this to
5178 the distutils folks so in the future we may not need it as a
5187 the distutils folks so in the future we may not need it as a
5179 private fix.
5188 private fix.
5180
5189
5181 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5190 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5182 changes for Debian packaging. See his patch for full details.
5191 changes for Debian packaging. See his patch for full details.
5183 The old distutils hack of making the ipythonrc* files carry a
5192 The old distutils hack of making the ipythonrc* files carry a
5184 bogus .py extension is gone, at last. Examples were moved to a
5193 bogus .py extension is gone, at last. Examples were moved to a
5185 separate subdir under doc/, and the separate executable scripts
5194 separate subdir under doc/, and the separate executable scripts
5186 now live in their own directory. Overall a great cleanup. The
5195 now live in their own directory. Overall a great cleanup. The
5187 manual was updated to use the new files, and setup.py has been
5196 manual was updated to use the new files, and setup.py has been
5188 fixed for this setup.
5197 fixed for this setup.
5189
5198
5190 * IPython/PyColorize.py (Parser.usage): made non-executable and
5199 * IPython/PyColorize.py (Parser.usage): made non-executable and
5191 created a pycolor wrapper around it to be included as a script.
5200 created a pycolor wrapper around it to be included as a script.
5192
5201
5193 2003-03-12 *** Released version 0.2.15pre2
5202 2003-03-12 *** Released version 0.2.15pre2
5194
5203
5195 2003-03-12 Fernando Perez <fperez@colorado.edu>
5204 2003-03-12 Fernando Perez <fperez@colorado.edu>
5196
5205
5197 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5206 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5198 long-standing problem with garbage characters in some terminals.
5207 long-standing problem with garbage characters in some terminals.
5199 The issue was really that the \001 and \002 escapes must _only_ be
5208 The issue was really that the \001 and \002 escapes must _only_ be
5200 passed to input prompts (which call readline), but _never_ to
5209 passed to input prompts (which call readline), but _never_ to
5201 normal text to be printed on screen. I changed ColorANSI to have
5210 normal text to be printed on screen. I changed ColorANSI to have
5202 two classes: TermColors and InputTermColors, each with the
5211 two classes: TermColors and InputTermColors, each with the
5203 appropriate escapes for input prompts or normal text. The code in
5212 appropriate escapes for input prompts or normal text. The code in
5204 Prompts.py got slightly more complicated, but this very old and
5213 Prompts.py got slightly more complicated, but this very old and
5205 annoying bug is finally fixed.
5214 annoying bug is finally fixed.
5206
5215
5207 All the credit for nailing down the real origin of this problem
5216 All the credit for nailing down the real origin of this problem
5208 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5217 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5209 *Many* thanks to him for spending quite a bit of effort on this.
5218 *Many* thanks to him for spending quite a bit of effort on this.
5210
5219
5211 2003-03-05 *** Released version 0.2.15pre1
5220 2003-03-05 *** Released version 0.2.15pre1
5212
5221
5213 2003-03-03 Fernando Perez <fperez@colorado.edu>
5222 2003-03-03 Fernando Perez <fperez@colorado.edu>
5214
5223
5215 * IPython/FakeModule.py: Moved the former _FakeModule to a
5224 * IPython/FakeModule.py: Moved the former _FakeModule to a
5216 separate file, because it's also needed by Magic (to fix a similar
5225 separate file, because it's also needed by Magic (to fix a similar
5217 pickle-related issue in @run).
5226 pickle-related issue in @run).
5218
5227
5219 2003-03-02 Fernando Perez <fperez@colorado.edu>
5228 2003-03-02 Fernando Perez <fperez@colorado.edu>
5220
5229
5221 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5230 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5222 the autocall option at runtime.
5231 the autocall option at runtime.
5223 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5232 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5224 across Magic.py to start separating Magic from InteractiveShell.
5233 across Magic.py to start separating Magic from InteractiveShell.
5225 (Magic._ofind): Fixed to return proper namespace for dotted
5234 (Magic._ofind): Fixed to return proper namespace for dotted
5226 names. Before, a dotted name would always return 'not currently
5235 names. Before, a dotted name would always return 'not currently
5227 defined', because it would find the 'parent'. s.x would be found,
5236 defined', because it would find the 'parent'. s.x would be found,
5228 but since 'x' isn't defined by itself, it would get confused.
5237 but since 'x' isn't defined by itself, it would get confused.
5229 (Magic.magic_run): Fixed pickling problems reported by Ralf
5238 (Magic.magic_run): Fixed pickling problems reported by Ralf
5230 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5239 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5231 that I'd used when Mike Heeter reported similar issues at the
5240 that I'd used when Mike Heeter reported similar issues at the
5232 top-level, but now for @run. It boils down to injecting the
5241 top-level, but now for @run. It boils down to injecting the
5233 namespace where code is being executed with something that looks
5242 namespace where code is being executed with something that looks
5234 enough like a module to fool pickle.dump(). Since a pickle stores
5243 enough like a module to fool pickle.dump(). Since a pickle stores
5235 a named reference to the importing module, we need this for
5244 a named reference to the importing module, we need this for
5236 pickles to save something sensible.
5245 pickles to save something sensible.
5237
5246
5238 * IPython/ipmaker.py (make_IPython): added an autocall option.
5247 * IPython/ipmaker.py (make_IPython): added an autocall option.
5239
5248
5240 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5249 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5241 the auto-eval code. Now autocalling is an option, and the code is
5250 the auto-eval code. Now autocalling is an option, and the code is
5242 also vastly safer. There is no more eval() involved at all.
5251 also vastly safer. There is no more eval() involved at all.
5243
5252
5244 2003-03-01 Fernando Perez <fperez@colorado.edu>
5253 2003-03-01 Fernando Perez <fperez@colorado.edu>
5245
5254
5246 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5255 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5247 dict with named keys instead of a tuple.
5256 dict with named keys instead of a tuple.
5248
5257
5249 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5258 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5250
5259
5251 * setup.py (make_shortcut): Fixed message about directories
5260 * setup.py (make_shortcut): Fixed message about directories
5252 created during Windows installation (the directories were ok, just
5261 created during Windows installation (the directories were ok, just
5253 the printed message was misleading). Thanks to Chris Liechti
5262 the printed message was misleading). Thanks to Chris Liechti
5254 <cliechti-AT-gmx.net> for the heads up.
5263 <cliechti-AT-gmx.net> for the heads up.
5255
5264
5256 2003-02-21 Fernando Perez <fperez@colorado.edu>
5265 2003-02-21 Fernando Perez <fperez@colorado.edu>
5257
5266
5258 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5267 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5259 of ValueError exception when checking for auto-execution. This
5268 of ValueError exception when checking for auto-execution. This
5260 one is raised by things like Numeric arrays arr.flat when the
5269 one is raised by things like Numeric arrays arr.flat when the
5261 array is non-contiguous.
5270 array is non-contiguous.
5262
5271
5263 2003-01-31 Fernando Perez <fperez@colorado.edu>
5272 2003-01-31 Fernando Perez <fperez@colorado.edu>
5264
5273
5265 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5274 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5266 not return any value at all (even though the command would get
5275 not return any value at all (even though the command would get
5267 executed).
5276 executed).
5268 (xsys): Flush stdout right after printing the command to ensure
5277 (xsys): Flush stdout right after printing the command to ensure
5269 proper ordering of commands and command output in the total
5278 proper ordering of commands and command output in the total
5270 output.
5279 output.
5271 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5280 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5272 system/getoutput as defaults. The old ones are kept for
5281 system/getoutput as defaults. The old ones are kept for
5273 compatibility reasons, so no code which uses this library needs
5282 compatibility reasons, so no code which uses this library needs
5274 changing.
5283 changing.
5275
5284
5276 2003-01-27 *** Released version 0.2.14
5285 2003-01-27 *** Released version 0.2.14
5277
5286
5278 2003-01-25 Fernando Perez <fperez@colorado.edu>
5287 2003-01-25 Fernando Perez <fperez@colorado.edu>
5279
5288
5280 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5289 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5281 functions defined in previous edit sessions could not be re-edited
5290 functions defined in previous edit sessions could not be re-edited
5282 (because the temp files were immediately removed). Now temp files
5291 (because the temp files were immediately removed). Now temp files
5283 are removed only at IPython's exit.
5292 are removed only at IPython's exit.
5284 (Magic.magic_run): Improved @run to perform shell-like expansions
5293 (Magic.magic_run): Improved @run to perform shell-like expansions
5285 on its arguments (~users and $VARS). With this, @run becomes more
5294 on its arguments (~users and $VARS). With this, @run becomes more
5286 like a normal command-line.
5295 like a normal command-line.
5287
5296
5288 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5297 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5289 bugs related to embedding and cleaned up that code. A fairly
5298 bugs related to embedding and cleaned up that code. A fairly
5290 important one was the impossibility to access the global namespace
5299 important one was the impossibility to access the global namespace
5291 through the embedded IPython (only local variables were visible).
5300 through the embedded IPython (only local variables were visible).
5292
5301
5293 2003-01-14 Fernando Perez <fperez@colorado.edu>
5302 2003-01-14 Fernando Perez <fperez@colorado.edu>
5294
5303
5295 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5304 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5296 auto-calling to be a bit more conservative. Now it doesn't get
5305 auto-calling to be a bit more conservative. Now it doesn't get
5297 triggered if any of '!=()<>' are in the rest of the input line, to
5306 triggered if any of '!=()<>' are in the rest of the input line, to
5298 allow comparing callables. Thanks to Alex for the heads up.
5307 allow comparing callables. Thanks to Alex for the heads up.
5299
5308
5300 2003-01-07 Fernando Perez <fperez@colorado.edu>
5309 2003-01-07 Fernando Perez <fperez@colorado.edu>
5301
5310
5302 * IPython/genutils.py (page): fixed estimation of the number of
5311 * IPython/genutils.py (page): fixed estimation of the number of
5303 lines in a string to be paged to simply count newlines. This
5312 lines in a string to be paged to simply count newlines. This
5304 prevents over-guessing due to embedded escape sequences. A better
5313 prevents over-guessing due to embedded escape sequences. A better
5305 long-term solution would involve stripping out the control chars
5314 long-term solution would involve stripping out the control chars
5306 for the count, but it's potentially so expensive I just don't
5315 for the count, but it's potentially so expensive I just don't
5307 think it's worth doing.
5316 think it's worth doing.
5308
5317
5309 2002-12-19 *** Released version 0.2.14pre50
5318 2002-12-19 *** Released version 0.2.14pre50
5310
5319
5311 2002-12-19 Fernando Perez <fperez@colorado.edu>
5320 2002-12-19 Fernando Perez <fperez@colorado.edu>
5312
5321
5313 * tools/release (version): Changed release scripts to inform
5322 * tools/release (version): Changed release scripts to inform
5314 Andrea and build a NEWS file with a list of recent changes.
5323 Andrea and build a NEWS file with a list of recent changes.
5315
5324
5316 * IPython/ColorANSI.py (__all__): changed terminal detection
5325 * IPython/ColorANSI.py (__all__): changed terminal detection
5317 code. Seems to work better for xterms without breaking
5326 code. Seems to work better for xterms without breaking
5318 konsole. Will need more testing to determine if WinXP and Mac OSX
5327 konsole. Will need more testing to determine if WinXP and Mac OSX
5319 also work ok.
5328 also work ok.
5320
5329
5321 2002-12-18 *** Released version 0.2.14pre49
5330 2002-12-18 *** Released version 0.2.14pre49
5322
5331
5323 2002-12-18 Fernando Perez <fperez@colorado.edu>
5332 2002-12-18 Fernando Perez <fperez@colorado.edu>
5324
5333
5325 * Docs: added new info about Mac OSX, from Andrea.
5334 * Docs: added new info about Mac OSX, from Andrea.
5326
5335
5327 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5336 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5328 allow direct plotting of python strings whose format is the same
5337 allow direct plotting of python strings whose format is the same
5329 of gnuplot data files.
5338 of gnuplot data files.
5330
5339
5331 2002-12-16 Fernando Perez <fperez@colorado.edu>
5340 2002-12-16 Fernando Perez <fperez@colorado.edu>
5332
5341
5333 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5342 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5334 value of exit question to be acknowledged.
5343 value of exit question to be acknowledged.
5335
5344
5336 2002-12-03 Fernando Perez <fperez@colorado.edu>
5345 2002-12-03 Fernando Perez <fperez@colorado.edu>
5337
5346
5338 * IPython/ipmaker.py: removed generators, which had been added
5347 * IPython/ipmaker.py: removed generators, which had been added
5339 by mistake in an earlier debugging run. This was causing trouble
5348 by mistake in an earlier debugging run. This was causing trouble
5340 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5349 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5341 for pointing this out.
5350 for pointing this out.
5342
5351
5343 2002-11-17 Fernando Perez <fperez@colorado.edu>
5352 2002-11-17 Fernando Perez <fperez@colorado.edu>
5344
5353
5345 * Manual: updated the Gnuplot section.
5354 * Manual: updated the Gnuplot section.
5346
5355
5347 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5356 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5348 a much better split of what goes in Runtime and what goes in
5357 a much better split of what goes in Runtime and what goes in
5349 Interactive.
5358 Interactive.
5350
5359
5351 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5360 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5352 being imported from iplib.
5361 being imported from iplib.
5353
5362
5354 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5363 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5355 for command-passing. Now the global Gnuplot instance is called
5364 for command-passing. Now the global Gnuplot instance is called
5356 'gp' instead of 'g', which was really a far too fragile and
5365 'gp' instead of 'g', which was really a far too fragile and
5357 common name.
5366 common name.
5358
5367
5359 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5368 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5360 bounding boxes generated by Gnuplot for square plots.
5369 bounding boxes generated by Gnuplot for square plots.
5361
5370
5362 * IPython/genutils.py (popkey): new function added. I should
5371 * IPython/genutils.py (popkey): new function added. I should
5363 suggest this on c.l.py as a dict method, it seems useful.
5372 suggest this on c.l.py as a dict method, it seems useful.
5364
5373
5365 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5374 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5366 to transparently handle PostScript generation. MUCH better than
5375 to transparently handle PostScript generation. MUCH better than
5367 the previous plot_eps/replot_eps (which I removed now). The code
5376 the previous plot_eps/replot_eps (which I removed now). The code
5368 is also fairly clean and well documented now (including
5377 is also fairly clean and well documented now (including
5369 docstrings).
5378 docstrings).
5370
5379
5371 2002-11-13 Fernando Perez <fperez@colorado.edu>
5380 2002-11-13 Fernando Perez <fperez@colorado.edu>
5372
5381
5373 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5382 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5374 (inconsistent with options).
5383 (inconsistent with options).
5375
5384
5376 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5385 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5377 manually disabled, I don't know why. Fixed it.
5386 manually disabled, I don't know why. Fixed it.
5378 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5387 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5379 eps output.
5388 eps output.
5380
5389
5381 2002-11-12 Fernando Perez <fperez@colorado.edu>
5390 2002-11-12 Fernando Perez <fperez@colorado.edu>
5382
5391
5383 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5392 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5384 don't propagate up to caller. Fixes crash reported by François
5393 don't propagate up to caller. Fixes crash reported by François
5385 Pinard.
5394 Pinard.
5386
5395
5387 2002-11-09 Fernando Perez <fperez@colorado.edu>
5396 2002-11-09 Fernando Perez <fperez@colorado.edu>
5388
5397
5389 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5398 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5390 history file for new users.
5399 history file for new users.
5391 (make_IPython): fixed bug where initial install would leave the
5400 (make_IPython): fixed bug where initial install would leave the
5392 user running in the .ipython dir.
5401 user running in the .ipython dir.
5393 (make_IPython): fixed bug where config dir .ipython would be
5402 (make_IPython): fixed bug where config dir .ipython would be
5394 created regardless of the given -ipythondir option. Thanks to Cory
5403 created regardless of the given -ipythondir option. Thanks to Cory
5395 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5404 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5396
5405
5397 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5406 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5398 type confirmations. Will need to use it in all of IPython's code
5407 type confirmations. Will need to use it in all of IPython's code
5399 consistently.
5408 consistently.
5400
5409
5401 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5410 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5402 context to print 31 lines instead of the default 5. This will make
5411 context to print 31 lines instead of the default 5. This will make
5403 the crash reports extremely detailed in case the problem is in
5412 the crash reports extremely detailed in case the problem is in
5404 libraries I don't have access to.
5413 libraries I don't have access to.
5405
5414
5406 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5415 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5407 line of defense' code to still crash, but giving users fair
5416 line of defense' code to still crash, but giving users fair
5408 warning. I don't want internal errors to go unreported: if there's
5417 warning. I don't want internal errors to go unreported: if there's
5409 an internal problem, IPython should crash and generate a full
5418 an internal problem, IPython should crash and generate a full
5410 report.
5419 report.
5411
5420
5412 2002-11-08 Fernando Perez <fperez@colorado.edu>
5421 2002-11-08 Fernando Perez <fperez@colorado.edu>
5413
5422
5414 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5423 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5415 otherwise uncaught exceptions which can appear if people set
5424 otherwise uncaught exceptions which can appear if people set
5416 sys.stdout to something badly broken. Thanks to a crash report
5425 sys.stdout to something badly broken. Thanks to a crash report
5417 from henni-AT-mail.brainbot.com.
5426 from henni-AT-mail.brainbot.com.
5418
5427
5419 2002-11-04 Fernando Perez <fperez@colorado.edu>
5428 2002-11-04 Fernando Perez <fperez@colorado.edu>
5420
5429
5421 * IPython/iplib.py (InteractiveShell.interact): added
5430 * IPython/iplib.py (InteractiveShell.interact): added
5422 __IPYTHON__active to the builtins. It's a flag which goes on when
5431 __IPYTHON__active to the builtins. It's a flag which goes on when
5423 the interaction starts and goes off again when it stops. This
5432 the interaction starts and goes off again when it stops. This
5424 allows embedding code to detect being inside IPython. Before this
5433 allows embedding code to detect being inside IPython. Before this
5425 was done via __IPYTHON__, but that only shows that an IPython
5434 was done via __IPYTHON__, but that only shows that an IPython
5426 instance has been created.
5435 instance has been created.
5427
5436
5428 * IPython/Magic.py (Magic.magic_env): I realized that in a
5437 * IPython/Magic.py (Magic.magic_env): I realized that in a
5429 UserDict, instance.data holds the data as a normal dict. So I
5438 UserDict, instance.data holds the data as a normal dict. So I
5430 modified @env to return os.environ.data instead of rebuilding a
5439 modified @env to return os.environ.data instead of rebuilding a
5431 dict by hand.
5440 dict by hand.
5432
5441
5433 2002-11-02 Fernando Perez <fperez@colorado.edu>
5442 2002-11-02 Fernando Perez <fperez@colorado.edu>
5434
5443
5435 * IPython/genutils.py (warn): changed so that level 1 prints no
5444 * IPython/genutils.py (warn): changed so that level 1 prints no
5436 header. Level 2 is now the default (with 'WARNING' header, as
5445 header. Level 2 is now the default (with 'WARNING' header, as
5437 before). I think I tracked all places where changes were needed in
5446 before). I think I tracked all places where changes were needed in
5438 IPython, but outside code using the old level numbering may have
5447 IPython, but outside code using the old level numbering may have
5439 broken.
5448 broken.
5440
5449
5441 * IPython/iplib.py (InteractiveShell.runcode): added this to
5450 * IPython/iplib.py (InteractiveShell.runcode): added this to
5442 handle the tracebacks in SystemExit traps correctly. The previous
5451 handle the tracebacks in SystemExit traps correctly. The previous
5443 code (through interact) was printing more of the stack than
5452 code (through interact) was printing more of the stack than
5444 necessary, showing IPython internal code to the user.
5453 necessary, showing IPython internal code to the user.
5445
5454
5446 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5455 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5447 default. Now that the default at the confirmation prompt is yes,
5456 default. Now that the default at the confirmation prompt is yes,
5448 it's not so intrusive. François' argument that ipython sessions
5457 it's not so intrusive. François' argument that ipython sessions
5449 tend to be complex enough not to lose them from an accidental C-d,
5458 tend to be complex enough not to lose them from an accidental C-d,
5450 is a valid one.
5459 is a valid one.
5451
5460
5452 * IPython/iplib.py (InteractiveShell.interact): added a
5461 * IPython/iplib.py (InteractiveShell.interact): added a
5453 showtraceback() call to the SystemExit trap, and modified the exit
5462 showtraceback() call to the SystemExit trap, and modified the exit
5454 confirmation to have yes as the default.
5463 confirmation to have yes as the default.
5455
5464
5456 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5465 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5457 this file. It's been gone from the code for a long time, this was
5466 this file. It's been gone from the code for a long time, this was
5458 simply leftover junk.
5467 simply leftover junk.
5459
5468
5460 2002-11-01 Fernando Perez <fperez@colorado.edu>
5469 2002-11-01 Fernando Perez <fperez@colorado.edu>
5461
5470
5462 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5471 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5463 added. If set, IPython now traps EOF and asks for
5472 added. If set, IPython now traps EOF and asks for
5464 confirmation. After a request by François Pinard.
5473 confirmation. After a request by François Pinard.
5465
5474
5466 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5475 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5467 of @abort, and with a new (better) mechanism for handling the
5476 of @abort, and with a new (better) mechanism for handling the
5468 exceptions.
5477 exceptions.
5469
5478
5470 2002-10-27 Fernando Perez <fperez@colorado.edu>
5479 2002-10-27 Fernando Perez <fperez@colorado.edu>
5471
5480
5472 * IPython/usage.py (__doc__): updated the --help information and
5481 * IPython/usage.py (__doc__): updated the --help information and
5473 the ipythonrc file to indicate that -log generates
5482 the ipythonrc file to indicate that -log generates
5474 ./ipython.log. Also fixed the corresponding info in @logstart.
5483 ./ipython.log. Also fixed the corresponding info in @logstart.
5475 This and several other fixes in the manuals thanks to reports by
5484 This and several other fixes in the manuals thanks to reports by
5476 François Pinard <pinard-AT-iro.umontreal.ca>.
5485 François Pinard <pinard-AT-iro.umontreal.ca>.
5477
5486
5478 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5487 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5479 refer to @logstart (instead of @log, which doesn't exist).
5488 refer to @logstart (instead of @log, which doesn't exist).
5480
5489
5481 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5490 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5482 AttributeError crash. Thanks to Christopher Armstrong
5491 AttributeError crash. Thanks to Christopher Armstrong
5483 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5492 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5484 introduced recently (in 0.2.14pre37) with the fix to the eval
5493 introduced recently (in 0.2.14pre37) with the fix to the eval
5485 problem mentioned below.
5494 problem mentioned below.
5486
5495
5487 2002-10-17 Fernando Perez <fperez@colorado.edu>
5496 2002-10-17 Fernando Perez <fperez@colorado.edu>
5488
5497
5489 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5498 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5490 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5499 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5491
5500
5492 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5501 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5493 this function to fix a problem reported by Alex Schmolck. He saw
5502 this function to fix a problem reported by Alex Schmolck. He saw
5494 it with list comprehensions and generators, which were getting
5503 it with list comprehensions and generators, which were getting
5495 called twice. The real problem was an 'eval' call in testing for
5504 called twice. The real problem was an 'eval' call in testing for
5496 automagic which was evaluating the input line silently.
5505 automagic which was evaluating the input line silently.
5497
5506
5498 This is a potentially very nasty bug, if the input has side
5507 This is a potentially very nasty bug, if the input has side
5499 effects which must not be repeated. The code is much cleaner now,
5508 effects which must not be repeated. The code is much cleaner now,
5500 without any blanket 'except' left and with a regexp test for
5509 without any blanket 'except' left and with a regexp test for
5501 actual function names.
5510 actual function names.
5502
5511
5503 But an eval remains, which I'm not fully comfortable with. I just
5512 But an eval remains, which I'm not fully comfortable with. I just
5504 don't know how to find out if an expression could be a callable in
5513 don't know how to find out if an expression could be a callable in
5505 the user's namespace without doing an eval on the string. However
5514 the user's namespace without doing an eval on the string. However
5506 that string is now much more strictly checked so that no code
5515 that string is now much more strictly checked so that no code
5507 slips by, so the eval should only happen for things that can
5516 slips by, so the eval should only happen for things that can
5508 really be only function/method names.
5517 really be only function/method names.
5509
5518
5510 2002-10-15 Fernando Perez <fperez@colorado.edu>
5519 2002-10-15 Fernando Perez <fperez@colorado.edu>
5511
5520
5512 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5521 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5513 OSX information to main manual, removed README_Mac_OSX file from
5522 OSX information to main manual, removed README_Mac_OSX file from
5514 distribution. Also updated credits for recent additions.
5523 distribution. Also updated credits for recent additions.
5515
5524
5516 2002-10-10 Fernando Perez <fperez@colorado.edu>
5525 2002-10-10 Fernando Perez <fperez@colorado.edu>
5517
5526
5518 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5527 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5519 terminal-related issues. Many thanks to Andrea Riciputi
5528 terminal-related issues. Many thanks to Andrea Riciputi
5520 <andrea.riciputi-AT-libero.it> for writing it.
5529 <andrea.riciputi-AT-libero.it> for writing it.
5521
5530
5522 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5531 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5523 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5532 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5524
5533
5525 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5534 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5526 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5535 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5527 <syver-en-AT-online.no> who both submitted patches for this problem.
5536 <syver-en-AT-online.no> who both submitted patches for this problem.
5528
5537
5529 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5538 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5530 global embedding to make sure that things don't overwrite user
5539 global embedding to make sure that things don't overwrite user
5531 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5540 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5532
5541
5533 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5542 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5534 compatibility. Thanks to Hayden Callow
5543 compatibility. Thanks to Hayden Callow
5535 <h.callow-AT-elec.canterbury.ac.nz>
5544 <h.callow-AT-elec.canterbury.ac.nz>
5536
5545
5537 2002-10-04 Fernando Perez <fperez@colorado.edu>
5546 2002-10-04 Fernando Perez <fperez@colorado.edu>
5538
5547
5539 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5548 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5540 Gnuplot.File objects.
5549 Gnuplot.File objects.
5541
5550
5542 2002-07-23 Fernando Perez <fperez@colorado.edu>
5551 2002-07-23 Fernando Perez <fperez@colorado.edu>
5543
5552
5544 * IPython/genutils.py (timing): Added timings() and timing() for
5553 * IPython/genutils.py (timing): Added timings() and timing() for
5545 quick access to the most commonly needed data, the execution
5554 quick access to the most commonly needed data, the execution
5546 times. Old timing() renamed to timings_out().
5555 times. Old timing() renamed to timings_out().
5547
5556
5548 2002-07-18 Fernando Perez <fperez@colorado.edu>
5557 2002-07-18 Fernando Perez <fperez@colorado.edu>
5549
5558
5550 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5559 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5551 bug with nested instances disrupting the parent's tab completion.
5560 bug with nested instances disrupting the parent's tab completion.
5552
5561
5553 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5562 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5554 all_completions code to begin the emacs integration.
5563 all_completions code to begin the emacs integration.
5555
5564
5556 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5565 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5557 argument to allow titling individual arrays when plotting.
5566 argument to allow titling individual arrays when plotting.
5558
5567
5559 2002-07-15 Fernando Perez <fperez@colorado.edu>
5568 2002-07-15 Fernando Perez <fperez@colorado.edu>
5560
5569
5561 * setup.py (make_shortcut): changed to retrieve the value of
5570 * setup.py (make_shortcut): changed to retrieve the value of
5562 'Program Files' directory from the registry (this value changes in
5571 'Program Files' directory from the registry (this value changes in
5563 non-english versions of Windows). Thanks to Thomas Fanslau
5572 non-english versions of Windows). Thanks to Thomas Fanslau
5564 <tfanslau-AT-gmx.de> for the report.
5573 <tfanslau-AT-gmx.de> for the report.
5565
5574
5566 2002-07-10 Fernando Perez <fperez@colorado.edu>
5575 2002-07-10 Fernando Perez <fperez@colorado.edu>
5567
5576
5568 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5577 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5569 a bug in pdb, which crashes if a line with only whitespace is
5578 a bug in pdb, which crashes if a line with only whitespace is
5570 entered. Bug report submitted to sourceforge.
5579 entered. Bug report submitted to sourceforge.
5571
5580
5572 2002-07-09 Fernando Perez <fperez@colorado.edu>
5581 2002-07-09 Fernando Perez <fperez@colorado.edu>
5573
5582
5574 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5583 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5575 reporting exceptions (it's a bug in inspect.py, I just set a
5584 reporting exceptions (it's a bug in inspect.py, I just set a
5576 workaround).
5585 workaround).
5577
5586
5578 2002-07-08 Fernando Perez <fperez@colorado.edu>
5587 2002-07-08 Fernando Perez <fperez@colorado.edu>
5579
5588
5580 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5589 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5581 __IPYTHON__ in __builtins__ to show up in user_ns.
5590 __IPYTHON__ in __builtins__ to show up in user_ns.
5582
5591
5583 2002-07-03 Fernando Perez <fperez@colorado.edu>
5592 2002-07-03 Fernando Perez <fperez@colorado.edu>
5584
5593
5585 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5594 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5586 name from @gp_set_instance to @gp_set_default.
5595 name from @gp_set_instance to @gp_set_default.
5587
5596
5588 * IPython/ipmaker.py (make_IPython): default editor value set to
5597 * IPython/ipmaker.py (make_IPython): default editor value set to
5589 '0' (a string), to match the rc file. Otherwise will crash when
5598 '0' (a string), to match the rc file. Otherwise will crash when
5590 .strip() is called on it.
5599 .strip() is called on it.
5591
5600
5592
5601
5593 2002-06-28 Fernando Perez <fperez@colorado.edu>
5602 2002-06-28 Fernando Perez <fperez@colorado.edu>
5594
5603
5595 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5604 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5596 of files in current directory when a file is executed via
5605 of files in current directory when a file is executed via
5597 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5606 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5598
5607
5599 * setup.py (manfiles): fix for rpm builds, submitted by RA
5608 * setup.py (manfiles): fix for rpm builds, submitted by RA
5600 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5609 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5601
5610
5602 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5611 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5603 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5612 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5604 string!). A. Schmolck caught this one.
5613 string!). A. Schmolck caught this one.
5605
5614
5606 2002-06-27 Fernando Perez <fperez@colorado.edu>
5615 2002-06-27 Fernando Perez <fperez@colorado.edu>
5607
5616
5608 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5617 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5609 defined files at the cmd line. __name__ wasn't being set to
5618 defined files at the cmd line. __name__ wasn't being set to
5610 __main__.
5619 __main__.
5611
5620
5612 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5621 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5613 regular lists and tuples besides Numeric arrays.
5622 regular lists and tuples besides Numeric arrays.
5614
5623
5615 * IPython/Prompts.py (CachedOutput.__call__): Added output
5624 * IPython/Prompts.py (CachedOutput.__call__): Added output
5616 supression for input ending with ';'. Similar to Mathematica and
5625 supression for input ending with ';'. Similar to Mathematica and
5617 Matlab. The _* vars and Out[] list are still updated, just like
5626 Matlab. The _* vars and Out[] list are still updated, just like
5618 Mathematica behaves.
5627 Mathematica behaves.
5619
5628
5620 2002-06-25 Fernando Perez <fperez@colorado.edu>
5629 2002-06-25 Fernando Perez <fperez@colorado.edu>
5621
5630
5622 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5631 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5623 .ini extensions for profiels under Windows.
5632 .ini extensions for profiels under Windows.
5624
5633
5625 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5634 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5626 string form. Fix contributed by Alexander Schmolck
5635 string form. Fix contributed by Alexander Schmolck
5627 <a.schmolck-AT-gmx.net>
5636 <a.schmolck-AT-gmx.net>
5628
5637
5629 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5638 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5630 pre-configured Gnuplot instance.
5639 pre-configured Gnuplot instance.
5631
5640
5632 2002-06-21 Fernando Perez <fperez@colorado.edu>
5641 2002-06-21 Fernando Perez <fperez@colorado.edu>
5633
5642
5634 * IPython/numutils.py (exp_safe): new function, works around the
5643 * IPython/numutils.py (exp_safe): new function, works around the
5635 underflow problems in Numeric.
5644 underflow problems in Numeric.
5636 (log2): New fn. Safe log in base 2: returns exact integer answer
5645 (log2): New fn. Safe log in base 2: returns exact integer answer
5637 for exact integer powers of 2.
5646 for exact integer powers of 2.
5638
5647
5639 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5648 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5640 properly.
5649 properly.
5641
5650
5642 2002-06-20 Fernando Perez <fperez@colorado.edu>
5651 2002-06-20 Fernando Perez <fperez@colorado.edu>
5643
5652
5644 * IPython/genutils.py (timing): new function like
5653 * IPython/genutils.py (timing): new function like
5645 Mathematica's. Similar to time_test, but returns more info.
5654 Mathematica's. Similar to time_test, but returns more info.
5646
5655
5647 2002-06-18 Fernando Perez <fperez@colorado.edu>
5656 2002-06-18 Fernando Perez <fperez@colorado.edu>
5648
5657
5649 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5658 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5650 according to Mike Heeter's suggestions.
5659 according to Mike Heeter's suggestions.
5651
5660
5652 2002-06-16 Fernando Perez <fperez@colorado.edu>
5661 2002-06-16 Fernando Perez <fperez@colorado.edu>
5653
5662
5654 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5663 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5655 system. GnuplotMagic is gone as a user-directory option. New files
5664 system. GnuplotMagic is gone as a user-directory option. New files
5656 make it easier to use all the gnuplot stuff both from external
5665 make it easier to use all the gnuplot stuff both from external
5657 programs as well as from IPython. Had to rewrite part of
5666 programs as well as from IPython. Had to rewrite part of
5658 hardcopy() b/c of a strange bug: often the ps files simply don't
5667 hardcopy() b/c of a strange bug: often the ps files simply don't
5659 get created, and require a repeat of the command (often several
5668 get created, and require a repeat of the command (often several
5660 times).
5669 times).
5661
5670
5662 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5671 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5663 resolve output channel at call time, so that if sys.stderr has
5672 resolve output channel at call time, so that if sys.stderr has
5664 been redirected by user this gets honored.
5673 been redirected by user this gets honored.
5665
5674
5666 2002-06-13 Fernando Perez <fperez@colorado.edu>
5675 2002-06-13 Fernando Perez <fperez@colorado.edu>
5667
5676
5668 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5677 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5669 IPShell. Kept a copy with the old names to avoid breaking people's
5678 IPShell. Kept a copy with the old names to avoid breaking people's
5670 embedded code.
5679 embedded code.
5671
5680
5672 * IPython/ipython: simplified it to the bare minimum after
5681 * IPython/ipython: simplified it to the bare minimum after
5673 Holger's suggestions. Added info about how to use it in
5682 Holger's suggestions. Added info about how to use it in
5674 PYTHONSTARTUP.
5683 PYTHONSTARTUP.
5675
5684
5676 * IPython/Shell.py (IPythonShell): changed the options passing
5685 * IPython/Shell.py (IPythonShell): changed the options passing
5677 from a string with funky %s replacements to a straight list. Maybe
5686 from a string with funky %s replacements to a straight list. Maybe
5678 a bit more typing, but it follows sys.argv conventions, so there's
5687 a bit more typing, but it follows sys.argv conventions, so there's
5679 less special-casing to remember.
5688 less special-casing to remember.
5680
5689
5681 2002-06-12 Fernando Perez <fperez@colorado.edu>
5690 2002-06-12 Fernando Perez <fperez@colorado.edu>
5682
5691
5683 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5692 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5684 command. Thanks to a suggestion by Mike Heeter.
5693 command. Thanks to a suggestion by Mike Heeter.
5685 (Magic.magic_pfile): added behavior to look at filenames if given
5694 (Magic.magic_pfile): added behavior to look at filenames if given
5686 arg is not a defined object.
5695 arg is not a defined object.
5687 (Magic.magic_save): New @save function to save code snippets. Also
5696 (Magic.magic_save): New @save function to save code snippets. Also
5688 a Mike Heeter idea.
5697 a Mike Heeter idea.
5689
5698
5690 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5699 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5691 plot() and replot(). Much more convenient now, especially for
5700 plot() and replot(). Much more convenient now, especially for
5692 interactive use.
5701 interactive use.
5693
5702
5694 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5703 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5695 filenames.
5704 filenames.
5696
5705
5697 2002-06-02 Fernando Perez <fperez@colorado.edu>
5706 2002-06-02 Fernando Perez <fperez@colorado.edu>
5698
5707
5699 * IPython/Struct.py (Struct.__init__): modified to admit
5708 * IPython/Struct.py (Struct.__init__): modified to admit
5700 initialization via another struct.
5709 initialization via another struct.
5701
5710
5702 * IPython/genutils.py (SystemExec.__init__): New stateful
5711 * IPython/genutils.py (SystemExec.__init__): New stateful
5703 interface to xsys and bq. Useful for writing system scripts.
5712 interface to xsys and bq. Useful for writing system scripts.
5704
5713
5705 2002-05-30 Fernando Perez <fperez@colorado.edu>
5714 2002-05-30 Fernando Perez <fperez@colorado.edu>
5706
5715
5707 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5716 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5708 documents. This will make the user download smaller (it's getting
5717 documents. This will make the user download smaller (it's getting
5709 too big).
5718 too big).
5710
5719
5711 2002-05-29 Fernando Perez <fperez@colorado.edu>
5720 2002-05-29 Fernando Perez <fperez@colorado.edu>
5712
5721
5713 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5722 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5714 fix problems with shelve and pickle. Seems to work, but I don't
5723 fix problems with shelve and pickle. Seems to work, but I don't
5715 know if corner cases break it. Thanks to Mike Heeter
5724 know if corner cases break it. Thanks to Mike Heeter
5716 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5725 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5717
5726
5718 2002-05-24 Fernando Perez <fperez@colorado.edu>
5727 2002-05-24 Fernando Perez <fperez@colorado.edu>
5719
5728
5720 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5729 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5721 macros having broken.
5730 macros having broken.
5722
5731
5723 2002-05-21 Fernando Perez <fperez@colorado.edu>
5732 2002-05-21 Fernando Perez <fperez@colorado.edu>
5724
5733
5725 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5734 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5726 introduced logging bug: all history before logging started was
5735 introduced logging bug: all history before logging started was
5727 being written one character per line! This came from the redesign
5736 being written one character per line! This came from the redesign
5728 of the input history as a special list which slices to strings,
5737 of the input history as a special list which slices to strings,
5729 not to lists.
5738 not to lists.
5730
5739
5731 2002-05-20 Fernando Perez <fperez@colorado.edu>
5740 2002-05-20 Fernando Perez <fperez@colorado.edu>
5732
5741
5733 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5742 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5734 be an attribute of all classes in this module. The design of these
5743 be an attribute of all classes in this module. The design of these
5735 classes needs some serious overhauling.
5744 classes needs some serious overhauling.
5736
5745
5737 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5746 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5738 which was ignoring '_' in option names.
5747 which was ignoring '_' in option names.
5739
5748
5740 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5749 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5741 'Verbose_novars' to 'Context' and made it the new default. It's a
5750 'Verbose_novars' to 'Context' and made it the new default. It's a
5742 bit more readable and also safer than verbose.
5751 bit more readable and also safer than verbose.
5743
5752
5744 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5753 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5745 triple-quoted strings.
5754 triple-quoted strings.
5746
5755
5747 * IPython/OInspect.py (__all__): new module exposing the object
5756 * IPython/OInspect.py (__all__): new module exposing the object
5748 introspection facilities. Now the corresponding magics are dummy
5757 introspection facilities. Now the corresponding magics are dummy
5749 wrappers around this. Having this module will make it much easier
5758 wrappers around this. Having this module will make it much easier
5750 to put these functions into our modified pdb.
5759 to put these functions into our modified pdb.
5751 This new object inspector system uses the new colorizing module,
5760 This new object inspector system uses the new colorizing module,
5752 so source code and other things are nicely syntax highlighted.
5761 so source code and other things are nicely syntax highlighted.
5753
5762
5754 2002-05-18 Fernando Perez <fperez@colorado.edu>
5763 2002-05-18 Fernando Perez <fperez@colorado.edu>
5755
5764
5756 * IPython/ColorANSI.py: Split the coloring tools into a separate
5765 * IPython/ColorANSI.py: Split the coloring tools into a separate
5757 module so I can use them in other code easier (they were part of
5766 module so I can use them in other code easier (they were part of
5758 ultraTB).
5767 ultraTB).
5759
5768
5760 2002-05-17 Fernando Perez <fperez@colorado.edu>
5769 2002-05-17 Fernando Perez <fperez@colorado.edu>
5761
5770
5762 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5771 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5763 fixed it to set the global 'g' also to the called instance, as
5772 fixed it to set the global 'g' also to the called instance, as
5764 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5773 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5765 user's 'g' variables).
5774 user's 'g' variables).
5766
5775
5767 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5776 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5768 global variables (aliases to _ih,_oh) so that users which expect
5777 global variables (aliases to _ih,_oh) so that users which expect
5769 In[5] or Out[7] to work aren't unpleasantly surprised.
5778 In[5] or Out[7] to work aren't unpleasantly surprised.
5770 (InputList.__getslice__): new class to allow executing slices of
5779 (InputList.__getslice__): new class to allow executing slices of
5771 input history directly. Very simple class, complements the use of
5780 input history directly. Very simple class, complements the use of
5772 macros.
5781 macros.
5773
5782
5774 2002-05-16 Fernando Perez <fperez@colorado.edu>
5783 2002-05-16 Fernando Perez <fperez@colorado.edu>
5775
5784
5776 * setup.py (docdirbase): make doc directory be just doc/IPython
5785 * setup.py (docdirbase): make doc directory be just doc/IPython
5777 without version numbers, it will reduce clutter for users.
5786 without version numbers, it will reduce clutter for users.
5778
5787
5779 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5788 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5780 execfile call to prevent possible memory leak. See for details:
5789 execfile call to prevent possible memory leak. See for details:
5781 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5790 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5782
5791
5783 2002-05-15 Fernando Perez <fperez@colorado.edu>
5792 2002-05-15 Fernando Perez <fperez@colorado.edu>
5784
5793
5785 * IPython/Magic.py (Magic.magic_psource): made the object
5794 * IPython/Magic.py (Magic.magic_psource): made the object
5786 introspection names be more standard: pdoc, pdef, pfile and
5795 introspection names be more standard: pdoc, pdef, pfile and
5787 psource. They all print/page their output, and it makes
5796 psource. They all print/page their output, and it makes
5788 remembering them easier. Kept old names for compatibility as
5797 remembering them easier. Kept old names for compatibility as
5789 aliases.
5798 aliases.
5790
5799
5791 2002-05-14 Fernando Perez <fperez@colorado.edu>
5800 2002-05-14 Fernando Perez <fperez@colorado.edu>
5792
5801
5793 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5802 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5794 what the mouse problem was. The trick is to use gnuplot with temp
5803 what the mouse problem was. The trick is to use gnuplot with temp
5795 files and NOT with pipes (for data communication), because having
5804 files and NOT with pipes (for data communication), because having
5796 both pipes and the mouse on is bad news.
5805 both pipes and the mouse on is bad news.
5797
5806
5798 2002-05-13 Fernando Perez <fperez@colorado.edu>
5807 2002-05-13 Fernando Perez <fperez@colorado.edu>
5799
5808
5800 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5809 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5801 bug. Information would be reported about builtins even when
5810 bug. Information would be reported about builtins even when
5802 user-defined functions overrode them.
5811 user-defined functions overrode them.
5803
5812
5804 2002-05-11 Fernando Perez <fperez@colorado.edu>
5813 2002-05-11 Fernando Perez <fperez@colorado.edu>
5805
5814
5806 * IPython/__init__.py (__all__): removed FlexCompleter from
5815 * IPython/__init__.py (__all__): removed FlexCompleter from
5807 __all__ so that things don't fail in platforms without readline.
5816 __all__ so that things don't fail in platforms without readline.
5808
5817
5809 2002-05-10 Fernando Perez <fperez@colorado.edu>
5818 2002-05-10 Fernando Perez <fperez@colorado.edu>
5810
5819
5811 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5820 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5812 it requires Numeric, effectively making Numeric a dependency for
5821 it requires Numeric, effectively making Numeric a dependency for
5813 IPython.
5822 IPython.
5814
5823
5815 * Released 0.2.13
5824 * Released 0.2.13
5816
5825
5817 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5826 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5818 profiler interface. Now all the major options from the profiler
5827 profiler interface. Now all the major options from the profiler
5819 module are directly supported in IPython, both for single
5828 module are directly supported in IPython, both for single
5820 expressions (@prun) and for full programs (@run -p).
5829 expressions (@prun) and for full programs (@run -p).
5821
5830
5822 2002-05-09 Fernando Perez <fperez@colorado.edu>
5831 2002-05-09 Fernando Perez <fperez@colorado.edu>
5823
5832
5824 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5833 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5825 magic properly formatted for screen.
5834 magic properly formatted for screen.
5826
5835
5827 * setup.py (make_shortcut): Changed things to put pdf version in
5836 * setup.py (make_shortcut): Changed things to put pdf version in
5828 doc/ instead of doc/manual (had to change lyxport a bit).
5837 doc/ instead of doc/manual (had to change lyxport a bit).
5829
5838
5830 * IPython/Magic.py (Profile.string_stats): made profile runs go
5839 * IPython/Magic.py (Profile.string_stats): made profile runs go
5831 through pager (they are long and a pager allows searching, saving,
5840 through pager (they are long and a pager allows searching, saving,
5832 etc.)
5841 etc.)
5833
5842
5834 2002-05-08 Fernando Perez <fperez@colorado.edu>
5843 2002-05-08 Fernando Perez <fperez@colorado.edu>
5835
5844
5836 * Released 0.2.12
5845 * Released 0.2.12
5837
5846
5838 2002-05-06 Fernando Perez <fperez@colorado.edu>
5847 2002-05-06 Fernando Perez <fperez@colorado.edu>
5839
5848
5840 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5849 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5841 introduced); 'hist n1 n2' was broken.
5850 introduced); 'hist n1 n2' was broken.
5842 (Magic.magic_pdb): added optional on/off arguments to @pdb
5851 (Magic.magic_pdb): added optional on/off arguments to @pdb
5843 (Magic.magic_run): added option -i to @run, which executes code in
5852 (Magic.magic_run): added option -i to @run, which executes code in
5844 the IPython namespace instead of a clean one. Also added @irun as
5853 the IPython namespace instead of a clean one. Also added @irun as
5845 an alias to @run -i.
5854 an alias to @run -i.
5846
5855
5847 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5856 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5848 fixed (it didn't really do anything, the namespaces were wrong).
5857 fixed (it didn't really do anything, the namespaces were wrong).
5849
5858
5850 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5859 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5851
5860
5852 * IPython/__init__.py (__all__): Fixed package namespace, now
5861 * IPython/__init__.py (__all__): Fixed package namespace, now
5853 'import IPython' does give access to IPython.<all> as
5862 'import IPython' does give access to IPython.<all> as
5854 expected. Also renamed __release__ to Release.
5863 expected. Also renamed __release__ to Release.
5855
5864
5856 * IPython/Debugger.py (__license__): created new Pdb class which
5865 * IPython/Debugger.py (__license__): created new Pdb class which
5857 functions like a drop-in for the normal pdb.Pdb but does NOT
5866 functions like a drop-in for the normal pdb.Pdb but does NOT
5858 import readline by default. This way it doesn't muck up IPython's
5867 import readline by default. This way it doesn't muck up IPython's
5859 readline handling, and now tab-completion finally works in the
5868 readline handling, and now tab-completion finally works in the
5860 debugger -- sort of. It completes things globally visible, but the
5869 debugger -- sort of. It completes things globally visible, but the
5861 completer doesn't track the stack as pdb walks it. That's a bit
5870 completer doesn't track the stack as pdb walks it. That's a bit
5862 tricky, and I'll have to implement it later.
5871 tricky, and I'll have to implement it later.
5863
5872
5864 2002-05-05 Fernando Perez <fperez@colorado.edu>
5873 2002-05-05 Fernando Perez <fperez@colorado.edu>
5865
5874
5866 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5875 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5867 magic docstrings when printed via ? (explicit \'s were being
5876 magic docstrings when printed via ? (explicit \'s were being
5868 printed).
5877 printed).
5869
5878
5870 * IPython/ipmaker.py (make_IPython): fixed namespace
5879 * IPython/ipmaker.py (make_IPython): fixed namespace
5871 identification bug. Now variables loaded via logs or command-line
5880 identification bug. Now variables loaded via logs or command-line
5872 files are recognized in the interactive namespace by @who.
5881 files are recognized in the interactive namespace by @who.
5873
5882
5874 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5883 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5875 log replay system stemming from the string form of Structs.
5884 log replay system stemming from the string form of Structs.
5876
5885
5877 * IPython/Magic.py (Macro.__init__): improved macros to properly
5886 * IPython/Magic.py (Macro.__init__): improved macros to properly
5878 handle magic commands in them.
5887 handle magic commands in them.
5879 (Magic.magic_logstart): usernames are now expanded so 'logstart
5888 (Magic.magic_logstart): usernames are now expanded so 'logstart
5880 ~/mylog' now works.
5889 ~/mylog' now works.
5881
5890
5882 * IPython/iplib.py (complete): fixed bug where paths starting with
5891 * IPython/iplib.py (complete): fixed bug where paths starting with
5883 '/' would be completed as magic names.
5892 '/' would be completed as magic names.
5884
5893
5885 2002-05-04 Fernando Perez <fperez@colorado.edu>
5894 2002-05-04 Fernando Perez <fperez@colorado.edu>
5886
5895
5887 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5896 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5888 allow running full programs under the profiler's control.
5897 allow running full programs under the profiler's control.
5889
5898
5890 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5899 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5891 mode to report exceptions verbosely but without formatting
5900 mode to report exceptions verbosely but without formatting
5892 variables. This addresses the issue of ipython 'freezing' (it's
5901 variables. This addresses the issue of ipython 'freezing' (it's
5893 not frozen, but caught in an expensive formatting loop) when huge
5902 not frozen, but caught in an expensive formatting loop) when huge
5894 variables are in the context of an exception.
5903 variables are in the context of an exception.
5895 (VerboseTB.text): Added '--->' markers at line where exception was
5904 (VerboseTB.text): Added '--->' markers at line where exception was
5896 triggered. Much clearer to read, especially in NoColor modes.
5905 triggered. Much clearer to read, especially in NoColor modes.
5897
5906
5898 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5907 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5899 implemented in reverse when changing to the new parse_options().
5908 implemented in reverse when changing to the new parse_options().
5900
5909
5901 2002-05-03 Fernando Perez <fperez@colorado.edu>
5910 2002-05-03 Fernando Perez <fperez@colorado.edu>
5902
5911
5903 * IPython/Magic.py (Magic.parse_options): new function so that
5912 * IPython/Magic.py (Magic.parse_options): new function so that
5904 magics can parse options easier.
5913 magics can parse options easier.
5905 (Magic.magic_prun): new function similar to profile.run(),
5914 (Magic.magic_prun): new function similar to profile.run(),
5906 suggested by Chris Hart.
5915 suggested by Chris Hart.
5907 (Magic.magic_cd): fixed behavior so that it only changes if
5916 (Magic.magic_cd): fixed behavior so that it only changes if
5908 directory actually is in history.
5917 directory actually is in history.
5909
5918
5910 * IPython/usage.py (__doc__): added information about potential
5919 * IPython/usage.py (__doc__): added information about potential
5911 slowness of Verbose exception mode when there are huge data
5920 slowness of Verbose exception mode when there are huge data
5912 structures to be formatted (thanks to Archie Paulson).
5921 structures to be formatted (thanks to Archie Paulson).
5913
5922
5914 * IPython/ipmaker.py (make_IPython): Changed default logging
5923 * IPython/ipmaker.py (make_IPython): Changed default logging
5915 (when simply called with -log) to use curr_dir/ipython.log in
5924 (when simply called with -log) to use curr_dir/ipython.log in
5916 rotate mode. Fixed crash which was occuring with -log before
5925 rotate mode. Fixed crash which was occuring with -log before
5917 (thanks to Jim Boyle).
5926 (thanks to Jim Boyle).
5918
5927
5919 2002-05-01 Fernando Perez <fperez@colorado.edu>
5928 2002-05-01 Fernando Perez <fperez@colorado.edu>
5920
5929
5921 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5930 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5922 was nasty -- though somewhat of a corner case).
5931 was nasty -- though somewhat of a corner case).
5923
5932
5924 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5933 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5925 text (was a bug).
5934 text (was a bug).
5926
5935
5927 2002-04-30 Fernando Perez <fperez@colorado.edu>
5936 2002-04-30 Fernando Perez <fperez@colorado.edu>
5928
5937
5929 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5938 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5930 a print after ^D or ^C from the user so that the In[] prompt
5939 a print after ^D or ^C from the user so that the In[] prompt
5931 doesn't over-run the gnuplot one.
5940 doesn't over-run the gnuplot one.
5932
5941
5933 2002-04-29 Fernando Perez <fperez@colorado.edu>
5942 2002-04-29 Fernando Perez <fperez@colorado.edu>
5934
5943
5935 * Released 0.2.10
5944 * Released 0.2.10
5936
5945
5937 * IPython/__release__.py (version): get date dynamically.
5946 * IPython/__release__.py (version): get date dynamically.
5938
5947
5939 * Misc. documentation updates thanks to Arnd's comments. Also ran
5948 * Misc. documentation updates thanks to Arnd's comments. Also ran
5940 a full spellcheck on the manual (hadn't been done in a while).
5949 a full spellcheck on the manual (hadn't been done in a while).
5941
5950
5942 2002-04-27 Fernando Perez <fperez@colorado.edu>
5951 2002-04-27 Fernando Perez <fperez@colorado.edu>
5943
5952
5944 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5953 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5945 starting a log in mid-session would reset the input history list.
5954 starting a log in mid-session would reset the input history list.
5946
5955
5947 2002-04-26 Fernando Perez <fperez@colorado.edu>
5956 2002-04-26 Fernando Perez <fperez@colorado.edu>
5948
5957
5949 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5958 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5950 all files were being included in an update. Now anything in
5959 all files were being included in an update. Now anything in
5951 UserConfig that matches [A-Za-z]*.py will go (this excludes
5960 UserConfig that matches [A-Za-z]*.py will go (this excludes
5952 __init__.py)
5961 __init__.py)
5953
5962
5954 2002-04-25 Fernando Perez <fperez@colorado.edu>
5963 2002-04-25 Fernando Perez <fperez@colorado.edu>
5955
5964
5956 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5965 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5957 to __builtins__ so that any form of embedded or imported code can
5966 to __builtins__ so that any form of embedded or imported code can
5958 test for being inside IPython.
5967 test for being inside IPython.
5959
5968
5960 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5969 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5961 changed to GnuplotMagic because it's now an importable module,
5970 changed to GnuplotMagic because it's now an importable module,
5962 this makes the name follow that of the standard Gnuplot module.
5971 this makes the name follow that of the standard Gnuplot module.
5963 GnuplotMagic can now be loaded at any time in mid-session.
5972 GnuplotMagic can now be loaded at any time in mid-session.
5964
5973
5965 2002-04-24 Fernando Perez <fperez@colorado.edu>
5974 2002-04-24 Fernando Perez <fperez@colorado.edu>
5966
5975
5967 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5976 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5968 the globals (IPython has its own namespace) and the
5977 the globals (IPython has its own namespace) and the
5969 PhysicalQuantity stuff is much better anyway.
5978 PhysicalQuantity stuff is much better anyway.
5970
5979
5971 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5980 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5972 embedding example to standard user directory for
5981 embedding example to standard user directory for
5973 distribution. Also put it in the manual.
5982 distribution. Also put it in the manual.
5974
5983
5975 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5984 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5976 instance as first argument (so it doesn't rely on some obscure
5985 instance as first argument (so it doesn't rely on some obscure
5977 hidden global).
5986 hidden global).
5978
5987
5979 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5988 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5980 delimiters. While it prevents ().TAB from working, it allows
5989 delimiters. While it prevents ().TAB from working, it allows
5981 completions in open (... expressions. This is by far a more common
5990 completions in open (... expressions. This is by far a more common
5982 case.
5991 case.
5983
5992
5984 2002-04-23 Fernando Perez <fperez@colorado.edu>
5993 2002-04-23 Fernando Perez <fperez@colorado.edu>
5985
5994
5986 * IPython/Extensions/InterpreterPasteInput.py: new
5995 * IPython/Extensions/InterpreterPasteInput.py: new
5987 syntax-processing module for pasting lines with >>> or ... at the
5996 syntax-processing module for pasting lines with >>> or ... at the
5988 start.
5997 start.
5989
5998
5990 * IPython/Extensions/PhysicalQ_Interactive.py
5999 * IPython/Extensions/PhysicalQ_Interactive.py
5991 (PhysicalQuantityInteractive.__int__): fixed to work with either
6000 (PhysicalQuantityInteractive.__int__): fixed to work with either
5992 Numeric or math.
6001 Numeric or math.
5993
6002
5994 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
6003 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5995 provided profiles. Now we have:
6004 provided profiles. Now we have:
5996 -math -> math module as * and cmath with its own namespace.
6005 -math -> math module as * and cmath with its own namespace.
5997 -numeric -> Numeric as *, plus gnuplot & grace
6006 -numeric -> Numeric as *, plus gnuplot & grace
5998 -physics -> same as before
6007 -physics -> same as before
5999
6008
6000 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
6009 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
6001 user-defined magics wouldn't be found by @magic if they were
6010 user-defined magics wouldn't be found by @magic if they were
6002 defined as class methods. Also cleaned up the namespace search
6011 defined as class methods. Also cleaned up the namespace search
6003 logic and the string building (to use %s instead of many repeated
6012 logic and the string building (to use %s instead of many repeated
6004 string adds).
6013 string adds).
6005
6014
6006 * IPython/UserConfig/example-magic.py (magic_foo): updated example
6015 * IPython/UserConfig/example-magic.py (magic_foo): updated example
6007 of user-defined magics to operate with class methods (cleaner, in
6016 of user-defined magics to operate with class methods (cleaner, in
6008 line with the gnuplot code).
6017 line with the gnuplot code).
6009
6018
6010 2002-04-22 Fernando Perez <fperez@colorado.edu>
6019 2002-04-22 Fernando Perez <fperez@colorado.edu>
6011
6020
6012 * setup.py: updated dependency list so that manual is updated when
6021 * setup.py: updated dependency list so that manual is updated when
6013 all included files change.
6022 all included files change.
6014
6023
6015 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
6024 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
6016 the delimiter removal option (the fix is ugly right now).
6025 the delimiter removal option (the fix is ugly right now).
6017
6026
6018 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
6027 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
6019 all of the math profile (quicker loading, no conflict between
6028 all of the math profile (quicker loading, no conflict between
6020 g-9.8 and g-gnuplot).
6029 g-9.8 and g-gnuplot).
6021
6030
6022 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
6031 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
6023 name of post-mortem files to IPython_crash_report.txt.
6032 name of post-mortem files to IPython_crash_report.txt.
6024
6033
6025 * Cleanup/update of the docs. Added all the new readline info and
6034 * Cleanup/update of the docs. Added all the new readline info and
6026 formatted all lists as 'real lists'.
6035 formatted all lists as 'real lists'.
6027
6036
6028 * IPython/ipmaker.py (make_IPython): removed now-obsolete
6037 * IPython/ipmaker.py (make_IPython): removed now-obsolete
6029 tab-completion options, since the full readline parse_and_bind is
6038 tab-completion options, since the full readline parse_and_bind is
6030 now accessible.
6039 now accessible.
6031
6040
6032 * IPython/iplib.py (InteractiveShell.init_readline): Changed
6041 * IPython/iplib.py (InteractiveShell.init_readline): Changed
6033 handling of readline options. Now users can specify any string to
6042 handling of readline options. Now users can specify any string to
6034 be passed to parse_and_bind(), as well as the delimiters to be
6043 be passed to parse_and_bind(), as well as the delimiters to be
6035 removed.
6044 removed.
6036 (InteractiveShell.__init__): Added __name__ to the global
6045 (InteractiveShell.__init__): Added __name__ to the global
6037 namespace so that things like Itpl which rely on its existence
6046 namespace so that things like Itpl which rely on its existence
6038 don't crash.
6047 don't crash.
6039 (InteractiveShell._prefilter): Defined the default with a _ so
6048 (InteractiveShell._prefilter): Defined the default with a _ so
6040 that prefilter() is easier to override, while the default one
6049 that prefilter() is easier to override, while the default one
6041 remains available.
6050 remains available.
6042
6051
6043 2002-04-18 Fernando Perez <fperez@colorado.edu>
6052 2002-04-18 Fernando Perez <fperez@colorado.edu>
6044
6053
6045 * Added information about pdb in the docs.
6054 * Added information about pdb in the docs.
6046
6055
6047 2002-04-17 Fernando Perez <fperez@colorado.edu>
6056 2002-04-17 Fernando Perez <fperez@colorado.edu>
6048
6057
6049 * IPython/ipmaker.py (make_IPython): added rc_override option to
6058 * IPython/ipmaker.py (make_IPython): added rc_override option to
6050 allow passing config options at creation time which may override
6059 allow passing config options at creation time which may override
6051 anything set in the config files or command line. This is
6060 anything set in the config files or command line. This is
6052 particularly useful for configuring embedded instances.
6061 particularly useful for configuring embedded instances.
6053
6062
6054 2002-04-15 Fernando Perez <fperez@colorado.edu>
6063 2002-04-15 Fernando Perez <fperez@colorado.edu>
6055
6064
6056 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
6065 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
6057 crash embedded instances because of the input cache falling out of
6066 crash embedded instances because of the input cache falling out of
6058 sync with the output counter.
6067 sync with the output counter.
6059
6068
6060 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
6069 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
6061 mode which calls pdb after an uncaught exception in IPython itself.
6070 mode which calls pdb after an uncaught exception in IPython itself.
6062
6071
6063 2002-04-14 Fernando Perez <fperez@colorado.edu>
6072 2002-04-14 Fernando Perez <fperez@colorado.edu>
6064
6073
6065 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6074 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6066 readline, fix it back after each call.
6075 readline, fix it back after each call.
6067
6076
6068 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6077 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6069 method to force all access via __call__(), which guarantees that
6078 method to force all access via __call__(), which guarantees that
6070 traceback references are properly deleted.
6079 traceback references are properly deleted.
6071
6080
6072 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6081 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6073 improve printing when pprint is in use.
6082 improve printing when pprint is in use.
6074
6083
6075 2002-04-13 Fernando Perez <fperez@colorado.edu>
6084 2002-04-13 Fernando Perez <fperez@colorado.edu>
6076
6085
6077 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6086 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6078 exceptions aren't caught anymore. If the user triggers one, he
6087 exceptions aren't caught anymore. If the user triggers one, he
6079 should know why he's doing it and it should go all the way up,
6088 should know why he's doing it and it should go all the way up,
6080 just like any other exception. So now @abort will fully kill the
6089 just like any other exception. So now @abort will fully kill the
6081 embedded interpreter and the embedding code (unless that happens
6090 embedded interpreter and the embedding code (unless that happens
6082 to catch SystemExit).
6091 to catch SystemExit).
6083
6092
6084 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6093 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6085 and a debugger() method to invoke the interactive pdb debugger
6094 and a debugger() method to invoke the interactive pdb debugger
6086 after printing exception information. Also added the corresponding
6095 after printing exception information. Also added the corresponding
6087 -pdb option and @pdb magic to control this feature, and updated
6096 -pdb option and @pdb magic to control this feature, and updated
6088 the docs. After a suggestion from Christopher Hart
6097 the docs. After a suggestion from Christopher Hart
6089 (hart-AT-caltech.edu).
6098 (hart-AT-caltech.edu).
6090
6099
6091 2002-04-12 Fernando Perez <fperez@colorado.edu>
6100 2002-04-12 Fernando Perez <fperez@colorado.edu>
6092
6101
6093 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6102 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6094 the exception handlers defined by the user (not the CrashHandler)
6103 the exception handlers defined by the user (not the CrashHandler)
6095 so that user exceptions don't trigger an ipython bug report.
6104 so that user exceptions don't trigger an ipython bug report.
6096
6105
6097 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6106 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6098 configurable (it should have always been so).
6107 configurable (it should have always been so).
6099
6108
6100 2002-03-26 Fernando Perez <fperez@colorado.edu>
6109 2002-03-26 Fernando Perez <fperez@colorado.edu>
6101
6110
6102 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6111 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6103 and there to fix embedding namespace issues. This should all be
6112 and there to fix embedding namespace issues. This should all be
6104 done in a more elegant way.
6113 done in a more elegant way.
6105
6114
6106 2002-03-25 Fernando Perez <fperez@colorado.edu>
6115 2002-03-25 Fernando Perez <fperez@colorado.edu>
6107
6116
6108 * IPython/genutils.py (get_home_dir): Try to make it work under
6117 * IPython/genutils.py (get_home_dir): Try to make it work under
6109 win9x also.
6118 win9x also.
6110
6119
6111 2002-03-20 Fernando Perez <fperez@colorado.edu>
6120 2002-03-20 Fernando Perez <fperez@colorado.edu>
6112
6121
6113 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6122 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6114 sys.displayhook untouched upon __init__.
6123 sys.displayhook untouched upon __init__.
6115
6124
6116 2002-03-19 Fernando Perez <fperez@colorado.edu>
6125 2002-03-19 Fernando Perez <fperez@colorado.edu>
6117
6126
6118 * Released 0.2.9 (for embedding bug, basically).
6127 * Released 0.2.9 (for embedding bug, basically).
6119
6128
6120 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6129 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6121 exceptions so that enclosing shell's state can be restored.
6130 exceptions so that enclosing shell's state can be restored.
6122
6131
6123 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6132 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6124 naming conventions in the .ipython/ dir.
6133 naming conventions in the .ipython/ dir.
6125
6134
6126 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6135 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6127 from delimiters list so filenames with - in them get expanded.
6136 from delimiters list so filenames with - in them get expanded.
6128
6137
6129 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6138 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6130 sys.displayhook not being properly restored after an embedded call.
6139 sys.displayhook not being properly restored after an embedded call.
6131
6140
6132 2002-03-18 Fernando Perez <fperez@colorado.edu>
6141 2002-03-18 Fernando Perez <fperez@colorado.edu>
6133
6142
6134 * Released 0.2.8
6143 * Released 0.2.8
6135
6144
6136 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6145 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6137 some files weren't being included in a -upgrade.
6146 some files weren't being included in a -upgrade.
6138 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6147 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6139 on' so that the first tab completes.
6148 on' so that the first tab completes.
6140 (InteractiveShell.handle_magic): fixed bug with spaces around
6149 (InteractiveShell.handle_magic): fixed bug with spaces around
6141 quotes breaking many magic commands.
6150 quotes breaking many magic commands.
6142
6151
6143 * setup.py: added note about ignoring the syntax error messages at
6152 * setup.py: added note about ignoring the syntax error messages at
6144 installation.
6153 installation.
6145
6154
6146 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6155 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6147 streamlining the gnuplot interface, now there's only one magic @gp.
6156 streamlining the gnuplot interface, now there's only one magic @gp.
6148
6157
6149 2002-03-17 Fernando Perez <fperez@colorado.edu>
6158 2002-03-17 Fernando Perez <fperez@colorado.edu>
6150
6159
6151 * IPython/UserConfig/magic_gnuplot.py: new name for the
6160 * IPython/UserConfig/magic_gnuplot.py: new name for the
6152 example-magic_pm.py file. Much enhanced system, now with a shell
6161 example-magic_pm.py file. Much enhanced system, now with a shell
6153 for communicating directly with gnuplot, one command at a time.
6162 for communicating directly with gnuplot, one command at a time.
6154
6163
6155 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6164 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6156 setting __name__=='__main__'.
6165 setting __name__=='__main__'.
6157
6166
6158 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6167 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6159 mini-shell for accessing gnuplot from inside ipython. Should
6168 mini-shell for accessing gnuplot from inside ipython. Should
6160 extend it later for grace access too. Inspired by Arnd's
6169 extend it later for grace access too. Inspired by Arnd's
6161 suggestion.
6170 suggestion.
6162
6171
6163 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6172 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6164 calling magic functions with () in their arguments. Thanks to Arnd
6173 calling magic functions with () in their arguments. Thanks to Arnd
6165 Baecker for pointing this to me.
6174 Baecker for pointing this to me.
6166
6175
6167 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6176 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6168 infinitely for integer or complex arrays (only worked with floats).
6177 infinitely for integer or complex arrays (only worked with floats).
6169
6178
6170 2002-03-16 Fernando Perez <fperez@colorado.edu>
6179 2002-03-16 Fernando Perez <fperez@colorado.edu>
6171
6180
6172 * setup.py: Merged setup and setup_windows into a single script
6181 * setup.py: Merged setup and setup_windows into a single script
6173 which properly handles things for windows users.
6182 which properly handles things for windows users.
6174
6183
6175 2002-03-15 Fernando Perez <fperez@colorado.edu>
6184 2002-03-15 Fernando Perez <fperez@colorado.edu>
6176
6185
6177 * Big change to the manual: now the magics are all automatically
6186 * Big change to the manual: now the magics are all automatically
6178 documented. This information is generated from their docstrings
6187 documented. This information is generated from their docstrings
6179 and put in a latex file included by the manual lyx file. This way
6188 and put in a latex file included by the manual lyx file. This way
6180 we get always up to date information for the magics. The manual
6189 we get always up to date information for the magics. The manual
6181 now also has proper version information, also auto-synced.
6190 now also has proper version information, also auto-synced.
6182
6191
6183 For this to work, an undocumented --magic_docstrings option was added.
6192 For this to work, an undocumented --magic_docstrings option was added.
6184
6193
6185 2002-03-13 Fernando Perez <fperez@colorado.edu>
6194 2002-03-13 Fernando Perez <fperez@colorado.edu>
6186
6195
6187 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6196 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6188 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6197 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6189
6198
6190 2002-03-12 Fernando Perez <fperez@colorado.edu>
6199 2002-03-12 Fernando Perez <fperez@colorado.edu>
6191
6200
6192 * IPython/ultraTB.py (TermColors): changed color escapes again to
6201 * IPython/ultraTB.py (TermColors): changed color escapes again to
6193 fix the (old, reintroduced) line-wrapping bug. Basically, if
6202 fix the (old, reintroduced) line-wrapping bug. Basically, if
6194 \001..\002 aren't given in the color escapes, lines get wrapped
6203 \001..\002 aren't given in the color escapes, lines get wrapped
6195 weirdly. But giving those screws up old xterms and emacs terms. So
6204 weirdly. But giving those screws up old xterms and emacs terms. So
6196 I added some logic for emacs terms to be ok, but I can't identify old
6205 I added some logic for emacs terms to be ok, but I can't identify old
6197 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6206 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6198
6207
6199 2002-03-10 Fernando Perez <fperez@colorado.edu>
6208 2002-03-10 Fernando Perez <fperez@colorado.edu>
6200
6209
6201 * IPython/usage.py (__doc__): Various documentation cleanups and
6210 * IPython/usage.py (__doc__): Various documentation cleanups and
6202 updates, both in usage docstrings and in the manual.
6211 updates, both in usage docstrings and in the manual.
6203
6212
6204 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6213 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6205 handling of caching. Set minimum acceptabe value for having a
6214 handling of caching. Set minimum acceptabe value for having a
6206 cache at 20 values.
6215 cache at 20 values.
6207
6216
6208 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6217 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6209 install_first_time function to a method, renamed it and added an
6218 install_first_time function to a method, renamed it and added an
6210 'upgrade' mode. Now people can update their config directory with
6219 'upgrade' mode. Now people can update their config directory with
6211 a simple command line switch (-upgrade, also new).
6220 a simple command line switch (-upgrade, also new).
6212
6221
6213 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6222 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6214 @file (convenient for automagic users under Python >= 2.2).
6223 @file (convenient for automagic users under Python >= 2.2).
6215 Removed @files (it seemed more like a plural than an abbrev. of
6224 Removed @files (it seemed more like a plural than an abbrev. of
6216 'file show').
6225 'file show').
6217
6226
6218 * IPython/iplib.py (install_first_time): Fixed crash if there were
6227 * IPython/iplib.py (install_first_time): Fixed crash if there were
6219 backup files ('~') in .ipython/ install directory.
6228 backup files ('~') in .ipython/ install directory.
6220
6229
6221 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6230 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6222 system. Things look fine, but these changes are fairly
6231 system. Things look fine, but these changes are fairly
6223 intrusive. Test them for a few days.
6232 intrusive. Test them for a few days.
6224
6233
6225 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6234 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6226 the prompts system. Now all in/out prompt strings are user
6235 the prompts system. Now all in/out prompt strings are user
6227 controllable. This is particularly useful for embedding, as one
6236 controllable. This is particularly useful for embedding, as one
6228 can tag embedded instances with particular prompts.
6237 can tag embedded instances with particular prompts.
6229
6238
6230 Also removed global use of sys.ps1/2, which now allows nested
6239 Also removed global use of sys.ps1/2, which now allows nested
6231 embeddings without any problems. Added command-line options for
6240 embeddings without any problems. Added command-line options for
6232 the prompt strings.
6241 the prompt strings.
6233
6242
6234 2002-03-08 Fernando Perez <fperez@colorado.edu>
6243 2002-03-08 Fernando Perez <fperez@colorado.edu>
6235
6244
6236 * IPython/UserConfig/example-embed-short.py (ipshell): added
6245 * IPython/UserConfig/example-embed-short.py (ipshell): added
6237 example file with the bare minimum code for embedding.
6246 example file with the bare minimum code for embedding.
6238
6247
6239 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6248 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6240 functionality for the embeddable shell to be activated/deactivated
6249 functionality for the embeddable shell to be activated/deactivated
6241 either globally or at each call.
6250 either globally or at each call.
6242
6251
6243 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6252 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6244 rewriting the prompt with '--->' for auto-inputs with proper
6253 rewriting the prompt with '--->' for auto-inputs with proper
6245 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6254 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6246 this is handled by the prompts class itself, as it should.
6255 this is handled by the prompts class itself, as it should.
6247
6256
6248 2002-03-05 Fernando Perez <fperez@colorado.edu>
6257 2002-03-05 Fernando Perez <fperez@colorado.edu>
6249
6258
6250 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6259 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6251 @logstart to avoid name clashes with the math log function.
6260 @logstart to avoid name clashes with the math log function.
6252
6261
6253 * Big updates to X/Emacs section of the manual.
6262 * Big updates to X/Emacs section of the manual.
6254
6263
6255 * Removed ipython_emacs. Milan explained to me how to pass
6264 * Removed ipython_emacs. Milan explained to me how to pass
6256 arguments to ipython through Emacs. Some day I'm going to end up
6265 arguments to ipython through Emacs. Some day I'm going to end up
6257 learning some lisp...
6266 learning some lisp...
6258
6267
6259 2002-03-04 Fernando Perez <fperez@colorado.edu>
6268 2002-03-04 Fernando Perez <fperez@colorado.edu>
6260
6269
6261 * IPython/ipython_emacs: Created script to be used as the
6270 * IPython/ipython_emacs: Created script to be used as the
6262 py-python-command Emacs variable so we can pass IPython
6271 py-python-command Emacs variable so we can pass IPython
6263 parameters. I can't figure out how to tell Emacs directly to pass
6272 parameters. I can't figure out how to tell Emacs directly to pass
6264 parameters to IPython, so a dummy shell script will do it.
6273 parameters to IPython, so a dummy shell script will do it.
6265
6274
6266 Other enhancements made for things to work better under Emacs'
6275 Other enhancements made for things to work better under Emacs'
6267 various types of terminals. Many thanks to Milan Zamazal
6276 various types of terminals. Many thanks to Milan Zamazal
6268 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6277 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6269
6278
6270 2002-03-01 Fernando Perez <fperez@colorado.edu>
6279 2002-03-01 Fernando Perez <fperez@colorado.edu>
6271
6280
6272 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6281 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6273 that loading of readline is now optional. This gives better
6282 that loading of readline is now optional. This gives better
6274 control to emacs users.
6283 control to emacs users.
6275
6284
6276 * IPython/ultraTB.py (__date__): Modified color escape sequences
6285 * IPython/ultraTB.py (__date__): Modified color escape sequences
6277 and now things work fine under xterm and in Emacs' term buffers
6286 and now things work fine under xterm and in Emacs' term buffers
6278 (though not shell ones). Well, in emacs you get colors, but all
6287 (though not shell ones). Well, in emacs you get colors, but all
6279 seem to be 'light' colors (no difference between dark and light
6288 seem to be 'light' colors (no difference between dark and light
6280 ones). But the garbage chars are gone, and also in xterms. It
6289 ones). But the garbage chars are gone, and also in xterms. It
6281 seems that now I'm using 'cleaner' ansi sequences.
6290 seems that now I'm using 'cleaner' ansi sequences.
6282
6291
6283 2002-02-21 Fernando Perez <fperez@colorado.edu>
6292 2002-02-21 Fernando Perez <fperez@colorado.edu>
6284
6293
6285 * Released 0.2.7 (mainly to publish the scoping fix).
6294 * Released 0.2.7 (mainly to publish the scoping fix).
6286
6295
6287 * IPython/Logger.py (Logger.logstate): added. A corresponding
6296 * IPython/Logger.py (Logger.logstate): added. A corresponding
6288 @logstate magic was created.
6297 @logstate magic was created.
6289
6298
6290 * IPython/Magic.py: fixed nested scoping problem under Python
6299 * IPython/Magic.py: fixed nested scoping problem under Python
6291 2.1.x (automagic wasn't working).
6300 2.1.x (automagic wasn't working).
6292
6301
6293 2002-02-20 Fernando Perez <fperez@colorado.edu>
6302 2002-02-20 Fernando Perez <fperez@colorado.edu>
6294
6303
6295 * Released 0.2.6.
6304 * Released 0.2.6.
6296
6305
6297 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6306 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6298 option so that logs can come out without any headers at all.
6307 option so that logs can come out without any headers at all.
6299
6308
6300 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6309 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6301 SciPy.
6310 SciPy.
6302
6311
6303 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6312 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6304 that embedded IPython calls don't require vars() to be explicitly
6313 that embedded IPython calls don't require vars() to be explicitly
6305 passed. Now they are extracted from the caller's frame (code
6314 passed. Now they are extracted from the caller's frame (code
6306 snatched from Eric Jones' weave). Added better documentation to
6315 snatched from Eric Jones' weave). Added better documentation to
6307 the section on embedding and the example file.
6316 the section on embedding and the example file.
6308
6317
6309 * IPython/genutils.py (page): Changed so that under emacs, it just
6318 * IPython/genutils.py (page): Changed so that under emacs, it just
6310 prints the string. You can then page up and down in the emacs
6319 prints the string. You can then page up and down in the emacs
6311 buffer itself. This is how the builtin help() works.
6320 buffer itself. This is how the builtin help() works.
6312
6321
6313 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6322 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6314 macro scoping: macros need to be executed in the user's namespace
6323 macro scoping: macros need to be executed in the user's namespace
6315 to work as if they had been typed by the user.
6324 to work as if they had been typed by the user.
6316
6325
6317 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6326 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6318 execute automatically (no need to type 'exec...'). They then
6327 execute automatically (no need to type 'exec...'). They then
6319 behave like 'true macros'. The printing system was also modified
6328 behave like 'true macros'. The printing system was also modified
6320 for this to work.
6329 for this to work.
6321
6330
6322 2002-02-19 Fernando Perez <fperez@colorado.edu>
6331 2002-02-19 Fernando Perez <fperez@colorado.edu>
6323
6332
6324 * IPython/genutils.py (page_file): new function for paging files
6333 * IPython/genutils.py (page_file): new function for paging files
6325 in an OS-independent way. Also necessary for file viewing to work
6334 in an OS-independent way. Also necessary for file viewing to work
6326 well inside Emacs buffers.
6335 well inside Emacs buffers.
6327 (page): Added checks for being in an emacs buffer.
6336 (page): Added checks for being in an emacs buffer.
6328 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6337 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6329 same bug in iplib.
6338 same bug in iplib.
6330
6339
6331 2002-02-18 Fernando Perez <fperez@colorado.edu>
6340 2002-02-18 Fernando Perez <fperez@colorado.edu>
6332
6341
6333 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6342 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6334 of readline so that IPython can work inside an Emacs buffer.
6343 of readline so that IPython can work inside an Emacs buffer.
6335
6344
6336 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6345 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6337 method signatures (they weren't really bugs, but it looks cleaner
6346 method signatures (they weren't really bugs, but it looks cleaner
6338 and keeps PyChecker happy).
6347 and keeps PyChecker happy).
6339
6348
6340 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6349 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6341 for implementing various user-defined hooks. Currently only
6350 for implementing various user-defined hooks. Currently only
6342 display is done.
6351 display is done.
6343
6352
6344 * IPython/Prompts.py (CachedOutput._display): changed display
6353 * IPython/Prompts.py (CachedOutput._display): changed display
6345 functions so that they can be dynamically changed by users easily.
6354 functions so that they can be dynamically changed by users easily.
6346
6355
6347 * IPython/Extensions/numeric_formats.py (num_display): added an
6356 * IPython/Extensions/numeric_formats.py (num_display): added an
6348 extension for printing NumPy arrays in flexible manners. It
6357 extension for printing NumPy arrays in flexible manners. It
6349 doesn't do anything yet, but all the structure is in
6358 doesn't do anything yet, but all the structure is in
6350 place. Ultimately the plan is to implement output format control
6359 place. Ultimately the plan is to implement output format control
6351 like in Octave.
6360 like in Octave.
6352
6361
6353 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6362 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6354 methods are found at run-time by all the automatic machinery.
6363 methods are found at run-time by all the automatic machinery.
6355
6364
6356 2002-02-17 Fernando Perez <fperez@colorado.edu>
6365 2002-02-17 Fernando Perez <fperez@colorado.edu>
6357
6366
6358 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6367 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6359 whole file a little.
6368 whole file a little.
6360
6369
6361 * ToDo: closed this document. Now there's a new_design.lyx
6370 * ToDo: closed this document. Now there's a new_design.lyx
6362 document for all new ideas. Added making a pdf of it for the
6371 document for all new ideas. Added making a pdf of it for the
6363 end-user distro.
6372 end-user distro.
6364
6373
6365 * IPython/Logger.py (Logger.switch_log): Created this to replace
6374 * IPython/Logger.py (Logger.switch_log): Created this to replace
6366 logon() and logoff(). It also fixes a nasty crash reported by
6375 logon() and logoff(). It also fixes a nasty crash reported by
6367 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6376 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6368
6377
6369 * IPython/iplib.py (complete): got auto-completion to work with
6378 * IPython/iplib.py (complete): got auto-completion to work with
6370 automagic (I had wanted this for a long time).
6379 automagic (I had wanted this for a long time).
6371
6380
6372 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6381 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6373 to @file, since file() is now a builtin and clashes with automagic
6382 to @file, since file() is now a builtin and clashes with automagic
6374 for @file.
6383 for @file.
6375
6384
6376 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6385 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6377 of this was previously in iplib, which had grown to more than 2000
6386 of this was previously in iplib, which had grown to more than 2000
6378 lines, way too long. No new functionality, but it makes managing
6387 lines, way too long. No new functionality, but it makes managing
6379 the code a bit easier.
6388 the code a bit easier.
6380
6389
6381 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6390 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6382 information to crash reports.
6391 information to crash reports.
6383
6392
6384 2002-02-12 Fernando Perez <fperez@colorado.edu>
6393 2002-02-12 Fernando Perez <fperez@colorado.edu>
6385
6394
6386 * Released 0.2.5.
6395 * Released 0.2.5.
6387
6396
6388 2002-02-11 Fernando Perez <fperez@colorado.edu>
6397 2002-02-11 Fernando Perez <fperez@colorado.edu>
6389
6398
6390 * Wrote a relatively complete Windows installer. It puts
6399 * Wrote a relatively complete Windows installer. It puts
6391 everything in place, creates Start Menu entries and fixes the
6400 everything in place, creates Start Menu entries and fixes the
6392 color issues. Nothing fancy, but it works.
6401 color issues. Nothing fancy, but it works.
6393
6402
6394 2002-02-10 Fernando Perez <fperez@colorado.edu>
6403 2002-02-10 Fernando Perez <fperez@colorado.edu>
6395
6404
6396 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6405 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6397 os.path.expanduser() call so that we can type @run ~/myfile.py and
6406 os.path.expanduser() call so that we can type @run ~/myfile.py and
6398 have thigs work as expected.
6407 have thigs work as expected.
6399
6408
6400 * IPython/genutils.py (page): fixed exception handling so things
6409 * IPython/genutils.py (page): fixed exception handling so things
6401 work both in Unix and Windows correctly. Quitting a pager triggers
6410 work both in Unix and Windows correctly. Quitting a pager triggers
6402 an IOError/broken pipe in Unix, and in windows not finding a pager
6411 an IOError/broken pipe in Unix, and in windows not finding a pager
6403 is also an IOError, so I had to actually look at the return value
6412 is also an IOError, so I had to actually look at the return value
6404 of the exception, not just the exception itself. Should be ok now.
6413 of the exception, not just the exception itself. Should be ok now.
6405
6414
6406 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6415 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6407 modified to allow case-insensitive color scheme changes.
6416 modified to allow case-insensitive color scheme changes.
6408
6417
6409 2002-02-09 Fernando Perez <fperez@colorado.edu>
6418 2002-02-09 Fernando Perez <fperez@colorado.edu>
6410
6419
6411 * IPython/genutils.py (native_line_ends): new function to leave
6420 * IPython/genutils.py (native_line_ends): new function to leave
6412 user config files with os-native line-endings.
6421 user config files with os-native line-endings.
6413
6422
6414 * README and manual updates.
6423 * README and manual updates.
6415
6424
6416 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6425 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6417 instead of StringType to catch Unicode strings.
6426 instead of StringType to catch Unicode strings.
6418
6427
6419 * IPython/genutils.py (filefind): fixed bug for paths with
6428 * IPython/genutils.py (filefind): fixed bug for paths with
6420 embedded spaces (very common in Windows).
6429 embedded spaces (very common in Windows).
6421
6430
6422 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6431 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6423 files under Windows, so that they get automatically associated
6432 files under Windows, so that they get automatically associated
6424 with a text editor. Windows makes it a pain to handle
6433 with a text editor. Windows makes it a pain to handle
6425 extension-less files.
6434 extension-less files.
6426
6435
6427 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6436 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6428 warning about readline only occur for Posix. In Windows there's no
6437 warning about readline only occur for Posix. In Windows there's no
6429 way to get readline, so why bother with the warning.
6438 way to get readline, so why bother with the warning.
6430
6439
6431 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6440 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6432 for __str__ instead of dir(self), since dir() changed in 2.2.
6441 for __str__ instead of dir(self), since dir() changed in 2.2.
6433
6442
6434 * Ported to Windows! Tested on XP, I suspect it should work fine
6443 * Ported to Windows! Tested on XP, I suspect it should work fine
6435 on NT/2000, but I don't think it will work on 98 et al. That
6444 on NT/2000, but I don't think it will work on 98 et al. That
6436 series of Windows is such a piece of junk anyway that I won't try
6445 series of Windows is such a piece of junk anyway that I won't try
6437 porting it there. The XP port was straightforward, showed a few
6446 porting it there. The XP port was straightforward, showed a few
6438 bugs here and there (fixed all), in particular some string
6447 bugs here and there (fixed all), in particular some string
6439 handling stuff which required considering Unicode strings (which
6448 handling stuff which required considering Unicode strings (which
6440 Windows uses). This is good, but hasn't been too tested :) No
6449 Windows uses). This is good, but hasn't been too tested :) No
6441 fancy installer yet, I'll put a note in the manual so people at
6450 fancy installer yet, I'll put a note in the manual so people at
6442 least make manually a shortcut.
6451 least make manually a shortcut.
6443
6452
6444 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6453 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6445 into a single one, "colors". This now controls both prompt and
6454 into a single one, "colors". This now controls both prompt and
6446 exception color schemes, and can be changed both at startup
6455 exception color schemes, and can be changed both at startup
6447 (either via command-line switches or via ipythonrc files) and at
6456 (either via command-line switches or via ipythonrc files) and at
6448 runtime, with @colors.
6457 runtime, with @colors.
6449 (Magic.magic_run): renamed @prun to @run and removed the old
6458 (Magic.magic_run): renamed @prun to @run and removed the old
6450 @run. The two were too similar to warrant keeping both.
6459 @run. The two were too similar to warrant keeping both.
6451
6460
6452 2002-02-03 Fernando Perez <fperez@colorado.edu>
6461 2002-02-03 Fernando Perez <fperez@colorado.edu>
6453
6462
6454 * IPython/iplib.py (install_first_time): Added comment on how to
6463 * IPython/iplib.py (install_first_time): Added comment on how to
6455 configure the color options for first-time users. Put a <return>
6464 configure the color options for first-time users. Put a <return>
6456 request at the end so that small-terminal users get a chance to
6465 request at the end so that small-terminal users get a chance to
6457 read the startup info.
6466 read the startup info.
6458
6467
6459 2002-01-23 Fernando Perez <fperez@colorado.edu>
6468 2002-01-23 Fernando Perez <fperez@colorado.edu>
6460
6469
6461 * IPython/iplib.py (CachedOutput.update): Changed output memory
6470 * IPython/iplib.py (CachedOutput.update): Changed output memory
6462 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6471 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6463 input history we still use _i. Did this b/c these variable are
6472 input history we still use _i. Did this b/c these variable are
6464 very commonly used in interactive work, so the less we need to
6473 very commonly used in interactive work, so the less we need to
6465 type the better off we are.
6474 type the better off we are.
6466 (Magic.magic_prun): updated @prun to better handle the namespaces
6475 (Magic.magic_prun): updated @prun to better handle the namespaces
6467 the file will run in, including a fix for __name__ not being set
6476 the file will run in, including a fix for __name__ not being set
6468 before.
6477 before.
6469
6478
6470 2002-01-20 Fernando Perez <fperez@colorado.edu>
6479 2002-01-20 Fernando Perez <fperez@colorado.edu>
6471
6480
6472 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6481 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6473 extra garbage for Python 2.2. Need to look more carefully into
6482 extra garbage for Python 2.2. Need to look more carefully into
6474 this later.
6483 this later.
6475
6484
6476 2002-01-19 Fernando Perez <fperez@colorado.edu>
6485 2002-01-19 Fernando Perez <fperez@colorado.edu>
6477
6486
6478 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6487 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6479 display SyntaxError exceptions properly formatted when they occur
6488 display SyntaxError exceptions properly formatted when they occur
6480 (they can be triggered by imported code).
6489 (they can be triggered by imported code).
6481
6490
6482 2002-01-18 Fernando Perez <fperez@colorado.edu>
6491 2002-01-18 Fernando Perez <fperez@colorado.edu>
6483
6492
6484 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6493 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6485 SyntaxError exceptions are reported nicely formatted, instead of
6494 SyntaxError exceptions are reported nicely formatted, instead of
6486 spitting out only offset information as before.
6495 spitting out only offset information as before.
6487 (Magic.magic_prun): Added the @prun function for executing
6496 (Magic.magic_prun): Added the @prun function for executing
6488 programs with command line args inside IPython.
6497 programs with command line args inside IPython.
6489
6498
6490 2002-01-16 Fernando Perez <fperez@colorado.edu>
6499 2002-01-16 Fernando Perez <fperez@colorado.edu>
6491
6500
6492 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6501 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6493 to *not* include the last item given in a range. This brings their
6502 to *not* include the last item given in a range. This brings their
6494 behavior in line with Python's slicing:
6503 behavior in line with Python's slicing:
6495 a[n1:n2] -> a[n1]...a[n2-1]
6504 a[n1:n2] -> a[n1]...a[n2-1]
6496 It may be a bit less convenient, but I prefer to stick to Python's
6505 It may be a bit less convenient, but I prefer to stick to Python's
6497 conventions *everywhere*, so users never have to wonder.
6506 conventions *everywhere*, so users never have to wonder.
6498 (Magic.magic_macro): Added @macro function to ease the creation of
6507 (Magic.magic_macro): Added @macro function to ease the creation of
6499 macros.
6508 macros.
6500
6509
6501 2002-01-05 Fernando Perez <fperez@colorado.edu>
6510 2002-01-05 Fernando Perez <fperez@colorado.edu>
6502
6511
6503 * Released 0.2.4.
6512 * Released 0.2.4.
6504
6513
6505 * IPython/iplib.py (Magic.magic_pdef):
6514 * IPython/iplib.py (Magic.magic_pdef):
6506 (InteractiveShell.safe_execfile): report magic lines and error
6515 (InteractiveShell.safe_execfile): report magic lines and error
6507 lines without line numbers so one can easily copy/paste them for
6516 lines without line numbers so one can easily copy/paste them for
6508 re-execution.
6517 re-execution.
6509
6518
6510 * Updated manual with recent changes.
6519 * Updated manual with recent changes.
6511
6520
6512 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6521 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6513 docstring printing when class? is called. Very handy for knowing
6522 docstring printing when class? is called. Very handy for knowing
6514 how to create class instances (as long as __init__ is well
6523 how to create class instances (as long as __init__ is well
6515 documented, of course :)
6524 documented, of course :)
6516 (Magic.magic_doc): print both class and constructor docstrings.
6525 (Magic.magic_doc): print both class and constructor docstrings.
6517 (Magic.magic_pdef): give constructor info if passed a class and
6526 (Magic.magic_pdef): give constructor info if passed a class and
6518 __call__ info for callable object instances.
6527 __call__ info for callable object instances.
6519
6528
6520 2002-01-04 Fernando Perez <fperez@colorado.edu>
6529 2002-01-04 Fernando Perez <fperez@colorado.edu>
6521
6530
6522 * Made deep_reload() off by default. It doesn't always work
6531 * Made deep_reload() off by default. It doesn't always work
6523 exactly as intended, so it's probably safer to have it off. It's
6532 exactly as intended, so it's probably safer to have it off. It's
6524 still available as dreload() anyway, so nothing is lost.
6533 still available as dreload() anyway, so nothing is lost.
6525
6534
6526 2002-01-02 Fernando Perez <fperez@colorado.edu>
6535 2002-01-02 Fernando Perez <fperez@colorado.edu>
6527
6536
6528 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6537 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6529 so I wanted an updated release).
6538 so I wanted an updated release).
6530
6539
6531 2001-12-27 Fernando Perez <fperez@colorado.edu>
6540 2001-12-27 Fernando Perez <fperez@colorado.edu>
6532
6541
6533 * IPython/iplib.py (InteractiveShell.interact): Added the original
6542 * IPython/iplib.py (InteractiveShell.interact): Added the original
6534 code from 'code.py' for this module in order to change the
6543 code from 'code.py' for this module in order to change the
6535 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6544 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6536 the history cache would break when the user hit Ctrl-C, and
6545 the history cache would break when the user hit Ctrl-C, and
6537 interact() offers no way to add any hooks to it.
6546 interact() offers no way to add any hooks to it.
6538
6547
6539 2001-12-23 Fernando Perez <fperez@colorado.edu>
6548 2001-12-23 Fernando Perez <fperez@colorado.edu>
6540
6549
6541 * setup.py: added check for 'MANIFEST' before trying to remove
6550 * setup.py: added check for 'MANIFEST' before trying to remove
6542 it. Thanks to Sean Reifschneider.
6551 it. Thanks to Sean Reifschneider.
6543
6552
6544 2001-12-22 Fernando Perez <fperez@colorado.edu>
6553 2001-12-22 Fernando Perez <fperez@colorado.edu>
6545
6554
6546 * Released 0.2.2.
6555 * Released 0.2.2.
6547
6556
6548 * Finished (reasonably) writing the manual. Later will add the
6557 * Finished (reasonably) writing the manual. Later will add the
6549 python-standard navigation stylesheets, but for the time being
6558 python-standard navigation stylesheets, but for the time being
6550 it's fairly complete. Distribution will include html and pdf
6559 it's fairly complete. Distribution will include html and pdf
6551 versions.
6560 versions.
6552
6561
6553 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6562 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6554 (MayaVi author).
6563 (MayaVi author).
6555
6564
6556 2001-12-21 Fernando Perez <fperez@colorado.edu>
6565 2001-12-21 Fernando Perez <fperez@colorado.edu>
6557
6566
6558 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6567 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6559 good public release, I think (with the manual and the distutils
6568 good public release, I think (with the manual and the distutils
6560 installer). The manual can use some work, but that can go
6569 installer). The manual can use some work, but that can go
6561 slowly. Otherwise I think it's quite nice for end users. Next
6570 slowly. Otherwise I think it's quite nice for end users. Next
6562 summer, rewrite the guts of it...
6571 summer, rewrite the guts of it...
6563
6572
6564 * Changed format of ipythonrc files to use whitespace as the
6573 * Changed format of ipythonrc files to use whitespace as the
6565 separator instead of an explicit '='. Cleaner.
6574 separator instead of an explicit '='. Cleaner.
6566
6575
6567 2001-12-20 Fernando Perez <fperez@colorado.edu>
6576 2001-12-20 Fernando Perez <fperez@colorado.edu>
6568
6577
6569 * Started a manual in LyX. For now it's just a quick merge of the
6578 * Started a manual in LyX. For now it's just a quick merge of the
6570 various internal docstrings and READMEs. Later it may grow into a
6579 various internal docstrings and READMEs. Later it may grow into a
6571 nice, full-blown manual.
6580 nice, full-blown manual.
6572
6581
6573 * Set up a distutils based installer. Installation should now be
6582 * Set up a distutils based installer. Installation should now be
6574 trivially simple for end-users.
6583 trivially simple for end-users.
6575
6584
6576 2001-12-11 Fernando Perez <fperez@colorado.edu>
6585 2001-12-11 Fernando Perez <fperez@colorado.edu>
6577
6586
6578 * Released 0.2.0. First public release, announced it at
6587 * Released 0.2.0. First public release, announced it at
6579 comp.lang.python. From now on, just bugfixes...
6588 comp.lang.python. From now on, just bugfixes...
6580
6589
6581 * Went through all the files, set copyright/license notices and
6590 * Went through all the files, set copyright/license notices and
6582 cleaned up things. Ready for release.
6591 cleaned up things. Ready for release.
6583
6592
6584 2001-12-10 Fernando Perez <fperez@colorado.edu>
6593 2001-12-10 Fernando Perez <fperez@colorado.edu>
6585
6594
6586 * Changed the first-time installer not to use tarfiles. It's more
6595 * Changed the first-time installer not to use tarfiles. It's more
6587 robust now and less unix-dependent. Also makes it easier for
6596 robust now and less unix-dependent. Also makes it easier for
6588 people to later upgrade versions.
6597 people to later upgrade versions.
6589
6598
6590 * Changed @exit to @abort to reflect the fact that it's pretty
6599 * Changed @exit to @abort to reflect the fact that it's pretty
6591 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6600 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6592 becomes significant only when IPyhton is embedded: in that case,
6601 becomes significant only when IPyhton is embedded: in that case,
6593 C-D closes IPython only, but @abort kills the enclosing program
6602 C-D closes IPython only, but @abort kills the enclosing program
6594 too (unless it had called IPython inside a try catching
6603 too (unless it had called IPython inside a try catching
6595 SystemExit).
6604 SystemExit).
6596
6605
6597 * Created Shell module which exposes the actuall IPython Shell
6606 * Created Shell module which exposes the actuall IPython Shell
6598 classes, currently the normal and the embeddable one. This at
6607 classes, currently the normal and the embeddable one. This at
6599 least offers a stable interface we won't need to change when
6608 least offers a stable interface we won't need to change when
6600 (later) the internals are rewritten. That rewrite will be confined
6609 (later) the internals are rewritten. That rewrite will be confined
6601 to iplib and ipmaker, but the Shell interface should remain as is.
6610 to iplib and ipmaker, but the Shell interface should remain as is.
6602
6611
6603 * Added embed module which offers an embeddable IPShell object,
6612 * Added embed module which offers an embeddable IPShell object,
6604 useful to fire up IPython *inside* a running program. Great for
6613 useful to fire up IPython *inside* a running program. Great for
6605 debugging or dynamical data analysis.
6614 debugging or dynamical data analysis.
6606
6615
6607 2001-12-08 Fernando Perez <fperez@colorado.edu>
6616 2001-12-08 Fernando Perez <fperez@colorado.edu>
6608
6617
6609 * Fixed small bug preventing seeing info from methods of defined
6618 * Fixed small bug preventing seeing info from methods of defined
6610 objects (incorrect namespace in _ofind()).
6619 objects (incorrect namespace in _ofind()).
6611
6620
6612 * Documentation cleanup. Moved the main usage docstrings to a
6621 * Documentation cleanup. Moved the main usage docstrings to a
6613 separate file, usage.py (cleaner to maintain, and hopefully in the
6622 separate file, usage.py (cleaner to maintain, and hopefully in the
6614 future some perlpod-like way of producing interactive, man and
6623 future some perlpod-like way of producing interactive, man and
6615 html docs out of it will be found).
6624 html docs out of it will be found).
6616
6625
6617 * Added @profile to see your profile at any time.
6626 * Added @profile to see your profile at any time.
6618
6627
6619 * Added @p as an alias for 'print'. It's especially convenient if
6628 * Added @p as an alias for 'print'. It's especially convenient if
6620 using automagic ('p x' prints x).
6629 using automagic ('p x' prints x).
6621
6630
6622 * Small cleanups and fixes after a pychecker run.
6631 * Small cleanups and fixes after a pychecker run.
6623
6632
6624 * Changed the @cd command to handle @cd - and @cd -<n> for
6633 * Changed the @cd command to handle @cd - and @cd -<n> for
6625 visiting any directory in _dh.
6634 visiting any directory in _dh.
6626
6635
6627 * Introduced _dh, a history of visited directories. @dhist prints
6636 * Introduced _dh, a history of visited directories. @dhist prints
6628 it out with numbers.
6637 it out with numbers.
6629
6638
6630 2001-12-07 Fernando Perez <fperez@colorado.edu>
6639 2001-12-07 Fernando Perez <fperez@colorado.edu>
6631
6640
6632 * Released 0.1.22
6641 * Released 0.1.22
6633
6642
6634 * Made initialization a bit more robust against invalid color
6643 * Made initialization a bit more robust against invalid color
6635 options in user input (exit, not traceback-crash).
6644 options in user input (exit, not traceback-crash).
6636
6645
6637 * Changed the bug crash reporter to write the report only in the
6646 * Changed the bug crash reporter to write the report only in the
6638 user's .ipython directory. That way IPython won't litter people's
6647 user's .ipython directory. That way IPython won't litter people's
6639 hard disks with crash files all over the place. Also print on
6648 hard disks with crash files all over the place. Also print on
6640 screen the necessary mail command.
6649 screen the necessary mail command.
6641
6650
6642 * With the new ultraTB, implemented LightBG color scheme for light
6651 * With the new ultraTB, implemented LightBG color scheme for light
6643 background terminals. A lot of people like white backgrounds, so I
6652 background terminals. A lot of people like white backgrounds, so I
6644 guess we should at least give them something readable.
6653 guess we should at least give them something readable.
6645
6654
6646 2001-12-06 Fernando Perez <fperez@colorado.edu>
6655 2001-12-06 Fernando Perez <fperez@colorado.edu>
6647
6656
6648 * Modified the structure of ultraTB. Now there's a proper class
6657 * Modified the structure of ultraTB. Now there's a proper class
6649 for tables of color schemes which allow adding schemes easily and
6658 for tables of color schemes which allow adding schemes easily and
6650 switching the active scheme without creating a new instance every
6659 switching the active scheme without creating a new instance every
6651 time (which was ridiculous). The syntax for creating new schemes
6660 time (which was ridiculous). The syntax for creating new schemes
6652 is also cleaner. I think ultraTB is finally done, with a clean
6661 is also cleaner. I think ultraTB is finally done, with a clean
6653 class structure. Names are also much cleaner (now there's proper
6662 class structure. Names are also much cleaner (now there's proper
6654 color tables, no need for every variable to also have 'color' in
6663 color tables, no need for every variable to also have 'color' in
6655 its name).
6664 its name).
6656
6665
6657 * Broke down genutils into separate files. Now genutils only
6666 * Broke down genutils into separate files. Now genutils only
6658 contains utility functions, and classes have been moved to their
6667 contains utility functions, and classes have been moved to their
6659 own files (they had enough independent functionality to warrant
6668 own files (they had enough independent functionality to warrant
6660 it): ConfigLoader, OutputTrap, Struct.
6669 it): ConfigLoader, OutputTrap, Struct.
6661
6670
6662 2001-12-05 Fernando Perez <fperez@colorado.edu>
6671 2001-12-05 Fernando Perez <fperez@colorado.edu>
6663
6672
6664 * IPython turns 21! Released version 0.1.21, as a candidate for
6673 * IPython turns 21! Released version 0.1.21, as a candidate for
6665 public consumption. If all goes well, release in a few days.
6674 public consumption. If all goes well, release in a few days.
6666
6675
6667 * Fixed path bug (files in Extensions/ directory wouldn't be found
6676 * Fixed path bug (files in Extensions/ directory wouldn't be found
6668 unless IPython/ was explicitly in sys.path).
6677 unless IPython/ was explicitly in sys.path).
6669
6678
6670 * Extended the FlexCompleter class as MagicCompleter to allow
6679 * Extended the FlexCompleter class as MagicCompleter to allow
6671 completion of @-starting lines.
6680 completion of @-starting lines.
6672
6681
6673 * Created __release__.py file as a central repository for release
6682 * Created __release__.py file as a central repository for release
6674 info that other files can read from.
6683 info that other files can read from.
6675
6684
6676 * Fixed small bug in logging: when logging was turned on in
6685 * Fixed small bug in logging: when logging was turned on in
6677 mid-session, old lines with special meanings (!@?) were being
6686 mid-session, old lines with special meanings (!@?) were being
6678 logged without the prepended comment, which is necessary since
6687 logged without the prepended comment, which is necessary since
6679 they are not truly valid python syntax. This should make session
6688 they are not truly valid python syntax. This should make session
6680 restores produce less errors.
6689 restores produce less errors.
6681
6690
6682 * The namespace cleanup forced me to make a FlexCompleter class
6691 * The namespace cleanup forced me to make a FlexCompleter class
6683 which is nothing but a ripoff of rlcompleter, but with selectable
6692 which is nothing but a ripoff of rlcompleter, but with selectable
6684 namespace (rlcompleter only works in __main__.__dict__). I'll try
6693 namespace (rlcompleter only works in __main__.__dict__). I'll try
6685 to submit a note to the authors to see if this change can be
6694 to submit a note to the authors to see if this change can be
6686 incorporated in future rlcompleter releases (Dec.6: done)
6695 incorporated in future rlcompleter releases (Dec.6: done)
6687
6696
6688 * More fixes to namespace handling. It was a mess! Now all
6697 * More fixes to namespace handling. It was a mess! Now all
6689 explicit references to __main__.__dict__ are gone (except when
6698 explicit references to __main__.__dict__ are gone (except when
6690 really needed) and everything is handled through the namespace
6699 really needed) and everything is handled through the namespace
6691 dicts in the IPython instance. We seem to be getting somewhere
6700 dicts in the IPython instance. We seem to be getting somewhere
6692 with this, finally...
6701 with this, finally...
6693
6702
6694 * Small documentation updates.
6703 * Small documentation updates.
6695
6704
6696 * Created the Extensions directory under IPython (with an
6705 * Created the Extensions directory under IPython (with an
6697 __init__.py). Put the PhysicalQ stuff there. This directory should
6706 __init__.py). Put the PhysicalQ stuff there. This directory should
6698 be used for all special-purpose extensions.
6707 be used for all special-purpose extensions.
6699
6708
6700 * File renaming:
6709 * File renaming:
6701 ipythonlib --> ipmaker
6710 ipythonlib --> ipmaker
6702 ipplib --> iplib
6711 ipplib --> iplib
6703 This makes a bit more sense in terms of what these files actually do.
6712 This makes a bit more sense in terms of what these files actually do.
6704
6713
6705 * Moved all the classes and functions in ipythonlib to ipplib, so
6714 * Moved all the classes and functions in ipythonlib to ipplib, so
6706 now ipythonlib only has make_IPython(). This will ease up its
6715 now ipythonlib only has make_IPython(). This will ease up its
6707 splitting in smaller functional chunks later.
6716 splitting in smaller functional chunks later.
6708
6717
6709 * Cleaned up (done, I think) output of @whos. Better column
6718 * Cleaned up (done, I think) output of @whos. Better column
6710 formatting, and now shows str(var) for as much as it can, which is
6719 formatting, and now shows str(var) for as much as it can, which is
6711 typically what one gets with a 'print var'.
6720 typically what one gets with a 'print var'.
6712
6721
6713 2001-12-04 Fernando Perez <fperez@colorado.edu>
6722 2001-12-04 Fernando Perez <fperez@colorado.edu>
6714
6723
6715 * Fixed namespace problems. Now builtin/IPyhton/user names get
6724 * Fixed namespace problems. Now builtin/IPyhton/user names get
6716 properly reported in their namespace. Internal namespace handling
6725 properly reported in their namespace. Internal namespace handling
6717 is finally getting decent (not perfect yet, but much better than
6726 is finally getting decent (not perfect yet, but much better than
6718 the ad-hoc mess we had).
6727 the ad-hoc mess we had).
6719
6728
6720 * Removed -exit option. If people just want to run a python
6729 * Removed -exit option. If people just want to run a python
6721 script, that's what the normal interpreter is for. Less
6730 script, that's what the normal interpreter is for. Less
6722 unnecessary options, less chances for bugs.
6731 unnecessary options, less chances for bugs.
6723
6732
6724 * Added a crash handler which generates a complete post-mortem if
6733 * Added a crash handler which generates a complete post-mortem if
6725 IPython crashes. This will help a lot in tracking bugs down the
6734 IPython crashes. This will help a lot in tracking bugs down the
6726 road.
6735 road.
6727
6736
6728 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6737 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6729 which were boud to functions being reassigned would bypass the
6738 which were boud to functions being reassigned would bypass the
6730 logger, breaking the sync of _il with the prompt counter. This
6739 logger, breaking the sync of _il with the prompt counter. This
6731 would then crash IPython later when a new line was logged.
6740 would then crash IPython later when a new line was logged.
6732
6741
6733 2001-12-02 Fernando Perez <fperez@colorado.edu>
6742 2001-12-02 Fernando Perez <fperez@colorado.edu>
6734
6743
6735 * Made IPython a package. This means people don't have to clutter
6744 * Made IPython a package. This means people don't have to clutter
6736 their sys.path with yet another directory. Changed the INSTALL
6745 their sys.path with yet another directory. Changed the INSTALL
6737 file accordingly.
6746 file accordingly.
6738
6747
6739 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6748 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6740 sorts its output (so @who shows it sorted) and @whos formats the
6749 sorts its output (so @who shows it sorted) and @whos formats the
6741 table according to the width of the first column. Nicer, easier to
6750 table according to the width of the first column. Nicer, easier to
6742 read. Todo: write a generic table_format() which takes a list of
6751 read. Todo: write a generic table_format() which takes a list of
6743 lists and prints it nicely formatted, with optional row/column
6752 lists and prints it nicely formatted, with optional row/column
6744 separators and proper padding and justification.
6753 separators and proper padding and justification.
6745
6754
6746 * Released 0.1.20
6755 * Released 0.1.20
6747
6756
6748 * Fixed bug in @log which would reverse the inputcache list (a
6757 * Fixed bug in @log which would reverse the inputcache list (a
6749 copy operation was missing).
6758 copy operation was missing).
6750
6759
6751 * Code cleanup. @config was changed to use page(). Better, since
6760 * Code cleanup. @config was changed to use page(). Better, since
6752 its output is always quite long.
6761 its output is always quite long.
6753
6762
6754 * Itpl is back as a dependency. I was having too many problems
6763 * Itpl is back as a dependency. I was having too many problems
6755 getting the parametric aliases to work reliably, and it's just
6764 getting the parametric aliases to work reliably, and it's just
6756 easier to code weird string operations with it than playing %()s
6765 easier to code weird string operations with it than playing %()s
6757 games. It's only ~6k, so I don't think it's too big a deal.
6766 games. It's only ~6k, so I don't think it's too big a deal.
6758
6767
6759 * Found (and fixed) a very nasty bug with history. !lines weren't
6768 * Found (and fixed) a very nasty bug with history. !lines weren't
6760 getting cached, and the out of sync caches would crash
6769 getting cached, and the out of sync caches would crash
6761 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6770 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6762 division of labor a bit better. Bug fixed, cleaner structure.
6771 division of labor a bit better. Bug fixed, cleaner structure.
6763
6772
6764 2001-12-01 Fernando Perez <fperez@colorado.edu>
6773 2001-12-01 Fernando Perez <fperez@colorado.edu>
6765
6774
6766 * Released 0.1.19
6775 * Released 0.1.19
6767
6776
6768 * Added option -n to @hist to prevent line number printing. Much
6777 * Added option -n to @hist to prevent line number printing. Much
6769 easier to copy/paste code this way.
6778 easier to copy/paste code this way.
6770
6779
6771 * Created global _il to hold the input list. Allows easy
6780 * Created global _il to hold the input list. Allows easy
6772 re-execution of blocks of code by slicing it (inspired by Janko's
6781 re-execution of blocks of code by slicing it (inspired by Janko's
6773 comment on 'macros').
6782 comment on 'macros').
6774
6783
6775 * Small fixes and doc updates.
6784 * Small fixes and doc updates.
6776
6785
6777 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6786 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6778 much too fragile with automagic. Handles properly multi-line
6787 much too fragile with automagic. Handles properly multi-line
6779 statements and takes parameters.
6788 statements and takes parameters.
6780
6789
6781 2001-11-30 Fernando Perez <fperez@colorado.edu>
6790 2001-11-30 Fernando Perez <fperez@colorado.edu>
6782
6791
6783 * Version 0.1.18 released.
6792 * Version 0.1.18 released.
6784
6793
6785 * Fixed nasty namespace bug in initial module imports.
6794 * Fixed nasty namespace bug in initial module imports.
6786
6795
6787 * Added copyright/license notes to all code files (except
6796 * Added copyright/license notes to all code files (except
6788 DPyGetOpt). For the time being, LGPL. That could change.
6797 DPyGetOpt). For the time being, LGPL. That could change.
6789
6798
6790 * Rewrote a much nicer README, updated INSTALL, cleaned up
6799 * Rewrote a much nicer README, updated INSTALL, cleaned up
6791 ipythonrc-* samples.
6800 ipythonrc-* samples.
6792
6801
6793 * Overall code/documentation cleanup. Basically ready for
6802 * Overall code/documentation cleanup. Basically ready for
6794 release. Only remaining thing: licence decision (LGPL?).
6803 release. Only remaining thing: licence decision (LGPL?).
6795
6804
6796 * Converted load_config to a class, ConfigLoader. Now recursion
6805 * Converted load_config to a class, ConfigLoader. Now recursion
6797 control is better organized. Doesn't include the same file twice.
6806 control is better organized. Doesn't include the same file twice.
6798
6807
6799 2001-11-29 Fernando Perez <fperez@colorado.edu>
6808 2001-11-29 Fernando Perez <fperez@colorado.edu>
6800
6809
6801 * Got input history working. Changed output history variables from
6810 * Got input history working. Changed output history variables from
6802 _p to _o so that _i is for input and _o for output. Just cleaner
6811 _p to _o so that _i is for input and _o for output. Just cleaner
6803 convention.
6812 convention.
6804
6813
6805 * Implemented parametric aliases. This pretty much allows the
6814 * Implemented parametric aliases. This pretty much allows the
6806 alias system to offer full-blown shell convenience, I think.
6815 alias system to offer full-blown shell convenience, I think.
6807
6816
6808 * Version 0.1.17 released, 0.1.18 opened.
6817 * Version 0.1.17 released, 0.1.18 opened.
6809
6818
6810 * dot_ipython/ipythonrc (alias): added documentation.
6819 * dot_ipython/ipythonrc (alias): added documentation.
6811 (xcolor): Fixed small bug (xcolors -> xcolor)
6820 (xcolor): Fixed small bug (xcolors -> xcolor)
6812
6821
6813 * Changed the alias system. Now alias is a magic command to define
6822 * Changed the alias system. Now alias is a magic command to define
6814 aliases just like the shell. Rationale: the builtin magics should
6823 aliases just like the shell. Rationale: the builtin magics should
6815 be there for things deeply connected to IPython's
6824 be there for things deeply connected to IPython's
6816 architecture. And this is a much lighter system for what I think
6825 architecture. And this is a much lighter system for what I think
6817 is the really important feature: allowing users to define quickly
6826 is the really important feature: allowing users to define quickly
6818 magics that will do shell things for them, so they can customize
6827 magics that will do shell things for them, so they can customize
6819 IPython easily to match their work habits. If someone is really
6828 IPython easily to match their work habits. If someone is really
6820 desperate to have another name for a builtin alias, they can
6829 desperate to have another name for a builtin alias, they can
6821 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6830 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6822 works.
6831 works.
6823
6832
6824 2001-11-28 Fernando Perez <fperez@colorado.edu>
6833 2001-11-28 Fernando Perez <fperez@colorado.edu>
6825
6834
6826 * Changed @file so that it opens the source file at the proper
6835 * Changed @file so that it opens the source file at the proper
6827 line. Since it uses less, if your EDITOR environment is
6836 line. Since it uses less, if your EDITOR environment is
6828 configured, typing v will immediately open your editor of choice
6837 configured, typing v will immediately open your editor of choice
6829 right at the line where the object is defined. Not as quick as
6838 right at the line where the object is defined. Not as quick as
6830 having a direct @edit command, but for all intents and purposes it
6839 having a direct @edit command, but for all intents and purposes it
6831 works. And I don't have to worry about writing @edit to deal with
6840 works. And I don't have to worry about writing @edit to deal with
6832 all the editors, less does that.
6841 all the editors, less does that.
6833
6842
6834 * Version 0.1.16 released, 0.1.17 opened.
6843 * Version 0.1.16 released, 0.1.17 opened.
6835
6844
6836 * Fixed some nasty bugs in the page/page_dumb combo that could
6845 * Fixed some nasty bugs in the page/page_dumb combo that could
6837 crash IPython.
6846 crash IPython.
6838
6847
6839 2001-11-27 Fernando Perez <fperez@colorado.edu>
6848 2001-11-27 Fernando Perez <fperez@colorado.edu>
6840
6849
6841 * Version 0.1.15 released, 0.1.16 opened.
6850 * Version 0.1.15 released, 0.1.16 opened.
6842
6851
6843 * Finally got ? and ?? to work for undefined things: now it's
6852 * Finally got ? and ?? to work for undefined things: now it's
6844 possible to type {}.get? and get information about the get method
6853 possible to type {}.get? and get information about the get method
6845 of dicts, or os.path? even if only os is defined (so technically
6854 of dicts, or os.path? even if only os is defined (so technically
6846 os.path isn't). Works at any level. For example, after import os,
6855 os.path isn't). Works at any level. For example, after import os,
6847 os?, os.path?, os.path.abspath? all work. This is great, took some
6856 os?, os.path?, os.path.abspath? all work. This is great, took some
6848 work in _ofind.
6857 work in _ofind.
6849
6858
6850 * Fixed more bugs with logging. The sanest way to do it was to add
6859 * Fixed more bugs with logging. The sanest way to do it was to add
6851 to @log a 'mode' parameter. Killed two in one shot (this mode
6860 to @log a 'mode' parameter. Killed two in one shot (this mode
6852 option was a request of Janko's). I think it's finally clean
6861 option was a request of Janko's). I think it's finally clean
6853 (famous last words).
6862 (famous last words).
6854
6863
6855 * Added a page_dumb() pager which does a decent job of paging on
6864 * Added a page_dumb() pager which does a decent job of paging on
6856 screen, if better things (like less) aren't available. One less
6865 screen, if better things (like less) aren't available. One less
6857 unix dependency (someday maybe somebody will port this to
6866 unix dependency (someday maybe somebody will port this to
6858 windows).
6867 windows).
6859
6868
6860 * Fixed problem in magic_log: would lock of logging out if log
6869 * Fixed problem in magic_log: would lock of logging out if log
6861 creation failed (because it would still think it had succeeded).
6870 creation failed (because it would still think it had succeeded).
6862
6871
6863 * Improved the page() function using curses to auto-detect screen
6872 * Improved the page() function using curses to auto-detect screen
6864 size. Now it can make a much better decision on whether to print
6873 size. Now it can make a much better decision on whether to print
6865 or page a string. Option screen_length was modified: a value 0
6874 or page a string. Option screen_length was modified: a value 0
6866 means auto-detect, and that's the default now.
6875 means auto-detect, and that's the default now.
6867
6876
6868 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6877 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6869 go out. I'll test it for a few days, then talk to Janko about
6878 go out. I'll test it for a few days, then talk to Janko about
6870 licences and announce it.
6879 licences and announce it.
6871
6880
6872 * Fixed the length of the auto-generated ---> prompt which appears
6881 * Fixed the length of the auto-generated ---> prompt which appears
6873 for auto-parens and auto-quotes. Getting this right isn't trivial,
6882 for auto-parens and auto-quotes. Getting this right isn't trivial,
6874 with all the color escapes, different prompt types and optional
6883 with all the color escapes, different prompt types and optional
6875 separators. But it seems to be working in all the combinations.
6884 separators. But it seems to be working in all the combinations.
6876
6885
6877 2001-11-26 Fernando Perez <fperez@colorado.edu>
6886 2001-11-26 Fernando Perez <fperez@colorado.edu>
6878
6887
6879 * Wrote a regexp filter to get option types from the option names
6888 * Wrote a regexp filter to get option types from the option names
6880 string. This eliminates the need to manually keep two duplicate
6889 string. This eliminates the need to manually keep two duplicate
6881 lists.
6890 lists.
6882
6891
6883 * Removed the unneeded check_option_names. Now options are handled
6892 * Removed the unneeded check_option_names. Now options are handled
6884 in a much saner manner and it's easy to visually check that things
6893 in a much saner manner and it's easy to visually check that things
6885 are ok.
6894 are ok.
6886
6895
6887 * Updated version numbers on all files I modified to carry a
6896 * Updated version numbers on all files I modified to carry a
6888 notice so Janko and Nathan have clear version markers.
6897 notice so Janko and Nathan have clear version markers.
6889
6898
6890 * Updated docstring for ultraTB with my changes. I should send
6899 * Updated docstring for ultraTB with my changes. I should send
6891 this to Nathan.
6900 this to Nathan.
6892
6901
6893 * Lots of small fixes. Ran everything through pychecker again.
6902 * Lots of small fixes. Ran everything through pychecker again.
6894
6903
6895 * Made loading of deep_reload an cmd line option. If it's not too
6904 * Made loading of deep_reload an cmd line option. If it's not too
6896 kosher, now people can just disable it. With -nodeep_reload it's
6905 kosher, now people can just disable it. With -nodeep_reload it's
6897 still available as dreload(), it just won't overwrite reload().
6906 still available as dreload(), it just won't overwrite reload().
6898
6907
6899 * Moved many options to the no| form (-opt and -noopt
6908 * Moved many options to the no| form (-opt and -noopt
6900 accepted). Cleaner.
6909 accepted). Cleaner.
6901
6910
6902 * Changed magic_log so that if called with no parameters, it uses
6911 * Changed magic_log so that if called with no parameters, it uses
6903 'rotate' mode. That way auto-generated logs aren't automatically
6912 'rotate' mode. That way auto-generated logs aren't automatically
6904 over-written. For normal logs, now a backup is made if it exists
6913 over-written. For normal logs, now a backup is made if it exists
6905 (only 1 level of backups). A new 'backup' mode was added to the
6914 (only 1 level of backups). A new 'backup' mode was added to the
6906 Logger class to support this. This was a request by Janko.
6915 Logger class to support this. This was a request by Janko.
6907
6916
6908 * Added @logoff/@logon to stop/restart an active log.
6917 * Added @logoff/@logon to stop/restart an active log.
6909
6918
6910 * Fixed a lot of bugs in log saving/replay. It was pretty
6919 * Fixed a lot of bugs in log saving/replay. It was pretty
6911 broken. Now special lines (!@,/) appear properly in the command
6920 broken. Now special lines (!@,/) appear properly in the command
6912 history after a log replay.
6921 history after a log replay.
6913
6922
6914 * Tried and failed to implement full session saving via pickle. My
6923 * Tried and failed to implement full session saving via pickle. My
6915 idea was to pickle __main__.__dict__, but modules can't be
6924 idea was to pickle __main__.__dict__, but modules can't be
6916 pickled. This would be a better alternative to replaying logs, but
6925 pickled. This would be a better alternative to replaying logs, but
6917 seems quite tricky to get to work. Changed -session to be called
6926 seems quite tricky to get to work. Changed -session to be called
6918 -logplay, which more accurately reflects what it does. And if we
6927 -logplay, which more accurately reflects what it does. And if we
6919 ever get real session saving working, -session is now available.
6928 ever get real session saving working, -session is now available.
6920
6929
6921 * Implemented color schemes for prompts also. As for tracebacks,
6930 * Implemented color schemes for prompts also. As for tracebacks,
6922 currently only NoColor and Linux are supported. But now the
6931 currently only NoColor and Linux are supported. But now the
6923 infrastructure is in place, based on a generic ColorScheme
6932 infrastructure is in place, based on a generic ColorScheme
6924 class. So writing and activating new schemes both for the prompts
6933 class. So writing and activating new schemes both for the prompts
6925 and the tracebacks should be straightforward.
6934 and the tracebacks should be straightforward.
6926
6935
6927 * Version 0.1.13 released, 0.1.14 opened.
6936 * Version 0.1.13 released, 0.1.14 opened.
6928
6937
6929 * Changed handling of options for output cache. Now counter is
6938 * Changed handling of options for output cache. Now counter is
6930 hardwired starting at 1 and one specifies the maximum number of
6939 hardwired starting at 1 and one specifies the maximum number of
6931 entries *in the outcache* (not the max prompt counter). This is
6940 entries *in the outcache* (not the max prompt counter). This is
6932 much better, since many statements won't increase the cache
6941 much better, since many statements won't increase the cache
6933 count. It also eliminated some confusing options, now there's only
6942 count. It also eliminated some confusing options, now there's only
6934 one: cache_size.
6943 one: cache_size.
6935
6944
6936 * Added 'alias' magic function and magic_alias option in the
6945 * Added 'alias' magic function and magic_alias option in the
6937 ipythonrc file. Now the user can easily define whatever names he
6946 ipythonrc file. Now the user can easily define whatever names he
6938 wants for the magic functions without having to play weird
6947 wants for the magic functions without having to play weird
6939 namespace games. This gives IPython a real shell-like feel.
6948 namespace games. This gives IPython a real shell-like feel.
6940
6949
6941 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6950 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6942 @ or not).
6951 @ or not).
6943
6952
6944 This was one of the last remaining 'visible' bugs (that I know
6953 This was one of the last remaining 'visible' bugs (that I know
6945 of). I think if I can clean up the session loading so it works
6954 of). I think if I can clean up the session loading so it works
6946 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6955 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6947 about licensing).
6956 about licensing).
6948
6957
6949 2001-11-25 Fernando Perez <fperez@colorado.edu>
6958 2001-11-25 Fernando Perez <fperez@colorado.edu>
6950
6959
6951 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6960 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6952 there's a cleaner distinction between what ? and ?? show.
6961 there's a cleaner distinction between what ? and ?? show.
6953
6962
6954 * Added screen_length option. Now the user can define his own
6963 * Added screen_length option. Now the user can define his own
6955 screen size for page() operations.
6964 screen size for page() operations.
6956
6965
6957 * Implemented magic shell-like functions with automatic code
6966 * Implemented magic shell-like functions with automatic code
6958 generation. Now adding another function is just a matter of adding
6967 generation. Now adding another function is just a matter of adding
6959 an entry to a dict, and the function is dynamically generated at
6968 an entry to a dict, and the function is dynamically generated at
6960 run-time. Python has some really cool features!
6969 run-time. Python has some really cool features!
6961
6970
6962 * Renamed many options to cleanup conventions a little. Now all
6971 * Renamed many options to cleanup conventions a little. Now all
6963 are lowercase, and only underscores where needed. Also in the code
6972 are lowercase, and only underscores where needed. Also in the code
6964 option name tables are clearer.
6973 option name tables are clearer.
6965
6974
6966 * Changed prompts a little. Now input is 'In [n]:' instead of
6975 * Changed prompts a little. Now input is 'In [n]:' instead of
6967 'In[n]:='. This allows it the numbers to be aligned with the
6976 'In[n]:='. This allows it the numbers to be aligned with the
6968 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6977 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6969 Python (it was a Mathematica thing). The '...' continuation prompt
6978 Python (it was a Mathematica thing). The '...' continuation prompt
6970 was also changed a little to align better.
6979 was also changed a little to align better.
6971
6980
6972 * Fixed bug when flushing output cache. Not all _p<n> variables
6981 * Fixed bug when flushing output cache. Not all _p<n> variables
6973 exist, so their deletion needs to be wrapped in a try:
6982 exist, so their deletion needs to be wrapped in a try:
6974
6983
6975 * Figured out how to properly use inspect.formatargspec() (it
6984 * Figured out how to properly use inspect.formatargspec() (it
6976 requires the args preceded by *). So I removed all the code from
6985 requires the args preceded by *). So I removed all the code from
6977 _get_pdef in Magic, which was just replicating that.
6986 _get_pdef in Magic, which was just replicating that.
6978
6987
6979 * Added test to prefilter to allow redefining magic function names
6988 * Added test to prefilter to allow redefining magic function names
6980 as variables. This is ok, since the @ form is always available,
6989 as variables. This is ok, since the @ form is always available,
6981 but whe should allow the user to define a variable called 'ls' if
6990 but whe should allow the user to define a variable called 'ls' if
6982 he needs it.
6991 he needs it.
6983
6992
6984 * Moved the ToDo information from README into a separate ToDo.
6993 * Moved the ToDo information from README into a separate ToDo.
6985
6994
6986 * General code cleanup and small bugfixes. I think it's close to a
6995 * General code cleanup and small bugfixes. I think it's close to a
6987 state where it can be released, obviously with a big 'beta'
6996 state where it can be released, obviously with a big 'beta'
6988 warning on it.
6997 warning on it.
6989
6998
6990 * Got the magic function split to work. Now all magics are defined
6999 * Got the magic function split to work. Now all magics are defined
6991 in a separate class. It just organizes things a bit, and now
7000 in a separate class. It just organizes things a bit, and now
6992 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
7001 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6993 was too long).
7002 was too long).
6994
7003
6995 * Changed @clear to @reset to avoid potential confusions with
7004 * Changed @clear to @reset to avoid potential confusions with
6996 the shell command clear. Also renamed @cl to @clear, which does
7005 the shell command clear. Also renamed @cl to @clear, which does
6997 exactly what people expect it to from their shell experience.
7006 exactly what people expect it to from their shell experience.
6998
7007
6999 Added a check to the @reset command (since it's so
7008 Added a check to the @reset command (since it's so
7000 destructive, it's probably a good idea to ask for confirmation).
7009 destructive, it's probably a good idea to ask for confirmation).
7001 But now reset only works for full namespace resetting. Since the
7010 But now reset only works for full namespace resetting. Since the
7002 del keyword is already there for deleting a few specific
7011 del keyword is already there for deleting a few specific
7003 variables, I don't see the point of having a redundant magic
7012 variables, I don't see the point of having a redundant magic
7004 function for the same task.
7013 function for the same task.
7005
7014
7006 2001-11-24 Fernando Perez <fperez@colorado.edu>
7015 2001-11-24 Fernando Perez <fperez@colorado.edu>
7007
7016
7008 * Updated the builtin docs (esp. the ? ones).
7017 * Updated the builtin docs (esp. the ? ones).
7009
7018
7010 * Ran all the code through pychecker. Not terribly impressed with
7019 * Ran all the code through pychecker. Not terribly impressed with
7011 it: lots of spurious warnings and didn't really find anything of
7020 it: lots of spurious warnings and didn't really find anything of
7012 substance (just a few modules being imported and not used).
7021 substance (just a few modules being imported and not used).
7013
7022
7014 * Implemented the new ultraTB functionality into IPython. New
7023 * Implemented the new ultraTB functionality into IPython. New
7015 option: xcolors. This chooses color scheme. xmode now only selects
7024 option: xcolors. This chooses color scheme. xmode now only selects
7016 between Plain and Verbose. Better orthogonality.
7025 between Plain and Verbose. Better orthogonality.
7017
7026
7018 * Large rewrite of ultraTB. Much cleaner now, with a separation of
7027 * Large rewrite of ultraTB. Much cleaner now, with a separation of
7019 mode and color scheme for the exception handlers. Now it's
7028 mode and color scheme for the exception handlers. Now it's
7020 possible to have the verbose traceback with no coloring.
7029 possible to have the verbose traceback with no coloring.
7021
7030
7022 2001-11-23 Fernando Perez <fperez@colorado.edu>
7031 2001-11-23 Fernando Perez <fperez@colorado.edu>
7023
7032
7024 * Version 0.1.12 released, 0.1.13 opened.
7033 * Version 0.1.12 released, 0.1.13 opened.
7025
7034
7026 * Removed option to set auto-quote and auto-paren escapes by
7035 * Removed option to set auto-quote and auto-paren escapes by
7027 user. The chances of breaking valid syntax are just too high. If
7036 user. The chances of breaking valid syntax are just too high. If
7028 someone *really* wants, they can always dig into the code.
7037 someone *really* wants, they can always dig into the code.
7029
7038
7030 * Made prompt separators configurable.
7039 * Made prompt separators configurable.
7031
7040
7032 2001-11-22 Fernando Perez <fperez@colorado.edu>
7041 2001-11-22 Fernando Perez <fperez@colorado.edu>
7033
7042
7034 * Small bugfixes in many places.
7043 * Small bugfixes in many places.
7035
7044
7036 * Removed the MyCompleter class from ipplib. It seemed redundant
7045 * Removed the MyCompleter class from ipplib. It seemed redundant
7037 with the C-p,C-n history search functionality. Less code to
7046 with the C-p,C-n history search functionality. Less code to
7038 maintain.
7047 maintain.
7039
7048
7040 * Moved all the original ipython.py code into ipythonlib.py. Right
7049 * Moved all the original ipython.py code into ipythonlib.py. Right
7041 now it's just one big dump into a function called make_IPython, so
7050 now it's just one big dump into a function called make_IPython, so
7042 no real modularity has been gained. But at least it makes the
7051 no real modularity has been gained. But at least it makes the
7043 wrapper script tiny, and since ipythonlib is a module, it gets
7052 wrapper script tiny, and since ipythonlib is a module, it gets
7044 compiled and startup is much faster.
7053 compiled and startup is much faster.
7045
7054
7046 This is a reasobably 'deep' change, so we should test it for a
7055 This is a reasobably 'deep' change, so we should test it for a
7047 while without messing too much more with the code.
7056 while without messing too much more with the code.
7048
7057
7049 2001-11-21 Fernando Perez <fperez@colorado.edu>
7058 2001-11-21 Fernando Perez <fperez@colorado.edu>
7050
7059
7051 * Version 0.1.11 released, 0.1.12 opened for further work.
7060 * Version 0.1.11 released, 0.1.12 opened for further work.
7052
7061
7053 * Removed dependency on Itpl. It was only needed in one place. It
7062 * Removed dependency on Itpl. It was only needed in one place. It
7054 would be nice if this became part of python, though. It makes life
7063 would be nice if this became part of python, though. It makes life
7055 *a lot* easier in some cases.
7064 *a lot* easier in some cases.
7056
7065
7057 * Simplified the prefilter code a bit. Now all handlers are
7066 * Simplified the prefilter code a bit. Now all handlers are
7058 expected to explicitly return a value (at least a blank string).
7067 expected to explicitly return a value (at least a blank string).
7059
7068
7060 * Heavy edits in ipplib. Removed the help system altogether. Now
7069 * Heavy edits in ipplib. Removed the help system altogether. Now
7061 obj?/?? is used for inspecting objects, a magic @doc prints
7070 obj?/?? is used for inspecting objects, a magic @doc prints
7062 docstrings, and full-blown Python help is accessed via the 'help'
7071 docstrings, and full-blown Python help is accessed via the 'help'
7063 keyword. This cleans up a lot of code (less to maintain) and does
7072 keyword. This cleans up a lot of code (less to maintain) and does
7064 the job. Since 'help' is now a standard Python component, might as
7073 the job. Since 'help' is now a standard Python component, might as
7065 well use it and remove duplicate functionality.
7074 well use it and remove duplicate functionality.
7066
7075
7067 Also removed the option to use ipplib as a standalone program. By
7076 Also removed the option to use ipplib as a standalone program. By
7068 now it's too dependent on other parts of IPython to function alone.
7077 now it's too dependent on other parts of IPython to function alone.
7069
7078
7070 * Fixed bug in genutils.pager. It would crash if the pager was
7079 * Fixed bug in genutils.pager. It would crash if the pager was
7071 exited immediately after opening (broken pipe).
7080 exited immediately after opening (broken pipe).
7072
7081
7073 * Trimmed down the VerboseTB reporting a little. The header is
7082 * Trimmed down the VerboseTB reporting a little. The header is
7074 much shorter now and the repeated exception arguments at the end
7083 much shorter now and the repeated exception arguments at the end
7075 have been removed. For interactive use the old header seemed a bit
7084 have been removed. For interactive use the old header seemed a bit
7076 excessive.
7085 excessive.
7077
7086
7078 * Fixed small bug in output of @whos for variables with multi-word
7087 * Fixed small bug in output of @whos for variables with multi-word
7079 types (only first word was displayed).
7088 types (only first word was displayed).
7080
7089
7081 2001-11-17 Fernando Perez <fperez@colorado.edu>
7090 2001-11-17 Fernando Perez <fperez@colorado.edu>
7082
7091
7083 * Version 0.1.10 released, 0.1.11 opened for further work.
7092 * Version 0.1.10 released, 0.1.11 opened for further work.
7084
7093
7085 * Modified dirs and friends. dirs now *returns* the stack (not
7094 * Modified dirs and friends. dirs now *returns* the stack (not
7086 prints), so one can manipulate it as a variable. Convenient to
7095 prints), so one can manipulate it as a variable. Convenient to
7087 travel along many directories.
7096 travel along many directories.
7088
7097
7089 * Fixed bug in magic_pdef: would only work with functions with
7098 * Fixed bug in magic_pdef: would only work with functions with
7090 arguments with default values.
7099 arguments with default values.
7091
7100
7092 2001-11-14 Fernando Perez <fperez@colorado.edu>
7101 2001-11-14 Fernando Perez <fperez@colorado.edu>
7093
7102
7094 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7103 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7095 example with IPython. Various other minor fixes and cleanups.
7104 example with IPython. Various other minor fixes and cleanups.
7096
7105
7097 * Version 0.1.9 released, 0.1.10 opened for further work.
7106 * Version 0.1.9 released, 0.1.10 opened for further work.
7098
7107
7099 * Added sys.path to the list of directories searched in the
7108 * Added sys.path to the list of directories searched in the
7100 execfile= option. It used to be the current directory and the
7109 execfile= option. It used to be the current directory and the
7101 user's IPYTHONDIR only.
7110 user's IPYTHONDIR only.
7102
7111
7103 2001-11-13 Fernando Perez <fperez@colorado.edu>
7112 2001-11-13 Fernando Perez <fperez@colorado.edu>
7104
7113
7105 * Reinstated the raw_input/prefilter separation that Janko had
7114 * Reinstated the raw_input/prefilter separation that Janko had
7106 initially. This gives a more convenient setup for extending the
7115 initially. This gives a more convenient setup for extending the
7107 pre-processor from the outside: raw_input always gets a string,
7116 pre-processor from the outside: raw_input always gets a string,
7108 and prefilter has to process it. We can then redefine prefilter
7117 and prefilter has to process it. We can then redefine prefilter
7109 from the outside and implement extensions for special
7118 from the outside and implement extensions for special
7110 purposes.
7119 purposes.
7111
7120
7112 Today I got one for inputting PhysicalQuantity objects
7121 Today I got one for inputting PhysicalQuantity objects
7113 (from Scientific) without needing any function calls at
7122 (from Scientific) without needing any function calls at
7114 all. Extremely convenient, and it's all done as a user-level
7123 all. Extremely convenient, and it's all done as a user-level
7115 extension (no IPython code was touched). Now instead of:
7124 extension (no IPython code was touched). Now instead of:
7116 a = PhysicalQuantity(4.2,'m/s**2')
7125 a = PhysicalQuantity(4.2,'m/s**2')
7117 one can simply say
7126 one can simply say
7118 a = 4.2 m/s**2
7127 a = 4.2 m/s**2
7119 or even
7128 or even
7120 a = 4.2 m/s^2
7129 a = 4.2 m/s^2
7121
7130
7122 I use this, but it's also a proof of concept: IPython really is
7131 I use this, but it's also a proof of concept: IPython really is
7123 fully user-extensible, even at the level of the parsing of the
7132 fully user-extensible, even at the level of the parsing of the
7124 command line. It's not trivial, but it's perfectly doable.
7133 command line. It's not trivial, but it's perfectly doable.
7125
7134
7126 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7135 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7127 the problem of modules being loaded in the inverse order in which
7136 the problem of modules being loaded in the inverse order in which
7128 they were defined in
7137 they were defined in
7129
7138
7130 * Version 0.1.8 released, 0.1.9 opened for further work.
7139 * Version 0.1.8 released, 0.1.9 opened for further work.
7131
7140
7132 * Added magics pdef, source and file. They respectively show the
7141 * Added magics pdef, source and file. They respectively show the
7133 definition line ('prototype' in C), source code and full python
7142 definition line ('prototype' in C), source code and full python
7134 file for any callable object. The object inspector oinfo uses
7143 file for any callable object. The object inspector oinfo uses
7135 these to show the same information.
7144 these to show the same information.
7136
7145
7137 * Version 0.1.7 released, 0.1.8 opened for further work.
7146 * Version 0.1.7 released, 0.1.8 opened for further work.
7138
7147
7139 * Separated all the magic functions into a class called Magic. The
7148 * Separated all the magic functions into a class called Magic. The
7140 InteractiveShell class was becoming too big for Xemacs to handle
7149 InteractiveShell class was becoming too big for Xemacs to handle
7141 (de-indenting a line would lock it up for 10 seconds while it
7150 (de-indenting a line would lock it up for 10 seconds while it
7142 backtracked on the whole class!)
7151 backtracked on the whole class!)
7143
7152
7144 FIXME: didn't work. It can be done, but right now namespaces are
7153 FIXME: didn't work. It can be done, but right now namespaces are
7145 all messed up. Do it later (reverted it for now, so at least
7154 all messed up. Do it later (reverted it for now, so at least
7146 everything works as before).
7155 everything works as before).
7147
7156
7148 * Got the object introspection system (magic_oinfo) working! I
7157 * Got the object introspection system (magic_oinfo) working! I
7149 think this is pretty much ready for release to Janko, so he can
7158 think this is pretty much ready for release to Janko, so he can
7150 test it for a while and then announce it. Pretty much 100% of what
7159 test it for a while and then announce it. Pretty much 100% of what
7151 I wanted for the 'phase 1' release is ready. Happy, tired.
7160 I wanted for the 'phase 1' release is ready. Happy, tired.
7152
7161
7153 2001-11-12 Fernando Perez <fperez@colorado.edu>
7162 2001-11-12 Fernando Perez <fperez@colorado.edu>
7154
7163
7155 * Version 0.1.6 released, 0.1.7 opened for further work.
7164 * Version 0.1.6 released, 0.1.7 opened for further work.
7156
7165
7157 * Fixed bug in printing: it used to test for truth before
7166 * Fixed bug in printing: it used to test for truth before
7158 printing, so 0 wouldn't print. Now checks for None.
7167 printing, so 0 wouldn't print. Now checks for None.
7159
7168
7160 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7169 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7161 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7170 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7162 reaches by hand into the outputcache. Think of a better way to do
7171 reaches by hand into the outputcache. Think of a better way to do
7163 this later.
7172 this later.
7164
7173
7165 * Various small fixes thanks to Nathan's comments.
7174 * Various small fixes thanks to Nathan's comments.
7166
7175
7167 * Changed magic_pprint to magic_Pprint. This way it doesn't
7176 * Changed magic_pprint to magic_Pprint. This way it doesn't
7168 collide with pprint() and the name is consistent with the command
7177 collide with pprint() and the name is consistent with the command
7169 line option.
7178 line option.
7170
7179
7171 * Changed prompt counter behavior to be fully like
7180 * Changed prompt counter behavior to be fully like
7172 Mathematica's. That is, even input that doesn't return a result
7181 Mathematica's. That is, even input that doesn't return a result
7173 raises the prompt counter. The old behavior was kind of confusing
7182 raises the prompt counter. The old behavior was kind of confusing
7174 (getting the same prompt number several times if the operation
7183 (getting the same prompt number several times if the operation
7175 didn't return a result).
7184 didn't return a result).
7176
7185
7177 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7186 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7178
7187
7179 * Fixed -Classic mode (wasn't working anymore).
7188 * Fixed -Classic mode (wasn't working anymore).
7180
7189
7181 * Added colored prompts using Nathan's new code. Colors are
7190 * Added colored prompts using Nathan's new code. Colors are
7182 currently hardwired, they can be user-configurable. For
7191 currently hardwired, they can be user-configurable. For
7183 developers, they can be chosen in file ipythonlib.py, at the
7192 developers, they can be chosen in file ipythonlib.py, at the
7184 beginning of the CachedOutput class def.
7193 beginning of the CachedOutput class def.
7185
7194
7186 2001-11-11 Fernando Perez <fperez@colorado.edu>
7195 2001-11-11 Fernando Perez <fperez@colorado.edu>
7187
7196
7188 * Version 0.1.5 released, 0.1.6 opened for further work.
7197 * Version 0.1.5 released, 0.1.6 opened for further work.
7189
7198
7190 * Changed magic_env to *return* the environment as a dict (not to
7199 * Changed magic_env to *return* the environment as a dict (not to
7191 print it). This way it prints, but it can also be processed.
7200 print it). This way it prints, but it can also be processed.
7192
7201
7193 * Added Verbose exception reporting to interactive
7202 * Added Verbose exception reporting to interactive
7194 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7203 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7195 traceback. Had to make some changes to the ultraTB file. This is
7204 traceback. Had to make some changes to the ultraTB file. This is
7196 probably the last 'big' thing in my mental todo list. This ties
7205 probably the last 'big' thing in my mental todo list. This ties
7197 in with the next entry:
7206 in with the next entry:
7198
7207
7199 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7208 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7200 has to specify is Plain, Color or Verbose for all exception
7209 has to specify is Plain, Color or Verbose for all exception
7201 handling.
7210 handling.
7202
7211
7203 * Removed ShellServices option. All this can really be done via
7212 * Removed ShellServices option. All this can really be done via
7204 the magic system. It's easier to extend, cleaner and has automatic
7213 the magic system. It's easier to extend, cleaner and has automatic
7205 namespace protection and documentation.
7214 namespace protection and documentation.
7206
7215
7207 2001-11-09 Fernando Perez <fperez@colorado.edu>
7216 2001-11-09 Fernando Perez <fperez@colorado.edu>
7208
7217
7209 * Fixed bug in output cache flushing (missing parameter to
7218 * Fixed bug in output cache flushing (missing parameter to
7210 __init__). Other small bugs fixed (found using pychecker).
7219 __init__). Other small bugs fixed (found using pychecker).
7211
7220
7212 * Version 0.1.4 opened for bugfixing.
7221 * Version 0.1.4 opened for bugfixing.
7213
7222
7214 2001-11-07 Fernando Perez <fperez@colorado.edu>
7223 2001-11-07 Fernando Perez <fperez@colorado.edu>
7215
7224
7216 * Version 0.1.3 released, mainly because of the raw_input bug.
7225 * Version 0.1.3 released, mainly because of the raw_input bug.
7217
7226
7218 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7227 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7219 and when testing for whether things were callable, a call could
7228 and when testing for whether things were callable, a call could
7220 actually be made to certain functions. They would get called again
7229 actually be made to certain functions. They would get called again
7221 once 'really' executed, with a resulting double call. A disaster
7230 once 'really' executed, with a resulting double call. A disaster
7222 in many cases (list.reverse() would never work!).
7231 in many cases (list.reverse() would never work!).
7223
7232
7224 * Removed prefilter() function, moved its code to raw_input (which
7233 * Removed prefilter() function, moved its code to raw_input (which
7225 after all was just a near-empty caller for prefilter). This saves
7234 after all was just a near-empty caller for prefilter). This saves
7226 a function call on every prompt, and simplifies the class a tiny bit.
7235 a function call on every prompt, and simplifies the class a tiny bit.
7227
7236
7228 * Fix _ip to __ip name in magic example file.
7237 * Fix _ip to __ip name in magic example file.
7229
7238
7230 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7239 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7231 work with non-gnu versions of tar.
7240 work with non-gnu versions of tar.
7232
7241
7233 2001-11-06 Fernando Perez <fperez@colorado.edu>
7242 2001-11-06 Fernando Perez <fperez@colorado.edu>
7234
7243
7235 * Version 0.1.2. Just to keep track of the recent changes.
7244 * Version 0.1.2. Just to keep track of the recent changes.
7236
7245
7237 * Fixed nasty bug in output prompt routine. It used to check 'if
7246 * Fixed nasty bug in output prompt routine. It used to check 'if
7238 arg != None...'. Problem is, this fails if arg implements a
7247 arg != None...'. Problem is, this fails if arg implements a
7239 special comparison (__cmp__) which disallows comparing to
7248 special comparison (__cmp__) which disallows comparing to
7240 None. Found it when trying to use the PhysicalQuantity module from
7249 None. Found it when trying to use the PhysicalQuantity module from
7241 ScientificPython.
7250 ScientificPython.
7242
7251
7243 2001-11-05 Fernando Perez <fperez@colorado.edu>
7252 2001-11-05 Fernando Perez <fperez@colorado.edu>
7244
7253
7245 * Also added dirs. Now the pushd/popd/dirs family functions
7254 * Also added dirs. Now the pushd/popd/dirs family functions
7246 basically like the shell, with the added convenience of going home
7255 basically like the shell, with the added convenience of going home
7247 when called with no args.
7256 when called with no args.
7248
7257
7249 * pushd/popd slightly modified to mimic shell behavior more
7258 * pushd/popd slightly modified to mimic shell behavior more
7250 closely.
7259 closely.
7251
7260
7252 * Added env,pushd,popd from ShellServices as magic functions. I
7261 * Added env,pushd,popd from ShellServices as magic functions. I
7253 think the cleanest will be to port all desired functions from
7262 think the cleanest will be to port all desired functions from
7254 ShellServices as magics and remove ShellServices altogether. This
7263 ShellServices as magics and remove ShellServices altogether. This
7255 will provide a single, clean way of adding functionality
7264 will provide a single, clean way of adding functionality
7256 (shell-type or otherwise) to IP.
7265 (shell-type or otherwise) to IP.
7257
7266
7258 2001-11-04 Fernando Perez <fperez@colorado.edu>
7267 2001-11-04 Fernando Perez <fperez@colorado.edu>
7259
7268
7260 * Added .ipython/ directory to sys.path. This way users can keep
7269 * Added .ipython/ directory to sys.path. This way users can keep
7261 customizations there and access them via import.
7270 customizations there and access them via import.
7262
7271
7263 2001-11-03 Fernando Perez <fperez@colorado.edu>
7272 2001-11-03 Fernando Perez <fperez@colorado.edu>
7264
7273
7265 * Opened version 0.1.1 for new changes.
7274 * Opened version 0.1.1 for new changes.
7266
7275
7267 * Changed version number to 0.1.0: first 'public' release, sent to
7276 * Changed version number to 0.1.0: first 'public' release, sent to
7268 Nathan and Janko.
7277 Nathan and Janko.
7269
7278
7270 * Lots of small fixes and tweaks.
7279 * Lots of small fixes and tweaks.
7271
7280
7272 * Minor changes to whos format. Now strings are shown, snipped if
7281 * Minor changes to whos format. Now strings are shown, snipped if
7273 too long.
7282 too long.
7274
7283
7275 * Changed ShellServices to work on __main__ so they show up in @who
7284 * Changed ShellServices to work on __main__ so they show up in @who
7276
7285
7277 * Help also works with ? at the end of a line:
7286 * Help also works with ? at the end of a line:
7278 ?sin and sin?
7287 ?sin and sin?
7279 both produce the same effect. This is nice, as often I use the
7288 both produce the same effect. This is nice, as often I use the
7280 tab-complete to find the name of a method, but I used to then have
7289 tab-complete to find the name of a method, but I used to then have
7281 to go to the beginning of the line to put a ? if I wanted more
7290 to go to the beginning of the line to put a ? if I wanted more
7282 info. Now I can just add the ? and hit return. Convenient.
7291 info. Now I can just add the ? and hit return. Convenient.
7283
7292
7284 2001-11-02 Fernando Perez <fperez@colorado.edu>
7293 2001-11-02 Fernando Perez <fperez@colorado.edu>
7285
7294
7286 * Python version check (>=2.1) added.
7295 * Python version check (>=2.1) added.
7287
7296
7288 * Added LazyPython documentation. At this point the docs are quite
7297 * Added LazyPython documentation. At this point the docs are quite
7289 a mess. A cleanup is in order.
7298 a mess. A cleanup is in order.
7290
7299
7291 * Auto-installer created. For some bizarre reason, the zipfiles
7300 * Auto-installer created. For some bizarre reason, the zipfiles
7292 module isn't working on my system. So I made a tar version
7301 module isn't working on my system. So I made a tar version
7293 (hopefully the command line options in various systems won't kill
7302 (hopefully the command line options in various systems won't kill
7294 me).
7303 me).
7295
7304
7296 * Fixes to Struct in genutils. Now all dictionary-like methods are
7305 * Fixes to Struct in genutils. Now all dictionary-like methods are
7297 protected (reasonably).
7306 protected (reasonably).
7298
7307
7299 * Added pager function to genutils and changed ? to print usage
7308 * Added pager function to genutils and changed ? to print usage
7300 note through it (it was too long).
7309 note through it (it was too long).
7301
7310
7302 * Added the LazyPython functionality. Works great! I changed the
7311 * Added the LazyPython functionality. Works great! I changed the
7303 auto-quote escape to ';', it's on home row and next to '. But
7312 auto-quote escape to ';', it's on home row and next to '. But
7304 both auto-quote and auto-paren (still /) escapes are command-line
7313 both auto-quote and auto-paren (still /) escapes are command-line
7305 parameters.
7314 parameters.
7306
7315
7307
7316
7308 2001-11-01 Fernando Perez <fperez@colorado.edu>
7317 2001-11-01 Fernando Perez <fperez@colorado.edu>
7309
7318
7310 * Version changed to 0.0.7. Fairly large change: configuration now
7319 * Version changed to 0.0.7. Fairly large change: configuration now
7311 is all stored in a directory, by default .ipython. There, all
7320 is all stored in a directory, by default .ipython. There, all
7312 config files have normal looking names (not .names)
7321 config files have normal looking names (not .names)
7313
7322
7314 * Version 0.0.6 Released first to Lucas and Archie as a test
7323 * Version 0.0.6 Released first to Lucas and Archie as a test
7315 run. Since it's the first 'semi-public' release, change version to
7324 run. Since it's the first 'semi-public' release, change version to
7316 > 0.0.6 for any changes now.
7325 > 0.0.6 for any changes now.
7317
7326
7318 * Stuff I had put in the ipplib.py changelog:
7327 * Stuff I had put in the ipplib.py changelog:
7319
7328
7320 Changes to InteractiveShell:
7329 Changes to InteractiveShell:
7321
7330
7322 - Made the usage message a parameter.
7331 - Made the usage message a parameter.
7323
7332
7324 - Require the name of the shell variable to be given. It's a bit
7333 - Require the name of the shell variable to be given. It's a bit
7325 of a hack, but allows the name 'shell' not to be hardwired in the
7334 of a hack, but allows the name 'shell' not to be hardwired in the
7326 magic (@) handler, which is problematic b/c it requires
7335 magic (@) handler, which is problematic b/c it requires
7327 polluting the global namespace with 'shell'. This in turn is
7336 polluting the global namespace with 'shell'. This in turn is
7328 fragile: if a user redefines a variable called shell, things
7337 fragile: if a user redefines a variable called shell, things
7329 break.
7338 break.
7330
7339
7331 - magic @: all functions available through @ need to be defined
7340 - magic @: all functions available through @ need to be defined
7332 as magic_<name>, even though they can be called simply as
7341 as magic_<name>, even though they can be called simply as
7333 @<name>. This allows the special command @magic to gather
7342 @<name>. This allows the special command @magic to gather
7334 information automatically about all existing magic functions,
7343 information automatically about all existing magic functions,
7335 even if they are run-time user extensions, by parsing the shell
7344 even if they are run-time user extensions, by parsing the shell
7336 instance __dict__ looking for special magic_ names.
7345 instance __dict__ looking for special magic_ names.
7337
7346
7338 - mainloop: added *two* local namespace parameters. This allows
7347 - mainloop: added *two* local namespace parameters. This allows
7339 the class to differentiate between parameters which were there
7348 the class to differentiate between parameters which were there
7340 before and after command line initialization was processed. This
7349 before and after command line initialization was processed. This
7341 way, later @who can show things loaded at startup by the
7350 way, later @who can show things loaded at startup by the
7342 user. This trick was necessary to make session saving/reloading
7351 user. This trick was necessary to make session saving/reloading
7343 really work: ideally after saving/exiting/reloading a session,
7352 really work: ideally after saving/exiting/reloading a session,
7344 *everything* should look the same, including the output of @who. I
7353 *everything* should look the same, including the output of @who. I
7345 was only able to make this work with this double namespace
7354 was only able to make this work with this double namespace
7346 trick.
7355 trick.
7347
7356
7348 - added a header to the logfile which allows (almost) full
7357 - added a header to the logfile which allows (almost) full
7349 session restoring.
7358 session restoring.
7350
7359
7351 - prepend lines beginning with @ or !, with a and log
7360 - prepend lines beginning with @ or !, with a and log
7352 them. Why? !lines: may be useful to know what you did @lines:
7361 them. Why? !lines: may be useful to know what you did @lines:
7353 they may affect session state. So when restoring a session, at
7362 they may affect session state. So when restoring a session, at
7354 least inform the user of their presence. I couldn't quite get
7363 least inform the user of their presence. I couldn't quite get
7355 them to properly re-execute, but at least the user is warned.
7364 them to properly re-execute, but at least the user is warned.
7356
7365
7357 * Started ChangeLog.
7366 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now