##// END OF EJS Templates
- Made the internal crash handler very customizable for end-user apps based...
fptest -
Show More
@@ -1,111 +1,227 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """sys.excepthook for IPython itself, leaves a detailed report on disk.
2 """sys.excepthook for IPython itself, leaves a detailed report on disk.
3
3
4 $Id: CrashHandler.py 1326 2006-05-25 02:07:11Z fperez $"""
4 $Id: CrashHandler.py 1828 2006-10-16 02:04:33Z fptest $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
7 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
8 #
8 #
9 # Distributed under the terms of the BSD License. The full license is in
9 # Distributed under the terms of the BSD License. The full license is in
10 # the file COPYING, distributed as part of this software.
10 # the file COPYING, distributed as part of this software.
11 #*****************************************************************************
11 #*****************************************************************************
12
12
13 from IPython import Release
13 from IPython import Release
14 __author__ = '%s <%s>' % Release.authors['Fernando']
14 __author__ = '%s <%s>' % Release.authors['Fernando']
15 __license__ = Release.license
15 __license__ = Release.license
16 __version__ = Release.version
16 __version__ = Release.version
17
17
18 #****************************************************************************
18 #****************************************************************************
19 # Required modules
19 # Required modules
20
20
21 # From the standard library
21 # From the standard library
22 import os
22 import os
23 import sys
23 import sys
24 from pprint import pprint,pformat
24 from pprint import pprint,pformat
25
25
26 # Homebrewed
26 # Homebrewed
27 from IPython.Itpl import Itpl,itpl,printpl
27 from IPython.Itpl import Itpl,itpl,printpl
28 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
28 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
29 from IPython import ultraTB
29 from IPython import ultraTB
30 from IPython.genutils import *
30 from IPython.genutils import *
31
31
32 #****************************************************************************
32 #****************************************************************************
33 class CrashHandler:
33 class CrashHandler:
34 """sys.excepthook for IPython itself, leaves a detailed report on disk."""
34 """Customizable crash handlers for IPython-based systems.
35
35
36 def __init__(self,IP):
36 Instances of this class provide a __call__ method which can be used as a
37 sys.excepthook, i.e., the __call__ signature is:
38
39 def __call__(self,etype, evalue, etb)
40
41 """
42
43 def __init__(self,IP,app_name,contact_name,contact_email,
44 bug_tracker,crash_report_fname,
45 show_crash_traceback=True):
46 """New crash handler.
47
48 Inputs:
49
50 - IP: a running IPython instance, which will be queried at crash time
51 for internal information.
52
53 - app_name: a string containing the name of your application.
54
55 - contact_name: a string with the name of the person to contact.
56
57 - contact_email: a string with the email address of the contact.
58
59 - bug_tracker: a string with the URL for your project's bug tracker.
60
61 - crash_report_fname: a string with the filename for the crash report
62 to be saved in. These reports are left in the ipython user directory
63 as determined by the running IPython instance.
64
65 Optional inputs:
66
67 - show_crash_traceback(True): if false, don't print the crash
68 traceback on stderr, only generate the on-disk report
69
70
71 Non-argument instance attributes:
72
73 These instances contain some non-argument attributes which allow for
74 further customization of the crash handler's behavior. Please see the
75 source for further details.
76 """
77
78 # apply args into instance
37 self.IP = IP # IPython instance
79 self.IP = IP # IPython instance
38 self.bug_contact = Release.authors['Ville'][0]
80 self.app_name = app_name
39 self.mailto = Release.authors['Ville'][1]
81 self.contact_name = contact_name
82 self.contact_email = contact_email
83 self.bug_tracker = bug_tracker
84 self.crash_report_fname = crash_report_fname
85 self.show_crash_traceback = show_crash_traceback
86
87 # Hardcoded defaults, which can be overridden either by subclasses or
88 # at runtime for the instance.
89
90 # Template for the user message. Subclasses which completely override
91 # this, or user apps, can modify it to suit their tastes. It gets
92 # expanded using itpl, so calls of the kind $self.foo are valid.
93 self.user_message_template = """
94 Oops, $self.app_name crashed. We do our best to make it stable, but...
95
96 A crash report was automatically generated with the following information:
97 - A verbatim copy of the crash traceback.
98 - A copy of your input history during this session.
99 - Data on your current $self.app_name configuration.
100
101 It was left in the file named:
102 \t'$self.crash_report_fname'
103 If you can email this file to the developers, the information in it will help
104 them in understanding and correcting the problem.
105
106 You can mail it to: $self.contact_name at $self.contact_email
107 with the subject '$self.app_name Crash Report'.
108
109 If you want to do it now, the following command will work (under Unix):
110 mail -s '$self.app_name Crash Report' $self.contact_email < $self.crash_report_fname
111
112 To ensure accurate tracking of this issue, please file a report about it at:
113 $self.bug_tracker
114 """
40
115
41 def __call__(self,etype, evalue, etb):
116 def __call__(self,etype, evalue, etb):
117 """Handle an exception, call for compatible with sys.excepthook"""
42
118
43 # Report tracebacks shouldn't use color in general (safer for users)
119 # Report tracebacks shouldn't use color in general (safer for users)
44 color_scheme = 'NoColor'
120 color_scheme = 'NoColor'
45
121
46 # Use this ONLY for developer debugging (keep commented out for release)
122 # Use this ONLY for developer debugging (keep commented out for release)
47 #color_scheme = 'Linux' # dbg
123 #color_scheme = 'Linux' # dbg
48
124
49 try:
125 try:
50 rptdir = self.IP.rc.ipythondir
126 rptdir = self.IP.rc.ipythondir
51 except:
127 except:
52 rptdir = os.getcwd()
128 rptdir = os.getcwd()
53 if not os.path.isdir(rptdir):
129 if not os.path.isdir(rptdir):
54 rptdir = os.getcwd()
130 rptdir = os.getcwd()
55 self.report_name = os.path.join(rptdir,'IPython_crash_report.txt')
131 report_name = os.path.join(rptdir,self.crash_report_fname)
56 self.TBhandler = ultraTB.VerboseTB(color_scheme=color_scheme,long_header=1)
132 # write the report filename into the instance dict so it can get
57 traceback = self.TBhandler.text(etype,evalue,etb,context=31)
133 # properly expanded out in the user message template
134 self.crash_report_fname = report_name
135 TBhandler = ultraTB.VerboseTB(color_scheme=color_scheme,
136 long_header=1)
137 traceback = TBhandler.text(etype,evalue,etb,context=31)
58
138
59 # print traceback to screen
139 # print traceback to screen
60 print >> sys.stderr, traceback
140 if self.show_crash_traceback:
141 print >> sys.stderr, traceback
61
142
62 # and generate a complete report on disk
143 # and generate a complete report on disk
63 try:
144 try:
64 report = open(self.report_name,'w')
145 report = open(report_name,'w')
65 except:
146 except:
66 print >> sys.stderr, 'Could not create crash report on disk.'
147 print >> sys.stderr, 'Could not create crash report on disk.'
67 return
148 return
68
149
69 msg = itpl('\n'+'*'*70+'\n'
150 # Inform user on stderr of what happened
70 """
151 msg = itpl('\n'+'*'*70+'\n'+self.user_message_template)
71 Oops, IPython crashed. We do our best to make it stable, but...
152 print >> sys.stderr, msg
72
153
73 A crash report was automatically generated with the following information:
154 # Construct report on disk
74 - A verbatim copy of the traceback above this text.
155 report.write(self.make_report(traceback))
75 - A copy of your input history during this session.
156 report.close()
76 - Data on your current IPython configuration.
77
157
78 It was left in the file named:
158 def make_report(self,traceback):
79 \t'$self.report_name'
159 """Return a string containing a crash report."""
80 If you can email this file to the developers, the information in it will help
81 them in understanding and correcting the problem.
82
160
83 You can mail it to $self.bug_contact at $self.mailto
161 sec_sep = '\n\n'+'*'*75+'\n\n'
84 with the subject 'IPython Crash Report'.
85
162
86 If you want to do it now, the following command will work (under Unix):
163 report = []
87 mail -s 'IPython Crash Report' $self.mailto < $self.report_name
164 rpt_add = report.append
165
166 rpt_add('*'*75+'\n\n'+'IPython post-mortem report\n\n')
167 rpt_add('IPython version: %s \n\n' % Release.version)
168 rpt_add('SVN revision : %s \n\n' % Release.revision)
169 rpt_add('Platform info : os.name -> %s, sys.platform -> %s' %
170 (os.name,sys.platform) )
171 rpt_add(sec_sep+'Current user configuration structure:\n\n')
172 rpt_add(pformat(self.IP.rc.dict()))
173 rpt_add(sec_sep+'Crash traceback:\n\n' + traceback)
174 try:
175 rpt_add(sec_sep+"History of session input:")
176 for line in self.IP.user_ns['_ih']:
177 rpt_add(line)
178 rpt_add('\n*** Last line of input (may not be in above history):\n')
179 rpt_add(self.IP._last_input_line+'\n')
180 except:
181 pass
88
182
89 To ensure accurate tracking of this issue, please file a report about it at:
183 return ''.join(report)
90 http://projects.scipy.org/ipython/ipython/report
184
91 """)
185 class IPythonCrashHandler(CrashHandler):
92 print >> sys.stderr, msg
186 """sys.excepthook for IPython itself, leaves a detailed report on disk."""
187
188 def __init__(self,IP):
189
190 # Set here which of the IPython authors should be listed as contact
191 AUTHOR_CONTACT = 'Ville'
192
193 # Set argument defaults
194 app_name = 'IPython'
195 bug_tracker = 'http://projects.scipy.org/ipython/ipython/report'
196 contact_name,contact_email = Release.authors[AUTHOR_CONTACT][:2]
197 crash_report_fname = 'IPython_crash_report.txt'
198 # Call parent constructor
199 CrashHandler.__init__(self,IP,app_name,contact_name,contact_email,
200 bug_tracker,crash_report_fname)
201
202 def make_report(self,traceback):
203 """Return a string containing a crash report."""
93
204
94 sec_sep = '\n\n'+'*'*75+'\n\n'
205 sec_sep = '\n\n'+'*'*75+'\n\n'
95 report.write('*'*75+'\n\n'+'IPython post-mortem report\n\n')
206
96 report.write('IPython version: %s \n\n' % Release.version)
207 report = []
97 report.write('SVN revision : %s \n\n' % Release.revision)
208 rpt_add = report.append
98 report.write('Platform info : os.name -> %s, sys.platform -> %s' %
209
210 rpt_add('*'*75+'\n\n'+'IPython post-mortem report\n\n')
211 rpt_add('IPython version: %s \n\n' % Release.version)
212 rpt_add('SVN revision : %s \n\n' % Release.revision)
213 rpt_add('Platform info : os.name -> %s, sys.platform -> %s' %
99 (os.name,sys.platform) )
214 (os.name,sys.platform) )
100 report.write(sec_sep+'Current user configuration structure:\n\n')
215 rpt_add(sec_sep+'Current user configuration structure:\n\n')
101 report.write(pformat(self.IP.rc.dict()))
216 rpt_add(pformat(self.IP.rc.dict()))
102 report.write(sec_sep+'Crash traceback:\n\n' + traceback)
217 rpt_add(sec_sep+'Crash traceback:\n\n' + traceback)
103 try:
218 try:
104 report.write(sec_sep+"History of session input:")
219 rpt_add(sec_sep+"History of session input:")
105 for line in self.IP.user_ns['_ih']:
220 for line in self.IP.user_ns['_ih']:
106 report.write(line)
221 rpt_add(line)
107 report.write('\n*** Last line of input (may not be in above history):\n')
222 rpt_add('\n*** Last line of input (may not be in above history):\n')
108 report.write(self.IP._last_input_line+'\n')
223 rpt_add(self.IP._last_input_line+'\n')
109 except:
224 except:
110 pass
225 pass
111 report.close()
226
227 return ''.join(report)
@@ -1,328 +1,330 b''
1 ''' IPython customization API
1 ''' IPython customization API
2
2
3 Your one-stop module for configuring & extending ipython
3 Your one-stop module for configuring & extending ipython
4
4
5 The API will probably break when ipython 1.0 is released, but so
5 The API will probably break when ipython 1.0 is released, but so
6 will the other configuration method (rc files).
6 will the other configuration method (rc files).
7
7
8 All names prefixed by underscores are for internal use, not part
8 All names prefixed by underscores are for internal use, not part
9 of the public api.
9 of the public api.
10
10
11 Below is an example that you can just put to a module and import from ipython.
11 Below is an example that you can just put to a module and import from ipython.
12
12
13 A good practice is to install the config script below as e.g.
13 A good practice is to install the config script below as e.g.
14
14
15 ~/.ipython/my_private_conf.py
15 ~/.ipython/my_private_conf.py
16
16
17 And do
17 And do
18
18
19 import_mod my_private_conf
19 import_mod my_private_conf
20
20
21 in ~/.ipython/ipythonrc
21 in ~/.ipython/ipythonrc
22
22
23 That way the module is imported at startup and you can have all your
23 That way the module is imported at startup and you can have all your
24 personal configuration (as opposed to boilerplate ipythonrc-PROFILENAME
24 personal configuration (as opposed to boilerplate ipythonrc-PROFILENAME
25 stuff) in there.
25 stuff) in there.
26
26
27 -----------------------------------------------
27 -----------------------------------------------
28 import IPython.ipapi
28 import IPython.ipapi
29 ip = IPython.ipapi.get()
29 ip = IPython.ipapi.get()
30
30
31 def ankka_f(self, arg):
31 def ankka_f(self, arg):
32 print "Ankka",self,"says uppercase:",arg.upper()
32 print "Ankka",self,"says uppercase:",arg.upper()
33
33
34 ip.expose_magic("ankka",ankka_f)
34 ip.expose_magic("ankka",ankka_f)
35
35
36 ip.magic('alias sayhi echo "Testing, hi ok"')
36 ip.magic('alias sayhi echo "Testing, hi ok"')
37 ip.magic('alias helloworld echo "Hello world"')
37 ip.magic('alias helloworld echo "Hello world"')
38 ip.system('pwd')
38 ip.system('pwd')
39
39
40 ip.ex('import re')
40 ip.ex('import re')
41 ip.ex("""
41 ip.ex("""
42 def funcci(a,b):
42 def funcci(a,b):
43 print a+b
43 print a+b
44 print funcci(3,4)
44 print funcci(3,4)
45 """)
45 """)
46 ip.ex("funcci(348,9)")
46 ip.ex("funcci(348,9)")
47
47
48 def jed_editor(self,filename, linenum=None):
48 def jed_editor(self,filename, linenum=None):
49 print "Calling my own editor, jed ... via hook!"
49 print "Calling my own editor, jed ... via hook!"
50 import os
50 import os
51 if linenum is None: linenum = 0
51 if linenum is None: linenum = 0
52 os.system('jed +%d %s' % (linenum, filename))
52 os.system('jed +%d %s' % (linenum, filename))
53 print "exiting jed"
53 print "exiting jed"
54
54
55 ip.set_hook('editor',jed_editor)
55 ip.set_hook('editor',jed_editor)
56
56
57 o = ip.options
57 o = ip.options
58 o.autocall = 2 # FULL autocall mode
58 o.autocall = 2 # FULL autocall mode
59
59
60 print "done!"
60 print "done!"
61 '''
61 '''
62
62
63 # stdlib imports
63 # stdlib imports
64 import __builtin__
64 import __builtin__
65 import sys
65 import sys
66
66
67 # our own
67 # our own
68 from IPython.genutils import warn,error
68 from IPython.genutils import warn,error
69
69
70 class TryNext(Exception):
70 class TryNext(Exception):
71 """Try next hook exception.
71 """Try next hook exception.
72
72
73 Raise this in your hook function to indicate that the next hook handler
73 Raise this in your hook function to indicate that the next hook handler
74 should be used to handle the operation. If you pass arguments to the
74 should be used to handle the operation. If you pass arguments to the
75 constructor those arguments will be used by the next hook instead of the
75 constructor those arguments will be used by the next hook instead of the
76 original ones.
76 original ones.
77 """
77 """
78
78
79 def __init__(self, *args, **kwargs):
79 def __init__(self, *args, **kwargs):
80 self.args = args
80 self.args = args
81 self.kwargs = kwargs
81 self.kwargs = kwargs
82
82
83 # contains the most recently instantiated IPApi
83 # contains the most recently instantiated IPApi
84
84
85 class IPythonNotRunning:
85 class IPythonNotRunning:
86 """Dummy do-nothing class.
86 """Dummy do-nothing class.
87
87
88 Instances of this class return a dummy attribute on all accesses, which
88 Instances of this class return a dummy attribute on all accesses, which
89 can be called and warns. This makes it easier to write scripts which use
89 can be called and warns. This makes it easier to write scripts which use
90 the ipapi.get() object for informational purposes to operate both with and
90 the ipapi.get() object for informational purposes to operate both with and
91 without ipython. Obviously code which uses the ipython object for
91 without ipython. Obviously code which uses the ipython object for
92 computations will not work, but this allows a wider range of code to
92 computations will not work, but this allows a wider range of code to
93 transparently work whether ipython is being used or not."""
93 transparently work whether ipython is being used or not."""
94
94
95 def __str__(self):
95 def __str__(self):
96 return "<IPythonNotRunning>"
96 return "<IPythonNotRunning>"
97
97
98 __repr__ = __str__
98 __repr__ = __str__
99
99
100 def __getattr__(self,name):
100 def __getattr__(self,name):
101 return self.dummy
101 return self.dummy
102
102
103 def dummy(self,*args,**kw):
103 def dummy(self,*args,**kw):
104 """Dummy function, which doesn't do anything but warn."""
104 """Dummy function, which doesn't do anything but warn."""
105 warn("IPython is not running, this is a dummy no-op function")
105 warn("IPython is not running, this is a dummy no-op function")
106
106
107 _recent = None
107 _recent = None
108
108
109
109
110 def get(allow_dummy=False):
110 def get(allow_dummy=False):
111 """Get an IPApi object.
111 """Get an IPApi object.
112
112
113 If allow_dummy is true, returns an instance of IPythonNotRunning
113 If allow_dummy is true, returns an instance of IPythonNotRunning
114 instead of None if not running under IPython.
114 instead of None if not running under IPython.
115
115
116 Running this should be the first thing you do when writing extensions that
116 Running this should be the first thing you do when writing extensions that
117 can be imported as normal modules. You can then direct all the
117 can be imported as normal modules. You can then direct all the
118 configuration operations against the returned object.
118 configuration operations against the returned object.
119 """
119 """
120 global _recent
120 global _recent
121 if allow_dummy and not _recent:
121 if allow_dummy and not _recent:
122 _recent = IPythonNotRunning()
122 _recent = IPythonNotRunning()
123 return _recent
123 return _recent
124
124
125 class IPApi:
125 class IPApi:
126 """ The actual API class for configuring IPython
126 """ The actual API class for configuring IPython
127
127
128 You should do all of the IPython configuration by getting an IPApi object
128 You should do all of the IPython configuration by getting an IPApi object
129 with IPython.ipapi.get() and using the attributes and methods of the
129 with IPython.ipapi.get() and using the attributes and methods of the
130 returned object."""
130 returned object."""
131
131
132 def __init__(self,ip):
132 def __init__(self,ip):
133
133
134 # All attributes exposed here are considered to be the public API of
134 # All attributes exposed here are considered to be the public API of
135 # IPython. As needs dictate, some of these may be wrapped as
135 # IPython. As needs dictate, some of these may be wrapped as
136 # properties.
136 # properties.
137
137
138 self.magic = ip.ipmagic
138 self.magic = ip.ipmagic
139
139
140 self.system = ip.ipsystem
140 self.system = ip.ipsystem
141
141
142 self.set_hook = ip.set_hook
142 self.set_hook = ip.set_hook
143
143
144 self.set_custom_exc = ip.set_custom_exc
144 self.set_custom_exc = ip.set_custom_exc
145
145
146 self.user_ns = ip.user_ns
146 self.user_ns = ip.user_ns
147
147
148 self.set_crash_handler = ip.set_crash_handler
149
148 # Session-specific data store, which can be used to store
150 # Session-specific data store, which can be used to store
149 # data that should persist through the ipython session.
151 # data that should persist through the ipython session.
150 self.meta = ip.meta
152 self.meta = ip.meta
151
153
152 # The ipython instance provided
154 # The ipython instance provided
153 self.IP = ip
155 self.IP = ip
154
156
155 global _recent
157 global _recent
156 _recent = self
158 _recent = self
157
159
158 # Use a property for some things which are added to the instance very
160 # Use a property for some things which are added to the instance very
159 # late. I don't have time right now to disentangle the initialization
161 # late. I don't have time right now to disentangle the initialization
160 # order issues, so a property lets us delay item extraction while
162 # order issues, so a property lets us delay item extraction while
161 # providing a normal attribute API.
163 # providing a normal attribute API.
162 def get_db(self):
164 def get_db(self):
163 """A handle to persistent dict-like database (a PickleShareDB object)"""
165 """A handle to persistent dict-like database (a PickleShareDB object)"""
164 return self.IP.db
166 return self.IP.db
165
167
166 db = property(get_db,None,None,get_db.__doc__)
168 db = property(get_db,None,None,get_db.__doc__)
167
169
168 def get_options(self):
170 def get_options(self):
169 """All configurable variables."""
171 """All configurable variables."""
170 return self.IP.rc
172 return self.IP.rc
171
173
172 options = property(get_options,None,None,get_options.__doc__)
174 options = property(get_options,None,None,get_options.__doc__)
173
175
174 def expose_magic(self,magicname, func):
176 def expose_magic(self,magicname, func):
175 ''' Expose own function as magic function for ipython
177 ''' Expose own function as magic function for ipython
176
178
177 def foo_impl(self,parameter_s=''):
179 def foo_impl(self,parameter_s=''):
178 """My very own magic!. (Use docstrings, IPython reads them)."""
180 """My very own magic!. (Use docstrings, IPython reads them)."""
179 print 'Magic function. Passed parameter is between < >: <'+parameter_s+'>'
181 print 'Magic function. Passed parameter is between < >: <'+parameter_s+'>'
180 print 'The self object is:',self
182 print 'The self object is:',self
181
183
182 ipapi.expose_magic("foo",foo_impl)
184 ipapi.expose_magic("foo",foo_impl)
183 '''
185 '''
184
186
185 import new
187 import new
186 im = new.instancemethod(func,self.IP, self.IP.__class__)
188 im = new.instancemethod(func,self.IP, self.IP.__class__)
187 setattr(self.IP, "magic_" + magicname, im)
189 setattr(self.IP, "magic_" + magicname, im)
188
190
189 def ex(self,cmd):
191 def ex(self,cmd):
190 """ Execute a normal python statement in user namespace """
192 """ Execute a normal python statement in user namespace """
191 exec cmd in self.user_ns
193 exec cmd in self.user_ns
192
194
193 def ev(self,expr):
195 def ev(self,expr):
194 """ Evaluate python expression expr in user namespace
196 """ Evaluate python expression expr in user namespace
195
197
196 Returns the result of evaluation"""
198 Returns the result of evaluation"""
197 return eval(expr,self.user_ns)
199 return eval(expr,self.user_ns)
198
200
199 def runlines(self,lines):
201 def runlines(self,lines):
200 """ Run the specified lines in interpreter, honoring ipython directives.
202 """ Run the specified lines in interpreter, honoring ipython directives.
201
203
202 This allows %magic and !shell escape notations.
204 This allows %magic and !shell escape notations.
203
205
204 Takes either all lines in one string or list of lines.
206 Takes either all lines in one string or list of lines.
205 """
207 """
206 if isinstance(lines,basestring):
208 if isinstance(lines,basestring):
207 self.IP.runlines(lines)
209 self.IP.runlines(lines)
208 else:
210 else:
209 self.IP.runlines('\n'.join(lines))
211 self.IP.runlines('\n'.join(lines))
210
212
211 def to_user_ns(self,vars):
213 def to_user_ns(self,vars):
212 """Inject a group of variables into the IPython user namespace.
214 """Inject a group of variables into the IPython user namespace.
213
215
214 Inputs:
216 Inputs:
215
217
216 - vars: string with variable names separated by whitespace
218 - vars: string with variable names separated by whitespace
217
219
218 This utility routine is meant to ease interactive debugging work,
220 This utility routine is meant to ease interactive debugging work,
219 where you want to easily propagate some internal variable in your code
221 where you want to easily propagate some internal variable in your code
220 up to the interactive namespace for further exploration.
222 up to the interactive namespace for further exploration.
221
223
222 When you run code via %run, globals in your script become visible at
224 When you run code via %run, globals in your script become visible at
223 the interactive prompt, but this doesn't happen for locals inside your
225 the interactive prompt, but this doesn't happen for locals inside your
224 own functions and methods. Yet when debugging, it is common to want
226 own functions and methods. Yet when debugging, it is common to want
225 to explore some internal variables further at the interactive propmt.
227 to explore some internal variables further at the interactive propmt.
226
228
227 Examples:
229 Examples:
228
230
229 To use this, you first must obtain a handle on the ipython object as
231 To use this, you first must obtain a handle on the ipython object as
230 indicated above, via:
232 indicated above, via:
231
233
232 import IPython.ipapi
234 import IPython.ipapi
233 ip = IPython.ipapi.get()
235 ip = IPython.ipapi.get()
234
236
235 Once this is done, inside a routine foo() where you want to expose
237 Once this is done, inside a routine foo() where you want to expose
236 variables x and y, you do the following:
238 variables x and y, you do the following:
237
239
238 def foo():
240 def foo():
239 ...
241 ...
240 x = your_computation()
242 x = your_computation()
241 y = something_else()
243 y = something_else()
242
244
243 # This pushes x and y to the interactive prompt immediately, even
245 # This pushes x and y to the interactive prompt immediately, even
244 # if this routine crashes on the next line after:
246 # if this routine crashes on the next line after:
245 ip.to_user_ns('x y')
247 ip.to_user_ns('x y')
246 ...
248 ...
247 # return
249 # return
248
250
249 If you need to rename variables, just use ip.user_ns with dict
251 If you need to rename variables, just use ip.user_ns with dict
250 and update:
252 and update:
251
253
252 # exposes variables 'foo' as 'x' and 'bar' as 'y' in IPython
254 # exposes variables 'foo' as 'x' and 'bar' as 'y' in IPython
253 # user namespace
255 # user namespace
254 ip.user_ns.update(dict(x=foo,y=bar))
256 ip.user_ns.update(dict(x=foo,y=bar))
255 """
257 """
256
258
257 # print 'vars given:',vars # dbg
259 # print 'vars given:',vars # dbg
258 # Get the caller's frame to evaluate the given names in
260 # Get the caller's frame to evaluate the given names in
259 cf = sys._getframe(1)
261 cf = sys._getframe(1)
260
262
261 user_ns = self.user_ns
263 user_ns = self.user_ns
262
264
263 for name in vars.split():
265 for name in vars.split():
264 try:
266 try:
265 user_ns[name] = eval(name,cf.f_globals,cf.f_locals)
267 user_ns[name] = eval(name,cf.f_globals,cf.f_locals)
266 except:
268 except:
267 error('could not get var. %s from %s' %
269 error('could not get var. %s from %s' %
268 (name,cf.f_code.co_name))
270 (name,cf.f_code.co_name))
269
271
270 def launch_new_instance(user_ns = None):
272 def launch_new_instance(user_ns = None):
271 """ Make and start a new ipython instance.
273 """ Make and start a new ipython instance.
272
274
273 This can be called even without having an already initialized
275 This can be called even without having an already initialized
274 ipython session running.
276 ipython session running.
275
277
276 This is also used as the egg entry point for the 'ipython' script.
278 This is also used as the egg entry point for the 'ipython' script.
277
279
278 """
280 """
279 ses = make_session(user_ns)
281 ses = make_session(user_ns)
280 ses.mainloop()
282 ses.mainloop()
281
283
282
284
283 def make_user_ns(user_ns = None):
285 def make_user_ns(user_ns = None):
284 """Return a valid user interactive namespace.
286 """Return a valid user interactive namespace.
285
287
286 This builds a dict with the minimal information needed to operate as a
288 This builds a dict with the minimal information needed to operate as a
287 valid IPython user namespace, which you can pass to the various embedding
289 valid IPython user namespace, which you can pass to the various embedding
288 classes in ipython.
290 classes in ipython.
289 """
291 """
290
292
291 if user_ns is None:
293 if user_ns is None:
292 # Set __name__ to __main__ to better match the behavior of the
294 # Set __name__ to __main__ to better match the behavior of the
293 # normal interpreter.
295 # normal interpreter.
294 user_ns = {'__name__' :'__main__',
296 user_ns = {'__name__' :'__main__',
295 '__builtins__' : __builtin__,
297 '__builtins__' : __builtin__,
296 }
298 }
297 else:
299 else:
298 user_ns.setdefault('__name__','__main__')
300 user_ns.setdefault('__name__','__main__')
299 user_ns.setdefault('__builtins__',__builtin__)
301 user_ns.setdefault('__builtins__',__builtin__)
300
302
301 return user_ns
303 return user_ns
302
304
303
305
304 def make_user_global_ns(ns = None):
306 def make_user_global_ns(ns = None):
305 """Return a valid user global namespace.
307 """Return a valid user global namespace.
306
308
307 Similar to make_user_ns(), but global namespaces are really only needed in
309 Similar to make_user_ns(), but global namespaces are really only needed in
308 embedded applications, where there is a distinction between the user's
310 embedded applications, where there is a distinction between the user's
309 interactive namespace and the global one where ipython is running."""
311 interactive namespace and the global one where ipython is running."""
310
312
311 if ns is None: ns = {}
313 if ns is None: ns = {}
312 return ns
314 return ns
313
315
314
316
315 def make_session(user_ns = None):
317 def make_session(user_ns = None):
316 """Makes, but does not launch an IPython session.
318 """Makes, but does not launch an IPython session.
317
319
318 Later on you can call obj.mainloop() on the returned object.
320 Later on you can call obj.mainloop() on the returned object.
319
321
320 Inputs:
322 Inputs:
321
323
322 - user_ns(None): a dict to be used as the user's namespace with initial
324 - user_ns(None): a dict to be used as the user's namespace with initial
323 data.
325 data.
324
326
325 WARNING: This should *not* be run when a session exists already."""
327 WARNING: This should *not* be run when a session exists already."""
326
328
327 import IPython
329 import IPython
328 return IPython.Shell.start(user_ns)
330 return IPython.Shell.start(user_ns)
@@ -1,2421 +1,2432 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 1822 2006-10-12 21:38:00Z vivainio $
9 $Id: iplib.py 1828 2006-10-16 02:04:33Z fptest $
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 pdb
50 import pdb
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
60 from sets import Set
60 from sets import Set
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 import IPython
64 import IPython
65 from IPython import OInspect,PyColorize,ultraTB
65 from IPython import OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
72 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76 import IPython.ipapi
76 import IPython.ipapi
77
77
78 # Globals
78 # Globals
79
79
80 # store the builtin raw_input globally, and use this always, in case user code
80 # store the builtin raw_input globally, and use this always, in case user code
81 # overwrites it (like wx.py.PyShell does)
81 # overwrites it (like wx.py.PyShell does)
82 raw_input_original = raw_input
82 raw_input_original = raw_input
83
83
84 # compiled regexps for autoindent management
84 # compiled regexps for autoindent management
85 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
85 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
86
86
87
87
88 #****************************************************************************
88 #****************************************************************************
89 # Some utility function definitions
89 # Some utility function definitions
90
90
91 ini_spaces_re = re.compile(r'^(\s+)')
91 ini_spaces_re = re.compile(r'^(\s+)')
92
92
93 def num_ini_spaces(strng):
93 def num_ini_spaces(strng):
94 """Return the number of initial spaces in a string"""
94 """Return the number of initial spaces in a string"""
95
95
96 ini_spaces = ini_spaces_re.match(strng)
96 ini_spaces = ini_spaces_re.match(strng)
97 if ini_spaces:
97 if ini_spaces:
98 return ini_spaces.end()
98 return ini_spaces.end()
99 else:
99 else:
100 return 0
100 return 0
101
101
102 def softspace(file, newvalue):
102 def softspace(file, newvalue):
103 """Copied from code.py, to remove the dependency"""
103 """Copied from code.py, to remove the dependency"""
104
104
105 oldvalue = 0
105 oldvalue = 0
106 try:
106 try:
107 oldvalue = file.softspace
107 oldvalue = file.softspace
108 except AttributeError:
108 except AttributeError:
109 pass
109 pass
110 try:
110 try:
111 file.softspace = newvalue
111 file.softspace = newvalue
112 except (AttributeError, TypeError):
112 except (AttributeError, TypeError):
113 # "attribute-less object" or "read-only attributes"
113 # "attribute-less object" or "read-only attributes"
114 pass
114 pass
115 return oldvalue
115 return oldvalue
116
116
117
117
118 #****************************************************************************
118 #****************************************************************************
119 # Local use exceptions
119 # Local use exceptions
120 class SpaceInInput(exceptions.Exception): pass
120 class SpaceInInput(exceptions.Exception): pass
121
121
122
122
123 #****************************************************************************
123 #****************************************************************************
124 # Local use classes
124 # Local use classes
125 class Bunch: pass
125 class Bunch: pass
126
126
127 class Undefined: pass
127 class Undefined: pass
128
128
129 class Quitter(object):
129 class Quitter(object):
130 """Simple class to handle exit, similar to Python 2.5's.
130 """Simple class to handle exit, similar to Python 2.5's.
131
131
132 It handles exiting in an ipython-safe manner, which the one in Python 2.5
132 It handles exiting in an ipython-safe manner, which the one in Python 2.5
133 doesn't do (obviously, since it doesn't know about ipython)."""
133 doesn't do (obviously, since it doesn't know about ipython)."""
134
134
135 def __init__(self,shell,name):
135 def __init__(self,shell,name):
136 self.shell = shell
136 self.shell = shell
137 self.name = name
137 self.name = name
138
138
139 def __repr__(self):
139 def __repr__(self):
140 return 'Type %s() to exit.' % self.name
140 return 'Type %s() to exit.' % self.name
141 __str__ = __repr__
141 __str__ = __repr__
142
142
143 def __call__(self):
143 def __call__(self):
144 self.shell.exit()
144 self.shell.exit()
145
145
146 class InputList(list):
146 class InputList(list):
147 """Class to store user input.
147 """Class to store user input.
148
148
149 It's basically a list, but slices return a string instead of a list, thus
149 It's basically a list, but slices return a string instead of a list, thus
150 allowing things like (assuming 'In' is an instance):
150 allowing things like (assuming 'In' is an instance):
151
151
152 exec In[4:7]
152 exec In[4:7]
153
153
154 or
154 or
155
155
156 exec In[5:9] + In[14] + In[21:25]"""
156 exec In[5:9] + In[14] + In[21:25]"""
157
157
158 def __getslice__(self,i,j):
158 def __getslice__(self,i,j):
159 return ''.join(list.__getslice__(self,i,j))
159 return ''.join(list.__getslice__(self,i,j))
160
160
161 class SyntaxTB(ultraTB.ListTB):
161 class SyntaxTB(ultraTB.ListTB):
162 """Extension which holds some state: the last exception value"""
162 """Extension which holds some state: the last exception value"""
163
163
164 def __init__(self,color_scheme = 'NoColor'):
164 def __init__(self,color_scheme = 'NoColor'):
165 ultraTB.ListTB.__init__(self,color_scheme)
165 ultraTB.ListTB.__init__(self,color_scheme)
166 self.last_syntax_error = None
166 self.last_syntax_error = None
167
167
168 def __call__(self, etype, value, elist):
168 def __call__(self, etype, value, elist):
169 self.last_syntax_error = value
169 self.last_syntax_error = value
170 ultraTB.ListTB.__call__(self,etype,value,elist)
170 ultraTB.ListTB.__call__(self,etype,value,elist)
171
171
172 def clear_err_state(self):
172 def clear_err_state(self):
173 """Return the current error state and clear it"""
173 """Return the current error state and clear it"""
174 e = self.last_syntax_error
174 e = self.last_syntax_error
175 self.last_syntax_error = None
175 self.last_syntax_error = None
176 return e
176 return e
177
177
178 #****************************************************************************
178 #****************************************************************************
179 # Main IPython class
179 # Main IPython class
180
180
181 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
181 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
182 # until a full rewrite is made. I've cleaned all cross-class uses of
182 # until a full rewrite is made. I've cleaned all cross-class uses of
183 # attributes and methods, but too much user code out there relies on the
183 # attributes and methods, but too much user code out there relies on the
184 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
184 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
185 #
185 #
186 # But at least now, all the pieces have been separated and we could, in
186 # But at least now, all the pieces have been separated and we could, in
187 # principle, stop using the mixin. This will ease the transition to the
187 # principle, stop using the mixin. This will ease the transition to the
188 # chainsaw branch.
188 # chainsaw branch.
189
189
190 # For reference, the following is the list of 'self.foo' uses in the Magic
190 # For reference, the following is the list of 'self.foo' uses in the Magic
191 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
191 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
192 # class, to prevent clashes.
192 # class, to prevent clashes.
193
193
194 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
194 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
195 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
195 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
196 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
196 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
197 # 'self.value']
197 # 'self.value']
198
198
199 class InteractiveShell(object,Magic):
199 class InteractiveShell(object,Magic):
200 """An enhanced console for Python."""
200 """An enhanced console for Python."""
201
201
202 # class attribute to indicate whether the class supports threads or not.
202 # class attribute to indicate whether the class supports threads or not.
203 # Subclasses with thread support should override this as needed.
203 # Subclasses with thread support should override this as needed.
204 isthreaded = False
204 isthreaded = False
205
205
206 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
206 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
207 user_ns = None,user_global_ns=None,banner2='',
207 user_ns = None,user_global_ns=None,banner2='',
208 custom_exceptions=((),None),embedded=False):
208 custom_exceptions=((),None),embedded=False):
209
209
210 # log system
210 # log system
211 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
211 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
212
212
213 # some minimal strict typechecks. For some core data structures, I
213 # some minimal strict typechecks. For some core data structures, I
214 # want actual basic python types, not just anything that looks like
214 # want actual basic python types, not just anything that looks like
215 # one. This is especially true for namespaces.
215 # one. This is especially true for namespaces.
216 for ns in (user_ns,user_global_ns):
216 for ns in (user_ns,user_global_ns):
217 if ns is not None and type(ns) != types.DictType:
217 if ns is not None and type(ns) != types.DictType:
218 raise TypeError,'namespace must be a dictionary'
218 raise TypeError,'namespace must be a dictionary'
219
219
220 # Job manager (for jobs run as background threads)
220 # Job manager (for jobs run as background threads)
221 self.jobs = BackgroundJobManager()
221 self.jobs = BackgroundJobManager()
222
222
223 # Store the actual shell's name
223 # Store the actual shell's name
224 self.name = name
224 self.name = name
225
225
226 # We need to know whether the instance is meant for embedding, since
226 # We need to know whether the instance is meant for embedding, since
227 # global/local namespaces need to be handled differently in that case
227 # global/local namespaces need to be handled differently in that case
228 self.embedded = embedded
228 self.embedded = embedded
229
229
230 # command compiler
230 # command compiler
231 self.compile = codeop.CommandCompiler()
231 self.compile = codeop.CommandCompiler()
232
232
233 # User input buffer
233 # User input buffer
234 self.buffer = []
234 self.buffer = []
235
235
236 # Default name given in compilation of code
236 # Default name given in compilation of code
237 self.filename = '<ipython console>'
237 self.filename = '<ipython console>'
238
238
239 # Install our own quitter instead of the builtins. For python2.3-2.4,
239 # Install our own quitter instead of the builtins. For python2.3-2.4,
240 # this brings in behavior like 2.5, and for 2.5 it's identical.
240 # this brings in behavior like 2.5, and for 2.5 it's identical.
241 __builtin__.exit = Quitter(self,'exit')
241 __builtin__.exit = Quitter(self,'exit')
242 __builtin__.quit = Quitter(self,'quit')
242 __builtin__.quit = Quitter(self,'quit')
243
243
244 # Make an empty namespace, which extension writers can rely on both
244 # Make an empty namespace, which extension writers can rely on both
245 # existing and NEVER being used by ipython itself. This gives them a
245 # existing and NEVER being used by ipython itself. This gives them a
246 # convenient location for storing additional information and state
246 # convenient location for storing additional information and state
247 # their extensions may require, without fear of collisions with other
247 # their extensions may require, without fear of collisions with other
248 # ipython names that may develop later.
248 # ipython names that may develop later.
249 self.meta = Struct()
249 self.meta = Struct()
250
250
251 # Create the namespace where the user will operate. user_ns is
251 # Create the namespace where the user will operate. user_ns is
252 # normally the only one used, and it is passed to the exec calls as
252 # normally the only one used, and it is passed to the exec calls as
253 # the locals argument. But we do carry a user_global_ns namespace
253 # the locals argument. But we do carry a user_global_ns namespace
254 # given as the exec 'globals' argument, This is useful in embedding
254 # given as the exec 'globals' argument, This is useful in embedding
255 # situations where the ipython shell opens in a context where the
255 # situations where the ipython shell opens in a context where the
256 # distinction between locals and globals is meaningful.
256 # distinction between locals and globals is meaningful.
257
257
258 # FIXME. For some strange reason, __builtins__ is showing up at user
258 # FIXME. For some strange reason, __builtins__ is showing up at user
259 # level as a dict instead of a module. This is a manual fix, but I
259 # level as a dict instead of a module. This is a manual fix, but I
260 # should really track down where the problem is coming from. Alex
260 # should really track down where the problem is coming from. Alex
261 # Schmolck reported this problem first.
261 # Schmolck reported this problem first.
262
262
263 # A useful post by Alex Martelli on this topic:
263 # A useful post by Alex Martelli on this topic:
264 # Re: inconsistent value from __builtins__
264 # Re: inconsistent value from __builtins__
265 # Von: Alex Martelli <aleaxit@yahoo.com>
265 # Von: Alex Martelli <aleaxit@yahoo.com>
266 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
266 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
267 # Gruppen: comp.lang.python
267 # Gruppen: comp.lang.python
268
268
269 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
269 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
270 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
270 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
271 # > <type 'dict'>
271 # > <type 'dict'>
272 # > >>> print type(__builtins__)
272 # > >>> print type(__builtins__)
273 # > <type 'module'>
273 # > <type 'module'>
274 # > Is this difference in return value intentional?
274 # > Is this difference in return value intentional?
275
275
276 # Well, it's documented that '__builtins__' can be either a dictionary
276 # Well, it's documented that '__builtins__' can be either a dictionary
277 # or a module, and it's been that way for a long time. Whether it's
277 # or a module, and it's been that way for a long time. Whether it's
278 # intentional (or sensible), I don't know. In any case, the idea is
278 # intentional (or sensible), I don't know. In any case, the idea is
279 # that if you need to access the built-in namespace directly, you
279 # that if you need to access the built-in namespace directly, you
280 # should start with "import __builtin__" (note, no 's') which will
280 # should start with "import __builtin__" (note, no 's') which will
281 # definitely give you a module. Yeah, it's somewhat confusing:-(.
281 # definitely give you a module. Yeah, it's somewhat confusing:-(.
282
282
283 # These routines return properly built dicts as needed by the rest of
283 # These routines return properly built dicts as needed by the rest of
284 # the code, and can also be used by extension writers to generate
284 # the code, and can also be used by extension writers to generate
285 # properly initialized namespaces.
285 # properly initialized namespaces.
286 user_ns = IPython.ipapi.make_user_ns(user_ns)
286 user_ns = IPython.ipapi.make_user_ns(user_ns)
287 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
287 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
288
288
289 # Assign namespaces
289 # Assign namespaces
290 # This is the namespace where all normal user variables live
290 # This is the namespace where all normal user variables live
291 self.user_ns = user_ns
291 self.user_ns = user_ns
292 # Embedded instances require a separate namespace for globals.
292 # Embedded instances require a separate namespace for globals.
293 # Normally this one is unused by non-embedded instances.
293 # Normally this one is unused by non-embedded instances.
294 self.user_global_ns = user_global_ns
294 self.user_global_ns = user_global_ns
295 # A namespace to keep track of internal data structures to prevent
295 # A namespace to keep track of internal data structures to prevent
296 # them from cluttering user-visible stuff. Will be updated later
296 # them from cluttering user-visible stuff. Will be updated later
297 self.internal_ns = {}
297 self.internal_ns = {}
298
298
299 # Namespace of system aliases. Each entry in the alias
299 # Namespace of system aliases. Each entry in the alias
300 # table must be a 2-tuple of the form (N,name), where N is the number
300 # table must be a 2-tuple of the form (N,name), where N is the number
301 # of positional arguments of the alias.
301 # of positional arguments of the alias.
302 self.alias_table = {}
302 self.alias_table = {}
303
303
304 # A table holding all the namespaces IPython deals with, so that
304 # A table holding all the namespaces IPython deals with, so that
305 # introspection facilities can search easily.
305 # introspection facilities can search easily.
306 self.ns_table = {'user':user_ns,
306 self.ns_table = {'user':user_ns,
307 'user_global':user_global_ns,
307 'user_global':user_global_ns,
308 'alias':self.alias_table,
308 'alias':self.alias_table,
309 'internal':self.internal_ns,
309 'internal':self.internal_ns,
310 'builtin':__builtin__.__dict__
310 'builtin':__builtin__.__dict__
311 }
311 }
312
312
313 # The user namespace MUST have a pointer to the shell itself.
313 # The user namespace MUST have a pointer to the shell itself.
314 self.user_ns[name] = self
314 self.user_ns[name] = self
315
315
316 # We need to insert into sys.modules something that looks like a
316 # We need to insert into sys.modules something that looks like a
317 # module but which accesses the IPython namespace, for shelve and
317 # module but which accesses the IPython namespace, for shelve and
318 # pickle to work interactively. Normally they rely on getting
318 # pickle to work interactively. Normally they rely on getting
319 # everything out of __main__, but for embedding purposes each IPython
319 # everything out of __main__, but for embedding purposes each IPython
320 # instance has its own private namespace, so we can't go shoving
320 # instance has its own private namespace, so we can't go shoving
321 # everything into __main__.
321 # everything into __main__.
322
322
323 # note, however, that we should only do this for non-embedded
323 # note, however, that we should only do this for non-embedded
324 # ipythons, which really mimic the __main__.__dict__ with their own
324 # ipythons, which really mimic the __main__.__dict__ with their own
325 # namespace. Embedded instances, on the other hand, should not do
325 # namespace. Embedded instances, on the other hand, should not do
326 # this because they need to manage the user local/global namespaces
326 # this because they need to manage the user local/global namespaces
327 # only, but they live within a 'normal' __main__ (meaning, they
327 # only, but they live within a 'normal' __main__ (meaning, they
328 # shouldn't overtake the execution environment of the script they're
328 # shouldn't overtake the execution environment of the script they're
329 # embedded in).
329 # embedded in).
330
330
331 if not embedded:
331 if not embedded:
332 try:
332 try:
333 main_name = self.user_ns['__name__']
333 main_name = self.user_ns['__name__']
334 except KeyError:
334 except KeyError:
335 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
335 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
336 else:
336 else:
337 #print "pickle hack in place" # dbg
337 #print "pickle hack in place" # dbg
338 #print 'main_name:',main_name # dbg
338 #print 'main_name:',main_name # dbg
339 sys.modules[main_name] = FakeModule(self.user_ns)
339 sys.modules[main_name] = FakeModule(self.user_ns)
340
340
341 # List of input with multi-line handling.
341 # List of input with multi-line handling.
342 # Fill its zero entry, user counter starts at 1
342 # Fill its zero entry, user counter starts at 1
343 self.input_hist = InputList(['\n'])
343 self.input_hist = InputList(['\n'])
344 # This one will hold the 'raw' input history, without any
344 # This one will hold the 'raw' input history, without any
345 # pre-processing. This will allow users to retrieve the input just as
345 # pre-processing. This will allow users to retrieve the input just as
346 # it was exactly typed in by the user, with %hist -r.
346 # it was exactly typed in by the user, with %hist -r.
347 self.input_hist_raw = InputList(['\n'])
347 self.input_hist_raw = InputList(['\n'])
348
348
349 # list of visited directories
349 # list of visited directories
350 try:
350 try:
351 self.dir_hist = [os.getcwd()]
351 self.dir_hist = [os.getcwd()]
352 except IOError, e:
352 except IOError, e:
353 self.dir_hist = []
353 self.dir_hist = []
354
354
355 # dict of output history
355 # dict of output history
356 self.output_hist = {}
356 self.output_hist = {}
357
357
358 # dict of things NOT to alias (keywords, builtins and some magics)
358 # dict of things NOT to alias (keywords, builtins and some magics)
359 no_alias = {}
359 no_alias = {}
360 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
360 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
361 for key in keyword.kwlist + no_alias_magics:
361 for key in keyword.kwlist + no_alias_magics:
362 no_alias[key] = 1
362 no_alias[key] = 1
363 no_alias.update(__builtin__.__dict__)
363 no_alias.update(__builtin__.__dict__)
364 self.no_alias = no_alias
364 self.no_alias = no_alias
365
365
366 # make global variables for user access to these
366 # make global variables for user access to these
367 self.user_ns['_ih'] = self.input_hist
367 self.user_ns['_ih'] = self.input_hist
368 self.user_ns['_oh'] = self.output_hist
368 self.user_ns['_oh'] = self.output_hist
369 self.user_ns['_dh'] = self.dir_hist
369 self.user_ns['_dh'] = self.dir_hist
370
370
371 # user aliases to input and output histories
371 # user aliases to input and output histories
372 self.user_ns['In'] = self.input_hist
372 self.user_ns['In'] = self.input_hist
373 self.user_ns['Out'] = self.output_hist
373 self.user_ns['Out'] = self.output_hist
374
374
375 # Object variable to store code object waiting execution. This is
375 # Object variable to store code object waiting execution. This is
376 # used mainly by the multithreaded shells, but it can come in handy in
376 # used mainly by the multithreaded shells, but it can come in handy in
377 # other situations. No need to use a Queue here, since it's a single
377 # other situations. No need to use a Queue here, since it's a single
378 # item which gets cleared once run.
378 # item which gets cleared once run.
379 self.code_to_run = None
379 self.code_to_run = None
380
380
381 # escapes for automatic behavior on the command line
381 # escapes for automatic behavior on the command line
382 self.ESC_SHELL = '!'
382 self.ESC_SHELL = '!'
383 self.ESC_HELP = '?'
383 self.ESC_HELP = '?'
384 self.ESC_MAGIC = '%'
384 self.ESC_MAGIC = '%'
385 self.ESC_QUOTE = ','
385 self.ESC_QUOTE = ','
386 self.ESC_QUOTE2 = ';'
386 self.ESC_QUOTE2 = ';'
387 self.ESC_PAREN = '/'
387 self.ESC_PAREN = '/'
388
388
389 # And their associated handlers
389 # And their associated handlers
390 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
390 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
391 self.ESC_QUOTE : self.handle_auto,
391 self.ESC_QUOTE : self.handle_auto,
392 self.ESC_QUOTE2 : self.handle_auto,
392 self.ESC_QUOTE2 : self.handle_auto,
393 self.ESC_MAGIC : self.handle_magic,
393 self.ESC_MAGIC : self.handle_magic,
394 self.ESC_HELP : self.handle_help,
394 self.ESC_HELP : self.handle_help,
395 self.ESC_SHELL : self.handle_shell_escape,
395 self.ESC_SHELL : self.handle_shell_escape,
396 }
396 }
397
397
398 # class initializations
398 # class initializations
399 Magic.__init__(self,self)
399 Magic.__init__(self,self)
400
400
401 # Python source parser/formatter for syntax highlighting
401 # Python source parser/formatter for syntax highlighting
402 pyformat = PyColorize.Parser().format
402 pyformat = PyColorize.Parser().format
403 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
403 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
404
404
405 # hooks holds pointers used for user-side customizations
405 # hooks holds pointers used for user-side customizations
406 self.hooks = Struct()
406 self.hooks = Struct()
407
407
408 # Set all default hooks, defined in the IPython.hooks module.
408 # Set all default hooks, defined in the IPython.hooks module.
409 hooks = IPython.hooks
409 hooks = IPython.hooks
410 for hook_name in hooks.__all__:
410 for hook_name in hooks.__all__:
411 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
411 # default hooks have priority 100, i.e. low; user hooks should have 0-100 priority
412 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
412 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
413 #print "bound hook",hook_name
413 #print "bound hook",hook_name
414
414
415 # Flag to mark unconditional exit
415 # Flag to mark unconditional exit
416 self.exit_now = False
416 self.exit_now = False
417
417
418 self.usage_min = """\
418 self.usage_min = """\
419 An enhanced console for Python.
419 An enhanced console for Python.
420 Some of its features are:
420 Some of its features are:
421 - Readline support if the readline library is present.
421 - Readline support if the readline library is present.
422 - Tab completion in the local namespace.
422 - Tab completion in the local namespace.
423 - Logging of input, see command-line options.
423 - Logging of input, see command-line options.
424 - System shell escape via ! , eg !ls.
424 - System shell escape via ! , eg !ls.
425 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
425 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
426 - Keeps track of locally defined variables via %who, %whos.
426 - Keeps track of locally defined variables via %who, %whos.
427 - Show object information with a ? eg ?x or x? (use ?? for more info).
427 - Show object information with a ? eg ?x or x? (use ?? for more info).
428 """
428 """
429 if usage: self.usage = usage
429 if usage: self.usage = usage
430 else: self.usage = self.usage_min
430 else: self.usage = self.usage_min
431
431
432 # Storage
432 # Storage
433 self.rc = rc # This will hold all configuration information
433 self.rc = rc # This will hold all configuration information
434 self.pager = 'less'
434 self.pager = 'less'
435 # temporary files used for various purposes. Deleted at exit.
435 # temporary files used for various purposes. Deleted at exit.
436 self.tempfiles = []
436 self.tempfiles = []
437
437
438 # Keep track of readline usage (later set by init_readline)
438 # Keep track of readline usage (later set by init_readline)
439 self.has_readline = False
439 self.has_readline = False
440
440
441 # template for logfile headers. It gets resolved at runtime by the
441 # template for logfile headers. It gets resolved at runtime by the
442 # logstart method.
442 # logstart method.
443 self.loghead_tpl = \
443 self.loghead_tpl = \
444 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
444 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
445 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
445 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
446 #log# opts = %s
446 #log# opts = %s
447 #log# args = %s
447 #log# args = %s
448 #log# It is safe to make manual edits below here.
448 #log# It is safe to make manual edits below here.
449 #log#-----------------------------------------------------------------------
449 #log#-----------------------------------------------------------------------
450 """
450 """
451 # for pushd/popd management
451 # for pushd/popd management
452 try:
452 try:
453 self.home_dir = get_home_dir()
453 self.home_dir = get_home_dir()
454 except HomeDirError,msg:
454 except HomeDirError,msg:
455 fatal(msg)
455 fatal(msg)
456
456
457 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
457 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
458
458
459 # Functions to call the underlying shell.
459 # Functions to call the underlying shell.
460
460
461 # utility to expand user variables via Itpl
461 # utility to expand user variables via Itpl
462 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
462 self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'),
463 self.user_ns))
463 self.user_ns))
464 # The first is similar to os.system, but it doesn't return a value,
464 # The first is similar to os.system, but it doesn't return a value,
465 # and it allows interpolation of variables in the user's namespace.
465 # and it allows interpolation of variables in the user's namespace.
466 self.system = lambda cmd: shell(self.var_expand(cmd),
466 self.system = lambda cmd: shell(self.var_expand(cmd),
467 header='IPython system call: ',
467 header='IPython system call: ',
468 verbose=self.rc.system_verbose)
468 verbose=self.rc.system_verbose)
469 # These are for getoutput and getoutputerror:
469 # These are for getoutput and getoutputerror:
470 self.getoutput = lambda cmd: \
470 self.getoutput = lambda cmd: \
471 getoutput(self.var_expand(cmd),
471 getoutput(self.var_expand(cmd),
472 header='IPython system call: ',
472 header='IPython system call: ',
473 verbose=self.rc.system_verbose)
473 verbose=self.rc.system_verbose)
474 self.getoutputerror = lambda cmd: \
474 self.getoutputerror = lambda cmd: \
475 getoutputerror(self.var_expand(cmd),
475 getoutputerror(self.var_expand(cmd),
476 header='IPython system call: ',
476 header='IPython system call: ',
477 verbose=self.rc.system_verbose)
477 verbose=self.rc.system_verbose)
478
478
479 # RegExp for splitting line contents into pre-char//first
479 # RegExp for splitting line contents into pre-char//first
480 # word-method//rest. For clarity, each group in on one line.
480 # word-method//rest. For clarity, each group in on one line.
481
481
482 # WARNING: update the regexp if the above escapes are changed, as they
482 # WARNING: update the regexp if the above escapes are changed, as they
483 # are hardwired in.
483 # are hardwired in.
484
484
485 # Don't get carried away with trying to make the autocalling catch too
485 # Don't get carried away with trying to make the autocalling catch too
486 # much: it's better to be conservative rather than to trigger hidden
486 # much: it's better to be conservative rather than to trigger hidden
487 # evals() somewhere and end up causing side effects.
487 # evals() somewhere and end up causing side effects.
488
488
489 self.line_split = re.compile(r'^([\s*,;/])'
489 self.line_split = re.compile(r'^([\s*,;/])'
490 r'([\?\w\.]+\w*\s*)'
490 r'([\?\w\.]+\w*\s*)'
491 r'(\(?.*$)')
491 r'(\(?.*$)')
492
492
493 # Original re, keep around for a while in case changes break something
493 # Original re, keep around for a while in case changes break something
494 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
494 #self.line_split = re.compile(r'(^[\s*!\?%,/]?)'
495 # r'(\s*[\?\w\.]+\w*\s*)'
495 # r'(\s*[\?\w\.]+\w*\s*)'
496 # r'(\(?.*$)')
496 # r'(\(?.*$)')
497
497
498 # RegExp to identify potential function names
498 # RegExp to identify potential function names
499 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
499 self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$')
500
500
501 # RegExp to exclude strings with this start from autocalling. In
501 # RegExp to exclude strings with this start from autocalling. In
502 # particular, all binary operators should be excluded, so that if foo
502 # particular, all binary operators should be excluded, so that if foo
503 # is callable, foo OP bar doesn't become foo(OP bar), which is
503 # is callable, foo OP bar doesn't become foo(OP bar), which is
504 # invalid. The characters '!=()' don't need to be checked for, as the
504 # invalid. The characters '!=()' don't need to be checked for, as the
505 # _prefilter routine explicitely does so, to catch direct calls and
505 # _prefilter routine explicitely does so, to catch direct calls and
506 # rebindings of existing names.
506 # rebindings of existing names.
507
507
508 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
508 # Warning: the '-' HAS TO BE AT THE END of the first group, otherwise
509 # it affects the rest of the group in square brackets.
509 # it affects the rest of the group in square brackets.
510 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
510 self.re_exclude_auto = re.compile(r'^[<>,&^\|\*/\+-]'
511 '|^is |^not |^in |^and |^or ')
511 '|^is |^not |^in |^and |^or ')
512
512
513 # try to catch also methods for stuff in lists/tuples/dicts: off
513 # try to catch also methods for stuff in lists/tuples/dicts: off
514 # (experimental). For this to work, the line_split regexp would need
514 # (experimental). For this to work, the line_split regexp would need
515 # to be modified so it wouldn't break things at '['. That line is
515 # to be modified so it wouldn't break things at '['. That line is
516 # nasty enough that I shouldn't change it until I can test it _well_.
516 # nasty enough that I shouldn't change it until I can test it _well_.
517 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
517 #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$')
518
518
519 # keep track of where we started running (mainly for crash post-mortem)
519 # keep track of where we started running (mainly for crash post-mortem)
520 self.starting_dir = os.getcwd()
520 self.starting_dir = os.getcwd()
521
521
522 # Various switches which can be set
522 # Various switches which can be set
523 self.CACHELENGTH = 5000 # this is cheap, it's just text
523 self.CACHELENGTH = 5000 # this is cheap, it's just text
524 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
524 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
525 self.banner2 = banner2
525 self.banner2 = banner2
526
526
527 # TraceBack handlers:
527 # TraceBack handlers:
528
528
529 # Syntax error handler.
529 # Syntax error handler.
530 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
530 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
531
531
532 # The interactive one is initialized with an offset, meaning we always
532 # The interactive one is initialized with an offset, meaning we always
533 # want to remove the topmost item in the traceback, which is our own
533 # want to remove the topmost item in the traceback, which is our own
534 # internal code. Valid modes: ['Plain','Context','Verbose']
534 # internal code. Valid modes: ['Plain','Context','Verbose']
535 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
535 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
536 color_scheme='NoColor',
536 color_scheme='NoColor',
537 tb_offset = 1)
537 tb_offset = 1)
538
538
539 # IPython itself shouldn't crash. This will produce a detailed
539 # IPython itself shouldn't crash. This will produce a detailed
540 # post-mortem if it does. But we only install the crash handler for
540 # post-mortem if it does. But we only install the crash handler for
541 # non-threaded shells, the threaded ones use a normal verbose reporter
541 # non-threaded shells, the threaded ones use a normal verbose reporter
542 # and lose the crash handler. This is because exceptions in the main
542 # and lose the crash handler. This is because exceptions in the main
543 # thread (such as in GUI code) propagate directly to sys.excepthook,
543 # thread (such as in GUI code) propagate directly to sys.excepthook,
544 # and there's no point in printing crash dumps for every user exception.
544 # and there's no point in printing crash dumps for every user exception.
545 if self.isthreaded:
545 if self.isthreaded:
546 sys.excepthook = ultraTB.FormattedTB()
546 ipCrashHandler = ultraTB.FormattedTB()
547 else:
547 else:
548 from IPython import CrashHandler
548 from IPython import CrashHandler
549 sys.excepthook = CrashHandler.CrashHandler(self)
549 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
550
550 self.set_crash_handler(ipCrashHandler)
551 # The instance will store a pointer to this, so that runtime code
552 # (such as magics) can access it. This is because during the
553 # read-eval loop, it gets temporarily overwritten (to deal with GUI
554 # frameworks).
555 self.sys_excepthook = sys.excepthook
556
551
557 # and add any custom exception handlers the user may have specified
552 # and add any custom exception handlers the user may have specified
558 self.set_custom_exc(*custom_exceptions)
553 self.set_custom_exc(*custom_exceptions)
559
554
560 # indentation management
555 # indentation management
561 self.autoindent = False
556 self.autoindent = False
562 self.indent_current_nsp = 0
557 self.indent_current_nsp = 0
563
558
564 # Make some aliases automatically
559 # Make some aliases automatically
565 # Prepare list of shell aliases to auto-define
560 # Prepare list of shell aliases to auto-define
566 if os.name == 'posix':
561 if os.name == 'posix':
567 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
562 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
568 'mv mv -i','rm rm -i','cp cp -i',
563 'mv mv -i','rm rm -i','cp cp -i',
569 'cat cat','less less','clear clear',
564 'cat cat','less less','clear clear',
570 # a better ls
565 # a better ls
571 'ls ls -F',
566 'ls ls -F',
572 # long ls
567 # long ls
573 'll ls -lF')
568 'll ls -lF')
574 # Extra ls aliases with color, which need special treatment on BSD
569 # Extra ls aliases with color, which need special treatment on BSD
575 # variants
570 # variants
576 ls_extra = ( # color ls
571 ls_extra = ( # color ls
577 'lc ls -F -o --color',
572 'lc ls -F -o --color',
578 # ls normal files only
573 # ls normal files only
579 'lf ls -F -o --color %l | grep ^-',
574 'lf ls -F -o --color %l | grep ^-',
580 # ls symbolic links
575 # ls symbolic links
581 'lk ls -F -o --color %l | grep ^l',
576 'lk ls -F -o --color %l | grep ^l',
582 # directories or links to directories,
577 # directories or links to directories,
583 'ldir ls -F -o --color %l | grep /$',
578 'ldir ls -F -o --color %l | grep /$',
584 # things which are executable
579 # things which are executable
585 'lx ls -F -o --color %l | grep ^-..x',
580 'lx ls -F -o --color %l | grep ^-..x',
586 )
581 )
587 # The BSDs don't ship GNU ls, so they don't understand the
582 # The BSDs don't ship GNU ls, so they don't understand the
588 # --color switch out of the box
583 # --color switch out of the box
589 if 'bsd' in sys.platform:
584 if 'bsd' in sys.platform:
590 ls_extra = ( # ls normal files only
585 ls_extra = ( # ls normal files only
591 'lf ls -lF | grep ^-',
586 'lf ls -lF | grep ^-',
592 # ls symbolic links
587 # ls symbolic links
593 'lk ls -lF | grep ^l',
588 'lk ls -lF | grep ^l',
594 # directories or links to directories,
589 # directories or links to directories,
595 'ldir ls -lF | grep /$',
590 'ldir ls -lF | grep /$',
596 # things which are executable
591 # things which are executable
597 'lx ls -lF | grep ^-..x',
592 'lx ls -lF | grep ^-..x',
598 )
593 )
599 auto_alias = auto_alias + ls_extra
594 auto_alias = auto_alias + ls_extra
600 elif os.name in ['nt','dos']:
595 elif os.name in ['nt','dos']:
601 auto_alias = ('dir dir /on', 'ls dir /on',
596 auto_alias = ('dir dir /on', 'ls dir /on',
602 'ddir dir /ad /on', 'ldir dir /ad /on',
597 'ddir dir /ad /on', 'ldir dir /ad /on',
603 'mkdir mkdir','rmdir rmdir','echo echo',
598 'mkdir mkdir','rmdir rmdir','echo echo',
604 'ren ren','cls cls','copy copy')
599 'ren ren','cls cls','copy copy')
605 else:
600 else:
606 auto_alias = ()
601 auto_alias = ()
607 self.auto_alias = [s.split(None,1) for s in auto_alias]
602 self.auto_alias = [s.split(None,1) for s in auto_alias]
608 # Call the actual (public) initializer
603 # Call the actual (public) initializer
609 self.init_auto_alias()
604 self.init_auto_alias()
610
605
611 # Produce a public API instance
606 # Produce a public API instance
612 self.api = IPython.ipapi.IPApi(self)
607 self.api = IPython.ipapi.IPApi(self)
613
608
614 # track which builtins we add, so we can clean up later
609 # track which builtins we add, so we can clean up later
615 self.builtins_added = {}
610 self.builtins_added = {}
616 # This method will add the necessary builtins for operation, but
611 # This method will add the necessary builtins for operation, but
617 # tracking what it did via the builtins_added dict.
612 # tracking what it did via the builtins_added dict.
618 self.add_builtins()
613 self.add_builtins()
619
614
620 # end __init__
615 # end __init__
621
616
622 def pre_config_initialization(self):
617 def pre_config_initialization(self):
623 """Pre-configuration init method
618 """Pre-configuration init method
624
619
625 This is called before the configuration files are processed to
620 This is called before the configuration files are processed to
626 prepare the services the config files might need.
621 prepare the services the config files might need.
627
622
628 self.rc already has reasonable default values at this point.
623 self.rc already has reasonable default values at this point.
629 """
624 """
630 rc = self.rc
625 rc = self.rc
631
626
632 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
627 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
633
628
634 def post_config_initialization(self):
629 def post_config_initialization(self):
635 """Post configuration init method
630 """Post configuration init method
636
631
637 This is called after the configuration files have been processed to
632 This is called after the configuration files have been processed to
638 'finalize' the initialization."""
633 'finalize' the initialization."""
639
634
640 rc = self.rc
635 rc = self.rc
641
636
642 # Object inspector
637 # Object inspector
643 self.inspector = OInspect.Inspector(OInspect.InspectColors,
638 self.inspector = OInspect.Inspector(OInspect.InspectColors,
644 PyColorize.ANSICodeColors,
639 PyColorize.ANSICodeColors,
645 'NoColor',
640 'NoColor',
646 rc.object_info_string_level)
641 rc.object_info_string_level)
647
642
648 # Load readline proper
643 # Load readline proper
649 if rc.readline:
644 if rc.readline:
650 self.init_readline()
645 self.init_readline()
651
646
652 # local shortcut, this is used a LOT
647 # local shortcut, this is used a LOT
653 self.log = self.logger.log
648 self.log = self.logger.log
654
649
655 # Initialize cache, set in/out prompts and printing system
650 # Initialize cache, set in/out prompts and printing system
656 self.outputcache = CachedOutput(self,
651 self.outputcache = CachedOutput(self,
657 rc.cache_size,
652 rc.cache_size,
658 rc.pprint,
653 rc.pprint,
659 input_sep = rc.separate_in,
654 input_sep = rc.separate_in,
660 output_sep = rc.separate_out,
655 output_sep = rc.separate_out,
661 output_sep2 = rc.separate_out2,
656 output_sep2 = rc.separate_out2,
662 ps1 = rc.prompt_in1,
657 ps1 = rc.prompt_in1,
663 ps2 = rc.prompt_in2,
658 ps2 = rc.prompt_in2,
664 ps_out = rc.prompt_out,
659 ps_out = rc.prompt_out,
665 pad_left = rc.prompts_pad_left)
660 pad_left = rc.prompts_pad_left)
666
661
667 # user may have over-ridden the default print hook:
662 # user may have over-ridden the default print hook:
668 try:
663 try:
669 self.outputcache.__class__.display = self.hooks.display
664 self.outputcache.__class__.display = self.hooks.display
670 except AttributeError:
665 except AttributeError:
671 pass
666 pass
672
667
673 # I don't like assigning globally to sys, because it means when embedding
668 # I don't like assigning globally to sys, because it means when embedding
674 # instances, each embedded instance overrides the previous choice. But
669 # instances, each embedded instance overrides the previous choice. But
675 # sys.displayhook seems to be called internally by exec, so I don't see a
670 # sys.displayhook seems to be called internally by exec, so I don't see a
676 # way around it.
671 # way around it.
677 sys.displayhook = self.outputcache
672 sys.displayhook = self.outputcache
678
673
679 # Set user colors (don't do it in the constructor above so that it
674 # Set user colors (don't do it in the constructor above so that it
680 # doesn't crash if colors option is invalid)
675 # doesn't crash if colors option is invalid)
681 self.magic_colors(rc.colors)
676 self.magic_colors(rc.colors)
682
677
683 # Set calling of pdb on exceptions
678 # Set calling of pdb on exceptions
684 self.call_pdb = rc.pdb
679 self.call_pdb = rc.pdb
685
680
686 # Load user aliases
681 # Load user aliases
687 for alias in rc.alias:
682 for alias in rc.alias:
688 self.magic_alias(alias)
683 self.magic_alias(alias)
689 self.hooks.late_startup_hook()
684 self.hooks.late_startup_hook()
690
685
691 batchrun = False
686 batchrun = False
692 for batchfile in [path(arg) for arg in self.rc.args
687 for batchfile in [path(arg) for arg in self.rc.args
693 if arg.lower().endswith('.ipy')]:
688 if arg.lower().endswith('.ipy')]:
694 if not batchfile.isfile():
689 if not batchfile.isfile():
695 print "No such batch file:", batchfile
690 print "No such batch file:", batchfile
696 continue
691 continue
697 self.api.runlines(batchfile.text())
692 self.api.runlines(batchfile.text())
698 batchrun = True
693 batchrun = True
699 if batchrun:
694 if batchrun:
700 self.exit_now = True
695 self.exit_now = True
701
696
702 def add_builtins(self):
697 def add_builtins(self):
703 """Store ipython references into the builtin namespace.
698 """Store ipython references into the builtin namespace.
704
699
705 Some parts of ipython operate via builtins injected here, which hold a
700 Some parts of ipython operate via builtins injected here, which hold a
706 reference to IPython itself."""
701 reference to IPython itself."""
707
702
708 # TODO: deprecate all except _ip; 'jobs' should be installed
703 # TODO: deprecate all except _ip; 'jobs' should be installed
709 # by an extension and the rest are under _ip, ipalias is redundant
704 # by an extension and the rest are under _ip, ipalias is redundant
710 builtins_new = dict(__IPYTHON__ = self,
705 builtins_new = dict(__IPYTHON__ = self,
711 ip_set_hook = self.set_hook,
706 ip_set_hook = self.set_hook,
712 jobs = self.jobs,
707 jobs = self.jobs,
713 ipmagic = self.ipmagic,
708 ipmagic = self.ipmagic,
714 ipalias = self.ipalias,
709 ipalias = self.ipalias,
715 ipsystem = self.ipsystem,
710 ipsystem = self.ipsystem,
716 _ip = self.api
711 _ip = self.api
717 )
712 )
718 for biname,bival in builtins_new.items():
713 for biname,bival in builtins_new.items():
719 try:
714 try:
720 # store the orignal value so we can restore it
715 # store the orignal value so we can restore it
721 self.builtins_added[biname] = __builtin__.__dict__[biname]
716 self.builtins_added[biname] = __builtin__.__dict__[biname]
722 except KeyError:
717 except KeyError:
723 # or mark that it wasn't defined, and we'll just delete it at
718 # or mark that it wasn't defined, and we'll just delete it at
724 # cleanup
719 # cleanup
725 self.builtins_added[biname] = Undefined
720 self.builtins_added[biname] = Undefined
726 __builtin__.__dict__[biname] = bival
721 __builtin__.__dict__[biname] = bival
727
722
728 # Keep in the builtins a flag for when IPython is active. We set it
723 # Keep in the builtins a flag for when IPython is active. We set it
729 # with setdefault so that multiple nested IPythons don't clobber one
724 # with setdefault so that multiple nested IPythons don't clobber one
730 # another. Each will increase its value by one upon being activated,
725 # another. Each will increase its value by one upon being activated,
731 # which also gives us a way to determine the nesting level.
726 # which also gives us a way to determine the nesting level.
732 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
727 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
733
728
734 def clean_builtins(self):
729 def clean_builtins(self):
735 """Remove any builtins which might have been added by add_builtins, or
730 """Remove any builtins which might have been added by add_builtins, or
736 restore overwritten ones to their previous values."""
731 restore overwritten ones to their previous values."""
737 for biname,bival in self.builtins_added.items():
732 for biname,bival in self.builtins_added.items():
738 if bival is Undefined:
733 if bival is Undefined:
739 del __builtin__.__dict__[biname]
734 del __builtin__.__dict__[biname]
740 else:
735 else:
741 __builtin__.__dict__[biname] = bival
736 __builtin__.__dict__[biname] = bival
742 self.builtins_added.clear()
737 self.builtins_added.clear()
743
738
744 def set_hook(self,name,hook, priority = 50):
739 def set_hook(self,name,hook, priority = 50):
745 """set_hook(name,hook) -> sets an internal IPython hook.
740 """set_hook(name,hook) -> sets an internal IPython hook.
746
741
747 IPython exposes some of its internal API as user-modifiable hooks. By
742 IPython exposes some of its internal API as user-modifiable hooks. By
748 adding your function to one of these hooks, you can modify IPython's
743 adding your function to one of these hooks, you can modify IPython's
749 behavior to call at runtime your own routines."""
744 behavior to call at runtime your own routines."""
750
745
751 # At some point in the future, this should validate the hook before it
746 # At some point in the future, this should validate the hook before it
752 # accepts it. Probably at least check that the hook takes the number
747 # accepts it. Probably at least check that the hook takes the number
753 # of args it's supposed to.
748 # of args it's supposed to.
754 dp = getattr(self.hooks, name, None)
749 dp = getattr(self.hooks, name, None)
755 if name not in IPython.hooks.__all__:
750 if name not in IPython.hooks.__all__:
756 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
751 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
757 if not dp:
752 if not dp:
758 dp = IPython.hooks.CommandChainDispatcher()
753 dp = IPython.hooks.CommandChainDispatcher()
759
754
760 f = new.instancemethod(hook,self,self.__class__)
755 f = new.instancemethod(hook,self,self.__class__)
761 try:
756 try:
762 dp.add(f,priority)
757 dp.add(f,priority)
763 except AttributeError:
758 except AttributeError:
764 # it was not commandchain, plain old func - replace
759 # it was not commandchain, plain old func - replace
765 dp = f
760 dp = f
766
761
767 setattr(self.hooks,name, dp)
762 setattr(self.hooks,name, dp)
768
763
769
764
770 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
765 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
771
766
767 def set_crash_handler(self,crashHandler):
768 """Set the IPython crash handler.
769
770 This must be a callable with a signature suitable for use as
771 sys.excepthook."""
772
773 # Install the given crash handler as the Python exception hook
774 sys.excepthook = crashHandler
775
776 # The instance will store a pointer to this, so that runtime code
777 # (such as magics) can access it. This is because during the
778 # read-eval loop, it gets temporarily overwritten (to deal with GUI
779 # frameworks).
780 self.sys_excepthook = sys.excepthook
781
782
772 def set_custom_exc(self,exc_tuple,handler):
783 def set_custom_exc(self,exc_tuple,handler):
773 """set_custom_exc(exc_tuple,handler)
784 """set_custom_exc(exc_tuple,handler)
774
785
775 Set a custom exception handler, which will be called if any of the
786 Set a custom exception handler, which will be called if any of the
776 exceptions in exc_tuple occur in the mainloop (specifically, in the
787 exceptions in exc_tuple occur in the mainloop (specifically, in the
777 runcode() method.
788 runcode() method.
778
789
779 Inputs:
790 Inputs:
780
791
781 - exc_tuple: a *tuple* of valid exceptions to call the defined
792 - exc_tuple: a *tuple* of valid exceptions to call the defined
782 handler for. It is very important that you use a tuple, and NOT A
793 handler for. It is very important that you use a tuple, and NOT A
783 LIST here, because of the way Python's except statement works. If
794 LIST here, because of the way Python's except statement works. If
784 you only want to trap a single exception, use a singleton tuple:
795 you only want to trap a single exception, use a singleton tuple:
785
796
786 exc_tuple == (MyCustomException,)
797 exc_tuple == (MyCustomException,)
787
798
788 - handler: this must be defined as a function with the following
799 - handler: this must be defined as a function with the following
789 basic interface: def my_handler(self,etype,value,tb).
800 basic interface: def my_handler(self,etype,value,tb).
790
801
791 This will be made into an instance method (via new.instancemethod)
802 This will be made into an instance method (via new.instancemethod)
792 of IPython itself, and it will be called if any of the exceptions
803 of IPython itself, and it will be called if any of the exceptions
793 listed in the exc_tuple are caught. If the handler is None, an
804 listed in the exc_tuple are caught. If the handler is None, an
794 internal basic one is used, which just prints basic info.
805 internal basic one is used, which just prints basic info.
795
806
796 WARNING: by putting in your own exception handler into IPython's main
807 WARNING: by putting in your own exception handler into IPython's main
797 execution loop, you run a very good chance of nasty crashes. This
808 execution loop, you run a very good chance of nasty crashes. This
798 facility should only be used if you really know what you are doing."""
809 facility should only be used if you really know what you are doing."""
799
810
800 assert type(exc_tuple)==type(()) , \
811 assert type(exc_tuple)==type(()) , \
801 "The custom exceptions must be given AS A TUPLE."
812 "The custom exceptions must be given AS A TUPLE."
802
813
803 def dummy_handler(self,etype,value,tb):
814 def dummy_handler(self,etype,value,tb):
804 print '*** Simple custom exception handler ***'
815 print '*** Simple custom exception handler ***'
805 print 'Exception type :',etype
816 print 'Exception type :',etype
806 print 'Exception value:',value
817 print 'Exception value:',value
807 print 'Traceback :',tb
818 print 'Traceback :',tb
808 print 'Source code :','\n'.join(self.buffer)
819 print 'Source code :','\n'.join(self.buffer)
809
820
810 if handler is None: handler = dummy_handler
821 if handler is None: handler = dummy_handler
811
822
812 self.CustomTB = new.instancemethod(handler,self,self.__class__)
823 self.CustomTB = new.instancemethod(handler,self,self.__class__)
813 self.custom_exceptions = exc_tuple
824 self.custom_exceptions = exc_tuple
814
825
815 def set_custom_completer(self,completer,pos=0):
826 def set_custom_completer(self,completer,pos=0):
816 """set_custom_completer(completer,pos=0)
827 """set_custom_completer(completer,pos=0)
817
828
818 Adds a new custom completer function.
829 Adds a new custom completer function.
819
830
820 The position argument (defaults to 0) is the index in the completers
831 The position argument (defaults to 0) is the index in the completers
821 list where you want the completer to be inserted."""
832 list where you want the completer to be inserted."""
822
833
823 newcomp = new.instancemethod(completer,self.Completer,
834 newcomp = new.instancemethod(completer,self.Completer,
824 self.Completer.__class__)
835 self.Completer.__class__)
825 self.Completer.matchers.insert(pos,newcomp)
836 self.Completer.matchers.insert(pos,newcomp)
826
837
827 def _get_call_pdb(self):
838 def _get_call_pdb(self):
828 return self._call_pdb
839 return self._call_pdb
829
840
830 def _set_call_pdb(self,val):
841 def _set_call_pdb(self,val):
831
842
832 if val not in (0,1,False,True):
843 if val not in (0,1,False,True):
833 raise ValueError,'new call_pdb value must be boolean'
844 raise ValueError,'new call_pdb value must be boolean'
834
845
835 # store value in instance
846 # store value in instance
836 self._call_pdb = val
847 self._call_pdb = val
837
848
838 # notify the actual exception handlers
849 # notify the actual exception handlers
839 self.InteractiveTB.call_pdb = val
850 self.InteractiveTB.call_pdb = val
840 if self.isthreaded:
851 if self.isthreaded:
841 try:
852 try:
842 self.sys_excepthook.call_pdb = val
853 self.sys_excepthook.call_pdb = val
843 except:
854 except:
844 warn('Failed to activate pdb for threaded exception handler')
855 warn('Failed to activate pdb for threaded exception handler')
845
856
846 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
857 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
847 'Control auto-activation of pdb at exceptions')
858 'Control auto-activation of pdb at exceptions')
848
859
849
860
850 # These special functions get installed in the builtin namespace, to
861 # These special functions get installed in the builtin namespace, to
851 # provide programmatic (pure python) access to magics, aliases and system
862 # provide programmatic (pure python) access to magics, aliases and system
852 # calls. This is important for logging, user scripting, and more.
863 # calls. This is important for logging, user scripting, and more.
853
864
854 # We are basically exposing, via normal python functions, the three
865 # We are basically exposing, via normal python functions, the three
855 # mechanisms in which ipython offers special call modes (magics for
866 # mechanisms in which ipython offers special call modes (magics for
856 # internal control, aliases for direct system access via pre-selected
867 # internal control, aliases for direct system access via pre-selected
857 # names, and !cmd for calling arbitrary system commands).
868 # names, and !cmd for calling arbitrary system commands).
858
869
859 def ipmagic(self,arg_s):
870 def ipmagic(self,arg_s):
860 """Call a magic function by name.
871 """Call a magic function by name.
861
872
862 Input: a string containing the name of the magic function to call and any
873 Input: a string containing the name of the magic function to call and any
863 additional arguments to be passed to the magic.
874 additional arguments to be passed to the magic.
864
875
865 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
876 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
866 prompt:
877 prompt:
867
878
868 In[1]: %name -opt foo bar
879 In[1]: %name -opt foo bar
869
880
870 To call a magic without arguments, simply use ipmagic('name').
881 To call a magic without arguments, simply use ipmagic('name').
871
882
872 This provides a proper Python function to call IPython's magics in any
883 This provides a proper Python function to call IPython's magics in any
873 valid Python code you can type at the interpreter, including loops and
884 valid Python code you can type at the interpreter, including loops and
874 compound statements. It is added by IPython to the Python builtin
885 compound statements. It is added by IPython to the Python builtin
875 namespace upon initialization."""
886 namespace upon initialization."""
876
887
877 args = arg_s.split(' ',1)
888 args = arg_s.split(' ',1)
878 magic_name = args[0]
889 magic_name = args[0]
879 magic_name = magic_name.lstrip(self.ESC_MAGIC)
890 magic_name = magic_name.lstrip(self.ESC_MAGIC)
880
891
881 try:
892 try:
882 magic_args = args[1]
893 magic_args = args[1]
883 except IndexError:
894 except IndexError:
884 magic_args = ''
895 magic_args = ''
885 fn = getattr(self,'magic_'+magic_name,None)
896 fn = getattr(self,'magic_'+magic_name,None)
886 if fn is None:
897 if fn is None:
887 error("Magic function `%s` not found." % magic_name)
898 error("Magic function `%s` not found." % magic_name)
888 else:
899 else:
889 magic_args = self.var_expand(magic_args)
900 magic_args = self.var_expand(magic_args)
890 return fn(magic_args)
901 return fn(magic_args)
891
902
892 def ipalias(self,arg_s):
903 def ipalias(self,arg_s):
893 """Call an alias by name.
904 """Call an alias by name.
894
905
895 Input: a string containing the name of the alias to call and any
906 Input: a string containing the name of the alias to call and any
896 additional arguments to be passed to the magic.
907 additional arguments to be passed to the magic.
897
908
898 ipalias('name -opt foo bar') is equivalent to typing at the ipython
909 ipalias('name -opt foo bar') is equivalent to typing at the ipython
899 prompt:
910 prompt:
900
911
901 In[1]: name -opt foo bar
912 In[1]: name -opt foo bar
902
913
903 To call an alias without arguments, simply use ipalias('name').
914 To call an alias without arguments, simply use ipalias('name').
904
915
905 This provides a proper Python function to call IPython's aliases in any
916 This provides a proper Python function to call IPython's aliases in any
906 valid Python code you can type at the interpreter, including loops and
917 valid Python code you can type at the interpreter, including loops and
907 compound statements. It is added by IPython to the Python builtin
918 compound statements. It is added by IPython to the Python builtin
908 namespace upon initialization."""
919 namespace upon initialization."""
909
920
910 args = arg_s.split(' ',1)
921 args = arg_s.split(' ',1)
911 alias_name = args[0]
922 alias_name = args[0]
912 try:
923 try:
913 alias_args = args[1]
924 alias_args = args[1]
914 except IndexError:
925 except IndexError:
915 alias_args = ''
926 alias_args = ''
916 if alias_name in self.alias_table:
927 if alias_name in self.alias_table:
917 self.call_alias(alias_name,alias_args)
928 self.call_alias(alias_name,alias_args)
918 else:
929 else:
919 error("Alias `%s` not found." % alias_name)
930 error("Alias `%s` not found." % alias_name)
920
931
921 def ipsystem(self,arg_s):
932 def ipsystem(self,arg_s):
922 """Make a system call, using IPython."""
933 """Make a system call, using IPython."""
923
934
924 self.system(arg_s)
935 self.system(arg_s)
925
936
926 def complete(self,text):
937 def complete(self,text):
927 """Return a sorted list of all possible completions on text.
938 """Return a sorted list of all possible completions on text.
928
939
929 Inputs:
940 Inputs:
930
941
931 - text: a string of text to be completed on.
942 - text: a string of text to be completed on.
932
943
933 This is a wrapper around the completion mechanism, similar to what
944 This is a wrapper around the completion mechanism, similar to what
934 readline does at the command line when the TAB key is hit. By
945 readline does at the command line when the TAB key is hit. By
935 exposing it as a method, it can be used by other non-readline
946 exposing it as a method, it can be used by other non-readline
936 environments (such as GUIs) for text completion.
947 environments (such as GUIs) for text completion.
937
948
938 Simple usage example:
949 Simple usage example:
939
950
940 In [1]: x = 'hello'
951 In [1]: x = 'hello'
941
952
942 In [2]: __IP.complete('x.l')
953 In [2]: __IP.complete('x.l')
943 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
954 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
944
955
945 complete = self.Completer.complete
956 complete = self.Completer.complete
946 state = 0
957 state = 0
947 # use a dict so we get unique keys, since ipyhton's multiple
958 # use a dict so we get unique keys, since ipyhton's multiple
948 # completers can return duplicates.
959 # completers can return duplicates.
949 comps = {}
960 comps = {}
950 while True:
961 while True:
951 newcomp = complete(text,state)
962 newcomp = complete(text,state)
952 if newcomp is None:
963 if newcomp is None:
953 break
964 break
954 comps[newcomp] = 1
965 comps[newcomp] = 1
955 state += 1
966 state += 1
956 outcomps = comps.keys()
967 outcomps = comps.keys()
957 outcomps.sort()
968 outcomps.sort()
958 return outcomps
969 return outcomps
959
970
960 def set_completer_frame(self, frame=None):
971 def set_completer_frame(self, frame=None):
961 if frame:
972 if frame:
962 self.Completer.namespace = frame.f_locals
973 self.Completer.namespace = frame.f_locals
963 self.Completer.global_namespace = frame.f_globals
974 self.Completer.global_namespace = frame.f_globals
964 else:
975 else:
965 self.Completer.namespace = self.user_ns
976 self.Completer.namespace = self.user_ns
966 self.Completer.global_namespace = self.user_global_ns
977 self.Completer.global_namespace = self.user_global_ns
967
978
968 def init_auto_alias(self):
979 def init_auto_alias(self):
969 """Define some aliases automatically.
980 """Define some aliases automatically.
970
981
971 These are ALL parameter-less aliases"""
982 These are ALL parameter-less aliases"""
972
983
973 for alias,cmd in self.auto_alias:
984 for alias,cmd in self.auto_alias:
974 self.alias_table[alias] = (0,cmd)
985 self.alias_table[alias] = (0,cmd)
975
986
976 def alias_table_validate(self,verbose=0):
987 def alias_table_validate(self,verbose=0):
977 """Update information about the alias table.
988 """Update information about the alias table.
978
989
979 In particular, make sure no Python keywords/builtins are in it."""
990 In particular, make sure no Python keywords/builtins are in it."""
980
991
981 no_alias = self.no_alias
992 no_alias = self.no_alias
982 for k in self.alias_table.keys():
993 for k in self.alias_table.keys():
983 if k in no_alias:
994 if k in no_alias:
984 del self.alias_table[k]
995 del self.alias_table[k]
985 if verbose:
996 if verbose:
986 print ("Deleting alias <%s>, it's a Python "
997 print ("Deleting alias <%s>, it's a Python "
987 "keyword or builtin." % k)
998 "keyword or builtin." % k)
988
999
989 def set_autoindent(self,value=None):
1000 def set_autoindent(self,value=None):
990 """Set the autoindent flag, checking for readline support.
1001 """Set the autoindent flag, checking for readline support.
991
1002
992 If called with no arguments, it acts as a toggle."""
1003 If called with no arguments, it acts as a toggle."""
993
1004
994 if not self.has_readline:
1005 if not self.has_readline:
995 if os.name == 'posix':
1006 if os.name == 'posix':
996 warn("The auto-indent feature requires the readline library")
1007 warn("The auto-indent feature requires the readline library")
997 self.autoindent = 0
1008 self.autoindent = 0
998 return
1009 return
999 if value is None:
1010 if value is None:
1000 self.autoindent = not self.autoindent
1011 self.autoindent = not self.autoindent
1001 else:
1012 else:
1002 self.autoindent = value
1013 self.autoindent = value
1003
1014
1004 def rc_set_toggle(self,rc_field,value=None):
1015 def rc_set_toggle(self,rc_field,value=None):
1005 """Set or toggle a field in IPython's rc config. structure.
1016 """Set or toggle a field in IPython's rc config. structure.
1006
1017
1007 If called with no arguments, it acts as a toggle.
1018 If called with no arguments, it acts as a toggle.
1008
1019
1009 If called with a non-existent field, the resulting AttributeError
1020 If called with a non-existent field, the resulting AttributeError
1010 exception will propagate out."""
1021 exception will propagate out."""
1011
1022
1012 rc_val = getattr(self.rc,rc_field)
1023 rc_val = getattr(self.rc,rc_field)
1013 if value is None:
1024 if value is None:
1014 value = not rc_val
1025 value = not rc_val
1015 setattr(self.rc,rc_field,value)
1026 setattr(self.rc,rc_field,value)
1016
1027
1017 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1028 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1018 """Install the user configuration directory.
1029 """Install the user configuration directory.
1019
1030
1020 Can be called when running for the first time or to upgrade the user's
1031 Can be called when running for the first time or to upgrade the user's
1021 .ipython/ directory with the mode parameter. Valid modes are 'install'
1032 .ipython/ directory with the mode parameter. Valid modes are 'install'
1022 and 'upgrade'."""
1033 and 'upgrade'."""
1023
1034
1024 def wait():
1035 def wait():
1025 try:
1036 try:
1026 raw_input("Please press <RETURN> to start IPython.")
1037 raw_input("Please press <RETURN> to start IPython.")
1027 except EOFError:
1038 except EOFError:
1028 print >> Term.cout
1039 print >> Term.cout
1029 print '*'*70
1040 print '*'*70
1030
1041
1031 cwd = os.getcwd() # remember where we started
1042 cwd = os.getcwd() # remember where we started
1032 glb = glob.glob
1043 glb = glob.glob
1033 print '*'*70
1044 print '*'*70
1034 if mode == 'install':
1045 if mode == 'install':
1035 print \
1046 print \
1036 """Welcome to IPython. I will try to create a personal configuration directory
1047 """Welcome to IPython. I will try to create a personal configuration directory
1037 where you can customize many aspects of IPython's functionality in:\n"""
1048 where you can customize many aspects of IPython's functionality in:\n"""
1038 else:
1049 else:
1039 print 'I am going to upgrade your configuration in:'
1050 print 'I am going to upgrade your configuration in:'
1040
1051
1041 print ipythondir
1052 print ipythondir
1042
1053
1043 rcdirend = os.path.join('IPython','UserConfig')
1054 rcdirend = os.path.join('IPython','UserConfig')
1044 cfg = lambda d: os.path.join(d,rcdirend)
1055 cfg = lambda d: os.path.join(d,rcdirend)
1045 try:
1056 try:
1046 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1057 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1047 except IOError:
1058 except IOError:
1048 warning = """
1059 warning = """
1049 Installation error. IPython's directory was not found.
1060 Installation error. IPython's directory was not found.
1050
1061
1051 Check the following:
1062 Check the following:
1052
1063
1053 The ipython/IPython directory should be in a directory belonging to your
1064 The ipython/IPython directory should be in a directory belonging to your
1054 PYTHONPATH environment variable (that is, it should be in a directory
1065 PYTHONPATH environment variable (that is, it should be in a directory
1055 belonging to sys.path). You can copy it explicitly there or just link to it.
1066 belonging to sys.path). You can copy it explicitly there or just link to it.
1056
1067
1057 IPython will proceed with builtin defaults.
1068 IPython will proceed with builtin defaults.
1058 """
1069 """
1059 warn(warning)
1070 warn(warning)
1060 wait()
1071 wait()
1061 return
1072 return
1062
1073
1063 if mode == 'install':
1074 if mode == 'install':
1064 try:
1075 try:
1065 shutil.copytree(rcdir,ipythondir)
1076 shutil.copytree(rcdir,ipythondir)
1066 os.chdir(ipythondir)
1077 os.chdir(ipythondir)
1067 rc_files = glb("ipythonrc*")
1078 rc_files = glb("ipythonrc*")
1068 for rc_file in rc_files:
1079 for rc_file in rc_files:
1069 os.rename(rc_file,rc_file+rc_suffix)
1080 os.rename(rc_file,rc_file+rc_suffix)
1070 except:
1081 except:
1071 warning = """
1082 warning = """
1072
1083
1073 There was a problem with the installation:
1084 There was a problem with the installation:
1074 %s
1085 %s
1075 Try to correct it or contact the developers if you think it's a bug.
1086 Try to correct it or contact the developers if you think it's a bug.
1076 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1087 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1077 warn(warning)
1088 warn(warning)
1078 wait()
1089 wait()
1079 return
1090 return
1080
1091
1081 elif mode == 'upgrade':
1092 elif mode == 'upgrade':
1082 try:
1093 try:
1083 os.chdir(ipythondir)
1094 os.chdir(ipythondir)
1084 except:
1095 except:
1085 print """
1096 print """
1086 Can not upgrade: changing to directory %s failed. Details:
1097 Can not upgrade: changing to directory %s failed. Details:
1087 %s
1098 %s
1088 """ % (ipythondir,sys.exc_info()[1])
1099 """ % (ipythondir,sys.exc_info()[1])
1089 wait()
1100 wait()
1090 return
1101 return
1091 else:
1102 else:
1092 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1103 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1093 for new_full_path in sources:
1104 for new_full_path in sources:
1094 new_filename = os.path.basename(new_full_path)
1105 new_filename = os.path.basename(new_full_path)
1095 if new_filename.startswith('ipythonrc'):
1106 if new_filename.startswith('ipythonrc'):
1096 new_filename = new_filename + rc_suffix
1107 new_filename = new_filename + rc_suffix
1097 # The config directory should only contain files, skip any
1108 # The config directory should only contain files, skip any
1098 # directories which may be there (like CVS)
1109 # directories which may be there (like CVS)
1099 if os.path.isdir(new_full_path):
1110 if os.path.isdir(new_full_path):
1100 continue
1111 continue
1101 if os.path.exists(new_filename):
1112 if os.path.exists(new_filename):
1102 old_file = new_filename+'.old'
1113 old_file = new_filename+'.old'
1103 if os.path.exists(old_file):
1114 if os.path.exists(old_file):
1104 os.remove(old_file)
1115 os.remove(old_file)
1105 os.rename(new_filename,old_file)
1116 os.rename(new_filename,old_file)
1106 shutil.copy(new_full_path,new_filename)
1117 shutil.copy(new_full_path,new_filename)
1107 else:
1118 else:
1108 raise ValueError,'unrecognized mode for install:',`mode`
1119 raise ValueError,'unrecognized mode for install:',`mode`
1109
1120
1110 # Fix line-endings to those native to each platform in the config
1121 # Fix line-endings to those native to each platform in the config
1111 # directory.
1122 # directory.
1112 try:
1123 try:
1113 os.chdir(ipythondir)
1124 os.chdir(ipythondir)
1114 except:
1125 except:
1115 print """
1126 print """
1116 Problem: changing to directory %s failed.
1127 Problem: changing to directory %s failed.
1117 Details:
1128 Details:
1118 %s
1129 %s
1119
1130
1120 Some configuration files may have incorrect line endings. This should not
1131 Some configuration files may have incorrect line endings. This should not
1121 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1132 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1122 wait()
1133 wait()
1123 else:
1134 else:
1124 for fname in glb('ipythonrc*'):
1135 for fname in glb('ipythonrc*'):
1125 try:
1136 try:
1126 native_line_ends(fname,backup=0)
1137 native_line_ends(fname,backup=0)
1127 except IOError:
1138 except IOError:
1128 pass
1139 pass
1129
1140
1130 if mode == 'install':
1141 if mode == 'install':
1131 print """
1142 print """
1132 Successful installation!
1143 Successful installation!
1133
1144
1134 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1145 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1135 IPython manual (there are both HTML and PDF versions supplied with the
1146 IPython manual (there are both HTML and PDF versions supplied with the
1136 distribution) to make sure that your system environment is properly configured
1147 distribution) to make sure that your system environment is properly configured
1137 to take advantage of IPython's features.
1148 to take advantage of IPython's features.
1138
1149
1139 Important note: the configuration system has changed! The old system is
1150 Important note: the configuration system has changed! The old system is
1140 still in place, but its setting may be partly overridden by the settings in
1151 still in place, but its setting may be partly overridden by the settings in
1141 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1152 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1142 if some of the new settings bother you.
1153 if some of the new settings bother you.
1143
1154
1144 """
1155 """
1145 else:
1156 else:
1146 print """
1157 print """
1147 Successful upgrade!
1158 Successful upgrade!
1148
1159
1149 All files in your directory:
1160 All files in your directory:
1150 %(ipythondir)s
1161 %(ipythondir)s
1151 which would have been overwritten by the upgrade were backed up with a .old
1162 which would have been overwritten by the upgrade were backed up with a .old
1152 extension. If you had made particular customizations in those files you may
1163 extension. If you had made particular customizations in those files you may
1153 want to merge them back into the new files.""" % locals()
1164 want to merge them back into the new files.""" % locals()
1154 wait()
1165 wait()
1155 os.chdir(cwd)
1166 os.chdir(cwd)
1156 # end user_setup()
1167 # end user_setup()
1157
1168
1158 def atexit_operations(self):
1169 def atexit_operations(self):
1159 """This will be executed at the time of exit.
1170 """This will be executed at the time of exit.
1160
1171
1161 Saving of persistent data should be performed here. """
1172 Saving of persistent data should be performed here. """
1162
1173
1163 #print '*** IPython exit cleanup ***' # dbg
1174 #print '*** IPython exit cleanup ***' # dbg
1164 # input history
1175 # input history
1165 self.savehist()
1176 self.savehist()
1166
1177
1167 # Cleanup all tempfiles left around
1178 # Cleanup all tempfiles left around
1168 for tfile in self.tempfiles:
1179 for tfile in self.tempfiles:
1169 try:
1180 try:
1170 os.unlink(tfile)
1181 os.unlink(tfile)
1171 except OSError:
1182 except OSError:
1172 pass
1183 pass
1173
1184
1174 # save the "persistent data" catch-all dictionary
1185 # save the "persistent data" catch-all dictionary
1175 self.hooks.shutdown_hook()
1186 self.hooks.shutdown_hook()
1176
1187
1177 def savehist(self):
1188 def savehist(self):
1178 """Save input history to a file (via readline library)."""
1189 """Save input history to a file (via readline library)."""
1179 try:
1190 try:
1180 self.readline.write_history_file(self.histfile)
1191 self.readline.write_history_file(self.histfile)
1181 except:
1192 except:
1182 print 'Unable to save IPython command history to file: ' + \
1193 print 'Unable to save IPython command history to file: ' + \
1183 `self.histfile`
1194 `self.histfile`
1184
1195
1185 def pre_readline(self):
1196 def pre_readline(self):
1186 """readline hook to be used at the start of each line.
1197 """readline hook to be used at the start of each line.
1187
1198
1188 Currently it handles auto-indent only."""
1199 Currently it handles auto-indent only."""
1189
1200
1190 #debugx('self.indent_current_nsp','pre_readline:')
1201 #debugx('self.indent_current_nsp','pre_readline:')
1191 self.readline.insert_text(self.indent_current_str())
1202 self.readline.insert_text(self.indent_current_str())
1192
1203
1193 def init_readline(self):
1204 def init_readline(self):
1194 """Command history completion/saving/reloading."""
1205 """Command history completion/saving/reloading."""
1195
1206
1196 import IPython.rlineimpl as readline
1207 import IPython.rlineimpl as readline
1197 if not readline.have_readline:
1208 if not readline.have_readline:
1198 self.has_readline = 0
1209 self.has_readline = 0
1199 self.readline = None
1210 self.readline = None
1200 # no point in bugging windows users with this every time:
1211 # no point in bugging windows users with this every time:
1201 warn('Readline services not available on this platform.')
1212 warn('Readline services not available on this platform.')
1202 else:
1213 else:
1203 sys.modules['readline'] = readline
1214 sys.modules['readline'] = readline
1204 import atexit
1215 import atexit
1205 from IPython.completer import IPCompleter
1216 from IPython.completer import IPCompleter
1206 self.Completer = IPCompleter(self,
1217 self.Completer = IPCompleter(self,
1207 self.user_ns,
1218 self.user_ns,
1208 self.user_global_ns,
1219 self.user_global_ns,
1209 self.rc.readline_omit__names,
1220 self.rc.readline_omit__names,
1210 self.alias_table)
1221 self.alias_table)
1211
1222
1212 # Platform-specific configuration
1223 # Platform-specific configuration
1213 if os.name == 'nt':
1224 if os.name == 'nt':
1214 self.readline_startup_hook = readline.set_pre_input_hook
1225 self.readline_startup_hook = readline.set_pre_input_hook
1215 else:
1226 else:
1216 self.readline_startup_hook = readline.set_startup_hook
1227 self.readline_startup_hook = readline.set_startup_hook
1217
1228
1218 # Load user's initrc file (readline config)
1229 # Load user's initrc file (readline config)
1219 inputrc_name = os.environ.get('INPUTRC')
1230 inputrc_name = os.environ.get('INPUTRC')
1220 if inputrc_name is None:
1231 if inputrc_name is None:
1221 home_dir = get_home_dir()
1232 home_dir = get_home_dir()
1222 if home_dir is not None:
1233 if home_dir is not None:
1223 inputrc_name = os.path.join(home_dir,'.inputrc')
1234 inputrc_name = os.path.join(home_dir,'.inputrc')
1224 if os.path.isfile(inputrc_name):
1235 if os.path.isfile(inputrc_name):
1225 try:
1236 try:
1226 readline.read_init_file(inputrc_name)
1237 readline.read_init_file(inputrc_name)
1227 except:
1238 except:
1228 warn('Problems reading readline initialization file <%s>'
1239 warn('Problems reading readline initialization file <%s>'
1229 % inputrc_name)
1240 % inputrc_name)
1230
1241
1231 self.has_readline = 1
1242 self.has_readline = 1
1232 self.readline = readline
1243 self.readline = readline
1233 # save this in sys so embedded copies can restore it properly
1244 # save this in sys so embedded copies can restore it properly
1234 sys.ipcompleter = self.Completer.complete
1245 sys.ipcompleter = self.Completer.complete
1235 readline.set_completer(self.Completer.complete)
1246 readline.set_completer(self.Completer.complete)
1236
1247
1237 # Configure readline according to user's prefs
1248 # Configure readline according to user's prefs
1238 for rlcommand in self.rc.readline_parse_and_bind:
1249 for rlcommand in self.rc.readline_parse_and_bind:
1239 readline.parse_and_bind(rlcommand)
1250 readline.parse_and_bind(rlcommand)
1240
1251
1241 # remove some chars from the delimiters list
1252 # remove some chars from the delimiters list
1242 delims = readline.get_completer_delims()
1253 delims = readline.get_completer_delims()
1243 delims = delims.translate(string._idmap,
1254 delims = delims.translate(string._idmap,
1244 self.rc.readline_remove_delims)
1255 self.rc.readline_remove_delims)
1245 readline.set_completer_delims(delims)
1256 readline.set_completer_delims(delims)
1246 # otherwise we end up with a monster history after a while:
1257 # otherwise we end up with a monster history after a while:
1247 readline.set_history_length(1000)
1258 readline.set_history_length(1000)
1248 try:
1259 try:
1249 #print '*** Reading readline history' # dbg
1260 #print '*** Reading readline history' # dbg
1250 readline.read_history_file(self.histfile)
1261 readline.read_history_file(self.histfile)
1251 except IOError:
1262 except IOError:
1252 pass # It doesn't exist yet.
1263 pass # It doesn't exist yet.
1253
1264
1254 atexit.register(self.atexit_operations)
1265 atexit.register(self.atexit_operations)
1255 del atexit
1266 del atexit
1256
1267
1257 # Configure auto-indent for all platforms
1268 # Configure auto-indent for all platforms
1258 self.set_autoindent(self.rc.autoindent)
1269 self.set_autoindent(self.rc.autoindent)
1259
1270
1260 def ask_yes_no(self,prompt,default=True):
1271 def ask_yes_no(self,prompt,default=True):
1261 if self.rc.quiet:
1272 if self.rc.quiet:
1262 return True
1273 return True
1263 return ask_yes_no(prompt,default)
1274 return ask_yes_no(prompt,default)
1264
1275
1265 def _should_recompile(self,e):
1276 def _should_recompile(self,e):
1266 """Utility routine for edit_syntax_error"""
1277 """Utility routine for edit_syntax_error"""
1267
1278
1268 if e.filename in ('<ipython console>','<input>','<string>',
1279 if e.filename in ('<ipython console>','<input>','<string>',
1269 '<console>','<BackgroundJob compilation>',
1280 '<console>','<BackgroundJob compilation>',
1270 None):
1281 None):
1271
1282
1272 return False
1283 return False
1273 try:
1284 try:
1274 if (self.rc.autoedit_syntax and
1285 if (self.rc.autoedit_syntax and
1275 not self.ask_yes_no('Return to editor to correct syntax error? '
1286 not self.ask_yes_no('Return to editor to correct syntax error? '
1276 '[Y/n] ','y')):
1287 '[Y/n] ','y')):
1277 return False
1288 return False
1278 except EOFError:
1289 except EOFError:
1279 return False
1290 return False
1280
1291
1281 def int0(x):
1292 def int0(x):
1282 try:
1293 try:
1283 return int(x)
1294 return int(x)
1284 except TypeError:
1295 except TypeError:
1285 return 0
1296 return 0
1286 # always pass integer line and offset values to editor hook
1297 # always pass integer line and offset values to editor hook
1287 self.hooks.fix_error_editor(e.filename,
1298 self.hooks.fix_error_editor(e.filename,
1288 int0(e.lineno),int0(e.offset),e.msg)
1299 int0(e.lineno),int0(e.offset),e.msg)
1289 return True
1300 return True
1290
1301
1291 def edit_syntax_error(self):
1302 def edit_syntax_error(self):
1292 """The bottom half of the syntax error handler called in the main loop.
1303 """The bottom half of the syntax error handler called in the main loop.
1293
1304
1294 Loop until syntax error is fixed or user cancels.
1305 Loop until syntax error is fixed or user cancels.
1295 """
1306 """
1296
1307
1297 while self.SyntaxTB.last_syntax_error:
1308 while self.SyntaxTB.last_syntax_error:
1298 # copy and clear last_syntax_error
1309 # copy and clear last_syntax_error
1299 err = self.SyntaxTB.clear_err_state()
1310 err = self.SyntaxTB.clear_err_state()
1300 if not self._should_recompile(err):
1311 if not self._should_recompile(err):
1301 return
1312 return
1302 try:
1313 try:
1303 # may set last_syntax_error again if a SyntaxError is raised
1314 # may set last_syntax_error again if a SyntaxError is raised
1304 self.safe_execfile(err.filename,self.user_ns)
1315 self.safe_execfile(err.filename,self.user_ns)
1305 except:
1316 except:
1306 self.showtraceback()
1317 self.showtraceback()
1307 else:
1318 else:
1308 try:
1319 try:
1309 f = file(err.filename)
1320 f = file(err.filename)
1310 try:
1321 try:
1311 sys.displayhook(f.read())
1322 sys.displayhook(f.read())
1312 finally:
1323 finally:
1313 f.close()
1324 f.close()
1314 except:
1325 except:
1315 self.showtraceback()
1326 self.showtraceback()
1316
1327
1317 def showsyntaxerror(self, filename=None):
1328 def showsyntaxerror(self, filename=None):
1318 """Display the syntax error that just occurred.
1329 """Display the syntax error that just occurred.
1319
1330
1320 This doesn't display a stack trace because there isn't one.
1331 This doesn't display a stack trace because there isn't one.
1321
1332
1322 If a filename is given, it is stuffed in the exception instead
1333 If a filename is given, it is stuffed in the exception instead
1323 of what was there before (because Python's parser always uses
1334 of what was there before (because Python's parser always uses
1324 "<string>" when reading from a string).
1335 "<string>" when reading from a string).
1325 """
1336 """
1326 etype, value, last_traceback = sys.exc_info()
1337 etype, value, last_traceback = sys.exc_info()
1327
1338
1328 # See note about these variables in showtraceback() below
1339 # See note about these variables in showtraceback() below
1329 sys.last_type = etype
1340 sys.last_type = etype
1330 sys.last_value = value
1341 sys.last_value = value
1331 sys.last_traceback = last_traceback
1342 sys.last_traceback = last_traceback
1332
1343
1333 if filename and etype is SyntaxError:
1344 if filename and etype is SyntaxError:
1334 # Work hard to stuff the correct filename in the exception
1345 # Work hard to stuff the correct filename in the exception
1335 try:
1346 try:
1336 msg, (dummy_filename, lineno, offset, line) = value
1347 msg, (dummy_filename, lineno, offset, line) = value
1337 except:
1348 except:
1338 # Not the format we expect; leave it alone
1349 # Not the format we expect; leave it alone
1339 pass
1350 pass
1340 else:
1351 else:
1341 # Stuff in the right filename
1352 # Stuff in the right filename
1342 try:
1353 try:
1343 # Assume SyntaxError is a class exception
1354 # Assume SyntaxError is a class exception
1344 value = SyntaxError(msg, (filename, lineno, offset, line))
1355 value = SyntaxError(msg, (filename, lineno, offset, line))
1345 except:
1356 except:
1346 # If that failed, assume SyntaxError is a string
1357 # If that failed, assume SyntaxError is a string
1347 value = msg, (filename, lineno, offset, line)
1358 value = msg, (filename, lineno, offset, line)
1348 self.SyntaxTB(etype,value,[])
1359 self.SyntaxTB(etype,value,[])
1349
1360
1350 def debugger(self):
1361 def debugger(self):
1351 """Call the pdb debugger."""
1362 """Call the pdb debugger."""
1352
1363
1353 if not self.rc.pdb:
1364 if not self.rc.pdb:
1354 return
1365 return
1355 pdb.pm()
1366 pdb.pm()
1356
1367
1357 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1368 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1358 """Display the exception that just occurred.
1369 """Display the exception that just occurred.
1359
1370
1360 If nothing is known about the exception, this is the method which
1371 If nothing is known about the exception, this is the method which
1361 should be used throughout the code for presenting user tracebacks,
1372 should be used throughout the code for presenting user tracebacks,
1362 rather than directly invoking the InteractiveTB object.
1373 rather than directly invoking the InteractiveTB object.
1363
1374
1364 A specific showsyntaxerror() also exists, but this method can take
1375 A specific showsyntaxerror() also exists, but this method can take
1365 care of calling it if needed, so unless you are explicitly catching a
1376 care of calling it if needed, so unless you are explicitly catching a
1366 SyntaxError exception, don't try to analyze the stack manually and
1377 SyntaxError exception, don't try to analyze the stack manually and
1367 simply call this method."""
1378 simply call this method."""
1368
1379
1369 # Though this won't be called by syntax errors in the input line,
1380 # Though this won't be called by syntax errors in the input line,
1370 # there may be SyntaxError cases whith imported code.
1381 # there may be SyntaxError cases whith imported code.
1371 if exc_tuple is None:
1382 if exc_tuple is None:
1372 etype, value, tb = sys.exc_info()
1383 etype, value, tb = sys.exc_info()
1373 else:
1384 else:
1374 etype, value, tb = exc_tuple
1385 etype, value, tb = exc_tuple
1375 if etype is SyntaxError:
1386 if etype is SyntaxError:
1376 self.showsyntaxerror(filename)
1387 self.showsyntaxerror(filename)
1377 else:
1388 else:
1378 # WARNING: these variables are somewhat deprecated and not
1389 # WARNING: these variables are somewhat deprecated and not
1379 # necessarily safe to use in a threaded environment, but tools
1390 # necessarily safe to use in a threaded environment, but tools
1380 # like pdb depend on their existence, so let's set them. If we
1391 # like pdb depend on their existence, so let's set them. If we
1381 # find problems in the field, we'll need to revisit their use.
1392 # find problems in the field, we'll need to revisit their use.
1382 sys.last_type = etype
1393 sys.last_type = etype
1383 sys.last_value = value
1394 sys.last_value = value
1384 sys.last_traceback = tb
1395 sys.last_traceback = tb
1385
1396
1386 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1397 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1387 if self.InteractiveTB.call_pdb and self.has_readline:
1398 if self.InteractiveTB.call_pdb and self.has_readline:
1388 # pdb mucks up readline, fix it back
1399 # pdb mucks up readline, fix it back
1389 self.readline.set_completer(self.Completer.complete)
1400 self.readline.set_completer(self.Completer.complete)
1390
1401
1391 def mainloop(self,banner=None):
1402 def mainloop(self,banner=None):
1392 """Creates the local namespace and starts the mainloop.
1403 """Creates the local namespace and starts the mainloop.
1393
1404
1394 If an optional banner argument is given, it will override the
1405 If an optional banner argument is given, it will override the
1395 internally created default banner."""
1406 internally created default banner."""
1396
1407
1397 if self.rc.c: # Emulate Python's -c option
1408 if self.rc.c: # Emulate Python's -c option
1398 self.exec_init_cmd()
1409 self.exec_init_cmd()
1399 if banner is None:
1410 if banner is None:
1400 if not self.rc.banner:
1411 if not self.rc.banner:
1401 banner = ''
1412 banner = ''
1402 # banner is string? Use it directly!
1413 # banner is string? Use it directly!
1403 elif isinstance(self.rc.banner,basestring):
1414 elif isinstance(self.rc.banner,basestring):
1404 banner = self.rc.banner
1415 banner = self.rc.banner
1405 else:
1416 else:
1406 banner = self.BANNER+self.banner2
1417 banner = self.BANNER+self.banner2
1407
1418
1408 self.interact(banner)
1419 self.interact(banner)
1409
1420
1410 def exec_init_cmd(self):
1421 def exec_init_cmd(self):
1411 """Execute a command given at the command line.
1422 """Execute a command given at the command line.
1412
1423
1413 This emulates Python's -c option."""
1424 This emulates Python's -c option."""
1414
1425
1415 #sys.argv = ['-c']
1426 #sys.argv = ['-c']
1416 self.push(self.rc.c)
1427 self.push(self.rc.c)
1417
1428
1418 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1429 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1419 """Embeds IPython into a running python program.
1430 """Embeds IPython into a running python program.
1420
1431
1421 Input:
1432 Input:
1422
1433
1423 - header: An optional header message can be specified.
1434 - header: An optional header message can be specified.
1424
1435
1425 - local_ns, global_ns: working namespaces. If given as None, the
1436 - local_ns, global_ns: working namespaces. If given as None, the
1426 IPython-initialized one is updated with __main__.__dict__, so that
1437 IPython-initialized one is updated with __main__.__dict__, so that
1427 program variables become visible but user-specific configuration
1438 program variables become visible but user-specific configuration
1428 remains possible.
1439 remains possible.
1429
1440
1430 - stack_depth: specifies how many levels in the stack to go to
1441 - stack_depth: specifies how many levels in the stack to go to
1431 looking for namespaces (when local_ns and global_ns are None). This
1442 looking for namespaces (when local_ns and global_ns are None). This
1432 allows an intermediate caller to make sure that this function gets
1443 allows an intermediate caller to make sure that this function gets
1433 the namespace from the intended level in the stack. By default (0)
1444 the namespace from the intended level in the stack. By default (0)
1434 it will get its locals and globals from the immediate caller.
1445 it will get its locals and globals from the immediate caller.
1435
1446
1436 Warning: it's possible to use this in a program which is being run by
1447 Warning: it's possible to use this in a program which is being run by
1437 IPython itself (via %run), but some funny things will happen (a few
1448 IPython itself (via %run), but some funny things will happen (a few
1438 globals get overwritten). In the future this will be cleaned up, as
1449 globals get overwritten). In the future this will be cleaned up, as
1439 there is no fundamental reason why it can't work perfectly."""
1450 there is no fundamental reason why it can't work perfectly."""
1440
1451
1441 # Get locals and globals from caller
1452 # Get locals and globals from caller
1442 if local_ns is None or global_ns is None:
1453 if local_ns is None or global_ns is None:
1443 call_frame = sys._getframe(stack_depth).f_back
1454 call_frame = sys._getframe(stack_depth).f_back
1444
1455
1445 if local_ns is None:
1456 if local_ns is None:
1446 local_ns = call_frame.f_locals
1457 local_ns = call_frame.f_locals
1447 if global_ns is None:
1458 if global_ns is None:
1448 global_ns = call_frame.f_globals
1459 global_ns = call_frame.f_globals
1449
1460
1450 # Update namespaces and fire up interpreter
1461 # Update namespaces and fire up interpreter
1451
1462
1452 # The global one is easy, we can just throw it in
1463 # The global one is easy, we can just throw it in
1453 self.user_global_ns = global_ns
1464 self.user_global_ns = global_ns
1454
1465
1455 # but the user/local one is tricky: ipython needs it to store internal
1466 # but the user/local one is tricky: ipython needs it to store internal
1456 # data, but we also need the locals. We'll copy locals in the user
1467 # data, but we also need the locals. We'll copy locals in the user
1457 # one, but will track what got copied so we can delete them at exit.
1468 # one, but will track what got copied so we can delete them at exit.
1458 # This is so that a later embedded call doesn't see locals from a
1469 # This is so that a later embedded call doesn't see locals from a
1459 # previous call (which most likely existed in a separate scope).
1470 # previous call (which most likely existed in a separate scope).
1460 local_varnames = local_ns.keys()
1471 local_varnames = local_ns.keys()
1461 self.user_ns.update(local_ns)
1472 self.user_ns.update(local_ns)
1462
1473
1463 # Patch for global embedding to make sure that things don't overwrite
1474 # Patch for global embedding to make sure that things don't overwrite
1464 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1475 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1465 # FIXME. Test this a bit more carefully (the if.. is new)
1476 # FIXME. Test this a bit more carefully (the if.. is new)
1466 if local_ns is None and global_ns is None:
1477 if local_ns is None and global_ns is None:
1467 self.user_global_ns.update(__main__.__dict__)
1478 self.user_global_ns.update(__main__.__dict__)
1468
1479
1469 # make sure the tab-completer has the correct frame information, so it
1480 # make sure the tab-completer has the correct frame information, so it
1470 # actually completes using the frame's locals/globals
1481 # actually completes using the frame's locals/globals
1471 self.set_completer_frame()
1482 self.set_completer_frame()
1472
1483
1473 # before activating the interactive mode, we need to make sure that
1484 # before activating the interactive mode, we need to make sure that
1474 # all names in the builtin namespace needed by ipython point to
1485 # all names in the builtin namespace needed by ipython point to
1475 # ourselves, and not to other instances.
1486 # ourselves, and not to other instances.
1476 self.add_builtins()
1487 self.add_builtins()
1477
1488
1478 self.interact(header)
1489 self.interact(header)
1479
1490
1480 # now, purge out the user namespace from anything we might have added
1491 # now, purge out the user namespace from anything we might have added
1481 # from the caller's local namespace
1492 # from the caller's local namespace
1482 delvar = self.user_ns.pop
1493 delvar = self.user_ns.pop
1483 for var in local_varnames:
1494 for var in local_varnames:
1484 delvar(var,None)
1495 delvar(var,None)
1485 # and clean builtins we may have overridden
1496 # and clean builtins we may have overridden
1486 self.clean_builtins()
1497 self.clean_builtins()
1487
1498
1488 def interact(self, banner=None):
1499 def interact(self, banner=None):
1489 """Closely emulate the interactive Python console.
1500 """Closely emulate the interactive Python console.
1490
1501
1491 The optional banner argument specify the banner to print
1502 The optional banner argument specify the banner to print
1492 before the first interaction; by default it prints a banner
1503 before the first interaction; by default it prints a banner
1493 similar to the one printed by the real Python interpreter,
1504 similar to the one printed by the real Python interpreter,
1494 followed by the current class name in parentheses (so as not
1505 followed by the current class name in parentheses (so as not
1495 to confuse this with the real interpreter -- since it's so
1506 to confuse this with the real interpreter -- since it's so
1496 close!).
1507 close!).
1497
1508
1498 """
1509 """
1499
1510
1500 if self.exit_now:
1511 if self.exit_now:
1501 # batch run -> do not interact
1512 # batch run -> do not interact
1502 return
1513 return
1503 cprt = 'Type "copyright", "credits" or "license" for more information.'
1514 cprt = 'Type "copyright", "credits" or "license" for more information.'
1504 if banner is None:
1515 if banner is None:
1505 self.write("Python %s on %s\n%s\n(%s)\n" %
1516 self.write("Python %s on %s\n%s\n(%s)\n" %
1506 (sys.version, sys.platform, cprt,
1517 (sys.version, sys.platform, cprt,
1507 self.__class__.__name__))
1518 self.__class__.__name__))
1508 else:
1519 else:
1509 self.write(banner)
1520 self.write(banner)
1510
1521
1511 more = 0
1522 more = 0
1512
1523
1513 # Mark activity in the builtins
1524 # Mark activity in the builtins
1514 __builtin__.__dict__['__IPYTHON__active'] += 1
1525 __builtin__.__dict__['__IPYTHON__active'] += 1
1515
1526
1516 # exit_now is set by a call to %Exit or %Quit
1527 # exit_now is set by a call to %Exit or %Quit
1517 while not self.exit_now:
1528 while not self.exit_now:
1518 if more:
1529 if more:
1519 prompt = self.hooks.generate_prompt(True)
1530 prompt = self.hooks.generate_prompt(True)
1520 if self.autoindent:
1531 if self.autoindent:
1521 self.readline_startup_hook(self.pre_readline)
1532 self.readline_startup_hook(self.pre_readline)
1522 else:
1533 else:
1523 prompt = self.hooks.generate_prompt(False)
1534 prompt = self.hooks.generate_prompt(False)
1524 try:
1535 try:
1525 line = self.raw_input(prompt,more)
1536 line = self.raw_input(prompt,more)
1526 if self.exit_now:
1537 if self.exit_now:
1527 # quick exit on sys.std[in|out] close
1538 # quick exit on sys.std[in|out] close
1528 break
1539 break
1529 if self.autoindent:
1540 if self.autoindent:
1530 self.readline_startup_hook(None)
1541 self.readline_startup_hook(None)
1531 except KeyboardInterrupt:
1542 except KeyboardInterrupt:
1532 self.write('\nKeyboardInterrupt\n')
1543 self.write('\nKeyboardInterrupt\n')
1533 self.resetbuffer()
1544 self.resetbuffer()
1534 # keep cache in sync with the prompt counter:
1545 # keep cache in sync with the prompt counter:
1535 self.outputcache.prompt_count -= 1
1546 self.outputcache.prompt_count -= 1
1536
1547
1537 if self.autoindent:
1548 if self.autoindent:
1538 self.indent_current_nsp = 0
1549 self.indent_current_nsp = 0
1539 more = 0
1550 more = 0
1540 except EOFError:
1551 except EOFError:
1541 if self.autoindent:
1552 if self.autoindent:
1542 self.readline_startup_hook(None)
1553 self.readline_startup_hook(None)
1543 self.write('\n')
1554 self.write('\n')
1544 self.exit()
1555 self.exit()
1545 except bdb.BdbQuit:
1556 except bdb.BdbQuit:
1546 warn('The Python debugger has exited with a BdbQuit exception.\n'
1557 warn('The Python debugger has exited with a BdbQuit exception.\n'
1547 'Because of how pdb handles the stack, it is impossible\n'
1558 'Because of how pdb handles the stack, it is impossible\n'
1548 'for IPython to properly format this particular exception.\n'
1559 'for IPython to properly format this particular exception.\n'
1549 'IPython will resume normal operation.')
1560 'IPython will resume normal operation.')
1550 except:
1561 except:
1551 # exceptions here are VERY RARE, but they can be triggered
1562 # exceptions here are VERY RARE, but they can be triggered
1552 # asynchronously by signal handlers, for example.
1563 # asynchronously by signal handlers, for example.
1553 self.showtraceback()
1564 self.showtraceback()
1554 else:
1565 else:
1555 more = self.push(line)
1566 more = self.push(line)
1556 if (self.SyntaxTB.last_syntax_error and
1567 if (self.SyntaxTB.last_syntax_error and
1557 self.rc.autoedit_syntax):
1568 self.rc.autoedit_syntax):
1558 self.edit_syntax_error()
1569 self.edit_syntax_error()
1559
1570
1560 # We are off again...
1571 # We are off again...
1561 __builtin__.__dict__['__IPYTHON__active'] -= 1
1572 __builtin__.__dict__['__IPYTHON__active'] -= 1
1562
1573
1563 def excepthook(self, etype, value, tb):
1574 def excepthook(self, etype, value, tb):
1564 """One more defense for GUI apps that call sys.excepthook.
1575 """One more defense for GUI apps that call sys.excepthook.
1565
1576
1566 GUI frameworks like wxPython trap exceptions and call
1577 GUI frameworks like wxPython trap exceptions and call
1567 sys.excepthook themselves. I guess this is a feature that
1578 sys.excepthook themselves. I guess this is a feature that
1568 enables them to keep running after exceptions that would
1579 enables them to keep running after exceptions that would
1569 otherwise kill their mainloop. This is a bother for IPython
1580 otherwise kill their mainloop. This is a bother for IPython
1570 which excepts to catch all of the program exceptions with a try:
1581 which excepts to catch all of the program exceptions with a try:
1571 except: statement.
1582 except: statement.
1572
1583
1573 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1584 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1574 any app directly invokes sys.excepthook, it will look to the user like
1585 any app directly invokes sys.excepthook, it will look to the user like
1575 IPython crashed. In order to work around this, we can disable the
1586 IPython crashed. In order to work around this, we can disable the
1576 CrashHandler and replace it with this excepthook instead, which prints a
1587 CrashHandler and replace it with this excepthook instead, which prints a
1577 regular traceback using our InteractiveTB. In this fashion, apps which
1588 regular traceback using our InteractiveTB. In this fashion, apps which
1578 call sys.excepthook will generate a regular-looking exception from
1589 call sys.excepthook will generate a regular-looking exception from
1579 IPython, and the CrashHandler will only be triggered by real IPython
1590 IPython, and the CrashHandler will only be triggered by real IPython
1580 crashes.
1591 crashes.
1581
1592
1582 This hook should be used sparingly, only in places which are not likely
1593 This hook should be used sparingly, only in places which are not likely
1583 to be true IPython errors.
1594 to be true IPython errors.
1584 """
1595 """
1585 self.showtraceback((etype,value,tb),tb_offset=0)
1596 self.showtraceback((etype,value,tb),tb_offset=0)
1586
1597
1587 def expand_aliases(self,fn,rest):
1598 def expand_aliases(self,fn,rest):
1588 """ Expand multiple levels of aliases:
1599 """ Expand multiple levels of aliases:
1589
1600
1590 if:
1601 if:
1591
1602
1592 alias foo bar /tmp
1603 alias foo bar /tmp
1593 alias baz foo
1604 alias baz foo
1594
1605
1595 then:
1606 then:
1596
1607
1597 baz huhhahhei -> bar /tmp huhhahhei
1608 baz huhhahhei -> bar /tmp huhhahhei
1598
1609
1599 """
1610 """
1600 line = fn + " " + rest
1611 line = fn + " " + rest
1601
1612
1602 done = Set()
1613 done = Set()
1603 while 1:
1614 while 1:
1604 pre,fn,rest = self.split_user_input(line)
1615 pre,fn,rest = self.split_user_input(line)
1605 if fn in self.alias_table:
1616 if fn in self.alias_table:
1606 if fn in done:
1617 if fn in done:
1607 warn("Cyclic alias definition, repeated '%s'" % fn)
1618 warn("Cyclic alias definition, repeated '%s'" % fn)
1608 return ""
1619 return ""
1609 done.add(fn)
1620 done.add(fn)
1610
1621
1611 l2 = self.transform_alias(fn,rest)
1622 l2 = self.transform_alias(fn,rest)
1612 # dir -> dir
1623 # dir -> dir
1613 if l2 == line:
1624 if l2 == line:
1614 break
1625 break
1615 # ls -> ls -F should not recurse forever
1626 # ls -> ls -F should not recurse forever
1616 if l2.split(None,1)[0] == line.split(None,1)[0]:
1627 if l2.split(None,1)[0] == line.split(None,1)[0]:
1617 line = l2
1628 line = l2
1618 break
1629 break
1619
1630
1620 line=l2
1631 line=l2
1621
1632
1622
1633
1623 # print "al expand to",line #dbg
1634 # print "al expand to",line #dbg
1624 else:
1635 else:
1625 break
1636 break
1626
1637
1627 return line
1638 return line
1628
1639
1629 def transform_alias(self, alias,rest=''):
1640 def transform_alias(self, alias,rest=''):
1630 """ Transform alias to system command string.
1641 """ Transform alias to system command string.
1631 """
1642 """
1632 nargs,cmd = self.alias_table[alias]
1643 nargs,cmd = self.alias_table[alias]
1633 if ' ' in cmd and os.path.isfile(cmd):
1644 if ' ' in cmd and os.path.isfile(cmd):
1634 cmd = '"%s"' % cmd
1645 cmd = '"%s"' % cmd
1635
1646
1636 # Expand the %l special to be the user's input line
1647 # Expand the %l special to be the user's input line
1637 if cmd.find('%l') >= 0:
1648 if cmd.find('%l') >= 0:
1638 cmd = cmd.replace('%l',rest)
1649 cmd = cmd.replace('%l',rest)
1639 rest = ''
1650 rest = ''
1640 if nargs==0:
1651 if nargs==0:
1641 # Simple, argument-less aliases
1652 # Simple, argument-less aliases
1642 cmd = '%s %s' % (cmd,rest)
1653 cmd = '%s %s' % (cmd,rest)
1643 else:
1654 else:
1644 # Handle aliases with positional arguments
1655 # Handle aliases with positional arguments
1645 args = rest.split(None,nargs)
1656 args = rest.split(None,nargs)
1646 if len(args)< nargs:
1657 if len(args)< nargs:
1647 error('Alias <%s> requires %s arguments, %s given.' %
1658 error('Alias <%s> requires %s arguments, %s given.' %
1648 (alias,nargs,len(args)))
1659 (alias,nargs,len(args)))
1649 return None
1660 return None
1650 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1661 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1651 # Now call the macro, evaluating in the user's namespace
1662 # Now call the macro, evaluating in the user's namespace
1652 #print 'new command: <%r>' % cmd # dbg
1663 #print 'new command: <%r>' % cmd # dbg
1653 return cmd
1664 return cmd
1654
1665
1655 def call_alias(self,alias,rest=''):
1666 def call_alias(self,alias,rest=''):
1656 """Call an alias given its name and the rest of the line.
1667 """Call an alias given its name and the rest of the line.
1657
1668
1658 This is only used to provide backwards compatibility for users of
1669 This is only used to provide backwards compatibility for users of
1659 ipalias(), use of which is not recommended for anymore."""
1670 ipalias(), use of which is not recommended for anymore."""
1660
1671
1661 # Now call the macro, evaluating in the user's namespace
1672 # Now call the macro, evaluating in the user's namespace
1662 cmd = self.transform_alias(alias, rest)
1673 cmd = self.transform_alias(alias, rest)
1663 try:
1674 try:
1664 self.system(cmd)
1675 self.system(cmd)
1665 except:
1676 except:
1666 self.showtraceback()
1677 self.showtraceback()
1667
1678
1668 def indent_current_str(self):
1679 def indent_current_str(self):
1669 """return the current level of indentation as a string"""
1680 """return the current level of indentation as a string"""
1670 return self.indent_current_nsp * ' '
1681 return self.indent_current_nsp * ' '
1671
1682
1672 def autoindent_update(self,line):
1683 def autoindent_update(self,line):
1673 """Keep track of the indent level."""
1684 """Keep track of the indent level."""
1674
1685
1675 #debugx('line')
1686 #debugx('line')
1676 #debugx('self.indent_current_nsp')
1687 #debugx('self.indent_current_nsp')
1677 if self.autoindent:
1688 if self.autoindent:
1678 if line:
1689 if line:
1679 inisp = num_ini_spaces(line)
1690 inisp = num_ini_spaces(line)
1680 if inisp < self.indent_current_nsp:
1691 if inisp < self.indent_current_nsp:
1681 self.indent_current_nsp = inisp
1692 self.indent_current_nsp = inisp
1682
1693
1683 if line[-1] == ':':
1694 if line[-1] == ':':
1684 self.indent_current_nsp += 4
1695 self.indent_current_nsp += 4
1685 elif dedent_re.match(line):
1696 elif dedent_re.match(line):
1686 self.indent_current_nsp -= 4
1697 self.indent_current_nsp -= 4
1687 else:
1698 else:
1688 self.indent_current_nsp = 0
1699 self.indent_current_nsp = 0
1689
1700
1690 def runlines(self,lines):
1701 def runlines(self,lines):
1691 """Run a string of one or more lines of source.
1702 """Run a string of one or more lines of source.
1692
1703
1693 This method is capable of running a string containing multiple source
1704 This method is capable of running a string containing multiple source
1694 lines, as if they had been entered at the IPython prompt. Since it
1705 lines, as if they had been entered at the IPython prompt. Since it
1695 exposes IPython's processing machinery, the given strings can contain
1706 exposes IPython's processing machinery, the given strings can contain
1696 magic calls (%magic), special shell access (!cmd), etc."""
1707 magic calls (%magic), special shell access (!cmd), etc."""
1697
1708
1698 # We must start with a clean buffer, in case this is run from an
1709 # We must start with a clean buffer, in case this is run from an
1699 # interactive IPython session (via a magic, for example).
1710 # interactive IPython session (via a magic, for example).
1700 self.resetbuffer()
1711 self.resetbuffer()
1701 lines = lines.split('\n')
1712 lines = lines.split('\n')
1702 more = 0
1713 more = 0
1703 for line in lines:
1714 for line in lines:
1704 # skip blank lines so we don't mess up the prompt counter, but do
1715 # skip blank lines so we don't mess up the prompt counter, but do
1705 # NOT skip even a blank line if we are in a code block (more is
1716 # NOT skip even a blank line if we are in a code block (more is
1706 # true)
1717 # true)
1707 if line or more:
1718 if line or more:
1708 more = self.push(self.prefilter(line,more))
1719 more = self.push(self.prefilter(line,more))
1709 # IPython's runsource returns None if there was an error
1720 # IPython's runsource returns None if there was an error
1710 # compiling the code. This allows us to stop processing right
1721 # compiling the code. This allows us to stop processing right
1711 # away, so the user gets the error message at the right place.
1722 # away, so the user gets the error message at the right place.
1712 if more is None:
1723 if more is None:
1713 break
1724 break
1714 # final newline in case the input didn't have it, so that the code
1725 # final newline in case the input didn't have it, so that the code
1715 # actually does get executed
1726 # actually does get executed
1716 if more:
1727 if more:
1717 self.push('\n')
1728 self.push('\n')
1718
1729
1719 def runsource(self, source, filename='<input>', symbol='single'):
1730 def runsource(self, source, filename='<input>', symbol='single'):
1720 """Compile and run some source in the interpreter.
1731 """Compile and run some source in the interpreter.
1721
1732
1722 Arguments are as for compile_command().
1733 Arguments are as for compile_command().
1723
1734
1724 One several things can happen:
1735 One several things can happen:
1725
1736
1726 1) The input is incorrect; compile_command() raised an
1737 1) The input is incorrect; compile_command() raised an
1727 exception (SyntaxError or OverflowError). A syntax traceback
1738 exception (SyntaxError or OverflowError). A syntax traceback
1728 will be printed by calling the showsyntaxerror() method.
1739 will be printed by calling the showsyntaxerror() method.
1729
1740
1730 2) The input is incomplete, and more input is required;
1741 2) The input is incomplete, and more input is required;
1731 compile_command() returned None. Nothing happens.
1742 compile_command() returned None. Nothing happens.
1732
1743
1733 3) The input is complete; compile_command() returned a code
1744 3) The input is complete; compile_command() returned a code
1734 object. The code is executed by calling self.runcode() (which
1745 object. The code is executed by calling self.runcode() (which
1735 also handles run-time exceptions, except for SystemExit).
1746 also handles run-time exceptions, except for SystemExit).
1736
1747
1737 The return value is:
1748 The return value is:
1738
1749
1739 - True in case 2
1750 - True in case 2
1740
1751
1741 - False in the other cases, unless an exception is raised, where
1752 - False in the other cases, unless an exception is raised, where
1742 None is returned instead. This can be used by external callers to
1753 None is returned instead. This can be used by external callers to
1743 know whether to continue feeding input or not.
1754 know whether to continue feeding input or not.
1744
1755
1745 The return value can be used to decide whether to use sys.ps1 or
1756 The return value can be used to decide whether to use sys.ps1 or
1746 sys.ps2 to prompt the next line."""
1757 sys.ps2 to prompt the next line."""
1747
1758
1748 try:
1759 try:
1749 code = self.compile(source,filename,symbol)
1760 code = self.compile(source,filename,symbol)
1750 except (OverflowError, SyntaxError, ValueError):
1761 except (OverflowError, SyntaxError, ValueError):
1751 # Case 1
1762 # Case 1
1752 self.showsyntaxerror(filename)
1763 self.showsyntaxerror(filename)
1753 return None
1764 return None
1754
1765
1755 if code is None:
1766 if code is None:
1756 # Case 2
1767 # Case 2
1757 return True
1768 return True
1758
1769
1759 # Case 3
1770 # Case 3
1760 # We store the code object so that threaded shells and
1771 # We store the code object so that threaded shells and
1761 # custom exception handlers can access all this info if needed.
1772 # custom exception handlers can access all this info if needed.
1762 # The source corresponding to this can be obtained from the
1773 # The source corresponding to this can be obtained from the
1763 # buffer attribute as '\n'.join(self.buffer).
1774 # buffer attribute as '\n'.join(self.buffer).
1764 self.code_to_run = code
1775 self.code_to_run = code
1765 # now actually execute the code object
1776 # now actually execute the code object
1766 if self.runcode(code) == 0:
1777 if self.runcode(code) == 0:
1767 return False
1778 return False
1768 else:
1779 else:
1769 return None
1780 return None
1770
1781
1771 def runcode(self,code_obj):
1782 def runcode(self,code_obj):
1772 """Execute a code object.
1783 """Execute a code object.
1773
1784
1774 When an exception occurs, self.showtraceback() is called to display a
1785 When an exception occurs, self.showtraceback() is called to display a
1775 traceback.
1786 traceback.
1776
1787
1777 Return value: a flag indicating whether the code to be run completed
1788 Return value: a flag indicating whether the code to be run completed
1778 successfully:
1789 successfully:
1779
1790
1780 - 0: successful execution.
1791 - 0: successful execution.
1781 - 1: an error occurred.
1792 - 1: an error occurred.
1782 """
1793 """
1783
1794
1784 # Set our own excepthook in case the user code tries to call it
1795 # Set our own excepthook in case the user code tries to call it
1785 # directly, so that the IPython crash handler doesn't get triggered
1796 # directly, so that the IPython crash handler doesn't get triggered
1786 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1797 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1787
1798
1788 # we save the original sys.excepthook in the instance, in case config
1799 # we save the original sys.excepthook in the instance, in case config
1789 # code (such as magics) needs access to it.
1800 # code (such as magics) needs access to it.
1790 self.sys_excepthook = old_excepthook
1801 self.sys_excepthook = old_excepthook
1791 outflag = 1 # happens in more places, so it's easier as default
1802 outflag = 1 # happens in more places, so it's easier as default
1792 try:
1803 try:
1793 try:
1804 try:
1794 # Embedded instances require separate global/local namespaces
1805 # Embedded instances require separate global/local namespaces
1795 # so they can see both the surrounding (local) namespace and
1806 # so they can see both the surrounding (local) namespace and
1796 # the module-level globals when called inside another function.
1807 # the module-level globals when called inside another function.
1797 if self.embedded:
1808 if self.embedded:
1798 exec code_obj in self.user_global_ns, self.user_ns
1809 exec code_obj in self.user_global_ns, self.user_ns
1799 # Normal (non-embedded) instances should only have a single
1810 # Normal (non-embedded) instances should only have a single
1800 # namespace for user code execution, otherwise functions won't
1811 # namespace for user code execution, otherwise functions won't
1801 # see interactive top-level globals.
1812 # see interactive top-level globals.
1802 else:
1813 else:
1803 exec code_obj in self.user_ns
1814 exec code_obj in self.user_ns
1804 finally:
1815 finally:
1805 # Reset our crash handler in place
1816 # Reset our crash handler in place
1806 sys.excepthook = old_excepthook
1817 sys.excepthook = old_excepthook
1807 except SystemExit:
1818 except SystemExit:
1808 self.resetbuffer()
1819 self.resetbuffer()
1809 self.showtraceback()
1820 self.showtraceback()
1810 warn("Type %exit or %quit to exit IPython "
1821 warn("Type %exit or %quit to exit IPython "
1811 "(%Exit or %Quit do so unconditionally).",level=1)
1822 "(%Exit or %Quit do so unconditionally).",level=1)
1812 except self.custom_exceptions:
1823 except self.custom_exceptions:
1813 etype,value,tb = sys.exc_info()
1824 etype,value,tb = sys.exc_info()
1814 self.CustomTB(etype,value,tb)
1825 self.CustomTB(etype,value,tb)
1815 except:
1826 except:
1816 self.showtraceback()
1827 self.showtraceback()
1817 else:
1828 else:
1818 outflag = 0
1829 outflag = 0
1819 if softspace(sys.stdout, 0):
1830 if softspace(sys.stdout, 0):
1820 print
1831 print
1821 # Flush out code object which has been run (and source)
1832 # Flush out code object which has been run (and source)
1822 self.code_to_run = None
1833 self.code_to_run = None
1823 return outflag
1834 return outflag
1824
1835
1825 def push(self, line):
1836 def push(self, line):
1826 """Push a line to the interpreter.
1837 """Push a line to the interpreter.
1827
1838
1828 The line should not have a trailing newline; it may have
1839 The line should not have a trailing newline; it may have
1829 internal newlines. The line is appended to a buffer and the
1840 internal newlines. The line is appended to a buffer and the
1830 interpreter's runsource() method is called with the
1841 interpreter's runsource() method is called with the
1831 concatenated contents of the buffer as source. If this
1842 concatenated contents of the buffer as source. If this
1832 indicates that the command was executed or invalid, the buffer
1843 indicates that the command was executed or invalid, the buffer
1833 is reset; otherwise, the command is incomplete, and the buffer
1844 is reset; otherwise, the command is incomplete, and the buffer
1834 is left as it was after the line was appended. The return
1845 is left as it was after the line was appended. The return
1835 value is 1 if more input is required, 0 if the line was dealt
1846 value is 1 if more input is required, 0 if the line was dealt
1836 with in some way (this is the same as runsource()).
1847 with in some way (this is the same as runsource()).
1837 """
1848 """
1838
1849
1839 # autoindent management should be done here, and not in the
1850 # autoindent management should be done here, and not in the
1840 # interactive loop, since that one is only seen by keyboard input. We
1851 # interactive loop, since that one is only seen by keyboard input. We
1841 # need this done correctly even for code run via runlines (which uses
1852 # need this done correctly even for code run via runlines (which uses
1842 # push).
1853 # push).
1843
1854
1844 #print 'push line: <%s>' % line # dbg
1855 #print 'push line: <%s>' % line # dbg
1845 for subline in line.splitlines():
1856 for subline in line.splitlines():
1846 self.autoindent_update(subline)
1857 self.autoindent_update(subline)
1847 self.buffer.append(line)
1858 self.buffer.append(line)
1848 more = self.runsource('\n'.join(self.buffer), self.filename)
1859 more = self.runsource('\n'.join(self.buffer), self.filename)
1849 if not more:
1860 if not more:
1850 self.resetbuffer()
1861 self.resetbuffer()
1851 return more
1862 return more
1852
1863
1853 def resetbuffer(self):
1864 def resetbuffer(self):
1854 """Reset the input buffer."""
1865 """Reset the input buffer."""
1855 self.buffer[:] = []
1866 self.buffer[:] = []
1856
1867
1857 def raw_input(self,prompt='',continue_prompt=False):
1868 def raw_input(self,prompt='',continue_prompt=False):
1858 """Write a prompt and read a line.
1869 """Write a prompt and read a line.
1859
1870
1860 The returned line does not include the trailing newline.
1871 The returned line does not include the trailing newline.
1861 When the user enters the EOF key sequence, EOFError is raised.
1872 When the user enters the EOF key sequence, EOFError is raised.
1862
1873
1863 Optional inputs:
1874 Optional inputs:
1864
1875
1865 - prompt(''): a string to be printed to prompt the user.
1876 - prompt(''): a string to be printed to prompt the user.
1866
1877
1867 - continue_prompt(False): whether this line is the first one or a
1878 - continue_prompt(False): whether this line is the first one or a
1868 continuation in a sequence of inputs.
1879 continuation in a sequence of inputs.
1869 """
1880 """
1870
1881
1871 try:
1882 try:
1872 line = raw_input_original(prompt)
1883 line = raw_input_original(prompt)
1873 except ValueError:
1884 except ValueError:
1874 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1885 warn("\n********\nYou or a %run:ed script called sys.stdin.close() or sys.stdout.close()!\nExiting IPython!")
1875 self.exit_now = True
1886 self.exit_now = True
1876 return ""
1887 return ""
1877
1888
1878
1889
1879 # Try to be reasonably smart about not re-indenting pasted input more
1890 # Try to be reasonably smart about not re-indenting pasted input more
1880 # than necessary. We do this by trimming out the auto-indent initial
1891 # than necessary. We do this by trimming out the auto-indent initial
1881 # spaces, if the user's actual input started itself with whitespace.
1892 # spaces, if the user's actual input started itself with whitespace.
1882 #debugx('self.buffer[-1]')
1893 #debugx('self.buffer[-1]')
1883
1894
1884 if self.autoindent:
1895 if self.autoindent:
1885 if num_ini_spaces(line) > self.indent_current_nsp:
1896 if num_ini_spaces(line) > self.indent_current_nsp:
1886 line = line[self.indent_current_nsp:]
1897 line = line[self.indent_current_nsp:]
1887 self.indent_current_nsp = 0
1898 self.indent_current_nsp = 0
1888
1899
1889 # store the unfiltered input before the user has any chance to modify
1900 # store the unfiltered input before the user has any chance to modify
1890 # it.
1901 # it.
1891 if line.strip():
1902 if line.strip():
1892 if continue_prompt:
1903 if continue_prompt:
1893 self.input_hist_raw[-1] += '%s\n' % line
1904 self.input_hist_raw[-1] += '%s\n' % line
1894 if self.has_readline: # and some config option is set?
1905 if self.has_readline: # and some config option is set?
1895 try:
1906 try:
1896 histlen = self.readline.get_current_history_length()
1907 histlen = self.readline.get_current_history_length()
1897 newhist = self.input_hist_raw[-1].rstrip()
1908 newhist = self.input_hist_raw[-1].rstrip()
1898 self.readline.remove_history_item(histlen-1)
1909 self.readline.remove_history_item(histlen-1)
1899 self.readline.replace_history_item(histlen-2,newhist)
1910 self.readline.replace_history_item(histlen-2,newhist)
1900 except AttributeError:
1911 except AttributeError:
1901 pass # re{move,place}_history_item are new in 2.4.
1912 pass # re{move,place}_history_item are new in 2.4.
1902 else:
1913 else:
1903 self.input_hist_raw.append('%s\n' % line)
1914 self.input_hist_raw.append('%s\n' % line)
1904
1915
1905 try:
1916 try:
1906 lineout = self.prefilter(line,continue_prompt)
1917 lineout = self.prefilter(line,continue_prompt)
1907 except:
1918 except:
1908 # blanket except, in case a user-defined prefilter crashes, so it
1919 # blanket except, in case a user-defined prefilter crashes, so it
1909 # can't take all of ipython with it.
1920 # can't take all of ipython with it.
1910 self.showtraceback()
1921 self.showtraceback()
1911 return ''
1922 return ''
1912 else:
1923 else:
1913 return lineout
1924 return lineout
1914
1925
1915 def split_user_input(self,line):
1926 def split_user_input(self,line):
1916 """Split user input into pre-char, function part and rest."""
1927 """Split user input into pre-char, function part and rest."""
1917
1928
1918 lsplit = self.line_split.match(line)
1929 lsplit = self.line_split.match(line)
1919 if lsplit is None: # no regexp match returns None
1930 if lsplit is None: # no regexp match returns None
1920 try:
1931 try:
1921 iFun,theRest = line.split(None,1)
1932 iFun,theRest = line.split(None,1)
1922 except ValueError:
1933 except ValueError:
1923 iFun,theRest = line,''
1934 iFun,theRest = line,''
1924 pre = re.match('^(\s*)(.*)',line).groups()[0]
1935 pre = re.match('^(\s*)(.*)',line).groups()[0]
1925 else:
1936 else:
1926 pre,iFun,theRest = lsplit.groups()
1937 pre,iFun,theRest = lsplit.groups()
1927
1938
1928 #print 'line:<%s>' % line # dbg
1939 #print 'line:<%s>' % line # dbg
1929 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1940 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg
1930 return pre,iFun.strip(),theRest
1941 return pre,iFun.strip(),theRest
1931
1942
1932 def _prefilter(self, line, continue_prompt):
1943 def _prefilter(self, line, continue_prompt):
1933 """Calls different preprocessors, depending on the form of line."""
1944 """Calls different preprocessors, depending on the form of line."""
1934
1945
1935 # All handlers *must* return a value, even if it's blank ('').
1946 # All handlers *must* return a value, even if it's blank ('').
1936
1947
1937 # Lines are NOT logged here. Handlers should process the line as
1948 # Lines are NOT logged here. Handlers should process the line as
1938 # needed, update the cache AND log it (so that the input cache array
1949 # needed, update the cache AND log it (so that the input cache array
1939 # stays synced).
1950 # stays synced).
1940
1951
1941 # This function is _very_ delicate, and since it's also the one which
1952 # This function is _very_ delicate, and since it's also the one which
1942 # determines IPython's response to user input, it must be as efficient
1953 # determines IPython's response to user input, it must be as efficient
1943 # as possible. For this reason it has _many_ returns in it, trying
1954 # as possible. For this reason it has _many_ returns in it, trying
1944 # always to exit as quickly as it can figure out what it needs to do.
1955 # always to exit as quickly as it can figure out what it needs to do.
1945
1956
1946 # This function is the main responsible for maintaining IPython's
1957 # This function is the main responsible for maintaining IPython's
1947 # behavior respectful of Python's semantics. So be _very_ careful if
1958 # behavior respectful of Python's semantics. So be _very_ careful if
1948 # making changes to anything here.
1959 # making changes to anything here.
1949
1960
1950 #.....................................................................
1961 #.....................................................................
1951 # Code begins
1962 # Code begins
1952
1963
1953 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1964 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
1954
1965
1955 # save the line away in case we crash, so the post-mortem handler can
1966 # save the line away in case we crash, so the post-mortem handler can
1956 # record it
1967 # record it
1957 self._last_input_line = line
1968 self._last_input_line = line
1958
1969
1959 #print '***line: <%s>' % line # dbg
1970 #print '***line: <%s>' % line # dbg
1960
1971
1961 # the input history needs to track even empty lines
1972 # the input history needs to track even empty lines
1962 stripped = line.strip()
1973 stripped = line.strip()
1963
1974
1964 if not stripped:
1975 if not stripped:
1965 if not continue_prompt:
1976 if not continue_prompt:
1966 self.outputcache.prompt_count -= 1
1977 self.outputcache.prompt_count -= 1
1967 return self.handle_normal(line,continue_prompt)
1978 return self.handle_normal(line,continue_prompt)
1968 #return self.handle_normal('',continue_prompt)
1979 #return self.handle_normal('',continue_prompt)
1969
1980
1970 # print '***cont',continue_prompt # dbg
1981 # print '***cont',continue_prompt # dbg
1971 # special handlers are only allowed for single line statements
1982 # special handlers are only allowed for single line statements
1972 if continue_prompt and not self.rc.multi_line_specials:
1983 if continue_prompt and not self.rc.multi_line_specials:
1973 return self.handle_normal(line,continue_prompt)
1984 return self.handle_normal(line,continue_prompt)
1974
1985
1975
1986
1976 # For the rest, we need the structure of the input
1987 # For the rest, we need the structure of the input
1977 pre,iFun,theRest = self.split_user_input(line)
1988 pre,iFun,theRest = self.split_user_input(line)
1978
1989
1979 # See whether any pre-existing handler can take care of it
1990 # See whether any pre-existing handler can take care of it
1980
1991
1981 rewritten = self.hooks.input_prefilter(stripped)
1992 rewritten = self.hooks.input_prefilter(stripped)
1982 if rewritten != stripped: # ok, some prefilter did something
1993 if rewritten != stripped: # ok, some prefilter did something
1983 rewritten = pre + rewritten # add indentation
1994 rewritten = pre + rewritten # add indentation
1984 return self.handle_normal(rewritten)
1995 return self.handle_normal(rewritten)
1985
1996
1986 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1997 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
1987
1998
1988 # First check for explicit escapes in the last/first character
1999 # First check for explicit escapes in the last/first character
1989 handler = None
2000 handler = None
1990 if line[-1] == self.ESC_HELP:
2001 if line[-1] == self.ESC_HELP:
1991 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
2002 handler = self.esc_handlers.get(line[-1]) # the ? can be at the end
1992 if handler is None:
2003 if handler is None:
1993 # look at the first character of iFun, NOT of line, so we skip
2004 # look at the first character of iFun, NOT of line, so we skip
1994 # leading whitespace in multiline input
2005 # leading whitespace in multiline input
1995 handler = self.esc_handlers.get(iFun[0:1])
2006 handler = self.esc_handlers.get(iFun[0:1])
1996 if handler is not None:
2007 if handler is not None:
1997 return handler(line,continue_prompt,pre,iFun,theRest)
2008 return handler(line,continue_prompt,pre,iFun,theRest)
1998 # Emacs ipython-mode tags certain input lines
2009 # Emacs ipython-mode tags certain input lines
1999 if line.endswith('# PYTHON-MODE'):
2010 if line.endswith('# PYTHON-MODE'):
2000 return self.handle_emacs(line,continue_prompt)
2011 return self.handle_emacs(line,continue_prompt)
2001
2012
2002 # Next, check if we can automatically execute this thing
2013 # Next, check if we can automatically execute this thing
2003
2014
2004 # Allow ! in multi-line statements if multi_line_specials is on:
2015 # Allow ! in multi-line statements if multi_line_specials is on:
2005 if continue_prompt and self.rc.multi_line_specials and \
2016 if continue_prompt and self.rc.multi_line_specials and \
2006 iFun.startswith(self.ESC_SHELL):
2017 iFun.startswith(self.ESC_SHELL):
2007 return self.handle_shell_escape(line,continue_prompt,
2018 return self.handle_shell_escape(line,continue_prompt,
2008 pre=pre,iFun=iFun,
2019 pre=pre,iFun=iFun,
2009 theRest=theRest)
2020 theRest=theRest)
2010
2021
2011 # Let's try to find if the input line is a magic fn
2022 # Let's try to find if the input line is a magic fn
2012 oinfo = None
2023 oinfo = None
2013 if hasattr(self,'magic_'+iFun):
2024 if hasattr(self,'magic_'+iFun):
2014 # WARNING: _ofind uses getattr(), so it can consume generators and
2025 # WARNING: _ofind uses getattr(), so it can consume generators and
2015 # cause other side effects.
2026 # cause other side effects.
2016 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2027 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2017 if oinfo['ismagic']:
2028 if oinfo['ismagic']:
2018 # Be careful not to call magics when a variable assignment is
2029 # Be careful not to call magics when a variable assignment is
2019 # being made (ls='hi', for example)
2030 # being made (ls='hi', for example)
2020 if self.rc.automagic and \
2031 if self.rc.automagic and \
2021 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2032 (len(theRest)==0 or theRest[0] not in '!=()<>,') and \
2022 (self.rc.multi_line_specials or not continue_prompt):
2033 (self.rc.multi_line_specials or not continue_prompt):
2023 return self.handle_magic(line,continue_prompt,
2034 return self.handle_magic(line,continue_prompt,
2024 pre,iFun,theRest)
2035 pre,iFun,theRest)
2025 else:
2036 else:
2026 return self.handle_normal(line,continue_prompt)
2037 return self.handle_normal(line,continue_prompt)
2027
2038
2028 # If the rest of the line begins with an (in)equality, assginment or
2039 # If the rest of the line begins with an (in)equality, assginment or
2029 # function call, we should not call _ofind but simply execute it.
2040 # function call, we should not call _ofind but simply execute it.
2030 # This avoids spurious geattr() accesses on objects upon assignment.
2041 # This avoids spurious geattr() accesses on objects upon assignment.
2031 #
2042 #
2032 # It also allows users to assign to either alias or magic names true
2043 # It also allows users to assign to either alias or magic names true
2033 # python variables (the magic/alias systems always take second seat to
2044 # python variables (the magic/alias systems always take second seat to
2034 # true python code).
2045 # true python code).
2035 if theRest and theRest[0] in '!=()':
2046 if theRest and theRest[0] in '!=()':
2036 return self.handle_normal(line,continue_prompt)
2047 return self.handle_normal(line,continue_prompt)
2037
2048
2038 if oinfo is None:
2049 if oinfo is None:
2039 # let's try to ensure that _oinfo is ONLY called when autocall is
2050 # let's try to ensure that _oinfo is ONLY called when autocall is
2040 # on. Since it has inevitable potential side effects, at least
2051 # on. Since it has inevitable potential side effects, at least
2041 # having autocall off should be a guarantee to the user that no
2052 # having autocall off should be a guarantee to the user that no
2042 # weird things will happen.
2053 # weird things will happen.
2043
2054
2044 if self.rc.autocall:
2055 if self.rc.autocall:
2045 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2056 oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic
2046 else:
2057 else:
2047 # in this case, all that's left is either an alias or
2058 # in this case, all that's left is either an alias or
2048 # processing the line normally.
2059 # processing the line normally.
2049 if iFun in self.alias_table:
2060 if iFun in self.alias_table:
2050 # if autocall is off, by not running _ofind we won't know
2061 # if autocall is off, by not running _ofind we won't know
2051 # whether the given name may also exist in one of the
2062 # whether the given name may also exist in one of the
2052 # user's namespace. At this point, it's best to do a
2063 # user's namespace. At this point, it's best to do a
2053 # quick check just to be sure that we don't let aliases
2064 # quick check just to be sure that we don't let aliases
2054 # shadow variables.
2065 # shadow variables.
2055 head = iFun.split('.',1)[0]
2066 head = iFun.split('.',1)[0]
2056 if head in self.user_ns or head in self.internal_ns \
2067 if head in self.user_ns or head in self.internal_ns \
2057 or head in __builtin__.__dict__:
2068 or head in __builtin__.__dict__:
2058 return self.handle_normal(line,continue_prompt)
2069 return self.handle_normal(line,continue_prompt)
2059 else:
2070 else:
2060 return self.handle_alias(line,continue_prompt,
2071 return self.handle_alias(line,continue_prompt,
2061 pre,iFun,theRest)
2072 pre,iFun,theRest)
2062
2073
2063 else:
2074 else:
2064 return self.handle_normal(line,continue_prompt)
2075 return self.handle_normal(line,continue_prompt)
2065
2076
2066 if not oinfo['found']:
2077 if not oinfo['found']:
2067 return self.handle_normal(line,continue_prompt)
2078 return self.handle_normal(line,continue_prompt)
2068 else:
2079 else:
2069 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2080 #print 'pre<%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2070 if oinfo['isalias']:
2081 if oinfo['isalias']:
2071 return self.handle_alias(line,continue_prompt,
2082 return self.handle_alias(line,continue_prompt,
2072 pre,iFun,theRest)
2083 pre,iFun,theRest)
2073
2084
2074 if (self.rc.autocall
2085 if (self.rc.autocall
2075 and
2086 and
2076 (
2087 (
2077 #only consider exclusion re if not "," or ";" autoquoting
2088 #only consider exclusion re if not "," or ";" autoquoting
2078 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2089 (pre == self.ESC_QUOTE or pre == self.ESC_QUOTE2
2079 or pre == self.ESC_PAREN) or
2090 or pre == self.ESC_PAREN) or
2080 (not self.re_exclude_auto.match(theRest)))
2091 (not self.re_exclude_auto.match(theRest)))
2081 and
2092 and
2082 self.re_fun_name.match(iFun) and
2093 self.re_fun_name.match(iFun) and
2083 callable(oinfo['obj'])) :
2094 callable(oinfo['obj'])) :
2084 #print 'going auto' # dbg
2095 #print 'going auto' # dbg
2085 return self.handle_auto(line,continue_prompt,
2096 return self.handle_auto(line,continue_prompt,
2086 pre,iFun,theRest,oinfo['obj'])
2097 pre,iFun,theRest,oinfo['obj'])
2087 else:
2098 else:
2088 #print 'was callable?', callable(oinfo['obj']) # dbg
2099 #print 'was callable?', callable(oinfo['obj']) # dbg
2089 return self.handle_normal(line,continue_prompt)
2100 return self.handle_normal(line,continue_prompt)
2090
2101
2091 # If we get here, we have a normal Python line. Log and return.
2102 # If we get here, we have a normal Python line. Log and return.
2092 return self.handle_normal(line,continue_prompt)
2103 return self.handle_normal(line,continue_prompt)
2093
2104
2094 def _prefilter_dumb(self, line, continue_prompt):
2105 def _prefilter_dumb(self, line, continue_prompt):
2095 """simple prefilter function, for debugging"""
2106 """simple prefilter function, for debugging"""
2096 return self.handle_normal(line,continue_prompt)
2107 return self.handle_normal(line,continue_prompt)
2097
2108
2098
2109
2099 def multiline_prefilter(self, line, continue_prompt):
2110 def multiline_prefilter(self, line, continue_prompt):
2100 """ Run _prefilter for each line of input
2111 """ Run _prefilter for each line of input
2101
2112
2102 Covers cases where there are multiple lines in the user entry,
2113 Covers cases where there are multiple lines in the user entry,
2103 which is the case when the user goes back to a multiline history
2114 which is the case when the user goes back to a multiline history
2104 entry and presses enter.
2115 entry and presses enter.
2105
2116
2106 """
2117 """
2107 out = []
2118 out = []
2108 for l in line.rstrip('\n').split('\n'):
2119 for l in line.rstrip('\n').split('\n'):
2109 out.append(self._prefilter(l, continue_prompt))
2120 out.append(self._prefilter(l, continue_prompt))
2110 return '\n'.join(out)
2121 return '\n'.join(out)
2111
2122
2112 # Set the default prefilter() function (this can be user-overridden)
2123 # Set the default prefilter() function (this can be user-overridden)
2113 prefilter = multiline_prefilter
2124 prefilter = multiline_prefilter
2114
2125
2115 def handle_normal(self,line,continue_prompt=None,
2126 def handle_normal(self,line,continue_prompt=None,
2116 pre=None,iFun=None,theRest=None):
2127 pre=None,iFun=None,theRest=None):
2117 """Handle normal input lines. Use as a template for handlers."""
2128 """Handle normal input lines. Use as a template for handlers."""
2118
2129
2119 # With autoindent on, we need some way to exit the input loop, and I
2130 # With autoindent on, we need some way to exit the input loop, and I
2120 # don't want to force the user to have to backspace all the way to
2131 # don't want to force the user to have to backspace all the way to
2121 # clear the line. The rule will be in this case, that either two
2132 # clear the line. The rule will be in this case, that either two
2122 # lines of pure whitespace in a row, or a line of pure whitespace but
2133 # lines of pure whitespace in a row, or a line of pure whitespace but
2123 # of a size different to the indent level, will exit the input loop.
2134 # of a size different to the indent level, will exit the input loop.
2124
2135
2125 if (continue_prompt and self.autoindent and line.isspace() and
2136 if (continue_prompt and self.autoindent and line.isspace() and
2126 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2137 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2127 (self.buffer[-1]).isspace() )):
2138 (self.buffer[-1]).isspace() )):
2128 line = ''
2139 line = ''
2129
2140
2130 self.log(line,line,continue_prompt)
2141 self.log(line,line,continue_prompt)
2131 return line
2142 return line
2132
2143
2133 def handle_alias(self,line,continue_prompt=None,
2144 def handle_alias(self,line,continue_prompt=None,
2134 pre=None,iFun=None,theRest=None):
2145 pre=None,iFun=None,theRest=None):
2135 """Handle alias input lines. """
2146 """Handle alias input lines. """
2136
2147
2137 # pre is needed, because it carries the leading whitespace. Otherwise
2148 # pre is needed, because it carries the leading whitespace. Otherwise
2138 # aliases won't work in indented sections.
2149 # aliases won't work in indented sections.
2139 transformed = self.expand_aliases(iFun, theRest)
2150 transformed = self.expand_aliases(iFun, theRest)
2140 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2151 line_out = '%s_ip.system(%s)' % (pre, make_quoted_expr( transformed ))
2141 self.log(line,line_out,continue_prompt)
2152 self.log(line,line_out,continue_prompt)
2142 #print 'line out:',line_out # dbg
2153 #print 'line out:',line_out # dbg
2143 return line_out
2154 return line_out
2144
2155
2145 def handle_shell_escape(self, line, continue_prompt=None,
2156 def handle_shell_escape(self, line, continue_prompt=None,
2146 pre=None,iFun=None,theRest=None):
2157 pre=None,iFun=None,theRest=None):
2147 """Execute the line in a shell, empty return value"""
2158 """Execute the line in a shell, empty return value"""
2148
2159
2149 #print 'line in :', `line` # dbg
2160 #print 'line in :', `line` # dbg
2150 # Example of a special handler. Others follow a similar pattern.
2161 # Example of a special handler. Others follow a similar pattern.
2151 if line.lstrip().startswith('!!'):
2162 if line.lstrip().startswith('!!'):
2152 # rewrite iFun/theRest to properly hold the call to %sx and
2163 # rewrite iFun/theRest to properly hold the call to %sx and
2153 # the actual command to be executed, so handle_magic can work
2164 # the actual command to be executed, so handle_magic can work
2154 # correctly
2165 # correctly
2155 theRest = '%s %s' % (iFun[2:],theRest)
2166 theRest = '%s %s' % (iFun[2:],theRest)
2156 iFun = 'sx'
2167 iFun = 'sx'
2157 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2168 return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,
2158 line.lstrip()[2:]),
2169 line.lstrip()[2:]),
2159 continue_prompt,pre,iFun,theRest)
2170 continue_prompt,pre,iFun,theRest)
2160 else:
2171 else:
2161 cmd=line.lstrip().lstrip('!')
2172 cmd=line.lstrip().lstrip('!')
2162 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2173 line_out = '%s_ip.system(%s)' % (pre,make_quoted_expr(cmd))
2163 # update cache/log and return
2174 # update cache/log and return
2164 self.log(line,line_out,continue_prompt)
2175 self.log(line,line_out,continue_prompt)
2165 return line_out
2176 return line_out
2166
2177
2167 def handle_magic(self, line, continue_prompt=None,
2178 def handle_magic(self, line, continue_prompt=None,
2168 pre=None,iFun=None,theRest=None):
2179 pre=None,iFun=None,theRest=None):
2169 """Execute magic functions."""
2180 """Execute magic functions."""
2170
2181
2171
2182
2172 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2183 cmd = '%s_ip.magic(%s)' % (pre,make_quoted_expr(iFun + " " + theRest))
2173 self.log(line,cmd,continue_prompt)
2184 self.log(line,cmd,continue_prompt)
2174 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2185 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2175 return cmd
2186 return cmd
2176
2187
2177 def handle_auto(self, line, continue_prompt=None,
2188 def handle_auto(self, line, continue_prompt=None,
2178 pre=None,iFun=None,theRest=None,obj=None):
2189 pre=None,iFun=None,theRest=None,obj=None):
2179 """Hande lines which can be auto-executed, quoting if requested."""
2190 """Hande lines which can be auto-executed, quoting if requested."""
2180
2191
2181 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2192 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2182
2193
2183 # This should only be active for single-line input!
2194 # This should only be active for single-line input!
2184 if continue_prompt:
2195 if continue_prompt:
2185 self.log(line,line,continue_prompt)
2196 self.log(line,line,continue_prompt)
2186 return line
2197 return line
2187
2198
2188 auto_rewrite = True
2199 auto_rewrite = True
2189
2200
2190 if pre == self.ESC_QUOTE:
2201 if pre == self.ESC_QUOTE:
2191 # Auto-quote splitting on whitespace
2202 # Auto-quote splitting on whitespace
2192 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2203 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2193 elif pre == self.ESC_QUOTE2:
2204 elif pre == self.ESC_QUOTE2:
2194 # Auto-quote whole string
2205 # Auto-quote whole string
2195 newcmd = '%s("%s")' % (iFun,theRest)
2206 newcmd = '%s("%s")' % (iFun,theRest)
2196 elif pre == self.ESC_PAREN:
2207 elif pre == self.ESC_PAREN:
2197 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2208 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2198 else:
2209 else:
2199 # Auto-paren.
2210 # Auto-paren.
2200 # We only apply it to argument-less calls if the autocall
2211 # We only apply it to argument-less calls if the autocall
2201 # parameter is set to 2. We only need to check that autocall is <
2212 # parameter is set to 2. We only need to check that autocall is <
2202 # 2, since this function isn't called unless it's at least 1.
2213 # 2, since this function isn't called unless it's at least 1.
2203 if not theRest and (self.rc.autocall < 2):
2214 if not theRest and (self.rc.autocall < 2):
2204 newcmd = '%s %s' % (iFun,theRest)
2215 newcmd = '%s %s' % (iFun,theRest)
2205 auto_rewrite = False
2216 auto_rewrite = False
2206 else:
2217 else:
2207 if theRest.startswith('['):
2218 if theRest.startswith('['):
2208 if hasattr(obj,'__getitem__'):
2219 if hasattr(obj,'__getitem__'):
2209 # Don't autocall in this case: item access for an object
2220 # Don't autocall in this case: item access for an object
2210 # which is BOTH callable and implements __getitem__.
2221 # which is BOTH callable and implements __getitem__.
2211 newcmd = '%s %s' % (iFun,theRest)
2222 newcmd = '%s %s' % (iFun,theRest)
2212 auto_rewrite = False
2223 auto_rewrite = False
2213 else:
2224 else:
2214 # if the object doesn't support [] access, go ahead and
2225 # if the object doesn't support [] access, go ahead and
2215 # autocall
2226 # autocall
2216 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2227 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2217 elif theRest.endswith(';'):
2228 elif theRest.endswith(';'):
2218 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2229 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2219 else:
2230 else:
2220 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2231 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2221
2232
2222 if auto_rewrite:
2233 if auto_rewrite:
2223 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2234 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
2224 # log what is now valid Python, not the actual user input (without the
2235 # log what is now valid Python, not the actual user input (without the
2225 # final newline)
2236 # final newline)
2226 self.log(line,newcmd,continue_prompt)
2237 self.log(line,newcmd,continue_prompt)
2227 return newcmd
2238 return newcmd
2228
2239
2229 def handle_help(self, line, continue_prompt=None,
2240 def handle_help(self, line, continue_prompt=None,
2230 pre=None,iFun=None,theRest=None):
2241 pre=None,iFun=None,theRest=None):
2231 """Try to get some help for the object.
2242 """Try to get some help for the object.
2232
2243
2233 obj? or ?obj -> basic information.
2244 obj? or ?obj -> basic information.
2234 obj?? or ??obj -> more details.
2245 obj?? or ??obj -> more details.
2235 """
2246 """
2236
2247
2237 # We need to make sure that we don't process lines which would be
2248 # We need to make sure that we don't process lines which would be
2238 # otherwise valid python, such as "x=1 # what?"
2249 # otherwise valid python, such as "x=1 # what?"
2239 try:
2250 try:
2240 codeop.compile_command(line)
2251 codeop.compile_command(line)
2241 except SyntaxError:
2252 except SyntaxError:
2242 # We should only handle as help stuff which is NOT valid syntax
2253 # We should only handle as help stuff which is NOT valid syntax
2243 if line[0]==self.ESC_HELP:
2254 if line[0]==self.ESC_HELP:
2244 line = line[1:]
2255 line = line[1:]
2245 elif line[-1]==self.ESC_HELP:
2256 elif line[-1]==self.ESC_HELP:
2246 line = line[:-1]
2257 line = line[:-1]
2247 self.log(line,'#?'+line,continue_prompt)
2258 self.log(line,'#?'+line,continue_prompt)
2248 if line:
2259 if line:
2249 self.magic_pinfo(line)
2260 self.magic_pinfo(line)
2250 else:
2261 else:
2251 page(self.usage,screen_lines=self.rc.screen_length)
2262 page(self.usage,screen_lines=self.rc.screen_length)
2252 return '' # Empty string is needed here!
2263 return '' # Empty string is needed here!
2253 except:
2264 except:
2254 # Pass any other exceptions through to the normal handler
2265 # Pass any other exceptions through to the normal handler
2255 return self.handle_normal(line,continue_prompt)
2266 return self.handle_normal(line,continue_prompt)
2256 else:
2267 else:
2257 # If the code compiles ok, we should handle it normally
2268 # If the code compiles ok, we should handle it normally
2258 return self.handle_normal(line,continue_prompt)
2269 return self.handle_normal(line,continue_prompt)
2259
2270
2260 def getapi(self):
2271 def getapi(self):
2261 """ Get an IPApi object for this shell instance
2272 """ Get an IPApi object for this shell instance
2262
2273
2263 Getting an IPApi object is always preferable to accessing the shell
2274 Getting an IPApi object is always preferable to accessing the shell
2264 directly, but this holds true especially for extensions.
2275 directly, but this holds true especially for extensions.
2265
2276
2266 It should always be possible to implement an extension with IPApi
2277 It should always be possible to implement an extension with IPApi
2267 alone. If not, contact maintainer to request an addition.
2278 alone. If not, contact maintainer to request an addition.
2268
2279
2269 """
2280 """
2270 return self.api
2281 return self.api
2271
2282
2272 def handle_emacs(self,line,continue_prompt=None,
2283 def handle_emacs(self,line,continue_prompt=None,
2273 pre=None,iFun=None,theRest=None):
2284 pre=None,iFun=None,theRest=None):
2274 """Handle input lines marked by python-mode."""
2285 """Handle input lines marked by python-mode."""
2275
2286
2276 # Currently, nothing is done. Later more functionality can be added
2287 # Currently, nothing is done. Later more functionality can be added
2277 # here if needed.
2288 # here if needed.
2278
2289
2279 # The input cache shouldn't be updated
2290 # The input cache shouldn't be updated
2280
2291
2281 return line
2292 return line
2282
2293
2283 def mktempfile(self,data=None):
2294 def mktempfile(self,data=None):
2284 """Make a new tempfile and return its filename.
2295 """Make a new tempfile and return its filename.
2285
2296
2286 This makes a call to tempfile.mktemp, but it registers the created
2297 This makes a call to tempfile.mktemp, but it registers the created
2287 filename internally so ipython cleans it up at exit time.
2298 filename internally so ipython cleans it up at exit time.
2288
2299
2289 Optional inputs:
2300 Optional inputs:
2290
2301
2291 - data(None): if data is given, it gets written out to the temp file
2302 - data(None): if data is given, it gets written out to the temp file
2292 immediately, and the file is closed again."""
2303 immediately, and the file is closed again."""
2293
2304
2294 filename = tempfile.mktemp('.py','ipython_edit_')
2305 filename = tempfile.mktemp('.py','ipython_edit_')
2295 self.tempfiles.append(filename)
2306 self.tempfiles.append(filename)
2296
2307
2297 if data:
2308 if data:
2298 tmp_file = open(filename,'w')
2309 tmp_file = open(filename,'w')
2299 tmp_file.write(data)
2310 tmp_file.write(data)
2300 tmp_file.close()
2311 tmp_file.close()
2301 return filename
2312 return filename
2302
2313
2303 def write(self,data):
2314 def write(self,data):
2304 """Write a string to the default output"""
2315 """Write a string to the default output"""
2305 Term.cout.write(data)
2316 Term.cout.write(data)
2306
2317
2307 def write_err(self,data):
2318 def write_err(self,data):
2308 """Write a string to the default error output"""
2319 """Write a string to the default error output"""
2309 Term.cerr.write(data)
2320 Term.cerr.write(data)
2310
2321
2311 def exit(self):
2322 def exit(self):
2312 """Handle interactive exit.
2323 """Handle interactive exit.
2313
2324
2314 This method sets the exit_now attribute."""
2325 This method sets the exit_now attribute."""
2315
2326
2316 if self.rc.confirm_exit:
2327 if self.rc.confirm_exit:
2317 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2328 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2318 self.exit_now = True
2329 self.exit_now = True
2319 else:
2330 else:
2320 self.exit_now = True
2331 self.exit_now = True
2321
2332
2322 def safe_execfile(self,fname,*where,**kw):
2333 def safe_execfile(self,fname,*where,**kw):
2323 fname = os.path.expanduser(fname)
2334 fname = os.path.expanduser(fname)
2324
2335
2325 # find things also in current directory
2336 # find things also in current directory
2326 dname = os.path.dirname(fname)
2337 dname = os.path.dirname(fname)
2327 if not sys.path.count(dname):
2338 if not sys.path.count(dname):
2328 sys.path.append(dname)
2339 sys.path.append(dname)
2329
2340
2330 try:
2341 try:
2331 xfile = open(fname)
2342 xfile = open(fname)
2332 except:
2343 except:
2333 print >> Term.cerr, \
2344 print >> Term.cerr, \
2334 'Could not open file <%s> for safe execution.' % fname
2345 'Could not open file <%s> for safe execution.' % fname
2335 return None
2346 return None
2336
2347
2337 kw.setdefault('islog',0)
2348 kw.setdefault('islog',0)
2338 kw.setdefault('quiet',1)
2349 kw.setdefault('quiet',1)
2339 kw.setdefault('exit_ignore',0)
2350 kw.setdefault('exit_ignore',0)
2340 first = xfile.readline()
2351 first = xfile.readline()
2341 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2352 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2342 xfile.close()
2353 xfile.close()
2343 # line by line execution
2354 # line by line execution
2344 if first.startswith(loghead) or kw['islog']:
2355 if first.startswith(loghead) or kw['islog']:
2345 print 'Loading log file <%s> one line at a time...' % fname
2356 print 'Loading log file <%s> one line at a time...' % fname
2346 if kw['quiet']:
2357 if kw['quiet']:
2347 stdout_save = sys.stdout
2358 stdout_save = sys.stdout
2348 sys.stdout = StringIO.StringIO()
2359 sys.stdout = StringIO.StringIO()
2349 try:
2360 try:
2350 globs,locs = where[0:2]
2361 globs,locs = where[0:2]
2351 except:
2362 except:
2352 try:
2363 try:
2353 globs = locs = where[0]
2364 globs = locs = where[0]
2354 except:
2365 except:
2355 globs = locs = globals()
2366 globs = locs = globals()
2356 badblocks = []
2367 badblocks = []
2357
2368
2358 # we also need to identify indented blocks of code when replaying
2369 # we also need to identify indented blocks of code when replaying
2359 # logs and put them together before passing them to an exec
2370 # logs and put them together before passing them to an exec
2360 # statement. This takes a bit of regexp and look-ahead work in the
2371 # statement. This takes a bit of regexp and look-ahead work in the
2361 # file. It's easiest if we swallow the whole thing in memory
2372 # file. It's easiest if we swallow the whole thing in memory
2362 # first, and manually walk through the lines list moving the
2373 # first, and manually walk through the lines list moving the
2363 # counter ourselves.
2374 # counter ourselves.
2364 indent_re = re.compile('\s+\S')
2375 indent_re = re.compile('\s+\S')
2365 xfile = open(fname)
2376 xfile = open(fname)
2366 filelines = xfile.readlines()
2377 filelines = xfile.readlines()
2367 xfile.close()
2378 xfile.close()
2368 nlines = len(filelines)
2379 nlines = len(filelines)
2369 lnum = 0
2380 lnum = 0
2370 while lnum < nlines:
2381 while lnum < nlines:
2371 line = filelines[lnum]
2382 line = filelines[lnum]
2372 lnum += 1
2383 lnum += 1
2373 # don't re-insert logger status info into cache
2384 # don't re-insert logger status info into cache
2374 if line.startswith('#log#'):
2385 if line.startswith('#log#'):
2375 continue
2386 continue
2376 else:
2387 else:
2377 # build a block of code (maybe a single line) for execution
2388 # build a block of code (maybe a single line) for execution
2378 block = line
2389 block = line
2379 try:
2390 try:
2380 next = filelines[lnum] # lnum has already incremented
2391 next = filelines[lnum] # lnum has already incremented
2381 except:
2392 except:
2382 next = None
2393 next = None
2383 while next and indent_re.match(next):
2394 while next and indent_re.match(next):
2384 block += next
2395 block += next
2385 lnum += 1
2396 lnum += 1
2386 try:
2397 try:
2387 next = filelines[lnum]
2398 next = filelines[lnum]
2388 except:
2399 except:
2389 next = None
2400 next = None
2390 # now execute the block of one or more lines
2401 # now execute the block of one or more lines
2391 try:
2402 try:
2392 exec block in globs,locs
2403 exec block in globs,locs
2393 except SystemExit:
2404 except SystemExit:
2394 pass
2405 pass
2395 except:
2406 except:
2396 badblocks.append(block.rstrip())
2407 badblocks.append(block.rstrip())
2397 if kw['quiet']: # restore stdout
2408 if kw['quiet']: # restore stdout
2398 sys.stdout.close()
2409 sys.stdout.close()
2399 sys.stdout = stdout_save
2410 sys.stdout = stdout_save
2400 print 'Finished replaying log file <%s>' % fname
2411 print 'Finished replaying log file <%s>' % fname
2401 if badblocks:
2412 if badblocks:
2402 print >> sys.stderr, ('\nThe following lines/blocks in file '
2413 print >> sys.stderr, ('\nThe following lines/blocks in file '
2403 '<%s> reported errors:' % fname)
2414 '<%s> reported errors:' % fname)
2404
2415
2405 for badline in badblocks:
2416 for badline in badblocks:
2406 print >> sys.stderr, badline
2417 print >> sys.stderr, badline
2407 else: # regular file execution
2418 else: # regular file execution
2408 try:
2419 try:
2409 execfile(fname,*where)
2420 execfile(fname,*where)
2410 except SyntaxError:
2421 except SyntaxError:
2411 self.showsyntaxerror()
2422 self.showsyntaxerror()
2412 warn('Failure executing file: <%s>' % fname)
2423 warn('Failure executing file: <%s>' % fname)
2413 except SystemExit,status:
2424 except SystemExit,status:
2414 if not kw['exit_ignore']:
2425 if not kw['exit_ignore']:
2415 self.showtraceback()
2426 self.showtraceback()
2416 warn('Failure executing file: <%s>' % fname)
2427 warn('Failure executing file: <%s>' % fname)
2417 except:
2428 except:
2418 self.showtraceback()
2429 self.showtraceback()
2419 warn('Failure executing file: <%s>' % fname)
2430 warn('Failure executing file: <%s>' % fname)
2420
2431
2421 #************************* end of file <iplib.py> *****************************
2432 #************************* end of file <iplib.py> *****************************
@@ -1,5785 +1,5796 b''
1 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
4 api: set_crash_handler(), to expose the ability to change the
5 internal crash handler.
6
7 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
8 the various parameters of the crash handler so that apps using
9 IPython as their engine can customize crash handling. Ipmlemented
10 at the request of SAGE.
11
1 2006-10-14 Ville Vainio <vivainio@gmail.com>
12 2006-10-14 Ville Vainio <vivainio@gmail.com>
2
13
3 * Magic.py, ipython.el: applied first "safe" part of Rocky
14 * Magic.py, ipython.el: applied first "safe" part of Rocky
4 Bernstein's patch set for pydb integration.
15 Bernstein's patch set for pydb integration.
5
16
6 * Magic.py (%unalias, %alias): %store'd aliases can now be
17 * Magic.py (%unalias, %alias): %store'd aliases can now be
7 removed with '%unalias'. %alias w/o args now shows most
18 removed with '%unalias'. %alias w/o args now shows most
8 interesting (stored / manually defined) aliases last
19 interesting (stored / manually defined) aliases last
9 where they catch the eye w/o scrolling.
20 where they catch the eye w/o scrolling.
10
21
11 2006-10-12 Ville Vainio <vivainio@gmail.com>
22 2006-10-12 Ville Vainio <vivainio@gmail.com>
12
23
13 * jobctrl.py: Add new "jobctrl" extension for spawning background
24 * jobctrl.py: Add new "jobctrl" extension for spawning background
14 processes with "&find /". 'import jobctrl' to try it out. Requires
25 processes with "&find /". 'import jobctrl' to try it out. Requires
15 'subprocess' module, standard in python 2.4+.
26 'subprocess' module, standard in python 2.4+.
16
27
17 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
28 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
18 so if foo -> bar and bar -> baz, then foo -> baz.
29 so if foo -> bar and bar -> baz, then foo -> baz.
19
30
20 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
31 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
21
32
22 * IPython/Magic.py (Magic.parse_options): add a new posix option
33 * IPython/Magic.py (Magic.parse_options): add a new posix option
23 to allow parsing of input args in magics that doesn't strip quotes
34 to allow parsing of input args in magics that doesn't strip quotes
24 (if posix=False). This also closes %timeit bug reported by
35 (if posix=False). This also closes %timeit bug reported by
25 Stefan.
36 Stefan.
26
37
27 2006-10-03 Ville Vainio <vivainio@gmail.com>
38 2006-10-03 Ville Vainio <vivainio@gmail.com>
28
39
29 * iplib.py (raw_input, interact): Return ValueError catching for
40 * iplib.py (raw_input, interact): Return ValueError catching for
30 raw_input. Fixes infinite loop for sys.stdin.close() or
41 raw_input. Fixes infinite loop for sys.stdin.close() or
31 sys.stdout.close().
42 sys.stdout.close().
32
43
33 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
44 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
34
45
35 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
46 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
36 to help in handling doctests. irunner is now pretty useful for
47 to help in handling doctests. irunner is now pretty useful for
37 running standalone scripts and simulate a full interactive session
48 running standalone scripts and simulate a full interactive session
38 in a format that can be then pasted as a doctest.
49 in a format that can be then pasted as a doctest.
39
50
40 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
51 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
41 on top of the default (useless) ones. This also fixes the nasty
52 on top of the default (useless) ones. This also fixes the nasty
42 way in which 2.5's Quitter() exits (reverted [1785]).
53 way in which 2.5's Quitter() exits (reverted [1785]).
43
54
44 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
55 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
45 2.5.
56 2.5.
46
57
47 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
58 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
48 color scheme is updated as well when color scheme is changed
59 color scheme is updated as well when color scheme is changed
49 interactively.
60 interactively.
50
61
51 2006-09-27 Ville Vainio <vivainio@gmail.com>
62 2006-09-27 Ville Vainio <vivainio@gmail.com>
52
63
53 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
64 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
54 infinite loop and just exit. It's a hack, but will do for a while.
65 infinite loop and just exit. It's a hack, but will do for a while.
55
66
56 2006-08-25 Walter Doerwald <walter@livinglogic.de>
67 2006-08-25 Walter Doerwald <walter@livinglogic.de>
57
68
58 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
69 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
59 the constructor, this makes it possible to get a list of only directories
70 the constructor, this makes it possible to get a list of only directories
60 or only files.
71 or only files.
61
72
62 2006-08-12 Ville Vainio <vivainio@gmail.com>
73 2006-08-12 Ville Vainio <vivainio@gmail.com>
63
74
64 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
75 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
65 they broke unittest
76 they broke unittest
66
77
67 2006-08-11 Ville Vainio <vivainio@gmail.com>
78 2006-08-11 Ville Vainio <vivainio@gmail.com>
68
79
69 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
80 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
70 by resolving issue properly, i.e. by inheriting FakeModule
81 by resolving issue properly, i.e. by inheriting FakeModule
71 from types.ModuleType. Pickling ipython interactive data
82 from types.ModuleType. Pickling ipython interactive data
72 should still work as usual (testing appreciated).
83 should still work as usual (testing appreciated).
73
84
74 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
85 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
75
86
76 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
87 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
77 running under python 2.3 with code from 2.4 to fix a bug with
88 running under python 2.3 with code from 2.4 to fix a bug with
78 help(). Reported by the Debian maintainers, Norbert Tretkowski
89 help(). Reported by the Debian maintainers, Norbert Tretkowski
79 <norbert-AT-tretkowski.de> and Alexandre Fayolle
90 <norbert-AT-tretkowski.de> and Alexandre Fayolle
80 <afayolle-AT-debian.org>.
91 <afayolle-AT-debian.org>.
81
92
82 2006-08-04 Walter Doerwald <walter@livinglogic.de>
93 2006-08-04 Walter Doerwald <walter@livinglogic.de>
83
94
84 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
95 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
85 (which was displaying "quit" twice).
96 (which was displaying "quit" twice).
86
97
87 2006-07-28 Walter Doerwald <walter@livinglogic.de>
98 2006-07-28 Walter Doerwald <walter@livinglogic.de>
88
99
89 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
100 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
90 the mode argument).
101 the mode argument).
91
102
92 2006-07-27 Walter Doerwald <walter@livinglogic.de>
103 2006-07-27 Walter Doerwald <walter@livinglogic.de>
93
104
94 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
105 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
95 not running under IPython.
106 not running under IPython.
96
107
97 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
108 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
98 and make it iterable (iterating over the attribute itself). Add two new
109 and make it iterable (iterating over the attribute itself). Add two new
99 magic strings for __xattrs__(): If the string starts with "-", the attribute
110 magic strings for __xattrs__(): If the string starts with "-", the attribute
100 will not be displayed in ibrowse's detail view (but it can still be
111 will not be displayed in ibrowse's detail view (but it can still be
101 iterated over). This makes it possible to add attributes that are large
112 iterated over). This makes it possible to add attributes that are large
102 lists or generator methods to the detail view. Replace magic attribute names
113 lists or generator methods to the detail view. Replace magic attribute names
103 and _attrname() and _getattr() with "descriptors": For each type of magic
114 and _attrname() and _getattr() with "descriptors": For each type of magic
104 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
115 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
105 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
116 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
106 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
117 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
107 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
118 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
108 are still supported.
119 are still supported.
109
120
110 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
121 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
111 fails in ibrowse.fetch(), the exception object is added as the last item
122 fails in ibrowse.fetch(), the exception object is added as the last item
112 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
123 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
113 a generator throws an exception midway through execution.
124 a generator throws an exception midway through execution.
114
125
115 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
126 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
116 encoding into methods.
127 encoding into methods.
117
128
118 2006-07-26 Ville Vainio <vivainio@gmail.com>
129 2006-07-26 Ville Vainio <vivainio@gmail.com>
119
130
120 * iplib.py: history now stores multiline input as single
131 * iplib.py: history now stores multiline input as single
121 history entries. Patch by Jorgen Cederlof.
132 history entries. Patch by Jorgen Cederlof.
122
133
123 2006-07-18 Walter Doerwald <walter@livinglogic.de>
134 2006-07-18 Walter Doerwald <walter@livinglogic.de>
124
135
125 * IPython/Extensions/ibrowse.py: Make cursor visible over
136 * IPython/Extensions/ibrowse.py: Make cursor visible over
126 non existing attributes.
137 non existing attributes.
127
138
128 2006-07-14 Walter Doerwald <walter@livinglogic.de>
139 2006-07-14 Walter Doerwald <walter@livinglogic.de>
129
140
130 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
141 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
131 error output of the running command doesn't mess up the screen.
142 error output of the running command doesn't mess up the screen.
132
143
133 2006-07-13 Walter Doerwald <walter@livinglogic.de>
144 2006-07-13 Walter Doerwald <walter@livinglogic.de>
134
145
135 * IPython/Extensions/ipipe.py (isort): Make isort usable without
146 * IPython/Extensions/ipipe.py (isort): Make isort usable without
136 argument. This sorts the items themselves.
147 argument. This sorts the items themselves.
137
148
138 2006-07-12 Walter Doerwald <walter@livinglogic.de>
149 2006-07-12 Walter Doerwald <walter@livinglogic.de>
139
150
140 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
151 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
141 Compile expression strings into code objects. This should speed
152 Compile expression strings into code objects. This should speed
142 up ifilter and friends somewhat.
153 up ifilter and friends somewhat.
143
154
144 2006-07-08 Ville Vainio <vivainio@gmail.com>
155 2006-07-08 Ville Vainio <vivainio@gmail.com>
145
156
146 * Magic.py: %cpaste now strips > from the beginning of lines
157 * Magic.py: %cpaste now strips > from the beginning of lines
147 to ease pasting quoted code from emails. Contributed by
158 to ease pasting quoted code from emails. Contributed by
148 Stefan van der Walt.
159 Stefan van der Walt.
149
160
150 2006-06-29 Ville Vainio <vivainio@gmail.com>
161 2006-06-29 Ville Vainio <vivainio@gmail.com>
151
162
152 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
163 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
153 mode, patch contributed by Darren Dale. NEEDS TESTING!
164 mode, patch contributed by Darren Dale. NEEDS TESTING!
154
165
155 2006-06-28 Walter Doerwald <walter@livinglogic.de>
166 2006-06-28 Walter Doerwald <walter@livinglogic.de>
156
167
157 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
168 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
158 a blue background. Fix fetching new display rows when the browser
169 a blue background. Fix fetching new display rows when the browser
159 scrolls more than a screenful (e.g. by using the goto command).
170 scrolls more than a screenful (e.g. by using the goto command).
160
171
161 2006-06-27 Ville Vainio <vivainio@gmail.com>
172 2006-06-27 Ville Vainio <vivainio@gmail.com>
162
173
163 * Magic.py (_inspect, _ofind) Apply David Huard's
174 * Magic.py (_inspect, _ofind) Apply David Huard's
164 patch for displaying the correct docstring for 'property'
175 patch for displaying the correct docstring for 'property'
165 attributes.
176 attributes.
166
177
167 2006-06-23 Walter Doerwald <walter@livinglogic.de>
178 2006-06-23 Walter Doerwald <walter@livinglogic.de>
168
179
169 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
180 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
170 commands into the methods implementing them.
181 commands into the methods implementing them.
171
182
172 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
183 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
173
184
174 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
185 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
175 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
186 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
176 autoindent support was authored by Jin Liu.
187 autoindent support was authored by Jin Liu.
177
188
178 2006-06-22 Walter Doerwald <walter@livinglogic.de>
189 2006-06-22 Walter Doerwald <walter@livinglogic.de>
179
190
180 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
191 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
181 for keymaps with a custom class that simplifies handling.
192 for keymaps with a custom class that simplifies handling.
182
193
183 2006-06-19 Walter Doerwald <walter@livinglogic.de>
194 2006-06-19 Walter Doerwald <walter@livinglogic.de>
184
195
185 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
196 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
186 resizing. This requires Python 2.5 to work.
197 resizing. This requires Python 2.5 to work.
187
198
188 2006-06-16 Walter Doerwald <walter@livinglogic.de>
199 2006-06-16 Walter Doerwald <walter@livinglogic.de>
189
200
190 * IPython/Extensions/ibrowse.py: Add two new commands to
201 * IPython/Extensions/ibrowse.py: Add two new commands to
191 ibrowse: "hideattr" (mapped to "h") hides the attribute under
202 ibrowse: "hideattr" (mapped to "h") hides the attribute under
192 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
203 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
193 attributes again. Remapped the help command to "?". Display
204 attributes again. Remapped the help command to "?". Display
194 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
205 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
195 as keys for the "home" and "end" commands. Add three new commands
206 as keys for the "home" and "end" commands. Add three new commands
196 to the input mode for "find" and friends: "delend" (CTRL-K)
207 to the input mode for "find" and friends: "delend" (CTRL-K)
197 deletes to the end of line. "incsearchup" searches upwards in the
208 deletes to the end of line. "incsearchup" searches upwards in the
198 command history for an input that starts with the text before the cursor.
209 command history for an input that starts with the text before the cursor.
199 "incsearchdown" does the same downwards. Removed a bogus mapping of
210 "incsearchdown" does the same downwards. Removed a bogus mapping of
200 the x key to "delete".
211 the x key to "delete".
201
212
202 2006-06-15 Ville Vainio <vivainio@gmail.com>
213 2006-06-15 Ville Vainio <vivainio@gmail.com>
203
214
204 * iplib.py, hooks.py: Added new generate_prompt hook that can be
215 * iplib.py, hooks.py: Added new generate_prompt hook that can be
205 used to create prompts dynamically, instead of the "old" way of
216 used to create prompts dynamically, instead of the "old" way of
206 assigning "magic" strings to prompt_in1 and prompt_in2. The old
217 assigning "magic" strings to prompt_in1 and prompt_in2. The old
207 way still works (it's invoked by the default hook), of course.
218 way still works (it's invoked by the default hook), of course.
208
219
209 * Prompts.py: added generate_output_prompt hook for altering output
220 * Prompts.py: added generate_output_prompt hook for altering output
210 prompt
221 prompt
211
222
212 * Release.py: Changed version string to 0.7.3.svn.
223 * Release.py: Changed version string to 0.7.3.svn.
213
224
214 2006-06-15 Walter Doerwald <walter@livinglogic.de>
225 2006-06-15 Walter Doerwald <walter@livinglogic.de>
215
226
216 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
227 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
217 the call to fetch() always tries to fetch enough data for at least one
228 the call to fetch() always tries to fetch enough data for at least one
218 full screen. This makes it possible to simply call moveto(0,0,True) in
229 full screen. This makes it possible to simply call moveto(0,0,True) in
219 the constructor. Fix typos and removed the obsolete goto attribute.
230 the constructor. Fix typos and removed the obsolete goto attribute.
220
231
221 2006-06-12 Ville Vainio <vivainio@gmail.com>
232 2006-06-12 Ville Vainio <vivainio@gmail.com>
222
233
223 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
234 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
224 allowing $variable interpolation within multiline statements,
235 allowing $variable interpolation within multiline statements,
225 though so far only with "sh" profile for a testing period.
236 though so far only with "sh" profile for a testing period.
226 The patch also enables splitting long commands with \ but it
237 The patch also enables splitting long commands with \ but it
227 doesn't work properly yet.
238 doesn't work properly yet.
228
239
229 2006-06-12 Walter Doerwald <walter@livinglogic.de>
240 2006-06-12 Walter Doerwald <walter@livinglogic.de>
230
241
231 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
242 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
232 input history and the position of the cursor in the input history for
243 input history and the position of the cursor in the input history for
233 the find, findbackwards and goto command.
244 the find, findbackwards and goto command.
234
245
235 2006-06-10 Walter Doerwald <walter@livinglogic.de>
246 2006-06-10 Walter Doerwald <walter@livinglogic.de>
236
247
237 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
248 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
238 implements the basic functionality of browser commands that require
249 implements the basic functionality of browser commands that require
239 input. Reimplement the goto, find and findbackwards commands as
250 input. Reimplement the goto, find and findbackwards commands as
240 subclasses of _CommandInput. Add an input history and keymaps to those
251 subclasses of _CommandInput. Add an input history and keymaps to those
241 commands. Add "\r" as a keyboard shortcut for the enterdefault and
252 commands. Add "\r" as a keyboard shortcut for the enterdefault and
242 execute commands.
253 execute commands.
243
254
244 2006-06-07 Ville Vainio <vivainio@gmail.com>
255 2006-06-07 Ville Vainio <vivainio@gmail.com>
245
256
246 * iplib.py: ipython mybatch.ipy exits ipython immediately after
257 * iplib.py: ipython mybatch.ipy exits ipython immediately after
247 running the batch files instead of leaving the session open.
258 running the batch files instead of leaving the session open.
248
259
249 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
260 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
250
261
251 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
262 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
252 the original fix was incomplete. Patch submitted by W. Maier.
263 the original fix was incomplete. Patch submitted by W. Maier.
253
264
254 2006-06-07 Ville Vainio <vivainio@gmail.com>
265 2006-06-07 Ville Vainio <vivainio@gmail.com>
255
266
256 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
267 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
257 Confirmation prompts can be supressed by 'quiet' option.
268 Confirmation prompts can be supressed by 'quiet' option.
258 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
269 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
259
270
260 2006-06-06 *** Released version 0.7.2
271 2006-06-06 *** Released version 0.7.2
261
272
262 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
273 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
263
274
264 * IPython/Release.py (version): Made 0.7.2 final for release.
275 * IPython/Release.py (version): Made 0.7.2 final for release.
265 Repo tagged and release cut.
276 Repo tagged and release cut.
266
277
267 2006-06-05 Ville Vainio <vivainio@gmail.com>
278 2006-06-05 Ville Vainio <vivainio@gmail.com>
268
279
269 * Magic.py (magic_rehashx): Honor no_alias list earlier in
280 * Magic.py (magic_rehashx): Honor no_alias list earlier in
270 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
281 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
271
282
272 * upgrade_dir.py: try import 'path' module a bit harder
283 * upgrade_dir.py: try import 'path' module a bit harder
273 (for %upgrade)
284 (for %upgrade)
274
285
275 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
286 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
276
287
277 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
288 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
278 instead of looping 20 times.
289 instead of looping 20 times.
279
290
280 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
291 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
281 correctly at initialization time. Bug reported by Krishna Mohan
292 correctly at initialization time. Bug reported by Krishna Mohan
282 Gundu <gkmohan-AT-gmail.com> on the user list.
293 Gundu <gkmohan-AT-gmail.com> on the user list.
283
294
284 * IPython/Release.py (version): Mark 0.7.2 version to start
295 * IPython/Release.py (version): Mark 0.7.2 version to start
285 testing for release on 06/06.
296 testing for release on 06/06.
286
297
287 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
298 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
288
299
289 * scripts/irunner: thin script interface so users don't have to
300 * scripts/irunner: thin script interface so users don't have to
290 find the module and call it as an executable, since modules rarely
301 find the module and call it as an executable, since modules rarely
291 live in people's PATH.
302 live in people's PATH.
292
303
293 * IPython/irunner.py (InteractiveRunner.__init__): added
304 * IPython/irunner.py (InteractiveRunner.__init__): added
294 delaybeforesend attribute to control delays with newer versions of
305 delaybeforesend attribute to control delays with newer versions of
295 pexpect. Thanks to detailed help from pexpect's author, Noah
306 pexpect. Thanks to detailed help from pexpect's author, Noah
296 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
307 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
297 correctly (it works in NoColor mode).
308 correctly (it works in NoColor mode).
298
309
299 * IPython/iplib.py (handle_normal): fix nasty crash reported on
310 * IPython/iplib.py (handle_normal): fix nasty crash reported on
300 SAGE list, from improper log() calls.
311 SAGE list, from improper log() calls.
301
312
302 2006-05-31 Ville Vainio <vivainio@gmail.com>
313 2006-05-31 Ville Vainio <vivainio@gmail.com>
303
314
304 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
315 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
305 with args in parens to work correctly with dirs that have spaces.
316 with args in parens to work correctly with dirs that have spaces.
306
317
307 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
318 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
308
319
309 * IPython/Logger.py (Logger.logstart): add option to log raw input
320 * IPython/Logger.py (Logger.logstart): add option to log raw input
310 instead of the processed one. A -r flag was added to the
321 instead of the processed one. A -r flag was added to the
311 %logstart magic used for controlling logging.
322 %logstart magic used for controlling logging.
312
323
313 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
324 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
314
325
315 * IPython/iplib.py (InteractiveShell.__init__): add check for the
326 * IPython/iplib.py (InteractiveShell.__init__): add check for the
316 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
327 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
317 recognize the option. After a bug report by Will Maier. This
328 recognize the option. After a bug report by Will Maier. This
318 closes #64 (will do it after confirmation from W. Maier).
329 closes #64 (will do it after confirmation from W. Maier).
319
330
320 * IPython/irunner.py: New module to run scripts as if manually
331 * IPython/irunner.py: New module to run scripts as if manually
321 typed into an interactive environment, based on pexpect. After a
332 typed into an interactive environment, based on pexpect. After a
322 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
333 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
323 ipython-user list. Simple unittests in the tests/ directory.
334 ipython-user list. Simple unittests in the tests/ directory.
324
335
325 * tools/release: add Will Maier, OpenBSD port maintainer, to
336 * tools/release: add Will Maier, OpenBSD port maintainer, to
326 recepients list. We are now officially part of the OpenBSD ports:
337 recepients list. We are now officially part of the OpenBSD ports:
327 http://www.openbsd.org/ports.html ! Many thanks to Will for the
338 http://www.openbsd.org/ports.html ! Many thanks to Will for the
328 work.
339 work.
329
340
330 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
341 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
331
342
332 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
343 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
333 so that it doesn't break tkinter apps.
344 so that it doesn't break tkinter apps.
334
345
335 * IPython/iplib.py (_prefilter): fix bug where aliases would
346 * IPython/iplib.py (_prefilter): fix bug where aliases would
336 shadow variables when autocall was fully off. Reported by SAGE
347 shadow variables when autocall was fully off. Reported by SAGE
337 author William Stein.
348 author William Stein.
338
349
339 * IPython/OInspect.py (Inspector.__init__): add a flag to control
350 * IPython/OInspect.py (Inspector.__init__): add a flag to control
340 at what detail level strings are computed when foo? is requested.
351 at what detail level strings are computed when foo? is requested.
341 This allows users to ask for example that the string form of an
352 This allows users to ask for example that the string form of an
342 object is only computed when foo?? is called, or even never, by
353 object is only computed when foo?? is called, or even never, by
343 setting the object_info_string_level >= 2 in the configuration
354 setting the object_info_string_level >= 2 in the configuration
344 file. This new option has been added and documented. After a
355 file. This new option has been added and documented. After a
345 request by SAGE to be able to control the printing of very large
356 request by SAGE to be able to control the printing of very large
346 objects more easily.
357 objects more easily.
347
358
348 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
359 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
349
360
350 * IPython/ipmaker.py (make_IPython): remove the ipython call path
361 * IPython/ipmaker.py (make_IPython): remove the ipython call path
351 from sys.argv, to be 100% consistent with how Python itself works
362 from sys.argv, to be 100% consistent with how Python itself works
352 (as seen for example with python -i file.py). After a bug report
363 (as seen for example with python -i file.py). After a bug report
353 by Jeffrey Collins.
364 by Jeffrey Collins.
354
365
355 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
366 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
356 nasty bug which was preventing custom namespaces with -pylab,
367 nasty bug which was preventing custom namespaces with -pylab,
357 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
368 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
358 compatibility (long gone from mpl).
369 compatibility (long gone from mpl).
359
370
360 * IPython/ipapi.py (make_session): name change: create->make. We
371 * IPython/ipapi.py (make_session): name change: create->make. We
361 use make in other places (ipmaker,...), it's shorter and easier to
372 use make in other places (ipmaker,...), it's shorter and easier to
362 type and say, etc. I'm trying to clean things before 0.7.2 so
373 type and say, etc. I'm trying to clean things before 0.7.2 so
363 that I can keep things stable wrt to ipapi in the chainsaw branch.
374 that I can keep things stable wrt to ipapi in the chainsaw branch.
364
375
365 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
376 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
366 python-mode recognizes our debugger mode. Add support for
377 python-mode recognizes our debugger mode. Add support for
367 autoindent inside (X)emacs. After a patch sent in by Jin Liu
378 autoindent inside (X)emacs. After a patch sent in by Jin Liu
368 <m.liu.jin-AT-gmail.com> originally written by
379 <m.liu.jin-AT-gmail.com> originally written by
369 doxgen-AT-newsmth.net (with minor modifications for xemacs
380 doxgen-AT-newsmth.net (with minor modifications for xemacs
370 compatibility)
381 compatibility)
371
382
372 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
383 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
373 tracebacks when walking the stack so that the stack tracking system
384 tracebacks when walking the stack so that the stack tracking system
374 in emacs' python-mode can identify the frames correctly.
385 in emacs' python-mode can identify the frames correctly.
375
386
376 * IPython/ipmaker.py (make_IPython): make the internal (and
387 * IPython/ipmaker.py (make_IPython): make the internal (and
377 default config) autoedit_syntax value false by default. Too many
388 default config) autoedit_syntax value false by default. Too many
378 users have complained to me (both on and off-list) about problems
389 users have complained to me (both on and off-list) about problems
379 with this option being on by default, so I'm making it default to
390 with this option being on by default, so I'm making it default to
380 off. It can still be enabled by anyone via the usual mechanisms.
391 off. It can still be enabled by anyone via the usual mechanisms.
381
392
382 * IPython/completer.py (Completer.attr_matches): add support for
393 * IPython/completer.py (Completer.attr_matches): add support for
383 PyCrust-style _getAttributeNames magic method. Patch contributed
394 PyCrust-style _getAttributeNames magic method. Patch contributed
384 by <mscott-AT-goldenspud.com>. Closes #50.
395 by <mscott-AT-goldenspud.com>. Closes #50.
385
396
386 * IPython/iplib.py (InteractiveShell.__init__): remove the
397 * IPython/iplib.py (InteractiveShell.__init__): remove the
387 deletion of exit/quit from __builtin__, which can break
398 deletion of exit/quit from __builtin__, which can break
388 third-party tools like the Zope debugging console. The
399 third-party tools like the Zope debugging console. The
389 %exit/%quit magics remain. In general, it's probably a good idea
400 %exit/%quit magics remain. In general, it's probably a good idea
390 not to delete anything from __builtin__, since we never know what
401 not to delete anything from __builtin__, since we never know what
391 that will break. In any case, python now (for 2.5) will support
402 that will break. In any case, python now (for 2.5) will support
392 'real' exit/quit, so this issue is moot. Closes #55.
403 'real' exit/quit, so this issue is moot. Closes #55.
393
404
394 * IPython/genutils.py (with_obj): rename the 'with' function to
405 * IPython/genutils.py (with_obj): rename the 'with' function to
395 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
406 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
396 becomes a language keyword. Closes #53.
407 becomes a language keyword. Closes #53.
397
408
398 * IPython/FakeModule.py (FakeModule.__init__): add a proper
409 * IPython/FakeModule.py (FakeModule.__init__): add a proper
399 __file__ attribute to this so it fools more things into thinking
410 __file__ attribute to this so it fools more things into thinking
400 it is a real module. Closes #59.
411 it is a real module. Closes #59.
401
412
402 * IPython/Magic.py (magic_edit): add -n option to open the editor
413 * IPython/Magic.py (magic_edit): add -n option to open the editor
403 at a specific line number. After a patch by Stefan van der Walt.
414 at a specific line number. After a patch by Stefan van der Walt.
404
415
405 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
416 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
406
417
407 * IPython/iplib.py (edit_syntax_error): fix crash when for some
418 * IPython/iplib.py (edit_syntax_error): fix crash when for some
408 reason the file could not be opened. After automatic crash
419 reason the file could not be opened. After automatic crash
409 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
420 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
410 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
421 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
411 (_should_recompile): Don't fire editor if using %bg, since there
422 (_should_recompile): Don't fire editor if using %bg, since there
412 is no file in the first place. From the same report as above.
423 is no file in the first place. From the same report as above.
413 (raw_input): protect against faulty third-party prefilters. After
424 (raw_input): protect against faulty third-party prefilters. After
414 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
425 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
415 while running under SAGE.
426 while running under SAGE.
416
427
417 2006-05-23 Ville Vainio <vivainio@gmail.com>
428 2006-05-23 Ville Vainio <vivainio@gmail.com>
418
429
419 * ipapi.py: Stripped down ip.to_user_ns() to work only as
430 * ipapi.py: Stripped down ip.to_user_ns() to work only as
420 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
431 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
421 now returns None (again), unless dummy is specifically allowed by
432 now returns None (again), unless dummy is specifically allowed by
422 ipapi.get(allow_dummy=True).
433 ipapi.get(allow_dummy=True).
423
434
424 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
435 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
425
436
426 * IPython: remove all 2.2-compatibility objects and hacks from
437 * IPython: remove all 2.2-compatibility objects and hacks from
427 everywhere, since we only support 2.3 at this point. Docs
438 everywhere, since we only support 2.3 at this point. Docs
428 updated.
439 updated.
429
440
430 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
441 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
431 Anything requiring extra validation can be turned into a Python
442 Anything requiring extra validation can be turned into a Python
432 property in the future. I used a property for the db one b/c
443 property in the future. I used a property for the db one b/c
433 there was a nasty circularity problem with the initialization
444 there was a nasty circularity problem with the initialization
434 order, which right now I don't have time to clean up.
445 order, which right now I don't have time to clean up.
435
446
436 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
447 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
437 another locking bug reported by Jorgen. I'm not 100% sure though,
448 another locking bug reported by Jorgen. I'm not 100% sure though,
438 so more testing is needed...
449 so more testing is needed...
439
450
440 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
451 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
441
452
442 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
453 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
443 local variables from any routine in user code (typically executed
454 local variables from any routine in user code (typically executed
444 with %run) directly into the interactive namespace. Very useful
455 with %run) directly into the interactive namespace. Very useful
445 when doing complex debugging.
456 when doing complex debugging.
446 (IPythonNotRunning): Changed the default None object to a dummy
457 (IPythonNotRunning): Changed the default None object to a dummy
447 whose attributes can be queried as well as called without
458 whose attributes can be queried as well as called without
448 exploding, to ease writing code which works transparently both in
459 exploding, to ease writing code which works transparently both in
449 and out of ipython and uses some of this API.
460 and out of ipython and uses some of this API.
450
461
451 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
462 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
452
463
453 * IPython/hooks.py (result_display): Fix the fact that our display
464 * IPython/hooks.py (result_display): Fix the fact that our display
454 hook was using str() instead of repr(), as the default python
465 hook was using str() instead of repr(), as the default python
455 console does. This had gone unnoticed b/c it only happened if
466 console does. This had gone unnoticed b/c it only happened if
456 %Pprint was off, but the inconsistency was there.
467 %Pprint was off, but the inconsistency was there.
457
468
458 2006-05-15 Ville Vainio <vivainio@gmail.com>
469 2006-05-15 Ville Vainio <vivainio@gmail.com>
459
470
460 * Oinspect.py: Only show docstring for nonexisting/binary files
471 * Oinspect.py: Only show docstring for nonexisting/binary files
461 when doing object??, closing ticket #62
472 when doing object??, closing ticket #62
462
473
463 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
474 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
464
475
465 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
476 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
466 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
477 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
467 was being released in a routine which hadn't checked if it had
478 was being released in a routine which hadn't checked if it had
468 been the one to acquire it.
479 been the one to acquire it.
469
480
470 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
481 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
471
482
472 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
483 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
473
484
474 2006-04-11 Ville Vainio <vivainio@gmail.com>
485 2006-04-11 Ville Vainio <vivainio@gmail.com>
475
486
476 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
487 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
477 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
488 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
478 prefilters, allowing stuff like magics and aliases in the file.
489 prefilters, allowing stuff like magics and aliases in the file.
479
490
480 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
491 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
481 added. Supported now are "%clear in" and "%clear out" (clear input and
492 added. Supported now are "%clear in" and "%clear out" (clear input and
482 output history, respectively). Also fixed CachedOutput.flush to
493 output history, respectively). Also fixed CachedOutput.flush to
483 properly flush the output cache.
494 properly flush the output cache.
484
495
485 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
496 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
486 half-success (and fail explicitly).
497 half-success (and fail explicitly).
487
498
488 2006-03-28 Ville Vainio <vivainio@gmail.com>
499 2006-03-28 Ville Vainio <vivainio@gmail.com>
489
500
490 * iplib.py: Fix quoting of aliases so that only argless ones
501 * iplib.py: Fix quoting of aliases so that only argless ones
491 are quoted
502 are quoted
492
503
493 2006-03-28 Ville Vainio <vivainio@gmail.com>
504 2006-03-28 Ville Vainio <vivainio@gmail.com>
494
505
495 * iplib.py: Quote aliases with spaces in the name.
506 * iplib.py: Quote aliases with spaces in the name.
496 "c:\program files\blah\bin" is now legal alias target.
507 "c:\program files\blah\bin" is now legal alias target.
497
508
498 * ext_rehashdir.py: Space no longer allowed as arg
509 * ext_rehashdir.py: Space no longer allowed as arg
499 separator, since space is legal in path names.
510 separator, since space is legal in path names.
500
511
501 2006-03-16 Ville Vainio <vivainio@gmail.com>
512 2006-03-16 Ville Vainio <vivainio@gmail.com>
502
513
503 * upgrade_dir.py: Take path.py from Extensions, correcting
514 * upgrade_dir.py: Take path.py from Extensions, correcting
504 %upgrade magic
515 %upgrade magic
505
516
506 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
517 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
507
518
508 * hooks.py: Only enclose editor binary in quotes if legal and
519 * hooks.py: Only enclose editor binary in quotes if legal and
509 necessary (space in the name, and is an existing file). Fixes a bug
520 necessary (space in the name, and is an existing file). Fixes a bug
510 reported by Zachary Pincus.
521 reported by Zachary Pincus.
511
522
512 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
523 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
513
524
514 * Manual: thanks to a tip on proper color handling for Emacs, by
525 * Manual: thanks to a tip on proper color handling for Emacs, by
515 Eric J Haywiser <ejh1-AT-MIT.EDU>.
526 Eric J Haywiser <ejh1-AT-MIT.EDU>.
516
527
517 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
528 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
518 by applying the provided patch. Thanks to Liu Jin
529 by applying the provided patch. Thanks to Liu Jin
519 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
530 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
520 XEmacs/Linux, I'm trusting the submitter that it actually helps
531 XEmacs/Linux, I'm trusting the submitter that it actually helps
521 under win32/GNU Emacs. Will revisit if any problems are reported.
532 under win32/GNU Emacs. Will revisit if any problems are reported.
522
533
523 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
534 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
524
535
525 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
536 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
526 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
537 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
527
538
528 2006-03-12 Ville Vainio <vivainio@gmail.com>
539 2006-03-12 Ville Vainio <vivainio@gmail.com>
529
540
530 * Magic.py (magic_timeit): Added %timeit magic, contributed by
541 * Magic.py (magic_timeit): Added %timeit magic, contributed by
531 Torsten Marek.
542 Torsten Marek.
532
543
533 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
544 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
534
545
535 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
546 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
536 line ranges works again.
547 line ranges works again.
537
548
538 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
549 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
539
550
540 * IPython/iplib.py (showtraceback): add back sys.last_traceback
551 * IPython/iplib.py (showtraceback): add back sys.last_traceback
541 and friends, after a discussion with Zach Pincus on ipython-user.
552 and friends, after a discussion with Zach Pincus on ipython-user.
542 I'm not 100% sure, but after thinking about it quite a bit, it may
553 I'm not 100% sure, but after thinking about it quite a bit, it may
543 be OK. Testing with the multithreaded shells didn't reveal any
554 be OK. Testing with the multithreaded shells didn't reveal any
544 problems, but let's keep an eye out.
555 problems, but let's keep an eye out.
545
556
546 In the process, I fixed a few things which were calling
557 In the process, I fixed a few things which were calling
547 self.InteractiveTB() directly (like safe_execfile), which is a
558 self.InteractiveTB() directly (like safe_execfile), which is a
548 mistake: ALL exception reporting should be done by calling
559 mistake: ALL exception reporting should be done by calling
549 self.showtraceback(), which handles state and tab-completion and
560 self.showtraceback(), which handles state and tab-completion and
550 more.
561 more.
551
562
552 2006-03-01 Ville Vainio <vivainio@gmail.com>
563 2006-03-01 Ville Vainio <vivainio@gmail.com>
553
564
554 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
565 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
555 To use, do "from ipipe import *".
566 To use, do "from ipipe import *".
556
567
557 2006-02-24 Ville Vainio <vivainio@gmail.com>
568 2006-02-24 Ville Vainio <vivainio@gmail.com>
558
569
559 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
570 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
560 "cleanly" and safely than the older upgrade mechanism.
571 "cleanly" and safely than the older upgrade mechanism.
561
572
562 2006-02-21 Ville Vainio <vivainio@gmail.com>
573 2006-02-21 Ville Vainio <vivainio@gmail.com>
563
574
564 * Magic.py: %save works again.
575 * Magic.py: %save works again.
565
576
566 2006-02-15 Ville Vainio <vivainio@gmail.com>
577 2006-02-15 Ville Vainio <vivainio@gmail.com>
567
578
568 * Magic.py: %Pprint works again
579 * Magic.py: %Pprint works again
569
580
570 * Extensions/ipy_sane_defaults.py: Provide everything provided
581 * Extensions/ipy_sane_defaults.py: Provide everything provided
571 in default ipythonrc, to make it possible to have a completely empty
582 in default ipythonrc, to make it possible to have a completely empty
572 ipythonrc (and thus completely rc-file free configuration)
583 ipythonrc (and thus completely rc-file free configuration)
573
584
574 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
585 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
575
586
576 * IPython/hooks.py (editor): quote the call to the editor command,
587 * IPython/hooks.py (editor): quote the call to the editor command,
577 to allow commands with spaces in them. Problem noted by watching
588 to allow commands with spaces in them. Problem noted by watching
578 Ian Oswald's video about textpad under win32 at
589 Ian Oswald's video about textpad under win32 at
579 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
590 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
580
591
581 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
592 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
582 describing magics (we haven't used @ for a loong time).
593 describing magics (we haven't used @ for a loong time).
583
594
584 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
595 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
585 contributed by marienz to close
596 contributed by marienz to close
586 http://www.scipy.net/roundup/ipython/issue53.
597 http://www.scipy.net/roundup/ipython/issue53.
587
598
588 2006-02-10 Ville Vainio <vivainio@gmail.com>
599 2006-02-10 Ville Vainio <vivainio@gmail.com>
589
600
590 * genutils.py: getoutput now works in win32 too
601 * genutils.py: getoutput now works in win32 too
591
602
592 * completer.py: alias and magic completion only invoked
603 * completer.py: alias and magic completion only invoked
593 at the first "item" in the line, to avoid "cd %store"
604 at the first "item" in the line, to avoid "cd %store"
594 nonsense.
605 nonsense.
595
606
596 2006-02-09 Ville Vainio <vivainio@gmail.com>
607 2006-02-09 Ville Vainio <vivainio@gmail.com>
597
608
598 * test/*: Added a unit testing framework (finally).
609 * test/*: Added a unit testing framework (finally).
599 '%run runtests.py' to run test_*.
610 '%run runtests.py' to run test_*.
600
611
601 * ipapi.py: Exposed runlines and set_custom_exc
612 * ipapi.py: Exposed runlines and set_custom_exc
602
613
603 2006-02-07 Ville Vainio <vivainio@gmail.com>
614 2006-02-07 Ville Vainio <vivainio@gmail.com>
604
615
605 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
616 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
606 instead use "f(1 2)" as before.
617 instead use "f(1 2)" as before.
607
618
608 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
619 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
609
620
610 * IPython/demo.py (IPythonDemo): Add new classes to the demo
621 * IPython/demo.py (IPythonDemo): Add new classes to the demo
611 facilities, for demos processed by the IPython input filter
622 facilities, for demos processed by the IPython input filter
612 (IPythonDemo), and for running a script one-line-at-a-time as a
623 (IPythonDemo), and for running a script one-line-at-a-time as a
613 demo, both for pure Python (LineDemo) and for IPython-processed
624 demo, both for pure Python (LineDemo) and for IPython-processed
614 input (IPythonLineDemo). After a request by Dave Kohel, from the
625 input (IPythonLineDemo). After a request by Dave Kohel, from the
615 SAGE team.
626 SAGE team.
616 (Demo.edit): added an edit() method to the demo objects, to edit
627 (Demo.edit): added an edit() method to the demo objects, to edit
617 the in-memory copy of the last executed block.
628 the in-memory copy of the last executed block.
618
629
619 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
630 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
620 processing to %edit, %macro and %save. These commands can now be
631 processing to %edit, %macro and %save. These commands can now be
621 invoked on the unprocessed input as it was typed by the user
632 invoked on the unprocessed input as it was typed by the user
622 (without any prefilters applied). After requests by the SAGE team
633 (without any prefilters applied). After requests by the SAGE team
623 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
634 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
624
635
625 2006-02-01 Ville Vainio <vivainio@gmail.com>
636 2006-02-01 Ville Vainio <vivainio@gmail.com>
626
637
627 * setup.py, eggsetup.py: easy_install ipython==dev works
638 * setup.py, eggsetup.py: easy_install ipython==dev works
628 correctly now (on Linux)
639 correctly now (on Linux)
629
640
630 * ipy_user_conf,ipmaker: user config changes, removed spurious
641 * ipy_user_conf,ipmaker: user config changes, removed spurious
631 warnings
642 warnings
632
643
633 * iplib: if rc.banner is string, use it as is.
644 * iplib: if rc.banner is string, use it as is.
634
645
635 * Magic: %pycat accepts a string argument and pages it's contents.
646 * Magic: %pycat accepts a string argument and pages it's contents.
636
647
637
648
638 2006-01-30 Ville Vainio <vivainio@gmail.com>
649 2006-01-30 Ville Vainio <vivainio@gmail.com>
639
650
640 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
651 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
641 Now %store and bookmarks work through PickleShare, meaning that
652 Now %store and bookmarks work through PickleShare, meaning that
642 concurrent access is possible and all ipython sessions see the
653 concurrent access is possible and all ipython sessions see the
643 same database situation all the time, instead of snapshot of
654 same database situation all the time, instead of snapshot of
644 the situation when the session was started. Hence, %bookmark
655 the situation when the session was started. Hence, %bookmark
645 results are immediately accessible from othes sessions. The database
656 results are immediately accessible from othes sessions. The database
646 is also available for use by user extensions. See:
657 is also available for use by user extensions. See:
647 http://www.python.org/pypi/pickleshare
658 http://www.python.org/pypi/pickleshare
648
659
649 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
660 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
650
661
651 * aliases can now be %store'd
662 * aliases can now be %store'd
652
663
653 * path.py moved to Extensions so that pickleshare does not need
664 * path.py moved to Extensions so that pickleshare does not need
654 IPython-specific import. Extensions added to pythonpath right
665 IPython-specific import. Extensions added to pythonpath right
655 at __init__.
666 at __init__.
656
667
657 * iplib.py: ipalias deprecated/redundant; aliases are converted and
668 * iplib.py: ipalias deprecated/redundant; aliases are converted and
658 called with _ip.system and the pre-transformed command string.
669 called with _ip.system and the pre-transformed command string.
659
670
660 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
671 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
661
672
662 * IPython/iplib.py (interact): Fix that we were not catching
673 * IPython/iplib.py (interact): Fix that we were not catching
663 KeyboardInterrupt exceptions properly. I'm not quite sure why the
674 KeyboardInterrupt exceptions properly. I'm not quite sure why the
664 logic here had to change, but it's fixed now.
675 logic here had to change, but it's fixed now.
665
676
666 2006-01-29 Ville Vainio <vivainio@gmail.com>
677 2006-01-29 Ville Vainio <vivainio@gmail.com>
667
678
668 * iplib.py: Try to import pyreadline on Windows.
679 * iplib.py: Try to import pyreadline on Windows.
669
680
670 2006-01-27 Ville Vainio <vivainio@gmail.com>
681 2006-01-27 Ville Vainio <vivainio@gmail.com>
671
682
672 * iplib.py: Expose ipapi as _ip in builtin namespace.
683 * iplib.py: Expose ipapi as _ip in builtin namespace.
673 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
684 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
674 and ip_set_hook (-> _ip.set_hook) redundant. % and !
685 and ip_set_hook (-> _ip.set_hook) redundant. % and !
675 syntax now produce _ip.* variant of the commands.
686 syntax now produce _ip.* variant of the commands.
676
687
677 * "_ip.options().autoedit_syntax = 2" automatically throws
688 * "_ip.options().autoedit_syntax = 2" automatically throws
678 user to editor for syntax error correction without prompting.
689 user to editor for syntax error correction without prompting.
679
690
680 2006-01-27 Ville Vainio <vivainio@gmail.com>
691 2006-01-27 Ville Vainio <vivainio@gmail.com>
681
692
682 * ipmaker.py: Give "realistic" sys.argv for scripts (without
693 * ipmaker.py: Give "realistic" sys.argv for scripts (without
683 'ipython' at argv[0]) executed through command line.
694 'ipython' at argv[0]) executed through command line.
684 NOTE: this DEPRECATES calling ipython with multiple scripts
695 NOTE: this DEPRECATES calling ipython with multiple scripts
685 ("ipython a.py b.py c.py")
696 ("ipython a.py b.py c.py")
686
697
687 * iplib.py, hooks.py: Added configurable input prefilter,
698 * iplib.py, hooks.py: Added configurable input prefilter,
688 named 'input_prefilter'. See ext_rescapture.py for example
699 named 'input_prefilter'. See ext_rescapture.py for example
689 usage.
700 usage.
690
701
691 * ext_rescapture.py, Magic.py: Better system command output capture
702 * ext_rescapture.py, Magic.py: Better system command output capture
692 through 'var = !ls' (deprecates user-visible %sc). Same notation
703 through 'var = !ls' (deprecates user-visible %sc). Same notation
693 applies for magics, 'var = %alias' assigns alias list to var.
704 applies for magics, 'var = %alias' assigns alias list to var.
694
705
695 * ipapi.py: added meta() for accessing extension-usable data store.
706 * ipapi.py: added meta() for accessing extension-usable data store.
696
707
697 * iplib.py: added InteractiveShell.getapi(). New magics should be
708 * iplib.py: added InteractiveShell.getapi(). New magics should be
698 written doing self.getapi() instead of using the shell directly.
709 written doing self.getapi() instead of using the shell directly.
699
710
700 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
711 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
701 %store foo >> ~/myfoo.txt to store variables to files (in clean
712 %store foo >> ~/myfoo.txt to store variables to files (in clean
702 textual form, not a restorable pickle).
713 textual form, not a restorable pickle).
703
714
704 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
715 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
705
716
706 * usage.py, Magic.py: added %quickref
717 * usage.py, Magic.py: added %quickref
707
718
708 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
719 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
709
720
710 * GetoptErrors when invoking magics etc. with wrong args
721 * GetoptErrors when invoking magics etc. with wrong args
711 are now more helpful:
722 are now more helpful:
712 GetoptError: option -l not recognized (allowed: "qb" )
723 GetoptError: option -l not recognized (allowed: "qb" )
713
724
714 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
725 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
715
726
716 * IPython/demo.py (Demo.show): Flush stdout after each block, so
727 * IPython/demo.py (Demo.show): Flush stdout after each block, so
717 computationally intensive blocks don't appear to stall the demo.
728 computationally intensive blocks don't appear to stall the demo.
718
729
719 2006-01-24 Ville Vainio <vivainio@gmail.com>
730 2006-01-24 Ville Vainio <vivainio@gmail.com>
720
731
721 * iplib.py, hooks.py: 'result_display' hook can return a non-None
732 * iplib.py, hooks.py: 'result_display' hook can return a non-None
722 value to manipulate resulting history entry.
733 value to manipulate resulting history entry.
723
734
724 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
735 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
725 to instance methods of IPApi class, to make extending an embedded
736 to instance methods of IPApi class, to make extending an embedded
726 IPython feasible. See ext_rehashdir.py for example usage.
737 IPython feasible. See ext_rehashdir.py for example usage.
727
738
728 * Merged 1071-1076 from branches/0.7.1
739 * Merged 1071-1076 from branches/0.7.1
729
740
730
741
731 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
742 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
732
743
733 * tools/release (daystamp): Fix build tools to use the new
744 * tools/release (daystamp): Fix build tools to use the new
734 eggsetup.py script to build lightweight eggs.
745 eggsetup.py script to build lightweight eggs.
735
746
736 * Applied changesets 1062 and 1064 before 0.7.1 release.
747 * Applied changesets 1062 and 1064 before 0.7.1 release.
737
748
738 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
749 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
739 see the raw input history (without conversions like %ls ->
750 see the raw input history (without conversions like %ls ->
740 ipmagic("ls")). After a request from W. Stein, SAGE
751 ipmagic("ls")). After a request from W. Stein, SAGE
741 (http://modular.ucsd.edu/sage) developer. This information is
752 (http://modular.ucsd.edu/sage) developer. This information is
742 stored in the input_hist_raw attribute of the IPython instance, so
753 stored in the input_hist_raw attribute of the IPython instance, so
743 developers can access it if needed (it's an InputList instance).
754 developers can access it if needed (it's an InputList instance).
744
755
745 * Versionstring = 0.7.2.svn
756 * Versionstring = 0.7.2.svn
746
757
747 * eggsetup.py: A separate script for constructing eggs, creates
758 * eggsetup.py: A separate script for constructing eggs, creates
748 proper launch scripts even on Windows (an .exe file in
759 proper launch scripts even on Windows (an .exe file in
749 \python24\scripts).
760 \python24\scripts).
750
761
751 * ipapi.py: launch_new_instance, launch entry point needed for the
762 * ipapi.py: launch_new_instance, launch entry point needed for the
752 egg.
763 egg.
753
764
754 2006-01-23 Ville Vainio <vivainio@gmail.com>
765 2006-01-23 Ville Vainio <vivainio@gmail.com>
755
766
756 * Added %cpaste magic for pasting python code
767 * Added %cpaste magic for pasting python code
757
768
758 2006-01-22 Ville Vainio <vivainio@gmail.com>
769 2006-01-22 Ville Vainio <vivainio@gmail.com>
759
770
760 * Merge from branches/0.7.1 into trunk, revs 1052-1057
771 * Merge from branches/0.7.1 into trunk, revs 1052-1057
761
772
762 * Versionstring = 0.7.2.svn
773 * Versionstring = 0.7.2.svn
763
774
764 * eggsetup.py: A separate script for constructing eggs, creates
775 * eggsetup.py: A separate script for constructing eggs, creates
765 proper launch scripts even on Windows (an .exe file in
776 proper launch scripts even on Windows (an .exe file in
766 \python24\scripts).
777 \python24\scripts).
767
778
768 * ipapi.py: launch_new_instance, launch entry point needed for the
779 * ipapi.py: launch_new_instance, launch entry point needed for the
769 egg.
780 egg.
770
781
771 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
782 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
772
783
773 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
784 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
774 %pfile foo would print the file for foo even if it was a binary.
785 %pfile foo would print the file for foo even if it was a binary.
775 Now, extensions '.so' and '.dll' are skipped.
786 Now, extensions '.so' and '.dll' are skipped.
776
787
777 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
788 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
778 bug, where macros would fail in all threaded modes. I'm not 100%
789 bug, where macros would fail in all threaded modes. I'm not 100%
779 sure, so I'm going to put out an rc instead of making a release
790 sure, so I'm going to put out an rc instead of making a release
780 today, and wait for feedback for at least a few days.
791 today, and wait for feedback for at least a few days.
781
792
782 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
793 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
783 it...) the handling of pasting external code with autoindent on.
794 it...) the handling of pasting external code with autoindent on.
784 To get out of a multiline input, the rule will appear for most
795 To get out of a multiline input, the rule will appear for most
785 users unchanged: two blank lines or change the indent level
796 users unchanged: two blank lines or change the indent level
786 proposed by IPython. But there is a twist now: you can
797 proposed by IPython. But there is a twist now: you can
787 add/subtract only *one or two spaces*. If you add/subtract three
798 add/subtract only *one or two spaces*. If you add/subtract three
788 or more (unless you completely delete the line), IPython will
799 or more (unless you completely delete the line), IPython will
789 accept that line, and you'll need to enter a second one of pure
800 accept that line, and you'll need to enter a second one of pure
790 whitespace. I know it sounds complicated, but I can't find a
801 whitespace. I know it sounds complicated, but I can't find a
791 different solution that covers all the cases, with the right
802 different solution that covers all the cases, with the right
792 heuristics. Hopefully in actual use, nobody will really notice
803 heuristics. Hopefully in actual use, nobody will really notice
793 all these strange rules and things will 'just work'.
804 all these strange rules and things will 'just work'.
794
805
795 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
806 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
796
807
797 * IPython/iplib.py (interact): catch exceptions which can be
808 * IPython/iplib.py (interact): catch exceptions which can be
798 triggered asynchronously by signal handlers. Thanks to an
809 triggered asynchronously by signal handlers. Thanks to an
799 automatic crash report, submitted by Colin Kingsley
810 automatic crash report, submitted by Colin Kingsley
800 <tercel-AT-gentoo.org>.
811 <tercel-AT-gentoo.org>.
801
812
802 2006-01-20 Ville Vainio <vivainio@gmail.com>
813 2006-01-20 Ville Vainio <vivainio@gmail.com>
803
814
804 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
815 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
805 (%rehashdir, very useful, try it out) of how to extend ipython
816 (%rehashdir, very useful, try it out) of how to extend ipython
806 with new magics. Also added Extensions dir to pythonpath to make
817 with new magics. Also added Extensions dir to pythonpath to make
807 importing extensions easy.
818 importing extensions easy.
808
819
809 * %store now complains when trying to store interactively declared
820 * %store now complains when trying to store interactively declared
810 classes / instances of those classes.
821 classes / instances of those classes.
811
822
812 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
823 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
813 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
824 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
814 if they exist, and ipy_user_conf.py with some defaults is created for
825 if they exist, and ipy_user_conf.py with some defaults is created for
815 the user.
826 the user.
816
827
817 * Startup rehashing done by the config file, not InterpreterExec.
828 * Startup rehashing done by the config file, not InterpreterExec.
818 This means system commands are available even without selecting the
829 This means system commands are available even without selecting the
819 pysh profile. It's the sensible default after all.
830 pysh profile. It's the sensible default after all.
820
831
821 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
832 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
822
833
823 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
834 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
824 multiline code with autoindent on working. But I am really not
835 multiline code with autoindent on working. But I am really not
825 sure, so this needs more testing. Will commit a debug-enabled
836 sure, so this needs more testing. Will commit a debug-enabled
826 version for now, while I test it some more, so that Ville and
837 version for now, while I test it some more, so that Ville and
827 others may also catch any problems. Also made
838 others may also catch any problems. Also made
828 self.indent_current_str() a method, to ensure that there's no
839 self.indent_current_str() a method, to ensure that there's no
829 chance of the indent space count and the corresponding string
840 chance of the indent space count and the corresponding string
830 falling out of sync. All code needing the string should just call
841 falling out of sync. All code needing the string should just call
831 the method.
842 the method.
832
843
833 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
844 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
834
845
835 * IPython/Magic.py (magic_edit): fix check for when users don't
846 * IPython/Magic.py (magic_edit): fix check for when users don't
836 save their output files, the try/except was in the wrong section.
847 save their output files, the try/except was in the wrong section.
837
848
838 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
849 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
839
850
840 * IPython/Magic.py (magic_run): fix __file__ global missing from
851 * IPython/Magic.py (magic_run): fix __file__ global missing from
841 script's namespace when executed via %run. After a report by
852 script's namespace when executed via %run. After a report by
842 Vivian.
853 Vivian.
843
854
844 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
855 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
845 when using python 2.4. The parent constructor changed in 2.4, and
856 when using python 2.4. The parent constructor changed in 2.4, and
846 we need to track it directly (we can't call it, as it messes up
857 we need to track it directly (we can't call it, as it messes up
847 readline and tab-completion inside our pdb would stop working).
858 readline and tab-completion inside our pdb would stop working).
848 After a bug report by R. Bernstein <rocky-AT-panix.com>.
859 After a bug report by R. Bernstein <rocky-AT-panix.com>.
849
860
850 2006-01-16 Ville Vainio <vivainio@gmail.com>
861 2006-01-16 Ville Vainio <vivainio@gmail.com>
851
862
852 * Ipython/magic.py: Reverted back to old %edit functionality
863 * Ipython/magic.py: Reverted back to old %edit functionality
853 that returns file contents on exit.
864 that returns file contents on exit.
854
865
855 * IPython/path.py: Added Jason Orendorff's "path" module to
866 * IPython/path.py: Added Jason Orendorff's "path" module to
856 IPython tree, http://www.jorendorff.com/articles/python/path/.
867 IPython tree, http://www.jorendorff.com/articles/python/path/.
857 You can get path objects conveniently through %sc, and !!, e.g.:
868 You can get path objects conveniently through %sc, and !!, e.g.:
858 sc files=ls
869 sc files=ls
859 for p in files.paths: # or files.p
870 for p in files.paths: # or files.p
860 print p,p.mtime
871 print p,p.mtime
861
872
862 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
873 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
863 now work again without considering the exclusion regexp -
874 now work again without considering the exclusion regexp -
864 hence, things like ',foo my/path' turn to 'foo("my/path")'
875 hence, things like ',foo my/path' turn to 'foo("my/path")'
865 instead of syntax error.
876 instead of syntax error.
866
877
867
878
868 2006-01-14 Ville Vainio <vivainio@gmail.com>
879 2006-01-14 Ville Vainio <vivainio@gmail.com>
869
880
870 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
881 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
871 ipapi decorators for python 2.4 users, options() provides access to rc
882 ipapi decorators for python 2.4 users, options() provides access to rc
872 data.
883 data.
873
884
874 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
885 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
875 as path separators (even on Linux ;-). Space character after
886 as path separators (even on Linux ;-). Space character after
876 backslash (as yielded by tab completer) is still space;
887 backslash (as yielded by tab completer) is still space;
877 "%cd long\ name" works as expected.
888 "%cd long\ name" works as expected.
878
889
879 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
890 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
880 as "chain of command", with priority. API stays the same,
891 as "chain of command", with priority. API stays the same,
881 TryNext exception raised by a hook function signals that
892 TryNext exception raised by a hook function signals that
882 current hook failed and next hook should try handling it, as
893 current hook failed and next hook should try handling it, as
883 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
894 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
884 requested configurable display hook, which is now implemented.
895 requested configurable display hook, which is now implemented.
885
896
886 2006-01-13 Ville Vainio <vivainio@gmail.com>
897 2006-01-13 Ville Vainio <vivainio@gmail.com>
887
898
888 * IPython/platutils*.py: platform specific utility functions,
899 * IPython/platutils*.py: platform specific utility functions,
889 so far only set_term_title is implemented (change terminal
900 so far only set_term_title is implemented (change terminal
890 label in windowing systems). %cd now changes the title to
901 label in windowing systems). %cd now changes the title to
891 current dir.
902 current dir.
892
903
893 * IPython/Release.py: Added myself to "authors" list,
904 * IPython/Release.py: Added myself to "authors" list,
894 had to create new files.
905 had to create new files.
895
906
896 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
907 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
897 shell escape; not a known bug but had potential to be one in the
908 shell escape; not a known bug but had potential to be one in the
898 future.
909 future.
899
910
900 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
911 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
901 extension API for IPython! See the module for usage example. Fix
912 extension API for IPython! See the module for usage example. Fix
902 OInspect for docstring-less magic functions.
913 OInspect for docstring-less magic functions.
903
914
904
915
905 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
916 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
906
917
907 * IPython/iplib.py (raw_input): temporarily deactivate all
918 * IPython/iplib.py (raw_input): temporarily deactivate all
908 attempts at allowing pasting of code with autoindent on. It
919 attempts at allowing pasting of code with autoindent on. It
909 introduced bugs (reported by Prabhu) and I can't seem to find a
920 introduced bugs (reported by Prabhu) and I can't seem to find a
910 robust combination which works in all cases. Will have to revisit
921 robust combination which works in all cases. Will have to revisit
911 later.
922 later.
912
923
913 * IPython/genutils.py: remove isspace() function. We've dropped
924 * IPython/genutils.py: remove isspace() function. We've dropped
914 2.2 compatibility, so it's OK to use the string method.
925 2.2 compatibility, so it's OK to use the string method.
915
926
916 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
927 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
917
928
918 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
929 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
919 matching what NOT to autocall on, to include all python binary
930 matching what NOT to autocall on, to include all python binary
920 operators (including things like 'and', 'or', 'is' and 'in').
931 operators (including things like 'and', 'or', 'is' and 'in').
921 Prompted by a bug report on 'foo & bar', but I realized we had
932 Prompted by a bug report on 'foo & bar', but I realized we had
922 many more potential bug cases with other operators. The regexp is
933 many more potential bug cases with other operators. The regexp is
923 self.re_exclude_auto, it's fairly commented.
934 self.re_exclude_auto, it's fairly commented.
924
935
925 2006-01-12 Ville Vainio <vivainio@gmail.com>
936 2006-01-12 Ville Vainio <vivainio@gmail.com>
926
937
927 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
938 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
928 Prettified and hardened string/backslash quoting with ipsystem(),
939 Prettified and hardened string/backslash quoting with ipsystem(),
929 ipalias() and ipmagic(). Now even \ characters are passed to
940 ipalias() and ipmagic(). Now even \ characters are passed to
930 %magics, !shell escapes and aliases exactly as they are in the
941 %magics, !shell escapes and aliases exactly as they are in the
931 ipython command line. Should improve backslash experience,
942 ipython command line. Should improve backslash experience,
932 particularly in Windows (path delimiter for some commands that
943 particularly in Windows (path delimiter for some commands that
933 won't understand '/'), but Unix benefits as well (regexps). %cd
944 won't understand '/'), but Unix benefits as well (regexps). %cd
934 magic still doesn't support backslash path delimiters, though. Also
945 magic still doesn't support backslash path delimiters, though. Also
935 deleted all pretense of supporting multiline command strings in
946 deleted all pretense of supporting multiline command strings in
936 !system or %magic commands. Thanks to Jerry McRae for suggestions.
947 !system or %magic commands. Thanks to Jerry McRae for suggestions.
937
948
938 * doc/build_doc_instructions.txt added. Documentation on how to
949 * doc/build_doc_instructions.txt added. Documentation on how to
939 use doc/update_manual.py, added yesterday. Both files contributed
950 use doc/update_manual.py, added yesterday. Both files contributed
940 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
951 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
941 doc/*.sh for deprecation at a later date.
952 doc/*.sh for deprecation at a later date.
942
953
943 * /ipython.py Added ipython.py to root directory for
954 * /ipython.py Added ipython.py to root directory for
944 zero-installation (tar xzvf ipython.tgz; cd ipython; python
955 zero-installation (tar xzvf ipython.tgz; cd ipython; python
945 ipython.py) and development convenience (no need to keep doing
956 ipython.py) and development convenience (no need to keep doing
946 "setup.py install" between changes).
957 "setup.py install" between changes).
947
958
948 * Made ! and !! shell escapes work (again) in multiline expressions:
959 * Made ! and !! shell escapes work (again) in multiline expressions:
949 if 1:
960 if 1:
950 !ls
961 !ls
951 !!ls
962 !!ls
952
963
953 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
964 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
954
965
955 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
966 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
956 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
967 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
957 module in case-insensitive installation. Was causing crashes
968 module in case-insensitive installation. Was causing crashes
958 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
969 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
959
970
960 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
971 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
961 <marienz-AT-gentoo.org>, closes
972 <marienz-AT-gentoo.org>, closes
962 http://www.scipy.net/roundup/ipython/issue51.
973 http://www.scipy.net/roundup/ipython/issue51.
963
974
964 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
975 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
965
976
966 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
977 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
967 problem of excessive CPU usage under *nix and keyboard lag under
978 problem of excessive CPU usage under *nix and keyboard lag under
968 win32.
979 win32.
969
980
970 2006-01-10 *** Released version 0.7.0
981 2006-01-10 *** Released version 0.7.0
971
982
972 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
983 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
973
984
974 * IPython/Release.py (revision): tag version number to 0.7.0,
985 * IPython/Release.py (revision): tag version number to 0.7.0,
975 ready for release.
986 ready for release.
976
987
977 * IPython/Magic.py (magic_edit): Add print statement to %edit so
988 * IPython/Magic.py (magic_edit): Add print statement to %edit so
978 it informs the user of the name of the temp. file used. This can
989 it informs the user of the name of the temp. file used. This can
979 help if you decide later to reuse that same file, so you know
990 help if you decide later to reuse that same file, so you know
980 where to copy the info from.
991 where to copy the info from.
981
992
982 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
993 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
983
994
984 * setup_bdist_egg.py: little script to build an egg. Added
995 * setup_bdist_egg.py: little script to build an egg. Added
985 support in the release tools as well.
996 support in the release tools as well.
986
997
987 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
998 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
988
999
989 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1000 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
990 version selection (new -wxversion command line and ipythonrc
1001 version selection (new -wxversion command line and ipythonrc
991 parameter). Patch contributed by Arnd Baecker
1002 parameter). Patch contributed by Arnd Baecker
992 <arnd.baecker-AT-web.de>.
1003 <arnd.baecker-AT-web.de>.
993
1004
994 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1005 * IPython/iplib.py (embed_mainloop): fix tab-completion in
995 embedded instances, for variables defined at the interactive
1006 embedded instances, for variables defined at the interactive
996 prompt of the embedded ipython. Reported by Arnd.
1007 prompt of the embedded ipython. Reported by Arnd.
997
1008
998 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1009 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
999 it can be used as a (stateful) toggle, or with a direct parameter.
1010 it can be used as a (stateful) toggle, or with a direct parameter.
1000
1011
1001 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1012 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1002 could be triggered in certain cases and cause the traceback
1013 could be triggered in certain cases and cause the traceback
1003 printer not to work.
1014 printer not to work.
1004
1015
1005 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1016 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1006
1017
1007 * IPython/iplib.py (_should_recompile): Small fix, closes
1018 * IPython/iplib.py (_should_recompile): Small fix, closes
1008 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1019 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1009
1020
1010 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1021 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1011
1022
1012 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1023 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1013 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1024 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1014 Moad for help with tracking it down.
1025 Moad for help with tracking it down.
1015
1026
1016 * IPython/iplib.py (handle_auto): fix autocall handling for
1027 * IPython/iplib.py (handle_auto): fix autocall handling for
1017 objects which support BOTH __getitem__ and __call__ (so that f [x]
1028 objects which support BOTH __getitem__ and __call__ (so that f [x]
1018 is left alone, instead of becoming f([x]) automatically).
1029 is left alone, instead of becoming f([x]) automatically).
1019
1030
1020 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1031 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1021 Ville's patch.
1032 Ville's patch.
1022
1033
1023 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1034 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1024
1035
1025 * IPython/iplib.py (handle_auto): changed autocall semantics to
1036 * IPython/iplib.py (handle_auto): changed autocall semantics to
1026 include 'smart' mode, where the autocall transformation is NOT
1037 include 'smart' mode, where the autocall transformation is NOT
1027 applied if there are no arguments on the line. This allows you to
1038 applied if there are no arguments on the line. This allows you to
1028 just type 'foo' if foo is a callable to see its internal form,
1039 just type 'foo' if foo is a callable to see its internal form,
1029 instead of having it called with no arguments (typically a
1040 instead of having it called with no arguments (typically a
1030 mistake). The old 'full' autocall still exists: for that, you
1041 mistake). The old 'full' autocall still exists: for that, you
1031 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1042 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1032
1043
1033 * IPython/completer.py (Completer.attr_matches): add
1044 * IPython/completer.py (Completer.attr_matches): add
1034 tab-completion support for Enthoughts' traits. After a report by
1045 tab-completion support for Enthoughts' traits. After a report by
1035 Arnd and a patch by Prabhu.
1046 Arnd and a patch by Prabhu.
1036
1047
1037 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1048 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1038
1049
1039 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1050 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1040 Schmolck's patch to fix inspect.getinnerframes().
1051 Schmolck's patch to fix inspect.getinnerframes().
1041
1052
1042 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1053 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1043 for embedded instances, regarding handling of namespaces and items
1054 for embedded instances, regarding handling of namespaces and items
1044 added to the __builtin__ one. Multiple embedded instances and
1055 added to the __builtin__ one. Multiple embedded instances and
1045 recursive embeddings should work better now (though I'm not sure
1056 recursive embeddings should work better now (though I'm not sure
1046 I've got all the corner cases fixed, that code is a bit of a brain
1057 I've got all the corner cases fixed, that code is a bit of a brain
1047 twister).
1058 twister).
1048
1059
1049 * IPython/Magic.py (magic_edit): added support to edit in-memory
1060 * IPython/Magic.py (magic_edit): added support to edit in-memory
1050 macros (automatically creates the necessary temp files). %edit
1061 macros (automatically creates the necessary temp files). %edit
1051 also doesn't return the file contents anymore, it's just noise.
1062 also doesn't return the file contents anymore, it's just noise.
1052
1063
1053 * IPython/completer.py (Completer.attr_matches): revert change to
1064 * IPython/completer.py (Completer.attr_matches): revert change to
1054 complete only on attributes listed in __all__. I realized it
1065 complete only on attributes listed in __all__. I realized it
1055 cripples the tab-completion system as a tool for exploring the
1066 cripples the tab-completion system as a tool for exploring the
1056 internals of unknown libraries (it renders any non-__all__
1067 internals of unknown libraries (it renders any non-__all__
1057 attribute off-limits). I got bit by this when trying to see
1068 attribute off-limits). I got bit by this when trying to see
1058 something inside the dis module.
1069 something inside the dis module.
1059
1070
1060 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1071 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1061
1072
1062 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1073 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1063 namespace for users and extension writers to hold data in. This
1074 namespace for users and extension writers to hold data in. This
1064 follows the discussion in
1075 follows the discussion in
1065 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1076 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1066
1077
1067 * IPython/completer.py (IPCompleter.complete): small patch to help
1078 * IPython/completer.py (IPCompleter.complete): small patch to help
1068 tab-completion under Emacs, after a suggestion by John Barnard
1079 tab-completion under Emacs, after a suggestion by John Barnard
1069 <barnarj-AT-ccf.org>.
1080 <barnarj-AT-ccf.org>.
1070
1081
1071 * IPython/Magic.py (Magic.extract_input_slices): added support for
1082 * IPython/Magic.py (Magic.extract_input_slices): added support for
1072 the slice notation in magics to use N-M to represent numbers N...M
1083 the slice notation in magics to use N-M to represent numbers N...M
1073 (closed endpoints). This is used by %macro and %save.
1084 (closed endpoints). This is used by %macro and %save.
1074
1085
1075 * IPython/completer.py (Completer.attr_matches): for modules which
1086 * IPython/completer.py (Completer.attr_matches): for modules which
1076 define __all__, complete only on those. After a patch by Jeffrey
1087 define __all__, complete only on those. After a patch by Jeffrey
1077 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1088 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1078 speed up this routine.
1089 speed up this routine.
1079
1090
1080 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1091 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1081 don't know if this is the end of it, but the behavior now is
1092 don't know if this is the end of it, but the behavior now is
1082 certainly much more correct. Note that coupled with macros,
1093 certainly much more correct. Note that coupled with macros,
1083 slightly surprising (at first) behavior may occur: a macro will in
1094 slightly surprising (at first) behavior may occur: a macro will in
1084 general expand to multiple lines of input, so upon exiting, the
1095 general expand to multiple lines of input, so upon exiting, the
1085 in/out counters will both be bumped by the corresponding amount
1096 in/out counters will both be bumped by the corresponding amount
1086 (as if the macro's contents had been typed interactively). Typing
1097 (as if the macro's contents had been typed interactively). Typing
1087 %hist will reveal the intermediate (silently processed) lines.
1098 %hist will reveal the intermediate (silently processed) lines.
1088
1099
1089 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1100 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1090 pickle to fail (%run was overwriting __main__ and not restoring
1101 pickle to fail (%run was overwriting __main__ and not restoring
1091 it, but pickle relies on __main__ to operate).
1102 it, but pickle relies on __main__ to operate).
1092
1103
1093 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1104 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1094 using properties, but forgot to make the main InteractiveShell
1105 using properties, but forgot to make the main InteractiveShell
1095 class a new-style class. Properties fail silently, and
1106 class a new-style class. Properties fail silently, and
1096 mysteriously, with old-style class (getters work, but
1107 mysteriously, with old-style class (getters work, but
1097 setters don't do anything).
1108 setters don't do anything).
1098
1109
1099 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1110 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1100
1111
1101 * IPython/Magic.py (magic_history): fix history reporting bug (I
1112 * IPython/Magic.py (magic_history): fix history reporting bug (I
1102 know some nasties are still there, I just can't seem to find a
1113 know some nasties are still there, I just can't seem to find a
1103 reproducible test case to track them down; the input history is
1114 reproducible test case to track them down; the input history is
1104 falling out of sync...)
1115 falling out of sync...)
1105
1116
1106 * IPython/iplib.py (handle_shell_escape): fix bug where both
1117 * IPython/iplib.py (handle_shell_escape): fix bug where both
1107 aliases and system accesses where broken for indented code (such
1118 aliases and system accesses where broken for indented code (such
1108 as loops).
1119 as loops).
1109
1120
1110 * IPython/genutils.py (shell): fix small but critical bug for
1121 * IPython/genutils.py (shell): fix small but critical bug for
1111 win32 system access.
1122 win32 system access.
1112
1123
1113 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1124 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1114
1125
1115 * IPython/iplib.py (showtraceback): remove use of the
1126 * IPython/iplib.py (showtraceback): remove use of the
1116 sys.last_{type/value/traceback} structures, which are non
1127 sys.last_{type/value/traceback} structures, which are non
1117 thread-safe.
1128 thread-safe.
1118 (_prefilter): change control flow to ensure that we NEVER
1129 (_prefilter): change control flow to ensure that we NEVER
1119 introspect objects when autocall is off. This will guarantee that
1130 introspect objects when autocall is off. This will guarantee that
1120 having an input line of the form 'x.y', where access to attribute
1131 having an input line of the form 'x.y', where access to attribute
1121 'y' has side effects, doesn't trigger the side effect TWICE. It
1132 'y' has side effects, doesn't trigger the side effect TWICE. It
1122 is important to note that, with autocall on, these side effects
1133 is important to note that, with autocall on, these side effects
1123 can still happen.
1134 can still happen.
1124 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1135 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1125 trio. IPython offers these three kinds of special calls which are
1136 trio. IPython offers these three kinds of special calls which are
1126 not python code, and it's a good thing to have their call method
1137 not python code, and it's a good thing to have their call method
1127 be accessible as pure python functions (not just special syntax at
1138 be accessible as pure python functions (not just special syntax at
1128 the command line). It gives us a better internal implementation
1139 the command line). It gives us a better internal implementation
1129 structure, as well as exposing these for user scripting more
1140 structure, as well as exposing these for user scripting more
1130 cleanly.
1141 cleanly.
1131
1142
1132 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1143 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1133 file. Now that they'll be more likely to be used with the
1144 file. Now that they'll be more likely to be used with the
1134 persistance system (%store), I want to make sure their module path
1145 persistance system (%store), I want to make sure their module path
1135 doesn't change in the future, so that we don't break things for
1146 doesn't change in the future, so that we don't break things for
1136 users' persisted data.
1147 users' persisted data.
1137
1148
1138 * IPython/iplib.py (autoindent_update): move indentation
1149 * IPython/iplib.py (autoindent_update): move indentation
1139 management into the _text_ processing loop, not the keyboard
1150 management into the _text_ processing loop, not the keyboard
1140 interactive one. This is necessary to correctly process non-typed
1151 interactive one. This is necessary to correctly process non-typed
1141 multiline input (such as macros).
1152 multiline input (such as macros).
1142
1153
1143 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1154 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1144 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1155 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1145 which was producing problems in the resulting manual.
1156 which was producing problems in the resulting manual.
1146 (magic_whos): improve reporting of instances (show their class,
1157 (magic_whos): improve reporting of instances (show their class,
1147 instead of simply printing 'instance' which isn't terribly
1158 instead of simply printing 'instance' which isn't terribly
1148 informative).
1159 informative).
1149
1160
1150 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1161 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1151 (minor mods) to support network shares under win32.
1162 (minor mods) to support network shares under win32.
1152
1163
1153 * IPython/winconsole.py (get_console_size): add new winconsole
1164 * IPython/winconsole.py (get_console_size): add new winconsole
1154 module and fixes to page_dumb() to improve its behavior under
1165 module and fixes to page_dumb() to improve its behavior under
1155 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1166 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1156
1167
1157 * IPython/Magic.py (Macro): simplified Macro class to just
1168 * IPython/Magic.py (Macro): simplified Macro class to just
1158 subclass list. We've had only 2.2 compatibility for a very long
1169 subclass list. We've had only 2.2 compatibility for a very long
1159 time, yet I was still avoiding subclassing the builtin types. No
1170 time, yet I was still avoiding subclassing the builtin types. No
1160 more (I'm also starting to use properties, though I won't shift to
1171 more (I'm also starting to use properties, though I won't shift to
1161 2.3-specific features quite yet).
1172 2.3-specific features quite yet).
1162 (magic_store): added Ville's patch for lightweight variable
1173 (magic_store): added Ville's patch for lightweight variable
1163 persistence, after a request on the user list by Matt Wilkie
1174 persistence, after a request on the user list by Matt Wilkie
1164 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1175 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1165 details.
1176 details.
1166
1177
1167 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1178 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1168 changed the default logfile name from 'ipython.log' to
1179 changed the default logfile name from 'ipython.log' to
1169 'ipython_log.py'. These logs are real python files, and now that
1180 'ipython_log.py'. These logs are real python files, and now that
1170 we have much better multiline support, people are more likely to
1181 we have much better multiline support, people are more likely to
1171 want to use them as such. Might as well name them correctly.
1182 want to use them as such. Might as well name them correctly.
1172
1183
1173 * IPython/Magic.py: substantial cleanup. While we can't stop
1184 * IPython/Magic.py: substantial cleanup. While we can't stop
1174 using magics as mixins, due to the existing customizations 'out
1185 using magics as mixins, due to the existing customizations 'out
1175 there' which rely on the mixin naming conventions, at least I
1186 there' which rely on the mixin naming conventions, at least I
1176 cleaned out all cross-class name usage. So once we are OK with
1187 cleaned out all cross-class name usage. So once we are OK with
1177 breaking compatibility, the two systems can be separated.
1188 breaking compatibility, the two systems can be separated.
1178
1189
1179 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1190 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1180 anymore, and the class is a fair bit less hideous as well. New
1191 anymore, and the class is a fair bit less hideous as well. New
1181 features were also introduced: timestamping of input, and logging
1192 features were also introduced: timestamping of input, and logging
1182 of output results. These are user-visible with the -t and -o
1193 of output results. These are user-visible with the -t and -o
1183 options to %logstart. Closes
1194 options to %logstart. Closes
1184 http://www.scipy.net/roundup/ipython/issue11 and a request by
1195 http://www.scipy.net/roundup/ipython/issue11 and a request by
1185 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1196 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1186
1197
1187 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1198 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1188
1199
1189 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1200 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1190 better handle backslashes in paths. See the thread 'More Windows
1201 better handle backslashes in paths. See the thread 'More Windows
1191 questions part 2 - \/ characters revisited' on the iypthon user
1202 questions part 2 - \/ characters revisited' on the iypthon user
1192 list:
1203 list:
1193 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1204 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1194
1205
1195 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1206 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1196
1207
1197 (InteractiveShell.__init__): change threaded shells to not use the
1208 (InteractiveShell.__init__): change threaded shells to not use the
1198 ipython crash handler. This was causing more problems than not,
1209 ipython crash handler. This was causing more problems than not,
1199 as exceptions in the main thread (GUI code, typically) would
1210 as exceptions in the main thread (GUI code, typically) would
1200 always show up as a 'crash', when they really weren't.
1211 always show up as a 'crash', when they really weren't.
1201
1212
1202 The colors and exception mode commands (%colors/%xmode) have been
1213 The colors and exception mode commands (%colors/%xmode) have been
1203 synchronized to also take this into account, so users can get
1214 synchronized to also take this into account, so users can get
1204 verbose exceptions for their threaded code as well. I also added
1215 verbose exceptions for their threaded code as well. I also added
1205 support for activating pdb inside this exception handler as well,
1216 support for activating pdb inside this exception handler as well,
1206 so now GUI authors can use IPython's enhanced pdb at runtime.
1217 so now GUI authors can use IPython's enhanced pdb at runtime.
1207
1218
1208 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1219 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1209 true by default, and add it to the shipped ipythonrc file. Since
1220 true by default, and add it to the shipped ipythonrc file. Since
1210 this asks the user before proceeding, I think it's OK to make it
1221 this asks the user before proceeding, I think it's OK to make it
1211 true by default.
1222 true by default.
1212
1223
1213 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1224 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1214 of the previous special-casing of input in the eval loop. I think
1225 of the previous special-casing of input in the eval loop. I think
1215 this is cleaner, as they really are commands and shouldn't have
1226 this is cleaner, as they really are commands and shouldn't have
1216 a special role in the middle of the core code.
1227 a special role in the middle of the core code.
1217
1228
1218 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1229 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1219
1230
1220 * IPython/iplib.py (edit_syntax_error): added support for
1231 * IPython/iplib.py (edit_syntax_error): added support for
1221 automatically reopening the editor if the file had a syntax error
1232 automatically reopening the editor if the file had a syntax error
1222 in it. Thanks to scottt who provided the patch at:
1233 in it. Thanks to scottt who provided the patch at:
1223 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1234 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1224 version committed).
1235 version committed).
1225
1236
1226 * IPython/iplib.py (handle_normal): add suport for multi-line
1237 * IPython/iplib.py (handle_normal): add suport for multi-line
1227 input with emtpy lines. This fixes
1238 input with emtpy lines. This fixes
1228 http://www.scipy.net/roundup/ipython/issue43 and a similar
1239 http://www.scipy.net/roundup/ipython/issue43 and a similar
1229 discussion on the user list.
1240 discussion on the user list.
1230
1241
1231 WARNING: a behavior change is necessarily introduced to support
1242 WARNING: a behavior change is necessarily introduced to support
1232 blank lines: now a single blank line with whitespace does NOT
1243 blank lines: now a single blank line with whitespace does NOT
1233 break the input loop, which means that when autoindent is on, by
1244 break the input loop, which means that when autoindent is on, by
1234 default hitting return on the next (indented) line does NOT exit.
1245 default hitting return on the next (indented) line does NOT exit.
1235
1246
1236 Instead, to exit a multiline input you can either have:
1247 Instead, to exit a multiline input you can either have:
1237
1248
1238 - TWO whitespace lines (just hit return again), or
1249 - TWO whitespace lines (just hit return again), or
1239 - a single whitespace line of a different length than provided
1250 - a single whitespace line of a different length than provided
1240 by the autoindent (add or remove a space).
1251 by the autoindent (add or remove a space).
1241
1252
1242 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1253 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1243 module to better organize all readline-related functionality.
1254 module to better organize all readline-related functionality.
1244 I've deleted FlexCompleter and put all completion clases here.
1255 I've deleted FlexCompleter and put all completion clases here.
1245
1256
1246 * IPython/iplib.py (raw_input): improve indentation management.
1257 * IPython/iplib.py (raw_input): improve indentation management.
1247 It is now possible to paste indented code with autoindent on, and
1258 It is now possible to paste indented code with autoindent on, and
1248 the code is interpreted correctly (though it still looks bad on
1259 the code is interpreted correctly (though it still looks bad on
1249 screen, due to the line-oriented nature of ipython).
1260 screen, due to the line-oriented nature of ipython).
1250 (MagicCompleter.complete): change behavior so that a TAB key on an
1261 (MagicCompleter.complete): change behavior so that a TAB key on an
1251 otherwise empty line actually inserts a tab, instead of completing
1262 otherwise empty line actually inserts a tab, instead of completing
1252 on the entire global namespace. This makes it easier to use the
1263 on the entire global namespace. This makes it easier to use the
1253 TAB key for indentation. After a request by Hans Meine
1264 TAB key for indentation. After a request by Hans Meine
1254 <hans_meine-AT-gmx.net>
1265 <hans_meine-AT-gmx.net>
1255 (_prefilter): add support so that typing plain 'exit' or 'quit'
1266 (_prefilter): add support so that typing plain 'exit' or 'quit'
1256 does a sensible thing. Originally I tried to deviate as little as
1267 does a sensible thing. Originally I tried to deviate as little as
1257 possible from the default python behavior, but even that one may
1268 possible from the default python behavior, but even that one may
1258 change in this direction (thread on python-dev to that effect).
1269 change in this direction (thread on python-dev to that effect).
1259 Regardless, ipython should do the right thing even if CPython's
1270 Regardless, ipython should do the right thing even if CPython's
1260 '>>>' prompt doesn't.
1271 '>>>' prompt doesn't.
1261 (InteractiveShell): removed subclassing code.InteractiveConsole
1272 (InteractiveShell): removed subclassing code.InteractiveConsole
1262 class. By now we'd overridden just about all of its methods: I've
1273 class. By now we'd overridden just about all of its methods: I've
1263 copied the remaining two over, and now ipython is a standalone
1274 copied the remaining two over, and now ipython is a standalone
1264 class. This will provide a clearer picture for the chainsaw
1275 class. This will provide a clearer picture for the chainsaw
1265 branch refactoring.
1276 branch refactoring.
1266
1277
1267 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1278 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1268
1279
1269 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1280 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1270 failures for objects which break when dir() is called on them.
1281 failures for objects which break when dir() is called on them.
1271
1282
1272 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1283 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1273 distinct local and global namespaces in the completer API. This
1284 distinct local and global namespaces in the completer API. This
1274 change allows us to properly handle completion with distinct
1285 change allows us to properly handle completion with distinct
1275 scopes, including in embedded instances (this had never really
1286 scopes, including in embedded instances (this had never really
1276 worked correctly).
1287 worked correctly).
1277
1288
1278 Note: this introduces a change in the constructor for
1289 Note: this introduces a change in the constructor for
1279 MagicCompleter, as a new global_namespace parameter is now the
1290 MagicCompleter, as a new global_namespace parameter is now the
1280 second argument (the others were bumped one position).
1291 second argument (the others were bumped one position).
1281
1292
1282 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1293 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1283
1294
1284 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1295 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1285 embedded instances (which can be done now thanks to Vivian's
1296 embedded instances (which can be done now thanks to Vivian's
1286 frame-handling fixes for pdb).
1297 frame-handling fixes for pdb).
1287 (InteractiveShell.__init__): Fix namespace handling problem in
1298 (InteractiveShell.__init__): Fix namespace handling problem in
1288 embedded instances. We were overwriting __main__ unconditionally,
1299 embedded instances. We were overwriting __main__ unconditionally,
1289 and this should only be done for 'full' (non-embedded) IPython;
1300 and this should only be done for 'full' (non-embedded) IPython;
1290 embedded instances must respect the caller's __main__. Thanks to
1301 embedded instances must respect the caller's __main__. Thanks to
1291 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1302 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1292
1303
1293 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1304 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1294
1305
1295 * setup.py: added download_url to setup(). This registers the
1306 * setup.py: added download_url to setup(). This registers the
1296 download address at PyPI, which is not only useful to humans
1307 download address at PyPI, which is not only useful to humans
1297 browsing the site, but is also picked up by setuptools (the Eggs
1308 browsing the site, but is also picked up by setuptools (the Eggs
1298 machinery). Thanks to Ville and R. Kern for the info/discussion
1309 machinery). Thanks to Ville and R. Kern for the info/discussion
1299 on this.
1310 on this.
1300
1311
1301 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1312 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1302
1313
1303 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1314 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1304 This brings a lot of nice functionality to the pdb mode, which now
1315 This brings a lot of nice functionality to the pdb mode, which now
1305 has tab-completion, syntax highlighting, and better stack handling
1316 has tab-completion, syntax highlighting, and better stack handling
1306 than before. Many thanks to Vivian De Smedt
1317 than before. Many thanks to Vivian De Smedt
1307 <vivian-AT-vdesmedt.com> for the original patches.
1318 <vivian-AT-vdesmedt.com> for the original patches.
1308
1319
1309 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1320 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1310
1321
1311 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1322 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1312 sequence to consistently accept the banner argument. The
1323 sequence to consistently accept the banner argument. The
1313 inconsistency was tripping SAGE, thanks to Gary Zablackis
1324 inconsistency was tripping SAGE, thanks to Gary Zablackis
1314 <gzabl-AT-yahoo.com> for the report.
1325 <gzabl-AT-yahoo.com> for the report.
1315
1326
1316 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1327 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1317
1328
1318 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1329 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1319 Fix bug where a naked 'alias' call in the ipythonrc file would
1330 Fix bug where a naked 'alias' call in the ipythonrc file would
1320 cause a crash. Bug reported by Jorgen Stenarson.
1331 cause a crash. Bug reported by Jorgen Stenarson.
1321
1332
1322 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1333 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1323
1334
1324 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1335 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1325 startup time.
1336 startup time.
1326
1337
1327 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1338 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1328 instances had introduced a bug with globals in normal code. Now
1339 instances had introduced a bug with globals in normal code. Now
1329 it's working in all cases.
1340 it's working in all cases.
1330
1341
1331 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1342 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1332 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1343 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1333 has been introduced to set the default case sensitivity of the
1344 has been introduced to set the default case sensitivity of the
1334 searches. Users can still select either mode at runtime on a
1345 searches. Users can still select either mode at runtime on a
1335 per-search basis.
1346 per-search basis.
1336
1347
1337 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1348 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1338
1349
1339 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1350 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1340 attributes in wildcard searches for subclasses. Modified version
1351 attributes in wildcard searches for subclasses. Modified version
1341 of a patch by Jorgen.
1352 of a patch by Jorgen.
1342
1353
1343 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1354 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1344
1355
1345 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1356 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1346 embedded instances. I added a user_global_ns attribute to the
1357 embedded instances. I added a user_global_ns attribute to the
1347 InteractiveShell class to handle this.
1358 InteractiveShell class to handle this.
1348
1359
1349 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1360 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1350
1361
1351 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1362 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1352 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1363 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1353 (reported under win32, but may happen also in other platforms).
1364 (reported under win32, but may happen also in other platforms).
1354 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1365 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1355
1366
1356 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1367 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1357
1368
1358 * IPython/Magic.py (magic_psearch): new support for wildcard
1369 * IPython/Magic.py (magic_psearch): new support for wildcard
1359 patterns. Now, typing ?a*b will list all names which begin with a
1370 patterns. Now, typing ?a*b will list all names which begin with a
1360 and end in b, for example. The %psearch magic has full
1371 and end in b, for example. The %psearch magic has full
1361 docstrings. Many thanks to JΓΆrgen Stenarson
1372 docstrings. Many thanks to JΓΆrgen Stenarson
1362 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1373 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1363 implementing this functionality.
1374 implementing this functionality.
1364
1375
1365 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1376 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1366
1377
1367 * Manual: fixed long-standing annoyance of double-dashes (as in
1378 * Manual: fixed long-standing annoyance of double-dashes (as in
1368 --prefix=~, for example) being stripped in the HTML version. This
1379 --prefix=~, for example) being stripped in the HTML version. This
1369 is a latex2html bug, but a workaround was provided. Many thanks
1380 is a latex2html bug, but a workaround was provided. Many thanks
1370 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1381 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1371 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1382 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1372 rolling. This seemingly small issue had tripped a number of users
1383 rolling. This seemingly small issue had tripped a number of users
1373 when first installing, so I'm glad to see it gone.
1384 when first installing, so I'm glad to see it gone.
1374
1385
1375 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1386 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1376
1387
1377 * IPython/Extensions/numeric_formats.py: fix missing import,
1388 * IPython/Extensions/numeric_formats.py: fix missing import,
1378 reported by Stephen Walton.
1389 reported by Stephen Walton.
1379
1390
1380 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1391 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1381
1392
1382 * IPython/demo.py: finish demo module, fully documented now.
1393 * IPython/demo.py: finish demo module, fully documented now.
1383
1394
1384 * IPython/genutils.py (file_read): simple little utility to read a
1395 * IPython/genutils.py (file_read): simple little utility to read a
1385 file and ensure it's closed afterwards.
1396 file and ensure it's closed afterwards.
1386
1397
1387 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1398 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1388
1399
1389 * IPython/demo.py (Demo.__init__): added support for individually
1400 * IPython/demo.py (Demo.__init__): added support for individually
1390 tagging blocks for automatic execution.
1401 tagging blocks for automatic execution.
1391
1402
1392 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1403 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1393 syntax-highlighted python sources, requested by John.
1404 syntax-highlighted python sources, requested by John.
1394
1405
1395 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1406 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1396
1407
1397 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1408 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1398 finishing.
1409 finishing.
1399
1410
1400 * IPython/genutils.py (shlex_split): moved from Magic to here,
1411 * IPython/genutils.py (shlex_split): moved from Magic to here,
1401 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1412 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1402
1413
1403 * IPython/demo.py (Demo.__init__): added support for silent
1414 * IPython/demo.py (Demo.__init__): added support for silent
1404 blocks, improved marks as regexps, docstrings written.
1415 blocks, improved marks as regexps, docstrings written.
1405 (Demo.__init__): better docstring, added support for sys.argv.
1416 (Demo.__init__): better docstring, added support for sys.argv.
1406
1417
1407 * IPython/genutils.py (marquee): little utility used by the demo
1418 * IPython/genutils.py (marquee): little utility used by the demo
1408 code, handy in general.
1419 code, handy in general.
1409
1420
1410 * IPython/demo.py (Demo.__init__): new class for interactive
1421 * IPython/demo.py (Demo.__init__): new class for interactive
1411 demos. Not documented yet, I just wrote it in a hurry for
1422 demos. Not documented yet, I just wrote it in a hurry for
1412 scipy'05. Will docstring later.
1423 scipy'05. Will docstring later.
1413
1424
1414 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1425 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1415
1426
1416 * IPython/Shell.py (sigint_handler): Drastic simplification which
1427 * IPython/Shell.py (sigint_handler): Drastic simplification which
1417 also seems to make Ctrl-C work correctly across threads! This is
1428 also seems to make Ctrl-C work correctly across threads! This is
1418 so simple, that I can't beleive I'd missed it before. Needs more
1429 so simple, that I can't beleive I'd missed it before. Needs more
1419 testing, though.
1430 testing, though.
1420 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1431 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1421 like this before...
1432 like this before...
1422
1433
1423 * IPython/genutils.py (get_home_dir): add protection against
1434 * IPython/genutils.py (get_home_dir): add protection against
1424 non-dirs in win32 registry.
1435 non-dirs in win32 registry.
1425
1436
1426 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1437 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1427 bug where dict was mutated while iterating (pysh crash).
1438 bug where dict was mutated while iterating (pysh crash).
1428
1439
1429 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1440 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1430
1441
1431 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1442 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1432 spurious newlines added by this routine. After a report by
1443 spurious newlines added by this routine. After a report by
1433 F. Mantegazza.
1444 F. Mantegazza.
1434
1445
1435 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1446 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1436
1447
1437 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1448 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1438 calls. These were a leftover from the GTK 1.x days, and can cause
1449 calls. These were a leftover from the GTK 1.x days, and can cause
1439 problems in certain cases (after a report by John Hunter).
1450 problems in certain cases (after a report by John Hunter).
1440
1451
1441 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1452 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1442 os.getcwd() fails at init time. Thanks to patch from David Remahl
1453 os.getcwd() fails at init time. Thanks to patch from David Remahl
1443 <chmod007-AT-mac.com>.
1454 <chmod007-AT-mac.com>.
1444 (InteractiveShell.__init__): prevent certain special magics from
1455 (InteractiveShell.__init__): prevent certain special magics from
1445 being shadowed by aliases. Closes
1456 being shadowed by aliases. Closes
1446 http://www.scipy.net/roundup/ipython/issue41.
1457 http://www.scipy.net/roundup/ipython/issue41.
1447
1458
1448 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1459 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1449
1460
1450 * IPython/iplib.py (InteractiveShell.complete): Added new
1461 * IPython/iplib.py (InteractiveShell.complete): Added new
1451 top-level completion method to expose the completion mechanism
1462 top-level completion method to expose the completion mechanism
1452 beyond readline-based environments.
1463 beyond readline-based environments.
1453
1464
1454 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1465 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1455
1466
1456 * tools/ipsvnc (svnversion): fix svnversion capture.
1467 * tools/ipsvnc (svnversion): fix svnversion capture.
1457
1468
1458 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1469 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1459 attribute to self, which was missing. Before, it was set by a
1470 attribute to self, which was missing. Before, it was set by a
1460 routine which in certain cases wasn't being called, so the
1471 routine which in certain cases wasn't being called, so the
1461 instance could end up missing the attribute. This caused a crash.
1472 instance could end up missing the attribute. This caused a crash.
1462 Closes http://www.scipy.net/roundup/ipython/issue40.
1473 Closes http://www.scipy.net/roundup/ipython/issue40.
1463
1474
1464 2005-08-16 Fernando Perez <fperez@colorado.edu>
1475 2005-08-16 Fernando Perez <fperez@colorado.edu>
1465
1476
1466 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1477 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1467 contains non-string attribute. Closes
1478 contains non-string attribute. Closes
1468 http://www.scipy.net/roundup/ipython/issue38.
1479 http://www.scipy.net/roundup/ipython/issue38.
1469
1480
1470 2005-08-14 Fernando Perez <fperez@colorado.edu>
1481 2005-08-14 Fernando Perez <fperez@colorado.edu>
1471
1482
1472 * tools/ipsvnc: Minor improvements, to add changeset info.
1483 * tools/ipsvnc: Minor improvements, to add changeset info.
1473
1484
1474 2005-08-12 Fernando Perez <fperez@colorado.edu>
1485 2005-08-12 Fernando Perez <fperez@colorado.edu>
1475
1486
1476 * IPython/iplib.py (runsource): remove self.code_to_run_src
1487 * IPython/iplib.py (runsource): remove self.code_to_run_src
1477 attribute. I realized this is nothing more than
1488 attribute. I realized this is nothing more than
1478 '\n'.join(self.buffer), and having the same data in two different
1489 '\n'.join(self.buffer), and having the same data in two different
1479 places is just asking for synchronization bugs. This may impact
1490 places is just asking for synchronization bugs. This may impact
1480 people who have custom exception handlers, so I need to warn
1491 people who have custom exception handlers, so I need to warn
1481 ipython-dev about it (F. Mantegazza may use them).
1492 ipython-dev about it (F. Mantegazza may use them).
1482
1493
1483 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1494 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1484
1495
1485 * IPython/genutils.py: fix 2.2 compatibility (generators)
1496 * IPython/genutils.py: fix 2.2 compatibility (generators)
1486
1497
1487 2005-07-18 Fernando Perez <fperez@colorado.edu>
1498 2005-07-18 Fernando Perez <fperez@colorado.edu>
1488
1499
1489 * IPython/genutils.py (get_home_dir): fix to help users with
1500 * IPython/genutils.py (get_home_dir): fix to help users with
1490 invalid $HOME under win32.
1501 invalid $HOME under win32.
1491
1502
1492 2005-07-17 Fernando Perez <fperez@colorado.edu>
1503 2005-07-17 Fernando Perez <fperez@colorado.edu>
1493
1504
1494 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1505 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1495 some old hacks and clean up a bit other routines; code should be
1506 some old hacks and clean up a bit other routines; code should be
1496 simpler and a bit faster.
1507 simpler and a bit faster.
1497
1508
1498 * IPython/iplib.py (interact): removed some last-resort attempts
1509 * IPython/iplib.py (interact): removed some last-resort attempts
1499 to survive broken stdout/stderr. That code was only making it
1510 to survive broken stdout/stderr. That code was only making it
1500 harder to abstract out the i/o (necessary for gui integration),
1511 harder to abstract out the i/o (necessary for gui integration),
1501 and the crashes it could prevent were extremely rare in practice
1512 and the crashes it could prevent were extremely rare in practice
1502 (besides being fully user-induced in a pretty violent manner).
1513 (besides being fully user-induced in a pretty violent manner).
1503
1514
1504 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1515 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1505 Nothing major yet, but the code is simpler to read; this should
1516 Nothing major yet, but the code is simpler to read; this should
1506 make it easier to do more serious modifications in the future.
1517 make it easier to do more serious modifications in the future.
1507
1518
1508 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1519 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1509 which broke in .15 (thanks to a report by Ville).
1520 which broke in .15 (thanks to a report by Ville).
1510
1521
1511 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1522 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1512 be quite correct, I know next to nothing about unicode). This
1523 be quite correct, I know next to nothing about unicode). This
1513 will allow unicode strings to be used in prompts, amongst other
1524 will allow unicode strings to be used in prompts, amongst other
1514 cases. It also will prevent ipython from crashing when unicode
1525 cases. It also will prevent ipython from crashing when unicode
1515 shows up unexpectedly in many places. If ascii encoding fails, we
1526 shows up unexpectedly in many places. If ascii encoding fails, we
1516 assume utf_8. Currently the encoding is not a user-visible
1527 assume utf_8. Currently the encoding is not a user-visible
1517 setting, though it could be made so if there is demand for it.
1528 setting, though it could be made so if there is demand for it.
1518
1529
1519 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1530 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1520
1531
1521 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1532 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1522
1533
1523 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1534 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1524
1535
1525 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1536 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1526 code can work transparently for 2.2/2.3.
1537 code can work transparently for 2.2/2.3.
1527
1538
1528 2005-07-16 Fernando Perez <fperez@colorado.edu>
1539 2005-07-16 Fernando Perez <fperez@colorado.edu>
1529
1540
1530 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1541 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1531 out of the color scheme table used for coloring exception
1542 out of the color scheme table used for coloring exception
1532 tracebacks. This allows user code to add new schemes at runtime.
1543 tracebacks. This allows user code to add new schemes at runtime.
1533 This is a minimally modified version of the patch at
1544 This is a minimally modified version of the patch at
1534 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1545 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1535 for the contribution.
1546 for the contribution.
1536
1547
1537 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1548 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1538 slightly modified version of the patch in
1549 slightly modified version of the patch in
1539 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1550 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1540 to remove the previous try/except solution (which was costlier).
1551 to remove the previous try/except solution (which was costlier).
1541 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1552 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1542
1553
1543 2005-06-08 Fernando Perez <fperez@colorado.edu>
1554 2005-06-08 Fernando Perez <fperez@colorado.edu>
1544
1555
1545 * IPython/iplib.py (write/write_err): Add methods to abstract all
1556 * IPython/iplib.py (write/write_err): Add methods to abstract all
1546 I/O a bit more.
1557 I/O a bit more.
1547
1558
1548 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1559 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1549 warning, reported by Aric Hagberg, fix by JD Hunter.
1560 warning, reported by Aric Hagberg, fix by JD Hunter.
1550
1561
1551 2005-06-02 *** Released version 0.6.15
1562 2005-06-02 *** Released version 0.6.15
1552
1563
1553 2005-06-01 Fernando Perez <fperez@colorado.edu>
1564 2005-06-01 Fernando Perez <fperez@colorado.edu>
1554
1565
1555 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1566 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1556 tab-completion of filenames within open-quoted strings. Note that
1567 tab-completion of filenames within open-quoted strings. Note that
1557 this requires that in ~/.ipython/ipythonrc, users change the
1568 this requires that in ~/.ipython/ipythonrc, users change the
1558 readline delimiters configuration to read:
1569 readline delimiters configuration to read:
1559
1570
1560 readline_remove_delims -/~
1571 readline_remove_delims -/~
1561
1572
1562
1573
1563 2005-05-31 *** Released version 0.6.14
1574 2005-05-31 *** Released version 0.6.14
1564
1575
1565 2005-05-29 Fernando Perez <fperez@colorado.edu>
1576 2005-05-29 Fernando Perez <fperez@colorado.edu>
1566
1577
1567 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1578 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1568 with files not on the filesystem. Reported by Eliyahu Sandler
1579 with files not on the filesystem. Reported by Eliyahu Sandler
1569 <eli@gondolin.net>
1580 <eli@gondolin.net>
1570
1581
1571 2005-05-22 Fernando Perez <fperez@colorado.edu>
1582 2005-05-22 Fernando Perez <fperez@colorado.edu>
1572
1583
1573 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1584 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1574 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1585 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1575
1586
1576 2005-05-19 Fernando Perez <fperez@colorado.edu>
1587 2005-05-19 Fernando Perez <fperez@colorado.edu>
1577
1588
1578 * IPython/iplib.py (safe_execfile): close a file which could be
1589 * IPython/iplib.py (safe_execfile): close a file which could be
1579 left open (causing problems in win32, which locks open files).
1590 left open (causing problems in win32, which locks open files).
1580 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1591 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1581
1592
1582 2005-05-18 Fernando Perez <fperez@colorado.edu>
1593 2005-05-18 Fernando Perez <fperez@colorado.edu>
1583
1594
1584 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1595 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1585 keyword arguments correctly to safe_execfile().
1596 keyword arguments correctly to safe_execfile().
1586
1597
1587 2005-05-13 Fernando Perez <fperez@colorado.edu>
1598 2005-05-13 Fernando Perez <fperez@colorado.edu>
1588
1599
1589 * ipython.1: Added info about Qt to manpage, and threads warning
1600 * ipython.1: Added info about Qt to manpage, and threads warning
1590 to usage page (invoked with --help).
1601 to usage page (invoked with --help).
1591
1602
1592 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1603 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1593 new matcher (it goes at the end of the priority list) to do
1604 new matcher (it goes at the end of the priority list) to do
1594 tab-completion on named function arguments. Submitted by George
1605 tab-completion on named function arguments. Submitted by George
1595 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1606 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1596 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1607 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1597 for more details.
1608 for more details.
1598
1609
1599 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1610 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1600 SystemExit exceptions in the script being run. Thanks to a report
1611 SystemExit exceptions in the script being run. Thanks to a report
1601 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1612 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1602 producing very annoying behavior when running unit tests.
1613 producing very annoying behavior when running unit tests.
1603
1614
1604 2005-05-12 Fernando Perez <fperez@colorado.edu>
1615 2005-05-12 Fernando Perez <fperez@colorado.edu>
1605
1616
1606 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1617 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1607 which I'd broken (again) due to a changed regexp. In the process,
1618 which I'd broken (again) due to a changed regexp. In the process,
1608 added ';' as an escape to auto-quote the whole line without
1619 added ';' as an escape to auto-quote the whole line without
1609 splitting its arguments. Thanks to a report by Jerry McRae
1620 splitting its arguments. Thanks to a report by Jerry McRae
1610 <qrs0xyc02-AT-sneakemail.com>.
1621 <qrs0xyc02-AT-sneakemail.com>.
1611
1622
1612 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1623 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1613 possible crashes caused by a TokenError. Reported by Ed Schofield
1624 possible crashes caused by a TokenError. Reported by Ed Schofield
1614 <schofield-AT-ftw.at>.
1625 <schofield-AT-ftw.at>.
1615
1626
1616 2005-05-06 Fernando Perez <fperez@colorado.edu>
1627 2005-05-06 Fernando Perez <fperez@colorado.edu>
1617
1628
1618 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1629 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1619
1630
1620 2005-04-29 Fernando Perez <fperez@colorado.edu>
1631 2005-04-29 Fernando Perez <fperez@colorado.edu>
1621
1632
1622 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1633 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1623 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1634 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1624 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1635 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1625 which provides support for Qt interactive usage (similar to the
1636 which provides support for Qt interactive usage (similar to the
1626 existing one for WX and GTK). This had been often requested.
1637 existing one for WX and GTK). This had been often requested.
1627
1638
1628 2005-04-14 *** Released version 0.6.13
1639 2005-04-14 *** Released version 0.6.13
1629
1640
1630 2005-04-08 Fernando Perez <fperez@colorado.edu>
1641 2005-04-08 Fernando Perez <fperez@colorado.edu>
1631
1642
1632 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1643 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1633 from _ofind, which gets called on almost every input line. Now,
1644 from _ofind, which gets called on almost every input line. Now,
1634 we only try to get docstrings if they are actually going to be
1645 we only try to get docstrings if they are actually going to be
1635 used (the overhead of fetching unnecessary docstrings can be
1646 used (the overhead of fetching unnecessary docstrings can be
1636 noticeable for certain objects, such as Pyro proxies).
1647 noticeable for certain objects, such as Pyro proxies).
1637
1648
1638 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1649 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1639 for completers. For some reason I had been passing them the state
1650 for completers. For some reason I had been passing them the state
1640 variable, which completers never actually need, and was in
1651 variable, which completers never actually need, and was in
1641 conflict with the rlcompleter API. Custom completers ONLY need to
1652 conflict with the rlcompleter API. Custom completers ONLY need to
1642 take the text parameter.
1653 take the text parameter.
1643
1654
1644 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1655 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1645 work correctly in pysh. I've also moved all the logic which used
1656 work correctly in pysh. I've also moved all the logic which used
1646 to be in pysh.py here, which will prevent problems with future
1657 to be in pysh.py here, which will prevent problems with future
1647 upgrades. However, this time I must warn users to update their
1658 upgrades. However, this time I must warn users to update their
1648 pysh profile to include the line
1659 pysh profile to include the line
1649
1660
1650 import_all IPython.Extensions.InterpreterExec
1661 import_all IPython.Extensions.InterpreterExec
1651
1662
1652 because otherwise things won't work for them. They MUST also
1663 because otherwise things won't work for them. They MUST also
1653 delete pysh.py and the line
1664 delete pysh.py and the line
1654
1665
1655 execfile pysh.py
1666 execfile pysh.py
1656
1667
1657 from their ipythonrc-pysh.
1668 from their ipythonrc-pysh.
1658
1669
1659 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1670 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1660 robust in the face of objects whose dir() returns non-strings
1671 robust in the face of objects whose dir() returns non-strings
1661 (which it shouldn't, but some broken libs like ITK do). Thanks to
1672 (which it shouldn't, but some broken libs like ITK do). Thanks to
1662 a patch by John Hunter (implemented differently, though). Also
1673 a patch by John Hunter (implemented differently, though). Also
1663 minor improvements by using .extend instead of + on lists.
1674 minor improvements by using .extend instead of + on lists.
1664
1675
1665 * pysh.py:
1676 * pysh.py:
1666
1677
1667 2005-04-06 Fernando Perez <fperez@colorado.edu>
1678 2005-04-06 Fernando Perez <fperez@colorado.edu>
1668
1679
1669 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1680 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1670 by default, so that all users benefit from it. Those who don't
1681 by default, so that all users benefit from it. Those who don't
1671 want it can still turn it off.
1682 want it can still turn it off.
1672
1683
1673 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1684 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1674 config file, I'd forgotten about this, so users were getting it
1685 config file, I'd forgotten about this, so users were getting it
1675 off by default.
1686 off by default.
1676
1687
1677 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1688 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1678 consistency. Now magics can be called in multiline statements,
1689 consistency. Now magics can be called in multiline statements,
1679 and python variables can be expanded in magic calls via $var.
1690 and python variables can be expanded in magic calls via $var.
1680 This makes the magic system behave just like aliases or !system
1691 This makes the magic system behave just like aliases or !system
1681 calls.
1692 calls.
1682
1693
1683 2005-03-28 Fernando Perez <fperez@colorado.edu>
1694 2005-03-28 Fernando Perez <fperez@colorado.edu>
1684
1695
1685 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1696 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1686 expensive string additions for building command. Add support for
1697 expensive string additions for building command. Add support for
1687 trailing ';' when autocall is used.
1698 trailing ';' when autocall is used.
1688
1699
1689 2005-03-26 Fernando Perez <fperez@colorado.edu>
1700 2005-03-26 Fernando Perez <fperez@colorado.edu>
1690
1701
1691 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1702 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1692 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1703 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1693 ipython.el robust against prompts with any number of spaces
1704 ipython.el robust against prompts with any number of spaces
1694 (including 0) after the ':' character.
1705 (including 0) after the ':' character.
1695
1706
1696 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1707 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1697 continuation prompt, which misled users to think the line was
1708 continuation prompt, which misled users to think the line was
1698 already indented. Closes debian Bug#300847, reported to me by
1709 already indented. Closes debian Bug#300847, reported to me by
1699 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1710 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1700
1711
1701 2005-03-23 Fernando Perez <fperez@colorado.edu>
1712 2005-03-23 Fernando Perez <fperez@colorado.edu>
1702
1713
1703 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1714 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1704 properly aligned if they have embedded newlines.
1715 properly aligned if they have embedded newlines.
1705
1716
1706 * IPython/iplib.py (runlines): Add a public method to expose
1717 * IPython/iplib.py (runlines): Add a public method to expose
1707 IPython's code execution machinery, so that users can run strings
1718 IPython's code execution machinery, so that users can run strings
1708 as if they had been typed at the prompt interactively.
1719 as if they had been typed at the prompt interactively.
1709 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1720 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1710 methods which can call the system shell, but with python variable
1721 methods which can call the system shell, but with python variable
1711 expansion. The three such methods are: __IPYTHON__.system,
1722 expansion. The three such methods are: __IPYTHON__.system,
1712 .getoutput and .getoutputerror. These need to be documented in a
1723 .getoutput and .getoutputerror. These need to be documented in a
1713 'public API' section (to be written) of the manual.
1724 'public API' section (to be written) of the manual.
1714
1725
1715 2005-03-20 Fernando Perez <fperez@colorado.edu>
1726 2005-03-20 Fernando Perez <fperez@colorado.edu>
1716
1727
1717 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1728 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1718 for custom exception handling. This is quite powerful, and it
1729 for custom exception handling. This is quite powerful, and it
1719 allows for user-installable exception handlers which can trap
1730 allows for user-installable exception handlers which can trap
1720 custom exceptions at runtime and treat them separately from
1731 custom exceptions at runtime and treat them separately from
1721 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1732 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1722 Mantegazza <mantegazza-AT-ill.fr>.
1733 Mantegazza <mantegazza-AT-ill.fr>.
1723 (InteractiveShell.set_custom_completer): public API function to
1734 (InteractiveShell.set_custom_completer): public API function to
1724 add new completers at runtime.
1735 add new completers at runtime.
1725
1736
1726 2005-03-19 Fernando Perez <fperez@colorado.edu>
1737 2005-03-19 Fernando Perez <fperez@colorado.edu>
1727
1738
1728 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1739 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1729 allow objects which provide their docstrings via non-standard
1740 allow objects which provide their docstrings via non-standard
1730 mechanisms (like Pyro proxies) to still be inspected by ipython's
1741 mechanisms (like Pyro proxies) to still be inspected by ipython's
1731 ? system.
1742 ? system.
1732
1743
1733 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1744 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1734 automatic capture system. I tried quite hard to make it work
1745 automatic capture system. I tried quite hard to make it work
1735 reliably, and simply failed. I tried many combinations with the
1746 reliably, and simply failed. I tried many combinations with the
1736 subprocess module, but eventually nothing worked in all needed
1747 subprocess module, but eventually nothing worked in all needed
1737 cases (not blocking stdin for the child, duplicating stdout
1748 cases (not blocking stdin for the child, duplicating stdout
1738 without blocking, etc). The new %sc/%sx still do capture to these
1749 without blocking, etc). The new %sc/%sx still do capture to these
1739 magical list/string objects which make shell use much more
1750 magical list/string objects which make shell use much more
1740 conveninent, so not all is lost.
1751 conveninent, so not all is lost.
1741
1752
1742 XXX - FIX MANUAL for the change above!
1753 XXX - FIX MANUAL for the change above!
1743
1754
1744 (runsource): I copied code.py's runsource() into ipython to modify
1755 (runsource): I copied code.py's runsource() into ipython to modify
1745 it a bit. Now the code object and source to be executed are
1756 it a bit. Now the code object and source to be executed are
1746 stored in ipython. This makes this info accessible to third-party
1757 stored in ipython. This makes this info accessible to third-party
1747 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1758 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1748 Mantegazza <mantegazza-AT-ill.fr>.
1759 Mantegazza <mantegazza-AT-ill.fr>.
1749
1760
1750 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1761 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1751 history-search via readline (like C-p/C-n). I'd wanted this for a
1762 history-search via readline (like C-p/C-n). I'd wanted this for a
1752 long time, but only recently found out how to do it. For users
1763 long time, but only recently found out how to do it. For users
1753 who already have their ipythonrc files made and want this, just
1764 who already have their ipythonrc files made and want this, just
1754 add:
1765 add:
1755
1766
1756 readline_parse_and_bind "\e[A": history-search-backward
1767 readline_parse_and_bind "\e[A": history-search-backward
1757 readline_parse_and_bind "\e[B": history-search-forward
1768 readline_parse_and_bind "\e[B": history-search-forward
1758
1769
1759 2005-03-18 Fernando Perez <fperez@colorado.edu>
1770 2005-03-18 Fernando Perez <fperez@colorado.edu>
1760
1771
1761 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1772 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1762 LSString and SList classes which allow transparent conversions
1773 LSString and SList classes which allow transparent conversions
1763 between list mode and whitespace-separated string.
1774 between list mode and whitespace-separated string.
1764 (magic_r): Fix recursion problem in %r.
1775 (magic_r): Fix recursion problem in %r.
1765
1776
1766 * IPython/genutils.py (LSString): New class to be used for
1777 * IPython/genutils.py (LSString): New class to be used for
1767 automatic storage of the results of all alias/system calls in _o
1778 automatic storage of the results of all alias/system calls in _o
1768 and _e (stdout/err). These provide a .l/.list attribute which
1779 and _e (stdout/err). These provide a .l/.list attribute which
1769 does automatic splitting on newlines. This means that for most
1780 does automatic splitting on newlines. This means that for most
1770 uses, you'll never need to do capturing of output with %sc/%sx
1781 uses, you'll never need to do capturing of output with %sc/%sx
1771 anymore, since ipython keeps this always done for you. Note that
1782 anymore, since ipython keeps this always done for you. Note that
1772 only the LAST results are stored, the _o/e variables are
1783 only the LAST results are stored, the _o/e variables are
1773 overwritten on each call. If you need to save their contents
1784 overwritten on each call. If you need to save their contents
1774 further, simply bind them to any other name.
1785 further, simply bind them to any other name.
1775
1786
1776 2005-03-17 Fernando Perez <fperez@colorado.edu>
1787 2005-03-17 Fernando Perez <fperez@colorado.edu>
1777
1788
1778 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1789 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1779 prompt namespace handling.
1790 prompt namespace handling.
1780
1791
1781 2005-03-16 Fernando Perez <fperez@colorado.edu>
1792 2005-03-16 Fernando Perez <fperez@colorado.edu>
1782
1793
1783 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1794 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1784 classic prompts to be '>>> ' (final space was missing, and it
1795 classic prompts to be '>>> ' (final space was missing, and it
1785 trips the emacs python mode).
1796 trips the emacs python mode).
1786 (BasePrompt.__str__): Added safe support for dynamic prompt
1797 (BasePrompt.__str__): Added safe support for dynamic prompt
1787 strings. Now you can set your prompt string to be '$x', and the
1798 strings. Now you can set your prompt string to be '$x', and the
1788 value of x will be printed from your interactive namespace. The
1799 value of x will be printed from your interactive namespace. The
1789 interpolation syntax includes the full Itpl support, so
1800 interpolation syntax includes the full Itpl support, so
1790 ${foo()+x+bar()} is a valid prompt string now, and the function
1801 ${foo()+x+bar()} is a valid prompt string now, and the function
1791 calls will be made at runtime.
1802 calls will be made at runtime.
1792
1803
1793 2005-03-15 Fernando Perez <fperez@colorado.edu>
1804 2005-03-15 Fernando Perez <fperez@colorado.edu>
1794
1805
1795 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1806 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1796 avoid name clashes in pylab. %hist still works, it just forwards
1807 avoid name clashes in pylab. %hist still works, it just forwards
1797 the call to %history.
1808 the call to %history.
1798
1809
1799 2005-03-02 *** Released version 0.6.12
1810 2005-03-02 *** Released version 0.6.12
1800
1811
1801 2005-03-02 Fernando Perez <fperez@colorado.edu>
1812 2005-03-02 Fernando Perez <fperez@colorado.edu>
1802
1813
1803 * IPython/iplib.py (handle_magic): log magic calls properly as
1814 * IPython/iplib.py (handle_magic): log magic calls properly as
1804 ipmagic() function calls.
1815 ipmagic() function calls.
1805
1816
1806 * IPython/Magic.py (magic_time): Improved %time to support
1817 * IPython/Magic.py (magic_time): Improved %time to support
1807 statements and provide wall-clock as well as CPU time.
1818 statements and provide wall-clock as well as CPU time.
1808
1819
1809 2005-02-27 Fernando Perez <fperez@colorado.edu>
1820 2005-02-27 Fernando Perez <fperez@colorado.edu>
1810
1821
1811 * IPython/hooks.py: New hooks module, to expose user-modifiable
1822 * IPython/hooks.py: New hooks module, to expose user-modifiable
1812 IPython functionality in a clean manner. For now only the editor
1823 IPython functionality in a clean manner. For now only the editor
1813 hook is actually written, and other thigns which I intend to turn
1824 hook is actually written, and other thigns which I intend to turn
1814 into proper hooks aren't yet there. The display and prefilter
1825 into proper hooks aren't yet there. The display and prefilter
1815 stuff, for example, should be hooks. But at least now the
1826 stuff, for example, should be hooks. But at least now the
1816 framework is in place, and the rest can be moved here with more
1827 framework is in place, and the rest can be moved here with more
1817 time later. IPython had had a .hooks variable for a long time for
1828 time later. IPython had had a .hooks variable for a long time for
1818 this purpose, but I'd never actually used it for anything.
1829 this purpose, but I'd never actually used it for anything.
1819
1830
1820 2005-02-26 Fernando Perez <fperez@colorado.edu>
1831 2005-02-26 Fernando Perez <fperez@colorado.edu>
1821
1832
1822 * IPython/ipmaker.py (make_IPython): make the default ipython
1833 * IPython/ipmaker.py (make_IPython): make the default ipython
1823 directory be called _ipython under win32, to follow more the
1834 directory be called _ipython under win32, to follow more the
1824 naming peculiarities of that platform (where buggy software like
1835 naming peculiarities of that platform (where buggy software like
1825 Visual Sourcesafe breaks with .named directories). Reported by
1836 Visual Sourcesafe breaks with .named directories). Reported by
1826 Ville Vainio.
1837 Ville Vainio.
1827
1838
1828 2005-02-23 Fernando Perez <fperez@colorado.edu>
1839 2005-02-23 Fernando Perez <fperez@colorado.edu>
1829
1840
1830 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1841 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1831 auto_aliases for win32 which were causing problems. Users can
1842 auto_aliases for win32 which were causing problems. Users can
1832 define the ones they personally like.
1843 define the ones they personally like.
1833
1844
1834 2005-02-21 Fernando Perez <fperez@colorado.edu>
1845 2005-02-21 Fernando Perez <fperez@colorado.edu>
1835
1846
1836 * IPython/Magic.py (magic_time): new magic to time execution of
1847 * IPython/Magic.py (magic_time): new magic to time execution of
1837 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1848 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1838
1849
1839 2005-02-19 Fernando Perez <fperez@colorado.edu>
1850 2005-02-19 Fernando Perez <fperez@colorado.edu>
1840
1851
1841 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1852 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1842 into keys (for prompts, for example).
1853 into keys (for prompts, for example).
1843
1854
1844 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1855 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1845 prompts in case users want them. This introduces a small behavior
1856 prompts in case users want them. This introduces a small behavior
1846 change: ipython does not automatically add a space to all prompts
1857 change: ipython does not automatically add a space to all prompts
1847 anymore. To get the old prompts with a space, users should add it
1858 anymore. To get the old prompts with a space, users should add it
1848 manually to their ipythonrc file, so for example prompt_in1 should
1859 manually to their ipythonrc file, so for example prompt_in1 should
1849 now read 'In [\#]: ' instead of 'In [\#]:'.
1860 now read 'In [\#]: ' instead of 'In [\#]:'.
1850 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1861 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1851 file) to control left-padding of secondary prompts.
1862 file) to control left-padding of secondary prompts.
1852
1863
1853 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1864 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1854 the profiler can't be imported. Fix for Debian, which removed
1865 the profiler can't be imported. Fix for Debian, which removed
1855 profile.py because of License issues. I applied a slightly
1866 profile.py because of License issues. I applied a slightly
1856 modified version of the original Debian patch at
1867 modified version of the original Debian patch at
1857 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1868 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1858
1869
1859 2005-02-17 Fernando Perez <fperez@colorado.edu>
1870 2005-02-17 Fernando Perez <fperez@colorado.edu>
1860
1871
1861 * IPython/genutils.py (native_line_ends): Fix bug which would
1872 * IPython/genutils.py (native_line_ends): Fix bug which would
1862 cause improper line-ends under win32 b/c I was not opening files
1873 cause improper line-ends under win32 b/c I was not opening files
1863 in binary mode. Bug report and fix thanks to Ville.
1874 in binary mode. Bug report and fix thanks to Ville.
1864
1875
1865 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1876 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1866 trying to catch spurious foo[1] autocalls. My fix actually broke
1877 trying to catch spurious foo[1] autocalls. My fix actually broke
1867 ',/' autoquote/call with explicit escape (bad regexp).
1878 ',/' autoquote/call with explicit escape (bad regexp).
1868
1879
1869 2005-02-15 *** Released version 0.6.11
1880 2005-02-15 *** Released version 0.6.11
1870
1881
1871 2005-02-14 Fernando Perez <fperez@colorado.edu>
1882 2005-02-14 Fernando Perez <fperez@colorado.edu>
1872
1883
1873 * IPython/background_jobs.py: New background job management
1884 * IPython/background_jobs.py: New background job management
1874 subsystem. This is implemented via a new set of classes, and
1885 subsystem. This is implemented via a new set of classes, and
1875 IPython now provides a builtin 'jobs' object for background job
1886 IPython now provides a builtin 'jobs' object for background job
1876 execution. A convenience %bg magic serves as a lightweight
1887 execution. A convenience %bg magic serves as a lightweight
1877 frontend for starting the more common type of calls. This was
1888 frontend for starting the more common type of calls. This was
1878 inspired by discussions with B. Granger and the BackgroundCommand
1889 inspired by discussions with B. Granger and the BackgroundCommand
1879 class described in the book Python Scripting for Computational
1890 class described in the book Python Scripting for Computational
1880 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1891 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1881 (although ultimately no code from this text was used, as IPython's
1892 (although ultimately no code from this text was used, as IPython's
1882 system is a separate implementation).
1893 system is a separate implementation).
1883
1894
1884 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1895 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1885 to control the completion of single/double underscore names
1896 to control the completion of single/double underscore names
1886 separately. As documented in the example ipytonrc file, the
1897 separately. As documented in the example ipytonrc file, the
1887 readline_omit__names variable can now be set to 2, to omit even
1898 readline_omit__names variable can now be set to 2, to omit even
1888 single underscore names. Thanks to a patch by Brian Wong
1899 single underscore names. Thanks to a patch by Brian Wong
1889 <BrianWong-AT-AirgoNetworks.Com>.
1900 <BrianWong-AT-AirgoNetworks.Com>.
1890 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1901 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1891 be autocalled as foo([1]) if foo were callable. A problem for
1902 be autocalled as foo([1]) if foo were callable. A problem for
1892 things which are both callable and implement __getitem__.
1903 things which are both callable and implement __getitem__.
1893 (init_readline): Fix autoindentation for win32. Thanks to a patch
1904 (init_readline): Fix autoindentation for win32. Thanks to a patch
1894 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1905 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1895
1906
1896 2005-02-12 Fernando Perez <fperez@colorado.edu>
1907 2005-02-12 Fernando Perez <fperez@colorado.edu>
1897
1908
1898 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1909 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1899 which I had written long ago to sort out user error messages which
1910 which I had written long ago to sort out user error messages which
1900 may occur during startup. This seemed like a good idea initially,
1911 may occur during startup. This seemed like a good idea initially,
1901 but it has proven a disaster in retrospect. I don't want to
1912 but it has proven a disaster in retrospect. I don't want to
1902 change much code for now, so my fix is to set the internal 'debug'
1913 change much code for now, so my fix is to set the internal 'debug'
1903 flag to true everywhere, whose only job was precisely to control
1914 flag to true everywhere, whose only job was precisely to control
1904 this subsystem. This closes issue 28 (as well as avoiding all
1915 this subsystem. This closes issue 28 (as well as avoiding all
1905 sorts of strange hangups which occur from time to time).
1916 sorts of strange hangups which occur from time to time).
1906
1917
1907 2005-02-07 Fernando Perez <fperez@colorado.edu>
1918 2005-02-07 Fernando Perez <fperez@colorado.edu>
1908
1919
1909 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1920 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1910 previous call produced a syntax error.
1921 previous call produced a syntax error.
1911
1922
1912 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1923 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1913 classes without constructor.
1924 classes without constructor.
1914
1925
1915 2005-02-06 Fernando Perez <fperez@colorado.edu>
1926 2005-02-06 Fernando Perez <fperez@colorado.edu>
1916
1927
1917 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1928 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1918 completions with the results of each matcher, so we return results
1929 completions with the results of each matcher, so we return results
1919 to the user from all namespaces. This breaks with ipython
1930 to the user from all namespaces. This breaks with ipython
1920 tradition, but I think it's a nicer behavior. Now you get all
1931 tradition, but I think it's a nicer behavior. Now you get all
1921 possible completions listed, from all possible namespaces (python,
1932 possible completions listed, from all possible namespaces (python,
1922 filesystem, magics...) After a request by John Hunter
1933 filesystem, magics...) After a request by John Hunter
1923 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1934 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1924
1935
1925 2005-02-05 Fernando Perez <fperez@colorado.edu>
1936 2005-02-05 Fernando Perez <fperez@colorado.edu>
1926
1937
1927 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1938 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1928 the call had quote characters in it (the quotes were stripped).
1939 the call had quote characters in it (the quotes were stripped).
1929
1940
1930 2005-01-31 Fernando Perez <fperez@colorado.edu>
1941 2005-01-31 Fernando Perez <fperez@colorado.edu>
1931
1942
1932 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1943 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1933 Itpl.itpl() to make the code more robust against psyco
1944 Itpl.itpl() to make the code more robust against psyco
1934 optimizations.
1945 optimizations.
1935
1946
1936 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1947 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1937 of causing an exception. Quicker, cleaner.
1948 of causing an exception. Quicker, cleaner.
1938
1949
1939 2005-01-28 Fernando Perez <fperez@colorado.edu>
1950 2005-01-28 Fernando Perez <fperez@colorado.edu>
1940
1951
1941 * scripts/ipython_win_post_install.py (install): hardcode
1952 * scripts/ipython_win_post_install.py (install): hardcode
1942 sys.prefix+'python.exe' as the executable path. It turns out that
1953 sys.prefix+'python.exe' as the executable path. It turns out that
1943 during the post-installation run, sys.executable resolves to the
1954 during the post-installation run, sys.executable resolves to the
1944 name of the binary installer! I should report this as a distutils
1955 name of the binary installer! I should report this as a distutils
1945 bug, I think. I updated the .10 release with this tiny fix, to
1956 bug, I think. I updated the .10 release with this tiny fix, to
1946 avoid annoying the lists further.
1957 avoid annoying the lists further.
1947
1958
1948 2005-01-27 *** Released version 0.6.10
1959 2005-01-27 *** Released version 0.6.10
1949
1960
1950 2005-01-27 Fernando Perez <fperez@colorado.edu>
1961 2005-01-27 Fernando Perez <fperez@colorado.edu>
1951
1962
1952 * IPython/numutils.py (norm): Added 'inf' as optional name for
1963 * IPython/numutils.py (norm): Added 'inf' as optional name for
1953 L-infinity norm, included references to mathworld.com for vector
1964 L-infinity norm, included references to mathworld.com for vector
1954 norm definitions.
1965 norm definitions.
1955 (amin/amax): added amin/amax for array min/max. Similar to what
1966 (amin/amax): added amin/amax for array min/max. Similar to what
1956 pylab ships with after the recent reorganization of names.
1967 pylab ships with after the recent reorganization of names.
1957 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1968 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1958
1969
1959 * ipython.el: committed Alex's recent fixes and improvements.
1970 * ipython.el: committed Alex's recent fixes and improvements.
1960 Tested with python-mode from CVS, and it looks excellent. Since
1971 Tested with python-mode from CVS, and it looks excellent. Since
1961 python-mode hasn't released anything in a while, I'm temporarily
1972 python-mode hasn't released anything in a while, I'm temporarily
1962 putting a copy of today's CVS (v 4.70) of python-mode in:
1973 putting a copy of today's CVS (v 4.70) of python-mode in:
1963 http://ipython.scipy.org/tmp/python-mode.el
1974 http://ipython.scipy.org/tmp/python-mode.el
1964
1975
1965 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1976 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1966 sys.executable for the executable name, instead of assuming it's
1977 sys.executable for the executable name, instead of assuming it's
1967 called 'python.exe' (the post-installer would have produced broken
1978 called 'python.exe' (the post-installer would have produced broken
1968 setups on systems with a differently named python binary).
1979 setups on systems with a differently named python binary).
1969
1980
1970 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1981 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1971 references to os.linesep, to make the code more
1982 references to os.linesep, to make the code more
1972 platform-independent. This is also part of the win32 coloring
1983 platform-independent. This is also part of the win32 coloring
1973 fixes.
1984 fixes.
1974
1985
1975 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1986 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1976 lines, which actually cause coloring bugs because the length of
1987 lines, which actually cause coloring bugs because the length of
1977 the line is very difficult to correctly compute with embedded
1988 the line is very difficult to correctly compute with embedded
1978 escapes. This was the source of all the coloring problems under
1989 escapes. This was the source of all the coloring problems under
1979 Win32. I think that _finally_, Win32 users have a properly
1990 Win32. I think that _finally_, Win32 users have a properly
1980 working ipython in all respects. This would never have happened
1991 working ipython in all respects. This would never have happened
1981 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1992 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1982
1993
1983 2005-01-26 *** Released version 0.6.9
1994 2005-01-26 *** Released version 0.6.9
1984
1995
1985 2005-01-25 Fernando Perez <fperez@colorado.edu>
1996 2005-01-25 Fernando Perez <fperez@colorado.edu>
1986
1997
1987 * setup.py: finally, we have a true Windows installer, thanks to
1998 * setup.py: finally, we have a true Windows installer, thanks to
1988 the excellent work of Viktor Ransmayr
1999 the excellent work of Viktor Ransmayr
1989 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2000 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1990 Windows users. The setup routine is quite a bit cleaner thanks to
2001 Windows users. The setup routine is quite a bit cleaner thanks to
1991 this, and the post-install script uses the proper functions to
2002 this, and the post-install script uses the proper functions to
1992 allow a clean de-installation using the standard Windows Control
2003 allow a clean de-installation using the standard Windows Control
1993 Panel.
2004 Panel.
1994
2005
1995 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2006 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1996 environment variable under all OSes (including win32) if
2007 environment variable under all OSes (including win32) if
1997 available. This will give consistency to win32 users who have set
2008 available. This will give consistency to win32 users who have set
1998 this variable for any reason. If os.environ['HOME'] fails, the
2009 this variable for any reason. If os.environ['HOME'] fails, the
1999 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2010 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2000
2011
2001 2005-01-24 Fernando Perez <fperez@colorado.edu>
2012 2005-01-24 Fernando Perez <fperez@colorado.edu>
2002
2013
2003 * IPython/numutils.py (empty_like): add empty_like(), similar to
2014 * IPython/numutils.py (empty_like): add empty_like(), similar to
2004 zeros_like() but taking advantage of the new empty() Numeric routine.
2015 zeros_like() but taking advantage of the new empty() Numeric routine.
2005
2016
2006 2005-01-23 *** Released version 0.6.8
2017 2005-01-23 *** Released version 0.6.8
2007
2018
2008 2005-01-22 Fernando Perez <fperez@colorado.edu>
2019 2005-01-22 Fernando Perez <fperez@colorado.edu>
2009
2020
2010 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2021 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2011 automatic show() calls. After discussing things with JDH, it
2022 automatic show() calls. After discussing things with JDH, it
2012 turns out there are too many corner cases where this can go wrong.
2023 turns out there are too many corner cases where this can go wrong.
2013 It's best not to try to be 'too smart', and simply have ipython
2024 It's best not to try to be 'too smart', and simply have ipython
2014 reproduce as much as possible the default behavior of a normal
2025 reproduce as much as possible the default behavior of a normal
2015 python shell.
2026 python shell.
2016
2027
2017 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2028 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2018 line-splitting regexp and _prefilter() to avoid calling getattr()
2029 line-splitting regexp and _prefilter() to avoid calling getattr()
2019 on assignments. This closes
2030 on assignments. This closes
2020 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2031 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2021 readline uses getattr(), so a simple <TAB> keypress is still
2032 readline uses getattr(), so a simple <TAB> keypress is still
2022 enough to trigger getattr() calls on an object.
2033 enough to trigger getattr() calls on an object.
2023
2034
2024 2005-01-21 Fernando Perez <fperez@colorado.edu>
2035 2005-01-21 Fernando Perez <fperez@colorado.edu>
2025
2036
2026 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2037 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2027 docstring under pylab so it doesn't mask the original.
2038 docstring under pylab so it doesn't mask the original.
2028
2039
2029 2005-01-21 *** Released version 0.6.7
2040 2005-01-21 *** Released version 0.6.7
2030
2041
2031 2005-01-21 Fernando Perez <fperez@colorado.edu>
2042 2005-01-21 Fernando Perez <fperez@colorado.edu>
2032
2043
2033 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2044 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2034 signal handling for win32 users in multithreaded mode.
2045 signal handling for win32 users in multithreaded mode.
2035
2046
2036 2005-01-17 Fernando Perez <fperez@colorado.edu>
2047 2005-01-17 Fernando Perez <fperez@colorado.edu>
2037
2048
2038 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2049 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2039 instances with no __init__. After a crash report by Norbert Nemec
2050 instances with no __init__. After a crash report by Norbert Nemec
2040 <Norbert-AT-nemec-online.de>.
2051 <Norbert-AT-nemec-online.de>.
2041
2052
2042 2005-01-14 Fernando Perez <fperez@colorado.edu>
2053 2005-01-14 Fernando Perez <fperez@colorado.edu>
2043
2054
2044 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2055 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2045 names for verbose exceptions, when multiple dotted names and the
2056 names for verbose exceptions, when multiple dotted names and the
2046 'parent' object were present on the same line.
2057 'parent' object were present on the same line.
2047
2058
2048 2005-01-11 Fernando Perez <fperez@colorado.edu>
2059 2005-01-11 Fernando Perez <fperez@colorado.edu>
2049
2060
2050 * IPython/genutils.py (flag_calls): new utility to trap and flag
2061 * IPython/genutils.py (flag_calls): new utility to trap and flag
2051 calls in functions. I need it to clean up matplotlib support.
2062 calls in functions. I need it to clean up matplotlib support.
2052 Also removed some deprecated code in genutils.
2063 Also removed some deprecated code in genutils.
2053
2064
2054 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2065 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2055 that matplotlib scripts called with %run, which don't call show()
2066 that matplotlib scripts called with %run, which don't call show()
2056 themselves, still have their plotting windows open.
2067 themselves, still have their plotting windows open.
2057
2068
2058 2005-01-05 Fernando Perez <fperez@colorado.edu>
2069 2005-01-05 Fernando Perez <fperez@colorado.edu>
2059
2070
2060 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2071 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2061 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2072 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2062
2073
2063 2004-12-19 Fernando Perez <fperez@colorado.edu>
2074 2004-12-19 Fernando Perez <fperez@colorado.edu>
2064
2075
2065 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2076 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2066 parent_runcode, which was an eyesore. The same result can be
2077 parent_runcode, which was an eyesore. The same result can be
2067 obtained with Python's regular superclass mechanisms.
2078 obtained with Python's regular superclass mechanisms.
2068
2079
2069 2004-12-17 Fernando Perez <fperez@colorado.edu>
2080 2004-12-17 Fernando Perez <fperez@colorado.edu>
2070
2081
2071 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2082 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2072 reported by Prabhu.
2083 reported by Prabhu.
2073 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2084 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2074 sys.stderr) instead of explicitly calling sys.stderr. This helps
2085 sys.stderr) instead of explicitly calling sys.stderr. This helps
2075 maintain our I/O abstractions clean, for future GUI embeddings.
2086 maintain our I/O abstractions clean, for future GUI embeddings.
2076
2087
2077 * IPython/genutils.py (info): added new utility for sys.stderr
2088 * IPython/genutils.py (info): added new utility for sys.stderr
2078 unified info message handling (thin wrapper around warn()).
2089 unified info message handling (thin wrapper around warn()).
2079
2090
2080 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2091 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2081 composite (dotted) names on verbose exceptions.
2092 composite (dotted) names on verbose exceptions.
2082 (VerboseTB.nullrepr): harden against another kind of errors which
2093 (VerboseTB.nullrepr): harden against another kind of errors which
2083 Python's inspect module can trigger, and which were crashing
2094 Python's inspect module can trigger, and which were crashing
2084 IPython. Thanks to a report by Marco Lombardi
2095 IPython. Thanks to a report by Marco Lombardi
2085 <mlombard-AT-ma010192.hq.eso.org>.
2096 <mlombard-AT-ma010192.hq.eso.org>.
2086
2097
2087 2004-12-13 *** Released version 0.6.6
2098 2004-12-13 *** Released version 0.6.6
2088
2099
2089 2004-12-12 Fernando Perez <fperez@colorado.edu>
2100 2004-12-12 Fernando Perez <fperez@colorado.edu>
2090
2101
2091 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2102 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2092 generated by pygtk upon initialization if it was built without
2103 generated by pygtk upon initialization if it was built without
2093 threads (for matplotlib users). After a crash reported by
2104 threads (for matplotlib users). After a crash reported by
2094 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2105 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2095
2106
2096 * IPython/ipmaker.py (make_IPython): fix small bug in the
2107 * IPython/ipmaker.py (make_IPython): fix small bug in the
2097 import_some parameter for multiple imports.
2108 import_some parameter for multiple imports.
2098
2109
2099 * IPython/iplib.py (ipmagic): simplified the interface of
2110 * IPython/iplib.py (ipmagic): simplified the interface of
2100 ipmagic() to take a single string argument, just as it would be
2111 ipmagic() to take a single string argument, just as it would be
2101 typed at the IPython cmd line.
2112 typed at the IPython cmd line.
2102 (ipalias): Added new ipalias() with an interface identical to
2113 (ipalias): Added new ipalias() with an interface identical to
2103 ipmagic(). This completes exposing a pure python interface to the
2114 ipmagic(). This completes exposing a pure python interface to the
2104 alias and magic system, which can be used in loops or more complex
2115 alias and magic system, which can be used in loops or more complex
2105 code where IPython's automatic line mangling is not active.
2116 code where IPython's automatic line mangling is not active.
2106
2117
2107 * IPython/genutils.py (timing): changed interface of timing to
2118 * IPython/genutils.py (timing): changed interface of timing to
2108 simply run code once, which is the most common case. timings()
2119 simply run code once, which is the most common case. timings()
2109 remains unchanged, for the cases where you want multiple runs.
2120 remains unchanged, for the cases where you want multiple runs.
2110
2121
2111 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2122 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2112 bug where Python2.2 crashes with exec'ing code which does not end
2123 bug where Python2.2 crashes with exec'ing code which does not end
2113 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2124 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2114 before.
2125 before.
2115
2126
2116 2004-12-10 Fernando Perez <fperez@colorado.edu>
2127 2004-12-10 Fernando Perez <fperez@colorado.edu>
2117
2128
2118 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2129 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2119 -t to -T, to accomodate the new -t flag in %run (the %run and
2130 -t to -T, to accomodate the new -t flag in %run (the %run and
2120 %prun options are kind of intermixed, and it's not easy to change
2131 %prun options are kind of intermixed, and it's not easy to change
2121 this with the limitations of python's getopt).
2132 this with the limitations of python's getopt).
2122
2133
2123 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2134 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2124 the execution of scripts. It's not as fine-tuned as timeit.py,
2135 the execution of scripts. It's not as fine-tuned as timeit.py,
2125 but it works from inside ipython (and under 2.2, which lacks
2136 but it works from inside ipython (and under 2.2, which lacks
2126 timeit.py). Optionally a number of runs > 1 can be given for
2137 timeit.py). Optionally a number of runs > 1 can be given for
2127 timing very short-running code.
2138 timing very short-running code.
2128
2139
2129 * IPython/genutils.py (uniq_stable): new routine which returns a
2140 * IPython/genutils.py (uniq_stable): new routine which returns a
2130 list of unique elements in any iterable, but in stable order of
2141 list of unique elements in any iterable, but in stable order of
2131 appearance. I needed this for the ultraTB fixes, and it's a handy
2142 appearance. I needed this for the ultraTB fixes, and it's a handy
2132 utility.
2143 utility.
2133
2144
2134 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2145 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2135 dotted names in Verbose exceptions. This had been broken since
2146 dotted names in Verbose exceptions. This had been broken since
2136 the very start, now x.y will properly be printed in a Verbose
2147 the very start, now x.y will properly be printed in a Verbose
2137 traceback, instead of x being shown and y appearing always as an
2148 traceback, instead of x being shown and y appearing always as an
2138 'undefined global'. Getting this to work was a bit tricky,
2149 'undefined global'. Getting this to work was a bit tricky,
2139 because by default python tokenizers are stateless. Saved by
2150 because by default python tokenizers are stateless. Saved by
2140 python's ability to easily add a bit of state to an arbitrary
2151 python's ability to easily add a bit of state to an arbitrary
2141 function (without needing to build a full-blown callable object).
2152 function (without needing to build a full-blown callable object).
2142
2153
2143 Also big cleanup of this code, which had horrendous runtime
2154 Also big cleanup of this code, which had horrendous runtime
2144 lookups of zillions of attributes for colorization. Moved all
2155 lookups of zillions of attributes for colorization. Moved all
2145 this code into a few templates, which make it cleaner and quicker.
2156 this code into a few templates, which make it cleaner and quicker.
2146
2157
2147 Printout quality was also improved for Verbose exceptions: one
2158 Printout quality was also improved for Verbose exceptions: one
2148 variable per line, and memory addresses are printed (this can be
2159 variable per line, and memory addresses are printed (this can be
2149 quite handy in nasty debugging situations, which is what Verbose
2160 quite handy in nasty debugging situations, which is what Verbose
2150 is for).
2161 is for).
2151
2162
2152 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2163 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2153 the command line as scripts to be loaded by embedded instances.
2164 the command line as scripts to be loaded by embedded instances.
2154 Doing so has the potential for an infinite recursion if there are
2165 Doing so has the potential for an infinite recursion if there are
2155 exceptions thrown in the process. This fixes a strange crash
2166 exceptions thrown in the process. This fixes a strange crash
2156 reported by Philippe MULLER <muller-AT-irit.fr>.
2167 reported by Philippe MULLER <muller-AT-irit.fr>.
2157
2168
2158 2004-12-09 Fernando Perez <fperez@colorado.edu>
2169 2004-12-09 Fernando Perez <fperez@colorado.edu>
2159
2170
2160 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2171 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2161 to reflect new names in matplotlib, which now expose the
2172 to reflect new names in matplotlib, which now expose the
2162 matlab-compatible interface via a pylab module instead of the
2173 matlab-compatible interface via a pylab module instead of the
2163 'matlab' name. The new code is backwards compatible, so users of
2174 'matlab' name. The new code is backwards compatible, so users of
2164 all matplotlib versions are OK. Patch by J. Hunter.
2175 all matplotlib versions are OK. Patch by J. Hunter.
2165
2176
2166 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2177 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2167 of __init__ docstrings for instances (class docstrings are already
2178 of __init__ docstrings for instances (class docstrings are already
2168 automatically printed). Instances with customized docstrings
2179 automatically printed). Instances with customized docstrings
2169 (indep. of the class) are also recognized and all 3 separate
2180 (indep. of the class) are also recognized and all 3 separate
2170 docstrings are printed (instance, class, constructor). After some
2181 docstrings are printed (instance, class, constructor). After some
2171 comments/suggestions by J. Hunter.
2182 comments/suggestions by J. Hunter.
2172
2183
2173 2004-12-05 Fernando Perez <fperez@colorado.edu>
2184 2004-12-05 Fernando Perez <fperez@colorado.edu>
2174
2185
2175 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2186 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2176 warnings when tab-completion fails and triggers an exception.
2187 warnings when tab-completion fails and triggers an exception.
2177
2188
2178 2004-12-03 Fernando Perez <fperez@colorado.edu>
2189 2004-12-03 Fernando Perez <fperez@colorado.edu>
2179
2190
2180 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2191 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2181 be triggered when using 'run -p'. An incorrect option flag was
2192 be triggered when using 'run -p'. An incorrect option flag was
2182 being set ('d' instead of 'D').
2193 being set ('d' instead of 'D').
2183 (manpage): fix missing escaped \- sign.
2194 (manpage): fix missing escaped \- sign.
2184
2195
2185 2004-11-30 *** Released version 0.6.5
2196 2004-11-30 *** Released version 0.6.5
2186
2197
2187 2004-11-30 Fernando Perez <fperez@colorado.edu>
2198 2004-11-30 Fernando Perez <fperez@colorado.edu>
2188
2199
2189 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2200 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2190 setting with -d option.
2201 setting with -d option.
2191
2202
2192 * setup.py (docfiles): Fix problem where the doc glob I was using
2203 * setup.py (docfiles): Fix problem where the doc glob I was using
2193 was COMPLETELY BROKEN. It was giving the right files by pure
2204 was COMPLETELY BROKEN. It was giving the right files by pure
2194 accident, but failed once I tried to include ipython.el. Note:
2205 accident, but failed once I tried to include ipython.el. Note:
2195 glob() does NOT allow you to do exclusion on multiple endings!
2206 glob() does NOT allow you to do exclusion on multiple endings!
2196
2207
2197 2004-11-29 Fernando Perez <fperez@colorado.edu>
2208 2004-11-29 Fernando Perez <fperez@colorado.edu>
2198
2209
2199 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2210 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2200 the manpage as the source. Better formatting & consistency.
2211 the manpage as the source. Better formatting & consistency.
2201
2212
2202 * IPython/Magic.py (magic_run): Added new -d option, to run
2213 * IPython/Magic.py (magic_run): Added new -d option, to run
2203 scripts under the control of the python pdb debugger. Note that
2214 scripts under the control of the python pdb debugger. Note that
2204 this required changing the %prun option -d to -D, to avoid a clash
2215 this required changing the %prun option -d to -D, to avoid a clash
2205 (since %run must pass options to %prun, and getopt is too dumb to
2216 (since %run must pass options to %prun, and getopt is too dumb to
2206 handle options with string values with embedded spaces). Thanks
2217 handle options with string values with embedded spaces). Thanks
2207 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2218 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2208 (magic_who_ls): added type matching to %who and %whos, so that one
2219 (magic_who_ls): added type matching to %who and %whos, so that one
2209 can filter their output to only include variables of certain
2220 can filter their output to only include variables of certain
2210 types. Another suggestion by Matthew.
2221 types. Another suggestion by Matthew.
2211 (magic_whos): Added memory summaries in kb and Mb for arrays.
2222 (magic_whos): Added memory summaries in kb and Mb for arrays.
2212 (magic_who): Improve formatting (break lines every 9 vars).
2223 (magic_who): Improve formatting (break lines every 9 vars).
2213
2224
2214 2004-11-28 Fernando Perez <fperez@colorado.edu>
2225 2004-11-28 Fernando Perez <fperez@colorado.edu>
2215
2226
2216 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2227 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2217 cache when empty lines were present.
2228 cache when empty lines were present.
2218
2229
2219 2004-11-24 Fernando Perez <fperez@colorado.edu>
2230 2004-11-24 Fernando Perez <fperez@colorado.edu>
2220
2231
2221 * IPython/usage.py (__doc__): document the re-activated threading
2232 * IPython/usage.py (__doc__): document the re-activated threading
2222 options for WX and GTK.
2233 options for WX and GTK.
2223
2234
2224 2004-11-23 Fernando Perez <fperez@colorado.edu>
2235 2004-11-23 Fernando Perez <fperez@colorado.edu>
2225
2236
2226 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2237 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2227 the -wthread and -gthread options, along with a new -tk one to try
2238 the -wthread and -gthread options, along with a new -tk one to try
2228 and coordinate Tk threading with wx/gtk. The tk support is very
2239 and coordinate Tk threading with wx/gtk. The tk support is very
2229 platform dependent, since it seems to require Tcl and Tk to be
2240 platform dependent, since it seems to require Tcl and Tk to be
2230 built with threads (Fedora1/2 appears NOT to have it, but in
2241 built with threads (Fedora1/2 appears NOT to have it, but in
2231 Prabhu's Debian boxes it works OK). But even with some Tk
2242 Prabhu's Debian boxes it works OK). But even with some Tk
2232 limitations, this is a great improvement.
2243 limitations, this is a great improvement.
2233
2244
2234 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2245 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2235 info in user prompts. Patch by Prabhu.
2246 info in user prompts. Patch by Prabhu.
2236
2247
2237 2004-11-18 Fernando Perez <fperez@colorado.edu>
2248 2004-11-18 Fernando Perez <fperez@colorado.edu>
2238
2249
2239 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2250 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2240 EOFErrors and bail, to avoid infinite loops if a non-terminating
2251 EOFErrors and bail, to avoid infinite loops if a non-terminating
2241 file is fed into ipython. Patch submitted in issue 19 by user,
2252 file is fed into ipython. Patch submitted in issue 19 by user,
2242 many thanks.
2253 many thanks.
2243
2254
2244 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2255 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2245 autoquote/parens in continuation prompts, which can cause lots of
2256 autoquote/parens in continuation prompts, which can cause lots of
2246 problems. Closes roundup issue 20.
2257 problems. Closes roundup issue 20.
2247
2258
2248 2004-11-17 Fernando Perez <fperez@colorado.edu>
2259 2004-11-17 Fernando Perez <fperez@colorado.edu>
2249
2260
2250 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2261 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2251 reported as debian bug #280505. I'm not sure my local changelog
2262 reported as debian bug #280505. I'm not sure my local changelog
2252 entry has the proper debian format (Jack?).
2263 entry has the proper debian format (Jack?).
2253
2264
2254 2004-11-08 *** Released version 0.6.4
2265 2004-11-08 *** Released version 0.6.4
2255
2266
2256 2004-11-08 Fernando Perez <fperez@colorado.edu>
2267 2004-11-08 Fernando Perez <fperez@colorado.edu>
2257
2268
2258 * IPython/iplib.py (init_readline): Fix exit message for Windows
2269 * IPython/iplib.py (init_readline): Fix exit message for Windows
2259 when readline is active. Thanks to a report by Eric Jones
2270 when readline is active. Thanks to a report by Eric Jones
2260 <eric-AT-enthought.com>.
2271 <eric-AT-enthought.com>.
2261
2272
2262 2004-11-07 Fernando Perez <fperez@colorado.edu>
2273 2004-11-07 Fernando Perez <fperez@colorado.edu>
2263
2274
2264 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2275 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2265 sometimes seen by win2k/cygwin users.
2276 sometimes seen by win2k/cygwin users.
2266
2277
2267 2004-11-06 Fernando Perez <fperez@colorado.edu>
2278 2004-11-06 Fernando Perez <fperez@colorado.edu>
2268
2279
2269 * IPython/iplib.py (interact): Change the handling of %Exit from
2280 * IPython/iplib.py (interact): Change the handling of %Exit from
2270 trying to propagate a SystemExit to an internal ipython flag.
2281 trying to propagate a SystemExit to an internal ipython flag.
2271 This is less elegant than using Python's exception mechanism, but
2282 This is less elegant than using Python's exception mechanism, but
2272 I can't get that to work reliably with threads, so under -pylab
2283 I can't get that to work reliably with threads, so under -pylab
2273 %Exit was hanging IPython. Cross-thread exception handling is
2284 %Exit was hanging IPython. Cross-thread exception handling is
2274 really a bitch. Thaks to a bug report by Stephen Walton
2285 really a bitch. Thaks to a bug report by Stephen Walton
2275 <stephen.walton-AT-csun.edu>.
2286 <stephen.walton-AT-csun.edu>.
2276
2287
2277 2004-11-04 Fernando Perez <fperez@colorado.edu>
2288 2004-11-04 Fernando Perez <fperez@colorado.edu>
2278
2289
2279 * IPython/iplib.py (raw_input_original): store a pointer to the
2290 * IPython/iplib.py (raw_input_original): store a pointer to the
2280 true raw_input to harden against code which can modify it
2291 true raw_input to harden against code which can modify it
2281 (wx.py.PyShell does this and would otherwise crash ipython).
2292 (wx.py.PyShell does this and would otherwise crash ipython).
2282 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2293 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2283
2294
2284 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2295 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2285 Ctrl-C problem, which does not mess up the input line.
2296 Ctrl-C problem, which does not mess up the input line.
2286
2297
2287 2004-11-03 Fernando Perez <fperez@colorado.edu>
2298 2004-11-03 Fernando Perez <fperez@colorado.edu>
2288
2299
2289 * IPython/Release.py: Changed licensing to BSD, in all files.
2300 * IPython/Release.py: Changed licensing to BSD, in all files.
2290 (name): lowercase name for tarball/RPM release.
2301 (name): lowercase name for tarball/RPM release.
2291
2302
2292 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2303 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2293 use throughout ipython.
2304 use throughout ipython.
2294
2305
2295 * IPython/Magic.py (Magic._ofind): Switch to using the new
2306 * IPython/Magic.py (Magic._ofind): Switch to using the new
2296 OInspect.getdoc() function.
2307 OInspect.getdoc() function.
2297
2308
2298 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2309 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2299 of the line currently being canceled via Ctrl-C. It's extremely
2310 of the line currently being canceled via Ctrl-C. It's extremely
2300 ugly, but I don't know how to do it better (the problem is one of
2311 ugly, but I don't know how to do it better (the problem is one of
2301 handling cross-thread exceptions).
2312 handling cross-thread exceptions).
2302
2313
2303 2004-10-28 Fernando Perez <fperez@colorado.edu>
2314 2004-10-28 Fernando Perez <fperez@colorado.edu>
2304
2315
2305 * IPython/Shell.py (signal_handler): add signal handlers to trap
2316 * IPython/Shell.py (signal_handler): add signal handlers to trap
2306 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2317 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2307 report by Francesc Alted.
2318 report by Francesc Alted.
2308
2319
2309 2004-10-21 Fernando Perez <fperez@colorado.edu>
2320 2004-10-21 Fernando Perez <fperez@colorado.edu>
2310
2321
2311 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2322 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2312 to % for pysh syntax extensions.
2323 to % for pysh syntax extensions.
2313
2324
2314 2004-10-09 Fernando Perez <fperez@colorado.edu>
2325 2004-10-09 Fernando Perez <fperez@colorado.edu>
2315
2326
2316 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2327 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2317 arrays to print a more useful summary, without calling str(arr).
2328 arrays to print a more useful summary, without calling str(arr).
2318 This avoids the problem of extremely lengthy computations which
2329 This avoids the problem of extremely lengthy computations which
2319 occur if arr is large, and appear to the user as a system lockup
2330 occur if arr is large, and appear to the user as a system lockup
2320 with 100% cpu activity. After a suggestion by Kristian Sandberg
2331 with 100% cpu activity. After a suggestion by Kristian Sandberg
2321 <Kristian.Sandberg@colorado.edu>.
2332 <Kristian.Sandberg@colorado.edu>.
2322 (Magic.__init__): fix bug in global magic escapes not being
2333 (Magic.__init__): fix bug in global magic escapes not being
2323 correctly set.
2334 correctly set.
2324
2335
2325 2004-10-08 Fernando Perez <fperez@colorado.edu>
2336 2004-10-08 Fernando Perez <fperez@colorado.edu>
2326
2337
2327 * IPython/Magic.py (__license__): change to absolute imports of
2338 * IPython/Magic.py (__license__): change to absolute imports of
2328 ipython's own internal packages, to start adapting to the absolute
2339 ipython's own internal packages, to start adapting to the absolute
2329 import requirement of PEP-328.
2340 import requirement of PEP-328.
2330
2341
2331 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2342 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2332 files, and standardize author/license marks through the Release
2343 files, and standardize author/license marks through the Release
2333 module instead of having per/file stuff (except for files with
2344 module instead of having per/file stuff (except for files with
2334 particular licenses, like the MIT/PSF-licensed codes).
2345 particular licenses, like the MIT/PSF-licensed codes).
2335
2346
2336 * IPython/Debugger.py: remove dead code for python 2.1
2347 * IPython/Debugger.py: remove dead code for python 2.1
2337
2348
2338 2004-10-04 Fernando Perez <fperez@colorado.edu>
2349 2004-10-04 Fernando Perez <fperez@colorado.edu>
2339
2350
2340 * IPython/iplib.py (ipmagic): New function for accessing magics
2351 * IPython/iplib.py (ipmagic): New function for accessing magics
2341 via a normal python function call.
2352 via a normal python function call.
2342
2353
2343 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2354 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2344 from '@' to '%', to accomodate the new @decorator syntax of python
2355 from '@' to '%', to accomodate the new @decorator syntax of python
2345 2.4.
2356 2.4.
2346
2357
2347 2004-09-29 Fernando Perez <fperez@colorado.edu>
2358 2004-09-29 Fernando Perez <fperez@colorado.edu>
2348
2359
2349 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2360 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2350 matplotlib.use to prevent running scripts which try to switch
2361 matplotlib.use to prevent running scripts which try to switch
2351 interactive backends from within ipython. This will just crash
2362 interactive backends from within ipython. This will just crash
2352 the python interpreter, so we can't allow it (but a detailed error
2363 the python interpreter, so we can't allow it (but a detailed error
2353 is given to the user).
2364 is given to the user).
2354
2365
2355 2004-09-28 Fernando Perez <fperez@colorado.edu>
2366 2004-09-28 Fernando Perez <fperez@colorado.edu>
2356
2367
2357 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2368 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2358 matplotlib-related fixes so that using @run with non-matplotlib
2369 matplotlib-related fixes so that using @run with non-matplotlib
2359 scripts doesn't pop up spurious plot windows. This requires
2370 scripts doesn't pop up spurious plot windows. This requires
2360 matplotlib >= 0.63, where I had to make some changes as well.
2371 matplotlib >= 0.63, where I had to make some changes as well.
2361
2372
2362 * IPython/ipmaker.py (make_IPython): update version requirement to
2373 * IPython/ipmaker.py (make_IPython): update version requirement to
2363 python 2.2.
2374 python 2.2.
2364
2375
2365 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2376 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2366 banner arg for embedded customization.
2377 banner arg for embedded customization.
2367
2378
2368 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2379 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2369 explicit uses of __IP as the IPython's instance name. Now things
2380 explicit uses of __IP as the IPython's instance name. Now things
2370 are properly handled via the shell.name value. The actual code
2381 are properly handled via the shell.name value. The actual code
2371 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2382 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2372 is much better than before. I'll clean things completely when the
2383 is much better than before. I'll clean things completely when the
2373 magic stuff gets a real overhaul.
2384 magic stuff gets a real overhaul.
2374
2385
2375 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2386 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2376 minor changes to debian dir.
2387 minor changes to debian dir.
2377
2388
2378 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2389 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2379 pointer to the shell itself in the interactive namespace even when
2390 pointer to the shell itself in the interactive namespace even when
2380 a user-supplied dict is provided. This is needed for embedding
2391 a user-supplied dict is provided. This is needed for embedding
2381 purposes (found by tests with Michel Sanner).
2392 purposes (found by tests with Michel Sanner).
2382
2393
2383 2004-09-27 Fernando Perez <fperez@colorado.edu>
2394 2004-09-27 Fernando Perez <fperez@colorado.edu>
2384
2395
2385 * IPython/UserConfig/ipythonrc: remove []{} from
2396 * IPython/UserConfig/ipythonrc: remove []{} from
2386 readline_remove_delims, so that things like [modname.<TAB> do
2397 readline_remove_delims, so that things like [modname.<TAB> do
2387 proper completion. This disables [].TAB, but that's a less common
2398 proper completion. This disables [].TAB, but that's a less common
2388 case than module names in list comprehensions, for example.
2399 case than module names in list comprehensions, for example.
2389 Thanks to a report by Andrea Riciputi.
2400 Thanks to a report by Andrea Riciputi.
2390
2401
2391 2004-09-09 Fernando Perez <fperez@colorado.edu>
2402 2004-09-09 Fernando Perez <fperez@colorado.edu>
2392
2403
2393 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2404 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2394 blocking problems in win32 and osx. Fix by John.
2405 blocking problems in win32 and osx. Fix by John.
2395
2406
2396 2004-09-08 Fernando Perez <fperez@colorado.edu>
2407 2004-09-08 Fernando Perez <fperez@colorado.edu>
2397
2408
2398 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2409 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2399 for Win32 and OSX. Fix by John Hunter.
2410 for Win32 and OSX. Fix by John Hunter.
2400
2411
2401 2004-08-30 *** Released version 0.6.3
2412 2004-08-30 *** Released version 0.6.3
2402
2413
2403 2004-08-30 Fernando Perez <fperez@colorado.edu>
2414 2004-08-30 Fernando Perez <fperez@colorado.edu>
2404
2415
2405 * setup.py (isfile): Add manpages to list of dependent files to be
2416 * setup.py (isfile): Add manpages to list of dependent files to be
2406 updated.
2417 updated.
2407
2418
2408 2004-08-27 Fernando Perez <fperez@colorado.edu>
2419 2004-08-27 Fernando Perez <fperez@colorado.edu>
2409
2420
2410 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2421 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2411 for now. They don't really work with standalone WX/GTK code
2422 for now. They don't really work with standalone WX/GTK code
2412 (though matplotlib IS working fine with both of those backends).
2423 (though matplotlib IS working fine with both of those backends).
2413 This will neeed much more testing. I disabled most things with
2424 This will neeed much more testing. I disabled most things with
2414 comments, so turning it back on later should be pretty easy.
2425 comments, so turning it back on later should be pretty easy.
2415
2426
2416 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2427 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2417 autocalling of expressions like r'foo', by modifying the line
2428 autocalling of expressions like r'foo', by modifying the line
2418 split regexp. Closes
2429 split regexp. Closes
2419 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2430 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2420 Riley <ipythonbugs-AT-sabi.net>.
2431 Riley <ipythonbugs-AT-sabi.net>.
2421 (InteractiveShell.mainloop): honor --nobanner with banner
2432 (InteractiveShell.mainloop): honor --nobanner with banner
2422 extensions.
2433 extensions.
2423
2434
2424 * IPython/Shell.py: Significant refactoring of all classes, so
2435 * IPython/Shell.py: Significant refactoring of all classes, so
2425 that we can really support ALL matplotlib backends and threading
2436 that we can really support ALL matplotlib backends and threading
2426 models (John spotted a bug with Tk which required this). Now we
2437 models (John spotted a bug with Tk which required this). Now we
2427 should support single-threaded, WX-threads and GTK-threads, both
2438 should support single-threaded, WX-threads and GTK-threads, both
2428 for generic code and for matplotlib.
2439 for generic code and for matplotlib.
2429
2440
2430 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2441 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2431 -pylab, to simplify things for users. Will also remove the pylab
2442 -pylab, to simplify things for users. Will also remove the pylab
2432 profile, since now all of matplotlib configuration is directly
2443 profile, since now all of matplotlib configuration is directly
2433 handled here. This also reduces startup time.
2444 handled here. This also reduces startup time.
2434
2445
2435 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2446 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2436 shell wasn't being correctly called. Also in IPShellWX.
2447 shell wasn't being correctly called. Also in IPShellWX.
2437
2448
2438 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2449 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2439 fine-tune banner.
2450 fine-tune banner.
2440
2451
2441 * IPython/numutils.py (spike): Deprecate these spike functions,
2452 * IPython/numutils.py (spike): Deprecate these spike functions,
2442 delete (long deprecated) gnuplot_exec handler.
2453 delete (long deprecated) gnuplot_exec handler.
2443
2454
2444 2004-08-26 Fernando Perez <fperez@colorado.edu>
2455 2004-08-26 Fernando Perez <fperez@colorado.edu>
2445
2456
2446 * ipython.1: Update for threading options, plus some others which
2457 * ipython.1: Update for threading options, plus some others which
2447 were missing.
2458 were missing.
2448
2459
2449 * IPython/ipmaker.py (__call__): Added -wthread option for
2460 * IPython/ipmaker.py (__call__): Added -wthread option for
2450 wxpython thread handling. Make sure threading options are only
2461 wxpython thread handling. Make sure threading options are only
2451 valid at the command line.
2462 valid at the command line.
2452
2463
2453 * scripts/ipython: moved shell selection into a factory function
2464 * scripts/ipython: moved shell selection into a factory function
2454 in Shell.py, to keep the starter script to a minimum.
2465 in Shell.py, to keep the starter script to a minimum.
2455
2466
2456 2004-08-25 Fernando Perez <fperez@colorado.edu>
2467 2004-08-25 Fernando Perez <fperez@colorado.edu>
2457
2468
2458 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2469 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2459 John. Along with some recent changes he made to matplotlib, the
2470 John. Along with some recent changes he made to matplotlib, the
2460 next versions of both systems should work very well together.
2471 next versions of both systems should work very well together.
2461
2472
2462 2004-08-24 Fernando Perez <fperez@colorado.edu>
2473 2004-08-24 Fernando Perez <fperez@colorado.edu>
2463
2474
2464 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2475 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2465 tried to switch the profiling to using hotshot, but I'm getting
2476 tried to switch the profiling to using hotshot, but I'm getting
2466 strange errors from prof.runctx() there. I may be misreading the
2477 strange errors from prof.runctx() there. I may be misreading the
2467 docs, but it looks weird. For now the profiling code will
2478 docs, but it looks weird. For now the profiling code will
2468 continue to use the standard profiler.
2479 continue to use the standard profiler.
2469
2480
2470 2004-08-23 Fernando Perez <fperez@colorado.edu>
2481 2004-08-23 Fernando Perez <fperez@colorado.edu>
2471
2482
2472 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2483 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2473 threaded shell, by John Hunter. It's not quite ready yet, but
2484 threaded shell, by John Hunter. It's not quite ready yet, but
2474 close.
2485 close.
2475
2486
2476 2004-08-22 Fernando Perez <fperez@colorado.edu>
2487 2004-08-22 Fernando Perez <fperez@colorado.edu>
2477
2488
2478 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2489 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2479 in Magic and ultraTB.
2490 in Magic and ultraTB.
2480
2491
2481 * ipython.1: document threading options in manpage.
2492 * ipython.1: document threading options in manpage.
2482
2493
2483 * scripts/ipython: Changed name of -thread option to -gthread,
2494 * scripts/ipython: Changed name of -thread option to -gthread,
2484 since this is GTK specific. I want to leave the door open for a
2495 since this is GTK specific. I want to leave the door open for a
2485 -wthread option for WX, which will most likely be necessary. This
2496 -wthread option for WX, which will most likely be necessary. This
2486 change affects usage and ipmaker as well.
2497 change affects usage and ipmaker as well.
2487
2498
2488 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2499 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2489 handle the matplotlib shell issues. Code by John Hunter
2500 handle the matplotlib shell issues. Code by John Hunter
2490 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2501 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2491 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2502 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2492 broken (and disabled for end users) for now, but it puts the
2503 broken (and disabled for end users) for now, but it puts the
2493 infrastructure in place.
2504 infrastructure in place.
2494
2505
2495 2004-08-21 Fernando Perez <fperez@colorado.edu>
2506 2004-08-21 Fernando Perez <fperez@colorado.edu>
2496
2507
2497 * ipythonrc-pylab: Add matplotlib support.
2508 * ipythonrc-pylab: Add matplotlib support.
2498
2509
2499 * matplotlib_config.py: new files for matplotlib support, part of
2510 * matplotlib_config.py: new files for matplotlib support, part of
2500 the pylab profile.
2511 the pylab profile.
2501
2512
2502 * IPython/usage.py (__doc__): documented the threading options.
2513 * IPython/usage.py (__doc__): documented the threading options.
2503
2514
2504 2004-08-20 Fernando Perez <fperez@colorado.edu>
2515 2004-08-20 Fernando Perez <fperez@colorado.edu>
2505
2516
2506 * ipython: Modified the main calling routine to handle the -thread
2517 * ipython: Modified the main calling routine to handle the -thread
2507 and -mpthread options. This needs to be done as a top-level hack,
2518 and -mpthread options. This needs to be done as a top-level hack,
2508 because it determines which class to instantiate for IPython
2519 because it determines which class to instantiate for IPython
2509 itself.
2520 itself.
2510
2521
2511 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2522 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2512 classes to support multithreaded GTK operation without blocking,
2523 classes to support multithreaded GTK operation without blocking,
2513 and matplotlib with all backends. This is a lot of still very
2524 and matplotlib with all backends. This is a lot of still very
2514 experimental code, and threads are tricky. So it may still have a
2525 experimental code, and threads are tricky. So it may still have a
2515 few rough edges... This code owes a lot to
2526 few rough edges... This code owes a lot to
2516 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2527 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2517 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2528 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2518 to John Hunter for all the matplotlib work.
2529 to John Hunter for all the matplotlib work.
2519
2530
2520 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2531 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2521 options for gtk thread and matplotlib support.
2532 options for gtk thread and matplotlib support.
2522
2533
2523 2004-08-16 Fernando Perez <fperez@colorado.edu>
2534 2004-08-16 Fernando Perez <fperez@colorado.edu>
2524
2535
2525 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2536 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2526 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2537 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2527 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2538 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2528
2539
2529 2004-08-11 Fernando Perez <fperez@colorado.edu>
2540 2004-08-11 Fernando Perez <fperez@colorado.edu>
2530
2541
2531 * setup.py (isfile): Fix build so documentation gets updated for
2542 * setup.py (isfile): Fix build so documentation gets updated for
2532 rpms (it was only done for .tgz builds).
2543 rpms (it was only done for .tgz builds).
2533
2544
2534 2004-08-10 Fernando Perez <fperez@colorado.edu>
2545 2004-08-10 Fernando Perez <fperez@colorado.edu>
2535
2546
2536 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2547 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2537
2548
2538 * iplib.py : Silence syntax error exceptions in tab-completion.
2549 * iplib.py : Silence syntax error exceptions in tab-completion.
2539
2550
2540 2004-08-05 Fernando Perez <fperez@colorado.edu>
2551 2004-08-05 Fernando Perez <fperez@colorado.edu>
2541
2552
2542 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2553 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2543 'color off' mark for continuation prompts. This was causing long
2554 'color off' mark for continuation prompts. This was causing long
2544 continuation lines to mis-wrap.
2555 continuation lines to mis-wrap.
2545
2556
2546 2004-08-01 Fernando Perez <fperez@colorado.edu>
2557 2004-08-01 Fernando Perez <fperez@colorado.edu>
2547
2558
2548 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2559 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2549 for building ipython to be a parameter. All this is necessary
2560 for building ipython to be a parameter. All this is necessary
2550 right now to have a multithreaded version, but this insane
2561 right now to have a multithreaded version, but this insane
2551 non-design will be cleaned up soon. For now, it's a hack that
2562 non-design will be cleaned up soon. For now, it's a hack that
2552 works.
2563 works.
2553
2564
2554 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2565 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2555 args in various places. No bugs so far, but it's a dangerous
2566 args in various places. No bugs so far, but it's a dangerous
2556 practice.
2567 practice.
2557
2568
2558 2004-07-31 Fernando Perez <fperez@colorado.edu>
2569 2004-07-31 Fernando Perez <fperez@colorado.edu>
2559
2570
2560 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2571 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2561 fix completion of files with dots in their names under most
2572 fix completion of files with dots in their names under most
2562 profiles (pysh was OK because the completion order is different).
2573 profiles (pysh was OK because the completion order is different).
2563
2574
2564 2004-07-27 Fernando Perez <fperez@colorado.edu>
2575 2004-07-27 Fernando Perez <fperez@colorado.edu>
2565
2576
2566 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2577 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2567 keywords manually, b/c the one in keyword.py was removed in python
2578 keywords manually, b/c the one in keyword.py was removed in python
2568 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2579 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2569 This is NOT a bug under python 2.3 and earlier.
2580 This is NOT a bug under python 2.3 and earlier.
2570
2581
2571 2004-07-26 Fernando Perez <fperez@colorado.edu>
2582 2004-07-26 Fernando Perez <fperez@colorado.edu>
2572
2583
2573 * IPython/ultraTB.py (VerboseTB.text): Add another
2584 * IPython/ultraTB.py (VerboseTB.text): Add another
2574 linecache.checkcache() call to try to prevent inspect.py from
2585 linecache.checkcache() call to try to prevent inspect.py from
2575 crashing under python 2.3. I think this fixes
2586 crashing under python 2.3. I think this fixes
2576 http://www.scipy.net/roundup/ipython/issue17.
2587 http://www.scipy.net/roundup/ipython/issue17.
2577
2588
2578 2004-07-26 *** Released version 0.6.2
2589 2004-07-26 *** Released version 0.6.2
2579
2590
2580 2004-07-26 Fernando Perez <fperez@colorado.edu>
2591 2004-07-26 Fernando Perez <fperez@colorado.edu>
2581
2592
2582 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2593 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2583 fail for any number.
2594 fail for any number.
2584 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2595 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2585 empty bookmarks.
2596 empty bookmarks.
2586
2597
2587 2004-07-26 *** Released version 0.6.1
2598 2004-07-26 *** Released version 0.6.1
2588
2599
2589 2004-07-26 Fernando Perez <fperez@colorado.edu>
2600 2004-07-26 Fernando Perez <fperez@colorado.edu>
2590
2601
2591 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2602 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2592
2603
2593 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2604 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2594 escaping '()[]{}' in filenames.
2605 escaping '()[]{}' in filenames.
2595
2606
2596 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2607 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2597 Python 2.2 users who lack a proper shlex.split.
2608 Python 2.2 users who lack a proper shlex.split.
2598
2609
2599 2004-07-19 Fernando Perez <fperez@colorado.edu>
2610 2004-07-19 Fernando Perez <fperez@colorado.edu>
2600
2611
2601 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2612 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2602 for reading readline's init file. I follow the normal chain:
2613 for reading readline's init file. I follow the normal chain:
2603 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2614 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2604 report by Mike Heeter. This closes
2615 report by Mike Heeter. This closes
2605 http://www.scipy.net/roundup/ipython/issue16.
2616 http://www.scipy.net/roundup/ipython/issue16.
2606
2617
2607 2004-07-18 Fernando Perez <fperez@colorado.edu>
2618 2004-07-18 Fernando Perez <fperez@colorado.edu>
2608
2619
2609 * IPython/iplib.py (__init__): Add better handling of '\' under
2620 * IPython/iplib.py (__init__): Add better handling of '\' under
2610 Win32 for filenames. After a patch by Ville.
2621 Win32 for filenames. After a patch by Ville.
2611
2622
2612 2004-07-17 Fernando Perez <fperez@colorado.edu>
2623 2004-07-17 Fernando Perez <fperez@colorado.edu>
2613
2624
2614 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2625 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2615 autocalling would be triggered for 'foo is bar' if foo is
2626 autocalling would be triggered for 'foo is bar' if foo is
2616 callable. I also cleaned up the autocall detection code to use a
2627 callable. I also cleaned up the autocall detection code to use a
2617 regexp, which is faster. Bug reported by Alexander Schmolck.
2628 regexp, which is faster. Bug reported by Alexander Schmolck.
2618
2629
2619 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2630 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2620 '?' in them would confuse the help system. Reported by Alex
2631 '?' in them would confuse the help system. Reported by Alex
2621 Schmolck.
2632 Schmolck.
2622
2633
2623 2004-07-16 Fernando Perez <fperez@colorado.edu>
2634 2004-07-16 Fernando Perez <fperez@colorado.edu>
2624
2635
2625 * IPython/GnuplotInteractive.py (__all__): added plot2.
2636 * IPython/GnuplotInteractive.py (__all__): added plot2.
2626
2637
2627 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2638 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2628 plotting dictionaries, lists or tuples of 1d arrays.
2639 plotting dictionaries, lists or tuples of 1d arrays.
2629
2640
2630 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2641 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2631 optimizations.
2642 optimizations.
2632
2643
2633 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2644 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2634 the information which was there from Janko's original IPP code:
2645 the information which was there from Janko's original IPP code:
2635
2646
2636 03.05.99 20:53 porto.ifm.uni-kiel.de
2647 03.05.99 20:53 porto.ifm.uni-kiel.de
2637 --Started changelog.
2648 --Started changelog.
2638 --make clear do what it say it does
2649 --make clear do what it say it does
2639 --added pretty output of lines from inputcache
2650 --added pretty output of lines from inputcache
2640 --Made Logger a mixin class, simplifies handling of switches
2651 --Made Logger a mixin class, simplifies handling of switches
2641 --Added own completer class. .string<TAB> expands to last history
2652 --Added own completer class. .string<TAB> expands to last history
2642 line which starts with string. The new expansion is also present
2653 line which starts with string. The new expansion is also present
2643 with Ctrl-r from the readline library. But this shows, who this
2654 with Ctrl-r from the readline library. But this shows, who this
2644 can be done for other cases.
2655 can be done for other cases.
2645 --Added convention that all shell functions should accept a
2656 --Added convention that all shell functions should accept a
2646 parameter_string This opens the door for different behaviour for
2657 parameter_string This opens the door for different behaviour for
2647 each function. @cd is a good example of this.
2658 each function. @cd is a good example of this.
2648
2659
2649 04.05.99 12:12 porto.ifm.uni-kiel.de
2660 04.05.99 12:12 porto.ifm.uni-kiel.de
2650 --added logfile rotation
2661 --added logfile rotation
2651 --added new mainloop method which freezes first the namespace
2662 --added new mainloop method which freezes first the namespace
2652
2663
2653 07.05.99 21:24 porto.ifm.uni-kiel.de
2664 07.05.99 21:24 porto.ifm.uni-kiel.de
2654 --added the docreader classes. Now there is a help system.
2665 --added the docreader classes. Now there is a help system.
2655 -This is only a first try. Currently it's not easy to put new
2666 -This is only a first try. Currently it's not easy to put new
2656 stuff in the indices. But this is the way to go. Info would be
2667 stuff in the indices. But this is the way to go. Info would be
2657 better, but HTML is every where and not everybody has an info
2668 better, but HTML is every where and not everybody has an info
2658 system installed and it's not so easy to change html-docs to info.
2669 system installed and it's not so easy to change html-docs to info.
2659 --added global logfile option
2670 --added global logfile option
2660 --there is now a hook for object inspection method pinfo needs to
2671 --there is now a hook for object inspection method pinfo needs to
2661 be provided for this. Can be reached by two '??'.
2672 be provided for this. Can be reached by two '??'.
2662
2673
2663 08.05.99 20:51 porto.ifm.uni-kiel.de
2674 08.05.99 20:51 porto.ifm.uni-kiel.de
2664 --added a README
2675 --added a README
2665 --bug in rc file. Something has changed so functions in the rc
2676 --bug in rc file. Something has changed so functions in the rc
2666 file need to reference the shell and not self. Not clear if it's a
2677 file need to reference the shell and not self. Not clear if it's a
2667 bug or feature.
2678 bug or feature.
2668 --changed rc file for new behavior
2679 --changed rc file for new behavior
2669
2680
2670 2004-07-15 Fernando Perez <fperez@colorado.edu>
2681 2004-07-15 Fernando Perez <fperez@colorado.edu>
2671
2682
2672 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2683 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2673 cache was falling out of sync in bizarre manners when multi-line
2684 cache was falling out of sync in bizarre manners when multi-line
2674 input was present. Minor optimizations and cleanup.
2685 input was present. Minor optimizations and cleanup.
2675
2686
2676 (Logger): Remove old Changelog info for cleanup. This is the
2687 (Logger): Remove old Changelog info for cleanup. This is the
2677 information which was there from Janko's original code:
2688 information which was there from Janko's original code:
2678
2689
2679 Changes to Logger: - made the default log filename a parameter
2690 Changes to Logger: - made the default log filename a parameter
2680
2691
2681 - put a check for lines beginning with !@? in log(). Needed
2692 - put a check for lines beginning with !@? in log(). Needed
2682 (even if the handlers properly log their lines) for mid-session
2693 (even if the handlers properly log their lines) for mid-session
2683 logging activation to work properly. Without this, lines logged
2694 logging activation to work properly. Without this, lines logged
2684 in mid session, which get read from the cache, would end up
2695 in mid session, which get read from the cache, would end up
2685 'bare' (with !@? in the open) in the log. Now they are caught
2696 'bare' (with !@? in the open) in the log. Now they are caught
2686 and prepended with a #.
2697 and prepended with a #.
2687
2698
2688 * IPython/iplib.py (InteractiveShell.init_readline): added check
2699 * IPython/iplib.py (InteractiveShell.init_readline): added check
2689 in case MagicCompleter fails to be defined, so we don't crash.
2700 in case MagicCompleter fails to be defined, so we don't crash.
2690
2701
2691 2004-07-13 Fernando Perez <fperez@colorado.edu>
2702 2004-07-13 Fernando Perez <fperez@colorado.edu>
2692
2703
2693 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2704 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2694 of EPS if the requested filename ends in '.eps'.
2705 of EPS if the requested filename ends in '.eps'.
2695
2706
2696 2004-07-04 Fernando Perez <fperez@colorado.edu>
2707 2004-07-04 Fernando Perez <fperez@colorado.edu>
2697
2708
2698 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2709 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2699 escaping of quotes when calling the shell.
2710 escaping of quotes when calling the shell.
2700
2711
2701 2004-07-02 Fernando Perez <fperez@colorado.edu>
2712 2004-07-02 Fernando Perez <fperez@colorado.edu>
2702
2713
2703 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2714 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2704 gettext not working because we were clobbering '_'. Fixes
2715 gettext not working because we were clobbering '_'. Fixes
2705 http://www.scipy.net/roundup/ipython/issue6.
2716 http://www.scipy.net/roundup/ipython/issue6.
2706
2717
2707 2004-07-01 Fernando Perez <fperez@colorado.edu>
2718 2004-07-01 Fernando Perez <fperez@colorado.edu>
2708
2719
2709 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2720 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2710 into @cd. Patch by Ville.
2721 into @cd. Patch by Ville.
2711
2722
2712 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2723 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2713 new function to store things after ipmaker runs. Patch by Ville.
2724 new function to store things after ipmaker runs. Patch by Ville.
2714 Eventually this will go away once ipmaker is removed and the class
2725 Eventually this will go away once ipmaker is removed and the class
2715 gets cleaned up, but for now it's ok. Key functionality here is
2726 gets cleaned up, but for now it's ok. Key functionality here is
2716 the addition of the persistent storage mechanism, a dict for
2727 the addition of the persistent storage mechanism, a dict for
2717 keeping data across sessions (for now just bookmarks, but more can
2728 keeping data across sessions (for now just bookmarks, but more can
2718 be implemented later).
2729 be implemented later).
2719
2730
2720 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2731 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2721 persistent across sections. Patch by Ville, I modified it
2732 persistent across sections. Patch by Ville, I modified it
2722 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2733 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2723 added a '-l' option to list all bookmarks.
2734 added a '-l' option to list all bookmarks.
2724
2735
2725 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2736 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2726 center for cleanup. Registered with atexit.register(). I moved
2737 center for cleanup. Registered with atexit.register(). I moved
2727 here the old exit_cleanup(). After a patch by Ville.
2738 here the old exit_cleanup(). After a patch by Ville.
2728
2739
2729 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2740 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2730 characters in the hacked shlex_split for python 2.2.
2741 characters in the hacked shlex_split for python 2.2.
2731
2742
2732 * IPython/iplib.py (file_matches): more fixes to filenames with
2743 * IPython/iplib.py (file_matches): more fixes to filenames with
2733 whitespace in them. It's not perfect, but limitations in python's
2744 whitespace in them. It's not perfect, but limitations in python's
2734 readline make it impossible to go further.
2745 readline make it impossible to go further.
2735
2746
2736 2004-06-29 Fernando Perez <fperez@colorado.edu>
2747 2004-06-29 Fernando Perez <fperez@colorado.edu>
2737
2748
2738 * IPython/iplib.py (file_matches): escape whitespace correctly in
2749 * IPython/iplib.py (file_matches): escape whitespace correctly in
2739 filename completions. Bug reported by Ville.
2750 filename completions. Bug reported by Ville.
2740
2751
2741 2004-06-28 Fernando Perez <fperez@colorado.edu>
2752 2004-06-28 Fernando Perez <fperez@colorado.edu>
2742
2753
2743 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2754 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2744 the history file will be called 'history-PROFNAME' (or just
2755 the history file will be called 'history-PROFNAME' (or just
2745 'history' if no profile is loaded). I was getting annoyed at
2756 'history' if no profile is loaded). I was getting annoyed at
2746 getting my Numerical work history clobbered by pysh sessions.
2757 getting my Numerical work history clobbered by pysh sessions.
2747
2758
2748 * IPython/iplib.py (InteractiveShell.__init__): Internal
2759 * IPython/iplib.py (InteractiveShell.__init__): Internal
2749 getoutputerror() function so that we can honor the system_verbose
2760 getoutputerror() function so that we can honor the system_verbose
2750 flag for _all_ system calls. I also added escaping of #
2761 flag for _all_ system calls. I also added escaping of #
2751 characters here to avoid confusing Itpl.
2762 characters here to avoid confusing Itpl.
2752
2763
2753 * IPython/Magic.py (shlex_split): removed call to shell in
2764 * IPython/Magic.py (shlex_split): removed call to shell in
2754 parse_options and replaced it with shlex.split(). The annoying
2765 parse_options and replaced it with shlex.split(). The annoying
2755 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2766 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2756 to backport it from 2.3, with several frail hacks (the shlex
2767 to backport it from 2.3, with several frail hacks (the shlex
2757 module is rather limited in 2.2). Thanks to a suggestion by Ville
2768 module is rather limited in 2.2). Thanks to a suggestion by Ville
2758 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2769 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2759 problem.
2770 problem.
2760
2771
2761 (Magic.magic_system_verbose): new toggle to print the actual
2772 (Magic.magic_system_verbose): new toggle to print the actual
2762 system calls made by ipython. Mainly for debugging purposes.
2773 system calls made by ipython. Mainly for debugging purposes.
2763
2774
2764 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2775 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2765 doesn't support persistence. Reported (and fix suggested) by
2776 doesn't support persistence. Reported (and fix suggested) by
2766 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2777 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2767
2778
2768 2004-06-26 Fernando Perez <fperez@colorado.edu>
2779 2004-06-26 Fernando Perez <fperez@colorado.edu>
2769
2780
2770 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2781 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2771 continue prompts.
2782 continue prompts.
2772
2783
2773 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2784 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2774 function (basically a big docstring) and a few more things here to
2785 function (basically a big docstring) and a few more things here to
2775 speedup startup. pysh.py is now very lightweight. We want because
2786 speedup startup. pysh.py is now very lightweight. We want because
2776 it gets execfile'd, while InterpreterExec gets imported, so
2787 it gets execfile'd, while InterpreterExec gets imported, so
2777 byte-compilation saves time.
2788 byte-compilation saves time.
2778
2789
2779 2004-06-25 Fernando Perez <fperez@colorado.edu>
2790 2004-06-25 Fernando Perez <fperez@colorado.edu>
2780
2791
2781 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2792 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2782 -NUM', which was recently broken.
2793 -NUM', which was recently broken.
2783
2794
2784 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2795 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2785 in multi-line input (but not !!, which doesn't make sense there).
2796 in multi-line input (but not !!, which doesn't make sense there).
2786
2797
2787 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2798 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2788 It's just too useful, and people can turn it off in the less
2799 It's just too useful, and people can turn it off in the less
2789 common cases where it's a problem.
2800 common cases where it's a problem.
2790
2801
2791 2004-06-24 Fernando Perez <fperez@colorado.edu>
2802 2004-06-24 Fernando Perez <fperez@colorado.edu>
2792
2803
2793 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2804 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2794 special syntaxes (like alias calling) is now allied in multi-line
2805 special syntaxes (like alias calling) is now allied in multi-line
2795 input. This is still _very_ experimental, but it's necessary for
2806 input. This is still _very_ experimental, but it's necessary for
2796 efficient shell usage combining python looping syntax with system
2807 efficient shell usage combining python looping syntax with system
2797 calls. For now it's restricted to aliases, I don't think it
2808 calls. For now it's restricted to aliases, I don't think it
2798 really even makes sense to have this for magics.
2809 really even makes sense to have this for magics.
2799
2810
2800 2004-06-23 Fernando Perez <fperez@colorado.edu>
2811 2004-06-23 Fernando Perez <fperez@colorado.edu>
2801
2812
2802 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2813 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2803 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2814 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2804
2815
2805 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2816 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2806 extensions under Windows (after code sent by Gary Bishop). The
2817 extensions under Windows (after code sent by Gary Bishop). The
2807 extensions considered 'executable' are stored in IPython's rc
2818 extensions considered 'executable' are stored in IPython's rc
2808 structure as win_exec_ext.
2819 structure as win_exec_ext.
2809
2820
2810 * IPython/genutils.py (shell): new function, like system() but
2821 * IPython/genutils.py (shell): new function, like system() but
2811 without return value. Very useful for interactive shell work.
2822 without return value. Very useful for interactive shell work.
2812
2823
2813 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2824 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2814 delete aliases.
2825 delete aliases.
2815
2826
2816 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2827 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2817 sure that the alias table doesn't contain python keywords.
2828 sure that the alias table doesn't contain python keywords.
2818
2829
2819 2004-06-21 Fernando Perez <fperez@colorado.edu>
2830 2004-06-21 Fernando Perez <fperez@colorado.edu>
2820
2831
2821 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2832 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2822 non-existent items are found in $PATH. Reported by Thorsten.
2833 non-existent items are found in $PATH. Reported by Thorsten.
2823
2834
2824 2004-06-20 Fernando Perez <fperez@colorado.edu>
2835 2004-06-20 Fernando Perez <fperez@colorado.edu>
2825
2836
2826 * IPython/iplib.py (complete): modified the completer so that the
2837 * IPython/iplib.py (complete): modified the completer so that the
2827 order of priorities can be easily changed at runtime.
2838 order of priorities can be easily changed at runtime.
2828
2839
2829 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2840 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2830 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2841 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2831
2842
2832 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2843 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2833 expand Python variables prepended with $ in all system calls. The
2844 expand Python variables prepended with $ in all system calls. The
2834 same was done to InteractiveShell.handle_shell_escape. Now all
2845 same was done to InteractiveShell.handle_shell_escape. Now all
2835 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2846 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2836 expansion of python variables and expressions according to the
2847 expansion of python variables and expressions according to the
2837 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2848 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2838
2849
2839 Though PEP-215 has been rejected, a similar (but simpler) one
2850 Though PEP-215 has been rejected, a similar (but simpler) one
2840 seems like it will go into Python 2.4, PEP-292 -
2851 seems like it will go into Python 2.4, PEP-292 -
2841 http://www.python.org/peps/pep-0292.html.
2852 http://www.python.org/peps/pep-0292.html.
2842
2853
2843 I'll keep the full syntax of PEP-215, since IPython has since the
2854 I'll keep the full syntax of PEP-215, since IPython has since the
2844 start used Ka-Ping Yee's reference implementation discussed there
2855 start used Ka-Ping Yee's reference implementation discussed there
2845 (Itpl), and I actually like the powerful semantics it offers.
2856 (Itpl), and I actually like the powerful semantics it offers.
2846
2857
2847 In order to access normal shell variables, the $ has to be escaped
2858 In order to access normal shell variables, the $ has to be escaped
2848 via an extra $. For example:
2859 via an extra $. For example:
2849
2860
2850 In [7]: PATH='a python variable'
2861 In [7]: PATH='a python variable'
2851
2862
2852 In [8]: !echo $PATH
2863 In [8]: !echo $PATH
2853 a python variable
2864 a python variable
2854
2865
2855 In [9]: !echo $$PATH
2866 In [9]: !echo $$PATH
2856 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2867 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2857
2868
2858 (Magic.parse_options): escape $ so the shell doesn't evaluate
2869 (Magic.parse_options): escape $ so the shell doesn't evaluate
2859 things prematurely.
2870 things prematurely.
2860
2871
2861 * IPython/iplib.py (InteractiveShell.call_alias): added the
2872 * IPython/iplib.py (InteractiveShell.call_alias): added the
2862 ability for aliases to expand python variables via $.
2873 ability for aliases to expand python variables via $.
2863
2874
2864 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2875 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2865 system, now there's a @rehash/@rehashx pair of magics. These work
2876 system, now there's a @rehash/@rehashx pair of magics. These work
2866 like the csh rehash command, and can be invoked at any time. They
2877 like the csh rehash command, and can be invoked at any time. They
2867 build a table of aliases to everything in the user's $PATH
2878 build a table of aliases to everything in the user's $PATH
2868 (@rehash uses everything, @rehashx is slower but only adds
2879 (@rehash uses everything, @rehashx is slower but only adds
2869 executable files). With this, the pysh.py-based shell profile can
2880 executable files). With this, the pysh.py-based shell profile can
2870 now simply call rehash upon startup, and full access to all
2881 now simply call rehash upon startup, and full access to all
2871 programs in the user's path is obtained.
2882 programs in the user's path is obtained.
2872
2883
2873 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2884 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2874 functionality is now fully in place. I removed the old dynamic
2885 functionality is now fully in place. I removed the old dynamic
2875 code generation based approach, in favor of a much lighter one
2886 code generation based approach, in favor of a much lighter one
2876 based on a simple dict. The advantage is that this allows me to
2887 based on a simple dict. The advantage is that this allows me to
2877 now have thousands of aliases with negligible cost (unthinkable
2888 now have thousands of aliases with negligible cost (unthinkable
2878 with the old system).
2889 with the old system).
2879
2890
2880 2004-06-19 Fernando Perez <fperez@colorado.edu>
2891 2004-06-19 Fernando Perez <fperez@colorado.edu>
2881
2892
2882 * IPython/iplib.py (__init__): extended MagicCompleter class to
2893 * IPython/iplib.py (__init__): extended MagicCompleter class to
2883 also complete (last in priority) on user aliases.
2894 also complete (last in priority) on user aliases.
2884
2895
2885 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2896 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2886 call to eval.
2897 call to eval.
2887 (ItplNS.__init__): Added a new class which functions like Itpl,
2898 (ItplNS.__init__): Added a new class which functions like Itpl,
2888 but allows configuring the namespace for the evaluation to occur
2899 but allows configuring the namespace for the evaluation to occur
2889 in.
2900 in.
2890
2901
2891 2004-06-18 Fernando Perez <fperez@colorado.edu>
2902 2004-06-18 Fernando Perez <fperez@colorado.edu>
2892
2903
2893 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2904 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2894 better message when 'exit' or 'quit' are typed (a common newbie
2905 better message when 'exit' or 'quit' are typed (a common newbie
2895 confusion).
2906 confusion).
2896
2907
2897 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2908 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2898 check for Windows users.
2909 check for Windows users.
2899
2910
2900 * IPython/iplib.py (InteractiveShell.user_setup): removed
2911 * IPython/iplib.py (InteractiveShell.user_setup): removed
2901 disabling of colors for Windows. I'll test at runtime and issue a
2912 disabling of colors for Windows. I'll test at runtime and issue a
2902 warning if Gary's readline isn't found, as to nudge users to
2913 warning if Gary's readline isn't found, as to nudge users to
2903 download it.
2914 download it.
2904
2915
2905 2004-06-16 Fernando Perez <fperez@colorado.edu>
2916 2004-06-16 Fernando Perez <fperez@colorado.edu>
2906
2917
2907 * IPython/genutils.py (Stream.__init__): changed to print errors
2918 * IPython/genutils.py (Stream.__init__): changed to print errors
2908 to sys.stderr. I had a circular dependency here. Now it's
2919 to sys.stderr. I had a circular dependency here. Now it's
2909 possible to run ipython as IDLE's shell (consider this pre-alpha,
2920 possible to run ipython as IDLE's shell (consider this pre-alpha,
2910 since true stdout things end up in the starting terminal instead
2921 since true stdout things end up in the starting terminal instead
2911 of IDLE's out).
2922 of IDLE's out).
2912
2923
2913 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2924 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2914 users who haven't # updated their prompt_in2 definitions. Remove
2925 users who haven't # updated their prompt_in2 definitions. Remove
2915 eventually.
2926 eventually.
2916 (multiple_replace): added credit to original ASPN recipe.
2927 (multiple_replace): added credit to original ASPN recipe.
2917
2928
2918 2004-06-15 Fernando Perez <fperez@colorado.edu>
2929 2004-06-15 Fernando Perez <fperez@colorado.edu>
2919
2930
2920 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2931 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2921 list of auto-defined aliases.
2932 list of auto-defined aliases.
2922
2933
2923 2004-06-13 Fernando Perez <fperez@colorado.edu>
2934 2004-06-13 Fernando Perez <fperez@colorado.edu>
2924
2935
2925 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2936 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2926 install was really requested (so setup.py can be used for other
2937 install was really requested (so setup.py can be used for other
2927 things under Windows).
2938 things under Windows).
2928
2939
2929 2004-06-10 Fernando Perez <fperez@colorado.edu>
2940 2004-06-10 Fernando Perez <fperez@colorado.edu>
2930
2941
2931 * IPython/Logger.py (Logger.create_log): Manually remove any old
2942 * IPython/Logger.py (Logger.create_log): Manually remove any old
2932 backup, since os.remove may fail under Windows. Fixes bug
2943 backup, since os.remove may fail under Windows. Fixes bug
2933 reported by Thorsten.
2944 reported by Thorsten.
2934
2945
2935 2004-06-09 Fernando Perez <fperez@colorado.edu>
2946 2004-06-09 Fernando Perez <fperez@colorado.edu>
2936
2947
2937 * examples/example-embed.py: fixed all references to %n (replaced
2948 * examples/example-embed.py: fixed all references to %n (replaced
2938 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2949 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2939 for all examples and the manual as well.
2950 for all examples and the manual as well.
2940
2951
2941 2004-06-08 Fernando Perez <fperez@colorado.edu>
2952 2004-06-08 Fernando Perez <fperez@colorado.edu>
2942
2953
2943 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2954 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2944 alignment and color management. All 3 prompt subsystems now
2955 alignment and color management. All 3 prompt subsystems now
2945 inherit from BasePrompt.
2956 inherit from BasePrompt.
2946
2957
2947 * tools/release: updates for windows installer build and tag rpms
2958 * tools/release: updates for windows installer build and tag rpms
2948 with python version (since paths are fixed).
2959 with python version (since paths are fixed).
2949
2960
2950 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2961 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2951 which will become eventually obsolete. Also fixed the default
2962 which will become eventually obsolete. Also fixed the default
2952 prompt_in2 to use \D, so at least new users start with the correct
2963 prompt_in2 to use \D, so at least new users start with the correct
2953 defaults.
2964 defaults.
2954 WARNING: Users with existing ipythonrc files will need to apply
2965 WARNING: Users with existing ipythonrc files will need to apply
2955 this fix manually!
2966 this fix manually!
2956
2967
2957 * setup.py: make windows installer (.exe). This is finally the
2968 * setup.py: make windows installer (.exe). This is finally the
2958 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2969 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2959 which I hadn't included because it required Python 2.3 (or recent
2970 which I hadn't included because it required Python 2.3 (or recent
2960 distutils).
2971 distutils).
2961
2972
2962 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2973 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2963 usage of new '\D' escape.
2974 usage of new '\D' escape.
2964
2975
2965 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2976 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2966 lacks os.getuid())
2977 lacks os.getuid())
2967 (CachedOutput.set_colors): Added the ability to turn coloring
2978 (CachedOutput.set_colors): Added the ability to turn coloring
2968 on/off with @colors even for manually defined prompt colors. It
2979 on/off with @colors even for manually defined prompt colors. It
2969 uses a nasty global, but it works safely and via the generic color
2980 uses a nasty global, but it works safely and via the generic color
2970 handling mechanism.
2981 handling mechanism.
2971 (Prompt2.__init__): Introduced new escape '\D' for continuation
2982 (Prompt2.__init__): Introduced new escape '\D' for continuation
2972 prompts. It represents the counter ('\#') as dots.
2983 prompts. It represents the counter ('\#') as dots.
2973 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2984 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2974 need to update their ipythonrc files and replace '%n' with '\D' in
2985 need to update their ipythonrc files and replace '%n' with '\D' in
2975 their prompt_in2 settings everywhere. Sorry, but there's
2986 their prompt_in2 settings everywhere. Sorry, but there's
2976 otherwise no clean way to get all prompts to properly align. The
2987 otherwise no clean way to get all prompts to properly align. The
2977 ipythonrc shipped with IPython has been updated.
2988 ipythonrc shipped with IPython has been updated.
2978
2989
2979 2004-06-07 Fernando Perez <fperez@colorado.edu>
2990 2004-06-07 Fernando Perez <fperez@colorado.edu>
2980
2991
2981 * setup.py (isfile): Pass local_icons option to latex2html, so the
2992 * setup.py (isfile): Pass local_icons option to latex2html, so the
2982 resulting HTML file is self-contained. Thanks to
2993 resulting HTML file is self-contained. Thanks to
2983 dryice-AT-liu.com.cn for the tip.
2994 dryice-AT-liu.com.cn for the tip.
2984
2995
2985 * pysh.py: I created a new profile 'shell', which implements a
2996 * pysh.py: I created a new profile 'shell', which implements a
2986 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2997 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2987 system shell, nor will it become one anytime soon. It's mainly
2998 system shell, nor will it become one anytime soon. It's mainly
2988 meant to illustrate the use of the new flexible bash-like prompts.
2999 meant to illustrate the use of the new flexible bash-like prompts.
2989 I guess it could be used by hardy souls for true shell management,
3000 I guess it could be used by hardy souls for true shell management,
2990 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3001 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2991 profile. This uses the InterpreterExec extension provided by
3002 profile. This uses the InterpreterExec extension provided by
2992 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3003 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2993
3004
2994 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3005 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2995 auto-align itself with the length of the previous input prompt
3006 auto-align itself with the length of the previous input prompt
2996 (taking into account the invisible color escapes).
3007 (taking into account the invisible color escapes).
2997 (CachedOutput.__init__): Large restructuring of this class. Now
3008 (CachedOutput.__init__): Large restructuring of this class. Now
2998 all three prompts (primary1, primary2, output) are proper objects,
3009 all three prompts (primary1, primary2, output) are proper objects,
2999 managed by the 'parent' CachedOutput class. The code is still a
3010 managed by the 'parent' CachedOutput class. The code is still a
3000 bit hackish (all prompts share state via a pointer to the cache),
3011 bit hackish (all prompts share state via a pointer to the cache),
3001 but it's overall far cleaner than before.
3012 but it's overall far cleaner than before.
3002
3013
3003 * IPython/genutils.py (getoutputerror): modified to add verbose,
3014 * IPython/genutils.py (getoutputerror): modified to add verbose,
3004 debug and header options. This makes the interface of all getout*
3015 debug and header options. This makes the interface of all getout*
3005 functions uniform.
3016 functions uniform.
3006 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3017 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3007
3018
3008 * IPython/Magic.py (Magic.default_option): added a function to
3019 * IPython/Magic.py (Magic.default_option): added a function to
3009 allow registering default options for any magic command. This
3020 allow registering default options for any magic command. This
3010 makes it easy to have profiles which customize the magics globally
3021 makes it easy to have profiles which customize the magics globally
3011 for a certain use. The values set through this function are
3022 for a certain use. The values set through this function are
3012 picked up by the parse_options() method, which all magics should
3023 picked up by the parse_options() method, which all magics should
3013 use to parse their options.
3024 use to parse their options.
3014
3025
3015 * IPython/genutils.py (warn): modified the warnings framework to
3026 * IPython/genutils.py (warn): modified the warnings framework to
3016 use the Term I/O class. I'm trying to slowly unify all of
3027 use the Term I/O class. I'm trying to slowly unify all of
3017 IPython's I/O operations to pass through Term.
3028 IPython's I/O operations to pass through Term.
3018
3029
3019 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3030 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3020 the secondary prompt to correctly match the length of the primary
3031 the secondary prompt to correctly match the length of the primary
3021 one for any prompt. Now multi-line code will properly line up
3032 one for any prompt. Now multi-line code will properly line up
3022 even for path dependent prompts, such as the new ones available
3033 even for path dependent prompts, such as the new ones available
3023 via the prompt_specials.
3034 via the prompt_specials.
3024
3035
3025 2004-06-06 Fernando Perez <fperez@colorado.edu>
3036 2004-06-06 Fernando Perez <fperez@colorado.edu>
3026
3037
3027 * IPython/Prompts.py (prompt_specials): Added the ability to have
3038 * IPython/Prompts.py (prompt_specials): Added the ability to have
3028 bash-like special sequences in the prompts, which get
3039 bash-like special sequences in the prompts, which get
3029 automatically expanded. Things like hostname, current working
3040 automatically expanded. Things like hostname, current working
3030 directory and username are implemented already, but it's easy to
3041 directory and username are implemented already, but it's easy to
3031 add more in the future. Thanks to a patch by W.J. van der Laan
3042 add more in the future. Thanks to a patch by W.J. van der Laan
3032 <gnufnork-AT-hetdigitalegat.nl>
3043 <gnufnork-AT-hetdigitalegat.nl>
3033 (prompt_specials): Added color support for prompt strings, so
3044 (prompt_specials): Added color support for prompt strings, so
3034 users can define arbitrary color setups for their prompts.
3045 users can define arbitrary color setups for their prompts.
3035
3046
3036 2004-06-05 Fernando Perez <fperez@colorado.edu>
3047 2004-06-05 Fernando Perez <fperez@colorado.edu>
3037
3048
3038 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3049 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3039 code to load Gary Bishop's readline and configure it
3050 code to load Gary Bishop's readline and configure it
3040 automatically. Thanks to Gary for help on this.
3051 automatically. Thanks to Gary for help on this.
3041
3052
3042 2004-06-01 Fernando Perez <fperez@colorado.edu>
3053 2004-06-01 Fernando Perez <fperez@colorado.edu>
3043
3054
3044 * IPython/Logger.py (Logger.create_log): fix bug for logging
3055 * IPython/Logger.py (Logger.create_log): fix bug for logging
3045 with no filename (previous fix was incomplete).
3056 with no filename (previous fix was incomplete).
3046
3057
3047 2004-05-25 Fernando Perez <fperez@colorado.edu>
3058 2004-05-25 Fernando Perez <fperez@colorado.edu>
3048
3059
3049 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3060 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3050 parens would get passed to the shell.
3061 parens would get passed to the shell.
3051
3062
3052 2004-05-20 Fernando Perez <fperez@colorado.edu>
3063 2004-05-20 Fernando Perez <fperez@colorado.edu>
3053
3064
3054 * IPython/Magic.py (Magic.magic_prun): changed default profile
3065 * IPython/Magic.py (Magic.magic_prun): changed default profile
3055 sort order to 'time' (the more common profiling need).
3066 sort order to 'time' (the more common profiling need).
3056
3067
3057 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3068 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3058 so that source code shown is guaranteed in sync with the file on
3069 so that source code shown is guaranteed in sync with the file on
3059 disk (also changed in psource). Similar fix to the one for
3070 disk (also changed in psource). Similar fix to the one for
3060 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3071 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3061 <yann.ledu-AT-noos.fr>.
3072 <yann.ledu-AT-noos.fr>.
3062
3073
3063 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3074 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3064 with a single option would not be correctly parsed. Closes
3075 with a single option would not be correctly parsed. Closes
3065 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3076 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3066 introduced in 0.6.0 (on 2004-05-06).
3077 introduced in 0.6.0 (on 2004-05-06).
3067
3078
3068 2004-05-13 *** Released version 0.6.0
3079 2004-05-13 *** Released version 0.6.0
3069
3080
3070 2004-05-13 Fernando Perez <fperez@colorado.edu>
3081 2004-05-13 Fernando Perez <fperez@colorado.edu>
3071
3082
3072 * debian/: Added debian/ directory to CVS, so that debian support
3083 * debian/: Added debian/ directory to CVS, so that debian support
3073 is publicly accessible. The debian package is maintained by Jack
3084 is publicly accessible. The debian package is maintained by Jack
3074 Moffit <jack-AT-xiph.org>.
3085 Moffit <jack-AT-xiph.org>.
3075
3086
3076 * Documentation: included the notes about an ipython-based system
3087 * Documentation: included the notes about an ipython-based system
3077 shell (the hypothetical 'pysh') into the new_design.pdf document,
3088 shell (the hypothetical 'pysh') into the new_design.pdf document,
3078 so that these ideas get distributed to users along with the
3089 so that these ideas get distributed to users along with the
3079 official documentation.
3090 official documentation.
3080
3091
3081 2004-05-10 Fernando Perez <fperez@colorado.edu>
3092 2004-05-10 Fernando Perez <fperez@colorado.edu>
3082
3093
3083 * IPython/Logger.py (Logger.create_log): fix recently introduced
3094 * IPython/Logger.py (Logger.create_log): fix recently introduced
3084 bug (misindented line) where logstart would fail when not given an
3095 bug (misindented line) where logstart would fail when not given an
3085 explicit filename.
3096 explicit filename.
3086
3097
3087 2004-05-09 Fernando Perez <fperez@colorado.edu>
3098 2004-05-09 Fernando Perez <fperez@colorado.edu>
3088
3099
3089 * IPython/Magic.py (Magic.parse_options): skip system call when
3100 * IPython/Magic.py (Magic.parse_options): skip system call when
3090 there are no options to look for. Faster, cleaner for the common
3101 there are no options to look for. Faster, cleaner for the common
3091 case.
3102 case.
3092
3103
3093 * Documentation: many updates to the manual: describing Windows
3104 * Documentation: many updates to the manual: describing Windows
3094 support better, Gnuplot updates, credits, misc small stuff. Also
3105 support better, Gnuplot updates, credits, misc small stuff. Also
3095 updated the new_design doc a bit.
3106 updated the new_design doc a bit.
3096
3107
3097 2004-05-06 *** Released version 0.6.0.rc1
3108 2004-05-06 *** Released version 0.6.0.rc1
3098
3109
3099 2004-05-06 Fernando Perez <fperez@colorado.edu>
3110 2004-05-06 Fernando Perez <fperez@colorado.edu>
3100
3111
3101 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3112 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3102 operations to use the vastly more efficient list/''.join() method.
3113 operations to use the vastly more efficient list/''.join() method.
3103 (FormattedTB.text): Fix
3114 (FormattedTB.text): Fix
3104 http://www.scipy.net/roundup/ipython/issue12 - exception source
3115 http://www.scipy.net/roundup/ipython/issue12 - exception source
3105 extract not updated after reload. Thanks to Mike Salib
3116 extract not updated after reload. Thanks to Mike Salib
3106 <msalib-AT-mit.edu> for pinning the source of the problem.
3117 <msalib-AT-mit.edu> for pinning the source of the problem.
3107 Fortunately, the solution works inside ipython and doesn't require
3118 Fortunately, the solution works inside ipython and doesn't require
3108 any changes to python proper.
3119 any changes to python proper.
3109
3120
3110 * IPython/Magic.py (Magic.parse_options): Improved to process the
3121 * IPython/Magic.py (Magic.parse_options): Improved to process the
3111 argument list as a true shell would (by actually using the
3122 argument list as a true shell would (by actually using the
3112 underlying system shell). This way, all @magics automatically get
3123 underlying system shell). This way, all @magics automatically get
3113 shell expansion for variables. Thanks to a comment by Alex
3124 shell expansion for variables. Thanks to a comment by Alex
3114 Schmolck.
3125 Schmolck.
3115
3126
3116 2004-04-04 Fernando Perez <fperez@colorado.edu>
3127 2004-04-04 Fernando Perez <fperez@colorado.edu>
3117
3128
3118 * IPython/iplib.py (InteractiveShell.interact): Added a special
3129 * IPython/iplib.py (InteractiveShell.interact): Added a special
3119 trap for a debugger quit exception, which is basically impossible
3130 trap for a debugger quit exception, which is basically impossible
3120 to handle by normal mechanisms, given what pdb does to the stack.
3131 to handle by normal mechanisms, given what pdb does to the stack.
3121 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3132 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3122
3133
3123 2004-04-03 Fernando Perez <fperez@colorado.edu>
3134 2004-04-03 Fernando Perez <fperez@colorado.edu>
3124
3135
3125 * IPython/genutils.py (Term): Standardized the names of the Term
3136 * IPython/genutils.py (Term): Standardized the names of the Term
3126 class streams to cin/cout/cerr, following C++ naming conventions
3137 class streams to cin/cout/cerr, following C++ naming conventions
3127 (I can't use in/out/err because 'in' is not a valid attribute
3138 (I can't use in/out/err because 'in' is not a valid attribute
3128 name).
3139 name).
3129
3140
3130 * IPython/iplib.py (InteractiveShell.interact): don't increment
3141 * IPython/iplib.py (InteractiveShell.interact): don't increment
3131 the prompt if there's no user input. By Daniel 'Dang' Griffith
3142 the prompt if there's no user input. By Daniel 'Dang' Griffith
3132 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3143 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3133 Francois Pinard.
3144 Francois Pinard.
3134
3145
3135 2004-04-02 Fernando Perez <fperez@colorado.edu>
3146 2004-04-02 Fernando Perez <fperez@colorado.edu>
3136
3147
3137 * IPython/genutils.py (Stream.__init__): Modified to survive at
3148 * IPython/genutils.py (Stream.__init__): Modified to survive at
3138 least importing in contexts where stdin/out/err aren't true file
3149 least importing in contexts where stdin/out/err aren't true file
3139 objects, such as PyCrust (they lack fileno() and mode). However,
3150 objects, such as PyCrust (they lack fileno() and mode). However,
3140 the recovery facilities which rely on these things existing will
3151 the recovery facilities which rely on these things existing will
3141 not work.
3152 not work.
3142
3153
3143 2004-04-01 Fernando Perez <fperez@colorado.edu>
3154 2004-04-01 Fernando Perez <fperez@colorado.edu>
3144
3155
3145 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3156 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3146 use the new getoutputerror() function, so it properly
3157 use the new getoutputerror() function, so it properly
3147 distinguishes stdout/err.
3158 distinguishes stdout/err.
3148
3159
3149 * IPython/genutils.py (getoutputerror): added a function to
3160 * IPython/genutils.py (getoutputerror): added a function to
3150 capture separately the standard output and error of a command.
3161 capture separately the standard output and error of a command.
3151 After a comment from dang on the mailing lists. This code is
3162 After a comment from dang on the mailing lists. This code is
3152 basically a modified version of commands.getstatusoutput(), from
3163 basically a modified version of commands.getstatusoutput(), from
3153 the standard library.
3164 the standard library.
3154
3165
3155 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3166 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3156 '!!' as a special syntax (shorthand) to access @sx.
3167 '!!' as a special syntax (shorthand) to access @sx.
3157
3168
3158 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3169 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3159 command and return its output as a list split on '\n'.
3170 command and return its output as a list split on '\n'.
3160
3171
3161 2004-03-31 Fernando Perez <fperez@colorado.edu>
3172 2004-03-31 Fernando Perez <fperez@colorado.edu>
3162
3173
3163 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3174 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3164 method to dictionaries used as FakeModule instances if they lack
3175 method to dictionaries used as FakeModule instances if they lack
3165 it. At least pydoc in python2.3 breaks for runtime-defined
3176 it. At least pydoc in python2.3 breaks for runtime-defined
3166 functions without this hack. At some point I need to _really_
3177 functions without this hack. At some point I need to _really_
3167 understand what FakeModule is doing, because it's a gross hack.
3178 understand what FakeModule is doing, because it's a gross hack.
3168 But it solves Arnd's problem for now...
3179 But it solves Arnd's problem for now...
3169
3180
3170 2004-02-27 Fernando Perez <fperez@colorado.edu>
3181 2004-02-27 Fernando Perez <fperez@colorado.edu>
3171
3182
3172 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3183 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3173 mode would behave erratically. Also increased the number of
3184 mode would behave erratically. Also increased the number of
3174 possible logs in rotate mod to 999. Thanks to Rod Holland
3185 possible logs in rotate mod to 999. Thanks to Rod Holland
3175 <rhh@StructureLABS.com> for the report and fixes.
3186 <rhh@StructureLABS.com> for the report and fixes.
3176
3187
3177 2004-02-26 Fernando Perez <fperez@colorado.edu>
3188 2004-02-26 Fernando Perez <fperez@colorado.edu>
3178
3189
3179 * IPython/genutils.py (page): Check that the curses module really
3190 * IPython/genutils.py (page): Check that the curses module really
3180 has the initscr attribute before trying to use it. For some
3191 has the initscr attribute before trying to use it. For some
3181 reason, the Solaris curses module is missing this. I think this
3192 reason, the Solaris curses module is missing this. I think this
3182 should be considered a Solaris python bug, but I'm not sure.
3193 should be considered a Solaris python bug, but I'm not sure.
3183
3194
3184 2004-01-17 Fernando Perez <fperez@colorado.edu>
3195 2004-01-17 Fernando Perez <fperez@colorado.edu>
3185
3196
3186 * IPython/genutils.py (Stream.__init__): Changes to try to make
3197 * IPython/genutils.py (Stream.__init__): Changes to try to make
3187 ipython robust against stdin/out/err being closed by the user.
3198 ipython robust against stdin/out/err being closed by the user.
3188 This is 'user error' (and blocks a normal python session, at least
3199 This is 'user error' (and blocks a normal python session, at least
3189 the stdout case). However, Ipython should be able to survive such
3200 the stdout case). However, Ipython should be able to survive such
3190 instances of abuse as gracefully as possible. To simplify the
3201 instances of abuse as gracefully as possible. To simplify the
3191 coding and maintain compatibility with Gary Bishop's Term
3202 coding and maintain compatibility with Gary Bishop's Term
3192 contributions, I've made use of classmethods for this. I think
3203 contributions, I've made use of classmethods for this. I think
3193 this introduces a dependency on python 2.2.
3204 this introduces a dependency on python 2.2.
3194
3205
3195 2004-01-13 Fernando Perez <fperez@colorado.edu>
3206 2004-01-13 Fernando Perez <fperez@colorado.edu>
3196
3207
3197 * IPython/numutils.py (exp_safe): simplified the code a bit and
3208 * IPython/numutils.py (exp_safe): simplified the code a bit and
3198 removed the need for importing the kinds module altogether.
3209 removed the need for importing the kinds module altogether.
3199
3210
3200 2004-01-06 Fernando Perez <fperez@colorado.edu>
3211 2004-01-06 Fernando Perez <fperez@colorado.edu>
3201
3212
3202 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3213 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3203 a magic function instead, after some community feedback. No
3214 a magic function instead, after some community feedback. No
3204 special syntax will exist for it, but its name is deliberately
3215 special syntax will exist for it, but its name is deliberately
3205 very short.
3216 very short.
3206
3217
3207 2003-12-20 Fernando Perez <fperez@colorado.edu>
3218 2003-12-20 Fernando Perez <fperez@colorado.edu>
3208
3219
3209 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3220 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3210 new functionality, to automagically assign the result of a shell
3221 new functionality, to automagically assign the result of a shell
3211 command to a variable. I'll solicit some community feedback on
3222 command to a variable. I'll solicit some community feedback on
3212 this before making it permanent.
3223 this before making it permanent.
3213
3224
3214 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3225 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3215 requested about callables for which inspect couldn't obtain a
3226 requested about callables for which inspect couldn't obtain a
3216 proper argspec. Thanks to a crash report sent by Etienne
3227 proper argspec. Thanks to a crash report sent by Etienne
3217 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3228 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3218
3229
3219 2003-12-09 Fernando Perez <fperez@colorado.edu>
3230 2003-12-09 Fernando Perez <fperez@colorado.edu>
3220
3231
3221 * IPython/genutils.py (page): patch for the pager to work across
3232 * IPython/genutils.py (page): patch for the pager to work across
3222 various versions of Windows. By Gary Bishop.
3233 various versions of Windows. By Gary Bishop.
3223
3234
3224 2003-12-04 Fernando Perez <fperez@colorado.edu>
3235 2003-12-04 Fernando Perez <fperez@colorado.edu>
3225
3236
3226 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3237 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3227 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3238 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3228 While I tested this and it looks ok, there may still be corner
3239 While I tested this and it looks ok, there may still be corner
3229 cases I've missed.
3240 cases I've missed.
3230
3241
3231 2003-12-01 Fernando Perez <fperez@colorado.edu>
3242 2003-12-01 Fernando Perez <fperez@colorado.edu>
3232
3243
3233 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3244 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3234 where a line like 'p,q=1,2' would fail because the automagic
3245 where a line like 'p,q=1,2' would fail because the automagic
3235 system would be triggered for @p.
3246 system would be triggered for @p.
3236
3247
3237 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3248 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3238 cleanups, code unmodified.
3249 cleanups, code unmodified.
3239
3250
3240 * IPython/genutils.py (Term): added a class for IPython to handle
3251 * IPython/genutils.py (Term): added a class for IPython to handle
3241 output. In most cases it will just be a proxy for stdout/err, but
3252 output. In most cases it will just be a proxy for stdout/err, but
3242 having this allows modifications to be made for some platforms,
3253 having this allows modifications to be made for some platforms,
3243 such as handling color escapes under Windows. All of this code
3254 such as handling color escapes under Windows. All of this code
3244 was contributed by Gary Bishop, with minor modifications by me.
3255 was contributed by Gary Bishop, with minor modifications by me.
3245 The actual changes affect many files.
3256 The actual changes affect many files.
3246
3257
3247 2003-11-30 Fernando Perez <fperez@colorado.edu>
3258 2003-11-30 Fernando Perez <fperez@colorado.edu>
3248
3259
3249 * IPython/iplib.py (file_matches): new completion code, courtesy
3260 * IPython/iplib.py (file_matches): new completion code, courtesy
3250 of Jeff Collins. This enables filename completion again under
3261 of Jeff Collins. This enables filename completion again under
3251 python 2.3, which disabled it at the C level.
3262 python 2.3, which disabled it at the C level.
3252
3263
3253 2003-11-11 Fernando Perez <fperez@colorado.edu>
3264 2003-11-11 Fernando Perez <fperez@colorado.edu>
3254
3265
3255 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3266 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3256 for Numeric.array(map(...)), but often convenient.
3267 for Numeric.array(map(...)), but often convenient.
3257
3268
3258 2003-11-05 Fernando Perez <fperez@colorado.edu>
3269 2003-11-05 Fernando Perez <fperez@colorado.edu>
3259
3270
3260 * IPython/numutils.py (frange): Changed a call from int() to
3271 * IPython/numutils.py (frange): Changed a call from int() to
3261 int(round()) to prevent a problem reported with arange() in the
3272 int(round()) to prevent a problem reported with arange() in the
3262 numpy list.
3273 numpy list.
3263
3274
3264 2003-10-06 Fernando Perez <fperez@colorado.edu>
3275 2003-10-06 Fernando Perez <fperez@colorado.edu>
3265
3276
3266 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3277 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3267 prevent crashes if sys lacks an argv attribute (it happens with
3278 prevent crashes if sys lacks an argv attribute (it happens with
3268 embedded interpreters which build a bare-bones sys module).
3279 embedded interpreters which build a bare-bones sys module).
3269 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3280 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3270
3281
3271 2003-09-24 Fernando Perez <fperez@colorado.edu>
3282 2003-09-24 Fernando Perez <fperez@colorado.edu>
3272
3283
3273 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3284 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3274 to protect against poorly written user objects where __getattr__
3285 to protect against poorly written user objects where __getattr__
3275 raises exceptions other than AttributeError. Thanks to a bug
3286 raises exceptions other than AttributeError. Thanks to a bug
3276 report by Oliver Sander <osander-AT-gmx.de>.
3287 report by Oliver Sander <osander-AT-gmx.de>.
3277
3288
3278 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3289 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3279 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3290 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3280
3291
3281 2003-09-09 Fernando Perez <fperez@colorado.edu>
3292 2003-09-09 Fernando Perez <fperez@colorado.edu>
3282
3293
3283 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3294 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3284 unpacking a list whith a callable as first element would
3295 unpacking a list whith a callable as first element would
3285 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3296 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3286 Collins.
3297 Collins.
3287
3298
3288 2003-08-25 *** Released version 0.5.0
3299 2003-08-25 *** Released version 0.5.0
3289
3300
3290 2003-08-22 Fernando Perez <fperez@colorado.edu>
3301 2003-08-22 Fernando Perez <fperez@colorado.edu>
3291
3302
3292 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3303 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3293 improperly defined user exceptions. Thanks to feedback from Mark
3304 improperly defined user exceptions. Thanks to feedback from Mark
3294 Russell <mrussell-AT-verio.net>.
3305 Russell <mrussell-AT-verio.net>.
3295
3306
3296 2003-08-20 Fernando Perez <fperez@colorado.edu>
3307 2003-08-20 Fernando Perez <fperez@colorado.edu>
3297
3308
3298 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3309 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3299 printing so that it would print multi-line string forms starting
3310 printing so that it would print multi-line string forms starting
3300 with a new line. This way the formatting is better respected for
3311 with a new line. This way the formatting is better respected for
3301 objects which work hard to make nice string forms.
3312 objects which work hard to make nice string forms.
3302
3313
3303 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3314 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3304 autocall would overtake data access for objects with both
3315 autocall would overtake data access for objects with both
3305 __getitem__ and __call__.
3316 __getitem__ and __call__.
3306
3317
3307 2003-08-19 *** Released version 0.5.0-rc1
3318 2003-08-19 *** Released version 0.5.0-rc1
3308
3319
3309 2003-08-19 Fernando Perez <fperez@colorado.edu>
3320 2003-08-19 Fernando Perez <fperez@colorado.edu>
3310
3321
3311 * IPython/deep_reload.py (load_tail): single tiny change here
3322 * IPython/deep_reload.py (load_tail): single tiny change here
3312 seems to fix the long-standing bug of dreload() failing to work
3323 seems to fix the long-standing bug of dreload() failing to work
3313 for dotted names. But this module is pretty tricky, so I may have
3324 for dotted names. But this module is pretty tricky, so I may have
3314 missed some subtlety. Needs more testing!.
3325 missed some subtlety. Needs more testing!.
3315
3326
3316 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3327 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3317 exceptions which have badly implemented __str__ methods.
3328 exceptions which have badly implemented __str__ methods.
3318 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3329 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3319 which I've been getting reports about from Python 2.3 users. I
3330 which I've been getting reports about from Python 2.3 users. I
3320 wish I had a simple test case to reproduce the problem, so I could
3331 wish I had a simple test case to reproduce the problem, so I could
3321 either write a cleaner workaround or file a bug report if
3332 either write a cleaner workaround or file a bug report if
3322 necessary.
3333 necessary.
3323
3334
3324 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3335 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3325 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3336 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3326 a bug report by Tjabo Kloppenburg.
3337 a bug report by Tjabo Kloppenburg.
3327
3338
3328 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3339 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3329 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3340 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3330 seems rather unstable. Thanks to a bug report by Tjabo
3341 seems rather unstable. Thanks to a bug report by Tjabo
3331 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3342 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3332
3343
3333 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3344 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3334 this out soon because of the critical fixes in the inner loop for
3345 this out soon because of the critical fixes in the inner loop for
3335 generators.
3346 generators.
3336
3347
3337 * IPython/Magic.py (Magic.getargspec): removed. This (and
3348 * IPython/Magic.py (Magic.getargspec): removed. This (and
3338 _get_def) have been obsoleted by OInspect for a long time, I
3349 _get_def) have been obsoleted by OInspect for a long time, I
3339 hadn't noticed that they were dead code.
3350 hadn't noticed that they were dead code.
3340 (Magic._ofind): restored _ofind functionality for a few literals
3351 (Magic._ofind): restored _ofind functionality for a few literals
3341 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3352 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3342 for things like "hello".capitalize?, since that would require a
3353 for things like "hello".capitalize?, since that would require a
3343 potentially dangerous eval() again.
3354 potentially dangerous eval() again.
3344
3355
3345 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3356 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3346 logic a bit more to clean up the escapes handling and minimize the
3357 logic a bit more to clean up the escapes handling and minimize the
3347 use of _ofind to only necessary cases. The interactive 'feel' of
3358 use of _ofind to only necessary cases. The interactive 'feel' of
3348 IPython should have improved quite a bit with the changes in
3359 IPython should have improved quite a bit with the changes in
3349 _prefilter and _ofind (besides being far safer than before).
3360 _prefilter and _ofind (besides being far safer than before).
3350
3361
3351 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3362 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3352 obscure, never reported). Edit would fail to find the object to
3363 obscure, never reported). Edit would fail to find the object to
3353 edit under some circumstances.
3364 edit under some circumstances.
3354 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3365 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3355 which were causing double-calling of generators. Those eval calls
3366 which were causing double-calling of generators. Those eval calls
3356 were _very_ dangerous, since code with side effects could be
3367 were _very_ dangerous, since code with side effects could be
3357 triggered. As they say, 'eval is evil'... These were the
3368 triggered. As they say, 'eval is evil'... These were the
3358 nastiest evals in IPython. Besides, _ofind is now far simpler,
3369 nastiest evals in IPython. Besides, _ofind is now far simpler,
3359 and it should also be quite a bit faster. Its use of inspect is
3370 and it should also be quite a bit faster. Its use of inspect is
3360 also safer, so perhaps some of the inspect-related crashes I've
3371 also safer, so perhaps some of the inspect-related crashes I've
3361 seen lately with Python 2.3 might be taken care of. That will
3372 seen lately with Python 2.3 might be taken care of. That will
3362 need more testing.
3373 need more testing.
3363
3374
3364 2003-08-17 Fernando Perez <fperez@colorado.edu>
3375 2003-08-17 Fernando Perez <fperez@colorado.edu>
3365
3376
3366 * IPython/iplib.py (InteractiveShell._prefilter): significant
3377 * IPython/iplib.py (InteractiveShell._prefilter): significant
3367 simplifications to the logic for handling user escapes. Faster
3378 simplifications to the logic for handling user escapes. Faster
3368 and simpler code.
3379 and simpler code.
3369
3380
3370 2003-08-14 Fernando Perez <fperez@colorado.edu>
3381 2003-08-14 Fernando Perez <fperez@colorado.edu>
3371
3382
3372 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3383 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3373 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3384 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3374 but it should be quite a bit faster. And the recursive version
3385 but it should be quite a bit faster. And the recursive version
3375 generated O(log N) intermediate storage for all rank>1 arrays,
3386 generated O(log N) intermediate storage for all rank>1 arrays,
3376 even if they were contiguous.
3387 even if they were contiguous.
3377 (l1norm): Added this function.
3388 (l1norm): Added this function.
3378 (norm): Added this function for arbitrary norms (including
3389 (norm): Added this function for arbitrary norms (including
3379 l-infinity). l1 and l2 are still special cases for convenience
3390 l-infinity). l1 and l2 are still special cases for convenience
3380 and speed.
3391 and speed.
3381
3392
3382 2003-08-03 Fernando Perez <fperez@colorado.edu>
3393 2003-08-03 Fernando Perez <fperez@colorado.edu>
3383
3394
3384 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3395 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3385 exceptions, which now raise PendingDeprecationWarnings in Python
3396 exceptions, which now raise PendingDeprecationWarnings in Python
3386 2.3. There were some in Magic and some in Gnuplot2.
3397 2.3. There were some in Magic and some in Gnuplot2.
3387
3398
3388 2003-06-30 Fernando Perez <fperez@colorado.edu>
3399 2003-06-30 Fernando Perez <fperez@colorado.edu>
3389
3400
3390 * IPython/genutils.py (page): modified to call curses only for
3401 * IPython/genutils.py (page): modified to call curses only for
3391 terminals where TERM=='xterm'. After problems under many other
3402 terminals where TERM=='xterm'. After problems under many other
3392 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3403 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3393
3404
3394 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3405 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3395 would be triggered when readline was absent. This was just an old
3406 would be triggered when readline was absent. This was just an old
3396 debugging statement I'd forgotten to take out.
3407 debugging statement I'd forgotten to take out.
3397
3408
3398 2003-06-20 Fernando Perez <fperez@colorado.edu>
3409 2003-06-20 Fernando Perez <fperez@colorado.edu>
3399
3410
3400 * IPython/genutils.py (clock): modified to return only user time
3411 * IPython/genutils.py (clock): modified to return only user time
3401 (not counting system time), after a discussion on scipy. While
3412 (not counting system time), after a discussion on scipy. While
3402 system time may be a useful quantity occasionally, it may much
3413 system time may be a useful quantity occasionally, it may much
3403 more easily be skewed by occasional swapping or other similar
3414 more easily be skewed by occasional swapping or other similar
3404 activity.
3415 activity.
3405
3416
3406 2003-06-05 Fernando Perez <fperez@colorado.edu>
3417 2003-06-05 Fernando Perez <fperez@colorado.edu>
3407
3418
3408 * IPython/numutils.py (identity): new function, for building
3419 * IPython/numutils.py (identity): new function, for building
3409 arbitrary rank Kronecker deltas (mostly backwards compatible with
3420 arbitrary rank Kronecker deltas (mostly backwards compatible with
3410 Numeric.identity)
3421 Numeric.identity)
3411
3422
3412 2003-06-03 Fernando Perez <fperez@colorado.edu>
3423 2003-06-03 Fernando Perez <fperez@colorado.edu>
3413
3424
3414 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3425 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3415 arguments passed to magics with spaces, to allow trailing '\' to
3426 arguments passed to magics with spaces, to allow trailing '\' to
3416 work normally (mainly for Windows users).
3427 work normally (mainly for Windows users).
3417
3428
3418 2003-05-29 Fernando Perez <fperez@colorado.edu>
3429 2003-05-29 Fernando Perez <fperez@colorado.edu>
3419
3430
3420 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3431 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3421 instead of pydoc.help. This fixes a bizarre behavior where
3432 instead of pydoc.help. This fixes a bizarre behavior where
3422 printing '%s' % locals() would trigger the help system. Now
3433 printing '%s' % locals() would trigger the help system. Now
3423 ipython behaves like normal python does.
3434 ipython behaves like normal python does.
3424
3435
3425 Note that if one does 'from pydoc import help', the bizarre
3436 Note that if one does 'from pydoc import help', the bizarre
3426 behavior returns, but this will also happen in normal python, so
3437 behavior returns, but this will also happen in normal python, so
3427 it's not an ipython bug anymore (it has to do with how pydoc.help
3438 it's not an ipython bug anymore (it has to do with how pydoc.help
3428 is implemented).
3439 is implemented).
3429
3440
3430 2003-05-22 Fernando Perez <fperez@colorado.edu>
3441 2003-05-22 Fernando Perez <fperez@colorado.edu>
3431
3442
3432 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3443 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3433 return [] instead of None when nothing matches, also match to end
3444 return [] instead of None when nothing matches, also match to end
3434 of line. Patch by Gary Bishop.
3445 of line. Patch by Gary Bishop.
3435
3446
3436 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3447 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3437 protection as before, for files passed on the command line. This
3448 protection as before, for files passed on the command line. This
3438 prevents the CrashHandler from kicking in if user files call into
3449 prevents the CrashHandler from kicking in if user files call into
3439 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3450 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3440 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3451 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3441
3452
3442 2003-05-20 *** Released version 0.4.0
3453 2003-05-20 *** Released version 0.4.0
3443
3454
3444 2003-05-20 Fernando Perez <fperez@colorado.edu>
3455 2003-05-20 Fernando Perez <fperez@colorado.edu>
3445
3456
3446 * setup.py: added support for manpages. It's a bit hackish b/c of
3457 * setup.py: added support for manpages. It's a bit hackish b/c of
3447 a bug in the way the bdist_rpm distutils target handles gzipped
3458 a bug in the way the bdist_rpm distutils target handles gzipped
3448 manpages, but it works. After a patch by Jack.
3459 manpages, but it works. After a patch by Jack.
3449
3460
3450 2003-05-19 Fernando Perez <fperez@colorado.edu>
3461 2003-05-19 Fernando Perez <fperez@colorado.edu>
3451
3462
3452 * IPython/numutils.py: added a mockup of the kinds module, since
3463 * IPython/numutils.py: added a mockup of the kinds module, since
3453 it was recently removed from Numeric. This way, numutils will
3464 it was recently removed from Numeric. This way, numutils will
3454 work for all users even if they are missing kinds.
3465 work for all users even if they are missing kinds.
3455
3466
3456 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3467 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3457 failure, which can occur with SWIG-wrapped extensions. After a
3468 failure, which can occur with SWIG-wrapped extensions. After a
3458 crash report from Prabhu.
3469 crash report from Prabhu.
3459
3470
3460 2003-05-16 Fernando Perez <fperez@colorado.edu>
3471 2003-05-16 Fernando Perez <fperez@colorado.edu>
3461
3472
3462 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3473 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3463 protect ipython from user code which may call directly
3474 protect ipython from user code which may call directly
3464 sys.excepthook (this looks like an ipython crash to the user, even
3475 sys.excepthook (this looks like an ipython crash to the user, even
3465 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3476 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3466 This is especially important to help users of WxWindows, but may
3477 This is especially important to help users of WxWindows, but may
3467 also be useful in other cases.
3478 also be useful in other cases.
3468
3479
3469 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3480 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3470 an optional tb_offset to be specified, and to preserve exception
3481 an optional tb_offset to be specified, and to preserve exception
3471 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3482 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3472
3483
3473 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3484 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3474
3485
3475 2003-05-15 Fernando Perez <fperez@colorado.edu>
3486 2003-05-15 Fernando Perez <fperez@colorado.edu>
3476
3487
3477 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3488 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3478 installing for a new user under Windows.
3489 installing for a new user under Windows.
3479
3490
3480 2003-05-12 Fernando Perez <fperez@colorado.edu>
3491 2003-05-12 Fernando Perez <fperez@colorado.edu>
3481
3492
3482 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3493 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3483 handler for Emacs comint-based lines. Currently it doesn't do
3494 handler for Emacs comint-based lines. Currently it doesn't do
3484 much (but importantly, it doesn't update the history cache). In
3495 much (but importantly, it doesn't update the history cache). In
3485 the future it may be expanded if Alex needs more functionality
3496 the future it may be expanded if Alex needs more functionality
3486 there.
3497 there.
3487
3498
3488 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3499 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3489 info to crash reports.
3500 info to crash reports.
3490
3501
3491 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3502 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3492 just like Python's -c. Also fixed crash with invalid -color
3503 just like Python's -c. Also fixed crash with invalid -color
3493 option value at startup. Thanks to Will French
3504 option value at startup. Thanks to Will French
3494 <wfrench-AT-bestweb.net> for the bug report.
3505 <wfrench-AT-bestweb.net> for the bug report.
3495
3506
3496 2003-05-09 Fernando Perez <fperez@colorado.edu>
3507 2003-05-09 Fernando Perez <fperez@colorado.edu>
3497
3508
3498 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3509 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3499 to EvalDict (it's a mapping, after all) and simplified its code
3510 to EvalDict (it's a mapping, after all) and simplified its code
3500 quite a bit, after a nice discussion on c.l.py where Gustavo
3511 quite a bit, after a nice discussion on c.l.py where Gustavo
3501 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3512 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3502
3513
3503 2003-04-30 Fernando Perez <fperez@colorado.edu>
3514 2003-04-30 Fernando Perez <fperez@colorado.edu>
3504
3515
3505 * IPython/genutils.py (timings_out): modified it to reduce its
3516 * IPython/genutils.py (timings_out): modified it to reduce its
3506 overhead in the common reps==1 case.
3517 overhead in the common reps==1 case.
3507
3518
3508 2003-04-29 Fernando Perez <fperez@colorado.edu>
3519 2003-04-29 Fernando Perez <fperez@colorado.edu>
3509
3520
3510 * IPython/genutils.py (timings_out): Modified to use the resource
3521 * IPython/genutils.py (timings_out): Modified to use the resource
3511 module, which avoids the wraparound problems of time.clock().
3522 module, which avoids the wraparound problems of time.clock().
3512
3523
3513 2003-04-17 *** Released version 0.2.15pre4
3524 2003-04-17 *** Released version 0.2.15pre4
3514
3525
3515 2003-04-17 Fernando Perez <fperez@colorado.edu>
3526 2003-04-17 Fernando Perez <fperez@colorado.edu>
3516
3527
3517 * setup.py (scriptfiles): Split windows-specific stuff over to a
3528 * setup.py (scriptfiles): Split windows-specific stuff over to a
3518 separate file, in an attempt to have a Windows GUI installer.
3529 separate file, in an attempt to have a Windows GUI installer.
3519 That didn't work, but part of the groundwork is done.
3530 That didn't work, but part of the groundwork is done.
3520
3531
3521 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3532 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3522 indent/unindent with 4 spaces. Particularly useful in combination
3533 indent/unindent with 4 spaces. Particularly useful in combination
3523 with the new auto-indent option.
3534 with the new auto-indent option.
3524
3535
3525 2003-04-16 Fernando Perez <fperez@colorado.edu>
3536 2003-04-16 Fernando Perez <fperez@colorado.edu>
3526
3537
3527 * IPython/Magic.py: various replacements of self.rc for
3538 * IPython/Magic.py: various replacements of self.rc for
3528 self.shell.rc. A lot more remains to be done to fully disentangle
3539 self.shell.rc. A lot more remains to be done to fully disentangle
3529 this class from the main Shell class.
3540 this class from the main Shell class.
3530
3541
3531 * IPython/GnuplotRuntime.py: added checks for mouse support so
3542 * IPython/GnuplotRuntime.py: added checks for mouse support so
3532 that we don't try to enable it if the current gnuplot doesn't
3543 that we don't try to enable it if the current gnuplot doesn't
3533 really support it. Also added checks so that we don't try to
3544 really support it. Also added checks so that we don't try to
3534 enable persist under Windows (where Gnuplot doesn't recognize the
3545 enable persist under Windows (where Gnuplot doesn't recognize the
3535 option).
3546 option).
3536
3547
3537 * IPython/iplib.py (InteractiveShell.interact): Added optional
3548 * IPython/iplib.py (InteractiveShell.interact): Added optional
3538 auto-indenting code, after a patch by King C. Shu
3549 auto-indenting code, after a patch by King C. Shu
3539 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3550 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3540 get along well with pasting indented code. If I ever figure out
3551 get along well with pasting indented code. If I ever figure out
3541 how to make that part go well, it will become on by default.
3552 how to make that part go well, it will become on by default.
3542
3553
3543 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3554 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3544 crash ipython if there was an unmatched '%' in the user's prompt
3555 crash ipython if there was an unmatched '%' in the user's prompt
3545 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3556 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3546
3557
3547 * IPython/iplib.py (InteractiveShell.interact): removed the
3558 * IPython/iplib.py (InteractiveShell.interact): removed the
3548 ability to ask the user whether he wants to crash or not at the
3559 ability to ask the user whether he wants to crash or not at the
3549 'last line' exception handler. Calling functions at that point
3560 'last line' exception handler. Calling functions at that point
3550 changes the stack, and the error reports would have incorrect
3561 changes the stack, and the error reports would have incorrect
3551 tracebacks.
3562 tracebacks.
3552
3563
3553 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3564 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3554 pass through a peger a pretty-printed form of any object. After a
3565 pass through a peger a pretty-printed form of any object. After a
3555 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3566 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3556
3567
3557 2003-04-14 Fernando Perez <fperez@colorado.edu>
3568 2003-04-14 Fernando Perez <fperez@colorado.edu>
3558
3569
3559 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3570 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3560 all files in ~ would be modified at first install (instead of
3571 all files in ~ would be modified at first install (instead of
3561 ~/.ipython). This could be potentially disastrous, as the
3572 ~/.ipython). This could be potentially disastrous, as the
3562 modification (make line-endings native) could damage binary files.
3573 modification (make line-endings native) could damage binary files.
3563
3574
3564 2003-04-10 Fernando Perez <fperez@colorado.edu>
3575 2003-04-10 Fernando Perez <fperez@colorado.edu>
3565
3576
3566 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3577 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3567 handle only lines which are invalid python. This now means that
3578 handle only lines which are invalid python. This now means that
3568 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3579 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3569 for the bug report.
3580 for the bug report.
3570
3581
3571 2003-04-01 Fernando Perez <fperez@colorado.edu>
3582 2003-04-01 Fernando Perez <fperez@colorado.edu>
3572
3583
3573 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3584 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3574 where failing to set sys.last_traceback would crash pdb.pm().
3585 where failing to set sys.last_traceback would crash pdb.pm().
3575 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3586 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3576 report.
3587 report.
3577
3588
3578 2003-03-25 Fernando Perez <fperez@colorado.edu>
3589 2003-03-25 Fernando Perez <fperez@colorado.edu>
3579
3590
3580 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3591 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3581 before printing it (it had a lot of spurious blank lines at the
3592 before printing it (it had a lot of spurious blank lines at the
3582 end).
3593 end).
3583
3594
3584 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3595 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3585 output would be sent 21 times! Obviously people don't use this
3596 output would be sent 21 times! Obviously people don't use this
3586 too often, or I would have heard about it.
3597 too often, or I would have heard about it.
3587
3598
3588 2003-03-24 Fernando Perez <fperez@colorado.edu>
3599 2003-03-24 Fernando Perez <fperez@colorado.edu>
3589
3600
3590 * setup.py (scriptfiles): renamed the data_files parameter from
3601 * setup.py (scriptfiles): renamed the data_files parameter from
3591 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3602 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3592 for the patch.
3603 for the patch.
3593
3604
3594 2003-03-20 Fernando Perez <fperez@colorado.edu>
3605 2003-03-20 Fernando Perez <fperez@colorado.edu>
3595
3606
3596 * IPython/genutils.py (error): added error() and fatal()
3607 * IPython/genutils.py (error): added error() and fatal()
3597 functions.
3608 functions.
3598
3609
3599 2003-03-18 *** Released version 0.2.15pre3
3610 2003-03-18 *** Released version 0.2.15pre3
3600
3611
3601 2003-03-18 Fernando Perez <fperez@colorado.edu>
3612 2003-03-18 Fernando Perez <fperez@colorado.edu>
3602
3613
3603 * setupext/install_data_ext.py
3614 * setupext/install_data_ext.py
3604 (install_data_ext.initialize_options): Class contributed by Jack
3615 (install_data_ext.initialize_options): Class contributed by Jack
3605 Moffit for fixing the old distutils hack. He is sending this to
3616 Moffit for fixing the old distutils hack. He is sending this to
3606 the distutils folks so in the future we may not need it as a
3617 the distutils folks so in the future we may not need it as a
3607 private fix.
3618 private fix.
3608
3619
3609 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3620 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3610 changes for Debian packaging. See his patch for full details.
3621 changes for Debian packaging. See his patch for full details.
3611 The old distutils hack of making the ipythonrc* files carry a
3622 The old distutils hack of making the ipythonrc* files carry a
3612 bogus .py extension is gone, at last. Examples were moved to a
3623 bogus .py extension is gone, at last. Examples were moved to a
3613 separate subdir under doc/, and the separate executable scripts
3624 separate subdir under doc/, and the separate executable scripts
3614 now live in their own directory. Overall a great cleanup. The
3625 now live in their own directory. Overall a great cleanup. The
3615 manual was updated to use the new files, and setup.py has been
3626 manual was updated to use the new files, and setup.py has been
3616 fixed for this setup.
3627 fixed for this setup.
3617
3628
3618 * IPython/PyColorize.py (Parser.usage): made non-executable and
3629 * IPython/PyColorize.py (Parser.usage): made non-executable and
3619 created a pycolor wrapper around it to be included as a script.
3630 created a pycolor wrapper around it to be included as a script.
3620
3631
3621 2003-03-12 *** Released version 0.2.15pre2
3632 2003-03-12 *** Released version 0.2.15pre2
3622
3633
3623 2003-03-12 Fernando Perez <fperez@colorado.edu>
3634 2003-03-12 Fernando Perez <fperez@colorado.edu>
3624
3635
3625 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3636 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3626 long-standing problem with garbage characters in some terminals.
3637 long-standing problem with garbage characters in some terminals.
3627 The issue was really that the \001 and \002 escapes must _only_ be
3638 The issue was really that the \001 and \002 escapes must _only_ be
3628 passed to input prompts (which call readline), but _never_ to
3639 passed to input prompts (which call readline), but _never_ to
3629 normal text to be printed on screen. I changed ColorANSI to have
3640 normal text to be printed on screen. I changed ColorANSI to have
3630 two classes: TermColors and InputTermColors, each with the
3641 two classes: TermColors and InputTermColors, each with the
3631 appropriate escapes for input prompts or normal text. The code in
3642 appropriate escapes for input prompts or normal text. The code in
3632 Prompts.py got slightly more complicated, but this very old and
3643 Prompts.py got slightly more complicated, but this very old and
3633 annoying bug is finally fixed.
3644 annoying bug is finally fixed.
3634
3645
3635 All the credit for nailing down the real origin of this problem
3646 All the credit for nailing down the real origin of this problem
3636 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3647 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3637 *Many* thanks to him for spending quite a bit of effort on this.
3648 *Many* thanks to him for spending quite a bit of effort on this.
3638
3649
3639 2003-03-05 *** Released version 0.2.15pre1
3650 2003-03-05 *** Released version 0.2.15pre1
3640
3651
3641 2003-03-03 Fernando Perez <fperez@colorado.edu>
3652 2003-03-03 Fernando Perez <fperez@colorado.edu>
3642
3653
3643 * IPython/FakeModule.py: Moved the former _FakeModule to a
3654 * IPython/FakeModule.py: Moved the former _FakeModule to a
3644 separate file, because it's also needed by Magic (to fix a similar
3655 separate file, because it's also needed by Magic (to fix a similar
3645 pickle-related issue in @run).
3656 pickle-related issue in @run).
3646
3657
3647 2003-03-02 Fernando Perez <fperez@colorado.edu>
3658 2003-03-02 Fernando Perez <fperez@colorado.edu>
3648
3659
3649 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3660 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3650 the autocall option at runtime.
3661 the autocall option at runtime.
3651 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3662 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3652 across Magic.py to start separating Magic from InteractiveShell.
3663 across Magic.py to start separating Magic from InteractiveShell.
3653 (Magic._ofind): Fixed to return proper namespace for dotted
3664 (Magic._ofind): Fixed to return proper namespace for dotted
3654 names. Before, a dotted name would always return 'not currently
3665 names. Before, a dotted name would always return 'not currently
3655 defined', because it would find the 'parent'. s.x would be found,
3666 defined', because it would find the 'parent'. s.x would be found,
3656 but since 'x' isn't defined by itself, it would get confused.
3667 but since 'x' isn't defined by itself, it would get confused.
3657 (Magic.magic_run): Fixed pickling problems reported by Ralf
3668 (Magic.magic_run): Fixed pickling problems reported by Ralf
3658 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3669 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3659 that I'd used when Mike Heeter reported similar issues at the
3670 that I'd used when Mike Heeter reported similar issues at the
3660 top-level, but now for @run. It boils down to injecting the
3671 top-level, but now for @run. It boils down to injecting the
3661 namespace where code is being executed with something that looks
3672 namespace where code is being executed with something that looks
3662 enough like a module to fool pickle.dump(). Since a pickle stores
3673 enough like a module to fool pickle.dump(). Since a pickle stores
3663 a named reference to the importing module, we need this for
3674 a named reference to the importing module, we need this for
3664 pickles to save something sensible.
3675 pickles to save something sensible.
3665
3676
3666 * IPython/ipmaker.py (make_IPython): added an autocall option.
3677 * IPython/ipmaker.py (make_IPython): added an autocall option.
3667
3678
3668 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3679 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3669 the auto-eval code. Now autocalling is an option, and the code is
3680 the auto-eval code. Now autocalling is an option, and the code is
3670 also vastly safer. There is no more eval() involved at all.
3681 also vastly safer. There is no more eval() involved at all.
3671
3682
3672 2003-03-01 Fernando Perez <fperez@colorado.edu>
3683 2003-03-01 Fernando Perez <fperez@colorado.edu>
3673
3684
3674 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3685 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3675 dict with named keys instead of a tuple.
3686 dict with named keys instead of a tuple.
3676
3687
3677 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3688 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3678
3689
3679 * setup.py (make_shortcut): Fixed message about directories
3690 * setup.py (make_shortcut): Fixed message about directories
3680 created during Windows installation (the directories were ok, just
3691 created during Windows installation (the directories were ok, just
3681 the printed message was misleading). Thanks to Chris Liechti
3692 the printed message was misleading). Thanks to Chris Liechti
3682 <cliechti-AT-gmx.net> for the heads up.
3693 <cliechti-AT-gmx.net> for the heads up.
3683
3694
3684 2003-02-21 Fernando Perez <fperez@colorado.edu>
3695 2003-02-21 Fernando Perez <fperez@colorado.edu>
3685
3696
3686 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3697 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3687 of ValueError exception when checking for auto-execution. This
3698 of ValueError exception when checking for auto-execution. This
3688 one is raised by things like Numeric arrays arr.flat when the
3699 one is raised by things like Numeric arrays arr.flat when the
3689 array is non-contiguous.
3700 array is non-contiguous.
3690
3701
3691 2003-01-31 Fernando Perez <fperez@colorado.edu>
3702 2003-01-31 Fernando Perez <fperez@colorado.edu>
3692
3703
3693 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3704 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3694 not return any value at all (even though the command would get
3705 not return any value at all (even though the command would get
3695 executed).
3706 executed).
3696 (xsys): Flush stdout right after printing the command to ensure
3707 (xsys): Flush stdout right after printing the command to ensure
3697 proper ordering of commands and command output in the total
3708 proper ordering of commands and command output in the total
3698 output.
3709 output.
3699 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3710 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3700 system/getoutput as defaults. The old ones are kept for
3711 system/getoutput as defaults. The old ones are kept for
3701 compatibility reasons, so no code which uses this library needs
3712 compatibility reasons, so no code which uses this library needs
3702 changing.
3713 changing.
3703
3714
3704 2003-01-27 *** Released version 0.2.14
3715 2003-01-27 *** Released version 0.2.14
3705
3716
3706 2003-01-25 Fernando Perez <fperez@colorado.edu>
3717 2003-01-25 Fernando Perez <fperez@colorado.edu>
3707
3718
3708 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3719 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3709 functions defined in previous edit sessions could not be re-edited
3720 functions defined in previous edit sessions could not be re-edited
3710 (because the temp files were immediately removed). Now temp files
3721 (because the temp files were immediately removed). Now temp files
3711 are removed only at IPython's exit.
3722 are removed only at IPython's exit.
3712 (Magic.magic_run): Improved @run to perform shell-like expansions
3723 (Magic.magic_run): Improved @run to perform shell-like expansions
3713 on its arguments (~users and $VARS). With this, @run becomes more
3724 on its arguments (~users and $VARS). With this, @run becomes more
3714 like a normal command-line.
3725 like a normal command-line.
3715
3726
3716 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3727 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3717 bugs related to embedding and cleaned up that code. A fairly
3728 bugs related to embedding and cleaned up that code. A fairly
3718 important one was the impossibility to access the global namespace
3729 important one was the impossibility to access the global namespace
3719 through the embedded IPython (only local variables were visible).
3730 through the embedded IPython (only local variables were visible).
3720
3731
3721 2003-01-14 Fernando Perez <fperez@colorado.edu>
3732 2003-01-14 Fernando Perez <fperez@colorado.edu>
3722
3733
3723 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3734 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3724 auto-calling to be a bit more conservative. Now it doesn't get
3735 auto-calling to be a bit more conservative. Now it doesn't get
3725 triggered if any of '!=()<>' are in the rest of the input line, to
3736 triggered if any of '!=()<>' are in the rest of the input line, to
3726 allow comparing callables. Thanks to Alex for the heads up.
3737 allow comparing callables. Thanks to Alex for the heads up.
3727
3738
3728 2003-01-07 Fernando Perez <fperez@colorado.edu>
3739 2003-01-07 Fernando Perez <fperez@colorado.edu>
3729
3740
3730 * IPython/genutils.py (page): fixed estimation of the number of
3741 * IPython/genutils.py (page): fixed estimation of the number of
3731 lines in a string to be paged to simply count newlines. This
3742 lines in a string to be paged to simply count newlines. This
3732 prevents over-guessing due to embedded escape sequences. A better
3743 prevents over-guessing due to embedded escape sequences. A better
3733 long-term solution would involve stripping out the control chars
3744 long-term solution would involve stripping out the control chars
3734 for the count, but it's potentially so expensive I just don't
3745 for the count, but it's potentially so expensive I just don't
3735 think it's worth doing.
3746 think it's worth doing.
3736
3747
3737 2002-12-19 *** Released version 0.2.14pre50
3748 2002-12-19 *** Released version 0.2.14pre50
3738
3749
3739 2002-12-19 Fernando Perez <fperez@colorado.edu>
3750 2002-12-19 Fernando Perez <fperez@colorado.edu>
3740
3751
3741 * tools/release (version): Changed release scripts to inform
3752 * tools/release (version): Changed release scripts to inform
3742 Andrea and build a NEWS file with a list of recent changes.
3753 Andrea and build a NEWS file with a list of recent changes.
3743
3754
3744 * IPython/ColorANSI.py (__all__): changed terminal detection
3755 * IPython/ColorANSI.py (__all__): changed terminal detection
3745 code. Seems to work better for xterms without breaking
3756 code. Seems to work better for xterms without breaking
3746 konsole. Will need more testing to determine if WinXP and Mac OSX
3757 konsole. Will need more testing to determine if WinXP and Mac OSX
3747 also work ok.
3758 also work ok.
3748
3759
3749 2002-12-18 *** Released version 0.2.14pre49
3760 2002-12-18 *** Released version 0.2.14pre49
3750
3761
3751 2002-12-18 Fernando Perez <fperez@colorado.edu>
3762 2002-12-18 Fernando Perez <fperez@colorado.edu>
3752
3763
3753 * Docs: added new info about Mac OSX, from Andrea.
3764 * Docs: added new info about Mac OSX, from Andrea.
3754
3765
3755 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3766 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3756 allow direct plotting of python strings whose format is the same
3767 allow direct plotting of python strings whose format is the same
3757 of gnuplot data files.
3768 of gnuplot data files.
3758
3769
3759 2002-12-16 Fernando Perez <fperez@colorado.edu>
3770 2002-12-16 Fernando Perez <fperez@colorado.edu>
3760
3771
3761 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3772 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3762 value of exit question to be acknowledged.
3773 value of exit question to be acknowledged.
3763
3774
3764 2002-12-03 Fernando Perez <fperez@colorado.edu>
3775 2002-12-03 Fernando Perez <fperez@colorado.edu>
3765
3776
3766 * IPython/ipmaker.py: removed generators, which had been added
3777 * IPython/ipmaker.py: removed generators, which had been added
3767 by mistake in an earlier debugging run. This was causing trouble
3778 by mistake in an earlier debugging run. This was causing trouble
3768 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3779 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3769 for pointing this out.
3780 for pointing this out.
3770
3781
3771 2002-11-17 Fernando Perez <fperez@colorado.edu>
3782 2002-11-17 Fernando Perez <fperez@colorado.edu>
3772
3783
3773 * Manual: updated the Gnuplot section.
3784 * Manual: updated the Gnuplot section.
3774
3785
3775 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3786 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3776 a much better split of what goes in Runtime and what goes in
3787 a much better split of what goes in Runtime and what goes in
3777 Interactive.
3788 Interactive.
3778
3789
3779 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3790 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3780 being imported from iplib.
3791 being imported from iplib.
3781
3792
3782 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3793 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3783 for command-passing. Now the global Gnuplot instance is called
3794 for command-passing. Now the global Gnuplot instance is called
3784 'gp' instead of 'g', which was really a far too fragile and
3795 'gp' instead of 'g', which was really a far too fragile and
3785 common name.
3796 common name.
3786
3797
3787 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3798 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3788 bounding boxes generated by Gnuplot for square plots.
3799 bounding boxes generated by Gnuplot for square plots.
3789
3800
3790 * IPython/genutils.py (popkey): new function added. I should
3801 * IPython/genutils.py (popkey): new function added. I should
3791 suggest this on c.l.py as a dict method, it seems useful.
3802 suggest this on c.l.py as a dict method, it seems useful.
3792
3803
3793 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3804 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3794 to transparently handle PostScript generation. MUCH better than
3805 to transparently handle PostScript generation. MUCH better than
3795 the previous plot_eps/replot_eps (which I removed now). The code
3806 the previous plot_eps/replot_eps (which I removed now). The code
3796 is also fairly clean and well documented now (including
3807 is also fairly clean and well documented now (including
3797 docstrings).
3808 docstrings).
3798
3809
3799 2002-11-13 Fernando Perez <fperez@colorado.edu>
3810 2002-11-13 Fernando Perez <fperez@colorado.edu>
3800
3811
3801 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3812 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3802 (inconsistent with options).
3813 (inconsistent with options).
3803
3814
3804 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3815 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3805 manually disabled, I don't know why. Fixed it.
3816 manually disabled, I don't know why. Fixed it.
3806 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3817 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3807 eps output.
3818 eps output.
3808
3819
3809 2002-11-12 Fernando Perez <fperez@colorado.edu>
3820 2002-11-12 Fernando Perez <fperez@colorado.edu>
3810
3821
3811 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3822 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3812 don't propagate up to caller. Fixes crash reported by François
3823 don't propagate up to caller. Fixes crash reported by François
3813 Pinard.
3824 Pinard.
3814
3825
3815 2002-11-09 Fernando Perez <fperez@colorado.edu>
3826 2002-11-09 Fernando Perez <fperez@colorado.edu>
3816
3827
3817 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3828 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3818 history file for new users.
3829 history file for new users.
3819 (make_IPython): fixed bug where initial install would leave the
3830 (make_IPython): fixed bug where initial install would leave the
3820 user running in the .ipython dir.
3831 user running in the .ipython dir.
3821 (make_IPython): fixed bug where config dir .ipython would be
3832 (make_IPython): fixed bug where config dir .ipython would be
3822 created regardless of the given -ipythondir option. Thanks to Cory
3833 created regardless of the given -ipythondir option. Thanks to Cory
3823 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3834 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3824
3835
3825 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3836 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3826 type confirmations. Will need to use it in all of IPython's code
3837 type confirmations. Will need to use it in all of IPython's code
3827 consistently.
3838 consistently.
3828
3839
3829 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3840 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3830 context to print 31 lines instead of the default 5. This will make
3841 context to print 31 lines instead of the default 5. This will make
3831 the crash reports extremely detailed in case the problem is in
3842 the crash reports extremely detailed in case the problem is in
3832 libraries I don't have access to.
3843 libraries I don't have access to.
3833
3844
3834 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3845 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3835 line of defense' code to still crash, but giving users fair
3846 line of defense' code to still crash, but giving users fair
3836 warning. I don't want internal errors to go unreported: if there's
3847 warning. I don't want internal errors to go unreported: if there's
3837 an internal problem, IPython should crash and generate a full
3848 an internal problem, IPython should crash and generate a full
3838 report.
3849 report.
3839
3850
3840 2002-11-08 Fernando Perez <fperez@colorado.edu>
3851 2002-11-08 Fernando Perez <fperez@colorado.edu>
3841
3852
3842 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3853 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3843 otherwise uncaught exceptions which can appear if people set
3854 otherwise uncaught exceptions which can appear if people set
3844 sys.stdout to something badly broken. Thanks to a crash report
3855 sys.stdout to something badly broken. Thanks to a crash report
3845 from henni-AT-mail.brainbot.com.
3856 from henni-AT-mail.brainbot.com.
3846
3857
3847 2002-11-04 Fernando Perez <fperez@colorado.edu>
3858 2002-11-04 Fernando Perez <fperez@colorado.edu>
3848
3859
3849 * IPython/iplib.py (InteractiveShell.interact): added
3860 * IPython/iplib.py (InteractiveShell.interact): added
3850 __IPYTHON__active to the builtins. It's a flag which goes on when
3861 __IPYTHON__active to the builtins. It's a flag which goes on when
3851 the interaction starts and goes off again when it stops. This
3862 the interaction starts and goes off again when it stops. This
3852 allows embedding code to detect being inside IPython. Before this
3863 allows embedding code to detect being inside IPython. Before this
3853 was done via __IPYTHON__, but that only shows that an IPython
3864 was done via __IPYTHON__, but that only shows that an IPython
3854 instance has been created.
3865 instance has been created.
3855
3866
3856 * IPython/Magic.py (Magic.magic_env): I realized that in a
3867 * IPython/Magic.py (Magic.magic_env): I realized that in a
3857 UserDict, instance.data holds the data as a normal dict. So I
3868 UserDict, instance.data holds the data as a normal dict. So I
3858 modified @env to return os.environ.data instead of rebuilding a
3869 modified @env to return os.environ.data instead of rebuilding a
3859 dict by hand.
3870 dict by hand.
3860
3871
3861 2002-11-02 Fernando Perez <fperez@colorado.edu>
3872 2002-11-02 Fernando Perez <fperez@colorado.edu>
3862
3873
3863 * IPython/genutils.py (warn): changed so that level 1 prints no
3874 * IPython/genutils.py (warn): changed so that level 1 prints no
3864 header. Level 2 is now the default (with 'WARNING' header, as
3875 header. Level 2 is now the default (with 'WARNING' header, as
3865 before). I think I tracked all places where changes were needed in
3876 before). I think I tracked all places where changes were needed in
3866 IPython, but outside code using the old level numbering may have
3877 IPython, but outside code using the old level numbering may have
3867 broken.
3878 broken.
3868
3879
3869 * IPython/iplib.py (InteractiveShell.runcode): added this to
3880 * IPython/iplib.py (InteractiveShell.runcode): added this to
3870 handle the tracebacks in SystemExit traps correctly. The previous
3881 handle the tracebacks in SystemExit traps correctly. The previous
3871 code (through interact) was printing more of the stack than
3882 code (through interact) was printing more of the stack than
3872 necessary, showing IPython internal code to the user.
3883 necessary, showing IPython internal code to the user.
3873
3884
3874 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3885 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3875 default. Now that the default at the confirmation prompt is yes,
3886 default. Now that the default at the confirmation prompt is yes,
3876 it's not so intrusive. François' argument that ipython sessions
3887 it's not so intrusive. François' argument that ipython sessions
3877 tend to be complex enough not to lose them from an accidental C-d,
3888 tend to be complex enough not to lose them from an accidental C-d,
3878 is a valid one.
3889 is a valid one.
3879
3890
3880 * IPython/iplib.py (InteractiveShell.interact): added a
3891 * IPython/iplib.py (InteractiveShell.interact): added a
3881 showtraceback() call to the SystemExit trap, and modified the exit
3892 showtraceback() call to the SystemExit trap, and modified the exit
3882 confirmation to have yes as the default.
3893 confirmation to have yes as the default.
3883
3894
3884 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3895 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3885 this file. It's been gone from the code for a long time, this was
3896 this file. It's been gone from the code for a long time, this was
3886 simply leftover junk.
3897 simply leftover junk.
3887
3898
3888 2002-11-01 Fernando Perez <fperez@colorado.edu>
3899 2002-11-01 Fernando Perez <fperez@colorado.edu>
3889
3900
3890 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3901 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3891 added. If set, IPython now traps EOF and asks for
3902 added. If set, IPython now traps EOF and asks for
3892 confirmation. After a request by François Pinard.
3903 confirmation. After a request by François Pinard.
3893
3904
3894 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3905 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3895 of @abort, and with a new (better) mechanism for handling the
3906 of @abort, and with a new (better) mechanism for handling the
3896 exceptions.
3907 exceptions.
3897
3908
3898 2002-10-27 Fernando Perez <fperez@colorado.edu>
3909 2002-10-27 Fernando Perez <fperez@colorado.edu>
3899
3910
3900 * IPython/usage.py (__doc__): updated the --help information and
3911 * IPython/usage.py (__doc__): updated the --help information and
3901 the ipythonrc file to indicate that -log generates
3912 the ipythonrc file to indicate that -log generates
3902 ./ipython.log. Also fixed the corresponding info in @logstart.
3913 ./ipython.log. Also fixed the corresponding info in @logstart.
3903 This and several other fixes in the manuals thanks to reports by
3914 This and several other fixes in the manuals thanks to reports by
3904 François Pinard <pinard-AT-iro.umontreal.ca>.
3915 François Pinard <pinard-AT-iro.umontreal.ca>.
3905
3916
3906 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3917 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3907 refer to @logstart (instead of @log, which doesn't exist).
3918 refer to @logstart (instead of @log, which doesn't exist).
3908
3919
3909 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3920 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3910 AttributeError crash. Thanks to Christopher Armstrong
3921 AttributeError crash. Thanks to Christopher Armstrong
3911 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3922 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3912 introduced recently (in 0.2.14pre37) with the fix to the eval
3923 introduced recently (in 0.2.14pre37) with the fix to the eval
3913 problem mentioned below.
3924 problem mentioned below.
3914
3925
3915 2002-10-17 Fernando Perez <fperez@colorado.edu>
3926 2002-10-17 Fernando Perez <fperez@colorado.edu>
3916
3927
3917 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3928 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3918 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3929 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3919
3930
3920 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3931 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3921 this function to fix a problem reported by Alex Schmolck. He saw
3932 this function to fix a problem reported by Alex Schmolck. He saw
3922 it with list comprehensions and generators, which were getting
3933 it with list comprehensions and generators, which were getting
3923 called twice. The real problem was an 'eval' call in testing for
3934 called twice. The real problem was an 'eval' call in testing for
3924 automagic which was evaluating the input line silently.
3935 automagic which was evaluating the input line silently.
3925
3936
3926 This is a potentially very nasty bug, if the input has side
3937 This is a potentially very nasty bug, if the input has side
3927 effects which must not be repeated. The code is much cleaner now,
3938 effects which must not be repeated. The code is much cleaner now,
3928 without any blanket 'except' left and with a regexp test for
3939 without any blanket 'except' left and with a regexp test for
3929 actual function names.
3940 actual function names.
3930
3941
3931 But an eval remains, which I'm not fully comfortable with. I just
3942 But an eval remains, which I'm not fully comfortable with. I just
3932 don't know how to find out if an expression could be a callable in
3943 don't know how to find out if an expression could be a callable in
3933 the user's namespace without doing an eval on the string. However
3944 the user's namespace without doing an eval on the string. However
3934 that string is now much more strictly checked so that no code
3945 that string is now much more strictly checked so that no code
3935 slips by, so the eval should only happen for things that can
3946 slips by, so the eval should only happen for things that can
3936 really be only function/method names.
3947 really be only function/method names.
3937
3948
3938 2002-10-15 Fernando Perez <fperez@colorado.edu>
3949 2002-10-15 Fernando Perez <fperez@colorado.edu>
3939
3950
3940 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3951 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3941 OSX information to main manual, removed README_Mac_OSX file from
3952 OSX information to main manual, removed README_Mac_OSX file from
3942 distribution. Also updated credits for recent additions.
3953 distribution. Also updated credits for recent additions.
3943
3954
3944 2002-10-10 Fernando Perez <fperez@colorado.edu>
3955 2002-10-10 Fernando Perez <fperez@colorado.edu>
3945
3956
3946 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3957 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3947 terminal-related issues. Many thanks to Andrea Riciputi
3958 terminal-related issues. Many thanks to Andrea Riciputi
3948 <andrea.riciputi-AT-libero.it> for writing it.
3959 <andrea.riciputi-AT-libero.it> for writing it.
3949
3960
3950 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3961 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3951 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3962 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3952
3963
3953 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3964 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3954 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3965 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3955 <syver-en-AT-online.no> who both submitted patches for this problem.
3966 <syver-en-AT-online.no> who both submitted patches for this problem.
3956
3967
3957 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3968 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3958 global embedding to make sure that things don't overwrite user
3969 global embedding to make sure that things don't overwrite user
3959 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3970 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3960
3971
3961 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3972 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3962 compatibility. Thanks to Hayden Callow
3973 compatibility. Thanks to Hayden Callow
3963 <h.callow-AT-elec.canterbury.ac.nz>
3974 <h.callow-AT-elec.canterbury.ac.nz>
3964
3975
3965 2002-10-04 Fernando Perez <fperez@colorado.edu>
3976 2002-10-04 Fernando Perez <fperez@colorado.edu>
3966
3977
3967 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3978 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3968 Gnuplot.File objects.
3979 Gnuplot.File objects.
3969
3980
3970 2002-07-23 Fernando Perez <fperez@colorado.edu>
3981 2002-07-23 Fernando Perez <fperez@colorado.edu>
3971
3982
3972 * IPython/genutils.py (timing): Added timings() and timing() for
3983 * IPython/genutils.py (timing): Added timings() and timing() for
3973 quick access to the most commonly needed data, the execution
3984 quick access to the most commonly needed data, the execution
3974 times. Old timing() renamed to timings_out().
3985 times. Old timing() renamed to timings_out().
3975
3986
3976 2002-07-18 Fernando Perez <fperez@colorado.edu>
3987 2002-07-18 Fernando Perez <fperez@colorado.edu>
3977
3988
3978 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3989 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3979 bug with nested instances disrupting the parent's tab completion.
3990 bug with nested instances disrupting the parent's tab completion.
3980
3991
3981 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3992 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3982 all_completions code to begin the emacs integration.
3993 all_completions code to begin the emacs integration.
3983
3994
3984 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3995 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3985 argument to allow titling individual arrays when plotting.
3996 argument to allow titling individual arrays when plotting.
3986
3997
3987 2002-07-15 Fernando Perez <fperez@colorado.edu>
3998 2002-07-15 Fernando Perez <fperez@colorado.edu>
3988
3999
3989 * setup.py (make_shortcut): changed to retrieve the value of
4000 * setup.py (make_shortcut): changed to retrieve the value of
3990 'Program Files' directory from the registry (this value changes in
4001 'Program Files' directory from the registry (this value changes in
3991 non-english versions of Windows). Thanks to Thomas Fanslau
4002 non-english versions of Windows). Thanks to Thomas Fanslau
3992 <tfanslau-AT-gmx.de> for the report.
4003 <tfanslau-AT-gmx.de> for the report.
3993
4004
3994 2002-07-10 Fernando Perez <fperez@colorado.edu>
4005 2002-07-10 Fernando Perez <fperez@colorado.edu>
3995
4006
3996 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4007 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3997 a bug in pdb, which crashes if a line with only whitespace is
4008 a bug in pdb, which crashes if a line with only whitespace is
3998 entered. Bug report submitted to sourceforge.
4009 entered. Bug report submitted to sourceforge.
3999
4010
4000 2002-07-09 Fernando Perez <fperez@colorado.edu>
4011 2002-07-09 Fernando Perez <fperez@colorado.edu>
4001
4012
4002 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4013 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4003 reporting exceptions (it's a bug in inspect.py, I just set a
4014 reporting exceptions (it's a bug in inspect.py, I just set a
4004 workaround).
4015 workaround).
4005
4016
4006 2002-07-08 Fernando Perez <fperez@colorado.edu>
4017 2002-07-08 Fernando Perez <fperez@colorado.edu>
4007
4018
4008 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4019 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4009 __IPYTHON__ in __builtins__ to show up in user_ns.
4020 __IPYTHON__ in __builtins__ to show up in user_ns.
4010
4021
4011 2002-07-03 Fernando Perez <fperez@colorado.edu>
4022 2002-07-03 Fernando Perez <fperez@colorado.edu>
4012
4023
4013 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4024 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4014 name from @gp_set_instance to @gp_set_default.
4025 name from @gp_set_instance to @gp_set_default.
4015
4026
4016 * IPython/ipmaker.py (make_IPython): default editor value set to
4027 * IPython/ipmaker.py (make_IPython): default editor value set to
4017 '0' (a string), to match the rc file. Otherwise will crash when
4028 '0' (a string), to match the rc file. Otherwise will crash when
4018 .strip() is called on it.
4029 .strip() is called on it.
4019
4030
4020
4031
4021 2002-06-28 Fernando Perez <fperez@colorado.edu>
4032 2002-06-28 Fernando Perez <fperez@colorado.edu>
4022
4033
4023 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4034 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4024 of files in current directory when a file is executed via
4035 of files in current directory when a file is executed via
4025 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4036 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4026
4037
4027 * setup.py (manfiles): fix for rpm builds, submitted by RA
4038 * setup.py (manfiles): fix for rpm builds, submitted by RA
4028 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4039 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4029
4040
4030 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4041 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4031 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4042 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4032 string!). A. Schmolck caught this one.
4043 string!). A. Schmolck caught this one.
4033
4044
4034 2002-06-27 Fernando Perez <fperez@colorado.edu>
4045 2002-06-27 Fernando Perez <fperez@colorado.edu>
4035
4046
4036 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4047 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4037 defined files at the cmd line. __name__ wasn't being set to
4048 defined files at the cmd line. __name__ wasn't being set to
4038 __main__.
4049 __main__.
4039
4050
4040 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4051 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4041 regular lists and tuples besides Numeric arrays.
4052 regular lists and tuples besides Numeric arrays.
4042
4053
4043 * IPython/Prompts.py (CachedOutput.__call__): Added output
4054 * IPython/Prompts.py (CachedOutput.__call__): Added output
4044 supression for input ending with ';'. Similar to Mathematica and
4055 supression for input ending with ';'. Similar to Mathematica and
4045 Matlab. The _* vars and Out[] list are still updated, just like
4056 Matlab. The _* vars and Out[] list are still updated, just like
4046 Mathematica behaves.
4057 Mathematica behaves.
4047
4058
4048 2002-06-25 Fernando Perez <fperez@colorado.edu>
4059 2002-06-25 Fernando Perez <fperez@colorado.edu>
4049
4060
4050 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4061 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4051 .ini extensions for profiels under Windows.
4062 .ini extensions for profiels under Windows.
4052
4063
4053 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4064 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4054 string form. Fix contributed by Alexander Schmolck
4065 string form. Fix contributed by Alexander Schmolck
4055 <a.schmolck-AT-gmx.net>
4066 <a.schmolck-AT-gmx.net>
4056
4067
4057 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4068 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4058 pre-configured Gnuplot instance.
4069 pre-configured Gnuplot instance.
4059
4070
4060 2002-06-21 Fernando Perez <fperez@colorado.edu>
4071 2002-06-21 Fernando Perez <fperez@colorado.edu>
4061
4072
4062 * IPython/numutils.py (exp_safe): new function, works around the
4073 * IPython/numutils.py (exp_safe): new function, works around the
4063 underflow problems in Numeric.
4074 underflow problems in Numeric.
4064 (log2): New fn. Safe log in base 2: returns exact integer answer
4075 (log2): New fn. Safe log in base 2: returns exact integer answer
4065 for exact integer powers of 2.
4076 for exact integer powers of 2.
4066
4077
4067 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4078 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4068 properly.
4079 properly.
4069
4080
4070 2002-06-20 Fernando Perez <fperez@colorado.edu>
4081 2002-06-20 Fernando Perez <fperez@colorado.edu>
4071
4082
4072 * IPython/genutils.py (timing): new function like
4083 * IPython/genutils.py (timing): new function like
4073 Mathematica's. Similar to time_test, but returns more info.
4084 Mathematica's. Similar to time_test, but returns more info.
4074
4085
4075 2002-06-18 Fernando Perez <fperez@colorado.edu>
4086 2002-06-18 Fernando Perez <fperez@colorado.edu>
4076
4087
4077 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4088 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4078 according to Mike Heeter's suggestions.
4089 according to Mike Heeter's suggestions.
4079
4090
4080 2002-06-16 Fernando Perez <fperez@colorado.edu>
4091 2002-06-16 Fernando Perez <fperez@colorado.edu>
4081
4092
4082 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4093 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4083 system. GnuplotMagic is gone as a user-directory option. New files
4094 system. GnuplotMagic is gone as a user-directory option. New files
4084 make it easier to use all the gnuplot stuff both from external
4095 make it easier to use all the gnuplot stuff both from external
4085 programs as well as from IPython. Had to rewrite part of
4096 programs as well as from IPython. Had to rewrite part of
4086 hardcopy() b/c of a strange bug: often the ps files simply don't
4097 hardcopy() b/c of a strange bug: often the ps files simply don't
4087 get created, and require a repeat of the command (often several
4098 get created, and require a repeat of the command (often several
4088 times).
4099 times).
4089
4100
4090 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4101 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4091 resolve output channel at call time, so that if sys.stderr has
4102 resolve output channel at call time, so that if sys.stderr has
4092 been redirected by user this gets honored.
4103 been redirected by user this gets honored.
4093
4104
4094 2002-06-13 Fernando Perez <fperez@colorado.edu>
4105 2002-06-13 Fernando Perez <fperez@colorado.edu>
4095
4106
4096 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4107 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4097 IPShell. Kept a copy with the old names to avoid breaking people's
4108 IPShell. Kept a copy with the old names to avoid breaking people's
4098 embedded code.
4109 embedded code.
4099
4110
4100 * IPython/ipython: simplified it to the bare minimum after
4111 * IPython/ipython: simplified it to the bare minimum after
4101 Holger's suggestions. Added info about how to use it in
4112 Holger's suggestions. Added info about how to use it in
4102 PYTHONSTARTUP.
4113 PYTHONSTARTUP.
4103
4114
4104 * IPython/Shell.py (IPythonShell): changed the options passing
4115 * IPython/Shell.py (IPythonShell): changed the options passing
4105 from a string with funky %s replacements to a straight list. Maybe
4116 from a string with funky %s replacements to a straight list. Maybe
4106 a bit more typing, but it follows sys.argv conventions, so there's
4117 a bit more typing, but it follows sys.argv conventions, so there's
4107 less special-casing to remember.
4118 less special-casing to remember.
4108
4119
4109 2002-06-12 Fernando Perez <fperez@colorado.edu>
4120 2002-06-12 Fernando Perez <fperez@colorado.edu>
4110
4121
4111 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4122 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4112 command. Thanks to a suggestion by Mike Heeter.
4123 command. Thanks to a suggestion by Mike Heeter.
4113 (Magic.magic_pfile): added behavior to look at filenames if given
4124 (Magic.magic_pfile): added behavior to look at filenames if given
4114 arg is not a defined object.
4125 arg is not a defined object.
4115 (Magic.magic_save): New @save function to save code snippets. Also
4126 (Magic.magic_save): New @save function to save code snippets. Also
4116 a Mike Heeter idea.
4127 a Mike Heeter idea.
4117
4128
4118 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4129 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4119 plot() and replot(). Much more convenient now, especially for
4130 plot() and replot(). Much more convenient now, especially for
4120 interactive use.
4131 interactive use.
4121
4132
4122 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4133 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4123 filenames.
4134 filenames.
4124
4135
4125 2002-06-02 Fernando Perez <fperez@colorado.edu>
4136 2002-06-02 Fernando Perez <fperez@colorado.edu>
4126
4137
4127 * IPython/Struct.py (Struct.__init__): modified to admit
4138 * IPython/Struct.py (Struct.__init__): modified to admit
4128 initialization via another struct.
4139 initialization via another struct.
4129
4140
4130 * IPython/genutils.py (SystemExec.__init__): New stateful
4141 * IPython/genutils.py (SystemExec.__init__): New stateful
4131 interface to xsys and bq. Useful for writing system scripts.
4142 interface to xsys and bq. Useful for writing system scripts.
4132
4143
4133 2002-05-30 Fernando Perez <fperez@colorado.edu>
4144 2002-05-30 Fernando Perez <fperez@colorado.edu>
4134
4145
4135 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4146 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4136 documents. This will make the user download smaller (it's getting
4147 documents. This will make the user download smaller (it's getting
4137 too big).
4148 too big).
4138
4149
4139 2002-05-29 Fernando Perez <fperez@colorado.edu>
4150 2002-05-29 Fernando Perez <fperez@colorado.edu>
4140
4151
4141 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4152 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4142 fix problems with shelve and pickle. Seems to work, but I don't
4153 fix problems with shelve and pickle. Seems to work, but I don't
4143 know if corner cases break it. Thanks to Mike Heeter
4154 know if corner cases break it. Thanks to Mike Heeter
4144 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4155 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4145
4156
4146 2002-05-24 Fernando Perez <fperez@colorado.edu>
4157 2002-05-24 Fernando Perez <fperez@colorado.edu>
4147
4158
4148 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4159 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4149 macros having broken.
4160 macros having broken.
4150
4161
4151 2002-05-21 Fernando Perez <fperez@colorado.edu>
4162 2002-05-21 Fernando Perez <fperez@colorado.edu>
4152
4163
4153 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4164 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4154 introduced logging bug: all history before logging started was
4165 introduced logging bug: all history before logging started was
4155 being written one character per line! This came from the redesign
4166 being written one character per line! This came from the redesign
4156 of the input history as a special list which slices to strings,
4167 of the input history as a special list which slices to strings,
4157 not to lists.
4168 not to lists.
4158
4169
4159 2002-05-20 Fernando Perez <fperez@colorado.edu>
4170 2002-05-20 Fernando Perez <fperez@colorado.edu>
4160
4171
4161 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4172 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4162 be an attribute of all classes in this module. The design of these
4173 be an attribute of all classes in this module. The design of these
4163 classes needs some serious overhauling.
4174 classes needs some serious overhauling.
4164
4175
4165 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4176 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4166 which was ignoring '_' in option names.
4177 which was ignoring '_' in option names.
4167
4178
4168 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4179 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4169 'Verbose_novars' to 'Context' and made it the new default. It's a
4180 'Verbose_novars' to 'Context' and made it the new default. It's a
4170 bit more readable and also safer than verbose.
4181 bit more readable and also safer than verbose.
4171
4182
4172 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4183 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4173 triple-quoted strings.
4184 triple-quoted strings.
4174
4185
4175 * IPython/OInspect.py (__all__): new module exposing the object
4186 * IPython/OInspect.py (__all__): new module exposing the object
4176 introspection facilities. Now the corresponding magics are dummy
4187 introspection facilities. Now the corresponding magics are dummy
4177 wrappers around this. Having this module will make it much easier
4188 wrappers around this. Having this module will make it much easier
4178 to put these functions into our modified pdb.
4189 to put these functions into our modified pdb.
4179 This new object inspector system uses the new colorizing module,
4190 This new object inspector system uses the new colorizing module,
4180 so source code and other things are nicely syntax highlighted.
4191 so source code and other things are nicely syntax highlighted.
4181
4192
4182 2002-05-18 Fernando Perez <fperez@colorado.edu>
4193 2002-05-18 Fernando Perez <fperez@colorado.edu>
4183
4194
4184 * IPython/ColorANSI.py: Split the coloring tools into a separate
4195 * IPython/ColorANSI.py: Split the coloring tools into a separate
4185 module so I can use them in other code easier (they were part of
4196 module so I can use them in other code easier (they were part of
4186 ultraTB).
4197 ultraTB).
4187
4198
4188 2002-05-17 Fernando Perez <fperez@colorado.edu>
4199 2002-05-17 Fernando Perez <fperez@colorado.edu>
4189
4200
4190 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4201 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4191 fixed it to set the global 'g' also to the called instance, as
4202 fixed it to set the global 'g' also to the called instance, as
4192 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4203 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4193 user's 'g' variables).
4204 user's 'g' variables).
4194
4205
4195 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4206 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4196 global variables (aliases to _ih,_oh) so that users which expect
4207 global variables (aliases to _ih,_oh) so that users which expect
4197 In[5] or Out[7] to work aren't unpleasantly surprised.
4208 In[5] or Out[7] to work aren't unpleasantly surprised.
4198 (InputList.__getslice__): new class to allow executing slices of
4209 (InputList.__getslice__): new class to allow executing slices of
4199 input history directly. Very simple class, complements the use of
4210 input history directly. Very simple class, complements the use of
4200 macros.
4211 macros.
4201
4212
4202 2002-05-16 Fernando Perez <fperez@colorado.edu>
4213 2002-05-16 Fernando Perez <fperez@colorado.edu>
4203
4214
4204 * setup.py (docdirbase): make doc directory be just doc/IPython
4215 * setup.py (docdirbase): make doc directory be just doc/IPython
4205 without version numbers, it will reduce clutter for users.
4216 without version numbers, it will reduce clutter for users.
4206
4217
4207 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4218 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4208 execfile call to prevent possible memory leak. See for details:
4219 execfile call to prevent possible memory leak. See for details:
4209 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4220 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4210
4221
4211 2002-05-15 Fernando Perez <fperez@colorado.edu>
4222 2002-05-15 Fernando Perez <fperez@colorado.edu>
4212
4223
4213 * IPython/Magic.py (Magic.magic_psource): made the object
4224 * IPython/Magic.py (Magic.magic_psource): made the object
4214 introspection names be more standard: pdoc, pdef, pfile and
4225 introspection names be more standard: pdoc, pdef, pfile and
4215 psource. They all print/page their output, and it makes
4226 psource. They all print/page their output, and it makes
4216 remembering them easier. Kept old names for compatibility as
4227 remembering them easier. Kept old names for compatibility as
4217 aliases.
4228 aliases.
4218
4229
4219 2002-05-14 Fernando Perez <fperez@colorado.edu>
4230 2002-05-14 Fernando Perez <fperez@colorado.edu>
4220
4231
4221 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4232 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4222 what the mouse problem was. The trick is to use gnuplot with temp
4233 what the mouse problem was. The trick is to use gnuplot with temp
4223 files and NOT with pipes (for data communication), because having
4234 files and NOT with pipes (for data communication), because having
4224 both pipes and the mouse on is bad news.
4235 both pipes and the mouse on is bad news.
4225
4236
4226 2002-05-13 Fernando Perez <fperez@colorado.edu>
4237 2002-05-13 Fernando Perez <fperez@colorado.edu>
4227
4238
4228 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4239 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4229 bug. Information would be reported about builtins even when
4240 bug. Information would be reported about builtins even when
4230 user-defined functions overrode them.
4241 user-defined functions overrode them.
4231
4242
4232 2002-05-11 Fernando Perez <fperez@colorado.edu>
4243 2002-05-11 Fernando Perez <fperez@colorado.edu>
4233
4244
4234 * IPython/__init__.py (__all__): removed FlexCompleter from
4245 * IPython/__init__.py (__all__): removed FlexCompleter from
4235 __all__ so that things don't fail in platforms without readline.
4246 __all__ so that things don't fail in platforms without readline.
4236
4247
4237 2002-05-10 Fernando Perez <fperez@colorado.edu>
4248 2002-05-10 Fernando Perez <fperez@colorado.edu>
4238
4249
4239 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4250 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4240 it requires Numeric, effectively making Numeric a dependency for
4251 it requires Numeric, effectively making Numeric a dependency for
4241 IPython.
4252 IPython.
4242
4253
4243 * Released 0.2.13
4254 * Released 0.2.13
4244
4255
4245 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4256 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4246 profiler interface. Now all the major options from the profiler
4257 profiler interface. Now all the major options from the profiler
4247 module are directly supported in IPython, both for single
4258 module are directly supported in IPython, both for single
4248 expressions (@prun) and for full programs (@run -p).
4259 expressions (@prun) and for full programs (@run -p).
4249
4260
4250 2002-05-09 Fernando Perez <fperez@colorado.edu>
4261 2002-05-09 Fernando Perez <fperez@colorado.edu>
4251
4262
4252 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4263 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4253 magic properly formatted for screen.
4264 magic properly formatted for screen.
4254
4265
4255 * setup.py (make_shortcut): Changed things to put pdf version in
4266 * setup.py (make_shortcut): Changed things to put pdf version in
4256 doc/ instead of doc/manual (had to change lyxport a bit).
4267 doc/ instead of doc/manual (had to change lyxport a bit).
4257
4268
4258 * IPython/Magic.py (Profile.string_stats): made profile runs go
4269 * IPython/Magic.py (Profile.string_stats): made profile runs go
4259 through pager (they are long and a pager allows searching, saving,
4270 through pager (they are long and a pager allows searching, saving,
4260 etc.)
4271 etc.)
4261
4272
4262 2002-05-08 Fernando Perez <fperez@colorado.edu>
4273 2002-05-08 Fernando Perez <fperez@colorado.edu>
4263
4274
4264 * Released 0.2.12
4275 * Released 0.2.12
4265
4276
4266 2002-05-06 Fernando Perez <fperez@colorado.edu>
4277 2002-05-06 Fernando Perez <fperez@colorado.edu>
4267
4278
4268 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4279 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4269 introduced); 'hist n1 n2' was broken.
4280 introduced); 'hist n1 n2' was broken.
4270 (Magic.magic_pdb): added optional on/off arguments to @pdb
4281 (Magic.magic_pdb): added optional on/off arguments to @pdb
4271 (Magic.magic_run): added option -i to @run, which executes code in
4282 (Magic.magic_run): added option -i to @run, which executes code in
4272 the IPython namespace instead of a clean one. Also added @irun as
4283 the IPython namespace instead of a clean one. Also added @irun as
4273 an alias to @run -i.
4284 an alias to @run -i.
4274
4285
4275 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4286 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4276 fixed (it didn't really do anything, the namespaces were wrong).
4287 fixed (it didn't really do anything, the namespaces were wrong).
4277
4288
4278 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4289 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4279
4290
4280 * IPython/__init__.py (__all__): Fixed package namespace, now
4291 * IPython/__init__.py (__all__): Fixed package namespace, now
4281 'import IPython' does give access to IPython.<all> as
4292 'import IPython' does give access to IPython.<all> as
4282 expected. Also renamed __release__ to Release.
4293 expected. Also renamed __release__ to Release.
4283
4294
4284 * IPython/Debugger.py (__license__): created new Pdb class which
4295 * IPython/Debugger.py (__license__): created new Pdb class which
4285 functions like a drop-in for the normal pdb.Pdb but does NOT
4296 functions like a drop-in for the normal pdb.Pdb but does NOT
4286 import readline by default. This way it doesn't muck up IPython's
4297 import readline by default. This way it doesn't muck up IPython's
4287 readline handling, and now tab-completion finally works in the
4298 readline handling, and now tab-completion finally works in the
4288 debugger -- sort of. It completes things globally visible, but the
4299 debugger -- sort of. It completes things globally visible, but the
4289 completer doesn't track the stack as pdb walks it. That's a bit
4300 completer doesn't track the stack as pdb walks it. That's a bit
4290 tricky, and I'll have to implement it later.
4301 tricky, and I'll have to implement it later.
4291
4302
4292 2002-05-05 Fernando Perez <fperez@colorado.edu>
4303 2002-05-05 Fernando Perez <fperez@colorado.edu>
4293
4304
4294 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4305 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4295 magic docstrings when printed via ? (explicit \'s were being
4306 magic docstrings when printed via ? (explicit \'s were being
4296 printed).
4307 printed).
4297
4308
4298 * IPython/ipmaker.py (make_IPython): fixed namespace
4309 * IPython/ipmaker.py (make_IPython): fixed namespace
4299 identification bug. Now variables loaded via logs or command-line
4310 identification bug. Now variables loaded via logs or command-line
4300 files are recognized in the interactive namespace by @who.
4311 files are recognized in the interactive namespace by @who.
4301
4312
4302 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4313 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4303 log replay system stemming from the string form of Structs.
4314 log replay system stemming from the string form of Structs.
4304
4315
4305 * IPython/Magic.py (Macro.__init__): improved macros to properly
4316 * IPython/Magic.py (Macro.__init__): improved macros to properly
4306 handle magic commands in them.
4317 handle magic commands in them.
4307 (Magic.magic_logstart): usernames are now expanded so 'logstart
4318 (Magic.magic_logstart): usernames are now expanded so 'logstart
4308 ~/mylog' now works.
4319 ~/mylog' now works.
4309
4320
4310 * IPython/iplib.py (complete): fixed bug where paths starting with
4321 * IPython/iplib.py (complete): fixed bug where paths starting with
4311 '/' would be completed as magic names.
4322 '/' would be completed as magic names.
4312
4323
4313 2002-05-04 Fernando Perez <fperez@colorado.edu>
4324 2002-05-04 Fernando Perez <fperez@colorado.edu>
4314
4325
4315 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4326 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4316 allow running full programs under the profiler's control.
4327 allow running full programs under the profiler's control.
4317
4328
4318 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4329 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4319 mode to report exceptions verbosely but without formatting
4330 mode to report exceptions verbosely but without formatting
4320 variables. This addresses the issue of ipython 'freezing' (it's
4331 variables. This addresses the issue of ipython 'freezing' (it's
4321 not frozen, but caught in an expensive formatting loop) when huge
4332 not frozen, but caught in an expensive formatting loop) when huge
4322 variables are in the context of an exception.
4333 variables are in the context of an exception.
4323 (VerboseTB.text): Added '--->' markers at line where exception was
4334 (VerboseTB.text): Added '--->' markers at line where exception was
4324 triggered. Much clearer to read, especially in NoColor modes.
4335 triggered. Much clearer to read, especially in NoColor modes.
4325
4336
4326 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4337 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4327 implemented in reverse when changing to the new parse_options().
4338 implemented in reverse when changing to the new parse_options().
4328
4339
4329 2002-05-03 Fernando Perez <fperez@colorado.edu>
4340 2002-05-03 Fernando Perez <fperez@colorado.edu>
4330
4341
4331 * IPython/Magic.py (Magic.parse_options): new function so that
4342 * IPython/Magic.py (Magic.parse_options): new function so that
4332 magics can parse options easier.
4343 magics can parse options easier.
4333 (Magic.magic_prun): new function similar to profile.run(),
4344 (Magic.magic_prun): new function similar to profile.run(),
4334 suggested by Chris Hart.
4345 suggested by Chris Hart.
4335 (Magic.magic_cd): fixed behavior so that it only changes if
4346 (Magic.magic_cd): fixed behavior so that it only changes if
4336 directory actually is in history.
4347 directory actually is in history.
4337
4348
4338 * IPython/usage.py (__doc__): added information about potential
4349 * IPython/usage.py (__doc__): added information about potential
4339 slowness of Verbose exception mode when there are huge data
4350 slowness of Verbose exception mode when there are huge data
4340 structures to be formatted (thanks to Archie Paulson).
4351 structures to be formatted (thanks to Archie Paulson).
4341
4352
4342 * IPython/ipmaker.py (make_IPython): Changed default logging
4353 * IPython/ipmaker.py (make_IPython): Changed default logging
4343 (when simply called with -log) to use curr_dir/ipython.log in
4354 (when simply called with -log) to use curr_dir/ipython.log in
4344 rotate mode. Fixed crash which was occuring with -log before
4355 rotate mode. Fixed crash which was occuring with -log before
4345 (thanks to Jim Boyle).
4356 (thanks to Jim Boyle).
4346
4357
4347 2002-05-01 Fernando Perez <fperez@colorado.edu>
4358 2002-05-01 Fernando Perez <fperez@colorado.edu>
4348
4359
4349 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4360 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4350 was nasty -- though somewhat of a corner case).
4361 was nasty -- though somewhat of a corner case).
4351
4362
4352 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4363 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4353 text (was a bug).
4364 text (was a bug).
4354
4365
4355 2002-04-30 Fernando Perez <fperez@colorado.edu>
4366 2002-04-30 Fernando Perez <fperez@colorado.edu>
4356
4367
4357 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4368 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4358 a print after ^D or ^C from the user so that the In[] prompt
4369 a print after ^D or ^C from the user so that the In[] prompt
4359 doesn't over-run the gnuplot one.
4370 doesn't over-run the gnuplot one.
4360
4371
4361 2002-04-29 Fernando Perez <fperez@colorado.edu>
4372 2002-04-29 Fernando Perez <fperez@colorado.edu>
4362
4373
4363 * Released 0.2.10
4374 * Released 0.2.10
4364
4375
4365 * IPython/__release__.py (version): get date dynamically.
4376 * IPython/__release__.py (version): get date dynamically.
4366
4377
4367 * Misc. documentation updates thanks to Arnd's comments. Also ran
4378 * Misc. documentation updates thanks to Arnd's comments. Also ran
4368 a full spellcheck on the manual (hadn't been done in a while).
4379 a full spellcheck on the manual (hadn't been done in a while).
4369
4380
4370 2002-04-27 Fernando Perez <fperez@colorado.edu>
4381 2002-04-27 Fernando Perez <fperez@colorado.edu>
4371
4382
4372 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4383 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4373 starting a log in mid-session would reset the input history list.
4384 starting a log in mid-session would reset the input history list.
4374
4385
4375 2002-04-26 Fernando Perez <fperez@colorado.edu>
4386 2002-04-26 Fernando Perez <fperez@colorado.edu>
4376
4387
4377 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4388 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4378 all files were being included in an update. Now anything in
4389 all files were being included in an update. Now anything in
4379 UserConfig that matches [A-Za-z]*.py will go (this excludes
4390 UserConfig that matches [A-Za-z]*.py will go (this excludes
4380 __init__.py)
4391 __init__.py)
4381
4392
4382 2002-04-25 Fernando Perez <fperez@colorado.edu>
4393 2002-04-25 Fernando Perez <fperez@colorado.edu>
4383
4394
4384 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4395 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4385 to __builtins__ so that any form of embedded or imported code can
4396 to __builtins__ so that any form of embedded or imported code can
4386 test for being inside IPython.
4397 test for being inside IPython.
4387
4398
4388 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4399 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4389 changed to GnuplotMagic because it's now an importable module,
4400 changed to GnuplotMagic because it's now an importable module,
4390 this makes the name follow that of the standard Gnuplot module.
4401 this makes the name follow that of the standard Gnuplot module.
4391 GnuplotMagic can now be loaded at any time in mid-session.
4402 GnuplotMagic can now be loaded at any time in mid-session.
4392
4403
4393 2002-04-24 Fernando Perez <fperez@colorado.edu>
4404 2002-04-24 Fernando Perez <fperez@colorado.edu>
4394
4405
4395 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4406 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4396 the globals (IPython has its own namespace) and the
4407 the globals (IPython has its own namespace) and the
4397 PhysicalQuantity stuff is much better anyway.
4408 PhysicalQuantity stuff is much better anyway.
4398
4409
4399 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4410 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4400 embedding example to standard user directory for
4411 embedding example to standard user directory for
4401 distribution. Also put it in the manual.
4412 distribution. Also put it in the manual.
4402
4413
4403 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4414 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4404 instance as first argument (so it doesn't rely on some obscure
4415 instance as first argument (so it doesn't rely on some obscure
4405 hidden global).
4416 hidden global).
4406
4417
4407 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4418 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4408 delimiters. While it prevents ().TAB from working, it allows
4419 delimiters. While it prevents ().TAB from working, it allows
4409 completions in open (... expressions. This is by far a more common
4420 completions in open (... expressions. This is by far a more common
4410 case.
4421 case.
4411
4422
4412 2002-04-23 Fernando Perez <fperez@colorado.edu>
4423 2002-04-23 Fernando Perez <fperez@colorado.edu>
4413
4424
4414 * IPython/Extensions/InterpreterPasteInput.py: new
4425 * IPython/Extensions/InterpreterPasteInput.py: new
4415 syntax-processing module for pasting lines with >>> or ... at the
4426 syntax-processing module for pasting lines with >>> or ... at the
4416 start.
4427 start.
4417
4428
4418 * IPython/Extensions/PhysicalQ_Interactive.py
4429 * IPython/Extensions/PhysicalQ_Interactive.py
4419 (PhysicalQuantityInteractive.__int__): fixed to work with either
4430 (PhysicalQuantityInteractive.__int__): fixed to work with either
4420 Numeric or math.
4431 Numeric or math.
4421
4432
4422 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4433 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4423 provided profiles. Now we have:
4434 provided profiles. Now we have:
4424 -math -> math module as * and cmath with its own namespace.
4435 -math -> math module as * and cmath with its own namespace.
4425 -numeric -> Numeric as *, plus gnuplot & grace
4436 -numeric -> Numeric as *, plus gnuplot & grace
4426 -physics -> same as before
4437 -physics -> same as before
4427
4438
4428 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4439 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4429 user-defined magics wouldn't be found by @magic if they were
4440 user-defined magics wouldn't be found by @magic if they were
4430 defined as class methods. Also cleaned up the namespace search
4441 defined as class methods. Also cleaned up the namespace search
4431 logic and the string building (to use %s instead of many repeated
4442 logic and the string building (to use %s instead of many repeated
4432 string adds).
4443 string adds).
4433
4444
4434 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4445 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4435 of user-defined magics to operate with class methods (cleaner, in
4446 of user-defined magics to operate with class methods (cleaner, in
4436 line with the gnuplot code).
4447 line with the gnuplot code).
4437
4448
4438 2002-04-22 Fernando Perez <fperez@colorado.edu>
4449 2002-04-22 Fernando Perez <fperez@colorado.edu>
4439
4450
4440 * setup.py: updated dependency list so that manual is updated when
4451 * setup.py: updated dependency list so that manual is updated when
4441 all included files change.
4452 all included files change.
4442
4453
4443 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4454 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4444 the delimiter removal option (the fix is ugly right now).
4455 the delimiter removal option (the fix is ugly right now).
4445
4456
4446 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4457 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4447 all of the math profile (quicker loading, no conflict between
4458 all of the math profile (quicker loading, no conflict between
4448 g-9.8 and g-gnuplot).
4459 g-9.8 and g-gnuplot).
4449
4460
4450 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4461 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4451 name of post-mortem files to IPython_crash_report.txt.
4462 name of post-mortem files to IPython_crash_report.txt.
4452
4463
4453 * Cleanup/update of the docs. Added all the new readline info and
4464 * Cleanup/update of the docs. Added all the new readline info and
4454 formatted all lists as 'real lists'.
4465 formatted all lists as 'real lists'.
4455
4466
4456 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4467 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4457 tab-completion options, since the full readline parse_and_bind is
4468 tab-completion options, since the full readline parse_and_bind is
4458 now accessible.
4469 now accessible.
4459
4470
4460 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4471 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4461 handling of readline options. Now users can specify any string to
4472 handling of readline options. Now users can specify any string to
4462 be passed to parse_and_bind(), as well as the delimiters to be
4473 be passed to parse_and_bind(), as well as the delimiters to be
4463 removed.
4474 removed.
4464 (InteractiveShell.__init__): Added __name__ to the global
4475 (InteractiveShell.__init__): Added __name__ to the global
4465 namespace so that things like Itpl which rely on its existence
4476 namespace so that things like Itpl which rely on its existence
4466 don't crash.
4477 don't crash.
4467 (InteractiveShell._prefilter): Defined the default with a _ so
4478 (InteractiveShell._prefilter): Defined the default with a _ so
4468 that prefilter() is easier to override, while the default one
4479 that prefilter() is easier to override, while the default one
4469 remains available.
4480 remains available.
4470
4481
4471 2002-04-18 Fernando Perez <fperez@colorado.edu>
4482 2002-04-18 Fernando Perez <fperez@colorado.edu>
4472
4483
4473 * Added information about pdb in the docs.
4484 * Added information about pdb in the docs.
4474
4485
4475 2002-04-17 Fernando Perez <fperez@colorado.edu>
4486 2002-04-17 Fernando Perez <fperez@colorado.edu>
4476
4487
4477 * IPython/ipmaker.py (make_IPython): added rc_override option to
4488 * IPython/ipmaker.py (make_IPython): added rc_override option to
4478 allow passing config options at creation time which may override
4489 allow passing config options at creation time which may override
4479 anything set in the config files or command line. This is
4490 anything set in the config files or command line. This is
4480 particularly useful for configuring embedded instances.
4491 particularly useful for configuring embedded instances.
4481
4492
4482 2002-04-15 Fernando Perez <fperez@colorado.edu>
4493 2002-04-15 Fernando Perez <fperez@colorado.edu>
4483
4494
4484 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4495 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4485 crash embedded instances because of the input cache falling out of
4496 crash embedded instances because of the input cache falling out of
4486 sync with the output counter.
4497 sync with the output counter.
4487
4498
4488 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4499 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4489 mode which calls pdb after an uncaught exception in IPython itself.
4500 mode which calls pdb after an uncaught exception in IPython itself.
4490
4501
4491 2002-04-14 Fernando Perez <fperez@colorado.edu>
4502 2002-04-14 Fernando Perez <fperez@colorado.edu>
4492
4503
4493 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4504 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4494 readline, fix it back after each call.
4505 readline, fix it back after each call.
4495
4506
4496 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4507 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4497 method to force all access via __call__(), which guarantees that
4508 method to force all access via __call__(), which guarantees that
4498 traceback references are properly deleted.
4509 traceback references are properly deleted.
4499
4510
4500 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4511 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4501 improve printing when pprint is in use.
4512 improve printing when pprint is in use.
4502
4513
4503 2002-04-13 Fernando Perez <fperez@colorado.edu>
4514 2002-04-13 Fernando Perez <fperez@colorado.edu>
4504
4515
4505 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4516 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4506 exceptions aren't caught anymore. If the user triggers one, he
4517 exceptions aren't caught anymore. If the user triggers one, he
4507 should know why he's doing it and it should go all the way up,
4518 should know why he's doing it and it should go all the way up,
4508 just like any other exception. So now @abort will fully kill the
4519 just like any other exception. So now @abort will fully kill the
4509 embedded interpreter and the embedding code (unless that happens
4520 embedded interpreter and the embedding code (unless that happens
4510 to catch SystemExit).
4521 to catch SystemExit).
4511
4522
4512 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4523 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4513 and a debugger() method to invoke the interactive pdb debugger
4524 and a debugger() method to invoke the interactive pdb debugger
4514 after printing exception information. Also added the corresponding
4525 after printing exception information. Also added the corresponding
4515 -pdb option and @pdb magic to control this feature, and updated
4526 -pdb option and @pdb magic to control this feature, and updated
4516 the docs. After a suggestion from Christopher Hart
4527 the docs. After a suggestion from Christopher Hart
4517 (hart-AT-caltech.edu).
4528 (hart-AT-caltech.edu).
4518
4529
4519 2002-04-12 Fernando Perez <fperez@colorado.edu>
4530 2002-04-12 Fernando Perez <fperez@colorado.edu>
4520
4531
4521 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4532 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4522 the exception handlers defined by the user (not the CrashHandler)
4533 the exception handlers defined by the user (not the CrashHandler)
4523 so that user exceptions don't trigger an ipython bug report.
4534 so that user exceptions don't trigger an ipython bug report.
4524
4535
4525 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4536 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4526 configurable (it should have always been so).
4537 configurable (it should have always been so).
4527
4538
4528 2002-03-26 Fernando Perez <fperez@colorado.edu>
4539 2002-03-26 Fernando Perez <fperez@colorado.edu>
4529
4540
4530 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4541 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4531 and there to fix embedding namespace issues. This should all be
4542 and there to fix embedding namespace issues. This should all be
4532 done in a more elegant way.
4543 done in a more elegant way.
4533
4544
4534 2002-03-25 Fernando Perez <fperez@colorado.edu>
4545 2002-03-25 Fernando Perez <fperez@colorado.edu>
4535
4546
4536 * IPython/genutils.py (get_home_dir): Try to make it work under
4547 * IPython/genutils.py (get_home_dir): Try to make it work under
4537 win9x also.
4548 win9x also.
4538
4549
4539 2002-03-20 Fernando Perez <fperez@colorado.edu>
4550 2002-03-20 Fernando Perez <fperez@colorado.edu>
4540
4551
4541 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4552 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4542 sys.displayhook untouched upon __init__.
4553 sys.displayhook untouched upon __init__.
4543
4554
4544 2002-03-19 Fernando Perez <fperez@colorado.edu>
4555 2002-03-19 Fernando Perez <fperez@colorado.edu>
4545
4556
4546 * Released 0.2.9 (for embedding bug, basically).
4557 * Released 0.2.9 (for embedding bug, basically).
4547
4558
4548 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4559 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4549 exceptions so that enclosing shell's state can be restored.
4560 exceptions so that enclosing shell's state can be restored.
4550
4561
4551 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4562 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4552 naming conventions in the .ipython/ dir.
4563 naming conventions in the .ipython/ dir.
4553
4564
4554 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4565 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4555 from delimiters list so filenames with - in them get expanded.
4566 from delimiters list so filenames with - in them get expanded.
4556
4567
4557 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4568 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4558 sys.displayhook not being properly restored after an embedded call.
4569 sys.displayhook not being properly restored after an embedded call.
4559
4570
4560 2002-03-18 Fernando Perez <fperez@colorado.edu>
4571 2002-03-18 Fernando Perez <fperez@colorado.edu>
4561
4572
4562 * Released 0.2.8
4573 * Released 0.2.8
4563
4574
4564 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4575 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4565 some files weren't being included in a -upgrade.
4576 some files weren't being included in a -upgrade.
4566 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4577 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4567 on' so that the first tab completes.
4578 on' so that the first tab completes.
4568 (InteractiveShell.handle_magic): fixed bug with spaces around
4579 (InteractiveShell.handle_magic): fixed bug with spaces around
4569 quotes breaking many magic commands.
4580 quotes breaking many magic commands.
4570
4581
4571 * setup.py: added note about ignoring the syntax error messages at
4582 * setup.py: added note about ignoring the syntax error messages at
4572 installation.
4583 installation.
4573
4584
4574 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4585 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4575 streamlining the gnuplot interface, now there's only one magic @gp.
4586 streamlining the gnuplot interface, now there's only one magic @gp.
4576
4587
4577 2002-03-17 Fernando Perez <fperez@colorado.edu>
4588 2002-03-17 Fernando Perez <fperez@colorado.edu>
4578
4589
4579 * IPython/UserConfig/magic_gnuplot.py: new name for the
4590 * IPython/UserConfig/magic_gnuplot.py: new name for the
4580 example-magic_pm.py file. Much enhanced system, now with a shell
4591 example-magic_pm.py file. Much enhanced system, now with a shell
4581 for communicating directly with gnuplot, one command at a time.
4592 for communicating directly with gnuplot, one command at a time.
4582
4593
4583 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4594 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4584 setting __name__=='__main__'.
4595 setting __name__=='__main__'.
4585
4596
4586 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4597 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4587 mini-shell for accessing gnuplot from inside ipython. Should
4598 mini-shell for accessing gnuplot from inside ipython. Should
4588 extend it later for grace access too. Inspired by Arnd's
4599 extend it later for grace access too. Inspired by Arnd's
4589 suggestion.
4600 suggestion.
4590
4601
4591 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4602 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4592 calling magic functions with () in their arguments. Thanks to Arnd
4603 calling magic functions with () in their arguments. Thanks to Arnd
4593 Baecker for pointing this to me.
4604 Baecker for pointing this to me.
4594
4605
4595 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4606 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4596 infinitely for integer or complex arrays (only worked with floats).
4607 infinitely for integer or complex arrays (only worked with floats).
4597
4608
4598 2002-03-16 Fernando Perez <fperez@colorado.edu>
4609 2002-03-16 Fernando Perez <fperez@colorado.edu>
4599
4610
4600 * setup.py: Merged setup and setup_windows into a single script
4611 * setup.py: Merged setup and setup_windows into a single script
4601 which properly handles things for windows users.
4612 which properly handles things for windows users.
4602
4613
4603 2002-03-15 Fernando Perez <fperez@colorado.edu>
4614 2002-03-15 Fernando Perez <fperez@colorado.edu>
4604
4615
4605 * Big change to the manual: now the magics are all automatically
4616 * Big change to the manual: now the magics are all automatically
4606 documented. This information is generated from their docstrings
4617 documented. This information is generated from their docstrings
4607 and put in a latex file included by the manual lyx file. This way
4618 and put in a latex file included by the manual lyx file. This way
4608 we get always up to date information for the magics. The manual
4619 we get always up to date information for the magics. The manual
4609 now also has proper version information, also auto-synced.
4620 now also has proper version information, also auto-synced.
4610
4621
4611 For this to work, an undocumented --magic_docstrings option was added.
4622 For this to work, an undocumented --magic_docstrings option was added.
4612
4623
4613 2002-03-13 Fernando Perez <fperez@colorado.edu>
4624 2002-03-13 Fernando Perez <fperez@colorado.edu>
4614
4625
4615 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4626 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4616 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4627 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4617
4628
4618 2002-03-12 Fernando Perez <fperez@colorado.edu>
4629 2002-03-12 Fernando Perez <fperez@colorado.edu>
4619
4630
4620 * IPython/ultraTB.py (TermColors): changed color escapes again to
4631 * IPython/ultraTB.py (TermColors): changed color escapes again to
4621 fix the (old, reintroduced) line-wrapping bug. Basically, if
4632 fix the (old, reintroduced) line-wrapping bug. Basically, if
4622 \001..\002 aren't given in the color escapes, lines get wrapped
4633 \001..\002 aren't given in the color escapes, lines get wrapped
4623 weirdly. But giving those screws up old xterms and emacs terms. So
4634 weirdly. But giving those screws up old xterms and emacs terms. So
4624 I added some logic for emacs terms to be ok, but I can't identify old
4635 I added some logic for emacs terms to be ok, but I can't identify old
4625 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4636 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4626
4637
4627 2002-03-10 Fernando Perez <fperez@colorado.edu>
4638 2002-03-10 Fernando Perez <fperez@colorado.edu>
4628
4639
4629 * IPython/usage.py (__doc__): Various documentation cleanups and
4640 * IPython/usage.py (__doc__): Various documentation cleanups and
4630 updates, both in usage docstrings and in the manual.
4641 updates, both in usage docstrings and in the manual.
4631
4642
4632 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4643 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4633 handling of caching. Set minimum acceptabe value for having a
4644 handling of caching. Set minimum acceptabe value for having a
4634 cache at 20 values.
4645 cache at 20 values.
4635
4646
4636 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4647 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4637 install_first_time function to a method, renamed it and added an
4648 install_first_time function to a method, renamed it and added an
4638 'upgrade' mode. Now people can update their config directory with
4649 'upgrade' mode. Now people can update their config directory with
4639 a simple command line switch (-upgrade, also new).
4650 a simple command line switch (-upgrade, also new).
4640
4651
4641 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4652 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4642 @file (convenient for automagic users under Python >= 2.2).
4653 @file (convenient for automagic users under Python >= 2.2).
4643 Removed @files (it seemed more like a plural than an abbrev. of
4654 Removed @files (it seemed more like a plural than an abbrev. of
4644 'file show').
4655 'file show').
4645
4656
4646 * IPython/iplib.py (install_first_time): Fixed crash if there were
4657 * IPython/iplib.py (install_first_time): Fixed crash if there were
4647 backup files ('~') in .ipython/ install directory.
4658 backup files ('~') in .ipython/ install directory.
4648
4659
4649 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4660 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4650 system. Things look fine, but these changes are fairly
4661 system. Things look fine, but these changes are fairly
4651 intrusive. Test them for a few days.
4662 intrusive. Test them for a few days.
4652
4663
4653 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4664 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4654 the prompts system. Now all in/out prompt strings are user
4665 the prompts system. Now all in/out prompt strings are user
4655 controllable. This is particularly useful for embedding, as one
4666 controllable. This is particularly useful for embedding, as one
4656 can tag embedded instances with particular prompts.
4667 can tag embedded instances with particular prompts.
4657
4668
4658 Also removed global use of sys.ps1/2, which now allows nested
4669 Also removed global use of sys.ps1/2, which now allows nested
4659 embeddings without any problems. Added command-line options for
4670 embeddings without any problems. Added command-line options for
4660 the prompt strings.
4671 the prompt strings.
4661
4672
4662 2002-03-08 Fernando Perez <fperez@colorado.edu>
4673 2002-03-08 Fernando Perez <fperez@colorado.edu>
4663
4674
4664 * IPython/UserConfig/example-embed-short.py (ipshell): added
4675 * IPython/UserConfig/example-embed-short.py (ipshell): added
4665 example file with the bare minimum code for embedding.
4676 example file with the bare minimum code for embedding.
4666
4677
4667 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4678 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4668 functionality for the embeddable shell to be activated/deactivated
4679 functionality for the embeddable shell to be activated/deactivated
4669 either globally or at each call.
4680 either globally or at each call.
4670
4681
4671 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4682 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4672 rewriting the prompt with '--->' for auto-inputs with proper
4683 rewriting the prompt with '--->' for auto-inputs with proper
4673 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4684 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4674 this is handled by the prompts class itself, as it should.
4685 this is handled by the prompts class itself, as it should.
4675
4686
4676 2002-03-05 Fernando Perez <fperez@colorado.edu>
4687 2002-03-05 Fernando Perez <fperez@colorado.edu>
4677
4688
4678 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4689 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4679 @logstart to avoid name clashes with the math log function.
4690 @logstart to avoid name clashes with the math log function.
4680
4691
4681 * Big updates to X/Emacs section of the manual.
4692 * Big updates to X/Emacs section of the manual.
4682
4693
4683 * Removed ipython_emacs. Milan explained to me how to pass
4694 * Removed ipython_emacs. Milan explained to me how to pass
4684 arguments to ipython through Emacs. Some day I'm going to end up
4695 arguments to ipython through Emacs. Some day I'm going to end up
4685 learning some lisp...
4696 learning some lisp...
4686
4697
4687 2002-03-04 Fernando Perez <fperez@colorado.edu>
4698 2002-03-04 Fernando Perez <fperez@colorado.edu>
4688
4699
4689 * IPython/ipython_emacs: Created script to be used as the
4700 * IPython/ipython_emacs: Created script to be used as the
4690 py-python-command Emacs variable so we can pass IPython
4701 py-python-command Emacs variable so we can pass IPython
4691 parameters. I can't figure out how to tell Emacs directly to pass
4702 parameters. I can't figure out how to tell Emacs directly to pass
4692 parameters to IPython, so a dummy shell script will do it.
4703 parameters to IPython, so a dummy shell script will do it.
4693
4704
4694 Other enhancements made for things to work better under Emacs'
4705 Other enhancements made for things to work better under Emacs'
4695 various types of terminals. Many thanks to Milan Zamazal
4706 various types of terminals. Many thanks to Milan Zamazal
4696 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4707 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4697
4708
4698 2002-03-01 Fernando Perez <fperez@colorado.edu>
4709 2002-03-01 Fernando Perez <fperez@colorado.edu>
4699
4710
4700 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4711 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4701 that loading of readline is now optional. This gives better
4712 that loading of readline is now optional. This gives better
4702 control to emacs users.
4713 control to emacs users.
4703
4714
4704 * IPython/ultraTB.py (__date__): Modified color escape sequences
4715 * IPython/ultraTB.py (__date__): Modified color escape sequences
4705 and now things work fine under xterm and in Emacs' term buffers
4716 and now things work fine under xterm and in Emacs' term buffers
4706 (though not shell ones). Well, in emacs you get colors, but all
4717 (though not shell ones). Well, in emacs you get colors, but all
4707 seem to be 'light' colors (no difference between dark and light
4718 seem to be 'light' colors (no difference between dark and light
4708 ones). But the garbage chars are gone, and also in xterms. It
4719 ones). But the garbage chars are gone, and also in xterms. It
4709 seems that now I'm using 'cleaner' ansi sequences.
4720 seems that now I'm using 'cleaner' ansi sequences.
4710
4721
4711 2002-02-21 Fernando Perez <fperez@colorado.edu>
4722 2002-02-21 Fernando Perez <fperez@colorado.edu>
4712
4723
4713 * Released 0.2.7 (mainly to publish the scoping fix).
4724 * Released 0.2.7 (mainly to publish the scoping fix).
4714
4725
4715 * IPython/Logger.py (Logger.logstate): added. A corresponding
4726 * IPython/Logger.py (Logger.logstate): added. A corresponding
4716 @logstate magic was created.
4727 @logstate magic was created.
4717
4728
4718 * IPython/Magic.py: fixed nested scoping problem under Python
4729 * IPython/Magic.py: fixed nested scoping problem under Python
4719 2.1.x (automagic wasn't working).
4730 2.1.x (automagic wasn't working).
4720
4731
4721 2002-02-20 Fernando Perez <fperez@colorado.edu>
4732 2002-02-20 Fernando Perez <fperez@colorado.edu>
4722
4733
4723 * Released 0.2.6.
4734 * Released 0.2.6.
4724
4735
4725 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4736 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4726 option so that logs can come out without any headers at all.
4737 option so that logs can come out without any headers at all.
4727
4738
4728 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4739 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4729 SciPy.
4740 SciPy.
4730
4741
4731 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4742 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4732 that embedded IPython calls don't require vars() to be explicitly
4743 that embedded IPython calls don't require vars() to be explicitly
4733 passed. Now they are extracted from the caller's frame (code
4744 passed. Now they are extracted from the caller's frame (code
4734 snatched from Eric Jones' weave). Added better documentation to
4745 snatched from Eric Jones' weave). Added better documentation to
4735 the section on embedding and the example file.
4746 the section on embedding and the example file.
4736
4747
4737 * IPython/genutils.py (page): Changed so that under emacs, it just
4748 * IPython/genutils.py (page): Changed so that under emacs, it just
4738 prints the string. You can then page up and down in the emacs
4749 prints the string. You can then page up and down in the emacs
4739 buffer itself. This is how the builtin help() works.
4750 buffer itself. This is how the builtin help() works.
4740
4751
4741 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4752 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4742 macro scoping: macros need to be executed in the user's namespace
4753 macro scoping: macros need to be executed in the user's namespace
4743 to work as if they had been typed by the user.
4754 to work as if they had been typed by the user.
4744
4755
4745 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4756 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4746 execute automatically (no need to type 'exec...'). They then
4757 execute automatically (no need to type 'exec...'). They then
4747 behave like 'true macros'. The printing system was also modified
4758 behave like 'true macros'. The printing system was also modified
4748 for this to work.
4759 for this to work.
4749
4760
4750 2002-02-19 Fernando Perez <fperez@colorado.edu>
4761 2002-02-19 Fernando Perez <fperez@colorado.edu>
4751
4762
4752 * IPython/genutils.py (page_file): new function for paging files
4763 * IPython/genutils.py (page_file): new function for paging files
4753 in an OS-independent way. Also necessary for file viewing to work
4764 in an OS-independent way. Also necessary for file viewing to work
4754 well inside Emacs buffers.
4765 well inside Emacs buffers.
4755 (page): Added checks for being in an emacs buffer.
4766 (page): Added checks for being in an emacs buffer.
4756 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4767 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4757 same bug in iplib.
4768 same bug in iplib.
4758
4769
4759 2002-02-18 Fernando Perez <fperez@colorado.edu>
4770 2002-02-18 Fernando Perez <fperez@colorado.edu>
4760
4771
4761 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4772 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4762 of readline so that IPython can work inside an Emacs buffer.
4773 of readline so that IPython can work inside an Emacs buffer.
4763
4774
4764 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4775 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4765 method signatures (they weren't really bugs, but it looks cleaner
4776 method signatures (they weren't really bugs, but it looks cleaner
4766 and keeps PyChecker happy).
4777 and keeps PyChecker happy).
4767
4778
4768 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4779 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4769 for implementing various user-defined hooks. Currently only
4780 for implementing various user-defined hooks. Currently only
4770 display is done.
4781 display is done.
4771
4782
4772 * IPython/Prompts.py (CachedOutput._display): changed display
4783 * IPython/Prompts.py (CachedOutput._display): changed display
4773 functions so that they can be dynamically changed by users easily.
4784 functions so that they can be dynamically changed by users easily.
4774
4785
4775 * IPython/Extensions/numeric_formats.py (num_display): added an
4786 * IPython/Extensions/numeric_formats.py (num_display): added an
4776 extension for printing NumPy arrays in flexible manners. It
4787 extension for printing NumPy arrays in flexible manners. It
4777 doesn't do anything yet, but all the structure is in
4788 doesn't do anything yet, but all the structure is in
4778 place. Ultimately the plan is to implement output format control
4789 place. Ultimately the plan is to implement output format control
4779 like in Octave.
4790 like in Octave.
4780
4791
4781 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4792 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4782 methods are found at run-time by all the automatic machinery.
4793 methods are found at run-time by all the automatic machinery.
4783
4794
4784 2002-02-17 Fernando Perez <fperez@colorado.edu>
4795 2002-02-17 Fernando Perez <fperez@colorado.edu>
4785
4796
4786 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4797 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4787 whole file a little.
4798 whole file a little.
4788
4799
4789 * ToDo: closed this document. Now there's a new_design.lyx
4800 * ToDo: closed this document. Now there's a new_design.lyx
4790 document for all new ideas. Added making a pdf of it for the
4801 document for all new ideas. Added making a pdf of it for the
4791 end-user distro.
4802 end-user distro.
4792
4803
4793 * IPython/Logger.py (Logger.switch_log): Created this to replace
4804 * IPython/Logger.py (Logger.switch_log): Created this to replace
4794 logon() and logoff(). It also fixes a nasty crash reported by
4805 logon() and logoff(). It also fixes a nasty crash reported by
4795 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4806 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4796
4807
4797 * IPython/iplib.py (complete): got auto-completion to work with
4808 * IPython/iplib.py (complete): got auto-completion to work with
4798 automagic (I had wanted this for a long time).
4809 automagic (I had wanted this for a long time).
4799
4810
4800 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4811 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4801 to @file, since file() is now a builtin and clashes with automagic
4812 to @file, since file() is now a builtin and clashes with automagic
4802 for @file.
4813 for @file.
4803
4814
4804 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4815 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4805 of this was previously in iplib, which had grown to more than 2000
4816 of this was previously in iplib, which had grown to more than 2000
4806 lines, way too long. No new functionality, but it makes managing
4817 lines, way too long. No new functionality, but it makes managing
4807 the code a bit easier.
4818 the code a bit easier.
4808
4819
4809 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4820 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4810 information to crash reports.
4821 information to crash reports.
4811
4822
4812 2002-02-12 Fernando Perez <fperez@colorado.edu>
4823 2002-02-12 Fernando Perez <fperez@colorado.edu>
4813
4824
4814 * Released 0.2.5.
4825 * Released 0.2.5.
4815
4826
4816 2002-02-11 Fernando Perez <fperez@colorado.edu>
4827 2002-02-11 Fernando Perez <fperez@colorado.edu>
4817
4828
4818 * Wrote a relatively complete Windows installer. It puts
4829 * Wrote a relatively complete Windows installer. It puts
4819 everything in place, creates Start Menu entries and fixes the
4830 everything in place, creates Start Menu entries and fixes the
4820 color issues. Nothing fancy, but it works.
4831 color issues. Nothing fancy, but it works.
4821
4832
4822 2002-02-10 Fernando Perez <fperez@colorado.edu>
4833 2002-02-10 Fernando Perez <fperez@colorado.edu>
4823
4834
4824 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4835 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4825 os.path.expanduser() call so that we can type @run ~/myfile.py and
4836 os.path.expanduser() call so that we can type @run ~/myfile.py and
4826 have thigs work as expected.
4837 have thigs work as expected.
4827
4838
4828 * IPython/genutils.py (page): fixed exception handling so things
4839 * IPython/genutils.py (page): fixed exception handling so things
4829 work both in Unix and Windows correctly. Quitting a pager triggers
4840 work both in Unix and Windows correctly. Quitting a pager triggers
4830 an IOError/broken pipe in Unix, and in windows not finding a pager
4841 an IOError/broken pipe in Unix, and in windows not finding a pager
4831 is also an IOError, so I had to actually look at the return value
4842 is also an IOError, so I had to actually look at the return value
4832 of the exception, not just the exception itself. Should be ok now.
4843 of the exception, not just the exception itself. Should be ok now.
4833
4844
4834 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4845 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4835 modified to allow case-insensitive color scheme changes.
4846 modified to allow case-insensitive color scheme changes.
4836
4847
4837 2002-02-09 Fernando Perez <fperez@colorado.edu>
4848 2002-02-09 Fernando Perez <fperez@colorado.edu>
4838
4849
4839 * IPython/genutils.py (native_line_ends): new function to leave
4850 * IPython/genutils.py (native_line_ends): new function to leave
4840 user config files with os-native line-endings.
4851 user config files with os-native line-endings.
4841
4852
4842 * README and manual updates.
4853 * README and manual updates.
4843
4854
4844 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4855 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4845 instead of StringType to catch Unicode strings.
4856 instead of StringType to catch Unicode strings.
4846
4857
4847 * IPython/genutils.py (filefind): fixed bug for paths with
4858 * IPython/genutils.py (filefind): fixed bug for paths with
4848 embedded spaces (very common in Windows).
4859 embedded spaces (very common in Windows).
4849
4860
4850 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4861 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4851 files under Windows, so that they get automatically associated
4862 files under Windows, so that they get automatically associated
4852 with a text editor. Windows makes it a pain to handle
4863 with a text editor. Windows makes it a pain to handle
4853 extension-less files.
4864 extension-less files.
4854
4865
4855 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4866 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4856 warning about readline only occur for Posix. In Windows there's no
4867 warning about readline only occur for Posix. In Windows there's no
4857 way to get readline, so why bother with the warning.
4868 way to get readline, so why bother with the warning.
4858
4869
4859 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4870 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4860 for __str__ instead of dir(self), since dir() changed in 2.2.
4871 for __str__ instead of dir(self), since dir() changed in 2.2.
4861
4872
4862 * Ported to Windows! Tested on XP, I suspect it should work fine
4873 * Ported to Windows! Tested on XP, I suspect it should work fine
4863 on NT/2000, but I don't think it will work on 98 et al. That
4874 on NT/2000, but I don't think it will work on 98 et al. That
4864 series of Windows is such a piece of junk anyway that I won't try
4875 series of Windows is such a piece of junk anyway that I won't try
4865 porting it there. The XP port was straightforward, showed a few
4876 porting it there. The XP port was straightforward, showed a few
4866 bugs here and there (fixed all), in particular some string
4877 bugs here and there (fixed all), in particular some string
4867 handling stuff which required considering Unicode strings (which
4878 handling stuff which required considering Unicode strings (which
4868 Windows uses). This is good, but hasn't been too tested :) No
4879 Windows uses). This is good, but hasn't been too tested :) No
4869 fancy installer yet, I'll put a note in the manual so people at
4880 fancy installer yet, I'll put a note in the manual so people at
4870 least make manually a shortcut.
4881 least make manually a shortcut.
4871
4882
4872 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4883 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4873 into a single one, "colors". This now controls both prompt and
4884 into a single one, "colors". This now controls both prompt and
4874 exception color schemes, and can be changed both at startup
4885 exception color schemes, and can be changed both at startup
4875 (either via command-line switches or via ipythonrc files) and at
4886 (either via command-line switches or via ipythonrc files) and at
4876 runtime, with @colors.
4887 runtime, with @colors.
4877 (Magic.magic_run): renamed @prun to @run and removed the old
4888 (Magic.magic_run): renamed @prun to @run and removed the old
4878 @run. The two were too similar to warrant keeping both.
4889 @run. The two were too similar to warrant keeping both.
4879
4890
4880 2002-02-03 Fernando Perez <fperez@colorado.edu>
4891 2002-02-03 Fernando Perez <fperez@colorado.edu>
4881
4892
4882 * IPython/iplib.py (install_first_time): Added comment on how to
4893 * IPython/iplib.py (install_first_time): Added comment on how to
4883 configure the color options for first-time users. Put a <return>
4894 configure the color options for first-time users. Put a <return>
4884 request at the end so that small-terminal users get a chance to
4895 request at the end so that small-terminal users get a chance to
4885 read the startup info.
4896 read the startup info.
4886
4897
4887 2002-01-23 Fernando Perez <fperez@colorado.edu>
4898 2002-01-23 Fernando Perez <fperez@colorado.edu>
4888
4899
4889 * IPython/iplib.py (CachedOutput.update): Changed output memory
4900 * IPython/iplib.py (CachedOutput.update): Changed output memory
4890 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4901 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4891 input history we still use _i. Did this b/c these variable are
4902 input history we still use _i. Did this b/c these variable are
4892 very commonly used in interactive work, so the less we need to
4903 very commonly used in interactive work, so the less we need to
4893 type the better off we are.
4904 type the better off we are.
4894 (Magic.magic_prun): updated @prun to better handle the namespaces
4905 (Magic.magic_prun): updated @prun to better handle the namespaces
4895 the file will run in, including a fix for __name__ not being set
4906 the file will run in, including a fix for __name__ not being set
4896 before.
4907 before.
4897
4908
4898 2002-01-20 Fernando Perez <fperez@colorado.edu>
4909 2002-01-20 Fernando Perez <fperez@colorado.edu>
4899
4910
4900 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4911 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4901 extra garbage for Python 2.2. Need to look more carefully into
4912 extra garbage for Python 2.2. Need to look more carefully into
4902 this later.
4913 this later.
4903
4914
4904 2002-01-19 Fernando Perez <fperez@colorado.edu>
4915 2002-01-19 Fernando Perez <fperez@colorado.edu>
4905
4916
4906 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4917 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4907 display SyntaxError exceptions properly formatted when they occur
4918 display SyntaxError exceptions properly formatted when they occur
4908 (they can be triggered by imported code).
4919 (they can be triggered by imported code).
4909
4920
4910 2002-01-18 Fernando Perez <fperez@colorado.edu>
4921 2002-01-18 Fernando Perez <fperez@colorado.edu>
4911
4922
4912 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4923 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4913 SyntaxError exceptions are reported nicely formatted, instead of
4924 SyntaxError exceptions are reported nicely formatted, instead of
4914 spitting out only offset information as before.
4925 spitting out only offset information as before.
4915 (Magic.magic_prun): Added the @prun function for executing
4926 (Magic.magic_prun): Added the @prun function for executing
4916 programs with command line args inside IPython.
4927 programs with command line args inside IPython.
4917
4928
4918 2002-01-16 Fernando Perez <fperez@colorado.edu>
4929 2002-01-16 Fernando Perez <fperez@colorado.edu>
4919
4930
4920 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4931 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4921 to *not* include the last item given in a range. This brings their
4932 to *not* include the last item given in a range. This brings their
4922 behavior in line with Python's slicing:
4933 behavior in line with Python's slicing:
4923 a[n1:n2] -> a[n1]...a[n2-1]
4934 a[n1:n2] -> a[n1]...a[n2-1]
4924 It may be a bit less convenient, but I prefer to stick to Python's
4935 It may be a bit less convenient, but I prefer to stick to Python's
4925 conventions *everywhere*, so users never have to wonder.
4936 conventions *everywhere*, so users never have to wonder.
4926 (Magic.magic_macro): Added @macro function to ease the creation of
4937 (Magic.magic_macro): Added @macro function to ease the creation of
4927 macros.
4938 macros.
4928
4939
4929 2002-01-05 Fernando Perez <fperez@colorado.edu>
4940 2002-01-05 Fernando Perez <fperez@colorado.edu>
4930
4941
4931 * Released 0.2.4.
4942 * Released 0.2.4.
4932
4943
4933 * IPython/iplib.py (Magic.magic_pdef):
4944 * IPython/iplib.py (Magic.magic_pdef):
4934 (InteractiveShell.safe_execfile): report magic lines and error
4945 (InteractiveShell.safe_execfile): report magic lines and error
4935 lines without line numbers so one can easily copy/paste them for
4946 lines without line numbers so one can easily copy/paste them for
4936 re-execution.
4947 re-execution.
4937
4948
4938 * Updated manual with recent changes.
4949 * Updated manual with recent changes.
4939
4950
4940 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4951 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4941 docstring printing when class? is called. Very handy for knowing
4952 docstring printing when class? is called. Very handy for knowing
4942 how to create class instances (as long as __init__ is well
4953 how to create class instances (as long as __init__ is well
4943 documented, of course :)
4954 documented, of course :)
4944 (Magic.magic_doc): print both class and constructor docstrings.
4955 (Magic.magic_doc): print both class and constructor docstrings.
4945 (Magic.magic_pdef): give constructor info if passed a class and
4956 (Magic.magic_pdef): give constructor info if passed a class and
4946 __call__ info for callable object instances.
4957 __call__ info for callable object instances.
4947
4958
4948 2002-01-04 Fernando Perez <fperez@colorado.edu>
4959 2002-01-04 Fernando Perez <fperez@colorado.edu>
4949
4960
4950 * Made deep_reload() off by default. It doesn't always work
4961 * Made deep_reload() off by default. It doesn't always work
4951 exactly as intended, so it's probably safer to have it off. It's
4962 exactly as intended, so it's probably safer to have it off. It's
4952 still available as dreload() anyway, so nothing is lost.
4963 still available as dreload() anyway, so nothing is lost.
4953
4964
4954 2002-01-02 Fernando Perez <fperez@colorado.edu>
4965 2002-01-02 Fernando Perez <fperez@colorado.edu>
4955
4966
4956 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4967 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4957 so I wanted an updated release).
4968 so I wanted an updated release).
4958
4969
4959 2001-12-27 Fernando Perez <fperez@colorado.edu>
4970 2001-12-27 Fernando Perez <fperez@colorado.edu>
4960
4971
4961 * IPython/iplib.py (InteractiveShell.interact): Added the original
4972 * IPython/iplib.py (InteractiveShell.interact): Added the original
4962 code from 'code.py' for this module in order to change the
4973 code from 'code.py' for this module in order to change the
4963 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4974 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4964 the history cache would break when the user hit Ctrl-C, and
4975 the history cache would break when the user hit Ctrl-C, and
4965 interact() offers no way to add any hooks to it.
4976 interact() offers no way to add any hooks to it.
4966
4977
4967 2001-12-23 Fernando Perez <fperez@colorado.edu>
4978 2001-12-23 Fernando Perez <fperez@colorado.edu>
4968
4979
4969 * setup.py: added check for 'MANIFEST' before trying to remove
4980 * setup.py: added check for 'MANIFEST' before trying to remove
4970 it. Thanks to Sean Reifschneider.
4981 it. Thanks to Sean Reifschneider.
4971
4982
4972 2001-12-22 Fernando Perez <fperez@colorado.edu>
4983 2001-12-22 Fernando Perez <fperez@colorado.edu>
4973
4984
4974 * Released 0.2.2.
4985 * Released 0.2.2.
4975
4986
4976 * Finished (reasonably) writing the manual. Later will add the
4987 * Finished (reasonably) writing the manual. Later will add the
4977 python-standard navigation stylesheets, but for the time being
4988 python-standard navigation stylesheets, but for the time being
4978 it's fairly complete. Distribution will include html and pdf
4989 it's fairly complete. Distribution will include html and pdf
4979 versions.
4990 versions.
4980
4991
4981 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4992 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4982 (MayaVi author).
4993 (MayaVi author).
4983
4994
4984 2001-12-21 Fernando Perez <fperez@colorado.edu>
4995 2001-12-21 Fernando Perez <fperez@colorado.edu>
4985
4996
4986 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4997 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4987 good public release, I think (with the manual and the distutils
4998 good public release, I think (with the manual and the distutils
4988 installer). The manual can use some work, but that can go
4999 installer). The manual can use some work, but that can go
4989 slowly. Otherwise I think it's quite nice for end users. Next
5000 slowly. Otherwise I think it's quite nice for end users. Next
4990 summer, rewrite the guts of it...
5001 summer, rewrite the guts of it...
4991
5002
4992 * Changed format of ipythonrc files to use whitespace as the
5003 * Changed format of ipythonrc files to use whitespace as the
4993 separator instead of an explicit '='. Cleaner.
5004 separator instead of an explicit '='. Cleaner.
4994
5005
4995 2001-12-20 Fernando Perez <fperez@colorado.edu>
5006 2001-12-20 Fernando Perez <fperez@colorado.edu>
4996
5007
4997 * Started a manual in LyX. For now it's just a quick merge of the
5008 * Started a manual in LyX. For now it's just a quick merge of the
4998 various internal docstrings and READMEs. Later it may grow into a
5009 various internal docstrings and READMEs. Later it may grow into a
4999 nice, full-blown manual.
5010 nice, full-blown manual.
5000
5011
5001 * Set up a distutils based installer. Installation should now be
5012 * Set up a distutils based installer. Installation should now be
5002 trivially simple for end-users.
5013 trivially simple for end-users.
5003
5014
5004 2001-12-11 Fernando Perez <fperez@colorado.edu>
5015 2001-12-11 Fernando Perez <fperez@colorado.edu>
5005
5016
5006 * Released 0.2.0. First public release, announced it at
5017 * Released 0.2.0. First public release, announced it at
5007 comp.lang.python. From now on, just bugfixes...
5018 comp.lang.python. From now on, just bugfixes...
5008
5019
5009 * Went through all the files, set copyright/license notices and
5020 * Went through all the files, set copyright/license notices and
5010 cleaned up things. Ready for release.
5021 cleaned up things. Ready for release.
5011
5022
5012 2001-12-10 Fernando Perez <fperez@colorado.edu>
5023 2001-12-10 Fernando Perez <fperez@colorado.edu>
5013
5024
5014 * Changed the first-time installer not to use tarfiles. It's more
5025 * Changed the first-time installer not to use tarfiles. It's more
5015 robust now and less unix-dependent. Also makes it easier for
5026 robust now and less unix-dependent. Also makes it easier for
5016 people to later upgrade versions.
5027 people to later upgrade versions.
5017
5028
5018 * Changed @exit to @abort to reflect the fact that it's pretty
5029 * Changed @exit to @abort to reflect the fact that it's pretty
5019 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5030 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5020 becomes significant only when IPyhton is embedded: in that case,
5031 becomes significant only when IPyhton is embedded: in that case,
5021 C-D closes IPython only, but @abort kills the enclosing program
5032 C-D closes IPython only, but @abort kills the enclosing program
5022 too (unless it had called IPython inside a try catching
5033 too (unless it had called IPython inside a try catching
5023 SystemExit).
5034 SystemExit).
5024
5035
5025 * Created Shell module which exposes the actuall IPython Shell
5036 * Created Shell module which exposes the actuall IPython Shell
5026 classes, currently the normal and the embeddable one. This at
5037 classes, currently the normal and the embeddable one. This at
5027 least offers a stable interface we won't need to change when
5038 least offers a stable interface we won't need to change when
5028 (later) the internals are rewritten. That rewrite will be confined
5039 (later) the internals are rewritten. That rewrite will be confined
5029 to iplib and ipmaker, but the Shell interface should remain as is.
5040 to iplib and ipmaker, but the Shell interface should remain as is.
5030
5041
5031 * Added embed module which offers an embeddable IPShell object,
5042 * Added embed module which offers an embeddable IPShell object,
5032 useful to fire up IPython *inside* a running program. Great for
5043 useful to fire up IPython *inside* a running program. Great for
5033 debugging or dynamical data analysis.
5044 debugging or dynamical data analysis.
5034
5045
5035 2001-12-08 Fernando Perez <fperez@colorado.edu>
5046 2001-12-08 Fernando Perez <fperez@colorado.edu>
5036
5047
5037 * Fixed small bug preventing seeing info from methods of defined
5048 * Fixed small bug preventing seeing info from methods of defined
5038 objects (incorrect namespace in _ofind()).
5049 objects (incorrect namespace in _ofind()).
5039
5050
5040 * Documentation cleanup. Moved the main usage docstrings to a
5051 * Documentation cleanup. Moved the main usage docstrings to a
5041 separate file, usage.py (cleaner to maintain, and hopefully in the
5052 separate file, usage.py (cleaner to maintain, and hopefully in the
5042 future some perlpod-like way of producing interactive, man and
5053 future some perlpod-like way of producing interactive, man and
5043 html docs out of it will be found).
5054 html docs out of it will be found).
5044
5055
5045 * Added @profile to see your profile at any time.
5056 * Added @profile to see your profile at any time.
5046
5057
5047 * Added @p as an alias for 'print'. It's especially convenient if
5058 * Added @p as an alias for 'print'. It's especially convenient if
5048 using automagic ('p x' prints x).
5059 using automagic ('p x' prints x).
5049
5060
5050 * Small cleanups and fixes after a pychecker run.
5061 * Small cleanups and fixes after a pychecker run.
5051
5062
5052 * Changed the @cd command to handle @cd - and @cd -<n> for
5063 * Changed the @cd command to handle @cd - and @cd -<n> for
5053 visiting any directory in _dh.
5064 visiting any directory in _dh.
5054
5065
5055 * Introduced _dh, a history of visited directories. @dhist prints
5066 * Introduced _dh, a history of visited directories. @dhist prints
5056 it out with numbers.
5067 it out with numbers.
5057
5068
5058 2001-12-07 Fernando Perez <fperez@colorado.edu>
5069 2001-12-07 Fernando Perez <fperez@colorado.edu>
5059
5070
5060 * Released 0.1.22
5071 * Released 0.1.22
5061
5072
5062 * Made initialization a bit more robust against invalid color
5073 * Made initialization a bit more robust against invalid color
5063 options in user input (exit, not traceback-crash).
5074 options in user input (exit, not traceback-crash).
5064
5075
5065 * Changed the bug crash reporter to write the report only in the
5076 * Changed the bug crash reporter to write the report only in the
5066 user's .ipython directory. That way IPython won't litter people's
5077 user's .ipython directory. That way IPython won't litter people's
5067 hard disks with crash files all over the place. Also print on
5078 hard disks with crash files all over the place. Also print on
5068 screen the necessary mail command.
5079 screen the necessary mail command.
5069
5080
5070 * With the new ultraTB, implemented LightBG color scheme for light
5081 * With the new ultraTB, implemented LightBG color scheme for light
5071 background terminals. A lot of people like white backgrounds, so I
5082 background terminals. A lot of people like white backgrounds, so I
5072 guess we should at least give them something readable.
5083 guess we should at least give them something readable.
5073
5084
5074 2001-12-06 Fernando Perez <fperez@colorado.edu>
5085 2001-12-06 Fernando Perez <fperez@colorado.edu>
5075
5086
5076 * Modified the structure of ultraTB. Now there's a proper class
5087 * Modified the structure of ultraTB. Now there's a proper class
5077 for tables of color schemes which allow adding schemes easily and
5088 for tables of color schemes which allow adding schemes easily and
5078 switching the active scheme without creating a new instance every
5089 switching the active scheme without creating a new instance every
5079 time (which was ridiculous). The syntax for creating new schemes
5090 time (which was ridiculous). The syntax for creating new schemes
5080 is also cleaner. I think ultraTB is finally done, with a clean
5091 is also cleaner. I think ultraTB is finally done, with a clean
5081 class structure. Names are also much cleaner (now there's proper
5092 class structure. Names are also much cleaner (now there's proper
5082 color tables, no need for every variable to also have 'color' in
5093 color tables, no need for every variable to also have 'color' in
5083 its name).
5094 its name).
5084
5095
5085 * Broke down genutils into separate files. Now genutils only
5096 * Broke down genutils into separate files. Now genutils only
5086 contains utility functions, and classes have been moved to their
5097 contains utility functions, and classes have been moved to their
5087 own files (they had enough independent functionality to warrant
5098 own files (they had enough independent functionality to warrant
5088 it): ConfigLoader, OutputTrap, Struct.
5099 it): ConfigLoader, OutputTrap, Struct.
5089
5100
5090 2001-12-05 Fernando Perez <fperez@colorado.edu>
5101 2001-12-05 Fernando Perez <fperez@colorado.edu>
5091
5102
5092 * IPython turns 21! Released version 0.1.21, as a candidate for
5103 * IPython turns 21! Released version 0.1.21, as a candidate for
5093 public consumption. If all goes well, release in a few days.
5104 public consumption. If all goes well, release in a few days.
5094
5105
5095 * Fixed path bug (files in Extensions/ directory wouldn't be found
5106 * Fixed path bug (files in Extensions/ directory wouldn't be found
5096 unless IPython/ was explicitly in sys.path).
5107 unless IPython/ was explicitly in sys.path).
5097
5108
5098 * Extended the FlexCompleter class as MagicCompleter to allow
5109 * Extended the FlexCompleter class as MagicCompleter to allow
5099 completion of @-starting lines.
5110 completion of @-starting lines.
5100
5111
5101 * Created __release__.py file as a central repository for release
5112 * Created __release__.py file as a central repository for release
5102 info that other files can read from.
5113 info that other files can read from.
5103
5114
5104 * Fixed small bug in logging: when logging was turned on in
5115 * Fixed small bug in logging: when logging was turned on in
5105 mid-session, old lines with special meanings (!@?) were being
5116 mid-session, old lines with special meanings (!@?) were being
5106 logged without the prepended comment, which is necessary since
5117 logged without the prepended comment, which is necessary since
5107 they are not truly valid python syntax. This should make session
5118 they are not truly valid python syntax. This should make session
5108 restores produce less errors.
5119 restores produce less errors.
5109
5120
5110 * The namespace cleanup forced me to make a FlexCompleter class
5121 * The namespace cleanup forced me to make a FlexCompleter class
5111 which is nothing but a ripoff of rlcompleter, but with selectable
5122 which is nothing but a ripoff of rlcompleter, but with selectable
5112 namespace (rlcompleter only works in __main__.__dict__). I'll try
5123 namespace (rlcompleter only works in __main__.__dict__). I'll try
5113 to submit a note to the authors to see if this change can be
5124 to submit a note to the authors to see if this change can be
5114 incorporated in future rlcompleter releases (Dec.6: done)
5125 incorporated in future rlcompleter releases (Dec.6: done)
5115
5126
5116 * More fixes to namespace handling. It was a mess! Now all
5127 * More fixes to namespace handling. It was a mess! Now all
5117 explicit references to __main__.__dict__ are gone (except when
5128 explicit references to __main__.__dict__ are gone (except when
5118 really needed) and everything is handled through the namespace
5129 really needed) and everything is handled through the namespace
5119 dicts in the IPython instance. We seem to be getting somewhere
5130 dicts in the IPython instance. We seem to be getting somewhere
5120 with this, finally...
5131 with this, finally...
5121
5132
5122 * Small documentation updates.
5133 * Small documentation updates.
5123
5134
5124 * Created the Extensions directory under IPython (with an
5135 * Created the Extensions directory under IPython (with an
5125 __init__.py). Put the PhysicalQ stuff there. This directory should
5136 __init__.py). Put the PhysicalQ stuff there. This directory should
5126 be used for all special-purpose extensions.
5137 be used for all special-purpose extensions.
5127
5138
5128 * File renaming:
5139 * File renaming:
5129 ipythonlib --> ipmaker
5140 ipythonlib --> ipmaker
5130 ipplib --> iplib
5141 ipplib --> iplib
5131 This makes a bit more sense in terms of what these files actually do.
5142 This makes a bit more sense in terms of what these files actually do.
5132
5143
5133 * Moved all the classes and functions in ipythonlib to ipplib, so
5144 * Moved all the classes and functions in ipythonlib to ipplib, so
5134 now ipythonlib only has make_IPython(). This will ease up its
5145 now ipythonlib only has make_IPython(). This will ease up its
5135 splitting in smaller functional chunks later.
5146 splitting in smaller functional chunks later.
5136
5147
5137 * Cleaned up (done, I think) output of @whos. Better column
5148 * Cleaned up (done, I think) output of @whos. Better column
5138 formatting, and now shows str(var) for as much as it can, which is
5149 formatting, and now shows str(var) for as much as it can, which is
5139 typically what one gets with a 'print var'.
5150 typically what one gets with a 'print var'.
5140
5151
5141 2001-12-04 Fernando Perez <fperez@colorado.edu>
5152 2001-12-04 Fernando Perez <fperez@colorado.edu>
5142
5153
5143 * Fixed namespace problems. Now builtin/IPyhton/user names get
5154 * Fixed namespace problems. Now builtin/IPyhton/user names get
5144 properly reported in their namespace. Internal namespace handling
5155 properly reported in their namespace. Internal namespace handling
5145 is finally getting decent (not perfect yet, but much better than
5156 is finally getting decent (not perfect yet, but much better than
5146 the ad-hoc mess we had).
5157 the ad-hoc mess we had).
5147
5158
5148 * Removed -exit option. If people just want to run a python
5159 * Removed -exit option. If people just want to run a python
5149 script, that's what the normal interpreter is for. Less
5160 script, that's what the normal interpreter is for. Less
5150 unnecessary options, less chances for bugs.
5161 unnecessary options, less chances for bugs.
5151
5162
5152 * Added a crash handler which generates a complete post-mortem if
5163 * Added a crash handler which generates a complete post-mortem if
5153 IPython crashes. This will help a lot in tracking bugs down the
5164 IPython crashes. This will help a lot in tracking bugs down the
5154 road.
5165 road.
5155
5166
5156 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5167 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5157 which were boud to functions being reassigned would bypass the
5168 which were boud to functions being reassigned would bypass the
5158 logger, breaking the sync of _il with the prompt counter. This
5169 logger, breaking the sync of _il with the prompt counter. This
5159 would then crash IPython later when a new line was logged.
5170 would then crash IPython later when a new line was logged.
5160
5171
5161 2001-12-02 Fernando Perez <fperez@colorado.edu>
5172 2001-12-02 Fernando Perez <fperez@colorado.edu>
5162
5173
5163 * Made IPython a package. This means people don't have to clutter
5174 * Made IPython a package. This means people don't have to clutter
5164 their sys.path with yet another directory. Changed the INSTALL
5175 their sys.path with yet another directory. Changed the INSTALL
5165 file accordingly.
5176 file accordingly.
5166
5177
5167 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5178 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5168 sorts its output (so @who shows it sorted) and @whos formats the
5179 sorts its output (so @who shows it sorted) and @whos formats the
5169 table according to the width of the first column. Nicer, easier to
5180 table according to the width of the first column. Nicer, easier to
5170 read. Todo: write a generic table_format() which takes a list of
5181 read. Todo: write a generic table_format() which takes a list of
5171 lists and prints it nicely formatted, with optional row/column
5182 lists and prints it nicely formatted, with optional row/column
5172 separators and proper padding and justification.
5183 separators and proper padding and justification.
5173
5184
5174 * Released 0.1.20
5185 * Released 0.1.20
5175
5186
5176 * Fixed bug in @log which would reverse the inputcache list (a
5187 * Fixed bug in @log which would reverse the inputcache list (a
5177 copy operation was missing).
5188 copy operation was missing).
5178
5189
5179 * Code cleanup. @config was changed to use page(). Better, since
5190 * Code cleanup. @config was changed to use page(). Better, since
5180 its output is always quite long.
5191 its output is always quite long.
5181
5192
5182 * Itpl is back as a dependency. I was having too many problems
5193 * Itpl is back as a dependency. I was having too many problems
5183 getting the parametric aliases to work reliably, and it's just
5194 getting the parametric aliases to work reliably, and it's just
5184 easier to code weird string operations with it than playing %()s
5195 easier to code weird string operations with it than playing %()s
5185 games. It's only ~6k, so I don't think it's too big a deal.
5196 games. It's only ~6k, so I don't think it's too big a deal.
5186
5197
5187 * Found (and fixed) a very nasty bug with history. !lines weren't
5198 * Found (and fixed) a very nasty bug with history. !lines weren't
5188 getting cached, and the out of sync caches would crash
5199 getting cached, and the out of sync caches would crash
5189 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5200 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5190 division of labor a bit better. Bug fixed, cleaner structure.
5201 division of labor a bit better. Bug fixed, cleaner structure.
5191
5202
5192 2001-12-01 Fernando Perez <fperez@colorado.edu>
5203 2001-12-01 Fernando Perez <fperez@colorado.edu>
5193
5204
5194 * Released 0.1.19
5205 * Released 0.1.19
5195
5206
5196 * Added option -n to @hist to prevent line number printing. Much
5207 * Added option -n to @hist to prevent line number printing. Much
5197 easier to copy/paste code this way.
5208 easier to copy/paste code this way.
5198
5209
5199 * Created global _il to hold the input list. Allows easy
5210 * Created global _il to hold the input list. Allows easy
5200 re-execution of blocks of code by slicing it (inspired by Janko's
5211 re-execution of blocks of code by slicing it (inspired by Janko's
5201 comment on 'macros').
5212 comment on 'macros').
5202
5213
5203 * Small fixes and doc updates.
5214 * Small fixes and doc updates.
5204
5215
5205 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5216 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5206 much too fragile with automagic. Handles properly multi-line
5217 much too fragile with automagic. Handles properly multi-line
5207 statements and takes parameters.
5218 statements and takes parameters.
5208
5219
5209 2001-11-30 Fernando Perez <fperez@colorado.edu>
5220 2001-11-30 Fernando Perez <fperez@colorado.edu>
5210
5221
5211 * Version 0.1.18 released.
5222 * Version 0.1.18 released.
5212
5223
5213 * Fixed nasty namespace bug in initial module imports.
5224 * Fixed nasty namespace bug in initial module imports.
5214
5225
5215 * Added copyright/license notes to all code files (except
5226 * Added copyright/license notes to all code files (except
5216 DPyGetOpt). For the time being, LGPL. That could change.
5227 DPyGetOpt). For the time being, LGPL. That could change.
5217
5228
5218 * Rewrote a much nicer README, updated INSTALL, cleaned up
5229 * Rewrote a much nicer README, updated INSTALL, cleaned up
5219 ipythonrc-* samples.
5230 ipythonrc-* samples.
5220
5231
5221 * Overall code/documentation cleanup. Basically ready for
5232 * Overall code/documentation cleanup. Basically ready for
5222 release. Only remaining thing: licence decision (LGPL?).
5233 release. Only remaining thing: licence decision (LGPL?).
5223
5234
5224 * Converted load_config to a class, ConfigLoader. Now recursion
5235 * Converted load_config to a class, ConfigLoader. Now recursion
5225 control is better organized. Doesn't include the same file twice.
5236 control is better organized. Doesn't include the same file twice.
5226
5237
5227 2001-11-29 Fernando Perez <fperez@colorado.edu>
5238 2001-11-29 Fernando Perez <fperez@colorado.edu>
5228
5239
5229 * Got input history working. Changed output history variables from
5240 * Got input history working. Changed output history variables from
5230 _p to _o so that _i is for input and _o for output. Just cleaner
5241 _p to _o so that _i is for input and _o for output. Just cleaner
5231 convention.
5242 convention.
5232
5243
5233 * Implemented parametric aliases. This pretty much allows the
5244 * Implemented parametric aliases. This pretty much allows the
5234 alias system to offer full-blown shell convenience, I think.
5245 alias system to offer full-blown shell convenience, I think.
5235
5246
5236 * Version 0.1.17 released, 0.1.18 opened.
5247 * Version 0.1.17 released, 0.1.18 opened.
5237
5248
5238 * dot_ipython/ipythonrc (alias): added documentation.
5249 * dot_ipython/ipythonrc (alias): added documentation.
5239 (xcolor): Fixed small bug (xcolors -> xcolor)
5250 (xcolor): Fixed small bug (xcolors -> xcolor)
5240
5251
5241 * Changed the alias system. Now alias is a magic command to define
5252 * Changed the alias system. Now alias is a magic command to define
5242 aliases just like the shell. Rationale: the builtin magics should
5253 aliases just like the shell. Rationale: the builtin magics should
5243 be there for things deeply connected to IPython's
5254 be there for things deeply connected to IPython's
5244 architecture. And this is a much lighter system for what I think
5255 architecture. And this is a much lighter system for what I think
5245 is the really important feature: allowing users to define quickly
5256 is the really important feature: allowing users to define quickly
5246 magics that will do shell things for them, so they can customize
5257 magics that will do shell things for them, so they can customize
5247 IPython easily to match their work habits. If someone is really
5258 IPython easily to match their work habits. If someone is really
5248 desperate to have another name for a builtin alias, they can
5259 desperate to have another name for a builtin alias, they can
5249 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5260 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5250 works.
5261 works.
5251
5262
5252 2001-11-28 Fernando Perez <fperez@colorado.edu>
5263 2001-11-28 Fernando Perez <fperez@colorado.edu>
5253
5264
5254 * Changed @file so that it opens the source file at the proper
5265 * Changed @file so that it opens the source file at the proper
5255 line. Since it uses less, if your EDITOR environment is
5266 line. Since it uses less, if your EDITOR environment is
5256 configured, typing v will immediately open your editor of choice
5267 configured, typing v will immediately open your editor of choice
5257 right at the line where the object is defined. Not as quick as
5268 right at the line where the object is defined. Not as quick as
5258 having a direct @edit command, but for all intents and purposes it
5269 having a direct @edit command, but for all intents and purposes it
5259 works. And I don't have to worry about writing @edit to deal with
5270 works. And I don't have to worry about writing @edit to deal with
5260 all the editors, less does that.
5271 all the editors, less does that.
5261
5272
5262 * Version 0.1.16 released, 0.1.17 opened.
5273 * Version 0.1.16 released, 0.1.17 opened.
5263
5274
5264 * Fixed some nasty bugs in the page/page_dumb combo that could
5275 * Fixed some nasty bugs in the page/page_dumb combo that could
5265 crash IPython.
5276 crash IPython.
5266
5277
5267 2001-11-27 Fernando Perez <fperez@colorado.edu>
5278 2001-11-27 Fernando Perez <fperez@colorado.edu>
5268
5279
5269 * Version 0.1.15 released, 0.1.16 opened.
5280 * Version 0.1.15 released, 0.1.16 opened.
5270
5281
5271 * Finally got ? and ?? to work for undefined things: now it's
5282 * Finally got ? and ?? to work for undefined things: now it's
5272 possible to type {}.get? and get information about the get method
5283 possible to type {}.get? and get information about the get method
5273 of dicts, or os.path? even if only os is defined (so technically
5284 of dicts, or os.path? even if only os is defined (so technically
5274 os.path isn't). Works at any level. For example, after import os,
5285 os.path isn't). Works at any level. For example, after import os,
5275 os?, os.path?, os.path.abspath? all work. This is great, took some
5286 os?, os.path?, os.path.abspath? all work. This is great, took some
5276 work in _ofind.
5287 work in _ofind.
5277
5288
5278 * Fixed more bugs with logging. The sanest way to do it was to add
5289 * Fixed more bugs with logging. The sanest way to do it was to add
5279 to @log a 'mode' parameter. Killed two in one shot (this mode
5290 to @log a 'mode' parameter. Killed two in one shot (this mode
5280 option was a request of Janko's). I think it's finally clean
5291 option was a request of Janko's). I think it's finally clean
5281 (famous last words).
5292 (famous last words).
5282
5293
5283 * Added a page_dumb() pager which does a decent job of paging on
5294 * Added a page_dumb() pager which does a decent job of paging on
5284 screen, if better things (like less) aren't available. One less
5295 screen, if better things (like less) aren't available. One less
5285 unix dependency (someday maybe somebody will port this to
5296 unix dependency (someday maybe somebody will port this to
5286 windows).
5297 windows).
5287
5298
5288 * Fixed problem in magic_log: would lock of logging out if log
5299 * Fixed problem in magic_log: would lock of logging out if log
5289 creation failed (because it would still think it had succeeded).
5300 creation failed (because it would still think it had succeeded).
5290
5301
5291 * Improved the page() function using curses to auto-detect screen
5302 * Improved the page() function using curses to auto-detect screen
5292 size. Now it can make a much better decision on whether to print
5303 size. Now it can make a much better decision on whether to print
5293 or page a string. Option screen_length was modified: a value 0
5304 or page a string. Option screen_length was modified: a value 0
5294 means auto-detect, and that's the default now.
5305 means auto-detect, and that's the default now.
5295
5306
5296 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5307 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5297 go out. I'll test it for a few days, then talk to Janko about
5308 go out. I'll test it for a few days, then talk to Janko about
5298 licences and announce it.
5309 licences and announce it.
5299
5310
5300 * Fixed the length of the auto-generated ---> prompt which appears
5311 * Fixed the length of the auto-generated ---> prompt which appears
5301 for auto-parens and auto-quotes. Getting this right isn't trivial,
5312 for auto-parens and auto-quotes. Getting this right isn't trivial,
5302 with all the color escapes, different prompt types and optional
5313 with all the color escapes, different prompt types and optional
5303 separators. But it seems to be working in all the combinations.
5314 separators. But it seems to be working in all the combinations.
5304
5315
5305 2001-11-26 Fernando Perez <fperez@colorado.edu>
5316 2001-11-26 Fernando Perez <fperez@colorado.edu>
5306
5317
5307 * Wrote a regexp filter to get option types from the option names
5318 * Wrote a regexp filter to get option types from the option names
5308 string. This eliminates the need to manually keep two duplicate
5319 string. This eliminates the need to manually keep two duplicate
5309 lists.
5320 lists.
5310
5321
5311 * Removed the unneeded check_option_names. Now options are handled
5322 * Removed the unneeded check_option_names. Now options are handled
5312 in a much saner manner and it's easy to visually check that things
5323 in a much saner manner and it's easy to visually check that things
5313 are ok.
5324 are ok.
5314
5325
5315 * Updated version numbers on all files I modified to carry a
5326 * Updated version numbers on all files I modified to carry a
5316 notice so Janko and Nathan have clear version markers.
5327 notice so Janko and Nathan have clear version markers.
5317
5328
5318 * Updated docstring for ultraTB with my changes. I should send
5329 * Updated docstring for ultraTB with my changes. I should send
5319 this to Nathan.
5330 this to Nathan.
5320
5331
5321 * Lots of small fixes. Ran everything through pychecker again.
5332 * Lots of small fixes. Ran everything through pychecker again.
5322
5333
5323 * Made loading of deep_reload an cmd line option. If it's not too
5334 * Made loading of deep_reload an cmd line option. If it's not too
5324 kosher, now people can just disable it. With -nodeep_reload it's
5335 kosher, now people can just disable it. With -nodeep_reload it's
5325 still available as dreload(), it just won't overwrite reload().
5336 still available as dreload(), it just won't overwrite reload().
5326
5337
5327 * Moved many options to the no| form (-opt and -noopt
5338 * Moved many options to the no| form (-opt and -noopt
5328 accepted). Cleaner.
5339 accepted). Cleaner.
5329
5340
5330 * Changed magic_log so that if called with no parameters, it uses
5341 * Changed magic_log so that if called with no parameters, it uses
5331 'rotate' mode. That way auto-generated logs aren't automatically
5342 'rotate' mode. That way auto-generated logs aren't automatically
5332 over-written. For normal logs, now a backup is made if it exists
5343 over-written. For normal logs, now a backup is made if it exists
5333 (only 1 level of backups). A new 'backup' mode was added to the
5344 (only 1 level of backups). A new 'backup' mode was added to the
5334 Logger class to support this. This was a request by Janko.
5345 Logger class to support this. This was a request by Janko.
5335
5346
5336 * Added @logoff/@logon to stop/restart an active log.
5347 * Added @logoff/@logon to stop/restart an active log.
5337
5348
5338 * Fixed a lot of bugs in log saving/replay. It was pretty
5349 * Fixed a lot of bugs in log saving/replay. It was pretty
5339 broken. Now special lines (!@,/) appear properly in the command
5350 broken. Now special lines (!@,/) appear properly in the command
5340 history after a log replay.
5351 history after a log replay.
5341
5352
5342 * Tried and failed to implement full session saving via pickle. My
5353 * Tried and failed to implement full session saving via pickle. My
5343 idea was to pickle __main__.__dict__, but modules can't be
5354 idea was to pickle __main__.__dict__, but modules can't be
5344 pickled. This would be a better alternative to replaying logs, but
5355 pickled. This would be a better alternative to replaying logs, but
5345 seems quite tricky to get to work. Changed -session to be called
5356 seems quite tricky to get to work. Changed -session to be called
5346 -logplay, which more accurately reflects what it does. And if we
5357 -logplay, which more accurately reflects what it does. And if we
5347 ever get real session saving working, -session is now available.
5358 ever get real session saving working, -session is now available.
5348
5359
5349 * Implemented color schemes for prompts also. As for tracebacks,
5360 * Implemented color schemes for prompts also. As for tracebacks,
5350 currently only NoColor and Linux are supported. But now the
5361 currently only NoColor and Linux are supported. But now the
5351 infrastructure is in place, based on a generic ColorScheme
5362 infrastructure is in place, based on a generic ColorScheme
5352 class. So writing and activating new schemes both for the prompts
5363 class. So writing and activating new schemes both for the prompts
5353 and the tracebacks should be straightforward.
5364 and the tracebacks should be straightforward.
5354
5365
5355 * Version 0.1.13 released, 0.1.14 opened.
5366 * Version 0.1.13 released, 0.1.14 opened.
5356
5367
5357 * Changed handling of options for output cache. Now counter is
5368 * Changed handling of options for output cache. Now counter is
5358 hardwired starting at 1 and one specifies the maximum number of
5369 hardwired starting at 1 and one specifies the maximum number of
5359 entries *in the outcache* (not the max prompt counter). This is
5370 entries *in the outcache* (not the max prompt counter). This is
5360 much better, since many statements won't increase the cache
5371 much better, since many statements won't increase the cache
5361 count. It also eliminated some confusing options, now there's only
5372 count. It also eliminated some confusing options, now there's only
5362 one: cache_size.
5373 one: cache_size.
5363
5374
5364 * Added 'alias' magic function and magic_alias option in the
5375 * Added 'alias' magic function and magic_alias option in the
5365 ipythonrc file. Now the user can easily define whatever names he
5376 ipythonrc file. Now the user can easily define whatever names he
5366 wants for the magic functions without having to play weird
5377 wants for the magic functions without having to play weird
5367 namespace games. This gives IPython a real shell-like feel.
5378 namespace games. This gives IPython a real shell-like feel.
5368
5379
5369 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5380 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5370 @ or not).
5381 @ or not).
5371
5382
5372 This was one of the last remaining 'visible' bugs (that I know
5383 This was one of the last remaining 'visible' bugs (that I know
5373 of). I think if I can clean up the session loading so it works
5384 of). I think if I can clean up the session loading so it works
5374 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5385 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5375 about licensing).
5386 about licensing).
5376
5387
5377 2001-11-25 Fernando Perez <fperez@colorado.edu>
5388 2001-11-25 Fernando Perez <fperez@colorado.edu>
5378
5389
5379 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5390 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5380 there's a cleaner distinction between what ? and ?? show.
5391 there's a cleaner distinction between what ? and ?? show.
5381
5392
5382 * Added screen_length option. Now the user can define his own
5393 * Added screen_length option. Now the user can define his own
5383 screen size for page() operations.
5394 screen size for page() operations.
5384
5395
5385 * Implemented magic shell-like functions with automatic code
5396 * Implemented magic shell-like functions with automatic code
5386 generation. Now adding another function is just a matter of adding
5397 generation. Now adding another function is just a matter of adding
5387 an entry to a dict, and the function is dynamically generated at
5398 an entry to a dict, and the function is dynamically generated at
5388 run-time. Python has some really cool features!
5399 run-time. Python has some really cool features!
5389
5400
5390 * Renamed many options to cleanup conventions a little. Now all
5401 * Renamed many options to cleanup conventions a little. Now all
5391 are lowercase, and only underscores where needed. Also in the code
5402 are lowercase, and only underscores where needed. Also in the code
5392 option name tables are clearer.
5403 option name tables are clearer.
5393
5404
5394 * Changed prompts a little. Now input is 'In [n]:' instead of
5405 * Changed prompts a little. Now input is 'In [n]:' instead of
5395 'In[n]:='. This allows it the numbers to be aligned with the
5406 'In[n]:='. This allows it the numbers to be aligned with the
5396 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5407 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5397 Python (it was a Mathematica thing). The '...' continuation prompt
5408 Python (it was a Mathematica thing). The '...' continuation prompt
5398 was also changed a little to align better.
5409 was also changed a little to align better.
5399
5410
5400 * Fixed bug when flushing output cache. Not all _p<n> variables
5411 * Fixed bug when flushing output cache. Not all _p<n> variables
5401 exist, so their deletion needs to be wrapped in a try:
5412 exist, so their deletion needs to be wrapped in a try:
5402
5413
5403 * Figured out how to properly use inspect.formatargspec() (it
5414 * Figured out how to properly use inspect.formatargspec() (it
5404 requires the args preceded by *). So I removed all the code from
5415 requires the args preceded by *). So I removed all the code from
5405 _get_pdef in Magic, which was just replicating that.
5416 _get_pdef in Magic, which was just replicating that.
5406
5417
5407 * Added test to prefilter to allow redefining magic function names
5418 * Added test to prefilter to allow redefining magic function names
5408 as variables. This is ok, since the @ form is always available,
5419 as variables. This is ok, since the @ form is always available,
5409 but whe should allow the user to define a variable called 'ls' if
5420 but whe should allow the user to define a variable called 'ls' if
5410 he needs it.
5421 he needs it.
5411
5422
5412 * Moved the ToDo information from README into a separate ToDo.
5423 * Moved the ToDo information from README into a separate ToDo.
5413
5424
5414 * General code cleanup and small bugfixes. I think it's close to a
5425 * General code cleanup and small bugfixes. I think it's close to a
5415 state where it can be released, obviously with a big 'beta'
5426 state where it can be released, obviously with a big 'beta'
5416 warning on it.
5427 warning on it.
5417
5428
5418 * Got the magic function split to work. Now all magics are defined
5429 * Got the magic function split to work. Now all magics are defined
5419 in a separate class. It just organizes things a bit, and now
5430 in a separate class. It just organizes things a bit, and now
5420 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5431 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5421 was too long).
5432 was too long).
5422
5433
5423 * Changed @clear to @reset to avoid potential confusions with
5434 * Changed @clear to @reset to avoid potential confusions with
5424 the shell command clear. Also renamed @cl to @clear, which does
5435 the shell command clear. Also renamed @cl to @clear, which does
5425 exactly what people expect it to from their shell experience.
5436 exactly what people expect it to from their shell experience.
5426
5437
5427 Added a check to the @reset command (since it's so
5438 Added a check to the @reset command (since it's so
5428 destructive, it's probably a good idea to ask for confirmation).
5439 destructive, it's probably a good idea to ask for confirmation).
5429 But now reset only works for full namespace resetting. Since the
5440 But now reset only works for full namespace resetting. Since the
5430 del keyword is already there for deleting a few specific
5441 del keyword is already there for deleting a few specific
5431 variables, I don't see the point of having a redundant magic
5442 variables, I don't see the point of having a redundant magic
5432 function for the same task.
5443 function for the same task.
5433
5444
5434 2001-11-24 Fernando Perez <fperez@colorado.edu>
5445 2001-11-24 Fernando Perez <fperez@colorado.edu>
5435
5446
5436 * Updated the builtin docs (esp. the ? ones).
5447 * Updated the builtin docs (esp. the ? ones).
5437
5448
5438 * Ran all the code through pychecker. Not terribly impressed with
5449 * Ran all the code through pychecker. Not terribly impressed with
5439 it: lots of spurious warnings and didn't really find anything of
5450 it: lots of spurious warnings and didn't really find anything of
5440 substance (just a few modules being imported and not used).
5451 substance (just a few modules being imported and not used).
5441
5452
5442 * Implemented the new ultraTB functionality into IPython. New
5453 * Implemented the new ultraTB functionality into IPython. New
5443 option: xcolors. This chooses color scheme. xmode now only selects
5454 option: xcolors. This chooses color scheme. xmode now only selects
5444 between Plain and Verbose. Better orthogonality.
5455 between Plain and Verbose. Better orthogonality.
5445
5456
5446 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5457 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5447 mode and color scheme for the exception handlers. Now it's
5458 mode and color scheme for the exception handlers. Now it's
5448 possible to have the verbose traceback with no coloring.
5459 possible to have the verbose traceback with no coloring.
5449
5460
5450 2001-11-23 Fernando Perez <fperez@colorado.edu>
5461 2001-11-23 Fernando Perez <fperez@colorado.edu>
5451
5462
5452 * Version 0.1.12 released, 0.1.13 opened.
5463 * Version 0.1.12 released, 0.1.13 opened.
5453
5464
5454 * Removed option to set auto-quote and auto-paren escapes by
5465 * Removed option to set auto-quote and auto-paren escapes by
5455 user. The chances of breaking valid syntax are just too high. If
5466 user. The chances of breaking valid syntax are just too high. If
5456 someone *really* wants, they can always dig into the code.
5467 someone *really* wants, they can always dig into the code.
5457
5468
5458 * Made prompt separators configurable.
5469 * Made prompt separators configurable.
5459
5470
5460 2001-11-22 Fernando Perez <fperez@colorado.edu>
5471 2001-11-22 Fernando Perez <fperez@colorado.edu>
5461
5472
5462 * Small bugfixes in many places.
5473 * Small bugfixes in many places.
5463
5474
5464 * Removed the MyCompleter class from ipplib. It seemed redundant
5475 * Removed the MyCompleter class from ipplib. It seemed redundant
5465 with the C-p,C-n history search functionality. Less code to
5476 with the C-p,C-n history search functionality. Less code to
5466 maintain.
5477 maintain.
5467
5478
5468 * Moved all the original ipython.py code into ipythonlib.py. Right
5479 * Moved all the original ipython.py code into ipythonlib.py. Right
5469 now it's just one big dump into a function called make_IPython, so
5480 now it's just one big dump into a function called make_IPython, so
5470 no real modularity has been gained. But at least it makes the
5481 no real modularity has been gained. But at least it makes the
5471 wrapper script tiny, and since ipythonlib is a module, it gets
5482 wrapper script tiny, and since ipythonlib is a module, it gets
5472 compiled and startup is much faster.
5483 compiled and startup is much faster.
5473
5484
5474 This is a reasobably 'deep' change, so we should test it for a
5485 This is a reasobably 'deep' change, so we should test it for a
5475 while without messing too much more with the code.
5486 while without messing too much more with the code.
5476
5487
5477 2001-11-21 Fernando Perez <fperez@colorado.edu>
5488 2001-11-21 Fernando Perez <fperez@colorado.edu>
5478
5489
5479 * Version 0.1.11 released, 0.1.12 opened for further work.
5490 * Version 0.1.11 released, 0.1.12 opened for further work.
5480
5491
5481 * Removed dependency on Itpl. It was only needed in one place. It
5492 * Removed dependency on Itpl. It was only needed in one place. It
5482 would be nice if this became part of python, though. It makes life
5493 would be nice if this became part of python, though. It makes life
5483 *a lot* easier in some cases.
5494 *a lot* easier in some cases.
5484
5495
5485 * Simplified the prefilter code a bit. Now all handlers are
5496 * Simplified the prefilter code a bit. Now all handlers are
5486 expected to explicitly return a value (at least a blank string).
5497 expected to explicitly return a value (at least a blank string).
5487
5498
5488 * Heavy edits in ipplib. Removed the help system altogether. Now
5499 * Heavy edits in ipplib. Removed the help system altogether. Now
5489 obj?/?? is used for inspecting objects, a magic @doc prints
5500 obj?/?? is used for inspecting objects, a magic @doc prints
5490 docstrings, and full-blown Python help is accessed via the 'help'
5501 docstrings, and full-blown Python help is accessed via the 'help'
5491 keyword. This cleans up a lot of code (less to maintain) and does
5502 keyword. This cleans up a lot of code (less to maintain) and does
5492 the job. Since 'help' is now a standard Python component, might as
5503 the job. Since 'help' is now a standard Python component, might as
5493 well use it and remove duplicate functionality.
5504 well use it and remove duplicate functionality.
5494
5505
5495 Also removed the option to use ipplib as a standalone program. By
5506 Also removed the option to use ipplib as a standalone program. By
5496 now it's too dependent on other parts of IPython to function alone.
5507 now it's too dependent on other parts of IPython to function alone.
5497
5508
5498 * Fixed bug in genutils.pager. It would crash if the pager was
5509 * Fixed bug in genutils.pager. It would crash if the pager was
5499 exited immediately after opening (broken pipe).
5510 exited immediately after opening (broken pipe).
5500
5511
5501 * Trimmed down the VerboseTB reporting a little. The header is
5512 * Trimmed down the VerboseTB reporting a little. The header is
5502 much shorter now and the repeated exception arguments at the end
5513 much shorter now and the repeated exception arguments at the end
5503 have been removed. For interactive use the old header seemed a bit
5514 have been removed. For interactive use the old header seemed a bit
5504 excessive.
5515 excessive.
5505
5516
5506 * Fixed small bug in output of @whos for variables with multi-word
5517 * Fixed small bug in output of @whos for variables with multi-word
5507 types (only first word was displayed).
5518 types (only first word was displayed).
5508
5519
5509 2001-11-17 Fernando Perez <fperez@colorado.edu>
5520 2001-11-17 Fernando Perez <fperez@colorado.edu>
5510
5521
5511 * Version 0.1.10 released, 0.1.11 opened for further work.
5522 * Version 0.1.10 released, 0.1.11 opened for further work.
5512
5523
5513 * Modified dirs and friends. dirs now *returns* the stack (not
5524 * Modified dirs and friends. dirs now *returns* the stack (not
5514 prints), so one can manipulate it as a variable. Convenient to
5525 prints), so one can manipulate it as a variable. Convenient to
5515 travel along many directories.
5526 travel along many directories.
5516
5527
5517 * Fixed bug in magic_pdef: would only work with functions with
5528 * Fixed bug in magic_pdef: would only work with functions with
5518 arguments with default values.
5529 arguments with default values.
5519
5530
5520 2001-11-14 Fernando Perez <fperez@colorado.edu>
5531 2001-11-14 Fernando Perez <fperez@colorado.edu>
5521
5532
5522 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5533 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5523 example with IPython. Various other minor fixes and cleanups.
5534 example with IPython. Various other minor fixes and cleanups.
5524
5535
5525 * Version 0.1.9 released, 0.1.10 opened for further work.
5536 * Version 0.1.9 released, 0.1.10 opened for further work.
5526
5537
5527 * Added sys.path to the list of directories searched in the
5538 * Added sys.path to the list of directories searched in the
5528 execfile= option. It used to be the current directory and the
5539 execfile= option. It used to be the current directory and the
5529 user's IPYTHONDIR only.
5540 user's IPYTHONDIR only.
5530
5541
5531 2001-11-13 Fernando Perez <fperez@colorado.edu>
5542 2001-11-13 Fernando Perez <fperez@colorado.edu>
5532
5543
5533 * Reinstated the raw_input/prefilter separation that Janko had
5544 * Reinstated the raw_input/prefilter separation that Janko had
5534 initially. This gives a more convenient setup for extending the
5545 initially. This gives a more convenient setup for extending the
5535 pre-processor from the outside: raw_input always gets a string,
5546 pre-processor from the outside: raw_input always gets a string,
5536 and prefilter has to process it. We can then redefine prefilter
5547 and prefilter has to process it. We can then redefine prefilter
5537 from the outside and implement extensions for special
5548 from the outside and implement extensions for special
5538 purposes.
5549 purposes.
5539
5550
5540 Today I got one for inputting PhysicalQuantity objects
5551 Today I got one for inputting PhysicalQuantity objects
5541 (from Scientific) without needing any function calls at
5552 (from Scientific) without needing any function calls at
5542 all. Extremely convenient, and it's all done as a user-level
5553 all. Extremely convenient, and it's all done as a user-level
5543 extension (no IPython code was touched). Now instead of:
5554 extension (no IPython code was touched). Now instead of:
5544 a = PhysicalQuantity(4.2,'m/s**2')
5555 a = PhysicalQuantity(4.2,'m/s**2')
5545 one can simply say
5556 one can simply say
5546 a = 4.2 m/s**2
5557 a = 4.2 m/s**2
5547 or even
5558 or even
5548 a = 4.2 m/s^2
5559 a = 4.2 m/s^2
5549
5560
5550 I use this, but it's also a proof of concept: IPython really is
5561 I use this, but it's also a proof of concept: IPython really is
5551 fully user-extensible, even at the level of the parsing of the
5562 fully user-extensible, even at the level of the parsing of the
5552 command line. It's not trivial, but it's perfectly doable.
5563 command line. It's not trivial, but it's perfectly doable.
5553
5564
5554 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5565 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5555 the problem of modules being loaded in the inverse order in which
5566 the problem of modules being loaded in the inverse order in which
5556 they were defined in
5567 they were defined in
5557
5568
5558 * Version 0.1.8 released, 0.1.9 opened for further work.
5569 * Version 0.1.8 released, 0.1.9 opened for further work.
5559
5570
5560 * Added magics pdef, source and file. They respectively show the
5571 * Added magics pdef, source and file. They respectively show the
5561 definition line ('prototype' in C), source code and full python
5572 definition line ('prototype' in C), source code and full python
5562 file for any callable object. The object inspector oinfo uses
5573 file for any callable object. The object inspector oinfo uses
5563 these to show the same information.
5574 these to show the same information.
5564
5575
5565 * Version 0.1.7 released, 0.1.8 opened for further work.
5576 * Version 0.1.7 released, 0.1.8 opened for further work.
5566
5577
5567 * Separated all the magic functions into a class called Magic. The
5578 * Separated all the magic functions into a class called Magic. The
5568 InteractiveShell class was becoming too big for Xemacs to handle
5579 InteractiveShell class was becoming too big for Xemacs to handle
5569 (de-indenting a line would lock it up for 10 seconds while it
5580 (de-indenting a line would lock it up for 10 seconds while it
5570 backtracked on the whole class!)
5581 backtracked on the whole class!)
5571
5582
5572 FIXME: didn't work. It can be done, but right now namespaces are
5583 FIXME: didn't work. It can be done, but right now namespaces are
5573 all messed up. Do it later (reverted it for now, so at least
5584 all messed up. Do it later (reverted it for now, so at least
5574 everything works as before).
5585 everything works as before).
5575
5586
5576 * Got the object introspection system (magic_oinfo) working! I
5587 * Got the object introspection system (magic_oinfo) working! I
5577 think this is pretty much ready for release to Janko, so he can
5588 think this is pretty much ready for release to Janko, so he can
5578 test it for a while and then announce it. Pretty much 100% of what
5589 test it for a while and then announce it. Pretty much 100% of what
5579 I wanted for the 'phase 1' release is ready. Happy, tired.
5590 I wanted for the 'phase 1' release is ready. Happy, tired.
5580
5591
5581 2001-11-12 Fernando Perez <fperez@colorado.edu>
5592 2001-11-12 Fernando Perez <fperez@colorado.edu>
5582
5593
5583 * Version 0.1.6 released, 0.1.7 opened for further work.
5594 * Version 0.1.6 released, 0.1.7 opened for further work.
5584
5595
5585 * Fixed bug in printing: it used to test for truth before
5596 * Fixed bug in printing: it used to test for truth before
5586 printing, so 0 wouldn't print. Now checks for None.
5597 printing, so 0 wouldn't print. Now checks for None.
5587
5598
5588 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5599 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5589 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5600 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5590 reaches by hand into the outputcache. Think of a better way to do
5601 reaches by hand into the outputcache. Think of a better way to do
5591 this later.
5602 this later.
5592
5603
5593 * Various small fixes thanks to Nathan's comments.
5604 * Various small fixes thanks to Nathan's comments.
5594
5605
5595 * Changed magic_pprint to magic_Pprint. This way it doesn't
5606 * Changed magic_pprint to magic_Pprint. This way it doesn't
5596 collide with pprint() and the name is consistent with the command
5607 collide with pprint() and the name is consistent with the command
5597 line option.
5608 line option.
5598
5609
5599 * Changed prompt counter behavior to be fully like
5610 * Changed prompt counter behavior to be fully like
5600 Mathematica's. That is, even input that doesn't return a result
5611 Mathematica's. That is, even input that doesn't return a result
5601 raises the prompt counter. The old behavior was kind of confusing
5612 raises the prompt counter. The old behavior was kind of confusing
5602 (getting the same prompt number several times if the operation
5613 (getting the same prompt number several times if the operation
5603 didn't return a result).
5614 didn't return a result).
5604
5615
5605 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5616 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5606
5617
5607 * Fixed -Classic mode (wasn't working anymore).
5618 * Fixed -Classic mode (wasn't working anymore).
5608
5619
5609 * Added colored prompts using Nathan's new code. Colors are
5620 * Added colored prompts using Nathan's new code. Colors are
5610 currently hardwired, they can be user-configurable. For
5621 currently hardwired, they can be user-configurable. For
5611 developers, they can be chosen in file ipythonlib.py, at the
5622 developers, they can be chosen in file ipythonlib.py, at the
5612 beginning of the CachedOutput class def.
5623 beginning of the CachedOutput class def.
5613
5624
5614 2001-11-11 Fernando Perez <fperez@colorado.edu>
5625 2001-11-11 Fernando Perez <fperez@colorado.edu>
5615
5626
5616 * Version 0.1.5 released, 0.1.6 opened for further work.
5627 * Version 0.1.5 released, 0.1.6 opened for further work.
5617
5628
5618 * Changed magic_env to *return* the environment as a dict (not to
5629 * Changed magic_env to *return* the environment as a dict (not to
5619 print it). This way it prints, but it can also be processed.
5630 print it). This way it prints, but it can also be processed.
5620
5631
5621 * Added Verbose exception reporting to interactive
5632 * Added Verbose exception reporting to interactive
5622 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5633 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5623 traceback. Had to make some changes to the ultraTB file. This is
5634 traceback. Had to make some changes to the ultraTB file. This is
5624 probably the last 'big' thing in my mental todo list. This ties
5635 probably the last 'big' thing in my mental todo list. This ties
5625 in with the next entry:
5636 in with the next entry:
5626
5637
5627 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5638 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5628 has to specify is Plain, Color or Verbose for all exception
5639 has to specify is Plain, Color or Verbose for all exception
5629 handling.
5640 handling.
5630
5641
5631 * Removed ShellServices option. All this can really be done via
5642 * Removed ShellServices option. All this can really be done via
5632 the magic system. It's easier to extend, cleaner and has automatic
5643 the magic system. It's easier to extend, cleaner and has automatic
5633 namespace protection and documentation.
5644 namespace protection and documentation.
5634
5645
5635 2001-11-09 Fernando Perez <fperez@colorado.edu>
5646 2001-11-09 Fernando Perez <fperez@colorado.edu>
5636
5647
5637 * Fixed bug in output cache flushing (missing parameter to
5648 * Fixed bug in output cache flushing (missing parameter to
5638 __init__). Other small bugs fixed (found using pychecker).
5649 __init__). Other small bugs fixed (found using pychecker).
5639
5650
5640 * Version 0.1.4 opened for bugfixing.
5651 * Version 0.1.4 opened for bugfixing.
5641
5652
5642 2001-11-07 Fernando Perez <fperez@colorado.edu>
5653 2001-11-07 Fernando Perez <fperez@colorado.edu>
5643
5654
5644 * Version 0.1.3 released, mainly because of the raw_input bug.
5655 * Version 0.1.3 released, mainly because of the raw_input bug.
5645
5656
5646 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5657 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5647 and when testing for whether things were callable, a call could
5658 and when testing for whether things were callable, a call could
5648 actually be made to certain functions. They would get called again
5659 actually be made to certain functions. They would get called again
5649 once 'really' executed, with a resulting double call. A disaster
5660 once 'really' executed, with a resulting double call. A disaster
5650 in many cases (list.reverse() would never work!).
5661 in many cases (list.reverse() would never work!).
5651
5662
5652 * Removed prefilter() function, moved its code to raw_input (which
5663 * Removed prefilter() function, moved its code to raw_input (which
5653 after all was just a near-empty caller for prefilter). This saves
5664 after all was just a near-empty caller for prefilter). This saves
5654 a function call on every prompt, and simplifies the class a tiny bit.
5665 a function call on every prompt, and simplifies the class a tiny bit.
5655
5666
5656 * Fix _ip to __ip name in magic example file.
5667 * Fix _ip to __ip name in magic example file.
5657
5668
5658 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5669 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5659 work with non-gnu versions of tar.
5670 work with non-gnu versions of tar.
5660
5671
5661 2001-11-06 Fernando Perez <fperez@colorado.edu>
5672 2001-11-06 Fernando Perez <fperez@colorado.edu>
5662
5673
5663 * Version 0.1.2. Just to keep track of the recent changes.
5674 * Version 0.1.2. Just to keep track of the recent changes.
5664
5675
5665 * Fixed nasty bug in output prompt routine. It used to check 'if
5676 * Fixed nasty bug in output prompt routine. It used to check 'if
5666 arg != None...'. Problem is, this fails if arg implements a
5677 arg != None...'. Problem is, this fails if arg implements a
5667 special comparison (__cmp__) which disallows comparing to
5678 special comparison (__cmp__) which disallows comparing to
5668 None. Found it when trying to use the PhysicalQuantity module from
5679 None. Found it when trying to use the PhysicalQuantity module from
5669 ScientificPython.
5680 ScientificPython.
5670
5681
5671 2001-11-05 Fernando Perez <fperez@colorado.edu>
5682 2001-11-05 Fernando Perez <fperez@colorado.edu>
5672
5683
5673 * Also added dirs. Now the pushd/popd/dirs family functions
5684 * Also added dirs. Now the pushd/popd/dirs family functions
5674 basically like the shell, with the added convenience of going home
5685 basically like the shell, with the added convenience of going home
5675 when called with no args.
5686 when called with no args.
5676
5687
5677 * pushd/popd slightly modified to mimic shell behavior more
5688 * pushd/popd slightly modified to mimic shell behavior more
5678 closely.
5689 closely.
5679
5690
5680 * Added env,pushd,popd from ShellServices as magic functions. I
5691 * Added env,pushd,popd from ShellServices as magic functions. I
5681 think the cleanest will be to port all desired functions from
5692 think the cleanest will be to port all desired functions from
5682 ShellServices as magics and remove ShellServices altogether. This
5693 ShellServices as magics and remove ShellServices altogether. This
5683 will provide a single, clean way of adding functionality
5694 will provide a single, clean way of adding functionality
5684 (shell-type or otherwise) to IP.
5695 (shell-type or otherwise) to IP.
5685
5696
5686 2001-11-04 Fernando Perez <fperez@colorado.edu>
5697 2001-11-04 Fernando Perez <fperez@colorado.edu>
5687
5698
5688 * Added .ipython/ directory to sys.path. This way users can keep
5699 * Added .ipython/ directory to sys.path. This way users can keep
5689 customizations there and access them via import.
5700 customizations there and access them via import.
5690
5701
5691 2001-11-03 Fernando Perez <fperez@colorado.edu>
5702 2001-11-03 Fernando Perez <fperez@colorado.edu>
5692
5703
5693 * Opened version 0.1.1 for new changes.
5704 * Opened version 0.1.1 for new changes.
5694
5705
5695 * Changed version number to 0.1.0: first 'public' release, sent to
5706 * Changed version number to 0.1.0: first 'public' release, sent to
5696 Nathan and Janko.
5707 Nathan and Janko.
5697
5708
5698 * Lots of small fixes and tweaks.
5709 * Lots of small fixes and tweaks.
5699
5710
5700 * Minor changes to whos format. Now strings are shown, snipped if
5711 * Minor changes to whos format. Now strings are shown, snipped if
5701 too long.
5712 too long.
5702
5713
5703 * Changed ShellServices to work on __main__ so they show up in @who
5714 * Changed ShellServices to work on __main__ so they show up in @who
5704
5715
5705 * Help also works with ? at the end of a line:
5716 * Help also works with ? at the end of a line:
5706 ?sin and sin?
5717 ?sin and sin?
5707 both produce the same effect. This is nice, as often I use the
5718 both produce the same effect. This is nice, as often I use the
5708 tab-complete to find the name of a method, but I used to then have
5719 tab-complete to find the name of a method, but I used to then have
5709 to go to the beginning of the line to put a ? if I wanted more
5720 to go to the beginning of the line to put a ? if I wanted more
5710 info. Now I can just add the ? and hit return. Convenient.
5721 info. Now I can just add the ? and hit return. Convenient.
5711
5722
5712 2001-11-02 Fernando Perez <fperez@colorado.edu>
5723 2001-11-02 Fernando Perez <fperez@colorado.edu>
5713
5724
5714 * Python version check (>=2.1) added.
5725 * Python version check (>=2.1) added.
5715
5726
5716 * Added LazyPython documentation. At this point the docs are quite
5727 * Added LazyPython documentation. At this point the docs are quite
5717 a mess. A cleanup is in order.
5728 a mess. A cleanup is in order.
5718
5729
5719 * Auto-installer created. For some bizarre reason, the zipfiles
5730 * Auto-installer created. For some bizarre reason, the zipfiles
5720 module isn't working on my system. So I made a tar version
5731 module isn't working on my system. So I made a tar version
5721 (hopefully the command line options in various systems won't kill
5732 (hopefully the command line options in various systems won't kill
5722 me).
5733 me).
5723
5734
5724 * Fixes to Struct in genutils. Now all dictionary-like methods are
5735 * Fixes to Struct in genutils. Now all dictionary-like methods are
5725 protected (reasonably).
5736 protected (reasonably).
5726
5737
5727 * Added pager function to genutils and changed ? to print usage
5738 * Added pager function to genutils and changed ? to print usage
5728 note through it (it was too long).
5739 note through it (it was too long).
5729
5740
5730 * Added the LazyPython functionality. Works great! I changed the
5741 * Added the LazyPython functionality. Works great! I changed the
5731 auto-quote escape to ';', it's on home row and next to '. But
5742 auto-quote escape to ';', it's on home row and next to '. But
5732 both auto-quote and auto-paren (still /) escapes are command-line
5743 both auto-quote and auto-paren (still /) escapes are command-line
5733 parameters.
5744 parameters.
5734
5745
5735
5746
5736 2001-11-01 Fernando Perez <fperez@colorado.edu>
5747 2001-11-01 Fernando Perez <fperez@colorado.edu>
5737
5748
5738 * Version changed to 0.0.7. Fairly large change: configuration now
5749 * Version changed to 0.0.7. Fairly large change: configuration now
5739 is all stored in a directory, by default .ipython. There, all
5750 is all stored in a directory, by default .ipython. There, all
5740 config files have normal looking names (not .names)
5751 config files have normal looking names (not .names)
5741
5752
5742 * Version 0.0.6 Released first to Lucas and Archie as a test
5753 * Version 0.0.6 Released first to Lucas and Archie as a test
5743 run. Since it's the first 'semi-public' release, change version to
5754 run. Since it's the first 'semi-public' release, change version to
5744 > 0.0.6 for any changes now.
5755 > 0.0.6 for any changes now.
5745
5756
5746 * Stuff I had put in the ipplib.py changelog:
5757 * Stuff I had put in the ipplib.py changelog:
5747
5758
5748 Changes to InteractiveShell:
5759 Changes to InteractiveShell:
5749
5760
5750 - Made the usage message a parameter.
5761 - Made the usage message a parameter.
5751
5762
5752 - Require the name of the shell variable to be given. It's a bit
5763 - Require the name of the shell variable to be given. It's a bit
5753 of a hack, but allows the name 'shell' not to be hardwired in the
5764 of a hack, but allows the name 'shell' not to be hardwired in the
5754 magic (@) handler, which is problematic b/c it requires
5765 magic (@) handler, which is problematic b/c it requires
5755 polluting the global namespace with 'shell'. This in turn is
5766 polluting the global namespace with 'shell'. This in turn is
5756 fragile: if a user redefines a variable called shell, things
5767 fragile: if a user redefines a variable called shell, things
5757 break.
5768 break.
5758
5769
5759 - magic @: all functions available through @ need to be defined
5770 - magic @: all functions available through @ need to be defined
5760 as magic_<name>, even though they can be called simply as
5771 as magic_<name>, even though they can be called simply as
5761 @<name>. This allows the special command @magic to gather
5772 @<name>. This allows the special command @magic to gather
5762 information automatically about all existing magic functions,
5773 information automatically about all existing magic functions,
5763 even if they are run-time user extensions, by parsing the shell
5774 even if they are run-time user extensions, by parsing the shell
5764 instance __dict__ looking for special magic_ names.
5775 instance __dict__ looking for special magic_ names.
5765
5776
5766 - mainloop: added *two* local namespace parameters. This allows
5777 - mainloop: added *two* local namespace parameters. This allows
5767 the class to differentiate between parameters which were there
5778 the class to differentiate between parameters which were there
5768 before and after command line initialization was processed. This
5779 before and after command line initialization was processed. This
5769 way, later @who can show things loaded at startup by the
5780 way, later @who can show things loaded at startup by the
5770 user. This trick was necessary to make session saving/reloading
5781 user. This trick was necessary to make session saving/reloading
5771 really work: ideally after saving/exiting/reloading a session,
5782 really work: ideally after saving/exiting/reloading a session,
5772 *everything* should look the same, including the output of @who. I
5783 *everything* should look the same, including the output of @who. I
5773 was only able to make this work with this double namespace
5784 was only able to make this work with this double namespace
5774 trick.
5785 trick.
5775
5786
5776 - added a header to the logfile which allows (almost) full
5787 - added a header to the logfile which allows (almost) full
5777 session restoring.
5788 session restoring.
5778
5789
5779 - prepend lines beginning with @ or !, with a and log
5790 - prepend lines beginning with @ or !, with a and log
5780 them. Why? !lines: may be useful to know what you did @lines:
5791 them. Why? !lines: may be useful to know what you did @lines:
5781 they may affect session state. So when restoring a session, at
5792 they may affect session state. So when restoring a session, at
5782 least inform the user of their presence. I couldn't quite get
5793 least inform the user of their presence. I couldn't quite get
5783 them to properly re-execute, but at least the user is warned.
5794 them to properly re-execute, but at least the user is warned.
5784
5795
5785 * Started ChangeLog.
5796 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now