##// END OF EJS Templates
Implement a proper -i command line option
vivainio -
Show More
@@ -1,555 +1,554 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 try: # Python 2.3 compatibility
67 try: # Python 2.3 compatibility
68 set
68 set
69 except NameError:
69 except NameError:
70 import sets
70 import sets
71 set = sets.Set
71 set = sets.Set
72
72
73 # our own
73 # our own
74 #from IPython.genutils import warn,error
74 #from IPython.genutils import warn,error
75
75
76 class TryNext(Exception):
76 class TryNext(Exception):
77 """Try next hook exception.
77 """Try next hook exception.
78
78
79 Raise this in your hook function to indicate that the next hook handler
79 Raise this in your hook function to indicate that the next hook handler
80 should be used to handle the operation. If you pass arguments to the
80 should be used to handle the operation. If you pass arguments to the
81 constructor those arguments will be used by the next hook instead of the
81 constructor those arguments will be used by the next hook instead of the
82 original ones.
82 original ones.
83 """
83 """
84
84
85 def __init__(self, *args, **kwargs):
85 def __init__(self, *args, **kwargs):
86 self.args = args
86 self.args = args
87 self.kwargs = kwargs
87 self.kwargs = kwargs
88
88
89 class IPyAutocall:
89 class IPyAutocall:
90 """ Instances of this class are always autocalled
90 """ Instances of this class are always autocalled
91
91
92 This happens regardless of 'autocall' variable state. Use this to
92 This happens regardless of 'autocall' variable state. Use this to
93 develop macro-like mechanisms.
93 develop macro-like mechanisms.
94 """
94 """
95
95
96 def set_ip(self,ip):
96 def set_ip(self,ip):
97 """ Will be used to set _ip point to current ipython instance b/f call
97 """ Will be used to set _ip point to current ipython instance b/f call
98
98
99 Override this method if you don't want this to happen.
99 Override this method if you don't want this to happen.
100
100
101 """
101 """
102 self._ip = ip
102 self._ip = ip
103
103
104
104
105 # contains the most recently instantiated IPApi
105 # contains the most recently instantiated IPApi
106
106
107 class IPythonNotRunning:
107 class IPythonNotRunning:
108 """Dummy do-nothing class.
108 """Dummy do-nothing class.
109
109
110 Instances of this class return a dummy attribute on all accesses, which
110 Instances of this class return a dummy attribute on all accesses, which
111 can be called and warns. This makes it easier to write scripts which use
111 can be called and warns. This makes it easier to write scripts which use
112 the ipapi.get() object for informational purposes to operate both with and
112 the ipapi.get() object for informational purposes to operate both with and
113 without ipython. Obviously code which uses the ipython object for
113 without ipython. Obviously code which uses the ipython object for
114 computations will not work, but this allows a wider range of code to
114 computations will not work, but this allows a wider range of code to
115 transparently work whether ipython is being used or not."""
115 transparently work whether ipython is being used or not."""
116
116
117 def __init__(self,warn=True):
117 def __init__(self,warn=True):
118 if warn:
118 if warn:
119 self.dummy = self._dummy_warn
119 self.dummy = self._dummy_warn
120 else:
120 else:
121 self.dummy = self._dummy_silent
121 self.dummy = self._dummy_silent
122
122
123 def __str__(self):
123 def __str__(self):
124 return "<IPythonNotRunning>"
124 return "<IPythonNotRunning>"
125
125
126 __repr__ = __str__
126 __repr__ = __str__
127
127
128 def __getattr__(self,name):
128 def __getattr__(self,name):
129 return self.dummy
129 return self.dummy
130
130
131 def _dummy_warn(self,*args,**kw):
131 def _dummy_warn(self,*args,**kw):
132 """Dummy function, which doesn't do anything but warn."""
132 """Dummy function, which doesn't do anything but warn."""
133
133
134 print ("IPython is not running, this is a dummy no-op function")
134 print ("IPython is not running, this is a dummy no-op function")
135
135
136 def _dummy_silent(self,*args,**kw):
136 def _dummy_silent(self,*args,**kw):
137 """Dummy function, which doesn't do anything and emits no warnings."""
137 """Dummy function, which doesn't do anything and emits no warnings."""
138 pass
138 pass
139
139
140 _recent = None
140 _recent = None
141
141
142
142
143 def get(allow_dummy=False,dummy_warn=True):
143 def get(allow_dummy=False,dummy_warn=True):
144 """Get an IPApi object.
144 """Get an IPApi object.
145
145
146 If allow_dummy is true, returns an instance of IPythonNotRunning
146 If allow_dummy is true, returns an instance of IPythonNotRunning
147 instead of None if not running under IPython.
147 instead of None if not running under IPython.
148
148
149 If dummy_warn is false, the dummy instance will be completely silent.
149 If dummy_warn is false, the dummy instance will be completely silent.
150
150
151 Running this should be the first thing you do when writing extensions that
151 Running this should be the first thing you do when writing extensions that
152 can be imported as normal modules. You can then direct all the
152 can be imported as normal modules. You can then direct all the
153 configuration operations against the returned object.
153 configuration operations against the returned object.
154 """
154 """
155 global _recent
155 global _recent
156 if allow_dummy and not _recent:
156 if allow_dummy and not _recent:
157 _recent = IPythonNotRunning(dummy_warn)
157 _recent = IPythonNotRunning(dummy_warn)
158 return _recent
158 return _recent
159
159
160 class IPApi:
160 class IPApi:
161 """ The actual API class for configuring IPython
161 """ The actual API class for configuring IPython
162
162
163 You should do all of the IPython configuration by getting an IPApi object
163 You should do all of the IPython configuration by getting an IPApi object
164 with IPython.ipapi.get() and using the attributes and methods of the
164 with IPython.ipapi.get() and using the attributes and methods of the
165 returned object."""
165 returned object."""
166
166
167 def __init__(self,ip):
167 def __init__(self,ip):
168
168
169 # All attributes exposed here are considered to be the public API of
169 # All attributes exposed here are considered to be the public API of
170 # IPython. As needs dictate, some of these may be wrapped as
170 # IPython. As needs dictate, some of these may be wrapped as
171 # properties.
171 # properties.
172
172
173 self.magic = ip.ipmagic
173 self.magic = ip.ipmagic
174
174
175 self.system = ip.system
175 self.system = ip.system
176
176
177 self.set_hook = ip.set_hook
177 self.set_hook = ip.set_hook
178
178
179 self.set_custom_exc = ip.set_custom_exc
179 self.set_custom_exc = ip.set_custom_exc
180
180
181 self.user_ns = ip.user_ns
181 self.user_ns = ip.user_ns
182
182
183 self.set_crash_handler = ip.set_crash_handler
183 self.set_crash_handler = ip.set_crash_handler
184
184
185 # Session-specific data store, which can be used to store
185 # Session-specific data store, which can be used to store
186 # data that should persist through the ipython session.
186 # data that should persist through the ipython session.
187 self.meta = ip.meta
187 self.meta = ip.meta
188
188
189 # The ipython instance provided
189 # The ipython instance provided
190 self.IP = ip
190 self.IP = ip
191
191
192 self.extensions = {}
192 self.extensions = {}
193
193
194 self.dbg = DebugTools(self)
194 self.dbg = DebugTools(self)
195
195
196 global _recent
196 global _recent
197 _recent = self
197 _recent = self
198
198
199 # Use a property for some things which are added to the instance very
199 # Use a property for some things which are added to the instance very
200 # late. I don't have time right now to disentangle the initialization
200 # late. I don't have time right now to disentangle the initialization
201 # order issues, so a property lets us delay item extraction while
201 # order issues, so a property lets us delay item extraction while
202 # providing a normal attribute API.
202 # providing a normal attribute API.
203 def get_db(self):
203 def get_db(self):
204 """A handle to persistent dict-like database (a PickleShareDB object)"""
204 """A handle to persistent dict-like database (a PickleShareDB object)"""
205 return self.IP.db
205 return self.IP.db
206
206
207 db = property(get_db,None,None,get_db.__doc__)
207 db = property(get_db,None,None,get_db.__doc__)
208
208
209 def get_options(self):
209 def get_options(self):
210 """All configurable variables."""
210 """All configurable variables."""
211
211
212 # catch typos by disabling new attribute creation. If new attr creation
212 # catch typos by disabling new attribute creation. If new attr creation
213 # is in fact wanted (e.g. when exposing new options), do allow_new_attr(True)
213 # is in fact wanted (e.g. when exposing new options), do allow_new_attr(True)
214 # for the received rc struct.
214 # for the received rc struct.
215
215
216 self.IP.rc.allow_new_attr(False)
216 self.IP.rc.allow_new_attr(False)
217 return self.IP.rc
217 return self.IP.rc
218
218
219 options = property(get_options,None,None,get_options.__doc__)
219 options = property(get_options,None,None,get_options.__doc__)
220
220
221 def expose_magic(self,magicname, func):
221 def expose_magic(self,magicname, func):
222 ''' Expose own function as magic function for ipython
222 ''' Expose own function as magic function for ipython
223
223
224 def foo_impl(self,parameter_s=''):
224 def foo_impl(self,parameter_s=''):
225 """My very own magic!. (Use docstrings, IPython reads them)."""
225 """My very own magic!. (Use docstrings, IPython reads them)."""
226 print 'Magic function. Passed parameter is between < >: <'+parameter_s+'>'
226 print 'Magic function. Passed parameter is between < >: <'+parameter_s+'>'
227 print 'The self object is:',self
227 print 'The self object is:',self
228
228
229 ipapi.expose_magic("foo",foo_impl)
229 ipapi.expose_magic("foo",foo_impl)
230 '''
230 '''
231
231
232 import new
232 import new
233 im = new.instancemethod(func,self.IP, self.IP.__class__)
233 im = new.instancemethod(func,self.IP, self.IP.__class__)
234 old = getattr(self.IP, "magic_" + magicname, None)
234 old = getattr(self.IP, "magic_" + magicname, None)
235 if old:
235 if old:
236 self.dbg.debug_stack("Magic redefinition '%s', old %s" % (magicname,
236 self.dbg.debug_stack("Magic redefinition '%s', old %s" % (magicname,
237 old))
237 old))
238
238
239 setattr(self.IP, "magic_" + magicname, im)
239 setattr(self.IP, "magic_" + magicname, im)
240
240
241 def ex(self,cmd):
241 def ex(self,cmd):
242 """ Execute a normal python statement in user namespace """
242 """ Execute a normal python statement in user namespace """
243 exec cmd in self.user_ns
243 exec cmd in self.user_ns
244
244
245 def ev(self,expr):
245 def ev(self,expr):
246 """ Evaluate python expression expr in user namespace
246 """ Evaluate python expression expr in user namespace
247
247
248 Returns the result of evaluation"""
248 Returns the result of evaluation"""
249 return eval(expr,self.user_ns)
249 return eval(expr,self.user_ns)
250
250
251 def runlines(self,lines):
251 def runlines(self,lines):
252 """ Run the specified lines in interpreter, honoring ipython directives.
252 """ Run the specified lines in interpreter, honoring ipython directives.
253
253
254 This allows %magic and !shell escape notations.
254 This allows %magic and !shell escape notations.
255
255
256 Takes either all lines in one string or list of lines.
256 Takes either all lines in one string or list of lines.
257 """
257 """
258 if isinstance(lines,basestring):
258 if isinstance(lines,basestring):
259 self.IP.runlines(lines)
259 self.IP.runlines(lines)
260 else:
260 else:
261 self.IP.runlines('\n'.join(lines))
261 self.IP.runlines('\n'.join(lines))
262
262
263 def to_user_ns(self,vars, interactive = True):
263 def to_user_ns(self,vars, interactive = True):
264 """Inject a group of variables into the IPython user namespace.
264 """Inject a group of variables into the IPython user namespace.
265
265
266 Inputs:
266 Inputs:
267
267
268 - vars: string with variable names separated by whitespace, or a
268 - vars: string with variable names separated by whitespace, or a
269 dict with name/value pairs.
269 dict with name/value pairs.
270
270
271 - interactive: if True (default), the var will be listed with
271 - interactive: if True (default), the var will be listed with
272 %whos et. al.
272 %whos et. al.
273
273
274 This utility routine is meant to ease interactive debugging work,
274 This utility routine is meant to ease interactive debugging work,
275 where you want to easily propagate some internal variable in your code
275 where you want to easily propagate some internal variable in your code
276 up to the interactive namespace for further exploration.
276 up to the interactive namespace for further exploration.
277
277
278 When you run code via %run, globals in your script become visible at
278 When you run code via %run, globals in your script become visible at
279 the interactive prompt, but this doesn't happen for locals inside your
279 the interactive prompt, but this doesn't happen for locals inside your
280 own functions and methods. Yet when debugging, it is common to want
280 own functions and methods. Yet when debugging, it is common to want
281 to explore some internal variables further at the interactive propmt.
281 to explore some internal variables further at the interactive propmt.
282
282
283 Examples:
283 Examples:
284
284
285 To use this, you first must obtain a handle on the ipython object as
285 To use this, you first must obtain a handle on the ipython object as
286 indicated above, via:
286 indicated above, via:
287
287
288 import IPython.ipapi
288 import IPython.ipapi
289 ip = IPython.ipapi.get()
289 ip = IPython.ipapi.get()
290
290
291 Once this is done, inside a routine foo() where you want to expose
291 Once this is done, inside a routine foo() where you want to expose
292 variables x and y, you do the following:
292 variables x and y, you do the following:
293
293
294 def foo():
294 def foo():
295 ...
295 ...
296 x = your_computation()
296 x = your_computation()
297 y = something_else()
297 y = something_else()
298
298
299 # This pushes x and y to the interactive prompt immediately, even
299 # This pushes x and y to the interactive prompt immediately, even
300 # if this routine crashes on the next line after:
300 # if this routine crashes on the next line after:
301 ip.to_user_ns('x y')
301 ip.to_user_ns('x y')
302 ...
302 ...
303
303
304 # To expose *ALL* the local variables from the function, use:
304 # To expose *ALL* the local variables from the function, use:
305 ip.to_user_ns(locals())
305 ip.to_user_ns(locals())
306
306
307 ...
307 ...
308 # return
308 # return
309
309
310
310
311 If you need to rename variables, the dict input makes it easy. For
311 If you need to rename variables, the dict input makes it easy. For
312 example, this call exposes variables 'foo' as 'x' and 'bar' as 'y'
312 example, this call exposes variables 'foo' as 'x' and 'bar' as 'y'
313 in IPython user namespace:
313 in IPython user namespace:
314
314
315 ip.to_user_ns(dict(x=foo,y=bar))
315 ip.to_user_ns(dict(x=foo,y=bar))
316 """
316 """
317
317
318 # print 'vars given:',vars # dbg
318 # print 'vars given:',vars # dbg
319
319
320 # We need a dict of name/value pairs to do namespace updates.
320 # We need a dict of name/value pairs to do namespace updates.
321 if isinstance(vars,dict):
321 if isinstance(vars,dict):
322 # If a dict was given, no need to change anything.
322 # If a dict was given, no need to change anything.
323 vdict = vars
323 vdict = vars
324 elif isinstance(vars,basestring):
324 elif isinstance(vars,basestring):
325 # If a string with names was given, get the caller's frame to
325 # If a string with names was given, get the caller's frame to
326 # evaluate the given names in
326 # evaluate the given names in
327 cf = sys._getframe(1)
327 cf = sys._getframe(1)
328 vdict = {}
328 vdict = {}
329 for name in vars.split():
329 for name in vars.split():
330 try:
330 try:
331 vdict[name] = eval(name,cf.f_globals,cf.f_locals)
331 vdict[name] = eval(name,cf.f_globals,cf.f_locals)
332 except:
332 except:
333 print ('could not get var. %s from %s' %
333 print ('could not get var. %s from %s' %
334 (name,cf.f_code.co_name))
334 (name,cf.f_code.co_name))
335 else:
335 else:
336 raise ValueError('vars must be a string or a dict')
336 raise ValueError('vars must be a string or a dict')
337
337
338 # Propagate variables to user namespace
338 # Propagate variables to user namespace
339 self.user_ns.update(vdict)
339 self.user_ns.update(vdict)
340
340
341 # And configure interactive visibility
341 # And configure interactive visibility
342 config_ns = self.IP.user_config_ns
342 config_ns = self.IP.user_config_ns
343 if interactive:
343 if interactive:
344 for name,val in vdict.iteritems():
344 for name,val in vdict.iteritems():
345 config_ns.pop(name,None)
345 config_ns.pop(name,None)
346 else:
346 else:
347 for name,val in vdict.iteritems():
347 for name,val in vdict.iteritems():
348 config_ns[name] = val
348 config_ns[name] = val
349
349
350
350
351 def expand_alias(self,line):
351 def expand_alias(self,line):
352 """ Expand an alias in the command line
352 """ Expand an alias in the command line
353
353
354 Returns the provided command line, possibly with the first word
354 Returns the provided command line, possibly with the first word
355 (command) translated according to alias expansion rules.
355 (command) translated according to alias expansion rules.
356
356
357 [ipython]|16> _ip.expand_aliases("np myfile.txt")
357 [ipython]|16> _ip.expand_aliases("np myfile.txt")
358 <16> 'q:/opt/np/notepad++.exe myfile.txt'
358 <16> 'q:/opt/np/notepad++.exe myfile.txt'
359 """
359 """
360
360
361 pre,fn,rest = self.IP.split_user_input(line)
361 pre,fn,rest = self.IP.split_user_input(line)
362 res = pre + self.IP.expand_aliases(fn,rest)
362 res = pre + self.IP.expand_aliases(fn,rest)
363 return res
363 return res
364
364
365 def defalias(self, name, cmd):
365 def defalias(self, name, cmd):
366 """ Define a new alias
366 """ Define a new alias
367
367
368 _ip.defalias('bb','bldmake bldfiles')
368 _ip.defalias('bb','bldmake bldfiles')
369
369
370 Creates a new alias named 'bb' in ipython user namespace
370 Creates a new alias named 'bb' in ipython user namespace
371 """
371 """
372
372
373 self.dbg.check_hotname(name)
373 self.dbg.check_hotname(name)
374
374
375
375
376 if name in self.IP.alias_table:
376 if name in self.IP.alias_table:
377 self.dbg.debug_stack("Alias redefinition: '%s' => '%s' (old '%s')" %
377 self.dbg.debug_stack("Alias redefinition: '%s' => '%s' (old '%s')" %
378 (name, cmd, self.IP.alias_table[name]))
378 (name, cmd, self.IP.alias_table[name]))
379
379
380
380
381 if callable(cmd):
381 if callable(cmd):
382 self.IP.alias_table[name] = cmd
382 self.IP.alias_table[name] = cmd
383 import IPython.shadowns
383 import IPython.shadowns
384 setattr(IPython.shadowns, name,cmd)
384 setattr(IPython.shadowns, name,cmd)
385 return
385 return
386
386
387 if isinstance(cmd,basestring):
387 if isinstance(cmd,basestring):
388 nargs = cmd.count('%s')
388 nargs = cmd.count('%s')
389 if nargs>0 and cmd.find('%l')>=0:
389 if nargs>0 and cmd.find('%l')>=0:
390 raise Exception('The %s and %l specifiers are mutually exclusive '
390 raise Exception('The %s and %l specifiers are mutually exclusive '
391 'in alias definitions.')
391 'in alias definitions.')
392
392
393 self.IP.alias_table[name] = (nargs,cmd)
393 self.IP.alias_table[name] = (nargs,cmd)
394 return
394 return
395
395
396 # just put it in - it's probably (0,'foo')
396 # just put it in - it's probably (0,'foo')
397 self.IP.alias_table[name] = cmd
397 self.IP.alias_table[name] = cmd
398
398
399 def defmacro(self, *args):
399 def defmacro(self, *args):
400 """ Define a new macro
400 """ Define a new macro
401
401
402 2 forms of calling:
402 2 forms of calling:
403
403
404 mac = _ip.defmacro('print "hello"\nprint "world"')
404 mac = _ip.defmacro('print "hello"\nprint "world"')
405
405
406 (doesn't put the created macro on user namespace)
406 (doesn't put the created macro on user namespace)
407
407
408 _ip.defmacro('build', 'bldmake bldfiles\nabld build winscw udeb')
408 _ip.defmacro('build', 'bldmake bldfiles\nabld build winscw udeb')
409
409
410 (creates a macro named 'build' in user namespace)
410 (creates a macro named 'build' in user namespace)
411 """
411 """
412
412
413 import IPython.macro
413 import IPython.macro
414
414
415 if len(args) == 1:
415 if len(args) == 1:
416 return IPython.macro.Macro(args[0])
416 return IPython.macro.Macro(args[0])
417 elif len(args) == 2:
417 elif len(args) == 2:
418 self.user_ns[args[0]] = IPython.macro.Macro(args[1])
418 self.user_ns[args[0]] = IPython.macro.Macro(args[1])
419 else:
419 else:
420 return Exception("_ip.defmacro must be called with 1 or 2 arguments")
420 return Exception("_ip.defmacro must be called with 1 or 2 arguments")
421
421
422 def set_next_input(self, s):
422 def set_next_input(self, s):
423 """ Sets the 'default' input string for the next command line.
423 """ Sets the 'default' input string for the next command line.
424
424
425 Requires readline.
425 Requires readline.
426
426
427 Example:
427 Example:
428
428
429 [D:\ipython]|1> _ip.set_next_input("Hello Word")
429 [D:\ipython]|1> _ip.set_next_input("Hello Word")
430 [D:\ipython]|2> Hello Word_ # cursor is here
430 [D:\ipython]|2> Hello Word_ # cursor is here
431 """
431 """
432
432
433 self.IP.rl_next_input = s
433 self.IP.rl_next_input = s
434
434
435 def load(self, mod):
435 def load(self, mod):
436 """ Load an extension.
436 """ Load an extension.
437
437
438 Some modules should (or must) be 'load()':ed, rather than just imported.
438 Some modules should (or must) be 'load()':ed, rather than just imported.
439
439
440 Loading will do:
440 Loading will do:
441
441
442 - run init_ipython(ip)
442 - run init_ipython(ip)
443 - run ipython_firstrun(ip)
443 - run ipython_firstrun(ip)
444
444
445 """
445 """
446 if mod in self.extensions:
446 if mod in self.extensions:
447 # just to make sure we don't init it twice
447 # just to make sure we don't init it twice
448 # note that if you 'load' a module that has already been
448 # note that if you 'load' a module that has already been
449 # imported, init_ipython gets run anyway
449 # imported, init_ipython gets run anyway
450
450
451 return self.extensions[mod]
451 return self.extensions[mod]
452 __import__(mod)
452 __import__(mod)
453 m = sys.modules[mod]
453 m = sys.modules[mod]
454 if hasattr(m,'init_ipython'):
454 if hasattr(m,'init_ipython'):
455 m.init_ipython(self)
455 m.init_ipython(self)
456
456
457 if hasattr(m,'ipython_firstrun'):
457 if hasattr(m,'ipython_firstrun'):
458 already_loaded = self.db.get('firstrun_done', set())
458 already_loaded = self.db.get('firstrun_done', set())
459 if mod not in already_loaded:
459 if mod not in already_loaded:
460 m.ipython_firstrun(self)
460 m.ipython_firstrun(self)
461 already_loaded.add(mod)
461 already_loaded.add(mod)
462 self.db['firstrun_done'] = already_loaded
462 self.db['firstrun_done'] = already_loaded
463
463
464 self.extensions[mod] = m
464 self.extensions[mod] = m
465 return m
465 return m
466
466
467
467
468 class DebugTools:
468 class DebugTools:
469 """ Used for debugging mishaps in api usage
469 """ Used for debugging mishaps in api usage
470
470
471 So far, tracing redefinitions is supported.
471 So far, tracing redefinitions is supported.
472 """
472 """
473
473
474 def __init__(self, ip):
474 def __init__(self, ip):
475 self.ip = ip
475 self.ip = ip
476 self.debugmode = False
476 self.debugmode = False
477 self.hotnames = set()
477 self.hotnames = set()
478
478
479
480 def hotname(self, name_to_catch):
479 def hotname(self, name_to_catch):
481 self.hotnames.add(name_to_catch)
480 self.hotnames.add(name_to_catch)
482
481
483 def debug_stack(self, msg = None):
482 def debug_stack(self, msg = None):
484 if not self.debugmode:
483 if not self.debugmode:
485 return
484 return
486
485
487 import traceback
486 import traceback
488 if msg is not None:
487 if msg is not None:
489 print '====== %s ========' % msg
488 print '====== %s ========' % msg
490 traceback.print_stack()
489 traceback.print_stack()
491
490
492 def check_hotname(self,name):
491 def check_hotname(self,name):
493 if name in self.hotnames:
492 if name in self.hotnames:
494 self.debug_stack( "HotName '%s' caught" % name)
493 self.debug_stack( "HotName '%s' caught" % name)
495
494
496 def launch_new_instance(user_ns = None):
495 def launch_new_instance(user_ns = None):
497 """ Make and start a new ipython instance.
496 """ Make and start a new ipython instance.
498
497
499 This can be called even without having an already initialized
498 This can be called even without having an already initialized
500 ipython session running.
499 ipython session running.
501
500
502 This is also used as the egg entry point for the 'ipython' script.
501 This is also used as the egg entry point for the 'ipython' script.
503
502
504 """
503 """
505 ses = make_session(user_ns)
504 ses = make_session(user_ns)
506 ses.mainloop()
505 ses.mainloop()
507
506
508
507
509 def make_user_ns(user_ns = None):
508 def make_user_ns(user_ns = None):
510 """Return a valid user interactive namespace.
509 """Return a valid user interactive namespace.
511
510
512 This builds a dict with the minimal information needed to operate as a
511 This builds a dict with the minimal information needed to operate as a
513 valid IPython user namespace, which you can pass to the various embedding
512 valid IPython user namespace, which you can pass to the various embedding
514 classes in ipython.
513 classes in ipython.
515 """
514 """
516
515
517 if user_ns is None:
516 if user_ns is None:
518 # Set __name__ to __main__ to better match the behavior of the
517 # Set __name__ to __main__ to better match the behavior of the
519 # normal interpreter.
518 # normal interpreter.
520 user_ns = {'__name__' :'__main__',
519 user_ns = {'__name__' :'__main__',
521 '__builtins__' : __builtin__,
520 '__builtins__' : __builtin__,
522 }
521 }
523 else:
522 else:
524 user_ns.setdefault('__name__','__main__')
523 user_ns.setdefault('__name__','__main__')
525 user_ns.setdefault('__builtins__',__builtin__)
524 user_ns.setdefault('__builtins__',__builtin__)
526
525
527 return user_ns
526 return user_ns
528
527
529
528
530 def make_user_global_ns(ns = None):
529 def make_user_global_ns(ns = None):
531 """Return a valid user global namespace.
530 """Return a valid user global namespace.
532
531
533 Similar to make_user_ns(), but global namespaces are really only needed in
532 Similar to make_user_ns(), but global namespaces are really only needed in
534 embedded applications, where there is a distinction between the user's
533 embedded applications, where there is a distinction between the user's
535 interactive namespace and the global one where ipython is running."""
534 interactive namespace and the global one where ipython is running."""
536
535
537 if ns is None: ns = {}
536 if ns is None: ns = {}
538 return ns
537 return ns
539
538
540
539
541 def make_session(user_ns = None):
540 def make_session(user_ns = None):
542 """Makes, but does not launch an IPython session.
541 """Makes, but does not launch an IPython session.
543
542
544 Later on you can call obj.mainloop() on the returned object.
543 Later on you can call obj.mainloop() on the returned object.
545
544
546 Inputs:
545 Inputs:
547
546
548 - user_ns(None): a dict to be used as the user's namespace with initial
547 - user_ns(None): a dict to be used as the user's namespace with initial
549 data.
548 data.
550
549
551 WARNING: This should *not* be run when a session exists already."""
550 WARNING: This should *not* be run when a session exists already."""
552
551
553 import IPython.Shell
552 import IPython.Shell
554 return IPython.Shell.start(user_ns)
553 return IPython.Shell.start(user_ns)
555
554
@@ -1,2519 +1,2522 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 2652 2007-08-22 17:25:24Z vivainio $
9 $Id: iplib.py 2674 2007-08-26 12:34:05Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
13 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
14 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
15 #
15 #
16 # Distributed under the terms of the BSD License. The full license is in
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
17 # the file COPYING, distributed as part of this software.
18 #
18 #
19 # Note: this code originally subclassed code.InteractiveConsole from the
19 # Note: this code originally subclassed code.InteractiveConsole from the
20 # Python standard library. Over time, all of that class has been copied
20 # Python standard library. Over time, all of that class has been copied
21 # verbatim here for modifications which could not be accomplished by
21 # verbatim here for modifications which could not be accomplished by
22 # subclassing. At this point, there are no dependencies at all on the code
22 # subclassing. At this point, there are no dependencies at all on the code
23 # module anymore (it is not even imported). The Python License (sec. 2)
23 # module anymore (it is not even imported). The Python License (sec. 2)
24 # allows for this, but it's always nice to acknowledge credit where credit is
24 # allows for this, but it's always nice to acknowledge credit where credit is
25 # due.
25 # due.
26 #*****************************************************************************
26 #*****************************************************************************
27
27
28 #****************************************************************************
28 #****************************************************************************
29 # Modules and globals
29 # Modules and globals
30
30
31 from IPython import Release
31 from IPython import Release
32 __author__ = '%s <%s>\n%s <%s>' % \
32 __author__ = '%s <%s>\n%s <%s>' % \
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
33 ( Release.authors['Janko'] + Release.authors['Fernando'] )
34 __license__ = Release.license
34 __license__ = Release.license
35 __version__ = Release.version
35 __version__ = Release.version
36
36
37 # Python standard modules
37 # Python standard modules
38 import __main__
38 import __main__
39 import __builtin__
39 import __builtin__
40 import StringIO
40 import StringIO
41 import bdb
41 import bdb
42 import cPickle as pickle
42 import cPickle as pickle
43 import codeop
43 import codeop
44 import doctest
44 import doctest
45 import exceptions
45 import exceptions
46 import glob
46 import glob
47 import inspect
47 import inspect
48 import keyword
48 import keyword
49 import new
49 import new
50 import os
50 import os
51 import pydoc
51 import pydoc
52 import re
52 import re
53 import shutil
53 import shutil
54 import string
54 import string
55 import sys
55 import sys
56 import tempfile
56 import tempfile
57 import traceback
57 import traceback
58 import types
58 import types
59 import pickleshare
59 import pickleshare
60 from sets import Set
60 from sets import Set
61 from pprint import pprint, pformat
61 from pprint import pprint, pformat
62
62
63 # IPython's own modules
63 # IPython's own modules
64 #import IPython
64 #import IPython
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
65 from IPython import Debugger,OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
69 from IPython.Logger import Logger
69 from IPython.Logger import Logger
70 from IPython.Magic import Magic
70 from IPython.Magic import Magic
71 from IPython.Prompts import CachedOutput
71 from IPython.Prompts import CachedOutput
72 from IPython.ipstruct import Struct
72 from IPython.ipstruct import Struct
73 from IPython.background_jobs import BackgroundJobManager
73 from IPython.background_jobs import BackgroundJobManager
74 from IPython.usage import cmd_line_usage,interactive_usage
74 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
75 from IPython.genutils import *
76 from IPython.strdispatch import StrDispatch
76 from IPython.strdispatch import StrDispatch
77 import IPython.ipapi
77 import IPython.ipapi
78 import IPython.history
78 import IPython.history
79 import IPython.prefilter as prefilter
79 import IPython.prefilter as prefilter
80 import IPython.shadowns
80 import IPython.shadowns
81 # Globals
81 # Globals
82
82
83 # store the builtin raw_input globally, and use this always, in case user code
83 # store the builtin raw_input globally, and use this always, in case user code
84 # overwrites it (like wx.py.PyShell does)
84 # overwrites it (like wx.py.PyShell does)
85 raw_input_original = raw_input
85 raw_input_original = raw_input
86
86
87 # compiled regexps for autoindent management
87 # compiled regexps for autoindent management
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
88 dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass')
89
89
90
90
91 #****************************************************************************
91 #****************************************************************************
92 # Some utility function definitions
92 # Some utility function definitions
93
93
94 ini_spaces_re = re.compile(r'^(\s+)')
94 ini_spaces_re = re.compile(r'^(\s+)')
95
95
96 def num_ini_spaces(strng):
96 def num_ini_spaces(strng):
97 """Return the number of initial spaces in a string"""
97 """Return the number of initial spaces in a string"""
98
98
99 ini_spaces = ini_spaces_re.match(strng)
99 ini_spaces = ini_spaces_re.match(strng)
100 if ini_spaces:
100 if ini_spaces:
101 return ini_spaces.end()
101 return ini_spaces.end()
102 else:
102 else:
103 return 0
103 return 0
104
104
105 def softspace(file, newvalue):
105 def softspace(file, newvalue):
106 """Copied from code.py, to remove the dependency"""
106 """Copied from code.py, to remove the dependency"""
107
107
108 oldvalue = 0
108 oldvalue = 0
109 try:
109 try:
110 oldvalue = file.softspace
110 oldvalue = file.softspace
111 except AttributeError:
111 except AttributeError:
112 pass
112 pass
113 try:
113 try:
114 file.softspace = newvalue
114 file.softspace = newvalue
115 except (AttributeError, TypeError):
115 except (AttributeError, TypeError):
116 # "attribute-less object" or "read-only attributes"
116 # "attribute-less object" or "read-only attributes"
117 pass
117 pass
118 return oldvalue
118 return oldvalue
119
119
120
120
121 #****************************************************************************
121 #****************************************************************************
122 # Local use exceptions
122 # Local use exceptions
123 class SpaceInInput(exceptions.Exception): pass
123 class SpaceInInput(exceptions.Exception): pass
124
124
125
125
126 #****************************************************************************
126 #****************************************************************************
127 # Local use classes
127 # Local use classes
128 class Bunch: pass
128 class Bunch: pass
129
129
130 class Undefined: pass
130 class Undefined: pass
131
131
132 class Quitter(object):
132 class Quitter(object):
133 """Simple class to handle exit, similar to Python 2.5's.
133 """Simple class to handle exit, similar to Python 2.5's.
134
134
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
135 It handles exiting in an ipython-safe manner, which the one in Python 2.5
136 doesn't do (obviously, since it doesn't know about ipython)."""
136 doesn't do (obviously, since it doesn't know about ipython)."""
137
137
138 def __init__(self,shell,name):
138 def __init__(self,shell,name):
139 self.shell = shell
139 self.shell = shell
140 self.name = name
140 self.name = name
141
141
142 def __repr__(self):
142 def __repr__(self):
143 return 'Type %s() to exit.' % self.name
143 return 'Type %s() to exit.' % self.name
144 __str__ = __repr__
144 __str__ = __repr__
145
145
146 def __call__(self):
146 def __call__(self):
147 self.shell.exit()
147 self.shell.exit()
148
148
149 class InputList(list):
149 class InputList(list):
150 """Class to store user input.
150 """Class to store user input.
151
151
152 It's basically a list, but slices return a string instead of a list, thus
152 It's basically a list, but slices return a string instead of a list, thus
153 allowing things like (assuming 'In' is an instance):
153 allowing things like (assuming 'In' is an instance):
154
154
155 exec In[4:7]
155 exec In[4:7]
156
156
157 or
157 or
158
158
159 exec In[5:9] + In[14] + In[21:25]"""
159 exec In[5:9] + In[14] + In[21:25]"""
160
160
161 def __getslice__(self,i,j):
161 def __getslice__(self,i,j):
162 return ''.join(list.__getslice__(self,i,j))
162 return ''.join(list.__getslice__(self,i,j))
163
163
164 class SyntaxTB(ultraTB.ListTB):
164 class SyntaxTB(ultraTB.ListTB):
165 """Extension which holds some state: the last exception value"""
165 """Extension which holds some state: the last exception value"""
166
166
167 def __init__(self,color_scheme = 'NoColor'):
167 def __init__(self,color_scheme = 'NoColor'):
168 ultraTB.ListTB.__init__(self,color_scheme)
168 ultraTB.ListTB.__init__(self,color_scheme)
169 self.last_syntax_error = None
169 self.last_syntax_error = None
170
170
171 def __call__(self, etype, value, elist):
171 def __call__(self, etype, value, elist):
172 self.last_syntax_error = value
172 self.last_syntax_error = value
173 ultraTB.ListTB.__call__(self,etype,value,elist)
173 ultraTB.ListTB.__call__(self,etype,value,elist)
174
174
175 def clear_err_state(self):
175 def clear_err_state(self):
176 """Return the current error state and clear it"""
176 """Return the current error state and clear it"""
177 e = self.last_syntax_error
177 e = self.last_syntax_error
178 self.last_syntax_error = None
178 self.last_syntax_error = None
179 return e
179 return e
180
180
181 #****************************************************************************
181 #****************************************************************************
182 # Main IPython class
182 # Main IPython class
183
183
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
184 # FIXME: the Magic class is a mixin for now, and will unfortunately remain so
185 # until a full rewrite is made. I've cleaned all cross-class uses of
185 # until a full rewrite is made. I've cleaned all cross-class uses of
186 # attributes and methods, but too much user code out there relies on the
186 # attributes and methods, but too much user code out there relies on the
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
187 # equlity %foo == __IP.magic_foo, so I can't actually remove the mixin usage.
188 #
188 #
189 # But at least now, all the pieces have been separated and we could, in
189 # But at least now, all the pieces have been separated and we could, in
190 # principle, stop using the mixin. This will ease the transition to the
190 # principle, stop using the mixin. This will ease the transition to the
191 # chainsaw branch.
191 # chainsaw branch.
192
192
193 # For reference, the following is the list of 'self.foo' uses in the Magic
193 # For reference, the following is the list of 'self.foo' uses in the Magic
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
194 # class as of 2005-12-28. These are names we CAN'T use in the main ipython
195 # class, to prevent clashes.
195 # class, to prevent clashes.
196
196
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
197 # ['self.__class__', 'self.__dict__', 'self._inspect', 'self._ofind',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
198 # 'self.arg_err', 'self.extract_input', 'self.format_', 'self.lsmagic',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
199 # 'self.magic_', 'self.options_table', 'self.parse', 'self.shell',
200 # 'self.value']
200 # 'self.value']
201
201
202 class InteractiveShell(object,Magic):
202 class InteractiveShell(object,Magic):
203 """An enhanced console for Python."""
203 """An enhanced console for Python."""
204
204
205 # class attribute to indicate whether the class supports threads or not.
205 # class attribute to indicate whether the class supports threads or not.
206 # Subclasses with thread support should override this as needed.
206 # Subclasses with thread support should override this as needed.
207 isthreaded = False
207 isthreaded = False
208
208
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
209 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
210 user_ns = None,user_global_ns=None,banner2='',
210 user_ns = None,user_global_ns=None,banner2='',
211 custom_exceptions=((),None),embedded=False):
211 custom_exceptions=((),None),embedded=False):
212
212
213 # log system
213 # log system
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
214 self.logger = Logger(self,logfname='ipython_log.py',logmode='rotate')
215
215
216 # some minimal strict typechecks. For some core data structures, I
216 # some minimal strict typechecks. For some core data structures, I
217 # want actual basic python types, not just anything that looks like
217 # want actual basic python types, not just anything that looks like
218 # one. This is especially true for namespaces.
218 # one. This is especially true for namespaces.
219 for ns in (user_ns,user_global_ns):
219 for ns in (user_ns,user_global_ns):
220 if ns is not None and type(ns) != types.DictType:
220 if ns is not None and type(ns) != types.DictType:
221 raise TypeError,'namespace must be a dictionary'
221 raise TypeError,'namespace must be a dictionary'
222
222
223 # Job manager (for jobs run as background threads)
223 # Job manager (for jobs run as background threads)
224 self.jobs = BackgroundJobManager()
224 self.jobs = BackgroundJobManager()
225
225
226 # Store the actual shell's name
226 # Store the actual shell's name
227 self.name = name
227 self.name = name
228
228
229 # We need to know whether the instance is meant for embedding, since
229 # We need to know whether the instance is meant for embedding, since
230 # global/local namespaces need to be handled differently in that case
230 # global/local namespaces need to be handled differently in that case
231 self.embedded = embedded
231 self.embedded = embedded
232 if embedded:
232 if embedded:
233 # Control variable so users can, from within the embedded instance,
233 # Control variable so users can, from within the embedded instance,
234 # permanently deactivate it.
234 # permanently deactivate it.
235 self.embedded_active = True
235 self.embedded_active = True
236
236
237 # command compiler
237 # command compiler
238 self.compile = codeop.CommandCompiler()
238 self.compile = codeop.CommandCompiler()
239
239
240 # User input buffer
240 # User input buffer
241 self.buffer = []
241 self.buffer = []
242
242
243 # Default name given in compilation of code
243 # Default name given in compilation of code
244 self.filename = '<ipython console>'
244 self.filename = '<ipython console>'
245
245
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
246 # Install our own quitter instead of the builtins. For python2.3-2.4,
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
247 # this brings in behavior like 2.5, and for 2.5 it's identical.
248 __builtin__.exit = Quitter(self,'exit')
248 __builtin__.exit = Quitter(self,'exit')
249 __builtin__.quit = Quitter(self,'quit')
249 __builtin__.quit = Quitter(self,'quit')
250
250
251 # Make an empty namespace, which extension writers can rely on both
251 # Make an empty namespace, which extension writers can rely on both
252 # existing and NEVER being used by ipython itself. This gives them a
252 # existing and NEVER being used by ipython itself. This gives them a
253 # convenient location for storing additional information and state
253 # convenient location for storing additional information and state
254 # their extensions may require, without fear of collisions with other
254 # their extensions may require, without fear of collisions with other
255 # ipython names that may develop later.
255 # ipython names that may develop later.
256 self.meta = Struct()
256 self.meta = Struct()
257
257
258 # Create the namespace where the user will operate. user_ns is
258 # Create the namespace where the user will operate. user_ns is
259 # normally the only one used, and it is passed to the exec calls as
259 # normally the only one used, and it is passed to the exec calls as
260 # the locals argument. But we do carry a user_global_ns namespace
260 # the locals argument. But we do carry a user_global_ns namespace
261 # given as the exec 'globals' argument, This is useful in embedding
261 # given as the exec 'globals' argument, This is useful in embedding
262 # situations where the ipython shell opens in a context where the
262 # situations where the ipython shell opens in a context where the
263 # distinction between locals and globals is meaningful.
263 # distinction between locals and globals is meaningful.
264
264
265 # FIXME. For some strange reason, __builtins__ is showing up at user
265 # FIXME. For some strange reason, __builtins__ is showing up at user
266 # level as a dict instead of a module. This is a manual fix, but I
266 # level as a dict instead of a module. This is a manual fix, but I
267 # should really track down where the problem is coming from. Alex
267 # should really track down where the problem is coming from. Alex
268 # Schmolck reported this problem first.
268 # Schmolck reported this problem first.
269
269
270 # A useful post by Alex Martelli on this topic:
270 # A useful post by Alex Martelli on this topic:
271 # Re: inconsistent value from __builtins__
271 # Re: inconsistent value from __builtins__
272 # Von: Alex Martelli <aleaxit@yahoo.com>
272 # Von: Alex Martelli <aleaxit@yahoo.com>
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
273 # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends
274 # Gruppen: comp.lang.python
274 # Gruppen: comp.lang.python
275
275
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
276 # Michael Hohn <hohn@hooknose.lbl.gov> wrote:
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
277 # > >>> print type(builtin_check.get_global_binding('__builtins__'))
278 # > <type 'dict'>
278 # > <type 'dict'>
279 # > >>> print type(__builtins__)
279 # > >>> print type(__builtins__)
280 # > <type 'module'>
280 # > <type 'module'>
281 # > Is this difference in return value intentional?
281 # > Is this difference in return value intentional?
282
282
283 # Well, it's documented that '__builtins__' can be either a dictionary
283 # Well, it's documented that '__builtins__' can be either a dictionary
284 # or a module, and it's been that way for a long time. Whether it's
284 # or a module, and it's been that way for a long time. Whether it's
285 # intentional (or sensible), I don't know. In any case, the idea is
285 # intentional (or sensible), I don't know. In any case, the idea is
286 # that if you need to access the built-in namespace directly, you
286 # that if you need to access the built-in namespace directly, you
287 # should start with "import __builtin__" (note, no 's') which will
287 # should start with "import __builtin__" (note, no 's') which will
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
288 # definitely give you a module. Yeah, it's somewhat confusing:-(.
289
289
290 # These routines return properly built dicts as needed by the rest of
290 # These routines return properly built dicts as needed by the rest of
291 # the code, and can also be used by extension writers to generate
291 # the code, and can also be used by extension writers to generate
292 # properly initialized namespaces.
292 # properly initialized namespaces.
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
293 user_ns = IPython.ipapi.make_user_ns(user_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
294 user_global_ns = IPython.ipapi.make_user_global_ns(user_global_ns)
295
295
296 # Assign namespaces
296 # Assign namespaces
297 # This is the namespace where all normal user variables live
297 # This is the namespace where all normal user variables live
298 self.user_ns = user_ns
298 self.user_ns = user_ns
299 # Embedded instances require a separate namespace for globals.
299 # Embedded instances require a separate namespace for globals.
300 # Normally this one is unused by non-embedded instances.
300 # Normally this one is unused by non-embedded instances.
301 self.user_global_ns = user_global_ns
301 self.user_global_ns = user_global_ns
302 # A namespace to keep track of internal data structures to prevent
302 # A namespace to keep track of internal data structures to prevent
303 # them from cluttering user-visible stuff. Will be updated later
303 # them from cluttering user-visible stuff. Will be updated later
304 self.internal_ns = {}
304 self.internal_ns = {}
305
305
306 # Namespace of system aliases. Each entry in the alias
306 # Namespace of system aliases. Each entry in the alias
307 # table must be a 2-tuple of the form (N,name), where N is the number
307 # table must be a 2-tuple of the form (N,name), where N is the number
308 # of positional arguments of the alias.
308 # of positional arguments of the alias.
309 self.alias_table = {}
309 self.alias_table = {}
310
310
311 # A table holding all the namespaces IPython deals with, so that
311 # A table holding all the namespaces IPython deals with, so that
312 # introspection facilities can search easily.
312 # introspection facilities can search easily.
313 self.ns_table = {'user':user_ns,
313 self.ns_table = {'user':user_ns,
314 'user_global':user_global_ns,
314 'user_global':user_global_ns,
315 'alias':self.alias_table,
315 'alias':self.alias_table,
316 'internal':self.internal_ns,
316 'internal':self.internal_ns,
317 'builtin':__builtin__.__dict__
317 'builtin':__builtin__.__dict__
318 }
318 }
319
319
320 # The user namespace MUST have a pointer to the shell itself.
320 # The user namespace MUST have a pointer to the shell itself.
321 self.user_ns[name] = self
321 self.user_ns[name] = self
322
322
323 # We need to insert into sys.modules something that looks like a
323 # We need to insert into sys.modules something that looks like a
324 # module but which accesses the IPython namespace, for shelve and
324 # module but which accesses the IPython namespace, for shelve and
325 # pickle to work interactively. Normally they rely on getting
325 # pickle to work interactively. Normally they rely on getting
326 # everything out of __main__, but for embedding purposes each IPython
326 # everything out of __main__, but for embedding purposes each IPython
327 # instance has its own private namespace, so we can't go shoving
327 # instance has its own private namespace, so we can't go shoving
328 # everything into __main__.
328 # everything into __main__.
329
329
330 # note, however, that we should only do this for non-embedded
330 # note, however, that we should only do this for non-embedded
331 # ipythons, which really mimic the __main__.__dict__ with their own
331 # ipythons, which really mimic the __main__.__dict__ with their own
332 # namespace. Embedded instances, on the other hand, should not do
332 # namespace. Embedded instances, on the other hand, should not do
333 # this because they need to manage the user local/global namespaces
333 # this because they need to manage the user local/global namespaces
334 # only, but they live within a 'normal' __main__ (meaning, they
334 # only, but they live within a 'normal' __main__ (meaning, they
335 # shouldn't overtake the execution environment of the script they're
335 # shouldn't overtake the execution environment of the script they're
336 # embedded in).
336 # embedded in).
337
337
338 if not embedded:
338 if not embedded:
339 try:
339 try:
340 main_name = self.user_ns['__name__']
340 main_name = self.user_ns['__name__']
341 except KeyError:
341 except KeyError:
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
342 raise KeyError,'user_ns dictionary MUST have a "__name__" key'
343 else:
343 else:
344 #print "pickle hack in place" # dbg
344 #print "pickle hack in place" # dbg
345 #print 'main_name:',main_name # dbg
345 #print 'main_name:',main_name # dbg
346 sys.modules[main_name] = FakeModule(self.user_ns)
346 sys.modules[main_name] = FakeModule(self.user_ns)
347
347
348 # List of input with multi-line handling.
348 # List of input with multi-line handling.
349 # Fill its zero entry, user counter starts at 1
349 # Fill its zero entry, user counter starts at 1
350 self.input_hist = InputList(['\n'])
350 self.input_hist = InputList(['\n'])
351 # This one will hold the 'raw' input history, without any
351 # This one will hold the 'raw' input history, without any
352 # pre-processing. This will allow users to retrieve the input just as
352 # pre-processing. This will allow users to retrieve the input just as
353 # it was exactly typed in by the user, with %hist -r.
353 # it was exactly typed in by the user, with %hist -r.
354 self.input_hist_raw = InputList(['\n'])
354 self.input_hist_raw = InputList(['\n'])
355
355
356 # list of visited directories
356 # list of visited directories
357 try:
357 try:
358 self.dir_hist = [os.getcwd()]
358 self.dir_hist = [os.getcwd()]
359 except OSError:
359 except OSError:
360 self.dir_hist = []
360 self.dir_hist = []
361
361
362 # dict of output history
362 # dict of output history
363 self.output_hist = {}
363 self.output_hist = {}
364
364
365 # Get system encoding at startup time. Certain terminals (like Emacs
365 # Get system encoding at startup time. Certain terminals (like Emacs
366 # under Win32 have it set to None, and we need to have a known valid
366 # under Win32 have it set to None, and we need to have a known valid
367 # encoding to use in the raw_input() method
367 # encoding to use in the raw_input() method
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
368 self.stdin_encoding = sys.stdin.encoding or 'ascii'
369
369
370 # dict of things NOT to alias (keywords, builtins and some magics)
370 # dict of things NOT to alias (keywords, builtins and some magics)
371 no_alias = {}
371 no_alias = {}
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
372 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
373 for key in keyword.kwlist + no_alias_magics:
373 for key in keyword.kwlist + no_alias_magics:
374 no_alias[key] = 1
374 no_alias[key] = 1
375 no_alias.update(__builtin__.__dict__)
375 no_alias.update(__builtin__.__dict__)
376 self.no_alias = no_alias
376 self.no_alias = no_alias
377
377
378 # make global variables for user access to these
378 # make global variables for user access to these
379 self.user_ns['_ih'] = self.input_hist
379 self.user_ns['_ih'] = self.input_hist
380 self.user_ns['_oh'] = self.output_hist
380 self.user_ns['_oh'] = self.output_hist
381 self.user_ns['_dh'] = self.dir_hist
381 self.user_ns['_dh'] = self.dir_hist
382
382
383 # user aliases to input and output histories
383 # user aliases to input and output histories
384 self.user_ns['In'] = self.input_hist
384 self.user_ns['In'] = self.input_hist
385 self.user_ns['Out'] = self.output_hist
385 self.user_ns['Out'] = self.output_hist
386
386
387 self.user_ns['_sh'] = IPython.shadowns
387 self.user_ns['_sh'] = IPython.shadowns
388 # Object variable to store code object waiting execution. This is
388 # Object variable to store code object waiting execution. This is
389 # used mainly by the multithreaded shells, but it can come in handy in
389 # used mainly by the multithreaded shells, but it can come in handy in
390 # other situations. No need to use a Queue here, since it's a single
390 # other situations. No need to use a Queue here, since it's a single
391 # item which gets cleared once run.
391 # item which gets cleared once run.
392 self.code_to_run = None
392 self.code_to_run = None
393
393
394 # escapes for automatic behavior on the command line
394 # escapes for automatic behavior on the command line
395 self.ESC_SHELL = '!'
395 self.ESC_SHELL = '!'
396 self.ESC_SH_CAP = '!!'
396 self.ESC_SH_CAP = '!!'
397 self.ESC_HELP = '?'
397 self.ESC_HELP = '?'
398 self.ESC_MAGIC = '%'
398 self.ESC_MAGIC = '%'
399 self.ESC_QUOTE = ','
399 self.ESC_QUOTE = ','
400 self.ESC_QUOTE2 = ';'
400 self.ESC_QUOTE2 = ';'
401 self.ESC_PAREN = '/'
401 self.ESC_PAREN = '/'
402
402
403 # And their associated handlers
403 # And their associated handlers
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
404 self.esc_handlers = {self.ESC_PAREN : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
405 self.ESC_QUOTE : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
406 self.ESC_QUOTE2 : self.handle_auto,
407 self.ESC_MAGIC : self.handle_magic,
407 self.ESC_MAGIC : self.handle_magic,
408 self.ESC_HELP : self.handle_help,
408 self.ESC_HELP : self.handle_help,
409 self.ESC_SHELL : self.handle_shell_escape,
409 self.ESC_SHELL : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
410 self.ESC_SH_CAP : self.handle_shell_escape,
411 }
411 }
412
412
413 # class initializations
413 # class initializations
414 Magic.__init__(self,self)
414 Magic.__init__(self,self)
415
415
416 # Python source parser/formatter for syntax highlighting
416 # Python source parser/formatter for syntax highlighting
417 pyformat = PyColorize.Parser().format
417 pyformat = PyColorize.Parser().format
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
418 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
419
419
420 # hooks holds pointers used for user-side customizations
420 # hooks holds pointers used for user-side customizations
421 self.hooks = Struct()
421 self.hooks = Struct()
422
422
423 self.strdispatchers = {}
423 self.strdispatchers = {}
424
424
425 # Set all default hooks, defined in the IPython.hooks module.
425 # Set all default hooks, defined in the IPython.hooks module.
426 hooks = IPython.hooks
426 hooks = IPython.hooks
427 for hook_name in hooks.__all__:
427 for hook_name in hooks.__all__:
428 # default hooks have priority 100, i.e. low; user hooks should have
428 # default hooks have priority 100, i.e. low; user hooks should have
429 # 0-100 priority
429 # 0-100 priority
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
430 self.set_hook(hook_name,getattr(hooks,hook_name), 100)
431 #print "bound hook",hook_name
431 #print "bound hook",hook_name
432
432
433 # Flag to mark unconditional exit
433 # Flag to mark unconditional exit
434 self.exit_now = False
434 self.exit_now = False
435
435
436 self.usage_min = """\
436 self.usage_min = """\
437 An enhanced console for Python.
437 An enhanced console for Python.
438 Some of its features are:
438 Some of its features are:
439 - Readline support if the readline library is present.
439 - Readline support if the readline library is present.
440 - Tab completion in the local namespace.
440 - Tab completion in the local namespace.
441 - Logging of input, see command-line options.
441 - Logging of input, see command-line options.
442 - System shell escape via ! , eg !ls.
442 - System shell escape via ! , eg !ls.
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
443 - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.)
444 - Keeps track of locally defined variables via %who, %whos.
444 - Keeps track of locally defined variables via %who, %whos.
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
445 - Show object information with a ? eg ?x or x? (use ?? for more info).
446 """
446 """
447 if usage: self.usage = usage
447 if usage: self.usage = usage
448 else: self.usage = self.usage_min
448 else: self.usage = self.usage_min
449
449
450 # Storage
450 # Storage
451 self.rc = rc # This will hold all configuration information
451 self.rc = rc # This will hold all configuration information
452 self.pager = 'less'
452 self.pager = 'less'
453 # temporary files used for various purposes. Deleted at exit.
453 # temporary files used for various purposes. Deleted at exit.
454 self.tempfiles = []
454 self.tempfiles = []
455
455
456 # Keep track of readline usage (later set by init_readline)
456 # Keep track of readline usage (later set by init_readline)
457 self.has_readline = False
457 self.has_readline = False
458
458
459 # template for logfile headers. It gets resolved at runtime by the
459 # template for logfile headers. It gets resolved at runtime by the
460 # logstart method.
460 # logstart method.
461 self.loghead_tpl = \
461 self.loghead_tpl = \
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
462 """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE ***
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
463 #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW
464 #log# opts = %s
464 #log# opts = %s
465 #log# args = %s
465 #log# args = %s
466 #log# It is safe to make manual edits below here.
466 #log# It is safe to make manual edits below here.
467 #log#-----------------------------------------------------------------------
467 #log#-----------------------------------------------------------------------
468 """
468 """
469 # for pushd/popd management
469 # for pushd/popd management
470 try:
470 try:
471 self.home_dir = get_home_dir()
471 self.home_dir = get_home_dir()
472 except HomeDirError,msg:
472 except HomeDirError,msg:
473 fatal(msg)
473 fatal(msg)
474
474
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
475 self.dir_stack = [os.getcwd().replace(self.home_dir,'~')]
476
476
477 # Functions to call the underlying shell.
477 # Functions to call the underlying shell.
478
478
479 # The first is similar to os.system, but it doesn't return a value,
479 # The first is similar to os.system, but it doesn't return a value,
480 # and it allows interpolation of variables in the user's namespace.
480 # and it allows interpolation of variables in the user's namespace.
481 self.system = lambda cmd: \
481 self.system = lambda cmd: \
482 shell(self.var_expand(cmd,depth=2),
482 shell(self.var_expand(cmd,depth=2),
483 header=self.rc.system_header,
483 header=self.rc.system_header,
484 verbose=self.rc.system_verbose)
484 verbose=self.rc.system_verbose)
485
485
486 # These are for getoutput and getoutputerror:
486 # These are for getoutput and getoutputerror:
487 self.getoutput = lambda cmd: \
487 self.getoutput = lambda cmd: \
488 getoutput(self.var_expand(cmd,depth=2),
488 getoutput(self.var_expand(cmd,depth=2),
489 header=self.rc.system_header,
489 header=self.rc.system_header,
490 verbose=self.rc.system_verbose)
490 verbose=self.rc.system_verbose)
491
491
492 self.getoutputerror = lambda cmd: \
492 self.getoutputerror = lambda cmd: \
493 getoutputerror(self.var_expand(cmd,depth=2),
493 getoutputerror(self.var_expand(cmd,depth=2),
494 header=self.rc.system_header,
494 header=self.rc.system_header,
495 verbose=self.rc.system_verbose)
495 verbose=self.rc.system_verbose)
496
496
497
497
498 # keep track of where we started running (mainly for crash post-mortem)
498 # keep track of where we started running (mainly for crash post-mortem)
499 self.starting_dir = os.getcwd()
499 self.starting_dir = os.getcwd()
500
500
501 # Various switches which can be set
501 # Various switches which can be set
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
502 self.CACHELENGTH = 5000 # this is cheap, it's just text
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
503 self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__
504 self.banner2 = banner2
504 self.banner2 = banner2
505
505
506 # TraceBack handlers:
506 # TraceBack handlers:
507
507
508 # Syntax error handler.
508 # Syntax error handler.
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
509 self.SyntaxTB = SyntaxTB(color_scheme='NoColor')
510
510
511 # The interactive one is initialized with an offset, meaning we always
511 # The interactive one is initialized with an offset, meaning we always
512 # want to remove the topmost item in the traceback, which is our own
512 # want to remove the topmost item in the traceback, which is our own
513 # internal code. Valid modes: ['Plain','Context','Verbose']
513 # internal code. Valid modes: ['Plain','Context','Verbose']
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
514 self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain',
515 color_scheme='NoColor',
515 color_scheme='NoColor',
516 tb_offset = 1)
516 tb_offset = 1)
517
517
518 # IPython itself shouldn't crash. This will produce a detailed
518 # IPython itself shouldn't crash. This will produce a detailed
519 # post-mortem if it does. But we only install the crash handler for
519 # post-mortem if it does. But we only install the crash handler for
520 # non-threaded shells, the threaded ones use a normal verbose reporter
520 # non-threaded shells, the threaded ones use a normal verbose reporter
521 # and lose the crash handler. This is because exceptions in the main
521 # and lose the crash handler. This is because exceptions in the main
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
522 # thread (such as in GUI code) propagate directly to sys.excepthook,
523 # and there's no point in printing crash dumps for every user exception.
523 # and there's no point in printing crash dumps for every user exception.
524 if self.isthreaded:
524 if self.isthreaded:
525 ipCrashHandler = ultraTB.FormattedTB()
525 ipCrashHandler = ultraTB.FormattedTB()
526 else:
526 else:
527 from IPython import CrashHandler
527 from IPython import CrashHandler
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
528 ipCrashHandler = CrashHandler.IPythonCrashHandler(self)
529 self.set_crash_handler(ipCrashHandler)
529 self.set_crash_handler(ipCrashHandler)
530
530
531 # and add any custom exception handlers the user may have specified
531 # and add any custom exception handlers the user may have specified
532 self.set_custom_exc(*custom_exceptions)
532 self.set_custom_exc(*custom_exceptions)
533
533
534 # indentation management
534 # indentation management
535 self.autoindent = False
535 self.autoindent = False
536 self.indent_current_nsp = 0
536 self.indent_current_nsp = 0
537
537
538 # Make some aliases automatically
538 # Make some aliases automatically
539 # Prepare list of shell aliases to auto-define
539 # Prepare list of shell aliases to auto-define
540 if os.name == 'posix':
540 if os.name == 'posix':
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
541 auto_alias = ('mkdir mkdir', 'rmdir rmdir',
542 'mv mv -i','rm rm -i','cp cp -i',
542 'mv mv -i','rm rm -i','cp cp -i',
543 'cat cat','less less','clear clear',
543 'cat cat','less less','clear clear',
544 # a better ls
544 # a better ls
545 'ls ls -F',
545 'ls ls -F',
546 # long ls
546 # long ls
547 'll ls -lF')
547 'll ls -lF')
548 # Extra ls aliases with color, which need special treatment on BSD
548 # Extra ls aliases with color, which need special treatment on BSD
549 # variants
549 # variants
550 ls_extra = ( # color ls
550 ls_extra = ( # color ls
551 'lc ls -F -o --color',
551 'lc ls -F -o --color',
552 # ls normal files only
552 # ls normal files only
553 'lf ls -F -o --color %l | grep ^-',
553 'lf ls -F -o --color %l | grep ^-',
554 # ls symbolic links
554 # ls symbolic links
555 'lk ls -F -o --color %l | grep ^l',
555 'lk ls -F -o --color %l | grep ^l',
556 # directories or links to directories,
556 # directories or links to directories,
557 'ldir ls -F -o --color %l | grep /$',
557 'ldir ls -F -o --color %l | grep /$',
558 # things which are executable
558 # things which are executable
559 'lx ls -F -o --color %l | grep ^-..x',
559 'lx ls -F -o --color %l | grep ^-..x',
560 )
560 )
561 # The BSDs don't ship GNU ls, so they don't understand the
561 # The BSDs don't ship GNU ls, so they don't understand the
562 # --color switch out of the box
562 # --color switch out of the box
563 if 'bsd' in sys.platform:
563 if 'bsd' in sys.platform:
564 ls_extra = ( # ls normal files only
564 ls_extra = ( # ls normal files only
565 'lf ls -lF | grep ^-',
565 'lf ls -lF | grep ^-',
566 # ls symbolic links
566 # ls symbolic links
567 'lk ls -lF | grep ^l',
567 'lk ls -lF | grep ^l',
568 # directories or links to directories,
568 # directories or links to directories,
569 'ldir ls -lF | grep /$',
569 'ldir ls -lF | grep /$',
570 # things which are executable
570 # things which are executable
571 'lx ls -lF | grep ^-..x',
571 'lx ls -lF | grep ^-..x',
572 )
572 )
573 auto_alias = auto_alias + ls_extra
573 auto_alias = auto_alias + ls_extra
574 elif os.name in ['nt','dos']:
574 elif os.name in ['nt','dos']:
575 auto_alias = ('dir dir /on', 'ls dir /on',
575 auto_alias = ('dir dir /on', 'ls dir /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
576 'ddir dir /ad /on', 'ldir dir /ad /on',
577 'mkdir mkdir','rmdir rmdir','echo echo',
577 'mkdir mkdir','rmdir rmdir','echo echo',
578 'ren ren','cls cls','copy copy')
578 'ren ren','cls cls','copy copy')
579 else:
579 else:
580 auto_alias = ()
580 auto_alias = ()
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
581 self.auto_alias = [s.split(None,1) for s in auto_alias]
582
582
583 # Produce a public API instance
583 # Produce a public API instance
584 self.api = IPython.ipapi.IPApi(self)
584 self.api = IPython.ipapi.IPApi(self)
585
585
586 # Call the actual (public) initializer
586 # Call the actual (public) initializer
587 self.init_auto_alias()
587 self.init_auto_alias()
588
588
589 # track which builtins we add, so we can clean up later
589 # track which builtins we add, so we can clean up later
590 self.builtins_added = {}
590 self.builtins_added = {}
591 # This method will add the necessary builtins for operation, but
591 # This method will add the necessary builtins for operation, but
592 # tracking what it did via the builtins_added dict.
592 # tracking what it did via the builtins_added dict.
593 self.add_builtins()
593 self.add_builtins()
594
594
595 # end __init__
595 # end __init__
596
596
597 def var_expand(self,cmd,depth=0):
597 def var_expand(self,cmd,depth=0):
598 """Expand python variables in a string.
598 """Expand python variables in a string.
599
599
600 The depth argument indicates how many frames above the caller should
600 The depth argument indicates how many frames above the caller should
601 be walked to look for the local namespace where to expand variables.
601 be walked to look for the local namespace where to expand variables.
602
602
603 The global namespace for expansion is always the user's interactive
603 The global namespace for expansion is always the user's interactive
604 namespace.
604 namespace.
605 """
605 """
606
606
607 return str(ItplNS(cmd.replace('#','\#'),
607 return str(ItplNS(cmd.replace('#','\#'),
608 self.user_ns, # globals
608 self.user_ns, # globals
609 # Skip our own frame in searching for locals:
609 # Skip our own frame in searching for locals:
610 sys._getframe(depth+1).f_locals # locals
610 sys._getframe(depth+1).f_locals # locals
611 ))
611 ))
612
612
613 def pre_config_initialization(self):
613 def pre_config_initialization(self):
614 """Pre-configuration init method
614 """Pre-configuration init method
615
615
616 This is called before the configuration files are processed to
616 This is called before the configuration files are processed to
617 prepare the services the config files might need.
617 prepare the services the config files might need.
618
618
619 self.rc already has reasonable default values at this point.
619 self.rc already has reasonable default values at this point.
620 """
620 """
621 rc = self.rc
621 rc = self.rc
622 try:
622 try:
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
623 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db")
624 except exceptions.UnicodeDecodeError:
624 except exceptions.UnicodeDecodeError:
625 print "Your ipythondir can't be decoded to unicode!"
625 print "Your ipythondir can't be decoded to unicode!"
626 print "Please set HOME environment variable to something that"
626 print "Please set HOME environment variable to something that"
627 print r"only has ASCII characters, e.g. c:\home"
627 print r"only has ASCII characters, e.g. c:\home"
628 print "Now it is",rc.ipythondir
628 print "Now it is",rc.ipythondir
629 sys.exit()
629 sys.exit()
630 self.shadowhist = IPython.history.ShadowHist(self.db)
630 self.shadowhist = IPython.history.ShadowHist(self.db)
631
631
632
632
633 def post_config_initialization(self):
633 def post_config_initialization(self):
634 """Post configuration init method
634 """Post configuration init method
635
635
636 This is called after the configuration files have been processed to
636 This is called after the configuration files have been processed to
637 'finalize' the initialization."""
637 'finalize' the initialization."""
638
638
639 rc = self.rc
639 rc = self.rc
640
640
641 # Object inspector
641 # Object inspector
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
642 self.inspector = OInspect.Inspector(OInspect.InspectColors,
643 PyColorize.ANSICodeColors,
643 PyColorize.ANSICodeColors,
644 'NoColor',
644 'NoColor',
645 rc.object_info_string_level)
645 rc.object_info_string_level)
646
646
647 self.rl_next_input = None
647 self.rl_next_input = None
648 self.rl_do_indent = False
648 self.rl_do_indent = False
649 # Load readline proper
649 # Load readline proper
650 if rc.readline:
650 if rc.readline:
651 self.init_readline()
651 self.init_readline()
652
652
653
653
654 # local shortcut, this is used a LOT
654 # local shortcut, this is used a LOT
655 self.log = self.logger.log
655 self.log = self.logger.log
656
656
657 # Initialize cache, set in/out prompts and printing system
657 # Initialize cache, set in/out prompts and printing system
658 self.outputcache = CachedOutput(self,
658 self.outputcache = CachedOutput(self,
659 rc.cache_size,
659 rc.cache_size,
660 rc.pprint,
660 rc.pprint,
661 input_sep = rc.separate_in,
661 input_sep = rc.separate_in,
662 output_sep = rc.separate_out,
662 output_sep = rc.separate_out,
663 output_sep2 = rc.separate_out2,
663 output_sep2 = rc.separate_out2,
664 ps1 = rc.prompt_in1,
664 ps1 = rc.prompt_in1,
665 ps2 = rc.prompt_in2,
665 ps2 = rc.prompt_in2,
666 ps_out = rc.prompt_out,
666 ps_out = rc.prompt_out,
667 pad_left = rc.prompts_pad_left)
667 pad_left = rc.prompts_pad_left)
668
668
669 # user may have over-ridden the default print hook:
669 # user may have over-ridden the default print hook:
670 try:
670 try:
671 self.outputcache.__class__.display = self.hooks.display
671 self.outputcache.__class__.display = self.hooks.display
672 except AttributeError:
672 except AttributeError:
673 pass
673 pass
674
674
675 # I don't like assigning globally to sys, because it means when
675 # I don't like assigning globally to sys, because it means when
676 # embedding instances, each embedded instance overrides the previous
676 # embedding instances, each embedded instance overrides the previous
677 # choice. But sys.displayhook seems to be called internally by exec,
677 # choice. But sys.displayhook seems to be called internally by exec,
678 # so I don't see a way around it. We first save the original and then
678 # so I don't see a way around it. We first save the original and then
679 # overwrite it.
679 # overwrite it.
680 self.sys_displayhook = sys.displayhook
680 self.sys_displayhook = sys.displayhook
681 sys.displayhook = self.outputcache
681 sys.displayhook = self.outputcache
682
682
683 # Monkeypatch doctest so that its core test runner method is protected
683 # Monkeypatch doctest so that its core test runner method is protected
684 # from IPython's modified displayhook. Doctest expects the default
684 # from IPython's modified displayhook. Doctest expects the default
685 # displayhook behavior deep down, so our modification breaks it
685 # displayhook behavior deep down, so our modification breaks it
686 # completely. For this reason, a hard monkeypatch seems like a
686 # completely. For this reason, a hard monkeypatch seems like a
687 # reasonable solution rather than asking users to manually use a
687 # reasonable solution rather than asking users to manually use a
688 # different doctest runner when under IPython.
688 # different doctest runner when under IPython.
689 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
689 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
690
690
691 # Set user colors (don't do it in the constructor above so that it
691 # Set user colors (don't do it in the constructor above so that it
692 # doesn't crash if colors option is invalid)
692 # doesn't crash if colors option is invalid)
693 self.magic_colors(rc.colors)
693 self.magic_colors(rc.colors)
694
694
695 # Set calling of pdb on exceptions
695 # Set calling of pdb on exceptions
696 self.call_pdb = rc.pdb
696 self.call_pdb = rc.pdb
697
697
698 # Load user aliases
698 # Load user aliases
699 for alias in rc.alias:
699 for alias in rc.alias:
700 self.magic_alias(alias)
700 self.magic_alias(alias)
701
701 self.hooks.late_startup_hook()
702 self.hooks.late_startup_hook()
702
703
703 batchrun = False
704 batchrun = False
704 for batchfile in [path(arg) for arg in self.rc.args
705 for batchfile in [path(arg) for arg in self.rc.args
705 if arg.lower().endswith('.ipy')]:
706 if arg.lower().endswith('.ipy')]:
706 if not batchfile.isfile():
707 if not batchfile.isfile():
707 print "No such batch file:", batchfile
708 print "No such batch file:", batchfile
708 continue
709 continue
709 self.api.runlines(batchfile.text())
710 self.api.runlines(batchfile.text())
710 batchrun = True
711 batchrun = True
711 if batchrun:
712 # without -i option, exit after running the batch file
713 if batchrun and not self.rc.interact:
712 self.exit_now = True
714 self.exit_now = True
713
715
714 def add_builtins(self):
716 def add_builtins(self):
715 """Store ipython references into the builtin namespace.
717 """Store ipython references into the builtin namespace.
716
718
717 Some parts of ipython operate via builtins injected here, which hold a
719 Some parts of ipython operate via builtins injected here, which hold a
718 reference to IPython itself."""
720 reference to IPython itself."""
719
721
720 # TODO: deprecate all except _ip; 'jobs' should be installed
722 # TODO: deprecate all except _ip; 'jobs' should be installed
721 # by an extension and the rest are under _ip, ipalias is redundant
723 # by an extension and the rest are under _ip, ipalias is redundant
722 builtins_new = dict(__IPYTHON__ = self,
724 builtins_new = dict(__IPYTHON__ = self,
723 ip_set_hook = self.set_hook,
725 ip_set_hook = self.set_hook,
724 jobs = self.jobs,
726 jobs = self.jobs,
725 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
727 ipmagic = wrap_deprecated(self.ipmagic,'_ip.magic()'),
726 ipalias = wrap_deprecated(self.ipalias),
728 ipalias = wrap_deprecated(self.ipalias),
727 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
729 ipsystem = wrap_deprecated(self.ipsystem,'_ip.system()'),
728 _ip = self.api
730 _ip = self.api
729 )
731 )
730 for biname,bival in builtins_new.items():
732 for biname,bival in builtins_new.items():
731 try:
733 try:
732 # store the orignal value so we can restore it
734 # store the orignal value so we can restore it
733 self.builtins_added[biname] = __builtin__.__dict__[biname]
735 self.builtins_added[biname] = __builtin__.__dict__[biname]
734 except KeyError:
736 except KeyError:
735 # or mark that it wasn't defined, and we'll just delete it at
737 # or mark that it wasn't defined, and we'll just delete it at
736 # cleanup
738 # cleanup
737 self.builtins_added[biname] = Undefined
739 self.builtins_added[biname] = Undefined
738 __builtin__.__dict__[biname] = bival
740 __builtin__.__dict__[biname] = bival
739
741
740 # Keep in the builtins a flag for when IPython is active. We set it
742 # Keep in the builtins a flag for when IPython is active. We set it
741 # with setdefault so that multiple nested IPythons don't clobber one
743 # with setdefault so that multiple nested IPythons don't clobber one
742 # another. Each will increase its value by one upon being activated,
744 # another. Each will increase its value by one upon being activated,
743 # which also gives us a way to determine the nesting level.
745 # which also gives us a way to determine the nesting level.
744 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
746 __builtin__.__dict__.setdefault('__IPYTHON__active',0)
745
747
746 def clean_builtins(self):
748 def clean_builtins(self):
747 """Remove any builtins which might have been added by add_builtins, or
749 """Remove any builtins which might have been added by add_builtins, or
748 restore overwritten ones to their previous values."""
750 restore overwritten ones to their previous values."""
749 for biname,bival in self.builtins_added.items():
751 for biname,bival in self.builtins_added.items():
750 if bival is Undefined:
752 if bival is Undefined:
751 del __builtin__.__dict__[biname]
753 del __builtin__.__dict__[biname]
752 else:
754 else:
753 __builtin__.__dict__[biname] = bival
755 __builtin__.__dict__[biname] = bival
754 self.builtins_added.clear()
756 self.builtins_added.clear()
755
757
756 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
758 def set_hook(self,name,hook, priority = 50, str_key = None, re_key = None):
757 """set_hook(name,hook) -> sets an internal IPython hook.
759 """set_hook(name,hook) -> sets an internal IPython hook.
758
760
759 IPython exposes some of its internal API as user-modifiable hooks. By
761 IPython exposes some of its internal API as user-modifiable hooks. By
760 adding your function to one of these hooks, you can modify IPython's
762 adding your function to one of these hooks, you can modify IPython's
761 behavior to call at runtime your own routines."""
763 behavior to call at runtime your own routines."""
762
764
763 # At some point in the future, this should validate the hook before it
765 # At some point in the future, this should validate the hook before it
764 # accepts it. Probably at least check that the hook takes the number
766 # accepts it. Probably at least check that the hook takes the number
765 # of args it's supposed to.
767 # of args it's supposed to.
766
768
767 f = new.instancemethod(hook,self,self.__class__)
769 f = new.instancemethod(hook,self,self.__class__)
768
770
769 # check if the hook is for strdispatcher first
771 # check if the hook is for strdispatcher first
770 if str_key is not None:
772 if str_key is not None:
771 sdp = self.strdispatchers.get(name, StrDispatch())
773 sdp = self.strdispatchers.get(name, StrDispatch())
772 sdp.add_s(str_key, f, priority )
774 sdp.add_s(str_key, f, priority )
773 self.strdispatchers[name] = sdp
775 self.strdispatchers[name] = sdp
774 return
776 return
775 if re_key is not None:
777 if re_key is not None:
776 sdp = self.strdispatchers.get(name, StrDispatch())
778 sdp = self.strdispatchers.get(name, StrDispatch())
777 sdp.add_re(re.compile(re_key), f, priority )
779 sdp.add_re(re.compile(re_key), f, priority )
778 self.strdispatchers[name] = sdp
780 self.strdispatchers[name] = sdp
779 return
781 return
780
782
781 dp = getattr(self.hooks, name, None)
783 dp = getattr(self.hooks, name, None)
782 if name not in IPython.hooks.__all__:
784 if name not in IPython.hooks.__all__:
783 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
785 print "Warning! Hook '%s' is not one of %s" % (name, IPython.hooks.__all__ )
784 if not dp:
786 if not dp:
785 dp = IPython.hooks.CommandChainDispatcher()
787 dp = IPython.hooks.CommandChainDispatcher()
786
788
787 try:
789 try:
788 dp.add(f,priority)
790 dp.add(f,priority)
789 except AttributeError:
791 except AttributeError:
790 # it was not commandchain, plain old func - replace
792 # it was not commandchain, plain old func - replace
791 dp = f
793 dp = f
792
794
793 setattr(self.hooks,name, dp)
795 setattr(self.hooks,name, dp)
794
796
795
797
796 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
798 #setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__))
797
799
798 def set_crash_handler(self,crashHandler):
800 def set_crash_handler(self,crashHandler):
799 """Set the IPython crash handler.
801 """Set the IPython crash handler.
800
802
801 This must be a callable with a signature suitable for use as
803 This must be a callable with a signature suitable for use as
802 sys.excepthook."""
804 sys.excepthook."""
803
805
804 # Install the given crash handler as the Python exception hook
806 # Install the given crash handler as the Python exception hook
805 sys.excepthook = crashHandler
807 sys.excepthook = crashHandler
806
808
807 # The instance will store a pointer to this, so that runtime code
809 # The instance will store a pointer to this, so that runtime code
808 # (such as magics) can access it. This is because during the
810 # (such as magics) can access it. This is because during the
809 # read-eval loop, it gets temporarily overwritten (to deal with GUI
811 # read-eval loop, it gets temporarily overwritten (to deal with GUI
810 # frameworks).
812 # frameworks).
811 self.sys_excepthook = sys.excepthook
813 self.sys_excepthook = sys.excepthook
812
814
813
815
814 def set_custom_exc(self,exc_tuple,handler):
816 def set_custom_exc(self,exc_tuple,handler):
815 """set_custom_exc(exc_tuple,handler)
817 """set_custom_exc(exc_tuple,handler)
816
818
817 Set a custom exception handler, which will be called if any of the
819 Set a custom exception handler, which will be called if any of the
818 exceptions in exc_tuple occur in the mainloop (specifically, in the
820 exceptions in exc_tuple occur in the mainloop (specifically, in the
819 runcode() method.
821 runcode() method.
820
822
821 Inputs:
823 Inputs:
822
824
823 - exc_tuple: a *tuple* of valid exceptions to call the defined
825 - exc_tuple: a *tuple* of valid exceptions to call the defined
824 handler for. It is very important that you use a tuple, and NOT A
826 handler for. It is very important that you use a tuple, and NOT A
825 LIST here, because of the way Python's except statement works. If
827 LIST here, because of the way Python's except statement works. If
826 you only want to trap a single exception, use a singleton tuple:
828 you only want to trap a single exception, use a singleton tuple:
827
829
828 exc_tuple == (MyCustomException,)
830 exc_tuple == (MyCustomException,)
829
831
830 - handler: this must be defined as a function with the following
832 - handler: this must be defined as a function with the following
831 basic interface: def my_handler(self,etype,value,tb).
833 basic interface: def my_handler(self,etype,value,tb).
832
834
833 This will be made into an instance method (via new.instancemethod)
835 This will be made into an instance method (via new.instancemethod)
834 of IPython itself, and it will be called if any of the exceptions
836 of IPython itself, and it will be called if any of the exceptions
835 listed in the exc_tuple are caught. If the handler is None, an
837 listed in the exc_tuple are caught. If the handler is None, an
836 internal basic one is used, which just prints basic info.
838 internal basic one is used, which just prints basic info.
837
839
838 WARNING: by putting in your own exception handler into IPython's main
840 WARNING: by putting in your own exception handler into IPython's main
839 execution loop, you run a very good chance of nasty crashes. This
841 execution loop, you run a very good chance of nasty crashes. This
840 facility should only be used if you really know what you are doing."""
842 facility should only be used if you really know what you are doing."""
841
843
842 assert type(exc_tuple)==type(()) , \
844 assert type(exc_tuple)==type(()) , \
843 "The custom exceptions must be given AS A TUPLE."
845 "The custom exceptions must be given AS A TUPLE."
844
846
845 def dummy_handler(self,etype,value,tb):
847 def dummy_handler(self,etype,value,tb):
846 print '*** Simple custom exception handler ***'
848 print '*** Simple custom exception handler ***'
847 print 'Exception type :',etype
849 print 'Exception type :',etype
848 print 'Exception value:',value
850 print 'Exception value:',value
849 print 'Traceback :',tb
851 print 'Traceback :',tb
850 print 'Source code :','\n'.join(self.buffer)
852 print 'Source code :','\n'.join(self.buffer)
851
853
852 if handler is None: handler = dummy_handler
854 if handler is None: handler = dummy_handler
853
855
854 self.CustomTB = new.instancemethod(handler,self,self.__class__)
856 self.CustomTB = new.instancemethod(handler,self,self.__class__)
855 self.custom_exceptions = exc_tuple
857 self.custom_exceptions = exc_tuple
856
858
857 def set_custom_completer(self,completer,pos=0):
859 def set_custom_completer(self,completer,pos=0):
858 """set_custom_completer(completer,pos=0)
860 """set_custom_completer(completer,pos=0)
859
861
860 Adds a new custom completer function.
862 Adds a new custom completer function.
861
863
862 The position argument (defaults to 0) is the index in the completers
864 The position argument (defaults to 0) is the index in the completers
863 list where you want the completer to be inserted."""
865 list where you want the completer to be inserted."""
864
866
865 newcomp = new.instancemethod(completer,self.Completer,
867 newcomp = new.instancemethod(completer,self.Completer,
866 self.Completer.__class__)
868 self.Completer.__class__)
867 self.Completer.matchers.insert(pos,newcomp)
869 self.Completer.matchers.insert(pos,newcomp)
868
870
869 def set_completer(self):
871 def set_completer(self):
870 """reset readline's completer to be our own."""
872 """reset readline's completer to be our own."""
871 self.readline.set_completer(self.Completer.complete)
873 self.readline.set_completer(self.Completer.complete)
872
874
873 def _get_call_pdb(self):
875 def _get_call_pdb(self):
874 return self._call_pdb
876 return self._call_pdb
875
877
876 def _set_call_pdb(self,val):
878 def _set_call_pdb(self,val):
877
879
878 if val not in (0,1,False,True):
880 if val not in (0,1,False,True):
879 raise ValueError,'new call_pdb value must be boolean'
881 raise ValueError,'new call_pdb value must be boolean'
880
882
881 # store value in instance
883 # store value in instance
882 self._call_pdb = val
884 self._call_pdb = val
883
885
884 # notify the actual exception handlers
886 # notify the actual exception handlers
885 self.InteractiveTB.call_pdb = val
887 self.InteractiveTB.call_pdb = val
886 if self.isthreaded:
888 if self.isthreaded:
887 try:
889 try:
888 self.sys_excepthook.call_pdb = val
890 self.sys_excepthook.call_pdb = val
889 except:
891 except:
890 warn('Failed to activate pdb for threaded exception handler')
892 warn('Failed to activate pdb for threaded exception handler')
891
893
892 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
894 call_pdb = property(_get_call_pdb,_set_call_pdb,None,
893 'Control auto-activation of pdb at exceptions')
895 'Control auto-activation of pdb at exceptions')
894
896
895
897
896 # These special functions get installed in the builtin namespace, to
898 # These special functions get installed in the builtin namespace, to
897 # provide programmatic (pure python) access to magics, aliases and system
899 # provide programmatic (pure python) access to magics, aliases and system
898 # calls. This is important for logging, user scripting, and more.
900 # calls. This is important for logging, user scripting, and more.
899
901
900 # We are basically exposing, via normal python functions, the three
902 # We are basically exposing, via normal python functions, the three
901 # mechanisms in which ipython offers special call modes (magics for
903 # mechanisms in which ipython offers special call modes (magics for
902 # internal control, aliases for direct system access via pre-selected
904 # internal control, aliases for direct system access via pre-selected
903 # names, and !cmd for calling arbitrary system commands).
905 # names, and !cmd for calling arbitrary system commands).
904
906
905 def ipmagic(self,arg_s):
907 def ipmagic(self,arg_s):
906 """Call a magic function by name.
908 """Call a magic function by name.
907
909
908 Input: a string containing the name of the magic function to call and any
910 Input: a string containing the name of the magic function to call and any
909 additional arguments to be passed to the magic.
911 additional arguments to be passed to the magic.
910
912
911 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
913 ipmagic('name -opt foo bar') is equivalent to typing at the ipython
912 prompt:
914 prompt:
913
915
914 In[1]: %name -opt foo bar
916 In[1]: %name -opt foo bar
915
917
916 To call a magic without arguments, simply use ipmagic('name').
918 To call a magic without arguments, simply use ipmagic('name').
917
919
918 This provides a proper Python function to call IPython's magics in any
920 This provides a proper Python function to call IPython's magics in any
919 valid Python code you can type at the interpreter, including loops and
921 valid Python code you can type at the interpreter, including loops and
920 compound statements. It is added by IPython to the Python builtin
922 compound statements. It is added by IPython to the Python builtin
921 namespace upon initialization."""
923 namespace upon initialization."""
922
924
923 args = arg_s.split(' ',1)
925 args = arg_s.split(' ',1)
924 magic_name = args[0]
926 magic_name = args[0]
925 magic_name = magic_name.lstrip(self.ESC_MAGIC)
927 magic_name = magic_name.lstrip(self.ESC_MAGIC)
926
928
927 try:
929 try:
928 magic_args = args[1]
930 magic_args = args[1]
929 except IndexError:
931 except IndexError:
930 magic_args = ''
932 magic_args = ''
931 fn = getattr(self,'magic_'+magic_name,None)
933 fn = getattr(self,'magic_'+magic_name,None)
932 if fn is None:
934 if fn is None:
933 error("Magic function `%s` not found." % magic_name)
935 error("Magic function `%s` not found." % magic_name)
934 else:
936 else:
935 magic_args = self.var_expand(magic_args,1)
937 magic_args = self.var_expand(magic_args,1)
936 return fn(magic_args)
938 return fn(magic_args)
937
939
938 def ipalias(self,arg_s):
940 def ipalias(self,arg_s):
939 """Call an alias by name.
941 """Call an alias by name.
940
942
941 Input: a string containing the name of the alias to call and any
943 Input: a string containing the name of the alias to call and any
942 additional arguments to be passed to the magic.
944 additional arguments to be passed to the magic.
943
945
944 ipalias('name -opt foo bar') is equivalent to typing at the ipython
946 ipalias('name -opt foo bar') is equivalent to typing at the ipython
945 prompt:
947 prompt:
946
948
947 In[1]: name -opt foo bar
949 In[1]: name -opt foo bar
948
950
949 To call an alias without arguments, simply use ipalias('name').
951 To call an alias without arguments, simply use ipalias('name').
950
952
951 This provides a proper Python function to call IPython's aliases in any
953 This provides a proper Python function to call IPython's aliases in any
952 valid Python code you can type at the interpreter, including loops and
954 valid Python code you can type at the interpreter, including loops and
953 compound statements. It is added by IPython to the Python builtin
955 compound statements. It is added by IPython to the Python builtin
954 namespace upon initialization."""
956 namespace upon initialization."""
955
957
956 args = arg_s.split(' ',1)
958 args = arg_s.split(' ',1)
957 alias_name = args[0]
959 alias_name = args[0]
958 try:
960 try:
959 alias_args = args[1]
961 alias_args = args[1]
960 except IndexError:
962 except IndexError:
961 alias_args = ''
963 alias_args = ''
962 if alias_name in self.alias_table:
964 if alias_name in self.alias_table:
963 self.call_alias(alias_name,alias_args)
965 self.call_alias(alias_name,alias_args)
964 else:
966 else:
965 error("Alias `%s` not found." % alias_name)
967 error("Alias `%s` not found." % alias_name)
966
968
967 def ipsystem(self,arg_s):
969 def ipsystem(self,arg_s):
968 """Make a system call, using IPython."""
970 """Make a system call, using IPython."""
969
971
970 self.system(arg_s)
972 self.system(arg_s)
971
973
972 def complete(self,text):
974 def complete(self,text):
973 """Return a sorted list of all possible completions on text.
975 """Return a sorted list of all possible completions on text.
974
976
975 Inputs:
977 Inputs:
976
978
977 - text: a string of text to be completed on.
979 - text: a string of text to be completed on.
978
980
979 This is a wrapper around the completion mechanism, similar to what
981 This is a wrapper around the completion mechanism, similar to what
980 readline does at the command line when the TAB key is hit. By
982 readline does at the command line when the TAB key is hit. By
981 exposing it as a method, it can be used by other non-readline
983 exposing it as a method, it can be used by other non-readline
982 environments (such as GUIs) for text completion.
984 environments (such as GUIs) for text completion.
983
985
984 Simple usage example:
986 Simple usage example:
985
987
986 In [1]: x = 'hello'
988 In [1]: x = 'hello'
987
989
988 In [2]: __IP.complete('x.l')
990 In [2]: __IP.complete('x.l')
989 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
991 Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']"""
990
992
991 complete = self.Completer.complete
993 complete = self.Completer.complete
992 state = 0
994 state = 0
993 # use a dict so we get unique keys, since ipyhton's multiple
995 # use a dict so we get unique keys, since ipyhton's multiple
994 # completers can return duplicates. When we make 2.4 a requirement,
996 # completers can return duplicates. When we make 2.4 a requirement,
995 # start using sets instead, which are faster.
997 # start using sets instead, which are faster.
996 comps = {}
998 comps = {}
997 while True:
999 while True:
998 newcomp = complete(text,state,line_buffer=text)
1000 newcomp = complete(text,state,line_buffer=text)
999 if newcomp is None:
1001 if newcomp is None:
1000 break
1002 break
1001 comps[newcomp] = 1
1003 comps[newcomp] = 1
1002 state += 1
1004 state += 1
1003 outcomps = comps.keys()
1005 outcomps = comps.keys()
1004 outcomps.sort()
1006 outcomps.sort()
1005 return outcomps
1007 return outcomps
1006
1008
1007 def set_completer_frame(self, frame=None):
1009 def set_completer_frame(self, frame=None):
1008 if frame:
1010 if frame:
1009 self.Completer.namespace = frame.f_locals
1011 self.Completer.namespace = frame.f_locals
1010 self.Completer.global_namespace = frame.f_globals
1012 self.Completer.global_namespace = frame.f_globals
1011 else:
1013 else:
1012 self.Completer.namespace = self.user_ns
1014 self.Completer.namespace = self.user_ns
1013 self.Completer.global_namespace = self.user_global_ns
1015 self.Completer.global_namespace = self.user_global_ns
1014
1016
1015 def init_auto_alias(self):
1017 def init_auto_alias(self):
1016 """Define some aliases automatically.
1018 """Define some aliases automatically.
1017
1019
1018 These are ALL parameter-less aliases"""
1020 These are ALL parameter-less aliases"""
1019
1021
1020 for alias,cmd in self.auto_alias:
1022 for alias,cmd in self.auto_alias:
1021 self.getapi().defalias(alias,cmd)
1023 self.getapi().defalias(alias,cmd)
1022
1024
1023
1025
1024 def alias_table_validate(self,verbose=0):
1026 def alias_table_validate(self,verbose=0):
1025 """Update information about the alias table.
1027 """Update information about the alias table.
1026
1028
1027 In particular, make sure no Python keywords/builtins are in it."""
1029 In particular, make sure no Python keywords/builtins are in it."""
1028
1030
1029 no_alias = self.no_alias
1031 no_alias = self.no_alias
1030 for k in self.alias_table.keys():
1032 for k in self.alias_table.keys():
1031 if k in no_alias:
1033 if k in no_alias:
1032 del self.alias_table[k]
1034 del self.alias_table[k]
1033 if verbose:
1035 if verbose:
1034 print ("Deleting alias <%s>, it's a Python "
1036 print ("Deleting alias <%s>, it's a Python "
1035 "keyword or builtin." % k)
1037 "keyword or builtin." % k)
1036
1038
1037 def set_autoindent(self,value=None):
1039 def set_autoindent(self,value=None):
1038 """Set the autoindent flag, checking for readline support.
1040 """Set the autoindent flag, checking for readline support.
1039
1041
1040 If called with no arguments, it acts as a toggle."""
1042 If called with no arguments, it acts as a toggle."""
1041
1043
1042 if not self.has_readline:
1044 if not self.has_readline:
1043 if os.name == 'posix':
1045 if os.name == 'posix':
1044 warn("The auto-indent feature requires the readline library")
1046 warn("The auto-indent feature requires the readline library")
1045 self.autoindent = 0
1047 self.autoindent = 0
1046 return
1048 return
1047 if value is None:
1049 if value is None:
1048 self.autoindent = not self.autoindent
1050 self.autoindent = not self.autoindent
1049 else:
1051 else:
1050 self.autoindent = value
1052 self.autoindent = value
1051
1053
1052 def rc_set_toggle(self,rc_field,value=None):
1054 def rc_set_toggle(self,rc_field,value=None):
1053 """Set or toggle a field in IPython's rc config. structure.
1055 """Set or toggle a field in IPython's rc config. structure.
1054
1056
1055 If called with no arguments, it acts as a toggle.
1057 If called with no arguments, it acts as a toggle.
1056
1058
1057 If called with a non-existent field, the resulting AttributeError
1059 If called with a non-existent field, the resulting AttributeError
1058 exception will propagate out."""
1060 exception will propagate out."""
1059
1061
1060 rc_val = getattr(self.rc,rc_field)
1062 rc_val = getattr(self.rc,rc_field)
1061 if value is None:
1063 if value is None:
1062 value = not rc_val
1064 value = not rc_val
1063 setattr(self.rc,rc_field,value)
1065 setattr(self.rc,rc_field,value)
1064
1066
1065 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1067 def user_setup(self,ipythondir,rc_suffix,mode='install'):
1066 """Install the user configuration directory.
1068 """Install the user configuration directory.
1067
1069
1068 Can be called when running for the first time or to upgrade the user's
1070 Can be called when running for the first time or to upgrade the user's
1069 .ipython/ directory with the mode parameter. Valid modes are 'install'
1071 .ipython/ directory with the mode parameter. Valid modes are 'install'
1070 and 'upgrade'."""
1072 and 'upgrade'."""
1071
1073
1072 def wait():
1074 def wait():
1073 try:
1075 try:
1074 raw_input("Please press <RETURN> to start IPython.")
1076 raw_input("Please press <RETURN> to start IPython.")
1075 except EOFError:
1077 except EOFError:
1076 print >> Term.cout
1078 print >> Term.cout
1077 print '*'*70
1079 print '*'*70
1078
1080
1079 cwd = os.getcwd() # remember where we started
1081 cwd = os.getcwd() # remember where we started
1080 glb = glob.glob
1082 glb = glob.glob
1081 print '*'*70
1083 print '*'*70
1082 if mode == 'install':
1084 if mode == 'install':
1083 print \
1085 print \
1084 """Welcome to IPython. I will try to create a personal configuration directory
1086 """Welcome to IPython. I will try to create a personal configuration directory
1085 where you can customize many aspects of IPython's functionality in:\n"""
1087 where you can customize many aspects of IPython's functionality in:\n"""
1086 else:
1088 else:
1087 print 'I am going to upgrade your configuration in:'
1089 print 'I am going to upgrade your configuration in:'
1088
1090
1089 print ipythondir
1091 print ipythondir
1090
1092
1091 rcdirend = os.path.join('IPython','UserConfig')
1093 rcdirend = os.path.join('IPython','UserConfig')
1092 cfg = lambda d: os.path.join(d,rcdirend)
1094 cfg = lambda d: os.path.join(d,rcdirend)
1093 try:
1095 try:
1094 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1096 rcdir = filter(os.path.isdir,map(cfg,sys.path))[0]
1095 except IOError:
1097 except IOError:
1096 warning = """
1098 warning = """
1097 Installation error. IPython's directory was not found.
1099 Installation error. IPython's directory was not found.
1098
1100
1099 Check the following:
1101 Check the following:
1100
1102
1101 The ipython/IPython directory should be in a directory belonging to your
1103 The ipython/IPython directory should be in a directory belonging to your
1102 PYTHONPATH environment variable (that is, it should be in a directory
1104 PYTHONPATH environment variable (that is, it should be in a directory
1103 belonging to sys.path). You can copy it explicitly there or just link to it.
1105 belonging to sys.path). You can copy it explicitly there or just link to it.
1104
1106
1105 IPython will proceed with builtin defaults.
1107 IPython will proceed with builtin defaults.
1106 """
1108 """
1107 warn(warning)
1109 warn(warning)
1108 wait()
1110 wait()
1109 return
1111 return
1110
1112
1111 if mode == 'install':
1113 if mode == 'install':
1112 try:
1114 try:
1113 shutil.copytree(rcdir,ipythondir)
1115 shutil.copytree(rcdir,ipythondir)
1114 os.chdir(ipythondir)
1116 os.chdir(ipythondir)
1115 rc_files = glb("ipythonrc*")
1117 rc_files = glb("ipythonrc*")
1116 for rc_file in rc_files:
1118 for rc_file in rc_files:
1117 os.rename(rc_file,rc_file+rc_suffix)
1119 os.rename(rc_file,rc_file+rc_suffix)
1118 except:
1120 except:
1119 warning = """
1121 warning = """
1120
1122
1121 There was a problem with the installation:
1123 There was a problem with the installation:
1122 %s
1124 %s
1123 Try to correct it or contact the developers if you think it's a bug.
1125 Try to correct it or contact the developers if you think it's a bug.
1124 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1126 IPython will proceed with builtin defaults.""" % sys.exc_info()[1]
1125 warn(warning)
1127 warn(warning)
1126 wait()
1128 wait()
1127 return
1129 return
1128
1130
1129 elif mode == 'upgrade':
1131 elif mode == 'upgrade':
1130 try:
1132 try:
1131 os.chdir(ipythondir)
1133 os.chdir(ipythondir)
1132 except:
1134 except:
1133 print """
1135 print """
1134 Can not upgrade: changing to directory %s failed. Details:
1136 Can not upgrade: changing to directory %s failed. Details:
1135 %s
1137 %s
1136 """ % (ipythondir,sys.exc_info()[1])
1138 """ % (ipythondir,sys.exc_info()[1])
1137 wait()
1139 wait()
1138 return
1140 return
1139 else:
1141 else:
1140 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1142 sources = glb(os.path.join(rcdir,'[A-Za-z]*'))
1141 for new_full_path in sources:
1143 for new_full_path in sources:
1142 new_filename = os.path.basename(new_full_path)
1144 new_filename = os.path.basename(new_full_path)
1143 if new_filename.startswith('ipythonrc'):
1145 if new_filename.startswith('ipythonrc'):
1144 new_filename = new_filename + rc_suffix
1146 new_filename = new_filename + rc_suffix
1145 # The config directory should only contain files, skip any
1147 # The config directory should only contain files, skip any
1146 # directories which may be there (like CVS)
1148 # directories which may be there (like CVS)
1147 if os.path.isdir(new_full_path):
1149 if os.path.isdir(new_full_path):
1148 continue
1150 continue
1149 if os.path.exists(new_filename):
1151 if os.path.exists(new_filename):
1150 old_file = new_filename+'.old'
1152 old_file = new_filename+'.old'
1151 if os.path.exists(old_file):
1153 if os.path.exists(old_file):
1152 os.remove(old_file)
1154 os.remove(old_file)
1153 os.rename(new_filename,old_file)
1155 os.rename(new_filename,old_file)
1154 shutil.copy(new_full_path,new_filename)
1156 shutil.copy(new_full_path,new_filename)
1155 else:
1157 else:
1156 raise ValueError,'unrecognized mode for install:',`mode`
1158 raise ValueError,'unrecognized mode for install:',`mode`
1157
1159
1158 # Fix line-endings to those native to each platform in the config
1160 # Fix line-endings to those native to each platform in the config
1159 # directory.
1161 # directory.
1160 try:
1162 try:
1161 os.chdir(ipythondir)
1163 os.chdir(ipythondir)
1162 except:
1164 except:
1163 print """
1165 print """
1164 Problem: changing to directory %s failed.
1166 Problem: changing to directory %s failed.
1165 Details:
1167 Details:
1166 %s
1168 %s
1167
1169
1168 Some configuration files may have incorrect line endings. This should not
1170 Some configuration files may have incorrect line endings. This should not
1169 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1171 cause any problems during execution. """ % (ipythondir,sys.exc_info()[1])
1170 wait()
1172 wait()
1171 else:
1173 else:
1172 for fname in glb('ipythonrc*'):
1174 for fname in glb('ipythonrc*'):
1173 try:
1175 try:
1174 native_line_ends(fname,backup=0)
1176 native_line_ends(fname,backup=0)
1175 except IOError:
1177 except IOError:
1176 pass
1178 pass
1177
1179
1178 if mode == 'install':
1180 if mode == 'install':
1179 print """
1181 print """
1180 Successful installation!
1182 Successful installation!
1181
1183
1182 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1184 Please read the sections 'Initial Configuration' and 'Quick Tips' in the
1183 IPython manual (there are both HTML and PDF versions supplied with the
1185 IPython manual (there are both HTML and PDF versions supplied with the
1184 distribution) to make sure that your system environment is properly configured
1186 distribution) to make sure that your system environment is properly configured
1185 to take advantage of IPython's features.
1187 to take advantage of IPython's features.
1186
1188
1187 Important note: the configuration system has changed! The old system is
1189 Important note: the configuration system has changed! The old system is
1188 still in place, but its setting may be partly overridden by the settings in
1190 still in place, but its setting may be partly overridden by the settings in
1189 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1191 "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file
1190 if some of the new settings bother you.
1192 if some of the new settings bother you.
1191
1193
1192 """
1194 """
1193 else:
1195 else:
1194 print """
1196 print """
1195 Successful upgrade!
1197 Successful upgrade!
1196
1198
1197 All files in your directory:
1199 All files in your directory:
1198 %(ipythondir)s
1200 %(ipythondir)s
1199 which would have been overwritten by the upgrade were backed up with a .old
1201 which would have been overwritten by the upgrade were backed up with a .old
1200 extension. If you had made particular customizations in those files you may
1202 extension. If you had made particular customizations in those files you may
1201 want to merge them back into the new files.""" % locals()
1203 want to merge them back into the new files.""" % locals()
1202 wait()
1204 wait()
1203 os.chdir(cwd)
1205 os.chdir(cwd)
1204 # end user_setup()
1206 # end user_setup()
1205
1207
1206 def atexit_operations(self):
1208 def atexit_operations(self):
1207 """This will be executed at the time of exit.
1209 """This will be executed at the time of exit.
1208
1210
1209 Saving of persistent data should be performed here. """
1211 Saving of persistent data should be performed here. """
1210
1212
1211 #print '*** IPython exit cleanup ***' # dbg
1213 #print '*** IPython exit cleanup ***' # dbg
1212 # input history
1214 # input history
1213 self.savehist()
1215 self.savehist()
1214
1216
1215 # Cleanup all tempfiles left around
1217 # Cleanup all tempfiles left around
1216 for tfile in self.tempfiles:
1218 for tfile in self.tempfiles:
1217 try:
1219 try:
1218 os.unlink(tfile)
1220 os.unlink(tfile)
1219 except OSError:
1221 except OSError:
1220 pass
1222 pass
1221
1223
1222 self.hooks.shutdown_hook()
1224 self.hooks.shutdown_hook()
1223
1225
1224 def savehist(self):
1226 def savehist(self):
1225 """Save input history to a file (via readline library)."""
1227 """Save input history to a file (via readline library)."""
1226 try:
1228 try:
1227 self.readline.write_history_file(self.histfile)
1229 self.readline.write_history_file(self.histfile)
1228 except:
1230 except:
1229 print 'Unable to save IPython command history to file: ' + \
1231 print 'Unable to save IPython command history to file: ' + \
1230 `self.histfile`
1232 `self.histfile`
1231
1233
1232 def reloadhist(self):
1234 def reloadhist(self):
1233 """Reload the input history from disk file."""
1235 """Reload the input history from disk file."""
1234
1236
1235 if self.has_readline:
1237 if self.has_readline:
1236 self.readline.clear_history()
1238 self.readline.clear_history()
1237 self.readline.read_history_file(self.shell.histfile)
1239 self.readline.read_history_file(self.shell.histfile)
1238
1240
1239 def history_saving_wrapper(self, func):
1241 def history_saving_wrapper(self, func):
1240 """ Wrap func for readline history saving
1242 """ Wrap func for readline history saving
1241
1243
1242 Convert func into callable that saves & restores
1244 Convert func into callable that saves & restores
1243 history around the call """
1245 history around the call """
1244
1246
1245 if not self.has_readline:
1247 if not self.has_readline:
1246 return func
1248 return func
1247
1249
1248 def wrapper():
1250 def wrapper():
1249 self.savehist()
1251 self.savehist()
1250 try:
1252 try:
1251 func()
1253 func()
1252 finally:
1254 finally:
1253 readline.read_history_file(self.histfile)
1255 readline.read_history_file(self.histfile)
1254 return wrapper
1256 return wrapper
1255
1257
1256
1258
1257 def pre_readline(self):
1259 def pre_readline(self):
1258 """readline hook to be used at the start of each line.
1260 """readline hook to be used at the start of each line.
1259
1261
1260 Currently it handles auto-indent only."""
1262 Currently it handles auto-indent only."""
1261
1263
1262 #debugx('self.indent_current_nsp','pre_readline:')
1264 #debugx('self.indent_current_nsp','pre_readline:')
1263
1265
1264 if self.rl_do_indent:
1266 if self.rl_do_indent:
1265 self.readline.insert_text(self.indent_current_str())
1267 self.readline.insert_text(self.indent_current_str())
1266 if self.rl_next_input is not None:
1268 if self.rl_next_input is not None:
1267 self.readline.insert_text(self.rl_next_input)
1269 self.readline.insert_text(self.rl_next_input)
1268 self.rl_next_input = None
1270 self.rl_next_input = None
1269
1271
1270 def init_readline(self):
1272 def init_readline(self):
1271 """Command history completion/saving/reloading."""
1273 """Command history completion/saving/reloading."""
1272
1274
1273
1275
1274 import IPython.rlineimpl as readline
1276 import IPython.rlineimpl as readline
1275
1277
1276 if not readline.have_readline:
1278 if not readline.have_readline:
1277 self.has_readline = 0
1279 self.has_readline = 0
1278 self.readline = None
1280 self.readline = None
1279 # no point in bugging windows users with this every time:
1281 # no point in bugging windows users with this every time:
1280 warn('Readline services not available on this platform.')
1282 warn('Readline services not available on this platform.')
1281 else:
1283 else:
1282 sys.modules['readline'] = readline
1284 sys.modules['readline'] = readline
1283 import atexit
1285 import atexit
1284 from IPython.completer import IPCompleter
1286 from IPython.completer import IPCompleter
1285 self.Completer = IPCompleter(self,
1287 self.Completer = IPCompleter(self,
1286 self.user_ns,
1288 self.user_ns,
1287 self.user_global_ns,
1289 self.user_global_ns,
1288 self.rc.readline_omit__names,
1290 self.rc.readline_omit__names,
1289 self.alias_table)
1291 self.alias_table)
1290 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1292 sdisp = self.strdispatchers.get('complete_command', StrDispatch())
1291 self.strdispatchers['complete_command'] = sdisp
1293 self.strdispatchers['complete_command'] = sdisp
1292 self.Completer.custom_completers = sdisp
1294 self.Completer.custom_completers = sdisp
1293 # Platform-specific configuration
1295 # Platform-specific configuration
1294 if os.name == 'nt':
1296 if os.name == 'nt':
1295 self.readline_startup_hook = readline.set_pre_input_hook
1297 self.readline_startup_hook = readline.set_pre_input_hook
1296 else:
1298 else:
1297 self.readline_startup_hook = readline.set_startup_hook
1299 self.readline_startup_hook = readline.set_startup_hook
1298
1300
1299 # Load user's initrc file (readline config)
1301 # Load user's initrc file (readline config)
1300 inputrc_name = os.environ.get('INPUTRC')
1302 inputrc_name = os.environ.get('INPUTRC')
1301 if inputrc_name is None:
1303 if inputrc_name is None:
1302 home_dir = get_home_dir()
1304 home_dir = get_home_dir()
1303 if home_dir is not None:
1305 if home_dir is not None:
1304 inputrc_name = os.path.join(home_dir,'.inputrc')
1306 inputrc_name = os.path.join(home_dir,'.inputrc')
1305 if os.path.isfile(inputrc_name):
1307 if os.path.isfile(inputrc_name):
1306 try:
1308 try:
1307 readline.read_init_file(inputrc_name)
1309 readline.read_init_file(inputrc_name)
1308 except:
1310 except:
1309 warn('Problems reading readline initialization file <%s>'
1311 warn('Problems reading readline initialization file <%s>'
1310 % inputrc_name)
1312 % inputrc_name)
1311
1313
1312 self.has_readline = 1
1314 self.has_readline = 1
1313 self.readline = readline
1315 self.readline = readline
1314 # save this in sys so embedded copies can restore it properly
1316 # save this in sys so embedded copies can restore it properly
1315 sys.ipcompleter = self.Completer.complete
1317 sys.ipcompleter = self.Completer.complete
1316 self.set_completer()
1318 self.set_completer()
1317
1319
1318 # Configure readline according to user's prefs
1320 # Configure readline according to user's prefs
1319 for rlcommand in self.rc.readline_parse_and_bind:
1321 for rlcommand in self.rc.readline_parse_and_bind:
1320 readline.parse_and_bind(rlcommand)
1322 readline.parse_and_bind(rlcommand)
1321
1323
1322 # remove some chars from the delimiters list
1324 # remove some chars from the delimiters list
1323 delims = readline.get_completer_delims()
1325 delims = readline.get_completer_delims()
1324 delims = delims.translate(string._idmap,
1326 delims = delims.translate(string._idmap,
1325 self.rc.readline_remove_delims)
1327 self.rc.readline_remove_delims)
1326 readline.set_completer_delims(delims)
1328 readline.set_completer_delims(delims)
1327 # otherwise we end up with a monster history after a while:
1329 # otherwise we end up with a monster history after a while:
1328 readline.set_history_length(1000)
1330 readline.set_history_length(1000)
1329 try:
1331 try:
1330 #print '*** Reading readline history' # dbg
1332 #print '*** Reading readline history' # dbg
1331 readline.read_history_file(self.histfile)
1333 readline.read_history_file(self.histfile)
1332 except IOError:
1334 except IOError:
1333 pass # It doesn't exist yet.
1335 pass # It doesn't exist yet.
1334
1336
1335 atexit.register(self.atexit_operations)
1337 atexit.register(self.atexit_operations)
1336 del atexit
1338 del atexit
1337
1339
1338 # Configure auto-indent for all platforms
1340 # Configure auto-indent for all platforms
1339 self.set_autoindent(self.rc.autoindent)
1341 self.set_autoindent(self.rc.autoindent)
1340
1342
1341 def ask_yes_no(self,prompt,default=True):
1343 def ask_yes_no(self,prompt,default=True):
1342 if self.rc.quiet:
1344 if self.rc.quiet:
1343 return True
1345 return True
1344 return ask_yes_no(prompt,default)
1346 return ask_yes_no(prompt,default)
1345
1347
1346 def _should_recompile(self,e):
1348 def _should_recompile(self,e):
1347 """Utility routine for edit_syntax_error"""
1349 """Utility routine for edit_syntax_error"""
1348
1350
1349 if e.filename in ('<ipython console>','<input>','<string>',
1351 if e.filename in ('<ipython console>','<input>','<string>',
1350 '<console>','<BackgroundJob compilation>',
1352 '<console>','<BackgroundJob compilation>',
1351 None):
1353 None):
1352
1354
1353 return False
1355 return False
1354 try:
1356 try:
1355 if (self.rc.autoedit_syntax and
1357 if (self.rc.autoedit_syntax and
1356 not self.ask_yes_no('Return to editor to correct syntax error? '
1358 not self.ask_yes_no('Return to editor to correct syntax error? '
1357 '[Y/n] ','y')):
1359 '[Y/n] ','y')):
1358 return False
1360 return False
1359 except EOFError:
1361 except EOFError:
1360 return False
1362 return False
1361
1363
1362 def int0(x):
1364 def int0(x):
1363 try:
1365 try:
1364 return int(x)
1366 return int(x)
1365 except TypeError:
1367 except TypeError:
1366 return 0
1368 return 0
1367 # always pass integer line and offset values to editor hook
1369 # always pass integer line and offset values to editor hook
1368 self.hooks.fix_error_editor(e.filename,
1370 self.hooks.fix_error_editor(e.filename,
1369 int0(e.lineno),int0(e.offset),e.msg)
1371 int0(e.lineno),int0(e.offset),e.msg)
1370 return True
1372 return True
1371
1373
1372 def edit_syntax_error(self):
1374 def edit_syntax_error(self):
1373 """The bottom half of the syntax error handler called in the main loop.
1375 """The bottom half of the syntax error handler called in the main loop.
1374
1376
1375 Loop until syntax error is fixed or user cancels.
1377 Loop until syntax error is fixed or user cancels.
1376 """
1378 """
1377
1379
1378 while self.SyntaxTB.last_syntax_error:
1380 while self.SyntaxTB.last_syntax_error:
1379 # copy and clear last_syntax_error
1381 # copy and clear last_syntax_error
1380 err = self.SyntaxTB.clear_err_state()
1382 err = self.SyntaxTB.clear_err_state()
1381 if not self._should_recompile(err):
1383 if not self._should_recompile(err):
1382 return
1384 return
1383 try:
1385 try:
1384 # may set last_syntax_error again if a SyntaxError is raised
1386 # may set last_syntax_error again if a SyntaxError is raised
1385 self.safe_execfile(err.filename,self.user_ns)
1387 self.safe_execfile(err.filename,self.user_ns)
1386 except:
1388 except:
1387 self.showtraceback()
1389 self.showtraceback()
1388 else:
1390 else:
1389 try:
1391 try:
1390 f = file(err.filename)
1392 f = file(err.filename)
1391 try:
1393 try:
1392 sys.displayhook(f.read())
1394 sys.displayhook(f.read())
1393 finally:
1395 finally:
1394 f.close()
1396 f.close()
1395 except:
1397 except:
1396 self.showtraceback()
1398 self.showtraceback()
1397
1399
1398 def showsyntaxerror(self, filename=None):
1400 def showsyntaxerror(self, filename=None):
1399 """Display the syntax error that just occurred.
1401 """Display the syntax error that just occurred.
1400
1402
1401 This doesn't display a stack trace because there isn't one.
1403 This doesn't display a stack trace because there isn't one.
1402
1404
1403 If a filename is given, it is stuffed in the exception instead
1405 If a filename is given, it is stuffed in the exception instead
1404 of what was there before (because Python's parser always uses
1406 of what was there before (because Python's parser always uses
1405 "<string>" when reading from a string).
1407 "<string>" when reading from a string).
1406 """
1408 """
1407 etype, value, last_traceback = sys.exc_info()
1409 etype, value, last_traceback = sys.exc_info()
1408
1410
1409 # See note about these variables in showtraceback() below
1411 # See note about these variables in showtraceback() below
1410 sys.last_type = etype
1412 sys.last_type = etype
1411 sys.last_value = value
1413 sys.last_value = value
1412 sys.last_traceback = last_traceback
1414 sys.last_traceback = last_traceback
1413
1415
1414 if filename and etype is SyntaxError:
1416 if filename and etype is SyntaxError:
1415 # Work hard to stuff the correct filename in the exception
1417 # Work hard to stuff the correct filename in the exception
1416 try:
1418 try:
1417 msg, (dummy_filename, lineno, offset, line) = value
1419 msg, (dummy_filename, lineno, offset, line) = value
1418 except:
1420 except:
1419 # Not the format we expect; leave it alone
1421 # Not the format we expect; leave it alone
1420 pass
1422 pass
1421 else:
1423 else:
1422 # Stuff in the right filename
1424 # Stuff in the right filename
1423 try:
1425 try:
1424 # Assume SyntaxError is a class exception
1426 # Assume SyntaxError is a class exception
1425 value = SyntaxError(msg, (filename, lineno, offset, line))
1427 value = SyntaxError(msg, (filename, lineno, offset, line))
1426 except:
1428 except:
1427 # If that failed, assume SyntaxError is a string
1429 # If that failed, assume SyntaxError is a string
1428 value = msg, (filename, lineno, offset, line)
1430 value = msg, (filename, lineno, offset, line)
1429 self.SyntaxTB(etype,value,[])
1431 self.SyntaxTB(etype,value,[])
1430
1432
1431 def debugger(self,force=False):
1433 def debugger(self,force=False):
1432 """Call the pydb/pdb debugger.
1434 """Call the pydb/pdb debugger.
1433
1435
1434 Keywords:
1436 Keywords:
1435
1437
1436 - force(False): by default, this routine checks the instance call_pdb
1438 - force(False): by default, this routine checks the instance call_pdb
1437 flag and does not actually invoke the debugger if the flag is false.
1439 flag and does not actually invoke the debugger if the flag is false.
1438 The 'force' option forces the debugger to activate even if the flag
1440 The 'force' option forces the debugger to activate even if the flag
1439 is false.
1441 is false.
1440 """
1442 """
1441
1443
1442 if not (force or self.call_pdb):
1444 if not (force or self.call_pdb):
1443 return
1445 return
1444
1446
1445 if not hasattr(sys,'last_traceback'):
1447 if not hasattr(sys,'last_traceback'):
1446 error('No traceback has been produced, nothing to debug.')
1448 error('No traceback has been produced, nothing to debug.')
1447 return
1449 return
1448
1450
1449 # use pydb if available
1451 # use pydb if available
1450 if Debugger.has_pydb:
1452 if Debugger.has_pydb:
1451 from pydb import pm
1453 from pydb import pm
1452 else:
1454 else:
1453 # fallback to our internal debugger
1455 # fallback to our internal debugger
1454 pm = lambda : self.InteractiveTB.debugger(force=True)
1456 pm = lambda : self.InteractiveTB.debugger(force=True)
1455 self.history_saving_wrapper(pm)()
1457 self.history_saving_wrapper(pm)()
1456
1458
1457 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1459 def showtraceback(self,exc_tuple = None,filename=None,tb_offset=None):
1458 """Display the exception that just occurred.
1460 """Display the exception that just occurred.
1459
1461
1460 If nothing is known about the exception, this is the method which
1462 If nothing is known about the exception, this is the method which
1461 should be used throughout the code for presenting user tracebacks,
1463 should be used throughout the code for presenting user tracebacks,
1462 rather than directly invoking the InteractiveTB object.
1464 rather than directly invoking the InteractiveTB object.
1463
1465
1464 A specific showsyntaxerror() also exists, but this method can take
1466 A specific showsyntaxerror() also exists, but this method can take
1465 care of calling it if needed, so unless you are explicitly catching a
1467 care of calling it if needed, so unless you are explicitly catching a
1466 SyntaxError exception, don't try to analyze the stack manually and
1468 SyntaxError exception, don't try to analyze the stack manually and
1467 simply call this method."""
1469 simply call this method."""
1468
1470
1469
1471
1470 # Though this won't be called by syntax errors in the input line,
1472 # Though this won't be called by syntax errors in the input line,
1471 # there may be SyntaxError cases whith imported code.
1473 # there may be SyntaxError cases whith imported code.
1472
1474
1473
1475
1474 if exc_tuple is None:
1476 if exc_tuple is None:
1475 etype, value, tb = sys.exc_info()
1477 etype, value, tb = sys.exc_info()
1476 else:
1478 else:
1477 etype, value, tb = exc_tuple
1479 etype, value, tb = exc_tuple
1478
1480
1479 if etype is SyntaxError:
1481 if etype is SyntaxError:
1480 self.showsyntaxerror(filename)
1482 self.showsyntaxerror(filename)
1481 else:
1483 else:
1482 # WARNING: these variables are somewhat deprecated and not
1484 # WARNING: these variables are somewhat deprecated and not
1483 # necessarily safe to use in a threaded environment, but tools
1485 # necessarily safe to use in a threaded environment, but tools
1484 # like pdb depend on their existence, so let's set them. If we
1486 # like pdb depend on their existence, so let's set them. If we
1485 # find problems in the field, we'll need to revisit their use.
1487 # find problems in the field, we'll need to revisit their use.
1486 sys.last_type = etype
1488 sys.last_type = etype
1487 sys.last_value = value
1489 sys.last_value = value
1488 sys.last_traceback = tb
1490 sys.last_traceback = tb
1489
1491
1490 if etype in self.custom_exceptions:
1492 if etype in self.custom_exceptions:
1491 self.CustomTB(etype,value,tb)
1493 self.CustomTB(etype,value,tb)
1492 else:
1494 else:
1493 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1495 self.InteractiveTB(etype,value,tb,tb_offset=tb_offset)
1494 if self.InteractiveTB.call_pdb and self.has_readline:
1496 if self.InteractiveTB.call_pdb and self.has_readline:
1495 # pdb mucks up readline, fix it back
1497 # pdb mucks up readline, fix it back
1496 self.set_completer()
1498 self.set_completer()
1497
1499
1498
1500
1499 def mainloop(self,banner=None):
1501 def mainloop(self,banner=None):
1500 """Creates the local namespace and starts the mainloop.
1502 """Creates the local namespace and starts the mainloop.
1501
1503
1502 If an optional banner argument is given, it will override the
1504 If an optional banner argument is given, it will override the
1503 internally created default banner."""
1505 internally created default banner."""
1504
1506
1505 if self.rc.c: # Emulate Python's -c option
1507 if self.rc.c: # Emulate Python's -c option
1506 self.exec_init_cmd()
1508 self.exec_init_cmd()
1507 if banner is None:
1509 if banner is None:
1508 if not self.rc.banner:
1510 if not self.rc.banner:
1509 banner = ''
1511 banner = ''
1510 # banner is string? Use it directly!
1512 # banner is string? Use it directly!
1511 elif isinstance(self.rc.banner,basestring):
1513 elif isinstance(self.rc.banner,basestring):
1512 banner = self.rc.banner
1514 banner = self.rc.banner
1513 else:
1515 else:
1514 banner = self.BANNER+self.banner2
1516 banner = self.BANNER+self.banner2
1515
1517
1516 self.interact(banner)
1518 self.interact(banner)
1517
1519
1518 def exec_init_cmd(self):
1520 def exec_init_cmd(self):
1519 """Execute a command given at the command line.
1521 """Execute a command given at the command line.
1520
1522
1521 This emulates Python's -c option."""
1523 This emulates Python's -c option."""
1522
1524
1523 #sys.argv = ['-c']
1525 #sys.argv = ['-c']
1524 self.push(self.prefilter(self.rc.c, False))
1526 self.push(self.prefilter(self.rc.c, False))
1525 self.exit_now = True
1527 if not self.rc.interact:
1528 self.exit_now = True
1526
1529
1527 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1530 def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0):
1528 """Embeds IPython into a running python program.
1531 """Embeds IPython into a running python program.
1529
1532
1530 Input:
1533 Input:
1531
1534
1532 - header: An optional header message can be specified.
1535 - header: An optional header message can be specified.
1533
1536
1534 - local_ns, global_ns: working namespaces. If given as None, the
1537 - local_ns, global_ns: working namespaces. If given as None, the
1535 IPython-initialized one is updated with __main__.__dict__, so that
1538 IPython-initialized one is updated with __main__.__dict__, so that
1536 program variables become visible but user-specific configuration
1539 program variables become visible but user-specific configuration
1537 remains possible.
1540 remains possible.
1538
1541
1539 - stack_depth: specifies how many levels in the stack to go to
1542 - stack_depth: specifies how many levels in the stack to go to
1540 looking for namespaces (when local_ns and global_ns are None). This
1543 looking for namespaces (when local_ns and global_ns are None). This
1541 allows an intermediate caller to make sure that this function gets
1544 allows an intermediate caller to make sure that this function gets
1542 the namespace from the intended level in the stack. By default (0)
1545 the namespace from the intended level in the stack. By default (0)
1543 it will get its locals and globals from the immediate caller.
1546 it will get its locals and globals from the immediate caller.
1544
1547
1545 Warning: it's possible to use this in a program which is being run by
1548 Warning: it's possible to use this in a program which is being run by
1546 IPython itself (via %run), but some funny things will happen (a few
1549 IPython itself (via %run), but some funny things will happen (a few
1547 globals get overwritten). In the future this will be cleaned up, as
1550 globals get overwritten). In the future this will be cleaned up, as
1548 there is no fundamental reason why it can't work perfectly."""
1551 there is no fundamental reason why it can't work perfectly."""
1549
1552
1550 # Get locals and globals from caller
1553 # Get locals and globals from caller
1551 if local_ns is None or global_ns is None:
1554 if local_ns is None or global_ns is None:
1552 call_frame = sys._getframe(stack_depth).f_back
1555 call_frame = sys._getframe(stack_depth).f_back
1553
1556
1554 if local_ns is None:
1557 if local_ns is None:
1555 local_ns = call_frame.f_locals
1558 local_ns = call_frame.f_locals
1556 if global_ns is None:
1559 if global_ns is None:
1557 global_ns = call_frame.f_globals
1560 global_ns = call_frame.f_globals
1558
1561
1559 # Update namespaces and fire up interpreter
1562 # Update namespaces and fire up interpreter
1560
1563
1561 # The global one is easy, we can just throw it in
1564 # The global one is easy, we can just throw it in
1562 self.user_global_ns = global_ns
1565 self.user_global_ns = global_ns
1563
1566
1564 # but the user/local one is tricky: ipython needs it to store internal
1567 # but the user/local one is tricky: ipython needs it to store internal
1565 # data, but we also need the locals. We'll copy locals in the user
1568 # data, but we also need the locals. We'll copy locals in the user
1566 # one, but will track what got copied so we can delete them at exit.
1569 # one, but will track what got copied so we can delete them at exit.
1567 # This is so that a later embedded call doesn't see locals from a
1570 # This is so that a later embedded call doesn't see locals from a
1568 # previous call (which most likely existed in a separate scope).
1571 # previous call (which most likely existed in a separate scope).
1569 local_varnames = local_ns.keys()
1572 local_varnames = local_ns.keys()
1570 self.user_ns.update(local_ns)
1573 self.user_ns.update(local_ns)
1571
1574
1572 # Patch for global embedding to make sure that things don't overwrite
1575 # Patch for global embedding to make sure that things don't overwrite
1573 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1576 # user globals accidentally. Thanks to Richard <rxe@renre-europe.com>
1574 # FIXME. Test this a bit more carefully (the if.. is new)
1577 # FIXME. Test this a bit more carefully (the if.. is new)
1575 if local_ns is None and global_ns is None:
1578 if local_ns is None and global_ns is None:
1576 self.user_global_ns.update(__main__.__dict__)
1579 self.user_global_ns.update(__main__.__dict__)
1577
1580
1578 # make sure the tab-completer has the correct frame information, so it
1581 # make sure the tab-completer has the correct frame information, so it
1579 # actually completes using the frame's locals/globals
1582 # actually completes using the frame's locals/globals
1580 self.set_completer_frame()
1583 self.set_completer_frame()
1581
1584
1582 # before activating the interactive mode, we need to make sure that
1585 # before activating the interactive mode, we need to make sure that
1583 # all names in the builtin namespace needed by ipython point to
1586 # all names in the builtin namespace needed by ipython point to
1584 # ourselves, and not to other instances.
1587 # ourselves, and not to other instances.
1585 self.add_builtins()
1588 self.add_builtins()
1586
1589
1587 self.interact(header)
1590 self.interact(header)
1588
1591
1589 # now, purge out the user namespace from anything we might have added
1592 # now, purge out the user namespace from anything we might have added
1590 # from the caller's local namespace
1593 # from the caller's local namespace
1591 delvar = self.user_ns.pop
1594 delvar = self.user_ns.pop
1592 for var in local_varnames:
1595 for var in local_varnames:
1593 delvar(var,None)
1596 delvar(var,None)
1594 # and clean builtins we may have overridden
1597 # and clean builtins we may have overridden
1595 self.clean_builtins()
1598 self.clean_builtins()
1596
1599
1597 def interact(self, banner=None):
1600 def interact(self, banner=None):
1598 """Closely emulate the interactive Python console.
1601 """Closely emulate the interactive Python console.
1599
1602
1600 The optional banner argument specify the banner to print
1603 The optional banner argument specify the banner to print
1601 before the first interaction; by default it prints a banner
1604 before the first interaction; by default it prints a banner
1602 similar to the one printed by the real Python interpreter,
1605 similar to the one printed by the real Python interpreter,
1603 followed by the current class name in parentheses (so as not
1606 followed by the current class name in parentheses (so as not
1604 to confuse this with the real interpreter -- since it's so
1607 to confuse this with the real interpreter -- since it's so
1605 close!).
1608 close!).
1606
1609
1607 """
1610 """
1608
1611
1609 if self.exit_now:
1612 if self.exit_now:
1610 # batch run -> do not interact
1613 # batch run -> do not interact
1611 return
1614 return
1612 cprt = 'Type "copyright", "credits" or "license" for more information.'
1615 cprt = 'Type "copyright", "credits" or "license" for more information.'
1613 if banner is None:
1616 if banner is None:
1614 self.write("Python %s on %s\n%s\n(%s)\n" %
1617 self.write("Python %s on %s\n%s\n(%s)\n" %
1615 (sys.version, sys.platform, cprt,
1618 (sys.version, sys.platform, cprt,
1616 self.__class__.__name__))
1619 self.__class__.__name__))
1617 else:
1620 else:
1618 self.write(banner)
1621 self.write(banner)
1619
1622
1620 more = 0
1623 more = 0
1621
1624
1622 # Mark activity in the builtins
1625 # Mark activity in the builtins
1623 __builtin__.__dict__['__IPYTHON__active'] += 1
1626 __builtin__.__dict__['__IPYTHON__active'] += 1
1624
1627
1625 if self.has_readline:
1628 if self.has_readline:
1626 self.readline_startup_hook(self.pre_readline)
1629 self.readline_startup_hook(self.pre_readline)
1627 # exit_now is set by a call to %Exit or %Quit
1630 # exit_now is set by a call to %Exit or %Quit
1628
1631
1629 while not self.exit_now:
1632 while not self.exit_now:
1630 if more:
1633 if more:
1631 prompt = self.hooks.generate_prompt(True)
1634 prompt = self.hooks.generate_prompt(True)
1632 if self.autoindent:
1635 if self.autoindent:
1633 self.rl_do_indent = True
1636 self.rl_do_indent = True
1634
1637
1635 else:
1638 else:
1636 prompt = self.hooks.generate_prompt(False)
1639 prompt = self.hooks.generate_prompt(False)
1637 try:
1640 try:
1638 line = self.raw_input(prompt,more)
1641 line = self.raw_input(prompt,more)
1639 if self.exit_now:
1642 if self.exit_now:
1640 # quick exit on sys.std[in|out] close
1643 # quick exit on sys.std[in|out] close
1641 break
1644 break
1642 if self.autoindent:
1645 if self.autoindent:
1643 self.rl_do_indent = False
1646 self.rl_do_indent = False
1644
1647
1645 except KeyboardInterrupt:
1648 except KeyboardInterrupt:
1646 self.write('\nKeyboardInterrupt\n')
1649 self.write('\nKeyboardInterrupt\n')
1647 self.resetbuffer()
1650 self.resetbuffer()
1648 # keep cache in sync with the prompt counter:
1651 # keep cache in sync with the prompt counter:
1649 self.outputcache.prompt_count -= 1
1652 self.outputcache.prompt_count -= 1
1650
1653
1651 if self.autoindent:
1654 if self.autoindent:
1652 self.indent_current_nsp = 0
1655 self.indent_current_nsp = 0
1653 more = 0
1656 more = 0
1654 except EOFError:
1657 except EOFError:
1655 if self.autoindent:
1658 if self.autoindent:
1656 self.rl_do_indent = False
1659 self.rl_do_indent = False
1657 self.readline_startup_hook(None)
1660 self.readline_startup_hook(None)
1658 self.write('\n')
1661 self.write('\n')
1659 self.exit()
1662 self.exit()
1660 except bdb.BdbQuit:
1663 except bdb.BdbQuit:
1661 warn('The Python debugger has exited with a BdbQuit exception.\n'
1664 warn('The Python debugger has exited with a BdbQuit exception.\n'
1662 'Because of how pdb handles the stack, it is impossible\n'
1665 'Because of how pdb handles the stack, it is impossible\n'
1663 'for IPython to properly format this particular exception.\n'
1666 'for IPython to properly format this particular exception.\n'
1664 'IPython will resume normal operation.')
1667 'IPython will resume normal operation.')
1665 except:
1668 except:
1666 # exceptions here are VERY RARE, but they can be triggered
1669 # exceptions here are VERY RARE, but they can be triggered
1667 # asynchronously by signal handlers, for example.
1670 # asynchronously by signal handlers, for example.
1668 self.showtraceback()
1671 self.showtraceback()
1669 else:
1672 else:
1670 more = self.push(line)
1673 more = self.push(line)
1671 if (self.SyntaxTB.last_syntax_error and
1674 if (self.SyntaxTB.last_syntax_error and
1672 self.rc.autoedit_syntax):
1675 self.rc.autoedit_syntax):
1673 self.edit_syntax_error()
1676 self.edit_syntax_error()
1674
1677
1675 # We are off again...
1678 # We are off again...
1676 __builtin__.__dict__['__IPYTHON__active'] -= 1
1679 __builtin__.__dict__['__IPYTHON__active'] -= 1
1677
1680
1678 def excepthook(self, etype, value, tb):
1681 def excepthook(self, etype, value, tb):
1679 """One more defense for GUI apps that call sys.excepthook.
1682 """One more defense for GUI apps that call sys.excepthook.
1680
1683
1681 GUI frameworks like wxPython trap exceptions and call
1684 GUI frameworks like wxPython trap exceptions and call
1682 sys.excepthook themselves. I guess this is a feature that
1685 sys.excepthook themselves. I guess this is a feature that
1683 enables them to keep running after exceptions that would
1686 enables them to keep running after exceptions that would
1684 otherwise kill their mainloop. This is a bother for IPython
1687 otherwise kill their mainloop. This is a bother for IPython
1685 which excepts to catch all of the program exceptions with a try:
1688 which excepts to catch all of the program exceptions with a try:
1686 except: statement.
1689 except: statement.
1687
1690
1688 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1691 Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
1689 any app directly invokes sys.excepthook, it will look to the user like
1692 any app directly invokes sys.excepthook, it will look to the user like
1690 IPython crashed. In order to work around this, we can disable the
1693 IPython crashed. In order to work around this, we can disable the
1691 CrashHandler and replace it with this excepthook instead, which prints a
1694 CrashHandler and replace it with this excepthook instead, which prints a
1692 regular traceback using our InteractiveTB. In this fashion, apps which
1695 regular traceback using our InteractiveTB. In this fashion, apps which
1693 call sys.excepthook will generate a regular-looking exception from
1696 call sys.excepthook will generate a regular-looking exception from
1694 IPython, and the CrashHandler will only be triggered by real IPython
1697 IPython, and the CrashHandler will only be triggered by real IPython
1695 crashes.
1698 crashes.
1696
1699
1697 This hook should be used sparingly, only in places which are not likely
1700 This hook should be used sparingly, only in places which are not likely
1698 to be true IPython errors.
1701 to be true IPython errors.
1699 """
1702 """
1700 self.showtraceback((etype,value,tb),tb_offset=0)
1703 self.showtraceback((etype,value,tb),tb_offset=0)
1701
1704
1702 def expand_aliases(self,fn,rest):
1705 def expand_aliases(self,fn,rest):
1703 """ Expand multiple levels of aliases:
1706 """ Expand multiple levels of aliases:
1704
1707
1705 if:
1708 if:
1706
1709
1707 alias foo bar /tmp
1710 alias foo bar /tmp
1708 alias baz foo
1711 alias baz foo
1709
1712
1710 then:
1713 then:
1711
1714
1712 baz huhhahhei -> bar /tmp huhhahhei
1715 baz huhhahhei -> bar /tmp huhhahhei
1713
1716
1714 """
1717 """
1715 line = fn + " " + rest
1718 line = fn + " " + rest
1716
1719
1717 done = Set()
1720 done = Set()
1718 while 1:
1721 while 1:
1719 pre,fn,rest = prefilter.splitUserInput(line,
1722 pre,fn,rest = prefilter.splitUserInput(line,
1720 prefilter.shell_line_split)
1723 prefilter.shell_line_split)
1721 if fn in self.alias_table:
1724 if fn in self.alias_table:
1722 if fn in done:
1725 if fn in done:
1723 warn("Cyclic alias definition, repeated '%s'" % fn)
1726 warn("Cyclic alias definition, repeated '%s'" % fn)
1724 return ""
1727 return ""
1725 done.add(fn)
1728 done.add(fn)
1726
1729
1727 l2 = self.transform_alias(fn,rest)
1730 l2 = self.transform_alias(fn,rest)
1728 # dir -> dir
1731 # dir -> dir
1729 # print "alias",line, "->",l2 #dbg
1732 # print "alias",line, "->",l2 #dbg
1730 if l2 == line:
1733 if l2 == line:
1731 break
1734 break
1732 # ls -> ls -F should not recurse forever
1735 # ls -> ls -F should not recurse forever
1733 if l2.split(None,1)[0] == line.split(None,1)[0]:
1736 if l2.split(None,1)[0] == line.split(None,1)[0]:
1734 line = l2
1737 line = l2
1735 break
1738 break
1736
1739
1737 line=l2
1740 line=l2
1738
1741
1739
1742
1740 # print "al expand to",line #dbg
1743 # print "al expand to",line #dbg
1741 else:
1744 else:
1742 break
1745 break
1743
1746
1744 return line
1747 return line
1745
1748
1746 def transform_alias(self, alias,rest=''):
1749 def transform_alias(self, alias,rest=''):
1747 """ Transform alias to system command string.
1750 """ Transform alias to system command string.
1748 """
1751 """
1749 trg = self.alias_table[alias]
1752 trg = self.alias_table[alias]
1750
1753
1751 nargs,cmd = trg
1754 nargs,cmd = trg
1752 # print trg #dbg
1755 # print trg #dbg
1753 if ' ' in cmd and os.path.isfile(cmd):
1756 if ' ' in cmd and os.path.isfile(cmd):
1754 cmd = '"%s"' % cmd
1757 cmd = '"%s"' % cmd
1755
1758
1756 # Expand the %l special to be the user's input line
1759 # Expand the %l special to be the user's input line
1757 if cmd.find('%l') >= 0:
1760 if cmd.find('%l') >= 0:
1758 cmd = cmd.replace('%l',rest)
1761 cmd = cmd.replace('%l',rest)
1759 rest = ''
1762 rest = ''
1760 if nargs==0:
1763 if nargs==0:
1761 # Simple, argument-less aliases
1764 # Simple, argument-less aliases
1762 cmd = '%s %s' % (cmd,rest)
1765 cmd = '%s %s' % (cmd,rest)
1763 else:
1766 else:
1764 # Handle aliases with positional arguments
1767 # Handle aliases with positional arguments
1765 args = rest.split(None,nargs)
1768 args = rest.split(None,nargs)
1766 if len(args)< nargs:
1769 if len(args)< nargs:
1767 error('Alias <%s> requires %s arguments, %s given.' %
1770 error('Alias <%s> requires %s arguments, %s given.' %
1768 (alias,nargs,len(args)))
1771 (alias,nargs,len(args)))
1769 return None
1772 return None
1770 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1773 cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
1771 # Now call the macro, evaluating in the user's namespace
1774 # Now call the macro, evaluating in the user's namespace
1772 #print 'new command: <%r>' % cmd # dbg
1775 #print 'new command: <%r>' % cmd # dbg
1773 return cmd
1776 return cmd
1774
1777
1775 def call_alias(self,alias,rest=''):
1778 def call_alias(self,alias,rest=''):
1776 """Call an alias given its name and the rest of the line.
1779 """Call an alias given its name and the rest of the line.
1777
1780
1778 This is only used to provide backwards compatibility for users of
1781 This is only used to provide backwards compatibility for users of
1779 ipalias(), use of which is not recommended for anymore."""
1782 ipalias(), use of which is not recommended for anymore."""
1780
1783
1781 # Now call the macro, evaluating in the user's namespace
1784 # Now call the macro, evaluating in the user's namespace
1782 cmd = self.transform_alias(alias, rest)
1785 cmd = self.transform_alias(alias, rest)
1783 try:
1786 try:
1784 self.system(cmd)
1787 self.system(cmd)
1785 except:
1788 except:
1786 self.showtraceback()
1789 self.showtraceback()
1787
1790
1788 def indent_current_str(self):
1791 def indent_current_str(self):
1789 """return the current level of indentation as a string"""
1792 """return the current level of indentation as a string"""
1790 return self.indent_current_nsp * ' '
1793 return self.indent_current_nsp * ' '
1791
1794
1792 def autoindent_update(self,line):
1795 def autoindent_update(self,line):
1793 """Keep track of the indent level."""
1796 """Keep track of the indent level."""
1794
1797
1795 #debugx('line')
1798 #debugx('line')
1796 #debugx('self.indent_current_nsp')
1799 #debugx('self.indent_current_nsp')
1797 if self.autoindent:
1800 if self.autoindent:
1798 if line:
1801 if line:
1799 inisp = num_ini_spaces(line)
1802 inisp = num_ini_spaces(line)
1800 if inisp < self.indent_current_nsp:
1803 if inisp < self.indent_current_nsp:
1801 self.indent_current_nsp = inisp
1804 self.indent_current_nsp = inisp
1802
1805
1803 if line[-1] == ':':
1806 if line[-1] == ':':
1804 self.indent_current_nsp += 4
1807 self.indent_current_nsp += 4
1805 elif dedent_re.match(line):
1808 elif dedent_re.match(line):
1806 self.indent_current_nsp -= 4
1809 self.indent_current_nsp -= 4
1807 else:
1810 else:
1808 self.indent_current_nsp = 0
1811 self.indent_current_nsp = 0
1809 def runlines(self,lines):
1812 def runlines(self,lines):
1810 """Run a string of one or more lines of source.
1813 """Run a string of one or more lines of source.
1811
1814
1812 This method is capable of running a string containing multiple source
1815 This method is capable of running a string containing multiple source
1813 lines, as if they had been entered at the IPython prompt. Since it
1816 lines, as if they had been entered at the IPython prompt. Since it
1814 exposes IPython's processing machinery, the given strings can contain
1817 exposes IPython's processing machinery, the given strings can contain
1815 magic calls (%magic), special shell access (!cmd), etc."""
1818 magic calls (%magic), special shell access (!cmd), etc."""
1816
1819
1817 # We must start with a clean buffer, in case this is run from an
1820 # We must start with a clean buffer, in case this is run from an
1818 # interactive IPython session (via a magic, for example).
1821 # interactive IPython session (via a magic, for example).
1819 self.resetbuffer()
1822 self.resetbuffer()
1820 lines = lines.split('\n')
1823 lines = lines.split('\n')
1821 more = 0
1824 more = 0
1822
1825
1823 for line in lines:
1826 for line in lines:
1824 # skip blank lines so we don't mess up the prompt counter, but do
1827 # skip blank lines so we don't mess up the prompt counter, but do
1825 # NOT skip even a blank line if we are in a code block (more is
1828 # NOT skip even a blank line if we are in a code block (more is
1826 # true)
1829 # true)
1827
1830
1828
1831
1829 if line or more:
1832 if line or more:
1830 # push to raw history, so hist line numbers stay in sync
1833 # push to raw history, so hist line numbers stay in sync
1831 self.input_hist_raw.append("# " + line + "\n")
1834 self.input_hist_raw.append("# " + line + "\n")
1832 more = self.push(self.prefilter(line,more))
1835 more = self.push(self.prefilter(line,more))
1833 # IPython's runsource returns None if there was an error
1836 # IPython's runsource returns None if there was an error
1834 # compiling the code. This allows us to stop processing right
1837 # compiling the code. This allows us to stop processing right
1835 # away, so the user gets the error message at the right place.
1838 # away, so the user gets the error message at the right place.
1836 if more is None:
1839 if more is None:
1837 break
1840 break
1838 else:
1841 else:
1839 self.input_hist_raw.append("\n")
1842 self.input_hist_raw.append("\n")
1840 # final newline in case the input didn't have it, so that the code
1843 # final newline in case the input didn't have it, so that the code
1841 # actually does get executed
1844 # actually does get executed
1842 if more:
1845 if more:
1843 self.push('\n')
1846 self.push('\n')
1844
1847
1845 def runsource(self, source, filename='<input>', symbol='single'):
1848 def runsource(self, source, filename='<input>', symbol='single'):
1846 """Compile and run some source in the interpreter.
1849 """Compile and run some source in the interpreter.
1847
1850
1848 Arguments are as for compile_command().
1851 Arguments are as for compile_command().
1849
1852
1850 One several things can happen:
1853 One several things can happen:
1851
1854
1852 1) The input is incorrect; compile_command() raised an
1855 1) The input is incorrect; compile_command() raised an
1853 exception (SyntaxError or OverflowError). A syntax traceback
1856 exception (SyntaxError or OverflowError). A syntax traceback
1854 will be printed by calling the showsyntaxerror() method.
1857 will be printed by calling the showsyntaxerror() method.
1855
1858
1856 2) The input is incomplete, and more input is required;
1859 2) The input is incomplete, and more input is required;
1857 compile_command() returned None. Nothing happens.
1860 compile_command() returned None. Nothing happens.
1858
1861
1859 3) The input is complete; compile_command() returned a code
1862 3) The input is complete; compile_command() returned a code
1860 object. The code is executed by calling self.runcode() (which
1863 object. The code is executed by calling self.runcode() (which
1861 also handles run-time exceptions, except for SystemExit).
1864 also handles run-time exceptions, except for SystemExit).
1862
1865
1863 The return value is:
1866 The return value is:
1864
1867
1865 - True in case 2
1868 - True in case 2
1866
1869
1867 - False in the other cases, unless an exception is raised, where
1870 - False in the other cases, unless an exception is raised, where
1868 None is returned instead. This can be used by external callers to
1871 None is returned instead. This can be used by external callers to
1869 know whether to continue feeding input or not.
1872 know whether to continue feeding input or not.
1870
1873
1871 The return value can be used to decide whether to use sys.ps1 or
1874 The return value can be used to decide whether to use sys.ps1 or
1872 sys.ps2 to prompt the next line."""
1875 sys.ps2 to prompt the next line."""
1873
1876
1874 # if the source code has leading blanks, add 'if 1:\n' to it
1877 # if the source code has leading blanks, add 'if 1:\n' to it
1875 # this allows execution of indented pasted code. It is tempting
1878 # this allows execution of indented pasted code. It is tempting
1876 # to add '\n' at the end of source to run commands like ' a=1'
1879 # to add '\n' at the end of source to run commands like ' a=1'
1877 # directly, but this fails for more complicated scenarios
1880 # directly, but this fails for more complicated scenarios
1878 if source[:1] in [' ', '\t']:
1881 if source[:1] in [' ', '\t']:
1879 source = 'if 1:\n%s' % source
1882 source = 'if 1:\n%s' % source
1880
1883
1881 try:
1884 try:
1882 code = self.compile(source,filename,symbol)
1885 code = self.compile(source,filename,symbol)
1883 except (OverflowError, SyntaxError, ValueError):
1886 except (OverflowError, SyntaxError, ValueError):
1884 # Case 1
1887 # Case 1
1885 self.showsyntaxerror(filename)
1888 self.showsyntaxerror(filename)
1886 return None
1889 return None
1887
1890
1888 if code is None:
1891 if code is None:
1889 # Case 2
1892 # Case 2
1890 return True
1893 return True
1891
1894
1892 # Case 3
1895 # Case 3
1893 # We store the code object so that threaded shells and
1896 # We store the code object so that threaded shells and
1894 # custom exception handlers can access all this info if needed.
1897 # custom exception handlers can access all this info if needed.
1895 # The source corresponding to this can be obtained from the
1898 # The source corresponding to this can be obtained from the
1896 # buffer attribute as '\n'.join(self.buffer).
1899 # buffer attribute as '\n'.join(self.buffer).
1897 self.code_to_run = code
1900 self.code_to_run = code
1898 # now actually execute the code object
1901 # now actually execute the code object
1899 if self.runcode(code) == 0:
1902 if self.runcode(code) == 0:
1900 return False
1903 return False
1901 else:
1904 else:
1902 return None
1905 return None
1903
1906
1904 def runcode(self,code_obj):
1907 def runcode(self,code_obj):
1905 """Execute a code object.
1908 """Execute a code object.
1906
1909
1907 When an exception occurs, self.showtraceback() is called to display a
1910 When an exception occurs, self.showtraceback() is called to display a
1908 traceback.
1911 traceback.
1909
1912
1910 Return value: a flag indicating whether the code to be run completed
1913 Return value: a flag indicating whether the code to be run completed
1911 successfully:
1914 successfully:
1912
1915
1913 - 0: successful execution.
1916 - 0: successful execution.
1914 - 1: an error occurred.
1917 - 1: an error occurred.
1915 """
1918 """
1916
1919
1917 # Set our own excepthook in case the user code tries to call it
1920 # Set our own excepthook in case the user code tries to call it
1918 # directly, so that the IPython crash handler doesn't get triggered
1921 # directly, so that the IPython crash handler doesn't get triggered
1919 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1922 old_excepthook,sys.excepthook = sys.excepthook, self.excepthook
1920
1923
1921 # we save the original sys.excepthook in the instance, in case config
1924 # we save the original sys.excepthook in the instance, in case config
1922 # code (such as magics) needs access to it.
1925 # code (such as magics) needs access to it.
1923 self.sys_excepthook = old_excepthook
1926 self.sys_excepthook = old_excepthook
1924 outflag = 1 # happens in more places, so it's easier as default
1927 outflag = 1 # happens in more places, so it's easier as default
1925 try:
1928 try:
1926 try:
1929 try:
1927 # Embedded instances require separate global/local namespaces
1930 # Embedded instances require separate global/local namespaces
1928 # so they can see both the surrounding (local) namespace and
1931 # so they can see both the surrounding (local) namespace and
1929 # the module-level globals when called inside another function.
1932 # the module-level globals when called inside another function.
1930 if self.embedded:
1933 if self.embedded:
1931 exec code_obj in self.user_global_ns, self.user_ns
1934 exec code_obj in self.user_global_ns, self.user_ns
1932 # Normal (non-embedded) instances should only have a single
1935 # Normal (non-embedded) instances should only have a single
1933 # namespace for user code execution, otherwise functions won't
1936 # namespace for user code execution, otherwise functions won't
1934 # see interactive top-level globals.
1937 # see interactive top-level globals.
1935 else:
1938 else:
1936 exec code_obj in self.user_ns
1939 exec code_obj in self.user_ns
1937 finally:
1940 finally:
1938 # Reset our crash handler in place
1941 # Reset our crash handler in place
1939 sys.excepthook = old_excepthook
1942 sys.excepthook = old_excepthook
1940 except SystemExit:
1943 except SystemExit:
1941 self.resetbuffer()
1944 self.resetbuffer()
1942 self.showtraceback()
1945 self.showtraceback()
1943 warn("Type %exit or %quit to exit IPython "
1946 warn("Type %exit or %quit to exit IPython "
1944 "(%Exit or %Quit do so unconditionally).",level=1)
1947 "(%Exit or %Quit do so unconditionally).",level=1)
1945 except self.custom_exceptions:
1948 except self.custom_exceptions:
1946 etype,value,tb = sys.exc_info()
1949 etype,value,tb = sys.exc_info()
1947 self.CustomTB(etype,value,tb)
1950 self.CustomTB(etype,value,tb)
1948 except:
1951 except:
1949 self.showtraceback()
1952 self.showtraceback()
1950 else:
1953 else:
1951 outflag = 0
1954 outflag = 0
1952 if softspace(sys.stdout, 0):
1955 if softspace(sys.stdout, 0):
1953 print
1956 print
1954 # Flush out code object which has been run (and source)
1957 # Flush out code object which has been run (and source)
1955 self.code_to_run = None
1958 self.code_to_run = None
1956 return outflag
1959 return outflag
1957
1960
1958 def push(self, line):
1961 def push(self, line):
1959 """Push a line to the interpreter.
1962 """Push a line to the interpreter.
1960
1963
1961 The line should not have a trailing newline; it may have
1964 The line should not have a trailing newline; it may have
1962 internal newlines. The line is appended to a buffer and the
1965 internal newlines. The line is appended to a buffer and the
1963 interpreter's runsource() method is called with the
1966 interpreter's runsource() method is called with the
1964 concatenated contents of the buffer as source. If this
1967 concatenated contents of the buffer as source. If this
1965 indicates that the command was executed or invalid, the buffer
1968 indicates that the command was executed or invalid, the buffer
1966 is reset; otherwise, the command is incomplete, and the buffer
1969 is reset; otherwise, the command is incomplete, and the buffer
1967 is left as it was after the line was appended. The return
1970 is left as it was after the line was appended. The return
1968 value is 1 if more input is required, 0 if the line was dealt
1971 value is 1 if more input is required, 0 if the line was dealt
1969 with in some way (this is the same as runsource()).
1972 with in some way (this is the same as runsource()).
1970 """
1973 """
1971
1974
1972 # autoindent management should be done here, and not in the
1975 # autoindent management should be done here, and not in the
1973 # interactive loop, since that one is only seen by keyboard input. We
1976 # interactive loop, since that one is only seen by keyboard input. We
1974 # need this done correctly even for code run via runlines (which uses
1977 # need this done correctly even for code run via runlines (which uses
1975 # push).
1978 # push).
1976
1979
1977 #print 'push line: <%s>' % line # dbg
1980 #print 'push line: <%s>' % line # dbg
1978 for subline in line.splitlines():
1981 for subline in line.splitlines():
1979 self.autoindent_update(subline)
1982 self.autoindent_update(subline)
1980 self.buffer.append(line)
1983 self.buffer.append(line)
1981 more = self.runsource('\n'.join(self.buffer), self.filename)
1984 more = self.runsource('\n'.join(self.buffer), self.filename)
1982 if not more:
1985 if not more:
1983 self.resetbuffer()
1986 self.resetbuffer()
1984 return more
1987 return more
1985
1988
1986 def split_user_input(self, line):
1989 def split_user_input(self, line):
1987 # This is really a hold-over to support ipapi and some extensions
1990 # This is really a hold-over to support ipapi and some extensions
1988 return prefilter.splitUserInput(line)
1991 return prefilter.splitUserInput(line)
1989
1992
1990 def resetbuffer(self):
1993 def resetbuffer(self):
1991 """Reset the input buffer."""
1994 """Reset the input buffer."""
1992 self.buffer[:] = []
1995 self.buffer[:] = []
1993
1996
1994 def raw_input(self,prompt='',continue_prompt=False):
1997 def raw_input(self,prompt='',continue_prompt=False):
1995 """Write a prompt and read a line.
1998 """Write a prompt and read a line.
1996
1999
1997 The returned line does not include the trailing newline.
2000 The returned line does not include the trailing newline.
1998 When the user enters the EOF key sequence, EOFError is raised.
2001 When the user enters the EOF key sequence, EOFError is raised.
1999
2002
2000 Optional inputs:
2003 Optional inputs:
2001
2004
2002 - prompt(''): a string to be printed to prompt the user.
2005 - prompt(''): a string to be printed to prompt the user.
2003
2006
2004 - continue_prompt(False): whether this line is the first one or a
2007 - continue_prompt(False): whether this line is the first one or a
2005 continuation in a sequence of inputs.
2008 continuation in a sequence of inputs.
2006 """
2009 """
2007
2010
2008 # Code run by the user may have modified the readline completer state.
2011 # Code run by the user may have modified the readline completer state.
2009 # We must ensure that our completer is back in place.
2012 # We must ensure that our completer is back in place.
2010 if self.has_readline:
2013 if self.has_readline:
2011 self.set_completer()
2014 self.set_completer()
2012
2015
2013 try:
2016 try:
2014 line = raw_input_original(prompt).decode(self.stdin_encoding)
2017 line = raw_input_original(prompt).decode(self.stdin_encoding)
2015 except ValueError:
2018 except ValueError:
2016 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2019 warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
2017 " or sys.stdout.close()!\nExiting IPython!")
2020 " or sys.stdout.close()!\nExiting IPython!")
2018 self.exit_now = True
2021 self.exit_now = True
2019 return ""
2022 return ""
2020
2023
2021 # Try to be reasonably smart about not re-indenting pasted input more
2024 # Try to be reasonably smart about not re-indenting pasted input more
2022 # than necessary. We do this by trimming out the auto-indent initial
2025 # than necessary. We do this by trimming out the auto-indent initial
2023 # spaces, if the user's actual input started itself with whitespace.
2026 # spaces, if the user's actual input started itself with whitespace.
2024 #debugx('self.buffer[-1]')
2027 #debugx('self.buffer[-1]')
2025
2028
2026 if self.autoindent:
2029 if self.autoindent:
2027 if num_ini_spaces(line) > self.indent_current_nsp:
2030 if num_ini_spaces(line) > self.indent_current_nsp:
2028 line = line[self.indent_current_nsp:]
2031 line = line[self.indent_current_nsp:]
2029 self.indent_current_nsp = 0
2032 self.indent_current_nsp = 0
2030
2033
2031 # store the unfiltered input before the user has any chance to modify
2034 # store the unfiltered input before the user has any chance to modify
2032 # it.
2035 # it.
2033 if line.strip():
2036 if line.strip():
2034 if continue_prompt:
2037 if continue_prompt:
2035 self.input_hist_raw[-1] += '%s\n' % line
2038 self.input_hist_raw[-1] += '%s\n' % line
2036 if self.has_readline: # and some config option is set?
2039 if self.has_readline: # and some config option is set?
2037 try:
2040 try:
2038 histlen = self.readline.get_current_history_length()
2041 histlen = self.readline.get_current_history_length()
2039 newhist = self.input_hist_raw[-1].rstrip()
2042 newhist = self.input_hist_raw[-1].rstrip()
2040 self.readline.remove_history_item(histlen-1)
2043 self.readline.remove_history_item(histlen-1)
2041 self.readline.replace_history_item(histlen-2,newhist)
2044 self.readline.replace_history_item(histlen-2,newhist)
2042 except AttributeError:
2045 except AttributeError:
2043 pass # re{move,place}_history_item are new in 2.4.
2046 pass # re{move,place}_history_item are new in 2.4.
2044 else:
2047 else:
2045 self.input_hist_raw.append('%s\n' % line)
2048 self.input_hist_raw.append('%s\n' % line)
2046 # only entries starting at first column go to shadow history
2049 # only entries starting at first column go to shadow history
2047 if line.lstrip() == line:
2050 if line.lstrip() == line:
2048 self.shadowhist.add(line.strip())
2051 self.shadowhist.add(line.strip())
2049 elif not continue_prompt:
2052 elif not continue_prompt:
2050 self.input_hist_raw.append('\n')
2053 self.input_hist_raw.append('\n')
2051 try:
2054 try:
2052 lineout = self.prefilter(line,continue_prompt)
2055 lineout = self.prefilter(line,continue_prompt)
2053 except:
2056 except:
2054 # blanket except, in case a user-defined prefilter crashes, so it
2057 # blanket except, in case a user-defined prefilter crashes, so it
2055 # can't take all of ipython with it.
2058 # can't take all of ipython with it.
2056 self.showtraceback()
2059 self.showtraceback()
2057 return ''
2060 return ''
2058 else:
2061 else:
2059 return lineout
2062 return lineout
2060
2063
2061 def _prefilter(self, line, continue_prompt):
2064 def _prefilter(self, line, continue_prompt):
2062 """Calls different preprocessors, depending on the form of line."""
2065 """Calls different preprocessors, depending on the form of line."""
2063
2066
2064 # All handlers *must* return a value, even if it's blank ('').
2067 # All handlers *must* return a value, even if it's blank ('').
2065
2068
2066 # Lines are NOT logged here. Handlers should process the line as
2069 # Lines are NOT logged here. Handlers should process the line as
2067 # needed, update the cache AND log it (so that the input cache array
2070 # needed, update the cache AND log it (so that the input cache array
2068 # stays synced).
2071 # stays synced).
2069
2072
2070 #.....................................................................
2073 #.....................................................................
2071 # Code begins
2074 # Code begins
2072
2075
2073 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2076 #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg
2074
2077
2075 # save the line away in case we crash, so the post-mortem handler can
2078 # save the line away in case we crash, so the post-mortem handler can
2076 # record it
2079 # record it
2077 self._last_input_line = line
2080 self._last_input_line = line
2078
2081
2079 #print '***line: <%s>' % line # dbg
2082 #print '***line: <%s>' % line # dbg
2080
2083
2081 if not line:
2084 if not line:
2082 # Return immediately on purely empty lines, so that if the user
2085 # Return immediately on purely empty lines, so that if the user
2083 # previously typed some whitespace that started a continuation
2086 # previously typed some whitespace that started a continuation
2084 # prompt, he can break out of that loop with just an empty line.
2087 # prompt, he can break out of that loop with just an empty line.
2085 # This is how the default python prompt works.
2088 # This is how the default python prompt works.
2086
2089
2087 # Only return if the accumulated input buffer was just whitespace!
2090 # Only return if the accumulated input buffer was just whitespace!
2088 if ''.join(self.buffer).isspace():
2091 if ''.join(self.buffer).isspace():
2089 self.buffer[:] = []
2092 self.buffer[:] = []
2090 return ''
2093 return ''
2091
2094
2092 line_info = prefilter.LineInfo(line, continue_prompt)
2095 line_info = prefilter.LineInfo(line, continue_prompt)
2093
2096
2094 # the input history needs to track even empty lines
2097 # the input history needs to track even empty lines
2095 stripped = line.strip()
2098 stripped = line.strip()
2096
2099
2097 if not stripped:
2100 if not stripped:
2098 if not continue_prompt:
2101 if not continue_prompt:
2099 self.outputcache.prompt_count -= 1
2102 self.outputcache.prompt_count -= 1
2100 return self.handle_normal(line_info)
2103 return self.handle_normal(line_info)
2101
2104
2102 # print '***cont',continue_prompt # dbg
2105 # print '***cont',continue_prompt # dbg
2103 # special handlers are only allowed for single line statements
2106 # special handlers are only allowed for single line statements
2104 if continue_prompt and not self.rc.multi_line_specials:
2107 if continue_prompt and not self.rc.multi_line_specials:
2105 return self.handle_normal(line_info)
2108 return self.handle_normal(line_info)
2106
2109
2107
2110
2108 # See whether any pre-existing handler can take care of it
2111 # See whether any pre-existing handler can take care of it
2109 rewritten = self.hooks.input_prefilter(stripped)
2112 rewritten = self.hooks.input_prefilter(stripped)
2110 if rewritten != stripped: # ok, some prefilter did something
2113 if rewritten != stripped: # ok, some prefilter did something
2111 rewritten = line_info.pre + rewritten # add indentation
2114 rewritten = line_info.pre + rewritten # add indentation
2112 return self.handle_normal(prefilter.LineInfo(rewritten,
2115 return self.handle_normal(prefilter.LineInfo(rewritten,
2113 continue_prompt))
2116 continue_prompt))
2114
2117
2115 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2118 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2116
2119
2117 return prefilter.prefilter(line_info, self)
2120 return prefilter.prefilter(line_info, self)
2118
2121
2119
2122
2120 def _prefilter_dumb(self, line, continue_prompt):
2123 def _prefilter_dumb(self, line, continue_prompt):
2121 """simple prefilter function, for debugging"""
2124 """simple prefilter function, for debugging"""
2122 return self.handle_normal(line,continue_prompt)
2125 return self.handle_normal(line,continue_prompt)
2123
2126
2124
2127
2125 def multiline_prefilter(self, line, continue_prompt):
2128 def multiline_prefilter(self, line, continue_prompt):
2126 """ Run _prefilter for each line of input
2129 """ Run _prefilter for each line of input
2127
2130
2128 Covers cases where there are multiple lines in the user entry,
2131 Covers cases where there are multiple lines in the user entry,
2129 which is the case when the user goes back to a multiline history
2132 which is the case when the user goes back to a multiline history
2130 entry and presses enter.
2133 entry and presses enter.
2131
2134
2132 """
2135 """
2133 out = []
2136 out = []
2134 for l in line.rstrip('\n').split('\n'):
2137 for l in line.rstrip('\n').split('\n'):
2135 out.append(self._prefilter(l, continue_prompt))
2138 out.append(self._prefilter(l, continue_prompt))
2136 return '\n'.join(out)
2139 return '\n'.join(out)
2137
2140
2138 # Set the default prefilter() function (this can be user-overridden)
2141 # Set the default prefilter() function (this can be user-overridden)
2139 prefilter = multiline_prefilter
2142 prefilter = multiline_prefilter
2140
2143
2141 def handle_normal(self,line_info):
2144 def handle_normal(self,line_info):
2142 """Handle normal input lines. Use as a template for handlers."""
2145 """Handle normal input lines. Use as a template for handlers."""
2143
2146
2144 # With autoindent on, we need some way to exit the input loop, and I
2147 # With autoindent on, we need some way to exit the input loop, and I
2145 # don't want to force the user to have to backspace all the way to
2148 # don't want to force the user to have to backspace all the way to
2146 # clear the line. The rule will be in this case, that either two
2149 # clear the line. The rule will be in this case, that either two
2147 # lines of pure whitespace in a row, or a line of pure whitespace but
2150 # lines of pure whitespace in a row, or a line of pure whitespace but
2148 # of a size different to the indent level, will exit the input loop.
2151 # of a size different to the indent level, will exit the input loop.
2149 line = line_info.line
2152 line = line_info.line
2150 continue_prompt = line_info.continue_prompt
2153 continue_prompt = line_info.continue_prompt
2151
2154
2152 if (continue_prompt and self.autoindent and line.isspace() and
2155 if (continue_prompt and self.autoindent and line.isspace() and
2153 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2156 (0 < abs(len(line) - self.indent_current_nsp) <= 2 or
2154 (self.buffer[-1]).isspace() )):
2157 (self.buffer[-1]).isspace() )):
2155 line = ''
2158 line = ''
2156
2159
2157 self.log(line,line,continue_prompt)
2160 self.log(line,line,continue_prompt)
2158 return line
2161 return line
2159
2162
2160 def handle_alias(self,line_info):
2163 def handle_alias(self,line_info):
2161 """Handle alias input lines. """
2164 """Handle alias input lines. """
2162 tgt = self.alias_table[line_info.iFun]
2165 tgt = self.alias_table[line_info.iFun]
2163 # print "=>",tgt #dbg
2166 # print "=>",tgt #dbg
2164 if callable(tgt):
2167 if callable(tgt):
2165 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.line + '""")'
2168 line_out = "_sh." + line_info.iFun + '(r"""' + line_info.line + '""")'
2166 else:
2169 else:
2167 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2170 transformed = self.expand_aliases(line_info.iFun,line_info.theRest)
2168
2171
2169 # pre is needed, because it carries the leading whitespace. Otherwise
2172 # pre is needed, because it carries the leading whitespace. Otherwise
2170 # aliases won't work in indented sections.
2173 # aliases won't work in indented sections.
2171 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2174 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2172 make_quoted_expr( transformed ))
2175 make_quoted_expr( transformed ))
2173
2176
2174 self.log(line_info.line,line_out,line_info.continue_prompt)
2177 self.log(line_info.line,line_out,line_info.continue_prompt)
2175 #print 'line out:',line_out # dbg
2178 #print 'line out:',line_out # dbg
2176 return line_out
2179 return line_out
2177
2180
2178 def handle_shell_escape(self, line_info):
2181 def handle_shell_escape(self, line_info):
2179 """Execute the line in a shell, empty return value"""
2182 """Execute the line in a shell, empty return value"""
2180 #print 'line in :', `line` # dbg
2183 #print 'line in :', `line` # dbg
2181 line = line_info.line
2184 line = line_info.line
2182 if line.lstrip().startswith('!!'):
2185 if line.lstrip().startswith('!!'):
2183 # rewrite LineInfo's line, iFun and theRest to properly hold the
2186 # rewrite LineInfo's line, iFun and theRest to properly hold the
2184 # call to %sx and the actual command to be executed, so
2187 # call to %sx and the actual command to be executed, so
2185 # handle_magic can work correctly. Note that this works even if
2188 # handle_magic can work correctly. Note that this works even if
2186 # the line is indented, so it handles multi_line_specials
2189 # the line is indented, so it handles multi_line_specials
2187 # properly.
2190 # properly.
2188 new_rest = line.lstrip()[2:]
2191 new_rest = line.lstrip()[2:]
2189 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2192 line_info.line = '%ssx %s' % (self.ESC_MAGIC,new_rest)
2190 line_info.iFun = 'sx'
2193 line_info.iFun = 'sx'
2191 line_info.theRest = new_rest
2194 line_info.theRest = new_rest
2192 return self.handle_magic(line_info)
2195 return self.handle_magic(line_info)
2193 else:
2196 else:
2194 cmd = line.lstrip().lstrip('!')
2197 cmd = line.lstrip().lstrip('!')
2195 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2198 line_out = '%s_ip.system(%s)' % (line_info.preWhitespace,
2196 make_quoted_expr(cmd))
2199 make_quoted_expr(cmd))
2197 # update cache/log and return
2200 # update cache/log and return
2198 self.log(line,line_out,line_info.continue_prompt)
2201 self.log(line,line_out,line_info.continue_prompt)
2199 return line_out
2202 return line_out
2200
2203
2201 def handle_magic(self, line_info):
2204 def handle_magic(self, line_info):
2202 """Execute magic functions."""
2205 """Execute magic functions."""
2203 iFun = line_info.iFun
2206 iFun = line_info.iFun
2204 theRest = line_info.theRest
2207 theRest = line_info.theRest
2205 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2208 cmd = '%s_ip.magic(%s)' % (line_info.preWhitespace,
2206 make_quoted_expr(iFun + " " + theRest))
2209 make_quoted_expr(iFun + " " + theRest))
2207 self.log(line_info.line,cmd,line_info.continue_prompt)
2210 self.log(line_info.line,cmd,line_info.continue_prompt)
2208 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2211 #print 'in handle_magic, cmd=<%s>' % cmd # dbg
2209 return cmd
2212 return cmd
2210
2213
2211 def handle_auto(self, line_info):
2214 def handle_auto(self, line_info):
2212 """Hande lines which can be auto-executed, quoting if requested."""
2215 """Hande lines which can be auto-executed, quoting if requested."""
2213
2216
2214 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2217 #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg
2215 line = line_info.line
2218 line = line_info.line
2216 iFun = line_info.iFun
2219 iFun = line_info.iFun
2217 theRest = line_info.theRest
2220 theRest = line_info.theRest
2218 pre = line_info.pre
2221 pre = line_info.pre
2219 continue_prompt = line_info.continue_prompt
2222 continue_prompt = line_info.continue_prompt
2220 obj = line_info.ofind(self)['obj']
2223 obj = line_info.ofind(self)['obj']
2221
2224
2222 # This should only be active for single-line input!
2225 # This should only be active for single-line input!
2223 if continue_prompt:
2226 if continue_prompt:
2224 self.log(line,line,continue_prompt)
2227 self.log(line,line,continue_prompt)
2225 return line
2228 return line
2226
2229
2227 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2230 force_auto = isinstance(obj, IPython.ipapi.IPyAutocall)
2228 auto_rewrite = True
2231 auto_rewrite = True
2229
2232
2230 if pre == self.ESC_QUOTE:
2233 if pre == self.ESC_QUOTE:
2231 # Auto-quote splitting on whitespace
2234 # Auto-quote splitting on whitespace
2232 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2235 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
2233 elif pre == self.ESC_QUOTE2:
2236 elif pre == self.ESC_QUOTE2:
2234 # Auto-quote whole string
2237 # Auto-quote whole string
2235 newcmd = '%s("%s")' % (iFun,theRest)
2238 newcmd = '%s("%s")' % (iFun,theRest)
2236 elif pre == self.ESC_PAREN:
2239 elif pre == self.ESC_PAREN:
2237 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2240 newcmd = '%s(%s)' % (iFun,",".join(theRest.split()))
2238 else:
2241 else:
2239 # Auto-paren.
2242 # Auto-paren.
2240 # We only apply it to argument-less calls if the autocall
2243 # We only apply it to argument-less calls if the autocall
2241 # parameter is set to 2. We only need to check that autocall is <
2244 # parameter is set to 2. We only need to check that autocall is <
2242 # 2, since this function isn't called unless it's at least 1.
2245 # 2, since this function isn't called unless it's at least 1.
2243 if not theRest and (self.rc.autocall < 2) and not force_auto:
2246 if not theRest and (self.rc.autocall < 2) and not force_auto:
2244 newcmd = '%s %s' % (iFun,theRest)
2247 newcmd = '%s %s' % (iFun,theRest)
2245 auto_rewrite = False
2248 auto_rewrite = False
2246 else:
2249 else:
2247 if not force_auto and theRest.startswith('['):
2250 if not force_auto and theRest.startswith('['):
2248 if hasattr(obj,'__getitem__'):
2251 if hasattr(obj,'__getitem__'):
2249 # Don't autocall in this case: item access for an object
2252 # Don't autocall in this case: item access for an object
2250 # which is BOTH callable and implements __getitem__.
2253 # which is BOTH callable and implements __getitem__.
2251 newcmd = '%s %s' % (iFun,theRest)
2254 newcmd = '%s %s' % (iFun,theRest)
2252 auto_rewrite = False
2255 auto_rewrite = False
2253 else:
2256 else:
2254 # if the object doesn't support [] access, go ahead and
2257 # if the object doesn't support [] access, go ahead and
2255 # autocall
2258 # autocall
2256 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2259 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
2257 elif theRest.endswith(';'):
2260 elif theRest.endswith(';'):
2258 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2261 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
2259 else:
2262 else:
2260 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2263 newcmd = '%s(%s)' % (iFun.rstrip(), theRest)
2261
2264
2262 if auto_rewrite:
2265 if auto_rewrite:
2263 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2266 rw = self.outputcache.prompt1.auto_rewrite() + newcmd
2264
2267
2265 try:
2268 try:
2266 # plain ascii works better w/ pyreadline, on some machines, so
2269 # plain ascii works better w/ pyreadline, on some machines, so
2267 # we use it and only print uncolored rewrite if we have unicode
2270 # we use it and only print uncolored rewrite if we have unicode
2268 rw = str(rw)
2271 rw = str(rw)
2269 print >>Term.cout, rw
2272 print >>Term.cout, rw
2270 except UnicodeEncodeError:
2273 except UnicodeEncodeError:
2271 print "-------------->" + newcmd
2274 print "-------------->" + newcmd
2272
2275
2273 # log what is now valid Python, not the actual user input (without the
2276 # log what is now valid Python, not the actual user input (without the
2274 # final newline)
2277 # final newline)
2275 self.log(line,newcmd,continue_prompt)
2278 self.log(line,newcmd,continue_prompt)
2276 return newcmd
2279 return newcmd
2277
2280
2278 def handle_help(self, line_info):
2281 def handle_help(self, line_info):
2279 """Try to get some help for the object.
2282 """Try to get some help for the object.
2280
2283
2281 obj? or ?obj -> basic information.
2284 obj? or ?obj -> basic information.
2282 obj?? or ??obj -> more details.
2285 obj?? or ??obj -> more details.
2283 """
2286 """
2284
2287
2285 line = line_info.line
2288 line = line_info.line
2286 # We need to make sure that we don't process lines which would be
2289 # We need to make sure that we don't process lines which would be
2287 # otherwise valid python, such as "x=1 # what?"
2290 # otherwise valid python, such as "x=1 # what?"
2288 try:
2291 try:
2289 codeop.compile_command(line)
2292 codeop.compile_command(line)
2290 except SyntaxError:
2293 except SyntaxError:
2291 # We should only handle as help stuff which is NOT valid syntax
2294 # We should only handle as help stuff which is NOT valid syntax
2292 if line[0]==self.ESC_HELP:
2295 if line[0]==self.ESC_HELP:
2293 line = line[1:]
2296 line = line[1:]
2294 elif line[-1]==self.ESC_HELP:
2297 elif line[-1]==self.ESC_HELP:
2295 line = line[:-1]
2298 line = line[:-1]
2296 self.log(line,'#?'+line,line_info.continue_prompt)
2299 self.log(line,'#?'+line,line_info.continue_prompt)
2297 if line:
2300 if line:
2298 #print 'line:<%r>' % line # dbg
2301 #print 'line:<%r>' % line # dbg
2299 self.magic_pinfo(line)
2302 self.magic_pinfo(line)
2300 else:
2303 else:
2301 page(self.usage,screen_lines=self.rc.screen_length)
2304 page(self.usage,screen_lines=self.rc.screen_length)
2302 return '' # Empty string is needed here!
2305 return '' # Empty string is needed here!
2303 except:
2306 except:
2304 # Pass any other exceptions through to the normal handler
2307 # Pass any other exceptions through to the normal handler
2305 return self.handle_normal(line_info)
2308 return self.handle_normal(line_info)
2306 else:
2309 else:
2307 # If the code compiles ok, we should handle it normally
2310 # If the code compiles ok, we should handle it normally
2308 return self.handle_normal(line_info)
2311 return self.handle_normal(line_info)
2309
2312
2310 def getapi(self):
2313 def getapi(self):
2311 """ Get an IPApi object for this shell instance
2314 """ Get an IPApi object for this shell instance
2312
2315
2313 Getting an IPApi object is always preferable to accessing the shell
2316 Getting an IPApi object is always preferable to accessing the shell
2314 directly, but this holds true especially for extensions.
2317 directly, but this holds true especially for extensions.
2315
2318
2316 It should always be possible to implement an extension with IPApi
2319 It should always be possible to implement an extension with IPApi
2317 alone. If not, contact maintainer to request an addition.
2320 alone. If not, contact maintainer to request an addition.
2318
2321
2319 """
2322 """
2320 return self.api
2323 return self.api
2321
2324
2322 def handle_emacs(self, line_info):
2325 def handle_emacs(self, line_info):
2323 """Handle input lines marked by python-mode."""
2326 """Handle input lines marked by python-mode."""
2324
2327
2325 # Currently, nothing is done. Later more functionality can be added
2328 # Currently, nothing is done. Later more functionality can be added
2326 # here if needed.
2329 # here if needed.
2327
2330
2328 # The input cache shouldn't be updated
2331 # The input cache shouldn't be updated
2329 return line_info.line
2332 return line_info.line
2330
2333
2331
2334
2332 def mktempfile(self,data=None):
2335 def mktempfile(self,data=None):
2333 """Make a new tempfile and return its filename.
2336 """Make a new tempfile and return its filename.
2334
2337
2335 This makes a call to tempfile.mktemp, but it registers the created
2338 This makes a call to tempfile.mktemp, but it registers the created
2336 filename internally so ipython cleans it up at exit time.
2339 filename internally so ipython cleans it up at exit time.
2337
2340
2338 Optional inputs:
2341 Optional inputs:
2339
2342
2340 - data(None): if data is given, it gets written out to the temp file
2343 - data(None): if data is given, it gets written out to the temp file
2341 immediately, and the file is closed again."""
2344 immediately, and the file is closed again."""
2342
2345
2343 filename = tempfile.mktemp('.py','ipython_edit_')
2346 filename = tempfile.mktemp('.py','ipython_edit_')
2344 self.tempfiles.append(filename)
2347 self.tempfiles.append(filename)
2345
2348
2346 if data:
2349 if data:
2347 tmp_file = open(filename,'w')
2350 tmp_file = open(filename,'w')
2348 tmp_file.write(data)
2351 tmp_file.write(data)
2349 tmp_file.close()
2352 tmp_file.close()
2350 return filename
2353 return filename
2351
2354
2352 def write(self,data):
2355 def write(self,data):
2353 """Write a string to the default output"""
2356 """Write a string to the default output"""
2354 Term.cout.write(data)
2357 Term.cout.write(data)
2355
2358
2356 def write_err(self,data):
2359 def write_err(self,data):
2357 """Write a string to the default error output"""
2360 """Write a string to the default error output"""
2358 Term.cerr.write(data)
2361 Term.cerr.write(data)
2359
2362
2360 def exit(self):
2363 def exit(self):
2361 """Handle interactive exit.
2364 """Handle interactive exit.
2362
2365
2363 This method sets the exit_now attribute."""
2366 This method sets the exit_now attribute."""
2364
2367
2365 if self.rc.confirm_exit:
2368 if self.rc.confirm_exit:
2366 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2369 if self.ask_yes_no('Do you really want to exit ([y]/n)?','y'):
2367 self.exit_now = True
2370 self.exit_now = True
2368 else:
2371 else:
2369 self.exit_now = True
2372 self.exit_now = True
2370
2373
2371 def safe_execfile(self,fname,*where,**kw):
2374 def safe_execfile(self,fname,*where,**kw):
2372 """A safe version of the builtin execfile().
2375 """A safe version of the builtin execfile().
2373
2376
2374 This version will never throw an exception, and knows how to handle
2377 This version will never throw an exception, and knows how to handle
2375 ipython logs as well."""
2378 ipython logs as well."""
2376
2379
2377 def syspath_cleanup():
2380 def syspath_cleanup():
2378 """Internal cleanup routine for sys.path."""
2381 """Internal cleanup routine for sys.path."""
2379 if add_dname:
2382 if add_dname:
2380 try:
2383 try:
2381 sys.path.remove(dname)
2384 sys.path.remove(dname)
2382 except ValueError:
2385 except ValueError:
2383 # For some reason the user has already removed it, ignore.
2386 # For some reason the user has already removed it, ignore.
2384 pass
2387 pass
2385
2388
2386 fname = os.path.expanduser(fname)
2389 fname = os.path.expanduser(fname)
2387
2390
2388 # Find things also in current directory. This is needed to mimic the
2391 # Find things also in current directory. This is needed to mimic the
2389 # behavior of running a script from the system command line, where
2392 # behavior of running a script from the system command line, where
2390 # Python inserts the script's directory into sys.path
2393 # Python inserts the script's directory into sys.path
2391 dname = os.path.dirname(os.path.abspath(fname))
2394 dname = os.path.dirname(os.path.abspath(fname))
2392 add_dname = False
2395 add_dname = False
2393 if dname not in sys.path:
2396 if dname not in sys.path:
2394 sys.path.insert(0,dname)
2397 sys.path.insert(0,dname)
2395 add_dname = True
2398 add_dname = True
2396
2399
2397 try:
2400 try:
2398 xfile = open(fname)
2401 xfile = open(fname)
2399 except:
2402 except:
2400 print >> Term.cerr, \
2403 print >> Term.cerr, \
2401 'Could not open file <%s> for safe execution.' % fname
2404 'Could not open file <%s> for safe execution.' % fname
2402 syspath_cleanup()
2405 syspath_cleanup()
2403 return None
2406 return None
2404
2407
2405 kw.setdefault('islog',0)
2408 kw.setdefault('islog',0)
2406 kw.setdefault('quiet',1)
2409 kw.setdefault('quiet',1)
2407 kw.setdefault('exit_ignore',0)
2410 kw.setdefault('exit_ignore',0)
2408 first = xfile.readline()
2411 first = xfile.readline()
2409 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2412 loghead = str(self.loghead_tpl).split('\n',1)[0].strip()
2410 xfile.close()
2413 xfile.close()
2411 # line by line execution
2414 # line by line execution
2412 if first.startswith(loghead) or kw['islog']:
2415 if first.startswith(loghead) or kw['islog']:
2413 print 'Loading log file <%s> one line at a time...' % fname
2416 print 'Loading log file <%s> one line at a time...' % fname
2414 if kw['quiet']:
2417 if kw['quiet']:
2415 stdout_save = sys.stdout
2418 stdout_save = sys.stdout
2416 sys.stdout = StringIO.StringIO()
2419 sys.stdout = StringIO.StringIO()
2417 try:
2420 try:
2418 globs,locs = where[0:2]
2421 globs,locs = where[0:2]
2419 except:
2422 except:
2420 try:
2423 try:
2421 globs = locs = where[0]
2424 globs = locs = where[0]
2422 except:
2425 except:
2423 globs = locs = globals()
2426 globs = locs = globals()
2424 badblocks = []
2427 badblocks = []
2425
2428
2426 # we also need to identify indented blocks of code when replaying
2429 # we also need to identify indented blocks of code when replaying
2427 # logs and put them together before passing them to an exec
2430 # logs and put them together before passing them to an exec
2428 # statement. This takes a bit of regexp and look-ahead work in the
2431 # statement. This takes a bit of regexp and look-ahead work in the
2429 # file. It's easiest if we swallow the whole thing in memory
2432 # file. It's easiest if we swallow the whole thing in memory
2430 # first, and manually walk through the lines list moving the
2433 # first, and manually walk through the lines list moving the
2431 # counter ourselves.
2434 # counter ourselves.
2432 indent_re = re.compile('\s+\S')
2435 indent_re = re.compile('\s+\S')
2433 xfile = open(fname)
2436 xfile = open(fname)
2434 filelines = xfile.readlines()
2437 filelines = xfile.readlines()
2435 xfile.close()
2438 xfile.close()
2436 nlines = len(filelines)
2439 nlines = len(filelines)
2437 lnum = 0
2440 lnum = 0
2438 while lnum < nlines:
2441 while lnum < nlines:
2439 line = filelines[lnum]
2442 line = filelines[lnum]
2440 lnum += 1
2443 lnum += 1
2441 # don't re-insert logger status info into cache
2444 # don't re-insert logger status info into cache
2442 if line.startswith('#log#'):
2445 if line.startswith('#log#'):
2443 continue
2446 continue
2444 else:
2447 else:
2445 # build a block of code (maybe a single line) for execution
2448 # build a block of code (maybe a single line) for execution
2446 block = line
2449 block = line
2447 try:
2450 try:
2448 next = filelines[lnum] # lnum has already incremented
2451 next = filelines[lnum] # lnum has already incremented
2449 except:
2452 except:
2450 next = None
2453 next = None
2451 while next and indent_re.match(next):
2454 while next and indent_re.match(next):
2452 block += next
2455 block += next
2453 lnum += 1
2456 lnum += 1
2454 try:
2457 try:
2455 next = filelines[lnum]
2458 next = filelines[lnum]
2456 except:
2459 except:
2457 next = None
2460 next = None
2458 # now execute the block of one or more lines
2461 # now execute the block of one or more lines
2459 try:
2462 try:
2460 exec block in globs,locs
2463 exec block in globs,locs
2461 except SystemExit:
2464 except SystemExit:
2462 pass
2465 pass
2463 except:
2466 except:
2464 badblocks.append(block.rstrip())
2467 badblocks.append(block.rstrip())
2465 if kw['quiet']: # restore stdout
2468 if kw['quiet']: # restore stdout
2466 sys.stdout.close()
2469 sys.stdout.close()
2467 sys.stdout = stdout_save
2470 sys.stdout = stdout_save
2468 print 'Finished replaying log file <%s>' % fname
2471 print 'Finished replaying log file <%s>' % fname
2469 if badblocks:
2472 if badblocks:
2470 print >> sys.stderr, ('\nThe following lines/blocks in file '
2473 print >> sys.stderr, ('\nThe following lines/blocks in file '
2471 '<%s> reported errors:' % fname)
2474 '<%s> reported errors:' % fname)
2472
2475
2473 for badline in badblocks:
2476 for badline in badblocks:
2474 print >> sys.stderr, badline
2477 print >> sys.stderr, badline
2475 else: # regular file execution
2478 else: # regular file execution
2476 try:
2479 try:
2477 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2480 if sys.platform == 'win32' and sys.version_info < (2,5,1):
2478 # Work around a bug in Python for Windows. The bug was
2481 # Work around a bug in Python for Windows. The bug was
2479 # fixed in in Python 2.5 r54159 and 54158, but that's still
2482 # fixed in in Python 2.5 r54159 and 54158, but that's still
2480 # SVN Python as of March/07. For details, see:
2483 # SVN Python as of March/07. For details, see:
2481 # http://projects.scipy.org/ipython/ipython/ticket/123
2484 # http://projects.scipy.org/ipython/ipython/ticket/123
2482 try:
2485 try:
2483 globs,locs = where[0:2]
2486 globs,locs = where[0:2]
2484 except:
2487 except:
2485 try:
2488 try:
2486 globs = locs = where[0]
2489 globs = locs = where[0]
2487 except:
2490 except:
2488 globs = locs = globals()
2491 globs = locs = globals()
2489 exec file(fname) in globs,locs
2492 exec file(fname) in globs,locs
2490 else:
2493 else:
2491 execfile(fname,*where)
2494 execfile(fname,*where)
2492 except SyntaxError:
2495 except SyntaxError:
2493 self.showsyntaxerror()
2496 self.showsyntaxerror()
2494 warn('Failure executing file: <%s>' % fname)
2497 warn('Failure executing file: <%s>' % fname)
2495 except SystemExit,status:
2498 except SystemExit,status:
2496 # Code that correctly sets the exit status flag to success (0)
2499 # Code that correctly sets the exit status flag to success (0)
2497 # shouldn't be bothered with a traceback. Note that a plain
2500 # shouldn't be bothered with a traceback. Note that a plain
2498 # sys.exit() does NOT set the message to 0 (it's empty) so that
2501 # sys.exit() does NOT set the message to 0 (it's empty) so that
2499 # will still get a traceback. Note that the structure of the
2502 # will still get a traceback. Note that the structure of the
2500 # SystemExit exception changed between Python 2.4 and 2.5, so
2503 # SystemExit exception changed between Python 2.4 and 2.5, so
2501 # the checks must be done in a version-dependent way.
2504 # the checks must be done in a version-dependent way.
2502 show = False
2505 show = False
2503
2506
2504 if sys.version_info[:2] > (2,5):
2507 if sys.version_info[:2] > (2,5):
2505 if status.message!=0 and not kw['exit_ignore']:
2508 if status.message!=0 and not kw['exit_ignore']:
2506 show = True
2509 show = True
2507 else:
2510 else:
2508 if status.code and not kw['exit_ignore']:
2511 if status.code and not kw['exit_ignore']:
2509 show = True
2512 show = True
2510 if show:
2513 if show:
2511 self.showtraceback()
2514 self.showtraceback()
2512 warn('Failure executing file: <%s>' % fname)
2515 warn('Failure executing file: <%s>' % fname)
2513 except:
2516 except:
2514 self.showtraceback()
2517 self.showtraceback()
2515 warn('Failure executing file: <%s>' % fname)
2518 warn('Failure executing file: <%s>' % fname)
2516
2519
2517 syspath_cleanup()
2520 syspath_cleanup()
2518
2521
2519 #************************* end of file <iplib.py> *****************************
2522 #************************* end of file <iplib.py> *****************************
@@ -1,769 +1,769 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.1 or better.
5 Requires Python 2.1 or better.
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 2672 2007-08-26 09:15:26Z vivainio $"""
9 $Id: ipmaker.py 2674 2007-08-26 12:34:05Z vivainio $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 #
13 #
14 # Distributed under the terms of the BSD License. The full license is in
14 # Distributed under the terms of the BSD License. The full license is in
15 # the file COPYING, distributed as part of this software.
15 # the file COPYING, distributed as part of this software.
16 #*****************************************************************************
16 #*****************************************************************************
17
17
18 from IPython import Release
18 from IPython import Release
19 __author__ = '%s <%s>' % Release.authors['Fernando']
19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 __license__ = Release.license
20 __license__ = Release.license
21 __version__ = Release.version
21 __version__ = Release.version
22
22
23 try:
23 try:
24 credits._Printer__data = """
24 credits._Printer__data = """
25 Python: %s
25 Python: %s
26
26
27 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
27 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
28 See http://ipython.scipy.org for more information.""" \
28 See http://ipython.scipy.org for more information.""" \
29 % credits._Printer__data
29 % credits._Printer__data
30
30
31 copyright._Printer__data += """
31 copyright._Printer__data += """
32
32
33 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
33 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
34 All Rights Reserved."""
34 All Rights Reserved."""
35 except NameError:
35 except NameError:
36 # Can happen if ipython was started with 'python -S', so that site.py is
36 # Can happen if ipython was started with 'python -S', so that site.py is
37 # not loaded
37 # not loaded
38 pass
38 pass
39
39
40 #****************************************************************************
40 #****************************************************************************
41 # Required modules
41 # Required modules
42
42
43 # From the standard library
43 # From the standard library
44 import __main__
44 import __main__
45 import __builtin__
45 import __builtin__
46 import os
46 import os
47 import re
47 import re
48 import sys
48 import sys
49 import types
49 import types
50 from pprint import pprint,pformat
50 from pprint import pprint,pformat
51
51
52 # Our own
52 # Our own
53 from IPython import DPyGetOpt
53 from IPython import DPyGetOpt
54 from IPython.ipstruct import Struct
54 from IPython.ipstruct import Struct
55 from IPython.OutputTrap import OutputTrap
55 from IPython.OutputTrap import OutputTrap
56 from IPython.ConfigLoader import ConfigLoader
56 from IPython.ConfigLoader import ConfigLoader
57 from IPython.iplib import InteractiveShell
57 from IPython.iplib import InteractiveShell
58 from IPython.usage import cmd_line_usage,interactive_usage
58 from IPython.usage import cmd_line_usage,interactive_usage
59 from IPython.genutils import *
59 from IPython.genutils import *
60
60
61 #-----------------------------------------------------------------------------
61 #-----------------------------------------------------------------------------
62 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
62 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
63 rc_override=None,shell_class=InteractiveShell,
63 rc_override=None,shell_class=InteractiveShell,
64 embedded=False,**kw):
64 embedded=False,**kw):
65 """This is a dump of IPython into a single function.
65 """This is a dump of IPython into a single function.
66
66
67 Later it will have to be broken up in a sensible manner.
67 Later it will have to be broken up in a sensible manner.
68
68
69 Arguments:
69 Arguments:
70
70
71 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
71 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
72 script name, b/c DPyGetOpt strips the first argument only for the real
72 script name, b/c DPyGetOpt strips the first argument only for the real
73 sys.argv.
73 sys.argv.
74
74
75 - user_ns: a dict to be used as the user's namespace."""
75 - user_ns: a dict to be used as the user's namespace."""
76
76
77 #----------------------------------------------------------------------
77 #----------------------------------------------------------------------
78 # Defaults and initialization
78 # Defaults and initialization
79
79
80 # For developer debugging, deactivates crash handler and uses pdb.
80 # For developer debugging, deactivates crash handler and uses pdb.
81 DEVDEBUG = False
81 DEVDEBUG = False
82
82
83 if argv is None:
83 if argv is None:
84 argv = sys.argv
84 argv = sys.argv
85
85
86 # __IP is the main global that lives throughout and represents the whole
86 # __IP is the main global that lives throughout and represents the whole
87 # application. If the user redefines it, all bets are off as to what
87 # application. If the user redefines it, all bets are off as to what
88 # happens.
88 # happens.
89
89
90 # __IP is the name of he global which the caller will have accessible as
90 # __IP is the name of he global which the caller will have accessible as
91 # __IP.name. We set its name via the first parameter passed to
91 # __IP.name. We set its name via the first parameter passed to
92 # InteractiveShell:
92 # InteractiveShell:
93
93
94 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
94 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
95 embedded=embedded,**kw)
95 embedded=embedded,**kw)
96
96
97 # Put 'help' in the user namespace
97 # Put 'help' in the user namespace
98 from site import _Helper
98 from site import _Helper
99 IP.user_config_ns = {}
99 IP.user_config_ns = {}
100 IP.user_ns['help'] = _Helper()
100 IP.user_ns['help'] = _Helper()
101
101
102
102
103 if DEVDEBUG:
103 if DEVDEBUG:
104 # For developer debugging only (global flag)
104 # For developer debugging only (global flag)
105 from IPython import ultraTB
105 from IPython import ultraTB
106 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
106 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
107
107
108 IP.BANNER_PARTS = ['Python %s\n'
108 IP.BANNER_PARTS = ['Python %s\n'
109 'Type "copyright", "credits" or "license" '
109 'Type "copyright", "credits" or "license" '
110 'for more information.\n'
110 'for more information.\n'
111 % (sys.version.split('\n')[0],),
111 % (sys.version.split('\n')[0],),
112 "IPython %s -- An enhanced Interactive Python."
112 "IPython %s -- An enhanced Interactive Python."
113 % (__version__,),
113 % (__version__,),
114 """? -> Introduction to IPython's features.
114 """? -> Introduction to IPython's features.
115 %magic -> Information about IPython's 'magic' % functions.
115 %magic -> Information about IPython's 'magic' % functions.
116 help -> Python's own help system.
116 help -> Python's own help system.
117 object? -> Details about 'object'. ?object also works, ?? prints more.
117 object? -> Details about 'object'. ?object also works, ?? prints more.
118 """ ]
118 """ ]
119
119
120 IP.usage = interactive_usage
120 IP.usage = interactive_usage
121
121
122 # Platform-dependent suffix and directory names. We use _ipython instead
122 # Platform-dependent suffix and directory names. We use _ipython instead
123 # of .ipython under win32 b/c there's software that breaks with .named
123 # of .ipython under win32 b/c there's software that breaks with .named
124 # directories on that platform.
124 # directories on that platform.
125 if os.name == 'posix':
125 if os.name == 'posix':
126 rc_suffix = ''
126 rc_suffix = ''
127 ipdir_def = '.ipython'
127 ipdir_def = '.ipython'
128 else:
128 else:
129 rc_suffix = '.ini'
129 rc_suffix = '.ini'
130 ipdir_def = '_ipython'
130 ipdir_def = '_ipython'
131
131
132 # default directory for configuration
132 # default directory for configuration
133 ipythondir_def = os.path.abspath(os.environ.get('IPYTHONDIR',
133 ipythondir_def = os.path.abspath(os.environ.get('IPYTHONDIR',
134 os.path.join(IP.home_dir,ipdir_def)))
134 os.path.join(IP.home_dir,ipdir_def)))
135
135
136 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
136 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
137
137
138 # we need the directory where IPython itself is installed
138 # we need the directory where IPython itself is installed
139 import IPython
139 import IPython
140 IPython_dir = os.path.dirname(IPython.__file__)
140 IPython_dir = os.path.dirname(IPython.__file__)
141 del IPython
141 del IPython
142
142
143 #-------------------------------------------------------------------------
143 #-------------------------------------------------------------------------
144 # Command line handling
144 # Command line handling
145
145
146 # Valid command line options (uses DPyGetOpt syntax, like Perl's
146 # Valid command line options (uses DPyGetOpt syntax, like Perl's
147 # GetOpt::Long)
147 # GetOpt::Long)
148
148
149 # Any key not listed here gets deleted even if in the file (like session
149 # Any key not listed here gets deleted even if in the file (like session
150 # or profile). That's deliberate, to maintain the rc namespace clean.
150 # or profile). That's deliberate, to maintain the rc namespace clean.
151
151
152 # Each set of options appears twice: under _conv only the names are
152 # Each set of options appears twice: under _conv only the names are
153 # listed, indicating which type they must be converted to when reading the
153 # listed, indicating which type they must be converted to when reading the
154 # ipythonrc file. And under DPyGetOpt they are listed with the regular
154 # ipythonrc file. And under DPyGetOpt they are listed with the regular
155 # DPyGetOpt syntax (=s,=i,:f,etc).
155 # DPyGetOpt syntax (=s,=i,:f,etc).
156
156
157 # Make sure there's a space before each end of line (they get auto-joined!)
157 # Make sure there's a space before each end of line (they get auto-joined!)
158 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
158 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
159 'c=s classic|cl color_info! colors=s confirm_exit! '
159 'c=s classic|cl color_info! colors=s confirm_exit! '
160 'debug! deep_reload! editor=s log|l messages! nosep '
160 'debug! deep_reload! editor=s log|l messages! nosep '
161 'object_info_string_level=i pdb! '
161 'object_info_string_level=i pdb! '
162 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
162 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
163 'pylab_import_all! '
163 'pylab_import_all! '
164 'quick screen_length|sl=i prompts_pad_left=i '
164 'quick screen_length|sl=i prompts_pad_left=i '
165 'logfile|lf=s logplay|lp=s profile|p=s '
165 'logfile|lf=s logplay|lp=s profile|p=s '
166 'readline! readline_merge_completions! '
166 'readline! readline_merge_completions! '
167 'readline_omit__names! '
167 'readline_omit__names! '
168 'rcfile=s separate_in|si=s separate_out|so=s '
168 'rcfile=s separate_in|si=s separate_out|so=s '
169 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
169 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
170 'magic_docstrings system_verbose! '
170 'magic_docstrings system_verbose! '
171 'multi_line_specials! '
171 'multi_line_specials! '
172 'term_title! wxversion=s '
172 'term_title! wxversion=s '
173 'autoedit_syntax!')
173 'autoedit_syntax!')
174
174
175 # Options that can *only* appear at the cmd line (not in rcfiles).
175 # Options that can *only* appear at the cmd line (not in rcfiles).
176
176
177 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
177 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
178 # the 'C-c !' command in emacs automatically appends a -i option at the end.
178 # the 'C-c !' command in emacs automatically appends a -i option at the end.
179 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
179 cmdline_only = ('help interact|i ipythondir=s Version upgrade '
180 'gthread! qthread! q4thread! wthread! pylab! tk!')
180 'gthread! qthread! q4thread! wthread! pylab! tk!')
181
181
182 # Build the actual name list to be used by DPyGetOpt
182 # Build the actual name list to be used by DPyGetOpt
183 opts_names = qw(cmdline_opts) + qw(cmdline_only)
183 opts_names = qw(cmdline_opts) + qw(cmdline_only)
184
184
185 # Set sensible command line defaults.
185 # Set sensible command line defaults.
186 # This should have everything from cmdline_opts and cmdline_only
186 # This should have everything from cmdline_opts and cmdline_only
187 opts_def = Struct(autocall = 1,
187 opts_def = Struct(autocall = 1,
188 autoedit_syntax = 0,
188 autoedit_syntax = 0,
189 autoindent = 0,
189 autoindent = 0,
190 automagic = 1,
190 automagic = 1,
191 banner = 1,
191 banner = 1,
192 cache_size = 1000,
192 cache_size = 1000,
193 c = '',
193 c = '',
194 classic = 0,
194 classic = 0,
195 colors = 'NoColor',
195 colors = 'NoColor',
196 color_info = 0,
196 color_info = 0,
197 confirm_exit = 1,
197 confirm_exit = 1,
198 debug = 0,
198 debug = 0,
199 deep_reload = 0,
199 deep_reload = 0,
200 editor = '0',
200 editor = '0',
201 help = 0,
201 help = 0,
202 ignore = 0,
202 interact = 0,
203 ipythondir = ipythondir_def,
203 ipythondir = ipythondir_def,
204 log = 0,
204 log = 0,
205 logfile = '',
205 logfile = '',
206 logplay = '',
206 logplay = '',
207 multi_line_specials = 1,
207 multi_line_specials = 1,
208 messages = 1,
208 messages = 1,
209 object_info_string_level = 0,
209 object_info_string_level = 0,
210 nosep = 0,
210 nosep = 0,
211 pdb = 0,
211 pdb = 0,
212 pprint = 0,
212 pprint = 0,
213 profile = '',
213 profile = '',
214 prompt_in1 = 'In [\\#]: ',
214 prompt_in1 = 'In [\\#]: ',
215 prompt_in2 = ' .\\D.: ',
215 prompt_in2 = ' .\\D.: ',
216 prompt_out = 'Out[\\#]: ',
216 prompt_out = 'Out[\\#]: ',
217 prompts_pad_left = 1,
217 prompts_pad_left = 1,
218 pylab_import_all = 1,
218 pylab_import_all = 1,
219 quiet = 0,
219 quiet = 0,
220 quick = 0,
220 quick = 0,
221 readline = 1,
221 readline = 1,
222 readline_merge_completions = 1,
222 readline_merge_completions = 1,
223 readline_omit__names = 0,
223 readline_omit__names = 0,
224 rcfile = 'ipythonrc' + rc_suffix,
224 rcfile = 'ipythonrc' + rc_suffix,
225 screen_length = 0,
225 screen_length = 0,
226 separate_in = '\n',
226 separate_in = '\n',
227 separate_out = '\n',
227 separate_out = '\n',
228 separate_out2 = '',
228 separate_out2 = '',
229 system_header = 'IPython system call: ',
229 system_header = 'IPython system call: ',
230 system_verbose = 0,
230 system_verbose = 0,
231 gthread = 0,
231 gthread = 0,
232 qthread = 0,
232 qthread = 0,
233 q4thread = 0,
233 q4thread = 0,
234 wthread = 0,
234 wthread = 0,
235 pylab = 0,
235 pylab = 0,
236 term_title = 1,
236 term_title = 1,
237 tk = 0,
237 tk = 0,
238 upgrade = 0,
238 upgrade = 0,
239 Version = 0,
239 Version = 0,
240 xmode = 'Verbose',
240 xmode = 'Verbose',
241 wildcards_case_sensitive = 1,
241 wildcards_case_sensitive = 1,
242 wxversion = '0',
242 wxversion = '0',
243 magic_docstrings = 0, # undocumented, for doc generation
243 magic_docstrings = 0, # undocumented, for doc generation
244 )
244 )
245
245
246 # Things that will *only* appear in rcfiles (not at the command line).
246 # Things that will *only* appear in rcfiles (not at the command line).
247 # Make sure there's a space before each end of line (they get auto-joined!)
247 # Make sure there's a space before each end of line (they get auto-joined!)
248 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
248 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
249 qw_lol: 'import_some ',
249 qw_lol: 'import_some ',
250 # for things with embedded whitespace:
250 # for things with embedded whitespace:
251 list_strings:'execute alias readline_parse_and_bind ',
251 list_strings:'execute alias readline_parse_and_bind ',
252 # Regular strings need no conversion:
252 # Regular strings need no conversion:
253 None:'readline_remove_delims ',
253 None:'readline_remove_delims ',
254 }
254 }
255 # Default values for these
255 # Default values for these
256 rc_def = Struct(include = [],
256 rc_def = Struct(include = [],
257 import_mod = [],
257 import_mod = [],
258 import_all = [],
258 import_all = [],
259 import_some = [[]],
259 import_some = [[]],
260 execute = [],
260 execute = [],
261 execfile = [],
261 execfile = [],
262 alias = [],
262 alias = [],
263 readline_parse_and_bind = [],
263 readline_parse_and_bind = [],
264 readline_remove_delims = '',
264 readline_remove_delims = '',
265 )
265 )
266
266
267 # Build the type conversion dictionary from the above tables:
267 # Build the type conversion dictionary from the above tables:
268 typeconv = rcfile_opts.copy()
268 typeconv = rcfile_opts.copy()
269 typeconv.update(optstr2types(cmdline_opts))
269 typeconv.update(optstr2types(cmdline_opts))
270
270
271 # FIXME: the None key appears in both, put that back together by hand. Ugly!
271 # FIXME: the None key appears in both, put that back together by hand. Ugly!
272 typeconv[None] += ' ' + rcfile_opts[None]
272 typeconv[None] += ' ' + rcfile_opts[None]
273
273
274 # Remove quotes at ends of all strings (used to protect spaces)
274 # Remove quotes at ends of all strings (used to protect spaces)
275 typeconv[unquote_ends] = typeconv[None]
275 typeconv[unquote_ends] = typeconv[None]
276 del typeconv[None]
276 del typeconv[None]
277
277
278 # Build the list we'll use to make all config decisions with defaults:
278 # Build the list we'll use to make all config decisions with defaults:
279 opts_all = opts_def.copy()
279 opts_all = opts_def.copy()
280 opts_all.update(rc_def)
280 opts_all.update(rc_def)
281
281
282 # Build conflict resolver for recursive loading of config files:
282 # Build conflict resolver for recursive loading of config files:
283 # - preserve means the outermost file maintains the value, it is not
283 # - preserve means the outermost file maintains the value, it is not
284 # overwritten if an included file has the same key.
284 # overwritten if an included file has the same key.
285 # - add_flip applies + to the two values, so it better make sense to add
285 # - add_flip applies + to the two values, so it better make sense to add
286 # those types of keys. But it flips them first so that things loaded
286 # those types of keys. But it flips them first so that things loaded
287 # deeper in the inclusion chain have lower precedence.
287 # deeper in the inclusion chain have lower precedence.
288 conflict = {'preserve': ' '.join([ typeconv[int],
288 conflict = {'preserve': ' '.join([ typeconv[int],
289 typeconv[unquote_ends] ]),
289 typeconv[unquote_ends] ]),
290 'add_flip': ' '.join([ typeconv[qwflat],
290 'add_flip': ' '.join([ typeconv[qwflat],
291 typeconv[qw_lol],
291 typeconv[qw_lol],
292 typeconv[list_strings] ])
292 typeconv[list_strings] ])
293 }
293 }
294
294
295 # Now actually process the command line
295 # Now actually process the command line
296 getopt = DPyGetOpt.DPyGetOpt()
296 getopt = DPyGetOpt.DPyGetOpt()
297 getopt.setIgnoreCase(0)
297 getopt.setIgnoreCase(0)
298
298
299 getopt.parseConfiguration(opts_names)
299 getopt.parseConfiguration(opts_names)
300
300
301 try:
301 try:
302 getopt.processArguments(argv)
302 getopt.processArguments(argv)
303 except:
303 except:
304 print cmd_line_usage
304 print cmd_line_usage
305 warn('\nError in Arguments: ' + `sys.exc_value`)
305 warn('\nError in Arguments: ' + `sys.exc_value`)
306 sys.exit(1)
306 sys.exit(1)
307
307
308 # convert the options dict to a struct for much lighter syntax later
308 # convert the options dict to a struct for much lighter syntax later
309 opts = Struct(getopt.optionValues)
309 opts = Struct(getopt.optionValues)
310 args = getopt.freeValues
310 args = getopt.freeValues
311
311
312 # this is the struct (which has default values at this point) with which
312 # this is the struct (which has default values at this point) with which
313 # we make all decisions:
313 # we make all decisions:
314 opts_all.update(opts)
314 opts_all.update(opts)
315
315
316 # Options that force an immediate exit
316 # Options that force an immediate exit
317 if opts_all.help:
317 if opts_all.help:
318 page(cmd_line_usage)
318 page(cmd_line_usage)
319 sys.exit()
319 sys.exit()
320
320
321 if opts_all.Version:
321 if opts_all.Version:
322 print __version__
322 print __version__
323 sys.exit()
323 sys.exit()
324
324
325 if opts_all.magic_docstrings:
325 if opts_all.magic_docstrings:
326 IP.magic_magic('-latex')
326 IP.magic_magic('-latex')
327 sys.exit()
327 sys.exit()
328
328
329 # add personal ipythondir to sys.path so that users can put things in
329 # add personal ipythondir to sys.path so that users can put things in
330 # there for customization
330 # there for customization
331 sys.path.append(os.path.abspath(opts_all.ipythondir))
331 sys.path.append(os.path.abspath(opts_all.ipythondir))
332
332
333 # Create user config directory if it doesn't exist. This must be done
333 # Create user config directory if it doesn't exist. This must be done
334 # *after* getting the cmd line options.
334 # *after* getting the cmd line options.
335 if not os.path.isdir(opts_all.ipythondir):
335 if not os.path.isdir(opts_all.ipythondir):
336 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
336 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
337
337
338 # upgrade user config files while preserving a copy of the originals
338 # upgrade user config files while preserving a copy of the originals
339 if opts_all.upgrade:
339 if opts_all.upgrade:
340 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
340 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
341
341
342 # check mutually exclusive options in the *original* command line
342 # check mutually exclusive options in the *original* command line
343 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
343 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
344 qw('classic profile'),qw('classic rcfile')])
344 qw('classic profile'),qw('classic rcfile')])
345
345
346 #---------------------------------------------------------------------------
346 #---------------------------------------------------------------------------
347 # Log replay
347 # Log replay
348
348
349 # if -logplay, we need to 'become' the other session. That basically means
349 # if -logplay, we need to 'become' the other session. That basically means
350 # replacing the current command line environment with that of the old
350 # replacing the current command line environment with that of the old
351 # session and moving on.
351 # session and moving on.
352
352
353 # this is needed so that later we know we're in session reload mode, as
353 # this is needed so that later we know we're in session reload mode, as
354 # opts_all will get overwritten:
354 # opts_all will get overwritten:
355 load_logplay = 0
355 load_logplay = 0
356
356
357 if opts_all.logplay:
357 if opts_all.logplay:
358 load_logplay = opts_all.logplay
358 load_logplay = opts_all.logplay
359 opts_debug_save = opts_all.debug
359 opts_debug_save = opts_all.debug
360 try:
360 try:
361 logplay = open(opts_all.logplay)
361 logplay = open(opts_all.logplay)
362 except IOError:
362 except IOError:
363 if opts_all.debug: IP.InteractiveTB()
363 if opts_all.debug: IP.InteractiveTB()
364 warn('Could not open logplay file '+`opts_all.logplay`)
364 warn('Could not open logplay file '+`opts_all.logplay`)
365 # restore state as if nothing had happened and move on, but make
365 # restore state as if nothing had happened and move on, but make
366 # sure that later we don't try to actually load the session file
366 # sure that later we don't try to actually load the session file
367 logplay = None
367 logplay = None
368 load_logplay = 0
368 load_logplay = 0
369 del opts_all.logplay
369 del opts_all.logplay
370 else:
370 else:
371 try:
371 try:
372 logplay.readline()
372 logplay.readline()
373 logplay.readline();
373 logplay.readline();
374 # this reloads that session's command line
374 # this reloads that session's command line
375 cmd = logplay.readline()[6:]
375 cmd = logplay.readline()[6:]
376 exec cmd
376 exec cmd
377 # restore the true debug flag given so that the process of
377 # restore the true debug flag given so that the process of
378 # session loading itself can be monitored.
378 # session loading itself can be monitored.
379 opts.debug = opts_debug_save
379 opts.debug = opts_debug_save
380 # save the logplay flag so later we don't overwrite the log
380 # save the logplay flag so later we don't overwrite the log
381 opts.logplay = load_logplay
381 opts.logplay = load_logplay
382 # now we must update our own structure with defaults
382 # now we must update our own structure with defaults
383 opts_all.update(opts)
383 opts_all.update(opts)
384 # now load args
384 # now load args
385 cmd = logplay.readline()[6:]
385 cmd = logplay.readline()[6:]
386 exec cmd
386 exec cmd
387 logplay.close()
387 logplay.close()
388 except:
388 except:
389 logplay.close()
389 logplay.close()
390 if opts_all.debug: IP.InteractiveTB()
390 if opts_all.debug: IP.InteractiveTB()
391 warn("Logplay file lacking full configuration information.\n"
391 warn("Logplay file lacking full configuration information.\n"
392 "I'll try to read it, but some things may not work.")
392 "I'll try to read it, but some things may not work.")
393
393
394 #-------------------------------------------------------------------------
394 #-------------------------------------------------------------------------
395 # set up output traps: catch all output from files, being run, modules
395 # set up output traps: catch all output from files, being run, modules
396 # loaded, etc. Then give it to the user in a clean form at the end.
396 # loaded, etc. Then give it to the user in a clean form at the end.
397
397
398 msg_out = 'Output messages. '
398 msg_out = 'Output messages. '
399 msg_err = 'Error messages. '
399 msg_err = 'Error messages. '
400 msg_sep = '\n'
400 msg_sep = '\n'
401 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
401 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
402 msg_err,msg_sep,debug,
402 msg_err,msg_sep,debug,
403 quiet_out=1),
403 quiet_out=1),
404 user_exec = OutputTrap('User File Execution',msg_out,
404 user_exec = OutputTrap('User File Execution',msg_out,
405 msg_err,msg_sep,debug),
405 msg_err,msg_sep,debug),
406 logplay = OutputTrap('Log Loader',msg_out,
406 logplay = OutputTrap('Log Loader',msg_out,
407 msg_err,msg_sep,debug),
407 msg_err,msg_sep,debug),
408 summary = ''
408 summary = ''
409 )
409 )
410
410
411 #-------------------------------------------------------------------------
411 #-------------------------------------------------------------------------
412 # Process user ipythonrc-type configuration files
412 # Process user ipythonrc-type configuration files
413
413
414 # turn on output trapping and log to msg.config
414 # turn on output trapping and log to msg.config
415 # remember that with debug on, trapping is actually disabled
415 # remember that with debug on, trapping is actually disabled
416 msg.config.trap_all()
416 msg.config.trap_all()
417
417
418 # look for rcfile in current or default directory
418 # look for rcfile in current or default directory
419 try:
419 try:
420 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
420 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
421 except IOError:
421 except IOError:
422 if opts_all.debug: IP.InteractiveTB()
422 if opts_all.debug: IP.InteractiveTB()
423 warn('Configuration file %s not found. Ignoring request.'
423 warn('Configuration file %s not found. Ignoring request.'
424 % (opts_all.rcfile) )
424 % (opts_all.rcfile) )
425
425
426 # 'profiles' are a shorthand notation for config filenames
426 # 'profiles' are a shorthand notation for config filenames
427 profile_handled_by_legacy = False
427 profile_handled_by_legacy = False
428 if opts_all.profile:
428 if opts_all.profile:
429
429
430 try:
430 try:
431 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
431 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
432 + rc_suffix,
432 + rc_suffix,
433 opts_all.ipythondir)
433 opts_all.ipythondir)
434 profile_handled_by_legacy = True
434 profile_handled_by_legacy = True
435 except IOError:
435 except IOError:
436 if opts_all.debug: IP.InteractiveTB()
436 if opts_all.debug: IP.InteractiveTB()
437 opts.profile = '' # remove profile from options if invalid
437 opts.profile = '' # remove profile from options if invalid
438 # We won't warn anymore, primary method is ipy_profile_PROFNAME
438 # We won't warn anymore, primary method is ipy_profile_PROFNAME
439 # which does trigger a warning.
439 # which does trigger a warning.
440
440
441 # load the config file
441 # load the config file
442 rcfiledata = None
442 rcfiledata = None
443 if opts_all.quick:
443 if opts_all.quick:
444 print 'Launching IPython in quick mode. No config file read.'
444 print 'Launching IPython in quick mode. No config file read.'
445 elif opts_all.rcfile:
445 elif opts_all.rcfile:
446 try:
446 try:
447 cfg_loader = ConfigLoader(conflict)
447 cfg_loader = ConfigLoader(conflict)
448 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
448 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
449 'include',opts_all.ipythondir,
449 'include',opts_all.ipythondir,
450 purge = 1,
450 purge = 1,
451 unique = conflict['preserve'])
451 unique = conflict['preserve'])
452 except:
452 except:
453 IP.InteractiveTB()
453 IP.InteractiveTB()
454 warn('Problems loading configuration file '+
454 warn('Problems loading configuration file '+
455 `opts_all.rcfile`+
455 `opts_all.rcfile`+
456 '\nStarting with default -bare bones- configuration.')
456 '\nStarting with default -bare bones- configuration.')
457 else:
457 else:
458 warn('No valid configuration file found in either currrent directory\n'+
458 warn('No valid configuration file found in either currrent directory\n'+
459 'or in the IPython config. directory: '+`opts_all.ipythondir`+
459 'or in the IPython config. directory: '+`opts_all.ipythondir`+
460 '\nProceeding with internal defaults.')
460 '\nProceeding with internal defaults.')
461
461
462 #------------------------------------------------------------------------
462 #------------------------------------------------------------------------
463 # Set exception handlers in mode requested by user.
463 # Set exception handlers in mode requested by user.
464 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
464 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
465 IP.magic_xmode(opts_all.xmode)
465 IP.magic_xmode(opts_all.xmode)
466 otrap.release_out()
466 otrap.release_out()
467
467
468 #------------------------------------------------------------------------
468 #------------------------------------------------------------------------
469 # Execute user config
469 # Execute user config
470
470
471 # Create a valid config structure with the right precedence order:
471 # Create a valid config structure with the right precedence order:
472 # defaults < rcfile < command line. This needs to be in the instance, so
472 # defaults < rcfile < command line. This needs to be in the instance, so
473 # that method calls below that rely on it find it.
473 # that method calls below that rely on it find it.
474 IP.rc = rc_def.copy()
474 IP.rc = rc_def.copy()
475
475
476 # Work with a local alias inside this routine to avoid unnecessary
476 # Work with a local alias inside this routine to avoid unnecessary
477 # attribute lookups.
477 # attribute lookups.
478 IP_rc = IP.rc
478 IP_rc = IP.rc
479
479
480 IP_rc.update(opts_def)
480 IP_rc.update(opts_def)
481 if rcfiledata:
481 if rcfiledata:
482 # now we can update
482 # now we can update
483 IP_rc.update(rcfiledata)
483 IP_rc.update(rcfiledata)
484 IP_rc.update(opts)
484 IP_rc.update(opts)
485 IP_rc.update(rc_override)
485 IP_rc.update(rc_override)
486
486
487 # Store the original cmd line for reference:
487 # Store the original cmd line for reference:
488 IP_rc.opts = opts
488 IP_rc.opts = opts
489 IP_rc.args = args
489 IP_rc.args = args
490
490
491 # create a *runtime* Struct like rc for holding parameters which may be
491 # create a *runtime* Struct like rc for holding parameters which may be
492 # created and/or modified by runtime user extensions.
492 # created and/or modified by runtime user extensions.
493 IP.runtime_rc = Struct()
493 IP.runtime_rc = Struct()
494
494
495 # from this point on, all config should be handled through IP_rc,
495 # from this point on, all config should be handled through IP_rc,
496 # opts* shouldn't be used anymore.
496 # opts* shouldn't be used anymore.
497
497
498
498
499 # update IP_rc with some special things that need manual
499 # update IP_rc with some special things that need manual
500 # tweaks. Basically options which affect other options. I guess this
500 # tweaks. Basically options which affect other options. I guess this
501 # should just be written so that options are fully orthogonal and we
501 # should just be written so that options are fully orthogonal and we
502 # wouldn't worry about this stuff!
502 # wouldn't worry about this stuff!
503
503
504 if IP_rc.classic:
504 if IP_rc.classic:
505 IP_rc.quick = 1
505 IP_rc.quick = 1
506 IP_rc.cache_size = 0
506 IP_rc.cache_size = 0
507 IP_rc.pprint = 0
507 IP_rc.pprint = 0
508 IP_rc.prompt_in1 = '>>> '
508 IP_rc.prompt_in1 = '>>> '
509 IP_rc.prompt_in2 = '... '
509 IP_rc.prompt_in2 = '... '
510 IP_rc.prompt_out = ''
510 IP_rc.prompt_out = ''
511 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
511 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
512 IP_rc.colors = 'NoColor'
512 IP_rc.colors = 'NoColor'
513 IP_rc.xmode = 'Plain'
513 IP_rc.xmode = 'Plain'
514
514
515 IP.pre_config_initialization()
515 IP.pre_config_initialization()
516 # configure readline
516 # configure readline
517 # Define the history file for saving commands in between sessions
517 # Define the history file for saving commands in between sessions
518 if IP_rc.profile:
518 if IP_rc.profile:
519 histfname = 'history-%s' % IP_rc.profile
519 histfname = 'history-%s' % IP_rc.profile
520 else:
520 else:
521 histfname = 'history'
521 histfname = 'history'
522 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
522 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
523
523
524 # update exception handlers with rc file status
524 # update exception handlers with rc file status
525 otrap.trap_out() # I don't want these messages ever.
525 otrap.trap_out() # I don't want these messages ever.
526 IP.magic_xmode(IP_rc.xmode)
526 IP.magic_xmode(IP_rc.xmode)
527 otrap.release_out()
527 otrap.release_out()
528
528
529 # activate logging if requested and not reloading a log
529 # activate logging if requested and not reloading a log
530 if IP_rc.logplay:
530 if IP_rc.logplay:
531 IP.magic_logstart(IP_rc.logplay + ' append')
531 IP.magic_logstart(IP_rc.logplay + ' append')
532 elif IP_rc.logfile:
532 elif IP_rc.logfile:
533 IP.magic_logstart(IP_rc.logfile)
533 IP.magic_logstart(IP_rc.logfile)
534 elif IP_rc.log:
534 elif IP_rc.log:
535 IP.magic_logstart()
535 IP.magic_logstart()
536
536
537 # find user editor so that it we don't have to look it up constantly
537 # find user editor so that it we don't have to look it up constantly
538 if IP_rc.editor.strip()=='0':
538 if IP_rc.editor.strip()=='0':
539 try:
539 try:
540 ed = os.environ['EDITOR']
540 ed = os.environ['EDITOR']
541 except KeyError:
541 except KeyError:
542 if os.name == 'posix':
542 if os.name == 'posix':
543 ed = 'vi' # the only one guaranteed to be there!
543 ed = 'vi' # the only one guaranteed to be there!
544 else:
544 else:
545 ed = 'notepad' # same in Windows!
545 ed = 'notepad' # same in Windows!
546 IP_rc.editor = ed
546 IP_rc.editor = ed
547
547
548 # Keep track of whether this is an embedded instance or not (useful for
548 # Keep track of whether this is an embedded instance or not (useful for
549 # post-mortems).
549 # post-mortems).
550 IP_rc.embedded = IP.embedded
550 IP_rc.embedded = IP.embedded
551
551
552 # Recursive reload
552 # Recursive reload
553 try:
553 try:
554 from IPython import deep_reload
554 from IPython import deep_reload
555 if IP_rc.deep_reload:
555 if IP_rc.deep_reload:
556 __builtin__.reload = deep_reload.reload
556 __builtin__.reload = deep_reload.reload
557 else:
557 else:
558 __builtin__.dreload = deep_reload.reload
558 __builtin__.dreload = deep_reload.reload
559 del deep_reload
559 del deep_reload
560 except ImportError:
560 except ImportError:
561 pass
561 pass
562
562
563 # Save the current state of our namespace so that the interactive shell
563 # Save the current state of our namespace so that the interactive shell
564 # can later know which variables have been created by us from config files
564 # can later know which variables have been created by us from config files
565 # and loading. This way, loading a file (in any way) is treated just like
565 # and loading. This way, loading a file (in any way) is treated just like
566 # defining things on the command line, and %who works as expected.
566 # defining things on the command line, and %who works as expected.
567
567
568 # DON'T do anything that affects the namespace beyond this point!
568 # DON'T do anything that affects the namespace beyond this point!
569 IP.internal_ns.update(__main__.__dict__)
569 IP.internal_ns.update(__main__.__dict__)
570
570
571 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
571 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
572
572
573 # Now run through the different sections of the users's config
573 # Now run through the different sections of the users's config
574 if IP_rc.debug:
574 if IP_rc.debug:
575 print 'Trying to execute the following configuration structure:'
575 print 'Trying to execute the following configuration structure:'
576 print '(Things listed first are deeper in the inclusion tree and get'
576 print '(Things listed first are deeper in the inclusion tree and get'
577 print 'loaded first).\n'
577 print 'loaded first).\n'
578 pprint(IP_rc.__dict__)
578 pprint(IP_rc.__dict__)
579
579
580 for mod in IP_rc.import_mod:
580 for mod in IP_rc.import_mod:
581 try:
581 try:
582 exec 'import '+mod in IP.user_ns
582 exec 'import '+mod in IP.user_ns
583 except :
583 except :
584 IP.InteractiveTB()
584 IP.InteractiveTB()
585 import_fail_info(mod)
585 import_fail_info(mod)
586
586
587 for mod_fn in IP_rc.import_some:
587 for mod_fn in IP_rc.import_some:
588 if not mod_fn == []:
588 if not mod_fn == []:
589 mod,fn = mod_fn[0],','.join(mod_fn[1:])
589 mod,fn = mod_fn[0],','.join(mod_fn[1:])
590 try:
590 try:
591 exec 'from '+mod+' import '+fn in IP.user_ns
591 exec 'from '+mod+' import '+fn in IP.user_ns
592 except :
592 except :
593 IP.InteractiveTB()
593 IP.InteractiveTB()
594 import_fail_info(mod,fn)
594 import_fail_info(mod,fn)
595
595
596 for mod in IP_rc.import_all:
596 for mod in IP_rc.import_all:
597 try:
597 try:
598 exec 'from '+mod+' import *' in IP.user_ns
598 exec 'from '+mod+' import *' in IP.user_ns
599 except :
599 except :
600 IP.InteractiveTB()
600 IP.InteractiveTB()
601 import_fail_info(mod)
601 import_fail_info(mod)
602
602
603 for code in IP_rc.execute:
603 for code in IP_rc.execute:
604 try:
604 try:
605 exec code in IP.user_ns
605 exec code in IP.user_ns
606 except:
606 except:
607 IP.InteractiveTB()
607 IP.InteractiveTB()
608 warn('Failure executing code: ' + `code`)
608 warn('Failure executing code: ' + `code`)
609
609
610 # Execute the files the user wants in ipythonrc
610 # Execute the files the user wants in ipythonrc
611 for file in IP_rc.execfile:
611 for file in IP_rc.execfile:
612 try:
612 try:
613 file = filefind(file,sys.path+[IPython_dir])
613 file = filefind(file,sys.path+[IPython_dir])
614 except IOError:
614 except IOError:
615 warn(itpl('File $file not found. Skipping it.'))
615 warn(itpl('File $file not found. Skipping it.'))
616 else:
616 else:
617 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
617 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
618
618
619 # finally, try importing ipy_*_conf for final configuration
619 # finally, try importing ipy_*_conf for final configuration
620 try:
620 try:
621 import ipy_system_conf
621 import ipy_system_conf
622 except ImportError:
622 except ImportError:
623 if opts_all.debug: IP.InteractiveTB()
623 if opts_all.debug: IP.InteractiveTB()
624 warn("Could not import 'ipy_system_conf'")
624 warn("Could not import 'ipy_system_conf'")
625 except:
625 except:
626 IP.InteractiveTB()
626 IP.InteractiveTB()
627 import_fail_info('ipy_system_conf')
627 import_fail_info('ipy_system_conf')
628
628
629 # only import prof module if ipythonrc-PROF was not found
629 # only import prof module if ipythonrc-PROF was not found
630 if opts_all.profile and not profile_handled_by_legacy:
630 if opts_all.profile and not profile_handled_by_legacy:
631 profmodname = 'ipy_profile_' + opts_all.profile
631 profmodname = 'ipy_profile_' + opts_all.profile
632 try:
632 try:
633 __import__(profmodname)
633 __import__(profmodname)
634 except ImportError:
634 except ImportError:
635 # only warn if ipythonrc-PROFNAME didn't exist
635 # only warn if ipythonrc-PROFNAME didn't exist
636 if opts.profile =='':
636 if opts.profile =='':
637 warn("Could not start with profile '%s'!\n"
637 warn("Could not start with profile '%s'!\n"
638 "('%s/%s.py' does not exist? run '%%upgrade')" %
638 "('%s/%s.py' does not exist? run '%%upgrade')" %
639 (opts_all.profile, opts_all.ipythondir, profmodname) )
639 (opts_all.profile, opts_all.ipythondir, profmodname) )
640 except:
640 except:
641 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
641 print "Error importing",profmodname,"- perhaps you should run %upgrade?"
642 IP.InteractiveTB()
642 IP.InteractiveTB()
643 import_fail_info(profmodname)
643 import_fail_info(profmodname)
644 else:
644 else:
645 import ipy_profile_none
645 import ipy_profile_none
646 try:
646 try:
647 import ipy_user_conf
647 import ipy_user_conf
648 except ImportError:
648 except ImportError:
649 if opts_all.debug: IP.InteractiveTB()
649 if opts_all.debug: IP.InteractiveTB()
650 warn("Could not import user config!\n "
650 warn("Could not import user config!\n "
651 "('%s/ipy_user_conf.py' does not exist? Please run '%%upgrade')\n"
651 "('%s/ipy_user_conf.py' does not exist? Please run '%%upgrade')\n"
652 % opts_all.ipythondir)
652 % opts_all.ipythondir)
653 except:
653 except:
654 print "Error importing ipy_user_conf - perhaps you should run %upgrade?"
654 print "Error importing ipy_user_conf - perhaps you should run %upgrade?"
655 IP.InteractiveTB()
655 IP.InteractiveTB()
656 import_fail_info("ipy_user_conf")
656 import_fail_info("ipy_user_conf")
657
657
658 # finally, push the argv to options again to ensure highest priority
658 # finally, push the argv to options again to ensure highest priority
659 IP_rc.update(opts)
659 IP_rc.update(opts)
660
660
661 # release stdout and stderr and save config log into a global summary
661 # release stdout and stderr and save config log into a global summary
662 msg.config.release_all()
662 msg.config.release_all()
663 if IP_rc.messages:
663 if IP_rc.messages:
664 msg.summary += msg.config.summary_all()
664 msg.summary += msg.config.summary_all()
665
665
666 #------------------------------------------------------------------------
666 #------------------------------------------------------------------------
667 # Setup interactive session
667 # Setup interactive session
668
668
669 # Now we should be fully configured. We can then execute files or load
669 # Now we should be fully configured. We can then execute files or load
670 # things only needed for interactive use. Then we'll open the shell.
670 # things only needed for interactive use. Then we'll open the shell.
671
671
672 # Take a snapshot of the user namespace before opening the shell. That way
672 # Take a snapshot of the user namespace before opening the shell. That way
673 # we'll be able to identify which things were interactively defined and
673 # we'll be able to identify which things were interactively defined and
674 # which were defined through config files.
674 # which were defined through config files.
675 IP.user_config_ns.update(IP.user_ns)
675 IP.user_config_ns.update(IP.user_ns)
676
676
677 # Force reading a file as if it were a session log. Slower but safer.
677 # Force reading a file as if it were a session log. Slower but safer.
678 if load_logplay:
678 if load_logplay:
679 print 'Replaying log...'
679 print 'Replaying log...'
680 try:
680 try:
681 if IP_rc.debug:
681 if IP_rc.debug:
682 logplay_quiet = 0
682 logplay_quiet = 0
683 else:
683 else:
684 logplay_quiet = 1
684 logplay_quiet = 1
685
685
686 msg.logplay.trap_all()
686 msg.logplay.trap_all()
687 IP.safe_execfile(load_logplay,IP.user_ns,
687 IP.safe_execfile(load_logplay,IP.user_ns,
688 islog = 1, quiet = logplay_quiet)
688 islog = 1, quiet = logplay_quiet)
689 msg.logplay.release_all()
689 msg.logplay.release_all()
690 if IP_rc.messages:
690 if IP_rc.messages:
691 msg.summary += msg.logplay.summary_all()
691 msg.summary += msg.logplay.summary_all()
692 except:
692 except:
693 warn('Problems replaying logfile %s.' % load_logplay)
693 warn('Problems replaying logfile %s.' % load_logplay)
694 IP.InteractiveTB()
694 IP.InteractiveTB()
695
695
696 # Load remaining files in command line
696 # Load remaining files in command line
697 msg.user_exec.trap_all()
697 msg.user_exec.trap_all()
698
698
699 # Do NOT execute files named in the command line as scripts to be loaded
699 # Do NOT execute files named in the command line as scripts to be loaded
700 # by embedded instances. Doing so has the potential for an infinite
700 # by embedded instances. Doing so has the potential for an infinite
701 # recursion if there are exceptions thrown in the process.
701 # recursion if there are exceptions thrown in the process.
702
702
703 # XXX FIXME: the execution of user files should be moved out to after
703 # XXX FIXME: the execution of user files should be moved out to after
704 # ipython is fully initialized, just as if they were run via %run at the
704 # ipython is fully initialized, just as if they were run via %run at the
705 # ipython prompt. This would also give them the benefit of ipython's
705 # ipython prompt. This would also give them the benefit of ipython's
706 # nice tracebacks.
706 # nice tracebacks.
707
707
708 if (not embedded and IP_rc.args and
708 if (not embedded and IP_rc.args and
709 not IP_rc.args[0].lower().endswith('.ipy')):
709 not IP_rc.args[0].lower().endswith('.ipy')):
710 name_save = IP.user_ns['__name__']
710 name_save = IP.user_ns['__name__']
711 IP.user_ns['__name__'] = '__main__'
711 IP.user_ns['__name__'] = '__main__'
712 # Set our own excepthook in case the user code tries to call it
712 # Set our own excepthook in case the user code tries to call it
713 # directly. This prevents triggering the IPython crash handler.
713 # directly. This prevents triggering the IPython crash handler.
714 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
714 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
715
715
716 save_argv = sys.argv[1:] # save it for later restoring
716 save_argv = sys.argv[1:] # save it for later restoring
717
717
718 sys.argv = args
718 sys.argv = args
719
719
720 try:
720 try:
721 IP.safe_execfile(args[0], IP.user_ns)
721 IP.safe_execfile(args[0], IP.user_ns)
722 finally:
722 finally:
723 # Reset our crash handler in place
723 # Reset our crash handler in place
724 sys.excepthook = old_excepthook
724 sys.excepthook = old_excepthook
725 sys.argv[:] = save_argv
725 sys.argv[:] = save_argv
726 IP.user_ns['__name__'] = name_save
726 IP.user_ns['__name__'] = name_save
727
727
728 msg.user_exec.release_all()
728 msg.user_exec.release_all()
729
729
730 if IP_rc.messages:
730 if IP_rc.messages:
731 msg.summary += msg.user_exec.summary_all()
731 msg.summary += msg.user_exec.summary_all()
732
732
733 # since we can't specify a null string on the cmd line, 0 is the equivalent:
733 # since we can't specify a null string on the cmd line, 0 is the equivalent:
734 if IP_rc.nosep:
734 if IP_rc.nosep:
735 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
735 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
736 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
736 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
737 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
737 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
738 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
738 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
739 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
739 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
740 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
740 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
741 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
741 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
742
742
743 # Determine how many lines at the bottom of the screen are needed for
743 # Determine how many lines at the bottom of the screen are needed for
744 # showing prompts, so we can know wheter long strings are to be printed or
744 # showing prompts, so we can know wheter long strings are to be printed or
745 # paged:
745 # paged:
746 num_lines_bot = IP_rc.separate_in.count('\n')+1
746 num_lines_bot = IP_rc.separate_in.count('\n')+1
747 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
747 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
748
748
749 # configure startup banner
749 # configure startup banner
750 if IP_rc.c: # regular python doesn't print the banner with -c
750 if IP_rc.c: # regular python doesn't print the banner with -c
751 IP_rc.banner = 0
751 IP_rc.banner = 0
752 if IP_rc.banner:
752 if IP_rc.banner:
753 BANN_P = IP.BANNER_PARTS
753 BANN_P = IP.BANNER_PARTS
754 else:
754 else:
755 BANN_P = []
755 BANN_P = []
756
756
757 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
757 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
758
758
759 # add message log (possibly empty)
759 # add message log (possibly empty)
760 if msg.summary: BANN_P.append(msg.summary)
760 if msg.summary: BANN_P.append(msg.summary)
761 # Final banner is a string
761 # Final banner is a string
762 IP.BANNER = '\n'.join(BANN_P)
762 IP.BANNER = '\n'.join(BANN_P)
763
763
764 # Finalize the IPython instance. This assumes the rc structure is fully
764 # Finalize the IPython instance. This assumes the rc structure is fully
765 # in place.
765 # in place.
766 IP.post_config_initialization()
766 IP.post_config_initialization()
767
767
768 return IP
768 return IP
769 #************************ end of file <ipmaker.py> **************************
769 #************************ end of file <ipmaker.py> **************************
@@ -1,7056 +1,7061 b''
1 2007-08-26 Ville Vainio <vivainio@gmail.com>
1 2007-08-26 Ville Vainio <vivainio@gmail.com>
2
2
3 * ipmaker.py: Command line args have the highest priority again
3 * ipmaker.py: Command line args have the highest priority again
4
5 * iplib.py, ipmaker.py: -i command line argument now behaves as in
6 normal python, i.e. leaves the IPython session running after -c
7 command or running a batch file from command line.
4
8
9 *
5 2007-08-22 Ville Vainio <vivainio@gmail.com>
10 2007-08-22 Ville Vainio <vivainio@gmail.com>
6
11
7 * iplib.py: no extra empty (last) line in raw hist w/ multiline
12 * iplib.py: no extra empty (last) line in raw hist w/ multiline
8 statements
13 statements
9
14
10 * logger.py: Fix bug where blank lines in history were not
15 * logger.py: Fix bug where blank lines in history were not
11 added until AFTER adding the current line; translated and raw
16 added until AFTER adding the current line; translated and raw
12 history should finally be in sync with prompt now.
17 history should finally be in sync with prompt now.
13
18
14 * ipy_completers.py: quick_completer now makes it easy to create
19 * ipy_completers.py: quick_completer now makes it easy to create
15 trivial custom completers
20 trivial custom completers
16
21
17 * clearcmd.py: shadow history compression & erasing, fixed input hist
22 * clearcmd.py: shadow history compression & erasing, fixed input hist
18 clearing.
23 clearing.
19
24
20 * envpersist.py, history.py: %env (sh profile only), %hist completers
25 * envpersist.py, history.py: %env (sh profile only), %hist completers
21
26
22 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
27 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
23 term title now include the drive letter, and always use / instead of
28 term title now include the drive letter, and always use / instead of
24 os.sep (as per recommended approach for win32 ipython in general).
29 os.sep (as per recommended approach for win32 ipython in general).
25
30
26 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
31 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
27 plain python scripts from ipykit command line by running
32 plain python scripts from ipykit command line by running
28 "py myscript.py", even w/o installed python.
33 "py myscript.py", even w/o installed python.
29
34
30 2007-08-21 Ville Vainio <vivainio@gmail.com>
35 2007-08-21 Ville Vainio <vivainio@gmail.com>
31
36
32 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
37 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
33 (for backwards compatibility)
38 (for backwards compatibility)
34
39
35 * history.py: switch back to %hist -t from %hist -r as default.
40 * history.py: switch back to %hist -t from %hist -r as default.
36 At least until raw history is fixed for good.
41 At least until raw history is fixed for good.
37
42
38 2007-08-20 Ville Vainio <vivainio@gmail.com>
43 2007-08-20 Ville Vainio <vivainio@gmail.com>
39
44
40 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
45 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
41 locate alias redeclarations etc. Also, avoid handling
46 locate alias redeclarations etc. Also, avoid handling
42 _ip.IP.alias_table directly, prefer using _ip.defalias.
47 _ip.IP.alias_table directly, prefer using _ip.defalias.
43
48
44
49
45 2007-08-15 Ville Vainio <vivainio@gmail.com>
50 2007-08-15 Ville Vainio <vivainio@gmail.com>
46
51
47 * prefilter.py: ! is now always served first
52 * prefilter.py: ! is now always served first
48
53
49 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
54 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
50
55
51 * IPython/iplib.py (safe_execfile): fix the SystemExit
56 * IPython/iplib.py (safe_execfile): fix the SystemExit
52 auto-suppression code to work in Python2.4 (the internal structure
57 auto-suppression code to work in Python2.4 (the internal structure
53 of that exception changed and I'd only tested the code with 2.5).
58 of that exception changed and I'd only tested the code with 2.5).
54 Bug reported by a SciPy attendee.
59 Bug reported by a SciPy attendee.
55
60
56 2007-08-13 Ville Vainio <vivainio@gmail.com>
61 2007-08-13 Ville Vainio <vivainio@gmail.com>
57
62
58 * prefilter.py: reverted !c:/bin/foo fix, made % in
63 * prefilter.py: reverted !c:/bin/foo fix, made % in
59 multiline specials work again
64 multiline specials work again
60
65
61 2007-08-13 Ville Vainio <vivainio@gmail.com>
66 2007-08-13 Ville Vainio <vivainio@gmail.com>
62
67
63 * prefilter.py: Take more care to special-case !, so that
68 * prefilter.py: Take more care to special-case !, so that
64 !c:/bin/foo.exe works.
69 !c:/bin/foo.exe works.
65
70
66 * setup.py: if we are building eggs, strip all docs and
71 * setup.py: if we are building eggs, strip all docs and
67 examples (it doesn't make sense to bytecompile examples,
72 examples (it doesn't make sense to bytecompile examples,
68 and docs would be in an awkward place anyway).
73 and docs would be in an awkward place anyway).
69
74
70 * Ryan Krauss' patch fixes start menu shortcuts when IPython
75 * Ryan Krauss' patch fixes start menu shortcuts when IPython
71 is installed into a directory that has spaces in the name.
76 is installed into a directory that has spaces in the name.
72
77
73 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
78 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
74
79
75 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
80 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
76 doctest profile and %doctest_mode, so they actually generate the
81 doctest profile and %doctest_mode, so they actually generate the
77 blank lines needed by doctest to separate individual tests.
82 blank lines needed by doctest to separate individual tests.
78
83
79 * IPython/iplib.py (safe_execfile): modify so that running code
84 * IPython/iplib.py (safe_execfile): modify so that running code
80 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
85 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
81 doesn't get a printed traceback. Any other value in sys.exit(),
86 doesn't get a printed traceback. Any other value in sys.exit(),
82 including the empty call, still generates a traceback. This
87 including the empty call, still generates a traceback. This
83 enables use of %run without having to pass '-e' for codes that
88 enables use of %run without having to pass '-e' for codes that
84 correctly set the exit status flag.
89 correctly set the exit status flag.
85
90
86 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
91 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
87
92
88 * IPython/iplib.py (InteractiveShell.post_config_initialization):
93 * IPython/iplib.py (InteractiveShell.post_config_initialization):
89 fix problems with doctests failing when run inside IPython due to
94 fix problems with doctests failing when run inside IPython due to
90 IPython's modifications of sys.displayhook.
95 IPython's modifications of sys.displayhook.
91
96
92 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
97 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
93
98
94 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
99 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
95 a string with names.
100 a string with names.
96
101
97 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
102 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
98
103
99 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
104 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
100 magic to toggle on/off the doctest pasting support without having
105 magic to toggle on/off the doctest pasting support without having
101 to leave a session to switch to a separate profile.
106 to leave a session to switch to a separate profile.
102
107
103 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
108 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
104
109
105 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
110 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
106 introduce a blank line between inputs, to conform to doctest
111 introduce a blank line between inputs, to conform to doctest
107 requirements.
112 requirements.
108
113
109 * IPython/OInspect.py (Inspector.pinfo): fix another part where
114 * IPython/OInspect.py (Inspector.pinfo): fix another part where
110 auto-generated docstrings for new-style classes were showing up.
115 auto-generated docstrings for new-style classes were showing up.
111
116
112 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
117 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
113
118
114 * api_changes: Add new file to track backward-incompatible
119 * api_changes: Add new file to track backward-incompatible
115 user-visible changes.
120 user-visible changes.
116
121
117 2007-08-06 Ville Vainio <vivainio@gmail.com>
122 2007-08-06 Ville Vainio <vivainio@gmail.com>
118
123
119 * ipmaker.py: fix bug where user_config_ns didn't exist at all
124 * ipmaker.py: fix bug where user_config_ns didn't exist at all
120 before all the config files were handled.
125 before all the config files were handled.
121
126
122 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
127 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
123
128
124 * IPython/irunner.py (RunnerFactory): Add new factory class for
129 * IPython/irunner.py (RunnerFactory): Add new factory class for
125 creating reusable runners based on filenames.
130 creating reusable runners based on filenames.
126
131
127 * IPython/Extensions/ipy_profile_doctest.py: New profile for
132 * IPython/Extensions/ipy_profile_doctest.py: New profile for
128 doctest support. It sets prompts/exceptions as similar to
133 doctest support. It sets prompts/exceptions as similar to
129 standard Python as possible, so that ipython sessions in this
134 standard Python as possible, so that ipython sessions in this
130 profile can be easily pasted as doctests with minimal
135 profile can be easily pasted as doctests with minimal
131 modifications. It also enables pasting of doctests from external
136 modifications. It also enables pasting of doctests from external
132 sources (even if they have leading whitespace), so that you can
137 sources (even if they have leading whitespace), so that you can
133 rerun doctests from existing sources.
138 rerun doctests from existing sources.
134
139
135 * IPython/iplib.py (_prefilter): fix a buglet where after entering
140 * IPython/iplib.py (_prefilter): fix a buglet where after entering
136 some whitespace, the prompt would become a continuation prompt
141 some whitespace, the prompt would become a continuation prompt
137 with no way of exiting it other than Ctrl-C. This fix brings us
142 with no way of exiting it other than Ctrl-C. This fix brings us
138 into conformity with how the default python prompt works.
143 into conformity with how the default python prompt works.
139
144
140 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
145 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
141 Add support for pasting not only lines that start with '>>>', but
146 Add support for pasting not only lines that start with '>>>', but
142 also with ' >>>'. That is, arbitrary whitespace can now precede
147 also with ' >>>'. That is, arbitrary whitespace can now precede
143 the prompts. This makes the system useful for pasting doctests
148 the prompts. This makes the system useful for pasting doctests
144 from docstrings back into a normal session.
149 from docstrings back into a normal session.
145
150
146 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
151 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
147
152
148 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
153 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
149 r1357, which had killed multiple invocations of an embedded
154 r1357, which had killed multiple invocations of an embedded
150 ipython (this means that example-embed has been broken for over 1
155 ipython (this means that example-embed has been broken for over 1
151 year!!!). Rather than possibly breaking the batch stuff for which
156 year!!!). Rather than possibly breaking the batch stuff for which
152 the code in iplib.py/interact was introduced, I worked around the
157 the code in iplib.py/interact was introduced, I worked around the
153 problem in the embedding class in Shell.py. We really need a
158 problem in the embedding class in Shell.py. We really need a
154 bloody test suite for this code, I'm sick of finding stuff that
159 bloody test suite for this code, I'm sick of finding stuff that
155 used to work breaking left and right every time I use an old
160 used to work breaking left and right every time I use an old
156 feature I hadn't touched in a few months.
161 feature I hadn't touched in a few months.
157 (kill_embedded): Add a new magic that only shows up in embedded
162 (kill_embedded): Add a new magic that only shows up in embedded
158 mode, to allow users to permanently deactivate an embedded instance.
163 mode, to allow users to permanently deactivate an embedded instance.
159
164
160 2007-08-01 Ville Vainio <vivainio@gmail.com>
165 2007-08-01 Ville Vainio <vivainio@gmail.com>
161
166
162 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
167 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
163 history gets out of sync on runlines (e.g. when running macros).
168 history gets out of sync on runlines (e.g. when running macros).
164
169
165 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
170 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
166
171
167 * IPython/Magic.py (magic_colors): fix win32-related error message
172 * IPython/Magic.py (magic_colors): fix win32-related error message
168 that could appear under *nix when readline was missing. Patch by
173 that could appear under *nix when readline was missing. Patch by
169 Scott Jackson, closes #175.
174 Scott Jackson, closes #175.
170
175
171 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
176 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
172
177
173 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
178 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
174 completer that it traits-aware, so that traits objects don't show
179 completer that it traits-aware, so that traits objects don't show
175 all of their internal attributes all the time.
180 all of their internal attributes all the time.
176
181
177 * IPython/genutils.py (dir2): moved this code from inside
182 * IPython/genutils.py (dir2): moved this code from inside
178 completer.py to expose it publicly, so I could use it in the
183 completer.py to expose it publicly, so I could use it in the
179 wildcards bugfix.
184 wildcards bugfix.
180
185
181 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
186 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
182 Stefan with Traits.
187 Stefan with Traits.
183
188
184 * IPython/completer.py (Completer.attr_matches): change internal
189 * IPython/completer.py (Completer.attr_matches): change internal
185 var name from 'object' to 'obj', since 'object' is now a builtin
190 var name from 'object' to 'obj', since 'object' is now a builtin
186 and this can lead to weird bugs if reusing this code elsewhere.
191 and this can lead to weird bugs if reusing this code elsewhere.
187
192
188 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
193 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
189
194
190 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
195 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
191 'foo?' and update the code to prevent printing of default
196 'foo?' and update the code to prevent printing of default
192 docstrings that started appearing after I added support for
197 docstrings that started appearing after I added support for
193 new-style classes. The approach I'm using isn't ideal (I just
198 new-style classes. The approach I'm using isn't ideal (I just
194 special-case those strings) but I'm not sure how to more robustly
199 special-case those strings) but I'm not sure how to more robustly
195 differentiate between truly user-written strings and Python's
200 differentiate between truly user-written strings and Python's
196 automatic ones.
201 automatic ones.
197
202
198 2007-07-09 Ville Vainio <vivainio@gmail.com>
203 2007-07-09 Ville Vainio <vivainio@gmail.com>
199
204
200 * completer.py: Applied Matthew Neeley's patch:
205 * completer.py: Applied Matthew Neeley's patch:
201 Dynamic attributes from trait_names and _getAttributeNames are added
206 Dynamic attributes from trait_names and _getAttributeNames are added
202 to the list of tab completions, but when this happens, the attribute
207 to the list of tab completions, but when this happens, the attribute
203 list is turned into a set, so the attributes are unordered when
208 list is turned into a set, so the attributes are unordered when
204 printed, which makes it hard to find the right completion. This patch
209 printed, which makes it hard to find the right completion. This patch
205 turns this set back into a list and sort it.
210 turns this set back into a list and sort it.
206
211
207 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
212 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
208
213
209 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
214 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
210 classes in various inspector functions.
215 classes in various inspector functions.
211
216
212 2007-06-28 Ville Vainio <vivainio@gmail.com>
217 2007-06-28 Ville Vainio <vivainio@gmail.com>
213
218
214 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
219 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
215 Implement "shadow" namespace, and callable aliases that reside there.
220 Implement "shadow" namespace, and callable aliases that reside there.
216 Use them by:
221 Use them by:
217
222
218 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
223 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
219
224
220 foo hello world
225 foo hello world
221 (gets translated to:)
226 (gets translated to:)
222 _sh.foo(r"""hello world""")
227 _sh.foo(r"""hello world""")
223
228
224 In practice, this kind of alias can take the role of a magic function
229 In practice, this kind of alias can take the role of a magic function
225
230
226 * New generic inspect_object, called on obj? and obj??
231 * New generic inspect_object, called on obj? and obj??
227
232
228 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
233 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
229
234
230 * IPython/ultraTB.py (findsource): fix a problem with
235 * IPython/ultraTB.py (findsource): fix a problem with
231 inspect.getfile that can cause crashes during traceback construction.
236 inspect.getfile that can cause crashes during traceback construction.
232
237
233 2007-06-14 Ville Vainio <vivainio@gmail.com>
238 2007-06-14 Ville Vainio <vivainio@gmail.com>
234
239
235 * iplib.py (handle_auto): Try to use ascii for printing "--->"
240 * iplib.py (handle_auto): Try to use ascii for printing "--->"
236 autocall rewrite indication, becausesometimes unicode fails to print
241 autocall rewrite indication, becausesometimes unicode fails to print
237 properly (and you get ' - - - '). Use plain uncoloured ---> for
242 properly (and you get ' - - - '). Use plain uncoloured ---> for
238 unicode.
243 unicode.
239
244
240 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
245 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
241
246
242 . pickleshare 'hash' commands (hget, hset, hcompress,
247 . pickleshare 'hash' commands (hget, hset, hcompress,
243 hdict) for efficient shadow history storage.
248 hdict) for efficient shadow history storage.
244
249
245 2007-06-13 Ville Vainio <vivainio@gmail.com>
250 2007-06-13 Ville Vainio <vivainio@gmail.com>
246
251
247 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
252 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
248 Added kw arg 'interactive', tell whether vars should be visible
253 Added kw arg 'interactive', tell whether vars should be visible
249 with %whos.
254 with %whos.
250
255
251 2007-06-11 Ville Vainio <vivainio@gmail.com>
256 2007-06-11 Ville Vainio <vivainio@gmail.com>
252
257
253 * pspersistence.py, Magic.py, iplib.py: directory history now saved
258 * pspersistence.py, Magic.py, iplib.py: directory history now saved
254 to db
259 to db
255
260
256 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
261 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
257 Also, it exits IPython immediately after evaluating the command (just like
262 Also, it exits IPython immediately after evaluating the command (just like
258 std python)
263 std python)
259
264
260 2007-06-05 Walter Doerwald <walter@livinglogic.de>
265 2007-06-05 Walter Doerwald <walter@livinglogic.de>
261
266
262 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
267 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
263 Python string and captures the output. (Idea and original patch by
268 Python string and captures the output. (Idea and original patch by
264 StοΏ½fan van der Walt)
269 StοΏ½fan van der Walt)
265
270
266 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
271 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
267
272
268 * IPython/ultraTB.py (VerboseTB.text): update printing of
273 * IPython/ultraTB.py (VerboseTB.text): update printing of
269 exception types for Python 2.5 (now all exceptions in the stdlib
274 exception types for Python 2.5 (now all exceptions in the stdlib
270 are new-style classes).
275 are new-style classes).
271
276
272 2007-05-31 Walter Doerwald <walter@livinglogic.de>
277 2007-05-31 Walter Doerwald <walter@livinglogic.de>
273
278
274 * IPython/Extensions/igrid.py: Add new commands refresh and
279 * IPython/Extensions/igrid.py: Add new commands refresh and
275 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
280 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
276 the iterator once (refresh) or after every x seconds (refresh_timer).
281 the iterator once (refresh) or after every x seconds (refresh_timer).
277 Add a working implementation of "searchexpression", where the text
282 Add a working implementation of "searchexpression", where the text
278 entered is not the text to search for, but an expression that must
283 entered is not the text to search for, but an expression that must
279 be true. Added display of shortcuts to the menu. Added commands "pickinput"
284 be true. Added display of shortcuts to the menu. Added commands "pickinput"
280 and "pickinputattr" that put the object or attribute under the cursor
285 and "pickinputattr" that put the object or attribute under the cursor
281 in the input line. Split the statusbar to be able to display the currently
286 in the input line. Split the statusbar to be able to display the currently
282 active refresh interval. (Patch by Nik Tautenhahn)
287 active refresh interval. (Patch by Nik Tautenhahn)
283
288
284 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
289 2007-05-29 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
285
290
286 * fixing set_term_title to use ctypes as default
291 * fixing set_term_title to use ctypes as default
287
292
288 * fixing set_term_title fallback to work when curent dir
293 * fixing set_term_title fallback to work when curent dir
289 is on a windows network share
294 is on a windows network share
290
295
291 2007-05-28 Ville Vainio <vivainio@gmail.com>
296 2007-05-28 Ville Vainio <vivainio@gmail.com>
292
297
293 * %cpaste: strip + with > from left (diffs).
298 * %cpaste: strip + with > from left (diffs).
294
299
295 * iplib.py: Fix crash when readline not installed
300 * iplib.py: Fix crash when readline not installed
296
301
297 2007-05-26 Ville Vainio <vivainio@gmail.com>
302 2007-05-26 Ville Vainio <vivainio@gmail.com>
298
303
299 * generics.py: intruduce easy to extend result_display generic
304 * generics.py: intruduce easy to extend result_display generic
300 function (using simplegeneric.py).
305 function (using simplegeneric.py).
301
306
302 * Fixed the append functionality of %set.
307 * Fixed the append functionality of %set.
303
308
304 2007-05-25 Ville Vainio <vivainio@gmail.com>
309 2007-05-25 Ville Vainio <vivainio@gmail.com>
305
310
306 * New magic: %rep (fetch / run old commands from history)
311 * New magic: %rep (fetch / run old commands from history)
307
312
308 * New extension: mglob (%mglob magic), for powerful glob / find /filter
313 * New extension: mglob (%mglob magic), for powerful glob / find /filter
309 like functionality
314 like functionality
310
315
311 % maghistory.py: %hist -g PATTERM greps the history for pattern
316 % maghistory.py: %hist -g PATTERM greps the history for pattern
312
317
313 2007-05-24 Walter Doerwald <walter@livinglogic.de>
318 2007-05-24 Walter Doerwald <walter@livinglogic.de>
314
319
315 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
320 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
316 browse the IPython input history
321 browse the IPython input history
317
322
318 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
323 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
319 (mapped to "i") can be used to put the object under the curser in the input
324 (mapped to "i") can be used to put the object under the curser in the input
320 line. pickinputattr (mapped to "I") does the same for the attribute under
325 line. pickinputattr (mapped to "I") does the same for the attribute under
321 the cursor.
326 the cursor.
322
327
323 2007-05-24 Ville Vainio <vivainio@gmail.com>
328 2007-05-24 Ville Vainio <vivainio@gmail.com>
324
329
325 * Grand magic cleansing (changeset [2380]):
330 * Grand magic cleansing (changeset [2380]):
326
331
327 * Introduce ipy_legacy.py where the following magics were
332 * Introduce ipy_legacy.py where the following magics were
328 moved:
333 moved:
329
334
330 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
335 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
331
336
332 If you need them, either use default profile or "import ipy_legacy"
337 If you need them, either use default profile or "import ipy_legacy"
333 in your ipy_user_conf.py
338 in your ipy_user_conf.py
334
339
335 * Move sh and scipy profile to Extensions from UserConfig. this implies
340 * Move sh and scipy profile to Extensions from UserConfig. this implies
336 you should not edit them, but you don't need to run %upgrade when
341 you should not edit them, but you don't need to run %upgrade when
337 upgrading IPython anymore.
342 upgrading IPython anymore.
338
343
339 * %hist/%history now operates in "raw" mode by default. To get the old
344 * %hist/%history now operates in "raw" mode by default. To get the old
340 behaviour, run '%hist -n' (native mode).
345 behaviour, run '%hist -n' (native mode).
341
346
342 * split ipy_stock_completers.py to ipy_stock_completers.py and
347 * split ipy_stock_completers.py to ipy_stock_completers.py and
343 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
348 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
344 installed as default.
349 installed as default.
345
350
346 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
351 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
347 handling.
352 handling.
348
353
349 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
354 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
350 input if readline is available.
355 input if readline is available.
351
356
352 2007-05-23 Ville Vainio <vivainio@gmail.com>
357 2007-05-23 Ville Vainio <vivainio@gmail.com>
353
358
354 * macro.py: %store uses __getstate__ properly
359 * macro.py: %store uses __getstate__ properly
355
360
356 * exesetup.py: added new setup script for creating
361 * exesetup.py: added new setup script for creating
357 standalone IPython executables with py2exe (i.e.
362 standalone IPython executables with py2exe (i.e.
358 no python installation required).
363 no python installation required).
359
364
360 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
365 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
361 its place.
366 its place.
362
367
363 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
368 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
364
369
365 2007-05-21 Ville Vainio <vivainio@gmail.com>
370 2007-05-21 Ville Vainio <vivainio@gmail.com>
366
371
367 * platutil_win32.py (set_term_title): handle
372 * platutil_win32.py (set_term_title): handle
368 failure of 'title' system call properly.
373 failure of 'title' system call properly.
369
374
370 2007-05-17 Walter Doerwald <walter@livinglogic.de>
375 2007-05-17 Walter Doerwald <walter@livinglogic.de>
371
376
372 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
377 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
373 (Bug detected by Paul Mueller).
378 (Bug detected by Paul Mueller).
374
379
375 2007-05-16 Ville Vainio <vivainio@gmail.com>
380 2007-05-16 Ville Vainio <vivainio@gmail.com>
376
381
377 * ipy_profile_sci.py, ipython_win_post_install.py: Create
382 * ipy_profile_sci.py, ipython_win_post_install.py: Create
378 new "sci" profile, effectively a modern version of the old
383 new "sci" profile, effectively a modern version of the old
379 "scipy" profile (which is now slated for deprecation).
384 "scipy" profile (which is now slated for deprecation).
380
385
381 2007-05-15 Ville Vainio <vivainio@gmail.com>
386 2007-05-15 Ville Vainio <vivainio@gmail.com>
382
387
383 * pycolorize.py, pycolor.1: Paul Mueller's patches that
388 * pycolorize.py, pycolor.1: Paul Mueller's patches that
384 make pycolorize read input from stdin when run without arguments.
389 make pycolorize read input from stdin when run without arguments.
385
390
386 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
391 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
387
392
388 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
393 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
389 it in sh profile (instead of ipy_system_conf.py).
394 it in sh profile (instead of ipy_system_conf.py).
390
395
391 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
396 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
392 aliases are now lower case on windows (MyCommand.exe => mycommand).
397 aliases are now lower case on windows (MyCommand.exe => mycommand).
393
398
394 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
399 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
395 Macros are now callable objects that inherit from ipapi.IPyAutocall,
400 Macros are now callable objects that inherit from ipapi.IPyAutocall,
396 i.e. get autocalled regardless of system autocall setting.
401 i.e. get autocalled regardless of system autocall setting.
397
402
398 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
403 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
399
404
400 * IPython/rlineimpl.py: check for clear_history in readline and
405 * IPython/rlineimpl.py: check for clear_history in readline and
401 make it a dummy no-op if not available. This function isn't
406 make it a dummy no-op if not available. This function isn't
402 guaranteed to be in the API and appeared in Python 2.4, so we need
407 guaranteed to be in the API and appeared in Python 2.4, so we need
403 to check it ourselves. Also, clean up this file quite a bit.
408 to check it ourselves. Also, clean up this file quite a bit.
404
409
405 * ipython.1: update man page and full manual with information
410 * ipython.1: update man page and full manual with information
406 about threads (remove outdated warning). Closes #151.
411 about threads (remove outdated warning). Closes #151.
407
412
408 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
413 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
409
414
410 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
415 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
411 in trunk (note that this made it into the 0.8.1 release already,
416 in trunk (note that this made it into the 0.8.1 release already,
412 but the changelogs didn't get coordinated). Many thanks to Gael
417 but the changelogs didn't get coordinated). Many thanks to Gael
413 Varoquaux <gael.varoquaux-AT-normalesup.org>
418 Varoquaux <gael.varoquaux-AT-normalesup.org>
414
419
415 2007-05-09 *** Released version 0.8.1
420 2007-05-09 *** Released version 0.8.1
416
421
417 2007-05-10 Walter Doerwald <walter@livinglogic.de>
422 2007-05-10 Walter Doerwald <walter@livinglogic.de>
418
423
419 * IPython/Extensions/igrid.py: Incorporate html help into
424 * IPython/Extensions/igrid.py: Incorporate html help into
420 the module, so we don't have to search for the file.
425 the module, so we don't have to search for the file.
421
426
422 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
427 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
423
428
424 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
429 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
425
430
426 2007-04-30 Ville Vainio <vivainio@gmail.com>
431 2007-04-30 Ville Vainio <vivainio@gmail.com>
427
432
428 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
433 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
429 user has illegal (non-ascii) home directory name
434 user has illegal (non-ascii) home directory name
430
435
431 2007-04-27 Ville Vainio <vivainio@gmail.com>
436 2007-04-27 Ville Vainio <vivainio@gmail.com>
432
437
433 * platutils_win32.py: implement set_term_title for windows
438 * platutils_win32.py: implement set_term_title for windows
434
439
435 * Update version number
440 * Update version number
436
441
437 * ipy_profile_sh.py: more informative prompt (2 dir levels)
442 * ipy_profile_sh.py: more informative prompt (2 dir levels)
438
443
439 2007-04-26 Walter Doerwald <walter@livinglogic.de>
444 2007-04-26 Walter Doerwald <walter@livinglogic.de>
440
445
441 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
446 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
442 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
447 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
443 bug discovered by Ville).
448 bug discovered by Ville).
444
449
445 2007-04-26 Ville Vainio <vivainio@gmail.com>
450 2007-04-26 Ville Vainio <vivainio@gmail.com>
446
451
447 * Extensions/ipy_completers.py: Olivier's module completer now
452 * Extensions/ipy_completers.py: Olivier's module completer now
448 saves the list of root modules if it takes > 4 secs on the first run.
453 saves the list of root modules if it takes > 4 secs on the first run.
449
454
450 * Magic.py (%rehashx): %rehashx now clears the completer cache
455 * Magic.py (%rehashx): %rehashx now clears the completer cache
451
456
452
457
453 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
458 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
454
459
455 * ipython.el: fix incorrect color scheme, reported by Stefan.
460 * ipython.el: fix incorrect color scheme, reported by Stefan.
456 Closes #149.
461 Closes #149.
457
462
458 * IPython/PyColorize.py (Parser.format2): fix state-handling
463 * IPython/PyColorize.py (Parser.format2): fix state-handling
459 logic. I still don't like how that code handles state, but at
464 logic. I still don't like how that code handles state, but at
460 least now it should be correct, if inelegant. Closes #146.
465 least now it should be correct, if inelegant. Closes #146.
461
466
462 2007-04-25 Ville Vainio <vivainio@gmail.com>
467 2007-04-25 Ville Vainio <vivainio@gmail.com>
463
468
464 * Extensions/ipy_which.py: added extension for %which magic, works
469 * Extensions/ipy_which.py: added extension for %which magic, works
465 a lot like unix 'which' but also finds and expands aliases, and
470 a lot like unix 'which' but also finds and expands aliases, and
466 allows wildcards.
471 allows wildcards.
467
472
468 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
473 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
469 as opposed to returning nothing.
474 as opposed to returning nothing.
470
475
471 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
476 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
472 ipy_stock_completers on default profile, do import on sh profile.
477 ipy_stock_completers on default profile, do import on sh profile.
473
478
474 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
479 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
475
480
476 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
481 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
477 like ipython.py foo.py which raised a IndexError.
482 like ipython.py foo.py which raised a IndexError.
478
483
479 2007-04-21 Ville Vainio <vivainio@gmail.com>
484 2007-04-21 Ville Vainio <vivainio@gmail.com>
480
485
481 * Extensions/ipy_extutil.py: added extension to manage other ipython
486 * Extensions/ipy_extutil.py: added extension to manage other ipython
482 extensions. Now only supports 'ls' == list extensions.
487 extensions. Now only supports 'ls' == list extensions.
483
488
484 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
489 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
485
490
486 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
491 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
487 would prevent use of the exception system outside of a running
492 would prevent use of the exception system outside of a running
488 IPython instance.
493 IPython instance.
489
494
490 2007-04-20 Ville Vainio <vivainio@gmail.com>
495 2007-04-20 Ville Vainio <vivainio@gmail.com>
491
496
492 * Extensions/ipy_render.py: added extension for easy
497 * Extensions/ipy_render.py: added extension for easy
493 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
498 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
494 'Iptl' template notation,
499 'Iptl' template notation,
495
500
496 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
501 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
497 safer & faster 'import' completer.
502 safer & faster 'import' completer.
498
503
499 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
504 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
500 and _ip.defalias(name, command).
505 and _ip.defalias(name, command).
501
506
502 * Extensions/ipy_exportdb.py: New extension for exporting all the
507 * Extensions/ipy_exportdb.py: New extension for exporting all the
503 %store'd data in a portable format (normal ipapi calls like
508 %store'd data in a portable format (normal ipapi calls like
504 defmacro() etc.)
509 defmacro() etc.)
505
510
506 2007-04-19 Ville Vainio <vivainio@gmail.com>
511 2007-04-19 Ville Vainio <vivainio@gmail.com>
507
512
508 * upgrade_dir.py: skip junk files like *.pyc
513 * upgrade_dir.py: skip junk files like *.pyc
509
514
510 * Release.py: version number to 0.8.1
515 * Release.py: version number to 0.8.1
511
516
512 2007-04-18 Ville Vainio <vivainio@gmail.com>
517 2007-04-18 Ville Vainio <vivainio@gmail.com>
513
518
514 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
519 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
515 and later on win32.
520 and later on win32.
516
521
517 2007-04-16 Ville Vainio <vivainio@gmail.com>
522 2007-04-16 Ville Vainio <vivainio@gmail.com>
518
523
519 * iplib.py (showtraceback): Do not crash when running w/o readline.
524 * iplib.py (showtraceback): Do not crash when running w/o readline.
520
525
521 2007-04-12 Walter Doerwald <walter@livinglogic.de>
526 2007-04-12 Walter Doerwald <walter@livinglogic.de>
522
527
523 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
528 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
524 sorted (case sensitive with files and dirs mixed).
529 sorted (case sensitive with files and dirs mixed).
525
530
526 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
531 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
527
532
528 * IPython/Release.py (version): Open trunk for 0.8.1 development.
533 * IPython/Release.py (version): Open trunk for 0.8.1 development.
529
534
530 2007-04-10 *** Released version 0.8.0
535 2007-04-10 *** Released version 0.8.0
531
536
532 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
537 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
533
538
534 * Tag 0.8.0 for release.
539 * Tag 0.8.0 for release.
535
540
536 * IPython/iplib.py (reloadhist): add API function to cleanly
541 * IPython/iplib.py (reloadhist): add API function to cleanly
537 reload the readline history, which was growing inappropriately on
542 reload the readline history, which was growing inappropriately on
538 every %run call.
543 every %run call.
539
544
540 * win32_manual_post_install.py (run): apply last part of Nicolas
545 * win32_manual_post_install.py (run): apply last part of Nicolas
541 Pernetty's patch (I'd accidentally applied it in a different
546 Pernetty's patch (I'd accidentally applied it in a different
542 directory and this particular file didn't get patched).
547 directory and this particular file didn't get patched).
543
548
544 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
549 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
545
550
546 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
551 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
547 find the main thread id and use the proper API call. Thanks to
552 find the main thread id and use the proper API call. Thanks to
548 Stefan for the fix.
553 Stefan for the fix.
549
554
550 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
555 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
551 unit tests to reflect fixed ticket #52, and add more tests sent by
556 unit tests to reflect fixed ticket #52, and add more tests sent by
552 him.
557 him.
553
558
554 * IPython/iplib.py (raw_input): restore the readline completer
559 * IPython/iplib.py (raw_input): restore the readline completer
555 state on every input, in case third-party code messed it up.
560 state on every input, in case third-party code messed it up.
556 (_prefilter): revert recent addition of early-escape checks which
561 (_prefilter): revert recent addition of early-escape checks which
557 prevent many valid alias calls from working.
562 prevent many valid alias calls from working.
558
563
559 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
564 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
560 flag for sigint handler so we don't run a full signal() call on
565 flag for sigint handler so we don't run a full signal() call on
561 each runcode access.
566 each runcode access.
562
567
563 * IPython/Magic.py (magic_whos): small improvement to diagnostic
568 * IPython/Magic.py (magic_whos): small improvement to diagnostic
564 message.
569 message.
565
570
566 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
571 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
567
572
568 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
573 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
569 asynchronous exceptions working, i.e., Ctrl-C can actually
574 asynchronous exceptions working, i.e., Ctrl-C can actually
570 interrupt long-running code in the multithreaded shells.
575 interrupt long-running code in the multithreaded shells.
571
576
572 This is using Tomer Filiba's great ctypes-based trick:
577 This is using Tomer Filiba's great ctypes-based trick:
573 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
578 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
574 this in the past, but hadn't been able to make it work before. So
579 this in the past, but hadn't been able to make it work before. So
575 far it looks like it's actually running, but this needs more
580 far it looks like it's actually running, but this needs more
576 testing. If it really works, I'll be *very* happy, and we'll owe
581 testing. If it really works, I'll be *very* happy, and we'll owe
577 a huge thank you to Tomer. My current implementation is ugly,
582 a huge thank you to Tomer. My current implementation is ugly,
578 hackish and uses nasty globals, but I don't want to try and clean
583 hackish and uses nasty globals, but I don't want to try and clean
579 anything up until we know if it actually works.
584 anything up until we know if it actually works.
580
585
581 NOTE: this feature needs ctypes to work. ctypes is included in
586 NOTE: this feature needs ctypes to work. ctypes is included in
582 Python2.5, but 2.4 users will need to manually install it. This
587 Python2.5, but 2.4 users will need to manually install it. This
583 feature makes multi-threaded shells so much more usable that it's
588 feature makes multi-threaded shells so much more usable that it's
584 a minor price to pay (ctypes is very easy to install, already a
589 a minor price to pay (ctypes is very easy to install, already a
585 requirement for win32 and available in major linux distros).
590 requirement for win32 and available in major linux distros).
586
591
587 2007-04-04 Ville Vainio <vivainio@gmail.com>
592 2007-04-04 Ville Vainio <vivainio@gmail.com>
588
593
589 * Extensions/ipy_completers.py, ipy_stock_completers.py:
594 * Extensions/ipy_completers.py, ipy_stock_completers.py:
590 Moved implementations of 'bundled' completers to ipy_completers.py,
595 Moved implementations of 'bundled' completers to ipy_completers.py,
591 they are only enabled in ipy_stock_completers.py.
596 they are only enabled in ipy_stock_completers.py.
592
597
593 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
598 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
594
599
595 * IPython/PyColorize.py (Parser.format2): Fix identation of
600 * IPython/PyColorize.py (Parser.format2): Fix identation of
596 colorzied output and return early if color scheme is NoColor, to
601 colorzied output and return early if color scheme is NoColor, to
597 avoid unnecessary and expensive tokenization. Closes #131.
602 avoid unnecessary and expensive tokenization. Closes #131.
598
603
599 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
604 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
600
605
601 * IPython/Debugger.py: disable the use of pydb version 1.17. It
606 * IPython/Debugger.py: disable the use of pydb version 1.17. It
602 has a critical bug (a missing import that makes post-mortem not
607 has a critical bug (a missing import that makes post-mortem not
603 work at all). Unfortunately as of this time, this is the version
608 work at all). Unfortunately as of this time, this is the version
604 shipped with Ubuntu Edgy, so quite a few people have this one. I
609 shipped with Ubuntu Edgy, so quite a few people have this one. I
605 hope Edgy will update to a more recent package.
610 hope Edgy will update to a more recent package.
606
611
607 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
612 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
608
613
609 * IPython/iplib.py (_prefilter): close #52, second part of a patch
614 * IPython/iplib.py (_prefilter): close #52, second part of a patch
610 set by Stefan (only the first part had been applied before).
615 set by Stefan (only the first part had been applied before).
611
616
612 * IPython/Extensions/ipy_stock_completers.py (module_completer):
617 * IPython/Extensions/ipy_stock_completers.py (module_completer):
613 remove usage of the dangerous pkgutil.walk_packages(). See
618 remove usage of the dangerous pkgutil.walk_packages(). See
614 details in comments left in the code.
619 details in comments left in the code.
615
620
616 * IPython/Magic.py (magic_whos): add support for numpy arrays
621 * IPython/Magic.py (magic_whos): add support for numpy arrays
617 similar to what we had for Numeric.
622 similar to what we had for Numeric.
618
623
619 * IPython/completer.py (IPCompleter.complete): extend the
624 * IPython/completer.py (IPCompleter.complete): extend the
620 complete() call API to support completions by other mechanisms
625 complete() call API to support completions by other mechanisms
621 than readline. Closes #109.
626 than readline. Closes #109.
622
627
623 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
628 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
624 protect against a bug in Python's execfile(). Closes #123.
629 protect against a bug in Python's execfile(). Closes #123.
625
630
626 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
631 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
627
632
628 * IPython/iplib.py (split_user_input): ensure that when splitting
633 * IPython/iplib.py (split_user_input): ensure that when splitting
629 user input, the part that can be treated as a python name is pure
634 user input, the part that can be treated as a python name is pure
630 ascii (Python identifiers MUST be pure ascii). Part of the
635 ascii (Python identifiers MUST be pure ascii). Part of the
631 ongoing Unicode support work.
636 ongoing Unicode support work.
632
637
633 * IPython/Prompts.py (prompt_specials_color): Add \N for the
638 * IPython/Prompts.py (prompt_specials_color): Add \N for the
634 actual prompt number, without any coloring. This allows users to
639 actual prompt number, without any coloring. This allows users to
635 produce numbered prompts with their own colors. Added after a
640 produce numbered prompts with their own colors. Added after a
636 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
641 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
637
642
638 2007-03-31 Walter Doerwald <walter@livinglogic.de>
643 2007-03-31 Walter Doerwald <walter@livinglogic.de>
639
644
640 * IPython/Extensions/igrid.py: Map the return key
645 * IPython/Extensions/igrid.py: Map the return key
641 to enter() and shift-return to enterattr().
646 to enter() and shift-return to enterattr().
642
647
643 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
648 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
644
649
645 * IPython/Magic.py (magic_psearch): add unicode support by
650 * IPython/Magic.py (magic_psearch): add unicode support by
646 encoding to ascii the input, since this routine also only deals
651 encoding to ascii the input, since this routine also only deals
647 with valid Python names. Fixes a bug reported by Stefan.
652 with valid Python names. Fixes a bug reported by Stefan.
648
653
649 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
654 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
650
655
651 * IPython/Magic.py (_inspect): convert unicode input into ascii
656 * IPython/Magic.py (_inspect): convert unicode input into ascii
652 before trying to evaluate it as a Python identifier. This fixes a
657 before trying to evaluate it as a Python identifier. This fixes a
653 problem that the new unicode support had introduced when analyzing
658 problem that the new unicode support had introduced when analyzing
654 long definition lines for functions.
659 long definition lines for functions.
655
660
656 2007-03-24 Walter Doerwald <walter@livinglogic.de>
661 2007-03-24 Walter Doerwald <walter@livinglogic.de>
657
662
658 * IPython/Extensions/igrid.py: Fix picking. Using
663 * IPython/Extensions/igrid.py: Fix picking. Using
659 igrid with wxPython 2.6 and -wthread should work now.
664 igrid with wxPython 2.6 and -wthread should work now.
660 igrid.display() simply tries to create a frame without
665 igrid.display() simply tries to create a frame without
661 an application. Only if this fails an application is created.
666 an application. Only if this fails an application is created.
662
667
663 2007-03-23 Walter Doerwald <walter@livinglogic.de>
668 2007-03-23 Walter Doerwald <walter@livinglogic.de>
664
669
665 * IPython/Extensions/path.py: Updated to version 2.2.
670 * IPython/Extensions/path.py: Updated to version 2.2.
666
671
667 2007-03-23 Ville Vainio <vivainio@gmail.com>
672 2007-03-23 Ville Vainio <vivainio@gmail.com>
668
673
669 * iplib.py: recursive alias expansion now works better, so that
674 * iplib.py: recursive alias expansion now works better, so that
670 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
675 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
671 doesn't trip up the process, if 'd' has been aliased to 'ls'.
676 doesn't trip up the process, if 'd' has been aliased to 'ls'.
672
677
673 * Extensions/ipy_gnuglobal.py added, provides %global magic
678 * Extensions/ipy_gnuglobal.py added, provides %global magic
674 for users of http://www.gnu.org/software/global
679 for users of http://www.gnu.org/software/global
675
680
676 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
681 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
677 Closes #52. Patch by Stefan van der Walt.
682 Closes #52. Patch by Stefan van der Walt.
678
683
679 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
684 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
680
685
681 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
686 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
682 respect the __file__ attribute when using %run. Thanks to a bug
687 respect the __file__ attribute when using %run. Thanks to a bug
683 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
688 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
684
689
685 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
690 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
686
691
687 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
692 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
688 input. Patch sent by Stefan.
693 input. Patch sent by Stefan.
689
694
690 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
695 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
691 * IPython/Extensions/ipy_stock_completer.py
696 * IPython/Extensions/ipy_stock_completer.py
692 shlex_split, fix bug in shlex_split. len function
697 shlex_split, fix bug in shlex_split. len function
693 call was missing an if statement. Caused shlex_split to
698 call was missing an if statement. Caused shlex_split to
694 sometimes return "" as last element.
699 sometimes return "" as last element.
695
700
696 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
701 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
697
702
698 * IPython/completer.py
703 * IPython/completer.py
699 (IPCompleter.file_matches.single_dir_expand): fix a problem
704 (IPCompleter.file_matches.single_dir_expand): fix a problem
700 reported by Stefan, where directories containign a single subdir
705 reported by Stefan, where directories containign a single subdir
701 would be completed too early.
706 would be completed too early.
702
707
703 * IPython/Shell.py (_load_pylab): Make the execution of 'from
708 * IPython/Shell.py (_load_pylab): Make the execution of 'from
704 pylab import *' when -pylab is given be optional. A new flag,
709 pylab import *' when -pylab is given be optional. A new flag,
705 pylab_import_all controls this behavior, the default is True for
710 pylab_import_all controls this behavior, the default is True for
706 backwards compatibility.
711 backwards compatibility.
707
712
708 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
713 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
709 modified) R. Bernstein's patch for fully syntax highlighted
714 modified) R. Bernstein's patch for fully syntax highlighted
710 tracebacks. The functionality is also available under ultraTB for
715 tracebacks. The functionality is also available under ultraTB for
711 non-ipython users (someone using ultraTB but outside an ipython
716 non-ipython users (someone using ultraTB but outside an ipython
712 session). They can select the color scheme by setting the
717 session). They can select the color scheme by setting the
713 module-level global DEFAULT_SCHEME. The highlight functionality
718 module-level global DEFAULT_SCHEME. The highlight functionality
714 also works when debugging.
719 also works when debugging.
715
720
716 * IPython/genutils.py (IOStream.close): small patch by
721 * IPython/genutils.py (IOStream.close): small patch by
717 R. Bernstein for improved pydb support.
722 R. Bernstein for improved pydb support.
718
723
719 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
724 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
720 DaveS <davls@telus.net> to improve support of debugging under
725 DaveS <davls@telus.net> to improve support of debugging under
721 NTEmacs, including improved pydb behavior.
726 NTEmacs, including improved pydb behavior.
722
727
723 * IPython/Magic.py (magic_prun): Fix saving of profile info for
728 * IPython/Magic.py (magic_prun): Fix saving of profile info for
724 Python 2.5, where the stats object API changed a little. Thanks
729 Python 2.5, where the stats object API changed a little. Thanks
725 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
730 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
726
731
727 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
732 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
728 Pernetty's patch to improve support for (X)Emacs under Win32.
733 Pernetty's patch to improve support for (X)Emacs under Win32.
729
734
730 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
735 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
731
736
732 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
737 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
733 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
738 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
734 a report by Nik Tautenhahn.
739 a report by Nik Tautenhahn.
735
740
736 2007-03-16 Walter Doerwald <walter@livinglogic.de>
741 2007-03-16 Walter Doerwald <walter@livinglogic.de>
737
742
738 * setup.py: Add the igrid help files to the list of data files
743 * setup.py: Add the igrid help files to the list of data files
739 to be installed alongside igrid.
744 to be installed alongside igrid.
740 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
745 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
741 Show the input object of the igrid browser as the window tile.
746 Show the input object of the igrid browser as the window tile.
742 Show the object the cursor is on in the statusbar.
747 Show the object the cursor is on in the statusbar.
743
748
744 2007-03-15 Ville Vainio <vivainio@gmail.com>
749 2007-03-15 Ville Vainio <vivainio@gmail.com>
745
750
746 * Extensions/ipy_stock_completers.py: Fixed exception
751 * Extensions/ipy_stock_completers.py: Fixed exception
747 on mismatching quotes in %run completer. Patch by
752 on mismatching quotes in %run completer. Patch by
748 JοΏ½rgen Stenarson. Closes #127.
753 JοΏ½rgen Stenarson. Closes #127.
749
754
750 2007-03-14 Ville Vainio <vivainio@gmail.com>
755 2007-03-14 Ville Vainio <vivainio@gmail.com>
751
756
752 * Extensions/ext_rehashdir.py: Do not do auto_alias
757 * Extensions/ext_rehashdir.py: Do not do auto_alias
753 in %rehashdir, it clobbers %store'd aliases.
758 in %rehashdir, it clobbers %store'd aliases.
754
759
755 * UserConfig/ipy_profile_sh.py: envpersist.py extension
760 * UserConfig/ipy_profile_sh.py: envpersist.py extension
756 (beefed up %env) imported for sh profile.
761 (beefed up %env) imported for sh profile.
757
762
758 2007-03-10 Walter Doerwald <walter@livinglogic.de>
763 2007-03-10 Walter Doerwald <walter@livinglogic.de>
759
764
760 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
765 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
761 as the default browser.
766 as the default browser.
762 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
767 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
763 As igrid displays all attributes it ever encounters, fetch() (which has
768 As igrid displays all attributes it ever encounters, fetch() (which has
764 been renamed to _fetch()) doesn't have to recalculate the display attributes
769 been renamed to _fetch()) doesn't have to recalculate the display attributes
765 every time a new item is fetched. This should speed up scrolling.
770 every time a new item is fetched. This should speed up scrolling.
766
771
767 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
772 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
768
773
769 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
774 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
770 Schmolck's recently reported tab-completion bug (my previous one
775 Schmolck's recently reported tab-completion bug (my previous one
771 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
776 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
772
777
773 2007-03-09 Walter Doerwald <walter@livinglogic.de>
778 2007-03-09 Walter Doerwald <walter@livinglogic.de>
774
779
775 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
780 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
776 Close help window if exiting igrid.
781 Close help window if exiting igrid.
777
782
778 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
783 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
779
784
780 * IPython/Extensions/ipy_defaults.py: Check if readline is available
785 * IPython/Extensions/ipy_defaults.py: Check if readline is available
781 before calling functions from readline.
786 before calling functions from readline.
782
787
783 2007-03-02 Walter Doerwald <walter@livinglogic.de>
788 2007-03-02 Walter Doerwald <walter@livinglogic.de>
784
789
785 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
790 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
786 igrid is a wxPython-based display object for ipipe. If your system has
791 igrid is a wxPython-based display object for ipipe. If your system has
787 wx installed igrid will be the default display. Without wx ipipe falls
792 wx installed igrid will be the default display. Without wx ipipe falls
788 back to ibrowse (which needs curses). If no curses is installed ipipe
793 back to ibrowse (which needs curses). If no curses is installed ipipe
789 falls back to idump.
794 falls back to idump.
790
795
791 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
796 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
792
797
793 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
798 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
794 my changes from yesterday, they introduced bugs. Will reactivate
799 my changes from yesterday, they introduced bugs. Will reactivate
795 once I get a correct solution, which will be much easier thanks to
800 once I get a correct solution, which will be much easier thanks to
796 Dan Milstein's new prefilter test suite.
801 Dan Milstein's new prefilter test suite.
797
802
798 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
803 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
799
804
800 * IPython/iplib.py (split_user_input): fix input splitting so we
805 * IPython/iplib.py (split_user_input): fix input splitting so we
801 don't attempt attribute accesses on things that can't possibly be
806 don't attempt attribute accesses on things that can't possibly be
802 valid Python attributes. After a bug report by Alex Schmolck.
807 valid Python attributes. After a bug report by Alex Schmolck.
803 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
808 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
804 %magic with explicit % prefix.
809 %magic with explicit % prefix.
805
810
806 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
811 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
807
812
808 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
813 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
809 avoid a DeprecationWarning from GTK.
814 avoid a DeprecationWarning from GTK.
810
815
811 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
816 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
812
817
813 * IPython/genutils.py (clock): I modified clock() to return total
818 * IPython/genutils.py (clock): I modified clock() to return total
814 time, user+system. This is a more commonly needed metric. I also
819 time, user+system. This is a more commonly needed metric. I also
815 introduced the new clocku/clocks to get only user/system time if
820 introduced the new clocku/clocks to get only user/system time if
816 one wants those instead.
821 one wants those instead.
817
822
818 ***WARNING: API CHANGE*** clock() used to return only user time,
823 ***WARNING: API CHANGE*** clock() used to return only user time,
819 so if you want exactly the same results as before, use clocku
824 so if you want exactly the same results as before, use clocku
820 instead.
825 instead.
821
826
822 2007-02-22 Ville Vainio <vivainio@gmail.com>
827 2007-02-22 Ville Vainio <vivainio@gmail.com>
823
828
824 * IPython/Extensions/ipy_p4.py: Extension for improved
829 * IPython/Extensions/ipy_p4.py: Extension for improved
825 p4 (perforce version control system) experience.
830 p4 (perforce version control system) experience.
826 Adds %p4 magic with p4 command completion and
831 Adds %p4 magic with p4 command completion and
827 automatic -G argument (marshall output as python dict)
832 automatic -G argument (marshall output as python dict)
828
833
829 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
834 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
830
835
831 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
836 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
832 stop marks.
837 stop marks.
833 (ClearingMixin): a simple mixin to easily make a Demo class clear
838 (ClearingMixin): a simple mixin to easily make a Demo class clear
834 the screen in between blocks and have empty marquees. The
839 the screen in between blocks and have empty marquees. The
835 ClearDemo and ClearIPDemo classes that use it are included.
840 ClearDemo and ClearIPDemo classes that use it are included.
836
841
837 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
842 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
838
843
839 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
844 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
840 protect against exceptions at Python shutdown time. Patch
845 protect against exceptions at Python shutdown time. Patch
841 sumbmitted to upstream.
846 sumbmitted to upstream.
842
847
843 2007-02-14 Walter Doerwald <walter@livinglogic.de>
848 2007-02-14 Walter Doerwald <walter@livinglogic.de>
844
849
845 * IPython/Extensions/ibrowse.py: If entering the first object level
850 * IPython/Extensions/ibrowse.py: If entering the first object level
846 (i.e. the object for which the browser has been started) fails,
851 (i.e. the object for which the browser has been started) fails,
847 now the error is raised directly (aborting the browser) instead of
852 now the error is raised directly (aborting the browser) instead of
848 running into an empty levels list later.
853 running into an empty levels list later.
849
854
850 2007-02-03 Walter Doerwald <walter@livinglogic.de>
855 2007-02-03 Walter Doerwald <walter@livinglogic.de>
851
856
852 * IPython/Extensions/ipipe.py: Add an xrepr implementation
857 * IPython/Extensions/ipipe.py: Add an xrepr implementation
853 for the noitem object.
858 for the noitem object.
854
859
855 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
860 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
856
861
857 * IPython/completer.py (Completer.attr_matches): Fix small
862 * IPython/completer.py (Completer.attr_matches): Fix small
858 tab-completion bug with Enthought Traits objects with units.
863 tab-completion bug with Enthought Traits objects with units.
859 Thanks to a bug report by Tom Denniston
864 Thanks to a bug report by Tom Denniston
860 <tom.denniston-AT-alum.dartmouth.org>.
865 <tom.denniston-AT-alum.dartmouth.org>.
861
866
862 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
867 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
863
868
864 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
869 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
865 bug where only .ipy or .py would be completed. Once the first
870 bug where only .ipy or .py would be completed. Once the first
866 argument to %run has been given, all completions are valid because
871 argument to %run has been given, all completions are valid because
867 they are the arguments to the script, which may well be non-python
872 they are the arguments to the script, which may well be non-python
868 filenames.
873 filenames.
869
874
870 * IPython/irunner.py (InteractiveRunner.run_source): major updates
875 * IPython/irunner.py (InteractiveRunner.run_source): major updates
871 to irunner to allow it to correctly support real doctesting of
876 to irunner to allow it to correctly support real doctesting of
872 out-of-process ipython code.
877 out-of-process ipython code.
873
878
874 * IPython/Magic.py (magic_cd): Make the setting of the terminal
879 * IPython/Magic.py (magic_cd): Make the setting of the terminal
875 title an option (-noterm_title) because it completely breaks
880 title an option (-noterm_title) because it completely breaks
876 doctesting.
881 doctesting.
877
882
878 * IPython/demo.py: fix IPythonDemo class that was not actually working.
883 * IPython/demo.py: fix IPythonDemo class that was not actually working.
879
884
880 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
885 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
881
886
882 * IPython/irunner.py (main): fix small bug where extensions were
887 * IPython/irunner.py (main): fix small bug where extensions were
883 not being correctly recognized.
888 not being correctly recognized.
884
889
885 2007-01-23 Walter Doerwald <walter@livinglogic.de>
890 2007-01-23 Walter Doerwald <walter@livinglogic.de>
886
891
887 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
892 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
888 a string containing a single line yields the string itself as the
893 a string containing a single line yields the string itself as the
889 only item.
894 only item.
890
895
891 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
896 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
892 object if it's the same as the one on the last level (This avoids
897 object if it's the same as the one on the last level (This avoids
893 infinite recursion for one line strings).
898 infinite recursion for one line strings).
894
899
895 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
900 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
896
901
897 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
902 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
898 all output streams before printing tracebacks. This ensures that
903 all output streams before printing tracebacks. This ensures that
899 user output doesn't end up interleaved with traceback output.
904 user output doesn't end up interleaved with traceback output.
900
905
901 2007-01-10 Ville Vainio <vivainio@gmail.com>
906 2007-01-10 Ville Vainio <vivainio@gmail.com>
902
907
903 * Extensions/envpersist.py: Turbocharged %env that remembers
908 * Extensions/envpersist.py: Turbocharged %env that remembers
904 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
909 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
905 "%env VISUAL=jed".
910 "%env VISUAL=jed".
906
911
907 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
912 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
908
913
909 * IPython/iplib.py (showtraceback): ensure that we correctly call
914 * IPython/iplib.py (showtraceback): ensure that we correctly call
910 custom handlers in all cases (some with pdb were slipping through,
915 custom handlers in all cases (some with pdb were slipping through,
911 but I'm not exactly sure why).
916 but I'm not exactly sure why).
912
917
913 * IPython/Debugger.py (Tracer.__init__): added new class to
918 * IPython/Debugger.py (Tracer.__init__): added new class to
914 support set_trace-like usage of IPython's enhanced debugger.
919 support set_trace-like usage of IPython's enhanced debugger.
915
920
916 2006-12-24 Ville Vainio <vivainio@gmail.com>
921 2006-12-24 Ville Vainio <vivainio@gmail.com>
917
922
918 * ipmaker.py: more informative message when ipy_user_conf
923 * ipmaker.py: more informative message when ipy_user_conf
919 import fails (suggest running %upgrade).
924 import fails (suggest running %upgrade).
920
925
921 * tools/run_ipy_in_profiler.py: Utility to see where
926 * tools/run_ipy_in_profiler.py: Utility to see where
922 the time during IPython startup is spent.
927 the time during IPython startup is spent.
923
928
924 2006-12-20 Ville Vainio <vivainio@gmail.com>
929 2006-12-20 Ville Vainio <vivainio@gmail.com>
925
930
926 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
931 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
927
932
928 * ipapi.py: Add new ipapi method, expand_alias.
933 * ipapi.py: Add new ipapi method, expand_alias.
929
934
930 * Release.py: Bump up version to 0.7.4.svn
935 * Release.py: Bump up version to 0.7.4.svn
931
936
932 2006-12-17 Ville Vainio <vivainio@gmail.com>
937 2006-12-17 Ville Vainio <vivainio@gmail.com>
933
938
934 * Extensions/jobctrl.py: Fixed &cmd arg arg...
939 * Extensions/jobctrl.py: Fixed &cmd arg arg...
935 to work properly on posix too
940 to work properly on posix too
936
941
937 * Release.py: Update revnum (version is still just 0.7.3).
942 * Release.py: Update revnum (version is still just 0.7.3).
938
943
939 2006-12-15 Ville Vainio <vivainio@gmail.com>
944 2006-12-15 Ville Vainio <vivainio@gmail.com>
940
945
941 * scripts/ipython_win_post_install: create ipython.py in
946 * scripts/ipython_win_post_install: create ipython.py in
942 prefix + "/scripts".
947 prefix + "/scripts".
943
948
944 * Release.py: Update version to 0.7.3.
949 * Release.py: Update version to 0.7.3.
945
950
946 2006-12-14 Ville Vainio <vivainio@gmail.com>
951 2006-12-14 Ville Vainio <vivainio@gmail.com>
947
952
948 * scripts/ipython_win_post_install: Overwrite old shortcuts
953 * scripts/ipython_win_post_install: Overwrite old shortcuts
949 if they already exist
954 if they already exist
950
955
951 * Release.py: release 0.7.3rc2
956 * Release.py: release 0.7.3rc2
952
957
953 2006-12-13 Ville Vainio <vivainio@gmail.com>
958 2006-12-13 Ville Vainio <vivainio@gmail.com>
954
959
955 * Branch and update Release.py for 0.7.3rc1
960 * Branch and update Release.py for 0.7.3rc1
956
961
957 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
962 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
958
963
959 * IPython/Shell.py (IPShellWX): update for current WX naming
964 * IPython/Shell.py (IPShellWX): update for current WX naming
960 conventions, to avoid a deprecation warning with current WX
965 conventions, to avoid a deprecation warning with current WX
961 versions. Thanks to a report by Danny Shevitz.
966 versions. Thanks to a report by Danny Shevitz.
962
967
963 2006-12-12 Ville Vainio <vivainio@gmail.com>
968 2006-12-12 Ville Vainio <vivainio@gmail.com>
964
969
965 * ipmaker.py: apply david cournapeau's patch to make
970 * ipmaker.py: apply david cournapeau's patch to make
966 import_some work properly even when ipythonrc does
971 import_some work properly even when ipythonrc does
967 import_some on empty list (it was an old bug!).
972 import_some on empty list (it was an old bug!).
968
973
969 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
974 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
970 Add deprecation note to ipythonrc and a url to wiki
975 Add deprecation note to ipythonrc and a url to wiki
971 in ipy_user_conf.py
976 in ipy_user_conf.py
972
977
973
978
974 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
979 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
975 as if it was typed on IPython command prompt, i.e.
980 as if it was typed on IPython command prompt, i.e.
976 as IPython script.
981 as IPython script.
977
982
978 * example-magic.py, magic_grepl.py: remove outdated examples
983 * example-magic.py, magic_grepl.py: remove outdated examples
979
984
980 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
985 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
981
986
982 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
987 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
983 is called before any exception has occurred.
988 is called before any exception has occurred.
984
989
985 2006-12-08 Ville Vainio <vivainio@gmail.com>
990 2006-12-08 Ville Vainio <vivainio@gmail.com>
986
991
987 * Extensions/ipy_stock_completers.py: fix cd completer
992 * Extensions/ipy_stock_completers.py: fix cd completer
988 to translate /'s to \'s again.
993 to translate /'s to \'s again.
989
994
990 * completer.py: prevent traceback on file completions w/
995 * completer.py: prevent traceback on file completions w/
991 backslash.
996 backslash.
992
997
993 * Release.py: Update release number to 0.7.3b3 for release
998 * Release.py: Update release number to 0.7.3b3 for release
994
999
995 2006-12-07 Ville Vainio <vivainio@gmail.com>
1000 2006-12-07 Ville Vainio <vivainio@gmail.com>
996
1001
997 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1002 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
998 while executing external code. Provides more shell-like behaviour
1003 while executing external code. Provides more shell-like behaviour
999 and overall better response to ctrl + C / ctrl + break.
1004 and overall better response to ctrl + C / ctrl + break.
1000
1005
1001 * tools/make_tarball.py: new script to create tarball straight from svn
1006 * tools/make_tarball.py: new script to create tarball straight from svn
1002 (setup.py sdist doesn't work on win32).
1007 (setup.py sdist doesn't work on win32).
1003
1008
1004 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1009 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1005 on dirnames with spaces and use the default completer instead.
1010 on dirnames with spaces and use the default completer instead.
1006
1011
1007 * Revision.py: Change version to 0.7.3b2 for release.
1012 * Revision.py: Change version to 0.7.3b2 for release.
1008
1013
1009 2006-12-05 Ville Vainio <vivainio@gmail.com>
1014 2006-12-05 Ville Vainio <vivainio@gmail.com>
1010
1015
1011 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1016 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1012 pydb patch 4 (rm debug printing, py 2.5 checking)
1017 pydb patch 4 (rm debug printing, py 2.5 checking)
1013
1018
1014 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1019 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1015 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1020 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1016 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1021 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1017 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1022 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1018 object the cursor was on before the refresh. The command "markrange" is
1023 object the cursor was on before the refresh. The command "markrange" is
1019 mapped to "%" now.
1024 mapped to "%" now.
1020 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1025 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1021
1026
1022 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1027 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1023
1028
1024 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1029 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1025 interactive debugger on the last traceback, without having to call
1030 interactive debugger on the last traceback, without having to call
1026 %pdb and rerun your code. Made minor changes in various modules,
1031 %pdb and rerun your code. Made minor changes in various modules,
1027 should automatically recognize pydb if available.
1032 should automatically recognize pydb if available.
1028
1033
1029 2006-11-28 Ville Vainio <vivainio@gmail.com>
1034 2006-11-28 Ville Vainio <vivainio@gmail.com>
1030
1035
1031 * completer.py: If the text start with !, show file completions
1036 * completer.py: If the text start with !, show file completions
1032 properly. This helps when trying to complete command name
1037 properly. This helps when trying to complete command name
1033 for shell escapes.
1038 for shell escapes.
1034
1039
1035 2006-11-27 Ville Vainio <vivainio@gmail.com>
1040 2006-11-27 Ville Vainio <vivainio@gmail.com>
1036
1041
1037 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1042 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1038 der Walt. Clean up svn and hg completers by using a common
1043 der Walt. Clean up svn and hg completers by using a common
1039 vcs_completer.
1044 vcs_completer.
1040
1045
1041 2006-11-26 Ville Vainio <vivainio@gmail.com>
1046 2006-11-26 Ville Vainio <vivainio@gmail.com>
1042
1047
1043 * Remove ipconfig and %config; you should use _ip.options structure
1048 * Remove ipconfig and %config; you should use _ip.options structure
1044 directly instead!
1049 directly instead!
1045
1050
1046 * genutils.py: add wrap_deprecated function for deprecating callables
1051 * genutils.py: add wrap_deprecated function for deprecating callables
1047
1052
1048 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1053 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1049 _ip.system instead. ipalias is redundant.
1054 _ip.system instead. ipalias is redundant.
1050
1055
1051 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1056 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1052 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1057 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1053 explicit.
1058 explicit.
1054
1059
1055 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1060 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1056 completer. Try it by entering 'hg ' and pressing tab.
1061 completer. Try it by entering 'hg ' and pressing tab.
1057
1062
1058 * macro.py: Give Macro a useful __repr__ method
1063 * macro.py: Give Macro a useful __repr__ method
1059
1064
1060 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1065 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1061
1066
1062 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1067 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1063 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1068 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1064 we don't get a duplicate ipipe module, where registration of the xrepr
1069 we don't get a duplicate ipipe module, where registration of the xrepr
1065 implementation for Text is useless.
1070 implementation for Text is useless.
1066
1071
1067 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1072 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1068
1073
1069 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1074 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1070
1075
1071 2006-11-24 Ville Vainio <vivainio@gmail.com>
1076 2006-11-24 Ville Vainio <vivainio@gmail.com>
1072
1077
1073 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1078 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1074 try to use "cProfile" instead of the slower pure python
1079 try to use "cProfile" instead of the slower pure python
1075 "profile"
1080 "profile"
1076
1081
1077 2006-11-23 Ville Vainio <vivainio@gmail.com>
1082 2006-11-23 Ville Vainio <vivainio@gmail.com>
1078
1083
1079 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1084 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1080 Qt+IPython+Designer link in documentation.
1085 Qt+IPython+Designer link in documentation.
1081
1086
1082 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1087 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1083 correct Pdb object to %pydb.
1088 correct Pdb object to %pydb.
1084
1089
1085
1090
1086 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1091 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1087 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1092 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1088 generic xrepr(), otherwise the list implementation would kick in.
1093 generic xrepr(), otherwise the list implementation would kick in.
1089
1094
1090 2006-11-21 Ville Vainio <vivainio@gmail.com>
1095 2006-11-21 Ville Vainio <vivainio@gmail.com>
1091
1096
1092 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1097 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1093 with one from UserConfig.
1098 with one from UserConfig.
1094
1099
1095 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1100 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1096 it was missing which broke the sh profile.
1101 it was missing which broke the sh profile.
1097
1102
1098 * completer.py: file completer now uses explicit '/' instead
1103 * completer.py: file completer now uses explicit '/' instead
1099 of os.path.join, expansion of 'foo' was broken on win32
1104 of os.path.join, expansion of 'foo' was broken on win32
1100 if there was one directory with name 'foobar'.
1105 if there was one directory with name 'foobar'.
1101
1106
1102 * A bunch of patches from Kirill Smelkov:
1107 * A bunch of patches from Kirill Smelkov:
1103
1108
1104 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1109 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1105
1110
1106 * [patch 7/9] Implement %page -r (page in raw mode) -
1111 * [patch 7/9] Implement %page -r (page in raw mode) -
1107
1112
1108 * [patch 5/9] ScientificPython webpage has moved
1113 * [patch 5/9] ScientificPython webpage has moved
1109
1114
1110 * [patch 4/9] The manual mentions %ds, should be %dhist
1115 * [patch 4/9] The manual mentions %ds, should be %dhist
1111
1116
1112 * [patch 3/9] Kill old bits from %prun doc.
1117 * [patch 3/9] Kill old bits from %prun doc.
1113
1118
1114 * [patch 1/9] Fix typos here and there.
1119 * [patch 1/9] Fix typos here and there.
1115
1120
1116 2006-11-08 Ville Vainio <vivainio@gmail.com>
1121 2006-11-08 Ville Vainio <vivainio@gmail.com>
1117
1122
1118 * completer.py (attr_matches): catch all exceptions raised
1123 * completer.py (attr_matches): catch all exceptions raised
1119 by eval of expr with dots.
1124 by eval of expr with dots.
1120
1125
1121 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1126 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1122
1127
1123 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1128 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1124 input if it starts with whitespace. This allows you to paste
1129 input if it starts with whitespace. This allows you to paste
1125 indented input from any editor without manually having to type in
1130 indented input from any editor without manually having to type in
1126 the 'if 1:', which is convenient when working interactively.
1131 the 'if 1:', which is convenient when working interactively.
1127 Slightly modifed version of a patch by Bo Peng
1132 Slightly modifed version of a patch by Bo Peng
1128 <bpeng-AT-rice.edu>.
1133 <bpeng-AT-rice.edu>.
1129
1134
1130 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1135 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1131
1136
1132 * IPython/irunner.py (main): modified irunner so it automatically
1137 * IPython/irunner.py (main): modified irunner so it automatically
1133 recognizes the right runner to use based on the extension (.py for
1138 recognizes the right runner to use based on the extension (.py for
1134 python, .ipy for ipython and .sage for sage).
1139 python, .ipy for ipython and .sage for sage).
1135
1140
1136 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1141 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1137 visible in ipapi as ip.config(), to programatically control the
1142 visible in ipapi as ip.config(), to programatically control the
1138 internal rc object. There's an accompanying %config magic for
1143 internal rc object. There's an accompanying %config magic for
1139 interactive use, which has been enhanced to match the
1144 interactive use, which has been enhanced to match the
1140 funtionality in ipconfig.
1145 funtionality in ipconfig.
1141
1146
1142 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1147 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1143 so it's not just a toggle, it now takes an argument. Add support
1148 so it's not just a toggle, it now takes an argument. Add support
1144 for a customizable header when making system calls, as the new
1149 for a customizable header when making system calls, as the new
1145 system_header variable in the ipythonrc file.
1150 system_header variable in the ipythonrc file.
1146
1151
1147 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1152 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1148
1153
1149 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1154 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1150 generic functions (using Philip J. Eby's simplegeneric package).
1155 generic functions (using Philip J. Eby's simplegeneric package).
1151 This makes it possible to customize the display of third-party classes
1156 This makes it possible to customize the display of third-party classes
1152 without having to monkeypatch them. xiter() no longer supports a mode
1157 without having to monkeypatch them. xiter() no longer supports a mode
1153 argument and the XMode class has been removed. The same functionality can
1158 argument and the XMode class has been removed. The same functionality can
1154 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1159 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1155 One consequence of the switch to generic functions is that xrepr() and
1160 One consequence of the switch to generic functions is that xrepr() and
1156 xattrs() implementation must define the default value for the mode
1161 xattrs() implementation must define the default value for the mode
1157 argument themselves and xattrs() implementations must return real
1162 argument themselves and xattrs() implementations must return real
1158 descriptors.
1163 descriptors.
1159
1164
1160 * IPython/external: This new subpackage will contain all third-party
1165 * IPython/external: This new subpackage will contain all third-party
1161 packages that are bundled with IPython. (The first one is simplegeneric).
1166 packages that are bundled with IPython. (The first one is simplegeneric).
1162
1167
1163 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1168 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1164 directory which as been dropped in r1703.
1169 directory which as been dropped in r1703.
1165
1170
1166 * IPython/Extensions/ipipe.py (iless): Fixed.
1171 * IPython/Extensions/ipipe.py (iless): Fixed.
1167
1172
1168 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1173 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1169
1174
1170 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1175 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1171
1176
1172 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1177 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1173 handling in variable expansion so that shells and magics recognize
1178 handling in variable expansion so that shells and magics recognize
1174 function local scopes correctly. Bug reported by Brian.
1179 function local scopes correctly. Bug reported by Brian.
1175
1180
1176 * scripts/ipython: remove the very first entry in sys.path which
1181 * scripts/ipython: remove the very first entry in sys.path which
1177 Python auto-inserts for scripts, so that sys.path under IPython is
1182 Python auto-inserts for scripts, so that sys.path under IPython is
1178 as similar as possible to that under plain Python.
1183 as similar as possible to that under plain Python.
1179
1184
1180 * IPython/completer.py (IPCompleter.file_matches): Fix
1185 * IPython/completer.py (IPCompleter.file_matches): Fix
1181 tab-completion so that quotes are not closed unless the completion
1186 tab-completion so that quotes are not closed unless the completion
1182 is unambiguous. After a request by Stefan. Minor cleanups in
1187 is unambiguous. After a request by Stefan. Minor cleanups in
1183 ipy_stock_completers.
1188 ipy_stock_completers.
1184
1189
1185 2006-11-02 Ville Vainio <vivainio@gmail.com>
1190 2006-11-02 Ville Vainio <vivainio@gmail.com>
1186
1191
1187 * ipy_stock_completers.py: Add %run and %cd completers.
1192 * ipy_stock_completers.py: Add %run and %cd completers.
1188
1193
1189 * completer.py: Try running custom completer for both
1194 * completer.py: Try running custom completer for both
1190 "foo" and "%foo" if the command is just "foo". Ignore case
1195 "foo" and "%foo" if the command is just "foo". Ignore case
1191 when filtering possible completions.
1196 when filtering possible completions.
1192
1197
1193 * UserConfig/ipy_user_conf.py: install stock completers as default
1198 * UserConfig/ipy_user_conf.py: install stock completers as default
1194
1199
1195 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1200 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1196 simplified readline history save / restore through a wrapper
1201 simplified readline history save / restore through a wrapper
1197 function
1202 function
1198
1203
1199
1204
1200 2006-10-31 Ville Vainio <vivainio@gmail.com>
1205 2006-10-31 Ville Vainio <vivainio@gmail.com>
1201
1206
1202 * strdispatch.py, completer.py, ipy_stock_completers.py:
1207 * strdispatch.py, completer.py, ipy_stock_completers.py:
1203 Allow str_key ("command") in completer hooks. Implement
1208 Allow str_key ("command") in completer hooks. Implement
1204 trivial completer for 'import' (stdlib modules only). Rename
1209 trivial completer for 'import' (stdlib modules only). Rename
1205 ipy_linux_package_managers.py to ipy_stock_completers.py.
1210 ipy_linux_package_managers.py to ipy_stock_completers.py.
1206 SVN completer.
1211 SVN completer.
1207
1212
1208 * Extensions/ledit.py: %magic line editor for easily and
1213 * Extensions/ledit.py: %magic line editor for easily and
1209 incrementally manipulating lists of strings. The magic command
1214 incrementally manipulating lists of strings. The magic command
1210 name is %led.
1215 name is %led.
1211
1216
1212 2006-10-30 Ville Vainio <vivainio@gmail.com>
1217 2006-10-30 Ville Vainio <vivainio@gmail.com>
1213
1218
1214 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1219 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1215 Bernsteins's patches for pydb integration.
1220 Bernsteins's patches for pydb integration.
1216 http://bashdb.sourceforge.net/pydb/
1221 http://bashdb.sourceforge.net/pydb/
1217
1222
1218 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1223 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1219 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1224 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1220 custom completer hook to allow the users to implement their own
1225 custom completer hook to allow the users to implement their own
1221 completers. See ipy_linux_package_managers.py for example. The
1226 completers. See ipy_linux_package_managers.py for example. The
1222 hook name is 'complete_command'.
1227 hook name is 'complete_command'.
1223
1228
1224 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1229 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1225
1230
1226 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1231 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1227 Numeric leftovers.
1232 Numeric leftovers.
1228
1233
1229 * ipython.el (py-execute-region): apply Stefan's patch to fix
1234 * ipython.el (py-execute-region): apply Stefan's patch to fix
1230 garbled results if the python shell hasn't been previously started.
1235 garbled results if the python shell hasn't been previously started.
1231
1236
1232 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1237 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1233 pretty generic function and useful for other things.
1238 pretty generic function and useful for other things.
1234
1239
1235 * IPython/OInspect.py (getsource): Add customizable source
1240 * IPython/OInspect.py (getsource): Add customizable source
1236 extractor. After a request/patch form W. Stein (SAGE).
1241 extractor. After a request/patch form W. Stein (SAGE).
1237
1242
1238 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1243 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1239 window size to a more reasonable value from what pexpect does,
1244 window size to a more reasonable value from what pexpect does,
1240 since their choice causes wrapping bugs with long input lines.
1245 since their choice causes wrapping bugs with long input lines.
1241
1246
1242 2006-10-28 Ville Vainio <vivainio@gmail.com>
1247 2006-10-28 Ville Vainio <vivainio@gmail.com>
1243
1248
1244 * Magic.py (%run): Save and restore the readline history from
1249 * Magic.py (%run): Save and restore the readline history from
1245 file around %run commands to prevent side effects from
1250 file around %run commands to prevent side effects from
1246 %runned programs that might use readline (e.g. pydb).
1251 %runned programs that might use readline (e.g. pydb).
1247
1252
1248 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1253 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1249 invoking the pydb enhanced debugger.
1254 invoking the pydb enhanced debugger.
1250
1255
1251 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1256 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1252
1257
1253 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1258 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1254 call the base class method and propagate the return value to
1259 call the base class method and propagate the return value to
1255 ifile. This is now done by path itself.
1260 ifile. This is now done by path itself.
1256
1261
1257 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1262 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1258
1263
1259 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1264 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1260 api: set_crash_handler(), to expose the ability to change the
1265 api: set_crash_handler(), to expose the ability to change the
1261 internal crash handler.
1266 internal crash handler.
1262
1267
1263 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1268 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1264 the various parameters of the crash handler so that apps using
1269 the various parameters of the crash handler so that apps using
1265 IPython as their engine can customize crash handling. Ipmlemented
1270 IPython as their engine can customize crash handling. Ipmlemented
1266 at the request of SAGE.
1271 at the request of SAGE.
1267
1272
1268 2006-10-14 Ville Vainio <vivainio@gmail.com>
1273 2006-10-14 Ville Vainio <vivainio@gmail.com>
1269
1274
1270 * Magic.py, ipython.el: applied first "safe" part of Rocky
1275 * Magic.py, ipython.el: applied first "safe" part of Rocky
1271 Bernstein's patch set for pydb integration.
1276 Bernstein's patch set for pydb integration.
1272
1277
1273 * Magic.py (%unalias, %alias): %store'd aliases can now be
1278 * Magic.py (%unalias, %alias): %store'd aliases can now be
1274 removed with '%unalias'. %alias w/o args now shows most
1279 removed with '%unalias'. %alias w/o args now shows most
1275 interesting (stored / manually defined) aliases last
1280 interesting (stored / manually defined) aliases last
1276 where they catch the eye w/o scrolling.
1281 where they catch the eye w/o scrolling.
1277
1282
1278 * Magic.py (%rehashx), ext_rehashdir.py: files with
1283 * Magic.py (%rehashx), ext_rehashdir.py: files with
1279 'py' extension are always considered executable, even
1284 'py' extension are always considered executable, even
1280 when not in PATHEXT environment variable.
1285 when not in PATHEXT environment variable.
1281
1286
1282 2006-10-12 Ville Vainio <vivainio@gmail.com>
1287 2006-10-12 Ville Vainio <vivainio@gmail.com>
1283
1288
1284 * jobctrl.py: Add new "jobctrl" extension for spawning background
1289 * jobctrl.py: Add new "jobctrl" extension for spawning background
1285 processes with "&find /". 'import jobctrl' to try it out. Requires
1290 processes with "&find /". 'import jobctrl' to try it out. Requires
1286 'subprocess' module, standard in python 2.4+.
1291 'subprocess' module, standard in python 2.4+.
1287
1292
1288 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1293 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1289 so if foo -> bar and bar -> baz, then foo -> baz.
1294 so if foo -> bar and bar -> baz, then foo -> baz.
1290
1295
1291 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1296 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1292
1297
1293 * IPython/Magic.py (Magic.parse_options): add a new posix option
1298 * IPython/Magic.py (Magic.parse_options): add a new posix option
1294 to allow parsing of input args in magics that doesn't strip quotes
1299 to allow parsing of input args in magics that doesn't strip quotes
1295 (if posix=False). This also closes %timeit bug reported by
1300 (if posix=False). This also closes %timeit bug reported by
1296 Stefan.
1301 Stefan.
1297
1302
1298 2006-10-03 Ville Vainio <vivainio@gmail.com>
1303 2006-10-03 Ville Vainio <vivainio@gmail.com>
1299
1304
1300 * iplib.py (raw_input, interact): Return ValueError catching for
1305 * iplib.py (raw_input, interact): Return ValueError catching for
1301 raw_input. Fixes infinite loop for sys.stdin.close() or
1306 raw_input. Fixes infinite loop for sys.stdin.close() or
1302 sys.stdout.close().
1307 sys.stdout.close().
1303
1308
1304 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1309 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1305
1310
1306 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1311 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1307 to help in handling doctests. irunner is now pretty useful for
1312 to help in handling doctests. irunner is now pretty useful for
1308 running standalone scripts and simulate a full interactive session
1313 running standalone scripts and simulate a full interactive session
1309 in a format that can be then pasted as a doctest.
1314 in a format that can be then pasted as a doctest.
1310
1315
1311 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1316 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1312 on top of the default (useless) ones. This also fixes the nasty
1317 on top of the default (useless) ones. This also fixes the nasty
1313 way in which 2.5's Quitter() exits (reverted [1785]).
1318 way in which 2.5's Quitter() exits (reverted [1785]).
1314
1319
1315 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1320 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1316 2.5.
1321 2.5.
1317
1322
1318 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1323 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1319 color scheme is updated as well when color scheme is changed
1324 color scheme is updated as well when color scheme is changed
1320 interactively.
1325 interactively.
1321
1326
1322 2006-09-27 Ville Vainio <vivainio@gmail.com>
1327 2006-09-27 Ville Vainio <vivainio@gmail.com>
1323
1328
1324 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1329 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1325 infinite loop and just exit. It's a hack, but will do for a while.
1330 infinite loop and just exit. It's a hack, but will do for a while.
1326
1331
1327 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1332 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1328
1333
1329 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1334 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1330 the constructor, this makes it possible to get a list of only directories
1335 the constructor, this makes it possible to get a list of only directories
1331 or only files.
1336 or only files.
1332
1337
1333 2006-08-12 Ville Vainio <vivainio@gmail.com>
1338 2006-08-12 Ville Vainio <vivainio@gmail.com>
1334
1339
1335 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1340 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1336 they broke unittest
1341 they broke unittest
1337
1342
1338 2006-08-11 Ville Vainio <vivainio@gmail.com>
1343 2006-08-11 Ville Vainio <vivainio@gmail.com>
1339
1344
1340 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1345 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1341 by resolving issue properly, i.e. by inheriting FakeModule
1346 by resolving issue properly, i.e. by inheriting FakeModule
1342 from types.ModuleType. Pickling ipython interactive data
1347 from types.ModuleType. Pickling ipython interactive data
1343 should still work as usual (testing appreciated).
1348 should still work as usual (testing appreciated).
1344
1349
1345 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1350 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1346
1351
1347 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1352 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1348 running under python 2.3 with code from 2.4 to fix a bug with
1353 running under python 2.3 with code from 2.4 to fix a bug with
1349 help(). Reported by the Debian maintainers, Norbert Tretkowski
1354 help(). Reported by the Debian maintainers, Norbert Tretkowski
1350 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1355 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1351 <afayolle-AT-debian.org>.
1356 <afayolle-AT-debian.org>.
1352
1357
1353 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1358 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1354
1359
1355 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1360 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1356 (which was displaying "quit" twice).
1361 (which was displaying "quit" twice).
1357
1362
1358 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1363 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1359
1364
1360 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1365 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1361 the mode argument).
1366 the mode argument).
1362
1367
1363 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1368 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1364
1369
1365 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1370 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1366 not running under IPython.
1371 not running under IPython.
1367
1372
1368 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1373 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1369 and make it iterable (iterating over the attribute itself). Add two new
1374 and make it iterable (iterating over the attribute itself). Add two new
1370 magic strings for __xattrs__(): If the string starts with "-", the attribute
1375 magic strings for __xattrs__(): If the string starts with "-", the attribute
1371 will not be displayed in ibrowse's detail view (but it can still be
1376 will not be displayed in ibrowse's detail view (but it can still be
1372 iterated over). This makes it possible to add attributes that are large
1377 iterated over). This makes it possible to add attributes that are large
1373 lists or generator methods to the detail view. Replace magic attribute names
1378 lists or generator methods to the detail view. Replace magic attribute names
1374 and _attrname() and _getattr() with "descriptors": For each type of magic
1379 and _attrname() and _getattr() with "descriptors": For each type of magic
1375 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1380 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1376 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1381 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1377 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1382 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1378 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1383 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1379 are still supported.
1384 are still supported.
1380
1385
1381 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1386 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1382 fails in ibrowse.fetch(), the exception object is added as the last item
1387 fails in ibrowse.fetch(), the exception object is added as the last item
1383 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1388 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1384 a generator throws an exception midway through execution.
1389 a generator throws an exception midway through execution.
1385
1390
1386 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1391 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1387 encoding into methods.
1392 encoding into methods.
1388
1393
1389 2006-07-26 Ville Vainio <vivainio@gmail.com>
1394 2006-07-26 Ville Vainio <vivainio@gmail.com>
1390
1395
1391 * iplib.py: history now stores multiline input as single
1396 * iplib.py: history now stores multiline input as single
1392 history entries. Patch by Jorgen Cederlof.
1397 history entries. Patch by Jorgen Cederlof.
1393
1398
1394 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1399 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1395
1400
1396 * IPython/Extensions/ibrowse.py: Make cursor visible over
1401 * IPython/Extensions/ibrowse.py: Make cursor visible over
1397 non existing attributes.
1402 non existing attributes.
1398
1403
1399 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1404 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1400
1405
1401 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1406 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1402 error output of the running command doesn't mess up the screen.
1407 error output of the running command doesn't mess up the screen.
1403
1408
1404 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1409 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1405
1410
1406 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1411 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1407 argument. This sorts the items themselves.
1412 argument. This sorts the items themselves.
1408
1413
1409 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1414 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1410
1415
1411 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1416 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1412 Compile expression strings into code objects. This should speed
1417 Compile expression strings into code objects. This should speed
1413 up ifilter and friends somewhat.
1418 up ifilter and friends somewhat.
1414
1419
1415 2006-07-08 Ville Vainio <vivainio@gmail.com>
1420 2006-07-08 Ville Vainio <vivainio@gmail.com>
1416
1421
1417 * Magic.py: %cpaste now strips > from the beginning of lines
1422 * Magic.py: %cpaste now strips > from the beginning of lines
1418 to ease pasting quoted code from emails. Contributed by
1423 to ease pasting quoted code from emails. Contributed by
1419 Stefan van der Walt.
1424 Stefan van der Walt.
1420
1425
1421 2006-06-29 Ville Vainio <vivainio@gmail.com>
1426 2006-06-29 Ville Vainio <vivainio@gmail.com>
1422
1427
1423 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1428 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1424 mode, patch contributed by Darren Dale. NEEDS TESTING!
1429 mode, patch contributed by Darren Dale. NEEDS TESTING!
1425
1430
1426 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1431 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1427
1432
1428 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1433 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1429 a blue background. Fix fetching new display rows when the browser
1434 a blue background. Fix fetching new display rows when the browser
1430 scrolls more than a screenful (e.g. by using the goto command).
1435 scrolls more than a screenful (e.g. by using the goto command).
1431
1436
1432 2006-06-27 Ville Vainio <vivainio@gmail.com>
1437 2006-06-27 Ville Vainio <vivainio@gmail.com>
1433
1438
1434 * Magic.py (_inspect, _ofind) Apply David Huard's
1439 * Magic.py (_inspect, _ofind) Apply David Huard's
1435 patch for displaying the correct docstring for 'property'
1440 patch for displaying the correct docstring for 'property'
1436 attributes.
1441 attributes.
1437
1442
1438 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1443 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1439
1444
1440 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1445 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1441 commands into the methods implementing them.
1446 commands into the methods implementing them.
1442
1447
1443 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1448 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1444
1449
1445 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1450 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1446 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1451 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1447 autoindent support was authored by Jin Liu.
1452 autoindent support was authored by Jin Liu.
1448
1453
1449 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1454 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1450
1455
1451 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1456 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1452 for keymaps with a custom class that simplifies handling.
1457 for keymaps with a custom class that simplifies handling.
1453
1458
1454 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1459 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1455
1460
1456 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1461 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1457 resizing. This requires Python 2.5 to work.
1462 resizing. This requires Python 2.5 to work.
1458
1463
1459 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1464 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1460
1465
1461 * IPython/Extensions/ibrowse.py: Add two new commands to
1466 * IPython/Extensions/ibrowse.py: Add two new commands to
1462 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1467 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1463 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1468 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1464 attributes again. Remapped the help command to "?". Display
1469 attributes again. Remapped the help command to "?". Display
1465 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1470 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1466 as keys for the "home" and "end" commands. Add three new commands
1471 as keys for the "home" and "end" commands. Add three new commands
1467 to the input mode for "find" and friends: "delend" (CTRL-K)
1472 to the input mode for "find" and friends: "delend" (CTRL-K)
1468 deletes to the end of line. "incsearchup" searches upwards in the
1473 deletes to the end of line. "incsearchup" searches upwards in the
1469 command history for an input that starts with the text before the cursor.
1474 command history for an input that starts with the text before the cursor.
1470 "incsearchdown" does the same downwards. Removed a bogus mapping of
1475 "incsearchdown" does the same downwards. Removed a bogus mapping of
1471 the x key to "delete".
1476 the x key to "delete".
1472
1477
1473 2006-06-15 Ville Vainio <vivainio@gmail.com>
1478 2006-06-15 Ville Vainio <vivainio@gmail.com>
1474
1479
1475 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1480 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1476 used to create prompts dynamically, instead of the "old" way of
1481 used to create prompts dynamically, instead of the "old" way of
1477 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1482 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1478 way still works (it's invoked by the default hook), of course.
1483 way still works (it's invoked by the default hook), of course.
1479
1484
1480 * Prompts.py: added generate_output_prompt hook for altering output
1485 * Prompts.py: added generate_output_prompt hook for altering output
1481 prompt
1486 prompt
1482
1487
1483 * Release.py: Changed version string to 0.7.3.svn.
1488 * Release.py: Changed version string to 0.7.3.svn.
1484
1489
1485 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1490 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1486
1491
1487 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1492 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1488 the call to fetch() always tries to fetch enough data for at least one
1493 the call to fetch() always tries to fetch enough data for at least one
1489 full screen. This makes it possible to simply call moveto(0,0,True) in
1494 full screen. This makes it possible to simply call moveto(0,0,True) in
1490 the constructor. Fix typos and removed the obsolete goto attribute.
1495 the constructor. Fix typos and removed the obsolete goto attribute.
1491
1496
1492 2006-06-12 Ville Vainio <vivainio@gmail.com>
1497 2006-06-12 Ville Vainio <vivainio@gmail.com>
1493
1498
1494 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1499 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1495 allowing $variable interpolation within multiline statements,
1500 allowing $variable interpolation within multiline statements,
1496 though so far only with "sh" profile for a testing period.
1501 though so far only with "sh" profile for a testing period.
1497 The patch also enables splitting long commands with \ but it
1502 The patch also enables splitting long commands with \ but it
1498 doesn't work properly yet.
1503 doesn't work properly yet.
1499
1504
1500 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1505 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1501
1506
1502 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1507 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1503 input history and the position of the cursor in the input history for
1508 input history and the position of the cursor in the input history for
1504 the find, findbackwards and goto command.
1509 the find, findbackwards and goto command.
1505
1510
1506 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1511 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1507
1512
1508 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1513 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1509 implements the basic functionality of browser commands that require
1514 implements the basic functionality of browser commands that require
1510 input. Reimplement the goto, find and findbackwards commands as
1515 input. Reimplement the goto, find and findbackwards commands as
1511 subclasses of _CommandInput. Add an input history and keymaps to those
1516 subclasses of _CommandInput. Add an input history and keymaps to those
1512 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1517 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1513 execute commands.
1518 execute commands.
1514
1519
1515 2006-06-07 Ville Vainio <vivainio@gmail.com>
1520 2006-06-07 Ville Vainio <vivainio@gmail.com>
1516
1521
1517 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1522 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1518 running the batch files instead of leaving the session open.
1523 running the batch files instead of leaving the session open.
1519
1524
1520 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1525 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1521
1526
1522 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1527 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1523 the original fix was incomplete. Patch submitted by W. Maier.
1528 the original fix was incomplete. Patch submitted by W. Maier.
1524
1529
1525 2006-06-07 Ville Vainio <vivainio@gmail.com>
1530 2006-06-07 Ville Vainio <vivainio@gmail.com>
1526
1531
1527 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1532 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1528 Confirmation prompts can be supressed by 'quiet' option.
1533 Confirmation prompts can be supressed by 'quiet' option.
1529 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1534 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1530
1535
1531 2006-06-06 *** Released version 0.7.2
1536 2006-06-06 *** Released version 0.7.2
1532
1537
1533 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1538 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1534
1539
1535 * IPython/Release.py (version): Made 0.7.2 final for release.
1540 * IPython/Release.py (version): Made 0.7.2 final for release.
1536 Repo tagged and release cut.
1541 Repo tagged and release cut.
1537
1542
1538 2006-06-05 Ville Vainio <vivainio@gmail.com>
1543 2006-06-05 Ville Vainio <vivainio@gmail.com>
1539
1544
1540 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1545 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1541 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1546 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1542
1547
1543 * upgrade_dir.py: try import 'path' module a bit harder
1548 * upgrade_dir.py: try import 'path' module a bit harder
1544 (for %upgrade)
1549 (for %upgrade)
1545
1550
1546 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1551 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1547
1552
1548 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1553 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1549 instead of looping 20 times.
1554 instead of looping 20 times.
1550
1555
1551 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1556 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1552 correctly at initialization time. Bug reported by Krishna Mohan
1557 correctly at initialization time. Bug reported by Krishna Mohan
1553 Gundu <gkmohan-AT-gmail.com> on the user list.
1558 Gundu <gkmohan-AT-gmail.com> on the user list.
1554
1559
1555 * IPython/Release.py (version): Mark 0.7.2 version to start
1560 * IPython/Release.py (version): Mark 0.7.2 version to start
1556 testing for release on 06/06.
1561 testing for release on 06/06.
1557
1562
1558 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1563 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1559
1564
1560 * scripts/irunner: thin script interface so users don't have to
1565 * scripts/irunner: thin script interface so users don't have to
1561 find the module and call it as an executable, since modules rarely
1566 find the module and call it as an executable, since modules rarely
1562 live in people's PATH.
1567 live in people's PATH.
1563
1568
1564 * IPython/irunner.py (InteractiveRunner.__init__): added
1569 * IPython/irunner.py (InteractiveRunner.__init__): added
1565 delaybeforesend attribute to control delays with newer versions of
1570 delaybeforesend attribute to control delays with newer versions of
1566 pexpect. Thanks to detailed help from pexpect's author, Noah
1571 pexpect. Thanks to detailed help from pexpect's author, Noah
1567 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1572 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1568 correctly (it works in NoColor mode).
1573 correctly (it works in NoColor mode).
1569
1574
1570 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1575 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1571 SAGE list, from improper log() calls.
1576 SAGE list, from improper log() calls.
1572
1577
1573 2006-05-31 Ville Vainio <vivainio@gmail.com>
1578 2006-05-31 Ville Vainio <vivainio@gmail.com>
1574
1579
1575 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1580 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1576 with args in parens to work correctly with dirs that have spaces.
1581 with args in parens to work correctly with dirs that have spaces.
1577
1582
1578 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1583 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1579
1584
1580 * IPython/Logger.py (Logger.logstart): add option to log raw input
1585 * IPython/Logger.py (Logger.logstart): add option to log raw input
1581 instead of the processed one. A -r flag was added to the
1586 instead of the processed one. A -r flag was added to the
1582 %logstart magic used for controlling logging.
1587 %logstart magic used for controlling logging.
1583
1588
1584 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1589 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1585
1590
1586 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1591 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1587 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1592 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1588 recognize the option. After a bug report by Will Maier. This
1593 recognize the option. After a bug report by Will Maier. This
1589 closes #64 (will do it after confirmation from W. Maier).
1594 closes #64 (will do it after confirmation from W. Maier).
1590
1595
1591 * IPython/irunner.py: New module to run scripts as if manually
1596 * IPython/irunner.py: New module to run scripts as if manually
1592 typed into an interactive environment, based on pexpect. After a
1597 typed into an interactive environment, based on pexpect. After a
1593 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1598 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1594 ipython-user list. Simple unittests in the tests/ directory.
1599 ipython-user list. Simple unittests in the tests/ directory.
1595
1600
1596 * tools/release: add Will Maier, OpenBSD port maintainer, to
1601 * tools/release: add Will Maier, OpenBSD port maintainer, to
1597 recepients list. We are now officially part of the OpenBSD ports:
1602 recepients list. We are now officially part of the OpenBSD ports:
1598 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1603 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1599 work.
1604 work.
1600
1605
1601 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1606 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1602
1607
1603 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1608 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1604 so that it doesn't break tkinter apps.
1609 so that it doesn't break tkinter apps.
1605
1610
1606 * IPython/iplib.py (_prefilter): fix bug where aliases would
1611 * IPython/iplib.py (_prefilter): fix bug where aliases would
1607 shadow variables when autocall was fully off. Reported by SAGE
1612 shadow variables when autocall was fully off. Reported by SAGE
1608 author William Stein.
1613 author William Stein.
1609
1614
1610 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1615 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1611 at what detail level strings are computed when foo? is requested.
1616 at what detail level strings are computed when foo? is requested.
1612 This allows users to ask for example that the string form of an
1617 This allows users to ask for example that the string form of an
1613 object is only computed when foo?? is called, or even never, by
1618 object is only computed when foo?? is called, or even never, by
1614 setting the object_info_string_level >= 2 in the configuration
1619 setting the object_info_string_level >= 2 in the configuration
1615 file. This new option has been added and documented. After a
1620 file. This new option has been added and documented. After a
1616 request by SAGE to be able to control the printing of very large
1621 request by SAGE to be able to control the printing of very large
1617 objects more easily.
1622 objects more easily.
1618
1623
1619 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1624 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1620
1625
1621 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1626 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1622 from sys.argv, to be 100% consistent with how Python itself works
1627 from sys.argv, to be 100% consistent with how Python itself works
1623 (as seen for example with python -i file.py). After a bug report
1628 (as seen for example with python -i file.py). After a bug report
1624 by Jeffrey Collins.
1629 by Jeffrey Collins.
1625
1630
1626 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1631 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1627 nasty bug which was preventing custom namespaces with -pylab,
1632 nasty bug which was preventing custom namespaces with -pylab,
1628 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1633 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1629 compatibility (long gone from mpl).
1634 compatibility (long gone from mpl).
1630
1635
1631 * IPython/ipapi.py (make_session): name change: create->make. We
1636 * IPython/ipapi.py (make_session): name change: create->make. We
1632 use make in other places (ipmaker,...), it's shorter and easier to
1637 use make in other places (ipmaker,...), it's shorter and easier to
1633 type and say, etc. I'm trying to clean things before 0.7.2 so
1638 type and say, etc. I'm trying to clean things before 0.7.2 so
1634 that I can keep things stable wrt to ipapi in the chainsaw branch.
1639 that I can keep things stable wrt to ipapi in the chainsaw branch.
1635
1640
1636 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1641 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1637 python-mode recognizes our debugger mode. Add support for
1642 python-mode recognizes our debugger mode. Add support for
1638 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1643 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1639 <m.liu.jin-AT-gmail.com> originally written by
1644 <m.liu.jin-AT-gmail.com> originally written by
1640 doxgen-AT-newsmth.net (with minor modifications for xemacs
1645 doxgen-AT-newsmth.net (with minor modifications for xemacs
1641 compatibility)
1646 compatibility)
1642
1647
1643 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1648 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1644 tracebacks when walking the stack so that the stack tracking system
1649 tracebacks when walking the stack so that the stack tracking system
1645 in emacs' python-mode can identify the frames correctly.
1650 in emacs' python-mode can identify the frames correctly.
1646
1651
1647 * IPython/ipmaker.py (make_IPython): make the internal (and
1652 * IPython/ipmaker.py (make_IPython): make the internal (and
1648 default config) autoedit_syntax value false by default. Too many
1653 default config) autoedit_syntax value false by default. Too many
1649 users have complained to me (both on and off-list) about problems
1654 users have complained to me (both on and off-list) about problems
1650 with this option being on by default, so I'm making it default to
1655 with this option being on by default, so I'm making it default to
1651 off. It can still be enabled by anyone via the usual mechanisms.
1656 off. It can still be enabled by anyone via the usual mechanisms.
1652
1657
1653 * IPython/completer.py (Completer.attr_matches): add support for
1658 * IPython/completer.py (Completer.attr_matches): add support for
1654 PyCrust-style _getAttributeNames magic method. Patch contributed
1659 PyCrust-style _getAttributeNames magic method. Patch contributed
1655 by <mscott-AT-goldenspud.com>. Closes #50.
1660 by <mscott-AT-goldenspud.com>. Closes #50.
1656
1661
1657 * IPython/iplib.py (InteractiveShell.__init__): remove the
1662 * IPython/iplib.py (InteractiveShell.__init__): remove the
1658 deletion of exit/quit from __builtin__, which can break
1663 deletion of exit/quit from __builtin__, which can break
1659 third-party tools like the Zope debugging console. The
1664 third-party tools like the Zope debugging console. The
1660 %exit/%quit magics remain. In general, it's probably a good idea
1665 %exit/%quit magics remain. In general, it's probably a good idea
1661 not to delete anything from __builtin__, since we never know what
1666 not to delete anything from __builtin__, since we never know what
1662 that will break. In any case, python now (for 2.5) will support
1667 that will break. In any case, python now (for 2.5) will support
1663 'real' exit/quit, so this issue is moot. Closes #55.
1668 'real' exit/quit, so this issue is moot. Closes #55.
1664
1669
1665 * IPython/genutils.py (with_obj): rename the 'with' function to
1670 * IPython/genutils.py (with_obj): rename the 'with' function to
1666 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1671 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1667 becomes a language keyword. Closes #53.
1672 becomes a language keyword. Closes #53.
1668
1673
1669 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1674 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1670 __file__ attribute to this so it fools more things into thinking
1675 __file__ attribute to this so it fools more things into thinking
1671 it is a real module. Closes #59.
1676 it is a real module. Closes #59.
1672
1677
1673 * IPython/Magic.py (magic_edit): add -n option to open the editor
1678 * IPython/Magic.py (magic_edit): add -n option to open the editor
1674 at a specific line number. After a patch by Stefan van der Walt.
1679 at a specific line number. After a patch by Stefan van der Walt.
1675
1680
1676 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1681 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1677
1682
1678 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1683 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1679 reason the file could not be opened. After automatic crash
1684 reason the file could not be opened. After automatic crash
1680 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1685 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1681 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1686 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1682 (_should_recompile): Don't fire editor if using %bg, since there
1687 (_should_recompile): Don't fire editor if using %bg, since there
1683 is no file in the first place. From the same report as above.
1688 is no file in the first place. From the same report as above.
1684 (raw_input): protect against faulty third-party prefilters. After
1689 (raw_input): protect against faulty third-party prefilters. After
1685 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1690 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1686 while running under SAGE.
1691 while running under SAGE.
1687
1692
1688 2006-05-23 Ville Vainio <vivainio@gmail.com>
1693 2006-05-23 Ville Vainio <vivainio@gmail.com>
1689
1694
1690 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1695 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1691 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1696 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1692 now returns None (again), unless dummy is specifically allowed by
1697 now returns None (again), unless dummy is specifically allowed by
1693 ipapi.get(allow_dummy=True).
1698 ipapi.get(allow_dummy=True).
1694
1699
1695 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1700 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1696
1701
1697 * IPython: remove all 2.2-compatibility objects and hacks from
1702 * IPython: remove all 2.2-compatibility objects and hacks from
1698 everywhere, since we only support 2.3 at this point. Docs
1703 everywhere, since we only support 2.3 at this point. Docs
1699 updated.
1704 updated.
1700
1705
1701 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1706 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1702 Anything requiring extra validation can be turned into a Python
1707 Anything requiring extra validation can be turned into a Python
1703 property in the future. I used a property for the db one b/c
1708 property in the future. I used a property for the db one b/c
1704 there was a nasty circularity problem with the initialization
1709 there was a nasty circularity problem with the initialization
1705 order, which right now I don't have time to clean up.
1710 order, which right now I don't have time to clean up.
1706
1711
1707 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1712 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1708 another locking bug reported by Jorgen. I'm not 100% sure though,
1713 another locking bug reported by Jorgen. I'm not 100% sure though,
1709 so more testing is needed...
1714 so more testing is needed...
1710
1715
1711 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1716 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1712
1717
1713 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1718 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1714 local variables from any routine in user code (typically executed
1719 local variables from any routine in user code (typically executed
1715 with %run) directly into the interactive namespace. Very useful
1720 with %run) directly into the interactive namespace. Very useful
1716 when doing complex debugging.
1721 when doing complex debugging.
1717 (IPythonNotRunning): Changed the default None object to a dummy
1722 (IPythonNotRunning): Changed the default None object to a dummy
1718 whose attributes can be queried as well as called without
1723 whose attributes can be queried as well as called without
1719 exploding, to ease writing code which works transparently both in
1724 exploding, to ease writing code which works transparently both in
1720 and out of ipython and uses some of this API.
1725 and out of ipython and uses some of this API.
1721
1726
1722 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1727 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1723
1728
1724 * IPython/hooks.py (result_display): Fix the fact that our display
1729 * IPython/hooks.py (result_display): Fix the fact that our display
1725 hook was using str() instead of repr(), as the default python
1730 hook was using str() instead of repr(), as the default python
1726 console does. This had gone unnoticed b/c it only happened if
1731 console does. This had gone unnoticed b/c it only happened if
1727 %Pprint was off, but the inconsistency was there.
1732 %Pprint was off, but the inconsistency was there.
1728
1733
1729 2006-05-15 Ville Vainio <vivainio@gmail.com>
1734 2006-05-15 Ville Vainio <vivainio@gmail.com>
1730
1735
1731 * Oinspect.py: Only show docstring for nonexisting/binary files
1736 * Oinspect.py: Only show docstring for nonexisting/binary files
1732 when doing object??, closing ticket #62
1737 when doing object??, closing ticket #62
1733
1738
1734 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1739 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1735
1740
1736 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1741 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1737 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1742 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1738 was being released in a routine which hadn't checked if it had
1743 was being released in a routine which hadn't checked if it had
1739 been the one to acquire it.
1744 been the one to acquire it.
1740
1745
1741 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1746 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1742
1747
1743 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1748 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1744
1749
1745 2006-04-11 Ville Vainio <vivainio@gmail.com>
1750 2006-04-11 Ville Vainio <vivainio@gmail.com>
1746
1751
1747 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1752 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1748 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1753 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1749 prefilters, allowing stuff like magics and aliases in the file.
1754 prefilters, allowing stuff like magics and aliases in the file.
1750
1755
1751 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1756 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1752 added. Supported now are "%clear in" and "%clear out" (clear input and
1757 added. Supported now are "%clear in" and "%clear out" (clear input and
1753 output history, respectively). Also fixed CachedOutput.flush to
1758 output history, respectively). Also fixed CachedOutput.flush to
1754 properly flush the output cache.
1759 properly flush the output cache.
1755
1760
1756 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1761 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1757 half-success (and fail explicitly).
1762 half-success (and fail explicitly).
1758
1763
1759 2006-03-28 Ville Vainio <vivainio@gmail.com>
1764 2006-03-28 Ville Vainio <vivainio@gmail.com>
1760
1765
1761 * iplib.py: Fix quoting of aliases so that only argless ones
1766 * iplib.py: Fix quoting of aliases so that only argless ones
1762 are quoted
1767 are quoted
1763
1768
1764 2006-03-28 Ville Vainio <vivainio@gmail.com>
1769 2006-03-28 Ville Vainio <vivainio@gmail.com>
1765
1770
1766 * iplib.py: Quote aliases with spaces in the name.
1771 * iplib.py: Quote aliases with spaces in the name.
1767 "c:\program files\blah\bin" is now legal alias target.
1772 "c:\program files\blah\bin" is now legal alias target.
1768
1773
1769 * ext_rehashdir.py: Space no longer allowed as arg
1774 * ext_rehashdir.py: Space no longer allowed as arg
1770 separator, since space is legal in path names.
1775 separator, since space is legal in path names.
1771
1776
1772 2006-03-16 Ville Vainio <vivainio@gmail.com>
1777 2006-03-16 Ville Vainio <vivainio@gmail.com>
1773
1778
1774 * upgrade_dir.py: Take path.py from Extensions, correcting
1779 * upgrade_dir.py: Take path.py from Extensions, correcting
1775 %upgrade magic
1780 %upgrade magic
1776
1781
1777 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1782 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1778
1783
1779 * hooks.py: Only enclose editor binary in quotes if legal and
1784 * hooks.py: Only enclose editor binary in quotes if legal and
1780 necessary (space in the name, and is an existing file). Fixes a bug
1785 necessary (space in the name, and is an existing file). Fixes a bug
1781 reported by Zachary Pincus.
1786 reported by Zachary Pincus.
1782
1787
1783 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1788 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1784
1789
1785 * Manual: thanks to a tip on proper color handling for Emacs, by
1790 * Manual: thanks to a tip on proper color handling for Emacs, by
1786 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1791 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1787
1792
1788 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1793 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1789 by applying the provided patch. Thanks to Liu Jin
1794 by applying the provided patch. Thanks to Liu Jin
1790 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1795 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1791 XEmacs/Linux, I'm trusting the submitter that it actually helps
1796 XEmacs/Linux, I'm trusting the submitter that it actually helps
1792 under win32/GNU Emacs. Will revisit if any problems are reported.
1797 under win32/GNU Emacs. Will revisit if any problems are reported.
1793
1798
1794 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1799 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1795
1800
1796 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1801 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1797 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1802 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1798
1803
1799 2006-03-12 Ville Vainio <vivainio@gmail.com>
1804 2006-03-12 Ville Vainio <vivainio@gmail.com>
1800
1805
1801 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1806 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1802 Torsten Marek.
1807 Torsten Marek.
1803
1808
1804 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1809 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1805
1810
1806 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1811 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1807 line ranges works again.
1812 line ranges works again.
1808
1813
1809 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1814 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1810
1815
1811 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1816 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1812 and friends, after a discussion with Zach Pincus on ipython-user.
1817 and friends, after a discussion with Zach Pincus on ipython-user.
1813 I'm not 100% sure, but after thinking about it quite a bit, it may
1818 I'm not 100% sure, but after thinking about it quite a bit, it may
1814 be OK. Testing with the multithreaded shells didn't reveal any
1819 be OK. Testing with the multithreaded shells didn't reveal any
1815 problems, but let's keep an eye out.
1820 problems, but let's keep an eye out.
1816
1821
1817 In the process, I fixed a few things which were calling
1822 In the process, I fixed a few things which were calling
1818 self.InteractiveTB() directly (like safe_execfile), which is a
1823 self.InteractiveTB() directly (like safe_execfile), which is a
1819 mistake: ALL exception reporting should be done by calling
1824 mistake: ALL exception reporting should be done by calling
1820 self.showtraceback(), which handles state and tab-completion and
1825 self.showtraceback(), which handles state and tab-completion and
1821 more.
1826 more.
1822
1827
1823 2006-03-01 Ville Vainio <vivainio@gmail.com>
1828 2006-03-01 Ville Vainio <vivainio@gmail.com>
1824
1829
1825 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1830 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1826 To use, do "from ipipe import *".
1831 To use, do "from ipipe import *".
1827
1832
1828 2006-02-24 Ville Vainio <vivainio@gmail.com>
1833 2006-02-24 Ville Vainio <vivainio@gmail.com>
1829
1834
1830 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1835 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1831 "cleanly" and safely than the older upgrade mechanism.
1836 "cleanly" and safely than the older upgrade mechanism.
1832
1837
1833 2006-02-21 Ville Vainio <vivainio@gmail.com>
1838 2006-02-21 Ville Vainio <vivainio@gmail.com>
1834
1839
1835 * Magic.py: %save works again.
1840 * Magic.py: %save works again.
1836
1841
1837 2006-02-15 Ville Vainio <vivainio@gmail.com>
1842 2006-02-15 Ville Vainio <vivainio@gmail.com>
1838
1843
1839 * Magic.py: %Pprint works again
1844 * Magic.py: %Pprint works again
1840
1845
1841 * Extensions/ipy_sane_defaults.py: Provide everything provided
1846 * Extensions/ipy_sane_defaults.py: Provide everything provided
1842 in default ipythonrc, to make it possible to have a completely empty
1847 in default ipythonrc, to make it possible to have a completely empty
1843 ipythonrc (and thus completely rc-file free configuration)
1848 ipythonrc (and thus completely rc-file free configuration)
1844
1849
1845 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1850 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1846
1851
1847 * IPython/hooks.py (editor): quote the call to the editor command,
1852 * IPython/hooks.py (editor): quote the call to the editor command,
1848 to allow commands with spaces in them. Problem noted by watching
1853 to allow commands with spaces in them. Problem noted by watching
1849 Ian Oswald's video about textpad under win32 at
1854 Ian Oswald's video about textpad under win32 at
1850 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1855 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1851
1856
1852 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1857 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1853 describing magics (we haven't used @ for a loong time).
1858 describing magics (we haven't used @ for a loong time).
1854
1859
1855 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1860 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1856 contributed by marienz to close
1861 contributed by marienz to close
1857 http://www.scipy.net/roundup/ipython/issue53.
1862 http://www.scipy.net/roundup/ipython/issue53.
1858
1863
1859 2006-02-10 Ville Vainio <vivainio@gmail.com>
1864 2006-02-10 Ville Vainio <vivainio@gmail.com>
1860
1865
1861 * genutils.py: getoutput now works in win32 too
1866 * genutils.py: getoutput now works in win32 too
1862
1867
1863 * completer.py: alias and magic completion only invoked
1868 * completer.py: alias and magic completion only invoked
1864 at the first "item" in the line, to avoid "cd %store"
1869 at the first "item" in the line, to avoid "cd %store"
1865 nonsense.
1870 nonsense.
1866
1871
1867 2006-02-09 Ville Vainio <vivainio@gmail.com>
1872 2006-02-09 Ville Vainio <vivainio@gmail.com>
1868
1873
1869 * test/*: Added a unit testing framework (finally).
1874 * test/*: Added a unit testing framework (finally).
1870 '%run runtests.py' to run test_*.
1875 '%run runtests.py' to run test_*.
1871
1876
1872 * ipapi.py: Exposed runlines and set_custom_exc
1877 * ipapi.py: Exposed runlines and set_custom_exc
1873
1878
1874 2006-02-07 Ville Vainio <vivainio@gmail.com>
1879 2006-02-07 Ville Vainio <vivainio@gmail.com>
1875
1880
1876 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1881 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1877 instead use "f(1 2)" as before.
1882 instead use "f(1 2)" as before.
1878
1883
1879 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1884 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1880
1885
1881 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1886 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1882 facilities, for demos processed by the IPython input filter
1887 facilities, for demos processed by the IPython input filter
1883 (IPythonDemo), and for running a script one-line-at-a-time as a
1888 (IPythonDemo), and for running a script one-line-at-a-time as a
1884 demo, both for pure Python (LineDemo) and for IPython-processed
1889 demo, both for pure Python (LineDemo) and for IPython-processed
1885 input (IPythonLineDemo). After a request by Dave Kohel, from the
1890 input (IPythonLineDemo). After a request by Dave Kohel, from the
1886 SAGE team.
1891 SAGE team.
1887 (Demo.edit): added an edit() method to the demo objects, to edit
1892 (Demo.edit): added an edit() method to the demo objects, to edit
1888 the in-memory copy of the last executed block.
1893 the in-memory copy of the last executed block.
1889
1894
1890 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1895 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1891 processing to %edit, %macro and %save. These commands can now be
1896 processing to %edit, %macro and %save. These commands can now be
1892 invoked on the unprocessed input as it was typed by the user
1897 invoked on the unprocessed input as it was typed by the user
1893 (without any prefilters applied). After requests by the SAGE team
1898 (without any prefilters applied). After requests by the SAGE team
1894 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1899 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1895
1900
1896 2006-02-01 Ville Vainio <vivainio@gmail.com>
1901 2006-02-01 Ville Vainio <vivainio@gmail.com>
1897
1902
1898 * setup.py, eggsetup.py: easy_install ipython==dev works
1903 * setup.py, eggsetup.py: easy_install ipython==dev works
1899 correctly now (on Linux)
1904 correctly now (on Linux)
1900
1905
1901 * ipy_user_conf,ipmaker: user config changes, removed spurious
1906 * ipy_user_conf,ipmaker: user config changes, removed spurious
1902 warnings
1907 warnings
1903
1908
1904 * iplib: if rc.banner is string, use it as is.
1909 * iplib: if rc.banner is string, use it as is.
1905
1910
1906 * Magic: %pycat accepts a string argument and pages it's contents.
1911 * Magic: %pycat accepts a string argument and pages it's contents.
1907
1912
1908
1913
1909 2006-01-30 Ville Vainio <vivainio@gmail.com>
1914 2006-01-30 Ville Vainio <vivainio@gmail.com>
1910
1915
1911 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1916 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1912 Now %store and bookmarks work through PickleShare, meaning that
1917 Now %store and bookmarks work through PickleShare, meaning that
1913 concurrent access is possible and all ipython sessions see the
1918 concurrent access is possible and all ipython sessions see the
1914 same database situation all the time, instead of snapshot of
1919 same database situation all the time, instead of snapshot of
1915 the situation when the session was started. Hence, %bookmark
1920 the situation when the session was started. Hence, %bookmark
1916 results are immediately accessible from othes sessions. The database
1921 results are immediately accessible from othes sessions. The database
1917 is also available for use by user extensions. See:
1922 is also available for use by user extensions. See:
1918 http://www.python.org/pypi/pickleshare
1923 http://www.python.org/pypi/pickleshare
1919
1924
1920 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1925 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1921
1926
1922 * aliases can now be %store'd
1927 * aliases can now be %store'd
1923
1928
1924 * path.py moved to Extensions so that pickleshare does not need
1929 * path.py moved to Extensions so that pickleshare does not need
1925 IPython-specific import. Extensions added to pythonpath right
1930 IPython-specific import. Extensions added to pythonpath right
1926 at __init__.
1931 at __init__.
1927
1932
1928 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1933 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1929 called with _ip.system and the pre-transformed command string.
1934 called with _ip.system and the pre-transformed command string.
1930
1935
1931 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1936 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1932
1937
1933 * IPython/iplib.py (interact): Fix that we were not catching
1938 * IPython/iplib.py (interact): Fix that we were not catching
1934 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1939 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1935 logic here had to change, but it's fixed now.
1940 logic here had to change, but it's fixed now.
1936
1941
1937 2006-01-29 Ville Vainio <vivainio@gmail.com>
1942 2006-01-29 Ville Vainio <vivainio@gmail.com>
1938
1943
1939 * iplib.py: Try to import pyreadline on Windows.
1944 * iplib.py: Try to import pyreadline on Windows.
1940
1945
1941 2006-01-27 Ville Vainio <vivainio@gmail.com>
1946 2006-01-27 Ville Vainio <vivainio@gmail.com>
1942
1947
1943 * iplib.py: Expose ipapi as _ip in builtin namespace.
1948 * iplib.py: Expose ipapi as _ip in builtin namespace.
1944 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1949 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1945 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1950 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1946 syntax now produce _ip.* variant of the commands.
1951 syntax now produce _ip.* variant of the commands.
1947
1952
1948 * "_ip.options().autoedit_syntax = 2" automatically throws
1953 * "_ip.options().autoedit_syntax = 2" automatically throws
1949 user to editor for syntax error correction without prompting.
1954 user to editor for syntax error correction without prompting.
1950
1955
1951 2006-01-27 Ville Vainio <vivainio@gmail.com>
1956 2006-01-27 Ville Vainio <vivainio@gmail.com>
1952
1957
1953 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1958 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1954 'ipython' at argv[0]) executed through command line.
1959 'ipython' at argv[0]) executed through command line.
1955 NOTE: this DEPRECATES calling ipython with multiple scripts
1960 NOTE: this DEPRECATES calling ipython with multiple scripts
1956 ("ipython a.py b.py c.py")
1961 ("ipython a.py b.py c.py")
1957
1962
1958 * iplib.py, hooks.py: Added configurable input prefilter,
1963 * iplib.py, hooks.py: Added configurable input prefilter,
1959 named 'input_prefilter'. See ext_rescapture.py for example
1964 named 'input_prefilter'. See ext_rescapture.py for example
1960 usage.
1965 usage.
1961
1966
1962 * ext_rescapture.py, Magic.py: Better system command output capture
1967 * ext_rescapture.py, Magic.py: Better system command output capture
1963 through 'var = !ls' (deprecates user-visible %sc). Same notation
1968 through 'var = !ls' (deprecates user-visible %sc). Same notation
1964 applies for magics, 'var = %alias' assigns alias list to var.
1969 applies for magics, 'var = %alias' assigns alias list to var.
1965
1970
1966 * ipapi.py: added meta() for accessing extension-usable data store.
1971 * ipapi.py: added meta() for accessing extension-usable data store.
1967
1972
1968 * iplib.py: added InteractiveShell.getapi(). New magics should be
1973 * iplib.py: added InteractiveShell.getapi(). New magics should be
1969 written doing self.getapi() instead of using the shell directly.
1974 written doing self.getapi() instead of using the shell directly.
1970
1975
1971 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1976 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1972 %store foo >> ~/myfoo.txt to store variables to files (in clean
1977 %store foo >> ~/myfoo.txt to store variables to files (in clean
1973 textual form, not a restorable pickle).
1978 textual form, not a restorable pickle).
1974
1979
1975 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1980 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1976
1981
1977 * usage.py, Magic.py: added %quickref
1982 * usage.py, Magic.py: added %quickref
1978
1983
1979 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1984 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1980
1985
1981 * GetoptErrors when invoking magics etc. with wrong args
1986 * GetoptErrors when invoking magics etc. with wrong args
1982 are now more helpful:
1987 are now more helpful:
1983 GetoptError: option -l not recognized (allowed: "qb" )
1988 GetoptError: option -l not recognized (allowed: "qb" )
1984
1989
1985 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1990 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1986
1991
1987 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1992 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1988 computationally intensive blocks don't appear to stall the demo.
1993 computationally intensive blocks don't appear to stall the demo.
1989
1994
1990 2006-01-24 Ville Vainio <vivainio@gmail.com>
1995 2006-01-24 Ville Vainio <vivainio@gmail.com>
1991
1996
1992 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1997 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1993 value to manipulate resulting history entry.
1998 value to manipulate resulting history entry.
1994
1999
1995 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2000 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1996 to instance methods of IPApi class, to make extending an embedded
2001 to instance methods of IPApi class, to make extending an embedded
1997 IPython feasible. See ext_rehashdir.py for example usage.
2002 IPython feasible. See ext_rehashdir.py for example usage.
1998
2003
1999 * Merged 1071-1076 from branches/0.7.1
2004 * Merged 1071-1076 from branches/0.7.1
2000
2005
2001
2006
2002 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2007 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2003
2008
2004 * tools/release (daystamp): Fix build tools to use the new
2009 * tools/release (daystamp): Fix build tools to use the new
2005 eggsetup.py script to build lightweight eggs.
2010 eggsetup.py script to build lightweight eggs.
2006
2011
2007 * Applied changesets 1062 and 1064 before 0.7.1 release.
2012 * Applied changesets 1062 and 1064 before 0.7.1 release.
2008
2013
2009 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2014 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2010 see the raw input history (without conversions like %ls ->
2015 see the raw input history (without conversions like %ls ->
2011 ipmagic("ls")). After a request from W. Stein, SAGE
2016 ipmagic("ls")). After a request from W. Stein, SAGE
2012 (http://modular.ucsd.edu/sage) developer. This information is
2017 (http://modular.ucsd.edu/sage) developer. This information is
2013 stored in the input_hist_raw attribute of the IPython instance, so
2018 stored in the input_hist_raw attribute of the IPython instance, so
2014 developers can access it if needed (it's an InputList instance).
2019 developers can access it if needed (it's an InputList instance).
2015
2020
2016 * Versionstring = 0.7.2.svn
2021 * Versionstring = 0.7.2.svn
2017
2022
2018 * eggsetup.py: A separate script for constructing eggs, creates
2023 * eggsetup.py: A separate script for constructing eggs, creates
2019 proper launch scripts even on Windows (an .exe file in
2024 proper launch scripts even on Windows (an .exe file in
2020 \python24\scripts).
2025 \python24\scripts).
2021
2026
2022 * ipapi.py: launch_new_instance, launch entry point needed for the
2027 * ipapi.py: launch_new_instance, launch entry point needed for the
2023 egg.
2028 egg.
2024
2029
2025 2006-01-23 Ville Vainio <vivainio@gmail.com>
2030 2006-01-23 Ville Vainio <vivainio@gmail.com>
2026
2031
2027 * Added %cpaste magic for pasting python code
2032 * Added %cpaste magic for pasting python code
2028
2033
2029 2006-01-22 Ville Vainio <vivainio@gmail.com>
2034 2006-01-22 Ville Vainio <vivainio@gmail.com>
2030
2035
2031 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2036 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2032
2037
2033 * Versionstring = 0.7.2.svn
2038 * Versionstring = 0.7.2.svn
2034
2039
2035 * eggsetup.py: A separate script for constructing eggs, creates
2040 * eggsetup.py: A separate script for constructing eggs, creates
2036 proper launch scripts even on Windows (an .exe file in
2041 proper launch scripts even on Windows (an .exe file in
2037 \python24\scripts).
2042 \python24\scripts).
2038
2043
2039 * ipapi.py: launch_new_instance, launch entry point needed for the
2044 * ipapi.py: launch_new_instance, launch entry point needed for the
2040 egg.
2045 egg.
2041
2046
2042 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2047 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2043
2048
2044 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2049 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2045 %pfile foo would print the file for foo even if it was a binary.
2050 %pfile foo would print the file for foo even if it was a binary.
2046 Now, extensions '.so' and '.dll' are skipped.
2051 Now, extensions '.so' and '.dll' are skipped.
2047
2052
2048 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2053 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2049 bug, where macros would fail in all threaded modes. I'm not 100%
2054 bug, where macros would fail in all threaded modes. I'm not 100%
2050 sure, so I'm going to put out an rc instead of making a release
2055 sure, so I'm going to put out an rc instead of making a release
2051 today, and wait for feedback for at least a few days.
2056 today, and wait for feedback for at least a few days.
2052
2057
2053 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2058 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2054 it...) the handling of pasting external code with autoindent on.
2059 it...) the handling of pasting external code with autoindent on.
2055 To get out of a multiline input, the rule will appear for most
2060 To get out of a multiline input, the rule will appear for most
2056 users unchanged: two blank lines or change the indent level
2061 users unchanged: two blank lines or change the indent level
2057 proposed by IPython. But there is a twist now: you can
2062 proposed by IPython. But there is a twist now: you can
2058 add/subtract only *one or two spaces*. If you add/subtract three
2063 add/subtract only *one or two spaces*. If you add/subtract three
2059 or more (unless you completely delete the line), IPython will
2064 or more (unless you completely delete the line), IPython will
2060 accept that line, and you'll need to enter a second one of pure
2065 accept that line, and you'll need to enter a second one of pure
2061 whitespace. I know it sounds complicated, but I can't find a
2066 whitespace. I know it sounds complicated, but I can't find a
2062 different solution that covers all the cases, with the right
2067 different solution that covers all the cases, with the right
2063 heuristics. Hopefully in actual use, nobody will really notice
2068 heuristics. Hopefully in actual use, nobody will really notice
2064 all these strange rules and things will 'just work'.
2069 all these strange rules and things will 'just work'.
2065
2070
2066 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2071 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2067
2072
2068 * IPython/iplib.py (interact): catch exceptions which can be
2073 * IPython/iplib.py (interact): catch exceptions which can be
2069 triggered asynchronously by signal handlers. Thanks to an
2074 triggered asynchronously by signal handlers. Thanks to an
2070 automatic crash report, submitted by Colin Kingsley
2075 automatic crash report, submitted by Colin Kingsley
2071 <tercel-AT-gentoo.org>.
2076 <tercel-AT-gentoo.org>.
2072
2077
2073 2006-01-20 Ville Vainio <vivainio@gmail.com>
2078 2006-01-20 Ville Vainio <vivainio@gmail.com>
2074
2079
2075 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2080 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2076 (%rehashdir, very useful, try it out) of how to extend ipython
2081 (%rehashdir, very useful, try it out) of how to extend ipython
2077 with new magics. Also added Extensions dir to pythonpath to make
2082 with new magics. Also added Extensions dir to pythonpath to make
2078 importing extensions easy.
2083 importing extensions easy.
2079
2084
2080 * %store now complains when trying to store interactively declared
2085 * %store now complains when trying to store interactively declared
2081 classes / instances of those classes.
2086 classes / instances of those classes.
2082
2087
2083 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2088 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2084 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2089 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2085 if they exist, and ipy_user_conf.py with some defaults is created for
2090 if they exist, and ipy_user_conf.py with some defaults is created for
2086 the user.
2091 the user.
2087
2092
2088 * Startup rehashing done by the config file, not InterpreterExec.
2093 * Startup rehashing done by the config file, not InterpreterExec.
2089 This means system commands are available even without selecting the
2094 This means system commands are available even without selecting the
2090 pysh profile. It's the sensible default after all.
2095 pysh profile. It's the sensible default after all.
2091
2096
2092 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2097 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2093
2098
2094 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2099 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2095 multiline code with autoindent on working. But I am really not
2100 multiline code with autoindent on working. But I am really not
2096 sure, so this needs more testing. Will commit a debug-enabled
2101 sure, so this needs more testing. Will commit a debug-enabled
2097 version for now, while I test it some more, so that Ville and
2102 version for now, while I test it some more, so that Ville and
2098 others may also catch any problems. Also made
2103 others may also catch any problems. Also made
2099 self.indent_current_str() a method, to ensure that there's no
2104 self.indent_current_str() a method, to ensure that there's no
2100 chance of the indent space count and the corresponding string
2105 chance of the indent space count and the corresponding string
2101 falling out of sync. All code needing the string should just call
2106 falling out of sync. All code needing the string should just call
2102 the method.
2107 the method.
2103
2108
2104 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2109 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2105
2110
2106 * IPython/Magic.py (magic_edit): fix check for when users don't
2111 * IPython/Magic.py (magic_edit): fix check for when users don't
2107 save their output files, the try/except was in the wrong section.
2112 save their output files, the try/except was in the wrong section.
2108
2113
2109 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2114 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2110
2115
2111 * IPython/Magic.py (magic_run): fix __file__ global missing from
2116 * IPython/Magic.py (magic_run): fix __file__ global missing from
2112 script's namespace when executed via %run. After a report by
2117 script's namespace when executed via %run. After a report by
2113 Vivian.
2118 Vivian.
2114
2119
2115 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2120 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2116 when using python 2.4. The parent constructor changed in 2.4, and
2121 when using python 2.4. The parent constructor changed in 2.4, and
2117 we need to track it directly (we can't call it, as it messes up
2122 we need to track it directly (we can't call it, as it messes up
2118 readline and tab-completion inside our pdb would stop working).
2123 readline and tab-completion inside our pdb would stop working).
2119 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2124 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2120
2125
2121 2006-01-16 Ville Vainio <vivainio@gmail.com>
2126 2006-01-16 Ville Vainio <vivainio@gmail.com>
2122
2127
2123 * Ipython/magic.py: Reverted back to old %edit functionality
2128 * Ipython/magic.py: Reverted back to old %edit functionality
2124 that returns file contents on exit.
2129 that returns file contents on exit.
2125
2130
2126 * IPython/path.py: Added Jason Orendorff's "path" module to
2131 * IPython/path.py: Added Jason Orendorff's "path" module to
2127 IPython tree, http://www.jorendorff.com/articles/python/path/.
2132 IPython tree, http://www.jorendorff.com/articles/python/path/.
2128 You can get path objects conveniently through %sc, and !!, e.g.:
2133 You can get path objects conveniently through %sc, and !!, e.g.:
2129 sc files=ls
2134 sc files=ls
2130 for p in files.paths: # or files.p
2135 for p in files.paths: # or files.p
2131 print p,p.mtime
2136 print p,p.mtime
2132
2137
2133 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2138 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2134 now work again without considering the exclusion regexp -
2139 now work again without considering the exclusion regexp -
2135 hence, things like ',foo my/path' turn to 'foo("my/path")'
2140 hence, things like ',foo my/path' turn to 'foo("my/path")'
2136 instead of syntax error.
2141 instead of syntax error.
2137
2142
2138
2143
2139 2006-01-14 Ville Vainio <vivainio@gmail.com>
2144 2006-01-14 Ville Vainio <vivainio@gmail.com>
2140
2145
2141 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2146 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2142 ipapi decorators for python 2.4 users, options() provides access to rc
2147 ipapi decorators for python 2.4 users, options() provides access to rc
2143 data.
2148 data.
2144
2149
2145 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2150 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2146 as path separators (even on Linux ;-). Space character after
2151 as path separators (even on Linux ;-). Space character after
2147 backslash (as yielded by tab completer) is still space;
2152 backslash (as yielded by tab completer) is still space;
2148 "%cd long\ name" works as expected.
2153 "%cd long\ name" works as expected.
2149
2154
2150 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2155 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2151 as "chain of command", with priority. API stays the same,
2156 as "chain of command", with priority. API stays the same,
2152 TryNext exception raised by a hook function signals that
2157 TryNext exception raised by a hook function signals that
2153 current hook failed and next hook should try handling it, as
2158 current hook failed and next hook should try handling it, as
2154 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2159 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
2155 requested configurable display hook, which is now implemented.
2160 requested configurable display hook, which is now implemented.
2156
2161
2157 2006-01-13 Ville Vainio <vivainio@gmail.com>
2162 2006-01-13 Ville Vainio <vivainio@gmail.com>
2158
2163
2159 * IPython/platutils*.py: platform specific utility functions,
2164 * IPython/platutils*.py: platform specific utility functions,
2160 so far only set_term_title is implemented (change terminal
2165 so far only set_term_title is implemented (change terminal
2161 label in windowing systems). %cd now changes the title to
2166 label in windowing systems). %cd now changes the title to
2162 current dir.
2167 current dir.
2163
2168
2164 * IPython/Release.py: Added myself to "authors" list,
2169 * IPython/Release.py: Added myself to "authors" list,
2165 had to create new files.
2170 had to create new files.
2166
2171
2167 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2172 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2168 shell escape; not a known bug but had potential to be one in the
2173 shell escape; not a known bug but had potential to be one in the
2169 future.
2174 future.
2170
2175
2171 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2176 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2172 extension API for IPython! See the module for usage example. Fix
2177 extension API for IPython! See the module for usage example. Fix
2173 OInspect for docstring-less magic functions.
2178 OInspect for docstring-less magic functions.
2174
2179
2175
2180
2176 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2181 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2177
2182
2178 * IPython/iplib.py (raw_input): temporarily deactivate all
2183 * IPython/iplib.py (raw_input): temporarily deactivate all
2179 attempts at allowing pasting of code with autoindent on. It
2184 attempts at allowing pasting of code with autoindent on. It
2180 introduced bugs (reported by Prabhu) and I can't seem to find a
2185 introduced bugs (reported by Prabhu) and I can't seem to find a
2181 robust combination which works in all cases. Will have to revisit
2186 robust combination which works in all cases. Will have to revisit
2182 later.
2187 later.
2183
2188
2184 * IPython/genutils.py: remove isspace() function. We've dropped
2189 * IPython/genutils.py: remove isspace() function. We've dropped
2185 2.2 compatibility, so it's OK to use the string method.
2190 2.2 compatibility, so it's OK to use the string method.
2186
2191
2187 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2192 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2188
2193
2189 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2194 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2190 matching what NOT to autocall on, to include all python binary
2195 matching what NOT to autocall on, to include all python binary
2191 operators (including things like 'and', 'or', 'is' and 'in').
2196 operators (including things like 'and', 'or', 'is' and 'in').
2192 Prompted by a bug report on 'foo & bar', but I realized we had
2197 Prompted by a bug report on 'foo & bar', but I realized we had
2193 many more potential bug cases with other operators. The regexp is
2198 many more potential bug cases with other operators. The regexp is
2194 self.re_exclude_auto, it's fairly commented.
2199 self.re_exclude_auto, it's fairly commented.
2195
2200
2196 2006-01-12 Ville Vainio <vivainio@gmail.com>
2201 2006-01-12 Ville Vainio <vivainio@gmail.com>
2197
2202
2198 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2203 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2199 Prettified and hardened string/backslash quoting with ipsystem(),
2204 Prettified and hardened string/backslash quoting with ipsystem(),
2200 ipalias() and ipmagic(). Now even \ characters are passed to
2205 ipalias() and ipmagic(). Now even \ characters are passed to
2201 %magics, !shell escapes and aliases exactly as they are in the
2206 %magics, !shell escapes and aliases exactly as they are in the
2202 ipython command line. Should improve backslash experience,
2207 ipython command line. Should improve backslash experience,
2203 particularly in Windows (path delimiter for some commands that
2208 particularly in Windows (path delimiter for some commands that
2204 won't understand '/'), but Unix benefits as well (regexps). %cd
2209 won't understand '/'), but Unix benefits as well (regexps). %cd
2205 magic still doesn't support backslash path delimiters, though. Also
2210 magic still doesn't support backslash path delimiters, though. Also
2206 deleted all pretense of supporting multiline command strings in
2211 deleted all pretense of supporting multiline command strings in
2207 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2212 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2208
2213
2209 * doc/build_doc_instructions.txt added. Documentation on how to
2214 * doc/build_doc_instructions.txt added. Documentation on how to
2210 use doc/update_manual.py, added yesterday. Both files contributed
2215 use doc/update_manual.py, added yesterday. Both files contributed
2211 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2216 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2212 doc/*.sh for deprecation at a later date.
2217 doc/*.sh for deprecation at a later date.
2213
2218
2214 * /ipython.py Added ipython.py to root directory for
2219 * /ipython.py Added ipython.py to root directory for
2215 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2220 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2216 ipython.py) and development convenience (no need to keep doing
2221 ipython.py) and development convenience (no need to keep doing
2217 "setup.py install" between changes).
2222 "setup.py install" between changes).
2218
2223
2219 * Made ! and !! shell escapes work (again) in multiline expressions:
2224 * Made ! and !! shell escapes work (again) in multiline expressions:
2220 if 1:
2225 if 1:
2221 !ls
2226 !ls
2222 !!ls
2227 !!ls
2223
2228
2224 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2229 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2225
2230
2226 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2231 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2227 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2232 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2228 module in case-insensitive installation. Was causing crashes
2233 module in case-insensitive installation. Was causing crashes
2229 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2234 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2230
2235
2231 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2236 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2232 <marienz-AT-gentoo.org>, closes
2237 <marienz-AT-gentoo.org>, closes
2233 http://www.scipy.net/roundup/ipython/issue51.
2238 http://www.scipy.net/roundup/ipython/issue51.
2234
2239
2235 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2240 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2236
2241
2237 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2242 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2238 problem of excessive CPU usage under *nix and keyboard lag under
2243 problem of excessive CPU usage under *nix and keyboard lag under
2239 win32.
2244 win32.
2240
2245
2241 2006-01-10 *** Released version 0.7.0
2246 2006-01-10 *** Released version 0.7.0
2242
2247
2243 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2248 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2244
2249
2245 * IPython/Release.py (revision): tag version number to 0.7.0,
2250 * IPython/Release.py (revision): tag version number to 0.7.0,
2246 ready for release.
2251 ready for release.
2247
2252
2248 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2253 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2249 it informs the user of the name of the temp. file used. This can
2254 it informs the user of the name of the temp. file used. This can
2250 help if you decide later to reuse that same file, so you know
2255 help if you decide later to reuse that same file, so you know
2251 where to copy the info from.
2256 where to copy the info from.
2252
2257
2253 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2258 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2254
2259
2255 * setup_bdist_egg.py: little script to build an egg. Added
2260 * setup_bdist_egg.py: little script to build an egg. Added
2256 support in the release tools as well.
2261 support in the release tools as well.
2257
2262
2258 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2263 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2259
2264
2260 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2265 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2261 version selection (new -wxversion command line and ipythonrc
2266 version selection (new -wxversion command line and ipythonrc
2262 parameter). Patch contributed by Arnd Baecker
2267 parameter). Patch contributed by Arnd Baecker
2263 <arnd.baecker-AT-web.de>.
2268 <arnd.baecker-AT-web.de>.
2264
2269
2265 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2270 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2266 embedded instances, for variables defined at the interactive
2271 embedded instances, for variables defined at the interactive
2267 prompt of the embedded ipython. Reported by Arnd.
2272 prompt of the embedded ipython. Reported by Arnd.
2268
2273
2269 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2274 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2270 it can be used as a (stateful) toggle, or with a direct parameter.
2275 it can be used as a (stateful) toggle, or with a direct parameter.
2271
2276
2272 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2277 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2273 could be triggered in certain cases and cause the traceback
2278 could be triggered in certain cases and cause the traceback
2274 printer not to work.
2279 printer not to work.
2275
2280
2276 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2281 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2277
2282
2278 * IPython/iplib.py (_should_recompile): Small fix, closes
2283 * IPython/iplib.py (_should_recompile): Small fix, closes
2279 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2284 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2280
2285
2281 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2286 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2282
2287
2283 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2288 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2284 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2289 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2285 Moad for help with tracking it down.
2290 Moad for help with tracking it down.
2286
2291
2287 * IPython/iplib.py (handle_auto): fix autocall handling for
2292 * IPython/iplib.py (handle_auto): fix autocall handling for
2288 objects which support BOTH __getitem__ and __call__ (so that f [x]
2293 objects which support BOTH __getitem__ and __call__ (so that f [x]
2289 is left alone, instead of becoming f([x]) automatically).
2294 is left alone, instead of becoming f([x]) automatically).
2290
2295
2291 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2296 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2292 Ville's patch.
2297 Ville's patch.
2293
2298
2294 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2299 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2295
2300
2296 * IPython/iplib.py (handle_auto): changed autocall semantics to
2301 * IPython/iplib.py (handle_auto): changed autocall semantics to
2297 include 'smart' mode, where the autocall transformation is NOT
2302 include 'smart' mode, where the autocall transformation is NOT
2298 applied if there are no arguments on the line. This allows you to
2303 applied if there are no arguments on the line. This allows you to
2299 just type 'foo' if foo is a callable to see its internal form,
2304 just type 'foo' if foo is a callable to see its internal form,
2300 instead of having it called with no arguments (typically a
2305 instead of having it called with no arguments (typically a
2301 mistake). The old 'full' autocall still exists: for that, you
2306 mistake). The old 'full' autocall still exists: for that, you
2302 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2307 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2303
2308
2304 * IPython/completer.py (Completer.attr_matches): add
2309 * IPython/completer.py (Completer.attr_matches): add
2305 tab-completion support for Enthoughts' traits. After a report by
2310 tab-completion support for Enthoughts' traits. After a report by
2306 Arnd and a patch by Prabhu.
2311 Arnd and a patch by Prabhu.
2307
2312
2308 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2313 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2309
2314
2310 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2315 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2311 Schmolck's patch to fix inspect.getinnerframes().
2316 Schmolck's patch to fix inspect.getinnerframes().
2312
2317
2313 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2318 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2314 for embedded instances, regarding handling of namespaces and items
2319 for embedded instances, regarding handling of namespaces and items
2315 added to the __builtin__ one. Multiple embedded instances and
2320 added to the __builtin__ one. Multiple embedded instances and
2316 recursive embeddings should work better now (though I'm not sure
2321 recursive embeddings should work better now (though I'm not sure
2317 I've got all the corner cases fixed, that code is a bit of a brain
2322 I've got all the corner cases fixed, that code is a bit of a brain
2318 twister).
2323 twister).
2319
2324
2320 * IPython/Magic.py (magic_edit): added support to edit in-memory
2325 * IPython/Magic.py (magic_edit): added support to edit in-memory
2321 macros (automatically creates the necessary temp files). %edit
2326 macros (automatically creates the necessary temp files). %edit
2322 also doesn't return the file contents anymore, it's just noise.
2327 also doesn't return the file contents anymore, it's just noise.
2323
2328
2324 * IPython/completer.py (Completer.attr_matches): revert change to
2329 * IPython/completer.py (Completer.attr_matches): revert change to
2325 complete only on attributes listed in __all__. I realized it
2330 complete only on attributes listed in __all__. I realized it
2326 cripples the tab-completion system as a tool for exploring the
2331 cripples the tab-completion system as a tool for exploring the
2327 internals of unknown libraries (it renders any non-__all__
2332 internals of unknown libraries (it renders any non-__all__
2328 attribute off-limits). I got bit by this when trying to see
2333 attribute off-limits). I got bit by this when trying to see
2329 something inside the dis module.
2334 something inside the dis module.
2330
2335
2331 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2336 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2332
2337
2333 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2338 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2334 namespace for users and extension writers to hold data in. This
2339 namespace for users and extension writers to hold data in. This
2335 follows the discussion in
2340 follows the discussion in
2336 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2341 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2337
2342
2338 * IPython/completer.py (IPCompleter.complete): small patch to help
2343 * IPython/completer.py (IPCompleter.complete): small patch to help
2339 tab-completion under Emacs, after a suggestion by John Barnard
2344 tab-completion under Emacs, after a suggestion by John Barnard
2340 <barnarj-AT-ccf.org>.
2345 <barnarj-AT-ccf.org>.
2341
2346
2342 * IPython/Magic.py (Magic.extract_input_slices): added support for
2347 * IPython/Magic.py (Magic.extract_input_slices): added support for
2343 the slice notation in magics to use N-M to represent numbers N...M
2348 the slice notation in magics to use N-M to represent numbers N...M
2344 (closed endpoints). This is used by %macro and %save.
2349 (closed endpoints). This is used by %macro and %save.
2345
2350
2346 * IPython/completer.py (Completer.attr_matches): for modules which
2351 * IPython/completer.py (Completer.attr_matches): for modules which
2347 define __all__, complete only on those. After a patch by Jeffrey
2352 define __all__, complete only on those. After a patch by Jeffrey
2348 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2353 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2349 speed up this routine.
2354 speed up this routine.
2350
2355
2351 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2356 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2352 don't know if this is the end of it, but the behavior now is
2357 don't know if this is the end of it, but the behavior now is
2353 certainly much more correct. Note that coupled with macros,
2358 certainly much more correct. Note that coupled with macros,
2354 slightly surprising (at first) behavior may occur: a macro will in
2359 slightly surprising (at first) behavior may occur: a macro will in
2355 general expand to multiple lines of input, so upon exiting, the
2360 general expand to multiple lines of input, so upon exiting, the
2356 in/out counters will both be bumped by the corresponding amount
2361 in/out counters will both be bumped by the corresponding amount
2357 (as if the macro's contents had been typed interactively). Typing
2362 (as if the macro's contents had been typed interactively). Typing
2358 %hist will reveal the intermediate (silently processed) lines.
2363 %hist will reveal the intermediate (silently processed) lines.
2359
2364
2360 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2365 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2361 pickle to fail (%run was overwriting __main__ and not restoring
2366 pickle to fail (%run was overwriting __main__ and not restoring
2362 it, but pickle relies on __main__ to operate).
2367 it, but pickle relies on __main__ to operate).
2363
2368
2364 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2369 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2365 using properties, but forgot to make the main InteractiveShell
2370 using properties, but forgot to make the main InteractiveShell
2366 class a new-style class. Properties fail silently, and
2371 class a new-style class. Properties fail silently, and
2367 mysteriously, with old-style class (getters work, but
2372 mysteriously, with old-style class (getters work, but
2368 setters don't do anything).
2373 setters don't do anything).
2369
2374
2370 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2375 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2371
2376
2372 * IPython/Magic.py (magic_history): fix history reporting bug (I
2377 * IPython/Magic.py (magic_history): fix history reporting bug (I
2373 know some nasties are still there, I just can't seem to find a
2378 know some nasties are still there, I just can't seem to find a
2374 reproducible test case to track them down; the input history is
2379 reproducible test case to track them down; the input history is
2375 falling out of sync...)
2380 falling out of sync...)
2376
2381
2377 * IPython/iplib.py (handle_shell_escape): fix bug where both
2382 * IPython/iplib.py (handle_shell_escape): fix bug where both
2378 aliases and system accesses where broken for indented code (such
2383 aliases and system accesses where broken for indented code (such
2379 as loops).
2384 as loops).
2380
2385
2381 * IPython/genutils.py (shell): fix small but critical bug for
2386 * IPython/genutils.py (shell): fix small but critical bug for
2382 win32 system access.
2387 win32 system access.
2383
2388
2384 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2389 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2385
2390
2386 * IPython/iplib.py (showtraceback): remove use of the
2391 * IPython/iplib.py (showtraceback): remove use of the
2387 sys.last_{type/value/traceback} structures, which are non
2392 sys.last_{type/value/traceback} structures, which are non
2388 thread-safe.
2393 thread-safe.
2389 (_prefilter): change control flow to ensure that we NEVER
2394 (_prefilter): change control flow to ensure that we NEVER
2390 introspect objects when autocall is off. This will guarantee that
2395 introspect objects when autocall is off. This will guarantee that
2391 having an input line of the form 'x.y', where access to attribute
2396 having an input line of the form 'x.y', where access to attribute
2392 'y' has side effects, doesn't trigger the side effect TWICE. It
2397 'y' has side effects, doesn't trigger the side effect TWICE. It
2393 is important to note that, with autocall on, these side effects
2398 is important to note that, with autocall on, these side effects
2394 can still happen.
2399 can still happen.
2395 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2400 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2396 trio. IPython offers these three kinds of special calls which are
2401 trio. IPython offers these three kinds of special calls which are
2397 not python code, and it's a good thing to have their call method
2402 not python code, and it's a good thing to have their call method
2398 be accessible as pure python functions (not just special syntax at
2403 be accessible as pure python functions (not just special syntax at
2399 the command line). It gives us a better internal implementation
2404 the command line). It gives us a better internal implementation
2400 structure, as well as exposing these for user scripting more
2405 structure, as well as exposing these for user scripting more
2401 cleanly.
2406 cleanly.
2402
2407
2403 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2408 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2404 file. Now that they'll be more likely to be used with the
2409 file. Now that they'll be more likely to be used with the
2405 persistance system (%store), I want to make sure their module path
2410 persistance system (%store), I want to make sure their module path
2406 doesn't change in the future, so that we don't break things for
2411 doesn't change in the future, so that we don't break things for
2407 users' persisted data.
2412 users' persisted data.
2408
2413
2409 * IPython/iplib.py (autoindent_update): move indentation
2414 * IPython/iplib.py (autoindent_update): move indentation
2410 management into the _text_ processing loop, not the keyboard
2415 management into the _text_ processing loop, not the keyboard
2411 interactive one. This is necessary to correctly process non-typed
2416 interactive one. This is necessary to correctly process non-typed
2412 multiline input (such as macros).
2417 multiline input (such as macros).
2413
2418
2414 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2419 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2415 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2420 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2416 which was producing problems in the resulting manual.
2421 which was producing problems in the resulting manual.
2417 (magic_whos): improve reporting of instances (show their class,
2422 (magic_whos): improve reporting of instances (show their class,
2418 instead of simply printing 'instance' which isn't terribly
2423 instead of simply printing 'instance' which isn't terribly
2419 informative).
2424 informative).
2420
2425
2421 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2426 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2422 (minor mods) to support network shares under win32.
2427 (minor mods) to support network shares under win32.
2423
2428
2424 * IPython/winconsole.py (get_console_size): add new winconsole
2429 * IPython/winconsole.py (get_console_size): add new winconsole
2425 module and fixes to page_dumb() to improve its behavior under
2430 module and fixes to page_dumb() to improve its behavior under
2426 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2431 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2427
2432
2428 * IPython/Magic.py (Macro): simplified Macro class to just
2433 * IPython/Magic.py (Macro): simplified Macro class to just
2429 subclass list. We've had only 2.2 compatibility for a very long
2434 subclass list. We've had only 2.2 compatibility for a very long
2430 time, yet I was still avoiding subclassing the builtin types. No
2435 time, yet I was still avoiding subclassing the builtin types. No
2431 more (I'm also starting to use properties, though I won't shift to
2436 more (I'm also starting to use properties, though I won't shift to
2432 2.3-specific features quite yet).
2437 2.3-specific features quite yet).
2433 (magic_store): added Ville's patch for lightweight variable
2438 (magic_store): added Ville's patch for lightweight variable
2434 persistence, after a request on the user list by Matt Wilkie
2439 persistence, after a request on the user list by Matt Wilkie
2435 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2440 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2436 details.
2441 details.
2437
2442
2438 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2443 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2439 changed the default logfile name from 'ipython.log' to
2444 changed the default logfile name from 'ipython.log' to
2440 'ipython_log.py'. These logs are real python files, and now that
2445 'ipython_log.py'. These logs are real python files, and now that
2441 we have much better multiline support, people are more likely to
2446 we have much better multiline support, people are more likely to
2442 want to use them as such. Might as well name them correctly.
2447 want to use them as such. Might as well name them correctly.
2443
2448
2444 * IPython/Magic.py: substantial cleanup. While we can't stop
2449 * IPython/Magic.py: substantial cleanup. While we can't stop
2445 using magics as mixins, due to the existing customizations 'out
2450 using magics as mixins, due to the existing customizations 'out
2446 there' which rely on the mixin naming conventions, at least I
2451 there' which rely on the mixin naming conventions, at least I
2447 cleaned out all cross-class name usage. So once we are OK with
2452 cleaned out all cross-class name usage. So once we are OK with
2448 breaking compatibility, the two systems can be separated.
2453 breaking compatibility, the two systems can be separated.
2449
2454
2450 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2455 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2451 anymore, and the class is a fair bit less hideous as well. New
2456 anymore, and the class is a fair bit less hideous as well. New
2452 features were also introduced: timestamping of input, and logging
2457 features were also introduced: timestamping of input, and logging
2453 of output results. These are user-visible with the -t and -o
2458 of output results. These are user-visible with the -t and -o
2454 options to %logstart. Closes
2459 options to %logstart. Closes
2455 http://www.scipy.net/roundup/ipython/issue11 and a request by
2460 http://www.scipy.net/roundup/ipython/issue11 and a request by
2456 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2461 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2457
2462
2458 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2463 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2459
2464
2460 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2465 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2461 better handle backslashes in paths. See the thread 'More Windows
2466 better handle backslashes in paths. See the thread 'More Windows
2462 questions part 2 - \/ characters revisited' on the iypthon user
2467 questions part 2 - \/ characters revisited' on the iypthon user
2463 list:
2468 list:
2464 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2469 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2465
2470
2466 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2471 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2467
2472
2468 (InteractiveShell.__init__): change threaded shells to not use the
2473 (InteractiveShell.__init__): change threaded shells to not use the
2469 ipython crash handler. This was causing more problems than not,
2474 ipython crash handler. This was causing more problems than not,
2470 as exceptions in the main thread (GUI code, typically) would
2475 as exceptions in the main thread (GUI code, typically) would
2471 always show up as a 'crash', when they really weren't.
2476 always show up as a 'crash', when they really weren't.
2472
2477
2473 The colors and exception mode commands (%colors/%xmode) have been
2478 The colors and exception mode commands (%colors/%xmode) have been
2474 synchronized to also take this into account, so users can get
2479 synchronized to also take this into account, so users can get
2475 verbose exceptions for their threaded code as well. I also added
2480 verbose exceptions for their threaded code as well. I also added
2476 support for activating pdb inside this exception handler as well,
2481 support for activating pdb inside this exception handler as well,
2477 so now GUI authors can use IPython's enhanced pdb at runtime.
2482 so now GUI authors can use IPython's enhanced pdb at runtime.
2478
2483
2479 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2484 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2480 true by default, and add it to the shipped ipythonrc file. Since
2485 true by default, and add it to the shipped ipythonrc file. Since
2481 this asks the user before proceeding, I think it's OK to make it
2486 this asks the user before proceeding, I think it's OK to make it
2482 true by default.
2487 true by default.
2483
2488
2484 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2489 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2485 of the previous special-casing of input in the eval loop. I think
2490 of the previous special-casing of input in the eval loop. I think
2486 this is cleaner, as they really are commands and shouldn't have
2491 this is cleaner, as they really are commands and shouldn't have
2487 a special role in the middle of the core code.
2492 a special role in the middle of the core code.
2488
2493
2489 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2494 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2490
2495
2491 * IPython/iplib.py (edit_syntax_error): added support for
2496 * IPython/iplib.py (edit_syntax_error): added support for
2492 automatically reopening the editor if the file had a syntax error
2497 automatically reopening the editor if the file had a syntax error
2493 in it. Thanks to scottt who provided the patch at:
2498 in it. Thanks to scottt who provided the patch at:
2494 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2499 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2495 version committed).
2500 version committed).
2496
2501
2497 * IPython/iplib.py (handle_normal): add suport for multi-line
2502 * IPython/iplib.py (handle_normal): add suport for multi-line
2498 input with emtpy lines. This fixes
2503 input with emtpy lines. This fixes
2499 http://www.scipy.net/roundup/ipython/issue43 and a similar
2504 http://www.scipy.net/roundup/ipython/issue43 and a similar
2500 discussion on the user list.
2505 discussion on the user list.
2501
2506
2502 WARNING: a behavior change is necessarily introduced to support
2507 WARNING: a behavior change is necessarily introduced to support
2503 blank lines: now a single blank line with whitespace does NOT
2508 blank lines: now a single blank line with whitespace does NOT
2504 break the input loop, which means that when autoindent is on, by
2509 break the input loop, which means that when autoindent is on, by
2505 default hitting return on the next (indented) line does NOT exit.
2510 default hitting return on the next (indented) line does NOT exit.
2506
2511
2507 Instead, to exit a multiline input you can either have:
2512 Instead, to exit a multiline input you can either have:
2508
2513
2509 - TWO whitespace lines (just hit return again), or
2514 - TWO whitespace lines (just hit return again), or
2510 - a single whitespace line of a different length than provided
2515 - a single whitespace line of a different length than provided
2511 by the autoindent (add or remove a space).
2516 by the autoindent (add or remove a space).
2512
2517
2513 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2518 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2514 module to better organize all readline-related functionality.
2519 module to better organize all readline-related functionality.
2515 I've deleted FlexCompleter and put all completion clases here.
2520 I've deleted FlexCompleter and put all completion clases here.
2516
2521
2517 * IPython/iplib.py (raw_input): improve indentation management.
2522 * IPython/iplib.py (raw_input): improve indentation management.
2518 It is now possible to paste indented code with autoindent on, and
2523 It is now possible to paste indented code with autoindent on, and
2519 the code is interpreted correctly (though it still looks bad on
2524 the code is interpreted correctly (though it still looks bad on
2520 screen, due to the line-oriented nature of ipython).
2525 screen, due to the line-oriented nature of ipython).
2521 (MagicCompleter.complete): change behavior so that a TAB key on an
2526 (MagicCompleter.complete): change behavior so that a TAB key on an
2522 otherwise empty line actually inserts a tab, instead of completing
2527 otherwise empty line actually inserts a tab, instead of completing
2523 on the entire global namespace. This makes it easier to use the
2528 on the entire global namespace. This makes it easier to use the
2524 TAB key for indentation. After a request by Hans Meine
2529 TAB key for indentation. After a request by Hans Meine
2525 <hans_meine-AT-gmx.net>
2530 <hans_meine-AT-gmx.net>
2526 (_prefilter): add support so that typing plain 'exit' or 'quit'
2531 (_prefilter): add support so that typing plain 'exit' or 'quit'
2527 does a sensible thing. Originally I tried to deviate as little as
2532 does a sensible thing. Originally I tried to deviate as little as
2528 possible from the default python behavior, but even that one may
2533 possible from the default python behavior, but even that one may
2529 change in this direction (thread on python-dev to that effect).
2534 change in this direction (thread on python-dev to that effect).
2530 Regardless, ipython should do the right thing even if CPython's
2535 Regardless, ipython should do the right thing even if CPython's
2531 '>>>' prompt doesn't.
2536 '>>>' prompt doesn't.
2532 (InteractiveShell): removed subclassing code.InteractiveConsole
2537 (InteractiveShell): removed subclassing code.InteractiveConsole
2533 class. By now we'd overridden just about all of its methods: I've
2538 class. By now we'd overridden just about all of its methods: I've
2534 copied the remaining two over, and now ipython is a standalone
2539 copied the remaining two over, and now ipython is a standalone
2535 class. This will provide a clearer picture for the chainsaw
2540 class. This will provide a clearer picture for the chainsaw
2536 branch refactoring.
2541 branch refactoring.
2537
2542
2538 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2543 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2539
2544
2540 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2545 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2541 failures for objects which break when dir() is called on them.
2546 failures for objects which break when dir() is called on them.
2542
2547
2543 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2548 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2544 distinct local and global namespaces in the completer API. This
2549 distinct local and global namespaces in the completer API. This
2545 change allows us to properly handle completion with distinct
2550 change allows us to properly handle completion with distinct
2546 scopes, including in embedded instances (this had never really
2551 scopes, including in embedded instances (this had never really
2547 worked correctly).
2552 worked correctly).
2548
2553
2549 Note: this introduces a change in the constructor for
2554 Note: this introduces a change in the constructor for
2550 MagicCompleter, as a new global_namespace parameter is now the
2555 MagicCompleter, as a new global_namespace parameter is now the
2551 second argument (the others were bumped one position).
2556 second argument (the others were bumped one position).
2552
2557
2553 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2558 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2554
2559
2555 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2560 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2556 embedded instances (which can be done now thanks to Vivian's
2561 embedded instances (which can be done now thanks to Vivian's
2557 frame-handling fixes for pdb).
2562 frame-handling fixes for pdb).
2558 (InteractiveShell.__init__): Fix namespace handling problem in
2563 (InteractiveShell.__init__): Fix namespace handling problem in
2559 embedded instances. We were overwriting __main__ unconditionally,
2564 embedded instances. We were overwriting __main__ unconditionally,
2560 and this should only be done for 'full' (non-embedded) IPython;
2565 and this should only be done for 'full' (non-embedded) IPython;
2561 embedded instances must respect the caller's __main__. Thanks to
2566 embedded instances must respect the caller's __main__. Thanks to
2562 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2567 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2563
2568
2564 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2569 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2565
2570
2566 * setup.py: added download_url to setup(). This registers the
2571 * setup.py: added download_url to setup(). This registers the
2567 download address at PyPI, which is not only useful to humans
2572 download address at PyPI, which is not only useful to humans
2568 browsing the site, but is also picked up by setuptools (the Eggs
2573 browsing the site, but is also picked up by setuptools (the Eggs
2569 machinery). Thanks to Ville and R. Kern for the info/discussion
2574 machinery). Thanks to Ville and R. Kern for the info/discussion
2570 on this.
2575 on this.
2571
2576
2572 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2577 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2573
2578
2574 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2579 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2575 This brings a lot of nice functionality to the pdb mode, which now
2580 This brings a lot of nice functionality to the pdb mode, which now
2576 has tab-completion, syntax highlighting, and better stack handling
2581 has tab-completion, syntax highlighting, and better stack handling
2577 than before. Many thanks to Vivian De Smedt
2582 than before. Many thanks to Vivian De Smedt
2578 <vivian-AT-vdesmedt.com> for the original patches.
2583 <vivian-AT-vdesmedt.com> for the original patches.
2579
2584
2580 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2585 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2581
2586
2582 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2587 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2583 sequence to consistently accept the banner argument. The
2588 sequence to consistently accept the banner argument. The
2584 inconsistency was tripping SAGE, thanks to Gary Zablackis
2589 inconsistency was tripping SAGE, thanks to Gary Zablackis
2585 <gzabl-AT-yahoo.com> for the report.
2590 <gzabl-AT-yahoo.com> for the report.
2586
2591
2587 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2592 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2588
2593
2589 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2594 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2590 Fix bug where a naked 'alias' call in the ipythonrc file would
2595 Fix bug where a naked 'alias' call in the ipythonrc file would
2591 cause a crash. Bug reported by Jorgen Stenarson.
2596 cause a crash. Bug reported by Jorgen Stenarson.
2592
2597
2593 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2598 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2594
2599
2595 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2600 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2596 startup time.
2601 startup time.
2597
2602
2598 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2603 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2599 instances had introduced a bug with globals in normal code. Now
2604 instances had introduced a bug with globals in normal code. Now
2600 it's working in all cases.
2605 it's working in all cases.
2601
2606
2602 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2607 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2603 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2608 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2604 has been introduced to set the default case sensitivity of the
2609 has been introduced to set the default case sensitivity of the
2605 searches. Users can still select either mode at runtime on a
2610 searches. Users can still select either mode at runtime on a
2606 per-search basis.
2611 per-search basis.
2607
2612
2608 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2613 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2609
2614
2610 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2615 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2611 attributes in wildcard searches for subclasses. Modified version
2616 attributes in wildcard searches for subclasses. Modified version
2612 of a patch by Jorgen.
2617 of a patch by Jorgen.
2613
2618
2614 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2619 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2615
2620
2616 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2621 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2617 embedded instances. I added a user_global_ns attribute to the
2622 embedded instances. I added a user_global_ns attribute to the
2618 InteractiveShell class to handle this.
2623 InteractiveShell class to handle this.
2619
2624
2620 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2625 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2621
2626
2622 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2627 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2623 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2628 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2624 (reported under win32, but may happen also in other platforms).
2629 (reported under win32, but may happen also in other platforms).
2625 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2630 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2626
2631
2627 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2632 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2628
2633
2629 * IPython/Magic.py (magic_psearch): new support for wildcard
2634 * IPython/Magic.py (magic_psearch): new support for wildcard
2630 patterns. Now, typing ?a*b will list all names which begin with a
2635 patterns. Now, typing ?a*b will list all names which begin with a
2631 and end in b, for example. The %psearch magic has full
2636 and end in b, for example. The %psearch magic has full
2632 docstrings. Many thanks to JΓΆrgen Stenarson
2637 docstrings. Many thanks to JΓΆrgen Stenarson
2633 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2638 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2634 implementing this functionality.
2639 implementing this functionality.
2635
2640
2636 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2641 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2637
2642
2638 * Manual: fixed long-standing annoyance of double-dashes (as in
2643 * Manual: fixed long-standing annoyance of double-dashes (as in
2639 --prefix=~, for example) being stripped in the HTML version. This
2644 --prefix=~, for example) being stripped in the HTML version. This
2640 is a latex2html bug, but a workaround was provided. Many thanks
2645 is a latex2html bug, but a workaround was provided. Many thanks
2641 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2646 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2642 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2647 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2643 rolling. This seemingly small issue had tripped a number of users
2648 rolling. This seemingly small issue had tripped a number of users
2644 when first installing, so I'm glad to see it gone.
2649 when first installing, so I'm glad to see it gone.
2645
2650
2646 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2651 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2647
2652
2648 * IPython/Extensions/numeric_formats.py: fix missing import,
2653 * IPython/Extensions/numeric_formats.py: fix missing import,
2649 reported by Stephen Walton.
2654 reported by Stephen Walton.
2650
2655
2651 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2656 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2652
2657
2653 * IPython/demo.py: finish demo module, fully documented now.
2658 * IPython/demo.py: finish demo module, fully documented now.
2654
2659
2655 * IPython/genutils.py (file_read): simple little utility to read a
2660 * IPython/genutils.py (file_read): simple little utility to read a
2656 file and ensure it's closed afterwards.
2661 file and ensure it's closed afterwards.
2657
2662
2658 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2663 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2659
2664
2660 * IPython/demo.py (Demo.__init__): added support for individually
2665 * IPython/demo.py (Demo.__init__): added support for individually
2661 tagging blocks for automatic execution.
2666 tagging blocks for automatic execution.
2662
2667
2663 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2668 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2664 syntax-highlighted python sources, requested by John.
2669 syntax-highlighted python sources, requested by John.
2665
2670
2666 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2671 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2667
2672
2668 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2673 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2669 finishing.
2674 finishing.
2670
2675
2671 * IPython/genutils.py (shlex_split): moved from Magic to here,
2676 * IPython/genutils.py (shlex_split): moved from Magic to here,
2672 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2677 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2673
2678
2674 * IPython/demo.py (Demo.__init__): added support for silent
2679 * IPython/demo.py (Demo.__init__): added support for silent
2675 blocks, improved marks as regexps, docstrings written.
2680 blocks, improved marks as regexps, docstrings written.
2676 (Demo.__init__): better docstring, added support for sys.argv.
2681 (Demo.__init__): better docstring, added support for sys.argv.
2677
2682
2678 * IPython/genutils.py (marquee): little utility used by the demo
2683 * IPython/genutils.py (marquee): little utility used by the demo
2679 code, handy in general.
2684 code, handy in general.
2680
2685
2681 * IPython/demo.py (Demo.__init__): new class for interactive
2686 * IPython/demo.py (Demo.__init__): new class for interactive
2682 demos. Not documented yet, I just wrote it in a hurry for
2687 demos. Not documented yet, I just wrote it in a hurry for
2683 scipy'05. Will docstring later.
2688 scipy'05. Will docstring later.
2684
2689
2685 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2690 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2686
2691
2687 * IPython/Shell.py (sigint_handler): Drastic simplification which
2692 * IPython/Shell.py (sigint_handler): Drastic simplification which
2688 also seems to make Ctrl-C work correctly across threads! This is
2693 also seems to make Ctrl-C work correctly across threads! This is
2689 so simple, that I can't beleive I'd missed it before. Needs more
2694 so simple, that I can't beleive I'd missed it before. Needs more
2690 testing, though.
2695 testing, though.
2691 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2696 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2692 like this before...
2697 like this before...
2693
2698
2694 * IPython/genutils.py (get_home_dir): add protection against
2699 * IPython/genutils.py (get_home_dir): add protection against
2695 non-dirs in win32 registry.
2700 non-dirs in win32 registry.
2696
2701
2697 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2702 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2698 bug where dict was mutated while iterating (pysh crash).
2703 bug where dict was mutated while iterating (pysh crash).
2699
2704
2700 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2705 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2701
2706
2702 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2707 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2703 spurious newlines added by this routine. After a report by
2708 spurious newlines added by this routine. After a report by
2704 F. Mantegazza.
2709 F. Mantegazza.
2705
2710
2706 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2711 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2707
2712
2708 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2713 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2709 calls. These were a leftover from the GTK 1.x days, and can cause
2714 calls. These were a leftover from the GTK 1.x days, and can cause
2710 problems in certain cases (after a report by John Hunter).
2715 problems in certain cases (after a report by John Hunter).
2711
2716
2712 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2717 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2713 os.getcwd() fails at init time. Thanks to patch from David Remahl
2718 os.getcwd() fails at init time. Thanks to patch from David Remahl
2714 <chmod007-AT-mac.com>.
2719 <chmod007-AT-mac.com>.
2715 (InteractiveShell.__init__): prevent certain special magics from
2720 (InteractiveShell.__init__): prevent certain special magics from
2716 being shadowed by aliases. Closes
2721 being shadowed by aliases. Closes
2717 http://www.scipy.net/roundup/ipython/issue41.
2722 http://www.scipy.net/roundup/ipython/issue41.
2718
2723
2719 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2724 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2720
2725
2721 * IPython/iplib.py (InteractiveShell.complete): Added new
2726 * IPython/iplib.py (InteractiveShell.complete): Added new
2722 top-level completion method to expose the completion mechanism
2727 top-level completion method to expose the completion mechanism
2723 beyond readline-based environments.
2728 beyond readline-based environments.
2724
2729
2725 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2730 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2726
2731
2727 * tools/ipsvnc (svnversion): fix svnversion capture.
2732 * tools/ipsvnc (svnversion): fix svnversion capture.
2728
2733
2729 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2734 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2730 attribute to self, which was missing. Before, it was set by a
2735 attribute to self, which was missing. Before, it was set by a
2731 routine which in certain cases wasn't being called, so the
2736 routine which in certain cases wasn't being called, so the
2732 instance could end up missing the attribute. This caused a crash.
2737 instance could end up missing the attribute. This caused a crash.
2733 Closes http://www.scipy.net/roundup/ipython/issue40.
2738 Closes http://www.scipy.net/roundup/ipython/issue40.
2734
2739
2735 2005-08-16 Fernando Perez <fperez@colorado.edu>
2740 2005-08-16 Fernando Perez <fperez@colorado.edu>
2736
2741
2737 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2742 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2738 contains non-string attribute. Closes
2743 contains non-string attribute. Closes
2739 http://www.scipy.net/roundup/ipython/issue38.
2744 http://www.scipy.net/roundup/ipython/issue38.
2740
2745
2741 2005-08-14 Fernando Perez <fperez@colorado.edu>
2746 2005-08-14 Fernando Perez <fperez@colorado.edu>
2742
2747
2743 * tools/ipsvnc: Minor improvements, to add changeset info.
2748 * tools/ipsvnc: Minor improvements, to add changeset info.
2744
2749
2745 2005-08-12 Fernando Perez <fperez@colorado.edu>
2750 2005-08-12 Fernando Perez <fperez@colorado.edu>
2746
2751
2747 * IPython/iplib.py (runsource): remove self.code_to_run_src
2752 * IPython/iplib.py (runsource): remove self.code_to_run_src
2748 attribute. I realized this is nothing more than
2753 attribute. I realized this is nothing more than
2749 '\n'.join(self.buffer), and having the same data in two different
2754 '\n'.join(self.buffer), and having the same data in two different
2750 places is just asking for synchronization bugs. This may impact
2755 places is just asking for synchronization bugs. This may impact
2751 people who have custom exception handlers, so I need to warn
2756 people who have custom exception handlers, so I need to warn
2752 ipython-dev about it (F. Mantegazza may use them).
2757 ipython-dev about it (F. Mantegazza may use them).
2753
2758
2754 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2759 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2755
2760
2756 * IPython/genutils.py: fix 2.2 compatibility (generators)
2761 * IPython/genutils.py: fix 2.2 compatibility (generators)
2757
2762
2758 2005-07-18 Fernando Perez <fperez@colorado.edu>
2763 2005-07-18 Fernando Perez <fperez@colorado.edu>
2759
2764
2760 * IPython/genutils.py (get_home_dir): fix to help users with
2765 * IPython/genutils.py (get_home_dir): fix to help users with
2761 invalid $HOME under win32.
2766 invalid $HOME under win32.
2762
2767
2763 2005-07-17 Fernando Perez <fperez@colorado.edu>
2768 2005-07-17 Fernando Perez <fperez@colorado.edu>
2764
2769
2765 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2770 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2766 some old hacks and clean up a bit other routines; code should be
2771 some old hacks and clean up a bit other routines; code should be
2767 simpler and a bit faster.
2772 simpler and a bit faster.
2768
2773
2769 * IPython/iplib.py (interact): removed some last-resort attempts
2774 * IPython/iplib.py (interact): removed some last-resort attempts
2770 to survive broken stdout/stderr. That code was only making it
2775 to survive broken stdout/stderr. That code was only making it
2771 harder to abstract out the i/o (necessary for gui integration),
2776 harder to abstract out the i/o (necessary for gui integration),
2772 and the crashes it could prevent were extremely rare in practice
2777 and the crashes it could prevent were extremely rare in practice
2773 (besides being fully user-induced in a pretty violent manner).
2778 (besides being fully user-induced in a pretty violent manner).
2774
2779
2775 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2780 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2776 Nothing major yet, but the code is simpler to read; this should
2781 Nothing major yet, but the code is simpler to read; this should
2777 make it easier to do more serious modifications in the future.
2782 make it easier to do more serious modifications in the future.
2778
2783
2779 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2784 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2780 which broke in .15 (thanks to a report by Ville).
2785 which broke in .15 (thanks to a report by Ville).
2781
2786
2782 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2787 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2783 be quite correct, I know next to nothing about unicode). This
2788 be quite correct, I know next to nothing about unicode). This
2784 will allow unicode strings to be used in prompts, amongst other
2789 will allow unicode strings to be used in prompts, amongst other
2785 cases. It also will prevent ipython from crashing when unicode
2790 cases. It also will prevent ipython from crashing when unicode
2786 shows up unexpectedly in many places. If ascii encoding fails, we
2791 shows up unexpectedly in many places. If ascii encoding fails, we
2787 assume utf_8. Currently the encoding is not a user-visible
2792 assume utf_8. Currently the encoding is not a user-visible
2788 setting, though it could be made so if there is demand for it.
2793 setting, though it could be made so if there is demand for it.
2789
2794
2790 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2795 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2791
2796
2792 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2797 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2793
2798
2794 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2799 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2795
2800
2796 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2801 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2797 code can work transparently for 2.2/2.3.
2802 code can work transparently for 2.2/2.3.
2798
2803
2799 2005-07-16 Fernando Perez <fperez@colorado.edu>
2804 2005-07-16 Fernando Perez <fperez@colorado.edu>
2800
2805
2801 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2806 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2802 out of the color scheme table used for coloring exception
2807 out of the color scheme table used for coloring exception
2803 tracebacks. This allows user code to add new schemes at runtime.
2808 tracebacks. This allows user code to add new schemes at runtime.
2804 This is a minimally modified version of the patch at
2809 This is a minimally modified version of the patch at
2805 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2810 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2806 for the contribution.
2811 for the contribution.
2807
2812
2808 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2813 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2809 slightly modified version of the patch in
2814 slightly modified version of the patch in
2810 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2815 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2811 to remove the previous try/except solution (which was costlier).
2816 to remove the previous try/except solution (which was costlier).
2812 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2817 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2813
2818
2814 2005-06-08 Fernando Perez <fperez@colorado.edu>
2819 2005-06-08 Fernando Perez <fperez@colorado.edu>
2815
2820
2816 * IPython/iplib.py (write/write_err): Add methods to abstract all
2821 * IPython/iplib.py (write/write_err): Add methods to abstract all
2817 I/O a bit more.
2822 I/O a bit more.
2818
2823
2819 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2824 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2820 warning, reported by Aric Hagberg, fix by JD Hunter.
2825 warning, reported by Aric Hagberg, fix by JD Hunter.
2821
2826
2822 2005-06-02 *** Released version 0.6.15
2827 2005-06-02 *** Released version 0.6.15
2823
2828
2824 2005-06-01 Fernando Perez <fperez@colorado.edu>
2829 2005-06-01 Fernando Perez <fperez@colorado.edu>
2825
2830
2826 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2831 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2827 tab-completion of filenames within open-quoted strings. Note that
2832 tab-completion of filenames within open-quoted strings. Note that
2828 this requires that in ~/.ipython/ipythonrc, users change the
2833 this requires that in ~/.ipython/ipythonrc, users change the
2829 readline delimiters configuration to read:
2834 readline delimiters configuration to read:
2830
2835
2831 readline_remove_delims -/~
2836 readline_remove_delims -/~
2832
2837
2833
2838
2834 2005-05-31 *** Released version 0.6.14
2839 2005-05-31 *** Released version 0.6.14
2835
2840
2836 2005-05-29 Fernando Perez <fperez@colorado.edu>
2841 2005-05-29 Fernando Perez <fperez@colorado.edu>
2837
2842
2838 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2843 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2839 with files not on the filesystem. Reported by Eliyahu Sandler
2844 with files not on the filesystem. Reported by Eliyahu Sandler
2840 <eli@gondolin.net>
2845 <eli@gondolin.net>
2841
2846
2842 2005-05-22 Fernando Perez <fperez@colorado.edu>
2847 2005-05-22 Fernando Perez <fperez@colorado.edu>
2843
2848
2844 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2849 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2845 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2850 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2846
2851
2847 2005-05-19 Fernando Perez <fperez@colorado.edu>
2852 2005-05-19 Fernando Perez <fperez@colorado.edu>
2848
2853
2849 * IPython/iplib.py (safe_execfile): close a file which could be
2854 * IPython/iplib.py (safe_execfile): close a file which could be
2850 left open (causing problems in win32, which locks open files).
2855 left open (causing problems in win32, which locks open files).
2851 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2856 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2852
2857
2853 2005-05-18 Fernando Perez <fperez@colorado.edu>
2858 2005-05-18 Fernando Perez <fperez@colorado.edu>
2854
2859
2855 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2860 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2856 keyword arguments correctly to safe_execfile().
2861 keyword arguments correctly to safe_execfile().
2857
2862
2858 2005-05-13 Fernando Perez <fperez@colorado.edu>
2863 2005-05-13 Fernando Perez <fperez@colorado.edu>
2859
2864
2860 * ipython.1: Added info about Qt to manpage, and threads warning
2865 * ipython.1: Added info about Qt to manpage, and threads warning
2861 to usage page (invoked with --help).
2866 to usage page (invoked with --help).
2862
2867
2863 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2868 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2864 new matcher (it goes at the end of the priority list) to do
2869 new matcher (it goes at the end of the priority list) to do
2865 tab-completion on named function arguments. Submitted by George
2870 tab-completion on named function arguments. Submitted by George
2866 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2871 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2867 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2872 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2868 for more details.
2873 for more details.
2869
2874
2870 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2875 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2871 SystemExit exceptions in the script being run. Thanks to a report
2876 SystemExit exceptions in the script being run. Thanks to a report
2872 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2877 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2873 producing very annoying behavior when running unit tests.
2878 producing very annoying behavior when running unit tests.
2874
2879
2875 2005-05-12 Fernando Perez <fperez@colorado.edu>
2880 2005-05-12 Fernando Perez <fperez@colorado.edu>
2876
2881
2877 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2882 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2878 which I'd broken (again) due to a changed regexp. In the process,
2883 which I'd broken (again) due to a changed regexp. In the process,
2879 added ';' as an escape to auto-quote the whole line without
2884 added ';' as an escape to auto-quote the whole line without
2880 splitting its arguments. Thanks to a report by Jerry McRae
2885 splitting its arguments. Thanks to a report by Jerry McRae
2881 <qrs0xyc02-AT-sneakemail.com>.
2886 <qrs0xyc02-AT-sneakemail.com>.
2882
2887
2883 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2888 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2884 possible crashes caused by a TokenError. Reported by Ed Schofield
2889 possible crashes caused by a TokenError. Reported by Ed Schofield
2885 <schofield-AT-ftw.at>.
2890 <schofield-AT-ftw.at>.
2886
2891
2887 2005-05-06 Fernando Perez <fperez@colorado.edu>
2892 2005-05-06 Fernando Perez <fperez@colorado.edu>
2888
2893
2889 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2894 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2890
2895
2891 2005-04-29 Fernando Perez <fperez@colorado.edu>
2896 2005-04-29 Fernando Perez <fperez@colorado.edu>
2892
2897
2893 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2898 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2894 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2899 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2895 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2900 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2896 which provides support for Qt interactive usage (similar to the
2901 which provides support for Qt interactive usage (similar to the
2897 existing one for WX and GTK). This had been often requested.
2902 existing one for WX and GTK). This had been often requested.
2898
2903
2899 2005-04-14 *** Released version 0.6.13
2904 2005-04-14 *** Released version 0.6.13
2900
2905
2901 2005-04-08 Fernando Perez <fperez@colorado.edu>
2906 2005-04-08 Fernando Perez <fperez@colorado.edu>
2902
2907
2903 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2908 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2904 from _ofind, which gets called on almost every input line. Now,
2909 from _ofind, which gets called on almost every input line. Now,
2905 we only try to get docstrings if they are actually going to be
2910 we only try to get docstrings if they are actually going to be
2906 used (the overhead of fetching unnecessary docstrings can be
2911 used (the overhead of fetching unnecessary docstrings can be
2907 noticeable for certain objects, such as Pyro proxies).
2912 noticeable for certain objects, such as Pyro proxies).
2908
2913
2909 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2914 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2910 for completers. For some reason I had been passing them the state
2915 for completers. For some reason I had been passing them the state
2911 variable, which completers never actually need, and was in
2916 variable, which completers never actually need, and was in
2912 conflict with the rlcompleter API. Custom completers ONLY need to
2917 conflict with the rlcompleter API. Custom completers ONLY need to
2913 take the text parameter.
2918 take the text parameter.
2914
2919
2915 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2920 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2916 work correctly in pysh. I've also moved all the logic which used
2921 work correctly in pysh. I've also moved all the logic which used
2917 to be in pysh.py here, which will prevent problems with future
2922 to be in pysh.py here, which will prevent problems with future
2918 upgrades. However, this time I must warn users to update their
2923 upgrades. However, this time I must warn users to update their
2919 pysh profile to include the line
2924 pysh profile to include the line
2920
2925
2921 import_all IPython.Extensions.InterpreterExec
2926 import_all IPython.Extensions.InterpreterExec
2922
2927
2923 because otherwise things won't work for them. They MUST also
2928 because otherwise things won't work for them. They MUST also
2924 delete pysh.py and the line
2929 delete pysh.py and the line
2925
2930
2926 execfile pysh.py
2931 execfile pysh.py
2927
2932
2928 from their ipythonrc-pysh.
2933 from their ipythonrc-pysh.
2929
2934
2930 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2935 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2931 robust in the face of objects whose dir() returns non-strings
2936 robust in the face of objects whose dir() returns non-strings
2932 (which it shouldn't, but some broken libs like ITK do). Thanks to
2937 (which it shouldn't, but some broken libs like ITK do). Thanks to
2933 a patch by John Hunter (implemented differently, though). Also
2938 a patch by John Hunter (implemented differently, though). Also
2934 minor improvements by using .extend instead of + on lists.
2939 minor improvements by using .extend instead of + on lists.
2935
2940
2936 * pysh.py:
2941 * pysh.py:
2937
2942
2938 2005-04-06 Fernando Perez <fperez@colorado.edu>
2943 2005-04-06 Fernando Perez <fperez@colorado.edu>
2939
2944
2940 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2945 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2941 by default, so that all users benefit from it. Those who don't
2946 by default, so that all users benefit from it. Those who don't
2942 want it can still turn it off.
2947 want it can still turn it off.
2943
2948
2944 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2949 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2945 config file, I'd forgotten about this, so users were getting it
2950 config file, I'd forgotten about this, so users were getting it
2946 off by default.
2951 off by default.
2947
2952
2948 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2953 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2949 consistency. Now magics can be called in multiline statements,
2954 consistency. Now magics can be called in multiline statements,
2950 and python variables can be expanded in magic calls via $var.
2955 and python variables can be expanded in magic calls via $var.
2951 This makes the magic system behave just like aliases or !system
2956 This makes the magic system behave just like aliases or !system
2952 calls.
2957 calls.
2953
2958
2954 2005-03-28 Fernando Perez <fperez@colorado.edu>
2959 2005-03-28 Fernando Perez <fperez@colorado.edu>
2955
2960
2956 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2961 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2957 expensive string additions for building command. Add support for
2962 expensive string additions for building command. Add support for
2958 trailing ';' when autocall is used.
2963 trailing ';' when autocall is used.
2959
2964
2960 2005-03-26 Fernando Perez <fperez@colorado.edu>
2965 2005-03-26 Fernando Perez <fperez@colorado.edu>
2961
2966
2962 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2967 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2963 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2968 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2964 ipython.el robust against prompts with any number of spaces
2969 ipython.el robust against prompts with any number of spaces
2965 (including 0) after the ':' character.
2970 (including 0) after the ':' character.
2966
2971
2967 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2972 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2968 continuation prompt, which misled users to think the line was
2973 continuation prompt, which misled users to think the line was
2969 already indented. Closes debian Bug#300847, reported to me by
2974 already indented. Closes debian Bug#300847, reported to me by
2970 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2975 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2971
2976
2972 2005-03-23 Fernando Perez <fperez@colorado.edu>
2977 2005-03-23 Fernando Perez <fperez@colorado.edu>
2973
2978
2974 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2979 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2975 properly aligned if they have embedded newlines.
2980 properly aligned if they have embedded newlines.
2976
2981
2977 * IPython/iplib.py (runlines): Add a public method to expose
2982 * IPython/iplib.py (runlines): Add a public method to expose
2978 IPython's code execution machinery, so that users can run strings
2983 IPython's code execution machinery, so that users can run strings
2979 as if they had been typed at the prompt interactively.
2984 as if they had been typed at the prompt interactively.
2980 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2985 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2981 methods which can call the system shell, but with python variable
2986 methods which can call the system shell, but with python variable
2982 expansion. The three such methods are: __IPYTHON__.system,
2987 expansion. The three such methods are: __IPYTHON__.system,
2983 .getoutput and .getoutputerror. These need to be documented in a
2988 .getoutput and .getoutputerror. These need to be documented in a
2984 'public API' section (to be written) of the manual.
2989 'public API' section (to be written) of the manual.
2985
2990
2986 2005-03-20 Fernando Perez <fperez@colorado.edu>
2991 2005-03-20 Fernando Perez <fperez@colorado.edu>
2987
2992
2988 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2993 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2989 for custom exception handling. This is quite powerful, and it
2994 for custom exception handling. This is quite powerful, and it
2990 allows for user-installable exception handlers which can trap
2995 allows for user-installable exception handlers which can trap
2991 custom exceptions at runtime and treat them separately from
2996 custom exceptions at runtime and treat them separately from
2992 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2997 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2993 Mantegazza <mantegazza-AT-ill.fr>.
2998 Mantegazza <mantegazza-AT-ill.fr>.
2994 (InteractiveShell.set_custom_completer): public API function to
2999 (InteractiveShell.set_custom_completer): public API function to
2995 add new completers at runtime.
3000 add new completers at runtime.
2996
3001
2997 2005-03-19 Fernando Perez <fperez@colorado.edu>
3002 2005-03-19 Fernando Perez <fperez@colorado.edu>
2998
3003
2999 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3004 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3000 allow objects which provide their docstrings via non-standard
3005 allow objects which provide their docstrings via non-standard
3001 mechanisms (like Pyro proxies) to still be inspected by ipython's
3006 mechanisms (like Pyro proxies) to still be inspected by ipython's
3002 ? system.
3007 ? system.
3003
3008
3004 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3009 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3005 automatic capture system. I tried quite hard to make it work
3010 automatic capture system. I tried quite hard to make it work
3006 reliably, and simply failed. I tried many combinations with the
3011 reliably, and simply failed. I tried many combinations with the
3007 subprocess module, but eventually nothing worked in all needed
3012 subprocess module, but eventually nothing worked in all needed
3008 cases (not blocking stdin for the child, duplicating stdout
3013 cases (not blocking stdin for the child, duplicating stdout
3009 without blocking, etc). The new %sc/%sx still do capture to these
3014 without blocking, etc). The new %sc/%sx still do capture to these
3010 magical list/string objects which make shell use much more
3015 magical list/string objects which make shell use much more
3011 conveninent, so not all is lost.
3016 conveninent, so not all is lost.
3012
3017
3013 XXX - FIX MANUAL for the change above!
3018 XXX - FIX MANUAL for the change above!
3014
3019
3015 (runsource): I copied code.py's runsource() into ipython to modify
3020 (runsource): I copied code.py's runsource() into ipython to modify
3016 it a bit. Now the code object and source to be executed are
3021 it a bit. Now the code object and source to be executed are
3017 stored in ipython. This makes this info accessible to third-party
3022 stored in ipython. This makes this info accessible to third-party
3018 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3023 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
3019 Mantegazza <mantegazza-AT-ill.fr>.
3024 Mantegazza <mantegazza-AT-ill.fr>.
3020
3025
3021 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3026 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3022 history-search via readline (like C-p/C-n). I'd wanted this for a
3027 history-search via readline (like C-p/C-n). I'd wanted this for a
3023 long time, but only recently found out how to do it. For users
3028 long time, but only recently found out how to do it. For users
3024 who already have their ipythonrc files made and want this, just
3029 who already have their ipythonrc files made and want this, just
3025 add:
3030 add:
3026
3031
3027 readline_parse_and_bind "\e[A": history-search-backward
3032 readline_parse_and_bind "\e[A": history-search-backward
3028 readline_parse_and_bind "\e[B": history-search-forward
3033 readline_parse_and_bind "\e[B": history-search-forward
3029
3034
3030 2005-03-18 Fernando Perez <fperez@colorado.edu>
3035 2005-03-18 Fernando Perez <fperez@colorado.edu>
3031
3036
3032 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3037 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3033 LSString and SList classes which allow transparent conversions
3038 LSString and SList classes which allow transparent conversions
3034 between list mode and whitespace-separated string.
3039 between list mode and whitespace-separated string.
3035 (magic_r): Fix recursion problem in %r.
3040 (magic_r): Fix recursion problem in %r.
3036
3041
3037 * IPython/genutils.py (LSString): New class to be used for
3042 * IPython/genutils.py (LSString): New class to be used for
3038 automatic storage of the results of all alias/system calls in _o
3043 automatic storage of the results of all alias/system calls in _o
3039 and _e (stdout/err). These provide a .l/.list attribute which
3044 and _e (stdout/err). These provide a .l/.list attribute which
3040 does automatic splitting on newlines. This means that for most
3045 does automatic splitting on newlines. This means that for most
3041 uses, you'll never need to do capturing of output with %sc/%sx
3046 uses, you'll never need to do capturing of output with %sc/%sx
3042 anymore, since ipython keeps this always done for you. Note that
3047 anymore, since ipython keeps this always done for you. Note that
3043 only the LAST results are stored, the _o/e variables are
3048 only the LAST results are stored, the _o/e variables are
3044 overwritten on each call. If you need to save their contents
3049 overwritten on each call. If you need to save their contents
3045 further, simply bind them to any other name.
3050 further, simply bind them to any other name.
3046
3051
3047 2005-03-17 Fernando Perez <fperez@colorado.edu>
3052 2005-03-17 Fernando Perez <fperez@colorado.edu>
3048
3053
3049 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3054 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3050 prompt namespace handling.
3055 prompt namespace handling.
3051
3056
3052 2005-03-16 Fernando Perez <fperez@colorado.edu>
3057 2005-03-16 Fernando Perez <fperez@colorado.edu>
3053
3058
3054 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3059 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3055 classic prompts to be '>>> ' (final space was missing, and it
3060 classic prompts to be '>>> ' (final space was missing, and it
3056 trips the emacs python mode).
3061 trips the emacs python mode).
3057 (BasePrompt.__str__): Added safe support for dynamic prompt
3062 (BasePrompt.__str__): Added safe support for dynamic prompt
3058 strings. Now you can set your prompt string to be '$x', and the
3063 strings. Now you can set your prompt string to be '$x', and the
3059 value of x will be printed from your interactive namespace. The
3064 value of x will be printed from your interactive namespace. The
3060 interpolation syntax includes the full Itpl support, so
3065 interpolation syntax includes the full Itpl support, so
3061 ${foo()+x+bar()} is a valid prompt string now, and the function
3066 ${foo()+x+bar()} is a valid prompt string now, and the function
3062 calls will be made at runtime.
3067 calls will be made at runtime.
3063
3068
3064 2005-03-15 Fernando Perez <fperez@colorado.edu>
3069 2005-03-15 Fernando Perez <fperez@colorado.edu>
3065
3070
3066 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3071 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3067 avoid name clashes in pylab. %hist still works, it just forwards
3072 avoid name clashes in pylab. %hist still works, it just forwards
3068 the call to %history.
3073 the call to %history.
3069
3074
3070 2005-03-02 *** Released version 0.6.12
3075 2005-03-02 *** Released version 0.6.12
3071
3076
3072 2005-03-02 Fernando Perez <fperez@colorado.edu>
3077 2005-03-02 Fernando Perez <fperez@colorado.edu>
3073
3078
3074 * IPython/iplib.py (handle_magic): log magic calls properly as
3079 * IPython/iplib.py (handle_magic): log magic calls properly as
3075 ipmagic() function calls.
3080 ipmagic() function calls.
3076
3081
3077 * IPython/Magic.py (magic_time): Improved %time to support
3082 * IPython/Magic.py (magic_time): Improved %time to support
3078 statements and provide wall-clock as well as CPU time.
3083 statements and provide wall-clock as well as CPU time.
3079
3084
3080 2005-02-27 Fernando Perez <fperez@colorado.edu>
3085 2005-02-27 Fernando Perez <fperez@colorado.edu>
3081
3086
3082 * IPython/hooks.py: New hooks module, to expose user-modifiable
3087 * IPython/hooks.py: New hooks module, to expose user-modifiable
3083 IPython functionality in a clean manner. For now only the editor
3088 IPython functionality in a clean manner. For now only the editor
3084 hook is actually written, and other thigns which I intend to turn
3089 hook is actually written, and other thigns which I intend to turn
3085 into proper hooks aren't yet there. The display and prefilter
3090 into proper hooks aren't yet there. The display and prefilter
3086 stuff, for example, should be hooks. But at least now the
3091 stuff, for example, should be hooks. But at least now the
3087 framework is in place, and the rest can be moved here with more
3092 framework is in place, and the rest can be moved here with more
3088 time later. IPython had had a .hooks variable for a long time for
3093 time later. IPython had had a .hooks variable for a long time for
3089 this purpose, but I'd never actually used it for anything.
3094 this purpose, but I'd never actually used it for anything.
3090
3095
3091 2005-02-26 Fernando Perez <fperez@colorado.edu>
3096 2005-02-26 Fernando Perez <fperez@colorado.edu>
3092
3097
3093 * IPython/ipmaker.py (make_IPython): make the default ipython
3098 * IPython/ipmaker.py (make_IPython): make the default ipython
3094 directory be called _ipython under win32, to follow more the
3099 directory be called _ipython under win32, to follow more the
3095 naming peculiarities of that platform (where buggy software like
3100 naming peculiarities of that platform (where buggy software like
3096 Visual Sourcesafe breaks with .named directories). Reported by
3101 Visual Sourcesafe breaks with .named directories). Reported by
3097 Ville Vainio.
3102 Ville Vainio.
3098
3103
3099 2005-02-23 Fernando Perez <fperez@colorado.edu>
3104 2005-02-23 Fernando Perez <fperez@colorado.edu>
3100
3105
3101 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3106 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3102 auto_aliases for win32 which were causing problems. Users can
3107 auto_aliases for win32 which were causing problems. Users can
3103 define the ones they personally like.
3108 define the ones they personally like.
3104
3109
3105 2005-02-21 Fernando Perez <fperez@colorado.edu>
3110 2005-02-21 Fernando Perez <fperez@colorado.edu>
3106
3111
3107 * IPython/Magic.py (magic_time): new magic to time execution of
3112 * IPython/Magic.py (magic_time): new magic to time execution of
3108 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3113 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3109
3114
3110 2005-02-19 Fernando Perez <fperez@colorado.edu>
3115 2005-02-19 Fernando Perez <fperez@colorado.edu>
3111
3116
3112 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3117 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3113 into keys (for prompts, for example).
3118 into keys (for prompts, for example).
3114
3119
3115 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3120 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3116 prompts in case users want them. This introduces a small behavior
3121 prompts in case users want them. This introduces a small behavior
3117 change: ipython does not automatically add a space to all prompts
3122 change: ipython does not automatically add a space to all prompts
3118 anymore. To get the old prompts with a space, users should add it
3123 anymore. To get the old prompts with a space, users should add it
3119 manually to their ipythonrc file, so for example prompt_in1 should
3124 manually to their ipythonrc file, so for example prompt_in1 should
3120 now read 'In [\#]: ' instead of 'In [\#]:'.
3125 now read 'In [\#]: ' instead of 'In [\#]:'.
3121 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3126 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3122 file) to control left-padding of secondary prompts.
3127 file) to control left-padding of secondary prompts.
3123
3128
3124 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3129 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3125 the profiler can't be imported. Fix for Debian, which removed
3130 the profiler can't be imported. Fix for Debian, which removed
3126 profile.py because of License issues. I applied a slightly
3131 profile.py because of License issues. I applied a slightly
3127 modified version of the original Debian patch at
3132 modified version of the original Debian patch at
3128 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3133 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3129
3134
3130 2005-02-17 Fernando Perez <fperez@colorado.edu>
3135 2005-02-17 Fernando Perez <fperez@colorado.edu>
3131
3136
3132 * IPython/genutils.py (native_line_ends): Fix bug which would
3137 * IPython/genutils.py (native_line_ends): Fix bug which would
3133 cause improper line-ends under win32 b/c I was not opening files
3138 cause improper line-ends under win32 b/c I was not opening files
3134 in binary mode. Bug report and fix thanks to Ville.
3139 in binary mode. Bug report and fix thanks to Ville.
3135
3140
3136 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3141 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3137 trying to catch spurious foo[1] autocalls. My fix actually broke
3142 trying to catch spurious foo[1] autocalls. My fix actually broke
3138 ',/' autoquote/call with explicit escape (bad regexp).
3143 ',/' autoquote/call with explicit escape (bad regexp).
3139
3144
3140 2005-02-15 *** Released version 0.6.11
3145 2005-02-15 *** Released version 0.6.11
3141
3146
3142 2005-02-14 Fernando Perez <fperez@colorado.edu>
3147 2005-02-14 Fernando Perez <fperez@colorado.edu>
3143
3148
3144 * IPython/background_jobs.py: New background job management
3149 * IPython/background_jobs.py: New background job management
3145 subsystem. This is implemented via a new set of classes, and
3150 subsystem. This is implemented via a new set of classes, and
3146 IPython now provides a builtin 'jobs' object for background job
3151 IPython now provides a builtin 'jobs' object for background job
3147 execution. A convenience %bg magic serves as a lightweight
3152 execution. A convenience %bg magic serves as a lightweight
3148 frontend for starting the more common type of calls. This was
3153 frontend for starting the more common type of calls. This was
3149 inspired by discussions with B. Granger and the BackgroundCommand
3154 inspired by discussions with B. Granger and the BackgroundCommand
3150 class described in the book Python Scripting for Computational
3155 class described in the book Python Scripting for Computational
3151 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3156 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3152 (although ultimately no code from this text was used, as IPython's
3157 (although ultimately no code from this text was used, as IPython's
3153 system is a separate implementation).
3158 system is a separate implementation).
3154
3159
3155 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3160 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3156 to control the completion of single/double underscore names
3161 to control the completion of single/double underscore names
3157 separately. As documented in the example ipytonrc file, the
3162 separately. As documented in the example ipytonrc file, the
3158 readline_omit__names variable can now be set to 2, to omit even
3163 readline_omit__names variable can now be set to 2, to omit even
3159 single underscore names. Thanks to a patch by Brian Wong
3164 single underscore names. Thanks to a patch by Brian Wong
3160 <BrianWong-AT-AirgoNetworks.Com>.
3165 <BrianWong-AT-AirgoNetworks.Com>.
3161 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3166 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3162 be autocalled as foo([1]) if foo were callable. A problem for
3167 be autocalled as foo([1]) if foo were callable. A problem for
3163 things which are both callable and implement __getitem__.
3168 things which are both callable and implement __getitem__.
3164 (init_readline): Fix autoindentation for win32. Thanks to a patch
3169 (init_readline): Fix autoindentation for win32. Thanks to a patch
3165 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3170 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3166
3171
3167 2005-02-12 Fernando Perez <fperez@colorado.edu>
3172 2005-02-12 Fernando Perez <fperez@colorado.edu>
3168
3173
3169 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3174 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3170 which I had written long ago to sort out user error messages which
3175 which I had written long ago to sort out user error messages which
3171 may occur during startup. This seemed like a good idea initially,
3176 may occur during startup. This seemed like a good idea initially,
3172 but it has proven a disaster in retrospect. I don't want to
3177 but it has proven a disaster in retrospect. I don't want to
3173 change much code for now, so my fix is to set the internal 'debug'
3178 change much code for now, so my fix is to set the internal 'debug'
3174 flag to true everywhere, whose only job was precisely to control
3179 flag to true everywhere, whose only job was precisely to control
3175 this subsystem. This closes issue 28 (as well as avoiding all
3180 this subsystem. This closes issue 28 (as well as avoiding all
3176 sorts of strange hangups which occur from time to time).
3181 sorts of strange hangups which occur from time to time).
3177
3182
3178 2005-02-07 Fernando Perez <fperez@colorado.edu>
3183 2005-02-07 Fernando Perez <fperez@colorado.edu>
3179
3184
3180 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3185 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3181 previous call produced a syntax error.
3186 previous call produced a syntax error.
3182
3187
3183 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3188 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3184 classes without constructor.
3189 classes without constructor.
3185
3190
3186 2005-02-06 Fernando Perez <fperez@colorado.edu>
3191 2005-02-06 Fernando Perez <fperez@colorado.edu>
3187
3192
3188 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3193 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3189 completions with the results of each matcher, so we return results
3194 completions with the results of each matcher, so we return results
3190 to the user from all namespaces. This breaks with ipython
3195 to the user from all namespaces. This breaks with ipython
3191 tradition, but I think it's a nicer behavior. Now you get all
3196 tradition, but I think it's a nicer behavior. Now you get all
3192 possible completions listed, from all possible namespaces (python,
3197 possible completions listed, from all possible namespaces (python,
3193 filesystem, magics...) After a request by John Hunter
3198 filesystem, magics...) After a request by John Hunter
3194 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3199 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3195
3200
3196 2005-02-05 Fernando Perez <fperez@colorado.edu>
3201 2005-02-05 Fernando Perez <fperez@colorado.edu>
3197
3202
3198 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3203 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3199 the call had quote characters in it (the quotes were stripped).
3204 the call had quote characters in it (the quotes were stripped).
3200
3205
3201 2005-01-31 Fernando Perez <fperez@colorado.edu>
3206 2005-01-31 Fernando Perez <fperez@colorado.edu>
3202
3207
3203 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3208 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3204 Itpl.itpl() to make the code more robust against psyco
3209 Itpl.itpl() to make the code more robust against psyco
3205 optimizations.
3210 optimizations.
3206
3211
3207 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3212 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3208 of causing an exception. Quicker, cleaner.
3213 of causing an exception. Quicker, cleaner.
3209
3214
3210 2005-01-28 Fernando Perez <fperez@colorado.edu>
3215 2005-01-28 Fernando Perez <fperez@colorado.edu>
3211
3216
3212 * scripts/ipython_win_post_install.py (install): hardcode
3217 * scripts/ipython_win_post_install.py (install): hardcode
3213 sys.prefix+'python.exe' as the executable path. It turns out that
3218 sys.prefix+'python.exe' as the executable path. It turns out that
3214 during the post-installation run, sys.executable resolves to the
3219 during the post-installation run, sys.executable resolves to the
3215 name of the binary installer! I should report this as a distutils
3220 name of the binary installer! I should report this as a distutils
3216 bug, I think. I updated the .10 release with this tiny fix, to
3221 bug, I think. I updated the .10 release with this tiny fix, to
3217 avoid annoying the lists further.
3222 avoid annoying the lists further.
3218
3223
3219 2005-01-27 *** Released version 0.6.10
3224 2005-01-27 *** Released version 0.6.10
3220
3225
3221 2005-01-27 Fernando Perez <fperez@colorado.edu>
3226 2005-01-27 Fernando Perez <fperez@colorado.edu>
3222
3227
3223 * IPython/numutils.py (norm): Added 'inf' as optional name for
3228 * IPython/numutils.py (norm): Added 'inf' as optional name for
3224 L-infinity norm, included references to mathworld.com for vector
3229 L-infinity norm, included references to mathworld.com for vector
3225 norm definitions.
3230 norm definitions.
3226 (amin/amax): added amin/amax for array min/max. Similar to what
3231 (amin/amax): added amin/amax for array min/max. Similar to what
3227 pylab ships with after the recent reorganization of names.
3232 pylab ships with after the recent reorganization of names.
3228 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3233 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3229
3234
3230 * ipython.el: committed Alex's recent fixes and improvements.
3235 * ipython.el: committed Alex's recent fixes and improvements.
3231 Tested with python-mode from CVS, and it looks excellent. Since
3236 Tested with python-mode from CVS, and it looks excellent. Since
3232 python-mode hasn't released anything in a while, I'm temporarily
3237 python-mode hasn't released anything in a while, I'm temporarily
3233 putting a copy of today's CVS (v 4.70) of python-mode in:
3238 putting a copy of today's CVS (v 4.70) of python-mode in:
3234 http://ipython.scipy.org/tmp/python-mode.el
3239 http://ipython.scipy.org/tmp/python-mode.el
3235
3240
3236 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3241 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3237 sys.executable for the executable name, instead of assuming it's
3242 sys.executable for the executable name, instead of assuming it's
3238 called 'python.exe' (the post-installer would have produced broken
3243 called 'python.exe' (the post-installer would have produced broken
3239 setups on systems with a differently named python binary).
3244 setups on systems with a differently named python binary).
3240
3245
3241 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3246 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3242 references to os.linesep, to make the code more
3247 references to os.linesep, to make the code more
3243 platform-independent. This is also part of the win32 coloring
3248 platform-independent. This is also part of the win32 coloring
3244 fixes.
3249 fixes.
3245
3250
3246 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3251 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3247 lines, which actually cause coloring bugs because the length of
3252 lines, which actually cause coloring bugs because the length of
3248 the line is very difficult to correctly compute with embedded
3253 the line is very difficult to correctly compute with embedded
3249 escapes. This was the source of all the coloring problems under
3254 escapes. This was the source of all the coloring problems under
3250 Win32. I think that _finally_, Win32 users have a properly
3255 Win32. I think that _finally_, Win32 users have a properly
3251 working ipython in all respects. This would never have happened
3256 working ipython in all respects. This would never have happened
3252 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3257 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3253
3258
3254 2005-01-26 *** Released version 0.6.9
3259 2005-01-26 *** Released version 0.6.9
3255
3260
3256 2005-01-25 Fernando Perez <fperez@colorado.edu>
3261 2005-01-25 Fernando Perez <fperez@colorado.edu>
3257
3262
3258 * setup.py: finally, we have a true Windows installer, thanks to
3263 * setup.py: finally, we have a true Windows installer, thanks to
3259 the excellent work of Viktor Ransmayr
3264 the excellent work of Viktor Ransmayr
3260 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3265 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3261 Windows users. The setup routine is quite a bit cleaner thanks to
3266 Windows users. The setup routine is quite a bit cleaner thanks to
3262 this, and the post-install script uses the proper functions to
3267 this, and the post-install script uses the proper functions to
3263 allow a clean de-installation using the standard Windows Control
3268 allow a clean de-installation using the standard Windows Control
3264 Panel.
3269 Panel.
3265
3270
3266 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3271 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3267 environment variable under all OSes (including win32) if
3272 environment variable under all OSes (including win32) if
3268 available. This will give consistency to win32 users who have set
3273 available. This will give consistency to win32 users who have set
3269 this variable for any reason. If os.environ['HOME'] fails, the
3274 this variable for any reason. If os.environ['HOME'] fails, the
3270 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3275 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3271
3276
3272 2005-01-24 Fernando Perez <fperez@colorado.edu>
3277 2005-01-24 Fernando Perez <fperez@colorado.edu>
3273
3278
3274 * IPython/numutils.py (empty_like): add empty_like(), similar to
3279 * IPython/numutils.py (empty_like): add empty_like(), similar to
3275 zeros_like() but taking advantage of the new empty() Numeric routine.
3280 zeros_like() but taking advantage of the new empty() Numeric routine.
3276
3281
3277 2005-01-23 *** Released version 0.6.8
3282 2005-01-23 *** Released version 0.6.8
3278
3283
3279 2005-01-22 Fernando Perez <fperez@colorado.edu>
3284 2005-01-22 Fernando Perez <fperez@colorado.edu>
3280
3285
3281 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3286 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3282 automatic show() calls. After discussing things with JDH, it
3287 automatic show() calls. After discussing things with JDH, it
3283 turns out there are too many corner cases where this can go wrong.
3288 turns out there are too many corner cases where this can go wrong.
3284 It's best not to try to be 'too smart', and simply have ipython
3289 It's best not to try to be 'too smart', and simply have ipython
3285 reproduce as much as possible the default behavior of a normal
3290 reproduce as much as possible the default behavior of a normal
3286 python shell.
3291 python shell.
3287
3292
3288 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3293 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3289 line-splitting regexp and _prefilter() to avoid calling getattr()
3294 line-splitting regexp and _prefilter() to avoid calling getattr()
3290 on assignments. This closes
3295 on assignments. This closes
3291 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3296 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3292 readline uses getattr(), so a simple <TAB> keypress is still
3297 readline uses getattr(), so a simple <TAB> keypress is still
3293 enough to trigger getattr() calls on an object.
3298 enough to trigger getattr() calls on an object.
3294
3299
3295 2005-01-21 Fernando Perez <fperez@colorado.edu>
3300 2005-01-21 Fernando Perez <fperez@colorado.edu>
3296
3301
3297 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3302 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3298 docstring under pylab so it doesn't mask the original.
3303 docstring under pylab so it doesn't mask the original.
3299
3304
3300 2005-01-21 *** Released version 0.6.7
3305 2005-01-21 *** Released version 0.6.7
3301
3306
3302 2005-01-21 Fernando Perez <fperez@colorado.edu>
3307 2005-01-21 Fernando Perez <fperez@colorado.edu>
3303
3308
3304 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3309 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3305 signal handling for win32 users in multithreaded mode.
3310 signal handling for win32 users in multithreaded mode.
3306
3311
3307 2005-01-17 Fernando Perez <fperez@colorado.edu>
3312 2005-01-17 Fernando Perez <fperez@colorado.edu>
3308
3313
3309 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3314 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3310 instances with no __init__. After a crash report by Norbert Nemec
3315 instances with no __init__. After a crash report by Norbert Nemec
3311 <Norbert-AT-nemec-online.de>.
3316 <Norbert-AT-nemec-online.de>.
3312
3317
3313 2005-01-14 Fernando Perez <fperez@colorado.edu>
3318 2005-01-14 Fernando Perez <fperez@colorado.edu>
3314
3319
3315 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3320 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3316 names for verbose exceptions, when multiple dotted names and the
3321 names for verbose exceptions, when multiple dotted names and the
3317 'parent' object were present on the same line.
3322 'parent' object were present on the same line.
3318
3323
3319 2005-01-11 Fernando Perez <fperez@colorado.edu>
3324 2005-01-11 Fernando Perez <fperez@colorado.edu>
3320
3325
3321 * IPython/genutils.py (flag_calls): new utility to trap and flag
3326 * IPython/genutils.py (flag_calls): new utility to trap and flag
3322 calls in functions. I need it to clean up matplotlib support.
3327 calls in functions. I need it to clean up matplotlib support.
3323 Also removed some deprecated code in genutils.
3328 Also removed some deprecated code in genutils.
3324
3329
3325 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3330 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3326 that matplotlib scripts called with %run, which don't call show()
3331 that matplotlib scripts called with %run, which don't call show()
3327 themselves, still have their plotting windows open.
3332 themselves, still have their plotting windows open.
3328
3333
3329 2005-01-05 Fernando Perez <fperez@colorado.edu>
3334 2005-01-05 Fernando Perez <fperez@colorado.edu>
3330
3335
3331 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3336 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3332 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3337 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3333
3338
3334 2004-12-19 Fernando Perez <fperez@colorado.edu>
3339 2004-12-19 Fernando Perez <fperez@colorado.edu>
3335
3340
3336 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3341 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3337 parent_runcode, which was an eyesore. The same result can be
3342 parent_runcode, which was an eyesore. The same result can be
3338 obtained with Python's regular superclass mechanisms.
3343 obtained with Python's regular superclass mechanisms.
3339
3344
3340 2004-12-17 Fernando Perez <fperez@colorado.edu>
3345 2004-12-17 Fernando Perez <fperez@colorado.edu>
3341
3346
3342 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3347 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3343 reported by Prabhu.
3348 reported by Prabhu.
3344 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3349 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3345 sys.stderr) instead of explicitly calling sys.stderr. This helps
3350 sys.stderr) instead of explicitly calling sys.stderr. This helps
3346 maintain our I/O abstractions clean, for future GUI embeddings.
3351 maintain our I/O abstractions clean, for future GUI embeddings.
3347
3352
3348 * IPython/genutils.py (info): added new utility for sys.stderr
3353 * IPython/genutils.py (info): added new utility for sys.stderr
3349 unified info message handling (thin wrapper around warn()).
3354 unified info message handling (thin wrapper around warn()).
3350
3355
3351 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3356 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3352 composite (dotted) names on verbose exceptions.
3357 composite (dotted) names on verbose exceptions.
3353 (VerboseTB.nullrepr): harden against another kind of errors which
3358 (VerboseTB.nullrepr): harden against another kind of errors which
3354 Python's inspect module can trigger, and which were crashing
3359 Python's inspect module can trigger, and which were crashing
3355 IPython. Thanks to a report by Marco Lombardi
3360 IPython. Thanks to a report by Marco Lombardi
3356 <mlombard-AT-ma010192.hq.eso.org>.
3361 <mlombard-AT-ma010192.hq.eso.org>.
3357
3362
3358 2004-12-13 *** Released version 0.6.6
3363 2004-12-13 *** Released version 0.6.6
3359
3364
3360 2004-12-12 Fernando Perez <fperez@colorado.edu>
3365 2004-12-12 Fernando Perez <fperez@colorado.edu>
3361
3366
3362 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3367 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3363 generated by pygtk upon initialization if it was built without
3368 generated by pygtk upon initialization if it was built without
3364 threads (for matplotlib users). After a crash reported by
3369 threads (for matplotlib users). After a crash reported by
3365 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3370 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3366
3371
3367 * IPython/ipmaker.py (make_IPython): fix small bug in the
3372 * IPython/ipmaker.py (make_IPython): fix small bug in the
3368 import_some parameter for multiple imports.
3373 import_some parameter for multiple imports.
3369
3374
3370 * IPython/iplib.py (ipmagic): simplified the interface of
3375 * IPython/iplib.py (ipmagic): simplified the interface of
3371 ipmagic() to take a single string argument, just as it would be
3376 ipmagic() to take a single string argument, just as it would be
3372 typed at the IPython cmd line.
3377 typed at the IPython cmd line.
3373 (ipalias): Added new ipalias() with an interface identical to
3378 (ipalias): Added new ipalias() with an interface identical to
3374 ipmagic(). This completes exposing a pure python interface to the
3379 ipmagic(). This completes exposing a pure python interface to the
3375 alias and magic system, which can be used in loops or more complex
3380 alias and magic system, which can be used in loops or more complex
3376 code where IPython's automatic line mangling is not active.
3381 code where IPython's automatic line mangling is not active.
3377
3382
3378 * IPython/genutils.py (timing): changed interface of timing to
3383 * IPython/genutils.py (timing): changed interface of timing to
3379 simply run code once, which is the most common case. timings()
3384 simply run code once, which is the most common case. timings()
3380 remains unchanged, for the cases where you want multiple runs.
3385 remains unchanged, for the cases where you want multiple runs.
3381
3386
3382 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3387 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3383 bug where Python2.2 crashes with exec'ing code which does not end
3388 bug where Python2.2 crashes with exec'ing code which does not end
3384 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3389 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3385 before.
3390 before.
3386
3391
3387 2004-12-10 Fernando Perez <fperez@colorado.edu>
3392 2004-12-10 Fernando Perez <fperez@colorado.edu>
3388
3393
3389 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3394 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3390 -t to -T, to accomodate the new -t flag in %run (the %run and
3395 -t to -T, to accomodate the new -t flag in %run (the %run and
3391 %prun options are kind of intermixed, and it's not easy to change
3396 %prun options are kind of intermixed, and it's not easy to change
3392 this with the limitations of python's getopt).
3397 this with the limitations of python's getopt).
3393
3398
3394 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3399 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3395 the execution of scripts. It's not as fine-tuned as timeit.py,
3400 the execution of scripts. It's not as fine-tuned as timeit.py,
3396 but it works from inside ipython (and under 2.2, which lacks
3401 but it works from inside ipython (and under 2.2, which lacks
3397 timeit.py). Optionally a number of runs > 1 can be given for
3402 timeit.py). Optionally a number of runs > 1 can be given for
3398 timing very short-running code.
3403 timing very short-running code.
3399
3404
3400 * IPython/genutils.py (uniq_stable): new routine which returns a
3405 * IPython/genutils.py (uniq_stable): new routine which returns a
3401 list of unique elements in any iterable, but in stable order of
3406 list of unique elements in any iterable, but in stable order of
3402 appearance. I needed this for the ultraTB fixes, and it's a handy
3407 appearance. I needed this for the ultraTB fixes, and it's a handy
3403 utility.
3408 utility.
3404
3409
3405 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3410 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3406 dotted names in Verbose exceptions. This had been broken since
3411 dotted names in Verbose exceptions. This had been broken since
3407 the very start, now x.y will properly be printed in a Verbose
3412 the very start, now x.y will properly be printed in a Verbose
3408 traceback, instead of x being shown and y appearing always as an
3413 traceback, instead of x being shown and y appearing always as an
3409 'undefined global'. Getting this to work was a bit tricky,
3414 'undefined global'. Getting this to work was a bit tricky,
3410 because by default python tokenizers are stateless. Saved by
3415 because by default python tokenizers are stateless. Saved by
3411 python's ability to easily add a bit of state to an arbitrary
3416 python's ability to easily add a bit of state to an arbitrary
3412 function (without needing to build a full-blown callable object).
3417 function (without needing to build a full-blown callable object).
3413
3418
3414 Also big cleanup of this code, which had horrendous runtime
3419 Also big cleanup of this code, which had horrendous runtime
3415 lookups of zillions of attributes for colorization. Moved all
3420 lookups of zillions of attributes for colorization. Moved all
3416 this code into a few templates, which make it cleaner and quicker.
3421 this code into a few templates, which make it cleaner and quicker.
3417
3422
3418 Printout quality was also improved for Verbose exceptions: one
3423 Printout quality was also improved for Verbose exceptions: one
3419 variable per line, and memory addresses are printed (this can be
3424 variable per line, and memory addresses are printed (this can be
3420 quite handy in nasty debugging situations, which is what Verbose
3425 quite handy in nasty debugging situations, which is what Verbose
3421 is for).
3426 is for).
3422
3427
3423 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3428 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3424 the command line as scripts to be loaded by embedded instances.
3429 the command line as scripts to be loaded by embedded instances.
3425 Doing so has the potential for an infinite recursion if there are
3430 Doing so has the potential for an infinite recursion if there are
3426 exceptions thrown in the process. This fixes a strange crash
3431 exceptions thrown in the process. This fixes a strange crash
3427 reported by Philippe MULLER <muller-AT-irit.fr>.
3432 reported by Philippe MULLER <muller-AT-irit.fr>.
3428
3433
3429 2004-12-09 Fernando Perez <fperez@colorado.edu>
3434 2004-12-09 Fernando Perez <fperez@colorado.edu>
3430
3435
3431 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3436 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3432 to reflect new names in matplotlib, which now expose the
3437 to reflect new names in matplotlib, which now expose the
3433 matlab-compatible interface via a pylab module instead of the
3438 matlab-compatible interface via a pylab module instead of the
3434 'matlab' name. The new code is backwards compatible, so users of
3439 'matlab' name. The new code is backwards compatible, so users of
3435 all matplotlib versions are OK. Patch by J. Hunter.
3440 all matplotlib versions are OK. Patch by J. Hunter.
3436
3441
3437 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3442 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3438 of __init__ docstrings for instances (class docstrings are already
3443 of __init__ docstrings for instances (class docstrings are already
3439 automatically printed). Instances with customized docstrings
3444 automatically printed). Instances with customized docstrings
3440 (indep. of the class) are also recognized and all 3 separate
3445 (indep. of the class) are also recognized and all 3 separate
3441 docstrings are printed (instance, class, constructor). After some
3446 docstrings are printed (instance, class, constructor). After some
3442 comments/suggestions by J. Hunter.
3447 comments/suggestions by J. Hunter.
3443
3448
3444 2004-12-05 Fernando Perez <fperez@colorado.edu>
3449 2004-12-05 Fernando Perez <fperez@colorado.edu>
3445
3450
3446 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3451 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3447 warnings when tab-completion fails and triggers an exception.
3452 warnings when tab-completion fails and triggers an exception.
3448
3453
3449 2004-12-03 Fernando Perez <fperez@colorado.edu>
3454 2004-12-03 Fernando Perez <fperez@colorado.edu>
3450
3455
3451 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3456 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3452 be triggered when using 'run -p'. An incorrect option flag was
3457 be triggered when using 'run -p'. An incorrect option flag was
3453 being set ('d' instead of 'D').
3458 being set ('d' instead of 'D').
3454 (manpage): fix missing escaped \- sign.
3459 (manpage): fix missing escaped \- sign.
3455
3460
3456 2004-11-30 *** Released version 0.6.5
3461 2004-11-30 *** Released version 0.6.5
3457
3462
3458 2004-11-30 Fernando Perez <fperez@colorado.edu>
3463 2004-11-30 Fernando Perez <fperez@colorado.edu>
3459
3464
3460 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3465 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3461 setting with -d option.
3466 setting with -d option.
3462
3467
3463 * setup.py (docfiles): Fix problem where the doc glob I was using
3468 * setup.py (docfiles): Fix problem where the doc glob I was using
3464 was COMPLETELY BROKEN. It was giving the right files by pure
3469 was COMPLETELY BROKEN. It was giving the right files by pure
3465 accident, but failed once I tried to include ipython.el. Note:
3470 accident, but failed once I tried to include ipython.el. Note:
3466 glob() does NOT allow you to do exclusion on multiple endings!
3471 glob() does NOT allow you to do exclusion on multiple endings!
3467
3472
3468 2004-11-29 Fernando Perez <fperez@colorado.edu>
3473 2004-11-29 Fernando Perez <fperez@colorado.edu>
3469
3474
3470 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3475 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3471 the manpage as the source. Better formatting & consistency.
3476 the manpage as the source. Better formatting & consistency.
3472
3477
3473 * IPython/Magic.py (magic_run): Added new -d option, to run
3478 * IPython/Magic.py (magic_run): Added new -d option, to run
3474 scripts under the control of the python pdb debugger. Note that
3479 scripts under the control of the python pdb debugger. Note that
3475 this required changing the %prun option -d to -D, to avoid a clash
3480 this required changing the %prun option -d to -D, to avoid a clash
3476 (since %run must pass options to %prun, and getopt is too dumb to
3481 (since %run must pass options to %prun, and getopt is too dumb to
3477 handle options with string values with embedded spaces). Thanks
3482 handle options with string values with embedded spaces). Thanks
3478 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3483 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3479 (magic_who_ls): added type matching to %who and %whos, so that one
3484 (magic_who_ls): added type matching to %who and %whos, so that one
3480 can filter their output to only include variables of certain
3485 can filter their output to only include variables of certain
3481 types. Another suggestion by Matthew.
3486 types. Another suggestion by Matthew.
3482 (magic_whos): Added memory summaries in kb and Mb for arrays.
3487 (magic_whos): Added memory summaries in kb and Mb for arrays.
3483 (magic_who): Improve formatting (break lines every 9 vars).
3488 (magic_who): Improve formatting (break lines every 9 vars).
3484
3489
3485 2004-11-28 Fernando Perez <fperez@colorado.edu>
3490 2004-11-28 Fernando Perez <fperez@colorado.edu>
3486
3491
3487 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3492 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3488 cache when empty lines were present.
3493 cache when empty lines were present.
3489
3494
3490 2004-11-24 Fernando Perez <fperez@colorado.edu>
3495 2004-11-24 Fernando Perez <fperez@colorado.edu>
3491
3496
3492 * IPython/usage.py (__doc__): document the re-activated threading
3497 * IPython/usage.py (__doc__): document the re-activated threading
3493 options for WX and GTK.
3498 options for WX and GTK.
3494
3499
3495 2004-11-23 Fernando Perez <fperez@colorado.edu>
3500 2004-11-23 Fernando Perez <fperez@colorado.edu>
3496
3501
3497 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3502 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3498 the -wthread and -gthread options, along with a new -tk one to try
3503 the -wthread and -gthread options, along with a new -tk one to try
3499 and coordinate Tk threading with wx/gtk. The tk support is very
3504 and coordinate Tk threading with wx/gtk. The tk support is very
3500 platform dependent, since it seems to require Tcl and Tk to be
3505 platform dependent, since it seems to require Tcl and Tk to be
3501 built with threads (Fedora1/2 appears NOT to have it, but in
3506 built with threads (Fedora1/2 appears NOT to have it, but in
3502 Prabhu's Debian boxes it works OK). But even with some Tk
3507 Prabhu's Debian boxes it works OK). But even with some Tk
3503 limitations, this is a great improvement.
3508 limitations, this is a great improvement.
3504
3509
3505 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3510 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3506 info in user prompts. Patch by Prabhu.
3511 info in user prompts. Patch by Prabhu.
3507
3512
3508 2004-11-18 Fernando Perez <fperez@colorado.edu>
3513 2004-11-18 Fernando Perez <fperez@colorado.edu>
3509
3514
3510 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3515 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3511 EOFErrors and bail, to avoid infinite loops if a non-terminating
3516 EOFErrors and bail, to avoid infinite loops if a non-terminating
3512 file is fed into ipython. Patch submitted in issue 19 by user,
3517 file is fed into ipython. Patch submitted in issue 19 by user,
3513 many thanks.
3518 many thanks.
3514
3519
3515 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3520 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3516 autoquote/parens in continuation prompts, which can cause lots of
3521 autoquote/parens in continuation prompts, which can cause lots of
3517 problems. Closes roundup issue 20.
3522 problems. Closes roundup issue 20.
3518
3523
3519 2004-11-17 Fernando Perez <fperez@colorado.edu>
3524 2004-11-17 Fernando Perez <fperez@colorado.edu>
3520
3525
3521 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3526 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3522 reported as debian bug #280505. I'm not sure my local changelog
3527 reported as debian bug #280505. I'm not sure my local changelog
3523 entry has the proper debian format (Jack?).
3528 entry has the proper debian format (Jack?).
3524
3529
3525 2004-11-08 *** Released version 0.6.4
3530 2004-11-08 *** Released version 0.6.4
3526
3531
3527 2004-11-08 Fernando Perez <fperez@colorado.edu>
3532 2004-11-08 Fernando Perez <fperez@colorado.edu>
3528
3533
3529 * IPython/iplib.py (init_readline): Fix exit message for Windows
3534 * IPython/iplib.py (init_readline): Fix exit message for Windows
3530 when readline is active. Thanks to a report by Eric Jones
3535 when readline is active. Thanks to a report by Eric Jones
3531 <eric-AT-enthought.com>.
3536 <eric-AT-enthought.com>.
3532
3537
3533 2004-11-07 Fernando Perez <fperez@colorado.edu>
3538 2004-11-07 Fernando Perez <fperez@colorado.edu>
3534
3539
3535 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3540 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3536 sometimes seen by win2k/cygwin users.
3541 sometimes seen by win2k/cygwin users.
3537
3542
3538 2004-11-06 Fernando Perez <fperez@colorado.edu>
3543 2004-11-06 Fernando Perez <fperez@colorado.edu>
3539
3544
3540 * IPython/iplib.py (interact): Change the handling of %Exit from
3545 * IPython/iplib.py (interact): Change the handling of %Exit from
3541 trying to propagate a SystemExit to an internal ipython flag.
3546 trying to propagate a SystemExit to an internal ipython flag.
3542 This is less elegant than using Python's exception mechanism, but
3547 This is less elegant than using Python's exception mechanism, but
3543 I can't get that to work reliably with threads, so under -pylab
3548 I can't get that to work reliably with threads, so under -pylab
3544 %Exit was hanging IPython. Cross-thread exception handling is
3549 %Exit was hanging IPython. Cross-thread exception handling is
3545 really a bitch. Thaks to a bug report by Stephen Walton
3550 really a bitch. Thaks to a bug report by Stephen Walton
3546 <stephen.walton-AT-csun.edu>.
3551 <stephen.walton-AT-csun.edu>.
3547
3552
3548 2004-11-04 Fernando Perez <fperez@colorado.edu>
3553 2004-11-04 Fernando Perez <fperez@colorado.edu>
3549
3554
3550 * IPython/iplib.py (raw_input_original): store a pointer to the
3555 * IPython/iplib.py (raw_input_original): store a pointer to the
3551 true raw_input to harden against code which can modify it
3556 true raw_input to harden against code which can modify it
3552 (wx.py.PyShell does this and would otherwise crash ipython).
3557 (wx.py.PyShell does this and would otherwise crash ipython).
3553 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3558 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3554
3559
3555 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3560 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3556 Ctrl-C problem, which does not mess up the input line.
3561 Ctrl-C problem, which does not mess up the input line.
3557
3562
3558 2004-11-03 Fernando Perez <fperez@colorado.edu>
3563 2004-11-03 Fernando Perez <fperez@colorado.edu>
3559
3564
3560 * IPython/Release.py: Changed licensing to BSD, in all files.
3565 * IPython/Release.py: Changed licensing to BSD, in all files.
3561 (name): lowercase name for tarball/RPM release.
3566 (name): lowercase name for tarball/RPM release.
3562
3567
3563 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3568 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3564 use throughout ipython.
3569 use throughout ipython.
3565
3570
3566 * IPython/Magic.py (Magic._ofind): Switch to using the new
3571 * IPython/Magic.py (Magic._ofind): Switch to using the new
3567 OInspect.getdoc() function.
3572 OInspect.getdoc() function.
3568
3573
3569 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3574 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3570 of the line currently being canceled via Ctrl-C. It's extremely
3575 of the line currently being canceled via Ctrl-C. It's extremely
3571 ugly, but I don't know how to do it better (the problem is one of
3576 ugly, but I don't know how to do it better (the problem is one of
3572 handling cross-thread exceptions).
3577 handling cross-thread exceptions).
3573
3578
3574 2004-10-28 Fernando Perez <fperez@colorado.edu>
3579 2004-10-28 Fernando Perez <fperez@colorado.edu>
3575
3580
3576 * IPython/Shell.py (signal_handler): add signal handlers to trap
3581 * IPython/Shell.py (signal_handler): add signal handlers to trap
3577 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3582 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3578 report by Francesc Alted.
3583 report by Francesc Alted.
3579
3584
3580 2004-10-21 Fernando Perez <fperez@colorado.edu>
3585 2004-10-21 Fernando Perez <fperez@colorado.edu>
3581
3586
3582 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3587 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3583 to % for pysh syntax extensions.
3588 to % for pysh syntax extensions.
3584
3589
3585 2004-10-09 Fernando Perez <fperez@colorado.edu>
3590 2004-10-09 Fernando Perez <fperez@colorado.edu>
3586
3591
3587 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3592 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3588 arrays to print a more useful summary, without calling str(arr).
3593 arrays to print a more useful summary, without calling str(arr).
3589 This avoids the problem of extremely lengthy computations which
3594 This avoids the problem of extremely lengthy computations which
3590 occur if arr is large, and appear to the user as a system lockup
3595 occur if arr is large, and appear to the user as a system lockup
3591 with 100% cpu activity. After a suggestion by Kristian Sandberg
3596 with 100% cpu activity. After a suggestion by Kristian Sandberg
3592 <Kristian.Sandberg@colorado.edu>.
3597 <Kristian.Sandberg@colorado.edu>.
3593 (Magic.__init__): fix bug in global magic escapes not being
3598 (Magic.__init__): fix bug in global magic escapes not being
3594 correctly set.
3599 correctly set.
3595
3600
3596 2004-10-08 Fernando Perez <fperez@colorado.edu>
3601 2004-10-08 Fernando Perez <fperez@colorado.edu>
3597
3602
3598 * IPython/Magic.py (__license__): change to absolute imports of
3603 * IPython/Magic.py (__license__): change to absolute imports of
3599 ipython's own internal packages, to start adapting to the absolute
3604 ipython's own internal packages, to start adapting to the absolute
3600 import requirement of PEP-328.
3605 import requirement of PEP-328.
3601
3606
3602 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3607 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3603 files, and standardize author/license marks through the Release
3608 files, and standardize author/license marks through the Release
3604 module instead of having per/file stuff (except for files with
3609 module instead of having per/file stuff (except for files with
3605 particular licenses, like the MIT/PSF-licensed codes).
3610 particular licenses, like the MIT/PSF-licensed codes).
3606
3611
3607 * IPython/Debugger.py: remove dead code for python 2.1
3612 * IPython/Debugger.py: remove dead code for python 2.1
3608
3613
3609 2004-10-04 Fernando Perez <fperez@colorado.edu>
3614 2004-10-04 Fernando Perez <fperez@colorado.edu>
3610
3615
3611 * IPython/iplib.py (ipmagic): New function for accessing magics
3616 * IPython/iplib.py (ipmagic): New function for accessing magics
3612 via a normal python function call.
3617 via a normal python function call.
3613
3618
3614 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3619 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3615 from '@' to '%', to accomodate the new @decorator syntax of python
3620 from '@' to '%', to accomodate the new @decorator syntax of python
3616 2.4.
3621 2.4.
3617
3622
3618 2004-09-29 Fernando Perez <fperez@colorado.edu>
3623 2004-09-29 Fernando Perez <fperez@colorado.edu>
3619
3624
3620 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3625 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3621 matplotlib.use to prevent running scripts which try to switch
3626 matplotlib.use to prevent running scripts which try to switch
3622 interactive backends from within ipython. This will just crash
3627 interactive backends from within ipython. This will just crash
3623 the python interpreter, so we can't allow it (but a detailed error
3628 the python interpreter, so we can't allow it (but a detailed error
3624 is given to the user).
3629 is given to the user).
3625
3630
3626 2004-09-28 Fernando Perez <fperez@colorado.edu>
3631 2004-09-28 Fernando Perez <fperez@colorado.edu>
3627
3632
3628 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3633 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3629 matplotlib-related fixes so that using @run with non-matplotlib
3634 matplotlib-related fixes so that using @run with non-matplotlib
3630 scripts doesn't pop up spurious plot windows. This requires
3635 scripts doesn't pop up spurious plot windows. This requires
3631 matplotlib >= 0.63, where I had to make some changes as well.
3636 matplotlib >= 0.63, where I had to make some changes as well.
3632
3637
3633 * IPython/ipmaker.py (make_IPython): update version requirement to
3638 * IPython/ipmaker.py (make_IPython): update version requirement to
3634 python 2.2.
3639 python 2.2.
3635
3640
3636 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3641 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3637 banner arg for embedded customization.
3642 banner arg for embedded customization.
3638
3643
3639 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3644 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3640 explicit uses of __IP as the IPython's instance name. Now things
3645 explicit uses of __IP as the IPython's instance name. Now things
3641 are properly handled via the shell.name value. The actual code
3646 are properly handled via the shell.name value. The actual code
3642 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3647 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3643 is much better than before. I'll clean things completely when the
3648 is much better than before. I'll clean things completely when the
3644 magic stuff gets a real overhaul.
3649 magic stuff gets a real overhaul.
3645
3650
3646 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3651 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3647 minor changes to debian dir.
3652 minor changes to debian dir.
3648
3653
3649 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3654 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3650 pointer to the shell itself in the interactive namespace even when
3655 pointer to the shell itself in the interactive namespace even when
3651 a user-supplied dict is provided. This is needed for embedding
3656 a user-supplied dict is provided. This is needed for embedding
3652 purposes (found by tests with Michel Sanner).
3657 purposes (found by tests with Michel Sanner).
3653
3658
3654 2004-09-27 Fernando Perez <fperez@colorado.edu>
3659 2004-09-27 Fernando Perez <fperez@colorado.edu>
3655
3660
3656 * IPython/UserConfig/ipythonrc: remove []{} from
3661 * IPython/UserConfig/ipythonrc: remove []{} from
3657 readline_remove_delims, so that things like [modname.<TAB> do
3662 readline_remove_delims, so that things like [modname.<TAB> do
3658 proper completion. This disables [].TAB, but that's a less common
3663 proper completion. This disables [].TAB, but that's a less common
3659 case than module names in list comprehensions, for example.
3664 case than module names in list comprehensions, for example.
3660 Thanks to a report by Andrea Riciputi.
3665 Thanks to a report by Andrea Riciputi.
3661
3666
3662 2004-09-09 Fernando Perez <fperez@colorado.edu>
3667 2004-09-09 Fernando Perez <fperez@colorado.edu>
3663
3668
3664 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3669 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3665 blocking problems in win32 and osx. Fix by John.
3670 blocking problems in win32 and osx. Fix by John.
3666
3671
3667 2004-09-08 Fernando Perez <fperez@colorado.edu>
3672 2004-09-08 Fernando Perez <fperez@colorado.edu>
3668
3673
3669 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3674 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3670 for Win32 and OSX. Fix by John Hunter.
3675 for Win32 and OSX. Fix by John Hunter.
3671
3676
3672 2004-08-30 *** Released version 0.6.3
3677 2004-08-30 *** Released version 0.6.3
3673
3678
3674 2004-08-30 Fernando Perez <fperez@colorado.edu>
3679 2004-08-30 Fernando Perez <fperez@colorado.edu>
3675
3680
3676 * setup.py (isfile): Add manpages to list of dependent files to be
3681 * setup.py (isfile): Add manpages to list of dependent files to be
3677 updated.
3682 updated.
3678
3683
3679 2004-08-27 Fernando Perez <fperez@colorado.edu>
3684 2004-08-27 Fernando Perez <fperez@colorado.edu>
3680
3685
3681 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3686 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3682 for now. They don't really work with standalone WX/GTK code
3687 for now. They don't really work with standalone WX/GTK code
3683 (though matplotlib IS working fine with both of those backends).
3688 (though matplotlib IS working fine with both of those backends).
3684 This will neeed much more testing. I disabled most things with
3689 This will neeed much more testing. I disabled most things with
3685 comments, so turning it back on later should be pretty easy.
3690 comments, so turning it back on later should be pretty easy.
3686
3691
3687 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3692 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3688 autocalling of expressions like r'foo', by modifying the line
3693 autocalling of expressions like r'foo', by modifying the line
3689 split regexp. Closes
3694 split regexp. Closes
3690 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3695 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3691 Riley <ipythonbugs-AT-sabi.net>.
3696 Riley <ipythonbugs-AT-sabi.net>.
3692 (InteractiveShell.mainloop): honor --nobanner with banner
3697 (InteractiveShell.mainloop): honor --nobanner with banner
3693 extensions.
3698 extensions.
3694
3699
3695 * IPython/Shell.py: Significant refactoring of all classes, so
3700 * IPython/Shell.py: Significant refactoring of all classes, so
3696 that we can really support ALL matplotlib backends and threading
3701 that we can really support ALL matplotlib backends and threading
3697 models (John spotted a bug with Tk which required this). Now we
3702 models (John spotted a bug with Tk which required this). Now we
3698 should support single-threaded, WX-threads and GTK-threads, both
3703 should support single-threaded, WX-threads and GTK-threads, both
3699 for generic code and for matplotlib.
3704 for generic code and for matplotlib.
3700
3705
3701 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3706 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3702 -pylab, to simplify things for users. Will also remove the pylab
3707 -pylab, to simplify things for users. Will also remove the pylab
3703 profile, since now all of matplotlib configuration is directly
3708 profile, since now all of matplotlib configuration is directly
3704 handled here. This also reduces startup time.
3709 handled here. This also reduces startup time.
3705
3710
3706 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3711 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3707 shell wasn't being correctly called. Also in IPShellWX.
3712 shell wasn't being correctly called. Also in IPShellWX.
3708
3713
3709 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3714 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3710 fine-tune banner.
3715 fine-tune banner.
3711
3716
3712 * IPython/numutils.py (spike): Deprecate these spike functions,
3717 * IPython/numutils.py (spike): Deprecate these spike functions,
3713 delete (long deprecated) gnuplot_exec handler.
3718 delete (long deprecated) gnuplot_exec handler.
3714
3719
3715 2004-08-26 Fernando Perez <fperez@colorado.edu>
3720 2004-08-26 Fernando Perez <fperez@colorado.edu>
3716
3721
3717 * ipython.1: Update for threading options, plus some others which
3722 * ipython.1: Update for threading options, plus some others which
3718 were missing.
3723 were missing.
3719
3724
3720 * IPython/ipmaker.py (__call__): Added -wthread option for
3725 * IPython/ipmaker.py (__call__): Added -wthread option for
3721 wxpython thread handling. Make sure threading options are only
3726 wxpython thread handling. Make sure threading options are only
3722 valid at the command line.
3727 valid at the command line.
3723
3728
3724 * scripts/ipython: moved shell selection into a factory function
3729 * scripts/ipython: moved shell selection into a factory function
3725 in Shell.py, to keep the starter script to a minimum.
3730 in Shell.py, to keep the starter script to a minimum.
3726
3731
3727 2004-08-25 Fernando Perez <fperez@colorado.edu>
3732 2004-08-25 Fernando Perez <fperez@colorado.edu>
3728
3733
3729 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3734 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3730 John. Along with some recent changes he made to matplotlib, the
3735 John. Along with some recent changes he made to matplotlib, the
3731 next versions of both systems should work very well together.
3736 next versions of both systems should work very well together.
3732
3737
3733 2004-08-24 Fernando Perez <fperez@colorado.edu>
3738 2004-08-24 Fernando Perez <fperez@colorado.edu>
3734
3739
3735 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3740 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3736 tried to switch the profiling to using hotshot, but I'm getting
3741 tried to switch the profiling to using hotshot, but I'm getting
3737 strange errors from prof.runctx() there. I may be misreading the
3742 strange errors from prof.runctx() there. I may be misreading the
3738 docs, but it looks weird. For now the profiling code will
3743 docs, but it looks weird. For now the profiling code will
3739 continue to use the standard profiler.
3744 continue to use the standard profiler.
3740
3745
3741 2004-08-23 Fernando Perez <fperez@colorado.edu>
3746 2004-08-23 Fernando Perez <fperez@colorado.edu>
3742
3747
3743 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3748 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3744 threaded shell, by John Hunter. It's not quite ready yet, but
3749 threaded shell, by John Hunter. It's not quite ready yet, but
3745 close.
3750 close.
3746
3751
3747 2004-08-22 Fernando Perez <fperez@colorado.edu>
3752 2004-08-22 Fernando Perez <fperez@colorado.edu>
3748
3753
3749 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3754 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3750 in Magic and ultraTB.
3755 in Magic and ultraTB.
3751
3756
3752 * ipython.1: document threading options in manpage.
3757 * ipython.1: document threading options in manpage.
3753
3758
3754 * scripts/ipython: Changed name of -thread option to -gthread,
3759 * scripts/ipython: Changed name of -thread option to -gthread,
3755 since this is GTK specific. I want to leave the door open for a
3760 since this is GTK specific. I want to leave the door open for a
3756 -wthread option for WX, which will most likely be necessary. This
3761 -wthread option for WX, which will most likely be necessary. This
3757 change affects usage and ipmaker as well.
3762 change affects usage and ipmaker as well.
3758
3763
3759 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3764 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3760 handle the matplotlib shell issues. Code by John Hunter
3765 handle the matplotlib shell issues. Code by John Hunter
3761 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3766 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3762 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3767 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3763 broken (and disabled for end users) for now, but it puts the
3768 broken (and disabled for end users) for now, but it puts the
3764 infrastructure in place.
3769 infrastructure in place.
3765
3770
3766 2004-08-21 Fernando Perez <fperez@colorado.edu>
3771 2004-08-21 Fernando Perez <fperez@colorado.edu>
3767
3772
3768 * ipythonrc-pylab: Add matplotlib support.
3773 * ipythonrc-pylab: Add matplotlib support.
3769
3774
3770 * matplotlib_config.py: new files for matplotlib support, part of
3775 * matplotlib_config.py: new files for matplotlib support, part of
3771 the pylab profile.
3776 the pylab profile.
3772
3777
3773 * IPython/usage.py (__doc__): documented the threading options.
3778 * IPython/usage.py (__doc__): documented the threading options.
3774
3779
3775 2004-08-20 Fernando Perez <fperez@colorado.edu>
3780 2004-08-20 Fernando Perez <fperez@colorado.edu>
3776
3781
3777 * ipython: Modified the main calling routine to handle the -thread
3782 * ipython: Modified the main calling routine to handle the -thread
3778 and -mpthread options. This needs to be done as a top-level hack,
3783 and -mpthread options. This needs to be done as a top-level hack,
3779 because it determines which class to instantiate for IPython
3784 because it determines which class to instantiate for IPython
3780 itself.
3785 itself.
3781
3786
3782 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3787 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3783 classes to support multithreaded GTK operation without blocking,
3788 classes to support multithreaded GTK operation without blocking,
3784 and matplotlib with all backends. This is a lot of still very
3789 and matplotlib with all backends. This is a lot of still very
3785 experimental code, and threads are tricky. So it may still have a
3790 experimental code, and threads are tricky. So it may still have a
3786 few rough edges... This code owes a lot to
3791 few rough edges... This code owes a lot to
3787 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3792 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3788 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3793 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3789 to John Hunter for all the matplotlib work.
3794 to John Hunter for all the matplotlib work.
3790
3795
3791 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3796 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3792 options for gtk thread and matplotlib support.
3797 options for gtk thread and matplotlib support.
3793
3798
3794 2004-08-16 Fernando Perez <fperez@colorado.edu>
3799 2004-08-16 Fernando Perez <fperez@colorado.edu>
3795
3800
3796 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3801 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3797 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3802 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3798 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3803 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3799
3804
3800 2004-08-11 Fernando Perez <fperez@colorado.edu>
3805 2004-08-11 Fernando Perez <fperez@colorado.edu>
3801
3806
3802 * setup.py (isfile): Fix build so documentation gets updated for
3807 * setup.py (isfile): Fix build so documentation gets updated for
3803 rpms (it was only done for .tgz builds).
3808 rpms (it was only done for .tgz builds).
3804
3809
3805 2004-08-10 Fernando Perez <fperez@colorado.edu>
3810 2004-08-10 Fernando Perez <fperez@colorado.edu>
3806
3811
3807 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3812 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3808
3813
3809 * iplib.py : Silence syntax error exceptions in tab-completion.
3814 * iplib.py : Silence syntax error exceptions in tab-completion.
3810
3815
3811 2004-08-05 Fernando Perez <fperez@colorado.edu>
3816 2004-08-05 Fernando Perez <fperez@colorado.edu>
3812
3817
3813 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3818 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3814 'color off' mark for continuation prompts. This was causing long
3819 'color off' mark for continuation prompts. This was causing long
3815 continuation lines to mis-wrap.
3820 continuation lines to mis-wrap.
3816
3821
3817 2004-08-01 Fernando Perez <fperez@colorado.edu>
3822 2004-08-01 Fernando Perez <fperez@colorado.edu>
3818
3823
3819 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3824 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3820 for building ipython to be a parameter. All this is necessary
3825 for building ipython to be a parameter. All this is necessary
3821 right now to have a multithreaded version, but this insane
3826 right now to have a multithreaded version, but this insane
3822 non-design will be cleaned up soon. For now, it's a hack that
3827 non-design will be cleaned up soon. For now, it's a hack that
3823 works.
3828 works.
3824
3829
3825 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3830 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3826 args in various places. No bugs so far, but it's a dangerous
3831 args in various places. No bugs so far, but it's a dangerous
3827 practice.
3832 practice.
3828
3833
3829 2004-07-31 Fernando Perez <fperez@colorado.edu>
3834 2004-07-31 Fernando Perez <fperez@colorado.edu>
3830
3835
3831 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3836 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3832 fix completion of files with dots in their names under most
3837 fix completion of files with dots in their names under most
3833 profiles (pysh was OK because the completion order is different).
3838 profiles (pysh was OK because the completion order is different).
3834
3839
3835 2004-07-27 Fernando Perez <fperez@colorado.edu>
3840 2004-07-27 Fernando Perez <fperez@colorado.edu>
3836
3841
3837 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3842 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3838 keywords manually, b/c the one in keyword.py was removed in python
3843 keywords manually, b/c the one in keyword.py was removed in python
3839 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3844 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3840 This is NOT a bug under python 2.3 and earlier.
3845 This is NOT a bug under python 2.3 and earlier.
3841
3846
3842 2004-07-26 Fernando Perez <fperez@colorado.edu>
3847 2004-07-26 Fernando Perez <fperez@colorado.edu>
3843
3848
3844 * IPython/ultraTB.py (VerboseTB.text): Add another
3849 * IPython/ultraTB.py (VerboseTB.text): Add another
3845 linecache.checkcache() call to try to prevent inspect.py from
3850 linecache.checkcache() call to try to prevent inspect.py from
3846 crashing under python 2.3. I think this fixes
3851 crashing under python 2.3. I think this fixes
3847 http://www.scipy.net/roundup/ipython/issue17.
3852 http://www.scipy.net/roundup/ipython/issue17.
3848
3853
3849 2004-07-26 *** Released version 0.6.2
3854 2004-07-26 *** Released version 0.6.2
3850
3855
3851 2004-07-26 Fernando Perez <fperez@colorado.edu>
3856 2004-07-26 Fernando Perez <fperez@colorado.edu>
3852
3857
3853 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3858 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3854 fail for any number.
3859 fail for any number.
3855 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3860 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3856 empty bookmarks.
3861 empty bookmarks.
3857
3862
3858 2004-07-26 *** Released version 0.6.1
3863 2004-07-26 *** Released version 0.6.1
3859
3864
3860 2004-07-26 Fernando Perez <fperez@colorado.edu>
3865 2004-07-26 Fernando Perez <fperez@colorado.edu>
3861
3866
3862 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3867 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3863
3868
3864 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3869 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3865 escaping '()[]{}' in filenames.
3870 escaping '()[]{}' in filenames.
3866
3871
3867 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3872 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3868 Python 2.2 users who lack a proper shlex.split.
3873 Python 2.2 users who lack a proper shlex.split.
3869
3874
3870 2004-07-19 Fernando Perez <fperez@colorado.edu>
3875 2004-07-19 Fernando Perez <fperez@colorado.edu>
3871
3876
3872 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3877 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3873 for reading readline's init file. I follow the normal chain:
3878 for reading readline's init file. I follow the normal chain:
3874 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3879 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3875 report by Mike Heeter. This closes
3880 report by Mike Heeter. This closes
3876 http://www.scipy.net/roundup/ipython/issue16.
3881 http://www.scipy.net/roundup/ipython/issue16.
3877
3882
3878 2004-07-18 Fernando Perez <fperez@colorado.edu>
3883 2004-07-18 Fernando Perez <fperez@colorado.edu>
3879
3884
3880 * IPython/iplib.py (__init__): Add better handling of '\' under
3885 * IPython/iplib.py (__init__): Add better handling of '\' under
3881 Win32 for filenames. After a patch by Ville.
3886 Win32 for filenames. After a patch by Ville.
3882
3887
3883 2004-07-17 Fernando Perez <fperez@colorado.edu>
3888 2004-07-17 Fernando Perez <fperez@colorado.edu>
3884
3889
3885 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3890 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3886 autocalling would be triggered for 'foo is bar' if foo is
3891 autocalling would be triggered for 'foo is bar' if foo is
3887 callable. I also cleaned up the autocall detection code to use a
3892 callable. I also cleaned up the autocall detection code to use a
3888 regexp, which is faster. Bug reported by Alexander Schmolck.
3893 regexp, which is faster. Bug reported by Alexander Schmolck.
3889
3894
3890 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3895 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3891 '?' in them would confuse the help system. Reported by Alex
3896 '?' in them would confuse the help system. Reported by Alex
3892 Schmolck.
3897 Schmolck.
3893
3898
3894 2004-07-16 Fernando Perez <fperez@colorado.edu>
3899 2004-07-16 Fernando Perez <fperez@colorado.edu>
3895
3900
3896 * IPython/GnuplotInteractive.py (__all__): added plot2.
3901 * IPython/GnuplotInteractive.py (__all__): added plot2.
3897
3902
3898 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3903 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3899 plotting dictionaries, lists or tuples of 1d arrays.
3904 plotting dictionaries, lists or tuples of 1d arrays.
3900
3905
3901 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3906 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3902 optimizations.
3907 optimizations.
3903
3908
3904 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3909 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3905 the information which was there from Janko's original IPP code:
3910 the information which was there from Janko's original IPP code:
3906
3911
3907 03.05.99 20:53 porto.ifm.uni-kiel.de
3912 03.05.99 20:53 porto.ifm.uni-kiel.de
3908 --Started changelog.
3913 --Started changelog.
3909 --make clear do what it say it does
3914 --make clear do what it say it does
3910 --added pretty output of lines from inputcache
3915 --added pretty output of lines from inputcache
3911 --Made Logger a mixin class, simplifies handling of switches
3916 --Made Logger a mixin class, simplifies handling of switches
3912 --Added own completer class. .string<TAB> expands to last history
3917 --Added own completer class. .string<TAB> expands to last history
3913 line which starts with string. The new expansion is also present
3918 line which starts with string. The new expansion is also present
3914 with Ctrl-r from the readline library. But this shows, who this
3919 with Ctrl-r from the readline library. But this shows, who this
3915 can be done for other cases.
3920 can be done for other cases.
3916 --Added convention that all shell functions should accept a
3921 --Added convention that all shell functions should accept a
3917 parameter_string This opens the door for different behaviour for
3922 parameter_string This opens the door for different behaviour for
3918 each function. @cd is a good example of this.
3923 each function. @cd is a good example of this.
3919
3924
3920 04.05.99 12:12 porto.ifm.uni-kiel.de
3925 04.05.99 12:12 porto.ifm.uni-kiel.de
3921 --added logfile rotation
3926 --added logfile rotation
3922 --added new mainloop method which freezes first the namespace
3927 --added new mainloop method which freezes first the namespace
3923
3928
3924 07.05.99 21:24 porto.ifm.uni-kiel.de
3929 07.05.99 21:24 porto.ifm.uni-kiel.de
3925 --added the docreader classes. Now there is a help system.
3930 --added the docreader classes. Now there is a help system.
3926 -This is only a first try. Currently it's not easy to put new
3931 -This is only a first try. Currently it's not easy to put new
3927 stuff in the indices. But this is the way to go. Info would be
3932 stuff in the indices. But this is the way to go. Info would be
3928 better, but HTML is every where and not everybody has an info
3933 better, but HTML is every where and not everybody has an info
3929 system installed and it's not so easy to change html-docs to info.
3934 system installed and it's not so easy to change html-docs to info.
3930 --added global logfile option
3935 --added global logfile option
3931 --there is now a hook for object inspection method pinfo needs to
3936 --there is now a hook for object inspection method pinfo needs to
3932 be provided for this. Can be reached by two '??'.
3937 be provided for this. Can be reached by two '??'.
3933
3938
3934 08.05.99 20:51 porto.ifm.uni-kiel.de
3939 08.05.99 20:51 porto.ifm.uni-kiel.de
3935 --added a README
3940 --added a README
3936 --bug in rc file. Something has changed so functions in the rc
3941 --bug in rc file. Something has changed so functions in the rc
3937 file need to reference the shell and not self. Not clear if it's a
3942 file need to reference the shell and not self. Not clear if it's a
3938 bug or feature.
3943 bug or feature.
3939 --changed rc file for new behavior
3944 --changed rc file for new behavior
3940
3945
3941 2004-07-15 Fernando Perez <fperez@colorado.edu>
3946 2004-07-15 Fernando Perez <fperez@colorado.edu>
3942
3947
3943 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3948 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3944 cache was falling out of sync in bizarre manners when multi-line
3949 cache was falling out of sync in bizarre manners when multi-line
3945 input was present. Minor optimizations and cleanup.
3950 input was present. Minor optimizations and cleanup.
3946
3951
3947 (Logger): Remove old Changelog info for cleanup. This is the
3952 (Logger): Remove old Changelog info for cleanup. This is the
3948 information which was there from Janko's original code:
3953 information which was there from Janko's original code:
3949
3954
3950 Changes to Logger: - made the default log filename a parameter
3955 Changes to Logger: - made the default log filename a parameter
3951
3956
3952 - put a check for lines beginning with !@? in log(). Needed
3957 - put a check for lines beginning with !@? in log(). Needed
3953 (even if the handlers properly log their lines) for mid-session
3958 (even if the handlers properly log their lines) for mid-session
3954 logging activation to work properly. Without this, lines logged
3959 logging activation to work properly. Without this, lines logged
3955 in mid session, which get read from the cache, would end up
3960 in mid session, which get read from the cache, would end up
3956 'bare' (with !@? in the open) in the log. Now they are caught
3961 'bare' (with !@? in the open) in the log. Now they are caught
3957 and prepended with a #.
3962 and prepended with a #.
3958
3963
3959 * IPython/iplib.py (InteractiveShell.init_readline): added check
3964 * IPython/iplib.py (InteractiveShell.init_readline): added check
3960 in case MagicCompleter fails to be defined, so we don't crash.
3965 in case MagicCompleter fails to be defined, so we don't crash.
3961
3966
3962 2004-07-13 Fernando Perez <fperez@colorado.edu>
3967 2004-07-13 Fernando Perez <fperez@colorado.edu>
3963
3968
3964 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3969 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3965 of EPS if the requested filename ends in '.eps'.
3970 of EPS if the requested filename ends in '.eps'.
3966
3971
3967 2004-07-04 Fernando Perez <fperez@colorado.edu>
3972 2004-07-04 Fernando Perez <fperez@colorado.edu>
3968
3973
3969 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3974 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3970 escaping of quotes when calling the shell.
3975 escaping of quotes when calling the shell.
3971
3976
3972 2004-07-02 Fernando Perez <fperez@colorado.edu>
3977 2004-07-02 Fernando Perez <fperez@colorado.edu>
3973
3978
3974 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3979 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3975 gettext not working because we were clobbering '_'. Fixes
3980 gettext not working because we were clobbering '_'. Fixes
3976 http://www.scipy.net/roundup/ipython/issue6.
3981 http://www.scipy.net/roundup/ipython/issue6.
3977
3982
3978 2004-07-01 Fernando Perez <fperez@colorado.edu>
3983 2004-07-01 Fernando Perez <fperez@colorado.edu>
3979
3984
3980 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3985 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3981 into @cd. Patch by Ville.
3986 into @cd. Patch by Ville.
3982
3987
3983 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3988 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3984 new function to store things after ipmaker runs. Patch by Ville.
3989 new function to store things after ipmaker runs. Patch by Ville.
3985 Eventually this will go away once ipmaker is removed and the class
3990 Eventually this will go away once ipmaker is removed and the class
3986 gets cleaned up, but for now it's ok. Key functionality here is
3991 gets cleaned up, but for now it's ok. Key functionality here is
3987 the addition of the persistent storage mechanism, a dict for
3992 the addition of the persistent storage mechanism, a dict for
3988 keeping data across sessions (for now just bookmarks, but more can
3993 keeping data across sessions (for now just bookmarks, but more can
3989 be implemented later).
3994 be implemented later).
3990
3995
3991 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3996 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3992 persistent across sections. Patch by Ville, I modified it
3997 persistent across sections. Patch by Ville, I modified it
3993 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3998 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3994 added a '-l' option to list all bookmarks.
3999 added a '-l' option to list all bookmarks.
3995
4000
3996 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4001 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3997 center for cleanup. Registered with atexit.register(). I moved
4002 center for cleanup. Registered with atexit.register(). I moved
3998 here the old exit_cleanup(). After a patch by Ville.
4003 here the old exit_cleanup(). After a patch by Ville.
3999
4004
4000 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4005 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4001 characters in the hacked shlex_split for python 2.2.
4006 characters in the hacked shlex_split for python 2.2.
4002
4007
4003 * IPython/iplib.py (file_matches): more fixes to filenames with
4008 * IPython/iplib.py (file_matches): more fixes to filenames with
4004 whitespace in them. It's not perfect, but limitations in python's
4009 whitespace in them. It's not perfect, but limitations in python's
4005 readline make it impossible to go further.
4010 readline make it impossible to go further.
4006
4011
4007 2004-06-29 Fernando Perez <fperez@colorado.edu>
4012 2004-06-29 Fernando Perez <fperez@colorado.edu>
4008
4013
4009 * IPython/iplib.py (file_matches): escape whitespace correctly in
4014 * IPython/iplib.py (file_matches): escape whitespace correctly in
4010 filename completions. Bug reported by Ville.
4015 filename completions. Bug reported by Ville.
4011
4016
4012 2004-06-28 Fernando Perez <fperez@colorado.edu>
4017 2004-06-28 Fernando Perez <fperez@colorado.edu>
4013
4018
4014 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4019 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4015 the history file will be called 'history-PROFNAME' (or just
4020 the history file will be called 'history-PROFNAME' (or just
4016 'history' if no profile is loaded). I was getting annoyed at
4021 'history' if no profile is loaded). I was getting annoyed at
4017 getting my Numerical work history clobbered by pysh sessions.
4022 getting my Numerical work history clobbered by pysh sessions.
4018
4023
4019 * IPython/iplib.py (InteractiveShell.__init__): Internal
4024 * IPython/iplib.py (InteractiveShell.__init__): Internal
4020 getoutputerror() function so that we can honor the system_verbose
4025 getoutputerror() function so that we can honor the system_verbose
4021 flag for _all_ system calls. I also added escaping of #
4026 flag for _all_ system calls. I also added escaping of #
4022 characters here to avoid confusing Itpl.
4027 characters here to avoid confusing Itpl.
4023
4028
4024 * IPython/Magic.py (shlex_split): removed call to shell in
4029 * IPython/Magic.py (shlex_split): removed call to shell in
4025 parse_options and replaced it with shlex.split(). The annoying
4030 parse_options and replaced it with shlex.split(). The annoying
4026 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4031 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4027 to backport it from 2.3, with several frail hacks (the shlex
4032 to backport it from 2.3, with several frail hacks (the shlex
4028 module is rather limited in 2.2). Thanks to a suggestion by Ville
4033 module is rather limited in 2.2). Thanks to a suggestion by Ville
4029 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4034 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4030 problem.
4035 problem.
4031
4036
4032 (Magic.magic_system_verbose): new toggle to print the actual
4037 (Magic.magic_system_verbose): new toggle to print the actual
4033 system calls made by ipython. Mainly for debugging purposes.
4038 system calls made by ipython. Mainly for debugging purposes.
4034
4039
4035 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4040 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4036 doesn't support persistence. Reported (and fix suggested) by
4041 doesn't support persistence. Reported (and fix suggested) by
4037 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4042 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4038
4043
4039 2004-06-26 Fernando Perez <fperez@colorado.edu>
4044 2004-06-26 Fernando Perez <fperez@colorado.edu>
4040
4045
4041 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4046 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4042 continue prompts.
4047 continue prompts.
4043
4048
4044 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4049 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4045 function (basically a big docstring) and a few more things here to
4050 function (basically a big docstring) and a few more things here to
4046 speedup startup. pysh.py is now very lightweight. We want because
4051 speedup startup. pysh.py is now very lightweight. We want because
4047 it gets execfile'd, while InterpreterExec gets imported, so
4052 it gets execfile'd, while InterpreterExec gets imported, so
4048 byte-compilation saves time.
4053 byte-compilation saves time.
4049
4054
4050 2004-06-25 Fernando Perez <fperez@colorado.edu>
4055 2004-06-25 Fernando Perez <fperez@colorado.edu>
4051
4056
4052 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4057 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4053 -NUM', which was recently broken.
4058 -NUM', which was recently broken.
4054
4059
4055 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4060 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4056 in multi-line input (but not !!, which doesn't make sense there).
4061 in multi-line input (but not !!, which doesn't make sense there).
4057
4062
4058 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4063 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4059 It's just too useful, and people can turn it off in the less
4064 It's just too useful, and people can turn it off in the less
4060 common cases where it's a problem.
4065 common cases where it's a problem.
4061
4066
4062 2004-06-24 Fernando Perez <fperez@colorado.edu>
4067 2004-06-24 Fernando Perez <fperez@colorado.edu>
4063
4068
4064 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4069 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4065 special syntaxes (like alias calling) is now allied in multi-line
4070 special syntaxes (like alias calling) is now allied in multi-line
4066 input. This is still _very_ experimental, but it's necessary for
4071 input. This is still _very_ experimental, but it's necessary for
4067 efficient shell usage combining python looping syntax with system
4072 efficient shell usage combining python looping syntax with system
4068 calls. For now it's restricted to aliases, I don't think it
4073 calls. For now it's restricted to aliases, I don't think it
4069 really even makes sense to have this for magics.
4074 really even makes sense to have this for magics.
4070
4075
4071 2004-06-23 Fernando Perez <fperez@colorado.edu>
4076 2004-06-23 Fernando Perez <fperez@colorado.edu>
4072
4077
4073 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4078 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4074 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4079 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4075
4080
4076 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4081 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4077 extensions under Windows (after code sent by Gary Bishop). The
4082 extensions under Windows (after code sent by Gary Bishop). The
4078 extensions considered 'executable' are stored in IPython's rc
4083 extensions considered 'executable' are stored in IPython's rc
4079 structure as win_exec_ext.
4084 structure as win_exec_ext.
4080
4085
4081 * IPython/genutils.py (shell): new function, like system() but
4086 * IPython/genutils.py (shell): new function, like system() but
4082 without return value. Very useful for interactive shell work.
4087 without return value. Very useful for interactive shell work.
4083
4088
4084 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4089 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4085 delete aliases.
4090 delete aliases.
4086
4091
4087 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4092 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4088 sure that the alias table doesn't contain python keywords.
4093 sure that the alias table doesn't contain python keywords.
4089
4094
4090 2004-06-21 Fernando Perez <fperez@colorado.edu>
4095 2004-06-21 Fernando Perez <fperez@colorado.edu>
4091
4096
4092 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4097 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4093 non-existent items are found in $PATH. Reported by Thorsten.
4098 non-existent items are found in $PATH. Reported by Thorsten.
4094
4099
4095 2004-06-20 Fernando Perez <fperez@colorado.edu>
4100 2004-06-20 Fernando Perez <fperez@colorado.edu>
4096
4101
4097 * IPython/iplib.py (complete): modified the completer so that the
4102 * IPython/iplib.py (complete): modified the completer so that the
4098 order of priorities can be easily changed at runtime.
4103 order of priorities can be easily changed at runtime.
4099
4104
4100 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4105 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4101 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4106 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4102
4107
4103 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4108 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4104 expand Python variables prepended with $ in all system calls. The
4109 expand Python variables prepended with $ in all system calls. The
4105 same was done to InteractiveShell.handle_shell_escape. Now all
4110 same was done to InteractiveShell.handle_shell_escape. Now all
4106 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4111 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4107 expansion of python variables and expressions according to the
4112 expansion of python variables and expressions according to the
4108 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4113 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4109
4114
4110 Though PEP-215 has been rejected, a similar (but simpler) one
4115 Though PEP-215 has been rejected, a similar (but simpler) one
4111 seems like it will go into Python 2.4, PEP-292 -
4116 seems like it will go into Python 2.4, PEP-292 -
4112 http://www.python.org/peps/pep-0292.html.
4117 http://www.python.org/peps/pep-0292.html.
4113
4118
4114 I'll keep the full syntax of PEP-215, since IPython has since the
4119 I'll keep the full syntax of PEP-215, since IPython has since the
4115 start used Ka-Ping Yee's reference implementation discussed there
4120 start used Ka-Ping Yee's reference implementation discussed there
4116 (Itpl), and I actually like the powerful semantics it offers.
4121 (Itpl), and I actually like the powerful semantics it offers.
4117
4122
4118 In order to access normal shell variables, the $ has to be escaped
4123 In order to access normal shell variables, the $ has to be escaped
4119 via an extra $. For example:
4124 via an extra $. For example:
4120
4125
4121 In [7]: PATH='a python variable'
4126 In [7]: PATH='a python variable'
4122
4127
4123 In [8]: !echo $PATH
4128 In [8]: !echo $PATH
4124 a python variable
4129 a python variable
4125
4130
4126 In [9]: !echo $$PATH
4131 In [9]: !echo $$PATH
4127 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4132 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4128
4133
4129 (Magic.parse_options): escape $ so the shell doesn't evaluate
4134 (Magic.parse_options): escape $ so the shell doesn't evaluate
4130 things prematurely.
4135 things prematurely.
4131
4136
4132 * IPython/iplib.py (InteractiveShell.call_alias): added the
4137 * IPython/iplib.py (InteractiveShell.call_alias): added the
4133 ability for aliases to expand python variables via $.
4138 ability for aliases to expand python variables via $.
4134
4139
4135 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4140 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4136 system, now there's a @rehash/@rehashx pair of magics. These work
4141 system, now there's a @rehash/@rehashx pair of magics. These work
4137 like the csh rehash command, and can be invoked at any time. They
4142 like the csh rehash command, and can be invoked at any time. They
4138 build a table of aliases to everything in the user's $PATH
4143 build a table of aliases to everything in the user's $PATH
4139 (@rehash uses everything, @rehashx is slower but only adds
4144 (@rehash uses everything, @rehashx is slower but only adds
4140 executable files). With this, the pysh.py-based shell profile can
4145 executable files). With this, the pysh.py-based shell profile can
4141 now simply call rehash upon startup, and full access to all
4146 now simply call rehash upon startup, and full access to all
4142 programs in the user's path is obtained.
4147 programs in the user's path is obtained.
4143
4148
4144 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4149 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4145 functionality is now fully in place. I removed the old dynamic
4150 functionality is now fully in place. I removed the old dynamic
4146 code generation based approach, in favor of a much lighter one
4151 code generation based approach, in favor of a much lighter one
4147 based on a simple dict. The advantage is that this allows me to
4152 based on a simple dict. The advantage is that this allows me to
4148 now have thousands of aliases with negligible cost (unthinkable
4153 now have thousands of aliases with negligible cost (unthinkable
4149 with the old system).
4154 with the old system).
4150
4155
4151 2004-06-19 Fernando Perez <fperez@colorado.edu>
4156 2004-06-19 Fernando Perez <fperez@colorado.edu>
4152
4157
4153 * IPython/iplib.py (__init__): extended MagicCompleter class to
4158 * IPython/iplib.py (__init__): extended MagicCompleter class to
4154 also complete (last in priority) on user aliases.
4159 also complete (last in priority) on user aliases.
4155
4160
4156 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4161 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4157 call to eval.
4162 call to eval.
4158 (ItplNS.__init__): Added a new class which functions like Itpl,
4163 (ItplNS.__init__): Added a new class which functions like Itpl,
4159 but allows configuring the namespace for the evaluation to occur
4164 but allows configuring the namespace for the evaluation to occur
4160 in.
4165 in.
4161
4166
4162 2004-06-18 Fernando Perez <fperez@colorado.edu>
4167 2004-06-18 Fernando Perez <fperez@colorado.edu>
4163
4168
4164 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4169 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4165 better message when 'exit' or 'quit' are typed (a common newbie
4170 better message when 'exit' or 'quit' are typed (a common newbie
4166 confusion).
4171 confusion).
4167
4172
4168 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4173 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4169 check for Windows users.
4174 check for Windows users.
4170
4175
4171 * IPython/iplib.py (InteractiveShell.user_setup): removed
4176 * IPython/iplib.py (InteractiveShell.user_setup): removed
4172 disabling of colors for Windows. I'll test at runtime and issue a
4177 disabling of colors for Windows. I'll test at runtime and issue a
4173 warning if Gary's readline isn't found, as to nudge users to
4178 warning if Gary's readline isn't found, as to nudge users to
4174 download it.
4179 download it.
4175
4180
4176 2004-06-16 Fernando Perez <fperez@colorado.edu>
4181 2004-06-16 Fernando Perez <fperez@colorado.edu>
4177
4182
4178 * IPython/genutils.py (Stream.__init__): changed to print errors
4183 * IPython/genutils.py (Stream.__init__): changed to print errors
4179 to sys.stderr. I had a circular dependency here. Now it's
4184 to sys.stderr. I had a circular dependency here. Now it's
4180 possible to run ipython as IDLE's shell (consider this pre-alpha,
4185 possible to run ipython as IDLE's shell (consider this pre-alpha,
4181 since true stdout things end up in the starting terminal instead
4186 since true stdout things end up in the starting terminal instead
4182 of IDLE's out).
4187 of IDLE's out).
4183
4188
4184 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4189 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4185 users who haven't # updated their prompt_in2 definitions. Remove
4190 users who haven't # updated their prompt_in2 definitions. Remove
4186 eventually.
4191 eventually.
4187 (multiple_replace): added credit to original ASPN recipe.
4192 (multiple_replace): added credit to original ASPN recipe.
4188
4193
4189 2004-06-15 Fernando Perez <fperez@colorado.edu>
4194 2004-06-15 Fernando Perez <fperez@colorado.edu>
4190
4195
4191 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4196 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4192 list of auto-defined aliases.
4197 list of auto-defined aliases.
4193
4198
4194 2004-06-13 Fernando Perez <fperez@colorado.edu>
4199 2004-06-13 Fernando Perez <fperez@colorado.edu>
4195
4200
4196 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4201 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4197 install was really requested (so setup.py can be used for other
4202 install was really requested (so setup.py can be used for other
4198 things under Windows).
4203 things under Windows).
4199
4204
4200 2004-06-10 Fernando Perez <fperez@colorado.edu>
4205 2004-06-10 Fernando Perez <fperez@colorado.edu>
4201
4206
4202 * IPython/Logger.py (Logger.create_log): Manually remove any old
4207 * IPython/Logger.py (Logger.create_log): Manually remove any old
4203 backup, since os.remove may fail under Windows. Fixes bug
4208 backup, since os.remove may fail under Windows. Fixes bug
4204 reported by Thorsten.
4209 reported by Thorsten.
4205
4210
4206 2004-06-09 Fernando Perez <fperez@colorado.edu>
4211 2004-06-09 Fernando Perez <fperez@colorado.edu>
4207
4212
4208 * examples/example-embed.py: fixed all references to %n (replaced
4213 * examples/example-embed.py: fixed all references to %n (replaced
4209 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4214 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4210 for all examples and the manual as well.
4215 for all examples and the manual as well.
4211
4216
4212 2004-06-08 Fernando Perez <fperez@colorado.edu>
4217 2004-06-08 Fernando Perez <fperez@colorado.edu>
4213
4218
4214 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4219 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4215 alignment and color management. All 3 prompt subsystems now
4220 alignment and color management. All 3 prompt subsystems now
4216 inherit from BasePrompt.
4221 inherit from BasePrompt.
4217
4222
4218 * tools/release: updates for windows installer build and tag rpms
4223 * tools/release: updates for windows installer build and tag rpms
4219 with python version (since paths are fixed).
4224 with python version (since paths are fixed).
4220
4225
4221 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4226 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4222 which will become eventually obsolete. Also fixed the default
4227 which will become eventually obsolete. Also fixed the default
4223 prompt_in2 to use \D, so at least new users start with the correct
4228 prompt_in2 to use \D, so at least new users start with the correct
4224 defaults.
4229 defaults.
4225 WARNING: Users with existing ipythonrc files will need to apply
4230 WARNING: Users with existing ipythonrc files will need to apply
4226 this fix manually!
4231 this fix manually!
4227
4232
4228 * setup.py: make windows installer (.exe). This is finally the
4233 * setup.py: make windows installer (.exe). This is finally the
4229 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4234 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4230 which I hadn't included because it required Python 2.3 (or recent
4235 which I hadn't included because it required Python 2.3 (or recent
4231 distutils).
4236 distutils).
4232
4237
4233 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4238 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4234 usage of new '\D' escape.
4239 usage of new '\D' escape.
4235
4240
4236 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4241 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4237 lacks os.getuid())
4242 lacks os.getuid())
4238 (CachedOutput.set_colors): Added the ability to turn coloring
4243 (CachedOutput.set_colors): Added the ability to turn coloring
4239 on/off with @colors even for manually defined prompt colors. It
4244 on/off with @colors even for manually defined prompt colors. It
4240 uses a nasty global, but it works safely and via the generic color
4245 uses a nasty global, but it works safely and via the generic color
4241 handling mechanism.
4246 handling mechanism.
4242 (Prompt2.__init__): Introduced new escape '\D' for continuation
4247 (Prompt2.__init__): Introduced new escape '\D' for continuation
4243 prompts. It represents the counter ('\#') as dots.
4248 prompts. It represents the counter ('\#') as dots.
4244 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4249 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4245 need to update their ipythonrc files and replace '%n' with '\D' in
4250 need to update their ipythonrc files and replace '%n' with '\D' in
4246 their prompt_in2 settings everywhere. Sorry, but there's
4251 their prompt_in2 settings everywhere. Sorry, but there's
4247 otherwise no clean way to get all prompts to properly align. The
4252 otherwise no clean way to get all prompts to properly align. The
4248 ipythonrc shipped with IPython has been updated.
4253 ipythonrc shipped with IPython has been updated.
4249
4254
4250 2004-06-07 Fernando Perez <fperez@colorado.edu>
4255 2004-06-07 Fernando Perez <fperez@colorado.edu>
4251
4256
4252 * setup.py (isfile): Pass local_icons option to latex2html, so the
4257 * setup.py (isfile): Pass local_icons option to latex2html, so the
4253 resulting HTML file is self-contained. Thanks to
4258 resulting HTML file is self-contained. Thanks to
4254 dryice-AT-liu.com.cn for the tip.
4259 dryice-AT-liu.com.cn for the tip.
4255
4260
4256 * pysh.py: I created a new profile 'shell', which implements a
4261 * pysh.py: I created a new profile 'shell', which implements a
4257 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4262 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4258 system shell, nor will it become one anytime soon. It's mainly
4263 system shell, nor will it become one anytime soon. It's mainly
4259 meant to illustrate the use of the new flexible bash-like prompts.
4264 meant to illustrate the use of the new flexible bash-like prompts.
4260 I guess it could be used by hardy souls for true shell management,
4265 I guess it could be used by hardy souls for true shell management,
4261 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4266 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4262 profile. This uses the InterpreterExec extension provided by
4267 profile. This uses the InterpreterExec extension provided by
4263 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4268 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4264
4269
4265 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4270 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4266 auto-align itself with the length of the previous input prompt
4271 auto-align itself with the length of the previous input prompt
4267 (taking into account the invisible color escapes).
4272 (taking into account the invisible color escapes).
4268 (CachedOutput.__init__): Large restructuring of this class. Now
4273 (CachedOutput.__init__): Large restructuring of this class. Now
4269 all three prompts (primary1, primary2, output) are proper objects,
4274 all three prompts (primary1, primary2, output) are proper objects,
4270 managed by the 'parent' CachedOutput class. The code is still a
4275 managed by the 'parent' CachedOutput class. The code is still a
4271 bit hackish (all prompts share state via a pointer to the cache),
4276 bit hackish (all prompts share state via a pointer to the cache),
4272 but it's overall far cleaner than before.
4277 but it's overall far cleaner than before.
4273
4278
4274 * IPython/genutils.py (getoutputerror): modified to add verbose,
4279 * IPython/genutils.py (getoutputerror): modified to add verbose,
4275 debug and header options. This makes the interface of all getout*
4280 debug and header options. This makes the interface of all getout*
4276 functions uniform.
4281 functions uniform.
4277 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4282 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4278
4283
4279 * IPython/Magic.py (Magic.default_option): added a function to
4284 * IPython/Magic.py (Magic.default_option): added a function to
4280 allow registering default options for any magic command. This
4285 allow registering default options for any magic command. This
4281 makes it easy to have profiles which customize the magics globally
4286 makes it easy to have profiles which customize the magics globally
4282 for a certain use. The values set through this function are
4287 for a certain use. The values set through this function are
4283 picked up by the parse_options() method, which all magics should
4288 picked up by the parse_options() method, which all magics should
4284 use to parse their options.
4289 use to parse their options.
4285
4290
4286 * IPython/genutils.py (warn): modified the warnings framework to
4291 * IPython/genutils.py (warn): modified the warnings framework to
4287 use the Term I/O class. I'm trying to slowly unify all of
4292 use the Term I/O class. I'm trying to slowly unify all of
4288 IPython's I/O operations to pass through Term.
4293 IPython's I/O operations to pass through Term.
4289
4294
4290 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4295 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4291 the secondary prompt to correctly match the length of the primary
4296 the secondary prompt to correctly match the length of the primary
4292 one for any prompt. Now multi-line code will properly line up
4297 one for any prompt. Now multi-line code will properly line up
4293 even for path dependent prompts, such as the new ones available
4298 even for path dependent prompts, such as the new ones available
4294 via the prompt_specials.
4299 via the prompt_specials.
4295
4300
4296 2004-06-06 Fernando Perez <fperez@colorado.edu>
4301 2004-06-06 Fernando Perez <fperez@colorado.edu>
4297
4302
4298 * IPython/Prompts.py (prompt_specials): Added the ability to have
4303 * IPython/Prompts.py (prompt_specials): Added the ability to have
4299 bash-like special sequences in the prompts, which get
4304 bash-like special sequences in the prompts, which get
4300 automatically expanded. Things like hostname, current working
4305 automatically expanded. Things like hostname, current working
4301 directory and username are implemented already, but it's easy to
4306 directory and username are implemented already, but it's easy to
4302 add more in the future. Thanks to a patch by W.J. van der Laan
4307 add more in the future. Thanks to a patch by W.J. van der Laan
4303 <gnufnork-AT-hetdigitalegat.nl>
4308 <gnufnork-AT-hetdigitalegat.nl>
4304 (prompt_specials): Added color support for prompt strings, so
4309 (prompt_specials): Added color support for prompt strings, so
4305 users can define arbitrary color setups for their prompts.
4310 users can define arbitrary color setups for their prompts.
4306
4311
4307 2004-06-05 Fernando Perez <fperez@colorado.edu>
4312 2004-06-05 Fernando Perez <fperez@colorado.edu>
4308
4313
4309 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4314 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4310 code to load Gary Bishop's readline and configure it
4315 code to load Gary Bishop's readline and configure it
4311 automatically. Thanks to Gary for help on this.
4316 automatically. Thanks to Gary for help on this.
4312
4317
4313 2004-06-01 Fernando Perez <fperez@colorado.edu>
4318 2004-06-01 Fernando Perez <fperez@colorado.edu>
4314
4319
4315 * IPython/Logger.py (Logger.create_log): fix bug for logging
4320 * IPython/Logger.py (Logger.create_log): fix bug for logging
4316 with no filename (previous fix was incomplete).
4321 with no filename (previous fix was incomplete).
4317
4322
4318 2004-05-25 Fernando Perez <fperez@colorado.edu>
4323 2004-05-25 Fernando Perez <fperez@colorado.edu>
4319
4324
4320 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4325 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4321 parens would get passed to the shell.
4326 parens would get passed to the shell.
4322
4327
4323 2004-05-20 Fernando Perez <fperez@colorado.edu>
4328 2004-05-20 Fernando Perez <fperez@colorado.edu>
4324
4329
4325 * IPython/Magic.py (Magic.magic_prun): changed default profile
4330 * IPython/Magic.py (Magic.magic_prun): changed default profile
4326 sort order to 'time' (the more common profiling need).
4331 sort order to 'time' (the more common profiling need).
4327
4332
4328 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4333 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4329 so that source code shown is guaranteed in sync with the file on
4334 so that source code shown is guaranteed in sync with the file on
4330 disk (also changed in psource). Similar fix to the one for
4335 disk (also changed in psource). Similar fix to the one for
4331 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4336 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4332 <yann.ledu-AT-noos.fr>.
4337 <yann.ledu-AT-noos.fr>.
4333
4338
4334 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4339 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4335 with a single option would not be correctly parsed. Closes
4340 with a single option would not be correctly parsed. Closes
4336 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4341 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4337 introduced in 0.6.0 (on 2004-05-06).
4342 introduced in 0.6.0 (on 2004-05-06).
4338
4343
4339 2004-05-13 *** Released version 0.6.0
4344 2004-05-13 *** Released version 0.6.0
4340
4345
4341 2004-05-13 Fernando Perez <fperez@colorado.edu>
4346 2004-05-13 Fernando Perez <fperez@colorado.edu>
4342
4347
4343 * debian/: Added debian/ directory to CVS, so that debian support
4348 * debian/: Added debian/ directory to CVS, so that debian support
4344 is publicly accessible. The debian package is maintained by Jack
4349 is publicly accessible. The debian package is maintained by Jack
4345 Moffit <jack-AT-xiph.org>.
4350 Moffit <jack-AT-xiph.org>.
4346
4351
4347 * Documentation: included the notes about an ipython-based system
4352 * Documentation: included the notes about an ipython-based system
4348 shell (the hypothetical 'pysh') into the new_design.pdf document,
4353 shell (the hypothetical 'pysh') into the new_design.pdf document,
4349 so that these ideas get distributed to users along with the
4354 so that these ideas get distributed to users along with the
4350 official documentation.
4355 official documentation.
4351
4356
4352 2004-05-10 Fernando Perez <fperez@colorado.edu>
4357 2004-05-10 Fernando Perez <fperez@colorado.edu>
4353
4358
4354 * IPython/Logger.py (Logger.create_log): fix recently introduced
4359 * IPython/Logger.py (Logger.create_log): fix recently introduced
4355 bug (misindented line) where logstart would fail when not given an
4360 bug (misindented line) where logstart would fail when not given an
4356 explicit filename.
4361 explicit filename.
4357
4362
4358 2004-05-09 Fernando Perez <fperez@colorado.edu>
4363 2004-05-09 Fernando Perez <fperez@colorado.edu>
4359
4364
4360 * IPython/Magic.py (Magic.parse_options): skip system call when
4365 * IPython/Magic.py (Magic.parse_options): skip system call when
4361 there are no options to look for. Faster, cleaner for the common
4366 there are no options to look for. Faster, cleaner for the common
4362 case.
4367 case.
4363
4368
4364 * Documentation: many updates to the manual: describing Windows
4369 * Documentation: many updates to the manual: describing Windows
4365 support better, Gnuplot updates, credits, misc small stuff. Also
4370 support better, Gnuplot updates, credits, misc small stuff. Also
4366 updated the new_design doc a bit.
4371 updated the new_design doc a bit.
4367
4372
4368 2004-05-06 *** Released version 0.6.0.rc1
4373 2004-05-06 *** Released version 0.6.0.rc1
4369
4374
4370 2004-05-06 Fernando Perez <fperez@colorado.edu>
4375 2004-05-06 Fernando Perez <fperez@colorado.edu>
4371
4376
4372 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4377 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4373 operations to use the vastly more efficient list/''.join() method.
4378 operations to use the vastly more efficient list/''.join() method.
4374 (FormattedTB.text): Fix
4379 (FormattedTB.text): Fix
4375 http://www.scipy.net/roundup/ipython/issue12 - exception source
4380 http://www.scipy.net/roundup/ipython/issue12 - exception source
4376 extract not updated after reload. Thanks to Mike Salib
4381 extract not updated after reload. Thanks to Mike Salib
4377 <msalib-AT-mit.edu> for pinning the source of the problem.
4382 <msalib-AT-mit.edu> for pinning the source of the problem.
4378 Fortunately, the solution works inside ipython and doesn't require
4383 Fortunately, the solution works inside ipython and doesn't require
4379 any changes to python proper.
4384 any changes to python proper.
4380
4385
4381 * IPython/Magic.py (Magic.parse_options): Improved to process the
4386 * IPython/Magic.py (Magic.parse_options): Improved to process the
4382 argument list as a true shell would (by actually using the
4387 argument list as a true shell would (by actually using the
4383 underlying system shell). This way, all @magics automatically get
4388 underlying system shell). This way, all @magics automatically get
4384 shell expansion for variables. Thanks to a comment by Alex
4389 shell expansion for variables. Thanks to a comment by Alex
4385 Schmolck.
4390 Schmolck.
4386
4391
4387 2004-04-04 Fernando Perez <fperez@colorado.edu>
4392 2004-04-04 Fernando Perez <fperez@colorado.edu>
4388
4393
4389 * IPython/iplib.py (InteractiveShell.interact): Added a special
4394 * IPython/iplib.py (InteractiveShell.interact): Added a special
4390 trap for a debugger quit exception, which is basically impossible
4395 trap for a debugger quit exception, which is basically impossible
4391 to handle by normal mechanisms, given what pdb does to the stack.
4396 to handle by normal mechanisms, given what pdb does to the stack.
4392 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4397 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4393
4398
4394 2004-04-03 Fernando Perez <fperez@colorado.edu>
4399 2004-04-03 Fernando Perez <fperez@colorado.edu>
4395
4400
4396 * IPython/genutils.py (Term): Standardized the names of the Term
4401 * IPython/genutils.py (Term): Standardized the names of the Term
4397 class streams to cin/cout/cerr, following C++ naming conventions
4402 class streams to cin/cout/cerr, following C++ naming conventions
4398 (I can't use in/out/err because 'in' is not a valid attribute
4403 (I can't use in/out/err because 'in' is not a valid attribute
4399 name).
4404 name).
4400
4405
4401 * IPython/iplib.py (InteractiveShell.interact): don't increment
4406 * IPython/iplib.py (InteractiveShell.interact): don't increment
4402 the prompt if there's no user input. By Daniel 'Dang' Griffith
4407 the prompt if there's no user input. By Daniel 'Dang' Griffith
4403 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4408 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4404 Francois Pinard.
4409 Francois Pinard.
4405
4410
4406 2004-04-02 Fernando Perez <fperez@colorado.edu>
4411 2004-04-02 Fernando Perez <fperez@colorado.edu>
4407
4412
4408 * IPython/genutils.py (Stream.__init__): Modified to survive at
4413 * IPython/genutils.py (Stream.__init__): Modified to survive at
4409 least importing in contexts where stdin/out/err aren't true file
4414 least importing in contexts where stdin/out/err aren't true file
4410 objects, such as PyCrust (they lack fileno() and mode). However,
4415 objects, such as PyCrust (they lack fileno() and mode). However,
4411 the recovery facilities which rely on these things existing will
4416 the recovery facilities which rely on these things existing will
4412 not work.
4417 not work.
4413
4418
4414 2004-04-01 Fernando Perez <fperez@colorado.edu>
4419 2004-04-01 Fernando Perez <fperez@colorado.edu>
4415
4420
4416 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4421 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4417 use the new getoutputerror() function, so it properly
4422 use the new getoutputerror() function, so it properly
4418 distinguishes stdout/err.
4423 distinguishes stdout/err.
4419
4424
4420 * IPython/genutils.py (getoutputerror): added a function to
4425 * IPython/genutils.py (getoutputerror): added a function to
4421 capture separately the standard output and error of a command.
4426 capture separately the standard output and error of a command.
4422 After a comment from dang on the mailing lists. This code is
4427 After a comment from dang on the mailing lists. This code is
4423 basically a modified version of commands.getstatusoutput(), from
4428 basically a modified version of commands.getstatusoutput(), from
4424 the standard library.
4429 the standard library.
4425
4430
4426 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4431 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4427 '!!' as a special syntax (shorthand) to access @sx.
4432 '!!' as a special syntax (shorthand) to access @sx.
4428
4433
4429 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4434 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4430 command and return its output as a list split on '\n'.
4435 command and return its output as a list split on '\n'.
4431
4436
4432 2004-03-31 Fernando Perez <fperez@colorado.edu>
4437 2004-03-31 Fernando Perez <fperez@colorado.edu>
4433
4438
4434 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4439 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4435 method to dictionaries used as FakeModule instances if they lack
4440 method to dictionaries used as FakeModule instances if they lack
4436 it. At least pydoc in python2.3 breaks for runtime-defined
4441 it. At least pydoc in python2.3 breaks for runtime-defined
4437 functions without this hack. At some point I need to _really_
4442 functions without this hack. At some point I need to _really_
4438 understand what FakeModule is doing, because it's a gross hack.
4443 understand what FakeModule is doing, because it's a gross hack.
4439 But it solves Arnd's problem for now...
4444 But it solves Arnd's problem for now...
4440
4445
4441 2004-02-27 Fernando Perez <fperez@colorado.edu>
4446 2004-02-27 Fernando Perez <fperez@colorado.edu>
4442
4447
4443 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4448 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4444 mode would behave erratically. Also increased the number of
4449 mode would behave erratically. Also increased the number of
4445 possible logs in rotate mod to 999. Thanks to Rod Holland
4450 possible logs in rotate mod to 999. Thanks to Rod Holland
4446 <rhh@StructureLABS.com> for the report and fixes.
4451 <rhh@StructureLABS.com> for the report and fixes.
4447
4452
4448 2004-02-26 Fernando Perez <fperez@colorado.edu>
4453 2004-02-26 Fernando Perez <fperez@colorado.edu>
4449
4454
4450 * IPython/genutils.py (page): Check that the curses module really
4455 * IPython/genutils.py (page): Check that the curses module really
4451 has the initscr attribute before trying to use it. For some
4456 has the initscr attribute before trying to use it. For some
4452 reason, the Solaris curses module is missing this. I think this
4457 reason, the Solaris curses module is missing this. I think this
4453 should be considered a Solaris python bug, but I'm not sure.
4458 should be considered a Solaris python bug, but I'm not sure.
4454
4459
4455 2004-01-17 Fernando Perez <fperez@colorado.edu>
4460 2004-01-17 Fernando Perez <fperez@colorado.edu>
4456
4461
4457 * IPython/genutils.py (Stream.__init__): Changes to try to make
4462 * IPython/genutils.py (Stream.__init__): Changes to try to make
4458 ipython robust against stdin/out/err being closed by the user.
4463 ipython robust against stdin/out/err being closed by the user.
4459 This is 'user error' (and blocks a normal python session, at least
4464 This is 'user error' (and blocks a normal python session, at least
4460 the stdout case). However, Ipython should be able to survive such
4465 the stdout case). However, Ipython should be able to survive such
4461 instances of abuse as gracefully as possible. To simplify the
4466 instances of abuse as gracefully as possible. To simplify the
4462 coding and maintain compatibility with Gary Bishop's Term
4467 coding and maintain compatibility with Gary Bishop's Term
4463 contributions, I've made use of classmethods for this. I think
4468 contributions, I've made use of classmethods for this. I think
4464 this introduces a dependency on python 2.2.
4469 this introduces a dependency on python 2.2.
4465
4470
4466 2004-01-13 Fernando Perez <fperez@colorado.edu>
4471 2004-01-13 Fernando Perez <fperez@colorado.edu>
4467
4472
4468 * IPython/numutils.py (exp_safe): simplified the code a bit and
4473 * IPython/numutils.py (exp_safe): simplified the code a bit and
4469 removed the need for importing the kinds module altogether.
4474 removed the need for importing the kinds module altogether.
4470
4475
4471 2004-01-06 Fernando Perez <fperez@colorado.edu>
4476 2004-01-06 Fernando Perez <fperez@colorado.edu>
4472
4477
4473 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4478 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4474 a magic function instead, after some community feedback. No
4479 a magic function instead, after some community feedback. No
4475 special syntax will exist for it, but its name is deliberately
4480 special syntax will exist for it, but its name is deliberately
4476 very short.
4481 very short.
4477
4482
4478 2003-12-20 Fernando Perez <fperez@colorado.edu>
4483 2003-12-20 Fernando Perez <fperez@colorado.edu>
4479
4484
4480 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4485 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4481 new functionality, to automagically assign the result of a shell
4486 new functionality, to automagically assign the result of a shell
4482 command to a variable. I'll solicit some community feedback on
4487 command to a variable. I'll solicit some community feedback on
4483 this before making it permanent.
4488 this before making it permanent.
4484
4489
4485 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4490 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4486 requested about callables for which inspect couldn't obtain a
4491 requested about callables for which inspect couldn't obtain a
4487 proper argspec. Thanks to a crash report sent by Etienne
4492 proper argspec. Thanks to a crash report sent by Etienne
4488 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4493 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4489
4494
4490 2003-12-09 Fernando Perez <fperez@colorado.edu>
4495 2003-12-09 Fernando Perez <fperez@colorado.edu>
4491
4496
4492 * IPython/genutils.py (page): patch for the pager to work across
4497 * IPython/genutils.py (page): patch for the pager to work across
4493 various versions of Windows. By Gary Bishop.
4498 various versions of Windows. By Gary Bishop.
4494
4499
4495 2003-12-04 Fernando Perez <fperez@colorado.edu>
4500 2003-12-04 Fernando Perez <fperez@colorado.edu>
4496
4501
4497 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4502 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4498 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4503 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4499 While I tested this and it looks ok, there may still be corner
4504 While I tested this and it looks ok, there may still be corner
4500 cases I've missed.
4505 cases I've missed.
4501
4506
4502 2003-12-01 Fernando Perez <fperez@colorado.edu>
4507 2003-12-01 Fernando Perez <fperez@colorado.edu>
4503
4508
4504 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4509 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4505 where a line like 'p,q=1,2' would fail because the automagic
4510 where a line like 'p,q=1,2' would fail because the automagic
4506 system would be triggered for @p.
4511 system would be triggered for @p.
4507
4512
4508 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4513 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4509 cleanups, code unmodified.
4514 cleanups, code unmodified.
4510
4515
4511 * IPython/genutils.py (Term): added a class for IPython to handle
4516 * IPython/genutils.py (Term): added a class for IPython to handle
4512 output. In most cases it will just be a proxy for stdout/err, but
4517 output. In most cases it will just be a proxy for stdout/err, but
4513 having this allows modifications to be made for some platforms,
4518 having this allows modifications to be made for some platforms,
4514 such as handling color escapes under Windows. All of this code
4519 such as handling color escapes under Windows. All of this code
4515 was contributed by Gary Bishop, with minor modifications by me.
4520 was contributed by Gary Bishop, with minor modifications by me.
4516 The actual changes affect many files.
4521 The actual changes affect many files.
4517
4522
4518 2003-11-30 Fernando Perez <fperez@colorado.edu>
4523 2003-11-30 Fernando Perez <fperez@colorado.edu>
4519
4524
4520 * IPython/iplib.py (file_matches): new completion code, courtesy
4525 * IPython/iplib.py (file_matches): new completion code, courtesy
4521 of Jeff Collins. This enables filename completion again under
4526 of Jeff Collins. This enables filename completion again under
4522 python 2.3, which disabled it at the C level.
4527 python 2.3, which disabled it at the C level.
4523
4528
4524 2003-11-11 Fernando Perez <fperez@colorado.edu>
4529 2003-11-11 Fernando Perez <fperez@colorado.edu>
4525
4530
4526 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4531 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4527 for Numeric.array(map(...)), but often convenient.
4532 for Numeric.array(map(...)), but often convenient.
4528
4533
4529 2003-11-05 Fernando Perez <fperez@colorado.edu>
4534 2003-11-05 Fernando Perez <fperez@colorado.edu>
4530
4535
4531 * IPython/numutils.py (frange): Changed a call from int() to
4536 * IPython/numutils.py (frange): Changed a call from int() to
4532 int(round()) to prevent a problem reported with arange() in the
4537 int(round()) to prevent a problem reported with arange() in the
4533 numpy list.
4538 numpy list.
4534
4539
4535 2003-10-06 Fernando Perez <fperez@colorado.edu>
4540 2003-10-06 Fernando Perez <fperez@colorado.edu>
4536
4541
4537 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4542 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4538 prevent crashes if sys lacks an argv attribute (it happens with
4543 prevent crashes if sys lacks an argv attribute (it happens with
4539 embedded interpreters which build a bare-bones sys module).
4544 embedded interpreters which build a bare-bones sys module).
4540 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4545 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4541
4546
4542 2003-09-24 Fernando Perez <fperez@colorado.edu>
4547 2003-09-24 Fernando Perez <fperez@colorado.edu>
4543
4548
4544 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4549 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4545 to protect against poorly written user objects where __getattr__
4550 to protect against poorly written user objects where __getattr__
4546 raises exceptions other than AttributeError. Thanks to a bug
4551 raises exceptions other than AttributeError. Thanks to a bug
4547 report by Oliver Sander <osander-AT-gmx.de>.
4552 report by Oliver Sander <osander-AT-gmx.de>.
4548
4553
4549 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4554 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4550 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4555 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4551
4556
4552 2003-09-09 Fernando Perez <fperez@colorado.edu>
4557 2003-09-09 Fernando Perez <fperez@colorado.edu>
4553
4558
4554 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4559 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4555 unpacking a list whith a callable as first element would
4560 unpacking a list whith a callable as first element would
4556 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4561 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4557 Collins.
4562 Collins.
4558
4563
4559 2003-08-25 *** Released version 0.5.0
4564 2003-08-25 *** Released version 0.5.0
4560
4565
4561 2003-08-22 Fernando Perez <fperez@colorado.edu>
4566 2003-08-22 Fernando Perez <fperez@colorado.edu>
4562
4567
4563 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4568 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4564 improperly defined user exceptions. Thanks to feedback from Mark
4569 improperly defined user exceptions. Thanks to feedback from Mark
4565 Russell <mrussell-AT-verio.net>.
4570 Russell <mrussell-AT-verio.net>.
4566
4571
4567 2003-08-20 Fernando Perez <fperez@colorado.edu>
4572 2003-08-20 Fernando Perez <fperez@colorado.edu>
4568
4573
4569 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4574 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4570 printing so that it would print multi-line string forms starting
4575 printing so that it would print multi-line string forms starting
4571 with a new line. This way the formatting is better respected for
4576 with a new line. This way the formatting is better respected for
4572 objects which work hard to make nice string forms.
4577 objects which work hard to make nice string forms.
4573
4578
4574 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4579 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4575 autocall would overtake data access for objects with both
4580 autocall would overtake data access for objects with both
4576 __getitem__ and __call__.
4581 __getitem__ and __call__.
4577
4582
4578 2003-08-19 *** Released version 0.5.0-rc1
4583 2003-08-19 *** Released version 0.5.0-rc1
4579
4584
4580 2003-08-19 Fernando Perez <fperez@colorado.edu>
4585 2003-08-19 Fernando Perez <fperez@colorado.edu>
4581
4586
4582 * IPython/deep_reload.py (load_tail): single tiny change here
4587 * IPython/deep_reload.py (load_tail): single tiny change here
4583 seems to fix the long-standing bug of dreload() failing to work
4588 seems to fix the long-standing bug of dreload() failing to work
4584 for dotted names. But this module is pretty tricky, so I may have
4589 for dotted names. But this module is pretty tricky, so I may have
4585 missed some subtlety. Needs more testing!.
4590 missed some subtlety. Needs more testing!.
4586
4591
4587 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4592 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4588 exceptions which have badly implemented __str__ methods.
4593 exceptions which have badly implemented __str__ methods.
4589 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4594 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4590 which I've been getting reports about from Python 2.3 users. I
4595 which I've been getting reports about from Python 2.3 users. I
4591 wish I had a simple test case to reproduce the problem, so I could
4596 wish I had a simple test case to reproduce the problem, so I could
4592 either write a cleaner workaround or file a bug report if
4597 either write a cleaner workaround or file a bug report if
4593 necessary.
4598 necessary.
4594
4599
4595 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4600 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4596 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4601 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4597 a bug report by Tjabo Kloppenburg.
4602 a bug report by Tjabo Kloppenburg.
4598
4603
4599 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4604 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4600 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4605 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4601 seems rather unstable. Thanks to a bug report by Tjabo
4606 seems rather unstable. Thanks to a bug report by Tjabo
4602 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4607 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4603
4608
4604 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4609 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4605 this out soon because of the critical fixes in the inner loop for
4610 this out soon because of the critical fixes in the inner loop for
4606 generators.
4611 generators.
4607
4612
4608 * IPython/Magic.py (Magic.getargspec): removed. This (and
4613 * IPython/Magic.py (Magic.getargspec): removed. This (and
4609 _get_def) have been obsoleted by OInspect for a long time, I
4614 _get_def) have been obsoleted by OInspect for a long time, I
4610 hadn't noticed that they were dead code.
4615 hadn't noticed that they were dead code.
4611 (Magic._ofind): restored _ofind functionality for a few literals
4616 (Magic._ofind): restored _ofind functionality for a few literals
4612 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4617 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4613 for things like "hello".capitalize?, since that would require a
4618 for things like "hello".capitalize?, since that would require a
4614 potentially dangerous eval() again.
4619 potentially dangerous eval() again.
4615
4620
4616 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4621 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4617 logic a bit more to clean up the escapes handling and minimize the
4622 logic a bit more to clean up the escapes handling and minimize the
4618 use of _ofind to only necessary cases. The interactive 'feel' of
4623 use of _ofind to only necessary cases. The interactive 'feel' of
4619 IPython should have improved quite a bit with the changes in
4624 IPython should have improved quite a bit with the changes in
4620 _prefilter and _ofind (besides being far safer than before).
4625 _prefilter and _ofind (besides being far safer than before).
4621
4626
4622 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4627 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4623 obscure, never reported). Edit would fail to find the object to
4628 obscure, never reported). Edit would fail to find the object to
4624 edit under some circumstances.
4629 edit under some circumstances.
4625 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4630 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4626 which were causing double-calling of generators. Those eval calls
4631 which were causing double-calling of generators. Those eval calls
4627 were _very_ dangerous, since code with side effects could be
4632 were _very_ dangerous, since code with side effects could be
4628 triggered. As they say, 'eval is evil'... These were the
4633 triggered. As they say, 'eval is evil'... These were the
4629 nastiest evals in IPython. Besides, _ofind is now far simpler,
4634 nastiest evals in IPython. Besides, _ofind is now far simpler,
4630 and it should also be quite a bit faster. Its use of inspect is
4635 and it should also be quite a bit faster. Its use of inspect is
4631 also safer, so perhaps some of the inspect-related crashes I've
4636 also safer, so perhaps some of the inspect-related crashes I've
4632 seen lately with Python 2.3 might be taken care of. That will
4637 seen lately with Python 2.3 might be taken care of. That will
4633 need more testing.
4638 need more testing.
4634
4639
4635 2003-08-17 Fernando Perez <fperez@colorado.edu>
4640 2003-08-17 Fernando Perez <fperez@colorado.edu>
4636
4641
4637 * IPython/iplib.py (InteractiveShell._prefilter): significant
4642 * IPython/iplib.py (InteractiveShell._prefilter): significant
4638 simplifications to the logic for handling user escapes. Faster
4643 simplifications to the logic for handling user escapes. Faster
4639 and simpler code.
4644 and simpler code.
4640
4645
4641 2003-08-14 Fernando Perez <fperez@colorado.edu>
4646 2003-08-14 Fernando Perez <fperez@colorado.edu>
4642
4647
4643 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4648 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4644 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4649 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4645 but it should be quite a bit faster. And the recursive version
4650 but it should be quite a bit faster. And the recursive version
4646 generated O(log N) intermediate storage for all rank>1 arrays,
4651 generated O(log N) intermediate storage for all rank>1 arrays,
4647 even if they were contiguous.
4652 even if they were contiguous.
4648 (l1norm): Added this function.
4653 (l1norm): Added this function.
4649 (norm): Added this function for arbitrary norms (including
4654 (norm): Added this function for arbitrary norms (including
4650 l-infinity). l1 and l2 are still special cases for convenience
4655 l-infinity). l1 and l2 are still special cases for convenience
4651 and speed.
4656 and speed.
4652
4657
4653 2003-08-03 Fernando Perez <fperez@colorado.edu>
4658 2003-08-03 Fernando Perez <fperez@colorado.edu>
4654
4659
4655 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4660 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4656 exceptions, which now raise PendingDeprecationWarnings in Python
4661 exceptions, which now raise PendingDeprecationWarnings in Python
4657 2.3. There were some in Magic and some in Gnuplot2.
4662 2.3. There were some in Magic and some in Gnuplot2.
4658
4663
4659 2003-06-30 Fernando Perez <fperez@colorado.edu>
4664 2003-06-30 Fernando Perez <fperez@colorado.edu>
4660
4665
4661 * IPython/genutils.py (page): modified to call curses only for
4666 * IPython/genutils.py (page): modified to call curses only for
4662 terminals where TERM=='xterm'. After problems under many other
4667 terminals where TERM=='xterm'. After problems under many other
4663 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4668 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4664
4669
4665 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4670 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4666 would be triggered when readline was absent. This was just an old
4671 would be triggered when readline was absent. This was just an old
4667 debugging statement I'd forgotten to take out.
4672 debugging statement I'd forgotten to take out.
4668
4673
4669 2003-06-20 Fernando Perez <fperez@colorado.edu>
4674 2003-06-20 Fernando Perez <fperez@colorado.edu>
4670
4675
4671 * IPython/genutils.py (clock): modified to return only user time
4676 * IPython/genutils.py (clock): modified to return only user time
4672 (not counting system time), after a discussion on scipy. While
4677 (not counting system time), after a discussion on scipy. While
4673 system time may be a useful quantity occasionally, it may much
4678 system time may be a useful quantity occasionally, it may much
4674 more easily be skewed by occasional swapping or other similar
4679 more easily be skewed by occasional swapping or other similar
4675 activity.
4680 activity.
4676
4681
4677 2003-06-05 Fernando Perez <fperez@colorado.edu>
4682 2003-06-05 Fernando Perez <fperez@colorado.edu>
4678
4683
4679 * IPython/numutils.py (identity): new function, for building
4684 * IPython/numutils.py (identity): new function, for building
4680 arbitrary rank Kronecker deltas (mostly backwards compatible with
4685 arbitrary rank Kronecker deltas (mostly backwards compatible with
4681 Numeric.identity)
4686 Numeric.identity)
4682
4687
4683 2003-06-03 Fernando Perez <fperez@colorado.edu>
4688 2003-06-03 Fernando Perez <fperez@colorado.edu>
4684
4689
4685 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4690 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4686 arguments passed to magics with spaces, to allow trailing '\' to
4691 arguments passed to magics with spaces, to allow trailing '\' to
4687 work normally (mainly for Windows users).
4692 work normally (mainly for Windows users).
4688
4693
4689 2003-05-29 Fernando Perez <fperez@colorado.edu>
4694 2003-05-29 Fernando Perez <fperez@colorado.edu>
4690
4695
4691 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4696 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4692 instead of pydoc.help. This fixes a bizarre behavior where
4697 instead of pydoc.help. This fixes a bizarre behavior where
4693 printing '%s' % locals() would trigger the help system. Now
4698 printing '%s' % locals() would trigger the help system. Now
4694 ipython behaves like normal python does.
4699 ipython behaves like normal python does.
4695
4700
4696 Note that if one does 'from pydoc import help', the bizarre
4701 Note that if one does 'from pydoc import help', the bizarre
4697 behavior returns, but this will also happen in normal python, so
4702 behavior returns, but this will also happen in normal python, so
4698 it's not an ipython bug anymore (it has to do with how pydoc.help
4703 it's not an ipython bug anymore (it has to do with how pydoc.help
4699 is implemented).
4704 is implemented).
4700
4705
4701 2003-05-22 Fernando Perez <fperez@colorado.edu>
4706 2003-05-22 Fernando Perez <fperez@colorado.edu>
4702
4707
4703 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4708 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4704 return [] instead of None when nothing matches, also match to end
4709 return [] instead of None when nothing matches, also match to end
4705 of line. Patch by Gary Bishop.
4710 of line. Patch by Gary Bishop.
4706
4711
4707 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4712 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4708 protection as before, for files passed on the command line. This
4713 protection as before, for files passed on the command line. This
4709 prevents the CrashHandler from kicking in if user files call into
4714 prevents the CrashHandler from kicking in if user files call into
4710 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4715 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4711 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4716 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4712
4717
4713 2003-05-20 *** Released version 0.4.0
4718 2003-05-20 *** Released version 0.4.0
4714
4719
4715 2003-05-20 Fernando Perez <fperez@colorado.edu>
4720 2003-05-20 Fernando Perez <fperez@colorado.edu>
4716
4721
4717 * setup.py: added support for manpages. It's a bit hackish b/c of
4722 * setup.py: added support for manpages. It's a bit hackish b/c of
4718 a bug in the way the bdist_rpm distutils target handles gzipped
4723 a bug in the way the bdist_rpm distutils target handles gzipped
4719 manpages, but it works. After a patch by Jack.
4724 manpages, but it works. After a patch by Jack.
4720
4725
4721 2003-05-19 Fernando Perez <fperez@colorado.edu>
4726 2003-05-19 Fernando Perez <fperez@colorado.edu>
4722
4727
4723 * IPython/numutils.py: added a mockup of the kinds module, since
4728 * IPython/numutils.py: added a mockup of the kinds module, since
4724 it was recently removed from Numeric. This way, numutils will
4729 it was recently removed from Numeric. This way, numutils will
4725 work for all users even if they are missing kinds.
4730 work for all users even if they are missing kinds.
4726
4731
4727 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4732 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4728 failure, which can occur with SWIG-wrapped extensions. After a
4733 failure, which can occur with SWIG-wrapped extensions. After a
4729 crash report from Prabhu.
4734 crash report from Prabhu.
4730
4735
4731 2003-05-16 Fernando Perez <fperez@colorado.edu>
4736 2003-05-16 Fernando Perez <fperez@colorado.edu>
4732
4737
4733 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4738 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4734 protect ipython from user code which may call directly
4739 protect ipython from user code which may call directly
4735 sys.excepthook (this looks like an ipython crash to the user, even
4740 sys.excepthook (this looks like an ipython crash to the user, even
4736 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4741 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4737 This is especially important to help users of WxWindows, but may
4742 This is especially important to help users of WxWindows, but may
4738 also be useful in other cases.
4743 also be useful in other cases.
4739
4744
4740 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4745 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4741 an optional tb_offset to be specified, and to preserve exception
4746 an optional tb_offset to be specified, and to preserve exception
4742 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4747 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4743
4748
4744 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4749 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4745
4750
4746 2003-05-15 Fernando Perez <fperez@colorado.edu>
4751 2003-05-15 Fernando Perez <fperez@colorado.edu>
4747
4752
4748 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4753 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4749 installing for a new user under Windows.
4754 installing for a new user under Windows.
4750
4755
4751 2003-05-12 Fernando Perez <fperez@colorado.edu>
4756 2003-05-12 Fernando Perez <fperez@colorado.edu>
4752
4757
4753 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4758 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4754 handler for Emacs comint-based lines. Currently it doesn't do
4759 handler for Emacs comint-based lines. Currently it doesn't do
4755 much (but importantly, it doesn't update the history cache). In
4760 much (but importantly, it doesn't update the history cache). In
4756 the future it may be expanded if Alex needs more functionality
4761 the future it may be expanded if Alex needs more functionality
4757 there.
4762 there.
4758
4763
4759 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4764 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4760 info to crash reports.
4765 info to crash reports.
4761
4766
4762 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4767 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4763 just like Python's -c. Also fixed crash with invalid -color
4768 just like Python's -c. Also fixed crash with invalid -color
4764 option value at startup. Thanks to Will French
4769 option value at startup. Thanks to Will French
4765 <wfrench-AT-bestweb.net> for the bug report.
4770 <wfrench-AT-bestweb.net> for the bug report.
4766
4771
4767 2003-05-09 Fernando Perez <fperez@colorado.edu>
4772 2003-05-09 Fernando Perez <fperez@colorado.edu>
4768
4773
4769 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4774 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4770 to EvalDict (it's a mapping, after all) and simplified its code
4775 to EvalDict (it's a mapping, after all) and simplified its code
4771 quite a bit, after a nice discussion on c.l.py where Gustavo
4776 quite a bit, after a nice discussion on c.l.py where Gustavo
4772 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4777 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4773
4778
4774 2003-04-30 Fernando Perez <fperez@colorado.edu>
4779 2003-04-30 Fernando Perez <fperez@colorado.edu>
4775
4780
4776 * IPython/genutils.py (timings_out): modified it to reduce its
4781 * IPython/genutils.py (timings_out): modified it to reduce its
4777 overhead in the common reps==1 case.
4782 overhead in the common reps==1 case.
4778
4783
4779 2003-04-29 Fernando Perez <fperez@colorado.edu>
4784 2003-04-29 Fernando Perez <fperez@colorado.edu>
4780
4785
4781 * IPython/genutils.py (timings_out): Modified to use the resource
4786 * IPython/genutils.py (timings_out): Modified to use the resource
4782 module, which avoids the wraparound problems of time.clock().
4787 module, which avoids the wraparound problems of time.clock().
4783
4788
4784 2003-04-17 *** Released version 0.2.15pre4
4789 2003-04-17 *** Released version 0.2.15pre4
4785
4790
4786 2003-04-17 Fernando Perez <fperez@colorado.edu>
4791 2003-04-17 Fernando Perez <fperez@colorado.edu>
4787
4792
4788 * setup.py (scriptfiles): Split windows-specific stuff over to a
4793 * setup.py (scriptfiles): Split windows-specific stuff over to a
4789 separate file, in an attempt to have a Windows GUI installer.
4794 separate file, in an attempt to have a Windows GUI installer.
4790 That didn't work, but part of the groundwork is done.
4795 That didn't work, but part of the groundwork is done.
4791
4796
4792 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4797 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4793 indent/unindent with 4 spaces. Particularly useful in combination
4798 indent/unindent with 4 spaces. Particularly useful in combination
4794 with the new auto-indent option.
4799 with the new auto-indent option.
4795
4800
4796 2003-04-16 Fernando Perez <fperez@colorado.edu>
4801 2003-04-16 Fernando Perez <fperez@colorado.edu>
4797
4802
4798 * IPython/Magic.py: various replacements of self.rc for
4803 * IPython/Magic.py: various replacements of self.rc for
4799 self.shell.rc. A lot more remains to be done to fully disentangle
4804 self.shell.rc. A lot more remains to be done to fully disentangle
4800 this class from the main Shell class.
4805 this class from the main Shell class.
4801
4806
4802 * IPython/GnuplotRuntime.py: added checks for mouse support so
4807 * IPython/GnuplotRuntime.py: added checks for mouse support so
4803 that we don't try to enable it if the current gnuplot doesn't
4808 that we don't try to enable it if the current gnuplot doesn't
4804 really support it. Also added checks so that we don't try to
4809 really support it. Also added checks so that we don't try to
4805 enable persist under Windows (where Gnuplot doesn't recognize the
4810 enable persist under Windows (where Gnuplot doesn't recognize the
4806 option).
4811 option).
4807
4812
4808 * IPython/iplib.py (InteractiveShell.interact): Added optional
4813 * IPython/iplib.py (InteractiveShell.interact): Added optional
4809 auto-indenting code, after a patch by King C. Shu
4814 auto-indenting code, after a patch by King C. Shu
4810 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4815 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4811 get along well with pasting indented code. If I ever figure out
4816 get along well with pasting indented code. If I ever figure out
4812 how to make that part go well, it will become on by default.
4817 how to make that part go well, it will become on by default.
4813
4818
4814 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4819 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4815 crash ipython if there was an unmatched '%' in the user's prompt
4820 crash ipython if there was an unmatched '%' in the user's prompt
4816 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4821 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4817
4822
4818 * IPython/iplib.py (InteractiveShell.interact): removed the
4823 * IPython/iplib.py (InteractiveShell.interact): removed the
4819 ability to ask the user whether he wants to crash or not at the
4824 ability to ask the user whether he wants to crash or not at the
4820 'last line' exception handler. Calling functions at that point
4825 'last line' exception handler. Calling functions at that point
4821 changes the stack, and the error reports would have incorrect
4826 changes the stack, and the error reports would have incorrect
4822 tracebacks.
4827 tracebacks.
4823
4828
4824 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4829 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4825 pass through a peger a pretty-printed form of any object. After a
4830 pass through a peger a pretty-printed form of any object. After a
4826 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4831 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4827
4832
4828 2003-04-14 Fernando Perez <fperez@colorado.edu>
4833 2003-04-14 Fernando Perez <fperez@colorado.edu>
4829
4834
4830 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4835 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4831 all files in ~ would be modified at first install (instead of
4836 all files in ~ would be modified at first install (instead of
4832 ~/.ipython). This could be potentially disastrous, as the
4837 ~/.ipython). This could be potentially disastrous, as the
4833 modification (make line-endings native) could damage binary files.
4838 modification (make line-endings native) could damage binary files.
4834
4839
4835 2003-04-10 Fernando Perez <fperez@colorado.edu>
4840 2003-04-10 Fernando Perez <fperez@colorado.edu>
4836
4841
4837 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4842 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4838 handle only lines which are invalid python. This now means that
4843 handle only lines which are invalid python. This now means that
4839 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4844 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4840 for the bug report.
4845 for the bug report.
4841
4846
4842 2003-04-01 Fernando Perez <fperez@colorado.edu>
4847 2003-04-01 Fernando Perez <fperez@colorado.edu>
4843
4848
4844 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4849 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4845 where failing to set sys.last_traceback would crash pdb.pm().
4850 where failing to set sys.last_traceback would crash pdb.pm().
4846 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4851 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4847 report.
4852 report.
4848
4853
4849 2003-03-25 Fernando Perez <fperez@colorado.edu>
4854 2003-03-25 Fernando Perez <fperez@colorado.edu>
4850
4855
4851 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4856 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4852 before printing it (it had a lot of spurious blank lines at the
4857 before printing it (it had a lot of spurious blank lines at the
4853 end).
4858 end).
4854
4859
4855 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4860 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4856 output would be sent 21 times! Obviously people don't use this
4861 output would be sent 21 times! Obviously people don't use this
4857 too often, or I would have heard about it.
4862 too often, or I would have heard about it.
4858
4863
4859 2003-03-24 Fernando Perez <fperez@colorado.edu>
4864 2003-03-24 Fernando Perez <fperez@colorado.edu>
4860
4865
4861 * setup.py (scriptfiles): renamed the data_files parameter from
4866 * setup.py (scriptfiles): renamed the data_files parameter from
4862 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4867 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4863 for the patch.
4868 for the patch.
4864
4869
4865 2003-03-20 Fernando Perez <fperez@colorado.edu>
4870 2003-03-20 Fernando Perez <fperez@colorado.edu>
4866
4871
4867 * IPython/genutils.py (error): added error() and fatal()
4872 * IPython/genutils.py (error): added error() and fatal()
4868 functions.
4873 functions.
4869
4874
4870 2003-03-18 *** Released version 0.2.15pre3
4875 2003-03-18 *** Released version 0.2.15pre3
4871
4876
4872 2003-03-18 Fernando Perez <fperez@colorado.edu>
4877 2003-03-18 Fernando Perez <fperez@colorado.edu>
4873
4878
4874 * setupext/install_data_ext.py
4879 * setupext/install_data_ext.py
4875 (install_data_ext.initialize_options): Class contributed by Jack
4880 (install_data_ext.initialize_options): Class contributed by Jack
4876 Moffit for fixing the old distutils hack. He is sending this to
4881 Moffit for fixing the old distutils hack. He is sending this to
4877 the distutils folks so in the future we may not need it as a
4882 the distutils folks so in the future we may not need it as a
4878 private fix.
4883 private fix.
4879
4884
4880 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4885 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4881 changes for Debian packaging. See his patch for full details.
4886 changes for Debian packaging. See his patch for full details.
4882 The old distutils hack of making the ipythonrc* files carry a
4887 The old distutils hack of making the ipythonrc* files carry a
4883 bogus .py extension is gone, at last. Examples were moved to a
4888 bogus .py extension is gone, at last. Examples were moved to a
4884 separate subdir under doc/, and the separate executable scripts
4889 separate subdir under doc/, and the separate executable scripts
4885 now live in their own directory. Overall a great cleanup. The
4890 now live in their own directory. Overall a great cleanup. The
4886 manual was updated to use the new files, and setup.py has been
4891 manual was updated to use the new files, and setup.py has been
4887 fixed for this setup.
4892 fixed for this setup.
4888
4893
4889 * IPython/PyColorize.py (Parser.usage): made non-executable and
4894 * IPython/PyColorize.py (Parser.usage): made non-executable and
4890 created a pycolor wrapper around it to be included as a script.
4895 created a pycolor wrapper around it to be included as a script.
4891
4896
4892 2003-03-12 *** Released version 0.2.15pre2
4897 2003-03-12 *** Released version 0.2.15pre2
4893
4898
4894 2003-03-12 Fernando Perez <fperez@colorado.edu>
4899 2003-03-12 Fernando Perez <fperez@colorado.edu>
4895
4900
4896 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4901 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4897 long-standing problem with garbage characters in some terminals.
4902 long-standing problem with garbage characters in some terminals.
4898 The issue was really that the \001 and \002 escapes must _only_ be
4903 The issue was really that the \001 and \002 escapes must _only_ be
4899 passed to input prompts (which call readline), but _never_ to
4904 passed to input prompts (which call readline), but _never_ to
4900 normal text to be printed on screen. I changed ColorANSI to have
4905 normal text to be printed on screen. I changed ColorANSI to have
4901 two classes: TermColors and InputTermColors, each with the
4906 two classes: TermColors and InputTermColors, each with the
4902 appropriate escapes for input prompts or normal text. The code in
4907 appropriate escapes for input prompts or normal text. The code in
4903 Prompts.py got slightly more complicated, but this very old and
4908 Prompts.py got slightly more complicated, but this very old and
4904 annoying bug is finally fixed.
4909 annoying bug is finally fixed.
4905
4910
4906 All the credit for nailing down the real origin of this problem
4911 All the credit for nailing down the real origin of this problem
4907 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4912 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4908 *Many* thanks to him for spending quite a bit of effort on this.
4913 *Many* thanks to him for spending quite a bit of effort on this.
4909
4914
4910 2003-03-05 *** Released version 0.2.15pre1
4915 2003-03-05 *** Released version 0.2.15pre1
4911
4916
4912 2003-03-03 Fernando Perez <fperez@colorado.edu>
4917 2003-03-03 Fernando Perez <fperez@colorado.edu>
4913
4918
4914 * IPython/FakeModule.py: Moved the former _FakeModule to a
4919 * IPython/FakeModule.py: Moved the former _FakeModule to a
4915 separate file, because it's also needed by Magic (to fix a similar
4920 separate file, because it's also needed by Magic (to fix a similar
4916 pickle-related issue in @run).
4921 pickle-related issue in @run).
4917
4922
4918 2003-03-02 Fernando Perez <fperez@colorado.edu>
4923 2003-03-02 Fernando Perez <fperez@colorado.edu>
4919
4924
4920 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4925 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4921 the autocall option at runtime.
4926 the autocall option at runtime.
4922 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4927 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4923 across Magic.py to start separating Magic from InteractiveShell.
4928 across Magic.py to start separating Magic from InteractiveShell.
4924 (Magic._ofind): Fixed to return proper namespace for dotted
4929 (Magic._ofind): Fixed to return proper namespace for dotted
4925 names. Before, a dotted name would always return 'not currently
4930 names. Before, a dotted name would always return 'not currently
4926 defined', because it would find the 'parent'. s.x would be found,
4931 defined', because it would find the 'parent'. s.x would be found,
4927 but since 'x' isn't defined by itself, it would get confused.
4932 but since 'x' isn't defined by itself, it would get confused.
4928 (Magic.magic_run): Fixed pickling problems reported by Ralf
4933 (Magic.magic_run): Fixed pickling problems reported by Ralf
4929 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4934 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4930 that I'd used when Mike Heeter reported similar issues at the
4935 that I'd used when Mike Heeter reported similar issues at the
4931 top-level, but now for @run. It boils down to injecting the
4936 top-level, but now for @run. It boils down to injecting the
4932 namespace where code is being executed with something that looks
4937 namespace where code is being executed with something that looks
4933 enough like a module to fool pickle.dump(). Since a pickle stores
4938 enough like a module to fool pickle.dump(). Since a pickle stores
4934 a named reference to the importing module, we need this for
4939 a named reference to the importing module, we need this for
4935 pickles to save something sensible.
4940 pickles to save something sensible.
4936
4941
4937 * IPython/ipmaker.py (make_IPython): added an autocall option.
4942 * IPython/ipmaker.py (make_IPython): added an autocall option.
4938
4943
4939 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4944 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4940 the auto-eval code. Now autocalling is an option, and the code is
4945 the auto-eval code. Now autocalling is an option, and the code is
4941 also vastly safer. There is no more eval() involved at all.
4946 also vastly safer. There is no more eval() involved at all.
4942
4947
4943 2003-03-01 Fernando Perez <fperez@colorado.edu>
4948 2003-03-01 Fernando Perez <fperez@colorado.edu>
4944
4949
4945 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4950 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4946 dict with named keys instead of a tuple.
4951 dict with named keys instead of a tuple.
4947
4952
4948 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4953 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4949
4954
4950 * setup.py (make_shortcut): Fixed message about directories
4955 * setup.py (make_shortcut): Fixed message about directories
4951 created during Windows installation (the directories were ok, just
4956 created during Windows installation (the directories were ok, just
4952 the printed message was misleading). Thanks to Chris Liechti
4957 the printed message was misleading). Thanks to Chris Liechti
4953 <cliechti-AT-gmx.net> for the heads up.
4958 <cliechti-AT-gmx.net> for the heads up.
4954
4959
4955 2003-02-21 Fernando Perez <fperez@colorado.edu>
4960 2003-02-21 Fernando Perez <fperez@colorado.edu>
4956
4961
4957 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4962 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4958 of ValueError exception when checking for auto-execution. This
4963 of ValueError exception when checking for auto-execution. This
4959 one is raised by things like Numeric arrays arr.flat when the
4964 one is raised by things like Numeric arrays arr.flat when the
4960 array is non-contiguous.
4965 array is non-contiguous.
4961
4966
4962 2003-01-31 Fernando Perez <fperez@colorado.edu>
4967 2003-01-31 Fernando Perez <fperez@colorado.edu>
4963
4968
4964 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4969 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4965 not return any value at all (even though the command would get
4970 not return any value at all (even though the command would get
4966 executed).
4971 executed).
4967 (xsys): Flush stdout right after printing the command to ensure
4972 (xsys): Flush stdout right after printing the command to ensure
4968 proper ordering of commands and command output in the total
4973 proper ordering of commands and command output in the total
4969 output.
4974 output.
4970 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4975 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4971 system/getoutput as defaults. The old ones are kept for
4976 system/getoutput as defaults. The old ones are kept for
4972 compatibility reasons, so no code which uses this library needs
4977 compatibility reasons, so no code which uses this library needs
4973 changing.
4978 changing.
4974
4979
4975 2003-01-27 *** Released version 0.2.14
4980 2003-01-27 *** Released version 0.2.14
4976
4981
4977 2003-01-25 Fernando Perez <fperez@colorado.edu>
4982 2003-01-25 Fernando Perez <fperez@colorado.edu>
4978
4983
4979 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4984 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4980 functions defined in previous edit sessions could not be re-edited
4985 functions defined in previous edit sessions could not be re-edited
4981 (because the temp files were immediately removed). Now temp files
4986 (because the temp files were immediately removed). Now temp files
4982 are removed only at IPython's exit.
4987 are removed only at IPython's exit.
4983 (Magic.magic_run): Improved @run to perform shell-like expansions
4988 (Magic.magic_run): Improved @run to perform shell-like expansions
4984 on its arguments (~users and $VARS). With this, @run becomes more
4989 on its arguments (~users and $VARS). With this, @run becomes more
4985 like a normal command-line.
4990 like a normal command-line.
4986
4991
4987 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4992 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4988 bugs related to embedding and cleaned up that code. A fairly
4993 bugs related to embedding and cleaned up that code. A fairly
4989 important one was the impossibility to access the global namespace
4994 important one was the impossibility to access the global namespace
4990 through the embedded IPython (only local variables were visible).
4995 through the embedded IPython (only local variables were visible).
4991
4996
4992 2003-01-14 Fernando Perez <fperez@colorado.edu>
4997 2003-01-14 Fernando Perez <fperez@colorado.edu>
4993
4998
4994 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4999 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4995 auto-calling to be a bit more conservative. Now it doesn't get
5000 auto-calling to be a bit more conservative. Now it doesn't get
4996 triggered if any of '!=()<>' are in the rest of the input line, to
5001 triggered if any of '!=()<>' are in the rest of the input line, to
4997 allow comparing callables. Thanks to Alex for the heads up.
5002 allow comparing callables. Thanks to Alex for the heads up.
4998
5003
4999 2003-01-07 Fernando Perez <fperez@colorado.edu>
5004 2003-01-07 Fernando Perez <fperez@colorado.edu>
5000
5005
5001 * IPython/genutils.py (page): fixed estimation of the number of
5006 * IPython/genutils.py (page): fixed estimation of the number of
5002 lines in a string to be paged to simply count newlines. This
5007 lines in a string to be paged to simply count newlines. This
5003 prevents over-guessing due to embedded escape sequences. A better
5008 prevents over-guessing due to embedded escape sequences. A better
5004 long-term solution would involve stripping out the control chars
5009 long-term solution would involve stripping out the control chars
5005 for the count, but it's potentially so expensive I just don't
5010 for the count, but it's potentially so expensive I just don't
5006 think it's worth doing.
5011 think it's worth doing.
5007
5012
5008 2002-12-19 *** Released version 0.2.14pre50
5013 2002-12-19 *** Released version 0.2.14pre50
5009
5014
5010 2002-12-19 Fernando Perez <fperez@colorado.edu>
5015 2002-12-19 Fernando Perez <fperez@colorado.edu>
5011
5016
5012 * tools/release (version): Changed release scripts to inform
5017 * tools/release (version): Changed release scripts to inform
5013 Andrea and build a NEWS file with a list of recent changes.
5018 Andrea and build a NEWS file with a list of recent changes.
5014
5019
5015 * IPython/ColorANSI.py (__all__): changed terminal detection
5020 * IPython/ColorANSI.py (__all__): changed terminal detection
5016 code. Seems to work better for xterms without breaking
5021 code. Seems to work better for xterms without breaking
5017 konsole. Will need more testing to determine if WinXP and Mac OSX
5022 konsole. Will need more testing to determine if WinXP and Mac OSX
5018 also work ok.
5023 also work ok.
5019
5024
5020 2002-12-18 *** Released version 0.2.14pre49
5025 2002-12-18 *** Released version 0.2.14pre49
5021
5026
5022 2002-12-18 Fernando Perez <fperez@colorado.edu>
5027 2002-12-18 Fernando Perez <fperez@colorado.edu>
5023
5028
5024 * Docs: added new info about Mac OSX, from Andrea.
5029 * Docs: added new info about Mac OSX, from Andrea.
5025
5030
5026 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5031 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5027 allow direct plotting of python strings whose format is the same
5032 allow direct plotting of python strings whose format is the same
5028 of gnuplot data files.
5033 of gnuplot data files.
5029
5034
5030 2002-12-16 Fernando Perez <fperez@colorado.edu>
5035 2002-12-16 Fernando Perez <fperez@colorado.edu>
5031
5036
5032 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5037 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5033 value of exit question to be acknowledged.
5038 value of exit question to be acknowledged.
5034
5039
5035 2002-12-03 Fernando Perez <fperez@colorado.edu>
5040 2002-12-03 Fernando Perez <fperez@colorado.edu>
5036
5041
5037 * IPython/ipmaker.py: removed generators, which had been added
5042 * IPython/ipmaker.py: removed generators, which had been added
5038 by mistake in an earlier debugging run. This was causing trouble
5043 by mistake in an earlier debugging run. This was causing trouble
5039 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5044 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5040 for pointing this out.
5045 for pointing this out.
5041
5046
5042 2002-11-17 Fernando Perez <fperez@colorado.edu>
5047 2002-11-17 Fernando Perez <fperez@colorado.edu>
5043
5048
5044 * Manual: updated the Gnuplot section.
5049 * Manual: updated the Gnuplot section.
5045
5050
5046 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5051 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5047 a much better split of what goes in Runtime and what goes in
5052 a much better split of what goes in Runtime and what goes in
5048 Interactive.
5053 Interactive.
5049
5054
5050 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5055 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5051 being imported from iplib.
5056 being imported from iplib.
5052
5057
5053 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5058 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5054 for command-passing. Now the global Gnuplot instance is called
5059 for command-passing. Now the global Gnuplot instance is called
5055 'gp' instead of 'g', which was really a far too fragile and
5060 'gp' instead of 'g', which was really a far too fragile and
5056 common name.
5061 common name.
5057
5062
5058 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5063 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5059 bounding boxes generated by Gnuplot for square plots.
5064 bounding boxes generated by Gnuplot for square plots.
5060
5065
5061 * IPython/genutils.py (popkey): new function added. I should
5066 * IPython/genutils.py (popkey): new function added. I should
5062 suggest this on c.l.py as a dict method, it seems useful.
5067 suggest this on c.l.py as a dict method, it seems useful.
5063
5068
5064 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5069 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5065 to transparently handle PostScript generation. MUCH better than
5070 to transparently handle PostScript generation. MUCH better than
5066 the previous plot_eps/replot_eps (which I removed now). The code
5071 the previous plot_eps/replot_eps (which I removed now). The code
5067 is also fairly clean and well documented now (including
5072 is also fairly clean and well documented now (including
5068 docstrings).
5073 docstrings).
5069
5074
5070 2002-11-13 Fernando Perez <fperez@colorado.edu>
5075 2002-11-13 Fernando Perez <fperez@colorado.edu>
5071
5076
5072 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5077 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5073 (inconsistent with options).
5078 (inconsistent with options).
5074
5079
5075 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5080 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5076 manually disabled, I don't know why. Fixed it.
5081 manually disabled, I don't know why. Fixed it.
5077 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5082 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5078 eps output.
5083 eps output.
5079
5084
5080 2002-11-12 Fernando Perez <fperez@colorado.edu>
5085 2002-11-12 Fernando Perez <fperez@colorado.edu>
5081
5086
5082 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5087 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5083 don't propagate up to caller. Fixes crash reported by François
5088 don't propagate up to caller. Fixes crash reported by François
5084 Pinard.
5089 Pinard.
5085
5090
5086 2002-11-09 Fernando Perez <fperez@colorado.edu>
5091 2002-11-09 Fernando Perez <fperez@colorado.edu>
5087
5092
5088 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5093 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5089 history file for new users.
5094 history file for new users.
5090 (make_IPython): fixed bug where initial install would leave the
5095 (make_IPython): fixed bug where initial install would leave the
5091 user running in the .ipython dir.
5096 user running in the .ipython dir.
5092 (make_IPython): fixed bug where config dir .ipython would be
5097 (make_IPython): fixed bug where config dir .ipython would be
5093 created regardless of the given -ipythondir option. Thanks to Cory
5098 created regardless of the given -ipythondir option. Thanks to Cory
5094 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5099 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5095
5100
5096 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5101 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5097 type confirmations. Will need to use it in all of IPython's code
5102 type confirmations. Will need to use it in all of IPython's code
5098 consistently.
5103 consistently.
5099
5104
5100 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5105 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5101 context to print 31 lines instead of the default 5. This will make
5106 context to print 31 lines instead of the default 5. This will make
5102 the crash reports extremely detailed in case the problem is in
5107 the crash reports extremely detailed in case the problem is in
5103 libraries I don't have access to.
5108 libraries I don't have access to.
5104
5109
5105 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5110 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5106 line of defense' code to still crash, but giving users fair
5111 line of defense' code to still crash, but giving users fair
5107 warning. I don't want internal errors to go unreported: if there's
5112 warning. I don't want internal errors to go unreported: if there's
5108 an internal problem, IPython should crash and generate a full
5113 an internal problem, IPython should crash and generate a full
5109 report.
5114 report.
5110
5115
5111 2002-11-08 Fernando Perez <fperez@colorado.edu>
5116 2002-11-08 Fernando Perez <fperez@colorado.edu>
5112
5117
5113 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5118 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5114 otherwise uncaught exceptions which can appear if people set
5119 otherwise uncaught exceptions which can appear if people set
5115 sys.stdout to something badly broken. Thanks to a crash report
5120 sys.stdout to something badly broken. Thanks to a crash report
5116 from henni-AT-mail.brainbot.com.
5121 from henni-AT-mail.brainbot.com.
5117
5122
5118 2002-11-04 Fernando Perez <fperez@colorado.edu>
5123 2002-11-04 Fernando Perez <fperez@colorado.edu>
5119
5124
5120 * IPython/iplib.py (InteractiveShell.interact): added
5125 * IPython/iplib.py (InteractiveShell.interact): added
5121 __IPYTHON__active to the builtins. It's a flag which goes on when
5126 __IPYTHON__active to the builtins. It's a flag which goes on when
5122 the interaction starts and goes off again when it stops. This
5127 the interaction starts and goes off again when it stops. This
5123 allows embedding code to detect being inside IPython. Before this
5128 allows embedding code to detect being inside IPython. Before this
5124 was done via __IPYTHON__, but that only shows that an IPython
5129 was done via __IPYTHON__, but that only shows that an IPython
5125 instance has been created.
5130 instance has been created.
5126
5131
5127 * IPython/Magic.py (Magic.magic_env): I realized that in a
5132 * IPython/Magic.py (Magic.magic_env): I realized that in a
5128 UserDict, instance.data holds the data as a normal dict. So I
5133 UserDict, instance.data holds the data as a normal dict. So I
5129 modified @env to return os.environ.data instead of rebuilding a
5134 modified @env to return os.environ.data instead of rebuilding a
5130 dict by hand.
5135 dict by hand.
5131
5136
5132 2002-11-02 Fernando Perez <fperez@colorado.edu>
5137 2002-11-02 Fernando Perez <fperez@colorado.edu>
5133
5138
5134 * IPython/genutils.py (warn): changed so that level 1 prints no
5139 * IPython/genutils.py (warn): changed so that level 1 prints no
5135 header. Level 2 is now the default (with 'WARNING' header, as
5140 header. Level 2 is now the default (with 'WARNING' header, as
5136 before). I think I tracked all places where changes were needed in
5141 before). I think I tracked all places where changes were needed in
5137 IPython, but outside code using the old level numbering may have
5142 IPython, but outside code using the old level numbering may have
5138 broken.
5143 broken.
5139
5144
5140 * IPython/iplib.py (InteractiveShell.runcode): added this to
5145 * IPython/iplib.py (InteractiveShell.runcode): added this to
5141 handle the tracebacks in SystemExit traps correctly. The previous
5146 handle the tracebacks in SystemExit traps correctly. The previous
5142 code (through interact) was printing more of the stack than
5147 code (through interact) was printing more of the stack than
5143 necessary, showing IPython internal code to the user.
5148 necessary, showing IPython internal code to the user.
5144
5149
5145 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5150 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5146 default. Now that the default at the confirmation prompt is yes,
5151 default. Now that the default at the confirmation prompt is yes,
5147 it's not so intrusive. François' argument that ipython sessions
5152 it's not so intrusive. François' argument that ipython sessions
5148 tend to be complex enough not to lose them from an accidental C-d,
5153 tend to be complex enough not to lose them from an accidental C-d,
5149 is a valid one.
5154 is a valid one.
5150
5155
5151 * IPython/iplib.py (InteractiveShell.interact): added a
5156 * IPython/iplib.py (InteractiveShell.interact): added a
5152 showtraceback() call to the SystemExit trap, and modified the exit
5157 showtraceback() call to the SystemExit trap, and modified the exit
5153 confirmation to have yes as the default.
5158 confirmation to have yes as the default.
5154
5159
5155 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5160 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5156 this file. It's been gone from the code for a long time, this was
5161 this file. It's been gone from the code for a long time, this was
5157 simply leftover junk.
5162 simply leftover junk.
5158
5163
5159 2002-11-01 Fernando Perez <fperez@colorado.edu>
5164 2002-11-01 Fernando Perez <fperez@colorado.edu>
5160
5165
5161 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5166 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5162 added. If set, IPython now traps EOF and asks for
5167 added. If set, IPython now traps EOF and asks for
5163 confirmation. After a request by François Pinard.
5168 confirmation. After a request by François Pinard.
5164
5169
5165 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5170 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5166 of @abort, and with a new (better) mechanism for handling the
5171 of @abort, and with a new (better) mechanism for handling the
5167 exceptions.
5172 exceptions.
5168
5173
5169 2002-10-27 Fernando Perez <fperez@colorado.edu>
5174 2002-10-27 Fernando Perez <fperez@colorado.edu>
5170
5175
5171 * IPython/usage.py (__doc__): updated the --help information and
5176 * IPython/usage.py (__doc__): updated the --help information and
5172 the ipythonrc file to indicate that -log generates
5177 the ipythonrc file to indicate that -log generates
5173 ./ipython.log. Also fixed the corresponding info in @logstart.
5178 ./ipython.log. Also fixed the corresponding info in @logstart.
5174 This and several other fixes in the manuals thanks to reports by
5179 This and several other fixes in the manuals thanks to reports by
5175 François Pinard <pinard-AT-iro.umontreal.ca>.
5180 François Pinard <pinard-AT-iro.umontreal.ca>.
5176
5181
5177 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5182 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5178 refer to @logstart (instead of @log, which doesn't exist).
5183 refer to @logstart (instead of @log, which doesn't exist).
5179
5184
5180 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5185 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5181 AttributeError crash. Thanks to Christopher Armstrong
5186 AttributeError crash. Thanks to Christopher Armstrong
5182 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5187 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5183 introduced recently (in 0.2.14pre37) with the fix to the eval
5188 introduced recently (in 0.2.14pre37) with the fix to the eval
5184 problem mentioned below.
5189 problem mentioned below.
5185
5190
5186 2002-10-17 Fernando Perez <fperez@colorado.edu>
5191 2002-10-17 Fernando Perez <fperez@colorado.edu>
5187
5192
5188 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5193 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5189 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5194 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5190
5195
5191 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5196 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5192 this function to fix a problem reported by Alex Schmolck. He saw
5197 this function to fix a problem reported by Alex Schmolck. He saw
5193 it with list comprehensions and generators, which were getting
5198 it with list comprehensions and generators, which were getting
5194 called twice. The real problem was an 'eval' call in testing for
5199 called twice. The real problem was an 'eval' call in testing for
5195 automagic which was evaluating the input line silently.
5200 automagic which was evaluating the input line silently.
5196
5201
5197 This is a potentially very nasty bug, if the input has side
5202 This is a potentially very nasty bug, if the input has side
5198 effects which must not be repeated. The code is much cleaner now,
5203 effects which must not be repeated. The code is much cleaner now,
5199 without any blanket 'except' left and with a regexp test for
5204 without any blanket 'except' left and with a regexp test for
5200 actual function names.
5205 actual function names.
5201
5206
5202 But an eval remains, which I'm not fully comfortable with. I just
5207 But an eval remains, which I'm not fully comfortable with. I just
5203 don't know how to find out if an expression could be a callable in
5208 don't know how to find out if an expression could be a callable in
5204 the user's namespace without doing an eval on the string. However
5209 the user's namespace without doing an eval on the string. However
5205 that string is now much more strictly checked so that no code
5210 that string is now much more strictly checked so that no code
5206 slips by, so the eval should only happen for things that can
5211 slips by, so the eval should only happen for things that can
5207 really be only function/method names.
5212 really be only function/method names.
5208
5213
5209 2002-10-15 Fernando Perez <fperez@colorado.edu>
5214 2002-10-15 Fernando Perez <fperez@colorado.edu>
5210
5215
5211 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5216 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5212 OSX information to main manual, removed README_Mac_OSX file from
5217 OSX information to main manual, removed README_Mac_OSX file from
5213 distribution. Also updated credits for recent additions.
5218 distribution. Also updated credits for recent additions.
5214
5219
5215 2002-10-10 Fernando Perez <fperez@colorado.edu>
5220 2002-10-10 Fernando Perez <fperez@colorado.edu>
5216
5221
5217 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5222 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5218 terminal-related issues. Many thanks to Andrea Riciputi
5223 terminal-related issues. Many thanks to Andrea Riciputi
5219 <andrea.riciputi-AT-libero.it> for writing it.
5224 <andrea.riciputi-AT-libero.it> for writing it.
5220
5225
5221 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5226 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5222 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5227 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5223
5228
5224 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5229 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5225 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5230 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5226 <syver-en-AT-online.no> who both submitted patches for this problem.
5231 <syver-en-AT-online.no> who both submitted patches for this problem.
5227
5232
5228 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5233 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5229 global embedding to make sure that things don't overwrite user
5234 global embedding to make sure that things don't overwrite user
5230 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5235 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5231
5236
5232 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5237 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5233 compatibility. Thanks to Hayden Callow
5238 compatibility. Thanks to Hayden Callow
5234 <h.callow-AT-elec.canterbury.ac.nz>
5239 <h.callow-AT-elec.canterbury.ac.nz>
5235
5240
5236 2002-10-04 Fernando Perez <fperez@colorado.edu>
5241 2002-10-04 Fernando Perez <fperez@colorado.edu>
5237
5242
5238 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5243 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5239 Gnuplot.File objects.
5244 Gnuplot.File objects.
5240
5245
5241 2002-07-23 Fernando Perez <fperez@colorado.edu>
5246 2002-07-23 Fernando Perez <fperez@colorado.edu>
5242
5247
5243 * IPython/genutils.py (timing): Added timings() and timing() for
5248 * IPython/genutils.py (timing): Added timings() and timing() for
5244 quick access to the most commonly needed data, the execution
5249 quick access to the most commonly needed data, the execution
5245 times. Old timing() renamed to timings_out().
5250 times. Old timing() renamed to timings_out().
5246
5251
5247 2002-07-18 Fernando Perez <fperez@colorado.edu>
5252 2002-07-18 Fernando Perez <fperez@colorado.edu>
5248
5253
5249 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5254 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5250 bug with nested instances disrupting the parent's tab completion.
5255 bug with nested instances disrupting the parent's tab completion.
5251
5256
5252 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5257 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5253 all_completions code to begin the emacs integration.
5258 all_completions code to begin the emacs integration.
5254
5259
5255 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5260 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5256 argument to allow titling individual arrays when plotting.
5261 argument to allow titling individual arrays when plotting.
5257
5262
5258 2002-07-15 Fernando Perez <fperez@colorado.edu>
5263 2002-07-15 Fernando Perez <fperez@colorado.edu>
5259
5264
5260 * setup.py (make_shortcut): changed to retrieve the value of
5265 * setup.py (make_shortcut): changed to retrieve the value of
5261 'Program Files' directory from the registry (this value changes in
5266 'Program Files' directory from the registry (this value changes in
5262 non-english versions of Windows). Thanks to Thomas Fanslau
5267 non-english versions of Windows). Thanks to Thomas Fanslau
5263 <tfanslau-AT-gmx.de> for the report.
5268 <tfanslau-AT-gmx.de> for the report.
5264
5269
5265 2002-07-10 Fernando Perez <fperez@colorado.edu>
5270 2002-07-10 Fernando Perez <fperez@colorado.edu>
5266
5271
5267 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5272 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5268 a bug in pdb, which crashes if a line with only whitespace is
5273 a bug in pdb, which crashes if a line with only whitespace is
5269 entered. Bug report submitted to sourceforge.
5274 entered. Bug report submitted to sourceforge.
5270
5275
5271 2002-07-09 Fernando Perez <fperez@colorado.edu>
5276 2002-07-09 Fernando Perez <fperez@colorado.edu>
5272
5277
5273 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5278 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5274 reporting exceptions (it's a bug in inspect.py, I just set a
5279 reporting exceptions (it's a bug in inspect.py, I just set a
5275 workaround).
5280 workaround).
5276
5281
5277 2002-07-08 Fernando Perez <fperez@colorado.edu>
5282 2002-07-08 Fernando Perez <fperez@colorado.edu>
5278
5283
5279 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5284 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5280 __IPYTHON__ in __builtins__ to show up in user_ns.
5285 __IPYTHON__ in __builtins__ to show up in user_ns.
5281
5286
5282 2002-07-03 Fernando Perez <fperez@colorado.edu>
5287 2002-07-03 Fernando Perez <fperez@colorado.edu>
5283
5288
5284 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5289 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5285 name from @gp_set_instance to @gp_set_default.
5290 name from @gp_set_instance to @gp_set_default.
5286
5291
5287 * IPython/ipmaker.py (make_IPython): default editor value set to
5292 * IPython/ipmaker.py (make_IPython): default editor value set to
5288 '0' (a string), to match the rc file. Otherwise will crash when
5293 '0' (a string), to match the rc file. Otherwise will crash when
5289 .strip() is called on it.
5294 .strip() is called on it.
5290
5295
5291
5296
5292 2002-06-28 Fernando Perez <fperez@colorado.edu>
5297 2002-06-28 Fernando Perez <fperez@colorado.edu>
5293
5298
5294 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5299 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5295 of files in current directory when a file is executed via
5300 of files in current directory when a file is executed via
5296 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5301 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5297
5302
5298 * setup.py (manfiles): fix for rpm builds, submitted by RA
5303 * setup.py (manfiles): fix for rpm builds, submitted by RA
5299 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5304 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5300
5305
5301 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5306 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5302 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5307 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5303 string!). A. Schmolck caught this one.
5308 string!). A. Schmolck caught this one.
5304
5309
5305 2002-06-27 Fernando Perez <fperez@colorado.edu>
5310 2002-06-27 Fernando Perez <fperez@colorado.edu>
5306
5311
5307 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5312 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5308 defined files at the cmd line. __name__ wasn't being set to
5313 defined files at the cmd line. __name__ wasn't being set to
5309 __main__.
5314 __main__.
5310
5315
5311 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5316 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5312 regular lists and tuples besides Numeric arrays.
5317 regular lists and tuples besides Numeric arrays.
5313
5318
5314 * IPython/Prompts.py (CachedOutput.__call__): Added output
5319 * IPython/Prompts.py (CachedOutput.__call__): Added output
5315 supression for input ending with ';'. Similar to Mathematica and
5320 supression for input ending with ';'. Similar to Mathematica and
5316 Matlab. The _* vars and Out[] list are still updated, just like
5321 Matlab. The _* vars and Out[] list are still updated, just like
5317 Mathematica behaves.
5322 Mathematica behaves.
5318
5323
5319 2002-06-25 Fernando Perez <fperez@colorado.edu>
5324 2002-06-25 Fernando Perez <fperez@colorado.edu>
5320
5325
5321 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5326 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5322 .ini extensions for profiels under Windows.
5327 .ini extensions for profiels under Windows.
5323
5328
5324 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5329 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5325 string form. Fix contributed by Alexander Schmolck
5330 string form. Fix contributed by Alexander Schmolck
5326 <a.schmolck-AT-gmx.net>
5331 <a.schmolck-AT-gmx.net>
5327
5332
5328 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5333 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5329 pre-configured Gnuplot instance.
5334 pre-configured Gnuplot instance.
5330
5335
5331 2002-06-21 Fernando Perez <fperez@colorado.edu>
5336 2002-06-21 Fernando Perez <fperez@colorado.edu>
5332
5337
5333 * IPython/numutils.py (exp_safe): new function, works around the
5338 * IPython/numutils.py (exp_safe): new function, works around the
5334 underflow problems in Numeric.
5339 underflow problems in Numeric.
5335 (log2): New fn. Safe log in base 2: returns exact integer answer
5340 (log2): New fn. Safe log in base 2: returns exact integer answer
5336 for exact integer powers of 2.
5341 for exact integer powers of 2.
5337
5342
5338 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5343 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5339 properly.
5344 properly.
5340
5345
5341 2002-06-20 Fernando Perez <fperez@colorado.edu>
5346 2002-06-20 Fernando Perez <fperez@colorado.edu>
5342
5347
5343 * IPython/genutils.py (timing): new function like
5348 * IPython/genutils.py (timing): new function like
5344 Mathematica's. Similar to time_test, but returns more info.
5349 Mathematica's. Similar to time_test, but returns more info.
5345
5350
5346 2002-06-18 Fernando Perez <fperez@colorado.edu>
5351 2002-06-18 Fernando Perez <fperez@colorado.edu>
5347
5352
5348 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5353 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5349 according to Mike Heeter's suggestions.
5354 according to Mike Heeter's suggestions.
5350
5355
5351 2002-06-16 Fernando Perez <fperez@colorado.edu>
5356 2002-06-16 Fernando Perez <fperez@colorado.edu>
5352
5357
5353 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5358 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5354 system. GnuplotMagic is gone as a user-directory option. New files
5359 system. GnuplotMagic is gone as a user-directory option. New files
5355 make it easier to use all the gnuplot stuff both from external
5360 make it easier to use all the gnuplot stuff both from external
5356 programs as well as from IPython. Had to rewrite part of
5361 programs as well as from IPython. Had to rewrite part of
5357 hardcopy() b/c of a strange bug: often the ps files simply don't
5362 hardcopy() b/c of a strange bug: often the ps files simply don't
5358 get created, and require a repeat of the command (often several
5363 get created, and require a repeat of the command (often several
5359 times).
5364 times).
5360
5365
5361 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5366 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5362 resolve output channel at call time, so that if sys.stderr has
5367 resolve output channel at call time, so that if sys.stderr has
5363 been redirected by user this gets honored.
5368 been redirected by user this gets honored.
5364
5369
5365 2002-06-13 Fernando Perez <fperez@colorado.edu>
5370 2002-06-13 Fernando Perez <fperez@colorado.edu>
5366
5371
5367 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5372 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5368 IPShell. Kept a copy with the old names to avoid breaking people's
5373 IPShell. Kept a copy with the old names to avoid breaking people's
5369 embedded code.
5374 embedded code.
5370
5375
5371 * IPython/ipython: simplified it to the bare minimum after
5376 * IPython/ipython: simplified it to the bare minimum after
5372 Holger's suggestions. Added info about how to use it in
5377 Holger's suggestions. Added info about how to use it in
5373 PYTHONSTARTUP.
5378 PYTHONSTARTUP.
5374
5379
5375 * IPython/Shell.py (IPythonShell): changed the options passing
5380 * IPython/Shell.py (IPythonShell): changed the options passing
5376 from a string with funky %s replacements to a straight list. Maybe
5381 from a string with funky %s replacements to a straight list. Maybe
5377 a bit more typing, but it follows sys.argv conventions, so there's
5382 a bit more typing, but it follows sys.argv conventions, so there's
5378 less special-casing to remember.
5383 less special-casing to remember.
5379
5384
5380 2002-06-12 Fernando Perez <fperez@colorado.edu>
5385 2002-06-12 Fernando Perez <fperez@colorado.edu>
5381
5386
5382 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5387 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5383 command. Thanks to a suggestion by Mike Heeter.
5388 command. Thanks to a suggestion by Mike Heeter.
5384 (Magic.magic_pfile): added behavior to look at filenames if given
5389 (Magic.magic_pfile): added behavior to look at filenames if given
5385 arg is not a defined object.
5390 arg is not a defined object.
5386 (Magic.magic_save): New @save function to save code snippets. Also
5391 (Magic.magic_save): New @save function to save code snippets. Also
5387 a Mike Heeter idea.
5392 a Mike Heeter idea.
5388
5393
5389 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5394 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5390 plot() and replot(). Much more convenient now, especially for
5395 plot() and replot(). Much more convenient now, especially for
5391 interactive use.
5396 interactive use.
5392
5397
5393 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5398 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5394 filenames.
5399 filenames.
5395
5400
5396 2002-06-02 Fernando Perez <fperez@colorado.edu>
5401 2002-06-02 Fernando Perez <fperez@colorado.edu>
5397
5402
5398 * IPython/Struct.py (Struct.__init__): modified to admit
5403 * IPython/Struct.py (Struct.__init__): modified to admit
5399 initialization via another struct.
5404 initialization via another struct.
5400
5405
5401 * IPython/genutils.py (SystemExec.__init__): New stateful
5406 * IPython/genutils.py (SystemExec.__init__): New stateful
5402 interface to xsys and bq. Useful for writing system scripts.
5407 interface to xsys and bq. Useful for writing system scripts.
5403
5408
5404 2002-05-30 Fernando Perez <fperez@colorado.edu>
5409 2002-05-30 Fernando Perez <fperez@colorado.edu>
5405
5410
5406 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5411 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5407 documents. This will make the user download smaller (it's getting
5412 documents. This will make the user download smaller (it's getting
5408 too big).
5413 too big).
5409
5414
5410 2002-05-29 Fernando Perez <fperez@colorado.edu>
5415 2002-05-29 Fernando Perez <fperez@colorado.edu>
5411
5416
5412 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5417 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5413 fix problems with shelve and pickle. Seems to work, but I don't
5418 fix problems with shelve and pickle. Seems to work, but I don't
5414 know if corner cases break it. Thanks to Mike Heeter
5419 know if corner cases break it. Thanks to Mike Heeter
5415 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5420 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5416
5421
5417 2002-05-24 Fernando Perez <fperez@colorado.edu>
5422 2002-05-24 Fernando Perez <fperez@colorado.edu>
5418
5423
5419 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5424 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5420 macros having broken.
5425 macros having broken.
5421
5426
5422 2002-05-21 Fernando Perez <fperez@colorado.edu>
5427 2002-05-21 Fernando Perez <fperez@colorado.edu>
5423
5428
5424 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5429 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5425 introduced logging bug: all history before logging started was
5430 introduced logging bug: all history before logging started was
5426 being written one character per line! This came from the redesign
5431 being written one character per line! This came from the redesign
5427 of the input history as a special list which slices to strings,
5432 of the input history as a special list which slices to strings,
5428 not to lists.
5433 not to lists.
5429
5434
5430 2002-05-20 Fernando Perez <fperez@colorado.edu>
5435 2002-05-20 Fernando Perez <fperez@colorado.edu>
5431
5436
5432 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5437 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5433 be an attribute of all classes in this module. The design of these
5438 be an attribute of all classes in this module. The design of these
5434 classes needs some serious overhauling.
5439 classes needs some serious overhauling.
5435
5440
5436 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5441 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5437 which was ignoring '_' in option names.
5442 which was ignoring '_' in option names.
5438
5443
5439 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5444 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5440 'Verbose_novars' to 'Context' and made it the new default. It's a
5445 'Verbose_novars' to 'Context' and made it the new default. It's a
5441 bit more readable and also safer than verbose.
5446 bit more readable and also safer than verbose.
5442
5447
5443 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5448 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5444 triple-quoted strings.
5449 triple-quoted strings.
5445
5450
5446 * IPython/OInspect.py (__all__): new module exposing the object
5451 * IPython/OInspect.py (__all__): new module exposing the object
5447 introspection facilities. Now the corresponding magics are dummy
5452 introspection facilities. Now the corresponding magics are dummy
5448 wrappers around this. Having this module will make it much easier
5453 wrappers around this. Having this module will make it much easier
5449 to put these functions into our modified pdb.
5454 to put these functions into our modified pdb.
5450 This new object inspector system uses the new colorizing module,
5455 This new object inspector system uses the new colorizing module,
5451 so source code and other things are nicely syntax highlighted.
5456 so source code and other things are nicely syntax highlighted.
5452
5457
5453 2002-05-18 Fernando Perez <fperez@colorado.edu>
5458 2002-05-18 Fernando Perez <fperez@colorado.edu>
5454
5459
5455 * IPython/ColorANSI.py: Split the coloring tools into a separate
5460 * IPython/ColorANSI.py: Split the coloring tools into a separate
5456 module so I can use them in other code easier (they were part of
5461 module so I can use them in other code easier (they were part of
5457 ultraTB).
5462 ultraTB).
5458
5463
5459 2002-05-17 Fernando Perez <fperez@colorado.edu>
5464 2002-05-17 Fernando Perez <fperez@colorado.edu>
5460
5465
5461 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5466 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5462 fixed it to set the global 'g' also to the called instance, as
5467 fixed it to set the global 'g' also to the called instance, as
5463 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5468 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5464 user's 'g' variables).
5469 user's 'g' variables).
5465
5470
5466 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5471 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5467 global variables (aliases to _ih,_oh) so that users which expect
5472 global variables (aliases to _ih,_oh) so that users which expect
5468 In[5] or Out[7] to work aren't unpleasantly surprised.
5473 In[5] or Out[7] to work aren't unpleasantly surprised.
5469 (InputList.__getslice__): new class to allow executing slices of
5474 (InputList.__getslice__): new class to allow executing slices of
5470 input history directly. Very simple class, complements the use of
5475 input history directly. Very simple class, complements the use of
5471 macros.
5476 macros.
5472
5477
5473 2002-05-16 Fernando Perez <fperez@colorado.edu>
5478 2002-05-16 Fernando Perez <fperez@colorado.edu>
5474
5479
5475 * setup.py (docdirbase): make doc directory be just doc/IPython
5480 * setup.py (docdirbase): make doc directory be just doc/IPython
5476 without version numbers, it will reduce clutter for users.
5481 without version numbers, it will reduce clutter for users.
5477
5482
5478 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5483 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5479 execfile call to prevent possible memory leak. See for details:
5484 execfile call to prevent possible memory leak. See for details:
5480 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5485 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5481
5486
5482 2002-05-15 Fernando Perez <fperez@colorado.edu>
5487 2002-05-15 Fernando Perez <fperez@colorado.edu>
5483
5488
5484 * IPython/Magic.py (Magic.magic_psource): made the object
5489 * IPython/Magic.py (Magic.magic_psource): made the object
5485 introspection names be more standard: pdoc, pdef, pfile and
5490 introspection names be more standard: pdoc, pdef, pfile and
5486 psource. They all print/page their output, and it makes
5491 psource. They all print/page their output, and it makes
5487 remembering them easier. Kept old names for compatibility as
5492 remembering them easier. Kept old names for compatibility as
5488 aliases.
5493 aliases.
5489
5494
5490 2002-05-14 Fernando Perez <fperez@colorado.edu>
5495 2002-05-14 Fernando Perez <fperez@colorado.edu>
5491
5496
5492 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5497 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5493 what the mouse problem was. The trick is to use gnuplot with temp
5498 what the mouse problem was. The trick is to use gnuplot with temp
5494 files and NOT with pipes (for data communication), because having
5499 files and NOT with pipes (for data communication), because having
5495 both pipes and the mouse on is bad news.
5500 both pipes and the mouse on is bad news.
5496
5501
5497 2002-05-13 Fernando Perez <fperez@colorado.edu>
5502 2002-05-13 Fernando Perez <fperez@colorado.edu>
5498
5503
5499 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5504 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5500 bug. Information would be reported about builtins even when
5505 bug. Information would be reported about builtins even when
5501 user-defined functions overrode them.
5506 user-defined functions overrode them.
5502
5507
5503 2002-05-11 Fernando Perez <fperez@colorado.edu>
5508 2002-05-11 Fernando Perez <fperez@colorado.edu>
5504
5509
5505 * IPython/__init__.py (__all__): removed FlexCompleter from
5510 * IPython/__init__.py (__all__): removed FlexCompleter from
5506 __all__ so that things don't fail in platforms without readline.
5511 __all__ so that things don't fail in platforms without readline.
5507
5512
5508 2002-05-10 Fernando Perez <fperez@colorado.edu>
5513 2002-05-10 Fernando Perez <fperez@colorado.edu>
5509
5514
5510 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5515 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5511 it requires Numeric, effectively making Numeric a dependency for
5516 it requires Numeric, effectively making Numeric a dependency for
5512 IPython.
5517 IPython.
5513
5518
5514 * Released 0.2.13
5519 * Released 0.2.13
5515
5520
5516 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5521 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5517 profiler interface. Now all the major options from the profiler
5522 profiler interface. Now all the major options from the profiler
5518 module are directly supported in IPython, both for single
5523 module are directly supported in IPython, both for single
5519 expressions (@prun) and for full programs (@run -p).
5524 expressions (@prun) and for full programs (@run -p).
5520
5525
5521 2002-05-09 Fernando Perez <fperez@colorado.edu>
5526 2002-05-09 Fernando Perez <fperez@colorado.edu>
5522
5527
5523 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5528 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5524 magic properly formatted for screen.
5529 magic properly formatted for screen.
5525
5530
5526 * setup.py (make_shortcut): Changed things to put pdf version in
5531 * setup.py (make_shortcut): Changed things to put pdf version in
5527 doc/ instead of doc/manual (had to change lyxport a bit).
5532 doc/ instead of doc/manual (had to change lyxport a bit).
5528
5533
5529 * IPython/Magic.py (Profile.string_stats): made profile runs go
5534 * IPython/Magic.py (Profile.string_stats): made profile runs go
5530 through pager (they are long and a pager allows searching, saving,
5535 through pager (they are long and a pager allows searching, saving,
5531 etc.)
5536 etc.)
5532
5537
5533 2002-05-08 Fernando Perez <fperez@colorado.edu>
5538 2002-05-08 Fernando Perez <fperez@colorado.edu>
5534
5539
5535 * Released 0.2.12
5540 * Released 0.2.12
5536
5541
5537 2002-05-06 Fernando Perez <fperez@colorado.edu>
5542 2002-05-06 Fernando Perez <fperez@colorado.edu>
5538
5543
5539 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5544 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5540 introduced); 'hist n1 n2' was broken.
5545 introduced); 'hist n1 n2' was broken.
5541 (Magic.magic_pdb): added optional on/off arguments to @pdb
5546 (Magic.magic_pdb): added optional on/off arguments to @pdb
5542 (Magic.magic_run): added option -i to @run, which executes code in
5547 (Magic.magic_run): added option -i to @run, which executes code in
5543 the IPython namespace instead of a clean one. Also added @irun as
5548 the IPython namespace instead of a clean one. Also added @irun as
5544 an alias to @run -i.
5549 an alias to @run -i.
5545
5550
5546 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5551 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5547 fixed (it didn't really do anything, the namespaces were wrong).
5552 fixed (it didn't really do anything, the namespaces were wrong).
5548
5553
5549 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5554 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5550
5555
5551 * IPython/__init__.py (__all__): Fixed package namespace, now
5556 * IPython/__init__.py (__all__): Fixed package namespace, now
5552 'import IPython' does give access to IPython.<all> as
5557 'import IPython' does give access to IPython.<all> as
5553 expected. Also renamed __release__ to Release.
5558 expected. Also renamed __release__ to Release.
5554
5559
5555 * IPython/Debugger.py (__license__): created new Pdb class which
5560 * IPython/Debugger.py (__license__): created new Pdb class which
5556 functions like a drop-in for the normal pdb.Pdb but does NOT
5561 functions like a drop-in for the normal pdb.Pdb but does NOT
5557 import readline by default. This way it doesn't muck up IPython's
5562 import readline by default. This way it doesn't muck up IPython's
5558 readline handling, and now tab-completion finally works in the
5563 readline handling, and now tab-completion finally works in the
5559 debugger -- sort of. It completes things globally visible, but the
5564 debugger -- sort of. It completes things globally visible, but the
5560 completer doesn't track the stack as pdb walks it. That's a bit
5565 completer doesn't track the stack as pdb walks it. That's a bit
5561 tricky, and I'll have to implement it later.
5566 tricky, and I'll have to implement it later.
5562
5567
5563 2002-05-05 Fernando Perez <fperez@colorado.edu>
5568 2002-05-05 Fernando Perez <fperez@colorado.edu>
5564
5569
5565 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5570 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5566 magic docstrings when printed via ? (explicit \'s were being
5571 magic docstrings when printed via ? (explicit \'s were being
5567 printed).
5572 printed).
5568
5573
5569 * IPython/ipmaker.py (make_IPython): fixed namespace
5574 * IPython/ipmaker.py (make_IPython): fixed namespace
5570 identification bug. Now variables loaded via logs or command-line
5575 identification bug. Now variables loaded via logs or command-line
5571 files are recognized in the interactive namespace by @who.
5576 files are recognized in the interactive namespace by @who.
5572
5577
5573 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5578 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5574 log replay system stemming from the string form of Structs.
5579 log replay system stemming from the string form of Structs.
5575
5580
5576 * IPython/Magic.py (Macro.__init__): improved macros to properly
5581 * IPython/Magic.py (Macro.__init__): improved macros to properly
5577 handle magic commands in them.
5582 handle magic commands in them.
5578 (Magic.magic_logstart): usernames are now expanded so 'logstart
5583 (Magic.magic_logstart): usernames are now expanded so 'logstart
5579 ~/mylog' now works.
5584 ~/mylog' now works.
5580
5585
5581 * IPython/iplib.py (complete): fixed bug where paths starting with
5586 * IPython/iplib.py (complete): fixed bug where paths starting with
5582 '/' would be completed as magic names.
5587 '/' would be completed as magic names.
5583
5588
5584 2002-05-04 Fernando Perez <fperez@colorado.edu>
5589 2002-05-04 Fernando Perez <fperez@colorado.edu>
5585
5590
5586 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5591 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5587 allow running full programs under the profiler's control.
5592 allow running full programs under the profiler's control.
5588
5593
5589 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5594 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5590 mode to report exceptions verbosely but without formatting
5595 mode to report exceptions verbosely but without formatting
5591 variables. This addresses the issue of ipython 'freezing' (it's
5596 variables. This addresses the issue of ipython 'freezing' (it's
5592 not frozen, but caught in an expensive formatting loop) when huge
5597 not frozen, but caught in an expensive formatting loop) when huge
5593 variables are in the context of an exception.
5598 variables are in the context of an exception.
5594 (VerboseTB.text): Added '--->' markers at line where exception was
5599 (VerboseTB.text): Added '--->' markers at line where exception was
5595 triggered. Much clearer to read, especially in NoColor modes.
5600 triggered. Much clearer to read, especially in NoColor modes.
5596
5601
5597 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5602 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5598 implemented in reverse when changing to the new parse_options().
5603 implemented in reverse when changing to the new parse_options().
5599
5604
5600 2002-05-03 Fernando Perez <fperez@colorado.edu>
5605 2002-05-03 Fernando Perez <fperez@colorado.edu>
5601
5606
5602 * IPython/Magic.py (Magic.parse_options): new function so that
5607 * IPython/Magic.py (Magic.parse_options): new function so that
5603 magics can parse options easier.
5608 magics can parse options easier.
5604 (Magic.magic_prun): new function similar to profile.run(),
5609 (Magic.magic_prun): new function similar to profile.run(),
5605 suggested by Chris Hart.
5610 suggested by Chris Hart.
5606 (Magic.magic_cd): fixed behavior so that it only changes if
5611 (Magic.magic_cd): fixed behavior so that it only changes if
5607 directory actually is in history.
5612 directory actually is in history.
5608
5613
5609 * IPython/usage.py (__doc__): added information about potential
5614 * IPython/usage.py (__doc__): added information about potential
5610 slowness of Verbose exception mode when there are huge data
5615 slowness of Verbose exception mode when there are huge data
5611 structures to be formatted (thanks to Archie Paulson).
5616 structures to be formatted (thanks to Archie Paulson).
5612
5617
5613 * IPython/ipmaker.py (make_IPython): Changed default logging
5618 * IPython/ipmaker.py (make_IPython): Changed default logging
5614 (when simply called with -log) to use curr_dir/ipython.log in
5619 (when simply called with -log) to use curr_dir/ipython.log in
5615 rotate mode. Fixed crash which was occuring with -log before
5620 rotate mode. Fixed crash which was occuring with -log before
5616 (thanks to Jim Boyle).
5621 (thanks to Jim Boyle).
5617
5622
5618 2002-05-01 Fernando Perez <fperez@colorado.edu>
5623 2002-05-01 Fernando Perez <fperez@colorado.edu>
5619
5624
5620 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5625 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5621 was nasty -- though somewhat of a corner case).
5626 was nasty -- though somewhat of a corner case).
5622
5627
5623 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5628 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5624 text (was a bug).
5629 text (was a bug).
5625
5630
5626 2002-04-30 Fernando Perez <fperez@colorado.edu>
5631 2002-04-30 Fernando Perez <fperez@colorado.edu>
5627
5632
5628 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5633 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5629 a print after ^D or ^C from the user so that the In[] prompt
5634 a print after ^D or ^C from the user so that the In[] prompt
5630 doesn't over-run the gnuplot one.
5635 doesn't over-run the gnuplot one.
5631
5636
5632 2002-04-29 Fernando Perez <fperez@colorado.edu>
5637 2002-04-29 Fernando Perez <fperez@colorado.edu>
5633
5638
5634 * Released 0.2.10
5639 * Released 0.2.10
5635
5640
5636 * IPython/__release__.py (version): get date dynamically.
5641 * IPython/__release__.py (version): get date dynamically.
5637
5642
5638 * Misc. documentation updates thanks to Arnd's comments. Also ran
5643 * Misc. documentation updates thanks to Arnd's comments. Also ran
5639 a full spellcheck on the manual (hadn't been done in a while).
5644 a full spellcheck on the manual (hadn't been done in a while).
5640
5645
5641 2002-04-27 Fernando Perez <fperez@colorado.edu>
5646 2002-04-27 Fernando Perez <fperez@colorado.edu>
5642
5647
5643 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5648 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5644 starting a log in mid-session would reset the input history list.
5649 starting a log in mid-session would reset the input history list.
5645
5650
5646 2002-04-26 Fernando Perez <fperez@colorado.edu>
5651 2002-04-26 Fernando Perez <fperez@colorado.edu>
5647
5652
5648 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5653 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5649 all files were being included in an update. Now anything in
5654 all files were being included in an update. Now anything in
5650 UserConfig that matches [A-Za-z]*.py will go (this excludes
5655 UserConfig that matches [A-Za-z]*.py will go (this excludes
5651 __init__.py)
5656 __init__.py)
5652
5657
5653 2002-04-25 Fernando Perez <fperez@colorado.edu>
5658 2002-04-25 Fernando Perez <fperez@colorado.edu>
5654
5659
5655 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5660 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5656 to __builtins__ so that any form of embedded or imported code can
5661 to __builtins__ so that any form of embedded or imported code can
5657 test for being inside IPython.
5662 test for being inside IPython.
5658
5663
5659 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5664 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5660 changed to GnuplotMagic because it's now an importable module,
5665 changed to GnuplotMagic because it's now an importable module,
5661 this makes the name follow that of the standard Gnuplot module.
5666 this makes the name follow that of the standard Gnuplot module.
5662 GnuplotMagic can now be loaded at any time in mid-session.
5667 GnuplotMagic can now be loaded at any time in mid-session.
5663
5668
5664 2002-04-24 Fernando Perez <fperez@colorado.edu>
5669 2002-04-24 Fernando Perez <fperez@colorado.edu>
5665
5670
5666 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5671 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5667 the globals (IPython has its own namespace) and the
5672 the globals (IPython has its own namespace) and the
5668 PhysicalQuantity stuff is much better anyway.
5673 PhysicalQuantity stuff is much better anyway.
5669
5674
5670 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5675 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5671 embedding example to standard user directory for
5676 embedding example to standard user directory for
5672 distribution. Also put it in the manual.
5677 distribution. Also put it in the manual.
5673
5678
5674 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5679 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5675 instance as first argument (so it doesn't rely on some obscure
5680 instance as first argument (so it doesn't rely on some obscure
5676 hidden global).
5681 hidden global).
5677
5682
5678 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5683 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5679 delimiters. While it prevents ().TAB from working, it allows
5684 delimiters. While it prevents ().TAB from working, it allows
5680 completions in open (... expressions. This is by far a more common
5685 completions in open (... expressions. This is by far a more common
5681 case.
5686 case.
5682
5687
5683 2002-04-23 Fernando Perez <fperez@colorado.edu>
5688 2002-04-23 Fernando Perez <fperez@colorado.edu>
5684
5689
5685 * IPython/Extensions/InterpreterPasteInput.py: new
5690 * IPython/Extensions/InterpreterPasteInput.py: new
5686 syntax-processing module for pasting lines with >>> or ... at the
5691 syntax-processing module for pasting lines with >>> or ... at the
5687 start.
5692 start.
5688
5693
5689 * IPython/Extensions/PhysicalQ_Interactive.py
5694 * IPython/Extensions/PhysicalQ_Interactive.py
5690 (PhysicalQuantityInteractive.__int__): fixed to work with either
5695 (PhysicalQuantityInteractive.__int__): fixed to work with either
5691 Numeric or math.
5696 Numeric or math.
5692
5697
5693 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5698 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5694 provided profiles. Now we have:
5699 provided profiles. Now we have:
5695 -math -> math module as * and cmath with its own namespace.
5700 -math -> math module as * and cmath with its own namespace.
5696 -numeric -> Numeric as *, plus gnuplot & grace
5701 -numeric -> Numeric as *, plus gnuplot & grace
5697 -physics -> same as before
5702 -physics -> same as before
5698
5703
5699 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5704 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5700 user-defined magics wouldn't be found by @magic if they were
5705 user-defined magics wouldn't be found by @magic if they were
5701 defined as class methods. Also cleaned up the namespace search
5706 defined as class methods. Also cleaned up the namespace search
5702 logic and the string building (to use %s instead of many repeated
5707 logic and the string building (to use %s instead of many repeated
5703 string adds).
5708 string adds).
5704
5709
5705 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5710 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5706 of user-defined magics to operate with class methods (cleaner, in
5711 of user-defined magics to operate with class methods (cleaner, in
5707 line with the gnuplot code).
5712 line with the gnuplot code).
5708
5713
5709 2002-04-22 Fernando Perez <fperez@colorado.edu>
5714 2002-04-22 Fernando Perez <fperez@colorado.edu>
5710
5715
5711 * setup.py: updated dependency list so that manual is updated when
5716 * setup.py: updated dependency list so that manual is updated when
5712 all included files change.
5717 all included files change.
5713
5718
5714 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5719 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5715 the delimiter removal option (the fix is ugly right now).
5720 the delimiter removal option (the fix is ugly right now).
5716
5721
5717 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5722 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5718 all of the math profile (quicker loading, no conflict between
5723 all of the math profile (quicker loading, no conflict between
5719 g-9.8 and g-gnuplot).
5724 g-9.8 and g-gnuplot).
5720
5725
5721 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5726 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5722 name of post-mortem files to IPython_crash_report.txt.
5727 name of post-mortem files to IPython_crash_report.txt.
5723
5728
5724 * Cleanup/update of the docs. Added all the new readline info and
5729 * Cleanup/update of the docs. Added all the new readline info and
5725 formatted all lists as 'real lists'.
5730 formatted all lists as 'real lists'.
5726
5731
5727 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5732 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5728 tab-completion options, since the full readline parse_and_bind is
5733 tab-completion options, since the full readline parse_and_bind is
5729 now accessible.
5734 now accessible.
5730
5735
5731 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5736 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5732 handling of readline options. Now users can specify any string to
5737 handling of readline options. Now users can specify any string to
5733 be passed to parse_and_bind(), as well as the delimiters to be
5738 be passed to parse_and_bind(), as well as the delimiters to be
5734 removed.
5739 removed.
5735 (InteractiveShell.__init__): Added __name__ to the global
5740 (InteractiveShell.__init__): Added __name__ to the global
5736 namespace so that things like Itpl which rely on its existence
5741 namespace so that things like Itpl which rely on its existence
5737 don't crash.
5742 don't crash.
5738 (InteractiveShell._prefilter): Defined the default with a _ so
5743 (InteractiveShell._prefilter): Defined the default with a _ so
5739 that prefilter() is easier to override, while the default one
5744 that prefilter() is easier to override, while the default one
5740 remains available.
5745 remains available.
5741
5746
5742 2002-04-18 Fernando Perez <fperez@colorado.edu>
5747 2002-04-18 Fernando Perez <fperez@colorado.edu>
5743
5748
5744 * Added information about pdb in the docs.
5749 * Added information about pdb in the docs.
5745
5750
5746 2002-04-17 Fernando Perez <fperez@colorado.edu>
5751 2002-04-17 Fernando Perez <fperez@colorado.edu>
5747
5752
5748 * IPython/ipmaker.py (make_IPython): added rc_override option to
5753 * IPython/ipmaker.py (make_IPython): added rc_override option to
5749 allow passing config options at creation time which may override
5754 allow passing config options at creation time which may override
5750 anything set in the config files or command line. This is
5755 anything set in the config files or command line. This is
5751 particularly useful for configuring embedded instances.
5756 particularly useful for configuring embedded instances.
5752
5757
5753 2002-04-15 Fernando Perez <fperez@colorado.edu>
5758 2002-04-15 Fernando Perez <fperez@colorado.edu>
5754
5759
5755 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5760 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5756 crash embedded instances because of the input cache falling out of
5761 crash embedded instances because of the input cache falling out of
5757 sync with the output counter.
5762 sync with the output counter.
5758
5763
5759 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5764 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5760 mode which calls pdb after an uncaught exception in IPython itself.
5765 mode which calls pdb after an uncaught exception in IPython itself.
5761
5766
5762 2002-04-14 Fernando Perez <fperez@colorado.edu>
5767 2002-04-14 Fernando Perez <fperez@colorado.edu>
5763
5768
5764 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5769 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5765 readline, fix it back after each call.
5770 readline, fix it back after each call.
5766
5771
5767 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5772 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5768 method to force all access via __call__(), which guarantees that
5773 method to force all access via __call__(), which guarantees that
5769 traceback references are properly deleted.
5774 traceback references are properly deleted.
5770
5775
5771 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5776 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5772 improve printing when pprint is in use.
5777 improve printing when pprint is in use.
5773
5778
5774 2002-04-13 Fernando Perez <fperez@colorado.edu>
5779 2002-04-13 Fernando Perez <fperez@colorado.edu>
5775
5780
5776 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5781 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5777 exceptions aren't caught anymore. If the user triggers one, he
5782 exceptions aren't caught anymore. If the user triggers one, he
5778 should know why he's doing it and it should go all the way up,
5783 should know why he's doing it and it should go all the way up,
5779 just like any other exception. So now @abort will fully kill the
5784 just like any other exception. So now @abort will fully kill the
5780 embedded interpreter and the embedding code (unless that happens
5785 embedded interpreter and the embedding code (unless that happens
5781 to catch SystemExit).
5786 to catch SystemExit).
5782
5787
5783 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5788 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5784 and a debugger() method to invoke the interactive pdb debugger
5789 and a debugger() method to invoke the interactive pdb debugger
5785 after printing exception information. Also added the corresponding
5790 after printing exception information. Also added the corresponding
5786 -pdb option and @pdb magic to control this feature, and updated
5791 -pdb option and @pdb magic to control this feature, and updated
5787 the docs. After a suggestion from Christopher Hart
5792 the docs. After a suggestion from Christopher Hart
5788 (hart-AT-caltech.edu).
5793 (hart-AT-caltech.edu).
5789
5794
5790 2002-04-12 Fernando Perez <fperez@colorado.edu>
5795 2002-04-12 Fernando Perez <fperez@colorado.edu>
5791
5796
5792 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5797 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5793 the exception handlers defined by the user (not the CrashHandler)
5798 the exception handlers defined by the user (not the CrashHandler)
5794 so that user exceptions don't trigger an ipython bug report.
5799 so that user exceptions don't trigger an ipython bug report.
5795
5800
5796 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5801 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5797 configurable (it should have always been so).
5802 configurable (it should have always been so).
5798
5803
5799 2002-03-26 Fernando Perez <fperez@colorado.edu>
5804 2002-03-26 Fernando Perez <fperez@colorado.edu>
5800
5805
5801 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5806 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5802 and there to fix embedding namespace issues. This should all be
5807 and there to fix embedding namespace issues. This should all be
5803 done in a more elegant way.
5808 done in a more elegant way.
5804
5809
5805 2002-03-25 Fernando Perez <fperez@colorado.edu>
5810 2002-03-25 Fernando Perez <fperez@colorado.edu>
5806
5811
5807 * IPython/genutils.py (get_home_dir): Try to make it work under
5812 * IPython/genutils.py (get_home_dir): Try to make it work under
5808 win9x also.
5813 win9x also.
5809
5814
5810 2002-03-20 Fernando Perez <fperez@colorado.edu>
5815 2002-03-20 Fernando Perez <fperez@colorado.edu>
5811
5816
5812 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5817 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5813 sys.displayhook untouched upon __init__.
5818 sys.displayhook untouched upon __init__.
5814
5819
5815 2002-03-19 Fernando Perez <fperez@colorado.edu>
5820 2002-03-19 Fernando Perez <fperez@colorado.edu>
5816
5821
5817 * Released 0.2.9 (for embedding bug, basically).
5822 * Released 0.2.9 (for embedding bug, basically).
5818
5823
5819 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5824 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5820 exceptions so that enclosing shell's state can be restored.
5825 exceptions so that enclosing shell's state can be restored.
5821
5826
5822 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5827 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5823 naming conventions in the .ipython/ dir.
5828 naming conventions in the .ipython/ dir.
5824
5829
5825 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5830 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5826 from delimiters list so filenames with - in them get expanded.
5831 from delimiters list so filenames with - in them get expanded.
5827
5832
5828 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5833 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5829 sys.displayhook not being properly restored after an embedded call.
5834 sys.displayhook not being properly restored after an embedded call.
5830
5835
5831 2002-03-18 Fernando Perez <fperez@colorado.edu>
5836 2002-03-18 Fernando Perez <fperez@colorado.edu>
5832
5837
5833 * Released 0.2.8
5838 * Released 0.2.8
5834
5839
5835 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5840 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5836 some files weren't being included in a -upgrade.
5841 some files weren't being included in a -upgrade.
5837 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5842 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5838 on' so that the first tab completes.
5843 on' so that the first tab completes.
5839 (InteractiveShell.handle_magic): fixed bug with spaces around
5844 (InteractiveShell.handle_magic): fixed bug with spaces around
5840 quotes breaking many magic commands.
5845 quotes breaking many magic commands.
5841
5846
5842 * setup.py: added note about ignoring the syntax error messages at
5847 * setup.py: added note about ignoring the syntax error messages at
5843 installation.
5848 installation.
5844
5849
5845 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5850 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5846 streamlining the gnuplot interface, now there's only one magic @gp.
5851 streamlining the gnuplot interface, now there's only one magic @gp.
5847
5852
5848 2002-03-17 Fernando Perez <fperez@colorado.edu>
5853 2002-03-17 Fernando Perez <fperez@colorado.edu>
5849
5854
5850 * IPython/UserConfig/magic_gnuplot.py: new name for the
5855 * IPython/UserConfig/magic_gnuplot.py: new name for the
5851 example-magic_pm.py file. Much enhanced system, now with a shell
5856 example-magic_pm.py file. Much enhanced system, now with a shell
5852 for communicating directly with gnuplot, one command at a time.
5857 for communicating directly with gnuplot, one command at a time.
5853
5858
5854 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5859 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5855 setting __name__=='__main__'.
5860 setting __name__=='__main__'.
5856
5861
5857 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5862 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5858 mini-shell for accessing gnuplot from inside ipython. Should
5863 mini-shell for accessing gnuplot from inside ipython. Should
5859 extend it later for grace access too. Inspired by Arnd's
5864 extend it later for grace access too. Inspired by Arnd's
5860 suggestion.
5865 suggestion.
5861
5866
5862 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5867 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5863 calling magic functions with () in their arguments. Thanks to Arnd
5868 calling magic functions with () in their arguments. Thanks to Arnd
5864 Baecker for pointing this to me.
5869 Baecker for pointing this to me.
5865
5870
5866 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5871 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5867 infinitely for integer or complex arrays (only worked with floats).
5872 infinitely for integer or complex arrays (only worked with floats).
5868
5873
5869 2002-03-16 Fernando Perez <fperez@colorado.edu>
5874 2002-03-16 Fernando Perez <fperez@colorado.edu>
5870
5875
5871 * setup.py: Merged setup and setup_windows into a single script
5876 * setup.py: Merged setup and setup_windows into a single script
5872 which properly handles things for windows users.
5877 which properly handles things for windows users.
5873
5878
5874 2002-03-15 Fernando Perez <fperez@colorado.edu>
5879 2002-03-15 Fernando Perez <fperez@colorado.edu>
5875
5880
5876 * Big change to the manual: now the magics are all automatically
5881 * Big change to the manual: now the magics are all automatically
5877 documented. This information is generated from their docstrings
5882 documented. This information is generated from their docstrings
5878 and put in a latex file included by the manual lyx file. This way
5883 and put in a latex file included by the manual lyx file. This way
5879 we get always up to date information for the magics. The manual
5884 we get always up to date information for the magics. The manual
5880 now also has proper version information, also auto-synced.
5885 now also has proper version information, also auto-synced.
5881
5886
5882 For this to work, an undocumented --magic_docstrings option was added.
5887 For this to work, an undocumented --magic_docstrings option was added.
5883
5888
5884 2002-03-13 Fernando Perez <fperez@colorado.edu>
5889 2002-03-13 Fernando Perez <fperez@colorado.edu>
5885
5890
5886 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5891 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5887 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5892 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5888
5893
5889 2002-03-12 Fernando Perez <fperez@colorado.edu>
5894 2002-03-12 Fernando Perez <fperez@colorado.edu>
5890
5895
5891 * IPython/ultraTB.py (TermColors): changed color escapes again to
5896 * IPython/ultraTB.py (TermColors): changed color escapes again to
5892 fix the (old, reintroduced) line-wrapping bug. Basically, if
5897 fix the (old, reintroduced) line-wrapping bug. Basically, if
5893 \001..\002 aren't given in the color escapes, lines get wrapped
5898 \001..\002 aren't given in the color escapes, lines get wrapped
5894 weirdly. But giving those screws up old xterms and emacs terms. So
5899 weirdly. But giving those screws up old xterms and emacs terms. So
5895 I added some logic for emacs terms to be ok, but I can't identify old
5900 I added some logic for emacs terms to be ok, but I can't identify old
5896 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5901 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5897
5902
5898 2002-03-10 Fernando Perez <fperez@colorado.edu>
5903 2002-03-10 Fernando Perez <fperez@colorado.edu>
5899
5904
5900 * IPython/usage.py (__doc__): Various documentation cleanups and
5905 * IPython/usage.py (__doc__): Various documentation cleanups and
5901 updates, both in usage docstrings and in the manual.
5906 updates, both in usage docstrings and in the manual.
5902
5907
5903 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5908 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5904 handling of caching. Set minimum acceptabe value for having a
5909 handling of caching. Set minimum acceptabe value for having a
5905 cache at 20 values.
5910 cache at 20 values.
5906
5911
5907 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5912 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5908 install_first_time function to a method, renamed it and added an
5913 install_first_time function to a method, renamed it and added an
5909 'upgrade' mode. Now people can update their config directory with
5914 'upgrade' mode. Now people can update their config directory with
5910 a simple command line switch (-upgrade, also new).
5915 a simple command line switch (-upgrade, also new).
5911
5916
5912 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5917 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5913 @file (convenient for automagic users under Python >= 2.2).
5918 @file (convenient for automagic users under Python >= 2.2).
5914 Removed @files (it seemed more like a plural than an abbrev. of
5919 Removed @files (it seemed more like a plural than an abbrev. of
5915 'file show').
5920 'file show').
5916
5921
5917 * IPython/iplib.py (install_first_time): Fixed crash if there were
5922 * IPython/iplib.py (install_first_time): Fixed crash if there were
5918 backup files ('~') in .ipython/ install directory.
5923 backup files ('~') in .ipython/ install directory.
5919
5924
5920 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5925 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5921 system. Things look fine, but these changes are fairly
5926 system. Things look fine, but these changes are fairly
5922 intrusive. Test them for a few days.
5927 intrusive. Test them for a few days.
5923
5928
5924 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5929 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5925 the prompts system. Now all in/out prompt strings are user
5930 the prompts system. Now all in/out prompt strings are user
5926 controllable. This is particularly useful for embedding, as one
5931 controllable. This is particularly useful for embedding, as one
5927 can tag embedded instances with particular prompts.
5932 can tag embedded instances with particular prompts.
5928
5933
5929 Also removed global use of sys.ps1/2, which now allows nested
5934 Also removed global use of sys.ps1/2, which now allows nested
5930 embeddings without any problems. Added command-line options for
5935 embeddings without any problems. Added command-line options for
5931 the prompt strings.
5936 the prompt strings.
5932
5937
5933 2002-03-08 Fernando Perez <fperez@colorado.edu>
5938 2002-03-08 Fernando Perez <fperez@colorado.edu>
5934
5939
5935 * IPython/UserConfig/example-embed-short.py (ipshell): added
5940 * IPython/UserConfig/example-embed-short.py (ipshell): added
5936 example file with the bare minimum code for embedding.
5941 example file with the bare minimum code for embedding.
5937
5942
5938 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5943 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5939 functionality for the embeddable shell to be activated/deactivated
5944 functionality for the embeddable shell to be activated/deactivated
5940 either globally or at each call.
5945 either globally or at each call.
5941
5946
5942 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5947 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5943 rewriting the prompt with '--->' for auto-inputs with proper
5948 rewriting the prompt with '--->' for auto-inputs with proper
5944 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5949 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5945 this is handled by the prompts class itself, as it should.
5950 this is handled by the prompts class itself, as it should.
5946
5951
5947 2002-03-05 Fernando Perez <fperez@colorado.edu>
5952 2002-03-05 Fernando Perez <fperez@colorado.edu>
5948
5953
5949 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5954 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5950 @logstart to avoid name clashes with the math log function.
5955 @logstart to avoid name clashes with the math log function.
5951
5956
5952 * Big updates to X/Emacs section of the manual.
5957 * Big updates to X/Emacs section of the manual.
5953
5958
5954 * Removed ipython_emacs. Milan explained to me how to pass
5959 * Removed ipython_emacs. Milan explained to me how to pass
5955 arguments to ipython through Emacs. Some day I'm going to end up
5960 arguments to ipython through Emacs. Some day I'm going to end up
5956 learning some lisp...
5961 learning some lisp...
5957
5962
5958 2002-03-04 Fernando Perez <fperez@colorado.edu>
5963 2002-03-04 Fernando Perez <fperez@colorado.edu>
5959
5964
5960 * IPython/ipython_emacs: Created script to be used as the
5965 * IPython/ipython_emacs: Created script to be used as the
5961 py-python-command Emacs variable so we can pass IPython
5966 py-python-command Emacs variable so we can pass IPython
5962 parameters. I can't figure out how to tell Emacs directly to pass
5967 parameters. I can't figure out how to tell Emacs directly to pass
5963 parameters to IPython, so a dummy shell script will do it.
5968 parameters to IPython, so a dummy shell script will do it.
5964
5969
5965 Other enhancements made for things to work better under Emacs'
5970 Other enhancements made for things to work better under Emacs'
5966 various types of terminals. Many thanks to Milan Zamazal
5971 various types of terminals. Many thanks to Milan Zamazal
5967 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5972 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5968
5973
5969 2002-03-01 Fernando Perez <fperez@colorado.edu>
5974 2002-03-01 Fernando Perez <fperez@colorado.edu>
5970
5975
5971 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5976 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5972 that loading of readline is now optional. This gives better
5977 that loading of readline is now optional. This gives better
5973 control to emacs users.
5978 control to emacs users.
5974
5979
5975 * IPython/ultraTB.py (__date__): Modified color escape sequences
5980 * IPython/ultraTB.py (__date__): Modified color escape sequences
5976 and now things work fine under xterm and in Emacs' term buffers
5981 and now things work fine under xterm and in Emacs' term buffers
5977 (though not shell ones). Well, in emacs you get colors, but all
5982 (though not shell ones). Well, in emacs you get colors, but all
5978 seem to be 'light' colors (no difference between dark and light
5983 seem to be 'light' colors (no difference between dark and light
5979 ones). But the garbage chars are gone, and also in xterms. It
5984 ones). But the garbage chars are gone, and also in xterms. It
5980 seems that now I'm using 'cleaner' ansi sequences.
5985 seems that now I'm using 'cleaner' ansi sequences.
5981
5986
5982 2002-02-21 Fernando Perez <fperez@colorado.edu>
5987 2002-02-21 Fernando Perez <fperez@colorado.edu>
5983
5988
5984 * Released 0.2.7 (mainly to publish the scoping fix).
5989 * Released 0.2.7 (mainly to publish the scoping fix).
5985
5990
5986 * IPython/Logger.py (Logger.logstate): added. A corresponding
5991 * IPython/Logger.py (Logger.logstate): added. A corresponding
5987 @logstate magic was created.
5992 @logstate magic was created.
5988
5993
5989 * IPython/Magic.py: fixed nested scoping problem under Python
5994 * IPython/Magic.py: fixed nested scoping problem under Python
5990 2.1.x (automagic wasn't working).
5995 2.1.x (automagic wasn't working).
5991
5996
5992 2002-02-20 Fernando Perez <fperez@colorado.edu>
5997 2002-02-20 Fernando Perez <fperez@colorado.edu>
5993
5998
5994 * Released 0.2.6.
5999 * Released 0.2.6.
5995
6000
5996 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6001 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5997 option so that logs can come out without any headers at all.
6002 option so that logs can come out without any headers at all.
5998
6003
5999 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6004 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6000 SciPy.
6005 SciPy.
6001
6006
6002 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6007 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6003 that embedded IPython calls don't require vars() to be explicitly
6008 that embedded IPython calls don't require vars() to be explicitly
6004 passed. Now they are extracted from the caller's frame (code
6009 passed. Now they are extracted from the caller's frame (code
6005 snatched from Eric Jones' weave). Added better documentation to
6010 snatched from Eric Jones' weave). Added better documentation to
6006 the section on embedding and the example file.
6011 the section on embedding and the example file.
6007
6012
6008 * IPython/genutils.py (page): Changed so that under emacs, it just
6013 * IPython/genutils.py (page): Changed so that under emacs, it just
6009 prints the string. You can then page up and down in the emacs
6014 prints the string. You can then page up and down in the emacs
6010 buffer itself. This is how the builtin help() works.
6015 buffer itself. This is how the builtin help() works.
6011
6016
6012 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6017 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6013 macro scoping: macros need to be executed in the user's namespace
6018 macro scoping: macros need to be executed in the user's namespace
6014 to work as if they had been typed by the user.
6019 to work as if they had been typed by the user.
6015
6020
6016 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6021 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6017 execute automatically (no need to type 'exec...'). They then
6022 execute automatically (no need to type 'exec...'). They then
6018 behave like 'true macros'. The printing system was also modified
6023 behave like 'true macros'. The printing system was also modified
6019 for this to work.
6024 for this to work.
6020
6025
6021 2002-02-19 Fernando Perez <fperez@colorado.edu>
6026 2002-02-19 Fernando Perez <fperez@colorado.edu>
6022
6027
6023 * IPython/genutils.py (page_file): new function for paging files
6028 * IPython/genutils.py (page_file): new function for paging files
6024 in an OS-independent way. Also necessary for file viewing to work
6029 in an OS-independent way. Also necessary for file viewing to work
6025 well inside Emacs buffers.
6030 well inside Emacs buffers.
6026 (page): Added checks for being in an emacs buffer.
6031 (page): Added checks for being in an emacs buffer.
6027 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6032 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6028 same bug in iplib.
6033 same bug in iplib.
6029
6034
6030 2002-02-18 Fernando Perez <fperez@colorado.edu>
6035 2002-02-18 Fernando Perez <fperez@colorado.edu>
6031
6036
6032 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6037 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6033 of readline so that IPython can work inside an Emacs buffer.
6038 of readline so that IPython can work inside an Emacs buffer.
6034
6039
6035 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6040 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6036 method signatures (they weren't really bugs, but it looks cleaner
6041 method signatures (they weren't really bugs, but it looks cleaner
6037 and keeps PyChecker happy).
6042 and keeps PyChecker happy).
6038
6043
6039 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6044 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6040 for implementing various user-defined hooks. Currently only
6045 for implementing various user-defined hooks. Currently only
6041 display is done.
6046 display is done.
6042
6047
6043 * IPython/Prompts.py (CachedOutput._display): changed display
6048 * IPython/Prompts.py (CachedOutput._display): changed display
6044 functions so that they can be dynamically changed by users easily.
6049 functions so that they can be dynamically changed by users easily.
6045
6050
6046 * IPython/Extensions/numeric_formats.py (num_display): added an
6051 * IPython/Extensions/numeric_formats.py (num_display): added an
6047 extension for printing NumPy arrays in flexible manners. It
6052 extension for printing NumPy arrays in flexible manners. It
6048 doesn't do anything yet, but all the structure is in
6053 doesn't do anything yet, but all the structure is in
6049 place. Ultimately the plan is to implement output format control
6054 place. Ultimately the plan is to implement output format control
6050 like in Octave.
6055 like in Octave.
6051
6056
6052 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6057 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6053 methods are found at run-time by all the automatic machinery.
6058 methods are found at run-time by all the automatic machinery.
6054
6059
6055 2002-02-17 Fernando Perez <fperez@colorado.edu>
6060 2002-02-17 Fernando Perez <fperez@colorado.edu>
6056
6061
6057 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6062 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6058 whole file a little.
6063 whole file a little.
6059
6064
6060 * ToDo: closed this document. Now there's a new_design.lyx
6065 * ToDo: closed this document. Now there's a new_design.lyx
6061 document for all new ideas. Added making a pdf of it for the
6066 document for all new ideas. Added making a pdf of it for the
6062 end-user distro.
6067 end-user distro.
6063
6068
6064 * IPython/Logger.py (Logger.switch_log): Created this to replace
6069 * IPython/Logger.py (Logger.switch_log): Created this to replace
6065 logon() and logoff(). It also fixes a nasty crash reported by
6070 logon() and logoff(). It also fixes a nasty crash reported by
6066 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6071 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6067
6072
6068 * IPython/iplib.py (complete): got auto-completion to work with
6073 * IPython/iplib.py (complete): got auto-completion to work with
6069 automagic (I had wanted this for a long time).
6074 automagic (I had wanted this for a long time).
6070
6075
6071 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6076 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6072 to @file, since file() is now a builtin and clashes with automagic
6077 to @file, since file() is now a builtin and clashes with automagic
6073 for @file.
6078 for @file.
6074
6079
6075 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6080 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6076 of this was previously in iplib, which had grown to more than 2000
6081 of this was previously in iplib, which had grown to more than 2000
6077 lines, way too long. No new functionality, but it makes managing
6082 lines, way too long. No new functionality, but it makes managing
6078 the code a bit easier.
6083 the code a bit easier.
6079
6084
6080 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6085 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6081 information to crash reports.
6086 information to crash reports.
6082
6087
6083 2002-02-12 Fernando Perez <fperez@colorado.edu>
6088 2002-02-12 Fernando Perez <fperez@colorado.edu>
6084
6089
6085 * Released 0.2.5.
6090 * Released 0.2.5.
6086
6091
6087 2002-02-11 Fernando Perez <fperez@colorado.edu>
6092 2002-02-11 Fernando Perez <fperez@colorado.edu>
6088
6093
6089 * Wrote a relatively complete Windows installer. It puts
6094 * Wrote a relatively complete Windows installer. It puts
6090 everything in place, creates Start Menu entries and fixes the
6095 everything in place, creates Start Menu entries and fixes the
6091 color issues. Nothing fancy, but it works.
6096 color issues. Nothing fancy, but it works.
6092
6097
6093 2002-02-10 Fernando Perez <fperez@colorado.edu>
6098 2002-02-10 Fernando Perez <fperez@colorado.edu>
6094
6099
6095 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6100 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6096 os.path.expanduser() call so that we can type @run ~/myfile.py and
6101 os.path.expanduser() call so that we can type @run ~/myfile.py and
6097 have thigs work as expected.
6102 have thigs work as expected.
6098
6103
6099 * IPython/genutils.py (page): fixed exception handling so things
6104 * IPython/genutils.py (page): fixed exception handling so things
6100 work both in Unix and Windows correctly. Quitting a pager triggers
6105 work both in Unix and Windows correctly. Quitting a pager triggers
6101 an IOError/broken pipe in Unix, and in windows not finding a pager
6106 an IOError/broken pipe in Unix, and in windows not finding a pager
6102 is also an IOError, so I had to actually look at the return value
6107 is also an IOError, so I had to actually look at the return value
6103 of the exception, not just the exception itself. Should be ok now.
6108 of the exception, not just the exception itself. Should be ok now.
6104
6109
6105 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6110 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6106 modified to allow case-insensitive color scheme changes.
6111 modified to allow case-insensitive color scheme changes.
6107
6112
6108 2002-02-09 Fernando Perez <fperez@colorado.edu>
6113 2002-02-09 Fernando Perez <fperez@colorado.edu>
6109
6114
6110 * IPython/genutils.py (native_line_ends): new function to leave
6115 * IPython/genutils.py (native_line_ends): new function to leave
6111 user config files with os-native line-endings.
6116 user config files with os-native line-endings.
6112
6117
6113 * README and manual updates.
6118 * README and manual updates.
6114
6119
6115 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6120 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6116 instead of StringType to catch Unicode strings.
6121 instead of StringType to catch Unicode strings.
6117
6122
6118 * IPython/genutils.py (filefind): fixed bug for paths with
6123 * IPython/genutils.py (filefind): fixed bug for paths with
6119 embedded spaces (very common in Windows).
6124 embedded spaces (very common in Windows).
6120
6125
6121 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6126 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6122 files under Windows, so that they get automatically associated
6127 files under Windows, so that they get automatically associated
6123 with a text editor. Windows makes it a pain to handle
6128 with a text editor. Windows makes it a pain to handle
6124 extension-less files.
6129 extension-less files.
6125
6130
6126 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6131 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6127 warning about readline only occur for Posix. In Windows there's no
6132 warning about readline only occur for Posix. In Windows there's no
6128 way to get readline, so why bother with the warning.
6133 way to get readline, so why bother with the warning.
6129
6134
6130 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6135 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6131 for __str__ instead of dir(self), since dir() changed in 2.2.
6136 for __str__ instead of dir(self), since dir() changed in 2.2.
6132
6137
6133 * Ported to Windows! Tested on XP, I suspect it should work fine
6138 * Ported to Windows! Tested on XP, I suspect it should work fine
6134 on NT/2000, but I don't think it will work on 98 et al. That
6139 on NT/2000, but I don't think it will work on 98 et al. That
6135 series of Windows is such a piece of junk anyway that I won't try
6140 series of Windows is such a piece of junk anyway that I won't try
6136 porting it there. The XP port was straightforward, showed a few
6141 porting it there. The XP port was straightforward, showed a few
6137 bugs here and there (fixed all), in particular some string
6142 bugs here and there (fixed all), in particular some string
6138 handling stuff which required considering Unicode strings (which
6143 handling stuff which required considering Unicode strings (which
6139 Windows uses). This is good, but hasn't been too tested :) No
6144 Windows uses). This is good, but hasn't been too tested :) No
6140 fancy installer yet, I'll put a note in the manual so people at
6145 fancy installer yet, I'll put a note in the manual so people at
6141 least make manually a shortcut.
6146 least make manually a shortcut.
6142
6147
6143 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6148 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6144 into a single one, "colors". This now controls both prompt and
6149 into a single one, "colors". This now controls both prompt and
6145 exception color schemes, and can be changed both at startup
6150 exception color schemes, and can be changed both at startup
6146 (either via command-line switches or via ipythonrc files) and at
6151 (either via command-line switches or via ipythonrc files) and at
6147 runtime, with @colors.
6152 runtime, with @colors.
6148 (Magic.magic_run): renamed @prun to @run and removed the old
6153 (Magic.magic_run): renamed @prun to @run and removed the old
6149 @run. The two were too similar to warrant keeping both.
6154 @run. The two were too similar to warrant keeping both.
6150
6155
6151 2002-02-03 Fernando Perez <fperez@colorado.edu>
6156 2002-02-03 Fernando Perez <fperez@colorado.edu>
6152
6157
6153 * IPython/iplib.py (install_first_time): Added comment on how to
6158 * IPython/iplib.py (install_first_time): Added comment on how to
6154 configure the color options for first-time users. Put a <return>
6159 configure the color options for first-time users. Put a <return>
6155 request at the end so that small-terminal users get a chance to
6160 request at the end so that small-terminal users get a chance to
6156 read the startup info.
6161 read the startup info.
6157
6162
6158 2002-01-23 Fernando Perez <fperez@colorado.edu>
6163 2002-01-23 Fernando Perez <fperez@colorado.edu>
6159
6164
6160 * IPython/iplib.py (CachedOutput.update): Changed output memory
6165 * IPython/iplib.py (CachedOutput.update): Changed output memory
6161 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6166 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6162 input history we still use _i. Did this b/c these variable are
6167 input history we still use _i. Did this b/c these variable are
6163 very commonly used in interactive work, so the less we need to
6168 very commonly used in interactive work, so the less we need to
6164 type the better off we are.
6169 type the better off we are.
6165 (Magic.magic_prun): updated @prun to better handle the namespaces
6170 (Magic.magic_prun): updated @prun to better handle the namespaces
6166 the file will run in, including a fix for __name__ not being set
6171 the file will run in, including a fix for __name__ not being set
6167 before.
6172 before.
6168
6173
6169 2002-01-20 Fernando Perez <fperez@colorado.edu>
6174 2002-01-20 Fernando Perez <fperez@colorado.edu>
6170
6175
6171 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6176 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6172 extra garbage for Python 2.2. Need to look more carefully into
6177 extra garbage for Python 2.2. Need to look more carefully into
6173 this later.
6178 this later.
6174
6179
6175 2002-01-19 Fernando Perez <fperez@colorado.edu>
6180 2002-01-19 Fernando Perez <fperez@colorado.edu>
6176
6181
6177 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6182 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6178 display SyntaxError exceptions properly formatted when they occur
6183 display SyntaxError exceptions properly formatted when they occur
6179 (they can be triggered by imported code).
6184 (they can be triggered by imported code).
6180
6185
6181 2002-01-18 Fernando Perez <fperez@colorado.edu>
6186 2002-01-18 Fernando Perez <fperez@colorado.edu>
6182
6187
6183 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6188 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6184 SyntaxError exceptions are reported nicely formatted, instead of
6189 SyntaxError exceptions are reported nicely formatted, instead of
6185 spitting out only offset information as before.
6190 spitting out only offset information as before.
6186 (Magic.magic_prun): Added the @prun function for executing
6191 (Magic.magic_prun): Added the @prun function for executing
6187 programs with command line args inside IPython.
6192 programs with command line args inside IPython.
6188
6193
6189 2002-01-16 Fernando Perez <fperez@colorado.edu>
6194 2002-01-16 Fernando Perez <fperez@colorado.edu>
6190
6195
6191 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6196 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6192 to *not* include the last item given in a range. This brings their
6197 to *not* include the last item given in a range. This brings their
6193 behavior in line with Python's slicing:
6198 behavior in line with Python's slicing:
6194 a[n1:n2] -> a[n1]...a[n2-1]
6199 a[n1:n2] -> a[n1]...a[n2-1]
6195 It may be a bit less convenient, but I prefer to stick to Python's
6200 It may be a bit less convenient, but I prefer to stick to Python's
6196 conventions *everywhere*, so users never have to wonder.
6201 conventions *everywhere*, so users never have to wonder.
6197 (Magic.magic_macro): Added @macro function to ease the creation of
6202 (Magic.magic_macro): Added @macro function to ease the creation of
6198 macros.
6203 macros.
6199
6204
6200 2002-01-05 Fernando Perez <fperez@colorado.edu>
6205 2002-01-05 Fernando Perez <fperez@colorado.edu>
6201
6206
6202 * Released 0.2.4.
6207 * Released 0.2.4.
6203
6208
6204 * IPython/iplib.py (Magic.magic_pdef):
6209 * IPython/iplib.py (Magic.magic_pdef):
6205 (InteractiveShell.safe_execfile): report magic lines and error
6210 (InteractiveShell.safe_execfile): report magic lines and error
6206 lines without line numbers so one can easily copy/paste them for
6211 lines without line numbers so one can easily copy/paste them for
6207 re-execution.
6212 re-execution.
6208
6213
6209 * Updated manual with recent changes.
6214 * Updated manual with recent changes.
6210
6215
6211 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6216 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6212 docstring printing when class? is called. Very handy for knowing
6217 docstring printing when class? is called. Very handy for knowing
6213 how to create class instances (as long as __init__ is well
6218 how to create class instances (as long as __init__ is well
6214 documented, of course :)
6219 documented, of course :)
6215 (Magic.magic_doc): print both class and constructor docstrings.
6220 (Magic.magic_doc): print both class and constructor docstrings.
6216 (Magic.magic_pdef): give constructor info if passed a class and
6221 (Magic.magic_pdef): give constructor info if passed a class and
6217 __call__ info for callable object instances.
6222 __call__ info for callable object instances.
6218
6223
6219 2002-01-04 Fernando Perez <fperez@colorado.edu>
6224 2002-01-04 Fernando Perez <fperez@colorado.edu>
6220
6225
6221 * Made deep_reload() off by default. It doesn't always work
6226 * Made deep_reload() off by default. It doesn't always work
6222 exactly as intended, so it's probably safer to have it off. It's
6227 exactly as intended, so it's probably safer to have it off. It's
6223 still available as dreload() anyway, so nothing is lost.
6228 still available as dreload() anyway, so nothing is lost.
6224
6229
6225 2002-01-02 Fernando Perez <fperez@colorado.edu>
6230 2002-01-02 Fernando Perez <fperez@colorado.edu>
6226
6231
6227 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6232 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6228 so I wanted an updated release).
6233 so I wanted an updated release).
6229
6234
6230 2001-12-27 Fernando Perez <fperez@colorado.edu>
6235 2001-12-27 Fernando Perez <fperez@colorado.edu>
6231
6236
6232 * IPython/iplib.py (InteractiveShell.interact): Added the original
6237 * IPython/iplib.py (InteractiveShell.interact): Added the original
6233 code from 'code.py' for this module in order to change the
6238 code from 'code.py' for this module in order to change the
6234 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6239 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6235 the history cache would break when the user hit Ctrl-C, and
6240 the history cache would break when the user hit Ctrl-C, and
6236 interact() offers no way to add any hooks to it.
6241 interact() offers no way to add any hooks to it.
6237
6242
6238 2001-12-23 Fernando Perez <fperez@colorado.edu>
6243 2001-12-23 Fernando Perez <fperez@colorado.edu>
6239
6244
6240 * setup.py: added check for 'MANIFEST' before trying to remove
6245 * setup.py: added check for 'MANIFEST' before trying to remove
6241 it. Thanks to Sean Reifschneider.
6246 it. Thanks to Sean Reifschneider.
6242
6247
6243 2001-12-22 Fernando Perez <fperez@colorado.edu>
6248 2001-12-22 Fernando Perez <fperez@colorado.edu>
6244
6249
6245 * Released 0.2.2.
6250 * Released 0.2.2.
6246
6251
6247 * Finished (reasonably) writing the manual. Later will add the
6252 * Finished (reasonably) writing the manual. Later will add the
6248 python-standard navigation stylesheets, but for the time being
6253 python-standard navigation stylesheets, but for the time being
6249 it's fairly complete. Distribution will include html and pdf
6254 it's fairly complete. Distribution will include html and pdf
6250 versions.
6255 versions.
6251
6256
6252 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6257 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6253 (MayaVi author).
6258 (MayaVi author).
6254
6259
6255 2001-12-21 Fernando Perez <fperez@colorado.edu>
6260 2001-12-21 Fernando Perez <fperez@colorado.edu>
6256
6261
6257 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6262 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6258 good public release, I think (with the manual and the distutils
6263 good public release, I think (with the manual and the distutils
6259 installer). The manual can use some work, but that can go
6264 installer). The manual can use some work, but that can go
6260 slowly. Otherwise I think it's quite nice for end users. Next
6265 slowly. Otherwise I think it's quite nice for end users. Next
6261 summer, rewrite the guts of it...
6266 summer, rewrite the guts of it...
6262
6267
6263 * Changed format of ipythonrc files to use whitespace as the
6268 * Changed format of ipythonrc files to use whitespace as the
6264 separator instead of an explicit '='. Cleaner.
6269 separator instead of an explicit '='. Cleaner.
6265
6270
6266 2001-12-20 Fernando Perez <fperez@colorado.edu>
6271 2001-12-20 Fernando Perez <fperez@colorado.edu>
6267
6272
6268 * Started a manual in LyX. For now it's just a quick merge of the
6273 * Started a manual in LyX. For now it's just a quick merge of the
6269 various internal docstrings and READMEs. Later it may grow into a
6274 various internal docstrings and READMEs. Later it may grow into a
6270 nice, full-blown manual.
6275 nice, full-blown manual.
6271
6276
6272 * Set up a distutils based installer. Installation should now be
6277 * Set up a distutils based installer. Installation should now be
6273 trivially simple for end-users.
6278 trivially simple for end-users.
6274
6279
6275 2001-12-11 Fernando Perez <fperez@colorado.edu>
6280 2001-12-11 Fernando Perez <fperez@colorado.edu>
6276
6281
6277 * Released 0.2.0. First public release, announced it at
6282 * Released 0.2.0. First public release, announced it at
6278 comp.lang.python. From now on, just bugfixes...
6283 comp.lang.python. From now on, just bugfixes...
6279
6284
6280 * Went through all the files, set copyright/license notices and
6285 * Went through all the files, set copyright/license notices and
6281 cleaned up things. Ready for release.
6286 cleaned up things. Ready for release.
6282
6287
6283 2001-12-10 Fernando Perez <fperez@colorado.edu>
6288 2001-12-10 Fernando Perez <fperez@colorado.edu>
6284
6289
6285 * Changed the first-time installer not to use tarfiles. It's more
6290 * Changed the first-time installer not to use tarfiles. It's more
6286 robust now and less unix-dependent. Also makes it easier for
6291 robust now and less unix-dependent. Also makes it easier for
6287 people to later upgrade versions.
6292 people to later upgrade versions.
6288
6293
6289 * Changed @exit to @abort to reflect the fact that it's pretty
6294 * Changed @exit to @abort to reflect the fact that it's pretty
6290 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6295 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6291 becomes significant only when IPyhton is embedded: in that case,
6296 becomes significant only when IPyhton is embedded: in that case,
6292 C-D closes IPython only, but @abort kills the enclosing program
6297 C-D closes IPython only, but @abort kills the enclosing program
6293 too (unless it had called IPython inside a try catching
6298 too (unless it had called IPython inside a try catching
6294 SystemExit).
6299 SystemExit).
6295
6300
6296 * Created Shell module which exposes the actuall IPython Shell
6301 * Created Shell module which exposes the actuall IPython Shell
6297 classes, currently the normal and the embeddable one. This at
6302 classes, currently the normal and the embeddable one. This at
6298 least offers a stable interface we won't need to change when
6303 least offers a stable interface we won't need to change when
6299 (later) the internals are rewritten. That rewrite will be confined
6304 (later) the internals are rewritten. That rewrite will be confined
6300 to iplib and ipmaker, but the Shell interface should remain as is.
6305 to iplib and ipmaker, but the Shell interface should remain as is.
6301
6306
6302 * Added embed module which offers an embeddable IPShell object,
6307 * Added embed module which offers an embeddable IPShell object,
6303 useful to fire up IPython *inside* a running program. Great for
6308 useful to fire up IPython *inside* a running program. Great for
6304 debugging or dynamical data analysis.
6309 debugging or dynamical data analysis.
6305
6310
6306 2001-12-08 Fernando Perez <fperez@colorado.edu>
6311 2001-12-08 Fernando Perez <fperez@colorado.edu>
6307
6312
6308 * Fixed small bug preventing seeing info from methods of defined
6313 * Fixed small bug preventing seeing info from methods of defined
6309 objects (incorrect namespace in _ofind()).
6314 objects (incorrect namespace in _ofind()).
6310
6315
6311 * Documentation cleanup. Moved the main usage docstrings to a
6316 * Documentation cleanup. Moved the main usage docstrings to a
6312 separate file, usage.py (cleaner to maintain, and hopefully in the
6317 separate file, usage.py (cleaner to maintain, and hopefully in the
6313 future some perlpod-like way of producing interactive, man and
6318 future some perlpod-like way of producing interactive, man and
6314 html docs out of it will be found).
6319 html docs out of it will be found).
6315
6320
6316 * Added @profile to see your profile at any time.
6321 * Added @profile to see your profile at any time.
6317
6322
6318 * Added @p as an alias for 'print'. It's especially convenient if
6323 * Added @p as an alias for 'print'. It's especially convenient if
6319 using automagic ('p x' prints x).
6324 using automagic ('p x' prints x).
6320
6325
6321 * Small cleanups and fixes after a pychecker run.
6326 * Small cleanups and fixes after a pychecker run.
6322
6327
6323 * Changed the @cd command to handle @cd - and @cd -<n> for
6328 * Changed the @cd command to handle @cd - and @cd -<n> for
6324 visiting any directory in _dh.
6329 visiting any directory in _dh.
6325
6330
6326 * Introduced _dh, a history of visited directories. @dhist prints
6331 * Introduced _dh, a history of visited directories. @dhist prints
6327 it out with numbers.
6332 it out with numbers.
6328
6333
6329 2001-12-07 Fernando Perez <fperez@colorado.edu>
6334 2001-12-07 Fernando Perez <fperez@colorado.edu>
6330
6335
6331 * Released 0.1.22
6336 * Released 0.1.22
6332
6337
6333 * Made initialization a bit more robust against invalid color
6338 * Made initialization a bit more robust against invalid color
6334 options in user input (exit, not traceback-crash).
6339 options in user input (exit, not traceback-crash).
6335
6340
6336 * Changed the bug crash reporter to write the report only in the
6341 * Changed the bug crash reporter to write the report only in the
6337 user's .ipython directory. That way IPython won't litter people's
6342 user's .ipython directory. That way IPython won't litter people's
6338 hard disks with crash files all over the place. Also print on
6343 hard disks with crash files all over the place. Also print on
6339 screen the necessary mail command.
6344 screen the necessary mail command.
6340
6345
6341 * With the new ultraTB, implemented LightBG color scheme for light
6346 * With the new ultraTB, implemented LightBG color scheme for light
6342 background terminals. A lot of people like white backgrounds, so I
6347 background terminals. A lot of people like white backgrounds, so I
6343 guess we should at least give them something readable.
6348 guess we should at least give them something readable.
6344
6349
6345 2001-12-06 Fernando Perez <fperez@colorado.edu>
6350 2001-12-06 Fernando Perez <fperez@colorado.edu>
6346
6351
6347 * Modified the structure of ultraTB. Now there's a proper class
6352 * Modified the structure of ultraTB. Now there's a proper class
6348 for tables of color schemes which allow adding schemes easily and
6353 for tables of color schemes which allow adding schemes easily and
6349 switching the active scheme without creating a new instance every
6354 switching the active scheme without creating a new instance every
6350 time (which was ridiculous). The syntax for creating new schemes
6355 time (which was ridiculous). The syntax for creating new schemes
6351 is also cleaner. I think ultraTB is finally done, with a clean
6356 is also cleaner. I think ultraTB is finally done, with a clean
6352 class structure. Names are also much cleaner (now there's proper
6357 class structure. Names are also much cleaner (now there's proper
6353 color tables, no need for every variable to also have 'color' in
6358 color tables, no need for every variable to also have 'color' in
6354 its name).
6359 its name).
6355
6360
6356 * Broke down genutils into separate files. Now genutils only
6361 * Broke down genutils into separate files. Now genutils only
6357 contains utility functions, and classes have been moved to their
6362 contains utility functions, and classes have been moved to their
6358 own files (they had enough independent functionality to warrant
6363 own files (they had enough independent functionality to warrant
6359 it): ConfigLoader, OutputTrap, Struct.
6364 it): ConfigLoader, OutputTrap, Struct.
6360
6365
6361 2001-12-05 Fernando Perez <fperez@colorado.edu>
6366 2001-12-05 Fernando Perez <fperez@colorado.edu>
6362
6367
6363 * IPython turns 21! Released version 0.1.21, as a candidate for
6368 * IPython turns 21! Released version 0.1.21, as a candidate for
6364 public consumption. If all goes well, release in a few days.
6369 public consumption. If all goes well, release in a few days.
6365
6370
6366 * Fixed path bug (files in Extensions/ directory wouldn't be found
6371 * Fixed path bug (files in Extensions/ directory wouldn't be found
6367 unless IPython/ was explicitly in sys.path).
6372 unless IPython/ was explicitly in sys.path).
6368
6373
6369 * Extended the FlexCompleter class as MagicCompleter to allow
6374 * Extended the FlexCompleter class as MagicCompleter to allow
6370 completion of @-starting lines.
6375 completion of @-starting lines.
6371
6376
6372 * Created __release__.py file as a central repository for release
6377 * Created __release__.py file as a central repository for release
6373 info that other files can read from.
6378 info that other files can read from.
6374
6379
6375 * Fixed small bug in logging: when logging was turned on in
6380 * Fixed small bug in logging: when logging was turned on in
6376 mid-session, old lines with special meanings (!@?) were being
6381 mid-session, old lines with special meanings (!@?) were being
6377 logged without the prepended comment, which is necessary since
6382 logged without the prepended comment, which is necessary since
6378 they are not truly valid python syntax. This should make session
6383 they are not truly valid python syntax. This should make session
6379 restores produce less errors.
6384 restores produce less errors.
6380
6385
6381 * The namespace cleanup forced me to make a FlexCompleter class
6386 * The namespace cleanup forced me to make a FlexCompleter class
6382 which is nothing but a ripoff of rlcompleter, but with selectable
6387 which is nothing but a ripoff of rlcompleter, but with selectable
6383 namespace (rlcompleter only works in __main__.__dict__). I'll try
6388 namespace (rlcompleter only works in __main__.__dict__). I'll try
6384 to submit a note to the authors to see if this change can be
6389 to submit a note to the authors to see if this change can be
6385 incorporated in future rlcompleter releases (Dec.6: done)
6390 incorporated in future rlcompleter releases (Dec.6: done)
6386
6391
6387 * More fixes to namespace handling. It was a mess! Now all
6392 * More fixes to namespace handling. It was a mess! Now all
6388 explicit references to __main__.__dict__ are gone (except when
6393 explicit references to __main__.__dict__ are gone (except when
6389 really needed) and everything is handled through the namespace
6394 really needed) and everything is handled through the namespace
6390 dicts in the IPython instance. We seem to be getting somewhere
6395 dicts in the IPython instance. We seem to be getting somewhere
6391 with this, finally...
6396 with this, finally...
6392
6397
6393 * Small documentation updates.
6398 * Small documentation updates.
6394
6399
6395 * Created the Extensions directory under IPython (with an
6400 * Created the Extensions directory under IPython (with an
6396 __init__.py). Put the PhysicalQ stuff there. This directory should
6401 __init__.py). Put the PhysicalQ stuff there. This directory should
6397 be used for all special-purpose extensions.
6402 be used for all special-purpose extensions.
6398
6403
6399 * File renaming:
6404 * File renaming:
6400 ipythonlib --> ipmaker
6405 ipythonlib --> ipmaker
6401 ipplib --> iplib
6406 ipplib --> iplib
6402 This makes a bit more sense in terms of what these files actually do.
6407 This makes a bit more sense in terms of what these files actually do.
6403
6408
6404 * Moved all the classes and functions in ipythonlib to ipplib, so
6409 * Moved all the classes and functions in ipythonlib to ipplib, so
6405 now ipythonlib only has make_IPython(). This will ease up its
6410 now ipythonlib only has make_IPython(). This will ease up its
6406 splitting in smaller functional chunks later.
6411 splitting in smaller functional chunks later.
6407
6412
6408 * Cleaned up (done, I think) output of @whos. Better column
6413 * Cleaned up (done, I think) output of @whos. Better column
6409 formatting, and now shows str(var) for as much as it can, which is
6414 formatting, and now shows str(var) for as much as it can, which is
6410 typically what one gets with a 'print var'.
6415 typically what one gets with a 'print var'.
6411
6416
6412 2001-12-04 Fernando Perez <fperez@colorado.edu>
6417 2001-12-04 Fernando Perez <fperez@colorado.edu>
6413
6418
6414 * Fixed namespace problems. Now builtin/IPyhton/user names get
6419 * Fixed namespace problems. Now builtin/IPyhton/user names get
6415 properly reported in their namespace. Internal namespace handling
6420 properly reported in their namespace. Internal namespace handling
6416 is finally getting decent (not perfect yet, but much better than
6421 is finally getting decent (not perfect yet, but much better than
6417 the ad-hoc mess we had).
6422 the ad-hoc mess we had).
6418
6423
6419 * Removed -exit option. If people just want to run a python
6424 * Removed -exit option. If people just want to run a python
6420 script, that's what the normal interpreter is for. Less
6425 script, that's what the normal interpreter is for. Less
6421 unnecessary options, less chances for bugs.
6426 unnecessary options, less chances for bugs.
6422
6427
6423 * Added a crash handler which generates a complete post-mortem if
6428 * Added a crash handler which generates a complete post-mortem if
6424 IPython crashes. This will help a lot in tracking bugs down the
6429 IPython crashes. This will help a lot in tracking bugs down the
6425 road.
6430 road.
6426
6431
6427 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6432 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6428 which were boud to functions being reassigned would bypass the
6433 which were boud to functions being reassigned would bypass the
6429 logger, breaking the sync of _il with the prompt counter. This
6434 logger, breaking the sync of _il with the prompt counter. This
6430 would then crash IPython later when a new line was logged.
6435 would then crash IPython later when a new line was logged.
6431
6436
6432 2001-12-02 Fernando Perez <fperez@colorado.edu>
6437 2001-12-02 Fernando Perez <fperez@colorado.edu>
6433
6438
6434 * Made IPython a package. This means people don't have to clutter
6439 * Made IPython a package. This means people don't have to clutter
6435 their sys.path with yet another directory. Changed the INSTALL
6440 their sys.path with yet another directory. Changed the INSTALL
6436 file accordingly.
6441 file accordingly.
6437
6442
6438 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6443 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6439 sorts its output (so @who shows it sorted) and @whos formats the
6444 sorts its output (so @who shows it sorted) and @whos formats the
6440 table according to the width of the first column. Nicer, easier to
6445 table according to the width of the first column. Nicer, easier to
6441 read. Todo: write a generic table_format() which takes a list of
6446 read. Todo: write a generic table_format() which takes a list of
6442 lists and prints it nicely formatted, with optional row/column
6447 lists and prints it nicely formatted, with optional row/column
6443 separators and proper padding and justification.
6448 separators and proper padding and justification.
6444
6449
6445 * Released 0.1.20
6450 * Released 0.1.20
6446
6451
6447 * Fixed bug in @log which would reverse the inputcache list (a
6452 * Fixed bug in @log which would reverse the inputcache list (a
6448 copy operation was missing).
6453 copy operation was missing).
6449
6454
6450 * Code cleanup. @config was changed to use page(). Better, since
6455 * Code cleanup. @config was changed to use page(). Better, since
6451 its output is always quite long.
6456 its output is always quite long.
6452
6457
6453 * Itpl is back as a dependency. I was having too many problems
6458 * Itpl is back as a dependency. I was having too many problems
6454 getting the parametric aliases to work reliably, and it's just
6459 getting the parametric aliases to work reliably, and it's just
6455 easier to code weird string operations with it than playing %()s
6460 easier to code weird string operations with it than playing %()s
6456 games. It's only ~6k, so I don't think it's too big a deal.
6461 games. It's only ~6k, so I don't think it's too big a deal.
6457
6462
6458 * Found (and fixed) a very nasty bug with history. !lines weren't
6463 * Found (and fixed) a very nasty bug with history. !lines weren't
6459 getting cached, and the out of sync caches would crash
6464 getting cached, and the out of sync caches would crash
6460 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6465 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6461 division of labor a bit better. Bug fixed, cleaner structure.
6466 division of labor a bit better. Bug fixed, cleaner structure.
6462
6467
6463 2001-12-01 Fernando Perez <fperez@colorado.edu>
6468 2001-12-01 Fernando Perez <fperez@colorado.edu>
6464
6469
6465 * Released 0.1.19
6470 * Released 0.1.19
6466
6471
6467 * Added option -n to @hist to prevent line number printing. Much
6472 * Added option -n to @hist to prevent line number printing. Much
6468 easier to copy/paste code this way.
6473 easier to copy/paste code this way.
6469
6474
6470 * Created global _il to hold the input list. Allows easy
6475 * Created global _il to hold the input list. Allows easy
6471 re-execution of blocks of code by slicing it (inspired by Janko's
6476 re-execution of blocks of code by slicing it (inspired by Janko's
6472 comment on 'macros').
6477 comment on 'macros').
6473
6478
6474 * Small fixes and doc updates.
6479 * Small fixes and doc updates.
6475
6480
6476 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6481 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6477 much too fragile with automagic. Handles properly multi-line
6482 much too fragile with automagic. Handles properly multi-line
6478 statements and takes parameters.
6483 statements and takes parameters.
6479
6484
6480 2001-11-30 Fernando Perez <fperez@colorado.edu>
6485 2001-11-30 Fernando Perez <fperez@colorado.edu>
6481
6486
6482 * Version 0.1.18 released.
6487 * Version 0.1.18 released.
6483
6488
6484 * Fixed nasty namespace bug in initial module imports.
6489 * Fixed nasty namespace bug in initial module imports.
6485
6490
6486 * Added copyright/license notes to all code files (except
6491 * Added copyright/license notes to all code files (except
6487 DPyGetOpt). For the time being, LGPL. That could change.
6492 DPyGetOpt). For the time being, LGPL. That could change.
6488
6493
6489 * Rewrote a much nicer README, updated INSTALL, cleaned up
6494 * Rewrote a much nicer README, updated INSTALL, cleaned up
6490 ipythonrc-* samples.
6495 ipythonrc-* samples.
6491
6496
6492 * Overall code/documentation cleanup. Basically ready for
6497 * Overall code/documentation cleanup. Basically ready for
6493 release. Only remaining thing: licence decision (LGPL?).
6498 release. Only remaining thing: licence decision (LGPL?).
6494
6499
6495 * Converted load_config to a class, ConfigLoader. Now recursion
6500 * Converted load_config to a class, ConfigLoader. Now recursion
6496 control is better organized. Doesn't include the same file twice.
6501 control is better organized. Doesn't include the same file twice.
6497
6502
6498 2001-11-29 Fernando Perez <fperez@colorado.edu>
6503 2001-11-29 Fernando Perez <fperez@colorado.edu>
6499
6504
6500 * Got input history working. Changed output history variables from
6505 * Got input history working. Changed output history variables from
6501 _p to _o so that _i is for input and _o for output. Just cleaner
6506 _p to _o so that _i is for input and _o for output. Just cleaner
6502 convention.
6507 convention.
6503
6508
6504 * Implemented parametric aliases. This pretty much allows the
6509 * Implemented parametric aliases. This pretty much allows the
6505 alias system to offer full-blown shell convenience, I think.
6510 alias system to offer full-blown shell convenience, I think.
6506
6511
6507 * Version 0.1.17 released, 0.1.18 opened.
6512 * Version 0.1.17 released, 0.1.18 opened.
6508
6513
6509 * dot_ipython/ipythonrc (alias): added documentation.
6514 * dot_ipython/ipythonrc (alias): added documentation.
6510 (xcolor): Fixed small bug (xcolors -> xcolor)
6515 (xcolor): Fixed small bug (xcolors -> xcolor)
6511
6516
6512 * Changed the alias system. Now alias is a magic command to define
6517 * Changed the alias system. Now alias is a magic command to define
6513 aliases just like the shell. Rationale: the builtin magics should
6518 aliases just like the shell. Rationale: the builtin magics should
6514 be there for things deeply connected to IPython's
6519 be there for things deeply connected to IPython's
6515 architecture. And this is a much lighter system for what I think
6520 architecture. And this is a much lighter system for what I think
6516 is the really important feature: allowing users to define quickly
6521 is the really important feature: allowing users to define quickly
6517 magics that will do shell things for them, so they can customize
6522 magics that will do shell things for them, so they can customize
6518 IPython easily to match their work habits. If someone is really
6523 IPython easily to match their work habits. If someone is really
6519 desperate to have another name for a builtin alias, they can
6524 desperate to have another name for a builtin alias, they can
6520 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6525 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6521 works.
6526 works.
6522
6527
6523 2001-11-28 Fernando Perez <fperez@colorado.edu>
6528 2001-11-28 Fernando Perez <fperez@colorado.edu>
6524
6529
6525 * Changed @file so that it opens the source file at the proper
6530 * Changed @file so that it opens the source file at the proper
6526 line. Since it uses less, if your EDITOR environment is
6531 line. Since it uses less, if your EDITOR environment is
6527 configured, typing v will immediately open your editor of choice
6532 configured, typing v will immediately open your editor of choice
6528 right at the line where the object is defined. Not as quick as
6533 right at the line where the object is defined. Not as quick as
6529 having a direct @edit command, but for all intents and purposes it
6534 having a direct @edit command, but for all intents and purposes it
6530 works. And I don't have to worry about writing @edit to deal with
6535 works. And I don't have to worry about writing @edit to deal with
6531 all the editors, less does that.
6536 all the editors, less does that.
6532
6537
6533 * Version 0.1.16 released, 0.1.17 opened.
6538 * Version 0.1.16 released, 0.1.17 opened.
6534
6539
6535 * Fixed some nasty bugs in the page/page_dumb combo that could
6540 * Fixed some nasty bugs in the page/page_dumb combo that could
6536 crash IPython.
6541 crash IPython.
6537
6542
6538 2001-11-27 Fernando Perez <fperez@colorado.edu>
6543 2001-11-27 Fernando Perez <fperez@colorado.edu>
6539
6544
6540 * Version 0.1.15 released, 0.1.16 opened.
6545 * Version 0.1.15 released, 0.1.16 opened.
6541
6546
6542 * Finally got ? and ?? to work for undefined things: now it's
6547 * Finally got ? and ?? to work for undefined things: now it's
6543 possible to type {}.get? and get information about the get method
6548 possible to type {}.get? and get information about the get method
6544 of dicts, or os.path? even if only os is defined (so technically
6549 of dicts, or os.path? even if only os is defined (so technically
6545 os.path isn't). Works at any level. For example, after import os,
6550 os.path isn't). Works at any level. For example, after import os,
6546 os?, os.path?, os.path.abspath? all work. This is great, took some
6551 os?, os.path?, os.path.abspath? all work. This is great, took some
6547 work in _ofind.
6552 work in _ofind.
6548
6553
6549 * Fixed more bugs with logging. The sanest way to do it was to add
6554 * Fixed more bugs with logging. The sanest way to do it was to add
6550 to @log a 'mode' parameter. Killed two in one shot (this mode
6555 to @log a 'mode' parameter. Killed two in one shot (this mode
6551 option was a request of Janko's). I think it's finally clean
6556 option was a request of Janko's). I think it's finally clean
6552 (famous last words).
6557 (famous last words).
6553
6558
6554 * Added a page_dumb() pager which does a decent job of paging on
6559 * Added a page_dumb() pager which does a decent job of paging on
6555 screen, if better things (like less) aren't available. One less
6560 screen, if better things (like less) aren't available. One less
6556 unix dependency (someday maybe somebody will port this to
6561 unix dependency (someday maybe somebody will port this to
6557 windows).
6562 windows).
6558
6563
6559 * Fixed problem in magic_log: would lock of logging out if log
6564 * Fixed problem in magic_log: would lock of logging out if log
6560 creation failed (because it would still think it had succeeded).
6565 creation failed (because it would still think it had succeeded).
6561
6566
6562 * Improved the page() function using curses to auto-detect screen
6567 * Improved the page() function using curses to auto-detect screen
6563 size. Now it can make a much better decision on whether to print
6568 size. Now it can make a much better decision on whether to print
6564 or page a string. Option screen_length was modified: a value 0
6569 or page a string. Option screen_length was modified: a value 0
6565 means auto-detect, and that's the default now.
6570 means auto-detect, and that's the default now.
6566
6571
6567 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6572 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6568 go out. I'll test it for a few days, then talk to Janko about
6573 go out. I'll test it for a few days, then talk to Janko about
6569 licences and announce it.
6574 licences and announce it.
6570
6575
6571 * Fixed the length of the auto-generated ---> prompt which appears
6576 * Fixed the length of the auto-generated ---> prompt which appears
6572 for auto-parens and auto-quotes. Getting this right isn't trivial,
6577 for auto-parens and auto-quotes. Getting this right isn't trivial,
6573 with all the color escapes, different prompt types and optional
6578 with all the color escapes, different prompt types and optional
6574 separators. But it seems to be working in all the combinations.
6579 separators. But it seems to be working in all the combinations.
6575
6580
6576 2001-11-26 Fernando Perez <fperez@colorado.edu>
6581 2001-11-26 Fernando Perez <fperez@colorado.edu>
6577
6582
6578 * Wrote a regexp filter to get option types from the option names
6583 * Wrote a regexp filter to get option types from the option names
6579 string. This eliminates the need to manually keep two duplicate
6584 string. This eliminates the need to manually keep two duplicate
6580 lists.
6585 lists.
6581
6586
6582 * Removed the unneeded check_option_names. Now options are handled
6587 * Removed the unneeded check_option_names. Now options are handled
6583 in a much saner manner and it's easy to visually check that things
6588 in a much saner manner and it's easy to visually check that things
6584 are ok.
6589 are ok.
6585
6590
6586 * Updated version numbers on all files I modified to carry a
6591 * Updated version numbers on all files I modified to carry a
6587 notice so Janko and Nathan have clear version markers.
6592 notice so Janko and Nathan have clear version markers.
6588
6593
6589 * Updated docstring for ultraTB with my changes. I should send
6594 * Updated docstring for ultraTB with my changes. I should send
6590 this to Nathan.
6595 this to Nathan.
6591
6596
6592 * Lots of small fixes. Ran everything through pychecker again.
6597 * Lots of small fixes. Ran everything through pychecker again.
6593
6598
6594 * Made loading of deep_reload an cmd line option. If it's not too
6599 * Made loading of deep_reload an cmd line option. If it's not too
6595 kosher, now people can just disable it. With -nodeep_reload it's
6600 kosher, now people can just disable it. With -nodeep_reload it's
6596 still available as dreload(), it just won't overwrite reload().
6601 still available as dreload(), it just won't overwrite reload().
6597
6602
6598 * Moved many options to the no| form (-opt and -noopt
6603 * Moved many options to the no| form (-opt and -noopt
6599 accepted). Cleaner.
6604 accepted). Cleaner.
6600
6605
6601 * Changed magic_log so that if called with no parameters, it uses
6606 * Changed magic_log so that if called with no parameters, it uses
6602 'rotate' mode. That way auto-generated logs aren't automatically
6607 'rotate' mode. That way auto-generated logs aren't automatically
6603 over-written. For normal logs, now a backup is made if it exists
6608 over-written. For normal logs, now a backup is made if it exists
6604 (only 1 level of backups). A new 'backup' mode was added to the
6609 (only 1 level of backups). A new 'backup' mode was added to the
6605 Logger class to support this. This was a request by Janko.
6610 Logger class to support this. This was a request by Janko.
6606
6611
6607 * Added @logoff/@logon to stop/restart an active log.
6612 * Added @logoff/@logon to stop/restart an active log.
6608
6613
6609 * Fixed a lot of bugs in log saving/replay. It was pretty
6614 * Fixed a lot of bugs in log saving/replay. It was pretty
6610 broken. Now special lines (!@,/) appear properly in the command
6615 broken. Now special lines (!@,/) appear properly in the command
6611 history after a log replay.
6616 history after a log replay.
6612
6617
6613 * Tried and failed to implement full session saving via pickle. My
6618 * Tried and failed to implement full session saving via pickle. My
6614 idea was to pickle __main__.__dict__, but modules can't be
6619 idea was to pickle __main__.__dict__, but modules can't be
6615 pickled. This would be a better alternative to replaying logs, but
6620 pickled. This would be a better alternative to replaying logs, but
6616 seems quite tricky to get to work. Changed -session to be called
6621 seems quite tricky to get to work. Changed -session to be called
6617 -logplay, which more accurately reflects what it does. And if we
6622 -logplay, which more accurately reflects what it does. And if we
6618 ever get real session saving working, -session is now available.
6623 ever get real session saving working, -session is now available.
6619
6624
6620 * Implemented color schemes for prompts also. As for tracebacks,
6625 * Implemented color schemes for prompts also. As for tracebacks,
6621 currently only NoColor and Linux are supported. But now the
6626 currently only NoColor and Linux are supported. But now the
6622 infrastructure is in place, based on a generic ColorScheme
6627 infrastructure is in place, based on a generic ColorScheme
6623 class. So writing and activating new schemes both for the prompts
6628 class. So writing and activating new schemes both for the prompts
6624 and the tracebacks should be straightforward.
6629 and the tracebacks should be straightforward.
6625
6630
6626 * Version 0.1.13 released, 0.1.14 opened.
6631 * Version 0.1.13 released, 0.1.14 opened.
6627
6632
6628 * Changed handling of options for output cache. Now counter is
6633 * Changed handling of options for output cache. Now counter is
6629 hardwired starting at 1 and one specifies the maximum number of
6634 hardwired starting at 1 and one specifies the maximum number of
6630 entries *in the outcache* (not the max prompt counter). This is
6635 entries *in the outcache* (not the max prompt counter). This is
6631 much better, since many statements won't increase the cache
6636 much better, since many statements won't increase the cache
6632 count. It also eliminated some confusing options, now there's only
6637 count. It also eliminated some confusing options, now there's only
6633 one: cache_size.
6638 one: cache_size.
6634
6639
6635 * Added 'alias' magic function and magic_alias option in the
6640 * Added 'alias' magic function and magic_alias option in the
6636 ipythonrc file. Now the user can easily define whatever names he
6641 ipythonrc file. Now the user can easily define whatever names he
6637 wants for the magic functions without having to play weird
6642 wants for the magic functions without having to play weird
6638 namespace games. This gives IPython a real shell-like feel.
6643 namespace games. This gives IPython a real shell-like feel.
6639
6644
6640 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6645 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6641 @ or not).
6646 @ or not).
6642
6647
6643 This was one of the last remaining 'visible' bugs (that I know
6648 This was one of the last remaining 'visible' bugs (that I know
6644 of). I think if I can clean up the session loading so it works
6649 of). I think if I can clean up the session loading so it works
6645 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6650 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6646 about licensing).
6651 about licensing).
6647
6652
6648 2001-11-25 Fernando Perez <fperez@colorado.edu>
6653 2001-11-25 Fernando Perez <fperez@colorado.edu>
6649
6654
6650 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6655 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6651 there's a cleaner distinction between what ? and ?? show.
6656 there's a cleaner distinction between what ? and ?? show.
6652
6657
6653 * Added screen_length option. Now the user can define his own
6658 * Added screen_length option. Now the user can define his own
6654 screen size for page() operations.
6659 screen size for page() operations.
6655
6660
6656 * Implemented magic shell-like functions with automatic code
6661 * Implemented magic shell-like functions with automatic code
6657 generation. Now adding another function is just a matter of adding
6662 generation. Now adding another function is just a matter of adding
6658 an entry to a dict, and the function is dynamically generated at
6663 an entry to a dict, and the function is dynamically generated at
6659 run-time. Python has some really cool features!
6664 run-time. Python has some really cool features!
6660
6665
6661 * Renamed many options to cleanup conventions a little. Now all
6666 * Renamed many options to cleanup conventions a little. Now all
6662 are lowercase, and only underscores where needed. Also in the code
6667 are lowercase, and only underscores where needed. Also in the code
6663 option name tables are clearer.
6668 option name tables are clearer.
6664
6669
6665 * Changed prompts a little. Now input is 'In [n]:' instead of
6670 * Changed prompts a little. Now input is 'In [n]:' instead of
6666 'In[n]:='. This allows it the numbers to be aligned with the
6671 'In[n]:='. This allows it the numbers to be aligned with the
6667 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6672 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6668 Python (it was a Mathematica thing). The '...' continuation prompt
6673 Python (it was a Mathematica thing). The '...' continuation prompt
6669 was also changed a little to align better.
6674 was also changed a little to align better.
6670
6675
6671 * Fixed bug when flushing output cache. Not all _p<n> variables
6676 * Fixed bug when flushing output cache. Not all _p<n> variables
6672 exist, so their deletion needs to be wrapped in a try:
6677 exist, so their deletion needs to be wrapped in a try:
6673
6678
6674 * Figured out how to properly use inspect.formatargspec() (it
6679 * Figured out how to properly use inspect.formatargspec() (it
6675 requires the args preceded by *). So I removed all the code from
6680 requires the args preceded by *). So I removed all the code from
6676 _get_pdef in Magic, which was just replicating that.
6681 _get_pdef in Magic, which was just replicating that.
6677
6682
6678 * Added test to prefilter to allow redefining magic function names
6683 * Added test to prefilter to allow redefining magic function names
6679 as variables. This is ok, since the @ form is always available,
6684 as variables. This is ok, since the @ form is always available,
6680 but whe should allow the user to define a variable called 'ls' if
6685 but whe should allow the user to define a variable called 'ls' if
6681 he needs it.
6686 he needs it.
6682
6687
6683 * Moved the ToDo information from README into a separate ToDo.
6688 * Moved the ToDo information from README into a separate ToDo.
6684
6689
6685 * General code cleanup and small bugfixes. I think it's close to a
6690 * General code cleanup and small bugfixes. I think it's close to a
6686 state where it can be released, obviously with a big 'beta'
6691 state where it can be released, obviously with a big 'beta'
6687 warning on it.
6692 warning on it.
6688
6693
6689 * Got the magic function split to work. Now all magics are defined
6694 * Got the magic function split to work. Now all magics are defined
6690 in a separate class. It just organizes things a bit, and now
6695 in a separate class. It just organizes things a bit, and now
6691 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6696 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6692 was too long).
6697 was too long).
6693
6698
6694 * Changed @clear to @reset to avoid potential confusions with
6699 * Changed @clear to @reset to avoid potential confusions with
6695 the shell command clear. Also renamed @cl to @clear, which does
6700 the shell command clear. Also renamed @cl to @clear, which does
6696 exactly what people expect it to from their shell experience.
6701 exactly what people expect it to from their shell experience.
6697
6702
6698 Added a check to the @reset command (since it's so
6703 Added a check to the @reset command (since it's so
6699 destructive, it's probably a good idea to ask for confirmation).
6704 destructive, it's probably a good idea to ask for confirmation).
6700 But now reset only works for full namespace resetting. Since the
6705 But now reset only works for full namespace resetting. Since the
6701 del keyword is already there for deleting a few specific
6706 del keyword is already there for deleting a few specific
6702 variables, I don't see the point of having a redundant magic
6707 variables, I don't see the point of having a redundant magic
6703 function for the same task.
6708 function for the same task.
6704
6709
6705 2001-11-24 Fernando Perez <fperez@colorado.edu>
6710 2001-11-24 Fernando Perez <fperez@colorado.edu>
6706
6711
6707 * Updated the builtin docs (esp. the ? ones).
6712 * Updated the builtin docs (esp. the ? ones).
6708
6713
6709 * Ran all the code through pychecker. Not terribly impressed with
6714 * Ran all the code through pychecker. Not terribly impressed with
6710 it: lots of spurious warnings and didn't really find anything of
6715 it: lots of spurious warnings and didn't really find anything of
6711 substance (just a few modules being imported and not used).
6716 substance (just a few modules being imported and not used).
6712
6717
6713 * Implemented the new ultraTB functionality into IPython. New
6718 * Implemented the new ultraTB functionality into IPython. New
6714 option: xcolors. This chooses color scheme. xmode now only selects
6719 option: xcolors. This chooses color scheme. xmode now only selects
6715 between Plain and Verbose. Better orthogonality.
6720 between Plain and Verbose. Better orthogonality.
6716
6721
6717 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6722 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6718 mode and color scheme for the exception handlers. Now it's
6723 mode and color scheme for the exception handlers. Now it's
6719 possible to have the verbose traceback with no coloring.
6724 possible to have the verbose traceback with no coloring.
6720
6725
6721 2001-11-23 Fernando Perez <fperez@colorado.edu>
6726 2001-11-23 Fernando Perez <fperez@colorado.edu>
6722
6727
6723 * Version 0.1.12 released, 0.1.13 opened.
6728 * Version 0.1.12 released, 0.1.13 opened.
6724
6729
6725 * Removed option to set auto-quote and auto-paren escapes by
6730 * Removed option to set auto-quote and auto-paren escapes by
6726 user. The chances of breaking valid syntax are just too high. If
6731 user. The chances of breaking valid syntax are just too high. If
6727 someone *really* wants, they can always dig into the code.
6732 someone *really* wants, they can always dig into the code.
6728
6733
6729 * Made prompt separators configurable.
6734 * Made prompt separators configurable.
6730
6735
6731 2001-11-22 Fernando Perez <fperez@colorado.edu>
6736 2001-11-22 Fernando Perez <fperez@colorado.edu>
6732
6737
6733 * Small bugfixes in many places.
6738 * Small bugfixes in many places.
6734
6739
6735 * Removed the MyCompleter class from ipplib. It seemed redundant
6740 * Removed the MyCompleter class from ipplib. It seemed redundant
6736 with the C-p,C-n history search functionality. Less code to
6741 with the C-p,C-n history search functionality. Less code to
6737 maintain.
6742 maintain.
6738
6743
6739 * Moved all the original ipython.py code into ipythonlib.py. Right
6744 * Moved all the original ipython.py code into ipythonlib.py. Right
6740 now it's just one big dump into a function called make_IPython, so
6745 now it's just one big dump into a function called make_IPython, so
6741 no real modularity has been gained. But at least it makes the
6746 no real modularity has been gained. But at least it makes the
6742 wrapper script tiny, and since ipythonlib is a module, it gets
6747 wrapper script tiny, and since ipythonlib is a module, it gets
6743 compiled and startup is much faster.
6748 compiled and startup is much faster.
6744
6749
6745 This is a reasobably 'deep' change, so we should test it for a
6750 This is a reasobably 'deep' change, so we should test it for a
6746 while without messing too much more with the code.
6751 while without messing too much more with the code.
6747
6752
6748 2001-11-21 Fernando Perez <fperez@colorado.edu>
6753 2001-11-21 Fernando Perez <fperez@colorado.edu>
6749
6754
6750 * Version 0.1.11 released, 0.1.12 opened for further work.
6755 * Version 0.1.11 released, 0.1.12 opened for further work.
6751
6756
6752 * Removed dependency on Itpl. It was only needed in one place. It
6757 * Removed dependency on Itpl. It was only needed in one place. It
6753 would be nice if this became part of python, though. It makes life
6758 would be nice if this became part of python, though. It makes life
6754 *a lot* easier in some cases.
6759 *a lot* easier in some cases.
6755
6760
6756 * Simplified the prefilter code a bit. Now all handlers are
6761 * Simplified the prefilter code a bit. Now all handlers are
6757 expected to explicitly return a value (at least a blank string).
6762 expected to explicitly return a value (at least a blank string).
6758
6763
6759 * Heavy edits in ipplib. Removed the help system altogether. Now
6764 * Heavy edits in ipplib. Removed the help system altogether. Now
6760 obj?/?? is used for inspecting objects, a magic @doc prints
6765 obj?/?? is used for inspecting objects, a magic @doc prints
6761 docstrings, and full-blown Python help is accessed via the 'help'
6766 docstrings, and full-blown Python help is accessed via the 'help'
6762 keyword. This cleans up a lot of code (less to maintain) and does
6767 keyword. This cleans up a lot of code (less to maintain) and does
6763 the job. Since 'help' is now a standard Python component, might as
6768 the job. Since 'help' is now a standard Python component, might as
6764 well use it and remove duplicate functionality.
6769 well use it and remove duplicate functionality.
6765
6770
6766 Also removed the option to use ipplib as a standalone program. By
6771 Also removed the option to use ipplib as a standalone program. By
6767 now it's too dependent on other parts of IPython to function alone.
6772 now it's too dependent on other parts of IPython to function alone.
6768
6773
6769 * Fixed bug in genutils.pager. It would crash if the pager was
6774 * Fixed bug in genutils.pager. It would crash if the pager was
6770 exited immediately after opening (broken pipe).
6775 exited immediately after opening (broken pipe).
6771
6776
6772 * Trimmed down the VerboseTB reporting a little. The header is
6777 * Trimmed down the VerboseTB reporting a little. The header is
6773 much shorter now and the repeated exception arguments at the end
6778 much shorter now and the repeated exception arguments at the end
6774 have been removed. For interactive use the old header seemed a bit
6779 have been removed. For interactive use the old header seemed a bit
6775 excessive.
6780 excessive.
6776
6781
6777 * Fixed small bug in output of @whos for variables with multi-word
6782 * Fixed small bug in output of @whos for variables with multi-word
6778 types (only first word was displayed).
6783 types (only first word was displayed).
6779
6784
6780 2001-11-17 Fernando Perez <fperez@colorado.edu>
6785 2001-11-17 Fernando Perez <fperez@colorado.edu>
6781
6786
6782 * Version 0.1.10 released, 0.1.11 opened for further work.
6787 * Version 0.1.10 released, 0.1.11 opened for further work.
6783
6788
6784 * Modified dirs and friends. dirs now *returns* the stack (not
6789 * Modified dirs and friends. dirs now *returns* the stack (not
6785 prints), so one can manipulate it as a variable. Convenient to
6790 prints), so one can manipulate it as a variable. Convenient to
6786 travel along many directories.
6791 travel along many directories.
6787
6792
6788 * Fixed bug in magic_pdef: would only work with functions with
6793 * Fixed bug in magic_pdef: would only work with functions with
6789 arguments with default values.
6794 arguments with default values.
6790
6795
6791 2001-11-14 Fernando Perez <fperez@colorado.edu>
6796 2001-11-14 Fernando Perez <fperez@colorado.edu>
6792
6797
6793 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6798 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6794 example with IPython. Various other minor fixes and cleanups.
6799 example with IPython. Various other minor fixes and cleanups.
6795
6800
6796 * Version 0.1.9 released, 0.1.10 opened for further work.
6801 * Version 0.1.9 released, 0.1.10 opened for further work.
6797
6802
6798 * Added sys.path to the list of directories searched in the
6803 * Added sys.path to the list of directories searched in the
6799 execfile= option. It used to be the current directory and the
6804 execfile= option. It used to be the current directory and the
6800 user's IPYTHONDIR only.
6805 user's IPYTHONDIR only.
6801
6806
6802 2001-11-13 Fernando Perez <fperez@colorado.edu>
6807 2001-11-13 Fernando Perez <fperez@colorado.edu>
6803
6808
6804 * Reinstated the raw_input/prefilter separation that Janko had
6809 * Reinstated the raw_input/prefilter separation that Janko had
6805 initially. This gives a more convenient setup for extending the
6810 initially. This gives a more convenient setup for extending the
6806 pre-processor from the outside: raw_input always gets a string,
6811 pre-processor from the outside: raw_input always gets a string,
6807 and prefilter has to process it. We can then redefine prefilter
6812 and prefilter has to process it. We can then redefine prefilter
6808 from the outside and implement extensions for special
6813 from the outside and implement extensions for special
6809 purposes.
6814 purposes.
6810
6815
6811 Today I got one for inputting PhysicalQuantity objects
6816 Today I got one for inputting PhysicalQuantity objects
6812 (from Scientific) without needing any function calls at
6817 (from Scientific) without needing any function calls at
6813 all. Extremely convenient, and it's all done as a user-level
6818 all. Extremely convenient, and it's all done as a user-level
6814 extension (no IPython code was touched). Now instead of:
6819 extension (no IPython code was touched). Now instead of:
6815 a = PhysicalQuantity(4.2,'m/s**2')
6820 a = PhysicalQuantity(4.2,'m/s**2')
6816 one can simply say
6821 one can simply say
6817 a = 4.2 m/s**2
6822 a = 4.2 m/s**2
6818 or even
6823 or even
6819 a = 4.2 m/s^2
6824 a = 4.2 m/s^2
6820
6825
6821 I use this, but it's also a proof of concept: IPython really is
6826 I use this, but it's also a proof of concept: IPython really is
6822 fully user-extensible, even at the level of the parsing of the
6827 fully user-extensible, even at the level of the parsing of the
6823 command line. It's not trivial, but it's perfectly doable.
6828 command line. It's not trivial, but it's perfectly doable.
6824
6829
6825 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6830 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6826 the problem of modules being loaded in the inverse order in which
6831 the problem of modules being loaded in the inverse order in which
6827 they were defined in
6832 they were defined in
6828
6833
6829 * Version 0.1.8 released, 0.1.9 opened for further work.
6834 * Version 0.1.8 released, 0.1.9 opened for further work.
6830
6835
6831 * Added magics pdef, source and file. They respectively show the
6836 * Added magics pdef, source and file. They respectively show the
6832 definition line ('prototype' in C), source code and full python
6837 definition line ('prototype' in C), source code and full python
6833 file for any callable object. The object inspector oinfo uses
6838 file for any callable object. The object inspector oinfo uses
6834 these to show the same information.
6839 these to show the same information.
6835
6840
6836 * Version 0.1.7 released, 0.1.8 opened for further work.
6841 * Version 0.1.7 released, 0.1.8 opened for further work.
6837
6842
6838 * Separated all the magic functions into a class called Magic. The
6843 * Separated all the magic functions into a class called Magic. The
6839 InteractiveShell class was becoming too big for Xemacs to handle
6844 InteractiveShell class was becoming too big for Xemacs to handle
6840 (de-indenting a line would lock it up for 10 seconds while it
6845 (de-indenting a line would lock it up for 10 seconds while it
6841 backtracked on the whole class!)
6846 backtracked on the whole class!)
6842
6847
6843 FIXME: didn't work. It can be done, but right now namespaces are
6848 FIXME: didn't work. It can be done, but right now namespaces are
6844 all messed up. Do it later (reverted it for now, so at least
6849 all messed up. Do it later (reverted it for now, so at least
6845 everything works as before).
6850 everything works as before).
6846
6851
6847 * Got the object introspection system (magic_oinfo) working! I
6852 * Got the object introspection system (magic_oinfo) working! I
6848 think this is pretty much ready for release to Janko, so he can
6853 think this is pretty much ready for release to Janko, so he can
6849 test it for a while and then announce it. Pretty much 100% of what
6854 test it for a while and then announce it. Pretty much 100% of what
6850 I wanted for the 'phase 1' release is ready. Happy, tired.
6855 I wanted for the 'phase 1' release is ready. Happy, tired.
6851
6856
6852 2001-11-12 Fernando Perez <fperez@colorado.edu>
6857 2001-11-12 Fernando Perez <fperez@colorado.edu>
6853
6858
6854 * Version 0.1.6 released, 0.1.7 opened for further work.
6859 * Version 0.1.6 released, 0.1.7 opened for further work.
6855
6860
6856 * Fixed bug in printing: it used to test for truth before
6861 * Fixed bug in printing: it used to test for truth before
6857 printing, so 0 wouldn't print. Now checks for None.
6862 printing, so 0 wouldn't print. Now checks for None.
6858
6863
6859 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6864 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6860 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6865 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6861 reaches by hand into the outputcache. Think of a better way to do
6866 reaches by hand into the outputcache. Think of a better way to do
6862 this later.
6867 this later.
6863
6868
6864 * Various small fixes thanks to Nathan's comments.
6869 * Various small fixes thanks to Nathan's comments.
6865
6870
6866 * Changed magic_pprint to magic_Pprint. This way it doesn't
6871 * Changed magic_pprint to magic_Pprint. This way it doesn't
6867 collide with pprint() and the name is consistent with the command
6872 collide with pprint() and the name is consistent with the command
6868 line option.
6873 line option.
6869
6874
6870 * Changed prompt counter behavior to be fully like
6875 * Changed prompt counter behavior to be fully like
6871 Mathematica's. That is, even input that doesn't return a result
6876 Mathematica's. That is, even input that doesn't return a result
6872 raises the prompt counter. The old behavior was kind of confusing
6877 raises the prompt counter. The old behavior was kind of confusing
6873 (getting the same prompt number several times if the operation
6878 (getting the same prompt number several times if the operation
6874 didn't return a result).
6879 didn't return a result).
6875
6880
6876 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6881 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6877
6882
6878 * Fixed -Classic mode (wasn't working anymore).
6883 * Fixed -Classic mode (wasn't working anymore).
6879
6884
6880 * Added colored prompts using Nathan's new code. Colors are
6885 * Added colored prompts using Nathan's new code. Colors are
6881 currently hardwired, they can be user-configurable. For
6886 currently hardwired, they can be user-configurable. For
6882 developers, they can be chosen in file ipythonlib.py, at the
6887 developers, they can be chosen in file ipythonlib.py, at the
6883 beginning of the CachedOutput class def.
6888 beginning of the CachedOutput class def.
6884
6889
6885 2001-11-11 Fernando Perez <fperez@colorado.edu>
6890 2001-11-11 Fernando Perez <fperez@colorado.edu>
6886
6891
6887 * Version 0.1.5 released, 0.1.6 opened for further work.
6892 * Version 0.1.5 released, 0.1.6 opened for further work.
6888
6893
6889 * Changed magic_env to *return* the environment as a dict (not to
6894 * Changed magic_env to *return* the environment as a dict (not to
6890 print it). This way it prints, but it can also be processed.
6895 print it). This way it prints, but it can also be processed.
6891
6896
6892 * Added Verbose exception reporting to interactive
6897 * Added Verbose exception reporting to interactive
6893 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6898 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6894 traceback. Had to make some changes to the ultraTB file. This is
6899 traceback. Had to make some changes to the ultraTB file. This is
6895 probably the last 'big' thing in my mental todo list. This ties
6900 probably the last 'big' thing in my mental todo list. This ties
6896 in with the next entry:
6901 in with the next entry:
6897
6902
6898 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6903 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6899 has to specify is Plain, Color or Verbose for all exception
6904 has to specify is Plain, Color or Verbose for all exception
6900 handling.
6905 handling.
6901
6906
6902 * Removed ShellServices option. All this can really be done via
6907 * Removed ShellServices option. All this can really be done via
6903 the magic system. It's easier to extend, cleaner and has automatic
6908 the magic system. It's easier to extend, cleaner and has automatic
6904 namespace protection and documentation.
6909 namespace protection and documentation.
6905
6910
6906 2001-11-09 Fernando Perez <fperez@colorado.edu>
6911 2001-11-09 Fernando Perez <fperez@colorado.edu>
6907
6912
6908 * Fixed bug in output cache flushing (missing parameter to
6913 * Fixed bug in output cache flushing (missing parameter to
6909 __init__). Other small bugs fixed (found using pychecker).
6914 __init__). Other small bugs fixed (found using pychecker).
6910
6915
6911 * Version 0.1.4 opened for bugfixing.
6916 * Version 0.1.4 opened for bugfixing.
6912
6917
6913 2001-11-07 Fernando Perez <fperez@colorado.edu>
6918 2001-11-07 Fernando Perez <fperez@colorado.edu>
6914
6919
6915 * Version 0.1.3 released, mainly because of the raw_input bug.
6920 * Version 0.1.3 released, mainly because of the raw_input bug.
6916
6921
6917 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6922 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6918 and when testing for whether things were callable, a call could
6923 and when testing for whether things were callable, a call could
6919 actually be made to certain functions. They would get called again
6924 actually be made to certain functions. They would get called again
6920 once 'really' executed, with a resulting double call. A disaster
6925 once 'really' executed, with a resulting double call. A disaster
6921 in many cases (list.reverse() would never work!).
6926 in many cases (list.reverse() would never work!).
6922
6927
6923 * Removed prefilter() function, moved its code to raw_input (which
6928 * Removed prefilter() function, moved its code to raw_input (which
6924 after all was just a near-empty caller for prefilter). This saves
6929 after all was just a near-empty caller for prefilter). This saves
6925 a function call on every prompt, and simplifies the class a tiny bit.
6930 a function call on every prompt, and simplifies the class a tiny bit.
6926
6931
6927 * Fix _ip to __ip name in magic example file.
6932 * Fix _ip to __ip name in magic example file.
6928
6933
6929 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6934 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6930 work with non-gnu versions of tar.
6935 work with non-gnu versions of tar.
6931
6936
6932 2001-11-06 Fernando Perez <fperez@colorado.edu>
6937 2001-11-06 Fernando Perez <fperez@colorado.edu>
6933
6938
6934 * Version 0.1.2. Just to keep track of the recent changes.
6939 * Version 0.1.2. Just to keep track of the recent changes.
6935
6940
6936 * Fixed nasty bug in output prompt routine. It used to check 'if
6941 * Fixed nasty bug in output prompt routine. It used to check 'if
6937 arg != None...'. Problem is, this fails if arg implements a
6942 arg != None...'. Problem is, this fails if arg implements a
6938 special comparison (__cmp__) which disallows comparing to
6943 special comparison (__cmp__) which disallows comparing to
6939 None. Found it when trying to use the PhysicalQuantity module from
6944 None. Found it when trying to use the PhysicalQuantity module from
6940 ScientificPython.
6945 ScientificPython.
6941
6946
6942 2001-11-05 Fernando Perez <fperez@colorado.edu>
6947 2001-11-05 Fernando Perez <fperez@colorado.edu>
6943
6948
6944 * Also added dirs. Now the pushd/popd/dirs family functions
6949 * Also added dirs. Now the pushd/popd/dirs family functions
6945 basically like the shell, with the added convenience of going home
6950 basically like the shell, with the added convenience of going home
6946 when called with no args.
6951 when called with no args.
6947
6952
6948 * pushd/popd slightly modified to mimic shell behavior more
6953 * pushd/popd slightly modified to mimic shell behavior more
6949 closely.
6954 closely.
6950
6955
6951 * Added env,pushd,popd from ShellServices as magic functions. I
6956 * Added env,pushd,popd from ShellServices as magic functions. I
6952 think the cleanest will be to port all desired functions from
6957 think the cleanest will be to port all desired functions from
6953 ShellServices as magics and remove ShellServices altogether. This
6958 ShellServices as magics and remove ShellServices altogether. This
6954 will provide a single, clean way of adding functionality
6959 will provide a single, clean way of adding functionality
6955 (shell-type or otherwise) to IP.
6960 (shell-type or otherwise) to IP.
6956
6961
6957 2001-11-04 Fernando Perez <fperez@colorado.edu>
6962 2001-11-04 Fernando Perez <fperez@colorado.edu>
6958
6963
6959 * Added .ipython/ directory to sys.path. This way users can keep
6964 * Added .ipython/ directory to sys.path. This way users can keep
6960 customizations there and access them via import.
6965 customizations there and access them via import.
6961
6966
6962 2001-11-03 Fernando Perez <fperez@colorado.edu>
6967 2001-11-03 Fernando Perez <fperez@colorado.edu>
6963
6968
6964 * Opened version 0.1.1 for new changes.
6969 * Opened version 0.1.1 for new changes.
6965
6970
6966 * Changed version number to 0.1.0: first 'public' release, sent to
6971 * Changed version number to 0.1.0: first 'public' release, sent to
6967 Nathan and Janko.
6972 Nathan and Janko.
6968
6973
6969 * Lots of small fixes and tweaks.
6974 * Lots of small fixes and tweaks.
6970
6975
6971 * Minor changes to whos format. Now strings are shown, snipped if
6976 * Minor changes to whos format. Now strings are shown, snipped if
6972 too long.
6977 too long.
6973
6978
6974 * Changed ShellServices to work on __main__ so they show up in @who
6979 * Changed ShellServices to work on __main__ so they show up in @who
6975
6980
6976 * Help also works with ? at the end of a line:
6981 * Help also works with ? at the end of a line:
6977 ?sin and sin?
6982 ?sin and sin?
6978 both produce the same effect. This is nice, as often I use the
6983 both produce the same effect. This is nice, as often I use the
6979 tab-complete to find the name of a method, but I used to then have
6984 tab-complete to find the name of a method, but I used to then have
6980 to go to the beginning of the line to put a ? if I wanted more
6985 to go to the beginning of the line to put a ? if I wanted more
6981 info. Now I can just add the ? and hit return. Convenient.
6986 info. Now I can just add the ? and hit return. Convenient.
6982
6987
6983 2001-11-02 Fernando Perez <fperez@colorado.edu>
6988 2001-11-02 Fernando Perez <fperez@colorado.edu>
6984
6989
6985 * Python version check (>=2.1) added.
6990 * Python version check (>=2.1) added.
6986
6991
6987 * Added LazyPython documentation. At this point the docs are quite
6992 * Added LazyPython documentation. At this point the docs are quite
6988 a mess. A cleanup is in order.
6993 a mess. A cleanup is in order.
6989
6994
6990 * Auto-installer created. For some bizarre reason, the zipfiles
6995 * Auto-installer created. For some bizarre reason, the zipfiles
6991 module isn't working on my system. So I made a tar version
6996 module isn't working on my system. So I made a tar version
6992 (hopefully the command line options in various systems won't kill
6997 (hopefully the command line options in various systems won't kill
6993 me).
6998 me).
6994
6999
6995 * Fixes to Struct in genutils. Now all dictionary-like methods are
7000 * Fixes to Struct in genutils. Now all dictionary-like methods are
6996 protected (reasonably).
7001 protected (reasonably).
6997
7002
6998 * Added pager function to genutils and changed ? to print usage
7003 * Added pager function to genutils and changed ? to print usage
6999 note through it (it was too long).
7004 note through it (it was too long).
7000
7005
7001 * Added the LazyPython functionality. Works great! I changed the
7006 * Added the LazyPython functionality. Works great! I changed the
7002 auto-quote escape to ';', it's on home row and next to '. But
7007 auto-quote escape to ';', it's on home row and next to '. But
7003 both auto-quote and auto-paren (still /) escapes are command-line
7008 both auto-quote and auto-paren (still /) escapes are command-line
7004 parameters.
7009 parameters.
7005
7010
7006
7011
7007 2001-11-01 Fernando Perez <fperez@colorado.edu>
7012 2001-11-01 Fernando Perez <fperez@colorado.edu>
7008
7013
7009 * Version changed to 0.0.7. Fairly large change: configuration now
7014 * Version changed to 0.0.7. Fairly large change: configuration now
7010 is all stored in a directory, by default .ipython. There, all
7015 is all stored in a directory, by default .ipython. There, all
7011 config files have normal looking names (not .names)
7016 config files have normal looking names (not .names)
7012
7017
7013 * Version 0.0.6 Released first to Lucas and Archie as a test
7018 * Version 0.0.6 Released first to Lucas and Archie as a test
7014 run. Since it's the first 'semi-public' release, change version to
7019 run. Since it's the first 'semi-public' release, change version to
7015 > 0.0.6 for any changes now.
7020 > 0.0.6 for any changes now.
7016
7021
7017 * Stuff I had put in the ipplib.py changelog:
7022 * Stuff I had put in the ipplib.py changelog:
7018
7023
7019 Changes to InteractiveShell:
7024 Changes to InteractiveShell:
7020
7025
7021 - Made the usage message a parameter.
7026 - Made the usage message a parameter.
7022
7027
7023 - Require the name of the shell variable to be given. It's a bit
7028 - Require the name of the shell variable to be given. It's a bit
7024 of a hack, but allows the name 'shell' not to be hardwired in the
7029 of a hack, but allows the name 'shell' not to be hardwired in the
7025 magic (@) handler, which is problematic b/c it requires
7030 magic (@) handler, which is problematic b/c it requires
7026 polluting the global namespace with 'shell'. This in turn is
7031 polluting the global namespace with 'shell'. This in turn is
7027 fragile: if a user redefines a variable called shell, things
7032 fragile: if a user redefines a variable called shell, things
7028 break.
7033 break.
7029
7034
7030 - magic @: all functions available through @ need to be defined
7035 - magic @: all functions available through @ need to be defined
7031 as magic_<name>, even though they can be called simply as
7036 as magic_<name>, even though they can be called simply as
7032 @<name>. This allows the special command @magic to gather
7037 @<name>. This allows the special command @magic to gather
7033 information automatically about all existing magic functions,
7038 information automatically about all existing magic functions,
7034 even if they are run-time user extensions, by parsing the shell
7039 even if they are run-time user extensions, by parsing the shell
7035 instance __dict__ looking for special magic_ names.
7040 instance __dict__ looking for special magic_ names.
7036
7041
7037 - mainloop: added *two* local namespace parameters. This allows
7042 - mainloop: added *two* local namespace parameters. This allows
7038 the class to differentiate between parameters which were there
7043 the class to differentiate between parameters which were there
7039 before and after command line initialization was processed. This
7044 before and after command line initialization was processed. This
7040 way, later @who can show things loaded at startup by the
7045 way, later @who can show things loaded at startup by the
7041 user. This trick was necessary to make session saving/reloading
7046 user. This trick was necessary to make session saving/reloading
7042 really work: ideally after saving/exiting/reloading a session,
7047 really work: ideally after saving/exiting/reloading a session,
7043 *everything* should look the same, including the output of @who. I
7048 *everything* should look the same, including the output of @who. I
7044 was only able to make this work with this double namespace
7049 was only able to make this work with this double namespace
7045 trick.
7050 trick.
7046
7051
7047 - added a header to the logfile which allows (almost) full
7052 - added a header to the logfile which allows (almost) full
7048 session restoring.
7053 session restoring.
7049
7054
7050 - prepend lines beginning with @ or !, with a and log
7055 - prepend lines beginning with @ or !, with a and log
7051 them. Why? !lines: may be useful to know what you did @lines:
7056 them. Why? !lines: may be useful to know what you did @lines:
7052 they may affect session state. So when restoring a session, at
7057 they may affect session state. So when restoring a session, at
7053 least inform the user of their presence. I couldn't quite get
7058 least inform the user of their presence. I couldn't quite get
7054 them to properly re-execute, but at least the user is warned.
7059 them to properly re-execute, but at least the user is warned.
7055
7060
7056 * Started ChangeLog.
7061 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now