##// END OF EJS Templates
Make igrpentry and ipwdentry comparable.
walter.doerwald -
Show More
@@ -1,2121 +1,2133
1 # -*- coding: iso-8859-1 -*-
1 # -*- coding: iso-8859-1 -*-
2
2
3 """
3 """
4 ``ipipe`` provides classes to be used in an interactive Python session. Doing a
4 ``ipipe`` provides classes to be used in an interactive Python session. Doing a
5 ``from ipipe import *`` is the preferred way to do this. The name of all
5 ``from ipipe import *`` is the preferred way to do this. The name of all
6 objects imported this way starts with ``i`` to minimize collisions.
6 objects imported this way starts with ``i`` to minimize collisions.
7
7
8 ``ipipe`` supports "pipeline expressions", which is something resembling Unix
8 ``ipipe`` supports "pipeline expressions", which is something resembling Unix
9 pipes. An example is:
9 pipes. An example is:
10
10
11 >>> ienv | isort("key.lower()")
11 >>> ienv | isort("key.lower()")
12
12
13 This gives a listing of all environment variables sorted by name.
13 This gives a listing of all environment variables sorted by name.
14
14
15
15
16 There are three types of objects in a pipeline expression:
16 There are three types of objects in a pipeline expression:
17
17
18 * ``Table``s: These objects produce items. Examples are ``ils`` (listing the
18 * ``Table``s: These objects produce items. Examples are ``ils`` (listing the
19 current directory, ``ienv`` (listing environment variables), ``ipwd`` (listing
19 current directory, ``ienv`` (listing environment variables), ``ipwd`` (listing
20 user accounts) and ``igrp`` (listing user groups). A ``Table`` must be the
20 user accounts) and ``igrp`` (listing user groups). A ``Table`` must be the
21 first object in a pipe expression.
21 first object in a pipe expression.
22
22
23 * ``Pipe``s: These objects sit in the middle of a pipe expression. They
23 * ``Pipe``s: These objects sit in the middle of a pipe expression. They
24 transform the input in some way (e.g. filtering or sorting it). Examples are:
24 transform the input in some way (e.g. filtering or sorting it). Examples are:
25 ``ifilter`` (which filters the input pipe), ``isort`` (which sorts the input
25 ``ifilter`` (which filters the input pipe), ``isort`` (which sorts the input
26 pipe) and ``ieval`` (which evaluates a function or expression for each object
26 pipe) and ``ieval`` (which evaluates a function or expression for each object
27 in the input pipe).
27 in the input pipe).
28
28
29 * ``Display``s: These objects can be put as the last object in a pipeline
29 * ``Display``s: These objects can be put as the last object in a pipeline
30 expression. There are responsible for displaying the result of the pipeline
30 expression. There are responsible for displaying the result of the pipeline
31 expression. If a pipeline expression doesn't end in a display object a default
31 expression. If a pipeline expression doesn't end in a display object a default
32 display objects will be used. One example is ``ibrowse`` which is a ``curses``
32 display objects will be used. One example is ``ibrowse`` which is a ``curses``
33 based browser.
33 based browser.
34
34
35
35
36 Adding support for pipeline expressions to your own objects can be done through
36 Adding support for pipeline expressions to your own objects can be done through
37 three extensions points (all of them optional):
37 three extensions points (all of them optional):
38
38
39 * An object that will be displayed as a row by a ``Display`` object should
39 * An object that will be displayed as a row by a ``Display`` object should
40 implement the method ``__xattrs__(self, mode)`` method or register an
40 implement the method ``__xattrs__(self, mode)`` method or register an
41 implementation of the generic function ``xattrs``. For more info see ``xattrs``.
41 implementation of the generic function ``xattrs``. For more info see ``xattrs``.
42
42
43 * When an object ``foo`` is displayed by a ``Display`` object, the generic
43 * When an object ``foo`` is displayed by a ``Display`` object, the generic
44 function ``xrepr`` is used.
44 function ``xrepr`` is used.
45
45
46 * Objects that can be iterated by ``Pipe``s must iterable. For special cases,
46 * Objects that can be iterated by ``Pipe``s must iterable. For special cases,
47 where iteration for display is different than the normal iteration a special
47 where iteration for display is different than the normal iteration a special
48 implementation can be registered with the generic function ``xiter``. This makes
48 implementation can be registered with the generic function ``xiter``. This makes
49 it possible to use dictionaries and modules in pipeline expressions, for example:
49 it possible to use dictionaries and modules in pipeline expressions, for example:
50
50
51 >>> import sys
51 >>> import sys
52 >>> sys | ifilter("isinstance(value, int)") | idump
52 >>> sys | ifilter("isinstance(value, int)") | idump
53 key |value
53 key |value
54 api_version| 1012
54 api_version| 1012
55 dllhandle | 503316480
55 dllhandle | 503316480
56 hexversion | 33817328
56 hexversion | 33817328
57 maxint |2147483647
57 maxint |2147483647
58 maxunicode | 65535
58 maxunicode | 65535
59 >>> sys.modules | ifilter("_.value is not None") | isort("_.key.lower()")
59 >>> sys.modules | ifilter("_.value is not None") | isort("_.key.lower()")
60 ...
60 ...
61
61
62 Note: The expression strings passed to ``ifilter()`` and ``isort()`` can
62 Note: The expression strings passed to ``ifilter()`` and ``isort()`` can
63 refer to the object to be filtered or sorted via the variable ``_`` and to any
63 refer to the object to be filtered or sorted via the variable ``_`` and to any
64 of the attributes of the object, i.e.:
64 of the attributes of the object, i.e.:
65
65
66 >>> sys.modules | ifilter("_.value is not None") | isort("_.key.lower()")
66 >>> sys.modules | ifilter("_.value is not None") | isort("_.key.lower()")
67
67
68 does the same as
68 does the same as
69
69
70 >>> sys.modules | ifilter("value is not None") | isort("key.lower()")
70 >>> sys.modules | ifilter("value is not None") | isort("key.lower()")
71
71
72 In addition to expression strings, it's possible to pass callables (taking
72 In addition to expression strings, it's possible to pass callables (taking
73 the object as an argument) to ``ifilter()``, ``isort()`` and ``ieval()``:
73 the object as an argument) to ``ifilter()``, ``isort()`` and ``ieval()``:
74
74
75 >>> sys | ifilter(lambda _:isinstance(_.value, int)) \
75 >>> sys | ifilter(lambda _:isinstance(_.value, int)) \
76 ... | ieval(lambda _: (_.key, hex(_.value))) | idump
76 ... | ieval(lambda _: (_.key, hex(_.value))) | idump
77 0 |1
77 0 |1
78 api_version|0x3f4
78 api_version|0x3f4
79 dllhandle |0x1e000000
79 dllhandle |0x1e000000
80 hexversion |0x20402f0
80 hexversion |0x20402f0
81 maxint |0x7fffffff
81 maxint |0x7fffffff
82 maxunicode |0xffff
82 maxunicode |0xffff
83 """
83 """
84
84
85 import sys, os, os.path, stat, glob, new, csv, datetime, types
85 import sys, os, os.path, stat, glob, new, csv, datetime, types
86 import itertools, mimetypes
86 import itertools, mimetypes
87
87
88 try: # Python 2.3 compatibility
88 try: # Python 2.3 compatibility
89 import collections
89 import collections
90 except ImportError:
90 except ImportError:
91 deque = list
91 deque = list
92 else:
92 else:
93 deque = collections.deque
93 deque = collections.deque
94
94
95 try: # Python 2.3 compatibility
95 try: # Python 2.3 compatibility
96 set
96 set
97 except NameError:
97 except NameError:
98 import sets
98 import sets
99 set = sets.Set
99 set = sets.Set
100
100
101 try: # Python 2.3 compatibility
101 try: # Python 2.3 compatibility
102 sorted
102 sorted
103 except NameError:
103 except NameError:
104 def sorted(iterator, key=None, reverse=False):
104 def sorted(iterator, key=None, reverse=False):
105 items = list(iterator)
105 items = list(iterator)
106 if key is not None:
106 if key is not None:
107 items.sort(lambda i1, i2: cmp(key(i1), key(i2)))
107 items.sort(lambda i1, i2: cmp(key(i1), key(i2)))
108 else:
108 else:
109 items.sort()
109 items.sort()
110 if reverse:
110 if reverse:
111 items.reverse()
111 items.reverse()
112 return items
112 return items
113
113
114 try:
114 try:
115 import pwd
115 import pwd
116 except ImportError:
116 except ImportError:
117 pwd = None
117 pwd = None
118
118
119 try:
119 try:
120 import grp
120 import grp
121 except ImportError:
121 except ImportError:
122 grp = None
122 grp = None
123
123
124 from IPython.external import simplegeneric
124 from IPython.external import simplegeneric
125
125
126 import path
126 import path
127 try:
127 try:
128 from IPython import genutils, ipapi
128 from IPython import genutils, ipapi
129 except ImportError:
129 except ImportError:
130 genutils = None
130 genutils = None
131 ipapi = None
131 ipapi = None
132
132
133 import astyle
133 import astyle
134
134
135
135
136 __all__ = [
136 __all__ = [
137 "ifile", "ils", "iglob", "iwalk", "ipwdentry", "ipwd", "igrpentry", "igrp",
137 "ifile", "ils", "iglob", "iwalk", "ipwdentry", "ipwd", "igrpentry", "igrp",
138 "icsv", "ix", "ichain", "isort", "ifilter", "ieval", "ienum", "ienv",
138 "icsv", "ix", "ichain", "isort", "ifilter", "ieval", "ienum", "ienv",
139 "idump", "iless"
139 "idump", "iless"
140 ]
140 ]
141
141
142
142
143 os.stat_float_times(True) # enable microseconds
143 os.stat_float_times(True) # enable microseconds
144
144
145
145
146 class AttrNamespace(object):
146 class AttrNamespace(object):
147 """
147 """
148 Helper class that is used for providing a namespace for evaluating
148 Helper class that is used for providing a namespace for evaluating
149 expressions containing attribute names of an object.
149 expressions containing attribute names of an object.
150 """
150 """
151 def __init__(self, wrapped):
151 def __init__(self, wrapped):
152 self.wrapped = wrapped
152 self.wrapped = wrapped
153
153
154 def __getitem__(self, name):
154 def __getitem__(self, name):
155 if name == "_":
155 if name == "_":
156 return self.wrapped
156 return self.wrapped
157 try:
157 try:
158 return getattr(self.wrapped, name)
158 return getattr(self.wrapped, name)
159 except AttributeError:
159 except AttributeError:
160 raise KeyError(name)
160 raise KeyError(name)
161
161
162 # Python 2.3 compatibility
162 # Python 2.3 compatibility
163 # use eval workaround to find out which names are used in the
163 # use eval workaround to find out which names are used in the
164 # eval string and put them into the locals. This works for most
164 # eval string and put them into the locals. This works for most
165 # normal uses case, bizarre ones like accessing the locals()
165 # normal uses case, bizarre ones like accessing the locals()
166 # will fail
166 # will fail
167 try:
167 try:
168 eval("_", None, AttrNamespace(None))
168 eval("_", None, AttrNamespace(None))
169 except TypeError:
169 except TypeError:
170 real_eval = eval
170 real_eval = eval
171 def eval(codestring, _globals, _locals):
171 def eval(codestring, _globals, _locals):
172 """
172 """
173 eval(source[, globals[, locals]]) -> value
173 eval(source[, globals[, locals]]) -> value
174
174
175 Evaluate the source in the context of globals and locals.
175 Evaluate the source in the context of globals and locals.
176 The source may be a string representing a Python expression
176 The source may be a string representing a Python expression
177 or a code object as returned by compile().
177 or a code object as returned by compile().
178 The globals must be a dictionary and locals can be any mappping.
178 The globals must be a dictionary and locals can be any mappping.
179
179
180 This function is a workaround for the shortcomings of
180 This function is a workaround for the shortcomings of
181 Python 2.3's eval.
181 Python 2.3's eval.
182 """
182 """
183
183
184 if isinstance(codestring, basestring):
184 if isinstance(codestring, basestring):
185 code = compile(codestring, "_eval", "eval")
185 code = compile(codestring, "_eval", "eval")
186 else:
186 else:
187 code = codestring
187 code = codestring
188 newlocals = {}
188 newlocals = {}
189 for name in code.co_names:
189 for name in code.co_names:
190 try:
190 try:
191 newlocals[name] = _locals[name]
191 newlocals[name] = _locals[name]
192 except KeyError:
192 except KeyError:
193 pass
193 pass
194 return real_eval(code, _globals, newlocals)
194 return real_eval(code, _globals, newlocals)
195
195
196
196
197 noitem = object()
197 noitem = object()
198
198
199 def item(iterator, index, default=noitem):
199 def item(iterator, index, default=noitem):
200 """
200 """
201 Return the ``index``th item from the iterator ``iterator``.
201 Return the ``index``th item from the iterator ``iterator``.
202 ``index`` must be an integer (negative integers are relative to the
202 ``index`` must be an integer (negative integers are relative to the
203 end (i.e. the last items produced by the iterator)).
203 end (i.e. the last items produced by the iterator)).
204
204
205 If ``default`` is given, this will be the default value when
205 If ``default`` is given, this will be the default value when
206 the iterator doesn't contain an item at this position. Otherwise an
206 the iterator doesn't contain an item at this position. Otherwise an
207 ``IndexError`` will be raised.
207 ``IndexError`` will be raised.
208
208
209 Note that using this function will partially or totally exhaust the
209 Note that using this function will partially or totally exhaust the
210 iterator.
210 iterator.
211 """
211 """
212 i = index
212 i = index
213 if i>=0:
213 if i>=0:
214 for item in iterator:
214 for item in iterator:
215 if not i:
215 if not i:
216 return item
216 return item
217 i -= 1
217 i -= 1
218 else:
218 else:
219 i = -index
219 i = -index
220 cache = deque()
220 cache = deque()
221 for item in iterator:
221 for item in iterator:
222 cache.append(item)
222 cache.append(item)
223 if len(cache)>i:
223 if len(cache)>i:
224 cache.popleft()
224 cache.popleft()
225 if len(cache)==i:
225 if len(cache)==i:
226 return cache.popleft()
226 return cache.popleft()
227 if default is noitem:
227 if default is noitem:
228 raise IndexError(index)
228 raise IndexError(index)
229 else:
229 else:
230 return default
230 return default
231
231
232
232
233 def getglobals(g):
233 def getglobals(g):
234 """
234 """
235 Return the global namespace that is used for expression strings in
235 Return the global namespace that is used for expression strings in
236 ``ifilter`` and others. This is ``g`` or (if ``g`` is ``None``) IPython's
236 ``ifilter`` and others. This is ``g`` or (if ``g`` is ``None``) IPython's
237 user namespace.
237 user namespace.
238 """
238 """
239 if g is None:
239 if g is None:
240 if ipapi is not None:
240 if ipapi is not None:
241 api = ipapi.get()
241 api = ipapi.get()
242 if api is not None:
242 if api is not None:
243 return api.user_ns
243 return api.user_ns
244 return globals()
244 return globals()
245 return g
245 return g
246
246
247
247
248 class Descriptor(object):
248 class Descriptor(object):
249 """
249 """
250 A ``Descriptor`` object is used for describing the attributes of objects.
250 A ``Descriptor`` object is used for describing the attributes of objects.
251 """
251 """
252 def __hash__(self):
252 def __hash__(self):
253 return hash(self.__class__) ^ hash(self.key())
253 return hash(self.__class__) ^ hash(self.key())
254
254
255 def __eq__(self, other):
255 def __eq__(self, other):
256 return self.__class__ is other.__class__ and self.key() == other.key()
256 return self.__class__ is other.__class__ and self.key() == other.key()
257
257
258 def __ne__(self, other):
258 def __ne__(self, other):
259 return self.__class__ is not other.__class__ or self.key() != other.key()
259 return self.__class__ is not other.__class__ or self.key() != other.key()
260
260
261 def key(self):
261 def key(self):
262 pass
262 pass
263
263
264 def name(self):
264 def name(self):
265 """
265 """
266 Return the name of this attribute for display by a ``Display`` object
266 Return the name of this attribute for display by a ``Display`` object
267 (e.g. as a column title).
267 (e.g. as a column title).
268 """
268 """
269 key = self.key()
269 key = self.key()
270 if key is None:
270 if key is None:
271 return "_"
271 return "_"
272 return str(key)
272 return str(key)
273
273
274 def attrtype(self, obj):
274 def attrtype(self, obj):
275 """
275 """
276 Return the type of this attribute (i.e. something like "attribute" or
276 Return the type of this attribute (i.e. something like "attribute" or
277 "method").
277 "method").
278 """
278 """
279
279
280 def valuetype(self, obj):
280 def valuetype(self, obj):
281 """
281 """
282 Return the type of this attribute value of the object ``obj``.
282 Return the type of this attribute value of the object ``obj``.
283 """
283 """
284
284
285 def value(self, obj):
285 def value(self, obj):
286 """
286 """
287 Return the value of this attribute of the object ``obj``.
287 Return the value of this attribute of the object ``obj``.
288 """
288 """
289
289
290 def doc(self, obj):
290 def doc(self, obj):
291 """
291 """
292 Return the documentation for this attribute.
292 Return the documentation for this attribute.
293 """
293 """
294
294
295 def shortdoc(self, obj):
295 def shortdoc(self, obj):
296 """
296 """
297 Return a short documentation for this attribute (defaulting to the
297 Return a short documentation for this attribute (defaulting to the
298 first line).
298 first line).
299 """
299 """
300 doc = self.doc(obj)
300 doc = self.doc(obj)
301 if doc is not None:
301 if doc is not None:
302 doc = doc.strip().splitlines()[0].strip()
302 doc = doc.strip().splitlines()[0].strip()
303 return doc
303 return doc
304
304
305 def iter(self, obj):
305 def iter(self, obj):
306 """
306 """
307 Return an iterator for this attribute of the object ``obj``.
307 Return an iterator for this attribute of the object ``obj``.
308 """
308 """
309 return xiter(self.value(obj))
309 return xiter(self.value(obj))
310
310
311
311
312 class SelfDescriptor(Descriptor):
312 class SelfDescriptor(Descriptor):
313 """
313 """
314 A ``SelfDescriptor`` describes the object itself.
314 A ``SelfDescriptor`` describes the object itself.
315 """
315 """
316 def key(self):
316 def key(self):
317 return None
317 return None
318
318
319 def attrtype(self, obj):
319 def attrtype(self, obj):
320 return "self"
320 return "self"
321
321
322 def valuetype(self, obj):
322 def valuetype(self, obj):
323 return type(obj)
323 return type(obj)
324
324
325 def value(self, obj):
325 def value(self, obj):
326 return obj
326 return obj
327
327
328 def __repr__(self):
328 def __repr__(self):
329 return "Self"
329 return "Self"
330
330
331 selfdescriptor = SelfDescriptor() # there's no need for more than one
331 selfdescriptor = SelfDescriptor() # there's no need for more than one
332
332
333
333
334 class AttributeDescriptor(Descriptor):
334 class AttributeDescriptor(Descriptor):
335 """
335 """
336 An ``AttributeDescriptor`` describes a simple attribute of an object.
336 An ``AttributeDescriptor`` describes a simple attribute of an object.
337 """
337 """
338 __slots__ = ("_name", "_doc")
338 __slots__ = ("_name", "_doc")
339
339
340 def __init__(self, name, doc=None):
340 def __init__(self, name, doc=None):
341 self._name = name
341 self._name = name
342 self._doc = doc
342 self._doc = doc
343
343
344 def key(self):
344 def key(self):
345 return self._name
345 return self._name
346
346
347 def doc(self, obj):
347 def doc(self, obj):
348 return self._doc
348 return self._doc
349
349
350 def attrtype(self, obj):
350 def attrtype(self, obj):
351 return "attr"
351 return "attr"
352
352
353 def valuetype(self, obj):
353 def valuetype(self, obj):
354 return type(getattr(obj, self._name))
354 return type(getattr(obj, self._name))
355
355
356 def value(self, obj):
356 def value(self, obj):
357 return getattr(obj, self._name)
357 return getattr(obj, self._name)
358
358
359 def __repr__(self):
359 def __repr__(self):
360 if self._doc is None:
360 if self._doc is None:
361 return "Attribute(%r)" % self._name
361 return "Attribute(%r)" % self._name
362 else:
362 else:
363 return "Attribute(%r, %r)" % (self._name, self._doc)
363 return "Attribute(%r, %r)" % (self._name, self._doc)
364
364
365
365
366 class IndexDescriptor(Descriptor):
366 class IndexDescriptor(Descriptor):
367 """
367 """
368 An ``IndexDescriptor`` describes an "attribute" of an object that is fetched
368 An ``IndexDescriptor`` describes an "attribute" of an object that is fetched
369 via ``__getitem__``.
369 via ``__getitem__``.
370 """
370 """
371 __slots__ = ("_index",)
371 __slots__ = ("_index",)
372
372
373 def __init__(self, index):
373 def __init__(self, index):
374 self._index = index
374 self._index = index
375
375
376 def key(self):
376 def key(self):
377 return self._index
377 return self._index
378
378
379 def attrtype(self, obj):
379 def attrtype(self, obj):
380 return "item"
380 return "item"
381
381
382 def valuetype(self, obj):
382 def valuetype(self, obj):
383 return type(obj[self._index])
383 return type(obj[self._index])
384
384
385 def value(self, obj):
385 def value(self, obj):
386 return obj[self._index]
386 return obj[self._index]
387
387
388 def __repr__(self):
388 def __repr__(self):
389 return "Index(%r)" % self._index
389 return "Index(%r)" % self._index
390
390
391
391
392 class MethodDescriptor(Descriptor):
392 class MethodDescriptor(Descriptor):
393 """
393 """
394 A ``MethodDescriptor`` describes a method of an object that can be called
394 A ``MethodDescriptor`` describes a method of an object that can be called
395 without argument. Note that this method shouldn't change the object.
395 without argument. Note that this method shouldn't change the object.
396 """
396 """
397 __slots__ = ("_name", "_doc")
397 __slots__ = ("_name", "_doc")
398
398
399 def __init__(self, name, doc=None):
399 def __init__(self, name, doc=None):
400 self._name = name
400 self._name = name
401 self._doc = doc
401 self._doc = doc
402
402
403 def key(self):
403 def key(self):
404 return self._name
404 return self._name
405
405
406 def doc(self, obj):
406 def doc(self, obj):
407 if self._doc is None:
407 if self._doc is None:
408 return getattr(obj, self._name).__doc__
408 return getattr(obj, self._name).__doc__
409 return self._doc
409 return self._doc
410
410
411 def attrtype(self, obj):
411 def attrtype(self, obj):
412 return "method"
412 return "method"
413
413
414 def valuetype(self, obj):
414 def valuetype(self, obj):
415 return type(self.value(obj))
415 return type(self.value(obj))
416
416
417 def value(self, obj):
417 def value(self, obj):
418 return getattr(obj, self._name)()
418 return getattr(obj, self._name)()
419
419
420 def __repr__(self):
420 def __repr__(self):
421 if self._doc is None:
421 if self._doc is None:
422 return "Method(%r)" % self._name
422 return "Method(%r)" % self._name
423 else:
423 else:
424 return "Method(%r, %r)" % (self._name, self._doc)
424 return "Method(%r, %r)" % (self._name, self._doc)
425
425
426
426
427 class IterAttributeDescriptor(Descriptor):
427 class IterAttributeDescriptor(Descriptor):
428 """
428 """
429 An ``IterAttributeDescriptor`` works like an ``AttributeDescriptor`` but
429 An ``IterAttributeDescriptor`` works like an ``AttributeDescriptor`` but
430 doesn't return an attribute values (because this value might be e.g. a large
430 doesn't return an attribute values (because this value might be e.g. a large
431 list).
431 list).
432 """
432 """
433 __slots__ = ("_name", "_doc")
433 __slots__ = ("_name", "_doc")
434
434
435 def __init__(self, name, doc=None):
435 def __init__(self, name, doc=None):
436 self._name = name
436 self._name = name
437 self._doc = doc
437 self._doc = doc
438
438
439 def key(self):
439 def key(self):
440 return self._name
440 return self._name
441
441
442 def doc(self, obj):
442 def doc(self, obj):
443 return self._doc
443 return self._doc
444
444
445 def attrtype(self, obj):
445 def attrtype(self, obj):
446 return "iter"
446 return "iter"
447
447
448 def valuetype(self, obj):
448 def valuetype(self, obj):
449 return noitem
449 return noitem
450
450
451 def value(self, obj):
451 def value(self, obj):
452 return noitem
452 return noitem
453
453
454 def iter(self, obj):
454 def iter(self, obj):
455 return xiter(getattr(obj, self._name))
455 return xiter(getattr(obj, self._name))
456
456
457 def __repr__(self):
457 def __repr__(self):
458 if self._doc is None:
458 if self._doc is None:
459 return "IterAttribute(%r)" % self._name
459 return "IterAttribute(%r)" % self._name
460 else:
460 else:
461 return "IterAttribute(%r, %r)" % (self._name, self._doc)
461 return "IterAttribute(%r, %r)" % (self._name, self._doc)
462
462
463
463
464 class IterMethodDescriptor(Descriptor):
464 class IterMethodDescriptor(Descriptor):
465 """
465 """
466 An ``IterMethodDescriptor`` works like an ``MethodDescriptor`` but doesn't
466 An ``IterMethodDescriptor`` works like an ``MethodDescriptor`` but doesn't
467 return an attribute values (because this value might be e.g. a large list).
467 return an attribute values (because this value might be e.g. a large list).
468 """
468 """
469 __slots__ = ("_name", "_doc")
469 __slots__ = ("_name", "_doc")
470
470
471 def __init__(self, name, doc=None):
471 def __init__(self, name, doc=None):
472 self._name = name
472 self._name = name
473 self._doc = doc
473 self._doc = doc
474
474
475 def key(self):
475 def key(self):
476 return self._name
476 return self._name
477
477
478 def doc(self, obj):
478 def doc(self, obj):
479 if self._doc is None:
479 if self._doc is None:
480 return getattr(obj, self._name).__doc__
480 return getattr(obj, self._name).__doc__
481 return self._doc
481 return self._doc
482
482
483 def attrtype(self, obj):
483 def attrtype(self, obj):
484 return "itermethod"
484 return "itermethod"
485
485
486 def valuetype(self, obj):
486 def valuetype(self, obj):
487 return noitem
487 return noitem
488
488
489 def value(self, obj):
489 def value(self, obj):
490 return noitem
490 return noitem
491
491
492 def iter(self, obj):
492 def iter(self, obj):
493 return xiter(getattr(obj, self._name)())
493 return xiter(getattr(obj, self._name)())
494
494
495 def __repr__(self):
495 def __repr__(self):
496 if self._doc is None:
496 if self._doc is None:
497 return "IterMethod(%r)" % self._name
497 return "IterMethod(%r)" % self._name
498 else:
498 else:
499 return "IterMethod(%r, %r)" % (self._name, self._doc)
499 return "IterMethod(%r, %r)" % (self._name, self._doc)
500
500
501
501
502 class FunctionDescriptor(Descriptor):
502 class FunctionDescriptor(Descriptor):
503 """
503 """
504 A ``FunctionDescriptor`` turns a function into a descriptor. The function
504 A ``FunctionDescriptor`` turns a function into a descriptor. The function
505 will be called with the object to get the type and value of the attribute.
505 will be called with the object to get the type and value of the attribute.
506 """
506 """
507 __slots__ = ("_function", "_name", "_doc")
507 __slots__ = ("_function", "_name", "_doc")
508
508
509 def __init__(self, function, name=None, doc=None):
509 def __init__(self, function, name=None, doc=None):
510 self._function = function
510 self._function = function
511 self._name = name
511 self._name = name
512 self._doc = doc
512 self._doc = doc
513
513
514 def key(self):
514 def key(self):
515 return self._function
515 return self._function
516
516
517 def name(self):
517 def name(self):
518 if self._name is not None:
518 if self._name is not None:
519 return self._name
519 return self._name
520 return getattr(self._function, "__xname__", self._function.__name__)
520 return getattr(self._function, "__xname__", self._function.__name__)
521
521
522 def doc(self, obj):
522 def doc(self, obj):
523 if self._doc is None:
523 if self._doc is None:
524 return self._function.__doc__
524 return self._function.__doc__
525 return self._doc
525 return self._doc
526
526
527 def attrtype(self, obj):
527 def attrtype(self, obj):
528 return "function"
528 return "function"
529
529
530 def valuetype(self, obj):
530 def valuetype(self, obj):
531 return type(self._function(obj))
531 return type(self._function(obj))
532
532
533 def value(self, obj):
533 def value(self, obj):
534 return self._function(obj)
534 return self._function(obj)
535
535
536 def __repr__(self):
536 def __repr__(self):
537 if self._doc is None:
537 if self._doc is None:
538 return "Function(%r)" % self._name
538 return "Function(%r)" % self._name
539 else:
539 else:
540 return "Function(%r, %r)" % (self._name, self._doc)
540 return "Function(%r, %r)" % (self._name, self._doc)
541
541
542
542
543 class Table(object):
543 class Table(object):
544 """
544 """
545 A ``Table`` is an object that produces items (just like a normal Python
545 A ``Table`` is an object that produces items (just like a normal Python
546 iterator/generator does) and can be used as the first object in a pipeline
546 iterator/generator does) and can be used as the first object in a pipeline
547 expression. The displayhook will open the default browser for such an object
547 expression. The displayhook will open the default browser for such an object
548 (instead of simply printing the ``repr()`` result).
548 (instead of simply printing the ``repr()`` result).
549 """
549 """
550
550
551 # We want to support ``foo`` and ``foo()`` in pipeline expression:
551 # We want to support ``foo`` and ``foo()`` in pipeline expression:
552 # So we implement the required operators (``|`` and ``+``) in the metaclass,
552 # So we implement the required operators (``|`` and ``+``) in the metaclass,
553 # instantiate the class and forward the operator to the instance
553 # instantiate the class and forward the operator to the instance
554 class __metaclass__(type):
554 class __metaclass__(type):
555 def __iter__(self):
555 def __iter__(self):
556 return iter(self())
556 return iter(self())
557
557
558 def __or__(self, other):
558 def __or__(self, other):
559 return self() | other
559 return self() | other
560
560
561 def __add__(self, other):
561 def __add__(self, other):
562 return self() + other
562 return self() + other
563
563
564 def __radd__(self, other):
564 def __radd__(self, other):
565 return other + self()
565 return other + self()
566
566
567 def __getitem__(self, index):
567 def __getitem__(self, index):
568 return self()[index]
568 return self()[index]
569
569
570 def __getitem__(self, index):
570 def __getitem__(self, index):
571 return item(self, index)
571 return item(self, index)
572
572
573 def __contains__(self, item):
573 def __contains__(self, item):
574 for haveitem in self:
574 for haveitem in self:
575 if item == haveitem:
575 if item == haveitem:
576 return True
576 return True
577 return False
577 return False
578
578
579 def __or__(self, other):
579 def __or__(self, other):
580 # autoinstantiate right hand side
580 # autoinstantiate right hand side
581 if isinstance(other, type) and issubclass(other, (Table, Display)):
581 if isinstance(other, type) and issubclass(other, (Table, Display)):
582 other = other()
582 other = other()
583 # treat simple strings and functions as ``ieval`` instances
583 # treat simple strings and functions as ``ieval`` instances
584 elif not isinstance(other, Display) and not isinstance(other, Table):
584 elif not isinstance(other, Display) and not isinstance(other, Table):
585 other = ieval(other)
585 other = ieval(other)
586 # forward operations to the right hand side
586 # forward operations to the right hand side
587 return other.__ror__(self)
587 return other.__ror__(self)
588
588
589 def __add__(self, other):
589 def __add__(self, other):
590 # autoinstantiate right hand side
590 # autoinstantiate right hand side
591 if isinstance(other, type) and issubclass(other, Table):
591 if isinstance(other, type) and issubclass(other, Table):
592 other = other()
592 other = other()
593 return ichain(self, other)
593 return ichain(self, other)
594
594
595 def __radd__(self, other):
595 def __radd__(self, other):
596 # autoinstantiate left hand side
596 # autoinstantiate left hand side
597 if isinstance(other, type) and issubclass(other, Table):
597 if isinstance(other, type) and issubclass(other, Table):
598 other = other()
598 other = other()
599 return ichain(other, self)
599 return ichain(other, self)
600
600
601
601
602 class Pipe(Table):
602 class Pipe(Table):
603 """
603 """
604 A ``Pipe`` is an object that can be used in a pipeline expression. It
604 A ``Pipe`` is an object that can be used in a pipeline expression. It
605 processes the objects it gets from its input ``Table``/``Pipe``. Note that
605 processes the objects it gets from its input ``Table``/``Pipe``. Note that
606 a ``Pipe`` object can't be used as the first object in a pipeline
606 a ``Pipe`` object can't be used as the first object in a pipeline
607 expression, as it doesn't produces items itself.
607 expression, as it doesn't produces items itself.
608 """
608 """
609 class __metaclass__(Table.__metaclass__):
609 class __metaclass__(Table.__metaclass__):
610 def __ror__(self, input):
610 def __ror__(self, input):
611 return input | self()
611 return input | self()
612
612
613 def __ror__(self, input):
613 def __ror__(self, input):
614 # autoinstantiate left hand side
614 # autoinstantiate left hand side
615 if isinstance(input, type) and issubclass(input, Table):
615 if isinstance(input, type) and issubclass(input, Table):
616 input = input()
616 input = input()
617 self.input = input
617 self.input = input
618 return self
618 return self
619
619
620
620
621 def xrepr(item, mode="default"):
621 def xrepr(item, mode="default"):
622 """
622 """
623 Generic function that adds color output and different display modes to ``repr``.
623 Generic function that adds color output and different display modes to ``repr``.
624
624
625 The result of an ``xrepr`` call is iterable and consists of ``(style, string)``
625 The result of an ``xrepr`` call is iterable and consists of ``(style, string)``
626 tuples. The ``style`` in this tuple must be a ``Style`` object from the
626 tuples. The ``style`` in this tuple must be a ``Style`` object from the
627 ``astring`` module. To reconfigure the output the first yielded tuple can be
627 ``astring`` module. To reconfigure the output the first yielded tuple can be
628 a ``(aligment, full)`` tuple instead of a ``(style, string)`` tuple.
628 a ``(aligment, full)`` tuple instead of a ``(style, string)`` tuple.
629 ``alignment`` can be -1 for left aligned, 0 for centered and 1 for right
629 ``alignment`` can be -1 for left aligned, 0 for centered and 1 for right
630 aligned (the default is left alignment). ``full`` is a boolean that specifies
630 aligned (the default is left alignment). ``full`` is a boolean that specifies
631 whether the complete output must be displayed or the ``Display`` object is
631 whether the complete output must be displayed or the ``Display`` object is
632 allowed to stop output after enough text has been produced (e.g. a syntax
632 allowed to stop output after enough text has been produced (e.g. a syntax
633 highlighted text line would use ``True``, but for a large data structure
633 highlighted text line would use ``True``, but for a large data structure
634 (i.e. a nested list, tuple or dictionary) ``False`` would be used).
634 (i.e. a nested list, tuple or dictionary) ``False`` would be used).
635 The default is full output.
635 The default is full output.
636
636
637 There are four different possible values for ``mode`` depending on where
637 There are four different possible values for ``mode`` depending on where
638 the ``Display`` object will display ``item``:
638 the ``Display`` object will display ``item``:
639
639
640 * ``"header"``: ``item`` will be displayed in a header line (this is used by
640 * ``"header"``: ``item`` will be displayed in a header line (this is used by
641 ``ibrowse``).
641 ``ibrowse``).
642 * ``"footer"``: ``item`` will be displayed in a footer line (this is used by
642 * ``"footer"``: ``item`` will be displayed in a footer line (this is used by
643 ``ibrowse``).
643 ``ibrowse``).
644 * ``"cell"``: ``item`` will be displayed in a table cell/list.
644 * ``"cell"``: ``item`` will be displayed in a table cell/list.
645 * ``"default"``: default mode. If an ``xrepr`` implementation recursively
645 * ``"default"``: default mode. If an ``xrepr`` implementation recursively
646 outputs objects, ``"default"`` must be passed in the recursive calls to
646 outputs objects, ``"default"`` must be passed in the recursive calls to
647 ``xrepr``.
647 ``xrepr``.
648
648
649 If no implementation is registered for ``item``, ``xrepr`` will try the
649 If no implementation is registered for ``item``, ``xrepr`` will try the
650 ``__xrepr__`` method on ``item``. If ``item`` doesn't have an ``__xrepr__``
650 ``__xrepr__`` method on ``item``. If ``item`` doesn't have an ``__xrepr__``
651 method it falls back to ``repr``/``__repr__`` for all modes.
651 method it falls back to ``repr``/``__repr__`` for all modes.
652 """
652 """
653 try:
653 try:
654 func = item.__xrepr__
654 func = item.__xrepr__
655 except AttributeError:
655 except AttributeError:
656 yield (astyle.style_default, repr(item))
656 yield (astyle.style_default, repr(item))
657 else:
657 else:
658 try:
658 try:
659 for x in func(mode):
659 for x in func(mode):
660 yield x
660 yield x
661 except (KeyboardInterrupt, SystemExit):
661 except (KeyboardInterrupt, SystemExit):
662 raise
662 raise
663 except Exception:
663 except Exception:
664 yield (astyle.style_default, repr(item))
664 yield (astyle.style_default, repr(item))
665 xrepr = simplegeneric.generic(xrepr)
665 xrepr = simplegeneric.generic(xrepr)
666
666
667
667
668 def xrepr_none(self, mode="default"):
668 def xrepr_none(self, mode="default"):
669 yield (astyle.style_type_none, repr(self))
669 yield (astyle.style_type_none, repr(self))
670 xrepr.when_object(None)(xrepr_none)
670 xrepr.when_object(None)(xrepr_none)
671
671
672
672
673 def xrepr_bool(self, mode="default"):
673 def xrepr_bool(self, mode="default"):
674 yield (astyle.style_type_bool, repr(self))
674 yield (astyle.style_type_bool, repr(self))
675 xrepr.when_type(bool)(xrepr_bool)
675 xrepr.when_type(bool)(xrepr_bool)
676
676
677
677
678 def xrepr_str(self, mode="default"):
678 def xrepr_str(self, mode="default"):
679 if mode == "cell":
679 if mode == "cell":
680 yield (astyle.style_default, repr(self.expandtabs(tab))[1:-1])
680 yield (astyle.style_default, repr(self.expandtabs(tab))[1:-1])
681 else:
681 else:
682 yield (astyle.style_default, repr(self))
682 yield (astyle.style_default, repr(self))
683 xrepr.when_type(str)(xrepr_str)
683 xrepr.when_type(str)(xrepr_str)
684
684
685
685
686 def xrepr_unicode(self, mode="default"):
686 def xrepr_unicode(self, mode="default"):
687 if mode == "cell":
687 if mode == "cell":
688 yield (astyle.style_default, repr(self.expandtabs(tab))[2:-1])
688 yield (astyle.style_default, repr(self.expandtabs(tab))[2:-1])
689 else:
689 else:
690 yield (astyle.style_default, repr(self))
690 yield (astyle.style_default, repr(self))
691 xrepr.when_type(unicode)(xrepr_unicode)
691 xrepr.when_type(unicode)(xrepr_unicode)
692
692
693
693
694 def xrepr_number(self, mode="default"):
694 def xrepr_number(self, mode="default"):
695 yield (1, True)
695 yield (1, True)
696 yield (astyle.style_type_number, repr(self))
696 yield (astyle.style_type_number, repr(self))
697 xrepr.when_type(int)(xrepr_number)
697 xrepr.when_type(int)(xrepr_number)
698 xrepr.when_type(long)(xrepr_number)
698 xrepr.when_type(long)(xrepr_number)
699 xrepr.when_type(float)(xrepr_number)
699 xrepr.when_type(float)(xrepr_number)
700
700
701
701
702 def xrepr_complex(self, mode="default"):
702 def xrepr_complex(self, mode="default"):
703 yield (astyle.style_type_number, repr(self))
703 yield (astyle.style_type_number, repr(self))
704 xrepr.when_type(complex)(xrepr_number)
704 xrepr.when_type(complex)(xrepr_number)
705
705
706
706
707 def xrepr_datetime(self, mode="default"):
707 def xrepr_datetime(self, mode="default"):
708 if mode == "cell":
708 if mode == "cell":
709 # Don't use strftime() here, as this requires year >= 1900
709 # Don't use strftime() here, as this requires year >= 1900
710 yield (astyle.style_type_datetime,
710 yield (astyle.style_type_datetime,
711 "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
711 "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
712 (self.year, self.month, self.day,
712 (self.year, self.month, self.day,
713 self.hour, self.minute, self.second,
713 self.hour, self.minute, self.second,
714 self.microsecond),
714 self.microsecond),
715 )
715 )
716 else:
716 else:
717 yield (astyle.style_type_datetime, repr(self))
717 yield (astyle.style_type_datetime, repr(self))
718 xrepr.when_type(datetime.datetime)(xrepr_datetime)
718 xrepr.when_type(datetime.datetime)(xrepr_datetime)
719
719
720
720
721 def xrepr_date(self, mode="default"):
721 def xrepr_date(self, mode="default"):
722 if mode == "cell":
722 if mode == "cell":
723 yield (astyle.style_type_datetime,
723 yield (astyle.style_type_datetime,
724 "%04d-%02d-%02d" % (self.year, self.month, self.day))
724 "%04d-%02d-%02d" % (self.year, self.month, self.day))
725 else:
725 else:
726 yield (astyle.style_type_datetime, repr(self))
726 yield (astyle.style_type_datetime, repr(self))
727 xrepr.when_type(datetime.date)(xrepr_date)
727 xrepr.when_type(datetime.date)(xrepr_date)
728
728
729
729
730 def xrepr_time(self, mode="default"):
730 def xrepr_time(self, mode="default"):
731 if mode == "cell":
731 if mode == "cell":
732 yield (astyle.style_type_datetime,
732 yield (astyle.style_type_datetime,
733 "%02d:%02d:%02d.%06d" % \
733 "%02d:%02d:%02d.%06d" % \
734 (self.hour, self.minute, self.second, self.microsecond))
734 (self.hour, self.minute, self.second, self.microsecond))
735 else:
735 else:
736 yield (astyle.style_type_datetime, repr(self))
736 yield (astyle.style_type_datetime, repr(self))
737 xrepr.when_type(datetime.time)(xrepr_time)
737 xrepr.when_type(datetime.time)(xrepr_time)
738
738
739
739
740 def xrepr_timedelta(self, mode="default"):
740 def xrepr_timedelta(self, mode="default"):
741 yield (astyle.style_type_datetime, repr(self))
741 yield (astyle.style_type_datetime, repr(self))
742 xrepr.when_type(datetime.timedelta)(xrepr_timedelta)
742 xrepr.when_type(datetime.timedelta)(xrepr_timedelta)
743
743
744
744
745 def xrepr_type(self, mode="default"):
745 def xrepr_type(self, mode="default"):
746 if self.__module__ == "__builtin__":
746 if self.__module__ == "__builtin__":
747 yield (astyle.style_type_type, self.__name__)
747 yield (astyle.style_type_type, self.__name__)
748 else:
748 else:
749 yield (astyle.style_type_type, "%s.%s" % (self.__module__, self.__name__))
749 yield (astyle.style_type_type, "%s.%s" % (self.__module__, self.__name__))
750 xrepr.when_type(type)(xrepr_type)
750 xrepr.when_type(type)(xrepr_type)
751
751
752
752
753 def xrepr_exception(self, mode="default"):
753 def xrepr_exception(self, mode="default"):
754 if self.__class__.__module__ == "exceptions":
754 if self.__class__.__module__ == "exceptions":
755 classname = self.__class__.__name__
755 classname = self.__class__.__name__
756 else:
756 else:
757 classname = "%s.%s" % \
757 classname = "%s.%s" % \
758 (self.__class__.__module__, self.__class__.__name__)
758 (self.__class__.__module__, self.__class__.__name__)
759 if mode == "header" or mode == "footer":
759 if mode == "header" or mode == "footer":
760 yield (astyle.style_error, "%s: %s" % (classname, self))
760 yield (astyle.style_error, "%s: %s" % (classname, self))
761 else:
761 else:
762 yield (astyle.style_error, classname)
762 yield (astyle.style_error, classname)
763 xrepr.when_type(Exception)(xrepr_exception)
763 xrepr.when_type(Exception)(xrepr_exception)
764
764
765
765
766 def xrepr_listtuple(self, mode="default"):
766 def xrepr_listtuple(self, mode="default"):
767 if mode == "header" or mode == "footer":
767 if mode == "header" or mode == "footer":
768 if self.__class__.__module__ == "__builtin__":
768 if self.__class__.__module__ == "__builtin__":
769 classname = self.__class__.__name__
769 classname = self.__class__.__name__
770 else:
770 else:
771 classname = "%s.%s" % \
771 classname = "%s.%s" % \
772 (self.__class__.__module__,self.__class__.__name__)
772 (self.__class__.__module__,self.__class__.__name__)
773 yield (astyle.style_default,
773 yield (astyle.style_default,
774 "<%s object with %d items at 0x%x>" % \
774 "<%s object with %d items at 0x%x>" % \
775 (classname, len(self), id(self)))
775 (classname, len(self), id(self)))
776 else:
776 else:
777 yield (-1, False)
777 yield (-1, False)
778 if isinstance(self, list):
778 if isinstance(self, list):
779 yield (astyle.style_default, "[")
779 yield (astyle.style_default, "[")
780 end = "]"
780 end = "]"
781 else:
781 else:
782 yield (astyle.style_default, "(")
782 yield (astyle.style_default, "(")
783 end = ")"
783 end = ")"
784 for (i, subself) in enumerate(self):
784 for (i, subself) in enumerate(self):
785 if i:
785 if i:
786 yield (astyle.style_default, ", ")
786 yield (astyle.style_default, ", ")
787 for part in xrepr(subself, "default"):
787 for part in xrepr(subself, "default"):
788 yield part
788 yield part
789 yield (astyle.style_default, end)
789 yield (astyle.style_default, end)
790 xrepr.when_type(list)(xrepr_listtuple)
790 xrepr.when_type(list)(xrepr_listtuple)
791 xrepr.when_type(tuple)(xrepr_listtuple)
791 xrepr.when_type(tuple)(xrepr_listtuple)
792
792
793
793
794 def xrepr_dict(self, mode="default"):
794 def xrepr_dict(self, mode="default"):
795 if mode == "header" or mode == "footer":
795 if mode == "header" or mode == "footer":
796 if self.__class__.__module__ == "__builtin__":
796 if self.__class__.__module__ == "__builtin__":
797 classname = self.__class__.__name__
797 classname = self.__class__.__name__
798 else:
798 else:
799 classname = "%s.%s" % \
799 classname = "%s.%s" % \
800 (self.__class__.__module__,self.__class__.__name__)
800 (self.__class__.__module__,self.__class__.__name__)
801 yield (astyle.style_default,
801 yield (astyle.style_default,
802 "<%s object with %d items at 0x%x>" % \
802 "<%s object with %d items at 0x%x>" % \
803 (classname, len(self), id(self)))
803 (classname, len(self), id(self)))
804 else:
804 else:
805 yield (-1, False)
805 yield (-1, False)
806 if isinstance(self, dict):
806 if isinstance(self, dict):
807 yield (astyle.style_default, "{")
807 yield (astyle.style_default, "{")
808 end = "}"
808 end = "}"
809 else:
809 else:
810 yield (astyle.style_default, "dictproxy((")
810 yield (astyle.style_default, "dictproxy((")
811 end = "})"
811 end = "})"
812 for (i, (key, value)) in enumerate(self.iteritems()):
812 for (i, (key, value)) in enumerate(self.iteritems()):
813 if i:
813 if i:
814 yield (astyle.style_default, ", ")
814 yield (astyle.style_default, ", ")
815 for part in xrepr(key, "default"):
815 for part in xrepr(key, "default"):
816 yield part
816 yield part
817 yield (astyle.style_default, ": ")
817 yield (astyle.style_default, ": ")
818 for part in xrepr(value, "default"):
818 for part in xrepr(value, "default"):
819 yield part
819 yield part
820 yield (astyle.style_default, end)
820 yield (astyle.style_default, end)
821 xrepr.when_type(dict)(xrepr_dict)
821 xrepr.when_type(dict)(xrepr_dict)
822 xrepr.when_type(types.DictProxyType)(xrepr_dict)
822 xrepr.when_type(types.DictProxyType)(xrepr_dict)
823
823
824
824
825 def upgradexattr(attr):
825 def upgradexattr(attr):
826 """
826 """
827 Convert an attribute descriptor string to a real descriptor object.
827 Convert an attribute descriptor string to a real descriptor object.
828
828
829 If attr already is a descriptor object return if unmodified. A
829 If attr already is a descriptor object return if unmodified. A
830 ``SelfDescriptor`` will be returned if ``attr`` is ``None``. ``"foo"``
830 ``SelfDescriptor`` will be returned if ``attr`` is ``None``. ``"foo"``
831 returns an ``AttributeDescriptor`` for the attribute named ``"foo"``.
831 returns an ``AttributeDescriptor`` for the attribute named ``"foo"``.
832 ``"foo()"`` returns a ``MethodDescriptor`` for the method named ``"foo"``.
832 ``"foo()"`` returns a ``MethodDescriptor`` for the method named ``"foo"``.
833 ``"-foo"`` will return an ``IterAttributeDescriptor`` for the attribute
833 ``"-foo"`` will return an ``IterAttributeDescriptor`` for the attribute
834 named ``"foo"`` and ``"-foo()"`` will return an ``IterMethodDescriptor``
834 named ``"foo"`` and ``"-foo()"`` will return an ``IterMethodDescriptor``
835 for the method named ``"foo"``. Furthermore integer will return the appropriate
835 for the method named ``"foo"``. Furthermore integer will return the appropriate
836 ``IndexDescriptor`` and callables will return a ``FunctionDescriptor``.
836 ``IndexDescriptor`` and callables will return a ``FunctionDescriptor``.
837 """
837 """
838 if attr is None:
838 if attr is None:
839 return selfdescriptor
839 return selfdescriptor
840 elif isinstance(attr, Descriptor):
840 elif isinstance(attr, Descriptor):
841 return attr
841 return attr
842 elif isinstance(attr, str):
842 elif isinstance(attr, str):
843 if attr.endswith("()"):
843 if attr.endswith("()"):
844 if attr.startswith("-"):
844 if attr.startswith("-"):
845 return IterMethodDescriptor(attr[1:-2])
845 return IterMethodDescriptor(attr[1:-2])
846 else:
846 else:
847 return MethodDescriptor(attr[:-2])
847 return MethodDescriptor(attr[:-2])
848 else:
848 else:
849 if attr.startswith("-"):
849 if attr.startswith("-"):
850 return IterAttributeDescriptor(attr[1:])
850 return IterAttributeDescriptor(attr[1:])
851 else:
851 else:
852 return AttributeDescriptor(attr)
852 return AttributeDescriptor(attr)
853 elif isinstance(attr, (int, long)):
853 elif isinstance(attr, (int, long)):
854 return IndexDescriptor(attr)
854 return IndexDescriptor(attr)
855 elif callable(attr):
855 elif callable(attr):
856 return FunctionDescriptor(attr)
856 return FunctionDescriptor(attr)
857 else:
857 else:
858 raise TypeError("can't handle descriptor %r" % attr)
858 raise TypeError("can't handle descriptor %r" % attr)
859
859
860
860
861 def xattrs(item, mode="default"):
861 def xattrs(item, mode="default"):
862 """
862 """
863 Generic function that returns an iterable of attribute descriptors
863 Generic function that returns an iterable of attribute descriptors
864 to be used for displaying the attributes ob the object ``item`` in display
864 to be used for displaying the attributes ob the object ``item`` in display
865 mode ``mode``.
865 mode ``mode``.
866
866
867 There are two possible modes:
867 There are two possible modes:
868
868
869 * ``"detail"``: The ``Display`` object wants to display a detailed list
869 * ``"detail"``: The ``Display`` object wants to display a detailed list
870 of the object attributes.
870 of the object attributes.
871 * ``"default"``: The ``Display`` object wants to display the object in a
871 * ``"default"``: The ``Display`` object wants to display the object in a
872 list view.
872 list view.
873
873
874 If no implementation is registered for the object ``item`` ``xattrs`` falls
874 If no implementation is registered for the object ``item`` ``xattrs`` falls
875 back to trying the ``__xattrs__`` method of the object. If this doesn't
875 back to trying the ``__xattrs__`` method of the object. If this doesn't
876 exist either, ``dir(item)`` is used for ``"detail"`` mode and ``(None,)``
876 exist either, ``dir(item)`` is used for ``"detail"`` mode and ``(None,)``
877 for ``"default"`` mode.
877 for ``"default"`` mode.
878
878
879 The implementation must yield attribute descriptor (see the class
879 The implementation must yield attribute descriptor (see the class
880 ``Descriptor`` for more info). The ``__xattrs__`` method may also return
880 ``Descriptor`` for more info). The ``__xattrs__`` method may also return
881 attribute descriptor string (and ``None``) which will be converted to real
881 attribute descriptor string (and ``None``) which will be converted to real
882 descriptors by ``upgradexattr()``.
882 descriptors by ``upgradexattr()``.
883 """
883 """
884 try:
884 try:
885 func = item.__xattrs__
885 func = item.__xattrs__
886 except AttributeError:
886 except AttributeError:
887 if mode == "detail":
887 if mode == "detail":
888 for attrname in dir(item):
888 for attrname in dir(item):
889 yield AttributeDescriptor(attrname)
889 yield AttributeDescriptor(attrname)
890 else:
890 else:
891 yield selfdescriptor
891 yield selfdescriptor
892 else:
892 else:
893 for attr in func(mode):
893 for attr in func(mode):
894 yield upgradexattr(attr)
894 yield upgradexattr(attr)
895 xattrs = simplegeneric.generic(xattrs)
895 xattrs = simplegeneric.generic(xattrs)
896
896
897
897
898 def xattrs_complex(self, mode="default"):
898 def xattrs_complex(self, mode="default"):
899 if mode == "detail":
899 if mode == "detail":
900 return (AttributeDescriptor("real"), AttributeDescriptor("imag"))
900 return (AttributeDescriptor("real"), AttributeDescriptor("imag"))
901 return (selfdescriptor,)
901 return (selfdescriptor,)
902 xattrs.when_type(complex)(xattrs_complex)
902 xattrs.when_type(complex)(xattrs_complex)
903
903
904
904
905 def _isdict(item):
905 def _isdict(item):
906 try:
906 try:
907 itermeth = item.__class__.__iter__
907 itermeth = item.__class__.__iter__
908 except (AttributeError, TypeError):
908 except (AttributeError, TypeError):
909 return False
909 return False
910 return itermeth is dict.__iter__ or itermeth is types.DictProxyType.__iter__
910 return itermeth is dict.__iter__ or itermeth is types.DictProxyType.__iter__
911
911
912
912
913 def _isstr(item):
913 def _isstr(item):
914 if not isinstance(item, basestring):
914 if not isinstance(item, basestring):
915 return False
915 return False
916 try:
916 try:
917 itermeth = item.__class__.__iter__
917 itermeth = item.__class__.__iter__
918 except AttributeError:
918 except AttributeError:
919 return True
919 return True
920 return False # ``__iter__`` has been redefined
920 return False # ``__iter__`` has been redefined
921
921
922
922
923 def xiter(item):
923 def xiter(item):
924 """
924 """
925 Generic function that implements iteration for pipeline expression. If no
925 Generic function that implements iteration for pipeline expression. If no
926 implementation is registered for ``item`` ``xiter`` falls back to ``iter``.
926 implementation is registered for ``item`` ``xiter`` falls back to ``iter``.
927 """
927 """
928 try:
928 try:
929 func = item.__xiter__
929 func = item.__xiter__
930 except AttributeError:
930 except AttributeError:
931 if _isdict(item):
931 if _isdict(item):
932 def items(item):
932 def items(item):
933 fields = ("key", "value")
933 fields = ("key", "value")
934 for (key, value) in item.iteritems():
934 for (key, value) in item.iteritems():
935 yield Fields(fields, key=key, value=value)
935 yield Fields(fields, key=key, value=value)
936 return items(item)
936 return items(item)
937 elif isinstance(item, new.module):
937 elif isinstance(item, new.module):
938 def items(item):
938 def items(item):
939 fields = ("key", "value")
939 fields = ("key", "value")
940 for key in sorted(item.__dict__):
940 for key in sorted(item.__dict__):
941 yield Fields(fields, key=key, value=getattr(item, key))
941 yield Fields(fields, key=key, value=getattr(item, key))
942 return items(item)
942 return items(item)
943 elif _isstr(item):
943 elif _isstr(item):
944 if not item:
944 if not item:
945 raise ValueError("can't enter empty string")
945 raise ValueError("can't enter empty string")
946 return iter(item.splitlines())
946 return iter(item.splitlines())
947 return iter(item)
947 return iter(item)
948 else:
948 else:
949 return iter(func()) # iter() just to be safe
949 return iter(func()) # iter() just to be safe
950 xiter = simplegeneric.generic(xiter)
950 xiter = simplegeneric.generic(xiter)
951
951
952
952
953 class ichain(Pipe):
953 class ichain(Pipe):
954 """
954 """
955 Chains multiple ``Table``s into one.
955 Chains multiple ``Table``s into one.
956 """
956 """
957
957
958 def __init__(self, *iters):
958 def __init__(self, *iters):
959 self.iters = iters
959 self.iters = iters
960
960
961 def __iter__(self):
961 def __iter__(self):
962 return itertools.chain(*self.iters)
962 return itertools.chain(*self.iters)
963
963
964 def __xrepr__(self, mode="default"):
964 def __xrepr__(self, mode="default"):
965 if mode == "header" or mode == "footer":
965 if mode == "header" or mode == "footer":
966 for (i, item) in enumerate(self.iters):
966 for (i, item) in enumerate(self.iters):
967 if i:
967 if i:
968 yield (astyle.style_default, "+")
968 yield (astyle.style_default, "+")
969 if isinstance(item, Pipe):
969 if isinstance(item, Pipe):
970 yield (astyle.style_default, "(")
970 yield (astyle.style_default, "(")
971 for part in xrepr(item, mode):
971 for part in xrepr(item, mode):
972 yield part
972 yield part
973 if isinstance(item, Pipe):
973 if isinstance(item, Pipe):
974 yield (astyle.style_default, ")")
974 yield (astyle.style_default, ")")
975 else:
975 else:
976 yield (astyle.style_default, repr(self))
976 yield (astyle.style_default, repr(self))
977
977
978 def __repr__(self):
978 def __repr__(self):
979 args = ", ".join([repr(it) for it in self.iters])
979 args = ", ".join([repr(it) for it in self.iters])
980 return "%s.%s(%s)" % \
980 return "%s.%s(%s)" % \
981 (self.__class__.__module__, self.__class__.__name__, args)
981 (self.__class__.__module__, self.__class__.__name__, args)
982
982
983
983
984 class ifile(path.path):
984 class ifile(path.path):
985 """
985 """
986 file (or directory) object.
986 file (or directory) object.
987 """
987 """
988
988
989 def getmode(self):
989 def getmode(self):
990 return self.stat().st_mode
990 return self.stat().st_mode
991 mode = property(getmode, None, None, "Access mode")
991 mode = property(getmode, None, None, "Access mode")
992
992
993 def gettype(self):
993 def gettype(self):
994 data = [
994 data = [
995 (stat.S_ISREG, "file"),
995 (stat.S_ISREG, "file"),
996 (stat.S_ISDIR, "dir"),
996 (stat.S_ISDIR, "dir"),
997 (stat.S_ISCHR, "chardev"),
997 (stat.S_ISCHR, "chardev"),
998 (stat.S_ISBLK, "blockdev"),
998 (stat.S_ISBLK, "blockdev"),
999 (stat.S_ISFIFO, "fifo"),
999 (stat.S_ISFIFO, "fifo"),
1000 (stat.S_ISLNK, "symlink"),
1000 (stat.S_ISLNK, "symlink"),
1001 (stat.S_ISSOCK,"socket"),
1001 (stat.S_ISSOCK,"socket"),
1002 ]
1002 ]
1003 lstat = self.lstat()
1003 lstat = self.lstat()
1004 if lstat is not None:
1004 if lstat is not None:
1005 types = set([text for (func, text) in data if func(lstat.st_mode)])
1005 types = set([text for (func, text) in data if func(lstat.st_mode)])
1006 else:
1006 else:
1007 types = set()
1007 types = set()
1008 m = self.mode
1008 m = self.mode
1009 types.update([text for (func, text) in data if func(m)])
1009 types.update([text for (func, text) in data if func(m)])
1010 return ", ".join(types)
1010 return ", ".join(types)
1011 type = property(gettype, None, None, "file type (file, directory, link, etc.)")
1011 type = property(gettype, None, None, "file type (file, directory, link, etc.)")
1012
1012
1013 def getmodestr(self):
1013 def getmodestr(self):
1014 m = self.mode
1014 m = self.mode
1015 data = [
1015 data = [
1016 (stat.S_IRUSR, "-r"),
1016 (stat.S_IRUSR, "-r"),
1017 (stat.S_IWUSR, "-w"),
1017 (stat.S_IWUSR, "-w"),
1018 (stat.S_IXUSR, "-x"),
1018 (stat.S_IXUSR, "-x"),
1019 (stat.S_IRGRP, "-r"),
1019 (stat.S_IRGRP, "-r"),
1020 (stat.S_IWGRP, "-w"),
1020 (stat.S_IWGRP, "-w"),
1021 (stat.S_IXGRP, "-x"),
1021 (stat.S_IXGRP, "-x"),
1022 (stat.S_IROTH, "-r"),
1022 (stat.S_IROTH, "-r"),
1023 (stat.S_IWOTH, "-w"),
1023 (stat.S_IWOTH, "-w"),
1024 (stat.S_IXOTH, "-x"),
1024 (stat.S_IXOTH, "-x"),
1025 ]
1025 ]
1026 return "".join([text[bool(m&bit)] for (bit, text) in data])
1026 return "".join([text[bool(m&bit)] for (bit, text) in data])
1027
1027
1028 modestr = property(getmodestr, None, None, "Access mode as string")
1028 modestr = property(getmodestr, None, None, "Access mode as string")
1029
1029
1030 def getblocks(self):
1030 def getblocks(self):
1031 return self.stat().st_blocks
1031 return self.stat().st_blocks
1032 blocks = property(getblocks, None, None, "File size in blocks")
1032 blocks = property(getblocks, None, None, "File size in blocks")
1033
1033
1034 def getblksize(self):
1034 def getblksize(self):
1035 return self.stat().st_blksize
1035 return self.stat().st_blksize
1036 blksize = property(getblksize, None, None, "Filesystem block size")
1036 blksize = property(getblksize, None, None, "Filesystem block size")
1037
1037
1038 def getdev(self):
1038 def getdev(self):
1039 return self.stat().st_dev
1039 return self.stat().st_dev
1040 dev = property(getdev)
1040 dev = property(getdev)
1041
1041
1042 def getnlink(self):
1042 def getnlink(self):
1043 return self.stat().st_nlink
1043 return self.stat().st_nlink
1044 nlink = property(getnlink, None, None, "Number of links")
1044 nlink = property(getnlink, None, None, "Number of links")
1045
1045
1046 def getuid(self):
1046 def getuid(self):
1047 return self.stat().st_uid
1047 return self.stat().st_uid
1048 uid = property(getuid, None, None, "User id of file owner")
1048 uid = property(getuid, None, None, "User id of file owner")
1049
1049
1050 def getgid(self):
1050 def getgid(self):
1051 return self.stat().st_gid
1051 return self.stat().st_gid
1052 gid = property(getgid, None, None, "Group id of file owner")
1052 gid = property(getgid, None, None, "Group id of file owner")
1053
1053
1054 def getowner(self):
1054 def getowner(self):
1055 stat = self.stat()
1055 stat = self.stat()
1056 try:
1056 try:
1057 return pwd.getpwuid(stat.st_uid).pw_name
1057 return pwd.getpwuid(stat.st_uid).pw_name
1058 except KeyError:
1058 except KeyError:
1059 return stat.st_uid
1059 return stat.st_uid
1060 owner = property(getowner, None, None, "Owner name (or id)")
1060 owner = property(getowner, None, None, "Owner name (or id)")
1061
1061
1062 def getgroup(self):
1062 def getgroup(self):
1063 stat = self.stat()
1063 stat = self.stat()
1064 try:
1064 try:
1065 return grp.getgrgid(stat.st_gid).gr_name
1065 return grp.getgrgid(stat.st_gid).gr_name
1066 except KeyError:
1066 except KeyError:
1067 return stat.st_gid
1067 return stat.st_gid
1068 group = property(getgroup, None, None, "Group name (or id)")
1068 group = property(getgroup, None, None, "Group name (or id)")
1069
1069
1070 def getadate(self):
1070 def getadate(self):
1071 return datetime.datetime.utcfromtimestamp(self.atime)
1071 return datetime.datetime.utcfromtimestamp(self.atime)
1072 adate = property(getadate, None, None, "Access date")
1072 adate = property(getadate, None, None, "Access date")
1073
1073
1074 def getcdate(self):
1074 def getcdate(self):
1075 return datetime.datetime.utcfromtimestamp(self.ctime)
1075 return datetime.datetime.utcfromtimestamp(self.ctime)
1076 cdate = property(getcdate, None, None, "Creation date")
1076 cdate = property(getcdate, None, None, "Creation date")
1077
1077
1078 def getmdate(self):
1078 def getmdate(self):
1079 return datetime.datetime.utcfromtimestamp(self.mtime)
1079 return datetime.datetime.utcfromtimestamp(self.mtime)
1080 mdate = property(getmdate, None, None, "Modification date")
1080 mdate = property(getmdate, None, None, "Modification date")
1081
1081
1082 def mimetype(self):
1082 def mimetype(self):
1083 """
1083 """
1084 Return MIME type guessed from the extension.
1084 Return MIME type guessed from the extension.
1085 """
1085 """
1086 return mimetypes.guess_type(self.basename())[0]
1086 return mimetypes.guess_type(self.basename())[0]
1087
1087
1088 def encoding(self):
1088 def encoding(self):
1089 """
1089 """
1090 Return guessed compression (like "compress" or "gzip").
1090 Return guessed compression (like "compress" or "gzip").
1091 """
1091 """
1092 return mimetypes.guess_type(self.basename())[1]
1092 return mimetypes.guess_type(self.basename())[1]
1093
1093
1094 def __repr__(self):
1094 def __repr__(self):
1095 return "ifile(%s)" % path._base.__repr__(self)
1095 return "ifile(%s)" % path._base.__repr__(self)
1096
1096
1097 if sys.platform == "win32":
1097 if sys.platform == "win32":
1098 defaultattrs = (None, "type", "size", "modestr", "mdate")
1098 defaultattrs = (None, "type", "size", "modestr", "mdate")
1099 else:
1099 else:
1100 defaultattrs = (None, "type", "size", "modestr", "owner", "group", "mdate")
1100 defaultattrs = (None, "type", "size", "modestr", "owner", "group", "mdate")
1101
1101
1102 def __xattrs__(self, mode="default"):
1102 def __xattrs__(self, mode="default"):
1103 if mode == "detail":
1103 if mode == "detail":
1104 return (
1104 return (
1105 "name",
1105 "name",
1106 "basename()",
1106 "basename()",
1107 "abspath()",
1107 "abspath()",
1108 "realpath()",
1108 "realpath()",
1109 "type",
1109 "type",
1110 "mode",
1110 "mode",
1111 "modestr",
1111 "modestr",
1112 "stat()",
1112 "stat()",
1113 "lstat()",
1113 "lstat()",
1114 "uid",
1114 "uid",
1115 "gid",
1115 "gid",
1116 "owner",
1116 "owner",
1117 "group",
1117 "group",
1118 "dev",
1118 "dev",
1119 "nlink",
1119 "nlink",
1120 "ctime",
1120 "ctime",
1121 "mtime",
1121 "mtime",
1122 "atime",
1122 "atime",
1123 "cdate",
1123 "cdate",
1124 "mdate",
1124 "mdate",
1125 "adate",
1125 "adate",
1126 "size",
1126 "size",
1127 "blocks",
1127 "blocks",
1128 "blksize",
1128 "blksize",
1129 "isdir()",
1129 "isdir()",
1130 "islink()",
1130 "islink()",
1131 "mimetype()",
1131 "mimetype()",
1132 "encoding()",
1132 "encoding()",
1133 "-listdir()",
1133 "-listdir()",
1134 "-dirs()",
1134 "-dirs()",
1135 "-files()",
1135 "-files()",
1136 "-walk()",
1136 "-walk()",
1137 "-walkdirs()",
1137 "-walkdirs()",
1138 "-walkfiles()",
1138 "-walkfiles()",
1139 )
1139 )
1140 else:
1140 else:
1141 return self.defaultattrs
1141 return self.defaultattrs
1142
1142
1143
1143
1144 def xiter_ifile(self):
1144 def xiter_ifile(self):
1145 if self.isdir():
1145 if self.isdir():
1146 yield (self / os.pardir).abspath()
1146 yield (self / os.pardir).abspath()
1147 for child in sorted(self.listdir()):
1147 for child in sorted(self.listdir()):
1148 yield child
1148 yield child
1149 else:
1149 else:
1150 f = self.open("rb")
1150 f = self.open("rb")
1151 for line in f:
1151 for line in f:
1152 yield line
1152 yield line
1153 f.close()
1153 f.close()
1154 xiter.when_type(ifile)(xiter_ifile)
1154 xiter.when_type(ifile)(xiter_ifile)
1155
1155
1156
1156
1157 # We need to implement ``xrepr`` for ``ifile`` as a generic function, because
1157 # We need to implement ``xrepr`` for ``ifile`` as a generic function, because
1158 # otherwise ``xrepr_str`` would kick in.
1158 # otherwise ``xrepr_str`` would kick in.
1159 def xrepr_ifile(self, mode="default"):
1159 def xrepr_ifile(self, mode="default"):
1160 try:
1160 try:
1161 if self.isdir():
1161 if self.isdir():
1162 name = "idir"
1162 name = "idir"
1163 style = astyle.style_dir
1163 style = astyle.style_dir
1164 else:
1164 else:
1165 name = "ifile"
1165 name = "ifile"
1166 style = astyle.style_file
1166 style = astyle.style_file
1167 except IOError:
1167 except IOError:
1168 name = "ifile"
1168 name = "ifile"
1169 style = astyle.style_default
1169 style = astyle.style_default
1170 if mode == "cell" or mode in "header" or mode == "footer":
1170 if mode == "cell" or mode in "header" or mode == "footer":
1171 abspath = repr(path._base(self.normpath()))
1171 abspath = repr(path._base(self.normpath()))
1172 if abspath.startswith("u"):
1172 if abspath.startswith("u"):
1173 abspath = abspath[2:-1]
1173 abspath = abspath[2:-1]
1174 else:
1174 else:
1175 abspath = abspath[1:-1]
1175 abspath = abspath[1:-1]
1176 if mode == "cell":
1176 if mode == "cell":
1177 yield (style, abspath)
1177 yield (style, abspath)
1178 else:
1178 else:
1179 yield (style, "%s(%s)" % (name, abspath))
1179 yield (style, "%s(%s)" % (name, abspath))
1180 else:
1180 else:
1181 yield (style, repr(self))
1181 yield (style, repr(self))
1182 xrepr.when_type(ifile)(xrepr_ifile)
1182 xrepr.when_type(ifile)(xrepr_ifile)
1183
1183
1184
1184
1185 class ils(Table):
1185 class ils(Table):
1186 """
1186 """
1187 List the current (or a specified) directory.
1187 List the current (or a specified) directory.
1188
1188
1189 Examples:
1189 Examples:
1190
1190
1191 >>> ils
1191 >>> ils
1192 >>> ils("/usr/local/lib/python2.4")
1192 >>> ils("/usr/local/lib/python2.4")
1193 >>> ils("~")
1193 >>> ils("~")
1194 """
1194 """
1195 def __init__(self, base=os.curdir, dirs=True, files=True):
1195 def __init__(self, base=os.curdir, dirs=True, files=True):
1196 self.base = os.path.expanduser(base)
1196 self.base = os.path.expanduser(base)
1197 self.dirs = dirs
1197 self.dirs = dirs
1198 self.files = files
1198 self.files = files
1199
1199
1200 def __iter__(self):
1200 def __iter__(self):
1201 base = ifile(self.base)
1201 base = ifile(self.base)
1202 yield (base / os.pardir).abspath()
1202 yield (base / os.pardir).abspath()
1203 for child in base.listdir():
1203 for child in base.listdir():
1204 if self.dirs:
1204 if self.dirs:
1205 if self.files:
1205 if self.files:
1206 yield child
1206 yield child
1207 else:
1207 else:
1208 if child.isdir():
1208 if child.isdir():
1209 yield child
1209 yield child
1210 elif self.files:
1210 elif self.files:
1211 if not child.isdir():
1211 if not child.isdir():
1212 yield child
1212 yield child
1213
1213
1214 def __xrepr__(self, mode="default"):
1214 def __xrepr__(self, mode="default"):
1215 return xrepr(ifile(self.base), mode)
1215 return xrepr(ifile(self.base), mode)
1216
1216
1217 def __repr__(self):
1217 def __repr__(self):
1218 return "%s.%s(%r)" % \
1218 return "%s.%s(%r)" % \
1219 (self.__class__.__module__, self.__class__.__name__, self.base)
1219 (self.__class__.__module__, self.__class__.__name__, self.base)
1220
1220
1221
1221
1222 class iglob(Table):
1222 class iglob(Table):
1223 """
1223 """
1224 List all files and directories matching a specified pattern.
1224 List all files and directories matching a specified pattern.
1225 (See ``glob.glob()`` for more info.).
1225 (See ``glob.glob()`` for more info.).
1226
1226
1227 Examples:
1227 Examples:
1228
1228
1229 >>> iglob("*.py")
1229 >>> iglob("*.py")
1230 """
1230 """
1231 def __init__(self, glob):
1231 def __init__(self, glob):
1232 self.glob = glob
1232 self.glob = glob
1233
1233
1234 def __iter__(self):
1234 def __iter__(self):
1235 for name in glob.glob(self.glob):
1235 for name in glob.glob(self.glob):
1236 yield ifile(name)
1236 yield ifile(name)
1237
1237
1238 def __xrepr__(self, mode="default"):
1238 def __xrepr__(self, mode="default"):
1239 if mode == "header" or mode == "footer" or mode == "cell":
1239 if mode == "header" or mode == "footer" or mode == "cell":
1240 yield (astyle.style_default,
1240 yield (astyle.style_default,
1241 "%s(%r)" % (self.__class__.__name__, self.glob))
1241 "%s(%r)" % (self.__class__.__name__, self.glob))
1242 else:
1242 else:
1243 yield (astyle.style_default, repr(self))
1243 yield (astyle.style_default, repr(self))
1244
1244
1245 def __repr__(self):
1245 def __repr__(self):
1246 return "%s.%s(%r)" % \
1246 return "%s.%s(%r)" % \
1247 (self.__class__.__module__, self.__class__.__name__, self.glob)
1247 (self.__class__.__module__, self.__class__.__name__, self.glob)
1248
1248
1249
1249
1250 class iwalk(Table):
1250 class iwalk(Table):
1251 """
1251 """
1252 List all files and directories in a directory and it's subdirectory.
1252 List all files and directories in a directory and it's subdirectory.
1253
1253
1254 >>> iwalk
1254 >>> iwalk
1255 >>> iwalk("/usr/local/lib/python2.4")
1255 >>> iwalk("/usr/local/lib/python2.4")
1256 >>> iwalk("~")
1256 >>> iwalk("~")
1257 """
1257 """
1258 def __init__(self, base=os.curdir, dirs=True, files=True):
1258 def __init__(self, base=os.curdir, dirs=True, files=True):
1259 self.base = os.path.expanduser(base)
1259 self.base = os.path.expanduser(base)
1260 self.dirs = dirs
1260 self.dirs = dirs
1261 self.files = files
1261 self.files = files
1262
1262
1263 def __iter__(self):
1263 def __iter__(self):
1264 for (dirpath, dirnames, filenames) in os.walk(self.base):
1264 for (dirpath, dirnames, filenames) in os.walk(self.base):
1265 if self.dirs:
1265 if self.dirs:
1266 for name in sorted(dirnames):
1266 for name in sorted(dirnames):
1267 yield ifile(os.path.join(dirpath, name))
1267 yield ifile(os.path.join(dirpath, name))
1268 if self.files:
1268 if self.files:
1269 for name in sorted(filenames):
1269 for name in sorted(filenames):
1270 yield ifile(os.path.join(dirpath, name))
1270 yield ifile(os.path.join(dirpath, name))
1271
1271
1272 def __xrepr__(self, mode="default"):
1272 def __xrepr__(self, mode="default"):
1273 if mode == "header" or mode == "footer" or mode == "cell":
1273 if mode == "header" or mode == "footer" or mode == "cell":
1274 yield (astyle.style_default,
1274 yield (astyle.style_default,
1275 "%s(%r)" % (self.__class__.__name__, self.base))
1275 "%s(%r)" % (self.__class__.__name__, self.base))
1276 else:
1276 else:
1277 yield (astyle.style_default, repr(self))
1277 yield (astyle.style_default, repr(self))
1278
1278
1279 def __repr__(self):
1279 def __repr__(self):
1280 return "%s.%s(%r)" % \
1280 return "%s.%s(%r)" % \
1281 (self.__class__.__module__, self.__class__.__name__, self.base)
1281 (self.__class__.__module__, self.__class__.__name__, self.base)
1282
1282
1283
1283
1284 class ipwdentry(object):
1284 class ipwdentry(object):
1285 """
1285 """
1286 ``ipwdentry`` objects encapsulate entries in the Unix user account and
1286 ``ipwdentry`` objects encapsulate entries in the Unix user account and
1287 password database.
1287 password database.
1288 """
1288 """
1289 def __init__(self, id):
1289 def __init__(self, id):
1290 self._id = id
1290 self._id = id
1291 self._entry = None
1291 self._entry = None
1292
1292
1293 def __eq__(self, other):
1294 return self.__class__ is other.__class__ and self._id == other._id
1295
1296 def __ne__(self, other):
1297 return self.__class__ is not other.__class__ or self._id != other._id
1298
1293 def _getentry(self):
1299 def _getentry(self):
1294 if self._entry is None:
1300 if self._entry is None:
1295 if isinstance(self._id, basestring):
1301 if isinstance(self._id, basestring):
1296 self._entry = pwd.getpwnam(self._id)
1302 self._entry = pwd.getpwnam(self._id)
1297 else:
1303 else:
1298 self._entry = pwd.getpwuid(self._id)
1304 self._entry = pwd.getpwuid(self._id)
1299 return self._entry
1305 return self._entry
1300
1306
1301 def getname(self):
1307 def getname(self):
1302 if isinstance(self._id, basestring):
1308 if isinstance(self._id, basestring):
1303 return self._id
1309 return self._id
1304 else:
1310 else:
1305 return self._getentry().pw_name
1311 return self._getentry().pw_name
1306 name = property(getname, None, None, "User name")
1312 name = property(getname, None, None, "User name")
1307
1313
1308 def getpasswd(self):
1314 def getpasswd(self):
1309 return self._getentry().pw_passwd
1315 return self._getentry().pw_passwd
1310 passwd = property(getpasswd, None, None, "Password")
1316 passwd = property(getpasswd, None, None, "Password")
1311
1317
1312 def getuid(self):
1318 def getuid(self):
1313 if isinstance(self._id, basestring):
1319 if isinstance(self._id, basestring):
1314 return self._getentry().pw_uid
1320 return self._getentry().pw_uid
1315 else:
1321 else:
1316 return self._id
1322 return self._id
1317 uid = property(getuid, None, None, "User id")
1323 uid = property(getuid, None, None, "User id")
1318
1324
1319 def getgid(self):
1325 def getgid(self):
1320 return self._getentry().pw_gid
1326 return self._getentry().pw_gid
1321 gid = property(getgid, None, None, "Primary group id")
1327 gid = property(getgid, None, None, "Primary group id")
1322
1328
1323 def getgroup(self):
1329 def getgroup(self):
1324 return igrpentry(self.gid)
1330 return igrpentry(self.gid)
1325 group = property(getgroup, None, None, "Group")
1331 group = property(getgroup, None, None, "Group")
1326
1332
1327 def getgecos(self):
1333 def getgecos(self):
1328 return self._getentry().pw_gecos
1334 return self._getentry().pw_gecos
1329 gecos = property(getgecos, None, None, "Information (e.g. full user name)")
1335 gecos = property(getgecos, None, None, "Information (e.g. full user name)")
1330
1336
1331 def getdir(self):
1337 def getdir(self):
1332 return self._getentry().pw_dir
1338 return self._getentry().pw_dir
1333 dir = property(getdir, None, None, "$HOME directory")
1339 dir = property(getdir, None, None, "$HOME directory")
1334
1340
1335 def getshell(self):
1341 def getshell(self):
1336 return self._getentry().pw_shell
1342 return self._getentry().pw_shell
1337 shell = property(getshell, None, None, "Login shell")
1343 shell = property(getshell, None, None, "Login shell")
1338
1344
1339 def __xattrs__(self, mode="default"):
1345 def __xattrs__(self, mode="default"):
1340 return ("name", "passwd", "uid", "gid", "gecos", "dir", "shell")
1346 return ("name", "passwd", "uid", "gid", "gecos", "dir", "shell")
1341
1347
1342 def __repr__(self):
1348 def __repr__(self):
1343 return "%s.%s(%r)" % \
1349 return "%s.%s(%r)" % \
1344 (self.__class__.__module__, self.__class__.__name__, self._id)
1350 (self.__class__.__module__, self.__class__.__name__, self._id)
1345
1351
1346
1352
1347 class ipwd(Table):
1353 class ipwd(Table):
1348 """
1354 """
1349 List all entries in the Unix user account and password database.
1355 List all entries in the Unix user account and password database.
1350
1356
1351 Example:
1357 Example:
1352
1358
1353 >>> ipwd | isort("uid")
1359 >>> ipwd | isort("uid")
1354 """
1360 """
1355 def __iter__(self):
1361 def __iter__(self):
1356 for entry in pwd.getpwall():
1362 for entry in pwd.getpwall():
1357 yield ipwdentry(entry.pw_name)
1363 yield ipwdentry(entry.pw_name)
1358
1364
1359 def __xrepr__(self, mode="default"):
1365 def __xrepr__(self, mode="default"):
1360 if mode == "header" or mode == "footer" or mode == "cell":
1366 if mode == "header" or mode == "footer" or mode == "cell":
1361 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1367 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1362 else:
1368 else:
1363 yield (astyle.style_default, repr(self))
1369 yield (astyle.style_default, repr(self))
1364
1370
1365
1371
1366 class igrpentry(object):
1372 class igrpentry(object):
1367 """
1373 """
1368 ``igrpentry`` objects encapsulate entries in the Unix group database.
1374 ``igrpentry`` objects encapsulate entries in the Unix group database.
1369 """
1375 """
1370 def __init__(self, id):
1376 def __init__(self, id):
1371 self._id = id
1377 self._id = id
1372 self._entry = None
1378 self._entry = None
1373
1379
1380 def __eq__(self, other):
1381 return self.__class__ is other.__class__ and self._id == other._id
1382
1383 def __ne__(self, other):
1384 return self.__class__ is not other.__class__ or self._id != other._id
1385
1374 def _getentry(self):
1386 def _getentry(self):
1375 if self._entry is None:
1387 if self._entry is None:
1376 if isinstance(self._id, basestring):
1388 if isinstance(self._id, basestring):
1377 self._entry = grp.getgrnam(self._id)
1389 self._entry = grp.getgrnam(self._id)
1378 else:
1390 else:
1379 self._entry = grp.getgrgid(self._id)
1391 self._entry = grp.getgrgid(self._id)
1380 return self._entry
1392 return self._entry
1381
1393
1382 def getname(self):
1394 def getname(self):
1383 if isinstance(self._id, basestring):
1395 if isinstance(self._id, basestring):
1384 return self._id
1396 return self._id
1385 else:
1397 else:
1386 return self._getentry().gr_name
1398 return self._getentry().gr_name
1387 name = property(getname, None, None, "Group name")
1399 name = property(getname, None, None, "Group name")
1388
1400
1389 def getpasswd(self):
1401 def getpasswd(self):
1390 return self._getentry().gr_passwd
1402 return self._getentry().gr_passwd
1391 passwd = property(getpasswd, None, None, "Password")
1403 passwd = property(getpasswd, None, None, "Password")
1392
1404
1393 def getgid(self):
1405 def getgid(self):
1394 if isinstance(self._id, basestring):
1406 if isinstance(self._id, basestring):
1395 return self._getentry().gr_gid
1407 return self._getentry().gr_gid
1396 else:
1408 else:
1397 return self._id
1409 return self._id
1398 gid = property(getgid, None, None, "Group id")
1410 gid = property(getgid, None, None, "Group id")
1399
1411
1400 def getmem(self):
1412 def getmem(self):
1401 return self._getentry().gr_mem
1413 return self._getentry().gr_mem
1402 mem = property(getmem, None, None, "Members")
1414 mem = property(getmem, None, None, "Members")
1403
1415
1404 def __xattrs__(self, mode="default"):
1416 def __xattrs__(self, mode="default"):
1405 return ("name", "passwd", "gid", "mem")
1417 return ("name", "passwd", "gid", "mem")
1406
1418
1407 def __xrepr__(self, mode="default"):
1419 def __xrepr__(self, mode="default"):
1408 if mode == "header" or mode == "footer" or mode == "cell":
1420 if mode == "header" or mode == "footer" or mode == "cell":
1409 yield (astyle.style_default, "group ")
1421 yield (astyle.style_default, "group ")
1410 try:
1422 try:
1411 yield (astyle.style_default, self.name)
1423 yield (astyle.style_default, self.name)
1412 except KeyError:
1424 except KeyError:
1413 if isinstance(self._id, basestring):
1425 if isinstance(self._id, basestring):
1414 yield (astyle.style_default, self.name_id)
1426 yield (astyle.style_default, self.name_id)
1415 else:
1427 else:
1416 yield (astyle.style_type_number, str(self._id))
1428 yield (astyle.style_type_number, str(self._id))
1417 else:
1429 else:
1418 yield (astyle.style_default, repr(self))
1430 yield (astyle.style_default, repr(self))
1419
1431
1420 def __iter__(self):
1432 def __iter__(self):
1421 for member in self.mem:
1433 for member in self.mem:
1422 yield ipwdentry(member)
1434 yield ipwdentry(member)
1423
1435
1424 def __repr__(self):
1436 def __repr__(self):
1425 return "%s.%s(%r)" % \
1437 return "%s.%s(%r)" % \
1426 (self.__class__.__module__, self.__class__.__name__, self._id)
1438 (self.__class__.__module__, self.__class__.__name__, self._id)
1427
1439
1428
1440
1429 class igrp(Table):
1441 class igrp(Table):
1430 """
1442 """
1431 This ``Table`` lists all entries in the Unix group database.
1443 This ``Table`` lists all entries in the Unix group database.
1432 """
1444 """
1433 def __iter__(self):
1445 def __iter__(self):
1434 for entry in grp.getgrall():
1446 for entry in grp.getgrall():
1435 yield igrpentry(entry.gr_name)
1447 yield igrpentry(entry.gr_name)
1436
1448
1437 def __xrepr__(self, mode="default"):
1449 def __xrepr__(self, mode="default"):
1438 if mode == "header" or mode == "footer":
1450 if mode == "header" or mode == "footer":
1439 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1451 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1440 else:
1452 else:
1441 yield (astyle.style_default, repr(self))
1453 yield (astyle.style_default, repr(self))
1442
1454
1443
1455
1444 class Fields(object):
1456 class Fields(object):
1445 def __init__(self, fieldnames, **fields):
1457 def __init__(self, fieldnames, **fields):
1446 self.__fieldnames = [upgradexattr(fieldname) for fieldname in fieldnames]
1458 self.__fieldnames = [upgradexattr(fieldname) for fieldname in fieldnames]
1447 for (key, value) in fields.iteritems():
1459 for (key, value) in fields.iteritems():
1448 setattr(self, key, value)
1460 setattr(self, key, value)
1449
1461
1450 def __xattrs__(self, mode="default"):
1462 def __xattrs__(self, mode="default"):
1451 return self.__fieldnames
1463 return self.__fieldnames
1452
1464
1453 def __xrepr__(self, mode="default"):
1465 def __xrepr__(self, mode="default"):
1454 yield (-1, False)
1466 yield (-1, False)
1455 if mode == "header" or mode == "cell":
1467 if mode == "header" or mode == "cell":
1456 yield (astyle.style_default, self.__class__.__name__)
1468 yield (astyle.style_default, self.__class__.__name__)
1457 yield (astyle.style_default, "(")
1469 yield (astyle.style_default, "(")
1458 for (i, f) in enumerate(self.__fieldnames):
1470 for (i, f) in enumerate(self.__fieldnames):
1459 if i:
1471 if i:
1460 yield (astyle.style_default, ", ")
1472 yield (astyle.style_default, ", ")
1461 yield (astyle.style_default, f.name())
1473 yield (astyle.style_default, f.name())
1462 yield (astyle.style_default, "=")
1474 yield (astyle.style_default, "=")
1463 for part in xrepr(getattr(self, f), "default"):
1475 for part in xrepr(getattr(self, f), "default"):
1464 yield part
1476 yield part
1465 yield (astyle.style_default, ")")
1477 yield (astyle.style_default, ")")
1466 elif mode == "footer":
1478 elif mode == "footer":
1467 yield (astyle.style_default, self.__class__.__name__)
1479 yield (astyle.style_default, self.__class__.__name__)
1468 yield (astyle.style_default, "(")
1480 yield (astyle.style_default, "(")
1469 for (i, f) in enumerate(self.__fieldnames):
1481 for (i, f) in enumerate(self.__fieldnames):
1470 if i:
1482 if i:
1471 yield (astyle.style_default, ", ")
1483 yield (astyle.style_default, ", ")
1472 yield (astyle.style_default, f.name())
1484 yield (astyle.style_default, f.name())
1473 yield (astyle.style_default, ")")
1485 yield (astyle.style_default, ")")
1474 else:
1486 else:
1475 yield (astyle.style_default, repr(self))
1487 yield (astyle.style_default, repr(self))
1476
1488
1477
1489
1478 class FieldTable(Table, list):
1490 class FieldTable(Table, list):
1479 def __init__(self, *fields):
1491 def __init__(self, *fields):
1480 Table.__init__(self)
1492 Table.__init__(self)
1481 list.__init__(self)
1493 list.__init__(self)
1482 self.fields = fields
1494 self.fields = fields
1483
1495
1484 def add(self, **fields):
1496 def add(self, **fields):
1485 self.append(Fields(self.fields, **fields))
1497 self.append(Fields(self.fields, **fields))
1486
1498
1487 def __xrepr__(self, mode="default"):
1499 def __xrepr__(self, mode="default"):
1488 yield (-1, False)
1500 yield (-1, False)
1489 if mode == "header" or mode == "footer":
1501 if mode == "header" or mode == "footer":
1490 yield (astyle.style_default, self.__class__.__name__)
1502 yield (astyle.style_default, self.__class__.__name__)
1491 yield (astyle.style_default, "(")
1503 yield (astyle.style_default, "(")
1492 for (i, f) in enumerate(self.__fieldnames):
1504 for (i, f) in enumerate(self.__fieldnames):
1493 if i:
1505 if i:
1494 yield (astyle.style_default, ", ")
1506 yield (astyle.style_default, ", ")
1495 yield (astyle.style_default, f)
1507 yield (astyle.style_default, f)
1496 yield (astyle.style_default, ")")
1508 yield (astyle.style_default, ")")
1497 else:
1509 else:
1498 yield (astyle.style_default, repr(self))
1510 yield (astyle.style_default, repr(self))
1499
1511
1500 def __repr__(self):
1512 def __repr__(self):
1501 return "<%s.%s object with fields=%r at 0x%x>" % \
1513 return "<%s.%s object with fields=%r at 0x%x>" % \
1502 (self.__class__.__module__, self.__class__.__name__,
1514 (self.__class__.__module__, self.__class__.__name__,
1503 ", ".join(map(repr, self.fields)), id(self))
1515 ", ".join(map(repr, self.fields)), id(self))
1504
1516
1505
1517
1506 class List(list):
1518 class List(list):
1507 def __xattrs__(self, mode="default"):
1519 def __xattrs__(self, mode="default"):
1508 return xrange(len(self))
1520 return xrange(len(self))
1509
1521
1510 def __xrepr__(self, mode="default"):
1522 def __xrepr__(self, mode="default"):
1511 yield (-1, False)
1523 yield (-1, False)
1512 if mode == "header" or mode == "cell" or mode == "footer" or mode == "default":
1524 if mode == "header" or mode == "cell" or mode == "footer" or mode == "default":
1513 yield (astyle.style_default, self.__class__.__name__)
1525 yield (astyle.style_default, self.__class__.__name__)
1514 yield (astyle.style_default, "(")
1526 yield (astyle.style_default, "(")
1515 for (i, item) in enumerate(self):
1527 for (i, item) in enumerate(self):
1516 if i:
1528 if i:
1517 yield (astyle.style_default, ", ")
1529 yield (astyle.style_default, ", ")
1518 for part in xrepr(item, "default"):
1530 for part in xrepr(item, "default"):
1519 yield part
1531 yield part
1520 yield (astyle.style_default, ")")
1532 yield (astyle.style_default, ")")
1521 else:
1533 else:
1522 yield (astyle.style_default, repr(self))
1534 yield (astyle.style_default, repr(self))
1523
1535
1524
1536
1525 class ienv(Table):
1537 class ienv(Table):
1526 """
1538 """
1527 List environment variables.
1539 List environment variables.
1528
1540
1529 Example:
1541 Example:
1530
1542
1531 >>> ienv
1543 >>> ienv
1532 """
1544 """
1533
1545
1534 def __iter__(self):
1546 def __iter__(self):
1535 fields = ("key", "value")
1547 fields = ("key", "value")
1536 for (key, value) in os.environ.iteritems():
1548 for (key, value) in os.environ.iteritems():
1537 yield Fields(fields, key=key, value=value)
1549 yield Fields(fields, key=key, value=value)
1538
1550
1539 def __xrepr__(self, mode="default"):
1551 def __xrepr__(self, mode="default"):
1540 if mode == "header" or mode == "cell":
1552 if mode == "header" or mode == "cell":
1541 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1553 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1542 else:
1554 else:
1543 yield (astyle.style_default, repr(self))
1555 yield (astyle.style_default, repr(self))
1544
1556
1545
1557
1546 class icsv(Pipe):
1558 class icsv(Pipe):
1547 """
1559 """
1548 This ``Pipe`` lists turn the input (with must be a pipe outputting lines
1560 This ``Pipe`` lists turn the input (with must be a pipe outputting lines
1549 or an ``ifile``) into lines of CVS columns.
1561 or an ``ifile``) into lines of CVS columns.
1550 """
1562 """
1551 def __init__(self, **csvargs):
1563 def __init__(self, **csvargs):
1552 """
1564 """
1553 Create an ``icsv`` object. ``cvsargs`` will be passed through as
1565 Create an ``icsv`` object. ``cvsargs`` will be passed through as
1554 keyword arguments to ``cvs.reader()``.
1566 keyword arguments to ``cvs.reader()``.
1555 """
1567 """
1556 self.csvargs = csvargs
1568 self.csvargs = csvargs
1557
1569
1558 def __iter__(self):
1570 def __iter__(self):
1559 input = self.input
1571 input = self.input
1560 if isinstance(input, ifile):
1572 if isinstance(input, ifile):
1561 input = input.open("rb")
1573 input = input.open("rb")
1562 reader = csv.reader(input, **self.csvargs)
1574 reader = csv.reader(input, **self.csvargs)
1563 for line in reader:
1575 for line in reader:
1564 yield List(line)
1576 yield List(line)
1565
1577
1566 def __xrepr__(self, mode="default"):
1578 def __xrepr__(self, mode="default"):
1567 yield (-1, False)
1579 yield (-1, False)
1568 if mode == "header" or mode == "footer":
1580 if mode == "header" or mode == "footer":
1569 input = getattr(self, "input", None)
1581 input = getattr(self, "input", None)
1570 if input is not None:
1582 if input is not None:
1571 for part in xrepr(input, mode):
1583 for part in xrepr(input, mode):
1572 yield part
1584 yield part
1573 yield (astyle.style_default, " | ")
1585 yield (astyle.style_default, " | ")
1574 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1586 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1575 for (i, (name, value)) in enumerate(self.csvargs.iteritems()):
1587 for (i, (name, value)) in enumerate(self.csvargs.iteritems()):
1576 if i:
1588 if i:
1577 yield (astyle.style_default, ", ")
1589 yield (astyle.style_default, ", ")
1578 yield (astyle.style_default, name)
1590 yield (astyle.style_default, name)
1579 yield (astyle.style_default, "=")
1591 yield (astyle.style_default, "=")
1580 for part in xrepr(value, "default"):
1592 for part in xrepr(value, "default"):
1581 yield part
1593 yield part
1582 yield (astyle.style_default, ")")
1594 yield (astyle.style_default, ")")
1583 else:
1595 else:
1584 yield (astyle.style_default, repr(self))
1596 yield (astyle.style_default, repr(self))
1585
1597
1586 def __repr__(self):
1598 def __repr__(self):
1587 args = ", ".join(["%s=%r" % item for item in self.csvargs.iteritems()])
1599 args = ", ".join(["%s=%r" % item for item in self.csvargs.iteritems()])
1588 return "<%s.%s %s at 0x%x>" % \
1600 return "<%s.%s %s at 0x%x>" % \
1589 (self.__class__.__module__, self.__class__.__name__, args, id(self))
1601 (self.__class__.__module__, self.__class__.__name__, args, id(self))
1590
1602
1591
1603
1592 class ix(Table):
1604 class ix(Table):
1593 """
1605 """
1594 Execute a system command and list its output as lines
1606 Execute a system command and list its output as lines
1595 (similar to ``os.popen()``).
1607 (similar to ``os.popen()``).
1596
1608
1597 Examples:
1609 Examples:
1598
1610
1599 >>> ix("ps x")
1611 >>> ix("ps x")
1600 >>> ix("find .") | ifile
1612 >>> ix("find .") | ifile
1601 """
1613 """
1602 def __init__(self, cmd):
1614 def __init__(self, cmd):
1603 self.cmd = cmd
1615 self.cmd = cmd
1604 self._pipeout = None
1616 self._pipeout = None
1605
1617
1606 def __iter__(self):
1618 def __iter__(self):
1607 (_pipein, self._pipeout) = os.popen4(self.cmd)
1619 (_pipein, self._pipeout) = os.popen4(self.cmd)
1608 _pipein.close()
1620 _pipein.close()
1609 for l in self._pipeout:
1621 for l in self._pipeout:
1610 yield l.rstrip("\r\n")
1622 yield l.rstrip("\r\n")
1611 self._pipeout.close()
1623 self._pipeout.close()
1612 self._pipeout = None
1624 self._pipeout = None
1613
1625
1614 def __del__(self):
1626 def __del__(self):
1615 if self._pipeout is not None and not self._pipeout.closed:
1627 if self._pipeout is not None and not self._pipeout.closed:
1616 self._pipeout.close()
1628 self._pipeout.close()
1617 self._pipeout = None
1629 self._pipeout = None
1618
1630
1619 def __xrepr__(self, mode="default"):
1631 def __xrepr__(self, mode="default"):
1620 if mode == "header" or mode == "footer":
1632 if mode == "header" or mode == "footer":
1621 yield (astyle.style_default,
1633 yield (astyle.style_default,
1622 "%s(%r)" % (self.__class__.__name__, self.cmd))
1634 "%s(%r)" % (self.__class__.__name__, self.cmd))
1623 else:
1635 else:
1624 yield (astyle.style_default, repr(self))
1636 yield (astyle.style_default, repr(self))
1625
1637
1626 def __repr__(self):
1638 def __repr__(self):
1627 return "%s.%s(%r)" % \
1639 return "%s.%s(%r)" % \
1628 (self.__class__.__module__, self.__class__.__name__, self.cmd)
1640 (self.__class__.__module__, self.__class__.__name__, self.cmd)
1629
1641
1630
1642
1631 class ifilter(Pipe):
1643 class ifilter(Pipe):
1632 """
1644 """
1633 Filter an input pipe. Only objects where an expression evaluates to true
1645 Filter an input pipe. Only objects where an expression evaluates to true
1634 (and doesn't raise an exception) are listed.
1646 (and doesn't raise an exception) are listed.
1635
1647
1636 Examples:
1648 Examples:
1637
1649
1638 >>> ils | ifilter("_.isfile() and size>1000")
1650 >>> ils | ifilter("_.isfile() and size>1000")
1639 >>> igrp | ifilter("len(mem)")
1651 >>> igrp | ifilter("len(mem)")
1640 >>> sys.modules | ifilter(lambda _:_.value is not None)
1652 >>> sys.modules | ifilter(lambda _:_.value is not None)
1641 """
1653 """
1642
1654
1643 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1655 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1644 """
1656 """
1645 Create an ``ifilter`` object. ``expr`` can be a callable or a string
1657 Create an ``ifilter`` object. ``expr`` can be a callable or a string
1646 containing an expression. ``globals`` will be used as the global
1658 containing an expression. ``globals`` will be used as the global
1647 namespace for calling string expressions (defaulting to IPython's
1659 namespace for calling string expressions (defaulting to IPython's
1648 user namespace). ``errors`` specifies how exception during evaluation
1660 user namespace). ``errors`` specifies how exception during evaluation
1649 of ``expr`` are handled:
1661 of ``expr`` are handled:
1650
1662
1651 * ``drop``: drop all items that have errors;
1663 * ``drop``: drop all items that have errors;
1652
1664
1653 * ``keep``: keep all items that have errors;
1665 * ``keep``: keep all items that have errors;
1654
1666
1655 * ``keeperror``: keep the exception of all items that have errors;
1667 * ``keeperror``: keep the exception of all items that have errors;
1656
1668
1657 * ``raise``: raise the exception;
1669 * ``raise``: raise the exception;
1658
1670
1659 * ``raiseifallfail``: raise the first exception if all items have errors;
1671 * ``raiseifallfail``: raise the first exception if all items have errors;
1660 otherwise drop those with errors (this is the default).
1672 otherwise drop those with errors (this is the default).
1661 """
1673 """
1662 self.expr = expr
1674 self.expr = expr
1663 self.globals = globals
1675 self.globals = globals
1664 self.errors = errors
1676 self.errors = errors
1665
1677
1666 def __iter__(self):
1678 def __iter__(self):
1667 if callable(self.expr):
1679 if callable(self.expr):
1668 test = self.expr
1680 test = self.expr
1669 else:
1681 else:
1670 g = getglobals(self.globals)
1682 g = getglobals(self.globals)
1671 expr = compile(self.expr, "ipipe-expression", "eval")
1683 expr = compile(self.expr, "ipipe-expression", "eval")
1672 def test(item):
1684 def test(item):
1673 return eval(expr, g, AttrNamespace(item))
1685 return eval(expr, g, AttrNamespace(item))
1674
1686
1675 ok = 0
1687 ok = 0
1676 exc_info = None
1688 exc_info = None
1677 for item in xiter(self.input):
1689 for item in xiter(self.input):
1678 try:
1690 try:
1679 if test(item):
1691 if test(item):
1680 yield item
1692 yield item
1681 ok += 1
1693 ok += 1
1682 except (KeyboardInterrupt, SystemExit):
1694 except (KeyboardInterrupt, SystemExit):
1683 raise
1695 raise
1684 except Exception, exc:
1696 except Exception, exc:
1685 if self.errors == "drop":
1697 if self.errors == "drop":
1686 pass # Ignore errors
1698 pass # Ignore errors
1687 elif self.errors == "keep":
1699 elif self.errors == "keep":
1688 yield item
1700 yield item
1689 elif self.errors == "keeperror":
1701 elif self.errors == "keeperror":
1690 yield exc
1702 yield exc
1691 elif self.errors == "raise":
1703 elif self.errors == "raise":
1692 raise
1704 raise
1693 elif self.errors == "raiseifallfail":
1705 elif self.errors == "raiseifallfail":
1694 if exc_info is None:
1706 if exc_info is None:
1695 exc_info = sys.exc_info()
1707 exc_info = sys.exc_info()
1696 if not ok and exc_info is not None:
1708 if not ok and exc_info is not None:
1697 raise exc_info[0], exc_info[1], exc_info[2]
1709 raise exc_info[0], exc_info[1], exc_info[2]
1698
1710
1699 def __xrepr__(self, mode="default"):
1711 def __xrepr__(self, mode="default"):
1700 if mode == "header" or mode == "footer":
1712 if mode == "header" or mode == "footer":
1701 input = getattr(self, "input", None)
1713 input = getattr(self, "input", None)
1702 if input is not None:
1714 if input is not None:
1703 for part in xrepr(input, mode):
1715 for part in xrepr(input, mode):
1704 yield part
1716 yield part
1705 yield (astyle.style_default, " | ")
1717 yield (astyle.style_default, " | ")
1706 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1718 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1707 for part in xrepr(self.expr, "default"):
1719 for part in xrepr(self.expr, "default"):
1708 yield part
1720 yield part
1709 yield (astyle.style_default, ")")
1721 yield (astyle.style_default, ")")
1710 else:
1722 else:
1711 yield (astyle.style_default, repr(self))
1723 yield (astyle.style_default, repr(self))
1712
1724
1713 def __repr__(self):
1725 def __repr__(self):
1714 return "<%s.%s expr=%r at 0x%x>" % \
1726 return "<%s.%s expr=%r at 0x%x>" % \
1715 (self.__class__.__module__, self.__class__.__name__,
1727 (self.__class__.__module__, self.__class__.__name__,
1716 self.expr, id(self))
1728 self.expr, id(self))
1717
1729
1718
1730
1719 class ieval(Pipe):
1731 class ieval(Pipe):
1720 """
1732 """
1721 Evaluate an expression for each object in the input pipe.
1733 Evaluate an expression for each object in the input pipe.
1722
1734
1723 Examples:
1735 Examples:
1724
1736
1725 >>> ils | ieval("_.abspath()")
1737 >>> ils | ieval("_.abspath()")
1726 >>> sys.path | ieval(ifile)
1738 >>> sys.path | ieval(ifile)
1727 """
1739 """
1728
1740
1729 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1741 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1730 """
1742 """
1731 Create an ``ieval`` object. ``expr`` can be a callable or a string
1743 Create an ``ieval`` object. ``expr`` can be a callable or a string
1732 containing an expression. For the meaning of ``globals`` and
1744 containing an expression. For the meaning of ``globals`` and
1733 ``errors`` see ``ifilter``.
1745 ``errors`` see ``ifilter``.
1734 """
1746 """
1735 self.expr = expr
1747 self.expr = expr
1736 self.globals = globals
1748 self.globals = globals
1737 self.errors = errors
1749 self.errors = errors
1738
1750
1739 def __iter__(self):
1751 def __iter__(self):
1740 if callable(self.expr):
1752 if callable(self.expr):
1741 do = self.expr
1753 do = self.expr
1742 else:
1754 else:
1743 g = getglobals(self.globals)
1755 g = getglobals(self.globals)
1744 expr = compile(self.expr, "ipipe-expression", "eval")
1756 expr = compile(self.expr, "ipipe-expression", "eval")
1745 def do(item):
1757 def do(item):
1746 return eval(expr, g, AttrNamespace(item))
1758 return eval(expr, g, AttrNamespace(item))
1747
1759
1748 ok = 0
1760 ok = 0
1749 exc_info = None
1761 exc_info = None
1750 for item in xiter(self.input):
1762 for item in xiter(self.input):
1751 try:
1763 try:
1752 yield do(item)
1764 yield do(item)
1753 except (KeyboardInterrupt, SystemExit):
1765 except (KeyboardInterrupt, SystemExit):
1754 raise
1766 raise
1755 except Exception, exc:
1767 except Exception, exc:
1756 if self.errors == "drop":
1768 if self.errors == "drop":
1757 pass # Ignore errors
1769 pass # Ignore errors
1758 elif self.errors == "keep":
1770 elif self.errors == "keep":
1759 yield item
1771 yield item
1760 elif self.errors == "keeperror":
1772 elif self.errors == "keeperror":
1761 yield exc
1773 yield exc
1762 elif self.errors == "raise":
1774 elif self.errors == "raise":
1763 raise
1775 raise
1764 elif self.errors == "raiseifallfail":
1776 elif self.errors == "raiseifallfail":
1765 if exc_info is None:
1777 if exc_info is None:
1766 exc_info = sys.exc_info()
1778 exc_info = sys.exc_info()
1767 if not ok and exc_info is not None:
1779 if not ok and exc_info is not None:
1768 raise exc_info[0], exc_info[1], exc_info[2]
1780 raise exc_info[0], exc_info[1], exc_info[2]
1769
1781
1770 def __xrepr__(self, mode="default"):
1782 def __xrepr__(self, mode="default"):
1771 if mode == "header" or mode == "footer":
1783 if mode == "header" or mode == "footer":
1772 input = getattr(self, "input", None)
1784 input = getattr(self, "input", None)
1773 if input is not None:
1785 if input is not None:
1774 for part in xrepr(input, mode):
1786 for part in xrepr(input, mode):
1775 yield part
1787 yield part
1776 yield (astyle.style_default, " | ")
1788 yield (astyle.style_default, " | ")
1777 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1789 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1778 for part in xrepr(self.expr, "default"):
1790 for part in xrepr(self.expr, "default"):
1779 yield part
1791 yield part
1780 yield (astyle.style_default, ")")
1792 yield (astyle.style_default, ")")
1781 else:
1793 else:
1782 yield (astyle.style_default, repr(self))
1794 yield (astyle.style_default, repr(self))
1783
1795
1784 def __repr__(self):
1796 def __repr__(self):
1785 return "<%s.%s expr=%r at 0x%x>" % \
1797 return "<%s.%s expr=%r at 0x%x>" % \
1786 (self.__class__.__module__, self.__class__.__name__,
1798 (self.__class__.__module__, self.__class__.__name__,
1787 self.expr, id(self))
1799 self.expr, id(self))
1788
1800
1789
1801
1790 class ienum(Pipe):
1802 class ienum(Pipe):
1791 """
1803 """
1792 Enumerate the input pipe (i.e. wrap each input object in an object
1804 Enumerate the input pipe (i.e. wrap each input object in an object
1793 with ``index`` and ``object`` attributes).
1805 with ``index`` and ``object`` attributes).
1794
1806
1795 Examples:
1807 Examples:
1796
1808
1797 >>> xrange(20) | ieval("_,_*_") | ienum | ifilter("index % 2 == 0") | ieval("object")
1809 >>> xrange(20) | ieval("_,_*_") | ienum | ifilter("index % 2 == 0") | ieval("object")
1798 """
1810 """
1799 def __iter__(self):
1811 def __iter__(self):
1800 fields = ("index", "object")
1812 fields = ("index", "object")
1801 for (index, object) in enumerate(xiter(self.input)):
1813 for (index, object) in enumerate(xiter(self.input)):
1802 yield Fields(fields, index=index, object=object)
1814 yield Fields(fields, index=index, object=object)
1803
1815
1804
1816
1805 class isort(Pipe):
1817 class isort(Pipe):
1806 """
1818 """
1807 Sorts the input pipe.
1819 Sorts the input pipe.
1808
1820
1809 Examples:
1821 Examples:
1810
1822
1811 >>> ils | isort("size")
1823 >>> ils | isort("size")
1812 >>> ils | isort("_.isdir(), _.lower()", reverse=True)
1824 >>> ils | isort("_.isdir(), _.lower()", reverse=True)
1813 """
1825 """
1814
1826
1815 def __init__(self, key=None, globals=None, reverse=False):
1827 def __init__(self, key=None, globals=None, reverse=False):
1816 """
1828 """
1817 Create an ``isort`` object. ``key`` can be a callable or a string
1829 Create an ``isort`` object. ``key`` can be a callable or a string
1818 containing an expression (or ``None`` in which case the items
1830 containing an expression (or ``None`` in which case the items
1819 themselves will be sorted). If ``reverse`` is true the sort order
1831 themselves will be sorted). If ``reverse`` is true the sort order
1820 will be reversed. For the meaning of ``globals`` see ``ifilter``.
1832 will be reversed. For the meaning of ``globals`` see ``ifilter``.
1821 """
1833 """
1822 self.key = key
1834 self.key = key
1823 self.globals = globals
1835 self.globals = globals
1824 self.reverse = reverse
1836 self.reverse = reverse
1825
1837
1826 def __iter__(self):
1838 def __iter__(self):
1827 if self.key is None:
1839 if self.key is None:
1828 items = sorted(xiter(self.input), reverse=self.reverse)
1840 items = sorted(xiter(self.input), reverse=self.reverse)
1829 elif callable(self.key):
1841 elif callable(self.key):
1830 items = sorted(xiter(self.input), key=self.key, reverse=self.reverse)
1842 items = sorted(xiter(self.input), key=self.key, reverse=self.reverse)
1831 else:
1843 else:
1832 g = getglobals(self.globals)
1844 g = getglobals(self.globals)
1833 key = compile(self.key, "ipipe-expression", "eval")
1845 key = compile(self.key, "ipipe-expression", "eval")
1834 def realkey(item):
1846 def realkey(item):
1835 return eval(key, g, AttrNamespace(item))
1847 return eval(key, g, AttrNamespace(item))
1836 items = sorted(xiter(self.input), key=realkey, reverse=self.reverse)
1848 items = sorted(xiter(self.input), key=realkey, reverse=self.reverse)
1837 for item in items:
1849 for item in items:
1838 yield item
1850 yield item
1839
1851
1840 def __xrepr__(self, mode="default"):
1852 def __xrepr__(self, mode="default"):
1841 if mode == "header" or mode == "footer":
1853 if mode == "header" or mode == "footer":
1842 input = getattr(self, "input", None)
1854 input = getattr(self, "input", None)
1843 if input is not None:
1855 if input is not None:
1844 for part in xrepr(input, mode):
1856 for part in xrepr(input, mode):
1845 yield part
1857 yield part
1846 yield (astyle.style_default, " | ")
1858 yield (astyle.style_default, " | ")
1847 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1859 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1848 for part in xrepr(self.key, "default"):
1860 for part in xrepr(self.key, "default"):
1849 yield part
1861 yield part
1850 if self.reverse:
1862 if self.reverse:
1851 yield (astyle.style_default, ", ")
1863 yield (astyle.style_default, ", ")
1852 for part in xrepr(True, "default"):
1864 for part in xrepr(True, "default"):
1853 yield part
1865 yield part
1854 yield (astyle.style_default, ")")
1866 yield (astyle.style_default, ")")
1855 else:
1867 else:
1856 yield (astyle.style_default, repr(self))
1868 yield (astyle.style_default, repr(self))
1857
1869
1858 def __repr__(self):
1870 def __repr__(self):
1859 return "<%s.%s key=%r reverse=%r at 0x%x>" % \
1871 return "<%s.%s key=%r reverse=%r at 0x%x>" % \
1860 (self.__class__.__module__, self.__class__.__name__,
1872 (self.__class__.__module__, self.__class__.__name__,
1861 self.key, self.reverse, id(self))
1873 self.key, self.reverse, id(self))
1862
1874
1863
1875
1864 tab = 3 # for expandtabs()
1876 tab = 3 # for expandtabs()
1865
1877
1866 def _format(field):
1878 def _format(field):
1867 if isinstance(field, str):
1879 if isinstance(field, str):
1868 text = repr(field.expandtabs(tab))[1:-1]
1880 text = repr(field.expandtabs(tab))[1:-1]
1869 elif isinstance(field, unicode):
1881 elif isinstance(field, unicode):
1870 text = repr(field.expandtabs(tab))[2:-1]
1882 text = repr(field.expandtabs(tab))[2:-1]
1871 elif isinstance(field, datetime.datetime):
1883 elif isinstance(field, datetime.datetime):
1872 # Don't use strftime() here, as this requires year >= 1900
1884 # Don't use strftime() here, as this requires year >= 1900
1873 text = "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
1885 text = "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
1874 (field.year, field.month, field.day,
1886 (field.year, field.month, field.day,
1875 field.hour, field.minute, field.second, field.microsecond)
1887 field.hour, field.minute, field.second, field.microsecond)
1876 elif isinstance(field, datetime.date):
1888 elif isinstance(field, datetime.date):
1877 text = "%04d-%02d-%02d" % (field.year, field.month, field.day)
1889 text = "%04d-%02d-%02d" % (field.year, field.month, field.day)
1878 else:
1890 else:
1879 text = repr(field)
1891 text = repr(field)
1880 return text
1892 return text
1881
1893
1882
1894
1883 class Display(object):
1895 class Display(object):
1884 class __metaclass__(type):
1896 class __metaclass__(type):
1885 def __ror__(self, input):
1897 def __ror__(self, input):
1886 return input | self()
1898 return input | self()
1887
1899
1888 def __ror__(self, input):
1900 def __ror__(self, input):
1889 self.input = input
1901 self.input = input
1890 return self
1902 return self
1891
1903
1892 def display(self):
1904 def display(self):
1893 pass
1905 pass
1894
1906
1895
1907
1896 class iless(Display):
1908 class iless(Display):
1897 cmd = "less --quit-if-one-screen --LONG-PROMPT --LINE-NUMBERS --chop-long-lines --shift=8 --RAW-CONTROL-CHARS"
1909 cmd = "less --quit-if-one-screen --LONG-PROMPT --LINE-NUMBERS --chop-long-lines --shift=8 --RAW-CONTROL-CHARS"
1898
1910
1899 def display(self):
1911 def display(self):
1900 try:
1912 try:
1901 pager = os.popen(self.cmd, "w")
1913 pager = os.popen(self.cmd, "w")
1902 try:
1914 try:
1903 for item in xiter(self.input):
1915 for item in xiter(self.input):
1904 first = False
1916 first = False
1905 for attr in xattrs(item, "default"):
1917 for attr in xattrs(item, "default"):
1906 if first:
1918 if first:
1907 first = False
1919 first = False
1908 else:
1920 else:
1909 pager.write(" ")
1921 pager.write(" ")
1910 attr = upgradexattr(attr)
1922 attr = upgradexattr(attr)
1911 if not isinstance(attr, SelfDescriptor):
1923 if not isinstance(attr, SelfDescriptor):
1912 pager.write(attr.name())
1924 pager.write(attr.name())
1913 pager.write("=")
1925 pager.write("=")
1914 pager.write(str(attr.value(item)))
1926 pager.write(str(attr.value(item)))
1915 pager.write("\n")
1927 pager.write("\n")
1916 finally:
1928 finally:
1917 pager.close()
1929 pager.close()
1918 except Exception, exc:
1930 except Exception, exc:
1919 print "%s: %s" % (exc.__class__.__name__, str(exc))
1931 print "%s: %s" % (exc.__class__.__name__, str(exc))
1920
1932
1921
1933
1922 def xformat(value, mode, maxlength):
1934 def xformat(value, mode, maxlength):
1923 align = None
1935 align = None
1924 full = True
1936 full = True
1925 width = 0
1937 width = 0
1926 text = astyle.Text()
1938 text = astyle.Text()
1927 for (style, part) in xrepr(value, mode):
1939 for (style, part) in xrepr(value, mode):
1928 # only consider the first result
1940 # only consider the first result
1929 if align is None:
1941 if align is None:
1930 if isinstance(style, int):
1942 if isinstance(style, int):
1931 # (style, text) really is (alignment, stop)
1943 # (style, text) really is (alignment, stop)
1932 align = style
1944 align = style
1933 full = part
1945 full = part
1934 continue
1946 continue
1935 else:
1947 else:
1936 align = -1
1948 align = -1
1937 full = True
1949 full = True
1938 if not isinstance(style, int):
1950 if not isinstance(style, int):
1939 text.append((style, part))
1951 text.append((style, part))
1940 width += len(part)
1952 width += len(part)
1941 if width >= maxlength and not full:
1953 if width >= maxlength and not full:
1942 text.append((astyle.style_ellisis, "..."))
1954 text.append((astyle.style_ellisis, "..."))
1943 width += 3
1955 width += 3
1944 break
1956 break
1945 if align is None: # default to left alignment
1957 if align is None: # default to left alignment
1946 align = -1
1958 align = -1
1947 return (align, width, text)
1959 return (align, width, text)
1948
1960
1949
1961
1950 class idump(Display):
1962 class idump(Display):
1951 # The approximate maximum length of a column entry
1963 # The approximate maximum length of a column entry
1952 maxattrlength = 200
1964 maxattrlength = 200
1953
1965
1954 # Style for column names
1966 # Style for column names
1955 style_header = astyle.Style.fromstr("white:black:bold")
1967 style_header = astyle.Style.fromstr("white:black:bold")
1956
1968
1957 def __init__(self, *attrs):
1969 def __init__(self, *attrs):
1958 self.attrs = [upgradexattr(attr) for attr in attrs]
1970 self.attrs = [upgradexattr(attr) for attr in attrs]
1959 self.headerpadchar = " "
1971 self.headerpadchar = " "
1960 self.headersepchar = "|"
1972 self.headersepchar = "|"
1961 self.datapadchar = " "
1973 self.datapadchar = " "
1962 self.datasepchar = "|"
1974 self.datasepchar = "|"
1963
1975
1964 def display(self):
1976 def display(self):
1965 stream = genutils.Term.cout
1977 stream = genutils.Term.cout
1966 allattrs = []
1978 allattrs = []
1967 attrset = set()
1979 attrset = set()
1968 colwidths = {}
1980 colwidths = {}
1969 rows = []
1981 rows = []
1970 for item in xiter(self.input):
1982 for item in xiter(self.input):
1971 row = {}
1983 row = {}
1972 attrs = self.attrs
1984 attrs = self.attrs
1973 if not attrs:
1985 if not attrs:
1974 attrs = xattrs(item, "default")
1986 attrs = xattrs(item, "default")
1975 for attr in attrs:
1987 for attr in attrs:
1976 if attr not in attrset:
1988 if attr not in attrset:
1977 allattrs.append(attr)
1989 allattrs.append(attr)
1978 attrset.add(attr)
1990 attrset.add(attr)
1979 colwidths[attr] = len(attr.name())
1991 colwidths[attr] = len(attr.name())
1980 try:
1992 try:
1981 value = attr.value(item)
1993 value = attr.value(item)
1982 except (KeyboardInterrupt, SystemExit):
1994 except (KeyboardInterrupt, SystemExit):
1983 raise
1995 raise
1984 except Exception, exc:
1996 except Exception, exc:
1985 value = exc
1997 value = exc
1986 (align, width, text) = xformat(value, "cell", self.maxattrlength)
1998 (align, width, text) = xformat(value, "cell", self.maxattrlength)
1987 colwidths[attr] = max(colwidths[attr], width)
1999 colwidths[attr] = max(colwidths[attr], width)
1988 # remember alignment, length and colored parts
2000 # remember alignment, length and colored parts
1989 row[attr] = (align, width, text)
2001 row[attr] = (align, width, text)
1990 rows.append(row)
2002 rows.append(row)
1991
2003
1992 stream.write("\n")
2004 stream.write("\n")
1993 for (i, attr) in enumerate(allattrs):
2005 for (i, attr) in enumerate(allattrs):
1994 attrname = attr.name()
2006 attrname = attr.name()
1995 self.style_header(attrname).write(stream)
2007 self.style_header(attrname).write(stream)
1996 spc = colwidths[attr] - len(attrname)
2008 spc = colwidths[attr] - len(attrname)
1997 if i < len(colwidths)-1:
2009 if i < len(colwidths)-1:
1998 stream.write(self.headerpadchar*spc)
2010 stream.write(self.headerpadchar*spc)
1999 stream.write(self.headersepchar)
2011 stream.write(self.headersepchar)
2000 stream.write("\n")
2012 stream.write("\n")
2001
2013
2002 for row in rows:
2014 for row in rows:
2003 for (i, attr) in enumerate(allattrs):
2015 for (i, attr) in enumerate(allattrs):
2004 (align, width, text) = row[attr]
2016 (align, width, text) = row[attr]
2005 spc = colwidths[attr] - width
2017 spc = colwidths[attr] - width
2006 if align == -1:
2018 if align == -1:
2007 text.write(stream)
2019 text.write(stream)
2008 if i < len(colwidths)-1:
2020 if i < len(colwidths)-1:
2009 stream.write(self.datapadchar*spc)
2021 stream.write(self.datapadchar*spc)
2010 elif align == 0:
2022 elif align == 0:
2011 spc = colwidths[attr] - width
2023 spc = colwidths[attr] - width
2012 spc1 = spc//2
2024 spc1 = spc//2
2013 spc2 = spc-spc1
2025 spc2 = spc-spc1
2014 stream.write(self.datapadchar*spc1)
2026 stream.write(self.datapadchar*spc1)
2015 text.write(stream)
2027 text.write(stream)
2016 if i < len(colwidths)-1:
2028 if i < len(colwidths)-1:
2017 stream.write(self.datapadchar*spc2)
2029 stream.write(self.datapadchar*spc2)
2018 else:
2030 else:
2019 stream.write(self.datapadchar*spc)
2031 stream.write(self.datapadchar*spc)
2020 text.write(stream)
2032 text.write(stream)
2021 if i < len(colwidths)-1:
2033 if i < len(colwidths)-1:
2022 stream.write(self.datasepchar)
2034 stream.write(self.datasepchar)
2023 stream.write("\n")
2035 stream.write("\n")
2024
2036
2025
2037
2026 class AttributeDetail(Table):
2038 class AttributeDetail(Table):
2027 """
2039 """
2028 ``AttributeDetail`` objects are use for displaying a detailed list of object
2040 ``AttributeDetail`` objects are use for displaying a detailed list of object
2029 attributes.
2041 attributes.
2030 """
2042 """
2031 def __init__(self, object, descriptor):
2043 def __init__(self, object, descriptor):
2032 self.object = object
2044 self.object = object
2033 self.descriptor = descriptor
2045 self.descriptor = descriptor
2034
2046
2035 def __iter__(self):
2047 def __iter__(self):
2036 return self.descriptor.iter(self.object)
2048 return self.descriptor.iter(self.object)
2037
2049
2038 def name(self):
2050 def name(self):
2039 return self.descriptor.name()
2051 return self.descriptor.name()
2040
2052
2041 def attrtype(self):
2053 def attrtype(self):
2042 return self.descriptor.attrtype(self.object)
2054 return self.descriptor.attrtype(self.object)
2043
2055
2044 def valuetype(self):
2056 def valuetype(self):
2045 return self.descriptor.valuetype(self.object)
2057 return self.descriptor.valuetype(self.object)
2046
2058
2047 def doc(self):
2059 def doc(self):
2048 return self.descriptor.doc(self.object)
2060 return self.descriptor.doc(self.object)
2049
2061
2050 def shortdoc(self):
2062 def shortdoc(self):
2051 return self.descriptor.shortdoc(self.object)
2063 return self.descriptor.shortdoc(self.object)
2052
2064
2053 def value(self):
2065 def value(self):
2054 return self.descriptor.value(self.object)
2066 return self.descriptor.value(self.object)
2055
2067
2056 def __xattrs__(self, mode="default"):
2068 def __xattrs__(self, mode="default"):
2057 attrs = ("name()", "attrtype()", "valuetype()", "value()", "shortdoc()")
2069 attrs = ("name()", "attrtype()", "valuetype()", "value()", "shortdoc()")
2058 if mode == "detail":
2070 if mode == "detail":
2059 attrs += ("doc()",)
2071 attrs += ("doc()",)
2060 return attrs
2072 return attrs
2061
2073
2062 def __xrepr__(self, mode="default"):
2074 def __xrepr__(self, mode="default"):
2063 yield (-1, True)
2075 yield (-1, True)
2064 valuetype = self.valuetype()
2076 valuetype = self.valuetype()
2065 if valuetype is not noitem:
2077 if valuetype is not noitem:
2066 for part in xrepr(valuetype):
2078 for part in xrepr(valuetype):
2067 yield part
2079 yield part
2068 yield (astyle.style_default, " ")
2080 yield (astyle.style_default, " ")
2069 yield (astyle.style_default, self.attrtype())
2081 yield (astyle.style_default, self.attrtype())
2070 yield (astyle.style_default, " ")
2082 yield (astyle.style_default, " ")
2071 yield (astyle.style_default, self.name())
2083 yield (astyle.style_default, self.name())
2072 yield (astyle.style_default, " of ")
2084 yield (astyle.style_default, " of ")
2073 for part in xrepr(self.object):
2085 for part in xrepr(self.object):
2074 yield part
2086 yield part
2075
2087
2076
2088
2077 try:
2089 try:
2078 from ibrowse import ibrowse
2090 from ibrowse import ibrowse
2079 except ImportError:
2091 except ImportError:
2080 # No curses (probably Windows) => use ``idump`` as the default display.
2092 # No curses (probably Windows) => use ``idump`` as the default display.
2081 defaultdisplay = idump
2093 defaultdisplay = idump
2082 else:
2094 else:
2083 defaultdisplay = ibrowse
2095 defaultdisplay = ibrowse
2084 __all__.append("ibrowse")
2096 __all__.append("ibrowse")
2085
2097
2086
2098
2087 # If we're running under IPython, install an IPython displayhook that
2099 # If we're running under IPython, install an IPython displayhook that
2088 # returns the object from Display.display(), else install a displayhook
2100 # returns the object from Display.display(), else install a displayhook
2089 # directly as sys.displayhook
2101 # directly as sys.displayhook
2090 api = None
2102 api = None
2091 if ipapi is not None:
2103 if ipapi is not None:
2092 try:
2104 try:
2093 api = ipapi.get()
2105 api = ipapi.get()
2094 except AttributeError:
2106 except AttributeError:
2095 pass
2107 pass
2096
2108
2097 if api is not None:
2109 if api is not None:
2098 def displayhook(self, obj):
2110 def displayhook(self, obj):
2099 if isinstance(obj, type) and issubclass(obj, Table):
2111 if isinstance(obj, type) and issubclass(obj, Table):
2100 obj = obj()
2112 obj = obj()
2101 if isinstance(obj, Table):
2113 if isinstance(obj, Table):
2102 obj = obj | defaultdisplay
2114 obj = obj | defaultdisplay
2103 if isinstance(obj, Display):
2115 if isinstance(obj, Display):
2104 return obj.display()
2116 return obj.display()
2105 else:
2117 else:
2106 raise ipapi.TryNext
2118 raise ipapi.TryNext
2107 api.set_hook("result_display", displayhook)
2119 api.set_hook("result_display", displayhook)
2108 else:
2120 else:
2109 def installdisplayhook():
2121 def installdisplayhook():
2110 _originalhook = sys.displayhook
2122 _originalhook = sys.displayhook
2111 def displayhook(obj):
2123 def displayhook(obj):
2112 if isinstance(obj, type) and issubclass(obj, Table):
2124 if isinstance(obj, type) and issubclass(obj, Table):
2113 obj = obj()
2125 obj = obj()
2114 if isinstance(obj, Table):
2126 if isinstance(obj, Table):
2115 obj = obj | defaultdisplay
2127 obj = obj | defaultdisplay
2116 if isinstance(obj, Display):
2128 if isinstance(obj, Display):
2117 return obj.display()
2129 return obj.display()
2118 else:
2130 else:
2119 _originalhook(obj)
2131 _originalhook(obj)
2120 sys.displayhook = displayhook
2132 sys.displayhook = displayhook
2121 installdisplayhook()
2133 installdisplayhook()
@@ -1,6042 +1,6043
1 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1 2006-11-30 Walter Doerwald <walter@livinglogic.de>
2 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
2 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
3 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
3 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
4 "refreshfind" (mapped to "R") does the same but tries to go back to the same
4 "refreshfind" (mapped to "R") does the same but tries to go back to the same
5 object the cursor was on before the refresh. The command "markrange" is
5 object the cursor was on before the refresh. The command "markrange" is
6 mapped to "%" now.
6 mapped to "%" now.
7 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
7
8
8 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
9 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
9
10
10 * IPython/Magic.py (magic_debug): new %debug magic to activate the
11 * IPython/Magic.py (magic_debug): new %debug magic to activate the
11 interactive debugger on the last traceback, without having to call
12 interactive debugger on the last traceback, without having to call
12 %pdb and rerun your code. Made minor changes in various modules,
13 %pdb and rerun your code. Made minor changes in various modules,
13 should automatically recognize pydb if available.
14 should automatically recognize pydb if available.
14
15
15 2006-11-28 Ville Vainio <vivainio@gmail.com>
16 2006-11-28 Ville Vainio <vivainio@gmail.com>
16
17
17 * completer.py: If the text start with !, show file completions
18 * completer.py: If the text start with !, show file completions
18 properly. This helps when trying to complete command name
19 properly. This helps when trying to complete command name
19 for shell escapes.
20 for shell escapes.
20
21
21 2006-11-27 Ville Vainio <vivainio@gmail.com>
22 2006-11-27 Ville Vainio <vivainio@gmail.com>
22
23
23 * ipy_stock_completers.py: bzr completer submitted by Stefan van
24 * ipy_stock_completers.py: bzr completer submitted by Stefan van
24 der Walt. Clean up svn and hg completers by using a common
25 der Walt. Clean up svn and hg completers by using a common
25 vcs_completer.
26 vcs_completer.
26
27
27 2006-11-26 Ville Vainio <vivainio@gmail.com>
28 2006-11-26 Ville Vainio <vivainio@gmail.com>
28
29
29 * Remove ipconfig and %config; you should use _ip.options structure
30 * Remove ipconfig and %config; you should use _ip.options structure
30 directly instead!
31 directly instead!
31
32
32 * genutils.py: add wrap_deprecated function for deprecating callables
33 * genutils.py: add wrap_deprecated function for deprecating callables
33
34
34 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
35 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
35 _ip.system instead. ipalias is redundant.
36 _ip.system instead. ipalias is redundant.
36
37
37 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
38 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
38 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
39 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
39 explicit.
40 explicit.
40
41
41 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
42 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
42 completer. Try it by entering 'hg ' and pressing tab.
43 completer. Try it by entering 'hg ' and pressing tab.
43
44
44 * macro.py: Give Macro a useful __repr__ method
45 * macro.py: Give Macro a useful __repr__ method
45
46
46 * Magic.py: %whos abbreviates the typename of Macro for brevity.
47 * Magic.py: %whos abbreviates the typename of Macro for brevity.
47
48
48 2006-11-24 Walter Doerwald <walter@livinglogic.de>
49 2006-11-24 Walter Doerwald <walter@livinglogic.de>
49 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
50 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
50 we don't get a duplicate ipipe module, where registration of the xrepr
51 we don't get a duplicate ipipe module, where registration of the xrepr
51 implementation for Text is useless.
52 implementation for Text is useless.
52
53
53 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
54 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
54
55
55 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
56 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
56
57
57 2006-11-24 Ville Vainio <vivainio@gmail.com>
58 2006-11-24 Ville Vainio <vivainio@gmail.com>
58
59
59 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
60 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
60 try to use "cProfile" instead of the slower pure python
61 try to use "cProfile" instead of the slower pure python
61 "profile"
62 "profile"
62
63
63 2006-11-23 Ville Vainio <vivainio@gmail.com>
64 2006-11-23 Ville Vainio <vivainio@gmail.com>
64
65
65 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
66 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
66 Qt+IPython+Designer link in documentation.
67 Qt+IPython+Designer link in documentation.
67
68
68 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
69 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
69 correct Pdb object to %pydb.
70 correct Pdb object to %pydb.
70
71
71
72
72 2006-11-22 Walter Doerwald <walter@livinglogic.de>
73 2006-11-22 Walter Doerwald <walter@livinglogic.de>
73 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
74 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
74 generic xrepr(), otherwise the list implementation would kick in.
75 generic xrepr(), otherwise the list implementation would kick in.
75
76
76 2006-11-21 Ville Vainio <vivainio@gmail.com>
77 2006-11-21 Ville Vainio <vivainio@gmail.com>
77
78
78 * upgrade_dir.py: Now actually overwrites a nonmodified user file
79 * upgrade_dir.py: Now actually overwrites a nonmodified user file
79 with one from UserConfig.
80 with one from UserConfig.
80
81
81 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
82 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
82 it was missing which broke the sh profile.
83 it was missing which broke the sh profile.
83
84
84 * completer.py: file completer now uses explicit '/' instead
85 * completer.py: file completer now uses explicit '/' instead
85 of os.path.join, expansion of 'foo' was broken on win32
86 of os.path.join, expansion of 'foo' was broken on win32
86 if there was one directory with name 'foobar'.
87 if there was one directory with name 'foobar'.
87
88
88 * A bunch of patches from Kirill Smelkov:
89 * A bunch of patches from Kirill Smelkov:
89
90
90 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
91 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
91
92
92 * [patch 7/9] Implement %page -r (page in raw mode) -
93 * [patch 7/9] Implement %page -r (page in raw mode) -
93
94
94 * [patch 5/9] ScientificPython webpage has moved
95 * [patch 5/9] ScientificPython webpage has moved
95
96
96 * [patch 4/9] The manual mentions %ds, should be %dhist
97 * [patch 4/9] The manual mentions %ds, should be %dhist
97
98
98 * [patch 3/9] Kill old bits from %prun doc.
99 * [patch 3/9] Kill old bits from %prun doc.
99
100
100 * [patch 1/9] Fix typos here and there.
101 * [patch 1/9] Fix typos here and there.
101
102
102 2006-11-08 Ville Vainio <vivainio@gmail.com>
103 2006-11-08 Ville Vainio <vivainio@gmail.com>
103
104
104 * completer.py (attr_matches): catch all exceptions raised
105 * completer.py (attr_matches): catch all exceptions raised
105 by eval of expr with dots.
106 by eval of expr with dots.
106
107
107 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
108 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
108
109
109 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
110 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
110 input if it starts with whitespace. This allows you to paste
111 input if it starts with whitespace. This allows you to paste
111 indented input from any editor without manually having to type in
112 indented input from any editor without manually having to type in
112 the 'if 1:', which is convenient when working interactively.
113 the 'if 1:', which is convenient when working interactively.
113 Slightly modifed version of a patch by Bo Peng
114 Slightly modifed version of a patch by Bo Peng
114 <bpeng-AT-rice.edu>.
115 <bpeng-AT-rice.edu>.
115
116
116 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
117 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
117
118
118 * IPython/irunner.py (main): modified irunner so it automatically
119 * IPython/irunner.py (main): modified irunner so it automatically
119 recognizes the right runner to use based on the extension (.py for
120 recognizes the right runner to use based on the extension (.py for
120 python, .ipy for ipython and .sage for sage).
121 python, .ipy for ipython and .sage for sage).
121
122
122 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
123 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
123 visible in ipapi as ip.config(), to programatically control the
124 visible in ipapi as ip.config(), to programatically control the
124 internal rc object. There's an accompanying %config magic for
125 internal rc object. There's an accompanying %config magic for
125 interactive use, which has been enhanced to match the
126 interactive use, which has been enhanced to match the
126 funtionality in ipconfig.
127 funtionality in ipconfig.
127
128
128 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
129 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
129 so it's not just a toggle, it now takes an argument. Add support
130 so it's not just a toggle, it now takes an argument. Add support
130 for a customizable header when making system calls, as the new
131 for a customizable header when making system calls, as the new
131 system_header variable in the ipythonrc file.
132 system_header variable in the ipythonrc file.
132
133
133 2006-11-03 Walter Doerwald <walter@livinglogic.de>
134 2006-11-03 Walter Doerwald <walter@livinglogic.de>
134
135
135 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
136 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
136 generic functions (using Philip J. Eby's simplegeneric package).
137 generic functions (using Philip J. Eby's simplegeneric package).
137 This makes it possible to customize the display of third-party classes
138 This makes it possible to customize the display of third-party classes
138 without having to monkeypatch them. xiter() no longer supports a mode
139 without having to monkeypatch them. xiter() no longer supports a mode
139 argument and the XMode class has been removed. The same functionality can
140 argument and the XMode class has been removed. The same functionality can
140 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
141 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
141 One consequence of the switch to generic functions is that xrepr() and
142 One consequence of the switch to generic functions is that xrepr() and
142 xattrs() implementation must define the default value for the mode
143 xattrs() implementation must define the default value for the mode
143 argument themselves and xattrs() implementations must return real
144 argument themselves and xattrs() implementations must return real
144 descriptors.
145 descriptors.
145
146
146 * IPython/external: This new subpackage will contain all third-party
147 * IPython/external: This new subpackage will contain all third-party
147 packages that are bundled with IPython. (The first one is simplegeneric).
148 packages that are bundled with IPython. (The first one is simplegeneric).
148
149
149 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
150 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
150 directory which as been dropped in r1703.
151 directory which as been dropped in r1703.
151
152
152 * IPython/Extensions/ipipe.py (iless): Fixed.
153 * IPython/Extensions/ipipe.py (iless): Fixed.
153
154
154 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
155 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
155
156
156 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
157 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
157
158
158 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
159 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
159 handling in variable expansion so that shells and magics recognize
160 handling in variable expansion so that shells and magics recognize
160 function local scopes correctly. Bug reported by Brian.
161 function local scopes correctly. Bug reported by Brian.
161
162
162 * scripts/ipython: remove the very first entry in sys.path which
163 * scripts/ipython: remove the very first entry in sys.path which
163 Python auto-inserts for scripts, so that sys.path under IPython is
164 Python auto-inserts for scripts, so that sys.path under IPython is
164 as similar as possible to that under plain Python.
165 as similar as possible to that under plain Python.
165
166
166 * IPython/completer.py (IPCompleter.file_matches): Fix
167 * IPython/completer.py (IPCompleter.file_matches): Fix
167 tab-completion so that quotes are not closed unless the completion
168 tab-completion so that quotes are not closed unless the completion
168 is unambiguous. After a request by Stefan. Minor cleanups in
169 is unambiguous. After a request by Stefan. Minor cleanups in
169 ipy_stock_completers.
170 ipy_stock_completers.
170
171
171 2006-11-02 Ville Vainio <vivainio@gmail.com>
172 2006-11-02 Ville Vainio <vivainio@gmail.com>
172
173
173 * ipy_stock_completers.py: Add %run and %cd completers.
174 * ipy_stock_completers.py: Add %run and %cd completers.
174
175
175 * completer.py: Try running custom completer for both
176 * completer.py: Try running custom completer for both
176 "foo" and "%foo" if the command is just "foo". Ignore case
177 "foo" and "%foo" if the command is just "foo". Ignore case
177 when filtering possible completions.
178 when filtering possible completions.
178
179
179 * UserConfig/ipy_user_conf.py: install stock completers as default
180 * UserConfig/ipy_user_conf.py: install stock completers as default
180
181
181 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
182 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
182 simplified readline history save / restore through a wrapper
183 simplified readline history save / restore through a wrapper
183 function
184 function
184
185
185
186
186 2006-10-31 Ville Vainio <vivainio@gmail.com>
187 2006-10-31 Ville Vainio <vivainio@gmail.com>
187
188
188 * strdispatch.py, completer.py, ipy_stock_completers.py:
189 * strdispatch.py, completer.py, ipy_stock_completers.py:
189 Allow str_key ("command") in completer hooks. Implement
190 Allow str_key ("command") in completer hooks. Implement
190 trivial completer for 'import' (stdlib modules only). Rename
191 trivial completer for 'import' (stdlib modules only). Rename
191 ipy_linux_package_managers.py to ipy_stock_completers.py.
192 ipy_linux_package_managers.py to ipy_stock_completers.py.
192 SVN completer.
193 SVN completer.
193
194
194 * Extensions/ledit.py: %magic line editor for easily and
195 * Extensions/ledit.py: %magic line editor for easily and
195 incrementally manipulating lists of strings. The magic command
196 incrementally manipulating lists of strings. The magic command
196 name is %led.
197 name is %led.
197
198
198 2006-10-30 Ville Vainio <vivainio@gmail.com>
199 2006-10-30 Ville Vainio <vivainio@gmail.com>
199
200
200 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
201 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
201 Bernsteins's patches for pydb integration.
202 Bernsteins's patches for pydb integration.
202 http://bashdb.sourceforge.net/pydb/
203 http://bashdb.sourceforge.net/pydb/
203
204
204 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
205 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
205 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
206 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
206 custom completer hook to allow the users to implement their own
207 custom completer hook to allow the users to implement their own
207 completers. See ipy_linux_package_managers.py for example. The
208 completers. See ipy_linux_package_managers.py for example. The
208 hook name is 'complete_command'.
209 hook name is 'complete_command'.
209
210
210 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
211 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
211
212
212 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
213 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
213 Numeric leftovers.
214 Numeric leftovers.
214
215
215 * ipython.el (py-execute-region): apply Stefan's patch to fix
216 * ipython.el (py-execute-region): apply Stefan's patch to fix
216 garbled results if the python shell hasn't been previously started.
217 garbled results if the python shell hasn't been previously started.
217
218
218 * IPython/genutils.py (arg_split): moved to genutils, since it's a
219 * IPython/genutils.py (arg_split): moved to genutils, since it's a
219 pretty generic function and useful for other things.
220 pretty generic function and useful for other things.
220
221
221 * IPython/OInspect.py (getsource): Add customizable source
222 * IPython/OInspect.py (getsource): Add customizable source
222 extractor. After a request/patch form W. Stein (SAGE).
223 extractor. After a request/patch form W. Stein (SAGE).
223
224
224 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
225 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
225 window size to a more reasonable value from what pexpect does,
226 window size to a more reasonable value from what pexpect does,
226 since their choice causes wrapping bugs with long input lines.
227 since their choice causes wrapping bugs with long input lines.
227
228
228 2006-10-28 Ville Vainio <vivainio@gmail.com>
229 2006-10-28 Ville Vainio <vivainio@gmail.com>
229
230
230 * Magic.py (%run): Save and restore the readline history from
231 * Magic.py (%run): Save and restore the readline history from
231 file around %run commands to prevent side effects from
232 file around %run commands to prevent side effects from
232 %runned programs that might use readline (e.g. pydb).
233 %runned programs that might use readline (e.g. pydb).
233
234
234 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
235 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
235 invoking the pydb enhanced debugger.
236 invoking the pydb enhanced debugger.
236
237
237 2006-10-23 Walter Doerwald <walter@livinglogic.de>
238 2006-10-23 Walter Doerwald <walter@livinglogic.de>
238
239
239 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
240 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
240 call the base class method and propagate the return value to
241 call the base class method and propagate the return value to
241 ifile. This is now done by path itself.
242 ifile. This is now done by path itself.
242
243
243 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
244 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
244
245
245 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
246 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
246 api: set_crash_handler(), to expose the ability to change the
247 api: set_crash_handler(), to expose the ability to change the
247 internal crash handler.
248 internal crash handler.
248
249
249 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
250 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
250 the various parameters of the crash handler so that apps using
251 the various parameters of the crash handler so that apps using
251 IPython as their engine can customize crash handling. Ipmlemented
252 IPython as their engine can customize crash handling. Ipmlemented
252 at the request of SAGE.
253 at the request of SAGE.
253
254
254 2006-10-14 Ville Vainio <vivainio@gmail.com>
255 2006-10-14 Ville Vainio <vivainio@gmail.com>
255
256
256 * Magic.py, ipython.el: applied first "safe" part of Rocky
257 * Magic.py, ipython.el: applied first "safe" part of Rocky
257 Bernstein's patch set for pydb integration.
258 Bernstein's patch set for pydb integration.
258
259
259 * Magic.py (%unalias, %alias): %store'd aliases can now be
260 * Magic.py (%unalias, %alias): %store'd aliases can now be
260 removed with '%unalias'. %alias w/o args now shows most
261 removed with '%unalias'. %alias w/o args now shows most
261 interesting (stored / manually defined) aliases last
262 interesting (stored / manually defined) aliases last
262 where they catch the eye w/o scrolling.
263 where they catch the eye w/o scrolling.
263
264
264 * Magic.py (%rehashx), ext_rehashdir.py: files with
265 * Magic.py (%rehashx), ext_rehashdir.py: files with
265 'py' extension are always considered executable, even
266 'py' extension are always considered executable, even
266 when not in PATHEXT environment variable.
267 when not in PATHEXT environment variable.
267
268
268 2006-10-12 Ville Vainio <vivainio@gmail.com>
269 2006-10-12 Ville Vainio <vivainio@gmail.com>
269
270
270 * jobctrl.py: Add new "jobctrl" extension for spawning background
271 * jobctrl.py: Add new "jobctrl" extension for spawning background
271 processes with "&find /". 'import jobctrl' to try it out. Requires
272 processes with "&find /". 'import jobctrl' to try it out. Requires
272 'subprocess' module, standard in python 2.4+.
273 'subprocess' module, standard in python 2.4+.
273
274
274 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
275 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
275 so if foo -> bar and bar -> baz, then foo -> baz.
276 so if foo -> bar and bar -> baz, then foo -> baz.
276
277
277 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
278 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
278
279
279 * IPython/Magic.py (Magic.parse_options): add a new posix option
280 * IPython/Magic.py (Magic.parse_options): add a new posix option
280 to allow parsing of input args in magics that doesn't strip quotes
281 to allow parsing of input args in magics that doesn't strip quotes
281 (if posix=False). This also closes %timeit bug reported by
282 (if posix=False). This also closes %timeit bug reported by
282 Stefan.
283 Stefan.
283
284
284 2006-10-03 Ville Vainio <vivainio@gmail.com>
285 2006-10-03 Ville Vainio <vivainio@gmail.com>
285
286
286 * iplib.py (raw_input, interact): Return ValueError catching for
287 * iplib.py (raw_input, interact): Return ValueError catching for
287 raw_input. Fixes infinite loop for sys.stdin.close() or
288 raw_input. Fixes infinite loop for sys.stdin.close() or
288 sys.stdout.close().
289 sys.stdout.close().
289
290
290 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
291 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
291
292
292 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
293 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
293 to help in handling doctests. irunner is now pretty useful for
294 to help in handling doctests. irunner is now pretty useful for
294 running standalone scripts and simulate a full interactive session
295 running standalone scripts and simulate a full interactive session
295 in a format that can be then pasted as a doctest.
296 in a format that can be then pasted as a doctest.
296
297
297 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
298 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
298 on top of the default (useless) ones. This also fixes the nasty
299 on top of the default (useless) ones. This also fixes the nasty
299 way in which 2.5's Quitter() exits (reverted [1785]).
300 way in which 2.5's Quitter() exits (reverted [1785]).
300
301
301 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
302 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
302 2.5.
303 2.5.
303
304
304 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
305 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
305 color scheme is updated as well when color scheme is changed
306 color scheme is updated as well when color scheme is changed
306 interactively.
307 interactively.
307
308
308 2006-09-27 Ville Vainio <vivainio@gmail.com>
309 2006-09-27 Ville Vainio <vivainio@gmail.com>
309
310
310 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
311 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
311 infinite loop and just exit. It's a hack, but will do for a while.
312 infinite loop and just exit. It's a hack, but will do for a while.
312
313
313 2006-08-25 Walter Doerwald <walter@livinglogic.de>
314 2006-08-25 Walter Doerwald <walter@livinglogic.de>
314
315
315 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
316 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
316 the constructor, this makes it possible to get a list of only directories
317 the constructor, this makes it possible to get a list of only directories
317 or only files.
318 or only files.
318
319
319 2006-08-12 Ville Vainio <vivainio@gmail.com>
320 2006-08-12 Ville Vainio <vivainio@gmail.com>
320
321
321 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
322 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
322 they broke unittest
323 they broke unittest
323
324
324 2006-08-11 Ville Vainio <vivainio@gmail.com>
325 2006-08-11 Ville Vainio <vivainio@gmail.com>
325
326
326 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
327 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
327 by resolving issue properly, i.e. by inheriting FakeModule
328 by resolving issue properly, i.e. by inheriting FakeModule
328 from types.ModuleType. Pickling ipython interactive data
329 from types.ModuleType. Pickling ipython interactive data
329 should still work as usual (testing appreciated).
330 should still work as usual (testing appreciated).
330
331
331 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
332 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
332
333
333 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
334 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
334 running under python 2.3 with code from 2.4 to fix a bug with
335 running under python 2.3 with code from 2.4 to fix a bug with
335 help(). Reported by the Debian maintainers, Norbert Tretkowski
336 help(). Reported by the Debian maintainers, Norbert Tretkowski
336 <norbert-AT-tretkowski.de> and Alexandre Fayolle
337 <norbert-AT-tretkowski.de> and Alexandre Fayolle
337 <afayolle-AT-debian.org>.
338 <afayolle-AT-debian.org>.
338
339
339 2006-08-04 Walter Doerwald <walter@livinglogic.de>
340 2006-08-04 Walter Doerwald <walter@livinglogic.de>
340
341
341 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
342 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
342 (which was displaying "quit" twice).
343 (which was displaying "quit" twice).
343
344
344 2006-07-28 Walter Doerwald <walter@livinglogic.de>
345 2006-07-28 Walter Doerwald <walter@livinglogic.de>
345
346
346 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
347 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
347 the mode argument).
348 the mode argument).
348
349
349 2006-07-27 Walter Doerwald <walter@livinglogic.de>
350 2006-07-27 Walter Doerwald <walter@livinglogic.de>
350
351
351 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
352 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
352 not running under IPython.
353 not running under IPython.
353
354
354 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
355 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
355 and make it iterable (iterating over the attribute itself). Add two new
356 and make it iterable (iterating over the attribute itself). Add two new
356 magic strings for __xattrs__(): If the string starts with "-", the attribute
357 magic strings for __xattrs__(): If the string starts with "-", the attribute
357 will not be displayed in ibrowse's detail view (but it can still be
358 will not be displayed in ibrowse's detail view (but it can still be
358 iterated over). This makes it possible to add attributes that are large
359 iterated over). This makes it possible to add attributes that are large
359 lists or generator methods to the detail view. Replace magic attribute names
360 lists or generator methods to the detail view. Replace magic attribute names
360 and _attrname() and _getattr() with "descriptors": For each type of magic
361 and _attrname() and _getattr() with "descriptors": For each type of magic
361 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
362 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
362 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
363 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
363 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
364 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
364 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
365 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
365 are still supported.
366 are still supported.
366
367
367 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
368 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
368 fails in ibrowse.fetch(), the exception object is added as the last item
369 fails in ibrowse.fetch(), the exception object is added as the last item
369 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
370 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
370 a generator throws an exception midway through execution.
371 a generator throws an exception midway through execution.
371
372
372 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
373 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
373 encoding into methods.
374 encoding into methods.
374
375
375 2006-07-26 Ville Vainio <vivainio@gmail.com>
376 2006-07-26 Ville Vainio <vivainio@gmail.com>
376
377
377 * iplib.py: history now stores multiline input as single
378 * iplib.py: history now stores multiline input as single
378 history entries. Patch by Jorgen Cederlof.
379 history entries. Patch by Jorgen Cederlof.
379
380
380 2006-07-18 Walter Doerwald <walter@livinglogic.de>
381 2006-07-18 Walter Doerwald <walter@livinglogic.de>
381
382
382 * IPython/Extensions/ibrowse.py: Make cursor visible over
383 * IPython/Extensions/ibrowse.py: Make cursor visible over
383 non existing attributes.
384 non existing attributes.
384
385
385 2006-07-14 Walter Doerwald <walter@livinglogic.de>
386 2006-07-14 Walter Doerwald <walter@livinglogic.de>
386
387
387 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
388 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
388 error output of the running command doesn't mess up the screen.
389 error output of the running command doesn't mess up the screen.
389
390
390 2006-07-13 Walter Doerwald <walter@livinglogic.de>
391 2006-07-13 Walter Doerwald <walter@livinglogic.de>
391
392
392 * IPython/Extensions/ipipe.py (isort): Make isort usable without
393 * IPython/Extensions/ipipe.py (isort): Make isort usable without
393 argument. This sorts the items themselves.
394 argument. This sorts the items themselves.
394
395
395 2006-07-12 Walter Doerwald <walter@livinglogic.de>
396 2006-07-12 Walter Doerwald <walter@livinglogic.de>
396
397
397 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
398 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
398 Compile expression strings into code objects. This should speed
399 Compile expression strings into code objects. This should speed
399 up ifilter and friends somewhat.
400 up ifilter and friends somewhat.
400
401
401 2006-07-08 Ville Vainio <vivainio@gmail.com>
402 2006-07-08 Ville Vainio <vivainio@gmail.com>
402
403
403 * Magic.py: %cpaste now strips > from the beginning of lines
404 * Magic.py: %cpaste now strips > from the beginning of lines
404 to ease pasting quoted code from emails. Contributed by
405 to ease pasting quoted code from emails. Contributed by
405 Stefan van der Walt.
406 Stefan van der Walt.
406
407
407 2006-06-29 Ville Vainio <vivainio@gmail.com>
408 2006-06-29 Ville Vainio <vivainio@gmail.com>
408
409
409 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
410 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
410 mode, patch contributed by Darren Dale. NEEDS TESTING!
411 mode, patch contributed by Darren Dale. NEEDS TESTING!
411
412
412 2006-06-28 Walter Doerwald <walter@livinglogic.de>
413 2006-06-28 Walter Doerwald <walter@livinglogic.de>
413
414
414 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
415 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
415 a blue background. Fix fetching new display rows when the browser
416 a blue background. Fix fetching new display rows when the browser
416 scrolls more than a screenful (e.g. by using the goto command).
417 scrolls more than a screenful (e.g. by using the goto command).
417
418
418 2006-06-27 Ville Vainio <vivainio@gmail.com>
419 2006-06-27 Ville Vainio <vivainio@gmail.com>
419
420
420 * Magic.py (_inspect, _ofind) Apply David Huard's
421 * Magic.py (_inspect, _ofind) Apply David Huard's
421 patch for displaying the correct docstring for 'property'
422 patch for displaying the correct docstring for 'property'
422 attributes.
423 attributes.
423
424
424 2006-06-23 Walter Doerwald <walter@livinglogic.de>
425 2006-06-23 Walter Doerwald <walter@livinglogic.de>
425
426
426 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
427 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
427 commands into the methods implementing them.
428 commands into the methods implementing them.
428
429
429 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
430 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
430
431
431 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
432 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
432 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
433 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
433 autoindent support was authored by Jin Liu.
434 autoindent support was authored by Jin Liu.
434
435
435 2006-06-22 Walter Doerwald <walter@livinglogic.de>
436 2006-06-22 Walter Doerwald <walter@livinglogic.de>
436
437
437 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
438 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
438 for keymaps with a custom class that simplifies handling.
439 for keymaps with a custom class that simplifies handling.
439
440
440 2006-06-19 Walter Doerwald <walter@livinglogic.de>
441 2006-06-19 Walter Doerwald <walter@livinglogic.de>
441
442
442 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
443 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
443 resizing. This requires Python 2.5 to work.
444 resizing. This requires Python 2.5 to work.
444
445
445 2006-06-16 Walter Doerwald <walter@livinglogic.de>
446 2006-06-16 Walter Doerwald <walter@livinglogic.de>
446
447
447 * IPython/Extensions/ibrowse.py: Add two new commands to
448 * IPython/Extensions/ibrowse.py: Add two new commands to
448 ibrowse: "hideattr" (mapped to "h") hides the attribute under
449 ibrowse: "hideattr" (mapped to "h") hides the attribute under
449 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
450 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
450 attributes again. Remapped the help command to "?". Display
451 attributes again. Remapped the help command to "?". Display
451 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
452 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
452 as keys for the "home" and "end" commands. Add three new commands
453 as keys for the "home" and "end" commands. Add three new commands
453 to the input mode for "find" and friends: "delend" (CTRL-K)
454 to the input mode for "find" and friends: "delend" (CTRL-K)
454 deletes to the end of line. "incsearchup" searches upwards in the
455 deletes to the end of line. "incsearchup" searches upwards in the
455 command history for an input that starts with the text before the cursor.
456 command history for an input that starts with the text before the cursor.
456 "incsearchdown" does the same downwards. Removed a bogus mapping of
457 "incsearchdown" does the same downwards. Removed a bogus mapping of
457 the x key to "delete".
458 the x key to "delete".
458
459
459 2006-06-15 Ville Vainio <vivainio@gmail.com>
460 2006-06-15 Ville Vainio <vivainio@gmail.com>
460
461
461 * iplib.py, hooks.py: Added new generate_prompt hook that can be
462 * iplib.py, hooks.py: Added new generate_prompt hook that can be
462 used to create prompts dynamically, instead of the "old" way of
463 used to create prompts dynamically, instead of the "old" way of
463 assigning "magic" strings to prompt_in1 and prompt_in2. The old
464 assigning "magic" strings to prompt_in1 and prompt_in2. The old
464 way still works (it's invoked by the default hook), of course.
465 way still works (it's invoked by the default hook), of course.
465
466
466 * Prompts.py: added generate_output_prompt hook for altering output
467 * Prompts.py: added generate_output_prompt hook for altering output
467 prompt
468 prompt
468
469
469 * Release.py: Changed version string to 0.7.3.svn.
470 * Release.py: Changed version string to 0.7.3.svn.
470
471
471 2006-06-15 Walter Doerwald <walter@livinglogic.de>
472 2006-06-15 Walter Doerwald <walter@livinglogic.de>
472
473
473 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
474 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
474 the call to fetch() always tries to fetch enough data for at least one
475 the call to fetch() always tries to fetch enough data for at least one
475 full screen. This makes it possible to simply call moveto(0,0,True) in
476 full screen. This makes it possible to simply call moveto(0,0,True) in
476 the constructor. Fix typos and removed the obsolete goto attribute.
477 the constructor. Fix typos and removed the obsolete goto attribute.
477
478
478 2006-06-12 Ville Vainio <vivainio@gmail.com>
479 2006-06-12 Ville Vainio <vivainio@gmail.com>
479
480
480 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
481 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
481 allowing $variable interpolation within multiline statements,
482 allowing $variable interpolation within multiline statements,
482 though so far only with "sh" profile for a testing period.
483 though so far only with "sh" profile for a testing period.
483 The patch also enables splitting long commands with \ but it
484 The patch also enables splitting long commands with \ but it
484 doesn't work properly yet.
485 doesn't work properly yet.
485
486
486 2006-06-12 Walter Doerwald <walter@livinglogic.de>
487 2006-06-12 Walter Doerwald <walter@livinglogic.de>
487
488
488 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
489 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
489 input history and the position of the cursor in the input history for
490 input history and the position of the cursor in the input history for
490 the find, findbackwards and goto command.
491 the find, findbackwards and goto command.
491
492
492 2006-06-10 Walter Doerwald <walter@livinglogic.de>
493 2006-06-10 Walter Doerwald <walter@livinglogic.de>
493
494
494 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
495 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
495 implements the basic functionality of browser commands that require
496 implements the basic functionality of browser commands that require
496 input. Reimplement the goto, find and findbackwards commands as
497 input. Reimplement the goto, find and findbackwards commands as
497 subclasses of _CommandInput. Add an input history and keymaps to those
498 subclasses of _CommandInput. Add an input history and keymaps to those
498 commands. Add "\r" as a keyboard shortcut for the enterdefault and
499 commands. Add "\r" as a keyboard shortcut for the enterdefault and
499 execute commands.
500 execute commands.
500
501
501 2006-06-07 Ville Vainio <vivainio@gmail.com>
502 2006-06-07 Ville Vainio <vivainio@gmail.com>
502
503
503 * iplib.py: ipython mybatch.ipy exits ipython immediately after
504 * iplib.py: ipython mybatch.ipy exits ipython immediately after
504 running the batch files instead of leaving the session open.
505 running the batch files instead of leaving the session open.
505
506
506 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
507 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
507
508
508 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
509 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
509 the original fix was incomplete. Patch submitted by W. Maier.
510 the original fix was incomplete. Patch submitted by W. Maier.
510
511
511 2006-06-07 Ville Vainio <vivainio@gmail.com>
512 2006-06-07 Ville Vainio <vivainio@gmail.com>
512
513
513 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
514 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
514 Confirmation prompts can be supressed by 'quiet' option.
515 Confirmation prompts can be supressed by 'quiet' option.
515 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
516 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
516
517
517 2006-06-06 *** Released version 0.7.2
518 2006-06-06 *** Released version 0.7.2
518
519
519 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
520 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
520
521
521 * IPython/Release.py (version): Made 0.7.2 final for release.
522 * IPython/Release.py (version): Made 0.7.2 final for release.
522 Repo tagged and release cut.
523 Repo tagged and release cut.
523
524
524 2006-06-05 Ville Vainio <vivainio@gmail.com>
525 2006-06-05 Ville Vainio <vivainio@gmail.com>
525
526
526 * Magic.py (magic_rehashx): Honor no_alias list earlier in
527 * Magic.py (magic_rehashx): Honor no_alias list earlier in
527 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
528 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
528
529
529 * upgrade_dir.py: try import 'path' module a bit harder
530 * upgrade_dir.py: try import 'path' module a bit harder
530 (for %upgrade)
531 (for %upgrade)
531
532
532 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
533 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
533
534
534 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
535 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
535 instead of looping 20 times.
536 instead of looping 20 times.
536
537
537 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
538 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
538 correctly at initialization time. Bug reported by Krishna Mohan
539 correctly at initialization time. Bug reported by Krishna Mohan
539 Gundu <gkmohan-AT-gmail.com> on the user list.
540 Gundu <gkmohan-AT-gmail.com> on the user list.
540
541
541 * IPython/Release.py (version): Mark 0.7.2 version to start
542 * IPython/Release.py (version): Mark 0.7.2 version to start
542 testing for release on 06/06.
543 testing for release on 06/06.
543
544
544 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
545 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
545
546
546 * scripts/irunner: thin script interface so users don't have to
547 * scripts/irunner: thin script interface so users don't have to
547 find the module and call it as an executable, since modules rarely
548 find the module and call it as an executable, since modules rarely
548 live in people's PATH.
549 live in people's PATH.
549
550
550 * IPython/irunner.py (InteractiveRunner.__init__): added
551 * IPython/irunner.py (InteractiveRunner.__init__): added
551 delaybeforesend attribute to control delays with newer versions of
552 delaybeforesend attribute to control delays with newer versions of
552 pexpect. Thanks to detailed help from pexpect's author, Noah
553 pexpect. Thanks to detailed help from pexpect's author, Noah
553 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
554 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
554 correctly (it works in NoColor mode).
555 correctly (it works in NoColor mode).
555
556
556 * IPython/iplib.py (handle_normal): fix nasty crash reported on
557 * IPython/iplib.py (handle_normal): fix nasty crash reported on
557 SAGE list, from improper log() calls.
558 SAGE list, from improper log() calls.
558
559
559 2006-05-31 Ville Vainio <vivainio@gmail.com>
560 2006-05-31 Ville Vainio <vivainio@gmail.com>
560
561
561 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
562 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
562 with args in parens to work correctly with dirs that have spaces.
563 with args in parens to work correctly with dirs that have spaces.
563
564
564 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
565 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
565
566
566 * IPython/Logger.py (Logger.logstart): add option to log raw input
567 * IPython/Logger.py (Logger.logstart): add option to log raw input
567 instead of the processed one. A -r flag was added to the
568 instead of the processed one. A -r flag was added to the
568 %logstart magic used for controlling logging.
569 %logstart magic used for controlling logging.
569
570
570 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
571 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
571
572
572 * IPython/iplib.py (InteractiveShell.__init__): add check for the
573 * IPython/iplib.py (InteractiveShell.__init__): add check for the
573 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
574 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
574 recognize the option. After a bug report by Will Maier. This
575 recognize the option. After a bug report by Will Maier. This
575 closes #64 (will do it after confirmation from W. Maier).
576 closes #64 (will do it after confirmation from W. Maier).
576
577
577 * IPython/irunner.py: New module to run scripts as if manually
578 * IPython/irunner.py: New module to run scripts as if manually
578 typed into an interactive environment, based on pexpect. After a
579 typed into an interactive environment, based on pexpect. After a
579 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
580 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
580 ipython-user list. Simple unittests in the tests/ directory.
581 ipython-user list. Simple unittests in the tests/ directory.
581
582
582 * tools/release: add Will Maier, OpenBSD port maintainer, to
583 * tools/release: add Will Maier, OpenBSD port maintainer, to
583 recepients list. We are now officially part of the OpenBSD ports:
584 recepients list. We are now officially part of the OpenBSD ports:
584 http://www.openbsd.org/ports.html ! Many thanks to Will for the
585 http://www.openbsd.org/ports.html ! Many thanks to Will for the
585 work.
586 work.
586
587
587 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
588 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
588
589
589 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
590 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
590 so that it doesn't break tkinter apps.
591 so that it doesn't break tkinter apps.
591
592
592 * IPython/iplib.py (_prefilter): fix bug where aliases would
593 * IPython/iplib.py (_prefilter): fix bug where aliases would
593 shadow variables when autocall was fully off. Reported by SAGE
594 shadow variables when autocall was fully off. Reported by SAGE
594 author William Stein.
595 author William Stein.
595
596
596 * IPython/OInspect.py (Inspector.__init__): add a flag to control
597 * IPython/OInspect.py (Inspector.__init__): add a flag to control
597 at what detail level strings are computed when foo? is requested.
598 at what detail level strings are computed when foo? is requested.
598 This allows users to ask for example that the string form of an
599 This allows users to ask for example that the string form of an
599 object is only computed when foo?? is called, or even never, by
600 object is only computed when foo?? is called, or even never, by
600 setting the object_info_string_level >= 2 in the configuration
601 setting the object_info_string_level >= 2 in the configuration
601 file. This new option has been added and documented. After a
602 file. This new option has been added and documented. After a
602 request by SAGE to be able to control the printing of very large
603 request by SAGE to be able to control the printing of very large
603 objects more easily.
604 objects more easily.
604
605
605 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
606 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
606
607
607 * IPython/ipmaker.py (make_IPython): remove the ipython call path
608 * IPython/ipmaker.py (make_IPython): remove the ipython call path
608 from sys.argv, to be 100% consistent with how Python itself works
609 from sys.argv, to be 100% consistent with how Python itself works
609 (as seen for example with python -i file.py). After a bug report
610 (as seen for example with python -i file.py). After a bug report
610 by Jeffrey Collins.
611 by Jeffrey Collins.
611
612
612 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
613 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
613 nasty bug which was preventing custom namespaces with -pylab,
614 nasty bug which was preventing custom namespaces with -pylab,
614 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
615 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
615 compatibility (long gone from mpl).
616 compatibility (long gone from mpl).
616
617
617 * IPython/ipapi.py (make_session): name change: create->make. We
618 * IPython/ipapi.py (make_session): name change: create->make. We
618 use make in other places (ipmaker,...), it's shorter and easier to
619 use make in other places (ipmaker,...), it's shorter and easier to
619 type and say, etc. I'm trying to clean things before 0.7.2 so
620 type and say, etc. I'm trying to clean things before 0.7.2 so
620 that I can keep things stable wrt to ipapi in the chainsaw branch.
621 that I can keep things stable wrt to ipapi in the chainsaw branch.
621
622
622 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
623 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
623 python-mode recognizes our debugger mode. Add support for
624 python-mode recognizes our debugger mode. Add support for
624 autoindent inside (X)emacs. After a patch sent in by Jin Liu
625 autoindent inside (X)emacs. After a patch sent in by Jin Liu
625 <m.liu.jin-AT-gmail.com> originally written by
626 <m.liu.jin-AT-gmail.com> originally written by
626 doxgen-AT-newsmth.net (with minor modifications for xemacs
627 doxgen-AT-newsmth.net (with minor modifications for xemacs
627 compatibility)
628 compatibility)
628
629
629 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
630 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
630 tracebacks when walking the stack so that the stack tracking system
631 tracebacks when walking the stack so that the stack tracking system
631 in emacs' python-mode can identify the frames correctly.
632 in emacs' python-mode can identify the frames correctly.
632
633
633 * IPython/ipmaker.py (make_IPython): make the internal (and
634 * IPython/ipmaker.py (make_IPython): make the internal (and
634 default config) autoedit_syntax value false by default. Too many
635 default config) autoedit_syntax value false by default. Too many
635 users have complained to me (both on and off-list) about problems
636 users have complained to me (both on and off-list) about problems
636 with this option being on by default, so I'm making it default to
637 with this option being on by default, so I'm making it default to
637 off. It can still be enabled by anyone via the usual mechanisms.
638 off. It can still be enabled by anyone via the usual mechanisms.
638
639
639 * IPython/completer.py (Completer.attr_matches): add support for
640 * IPython/completer.py (Completer.attr_matches): add support for
640 PyCrust-style _getAttributeNames magic method. Patch contributed
641 PyCrust-style _getAttributeNames magic method. Patch contributed
641 by <mscott-AT-goldenspud.com>. Closes #50.
642 by <mscott-AT-goldenspud.com>. Closes #50.
642
643
643 * IPython/iplib.py (InteractiveShell.__init__): remove the
644 * IPython/iplib.py (InteractiveShell.__init__): remove the
644 deletion of exit/quit from __builtin__, which can break
645 deletion of exit/quit from __builtin__, which can break
645 third-party tools like the Zope debugging console. The
646 third-party tools like the Zope debugging console. The
646 %exit/%quit magics remain. In general, it's probably a good idea
647 %exit/%quit magics remain. In general, it's probably a good idea
647 not to delete anything from __builtin__, since we never know what
648 not to delete anything from __builtin__, since we never know what
648 that will break. In any case, python now (for 2.5) will support
649 that will break. In any case, python now (for 2.5) will support
649 'real' exit/quit, so this issue is moot. Closes #55.
650 'real' exit/quit, so this issue is moot. Closes #55.
650
651
651 * IPython/genutils.py (with_obj): rename the 'with' function to
652 * IPython/genutils.py (with_obj): rename the 'with' function to
652 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
653 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
653 becomes a language keyword. Closes #53.
654 becomes a language keyword. Closes #53.
654
655
655 * IPython/FakeModule.py (FakeModule.__init__): add a proper
656 * IPython/FakeModule.py (FakeModule.__init__): add a proper
656 __file__ attribute to this so it fools more things into thinking
657 __file__ attribute to this so it fools more things into thinking
657 it is a real module. Closes #59.
658 it is a real module. Closes #59.
658
659
659 * IPython/Magic.py (magic_edit): add -n option to open the editor
660 * IPython/Magic.py (magic_edit): add -n option to open the editor
660 at a specific line number. After a patch by Stefan van der Walt.
661 at a specific line number. After a patch by Stefan van der Walt.
661
662
662 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
663 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
663
664
664 * IPython/iplib.py (edit_syntax_error): fix crash when for some
665 * IPython/iplib.py (edit_syntax_error): fix crash when for some
665 reason the file could not be opened. After automatic crash
666 reason the file could not be opened. After automatic crash
666 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
667 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
667 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
668 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
668 (_should_recompile): Don't fire editor if using %bg, since there
669 (_should_recompile): Don't fire editor if using %bg, since there
669 is no file in the first place. From the same report as above.
670 is no file in the first place. From the same report as above.
670 (raw_input): protect against faulty third-party prefilters. After
671 (raw_input): protect against faulty third-party prefilters. After
671 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
672 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
672 while running under SAGE.
673 while running under SAGE.
673
674
674 2006-05-23 Ville Vainio <vivainio@gmail.com>
675 2006-05-23 Ville Vainio <vivainio@gmail.com>
675
676
676 * ipapi.py: Stripped down ip.to_user_ns() to work only as
677 * ipapi.py: Stripped down ip.to_user_ns() to work only as
677 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
678 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
678 now returns None (again), unless dummy is specifically allowed by
679 now returns None (again), unless dummy is specifically allowed by
679 ipapi.get(allow_dummy=True).
680 ipapi.get(allow_dummy=True).
680
681
681 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
682 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
682
683
683 * IPython: remove all 2.2-compatibility objects and hacks from
684 * IPython: remove all 2.2-compatibility objects and hacks from
684 everywhere, since we only support 2.3 at this point. Docs
685 everywhere, since we only support 2.3 at this point. Docs
685 updated.
686 updated.
686
687
687 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
688 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
688 Anything requiring extra validation can be turned into a Python
689 Anything requiring extra validation can be turned into a Python
689 property in the future. I used a property for the db one b/c
690 property in the future. I used a property for the db one b/c
690 there was a nasty circularity problem with the initialization
691 there was a nasty circularity problem with the initialization
691 order, which right now I don't have time to clean up.
692 order, which right now I don't have time to clean up.
692
693
693 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
694 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
694 another locking bug reported by Jorgen. I'm not 100% sure though,
695 another locking bug reported by Jorgen. I'm not 100% sure though,
695 so more testing is needed...
696 so more testing is needed...
696
697
697 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
698 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
698
699
699 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
700 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
700 local variables from any routine in user code (typically executed
701 local variables from any routine in user code (typically executed
701 with %run) directly into the interactive namespace. Very useful
702 with %run) directly into the interactive namespace. Very useful
702 when doing complex debugging.
703 when doing complex debugging.
703 (IPythonNotRunning): Changed the default None object to a dummy
704 (IPythonNotRunning): Changed the default None object to a dummy
704 whose attributes can be queried as well as called without
705 whose attributes can be queried as well as called without
705 exploding, to ease writing code which works transparently both in
706 exploding, to ease writing code which works transparently both in
706 and out of ipython and uses some of this API.
707 and out of ipython and uses some of this API.
707
708
708 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
709 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
709
710
710 * IPython/hooks.py (result_display): Fix the fact that our display
711 * IPython/hooks.py (result_display): Fix the fact that our display
711 hook was using str() instead of repr(), as the default python
712 hook was using str() instead of repr(), as the default python
712 console does. This had gone unnoticed b/c it only happened if
713 console does. This had gone unnoticed b/c it only happened if
713 %Pprint was off, but the inconsistency was there.
714 %Pprint was off, but the inconsistency was there.
714
715
715 2006-05-15 Ville Vainio <vivainio@gmail.com>
716 2006-05-15 Ville Vainio <vivainio@gmail.com>
716
717
717 * Oinspect.py: Only show docstring for nonexisting/binary files
718 * Oinspect.py: Only show docstring for nonexisting/binary files
718 when doing object??, closing ticket #62
719 when doing object??, closing ticket #62
719
720
720 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
721 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
721
722
722 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
723 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
723 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
724 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
724 was being released in a routine which hadn't checked if it had
725 was being released in a routine which hadn't checked if it had
725 been the one to acquire it.
726 been the one to acquire it.
726
727
727 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
728 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
728
729
729 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
730 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
730
731
731 2006-04-11 Ville Vainio <vivainio@gmail.com>
732 2006-04-11 Ville Vainio <vivainio@gmail.com>
732
733
733 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
734 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
734 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
735 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
735 prefilters, allowing stuff like magics and aliases in the file.
736 prefilters, allowing stuff like magics and aliases in the file.
736
737
737 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
738 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
738 added. Supported now are "%clear in" and "%clear out" (clear input and
739 added. Supported now are "%clear in" and "%clear out" (clear input and
739 output history, respectively). Also fixed CachedOutput.flush to
740 output history, respectively). Also fixed CachedOutput.flush to
740 properly flush the output cache.
741 properly flush the output cache.
741
742
742 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
743 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
743 half-success (and fail explicitly).
744 half-success (and fail explicitly).
744
745
745 2006-03-28 Ville Vainio <vivainio@gmail.com>
746 2006-03-28 Ville Vainio <vivainio@gmail.com>
746
747
747 * iplib.py: Fix quoting of aliases so that only argless ones
748 * iplib.py: Fix quoting of aliases so that only argless ones
748 are quoted
749 are quoted
749
750
750 2006-03-28 Ville Vainio <vivainio@gmail.com>
751 2006-03-28 Ville Vainio <vivainio@gmail.com>
751
752
752 * iplib.py: Quote aliases with spaces in the name.
753 * iplib.py: Quote aliases with spaces in the name.
753 "c:\program files\blah\bin" is now legal alias target.
754 "c:\program files\blah\bin" is now legal alias target.
754
755
755 * ext_rehashdir.py: Space no longer allowed as arg
756 * ext_rehashdir.py: Space no longer allowed as arg
756 separator, since space is legal in path names.
757 separator, since space is legal in path names.
757
758
758 2006-03-16 Ville Vainio <vivainio@gmail.com>
759 2006-03-16 Ville Vainio <vivainio@gmail.com>
759
760
760 * upgrade_dir.py: Take path.py from Extensions, correcting
761 * upgrade_dir.py: Take path.py from Extensions, correcting
761 %upgrade magic
762 %upgrade magic
762
763
763 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
764 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
764
765
765 * hooks.py: Only enclose editor binary in quotes if legal and
766 * hooks.py: Only enclose editor binary in quotes if legal and
766 necessary (space in the name, and is an existing file). Fixes a bug
767 necessary (space in the name, and is an existing file). Fixes a bug
767 reported by Zachary Pincus.
768 reported by Zachary Pincus.
768
769
769 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
770 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
770
771
771 * Manual: thanks to a tip on proper color handling for Emacs, by
772 * Manual: thanks to a tip on proper color handling for Emacs, by
772 Eric J Haywiser <ejh1-AT-MIT.EDU>.
773 Eric J Haywiser <ejh1-AT-MIT.EDU>.
773
774
774 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
775 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
775 by applying the provided patch. Thanks to Liu Jin
776 by applying the provided patch. Thanks to Liu Jin
776 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
777 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
777 XEmacs/Linux, I'm trusting the submitter that it actually helps
778 XEmacs/Linux, I'm trusting the submitter that it actually helps
778 under win32/GNU Emacs. Will revisit if any problems are reported.
779 under win32/GNU Emacs. Will revisit if any problems are reported.
779
780
780 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
781 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
781
782
782 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
783 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
783 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
784 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
784
785
785 2006-03-12 Ville Vainio <vivainio@gmail.com>
786 2006-03-12 Ville Vainio <vivainio@gmail.com>
786
787
787 * Magic.py (magic_timeit): Added %timeit magic, contributed by
788 * Magic.py (magic_timeit): Added %timeit magic, contributed by
788 Torsten Marek.
789 Torsten Marek.
789
790
790 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
791 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
791
792
792 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
793 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
793 line ranges works again.
794 line ranges works again.
794
795
795 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
796 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
796
797
797 * IPython/iplib.py (showtraceback): add back sys.last_traceback
798 * IPython/iplib.py (showtraceback): add back sys.last_traceback
798 and friends, after a discussion with Zach Pincus on ipython-user.
799 and friends, after a discussion with Zach Pincus on ipython-user.
799 I'm not 100% sure, but after thinking about it quite a bit, it may
800 I'm not 100% sure, but after thinking about it quite a bit, it may
800 be OK. Testing with the multithreaded shells didn't reveal any
801 be OK. Testing with the multithreaded shells didn't reveal any
801 problems, but let's keep an eye out.
802 problems, but let's keep an eye out.
802
803
803 In the process, I fixed a few things which were calling
804 In the process, I fixed a few things which were calling
804 self.InteractiveTB() directly (like safe_execfile), which is a
805 self.InteractiveTB() directly (like safe_execfile), which is a
805 mistake: ALL exception reporting should be done by calling
806 mistake: ALL exception reporting should be done by calling
806 self.showtraceback(), which handles state and tab-completion and
807 self.showtraceback(), which handles state and tab-completion and
807 more.
808 more.
808
809
809 2006-03-01 Ville Vainio <vivainio@gmail.com>
810 2006-03-01 Ville Vainio <vivainio@gmail.com>
810
811
811 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
812 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
812 To use, do "from ipipe import *".
813 To use, do "from ipipe import *".
813
814
814 2006-02-24 Ville Vainio <vivainio@gmail.com>
815 2006-02-24 Ville Vainio <vivainio@gmail.com>
815
816
816 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
817 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
817 "cleanly" and safely than the older upgrade mechanism.
818 "cleanly" and safely than the older upgrade mechanism.
818
819
819 2006-02-21 Ville Vainio <vivainio@gmail.com>
820 2006-02-21 Ville Vainio <vivainio@gmail.com>
820
821
821 * Magic.py: %save works again.
822 * Magic.py: %save works again.
822
823
823 2006-02-15 Ville Vainio <vivainio@gmail.com>
824 2006-02-15 Ville Vainio <vivainio@gmail.com>
824
825
825 * Magic.py: %Pprint works again
826 * Magic.py: %Pprint works again
826
827
827 * Extensions/ipy_sane_defaults.py: Provide everything provided
828 * Extensions/ipy_sane_defaults.py: Provide everything provided
828 in default ipythonrc, to make it possible to have a completely empty
829 in default ipythonrc, to make it possible to have a completely empty
829 ipythonrc (and thus completely rc-file free configuration)
830 ipythonrc (and thus completely rc-file free configuration)
830
831
831 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
832 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
832
833
833 * IPython/hooks.py (editor): quote the call to the editor command,
834 * IPython/hooks.py (editor): quote the call to the editor command,
834 to allow commands with spaces in them. Problem noted by watching
835 to allow commands with spaces in them. Problem noted by watching
835 Ian Oswald's video about textpad under win32 at
836 Ian Oswald's video about textpad under win32 at
836 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
837 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
837
838
838 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
839 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
839 describing magics (we haven't used @ for a loong time).
840 describing magics (we haven't used @ for a loong time).
840
841
841 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
842 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
842 contributed by marienz to close
843 contributed by marienz to close
843 http://www.scipy.net/roundup/ipython/issue53.
844 http://www.scipy.net/roundup/ipython/issue53.
844
845
845 2006-02-10 Ville Vainio <vivainio@gmail.com>
846 2006-02-10 Ville Vainio <vivainio@gmail.com>
846
847
847 * genutils.py: getoutput now works in win32 too
848 * genutils.py: getoutput now works in win32 too
848
849
849 * completer.py: alias and magic completion only invoked
850 * completer.py: alias and magic completion only invoked
850 at the first "item" in the line, to avoid "cd %store"
851 at the first "item" in the line, to avoid "cd %store"
851 nonsense.
852 nonsense.
852
853
853 2006-02-09 Ville Vainio <vivainio@gmail.com>
854 2006-02-09 Ville Vainio <vivainio@gmail.com>
854
855
855 * test/*: Added a unit testing framework (finally).
856 * test/*: Added a unit testing framework (finally).
856 '%run runtests.py' to run test_*.
857 '%run runtests.py' to run test_*.
857
858
858 * ipapi.py: Exposed runlines and set_custom_exc
859 * ipapi.py: Exposed runlines and set_custom_exc
859
860
860 2006-02-07 Ville Vainio <vivainio@gmail.com>
861 2006-02-07 Ville Vainio <vivainio@gmail.com>
861
862
862 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
863 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
863 instead use "f(1 2)" as before.
864 instead use "f(1 2)" as before.
864
865
865 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
866 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
866
867
867 * IPython/demo.py (IPythonDemo): Add new classes to the demo
868 * IPython/demo.py (IPythonDemo): Add new classes to the demo
868 facilities, for demos processed by the IPython input filter
869 facilities, for demos processed by the IPython input filter
869 (IPythonDemo), and for running a script one-line-at-a-time as a
870 (IPythonDemo), and for running a script one-line-at-a-time as a
870 demo, both for pure Python (LineDemo) and for IPython-processed
871 demo, both for pure Python (LineDemo) and for IPython-processed
871 input (IPythonLineDemo). After a request by Dave Kohel, from the
872 input (IPythonLineDemo). After a request by Dave Kohel, from the
872 SAGE team.
873 SAGE team.
873 (Demo.edit): added an edit() method to the demo objects, to edit
874 (Demo.edit): added an edit() method to the demo objects, to edit
874 the in-memory copy of the last executed block.
875 the in-memory copy of the last executed block.
875
876
876 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
877 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
877 processing to %edit, %macro and %save. These commands can now be
878 processing to %edit, %macro and %save. These commands can now be
878 invoked on the unprocessed input as it was typed by the user
879 invoked on the unprocessed input as it was typed by the user
879 (without any prefilters applied). After requests by the SAGE team
880 (without any prefilters applied). After requests by the SAGE team
880 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
881 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
881
882
882 2006-02-01 Ville Vainio <vivainio@gmail.com>
883 2006-02-01 Ville Vainio <vivainio@gmail.com>
883
884
884 * setup.py, eggsetup.py: easy_install ipython==dev works
885 * setup.py, eggsetup.py: easy_install ipython==dev works
885 correctly now (on Linux)
886 correctly now (on Linux)
886
887
887 * ipy_user_conf,ipmaker: user config changes, removed spurious
888 * ipy_user_conf,ipmaker: user config changes, removed spurious
888 warnings
889 warnings
889
890
890 * iplib: if rc.banner is string, use it as is.
891 * iplib: if rc.banner is string, use it as is.
891
892
892 * Magic: %pycat accepts a string argument and pages it's contents.
893 * Magic: %pycat accepts a string argument and pages it's contents.
893
894
894
895
895 2006-01-30 Ville Vainio <vivainio@gmail.com>
896 2006-01-30 Ville Vainio <vivainio@gmail.com>
896
897
897 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
898 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
898 Now %store and bookmarks work through PickleShare, meaning that
899 Now %store and bookmarks work through PickleShare, meaning that
899 concurrent access is possible and all ipython sessions see the
900 concurrent access is possible and all ipython sessions see the
900 same database situation all the time, instead of snapshot of
901 same database situation all the time, instead of snapshot of
901 the situation when the session was started. Hence, %bookmark
902 the situation when the session was started. Hence, %bookmark
902 results are immediately accessible from othes sessions. The database
903 results are immediately accessible from othes sessions. The database
903 is also available for use by user extensions. See:
904 is also available for use by user extensions. See:
904 http://www.python.org/pypi/pickleshare
905 http://www.python.org/pypi/pickleshare
905
906
906 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
907 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
907
908
908 * aliases can now be %store'd
909 * aliases can now be %store'd
909
910
910 * path.py moved to Extensions so that pickleshare does not need
911 * path.py moved to Extensions so that pickleshare does not need
911 IPython-specific import. Extensions added to pythonpath right
912 IPython-specific import. Extensions added to pythonpath right
912 at __init__.
913 at __init__.
913
914
914 * iplib.py: ipalias deprecated/redundant; aliases are converted and
915 * iplib.py: ipalias deprecated/redundant; aliases are converted and
915 called with _ip.system and the pre-transformed command string.
916 called with _ip.system and the pre-transformed command string.
916
917
917 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
918 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
918
919
919 * IPython/iplib.py (interact): Fix that we were not catching
920 * IPython/iplib.py (interact): Fix that we were not catching
920 KeyboardInterrupt exceptions properly. I'm not quite sure why the
921 KeyboardInterrupt exceptions properly. I'm not quite sure why the
921 logic here had to change, but it's fixed now.
922 logic here had to change, but it's fixed now.
922
923
923 2006-01-29 Ville Vainio <vivainio@gmail.com>
924 2006-01-29 Ville Vainio <vivainio@gmail.com>
924
925
925 * iplib.py: Try to import pyreadline on Windows.
926 * iplib.py: Try to import pyreadline on Windows.
926
927
927 2006-01-27 Ville Vainio <vivainio@gmail.com>
928 2006-01-27 Ville Vainio <vivainio@gmail.com>
928
929
929 * iplib.py: Expose ipapi as _ip in builtin namespace.
930 * iplib.py: Expose ipapi as _ip in builtin namespace.
930 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
931 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
931 and ip_set_hook (-> _ip.set_hook) redundant. % and !
932 and ip_set_hook (-> _ip.set_hook) redundant. % and !
932 syntax now produce _ip.* variant of the commands.
933 syntax now produce _ip.* variant of the commands.
933
934
934 * "_ip.options().autoedit_syntax = 2" automatically throws
935 * "_ip.options().autoedit_syntax = 2" automatically throws
935 user to editor for syntax error correction without prompting.
936 user to editor for syntax error correction without prompting.
936
937
937 2006-01-27 Ville Vainio <vivainio@gmail.com>
938 2006-01-27 Ville Vainio <vivainio@gmail.com>
938
939
939 * ipmaker.py: Give "realistic" sys.argv for scripts (without
940 * ipmaker.py: Give "realistic" sys.argv for scripts (without
940 'ipython' at argv[0]) executed through command line.
941 'ipython' at argv[0]) executed through command line.
941 NOTE: this DEPRECATES calling ipython with multiple scripts
942 NOTE: this DEPRECATES calling ipython with multiple scripts
942 ("ipython a.py b.py c.py")
943 ("ipython a.py b.py c.py")
943
944
944 * iplib.py, hooks.py: Added configurable input prefilter,
945 * iplib.py, hooks.py: Added configurable input prefilter,
945 named 'input_prefilter'. See ext_rescapture.py for example
946 named 'input_prefilter'. See ext_rescapture.py for example
946 usage.
947 usage.
947
948
948 * ext_rescapture.py, Magic.py: Better system command output capture
949 * ext_rescapture.py, Magic.py: Better system command output capture
949 through 'var = !ls' (deprecates user-visible %sc). Same notation
950 through 'var = !ls' (deprecates user-visible %sc). Same notation
950 applies for magics, 'var = %alias' assigns alias list to var.
951 applies for magics, 'var = %alias' assigns alias list to var.
951
952
952 * ipapi.py: added meta() for accessing extension-usable data store.
953 * ipapi.py: added meta() for accessing extension-usable data store.
953
954
954 * iplib.py: added InteractiveShell.getapi(). New magics should be
955 * iplib.py: added InteractiveShell.getapi(). New magics should be
955 written doing self.getapi() instead of using the shell directly.
956 written doing self.getapi() instead of using the shell directly.
956
957
957 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
958 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
958 %store foo >> ~/myfoo.txt to store variables to files (in clean
959 %store foo >> ~/myfoo.txt to store variables to files (in clean
959 textual form, not a restorable pickle).
960 textual form, not a restorable pickle).
960
961
961 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
962 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
962
963
963 * usage.py, Magic.py: added %quickref
964 * usage.py, Magic.py: added %quickref
964
965
965 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
966 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
966
967
967 * GetoptErrors when invoking magics etc. with wrong args
968 * GetoptErrors when invoking magics etc. with wrong args
968 are now more helpful:
969 are now more helpful:
969 GetoptError: option -l not recognized (allowed: "qb" )
970 GetoptError: option -l not recognized (allowed: "qb" )
970
971
971 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
972 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
972
973
973 * IPython/demo.py (Demo.show): Flush stdout after each block, so
974 * IPython/demo.py (Demo.show): Flush stdout after each block, so
974 computationally intensive blocks don't appear to stall the demo.
975 computationally intensive blocks don't appear to stall the demo.
975
976
976 2006-01-24 Ville Vainio <vivainio@gmail.com>
977 2006-01-24 Ville Vainio <vivainio@gmail.com>
977
978
978 * iplib.py, hooks.py: 'result_display' hook can return a non-None
979 * iplib.py, hooks.py: 'result_display' hook can return a non-None
979 value to manipulate resulting history entry.
980 value to manipulate resulting history entry.
980
981
981 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
982 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
982 to instance methods of IPApi class, to make extending an embedded
983 to instance methods of IPApi class, to make extending an embedded
983 IPython feasible. See ext_rehashdir.py for example usage.
984 IPython feasible. See ext_rehashdir.py for example usage.
984
985
985 * Merged 1071-1076 from branches/0.7.1
986 * Merged 1071-1076 from branches/0.7.1
986
987
987
988
988 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
989 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
989
990
990 * tools/release (daystamp): Fix build tools to use the new
991 * tools/release (daystamp): Fix build tools to use the new
991 eggsetup.py script to build lightweight eggs.
992 eggsetup.py script to build lightweight eggs.
992
993
993 * Applied changesets 1062 and 1064 before 0.7.1 release.
994 * Applied changesets 1062 and 1064 before 0.7.1 release.
994
995
995 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
996 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
996 see the raw input history (without conversions like %ls ->
997 see the raw input history (without conversions like %ls ->
997 ipmagic("ls")). After a request from W. Stein, SAGE
998 ipmagic("ls")). After a request from W. Stein, SAGE
998 (http://modular.ucsd.edu/sage) developer. This information is
999 (http://modular.ucsd.edu/sage) developer. This information is
999 stored in the input_hist_raw attribute of the IPython instance, so
1000 stored in the input_hist_raw attribute of the IPython instance, so
1000 developers can access it if needed (it's an InputList instance).
1001 developers can access it if needed (it's an InputList instance).
1001
1002
1002 * Versionstring = 0.7.2.svn
1003 * Versionstring = 0.7.2.svn
1003
1004
1004 * eggsetup.py: A separate script for constructing eggs, creates
1005 * eggsetup.py: A separate script for constructing eggs, creates
1005 proper launch scripts even on Windows (an .exe file in
1006 proper launch scripts even on Windows (an .exe file in
1006 \python24\scripts).
1007 \python24\scripts).
1007
1008
1008 * ipapi.py: launch_new_instance, launch entry point needed for the
1009 * ipapi.py: launch_new_instance, launch entry point needed for the
1009 egg.
1010 egg.
1010
1011
1011 2006-01-23 Ville Vainio <vivainio@gmail.com>
1012 2006-01-23 Ville Vainio <vivainio@gmail.com>
1012
1013
1013 * Added %cpaste magic for pasting python code
1014 * Added %cpaste magic for pasting python code
1014
1015
1015 2006-01-22 Ville Vainio <vivainio@gmail.com>
1016 2006-01-22 Ville Vainio <vivainio@gmail.com>
1016
1017
1017 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1018 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1018
1019
1019 * Versionstring = 0.7.2.svn
1020 * Versionstring = 0.7.2.svn
1020
1021
1021 * eggsetup.py: A separate script for constructing eggs, creates
1022 * eggsetup.py: A separate script for constructing eggs, creates
1022 proper launch scripts even on Windows (an .exe file in
1023 proper launch scripts even on Windows (an .exe file in
1023 \python24\scripts).
1024 \python24\scripts).
1024
1025
1025 * ipapi.py: launch_new_instance, launch entry point needed for the
1026 * ipapi.py: launch_new_instance, launch entry point needed for the
1026 egg.
1027 egg.
1027
1028
1028 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1029 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1029
1030
1030 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1031 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1031 %pfile foo would print the file for foo even if it was a binary.
1032 %pfile foo would print the file for foo even if it was a binary.
1032 Now, extensions '.so' and '.dll' are skipped.
1033 Now, extensions '.so' and '.dll' are skipped.
1033
1034
1034 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1035 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1035 bug, where macros would fail in all threaded modes. I'm not 100%
1036 bug, where macros would fail in all threaded modes. I'm not 100%
1036 sure, so I'm going to put out an rc instead of making a release
1037 sure, so I'm going to put out an rc instead of making a release
1037 today, and wait for feedback for at least a few days.
1038 today, and wait for feedback for at least a few days.
1038
1039
1039 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1040 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1040 it...) the handling of pasting external code with autoindent on.
1041 it...) the handling of pasting external code with autoindent on.
1041 To get out of a multiline input, the rule will appear for most
1042 To get out of a multiline input, the rule will appear for most
1042 users unchanged: two blank lines or change the indent level
1043 users unchanged: two blank lines or change the indent level
1043 proposed by IPython. But there is a twist now: you can
1044 proposed by IPython. But there is a twist now: you can
1044 add/subtract only *one or two spaces*. If you add/subtract three
1045 add/subtract only *one or two spaces*. If you add/subtract three
1045 or more (unless you completely delete the line), IPython will
1046 or more (unless you completely delete the line), IPython will
1046 accept that line, and you'll need to enter a second one of pure
1047 accept that line, and you'll need to enter a second one of pure
1047 whitespace. I know it sounds complicated, but I can't find a
1048 whitespace. I know it sounds complicated, but I can't find a
1048 different solution that covers all the cases, with the right
1049 different solution that covers all the cases, with the right
1049 heuristics. Hopefully in actual use, nobody will really notice
1050 heuristics. Hopefully in actual use, nobody will really notice
1050 all these strange rules and things will 'just work'.
1051 all these strange rules and things will 'just work'.
1051
1052
1052 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1053 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1053
1054
1054 * IPython/iplib.py (interact): catch exceptions which can be
1055 * IPython/iplib.py (interact): catch exceptions which can be
1055 triggered asynchronously by signal handlers. Thanks to an
1056 triggered asynchronously by signal handlers. Thanks to an
1056 automatic crash report, submitted by Colin Kingsley
1057 automatic crash report, submitted by Colin Kingsley
1057 <tercel-AT-gentoo.org>.
1058 <tercel-AT-gentoo.org>.
1058
1059
1059 2006-01-20 Ville Vainio <vivainio@gmail.com>
1060 2006-01-20 Ville Vainio <vivainio@gmail.com>
1060
1061
1061 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1062 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1062 (%rehashdir, very useful, try it out) of how to extend ipython
1063 (%rehashdir, very useful, try it out) of how to extend ipython
1063 with new magics. Also added Extensions dir to pythonpath to make
1064 with new magics. Also added Extensions dir to pythonpath to make
1064 importing extensions easy.
1065 importing extensions easy.
1065
1066
1066 * %store now complains when trying to store interactively declared
1067 * %store now complains when trying to store interactively declared
1067 classes / instances of those classes.
1068 classes / instances of those classes.
1068
1069
1069 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1070 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1070 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1071 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1071 if they exist, and ipy_user_conf.py with some defaults is created for
1072 if they exist, and ipy_user_conf.py with some defaults is created for
1072 the user.
1073 the user.
1073
1074
1074 * Startup rehashing done by the config file, not InterpreterExec.
1075 * Startup rehashing done by the config file, not InterpreterExec.
1075 This means system commands are available even without selecting the
1076 This means system commands are available even without selecting the
1076 pysh profile. It's the sensible default after all.
1077 pysh profile. It's the sensible default after all.
1077
1078
1078 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1079 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1079
1080
1080 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1081 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1081 multiline code with autoindent on working. But I am really not
1082 multiline code with autoindent on working. But I am really not
1082 sure, so this needs more testing. Will commit a debug-enabled
1083 sure, so this needs more testing. Will commit a debug-enabled
1083 version for now, while I test it some more, so that Ville and
1084 version for now, while I test it some more, so that Ville and
1084 others may also catch any problems. Also made
1085 others may also catch any problems. Also made
1085 self.indent_current_str() a method, to ensure that there's no
1086 self.indent_current_str() a method, to ensure that there's no
1086 chance of the indent space count and the corresponding string
1087 chance of the indent space count and the corresponding string
1087 falling out of sync. All code needing the string should just call
1088 falling out of sync. All code needing the string should just call
1088 the method.
1089 the method.
1089
1090
1090 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1091 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1091
1092
1092 * IPython/Magic.py (magic_edit): fix check for when users don't
1093 * IPython/Magic.py (magic_edit): fix check for when users don't
1093 save their output files, the try/except was in the wrong section.
1094 save their output files, the try/except was in the wrong section.
1094
1095
1095 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1096 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1096
1097
1097 * IPython/Magic.py (magic_run): fix __file__ global missing from
1098 * IPython/Magic.py (magic_run): fix __file__ global missing from
1098 script's namespace when executed via %run. After a report by
1099 script's namespace when executed via %run. After a report by
1099 Vivian.
1100 Vivian.
1100
1101
1101 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1102 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1102 when using python 2.4. The parent constructor changed in 2.4, and
1103 when using python 2.4. The parent constructor changed in 2.4, and
1103 we need to track it directly (we can't call it, as it messes up
1104 we need to track it directly (we can't call it, as it messes up
1104 readline and tab-completion inside our pdb would stop working).
1105 readline and tab-completion inside our pdb would stop working).
1105 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1106 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1106
1107
1107 2006-01-16 Ville Vainio <vivainio@gmail.com>
1108 2006-01-16 Ville Vainio <vivainio@gmail.com>
1108
1109
1109 * Ipython/magic.py: Reverted back to old %edit functionality
1110 * Ipython/magic.py: Reverted back to old %edit functionality
1110 that returns file contents on exit.
1111 that returns file contents on exit.
1111
1112
1112 * IPython/path.py: Added Jason Orendorff's "path" module to
1113 * IPython/path.py: Added Jason Orendorff's "path" module to
1113 IPython tree, http://www.jorendorff.com/articles/python/path/.
1114 IPython tree, http://www.jorendorff.com/articles/python/path/.
1114 You can get path objects conveniently through %sc, and !!, e.g.:
1115 You can get path objects conveniently through %sc, and !!, e.g.:
1115 sc files=ls
1116 sc files=ls
1116 for p in files.paths: # or files.p
1117 for p in files.paths: # or files.p
1117 print p,p.mtime
1118 print p,p.mtime
1118
1119
1119 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1120 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1120 now work again without considering the exclusion regexp -
1121 now work again without considering the exclusion regexp -
1121 hence, things like ',foo my/path' turn to 'foo("my/path")'
1122 hence, things like ',foo my/path' turn to 'foo("my/path")'
1122 instead of syntax error.
1123 instead of syntax error.
1123
1124
1124
1125
1125 2006-01-14 Ville Vainio <vivainio@gmail.com>
1126 2006-01-14 Ville Vainio <vivainio@gmail.com>
1126
1127
1127 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1128 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1128 ipapi decorators for python 2.4 users, options() provides access to rc
1129 ipapi decorators for python 2.4 users, options() provides access to rc
1129 data.
1130 data.
1130
1131
1131 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1132 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1132 as path separators (even on Linux ;-). Space character after
1133 as path separators (even on Linux ;-). Space character after
1133 backslash (as yielded by tab completer) is still space;
1134 backslash (as yielded by tab completer) is still space;
1134 "%cd long\ name" works as expected.
1135 "%cd long\ name" works as expected.
1135
1136
1136 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1137 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1137 as "chain of command", with priority. API stays the same,
1138 as "chain of command", with priority. API stays the same,
1138 TryNext exception raised by a hook function signals that
1139 TryNext exception raised by a hook function signals that
1139 current hook failed and next hook should try handling it, as
1140 current hook failed and next hook should try handling it, as
1140 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1141 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1141 requested configurable display hook, which is now implemented.
1142 requested configurable display hook, which is now implemented.
1142
1143
1143 2006-01-13 Ville Vainio <vivainio@gmail.com>
1144 2006-01-13 Ville Vainio <vivainio@gmail.com>
1144
1145
1145 * IPython/platutils*.py: platform specific utility functions,
1146 * IPython/platutils*.py: platform specific utility functions,
1146 so far only set_term_title is implemented (change terminal
1147 so far only set_term_title is implemented (change terminal
1147 label in windowing systems). %cd now changes the title to
1148 label in windowing systems). %cd now changes the title to
1148 current dir.
1149 current dir.
1149
1150
1150 * IPython/Release.py: Added myself to "authors" list,
1151 * IPython/Release.py: Added myself to "authors" list,
1151 had to create new files.
1152 had to create new files.
1152
1153
1153 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1154 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1154 shell escape; not a known bug but had potential to be one in the
1155 shell escape; not a known bug but had potential to be one in the
1155 future.
1156 future.
1156
1157
1157 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1158 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1158 extension API for IPython! See the module for usage example. Fix
1159 extension API for IPython! See the module for usage example. Fix
1159 OInspect for docstring-less magic functions.
1160 OInspect for docstring-less magic functions.
1160
1161
1161
1162
1162 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1163 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1163
1164
1164 * IPython/iplib.py (raw_input): temporarily deactivate all
1165 * IPython/iplib.py (raw_input): temporarily deactivate all
1165 attempts at allowing pasting of code with autoindent on. It
1166 attempts at allowing pasting of code with autoindent on. It
1166 introduced bugs (reported by Prabhu) and I can't seem to find a
1167 introduced bugs (reported by Prabhu) and I can't seem to find a
1167 robust combination which works in all cases. Will have to revisit
1168 robust combination which works in all cases. Will have to revisit
1168 later.
1169 later.
1169
1170
1170 * IPython/genutils.py: remove isspace() function. We've dropped
1171 * IPython/genutils.py: remove isspace() function. We've dropped
1171 2.2 compatibility, so it's OK to use the string method.
1172 2.2 compatibility, so it's OK to use the string method.
1172
1173
1173 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1174 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1174
1175
1175 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1176 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1176 matching what NOT to autocall on, to include all python binary
1177 matching what NOT to autocall on, to include all python binary
1177 operators (including things like 'and', 'or', 'is' and 'in').
1178 operators (including things like 'and', 'or', 'is' and 'in').
1178 Prompted by a bug report on 'foo & bar', but I realized we had
1179 Prompted by a bug report on 'foo & bar', but I realized we had
1179 many more potential bug cases with other operators. The regexp is
1180 many more potential bug cases with other operators. The regexp is
1180 self.re_exclude_auto, it's fairly commented.
1181 self.re_exclude_auto, it's fairly commented.
1181
1182
1182 2006-01-12 Ville Vainio <vivainio@gmail.com>
1183 2006-01-12 Ville Vainio <vivainio@gmail.com>
1183
1184
1184 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1185 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1185 Prettified and hardened string/backslash quoting with ipsystem(),
1186 Prettified and hardened string/backslash quoting with ipsystem(),
1186 ipalias() and ipmagic(). Now even \ characters are passed to
1187 ipalias() and ipmagic(). Now even \ characters are passed to
1187 %magics, !shell escapes and aliases exactly as they are in the
1188 %magics, !shell escapes and aliases exactly as they are in the
1188 ipython command line. Should improve backslash experience,
1189 ipython command line. Should improve backslash experience,
1189 particularly in Windows (path delimiter for some commands that
1190 particularly in Windows (path delimiter for some commands that
1190 won't understand '/'), but Unix benefits as well (regexps). %cd
1191 won't understand '/'), but Unix benefits as well (regexps). %cd
1191 magic still doesn't support backslash path delimiters, though. Also
1192 magic still doesn't support backslash path delimiters, though. Also
1192 deleted all pretense of supporting multiline command strings in
1193 deleted all pretense of supporting multiline command strings in
1193 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1194 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1194
1195
1195 * doc/build_doc_instructions.txt added. Documentation on how to
1196 * doc/build_doc_instructions.txt added. Documentation on how to
1196 use doc/update_manual.py, added yesterday. Both files contributed
1197 use doc/update_manual.py, added yesterday. Both files contributed
1197 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1198 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1198 doc/*.sh for deprecation at a later date.
1199 doc/*.sh for deprecation at a later date.
1199
1200
1200 * /ipython.py Added ipython.py to root directory for
1201 * /ipython.py Added ipython.py to root directory for
1201 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1202 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1202 ipython.py) and development convenience (no need to keep doing
1203 ipython.py) and development convenience (no need to keep doing
1203 "setup.py install" between changes).
1204 "setup.py install" between changes).
1204
1205
1205 * Made ! and !! shell escapes work (again) in multiline expressions:
1206 * Made ! and !! shell escapes work (again) in multiline expressions:
1206 if 1:
1207 if 1:
1207 !ls
1208 !ls
1208 !!ls
1209 !!ls
1209
1210
1210 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1211 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1211
1212
1212 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1213 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1213 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1214 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1214 module in case-insensitive installation. Was causing crashes
1215 module in case-insensitive installation. Was causing crashes
1215 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1216 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1216
1217
1217 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1218 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1218 <marienz-AT-gentoo.org>, closes
1219 <marienz-AT-gentoo.org>, closes
1219 http://www.scipy.net/roundup/ipython/issue51.
1220 http://www.scipy.net/roundup/ipython/issue51.
1220
1221
1221 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1222 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1222
1223
1223 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1224 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1224 problem of excessive CPU usage under *nix and keyboard lag under
1225 problem of excessive CPU usage under *nix and keyboard lag under
1225 win32.
1226 win32.
1226
1227
1227 2006-01-10 *** Released version 0.7.0
1228 2006-01-10 *** Released version 0.7.0
1228
1229
1229 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1230 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1230
1231
1231 * IPython/Release.py (revision): tag version number to 0.7.0,
1232 * IPython/Release.py (revision): tag version number to 0.7.0,
1232 ready for release.
1233 ready for release.
1233
1234
1234 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1235 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1235 it informs the user of the name of the temp. file used. This can
1236 it informs the user of the name of the temp. file used. This can
1236 help if you decide later to reuse that same file, so you know
1237 help if you decide later to reuse that same file, so you know
1237 where to copy the info from.
1238 where to copy the info from.
1238
1239
1239 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1240 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1240
1241
1241 * setup_bdist_egg.py: little script to build an egg. Added
1242 * setup_bdist_egg.py: little script to build an egg. Added
1242 support in the release tools as well.
1243 support in the release tools as well.
1243
1244
1244 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1245 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1245
1246
1246 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1247 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1247 version selection (new -wxversion command line and ipythonrc
1248 version selection (new -wxversion command line and ipythonrc
1248 parameter). Patch contributed by Arnd Baecker
1249 parameter). Patch contributed by Arnd Baecker
1249 <arnd.baecker-AT-web.de>.
1250 <arnd.baecker-AT-web.de>.
1250
1251
1251 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1252 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1252 embedded instances, for variables defined at the interactive
1253 embedded instances, for variables defined at the interactive
1253 prompt of the embedded ipython. Reported by Arnd.
1254 prompt of the embedded ipython. Reported by Arnd.
1254
1255
1255 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1256 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1256 it can be used as a (stateful) toggle, or with a direct parameter.
1257 it can be used as a (stateful) toggle, or with a direct parameter.
1257
1258
1258 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1259 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1259 could be triggered in certain cases and cause the traceback
1260 could be triggered in certain cases and cause the traceback
1260 printer not to work.
1261 printer not to work.
1261
1262
1262 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1263 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1263
1264
1264 * IPython/iplib.py (_should_recompile): Small fix, closes
1265 * IPython/iplib.py (_should_recompile): Small fix, closes
1265 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1266 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1266
1267
1267 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1268 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1268
1269
1269 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1270 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1270 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1271 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1271 Moad for help with tracking it down.
1272 Moad for help with tracking it down.
1272
1273
1273 * IPython/iplib.py (handle_auto): fix autocall handling for
1274 * IPython/iplib.py (handle_auto): fix autocall handling for
1274 objects which support BOTH __getitem__ and __call__ (so that f [x]
1275 objects which support BOTH __getitem__ and __call__ (so that f [x]
1275 is left alone, instead of becoming f([x]) automatically).
1276 is left alone, instead of becoming f([x]) automatically).
1276
1277
1277 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1278 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1278 Ville's patch.
1279 Ville's patch.
1279
1280
1280 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1281 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1281
1282
1282 * IPython/iplib.py (handle_auto): changed autocall semantics to
1283 * IPython/iplib.py (handle_auto): changed autocall semantics to
1283 include 'smart' mode, where the autocall transformation is NOT
1284 include 'smart' mode, where the autocall transformation is NOT
1284 applied if there are no arguments on the line. This allows you to
1285 applied if there are no arguments on the line. This allows you to
1285 just type 'foo' if foo is a callable to see its internal form,
1286 just type 'foo' if foo is a callable to see its internal form,
1286 instead of having it called with no arguments (typically a
1287 instead of having it called with no arguments (typically a
1287 mistake). The old 'full' autocall still exists: for that, you
1288 mistake). The old 'full' autocall still exists: for that, you
1288 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1289 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1289
1290
1290 * IPython/completer.py (Completer.attr_matches): add
1291 * IPython/completer.py (Completer.attr_matches): add
1291 tab-completion support for Enthoughts' traits. After a report by
1292 tab-completion support for Enthoughts' traits. After a report by
1292 Arnd and a patch by Prabhu.
1293 Arnd and a patch by Prabhu.
1293
1294
1294 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1295 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1295
1296
1296 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1297 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1297 Schmolck's patch to fix inspect.getinnerframes().
1298 Schmolck's patch to fix inspect.getinnerframes().
1298
1299
1299 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1300 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1300 for embedded instances, regarding handling of namespaces and items
1301 for embedded instances, regarding handling of namespaces and items
1301 added to the __builtin__ one. Multiple embedded instances and
1302 added to the __builtin__ one. Multiple embedded instances and
1302 recursive embeddings should work better now (though I'm not sure
1303 recursive embeddings should work better now (though I'm not sure
1303 I've got all the corner cases fixed, that code is a bit of a brain
1304 I've got all the corner cases fixed, that code is a bit of a brain
1304 twister).
1305 twister).
1305
1306
1306 * IPython/Magic.py (magic_edit): added support to edit in-memory
1307 * IPython/Magic.py (magic_edit): added support to edit in-memory
1307 macros (automatically creates the necessary temp files). %edit
1308 macros (automatically creates the necessary temp files). %edit
1308 also doesn't return the file contents anymore, it's just noise.
1309 also doesn't return the file contents anymore, it's just noise.
1309
1310
1310 * IPython/completer.py (Completer.attr_matches): revert change to
1311 * IPython/completer.py (Completer.attr_matches): revert change to
1311 complete only on attributes listed in __all__. I realized it
1312 complete only on attributes listed in __all__. I realized it
1312 cripples the tab-completion system as a tool for exploring the
1313 cripples the tab-completion system as a tool for exploring the
1313 internals of unknown libraries (it renders any non-__all__
1314 internals of unknown libraries (it renders any non-__all__
1314 attribute off-limits). I got bit by this when trying to see
1315 attribute off-limits). I got bit by this when trying to see
1315 something inside the dis module.
1316 something inside the dis module.
1316
1317
1317 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1318 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1318
1319
1319 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1320 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1320 namespace for users and extension writers to hold data in. This
1321 namespace for users and extension writers to hold data in. This
1321 follows the discussion in
1322 follows the discussion in
1322 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1323 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1323
1324
1324 * IPython/completer.py (IPCompleter.complete): small patch to help
1325 * IPython/completer.py (IPCompleter.complete): small patch to help
1325 tab-completion under Emacs, after a suggestion by John Barnard
1326 tab-completion under Emacs, after a suggestion by John Barnard
1326 <barnarj-AT-ccf.org>.
1327 <barnarj-AT-ccf.org>.
1327
1328
1328 * IPython/Magic.py (Magic.extract_input_slices): added support for
1329 * IPython/Magic.py (Magic.extract_input_slices): added support for
1329 the slice notation in magics to use N-M to represent numbers N...M
1330 the slice notation in magics to use N-M to represent numbers N...M
1330 (closed endpoints). This is used by %macro and %save.
1331 (closed endpoints). This is used by %macro and %save.
1331
1332
1332 * IPython/completer.py (Completer.attr_matches): for modules which
1333 * IPython/completer.py (Completer.attr_matches): for modules which
1333 define __all__, complete only on those. After a patch by Jeffrey
1334 define __all__, complete only on those. After a patch by Jeffrey
1334 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1335 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1335 speed up this routine.
1336 speed up this routine.
1336
1337
1337 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1338 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1338 don't know if this is the end of it, but the behavior now is
1339 don't know if this is the end of it, but the behavior now is
1339 certainly much more correct. Note that coupled with macros,
1340 certainly much more correct. Note that coupled with macros,
1340 slightly surprising (at first) behavior may occur: a macro will in
1341 slightly surprising (at first) behavior may occur: a macro will in
1341 general expand to multiple lines of input, so upon exiting, the
1342 general expand to multiple lines of input, so upon exiting, the
1342 in/out counters will both be bumped by the corresponding amount
1343 in/out counters will both be bumped by the corresponding amount
1343 (as if the macro's contents had been typed interactively). Typing
1344 (as if the macro's contents had been typed interactively). Typing
1344 %hist will reveal the intermediate (silently processed) lines.
1345 %hist will reveal the intermediate (silently processed) lines.
1345
1346
1346 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1347 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1347 pickle to fail (%run was overwriting __main__ and not restoring
1348 pickle to fail (%run was overwriting __main__ and not restoring
1348 it, but pickle relies on __main__ to operate).
1349 it, but pickle relies on __main__ to operate).
1349
1350
1350 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1351 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1351 using properties, but forgot to make the main InteractiveShell
1352 using properties, but forgot to make the main InteractiveShell
1352 class a new-style class. Properties fail silently, and
1353 class a new-style class. Properties fail silently, and
1353 mysteriously, with old-style class (getters work, but
1354 mysteriously, with old-style class (getters work, but
1354 setters don't do anything).
1355 setters don't do anything).
1355
1356
1356 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1357 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1357
1358
1358 * IPython/Magic.py (magic_history): fix history reporting bug (I
1359 * IPython/Magic.py (magic_history): fix history reporting bug (I
1359 know some nasties are still there, I just can't seem to find a
1360 know some nasties are still there, I just can't seem to find a
1360 reproducible test case to track them down; the input history is
1361 reproducible test case to track them down; the input history is
1361 falling out of sync...)
1362 falling out of sync...)
1362
1363
1363 * IPython/iplib.py (handle_shell_escape): fix bug where both
1364 * IPython/iplib.py (handle_shell_escape): fix bug where both
1364 aliases and system accesses where broken for indented code (such
1365 aliases and system accesses where broken for indented code (such
1365 as loops).
1366 as loops).
1366
1367
1367 * IPython/genutils.py (shell): fix small but critical bug for
1368 * IPython/genutils.py (shell): fix small but critical bug for
1368 win32 system access.
1369 win32 system access.
1369
1370
1370 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1371 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1371
1372
1372 * IPython/iplib.py (showtraceback): remove use of the
1373 * IPython/iplib.py (showtraceback): remove use of the
1373 sys.last_{type/value/traceback} structures, which are non
1374 sys.last_{type/value/traceback} structures, which are non
1374 thread-safe.
1375 thread-safe.
1375 (_prefilter): change control flow to ensure that we NEVER
1376 (_prefilter): change control flow to ensure that we NEVER
1376 introspect objects when autocall is off. This will guarantee that
1377 introspect objects when autocall is off. This will guarantee that
1377 having an input line of the form 'x.y', where access to attribute
1378 having an input line of the form 'x.y', where access to attribute
1378 'y' has side effects, doesn't trigger the side effect TWICE. It
1379 'y' has side effects, doesn't trigger the side effect TWICE. It
1379 is important to note that, with autocall on, these side effects
1380 is important to note that, with autocall on, these side effects
1380 can still happen.
1381 can still happen.
1381 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1382 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1382 trio. IPython offers these three kinds of special calls which are
1383 trio. IPython offers these three kinds of special calls which are
1383 not python code, and it's a good thing to have their call method
1384 not python code, and it's a good thing to have their call method
1384 be accessible as pure python functions (not just special syntax at
1385 be accessible as pure python functions (not just special syntax at
1385 the command line). It gives us a better internal implementation
1386 the command line). It gives us a better internal implementation
1386 structure, as well as exposing these for user scripting more
1387 structure, as well as exposing these for user scripting more
1387 cleanly.
1388 cleanly.
1388
1389
1389 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1390 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1390 file. Now that they'll be more likely to be used with the
1391 file. Now that they'll be more likely to be used with the
1391 persistance system (%store), I want to make sure their module path
1392 persistance system (%store), I want to make sure their module path
1392 doesn't change in the future, so that we don't break things for
1393 doesn't change in the future, so that we don't break things for
1393 users' persisted data.
1394 users' persisted data.
1394
1395
1395 * IPython/iplib.py (autoindent_update): move indentation
1396 * IPython/iplib.py (autoindent_update): move indentation
1396 management into the _text_ processing loop, not the keyboard
1397 management into the _text_ processing loop, not the keyboard
1397 interactive one. This is necessary to correctly process non-typed
1398 interactive one. This is necessary to correctly process non-typed
1398 multiline input (such as macros).
1399 multiline input (such as macros).
1399
1400
1400 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1401 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1401 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1402 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1402 which was producing problems in the resulting manual.
1403 which was producing problems in the resulting manual.
1403 (magic_whos): improve reporting of instances (show their class,
1404 (magic_whos): improve reporting of instances (show their class,
1404 instead of simply printing 'instance' which isn't terribly
1405 instead of simply printing 'instance' which isn't terribly
1405 informative).
1406 informative).
1406
1407
1407 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1408 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1408 (minor mods) to support network shares under win32.
1409 (minor mods) to support network shares under win32.
1409
1410
1410 * IPython/winconsole.py (get_console_size): add new winconsole
1411 * IPython/winconsole.py (get_console_size): add new winconsole
1411 module and fixes to page_dumb() to improve its behavior under
1412 module and fixes to page_dumb() to improve its behavior under
1412 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1413 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1413
1414
1414 * IPython/Magic.py (Macro): simplified Macro class to just
1415 * IPython/Magic.py (Macro): simplified Macro class to just
1415 subclass list. We've had only 2.2 compatibility for a very long
1416 subclass list. We've had only 2.2 compatibility for a very long
1416 time, yet I was still avoiding subclassing the builtin types. No
1417 time, yet I was still avoiding subclassing the builtin types. No
1417 more (I'm also starting to use properties, though I won't shift to
1418 more (I'm also starting to use properties, though I won't shift to
1418 2.3-specific features quite yet).
1419 2.3-specific features quite yet).
1419 (magic_store): added Ville's patch for lightweight variable
1420 (magic_store): added Ville's patch for lightweight variable
1420 persistence, after a request on the user list by Matt Wilkie
1421 persistence, after a request on the user list by Matt Wilkie
1421 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1422 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1422 details.
1423 details.
1423
1424
1424 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1425 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1425 changed the default logfile name from 'ipython.log' to
1426 changed the default logfile name from 'ipython.log' to
1426 'ipython_log.py'. These logs are real python files, and now that
1427 'ipython_log.py'. These logs are real python files, and now that
1427 we have much better multiline support, people are more likely to
1428 we have much better multiline support, people are more likely to
1428 want to use them as such. Might as well name them correctly.
1429 want to use them as such. Might as well name them correctly.
1429
1430
1430 * IPython/Magic.py: substantial cleanup. While we can't stop
1431 * IPython/Magic.py: substantial cleanup. While we can't stop
1431 using magics as mixins, due to the existing customizations 'out
1432 using magics as mixins, due to the existing customizations 'out
1432 there' which rely on the mixin naming conventions, at least I
1433 there' which rely on the mixin naming conventions, at least I
1433 cleaned out all cross-class name usage. So once we are OK with
1434 cleaned out all cross-class name usage. So once we are OK with
1434 breaking compatibility, the two systems can be separated.
1435 breaking compatibility, the two systems can be separated.
1435
1436
1436 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1437 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1437 anymore, and the class is a fair bit less hideous as well. New
1438 anymore, and the class is a fair bit less hideous as well. New
1438 features were also introduced: timestamping of input, and logging
1439 features were also introduced: timestamping of input, and logging
1439 of output results. These are user-visible with the -t and -o
1440 of output results. These are user-visible with the -t and -o
1440 options to %logstart. Closes
1441 options to %logstart. Closes
1441 http://www.scipy.net/roundup/ipython/issue11 and a request by
1442 http://www.scipy.net/roundup/ipython/issue11 and a request by
1442 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1443 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1443
1444
1444 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1445 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1445
1446
1446 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1447 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1447 better handle backslashes in paths. See the thread 'More Windows
1448 better handle backslashes in paths. See the thread 'More Windows
1448 questions part 2 - \/ characters revisited' on the iypthon user
1449 questions part 2 - \/ characters revisited' on the iypthon user
1449 list:
1450 list:
1450 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1451 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1451
1452
1452 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1453 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1453
1454
1454 (InteractiveShell.__init__): change threaded shells to not use the
1455 (InteractiveShell.__init__): change threaded shells to not use the
1455 ipython crash handler. This was causing more problems than not,
1456 ipython crash handler. This was causing more problems than not,
1456 as exceptions in the main thread (GUI code, typically) would
1457 as exceptions in the main thread (GUI code, typically) would
1457 always show up as a 'crash', when they really weren't.
1458 always show up as a 'crash', when they really weren't.
1458
1459
1459 The colors and exception mode commands (%colors/%xmode) have been
1460 The colors and exception mode commands (%colors/%xmode) have been
1460 synchronized to also take this into account, so users can get
1461 synchronized to also take this into account, so users can get
1461 verbose exceptions for their threaded code as well. I also added
1462 verbose exceptions for their threaded code as well. I also added
1462 support for activating pdb inside this exception handler as well,
1463 support for activating pdb inside this exception handler as well,
1463 so now GUI authors can use IPython's enhanced pdb at runtime.
1464 so now GUI authors can use IPython's enhanced pdb at runtime.
1464
1465
1465 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1466 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1466 true by default, and add it to the shipped ipythonrc file. Since
1467 true by default, and add it to the shipped ipythonrc file. Since
1467 this asks the user before proceeding, I think it's OK to make it
1468 this asks the user before proceeding, I think it's OK to make it
1468 true by default.
1469 true by default.
1469
1470
1470 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1471 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1471 of the previous special-casing of input in the eval loop. I think
1472 of the previous special-casing of input in the eval loop. I think
1472 this is cleaner, as they really are commands and shouldn't have
1473 this is cleaner, as they really are commands and shouldn't have
1473 a special role in the middle of the core code.
1474 a special role in the middle of the core code.
1474
1475
1475 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1476 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1476
1477
1477 * IPython/iplib.py (edit_syntax_error): added support for
1478 * IPython/iplib.py (edit_syntax_error): added support for
1478 automatically reopening the editor if the file had a syntax error
1479 automatically reopening the editor if the file had a syntax error
1479 in it. Thanks to scottt who provided the patch at:
1480 in it. Thanks to scottt who provided the patch at:
1480 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1481 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1481 version committed).
1482 version committed).
1482
1483
1483 * IPython/iplib.py (handle_normal): add suport for multi-line
1484 * IPython/iplib.py (handle_normal): add suport for multi-line
1484 input with emtpy lines. This fixes
1485 input with emtpy lines. This fixes
1485 http://www.scipy.net/roundup/ipython/issue43 and a similar
1486 http://www.scipy.net/roundup/ipython/issue43 and a similar
1486 discussion on the user list.
1487 discussion on the user list.
1487
1488
1488 WARNING: a behavior change is necessarily introduced to support
1489 WARNING: a behavior change is necessarily introduced to support
1489 blank lines: now a single blank line with whitespace does NOT
1490 blank lines: now a single blank line with whitespace does NOT
1490 break the input loop, which means that when autoindent is on, by
1491 break the input loop, which means that when autoindent is on, by
1491 default hitting return on the next (indented) line does NOT exit.
1492 default hitting return on the next (indented) line does NOT exit.
1492
1493
1493 Instead, to exit a multiline input you can either have:
1494 Instead, to exit a multiline input you can either have:
1494
1495
1495 - TWO whitespace lines (just hit return again), or
1496 - TWO whitespace lines (just hit return again), or
1496 - a single whitespace line of a different length than provided
1497 - a single whitespace line of a different length than provided
1497 by the autoindent (add or remove a space).
1498 by the autoindent (add or remove a space).
1498
1499
1499 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1500 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1500 module to better organize all readline-related functionality.
1501 module to better organize all readline-related functionality.
1501 I've deleted FlexCompleter and put all completion clases here.
1502 I've deleted FlexCompleter and put all completion clases here.
1502
1503
1503 * IPython/iplib.py (raw_input): improve indentation management.
1504 * IPython/iplib.py (raw_input): improve indentation management.
1504 It is now possible to paste indented code with autoindent on, and
1505 It is now possible to paste indented code with autoindent on, and
1505 the code is interpreted correctly (though it still looks bad on
1506 the code is interpreted correctly (though it still looks bad on
1506 screen, due to the line-oriented nature of ipython).
1507 screen, due to the line-oriented nature of ipython).
1507 (MagicCompleter.complete): change behavior so that a TAB key on an
1508 (MagicCompleter.complete): change behavior so that a TAB key on an
1508 otherwise empty line actually inserts a tab, instead of completing
1509 otherwise empty line actually inserts a tab, instead of completing
1509 on the entire global namespace. This makes it easier to use the
1510 on the entire global namespace. This makes it easier to use the
1510 TAB key for indentation. After a request by Hans Meine
1511 TAB key for indentation. After a request by Hans Meine
1511 <hans_meine-AT-gmx.net>
1512 <hans_meine-AT-gmx.net>
1512 (_prefilter): add support so that typing plain 'exit' or 'quit'
1513 (_prefilter): add support so that typing plain 'exit' or 'quit'
1513 does a sensible thing. Originally I tried to deviate as little as
1514 does a sensible thing. Originally I tried to deviate as little as
1514 possible from the default python behavior, but even that one may
1515 possible from the default python behavior, but even that one may
1515 change in this direction (thread on python-dev to that effect).
1516 change in this direction (thread on python-dev to that effect).
1516 Regardless, ipython should do the right thing even if CPython's
1517 Regardless, ipython should do the right thing even if CPython's
1517 '>>>' prompt doesn't.
1518 '>>>' prompt doesn't.
1518 (InteractiveShell): removed subclassing code.InteractiveConsole
1519 (InteractiveShell): removed subclassing code.InteractiveConsole
1519 class. By now we'd overridden just about all of its methods: I've
1520 class. By now we'd overridden just about all of its methods: I've
1520 copied the remaining two over, and now ipython is a standalone
1521 copied the remaining two over, and now ipython is a standalone
1521 class. This will provide a clearer picture for the chainsaw
1522 class. This will provide a clearer picture for the chainsaw
1522 branch refactoring.
1523 branch refactoring.
1523
1524
1524 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1525 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1525
1526
1526 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1527 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1527 failures for objects which break when dir() is called on them.
1528 failures for objects which break when dir() is called on them.
1528
1529
1529 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1530 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1530 distinct local and global namespaces in the completer API. This
1531 distinct local and global namespaces in the completer API. This
1531 change allows us to properly handle completion with distinct
1532 change allows us to properly handle completion with distinct
1532 scopes, including in embedded instances (this had never really
1533 scopes, including in embedded instances (this had never really
1533 worked correctly).
1534 worked correctly).
1534
1535
1535 Note: this introduces a change in the constructor for
1536 Note: this introduces a change in the constructor for
1536 MagicCompleter, as a new global_namespace parameter is now the
1537 MagicCompleter, as a new global_namespace parameter is now the
1537 second argument (the others were bumped one position).
1538 second argument (the others were bumped one position).
1538
1539
1539 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1540 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1540
1541
1541 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1542 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1542 embedded instances (which can be done now thanks to Vivian's
1543 embedded instances (which can be done now thanks to Vivian's
1543 frame-handling fixes for pdb).
1544 frame-handling fixes for pdb).
1544 (InteractiveShell.__init__): Fix namespace handling problem in
1545 (InteractiveShell.__init__): Fix namespace handling problem in
1545 embedded instances. We were overwriting __main__ unconditionally,
1546 embedded instances. We were overwriting __main__ unconditionally,
1546 and this should only be done for 'full' (non-embedded) IPython;
1547 and this should only be done for 'full' (non-embedded) IPython;
1547 embedded instances must respect the caller's __main__. Thanks to
1548 embedded instances must respect the caller's __main__. Thanks to
1548 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1549 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1549
1550
1550 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1551 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1551
1552
1552 * setup.py: added download_url to setup(). This registers the
1553 * setup.py: added download_url to setup(). This registers the
1553 download address at PyPI, which is not only useful to humans
1554 download address at PyPI, which is not only useful to humans
1554 browsing the site, but is also picked up by setuptools (the Eggs
1555 browsing the site, but is also picked up by setuptools (the Eggs
1555 machinery). Thanks to Ville and R. Kern for the info/discussion
1556 machinery). Thanks to Ville and R. Kern for the info/discussion
1556 on this.
1557 on this.
1557
1558
1558 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1559 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1559
1560
1560 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1561 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1561 This brings a lot of nice functionality to the pdb mode, which now
1562 This brings a lot of nice functionality to the pdb mode, which now
1562 has tab-completion, syntax highlighting, and better stack handling
1563 has tab-completion, syntax highlighting, and better stack handling
1563 than before. Many thanks to Vivian De Smedt
1564 than before. Many thanks to Vivian De Smedt
1564 <vivian-AT-vdesmedt.com> for the original patches.
1565 <vivian-AT-vdesmedt.com> for the original patches.
1565
1566
1566 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1567 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1567
1568
1568 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1569 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1569 sequence to consistently accept the banner argument. The
1570 sequence to consistently accept the banner argument. The
1570 inconsistency was tripping SAGE, thanks to Gary Zablackis
1571 inconsistency was tripping SAGE, thanks to Gary Zablackis
1571 <gzabl-AT-yahoo.com> for the report.
1572 <gzabl-AT-yahoo.com> for the report.
1572
1573
1573 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1574 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1574
1575
1575 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1576 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1576 Fix bug where a naked 'alias' call in the ipythonrc file would
1577 Fix bug where a naked 'alias' call in the ipythonrc file would
1577 cause a crash. Bug reported by Jorgen Stenarson.
1578 cause a crash. Bug reported by Jorgen Stenarson.
1578
1579
1579 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1580 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1580
1581
1581 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1582 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1582 startup time.
1583 startup time.
1583
1584
1584 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1585 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1585 instances had introduced a bug with globals in normal code. Now
1586 instances had introduced a bug with globals in normal code. Now
1586 it's working in all cases.
1587 it's working in all cases.
1587
1588
1588 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1589 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1589 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1590 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1590 has been introduced to set the default case sensitivity of the
1591 has been introduced to set the default case sensitivity of the
1591 searches. Users can still select either mode at runtime on a
1592 searches. Users can still select either mode at runtime on a
1592 per-search basis.
1593 per-search basis.
1593
1594
1594 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1595 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1595
1596
1596 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1597 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1597 attributes in wildcard searches for subclasses. Modified version
1598 attributes in wildcard searches for subclasses. Modified version
1598 of a patch by Jorgen.
1599 of a patch by Jorgen.
1599
1600
1600 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1601 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1601
1602
1602 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1603 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1603 embedded instances. I added a user_global_ns attribute to the
1604 embedded instances. I added a user_global_ns attribute to the
1604 InteractiveShell class to handle this.
1605 InteractiveShell class to handle this.
1605
1606
1606 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1607 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1607
1608
1608 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1609 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1609 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1610 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1610 (reported under win32, but may happen also in other platforms).
1611 (reported under win32, but may happen also in other platforms).
1611 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1612 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1612
1613
1613 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1614 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1614
1615
1615 * IPython/Magic.py (magic_psearch): new support for wildcard
1616 * IPython/Magic.py (magic_psearch): new support for wildcard
1616 patterns. Now, typing ?a*b will list all names which begin with a
1617 patterns. Now, typing ?a*b will list all names which begin with a
1617 and end in b, for example. The %psearch magic has full
1618 and end in b, for example. The %psearch magic has full
1618 docstrings. Many thanks to JΓΆrgen Stenarson
1619 docstrings. Many thanks to JΓΆrgen Stenarson
1619 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1620 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1620 implementing this functionality.
1621 implementing this functionality.
1621
1622
1622 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1623 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1623
1624
1624 * Manual: fixed long-standing annoyance of double-dashes (as in
1625 * Manual: fixed long-standing annoyance of double-dashes (as in
1625 --prefix=~, for example) being stripped in the HTML version. This
1626 --prefix=~, for example) being stripped in the HTML version. This
1626 is a latex2html bug, but a workaround was provided. Many thanks
1627 is a latex2html bug, but a workaround was provided. Many thanks
1627 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1628 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1628 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1629 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1629 rolling. This seemingly small issue had tripped a number of users
1630 rolling. This seemingly small issue had tripped a number of users
1630 when first installing, so I'm glad to see it gone.
1631 when first installing, so I'm glad to see it gone.
1631
1632
1632 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1633 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1633
1634
1634 * IPython/Extensions/numeric_formats.py: fix missing import,
1635 * IPython/Extensions/numeric_formats.py: fix missing import,
1635 reported by Stephen Walton.
1636 reported by Stephen Walton.
1636
1637
1637 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1638 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1638
1639
1639 * IPython/demo.py: finish demo module, fully documented now.
1640 * IPython/demo.py: finish demo module, fully documented now.
1640
1641
1641 * IPython/genutils.py (file_read): simple little utility to read a
1642 * IPython/genutils.py (file_read): simple little utility to read a
1642 file and ensure it's closed afterwards.
1643 file and ensure it's closed afterwards.
1643
1644
1644 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1645 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1645
1646
1646 * IPython/demo.py (Demo.__init__): added support for individually
1647 * IPython/demo.py (Demo.__init__): added support for individually
1647 tagging blocks for automatic execution.
1648 tagging blocks for automatic execution.
1648
1649
1649 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1650 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1650 syntax-highlighted python sources, requested by John.
1651 syntax-highlighted python sources, requested by John.
1651
1652
1652 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1653 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1653
1654
1654 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1655 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1655 finishing.
1656 finishing.
1656
1657
1657 * IPython/genutils.py (shlex_split): moved from Magic to here,
1658 * IPython/genutils.py (shlex_split): moved from Magic to here,
1658 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1659 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1659
1660
1660 * IPython/demo.py (Demo.__init__): added support for silent
1661 * IPython/demo.py (Demo.__init__): added support for silent
1661 blocks, improved marks as regexps, docstrings written.
1662 blocks, improved marks as regexps, docstrings written.
1662 (Demo.__init__): better docstring, added support for sys.argv.
1663 (Demo.__init__): better docstring, added support for sys.argv.
1663
1664
1664 * IPython/genutils.py (marquee): little utility used by the demo
1665 * IPython/genutils.py (marquee): little utility used by the demo
1665 code, handy in general.
1666 code, handy in general.
1666
1667
1667 * IPython/demo.py (Demo.__init__): new class for interactive
1668 * IPython/demo.py (Demo.__init__): new class for interactive
1668 demos. Not documented yet, I just wrote it in a hurry for
1669 demos. Not documented yet, I just wrote it in a hurry for
1669 scipy'05. Will docstring later.
1670 scipy'05. Will docstring later.
1670
1671
1671 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1672 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1672
1673
1673 * IPython/Shell.py (sigint_handler): Drastic simplification which
1674 * IPython/Shell.py (sigint_handler): Drastic simplification which
1674 also seems to make Ctrl-C work correctly across threads! This is
1675 also seems to make Ctrl-C work correctly across threads! This is
1675 so simple, that I can't beleive I'd missed it before. Needs more
1676 so simple, that I can't beleive I'd missed it before. Needs more
1676 testing, though.
1677 testing, though.
1677 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1678 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1678 like this before...
1679 like this before...
1679
1680
1680 * IPython/genutils.py (get_home_dir): add protection against
1681 * IPython/genutils.py (get_home_dir): add protection against
1681 non-dirs in win32 registry.
1682 non-dirs in win32 registry.
1682
1683
1683 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1684 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1684 bug where dict was mutated while iterating (pysh crash).
1685 bug where dict was mutated while iterating (pysh crash).
1685
1686
1686 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1687 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1687
1688
1688 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1689 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1689 spurious newlines added by this routine. After a report by
1690 spurious newlines added by this routine. After a report by
1690 F. Mantegazza.
1691 F. Mantegazza.
1691
1692
1692 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1693 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1693
1694
1694 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1695 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1695 calls. These were a leftover from the GTK 1.x days, and can cause
1696 calls. These were a leftover from the GTK 1.x days, and can cause
1696 problems in certain cases (after a report by John Hunter).
1697 problems in certain cases (after a report by John Hunter).
1697
1698
1698 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1699 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1699 os.getcwd() fails at init time. Thanks to patch from David Remahl
1700 os.getcwd() fails at init time. Thanks to patch from David Remahl
1700 <chmod007-AT-mac.com>.
1701 <chmod007-AT-mac.com>.
1701 (InteractiveShell.__init__): prevent certain special magics from
1702 (InteractiveShell.__init__): prevent certain special magics from
1702 being shadowed by aliases. Closes
1703 being shadowed by aliases. Closes
1703 http://www.scipy.net/roundup/ipython/issue41.
1704 http://www.scipy.net/roundup/ipython/issue41.
1704
1705
1705 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1706 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1706
1707
1707 * IPython/iplib.py (InteractiveShell.complete): Added new
1708 * IPython/iplib.py (InteractiveShell.complete): Added new
1708 top-level completion method to expose the completion mechanism
1709 top-level completion method to expose the completion mechanism
1709 beyond readline-based environments.
1710 beyond readline-based environments.
1710
1711
1711 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1712 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1712
1713
1713 * tools/ipsvnc (svnversion): fix svnversion capture.
1714 * tools/ipsvnc (svnversion): fix svnversion capture.
1714
1715
1715 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1716 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1716 attribute to self, which was missing. Before, it was set by a
1717 attribute to self, which was missing. Before, it was set by a
1717 routine which in certain cases wasn't being called, so the
1718 routine which in certain cases wasn't being called, so the
1718 instance could end up missing the attribute. This caused a crash.
1719 instance could end up missing the attribute. This caused a crash.
1719 Closes http://www.scipy.net/roundup/ipython/issue40.
1720 Closes http://www.scipy.net/roundup/ipython/issue40.
1720
1721
1721 2005-08-16 Fernando Perez <fperez@colorado.edu>
1722 2005-08-16 Fernando Perez <fperez@colorado.edu>
1722
1723
1723 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1724 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1724 contains non-string attribute. Closes
1725 contains non-string attribute. Closes
1725 http://www.scipy.net/roundup/ipython/issue38.
1726 http://www.scipy.net/roundup/ipython/issue38.
1726
1727
1727 2005-08-14 Fernando Perez <fperez@colorado.edu>
1728 2005-08-14 Fernando Perez <fperez@colorado.edu>
1728
1729
1729 * tools/ipsvnc: Minor improvements, to add changeset info.
1730 * tools/ipsvnc: Minor improvements, to add changeset info.
1730
1731
1731 2005-08-12 Fernando Perez <fperez@colorado.edu>
1732 2005-08-12 Fernando Perez <fperez@colorado.edu>
1732
1733
1733 * IPython/iplib.py (runsource): remove self.code_to_run_src
1734 * IPython/iplib.py (runsource): remove self.code_to_run_src
1734 attribute. I realized this is nothing more than
1735 attribute. I realized this is nothing more than
1735 '\n'.join(self.buffer), and having the same data in two different
1736 '\n'.join(self.buffer), and having the same data in two different
1736 places is just asking for synchronization bugs. This may impact
1737 places is just asking for synchronization bugs. This may impact
1737 people who have custom exception handlers, so I need to warn
1738 people who have custom exception handlers, so I need to warn
1738 ipython-dev about it (F. Mantegazza may use them).
1739 ipython-dev about it (F. Mantegazza may use them).
1739
1740
1740 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1741 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1741
1742
1742 * IPython/genutils.py: fix 2.2 compatibility (generators)
1743 * IPython/genutils.py: fix 2.2 compatibility (generators)
1743
1744
1744 2005-07-18 Fernando Perez <fperez@colorado.edu>
1745 2005-07-18 Fernando Perez <fperez@colorado.edu>
1745
1746
1746 * IPython/genutils.py (get_home_dir): fix to help users with
1747 * IPython/genutils.py (get_home_dir): fix to help users with
1747 invalid $HOME under win32.
1748 invalid $HOME under win32.
1748
1749
1749 2005-07-17 Fernando Perez <fperez@colorado.edu>
1750 2005-07-17 Fernando Perez <fperez@colorado.edu>
1750
1751
1751 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1752 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1752 some old hacks and clean up a bit other routines; code should be
1753 some old hacks and clean up a bit other routines; code should be
1753 simpler and a bit faster.
1754 simpler and a bit faster.
1754
1755
1755 * IPython/iplib.py (interact): removed some last-resort attempts
1756 * IPython/iplib.py (interact): removed some last-resort attempts
1756 to survive broken stdout/stderr. That code was only making it
1757 to survive broken stdout/stderr. That code was only making it
1757 harder to abstract out the i/o (necessary for gui integration),
1758 harder to abstract out the i/o (necessary for gui integration),
1758 and the crashes it could prevent were extremely rare in practice
1759 and the crashes it could prevent were extremely rare in practice
1759 (besides being fully user-induced in a pretty violent manner).
1760 (besides being fully user-induced in a pretty violent manner).
1760
1761
1761 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1762 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1762 Nothing major yet, but the code is simpler to read; this should
1763 Nothing major yet, but the code is simpler to read; this should
1763 make it easier to do more serious modifications in the future.
1764 make it easier to do more serious modifications in the future.
1764
1765
1765 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1766 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1766 which broke in .15 (thanks to a report by Ville).
1767 which broke in .15 (thanks to a report by Ville).
1767
1768
1768 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1769 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1769 be quite correct, I know next to nothing about unicode). This
1770 be quite correct, I know next to nothing about unicode). This
1770 will allow unicode strings to be used in prompts, amongst other
1771 will allow unicode strings to be used in prompts, amongst other
1771 cases. It also will prevent ipython from crashing when unicode
1772 cases. It also will prevent ipython from crashing when unicode
1772 shows up unexpectedly in many places. If ascii encoding fails, we
1773 shows up unexpectedly in many places. If ascii encoding fails, we
1773 assume utf_8. Currently the encoding is not a user-visible
1774 assume utf_8. Currently the encoding is not a user-visible
1774 setting, though it could be made so if there is demand for it.
1775 setting, though it could be made so if there is demand for it.
1775
1776
1776 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1777 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1777
1778
1778 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1779 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1779
1780
1780 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1781 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1781
1782
1782 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1783 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1783 code can work transparently for 2.2/2.3.
1784 code can work transparently for 2.2/2.3.
1784
1785
1785 2005-07-16 Fernando Perez <fperez@colorado.edu>
1786 2005-07-16 Fernando Perez <fperez@colorado.edu>
1786
1787
1787 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1788 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1788 out of the color scheme table used for coloring exception
1789 out of the color scheme table used for coloring exception
1789 tracebacks. This allows user code to add new schemes at runtime.
1790 tracebacks. This allows user code to add new schemes at runtime.
1790 This is a minimally modified version of the patch at
1791 This is a minimally modified version of the patch at
1791 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1792 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1792 for the contribution.
1793 for the contribution.
1793
1794
1794 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1795 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1795 slightly modified version of the patch in
1796 slightly modified version of the patch in
1796 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1797 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1797 to remove the previous try/except solution (which was costlier).
1798 to remove the previous try/except solution (which was costlier).
1798 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1799 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1799
1800
1800 2005-06-08 Fernando Perez <fperez@colorado.edu>
1801 2005-06-08 Fernando Perez <fperez@colorado.edu>
1801
1802
1802 * IPython/iplib.py (write/write_err): Add methods to abstract all
1803 * IPython/iplib.py (write/write_err): Add methods to abstract all
1803 I/O a bit more.
1804 I/O a bit more.
1804
1805
1805 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1806 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1806 warning, reported by Aric Hagberg, fix by JD Hunter.
1807 warning, reported by Aric Hagberg, fix by JD Hunter.
1807
1808
1808 2005-06-02 *** Released version 0.6.15
1809 2005-06-02 *** Released version 0.6.15
1809
1810
1810 2005-06-01 Fernando Perez <fperez@colorado.edu>
1811 2005-06-01 Fernando Perez <fperez@colorado.edu>
1811
1812
1812 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1813 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1813 tab-completion of filenames within open-quoted strings. Note that
1814 tab-completion of filenames within open-quoted strings. Note that
1814 this requires that in ~/.ipython/ipythonrc, users change the
1815 this requires that in ~/.ipython/ipythonrc, users change the
1815 readline delimiters configuration to read:
1816 readline delimiters configuration to read:
1816
1817
1817 readline_remove_delims -/~
1818 readline_remove_delims -/~
1818
1819
1819
1820
1820 2005-05-31 *** Released version 0.6.14
1821 2005-05-31 *** Released version 0.6.14
1821
1822
1822 2005-05-29 Fernando Perez <fperez@colorado.edu>
1823 2005-05-29 Fernando Perez <fperez@colorado.edu>
1823
1824
1824 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1825 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1825 with files not on the filesystem. Reported by Eliyahu Sandler
1826 with files not on the filesystem. Reported by Eliyahu Sandler
1826 <eli@gondolin.net>
1827 <eli@gondolin.net>
1827
1828
1828 2005-05-22 Fernando Perez <fperez@colorado.edu>
1829 2005-05-22 Fernando Perez <fperez@colorado.edu>
1829
1830
1830 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1831 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1831 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1832 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1832
1833
1833 2005-05-19 Fernando Perez <fperez@colorado.edu>
1834 2005-05-19 Fernando Perez <fperez@colorado.edu>
1834
1835
1835 * IPython/iplib.py (safe_execfile): close a file which could be
1836 * IPython/iplib.py (safe_execfile): close a file which could be
1836 left open (causing problems in win32, which locks open files).
1837 left open (causing problems in win32, which locks open files).
1837 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1838 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1838
1839
1839 2005-05-18 Fernando Perez <fperez@colorado.edu>
1840 2005-05-18 Fernando Perez <fperez@colorado.edu>
1840
1841
1841 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1842 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1842 keyword arguments correctly to safe_execfile().
1843 keyword arguments correctly to safe_execfile().
1843
1844
1844 2005-05-13 Fernando Perez <fperez@colorado.edu>
1845 2005-05-13 Fernando Perez <fperez@colorado.edu>
1845
1846
1846 * ipython.1: Added info about Qt to manpage, and threads warning
1847 * ipython.1: Added info about Qt to manpage, and threads warning
1847 to usage page (invoked with --help).
1848 to usage page (invoked with --help).
1848
1849
1849 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1850 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1850 new matcher (it goes at the end of the priority list) to do
1851 new matcher (it goes at the end of the priority list) to do
1851 tab-completion on named function arguments. Submitted by George
1852 tab-completion on named function arguments. Submitted by George
1852 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1853 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1853 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1854 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1854 for more details.
1855 for more details.
1855
1856
1856 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1857 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1857 SystemExit exceptions in the script being run. Thanks to a report
1858 SystemExit exceptions in the script being run. Thanks to a report
1858 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1859 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1859 producing very annoying behavior when running unit tests.
1860 producing very annoying behavior when running unit tests.
1860
1861
1861 2005-05-12 Fernando Perez <fperez@colorado.edu>
1862 2005-05-12 Fernando Perez <fperez@colorado.edu>
1862
1863
1863 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1864 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1864 which I'd broken (again) due to a changed regexp. In the process,
1865 which I'd broken (again) due to a changed regexp. In the process,
1865 added ';' as an escape to auto-quote the whole line without
1866 added ';' as an escape to auto-quote the whole line without
1866 splitting its arguments. Thanks to a report by Jerry McRae
1867 splitting its arguments. Thanks to a report by Jerry McRae
1867 <qrs0xyc02-AT-sneakemail.com>.
1868 <qrs0xyc02-AT-sneakemail.com>.
1868
1869
1869 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1870 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1870 possible crashes caused by a TokenError. Reported by Ed Schofield
1871 possible crashes caused by a TokenError. Reported by Ed Schofield
1871 <schofield-AT-ftw.at>.
1872 <schofield-AT-ftw.at>.
1872
1873
1873 2005-05-06 Fernando Perez <fperez@colorado.edu>
1874 2005-05-06 Fernando Perez <fperez@colorado.edu>
1874
1875
1875 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1876 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1876
1877
1877 2005-04-29 Fernando Perez <fperez@colorado.edu>
1878 2005-04-29 Fernando Perez <fperez@colorado.edu>
1878
1879
1879 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1880 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1880 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1881 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1881 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1882 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1882 which provides support for Qt interactive usage (similar to the
1883 which provides support for Qt interactive usage (similar to the
1883 existing one for WX and GTK). This had been often requested.
1884 existing one for WX and GTK). This had been often requested.
1884
1885
1885 2005-04-14 *** Released version 0.6.13
1886 2005-04-14 *** Released version 0.6.13
1886
1887
1887 2005-04-08 Fernando Perez <fperez@colorado.edu>
1888 2005-04-08 Fernando Perez <fperez@colorado.edu>
1888
1889
1889 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1890 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1890 from _ofind, which gets called on almost every input line. Now,
1891 from _ofind, which gets called on almost every input line. Now,
1891 we only try to get docstrings if they are actually going to be
1892 we only try to get docstrings if they are actually going to be
1892 used (the overhead of fetching unnecessary docstrings can be
1893 used (the overhead of fetching unnecessary docstrings can be
1893 noticeable for certain objects, such as Pyro proxies).
1894 noticeable for certain objects, such as Pyro proxies).
1894
1895
1895 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1896 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1896 for completers. For some reason I had been passing them the state
1897 for completers. For some reason I had been passing them the state
1897 variable, which completers never actually need, and was in
1898 variable, which completers never actually need, and was in
1898 conflict with the rlcompleter API. Custom completers ONLY need to
1899 conflict with the rlcompleter API. Custom completers ONLY need to
1899 take the text parameter.
1900 take the text parameter.
1900
1901
1901 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1902 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1902 work correctly in pysh. I've also moved all the logic which used
1903 work correctly in pysh. I've also moved all the logic which used
1903 to be in pysh.py here, which will prevent problems with future
1904 to be in pysh.py here, which will prevent problems with future
1904 upgrades. However, this time I must warn users to update their
1905 upgrades. However, this time I must warn users to update their
1905 pysh profile to include the line
1906 pysh profile to include the line
1906
1907
1907 import_all IPython.Extensions.InterpreterExec
1908 import_all IPython.Extensions.InterpreterExec
1908
1909
1909 because otherwise things won't work for them. They MUST also
1910 because otherwise things won't work for them. They MUST also
1910 delete pysh.py and the line
1911 delete pysh.py and the line
1911
1912
1912 execfile pysh.py
1913 execfile pysh.py
1913
1914
1914 from their ipythonrc-pysh.
1915 from their ipythonrc-pysh.
1915
1916
1916 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1917 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1917 robust in the face of objects whose dir() returns non-strings
1918 robust in the face of objects whose dir() returns non-strings
1918 (which it shouldn't, but some broken libs like ITK do). Thanks to
1919 (which it shouldn't, but some broken libs like ITK do). Thanks to
1919 a patch by John Hunter (implemented differently, though). Also
1920 a patch by John Hunter (implemented differently, though). Also
1920 minor improvements by using .extend instead of + on lists.
1921 minor improvements by using .extend instead of + on lists.
1921
1922
1922 * pysh.py:
1923 * pysh.py:
1923
1924
1924 2005-04-06 Fernando Perez <fperez@colorado.edu>
1925 2005-04-06 Fernando Perez <fperez@colorado.edu>
1925
1926
1926 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1927 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1927 by default, so that all users benefit from it. Those who don't
1928 by default, so that all users benefit from it. Those who don't
1928 want it can still turn it off.
1929 want it can still turn it off.
1929
1930
1930 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1931 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1931 config file, I'd forgotten about this, so users were getting it
1932 config file, I'd forgotten about this, so users were getting it
1932 off by default.
1933 off by default.
1933
1934
1934 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1935 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1935 consistency. Now magics can be called in multiline statements,
1936 consistency. Now magics can be called in multiline statements,
1936 and python variables can be expanded in magic calls via $var.
1937 and python variables can be expanded in magic calls via $var.
1937 This makes the magic system behave just like aliases or !system
1938 This makes the magic system behave just like aliases or !system
1938 calls.
1939 calls.
1939
1940
1940 2005-03-28 Fernando Perez <fperez@colorado.edu>
1941 2005-03-28 Fernando Perez <fperez@colorado.edu>
1941
1942
1942 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1943 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1943 expensive string additions for building command. Add support for
1944 expensive string additions for building command. Add support for
1944 trailing ';' when autocall is used.
1945 trailing ';' when autocall is used.
1945
1946
1946 2005-03-26 Fernando Perez <fperez@colorado.edu>
1947 2005-03-26 Fernando Perez <fperez@colorado.edu>
1947
1948
1948 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1949 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1949 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1950 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1950 ipython.el robust against prompts with any number of spaces
1951 ipython.el robust against prompts with any number of spaces
1951 (including 0) after the ':' character.
1952 (including 0) after the ':' character.
1952
1953
1953 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1954 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1954 continuation prompt, which misled users to think the line was
1955 continuation prompt, which misled users to think the line was
1955 already indented. Closes debian Bug#300847, reported to me by
1956 already indented. Closes debian Bug#300847, reported to me by
1956 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1957 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1957
1958
1958 2005-03-23 Fernando Perez <fperez@colorado.edu>
1959 2005-03-23 Fernando Perez <fperez@colorado.edu>
1959
1960
1960 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1961 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1961 properly aligned if they have embedded newlines.
1962 properly aligned if they have embedded newlines.
1962
1963
1963 * IPython/iplib.py (runlines): Add a public method to expose
1964 * IPython/iplib.py (runlines): Add a public method to expose
1964 IPython's code execution machinery, so that users can run strings
1965 IPython's code execution machinery, so that users can run strings
1965 as if they had been typed at the prompt interactively.
1966 as if they had been typed at the prompt interactively.
1966 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1967 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1967 methods which can call the system shell, but with python variable
1968 methods which can call the system shell, but with python variable
1968 expansion. The three such methods are: __IPYTHON__.system,
1969 expansion. The three such methods are: __IPYTHON__.system,
1969 .getoutput and .getoutputerror. These need to be documented in a
1970 .getoutput and .getoutputerror. These need to be documented in a
1970 'public API' section (to be written) of the manual.
1971 'public API' section (to be written) of the manual.
1971
1972
1972 2005-03-20 Fernando Perez <fperez@colorado.edu>
1973 2005-03-20 Fernando Perez <fperez@colorado.edu>
1973
1974
1974 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1975 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1975 for custom exception handling. This is quite powerful, and it
1976 for custom exception handling. This is quite powerful, and it
1976 allows for user-installable exception handlers which can trap
1977 allows for user-installable exception handlers which can trap
1977 custom exceptions at runtime and treat them separately from
1978 custom exceptions at runtime and treat them separately from
1978 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1979 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1979 Mantegazza <mantegazza-AT-ill.fr>.
1980 Mantegazza <mantegazza-AT-ill.fr>.
1980 (InteractiveShell.set_custom_completer): public API function to
1981 (InteractiveShell.set_custom_completer): public API function to
1981 add new completers at runtime.
1982 add new completers at runtime.
1982
1983
1983 2005-03-19 Fernando Perez <fperez@colorado.edu>
1984 2005-03-19 Fernando Perez <fperez@colorado.edu>
1984
1985
1985 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1986 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1986 allow objects which provide their docstrings via non-standard
1987 allow objects which provide their docstrings via non-standard
1987 mechanisms (like Pyro proxies) to still be inspected by ipython's
1988 mechanisms (like Pyro proxies) to still be inspected by ipython's
1988 ? system.
1989 ? system.
1989
1990
1990 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1991 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1991 automatic capture system. I tried quite hard to make it work
1992 automatic capture system. I tried quite hard to make it work
1992 reliably, and simply failed. I tried many combinations with the
1993 reliably, and simply failed. I tried many combinations with the
1993 subprocess module, but eventually nothing worked in all needed
1994 subprocess module, but eventually nothing worked in all needed
1994 cases (not blocking stdin for the child, duplicating stdout
1995 cases (not blocking stdin for the child, duplicating stdout
1995 without blocking, etc). The new %sc/%sx still do capture to these
1996 without blocking, etc). The new %sc/%sx still do capture to these
1996 magical list/string objects which make shell use much more
1997 magical list/string objects which make shell use much more
1997 conveninent, so not all is lost.
1998 conveninent, so not all is lost.
1998
1999
1999 XXX - FIX MANUAL for the change above!
2000 XXX - FIX MANUAL for the change above!
2000
2001
2001 (runsource): I copied code.py's runsource() into ipython to modify
2002 (runsource): I copied code.py's runsource() into ipython to modify
2002 it a bit. Now the code object and source to be executed are
2003 it a bit. Now the code object and source to be executed are
2003 stored in ipython. This makes this info accessible to third-party
2004 stored in ipython. This makes this info accessible to third-party
2004 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2005 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2005 Mantegazza <mantegazza-AT-ill.fr>.
2006 Mantegazza <mantegazza-AT-ill.fr>.
2006
2007
2007 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2008 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2008 history-search via readline (like C-p/C-n). I'd wanted this for a
2009 history-search via readline (like C-p/C-n). I'd wanted this for a
2009 long time, but only recently found out how to do it. For users
2010 long time, but only recently found out how to do it. For users
2010 who already have their ipythonrc files made and want this, just
2011 who already have their ipythonrc files made and want this, just
2011 add:
2012 add:
2012
2013
2013 readline_parse_and_bind "\e[A": history-search-backward
2014 readline_parse_and_bind "\e[A": history-search-backward
2014 readline_parse_and_bind "\e[B": history-search-forward
2015 readline_parse_and_bind "\e[B": history-search-forward
2015
2016
2016 2005-03-18 Fernando Perez <fperez@colorado.edu>
2017 2005-03-18 Fernando Perez <fperez@colorado.edu>
2017
2018
2018 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2019 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2019 LSString and SList classes which allow transparent conversions
2020 LSString and SList classes which allow transparent conversions
2020 between list mode and whitespace-separated string.
2021 between list mode and whitespace-separated string.
2021 (magic_r): Fix recursion problem in %r.
2022 (magic_r): Fix recursion problem in %r.
2022
2023
2023 * IPython/genutils.py (LSString): New class to be used for
2024 * IPython/genutils.py (LSString): New class to be used for
2024 automatic storage of the results of all alias/system calls in _o
2025 automatic storage of the results of all alias/system calls in _o
2025 and _e (stdout/err). These provide a .l/.list attribute which
2026 and _e (stdout/err). These provide a .l/.list attribute which
2026 does automatic splitting on newlines. This means that for most
2027 does automatic splitting on newlines. This means that for most
2027 uses, you'll never need to do capturing of output with %sc/%sx
2028 uses, you'll never need to do capturing of output with %sc/%sx
2028 anymore, since ipython keeps this always done for you. Note that
2029 anymore, since ipython keeps this always done for you. Note that
2029 only the LAST results are stored, the _o/e variables are
2030 only the LAST results are stored, the _o/e variables are
2030 overwritten on each call. If you need to save their contents
2031 overwritten on each call. If you need to save their contents
2031 further, simply bind them to any other name.
2032 further, simply bind them to any other name.
2032
2033
2033 2005-03-17 Fernando Perez <fperez@colorado.edu>
2034 2005-03-17 Fernando Perez <fperez@colorado.edu>
2034
2035
2035 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2036 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2036 prompt namespace handling.
2037 prompt namespace handling.
2037
2038
2038 2005-03-16 Fernando Perez <fperez@colorado.edu>
2039 2005-03-16 Fernando Perez <fperez@colorado.edu>
2039
2040
2040 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2041 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2041 classic prompts to be '>>> ' (final space was missing, and it
2042 classic prompts to be '>>> ' (final space was missing, and it
2042 trips the emacs python mode).
2043 trips the emacs python mode).
2043 (BasePrompt.__str__): Added safe support for dynamic prompt
2044 (BasePrompt.__str__): Added safe support for dynamic prompt
2044 strings. Now you can set your prompt string to be '$x', and the
2045 strings. Now you can set your prompt string to be '$x', and the
2045 value of x will be printed from your interactive namespace. The
2046 value of x will be printed from your interactive namespace. The
2046 interpolation syntax includes the full Itpl support, so
2047 interpolation syntax includes the full Itpl support, so
2047 ${foo()+x+bar()} is a valid prompt string now, and the function
2048 ${foo()+x+bar()} is a valid prompt string now, and the function
2048 calls will be made at runtime.
2049 calls will be made at runtime.
2049
2050
2050 2005-03-15 Fernando Perez <fperez@colorado.edu>
2051 2005-03-15 Fernando Perez <fperez@colorado.edu>
2051
2052
2052 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2053 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2053 avoid name clashes in pylab. %hist still works, it just forwards
2054 avoid name clashes in pylab. %hist still works, it just forwards
2054 the call to %history.
2055 the call to %history.
2055
2056
2056 2005-03-02 *** Released version 0.6.12
2057 2005-03-02 *** Released version 0.6.12
2057
2058
2058 2005-03-02 Fernando Perez <fperez@colorado.edu>
2059 2005-03-02 Fernando Perez <fperez@colorado.edu>
2059
2060
2060 * IPython/iplib.py (handle_magic): log magic calls properly as
2061 * IPython/iplib.py (handle_magic): log magic calls properly as
2061 ipmagic() function calls.
2062 ipmagic() function calls.
2062
2063
2063 * IPython/Magic.py (magic_time): Improved %time to support
2064 * IPython/Magic.py (magic_time): Improved %time to support
2064 statements and provide wall-clock as well as CPU time.
2065 statements and provide wall-clock as well as CPU time.
2065
2066
2066 2005-02-27 Fernando Perez <fperez@colorado.edu>
2067 2005-02-27 Fernando Perez <fperez@colorado.edu>
2067
2068
2068 * IPython/hooks.py: New hooks module, to expose user-modifiable
2069 * IPython/hooks.py: New hooks module, to expose user-modifiable
2069 IPython functionality in a clean manner. For now only the editor
2070 IPython functionality in a clean manner. For now only the editor
2070 hook is actually written, and other thigns which I intend to turn
2071 hook is actually written, and other thigns which I intend to turn
2071 into proper hooks aren't yet there. The display and prefilter
2072 into proper hooks aren't yet there. The display and prefilter
2072 stuff, for example, should be hooks. But at least now the
2073 stuff, for example, should be hooks. But at least now the
2073 framework is in place, and the rest can be moved here with more
2074 framework is in place, and the rest can be moved here with more
2074 time later. IPython had had a .hooks variable for a long time for
2075 time later. IPython had had a .hooks variable for a long time for
2075 this purpose, but I'd never actually used it for anything.
2076 this purpose, but I'd never actually used it for anything.
2076
2077
2077 2005-02-26 Fernando Perez <fperez@colorado.edu>
2078 2005-02-26 Fernando Perez <fperez@colorado.edu>
2078
2079
2079 * IPython/ipmaker.py (make_IPython): make the default ipython
2080 * IPython/ipmaker.py (make_IPython): make the default ipython
2080 directory be called _ipython under win32, to follow more the
2081 directory be called _ipython under win32, to follow more the
2081 naming peculiarities of that platform (where buggy software like
2082 naming peculiarities of that platform (where buggy software like
2082 Visual Sourcesafe breaks with .named directories). Reported by
2083 Visual Sourcesafe breaks with .named directories). Reported by
2083 Ville Vainio.
2084 Ville Vainio.
2084
2085
2085 2005-02-23 Fernando Perez <fperez@colorado.edu>
2086 2005-02-23 Fernando Perez <fperez@colorado.edu>
2086
2087
2087 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2088 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2088 auto_aliases for win32 which were causing problems. Users can
2089 auto_aliases for win32 which were causing problems. Users can
2089 define the ones they personally like.
2090 define the ones they personally like.
2090
2091
2091 2005-02-21 Fernando Perez <fperez@colorado.edu>
2092 2005-02-21 Fernando Perez <fperez@colorado.edu>
2092
2093
2093 * IPython/Magic.py (magic_time): new magic to time execution of
2094 * IPython/Magic.py (magic_time): new magic to time execution of
2094 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2095 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2095
2096
2096 2005-02-19 Fernando Perez <fperez@colorado.edu>
2097 2005-02-19 Fernando Perez <fperez@colorado.edu>
2097
2098
2098 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2099 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2099 into keys (for prompts, for example).
2100 into keys (for prompts, for example).
2100
2101
2101 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2102 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2102 prompts in case users want them. This introduces a small behavior
2103 prompts in case users want them. This introduces a small behavior
2103 change: ipython does not automatically add a space to all prompts
2104 change: ipython does not automatically add a space to all prompts
2104 anymore. To get the old prompts with a space, users should add it
2105 anymore. To get the old prompts with a space, users should add it
2105 manually to their ipythonrc file, so for example prompt_in1 should
2106 manually to their ipythonrc file, so for example prompt_in1 should
2106 now read 'In [\#]: ' instead of 'In [\#]:'.
2107 now read 'In [\#]: ' instead of 'In [\#]:'.
2107 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2108 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2108 file) to control left-padding of secondary prompts.
2109 file) to control left-padding of secondary prompts.
2109
2110
2110 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2111 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2111 the profiler can't be imported. Fix for Debian, which removed
2112 the profiler can't be imported. Fix for Debian, which removed
2112 profile.py because of License issues. I applied a slightly
2113 profile.py because of License issues. I applied a slightly
2113 modified version of the original Debian patch at
2114 modified version of the original Debian patch at
2114 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2115 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2115
2116
2116 2005-02-17 Fernando Perez <fperez@colorado.edu>
2117 2005-02-17 Fernando Perez <fperez@colorado.edu>
2117
2118
2118 * IPython/genutils.py (native_line_ends): Fix bug which would
2119 * IPython/genutils.py (native_line_ends): Fix bug which would
2119 cause improper line-ends under win32 b/c I was not opening files
2120 cause improper line-ends under win32 b/c I was not opening files
2120 in binary mode. Bug report and fix thanks to Ville.
2121 in binary mode. Bug report and fix thanks to Ville.
2121
2122
2122 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2123 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2123 trying to catch spurious foo[1] autocalls. My fix actually broke
2124 trying to catch spurious foo[1] autocalls. My fix actually broke
2124 ',/' autoquote/call with explicit escape (bad regexp).
2125 ',/' autoquote/call with explicit escape (bad regexp).
2125
2126
2126 2005-02-15 *** Released version 0.6.11
2127 2005-02-15 *** Released version 0.6.11
2127
2128
2128 2005-02-14 Fernando Perez <fperez@colorado.edu>
2129 2005-02-14 Fernando Perez <fperez@colorado.edu>
2129
2130
2130 * IPython/background_jobs.py: New background job management
2131 * IPython/background_jobs.py: New background job management
2131 subsystem. This is implemented via a new set of classes, and
2132 subsystem. This is implemented via a new set of classes, and
2132 IPython now provides a builtin 'jobs' object for background job
2133 IPython now provides a builtin 'jobs' object for background job
2133 execution. A convenience %bg magic serves as a lightweight
2134 execution. A convenience %bg magic serves as a lightweight
2134 frontend for starting the more common type of calls. This was
2135 frontend for starting the more common type of calls. This was
2135 inspired by discussions with B. Granger and the BackgroundCommand
2136 inspired by discussions with B. Granger and the BackgroundCommand
2136 class described in the book Python Scripting for Computational
2137 class described in the book Python Scripting for Computational
2137 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2138 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2138 (although ultimately no code from this text was used, as IPython's
2139 (although ultimately no code from this text was used, as IPython's
2139 system is a separate implementation).
2140 system is a separate implementation).
2140
2141
2141 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2142 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2142 to control the completion of single/double underscore names
2143 to control the completion of single/double underscore names
2143 separately. As documented in the example ipytonrc file, the
2144 separately. As documented in the example ipytonrc file, the
2144 readline_omit__names variable can now be set to 2, to omit even
2145 readline_omit__names variable can now be set to 2, to omit even
2145 single underscore names. Thanks to a patch by Brian Wong
2146 single underscore names. Thanks to a patch by Brian Wong
2146 <BrianWong-AT-AirgoNetworks.Com>.
2147 <BrianWong-AT-AirgoNetworks.Com>.
2147 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2148 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2148 be autocalled as foo([1]) if foo were callable. A problem for
2149 be autocalled as foo([1]) if foo were callable. A problem for
2149 things which are both callable and implement __getitem__.
2150 things which are both callable and implement __getitem__.
2150 (init_readline): Fix autoindentation for win32. Thanks to a patch
2151 (init_readline): Fix autoindentation for win32. Thanks to a patch
2151 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2152 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2152
2153
2153 2005-02-12 Fernando Perez <fperez@colorado.edu>
2154 2005-02-12 Fernando Perez <fperez@colorado.edu>
2154
2155
2155 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2156 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2156 which I had written long ago to sort out user error messages which
2157 which I had written long ago to sort out user error messages which
2157 may occur during startup. This seemed like a good idea initially,
2158 may occur during startup. This seemed like a good idea initially,
2158 but it has proven a disaster in retrospect. I don't want to
2159 but it has proven a disaster in retrospect. I don't want to
2159 change much code for now, so my fix is to set the internal 'debug'
2160 change much code for now, so my fix is to set the internal 'debug'
2160 flag to true everywhere, whose only job was precisely to control
2161 flag to true everywhere, whose only job was precisely to control
2161 this subsystem. This closes issue 28 (as well as avoiding all
2162 this subsystem. This closes issue 28 (as well as avoiding all
2162 sorts of strange hangups which occur from time to time).
2163 sorts of strange hangups which occur from time to time).
2163
2164
2164 2005-02-07 Fernando Perez <fperez@colorado.edu>
2165 2005-02-07 Fernando Perez <fperez@colorado.edu>
2165
2166
2166 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2167 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2167 previous call produced a syntax error.
2168 previous call produced a syntax error.
2168
2169
2169 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2170 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2170 classes without constructor.
2171 classes without constructor.
2171
2172
2172 2005-02-06 Fernando Perez <fperez@colorado.edu>
2173 2005-02-06 Fernando Perez <fperez@colorado.edu>
2173
2174
2174 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2175 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2175 completions with the results of each matcher, so we return results
2176 completions with the results of each matcher, so we return results
2176 to the user from all namespaces. This breaks with ipython
2177 to the user from all namespaces. This breaks with ipython
2177 tradition, but I think it's a nicer behavior. Now you get all
2178 tradition, but I think it's a nicer behavior. Now you get all
2178 possible completions listed, from all possible namespaces (python,
2179 possible completions listed, from all possible namespaces (python,
2179 filesystem, magics...) After a request by John Hunter
2180 filesystem, magics...) After a request by John Hunter
2180 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2181 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2181
2182
2182 2005-02-05 Fernando Perez <fperez@colorado.edu>
2183 2005-02-05 Fernando Perez <fperez@colorado.edu>
2183
2184
2184 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2185 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2185 the call had quote characters in it (the quotes were stripped).
2186 the call had quote characters in it (the quotes were stripped).
2186
2187
2187 2005-01-31 Fernando Perez <fperez@colorado.edu>
2188 2005-01-31 Fernando Perez <fperez@colorado.edu>
2188
2189
2189 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2190 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2190 Itpl.itpl() to make the code more robust against psyco
2191 Itpl.itpl() to make the code more robust against psyco
2191 optimizations.
2192 optimizations.
2192
2193
2193 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2194 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2194 of causing an exception. Quicker, cleaner.
2195 of causing an exception. Quicker, cleaner.
2195
2196
2196 2005-01-28 Fernando Perez <fperez@colorado.edu>
2197 2005-01-28 Fernando Perez <fperez@colorado.edu>
2197
2198
2198 * scripts/ipython_win_post_install.py (install): hardcode
2199 * scripts/ipython_win_post_install.py (install): hardcode
2199 sys.prefix+'python.exe' as the executable path. It turns out that
2200 sys.prefix+'python.exe' as the executable path. It turns out that
2200 during the post-installation run, sys.executable resolves to the
2201 during the post-installation run, sys.executable resolves to the
2201 name of the binary installer! I should report this as a distutils
2202 name of the binary installer! I should report this as a distutils
2202 bug, I think. I updated the .10 release with this tiny fix, to
2203 bug, I think. I updated the .10 release with this tiny fix, to
2203 avoid annoying the lists further.
2204 avoid annoying the lists further.
2204
2205
2205 2005-01-27 *** Released version 0.6.10
2206 2005-01-27 *** Released version 0.6.10
2206
2207
2207 2005-01-27 Fernando Perez <fperez@colorado.edu>
2208 2005-01-27 Fernando Perez <fperez@colorado.edu>
2208
2209
2209 * IPython/numutils.py (norm): Added 'inf' as optional name for
2210 * IPython/numutils.py (norm): Added 'inf' as optional name for
2210 L-infinity norm, included references to mathworld.com for vector
2211 L-infinity norm, included references to mathworld.com for vector
2211 norm definitions.
2212 norm definitions.
2212 (amin/amax): added amin/amax for array min/max. Similar to what
2213 (amin/amax): added amin/amax for array min/max. Similar to what
2213 pylab ships with after the recent reorganization of names.
2214 pylab ships with after the recent reorganization of names.
2214 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2215 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2215
2216
2216 * ipython.el: committed Alex's recent fixes and improvements.
2217 * ipython.el: committed Alex's recent fixes and improvements.
2217 Tested with python-mode from CVS, and it looks excellent. Since
2218 Tested with python-mode from CVS, and it looks excellent. Since
2218 python-mode hasn't released anything in a while, I'm temporarily
2219 python-mode hasn't released anything in a while, I'm temporarily
2219 putting a copy of today's CVS (v 4.70) of python-mode in:
2220 putting a copy of today's CVS (v 4.70) of python-mode in:
2220 http://ipython.scipy.org/tmp/python-mode.el
2221 http://ipython.scipy.org/tmp/python-mode.el
2221
2222
2222 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2223 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2223 sys.executable for the executable name, instead of assuming it's
2224 sys.executable for the executable name, instead of assuming it's
2224 called 'python.exe' (the post-installer would have produced broken
2225 called 'python.exe' (the post-installer would have produced broken
2225 setups on systems with a differently named python binary).
2226 setups on systems with a differently named python binary).
2226
2227
2227 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2228 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2228 references to os.linesep, to make the code more
2229 references to os.linesep, to make the code more
2229 platform-independent. This is also part of the win32 coloring
2230 platform-independent. This is also part of the win32 coloring
2230 fixes.
2231 fixes.
2231
2232
2232 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2233 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2233 lines, which actually cause coloring bugs because the length of
2234 lines, which actually cause coloring bugs because the length of
2234 the line is very difficult to correctly compute with embedded
2235 the line is very difficult to correctly compute with embedded
2235 escapes. This was the source of all the coloring problems under
2236 escapes. This was the source of all the coloring problems under
2236 Win32. I think that _finally_, Win32 users have a properly
2237 Win32. I think that _finally_, Win32 users have a properly
2237 working ipython in all respects. This would never have happened
2238 working ipython in all respects. This would never have happened
2238 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2239 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2239
2240
2240 2005-01-26 *** Released version 0.6.9
2241 2005-01-26 *** Released version 0.6.9
2241
2242
2242 2005-01-25 Fernando Perez <fperez@colorado.edu>
2243 2005-01-25 Fernando Perez <fperez@colorado.edu>
2243
2244
2244 * setup.py: finally, we have a true Windows installer, thanks to
2245 * setup.py: finally, we have a true Windows installer, thanks to
2245 the excellent work of Viktor Ransmayr
2246 the excellent work of Viktor Ransmayr
2246 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2247 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2247 Windows users. The setup routine is quite a bit cleaner thanks to
2248 Windows users. The setup routine is quite a bit cleaner thanks to
2248 this, and the post-install script uses the proper functions to
2249 this, and the post-install script uses the proper functions to
2249 allow a clean de-installation using the standard Windows Control
2250 allow a clean de-installation using the standard Windows Control
2250 Panel.
2251 Panel.
2251
2252
2252 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2253 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2253 environment variable under all OSes (including win32) if
2254 environment variable under all OSes (including win32) if
2254 available. This will give consistency to win32 users who have set
2255 available. This will give consistency to win32 users who have set
2255 this variable for any reason. If os.environ['HOME'] fails, the
2256 this variable for any reason. If os.environ['HOME'] fails, the
2256 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2257 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2257
2258
2258 2005-01-24 Fernando Perez <fperez@colorado.edu>
2259 2005-01-24 Fernando Perez <fperez@colorado.edu>
2259
2260
2260 * IPython/numutils.py (empty_like): add empty_like(), similar to
2261 * IPython/numutils.py (empty_like): add empty_like(), similar to
2261 zeros_like() but taking advantage of the new empty() Numeric routine.
2262 zeros_like() but taking advantage of the new empty() Numeric routine.
2262
2263
2263 2005-01-23 *** Released version 0.6.8
2264 2005-01-23 *** Released version 0.6.8
2264
2265
2265 2005-01-22 Fernando Perez <fperez@colorado.edu>
2266 2005-01-22 Fernando Perez <fperez@colorado.edu>
2266
2267
2267 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2268 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2268 automatic show() calls. After discussing things with JDH, it
2269 automatic show() calls. After discussing things with JDH, it
2269 turns out there are too many corner cases where this can go wrong.
2270 turns out there are too many corner cases where this can go wrong.
2270 It's best not to try to be 'too smart', and simply have ipython
2271 It's best not to try to be 'too smart', and simply have ipython
2271 reproduce as much as possible the default behavior of a normal
2272 reproduce as much as possible the default behavior of a normal
2272 python shell.
2273 python shell.
2273
2274
2274 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2275 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2275 line-splitting regexp and _prefilter() to avoid calling getattr()
2276 line-splitting regexp and _prefilter() to avoid calling getattr()
2276 on assignments. This closes
2277 on assignments. This closes
2277 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2278 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2278 readline uses getattr(), so a simple <TAB> keypress is still
2279 readline uses getattr(), so a simple <TAB> keypress is still
2279 enough to trigger getattr() calls on an object.
2280 enough to trigger getattr() calls on an object.
2280
2281
2281 2005-01-21 Fernando Perez <fperez@colorado.edu>
2282 2005-01-21 Fernando Perez <fperez@colorado.edu>
2282
2283
2283 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2284 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2284 docstring under pylab so it doesn't mask the original.
2285 docstring under pylab so it doesn't mask the original.
2285
2286
2286 2005-01-21 *** Released version 0.6.7
2287 2005-01-21 *** Released version 0.6.7
2287
2288
2288 2005-01-21 Fernando Perez <fperez@colorado.edu>
2289 2005-01-21 Fernando Perez <fperez@colorado.edu>
2289
2290
2290 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2291 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2291 signal handling for win32 users in multithreaded mode.
2292 signal handling for win32 users in multithreaded mode.
2292
2293
2293 2005-01-17 Fernando Perez <fperez@colorado.edu>
2294 2005-01-17 Fernando Perez <fperez@colorado.edu>
2294
2295
2295 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2296 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2296 instances with no __init__. After a crash report by Norbert Nemec
2297 instances with no __init__. After a crash report by Norbert Nemec
2297 <Norbert-AT-nemec-online.de>.
2298 <Norbert-AT-nemec-online.de>.
2298
2299
2299 2005-01-14 Fernando Perez <fperez@colorado.edu>
2300 2005-01-14 Fernando Perez <fperez@colorado.edu>
2300
2301
2301 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2302 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2302 names for verbose exceptions, when multiple dotted names and the
2303 names for verbose exceptions, when multiple dotted names and the
2303 'parent' object were present on the same line.
2304 'parent' object were present on the same line.
2304
2305
2305 2005-01-11 Fernando Perez <fperez@colorado.edu>
2306 2005-01-11 Fernando Perez <fperez@colorado.edu>
2306
2307
2307 * IPython/genutils.py (flag_calls): new utility to trap and flag
2308 * IPython/genutils.py (flag_calls): new utility to trap and flag
2308 calls in functions. I need it to clean up matplotlib support.
2309 calls in functions. I need it to clean up matplotlib support.
2309 Also removed some deprecated code in genutils.
2310 Also removed some deprecated code in genutils.
2310
2311
2311 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2312 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2312 that matplotlib scripts called with %run, which don't call show()
2313 that matplotlib scripts called with %run, which don't call show()
2313 themselves, still have their plotting windows open.
2314 themselves, still have their plotting windows open.
2314
2315
2315 2005-01-05 Fernando Perez <fperez@colorado.edu>
2316 2005-01-05 Fernando Perez <fperez@colorado.edu>
2316
2317
2317 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2318 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2318 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2319 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2319
2320
2320 2004-12-19 Fernando Perez <fperez@colorado.edu>
2321 2004-12-19 Fernando Perez <fperez@colorado.edu>
2321
2322
2322 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2323 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2323 parent_runcode, which was an eyesore. The same result can be
2324 parent_runcode, which was an eyesore. The same result can be
2324 obtained with Python's regular superclass mechanisms.
2325 obtained with Python's regular superclass mechanisms.
2325
2326
2326 2004-12-17 Fernando Perez <fperez@colorado.edu>
2327 2004-12-17 Fernando Perez <fperez@colorado.edu>
2327
2328
2328 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2329 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2329 reported by Prabhu.
2330 reported by Prabhu.
2330 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2331 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2331 sys.stderr) instead of explicitly calling sys.stderr. This helps
2332 sys.stderr) instead of explicitly calling sys.stderr. This helps
2332 maintain our I/O abstractions clean, for future GUI embeddings.
2333 maintain our I/O abstractions clean, for future GUI embeddings.
2333
2334
2334 * IPython/genutils.py (info): added new utility for sys.stderr
2335 * IPython/genutils.py (info): added new utility for sys.stderr
2335 unified info message handling (thin wrapper around warn()).
2336 unified info message handling (thin wrapper around warn()).
2336
2337
2337 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2338 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2338 composite (dotted) names on verbose exceptions.
2339 composite (dotted) names on verbose exceptions.
2339 (VerboseTB.nullrepr): harden against another kind of errors which
2340 (VerboseTB.nullrepr): harden against another kind of errors which
2340 Python's inspect module can trigger, and which were crashing
2341 Python's inspect module can trigger, and which were crashing
2341 IPython. Thanks to a report by Marco Lombardi
2342 IPython. Thanks to a report by Marco Lombardi
2342 <mlombard-AT-ma010192.hq.eso.org>.
2343 <mlombard-AT-ma010192.hq.eso.org>.
2343
2344
2344 2004-12-13 *** Released version 0.6.6
2345 2004-12-13 *** Released version 0.6.6
2345
2346
2346 2004-12-12 Fernando Perez <fperez@colorado.edu>
2347 2004-12-12 Fernando Perez <fperez@colorado.edu>
2347
2348
2348 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2349 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2349 generated by pygtk upon initialization if it was built without
2350 generated by pygtk upon initialization if it was built without
2350 threads (for matplotlib users). After a crash reported by
2351 threads (for matplotlib users). After a crash reported by
2351 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2352 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2352
2353
2353 * IPython/ipmaker.py (make_IPython): fix small bug in the
2354 * IPython/ipmaker.py (make_IPython): fix small bug in the
2354 import_some parameter for multiple imports.
2355 import_some parameter for multiple imports.
2355
2356
2356 * IPython/iplib.py (ipmagic): simplified the interface of
2357 * IPython/iplib.py (ipmagic): simplified the interface of
2357 ipmagic() to take a single string argument, just as it would be
2358 ipmagic() to take a single string argument, just as it would be
2358 typed at the IPython cmd line.
2359 typed at the IPython cmd line.
2359 (ipalias): Added new ipalias() with an interface identical to
2360 (ipalias): Added new ipalias() with an interface identical to
2360 ipmagic(). This completes exposing a pure python interface to the
2361 ipmagic(). This completes exposing a pure python interface to the
2361 alias and magic system, which can be used in loops or more complex
2362 alias and magic system, which can be used in loops or more complex
2362 code where IPython's automatic line mangling is not active.
2363 code where IPython's automatic line mangling is not active.
2363
2364
2364 * IPython/genutils.py (timing): changed interface of timing to
2365 * IPython/genutils.py (timing): changed interface of timing to
2365 simply run code once, which is the most common case. timings()
2366 simply run code once, which is the most common case. timings()
2366 remains unchanged, for the cases where you want multiple runs.
2367 remains unchanged, for the cases where you want multiple runs.
2367
2368
2368 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2369 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2369 bug where Python2.2 crashes with exec'ing code which does not end
2370 bug where Python2.2 crashes with exec'ing code which does not end
2370 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2371 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2371 before.
2372 before.
2372
2373
2373 2004-12-10 Fernando Perez <fperez@colorado.edu>
2374 2004-12-10 Fernando Perez <fperez@colorado.edu>
2374
2375
2375 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2376 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2376 -t to -T, to accomodate the new -t flag in %run (the %run and
2377 -t to -T, to accomodate the new -t flag in %run (the %run and
2377 %prun options are kind of intermixed, and it's not easy to change
2378 %prun options are kind of intermixed, and it's not easy to change
2378 this with the limitations of python's getopt).
2379 this with the limitations of python's getopt).
2379
2380
2380 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2381 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2381 the execution of scripts. It's not as fine-tuned as timeit.py,
2382 the execution of scripts. It's not as fine-tuned as timeit.py,
2382 but it works from inside ipython (and under 2.2, which lacks
2383 but it works from inside ipython (and under 2.2, which lacks
2383 timeit.py). Optionally a number of runs > 1 can be given for
2384 timeit.py). Optionally a number of runs > 1 can be given for
2384 timing very short-running code.
2385 timing very short-running code.
2385
2386
2386 * IPython/genutils.py (uniq_stable): new routine which returns a
2387 * IPython/genutils.py (uniq_stable): new routine which returns a
2387 list of unique elements in any iterable, but in stable order of
2388 list of unique elements in any iterable, but in stable order of
2388 appearance. I needed this for the ultraTB fixes, and it's a handy
2389 appearance. I needed this for the ultraTB fixes, and it's a handy
2389 utility.
2390 utility.
2390
2391
2391 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2392 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2392 dotted names in Verbose exceptions. This had been broken since
2393 dotted names in Verbose exceptions. This had been broken since
2393 the very start, now x.y will properly be printed in a Verbose
2394 the very start, now x.y will properly be printed in a Verbose
2394 traceback, instead of x being shown and y appearing always as an
2395 traceback, instead of x being shown and y appearing always as an
2395 'undefined global'. Getting this to work was a bit tricky,
2396 'undefined global'. Getting this to work was a bit tricky,
2396 because by default python tokenizers are stateless. Saved by
2397 because by default python tokenizers are stateless. Saved by
2397 python's ability to easily add a bit of state to an arbitrary
2398 python's ability to easily add a bit of state to an arbitrary
2398 function (without needing to build a full-blown callable object).
2399 function (without needing to build a full-blown callable object).
2399
2400
2400 Also big cleanup of this code, which had horrendous runtime
2401 Also big cleanup of this code, which had horrendous runtime
2401 lookups of zillions of attributes for colorization. Moved all
2402 lookups of zillions of attributes for colorization. Moved all
2402 this code into a few templates, which make it cleaner and quicker.
2403 this code into a few templates, which make it cleaner and quicker.
2403
2404
2404 Printout quality was also improved for Verbose exceptions: one
2405 Printout quality was also improved for Verbose exceptions: one
2405 variable per line, and memory addresses are printed (this can be
2406 variable per line, and memory addresses are printed (this can be
2406 quite handy in nasty debugging situations, which is what Verbose
2407 quite handy in nasty debugging situations, which is what Verbose
2407 is for).
2408 is for).
2408
2409
2409 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2410 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2410 the command line as scripts to be loaded by embedded instances.
2411 the command line as scripts to be loaded by embedded instances.
2411 Doing so has the potential for an infinite recursion if there are
2412 Doing so has the potential for an infinite recursion if there are
2412 exceptions thrown in the process. This fixes a strange crash
2413 exceptions thrown in the process. This fixes a strange crash
2413 reported by Philippe MULLER <muller-AT-irit.fr>.
2414 reported by Philippe MULLER <muller-AT-irit.fr>.
2414
2415
2415 2004-12-09 Fernando Perez <fperez@colorado.edu>
2416 2004-12-09 Fernando Perez <fperez@colorado.edu>
2416
2417
2417 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2418 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2418 to reflect new names in matplotlib, which now expose the
2419 to reflect new names in matplotlib, which now expose the
2419 matlab-compatible interface via a pylab module instead of the
2420 matlab-compatible interface via a pylab module instead of the
2420 'matlab' name. The new code is backwards compatible, so users of
2421 'matlab' name. The new code is backwards compatible, so users of
2421 all matplotlib versions are OK. Patch by J. Hunter.
2422 all matplotlib versions are OK. Patch by J. Hunter.
2422
2423
2423 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2424 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2424 of __init__ docstrings for instances (class docstrings are already
2425 of __init__ docstrings for instances (class docstrings are already
2425 automatically printed). Instances with customized docstrings
2426 automatically printed). Instances with customized docstrings
2426 (indep. of the class) are also recognized and all 3 separate
2427 (indep. of the class) are also recognized and all 3 separate
2427 docstrings are printed (instance, class, constructor). After some
2428 docstrings are printed (instance, class, constructor). After some
2428 comments/suggestions by J. Hunter.
2429 comments/suggestions by J. Hunter.
2429
2430
2430 2004-12-05 Fernando Perez <fperez@colorado.edu>
2431 2004-12-05 Fernando Perez <fperez@colorado.edu>
2431
2432
2432 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2433 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2433 warnings when tab-completion fails and triggers an exception.
2434 warnings when tab-completion fails and triggers an exception.
2434
2435
2435 2004-12-03 Fernando Perez <fperez@colorado.edu>
2436 2004-12-03 Fernando Perez <fperez@colorado.edu>
2436
2437
2437 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2438 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2438 be triggered when using 'run -p'. An incorrect option flag was
2439 be triggered when using 'run -p'. An incorrect option flag was
2439 being set ('d' instead of 'D').
2440 being set ('d' instead of 'D').
2440 (manpage): fix missing escaped \- sign.
2441 (manpage): fix missing escaped \- sign.
2441
2442
2442 2004-11-30 *** Released version 0.6.5
2443 2004-11-30 *** Released version 0.6.5
2443
2444
2444 2004-11-30 Fernando Perez <fperez@colorado.edu>
2445 2004-11-30 Fernando Perez <fperez@colorado.edu>
2445
2446
2446 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2447 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2447 setting with -d option.
2448 setting with -d option.
2448
2449
2449 * setup.py (docfiles): Fix problem where the doc glob I was using
2450 * setup.py (docfiles): Fix problem where the doc glob I was using
2450 was COMPLETELY BROKEN. It was giving the right files by pure
2451 was COMPLETELY BROKEN. It was giving the right files by pure
2451 accident, but failed once I tried to include ipython.el. Note:
2452 accident, but failed once I tried to include ipython.el. Note:
2452 glob() does NOT allow you to do exclusion on multiple endings!
2453 glob() does NOT allow you to do exclusion on multiple endings!
2453
2454
2454 2004-11-29 Fernando Perez <fperez@colorado.edu>
2455 2004-11-29 Fernando Perez <fperez@colorado.edu>
2455
2456
2456 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2457 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2457 the manpage as the source. Better formatting & consistency.
2458 the manpage as the source. Better formatting & consistency.
2458
2459
2459 * IPython/Magic.py (magic_run): Added new -d option, to run
2460 * IPython/Magic.py (magic_run): Added new -d option, to run
2460 scripts under the control of the python pdb debugger. Note that
2461 scripts under the control of the python pdb debugger. Note that
2461 this required changing the %prun option -d to -D, to avoid a clash
2462 this required changing the %prun option -d to -D, to avoid a clash
2462 (since %run must pass options to %prun, and getopt is too dumb to
2463 (since %run must pass options to %prun, and getopt is too dumb to
2463 handle options with string values with embedded spaces). Thanks
2464 handle options with string values with embedded spaces). Thanks
2464 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2465 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2465 (magic_who_ls): added type matching to %who and %whos, so that one
2466 (magic_who_ls): added type matching to %who and %whos, so that one
2466 can filter their output to only include variables of certain
2467 can filter their output to only include variables of certain
2467 types. Another suggestion by Matthew.
2468 types. Another suggestion by Matthew.
2468 (magic_whos): Added memory summaries in kb and Mb for arrays.
2469 (magic_whos): Added memory summaries in kb and Mb for arrays.
2469 (magic_who): Improve formatting (break lines every 9 vars).
2470 (magic_who): Improve formatting (break lines every 9 vars).
2470
2471
2471 2004-11-28 Fernando Perez <fperez@colorado.edu>
2472 2004-11-28 Fernando Perez <fperez@colorado.edu>
2472
2473
2473 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2474 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2474 cache when empty lines were present.
2475 cache when empty lines were present.
2475
2476
2476 2004-11-24 Fernando Perez <fperez@colorado.edu>
2477 2004-11-24 Fernando Perez <fperez@colorado.edu>
2477
2478
2478 * IPython/usage.py (__doc__): document the re-activated threading
2479 * IPython/usage.py (__doc__): document the re-activated threading
2479 options for WX and GTK.
2480 options for WX and GTK.
2480
2481
2481 2004-11-23 Fernando Perez <fperez@colorado.edu>
2482 2004-11-23 Fernando Perez <fperez@colorado.edu>
2482
2483
2483 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2484 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2484 the -wthread and -gthread options, along with a new -tk one to try
2485 the -wthread and -gthread options, along with a new -tk one to try
2485 and coordinate Tk threading with wx/gtk. The tk support is very
2486 and coordinate Tk threading with wx/gtk. The tk support is very
2486 platform dependent, since it seems to require Tcl and Tk to be
2487 platform dependent, since it seems to require Tcl and Tk to be
2487 built with threads (Fedora1/2 appears NOT to have it, but in
2488 built with threads (Fedora1/2 appears NOT to have it, but in
2488 Prabhu's Debian boxes it works OK). But even with some Tk
2489 Prabhu's Debian boxes it works OK). But even with some Tk
2489 limitations, this is a great improvement.
2490 limitations, this is a great improvement.
2490
2491
2491 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2492 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2492 info in user prompts. Patch by Prabhu.
2493 info in user prompts. Patch by Prabhu.
2493
2494
2494 2004-11-18 Fernando Perez <fperez@colorado.edu>
2495 2004-11-18 Fernando Perez <fperez@colorado.edu>
2495
2496
2496 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2497 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2497 EOFErrors and bail, to avoid infinite loops if a non-terminating
2498 EOFErrors and bail, to avoid infinite loops if a non-terminating
2498 file is fed into ipython. Patch submitted in issue 19 by user,
2499 file is fed into ipython. Patch submitted in issue 19 by user,
2499 many thanks.
2500 many thanks.
2500
2501
2501 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2502 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2502 autoquote/parens in continuation prompts, which can cause lots of
2503 autoquote/parens in continuation prompts, which can cause lots of
2503 problems. Closes roundup issue 20.
2504 problems. Closes roundup issue 20.
2504
2505
2505 2004-11-17 Fernando Perez <fperez@colorado.edu>
2506 2004-11-17 Fernando Perez <fperez@colorado.edu>
2506
2507
2507 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2508 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2508 reported as debian bug #280505. I'm not sure my local changelog
2509 reported as debian bug #280505. I'm not sure my local changelog
2509 entry has the proper debian format (Jack?).
2510 entry has the proper debian format (Jack?).
2510
2511
2511 2004-11-08 *** Released version 0.6.4
2512 2004-11-08 *** Released version 0.6.4
2512
2513
2513 2004-11-08 Fernando Perez <fperez@colorado.edu>
2514 2004-11-08 Fernando Perez <fperez@colorado.edu>
2514
2515
2515 * IPython/iplib.py (init_readline): Fix exit message for Windows
2516 * IPython/iplib.py (init_readline): Fix exit message for Windows
2516 when readline is active. Thanks to a report by Eric Jones
2517 when readline is active. Thanks to a report by Eric Jones
2517 <eric-AT-enthought.com>.
2518 <eric-AT-enthought.com>.
2518
2519
2519 2004-11-07 Fernando Perez <fperez@colorado.edu>
2520 2004-11-07 Fernando Perez <fperez@colorado.edu>
2520
2521
2521 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2522 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2522 sometimes seen by win2k/cygwin users.
2523 sometimes seen by win2k/cygwin users.
2523
2524
2524 2004-11-06 Fernando Perez <fperez@colorado.edu>
2525 2004-11-06 Fernando Perez <fperez@colorado.edu>
2525
2526
2526 * IPython/iplib.py (interact): Change the handling of %Exit from
2527 * IPython/iplib.py (interact): Change the handling of %Exit from
2527 trying to propagate a SystemExit to an internal ipython flag.
2528 trying to propagate a SystemExit to an internal ipython flag.
2528 This is less elegant than using Python's exception mechanism, but
2529 This is less elegant than using Python's exception mechanism, but
2529 I can't get that to work reliably with threads, so under -pylab
2530 I can't get that to work reliably with threads, so under -pylab
2530 %Exit was hanging IPython. Cross-thread exception handling is
2531 %Exit was hanging IPython. Cross-thread exception handling is
2531 really a bitch. Thaks to a bug report by Stephen Walton
2532 really a bitch. Thaks to a bug report by Stephen Walton
2532 <stephen.walton-AT-csun.edu>.
2533 <stephen.walton-AT-csun.edu>.
2533
2534
2534 2004-11-04 Fernando Perez <fperez@colorado.edu>
2535 2004-11-04 Fernando Perez <fperez@colorado.edu>
2535
2536
2536 * IPython/iplib.py (raw_input_original): store a pointer to the
2537 * IPython/iplib.py (raw_input_original): store a pointer to the
2537 true raw_input to harden against code which can modify it
2538 true raw_input to harden against code which can modify it
2538 (wx.py.PyShell does this and would otherwise crash ipython).
2539 (wx.py.PyShell does this and would otherwise crash ipython).
2539 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2540 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2540
2541
2541 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2542 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2542 Ctrl-C problem, which does not mess up the input line.
2543 Ctrl-C problem, which does not mess up the input line.
2543
2544
2544 2004-11-03 Fernando Perez <fperez@colorado.edu>
2545 2004-11-03 Fernando Perez <fperez@colorado.edu>
2545
2546
2546 * IPython/Release.py: Changed licensing to BSD, in all files.
2547 * IPython/Release.py: Changed licensing to BSD, in all files.
2547 (name): lowercase name for tarball/RPM release.
2548 (name): lowercase name for tarball/RPM release.
2548
2549
2549 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2550 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2550 use throughout ipython.
2551 use throughout ipython.
2551
2552
2552 * IPython/Magic.py (Magic._ofind): Switch to using the new
2553 * IPython/Magic.py (Magic._ofind): Switch to using the new
2553 OInspect.getdoc() function.
2554 OInspect.getdoc() function.
2554
2555
2555 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2556 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2556 of the line currently being canceled via Ctrl-C. It's extremely
2557 of the line currently being canceled via Ctrl-C. It's extremely
2557 ugly, but I don't know how to do it better (the problem is one of
2558 ugly, but I don't know how to do it better (the problem is one of
2558 handling cross-thread exceptions).
2559 handling cross-thread exceptions).
2559
2560
2560 2004-10-28 Fernando Perez <fperez@colorado.edu>
2561 2004-10-28 Fernando Perez <fperez@colorado.edu>
2561
2562
2562 * IPython/Shell.py (signal_handler): add signal handlers to trap
2563 * IPython/Shell.py (signal_handler): add signal handlers to trap
2563 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2564 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2564 report by Francesc Alted.
2565 report by Francesc Alted.
2565
2566
2566 2004-10-21 Fernando Perez <fperez@colorado.edu>
2567 2004-10-21 Fernando Perez <fperez@colorado.edu>
2567
2568
2568 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2569 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2569 to % for pysh syntax extensions.
2570 to % for pysh syntax extensions.
2570
2571
2571 2004-10-09 Fernando Perez <fperez@colorado.edu>
2572 2004-10-09 Fernando Perez <fperez@colorado.edu>
2572
2573
2573 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2574 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2574 arrays to print a more useful summary, without calling str(arr).
2575 arrays to print a more useful summary, without calling str(arr).
2575 This avoids the problem of extremely lengthy computations which
2576 This avoids the problem of extremely lengthy computations which
2576 occur if arr is large, and appear to the user as a system lockup
2577 occur if arr is large, and appear to the user as a system lockup
2577 with 100% cpu activity. After a suggestion by Kristian Sandberg
2578 with 100% cpu activity. After a suggestion by Kristian Sandberg
2578 <Kristian.Sandberg@colorado.edu>.
2579 <Kristian.Sandberg@colorado.edu>.
2579 (Magic.__init__): fix bug in global magic escapes not being
2580 (Magic.__init__): fix bug in global magic escapes not being
2580 correctly set.
2581 correctly set.
2581
2582
2582 2004-10-08 Fernando Perez <fperez@colorado.edu>
2583 2004-10-08 Fernando Perez <fperez@colorado.edu>
2583
2584
2584 * IPython/Magic.py (__license__): change to absolute imports of
2585 * IPython/Magic.py (__license__): change to absolute imports of
2585 ipython's own internal packages, to start adapting to the absolute
2586 ipython's own internal packages, to start adapting to the absolute
2586 import requirement of PEP-328.
2587 import requirement of PEP-328.
2587
2588
2588 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2589 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2589 files, and standardize author/license marks through the Release
2590 files, and standardize author/license marks through the Release
2590 module instead of having per/file stuff (except for files with
2591 module instead of having per/file stuff (except for files with
2591 particular licenses, like the MIT/PSF-licensed codes).
2592 particular licenses, like the MIT/PSF-licensed codes).
2592
2593
2593 * IPython/Debugger.py: remove dead code for python 2.1
2594 * IPython/Debugger.py: remove dead code for python 2.1
2594
2595
2595 2004-10-04 Fernando Perez <fperez@colorado.edu>
2596 2004-10-04 Fernando Perez <fperez@colorado.edu>
2596
2597
2597 * IPython/iplib.py (ipmagic): New function for accessing magics
2598 * IPython/iplib.py (ipmagic): New function for accessing magics
2598 via a normal python function call.
2599 via a normal python function call.
2599
2600
2600 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2601 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2601 from '@' to '%', to accomodate the new @decorator syntax of python
2602 from '@' to '%', to accomodate the new @decorator syntax of python
2602 2.4.
2603 2.4.
2603
2604
2604 2004-09-29 Fernando Perez <fperez@colorado.edu>
2605 2004-09-29 Fernando Perez <fperez@colorado.edu>
2605
2606
2606 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2607 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2607 matplotlib.use to prevent running scripts which try to switch
2608 matplotlib.use to prevent running scripts which try to switch
2608 interactive backends from within ipython. This will just crash
2609 interactive backends from within ipython. This will just crash
2609 the python interpreter, so we can't allow it (but a detailed error
2610 the python interpreter, so we can't allow it (but a detailed error
2610 is given to the user).
2611 is given to the user).
2611
2612
2612 2004-09-28 Fernando Perez <fperez@colorado.edu>
2613 2004-09-28 Fernando Perez <fperez@colorado.edu>
2613
2614
2614 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2615 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2615 matplotlib-related fixes so that using @run with non-matplotlib
2616 matplotlib-related fixes so that using @run with non-matplotlib
2616 scripts doesn't pop up spurious plot windows. This requires
2617 scripts doesn't pop up spurious plot windows. This requires
2617 matplotlib >= 0.63, where I had to make some changes as well.
2618 matplotlib >= 0.63, where I had to make some changes as well.
2618
2619
2619 * IPython/ipmaker.py (make_IPython): update version requirement to
2620 * IPython/ipmaker.py (make_IPython): update version requirement to
2620 python 2.2.
2621 python 2.2.
2621
2622
2622 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2623 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2623 banner arg for embedded customization.
2624 banner arg for embedded customization.
2624
2625
2625 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2626 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2626 explicit uses of __IP as the IPython's instance name. Now things
2627 explicit uses of __IP as the IPython's instance name. Now things
2627 are properly handled via the shell.name value. The actual code
2628 are properly handled via the shell.name value. The actual code
2628 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2629 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2629 is much better than before. I'll clean things completely when the
2630 is much better than before. I'll clean things completely when the
2630 magic stuff gets a real overhaul.
2631 magic stuff gets a real overhaul.
2631
2632
2632 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2633 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2633 minor changes to debian dir.
2634 minor changes to debian dir.
2634
2635
2635 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2636 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2636 pointer to the shell itself in the interactive namespace even when
2637 pointer to the shell itself in the interactive namespace even when
2637 a user-supplied dict is provided. This is needed for embedding
2638 a user-supplied dict is provided. This is needed for embedding
2638 purposes (found by tests with Michel Sanner).
2639 purposes (found by tests with Michel Sanner).
2639
2640
2640 2004-09-27 Fernando Perez <fperez@colorado.edu>
2641 2004-09-27 Fernando Perez <fperez@colorado.edu>
2641
2642
2642 * IPython/UserConfig/ipythonrc: remove []{} from
2643 * IPython/UserConfig/ipythonrc: remove []{} from
2643 readline_remove_delims, so that things like [modname.<TAB> do
2644 readline_remove_delims, so that things like [modname.<TAB> do
2644 proper completion. This disables [].TAB, but that's a less common
2645 proper completion. This disables [].TAB, but that's a less common
2645 case than module names in list comprehensions, for example.
2646 case than module names in list comprehensions, for example.
2646 Thanks to a report by Andrea Riciputi.
2647 Thanks to a report by Andrea Riciputi.
2647
2648
2648 2004-09-09 Fernando Perez <fperez@colorado.edu>
2649 2004-09-09 Fernando Perez <fperez@colorado.edu>
2649
2650
2650 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2651 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2651 blocking problems in win32 and osx. Fix by John.
2652 blocking problems in win32 and osx. Fix by John.
2652
2653
2653 2004-09-08 Fernando Perez <fperez@colorado.edu>
2654 2004-09-08 Fernando Perez <fperez@colorado.edu>
2654
2655
2655 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2656 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2656 for Win32 and OSX. Fix by John Hunter.
2657 for Win32 and OSX. Fix by John Hunter.
2657
2658
2658 2004-08-30 *** Released version 0.6.3
2659 2004-08-30 *** Released version 0.6.3
2659
2660
2660 2004-08-30 Fernando Perez <fperez@colorado.edu>
2661 2004-08-30 Fernando Perez <fperez@colorado.edu>
2661
2662
2662 * setup.py (isfile): Add manpages to list of dependent files to be
2663 * setup.py (isfile): Add manpages to list of dependent files to be
2663 updated.
2664 updated.
2664
2665
2665 2004-08-27 Fernando Perez <fperez@colorado.edu>
2666 2004-08-27 Fernando Perez <fperez@colorado.edu>
2666
2667
2667 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2668 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2668 for now. They don't really work with standalone WX/GTK code
2669 for now. They don't really work with standalone WX/GTK code
2669 (though matplotlib IS working fine with both of those backends).
2670 (though matplotlib IS working fine with both of those backends).
2670 This will neeed much more testing. I disabled most things with
2671 This will neeed much more testing. I disabled most things with
2671 comments, so turning it back on later should be pretty easy.
2672 comments, so turning it back on later should be pretty easy.
2672
2673
2673 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2674 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2674 autocalling of expressions like r'foo', by modifying the line
2675 autocalling of expressions like r'foo', by modifying the line
2675 split regexp. Closes
2676 split regexp. Closes
2676 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2677 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2677 Riley <ipythonbugs-AT-sabi.net>.
2678 Riley <ipythonbugs-AT-sabi.net>.
2678 (InteractiveShell.mainloop): honor --nobanner with banner
2679 (InteractiveShell.mainloop): honor --nobanner with banner
2679 extensions.
2680 extensions.
2680
2681
2681 * IPython/Shell.py: Significant refactoring of all classes, so
2682 * IPython/Shell.py: Significant refactoring of all classes, so
2682 that we can really support ALL matplotlib backends and threading
2683 that we can really support ALL matplotlib backends and threading
2683 models (John spotted a bug with Tk which required this). Now we
2684 models (John spotted a bug with Tk which required this). Now we
2684 should support single-threaded, WX-threads and GTK-threads, both
2685 should support single-threaded, WX-threads and GTK-threads, both
2685 for generic code and for matplotlib.
2686 for generic code and for matplotlib.
2686
2687
2687 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2688 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2688 -pylab, to simplify things for users. Will also remove the pylab
2689 -pylab, to simplify things for users. Will also remove the pylab
2689 profile, since now all of matplotlib configuration is directly
2690 profile, since now all of matplotlib configuration is directly
2690 handled here. This also reduces startup time.
2691 handled here. This also reduces startup time.
2691
2692
2692 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2693 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2693 shell wasn't being correctly called. Also in IPShellWX.
2694 shell wasn't being correctly called. Also in IPShellWX.
2694
2695
2695 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2696 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2696 fine-tune banner.
2697 fine-tune banner.
2697
2698
2698 * IPython/numutils.py (spike): Deprecate these spike functions,
2699 * IPython/numutils.py (spike): Deprecate these spike functions,
2699 delete (long deprecated) gnuplot_exec handler.
2700 delete (long deprecated) gnuplot_exec handler.
2700
2701
2701 2004-08-26 Fernando Perez <fperez@colorado.edu>
2702 2004-08-26 Fernando Perez <fperez@colorado.edu>
2702
2703
2703 * ipython.1: Update for threading options, plus some others which
2704 * ipython.1: Update for threading options, plus some others which
2704 were missing.
2705 were missing.
2705
2706
2706 * IPython/ipmaker.py (__call__): Added -wthread option for
2707 * IPython/ipmaker.py (__call__): Added -wthread option for
2707 wxpython thread handling. Make sure threading options are only
2708 wxpython thread handling. Make sure threading options are only
2708 valid at the command line.
2709 valid at the command line.
2709
2710
2710 * scripts/ipython: moved shell selection into a factory function
2711 * scripts/ipython: moved shell selection into a factory function
2711 in Shell.py, to keep the starter script to a minimum.
2712 in Shell.py, to keep the starter script to a minimum.
2712
2713
2713 2004-08-25 Fernando Perez <fperez@colorado.edu>
2714 2004-08-25 Fernando Perez <fperez@colorado.edu>
2714
2715
2715 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2716 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2716 John. Along with some recent changes he made to matplotlib, the
2717 John. Along with some recent changes he made to matplotlib, the
2717 next versions of both systems should work very well together.
2718 next versions of both systems should work very well together.
2718
2719
2719 2004-08-24 Fernando Perez <fperez@colorado.edu>
2720 2004-08-24 Fernando Perez <fperez@colorado.edu>
2720
2721
2721 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2722 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2722 tried to switch the profiling to using hotshot, but I'm getting
2723 tried to switch the profiling to using hotshot, but I'm getting
2723 strange errors from prof.runctx() there. I may be misreading the
2724 strange errors from prof.runctx() there. I may be misreading the
2724 docs, but it looks weird. For now the profiling code will
2725 docs, but it looks weird. For now the profiling code will
2725 continue to use the standard profiler.
2726 continue to use the standard profiler.
2726
2727
2727 2004-08-23 Fernando Perez <fperez@colorado.edu>
2728 2004-08-23 Fernando Perez <fperez@colorado.edu>
2728
2729
2729 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2730 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2730 threaded shell, by John Hunter. It's not quite ready yet, but
2731 threaded shell, by John Hunter. It's not quite ready yet, but
2731 close.
2732 close.
2732
2733
2733 2004-08-22 Fernando Perez <fperez@colorado.edu>
2734 2004-08-22 Fernando Perez <fperez@colorado.edu>
2734
2735
2735 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2736 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2736 in Magic and ultraTB.
2737 in Magic and ultraTB.
2737
2738
2738 * ipython.1: document threading options in manpage.
2739 * ipython.1: document threading options in manpage.
2739
2740
2740 * scripts/ipython: Changed name of -thread option to -gthread,
2741 * scripts/ipython: Changed name of -thread option to -gthread,
2741 since this is GTK specific. I want to leave the door open for a
2742 since this is GTK specific. I want to leave the door open for a
2742 -wthread option for WX, which will most likely be necessary. This
2743 -wthread option for WX, which will most likely be necessary. This
2743 change affects usage and ipmaker as well.
2744 change affects usage and ipmaker as well.
2744
2745
2745 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2746 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2746 handle the matplotlib shell issues. Code by John Hunter
2747 handle the matplotlib shell issues. Code by John Hunter
2747 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2748 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2748 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2749 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2749 broken (and disabled for end users) for now, but it puts the
2750 broken (and disabled for end users) for now, but it puts the
2750 infrastructure in place.
2751 infrastructure in place.
2751
2752
2752 2004-08-21 Fernando Perez <fperez@colorado.edu>
2753 2004-08-21 Fernando Perez <fperez@colorado.edu>
2753
2754
2754 * ipythonrc-pylab: Add matplotlib support.
2755 * ipythonrc-pylab: Add matplotlib support.
2755
2756
2756 * matplotlib_config.py: new files for matplotlib support, part of
2757 * matplotlib_config.py: new files for matplotlib support, part of
2757 the pylab profile.
2758 the pylab profile.
2758
2759
2759 * IPython/usage.py (__doc__): documented the threading options.
2760 * IPython/usage.py (__doc__): documented the threading options.
2760
2761
2761 2004-08-20 Fernando Perez <fperez@colorado.edu>
2762 2004-08-20 Fernando Perez <fperez@colorado.edu>
2762
2763
2763 * ipython: Modified the main calling routine to handle the -thread
2764 * ipython: Modified the main calling routine to handle the -thread
2764 and -mpthread options. This needs to be done as a top-level hack,
2765 and -mpthread options. This needs to be done as a top-level hack,
2765 because it determines which class to instantiate for IPython
2766 because it determines which class to instantiate for IPython
2766 itself.
2767 itself.
2767
2768
2768 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2769 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2769 classes to support multithreaded GTK operation without blocking,
2770 classes to support multithreaded GTK operation without blocking,
2770 and matplotlib with all backends. This is a lot of still very
2771 and matplotlib with all backends. This is a lot of still very
2771 experimental code, and threads are tricky. So it may still have a
2772 experimental code, and threads are tricky. So it may still have a
2772 few rough edges... This code owes a lot to
2773 few rough edges... This code owes a lot to
2773 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2774 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2774 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2775 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2775 to John Hunter for all the matplotlib work.
2776 to John Hunter for all the matplotlib work.
2776
2777
2777 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2778 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2778 options for gtk thread and matplotlib support.
2779 options for gtk thread and matplotlib support.
2779
2780
2780 2004-08-16 Fernando Perez <fperez@colorado.edu>
2781 2004-08-16 Fernando Perez <fperez@colorado.edu>
2781
2782
2782 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2783 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2783 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2784 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2784 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2785 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2785
2786
2786 2004-08-11 Fernando Perez <fperez@colorado.edu>
2787 2004-08-11 Fernando Perez <fperez@colorado.edu>
2787
2788
2788 * setup.py (isfile): Fix build so documentation gets updated for
2789 * setup.py (isfile): Fix build so documentation gets updated for
2789 rpms (it was only done for .tgz builds).
2790 rpms (it was only done for .tgz builds).
2790
2791
2791 2004-08-10 Fernando Perez <fperez@colorado.edu>
2792 2004-08-10 Fernando Perez <fperez@colorado.edu>
2792
2793
2793 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2794 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2794
2795
2795 * iplib.py : Silence syntax error exceptions in tab-completion.
2796 * iplib.py : Silence syntax error exceptions in tab-completion.
2796
2797
2797 2004-08-05 Fernando Perez <fperez@colorado.edu>
2798 2004-08-05 Fernando Perez <fperez@colorado.edu>
2798
2799
2799 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2800 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2800 'color off' mark for continuation prompts. This was causing long
2801 'color off' mark for continuation prompts. This was causing long
2801 continuation lines to mis-wrap.
2802 continuation lines to mis-wrap.
2802
2803
2803 2004-08-01 Fernando Perez <fperez@colorado.edu>
2804 2004-08-01 Fernando Perez <fperez@colorado.edu>
2804
2805
2805 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2806 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2806 for building ipython to be a parameter. All this is necessary
2807 for building ipython to be a parameter. All this is necessary
2807 right now to have a multithreaded version, but this insane
2808 right now to have a multithreaded version, but this insane
2808 non-design will be cleaned up soon. For now, it's a hack that
2809 non-design will be cleaned up soon. For now, it's a hack that
2809 works.
2810 works.
2810
2811
2811 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2812 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2812 args in various places. No bugs so far, but it's a dangerous
2813 args in various places. No bugs so far, but it's a dangerous
2813 practice.
2814 practice.
2814
2815
2815 2004-07-31 Fernando Perez <fperez@colorado.edu>
2816 2004-07-31 Fernando Perez <fperez@colorado.edu>
2816
2817
2817 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2818 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2818 fix completion of files with dots in their names under most
2819 fix completion of files with dots in their names under most
2819 profiles (pysh was OK because the completion order is different).
2820 profiles (pysh was OK because the completion order is different).
2820
2821
2821 2004-07-27 Fernando Perez <fperez@colorado.edu>
2822 2004-07-27 Fernando Perez <fperez@colorado.edu>
2822
2823
2823 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2824 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2824 keywords manually, b/c the one in keyword.py was removed in python
2825 keywords manually, b/c the one in keyword.py was removed in python
2825 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2826 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2826 This is NOT a bug under python 2.3 and earlier.
2827 This is NOT a bug under python 2.3 and earlier.
2827
2828
2828 2004-07-26 Fernando Perez <fperez@colorado.edu>
2829 2004-07-26 Fernando Perez <fperez@colorado.edu>
2829
2830
2830 * IPython/ultraTB.py (VerboseTB.text): Add another
2831 * IPython/ultraTB.py (VerboseTB.text): Add another
2831 linecache.checkcache() call to try to prevent inspect.py from
2832 linecache.checkcache() call to try to prevent inspect.py from
2832 crashing under python 2.3. I think this fixes
2833 crashing under python 2.3. I think this fixes
2833 http://www.scipy.net/roundup/ipython/issue17.
2834 http://www.scipy.net/roundup/ipython/issue17.
2834
2835
2835 2004-07-26 *** Released version 0.6.2
2836 2004-07-26 *** Released version 0.6.2
2836
2837
2837 2004-07-26 Fernando Perez <fperez@colorado.edu>
2838 2004-07-26 Fernando Perez <fperez@colorado.edu>
2838
2839
2839 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2840 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2840 fail for any number.
2841 fail for any number.
2841 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2842 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2842 empty bookmarks.
2843 empty bookmarks.
2843
2844
2844 2004-07-26 *** Released version 0.6.1
2845 2004-07-26 *** Released version 0.6.1
2845
2846
2846 2004-07-26 Fernando Perez <fperez@colorado.edu>
2847 2004-07-26 Fernando Perez <fperez@colorado.edu>
2847
2848
2848 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2849 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2849
2850
2850 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2851 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2851 escaping '()[]{}' in filenames.
2852 escaping '()[]{}' in filenames.
2852
2853
2853 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2854 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2854 Python 2.2 users who lack a proper shlex.split.
2855 Python 2.2 users who lack a proper shlex.split.
2855
2856
2856 2004-07-19 Fernando Perez <fperez@colorado.edu>
2857 2004-07-19 Fernando Perez <fperez@colorado.edu>
2857
2858
2858 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2859 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2859 for reading readline's init file. I follow the normal chain:
2860 for reading readline's init file. I follow the normal chain:
2860 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2861 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2861 report by Mike Heeter. This closes
2862 report by Mike Heeter. This closes
2862 http://www.scipy.net/roundup/ipython/issue16.
2863 http://www.scipy.net/roundup/ipython/issue16.
2863
2864
2864 2004-07-18 Fernando Perez <fperez@colorado.edu>
2865 2004-07-18 Fernando Perez <fperez@colorado.edu>
2865
2866
2866 * IPython/iplib.py (__init__): Add better handling of '\' under
2867 * IPython/iplib.py (__init__): Add better handling of '\' under
2867 Win32 for filenames. After a patch by Ville.
2868 Win32 for filenames. After a patch by Ville.
2868
2869
2869 2004-07-17 Fernando Perez <fperez@colorado.edu>
2870 2004-07-17 Fernando Perez <fperez@colorado.edu>
2870
2871
2871 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2872 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2872 autocalling would be triggered for 'foo is bar' if foo is
2873 autocalling would be triggered for 'foo is bar' if foo is
2873 callable. I also cleaned up the autocall detection code to use a
2874 callable. I also cleaned up the autocall detection code to use a
2874 regexp, which is faster. Bug reported by Alexander Schmolck.
2875 regexp, which is faster. Bug reported by Alexander Schmolck.
2875
2876
2876 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2877 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2877 '?' in them would confuse the help system. Reported by Alex
2878 '?' in them would confuse the help system. Reported by Alex
2878 Schmolck.
2879 Schmolck.
2879
2880
2880 2004-07-16 Fernando Perez <fperez@colorado.edu>
2881 2004-07-16 Fernando Perez <fperez@colorado.edu>
2881
2882
2882 * IPython/GnuplotInteractive.py (__all__): added plot2.
2883 * IPython/GnuplotInteractive.py (__all__): added plot2.
2883
2884
2884 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2885 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2885 plotting dictionaries, lists or tuples of 1d arrays.
2886 plotting dictionaries, lists or tuples of 1d arrays.
2886
2887
2887 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2888 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2888 optimizations.
2889 optimizations.
2889
2890
2890 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2891 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2891 the information which was there from Janko's original IPP code:
2892 the information which was there from Janko's original IPP code:
2892
2893
2893 03.05.99 20:53 porto.ifm.uni-kiel.de
2894 03.05.99 20:53 porto.ifm.uni-kiel.de
2894 --Started changelog.
2895 --Started changelog.
2895 --make clear do what it say it does
2896 --make clear do what it say it does
2896 --added pretty output of lines from inputcache
2897 --added pretty output of lines from inputcache
2897 --Made Logger a mixin class, simplifies handling of switches
2898 --Made Logger a mixin class, simplifies handling of switches
2898 --Added own completer class. .string<TAB> expands to last history
2899 --Added own completer class. .string<TAB> expands to last history
2899 line which starts with string. The new expansion is also present
2900 line which starts with string. The new expansion is also present
2900 with Ctrl-r from the readline library. But this shows, who this
2901 with Ctrl-r from the readline library. But this shows, who this
2901 can be done for other cases.
2902 can be done for other cases.
2902 --Added convention that all shell functions should accept a
2903 --Added convention that all shell functions should accept a
2903 parameter_string This opens the door for different behaviour for
2904 parameter_string This opens the door for different behaviour for
2904 each function. @cd is a good example of this.
2905 each function. @cd is a good example of this.
2905
2906
2906 04.05.99 12:12 porto.ifm.uni-kiel.de
2907 04.05.99 12:12 porto.ifm.uni-kiel.de
2907 --added logfile rotation
2908 --added logfile rotation
2908 --added new mainloop method which freezes first the namespace
2909 --added new mainloop method which freezes first the namespace
2909
2910
2910 07.05.99 21:24 porto.ifm.uni-kiel.de
2911 07.05.99 21:24 porto.ifm.uni-kiel.de
2911 --added the docreader classes. Now there is a help system.
2912 --added the docreader classes. Now there is a help system.
2912 -This is only a first try. Currently it's not easy to put new
2913 -This is only a first try. Currently it's not easy to put new
2913 stuff in the indices. But this is the way to go. Info would be
2914 stuff in the indices. But this is the way to go. Info would be
2914 better, but HTML is every where and not everybody has an info
2915 better, but HTML is every where and not everybody has an info
2915 system installed and it's not so easy to change html-docs to info.
2916 system installed and it's not so easy to change html-docs to info.
2916 --added global logfile option
2917 --added global logfile option
2917 --there is now a hook for object inspection method pinfo needs to
2918 --there is now a hook for object inspection method pinfo needs to
2918 be provided for this. Can be reached by two '??'.
2919 be provided for this. Can be reached by two '??'.
2919
2920
2920 08.05.99 20:51 porto.ifm.uni-kiel.de
2921 08.05.99 20:51 porto.ifm.uni-kiel.de
2921 --added a README
2922 --added a README
2922 --bug in rc file. Something has changed so functions in the rc
2923 --bug in rc file. Something has changed so functions in the rc
2923 file need to reference the shell and not self. Not clear if it's a
2924 file need to reference the shell and not self. Not clear if it's a
2924 bug or feature.
2925 bug or feature.
2925 --changed rc file for new behavior
2926 --changed rc file for new behavior
2926
2927
2927 2004-07-15 Fernando Perez <fperez@colorado.edu>
2928 2004-07-15 Fernando Perez <fperez@colorado.edu>
2928
2929
2929 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2930 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2930 cache was falling out of sync in bizarre manners when multi-line
2931 cache was falling out of sync in bizarre manners when multi-line
2931 input was present. Minor optimizations and cleanup.
2932 input was present. Minor optimizations and cleanup.
2932
2933
2933 (Logger): Remove old Changelog info for cleanup. This is the
2934 (Logger): Remove old Changelog info for cleanup. This is the
2934 information which was there from Janko's original code:
2935 information which was there from Janko's original code:
2935
2936
2936 Changes to Logger: - made the default log filename a parameter
2937 Changes to Logger: - made the default log filename a parameter
2937
2938
2938 - put a check for lines beginning with !@? in log(). Needed
2939 - put a check for lines beginning with !@? in log(). Needed
2939 (even if the handlers properly log their lines) for mid-session
2940 (even if the handlers properly log their lines) for mid-session
2940 logging activation to work properly. Without this, lines logged
2941 logging activation to work properly. Without this, lines logged
2941 in mid session, which get read from the cache, would end up
2942 in mid session, which get read from the cache, would end up
2942 'bare' (with !@? in the open) in the log. Now they are caught
2943 'bare' (with !@? in the open) in the log. Now they are caught
2943 and prepended with a #.
2944 and prepended with a #.
2944
2945
2945 * IPython/iplib.py (InteractiveShell.init_readline): added check
2946 * IPython/iplib.py (InteractiveShell.init_readline): added check
2946 in case MagicCompleter fails to be defined, so we don't crash.
2947 in case MagicCompleter fails to be defined, so we don't crash.
2947
2948
2948 2004-07-13 Fernando Perez <fperez@colorado.edu>
2949 2004-07-13 Fernando Perez <fperez@colorado.edu>
2949
2950
2950 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2951 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2951 of EPS if the requested filename ends in '.eps'.
2952 of EPS if the requested filename ends in '.eps'.
2952
2953
2953 2004-07-04 Fernando Perez <fperez@colorado.edu>
2954 2004-07-04 Fernando Perez <fperez@colorado.edu>
2954
2955
2955 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2956 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2956 escaping of quotes when calling the shell.
2957 escaping of quotes when calling the shell.
2957
2958
2958 2004-07-02 Fernando Perez <fperez@colorado.edu>
2959 2004-07-02 Fernando Perez <fperez@colorado.edu>
2959
2960
2960 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2961 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2961 gettext not working because we were clobbering '_'. Fixes
2962 gettext not working because we were clobbering '_'. Fixes
2962 http://www.scipy.net/roundup/ipython/issue6.
2963 http://www.scipy.net/roundup/ipython/issue6.
2963
2964
2964 2004-07-01 Fernando Perez <fperez@colorado.edu>
2965 2004-07-01 Fernando Perez <fperez@colorado.edu>
2965
2966
2966 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2967 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2967 into @cd. Patch by Ville.
2968 into @cd. Patch by Ville.
2968
2969
2969 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2970 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2970 new function to store things after ipmaker runs. Patch by Ville.
2971 new function to store things after ipmaker runs. Patch by Ville.
2971 Eventually this will go away once ipmaker is removed and the class
2972 Eventually this will go away once ipmaker is removed and the class
2972 gets cleaned up, but for now it's ok. Key functionality here is
2973 gets cleaned up, but for now it's ok. Key functionality here is
2973 the addition of the persistent storage mechanism, a dict for
2974 the addition of the persistent storage mechanism, a dict for
2974 keeping data across sessions (for now just bookmarks, but more can
2975 keeping data across sessions (for now just bookmarks, but more can
2975 be implemented later).
2976 be implemented later).
2976
2977
2977 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2978 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2978 persistent across sections. Patch by Ville, I modified it
2979 persistent across sections. Patch by Ville, I modified it
2979 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2980 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2980 added a '-l' option to list all bookmarks.
2981 added a '-l' option to list all bookmarks.
2981
2982
2982 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2983 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2983 center for cleanup. Registered with atexit.register(). I moved
2984 center for cleanup. Registered with atexit.register(). I moved
2984 here the old exit_cleanup(). After a patch by Ville.
2985 here the old exit_cleanup(). After a patch by Ville.
2985
2986
2986 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2987 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2987 characters in the hacked shlex_split for python 2.2.
2988 characters in the hacked shlex_split for python 2.2.
2988
2989
2989 * IPython/iplib.py (file_matches): more fixes to filenames with
2990 * IPython/iplib.py (file_matches): more fixes to filenames with
2990 whitespace in them. It's not perfect, but limitations in python's
2991 whitespace in them. It's not perfect, but limitations in python's
2991 readline make it impossible to go further.
2992 readline make it impossible to go further.
2992
2993
2993 2004-06-29 Fernando Perez <fperez@colorado.edu>
2994 2004-06-29 Fernando Perez <fperez@colorado.edu>
2994
2995
2995 * IPython/iplib.py (file_matches): escape whitespace correctly in
2996 * IPython/iplib.py (file_matches): escape whitespace correctly in
2996 filename completions. Bug reported by Ville.
2997 filename completions. Bug reported by Ville.
2997
2998
2998 2004-06-28 Fernando Perez <fperez@colorado.edu>
2999 2004-06-28 Fernando Perez <fperez@colorado.edu>
2999
3000
3000 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3001 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3001 the history file will be called 'history-PROFNAME' (or just
3002 the history file will be called 'history-PROFNAME' (or just
3002 'history' if no profile is loaded). I was getting annoyed at
3003 'history' if no profile is loaded). I was getting annoyed at
3003 getting my Numerical work history clobbered by pysh sessions.
3004 getting my Numerical work history clobbered by pysh sessions.
3004
3005
3005 * IPython/iplib.py (InteractiveShell.__init__): Internal
3006 * IPython/iplib.py (InteractiveShell.__init__): Internal
3006 getoutputerror() function so that we can honor the system_verbose
3007 getoutputerror() function so that we can honor the system_verbose
3007 flag for _all_ system calls. I also added escaping of #
3008 flag for _all_ system calls. I also added escaping of #
3008 characters here to avoid confusing Itpl.
3009 characters here to avoid confusing Itpl.
3009
3010
3010 * IPython/Magic.py (shlex_split): removed call to shell in
3011 * IPython/Magic.py (shlex_split): removed call to shell in
3011 parse_options and replaced it with shlex.split(). The annoying
3012 parse_options and replaced it with shlex.split(). The annoying
3012 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3013 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3013 to backport it from 2.3, with several frail hacks (the shlex
3014 to backport it from 2.3, with several frail hacks (the shlex
3014 module is rather limited in 2.2). Thanks to a suggestion by Ville
3015 module is rather limited in 2.2). Thanks to a suggestion by Ville
3015 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3016 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3016 problem.
3017 problem.
3017
3018
3018 (Magic.magic_system_verbose): new toggle to print the actual
3019 (Magic.magic_system_verbose): new toggle to print the actual
3019 system calls made by ipython. Mainly for debugging purposes.
3020 system calls made by ipython. Mainly for debugging purposes.
3020
3021
3021 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3022 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3022 doesn't support persistence. Reported (and fix suggested) by
3023 doesn't support persistence. Reported (and fix suggested) by
3023 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3024 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3024
3025
3025 2004-06-26 Fernando Perez <fperez@colorado.edu>
3026 2004-06-26 Fernando Perez <fperez@colorado.edu>
3026
3027
3027 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3028 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3028 continue prompts.
3029 continue prompts.
3029
3030
3030 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3031 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3031 function (basically a big docstring) and a few more things here to
3032 function (basically a big docstring) and a few more things here to
3032 speedup startup. pysh.py is now very lightweight. We want because
3033 speedup startup. pysh.py is now very lightweight. We want because
3033 it gets execfile'd, while InterpreterExec gets imported, so
3034 it gets execfile'd, while InterpreterExec gets imported, so
3034 byte-compilation saves time.
3035 byte-compilation saves time.
3035
3036
3036 2004-06-25 Fernando Perez <fperez@colorado.edu>
3037 2004-06-25 Fernando Perez <fperez@colorado.edu>
3037
3038
3038 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3039 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3039 -NUM', which was recently broken.
3040 -NUM', which was recently broken.
3040
3041
3041 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3042 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3042 in multi-line input (but not !!, which doesn't make sense there).
3043 in multi-line input (but not !!, which doesn't make sense there).
3043
3044
3044 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3045 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3045 It's just too useful, and people can turn it off in the less
3046 It's just too useful, and people can turn it off in the less
3046 common cases where it's a problem.
3047 common cases where it's a problem.
3047
3048
3048 2004-06-24 Fernando Perez <fperez@colorado.edu>
3049 2004-06-24 Fernando Perez <fperez@colorado.edu>
3049
3050
3050 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3051 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3051 special syntaxes (like alias calling) is now allied in multi-line
3052 special syntaxes (like alias calling) is now allied in multi-line
3052 input. This is still _very_ experimental, but it's necessary for
3053 input. This is still _very_ experimental, but it's necessary for
3053 efficient shell usage combining python looping syntax with system
3054 efficient shell usage combining python looping syntax with system
3054 calls. For now it's restricted to aliases, I don't think it
3055 calls. For now it's restricted to aliases, I don't think it
3055 really even makes sense to have this for magics.
3056 really even makes sense to have this for magics.
3056
3057
3057 2004-06-23 Fernando Perez <fperez@colorado.edu>
3058 2004-06-23 Fernando Perez <fperez@colorado.edu>
3058
3059
3059 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3060 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3060 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3061 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3061
3062
3062 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3063 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3063 extensions under Windows (after code sent by Gary Bishop). The
3064 extensions under Windows (after code sent by Gary Bishop). The
3064 extensions considered 'executable' are stored in IPython's rc
3065 extensions considered 'executable' are stored in IPython's rc
3065 structure as win_exec_ext.
3066 structure as win_exec_ext.
3066
3067
3067 * IPython/genutils.py (shell): new function, like system() but
3068 * IPython/genutils.py (shell): new function, like system() but
3068 without return value. Very useful for interactive shell work.
3069 without return value. Very useful for interactive shell work.
3069
3070
3070 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3071 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3071 delete aliases.
3072 delete aliases.
3072
3073
3073 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3074 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3074 sure that the alias table doesn't contain python keywords.
3075 sure that the alias table doesn't contain python keywords.
3075
3076
3076 2004-06-21 Fernando Perez <fperez@colorado.edu>
3077 2004-06-21 Fernando Perez <fperez@colorado.edu>
3077
3078
3078 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3079 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3079 non-existent items are found in $PATH. Reported by Thorsten.
3080 non-existent items are found in $PATH. Reported by Thorsten.
3080
3081
3081 2004-06-20 Fernando Perez <fperez@colorado.edu>
3082 2004-06-20 Fernando Perez <fperez@colorado.edu>
3082
3083
3083 * IPython/iplib.py (complete): modified the completer so that the
3084 * IPython/iplib.py (complete): modified the completer so that the
3084 order of priorities can be easily changed at runtime.
3085 order of priorities can be easily changed at runtime.
3085
3086
3086 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3087 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3087 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3088 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3088
3089
3089 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3090 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3090 expand Python variables prepended with $ in all system calls. The
3091 expand Python variables prepended with $ in all system calls. The
3091 same was done to InteractiveShell.handle_shell_escape. Now all
3092 same was done to InteractiveShell.handle_shell_escape. Now all
3092 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3093 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3093 expansion of python variables and expressions according to the
3094 expansion of python variables and expressions according to the
3094 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3095 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3095
3096
3096 Though PEP-215 has been rejected, a similar (but simpler) one
3097 Though PEP-215 has been rejected, a similar (but simpler) one
3097 seems like it will go into Python 2.4, PEP-292 -
3098 seems like it will go into Python 2.4, PEP-292 -
3098 http://www.python.org/peps/pep-0292.html.
3099 http://www.python.org/peps/pep-0292.html.
3099
3100
3100 I'll keep the full syntax of PEP-215, since IPython has since the
3101 I'll keep the full syntax of PEP-215, since IPython has since the
3101 start used Ka-Ping Yee's reference implementation discussed there
3102 start used Ka-Ping Yee's reference implementation discussed there
3102 (Itpl), and I actually like the powerful semantics it offers.
3103 (Itpl), and I actually like the powerful semantics it offers.
3103
3104
3104 In order to access normal shell variables, the $ has to be escaped
3105 In order to access normal shell variables, the $ has to be escaped
3105 via an extra $. For example:
3106 via an extra $. For example:
3106
3107
3107 In [7]: PATH='a python variable'
3108 In [7]: PATH='a python variable'
3108
3109
3109 In [8]: !echo $PATH
3110 In [8]: !echo $PATH
3110 a python variable
3111 a python variable
3111
3112
3112 In [9]: !echo $$PATH
3113 In [9]: !echo $$PATH
3113 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3114 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3114
3115
3115 (Magic.parse_options): escape $ so the shell doesn't evaluate
3116 (Magic.parse_options): escape $ so the shell doesn't evaluate
3116 things prematurely.
3117 things prematurely.
3117
3118
3118 * IPython/iplib.py (InteractiveShell.call_alias): added the
3119 * IPython/iplib.py (InteractiveShell.call_alias): added the
3119 ability for aliases to expand python variables via $.
3120 ability for aliases to expand python variables via $.
3120
3121
3121 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3122 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3122 system, now there's a @rehash/@rehashx pair of magics. These work
3123 system, now there's a @rehash/@rehashx pair of magics. These work
3123 like the csh rehash command, and can be invoked at any time. They
3124 like the csh rehash command, and can be invoked at any time. They
3124 build a table of aliases to everything in the user's $PATH
3125 build a table of aliases to everything in the user's $PATH
3125 (@rehash uses everything, @rehashx is slower but only adds
3126 (@rehash uses everything, @rehashx is slower but only adds
3126 executable files). With this, the pysh.py-based shell profile can
3127 executable files). With this, the pysh.py-based shell profile can
3127 now simply call rehash upon startup, and full access to all
3128 now simply call rehash upon startup, and full access to all
3128 programs in the user's path is obtained.
3129 programs in the user's path is obtained.
3129
3130
3130 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3131 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3131 functionality is now fully in place. I removed the old dynamic
3132 functionality is now fully in place. I removed the old dynamic
3132 code generation based approach, in favor of a much lighter one
3133 code generation based approach, in favor of a much lighter one
3133 based on a simple dict. The advantage is that this allows me to
3134 based on a simple dict. The advantage is that this allows me to
3134 now have thousands of aliases with negligible cost (unthinkable
3135 now have thousands of aliases with negligible cost (unthinkable
3135 with the old system).
3136 with the old system).
3136
3137
3137 2004-06-19 Fernando Perez <fperez@colorado.edu>
3138 2004-06-19 Fernando Perez <fperez@colorado.edu>
3138
3139
3139 * IPython/iplib.py (__init__): extended MagicCompleter class to
3140 * IPython/iplib.py (__init__): extended MagicCompleter class to
3140 also complete (last in priority) on user aliases.
3141 also complete (last in priority) on user aliases.
3141
3142
3142 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3143 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3143 call to eval.
3144 call to eval.
3144 (ItplNS.__init__): Added a new class which functions like Itpl,
3145 (ItplNS.__init__): Added a new class which functions like Itpl,
3145 but allows configuring the namespace for the evaluation to occur
3146 but allows configuring the namespace for the evaluation to occur
3146 in.
3147 in.
3147
3148
3148 2004-06-18 Fernando Perez <fperez@colorado.edu>
3149 2004-06-18 Fernando Perez <fperez@colorado.edu>
3149
3150
3150 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3151 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3151 better message when 'exit' or 'quit' are typed (a common newbie
3152 better message when 'exit' or 'quit' are typed (a common newbie
3152 confusion).
3153 confusion).
3153
3154
3154 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3155 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3155 check for Windows users.
3156 check for Windows users.
3156
3157
3157 * IPython/iplib.py (InteractiveShell.user_setup): removed
3158 * IPython/iplib.py (InteractiveShell.user_setup): removed
3158 disabling of colors for Windows. I'll test at runtime and issue a
3159 disabling of colors for Windows. I'll test at runtime and issue a
3159 warning if Gary's readline isn't found, as to nudge users to
3160 warning if Gary's readline isn't found, as to nudge users to
3160 download it.
3161 download it.
3161
3162
3162 2004-06-16 Fernando Perez <fperez@colorado.edu>
3163 2004-06-16 Fernando Perez <fperez@colorado.edu>
3163
3164
3164 * IPython/genutils.py (Stream.__init__): changed to print errors
3165 * IPython/genutils.py (Stream.__init__): changed to print errors
3165 to sys.stderr. I had a circular dependency here. Now it's
3166 to sys.stderr. I had a circular dependency here. Now it's
3166 possible to run ipython as IDLE's shell (consider this pre-alpha,
3167 possible to run ipython as IDLE's shell (consider this pre-alpha,
3167 since true stdout things end up in the starting terminal instead
3168 since true stdout things end up in the starting terminal instead
3168 of IDLE's out).
3169 of IDLE's out).
3169
3170
3170 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3171 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3171 users who haven't # updated their prompt_in2 definitions. Remove
3172 users who haven't # updated their prompt_in2 definitions. Remove
3172 eventually.
3173 eventually.
3173 (multiple_replace): added credit to original ASPN recipe.
3174 (multiple_replace): added credit to original ASPN recipe.
3174
3175
3175 2004-06-15 Fernando Perez <fperez@colorado.edu>
3176 2004-06-15 Fernando Perez <fperez@colorado.edu>
3176
3177
3177 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3178 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3178 list of auto-defined aliases.
3179 list of auto-defined aliases.
3179
3180
3180 2004-06-13 Fernando Perez <fperez@colorado.edu>
3181 2004-06-13 Fernando Perez <fperez@colorado.edu>
3181
3182
3182 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3183 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3183 install was really requested (so setup.py can be used for other
3184 install was really requested (so setup.py can be used for other
3184 things under Windows).
3185 things under Windows).
3185
3186
3186 2004-06-10 Fernando Perez <fperez@colorado.edu>
3187 2004-06-10 Fernando Perez <fperez@colorado.edu>
3187
3188
3188 * IPython/Logger.py (Logger.create_log): Manually remove any old
3189 * IPython/Logger.py (Logger.create_log): Manually remove any old
3189 backup, since os.remove may fail under Windows. Fixes bug
3190 backup, since os.remove may fail under Windows. Fixes bug
3190 reported by Thorsten.
3191 reported by Thorsten.
3191
3192
3192 2004-06-09 Fernando Perez <fperez@colorado.edu>
3193 2004-06-09 Fernando Perez <fperez@colorado.edu>
3193
3194
3194 * examples/example-embed.py: fixed all references to %n (replaced
3195 * examples/example-embed.py: fixed all references to %n (replaced
3195 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3196 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3196 for all examples and the manual as well.
3197 for all examples and the manual as well.
3197
3198
3198 2004-06-08 Fernando Perez <fperez@colorado.edu>
3199 2004-06-08 Fernando Perez <fperez@colorado.edu>
3199
3200
3200 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3201 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3201 alignment and color management. All 3 prompt subsystems now
3202 alignment and color management. All 3 prompt subsystems now
3202 inherit from BasePrompt.
3203 inherit from BasePrompt.
3203
3204
3204 * tools/release: updates for windows installer build and tag rpms
3205 * tools/release: updates for windows installer build and tag rpms
3205 with python version (since paths are fixed).
3206 with python version (since paths are fixed).
3206
3207
3207 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3208 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3208 which will become eventually obsolete. Also fixed the default
3209 which will become eventually obsolete. Also fixed the default
3209 prompt_in2 to use \D, so at least new users start with the correct
3210 prompt_in2 to use \D, so at least new users start with the correct
3210 defaults.
3211 defaults.
3211 WARNING: Users with existing ipythonrc files will need to apply
3212 WARNING: Users with existing ipythonrc files will need to apply
3212 this fix manually!
3213 this fix manually!
3213
3214
3214 * setup.py: make windows installer (.exe). This is finally the
3215 * setup.py: make windows installer (.exe). This is finally the
3215 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3216 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3216 which I hadn't included because it required Python 2.3 (or recent
3217 which I hadn't included because it required Python 2.3 (or recent
3217 distutils).
3218 distutils).
3218
3219
3219 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3220 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3220 usage of new '\D' escape.
3221 usage of new '\D' escape.
3221
3222
3222 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3223 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3223 lacks os.getuid())
3224 lacks os.getuid())
3224 (CachedOutput.set_colors): Added the ability to turn coloring
3225 (CachedOutput.set_colors): Added the ability to turn coloring
3225 on/off with @colors even for manually defined prompt colors. It
3226 on/off with @colors even for manually defined prompt colors. It
3226 uses a nasty global, but it works safely and via the generic color
3227 uses a nasty global, but it works safely and via the generic color
3227 handling mechanism.
3228 handling mechanism.
3228 (Prompt2.__init__): Introduced new escape '\D' for continuation
3229 (Prompt2.__init__): Introduced new escape '\D' for continuation
3229 prompts. It represents the counter ('\#') as dots.
3230 prompts. It represents the counter ('\#') as dots.
3230 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3231 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3231 need to update their ipythonrc files and replace '%n' with '\D' in
3232 need to update their ipythonrc files and replace '%n' with '\D' in
3232 their prompt_in2 settings everywhere. Sorry, but there's
3233 their prompt_in2 settings everywhere. Sorry, but there's
3233 otherwise no clean way to get all prompts to properly align. The
3234 otherwise no clean way to get all prompts to properly align. The
3234 ipythonrc shipped with IPython has been updated.
3235 ipythonrc shipped with IPython has been updated.
3235
3236
3236 2004-06-07 Fernando Perez <fperez@colorado.edu>
3237 2004-06-07 Fernando Perez <fperez@colorado.edu>
3237
3238
3238 * setup.py (isfile): Pass local_icons option to latex2html, so the
3239 * setup.py (isfile): Pass local_icons option to latex2html, so the
3239 resulting HTML file is self-contained. Thanks to
3240 resulting HTML file is self-contained. Thanks to
3240 dryice-AT-liu.com.cn for the tip.
3241 dryice-AT-liu.com.cn for the tip.
3241
3242
3242 * pysh.py: I created a new profile 'shell', which implements a
3243 * pysh.py: I created a new profile 'shell', which implements a
3243 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3244 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3244 system shell, nor will it become one anytime soon. It's mainly
3245 system shell, nor will it become one anytime soon. It's mainly
3245 meant to illustrate the use of the new flexible bash-like prompts.
3246 meant to illustrate the use of the new flexible bash-like prompts.
3246 I guess it could be used by hardy souls for true shell management,
3247 I guess it could be used by hardy souls for true shell management,
3247 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3248 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3248 profile. This uses the InterpreterExec extension provided by
3249 profile. This uses the InterpreterExec extension provided by
3249 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3250 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3250
3251
3251 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3252 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3252 auto-align itself with the length of the previous input prompt
3253 auto-align itself with the length of the previous input prompt
3253 (taking into account the invisible color escapes).
3254 (taking into account the invisible color escapes).
3254 (CachedOutput.__init__): Large restructuring of this class. Now
3255 (CachedOutput.__init__): Large restructuring of this class. Now
3255 all three prompts (primary1, primary2, output) are proper objects,
3256 all three prompts (primary1, primary2, output) are proper objects,
3256 managed by the 'parent' CachedOutput class. The code is still a
3257 managed by the 'parent' CachedOutput class. The code is still a
3257 bit hackish (all prompts share state via a pointer to the cache),
3258 bit hackish (all prompts share state via a pointer to the cache),
3258 but it's overall far cleaner than before.
3259 but it's overall far cleaner than before.
3259
3260
3260 * IPython/genutils.py (getoutputerror): modified to add verbose,
3261 * IPython/genutils.py (getoutputerror): modified to add verbose,
3261 debug and header options. This makes the interface of all getout*
3262 debug and header options. This makes the interface of all getout*
3262 functions uniform.
3263 functions uniform.
3263 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3264 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3264
3265
3265 * IPython/Magic.py (Magic.default_option): added a function to
3266 * IPython/Magic.py (Magic.default_option): added a function to
3266 allow registering default options for any magic command. This
3267 allow registering default options for any magic command. This
3267 makes it easy to have profiles which customize the magics globally
3268 makes it easy to have profiles which customize the magics globally
3268 for a certain use. The values set through this function are
3269 for a certain use. The values set through this function are
3269 picked up by the parse_options() method, which all magics should
3270 picked up by the parse_options() method, which all magics should
3270 use to parse their options.
3271 use to parse their options.
3271
3272
3272 * IPython/genutils.py (warn): modified the warnings framework to
3273 * IPython/genutils.py (warn): modified the warnings framework to
3273 use the Term I/O class. I'm trying to slowly unify all of
3274 use the Term I/O class. I'm trying to slowly unify all of
3274 IPython's I/O operations to pass through Term.
3275 IPython's I/O operations to pass through Term.
3275
3276
3276 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3277 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3277 the secondary prompt to correctly match the length of the primary
3278 the secondary prompt to correctly match the length of the primary
3278 one for any prompt. Now multi-line code will properly line up
3279 one for any prompt. Now multi-line code will properly line up
3279 even for path dependent prompts, such as the new ones available
3280 even for path dependent prompts, such as the new ones available
3280 via the prompt_specials.
3281 via the prompt_specials.
3281
3282
3282 2004-06-06 Fernando Perez <fperez@colorado.edu>
3283 2004-06-06 Fernando Perez <fperez@colorado.edu>
3283
3284
3284 * IPython/Prompts.py (prompt_specials): Added the ability to have
3285 * IPython/Prompts.py (prompt_specials): Added the ability to have
3285 bash-like special sequences in the prompts, which get
3286 bash-like special sequences in the prompts, which get
3286 automatically expanded. Things like hostname, current working
3287 automatically expanded. Things like hostname, current working
3287 directory and username are implemented already, but it's easy to
3288 directory and username are implemented already, but it's easy to
3288 add more in the future. Thanks to a patch by W.J. van der Laan
3289 add more in the future. Thanks to a patch by W.J. van der Laan
3289 <gnufnork-AT-hetdigitalegat.nl>
3290 <gnufnork-AT-hetdigitalegat.nl>
3290 (prompt_specials): Added color support for prompt strings, so
3291 (prompt_specials): Added color support for prompt strings, so
3291 users can define arbitrary color setups for their prompts.
3292 users can define arbitrary color setups for their prompts.
3292
3293
3293 2004-06-05 Fernando Perez <fperez@colorado.edu>
3294 2004-06-05 Fernando Perez <fperez@colorado.edu>
3294
3295
3295 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3296 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3296 code to load Gary Bishop's readline and configure it
3297 code to load Gary Bishop's readline and configure it
3297 automatically. Thanks to Gary for help on this.
3298 automatically. Thanks to Gary for help on this.
3298
3299
3299 2004-06-01 Fernando Perez <fperez@colorado.edu>
3300 2004-06-01 Fernando Perez <fperez@colorado.edu>
3300
3301
3301 * IPython/Logger.py (Logger.create_log): fix bug for logging
3302 * IPython/Logger.py (Logger.create_log): fix bug for logging
3302 with no filename (previous fix was incomplete).
3303 with no filename (previous fix was incomplete).
3303
3304
3304 2004-05-25 Fernando Perez <fperez@colorado.edu>
3305 2004-05-25 Fernando Perez <fperez@colorado.edu>
3305
3306
3306 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3307 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3307 parens would get passed to the shell.
3308 parens would get passed to the shell.
3308
3309
3309 2004-05-20 Fernando Perez <fperez@colorado.edu>
3310 2004-05-20 Fernando Perez <fperez@colorado.edu>
3310
3311
3311 * IPython/Magic.py (Magic.magic_prun): changed default profile
3312 * IPython/Magic.py (Magic.magic_prun): changed default profile
3312 sort order to 'time' (the more common profiling need).
3313 sort order to 'time' (the more common profiling need).
3313
3314
3314 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3315 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3315 so that source code shown is guaranteed in sync with the file on
3316 so that source code shown is guaranteed in sync with the file on
3316 disk (also changed in psource). Similar fix to the one for
3317 disk (also changed in psource). Similar fix to the one for
3317 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3318 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3318 <yann.ledu-AT-noos.fr>.
3319 <yann.ledu-AT-noos.fr>.
3319
3320
3320 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3321 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3321 with a single option would not be correctly parsed. Closes
3322 with a single option would not be correctly parsed. Closes
3322 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3323 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3323 introduced in 0.6.0 (on 2004-05-06).
3324 introduced in 0.6.0 (on 2004-05-06).
3324
3325
3325 2004-05-13 *** Released version 0.6.0
3326 2004-05-13 *** Released version 0.6.0
3326
3327
3327 2004-05-13 Fernando Perez <fperez@colorado.edu>
3328 2004-05-13 Fernando Perez <fperez@colorado.edu>
3328
3329
3329 * debian/: Added debian/ directory to CVS, so that debian support
3330 * debian/: Added debian/ directory to CVS, so that debian support
3330 is publicly accessible. The debian package is maintained by Jack
3331 is publicly accessible. The debian package is maintained by Jack
3331 Moffit <jack-AT-xiph.org>.
3332 Moffit <jack-AT-xiph.org>.
3332
3333
3333 * Documentation: included the notes about an ipython-based system
3334 * Documentation: included the notes about an ipython-based system
3334 shell (the hypothetical 'pysh') into the new_design.pdf document,
3335 shell (the hypothetical 'pysh') into the new_design.pdf document,
3335 so that these ideas get distributed to users along with the
3336 so that these ideas get distributed to users along with the
3336 official documentation.
3337 official documentation.
3337
3338
3338 2004-05-10 Fernando Perez <fperez@colorado.edu>
3339 2004-05-10 Fernando Perez <fperez@colorado.edu>
3339
3340
3340 * IPython/Logger.py (Logger.create_log): fix recently introduced
3341 * IPython/Logger.py (Logger.create_log): fix recently introduced
3341 bug (misindented line) where logstart would fail when not given an
3342 bug (misindented line) where logstart would fail when not given an
3342 explicit filename.
3343 explicit filename.
3343
3344
3344 2004-05-09 Fernando Perez <fperez@colorado.edu>
3345 2004-05-09 Fernando Perez <fperez@colorado.edu>
3345
3346
3346 * IPython/Magic.py (Magic.parse_options): skip system call when
3347 * IPython/Magic.py (Magic.parse_options): skip system call when
3347 there are no options to look for. Faster, cleaner for the common
3348 there are no options to look for. Faster, cleaner for the common
3348 case.
3349 case.
3349
3350
3350 * Documentation: many updates to the manual: describing Windows
3351 * Documentation: many updates to the manual: describing Windows
3351 support better, Gnuplot updates, credits, misc small stuff. Also
3352 support better, Gnuplot updates, credits, misc small stuff. Also
3352 updated the new_design doc a bit.
3353 updated the new_design doc a bit.
3353
3354
3354 2004-05-06 *** Released version 0.6.0.rc1
3355 2004-05-06 *** Released version 0.6.0.rc1
3355
3356
3356 2004-05-06 Fernando Perez <fperez@colorado.edu>
3357 2004-05-06 Fernando Perez <fperez@colorado.edu>
3357
3358
3358 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3359 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3359 operations to use the vastly more efficient list/''.join() method.
3360 operations to use the vastly more efficient list/''.join() method.
3360 (FormattedTB.text): Fix
3361 (FormattedTB.text): Fix
3361 http://www.scipy.net/roundup/ipython/issue12 - exception source
3362 http://www.scipy.net/roundup/ipython/issue12 - exception source
3362 extract not updated after reload. Thanks to Mike Salib
3363 extract not updated after reload. Thanks to Mike Salib
3363 <msalib-AT-mit.edu> for pinning the source of the problem.
3364 <msalib-AT-mit.edu> for pinning the source of the problem.
3364 Fortunately, the solution works inside ipython and doesn't require
3365 Fortunately, the solution works inside ipython and doesn't require
3365 any changes to python proper.
3366 any changes to python proper.
3366
3367
3367 * IPython/Magic.py (Magic.parse_options): Improved to process the
3368 * IPython/Magic.py (Magic.parse_options): Improved to process the
3368 argument list as a true shell would (by actually using the
3369 argument list as a true shell would (by actually using the
3369 underlying system shell). This way, all @magics automatically get
3370 underlying system shell). This way, all @magics automatically get
3370 shell expansion for variables. Thanks to a comment by Alex
3371 shell expansion for variables. Thanks to a comment by Alex
3371 Schmolck.
3372 Schmolck.
3372
3373
3373 2004-04-04 Fernando Perez <fperez@colorado.edu>
3374 2004-04-04 Fernando Perez <fperez@colorado.edu>
3374
3375
3375 * IPython/iplib.py (InteractiveShell.interact): Added a special
3376 * IPython/iplib.py (InteractiveShell.interact): Added a special
3376 trap for a debugger quit exception, which is basically impossible
3377 trap for a debugger quit exception, which is basically impossible
3377 to handle by normal mechanisms, given what pdb does to the stack.
3378 to handle by normal mechanisms, given what pdb does to the stack.
3378 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3379 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3379
3380
3380 2004-04-03 Fernando Perez <fperez@colorado.edu>
3381 2004-04-03 Fernando Perez <fperez@colorado.edu>
3381
3382
3382 * IPython/genutils.py (Term): Standardized the names of the Term
3383 * IPython/genutils.py (Term): Standardized the names of the Term
3383 class streams to cin/cout/cerr, following C++ naming conventions
3384 class streams to cin/cout/cerr, following C++ naming conventions
3384 (I can't use in/out/err because 'in' is not a valid attribute
3385 (I can't use in/out/err because 'in' is not a valid attribute
3385 name).
3386 name).
3386
3387
3387 * IPython/iplib.py (InteractiveShell.interact): don't increment
3388 * IPython/iplib.py (InteractiveShell.interact): don't increment
3388 the prompt if there's no user input. By Daniel 'Dang' Griffith
3389 the prompt if there's no user input. By Daniel 'Dang' Griffith
3389 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3390 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3390 Francois Pinard.
3391 Francois Pinard.
3391
3392
3392 2004-04-02 Fernando Perez <fperez@colorado.edu>
3393 2004-04-02 Fernando Perez <fperez@colorado.edu>
3393
3394
3394 * IPython/genutils.py (Stream.__init__): Modified to survive at
3395 * IPython/genutils.py (Stream.__init__): Modified to survive at
3395 least importing in contexts where stdin/out/err aren't true file
3396 least importing in contexts where stdin/out/err aren't true file
3396 objects, such as PyCrust (they lack fileno() and mode). However,
3397 objects, such as PyCrust (they lack fileno() and mode). However,
3397 the recovery facilities which rely on these things existing will
3398 the recovery facilities which rely on these things existing will
3398 not work.
3399 not work.
3399
3400
3400 2004-04-01 Fernando Perez <fperez@colorado.edu>
3401 2004-04-01 Fernando Perez <fperez@colorado.edu>
3401
3402
3402 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3403 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3403 use the new getoutputerror() function, so it properly
3404 use the new getoutputerror() function, so it properly
3404 distinguishes stdout/err.
3405 distinguishes stdout/err.
3405
3406
3406 * IPython/genutils.py (getoutputerror): added a function to
3407 * IPython/genutils.py (getoutputerror): added a function to
3407 capture separately the standard output and error of a command.
3408 capture separately the standard output and error of a command.
3408 After a comment from dang on the mailing lists. This code is
3409 After a comment from dang on the mailing lists. This code is
3409 basically a modified version of commands.getstatusoutput(), from
3410 basically a modified version of commands.getstatusoutput(), from
3410 the standard library.
3411 the standard library.
3411
3412
3412 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3413 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3413 '!!' as a special syntax (shorthand) to access @sx.
3414 '!!' as a special syntax (shorthand) to access @sx.
3414
3415
3415 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3416 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3416 command and return its output as a list split on '\n'.
3417 command and return its output as a list split on '\n'.
3417
3418
3418 2004-03-31 Fernando Perez <fperez@colorado.edu>
3419 2004-03-31 Fernando Perez <fperez@colorado.edu>
3419
3420
3420 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3421 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3421 method to dictionaries used as FakeModule instances if they lack
3422 method to dictionaries used as FakeModule instances if they lack
3422 it. At least pydoc in python2.3 breaks for runtime-defined
3423 it. At least pydoc in python2.3 breaks for runtime-defined
3423 functions without this hack. At some point I need to _really_
3424 functions without this hack. At some point I need to _really_
3424 understand what FakeModule is doing, because it's a gross hack.
3425 understand what FakeModule is doing, because it's a gross hack.
3425 But it solves Arnd's problem for now...
3426 But it solves Arnd's problem for now...
3426
3427
3427 2004-02-27 Fernando Perez <fperez@colorado.edu>
3428 2004-02-27 Fernando Perez <fperez@colorado.edu>
3428
3429
3429 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3430 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3430 mode would behave erratically. Also increased the number of
3431 mode would behave erratically. Also increased the number of
3431 possible logs in rotate mod to 999. Thanks to Rod Holland
3432 possible logs in rotate mod to 999. Thanks to Rod Holland
3432 <rhh@StructureLABS.com> for the report and fixes.
3433 <rhh@StructureLABS.com> for the report and fixes.
3433
3434
3434 2004-02-26 Fernando Perez <fperez@colorado.edu>
3435 2004-02-26 Fernando Perez <fperez@colorado.edu>
3435
3436
3436 * IPython/genutils.py (page): Check that the curses module really
3437 * IPython/genutils.py (page): Check that the curses module really
3437 has the initscr attribute before trying to use it. For some
3438 has the initscr attribute before trying to use it. For some
3438 reason, the Solaris curses module is missing this. I think this
3439 reason, the Solaris curses module is missing this. I think this
3439 should be considered a Solaris python bug, but I'm not sure.
3440 should be considered a Solaris python bug, but I'm not sure.
3440
3441
3441 2004-01-17 Fernando Perez <fperez@colorado.edu>
3442 2004-01-17 Fernando Perez <fperez@colorado.edu>
3442
3443
3443 * IPython/genutils.py (Stream.__init__): Changes to try to make
3444 * IPython/genutils.py (Stream.__init__): Changes to try to make
3444 ipython robust against stdin/out/err being closed by the user.
3445 ipython robust against stdin/out/err being closed by the user.
3445 This is 'user error' (and blocks a normal python session, at least
3446 This is 'user error' (and blocks a normal python session, at least
3446 the stdout case). However, Ipython should be able to survive such
3447 the stdout case). However, Ipython should be able to survive such
3447 instances of abuse as gracefully as possible. To simplify the
3448 instances of abuse as gracefully as possible. To simplify the
3448 coding and maintain compatibility with Gary Bishop's Term
3449 coding and maintain compatibility with Gary Bishop's Term
3449 contributions, I've made use of classmethods for this. I think
3450 contributions, I've made use of classmethods for this. I think
3450 this introduces a dependency on python 2.2.
3451 this introduces a dependency on python 2.2.
3451
3452
3452 2004-01-13 Fernando Perez <fperez@colorado.edu>
3453 2004-01-13 Fernando Perez <fperez@colorado.edu>
3453
3454
3454 * IPython/numutils.py (exp_safe): simplified the code a bit and
3455 * IPython/numutils.py (exp_safe): simplified the code a bit and
3455 removed the need for importing the kinds module altogether.
3456 removed the need for importing the kinds module altogether.
3456
3457
3457 2004-01-06 Fernando Perez <fperez@colorado.edu>
3458 2004-01-06 Fernando Perez <fperez@colorado.edu>
3458
3459
3459 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3460 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3460 a magic function instead, after some community feedback. No
3461 a magic function instead, after some community feedback. No
3461 special syntax will exist for it, but its name is deliberately
3462 special syntax will exist for it, but its name is deliberately
3462 very short.
3463 very short.
3463
3464
3464 2003-12-20 Fernando Perez <fperez@colorado.edu>
3465 2003-12-20 Fernando Perez <fperez@colorado.edu>
3465
3466
3466 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3467 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3467 new functionality, to automagically assign the result of a shell
3468 new functionality, to automagically assign the result of a shell
3468 command to a variable. I'll solicit some community feedback on
3469 command to a variable. I'll solicit some community feedback on
3469 this before making it permanent.
3470 this before making it permanent.
3470
3471
3471 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3472 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3472 requested about callables for which inspect couldn't obtain a
3473 requested about callables for which inspect couldn't obtain a
3473 proper argspec. Thanks to a crash report sent by Etienne
3474 proper argspec. Thanks to a crash report sent by Etienne
3474 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3475 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3475
3476
3476 2003-12-09 Fernando Perez <fperez@colorado.edu>
3477 2003-12-09 Fernando Perez <fperez@colorado.edu>
3477
3478
3478 * IPython/genutils.py (page): patch for the pager to work across
3479 * IPython/genutils.py (page): patch for the pager to work across
3479 various versions of Windows. By Gary Bishop.
3480 various versions of Windows. By Gary Bishop.
3480
3481
3481 2003-12-04 Fernando Perez <fperez@colorado.edu>
3482 2003-12-04 Fernando Perez <fperez@colorado.edu>
3482
3483
3483 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3484 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3484 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3485 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3485 While I tested this and it looks ok, there may still be corner
3486 While I tested this and it looks ok, there may still be corner
3486 cases I've missed.
3487 cases I've missed.
3487
3488
3488 2003-12-01 Fernando Perez <fperez@colorado.edu>
3489 2003-12-01 Fernando Perez <fperez@colorado.edu>
3489
3490
3490 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3491 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3491 where a line like 'p,q=1,2' would fail because the automagic
3492 where a line like 'p,q=1,2' would fail because the automagic
3492 system would be triggered for @p.
3493 system would be triggered for @p.
3493
3494
3494 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3495 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3495 cleanups, code unmodified.
3496 cleanups, code unmodified.
3496
3497
3497 * IPython/genutils.py (Term): added a class for IPython to handle
3498 * IPython/genutils.py (Term): added a class for IPython to handle
3498 output. In most cases it will just be a proxy for stdout/err, but
3499 output. In most cases it will just be a proxy for stdout/err, but
3499 having this allows modifications to be made for some platforms,
3500 having this allows modifications to be made for some platforms,
3500 such as handling color escapes under Windows. All of this code
3501 such as handling color escapes under Windows. All of this code
3501 was contributed by Gary Bishop, with minor modifications by me.
3502 was contributed by Gary Bishop, with minor modifications by me.
3502 The actual changes affect many files.
3503 The actual changes affect many files.
3503
3504
3504 2003-11-30 Fernando Perez <fperez@colorado.edu>
3505 2003-11-30 Fernando Perez <fperez@colorado.edu>
3505
3506
3506 * IPython/iplib.py (file_matches): new completion code, courtesy
3507 * IPython/iplib.py (file_matches): new completion code, courtesy
3507 of Jeff Collins. This enables filename completion again under
3508 of Jeff Collins. This enables filename completion again under
3508 python 2.3, which disabled it at the C level.
3509 python 2.3, which disabled it at the C level.
3509
3510
3510 2003-11-11 Fernando Perez <fperez@colorado.edu>
3511 2003-11-11 Fernando Perez <fperez@colorado.edu>
3511
3512
3512 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3513 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3513 for Numeric.array(map(...)), but often convenient.
3514 for Numeric.array(map(...)), but often convenient.
3514
3515
3515 2003-11-05 Fernando Perez <fperez@colorado.edu>
3516 2003-11-05 Fernando Perez <fperez@colorado.edu>
3516
3517
3517 * IPython/numutils.py (frange): Changed a call from int() to
3518 * IPython/numutils.py (frange): Changed a call from int() to
3518 int(round()) to prevent a problem reported with arange() in the
3519 int(round()) to prevent a problem reported with arange() in the
3519 numpy list.
3520 numpy list.
3520
3521
3521 2003-10-06 Fernando Perez <fperez@colorado.edu>
3522 2003-10-06 Fernando Perez <fperez@colorado.edu>
3522
3523
3523 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3524 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3524 prevent crashes if sys lacks an argv attribute (it happens with
3525 prevent crashes if sys lacks an argv attribute (it happens with
3525 embedded interpreters which build a bare-bones sys module).
3526 embedded interpreters which build a bare-bones sys module).
3526 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3527 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3527
3528
3528 2003-09-24 Fernando Perez <fperez@colorado.edu>
3529 2003-09-24 Fernando Perez <fperez@colorado.edu>
3529
3530
3530 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3531 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3531 to protect against poorly written user objects where __getattr__
3532 to protect against poorly written user objects where __getattr__
3532 raises exceptions other than AttributeError. Thanks to a bug
3533 raises exceptions other than AttributeError. Thanks to a bug
3533 report by Oliver Sander <osander-AT-gmx.de>.
3534 report by Oliver Sander <osander-AT-gmx.de>.
3534
3535
3535 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3536 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3536 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3537 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3537
3538
3538 2003-09-09 Fernando Perez <fperez@colorado.edu>
3539 2003-09-09 Fernando Perez <fperez@colorado.edu>
3539
3540
3540 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3541 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3541 unpacking a list whith a callable as first element would
3542 unpacking a list whith a callable as first element would
3542 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3543 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3543 Collins.
3544 Collins.
3544
3545
3545 2003-08-25 *** Released version 0.5.0
3546 2003-08-25 *** Released version 0.5.0
3546
3547
3547 2003-08-22 Fernando Perez <fperez@colorado.edu>
3548 2003-08-22 Fernando Perez <fperez@colorado.edu>
3548
3549
3549 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3550 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3550 improperly defined user exceptions. Thanks to feedback from Mark
3551 improperly defined user exceptions. Thanks to feedback from Mark
3551 Russell <mrussell-AT-verio.net>.
3552 Russell <mrussell-AT-verio.net>.
3552
3553
3553 2003-08-20 Fernando Perez <fperez@colorado.edu>
3554 2003-08-20 Fernando Perez <fperez@colorado.edu>
3554
3555
3555 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3556 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3556 printing so that it would print multi-line string forms starting
3557 printing so that it would print multi-line string forms starting
3557 with a new line. This way the formatting is better respected for
3558 with a new line. This way the formatting is better respected for
3558 objects which work hard to make nice string forms.
3559 objects which work hard to make nice string forms.
3559
3560
3560 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3561 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3561 autocall would overtake data access for objects with both
3562 autocall would overtake data access for objects with both
3562 __getitem__ and __call__.
3563 __getitem__ and __call__.
3563
3564
3564 2003-08-19 *** Released version 0.5.0-rc1
3565 2003-08-19 *** Released version 0.5.0-rc1
3565
3566
3566 2003-08-19 Fernando Perez <fperez@colorado.edu>
3567 2003-08-19 Fernando Perez <fperez@colorado.edu>
3567
3568
3568 * IPython/deep_reload.py (load_tail): single tiny change here
3569 * IPython/deep_reload.py (load_tail): single tiny change here
3569 seems to fix the long-standing bug of dreload() failing to work
3570 seems to fix the long-standing bug of dreload() failing to work
3570 for dotted names. But this module is pretty tricky, so I may have
3571 for dotted names. But this module is pretty tricky, so I may have
3571 missed some subtlety. Needs more testing!.
3572 missed some subtlety. Needs more testing!.
3572
3573
3573 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3574 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3574 exceptions which have badly implemented __str__ methods.
3575 exceptions which have badly implemented __str__ methods.
3575 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3576 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3576 which I've been getting reports about from Python 2.3 users. I
3577 which I've been getting reports about from Python 2.3 users. I
3577 wish I had a simple test case to reproduce the problem, so I could
3578 wish I had a simple test case to reproduce the problem, so I could
3578 either write a cleaner workaround or file a bug report if
3579 either write a cleaner workaround or file a bug report if
3579 necessary.
3580 necessary.
3580
3581
3581 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3582 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3582 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3583 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3583 a bug report by Tjabo Kloppenburg.
3584 a bug report by Tjabo Kloppenburg.
3584
3585
3585 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3586 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3586 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3587 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3587 seems rather unstable. Thanks to a bug report by Tjabo
3588 seems rather unstable. Thanks to a bug report by Tjabo
3588 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3589 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3589
3590
3590 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3591 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3591 this out soon because of the critical fixes in the inner loop for
3592 this out soon because of the critical fixes in the inner loop for
3592 generators.
3593 generators.
3593
3594
3594 * IPython/Magic.py (Magic.getargspec): removed. This (and
3595 * IPython/Magic.py (Magic.getargspec): removed. This (and
3595 _get_def) have been obsoleted by OInspect for a long time, I
3596 _get_def) have been obsoleted by OInspect for a long time, I
3596 hadn't noticed that they were dead code.
3597 hadn't noticed that they were dead code.
3597 (Magic._ofind): restored _ofind functionality for a few literals
3598 (Magic._ofind): restored _ofind functionality for a few literals
3598 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3599 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3599 for things like "hello".capitalize?, since that would require a
3600 for things like "hello".capitalize?, since that would require a
3600 potentially dangerous eval() again.
3601 potentially dangerous eval() again.
3601
3602
3602 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3603 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3603 logic a bit more to clean up the escapes handling and minimize the
3604 logic a bit more to clean up the escapes handling and minimize the
3604 use of _ofind to only necessary cases. The interactive 'feel' of
3605 use of _ofind to only necessary cases. The interactive 'feel' of
3605 IPython should have improved quite a bit with the changes in
3606 IPython should have improved quite a bit with the changes in
3606 _prefilter and _ofind (besides being far safer than before).
3607 _prefilter and _ofind (besides being far safer than before).
3607
3608
3608 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3609 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3609 obscure, never reported). Edit would fail to find the object to
3610 obscure, never reported). Edit would fail to find the object to
3610 edit under some circumstances.
3611 edit under some circumstances.
3611 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3612 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3612 which were causing double-calling of generators. Those eval calls
3613 which were causing double-calling of generators. Those eval calls
3613 were _very_ dangerous, since code with side effects could be
3614 were _very_ dangerous, since code with side effects could be
3614 triggered. As they say, 'eval is evil'... These were the
3615 triggered. As they say, 'eval is evil'... These were the
3615 nastiest evals in IPython. Besides, _ofind is now far simpler,
3616 nastiest evals in IPython. Besides, _ofind is now far simpler,
3616 and it should also be quite a bit faster. Its use of inspect is
3617 and it should also be quite a bit faster. Its use of inspect is
3617 also safer, so perhaps some of the inspect-related crashes I've
3618 also safer, so perhaps some of the inspect-related crashes I've
3618 seen lately with Python 2.3 might be taken care of. That will
3619 seen lately with Python 2.3 might be taken care of. That will
3619 need more testing.
3620 need more testing.
3620
3621
3621 2003-08-17 Fernando Perez <fperez@colorado.edu>
3622 2003-08-17 Fernando Perez <fperez@colorado.edu>
3622
3623
3623 * IPython/iplib.py (InteractiveShell._prefilter): significant
3624 * IPython/iplib.py (InteractiveShell._prefilter): significant
3624 simplifications to the logic for handling user escapes. Faster
3625 simplifications to the logic for handling user escapes. Faster
3625 and simpler code.
3626 and simpler code.
3626
3627
3627 2003-08-14 Fernando Perez <fperez@colorado.edu>
3628 2003-08-14 Fernando Perez <fperez@colorado.edu>
3628
3629
3629 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3630 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3630 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3631 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3631 but it should be quite a bit faster. And the recursive version
3632 but it should be quite a bit faster. And the recursive version
3632 generated O(log N) intermediate storage for all rank>1 arrays,
3633 generated O(log N) intermediate storage for all rank>1 arrays,
3633 even if they were contiguous.
3634 even if they were contiguous.
3634 (l1norm): Added this function.
3635 (l1norm): Added this function.
3635 (norm): Added this function for arbitrary norms (including
3636 (norm): Added this function for arbitrary norms (including
3636 l-infinity). l1 and l2 are still special cases for convenience
3637 l-infinity). l1 and l2 are still special cases for convenience
3637 and speed.
3638 and speed.
3638
3639
3639 2003-08-03 Fernando Perez <fperez@colorado.edu>
3640 2003-08-03 Fernando Perez <fperez@colorado.edu>
3640
3641
3641 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3642 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3642 exceptions, which now raise PendingDeprecationWarnings in Python
3643 exceptions, which now raise PendingDeprecationWarnings in Python
3643 2.3. There were some in Magic and some in Gnuplot2.
3644 2.3. There were some in Magic and some in Gnuplot2.
3644
3645
3645 2003-06-30 Fernando Perez <fperez@colorado.edu>
3646 2003-06-30 Fernando Perez <fperez@colorado.edu>
3646
3647
3647 * IPython/genutils.py (page): modified to call curses only for
3648 * IPython/genutils.py (page): modified to call curses only for
3648 terminals where TERM=='xterm'. After problems under many other
3649 terminals where TERM=='xterm'. After problems under many other
3649 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3650 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3650
3651
3651 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3652 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3652 would be triggered when readline was absent. This was just an old
3653 would be triggered when readline was absent. This was just an old
3653 debugging statement I'd forgotten to take out.
3654 debugging statement I'd forgotten to take out.
3654
3655
3655 2003-06-20 Fernando Perez <fperez@colorado.edu>
3656 2003-06-20 Fernando Perez <fperez@colorado.edu>
3656
3657
3657 * IPython/genutils.py (clock): modified to return only user time
3658 * IPython/genutils.py (clock): modified to return only user time
3658 (not counting system time), after a discussion on scipy. While
3659 (not counting system time), after a discussion on scipy. While
3659 system time may be a useful quantity occasionally, it may much
3660 system time may be a useful quantity occasionally, it may much
3660 more easily be skewed by occasional swapping or other similar
3661 more easily be skewed by occasional swapping or other similar
3661 activity.
3662 activity.
3662
3663
3663 2003-06-05 Fernando Perez <fperez@colorado.edu>
3664 2003-06-05 Fernando Perez <fperez@colorado.edu>
3664
3665
3665 * IPython/numutils.py (identity): new function, for building
3666 * IPython/numutils.py (identity): new function, for building
3666 arbitrary rank Kronecker deltas (mostly backwards compatible with
3667 arbitrary rank Kronecker deltas (mostly backwards compatible with
3667 Numeric.identity)
3668 Numeric.identity)
3668
3669
3669 2003-06-03 Fernando Perez <fperez@colorado.edu>
3670 2003-06-03 Fernando Perez <fperez@colorado.edu>
3670
3671
3671 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3672 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3672 arguments passed to magics with spaces, to allow trailing '\' to
3673 arguments passed to magics with spaces, to allow trailing '\' to
3673 work normally (mainly for Windows users).
3674 work normally (mainly for Windows users).
3674
3675
3675 2003-05-29 Fernando Perez <fperez@colorado.edu>
3676 2003-05-29 Fernando Perez <fperez@colorado.edu>
3676
3677
3677 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3678 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3678 instead of pydoc.help. This fixes a bizarre behavior where
3679 instead of pydoc.help. This fixes a bizarre behavior where
3679 printing '%s' % locals() would trigger the help system. Now
3680 printing '%s' % locals() would trigger the help system. Now
3680 ipython behaves like normal python does.
3681 ipython behaves like normal python does.
3681
3682
3682 Note that if one does 'from pydoc import help', the bizarre
3683 Note that if one does 'from pydoc import help', the bizarre
3683 behavior returns, but this will also happen in normal python, so
3684 behavior returns, but this will also happen in normal python, so
3684 it's not an ipython bug anymore (it has to do with how pydoc.help
3685 it's not an ipython bug anymore (it has to do with how pydoc.help
3685 is implemented).
3686 is implemented).
3686
3687
3687 2003-05-22 Fernando Perez <fperez@colorado.edu>
3688 2003-05-22 Fernando Perez <fperez@colorado.edu>
3688
3689
3689 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3690 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3690 return [] instead of None when nothing matches, also match to end
3691 return [] instead of None when nothing matches, also match to end
3691 of line. Patch by Gary Bishop.
3692 of line. Patch by Gary Bishop.
3692
3693
3693 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3694 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3694 protection as before, for files passed on the command line. This
3695 protection as before, for files passed on the command line. This
3695 prevents the CrashHandler from kicking in if user files call into
3696 prevents the CrashHandler from kicking in if user files call into
3696 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3697 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3697 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3698 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3698
3699
3699 2003-05-20 *** Released version 0.4.0
3700 2003-05-20 *** Released version 0.4.0
3700
3701
3701 2003-05-20 Fernando Perez <fperez@colorado.edu>
3702 2003-05-20 Fernando Perez <fperez@colorado.edu>
3702
3703
3703 * setup.py: added support for manpages. It's a bit hackish b/c of
3704 * setup.py: added support for manpages. It's a bit hackish b/c of
3704 a bug in the way the bdist_rpm distutils target handles gzipped
3705 a bug in the way the bdist_rpm distutils target handles gzipped
3705 manpages, but it works. After a patch by Jack.
3706 manpages, but it works. After a patch by Jack.
3706
3707
3707 2003-05-19 Fernando Perez <fperez@colorado.edu>
3708 2003-05-19 Fernando Perez <fperez@colorado.edu>
3708
3709
3709 * IPython/numutils.py: added a mockup of the kinds module, since
3710 * IPython/numutils.py: added a mockup of the kinds module, since
3710 it was recently removed from Numeric. This way, numutils will
3711 it was recently removed from Numeric. This way, numutils will
3711 work for all users even if they are missing kinds.
3712 work for all users even if they are missing kinds.
3712
3713
3713 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3714 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3714 failure, which can occur with SWIG-wrapped extensions. After a
3715 failure, which can occur with SWIG-wrapped extensions. After a
3715 crash report from Prabhu.
3716 crash report from Prabhu.
3716
3717
3717 2003-05-16 Fernando Perez <fperez@colorado.edu>
3718 2003-05-16 Fernando Perez <fperez@colorado.edu>
3718
3719
3719 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3720 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3720 protect ipython from user code which may call directly
3721 protect ipython from user code which may call directly
3721 sys.excepthook (this looks like an ipython crash to the user, even
3722 sys.excepthook (this looks like an ipython crash to the user, even
3722 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3723 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3723 This is especially important to help users of WxWindows, but may
3724 This is especially important to help users of WxWindows, but may
3724 also be useful in other cases.
3725 also be useful in other cases.
3725
3726
3726 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3727 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3727 an optional tb_offset to be specified, and to preserve exception
3728 an optional tb_offset to be specified, and to preserve exception
3728 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3729 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3729
3730
3730 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3731 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3731
3732
3732 2003-05-15 Fernando Perez <fperez@colorado.edu>
3733 2003-05-15 Fernando Perez <fperez@colorado.edu>
3733
3734
3734 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3735 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3735 installing for a new user under Windows.
3736 installing for a new user under Windows.
3736
3737
3737 2003-05-12 Fernando Perez <fperez@colorado.edu>
3738 2003-05-12 Fernando Perez <fperez@colorado.edu>
3738
3739
3739 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3740 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3740 handler for Emacs comint-based lines. Currently it doesn't do
3741 handler for Emacs comint-based lines. Currently it doesn't do
3741 much (but importantly, it doesn't update the history cache). In
3742 much (but importantly, it doesn't update the history cache). In
3742 the future it may be expanded if Alex needs more functionality
3743 the future it may be expanded if Alex needs more functionality
3743 there.
3744 there.
3744
3745
3745 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3746 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3746 info to crash reports.
3747 info to crash reports.
3747
3748
3748 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3749 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3749 just like Python's -c. Also fixed crash with invalid -color
3750 just like Python's -c. Also fixed crash with invalid -color
3750 option value at startup. Thanks to Will French
3751 option value at startup. Thanks to Will French
3751 <wfrench-AT-bestweb.net> for the bug report.
3752 <wfrench-AT-bestweb.net> for the bug report.
3752
3753
3753 2003-05-09 Fernando Perez <fperez@colorado.edu>
3754 2003-05-09 Fernando Perez <fperez@colorado.edu>
3754
3755
3755 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3756 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3756 to EvalDict (it's a mapping, after all) and simplified its code
3757 to EvalDict (it's a mapping, after all) and simplified its code
3757 quite a bit, after a nice discussion on c.l.py where Gustavo
3758 quite a bit, after a nice discussion on c.l.py where Gustavo
3758 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3759 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3759
3760
3760 2003-04-30 Fernando Perez <fperez@colorado.edu>
3761 2003-04-30 Fernando Perez <fperez@colorado.edu>
3761
3762
3762 * IPython/genutils.py (timings_out): modified it to reduce its
3763 * IPython/genutils.py (timings_out): modified it to reduce its
3763 overhead in the common reps==1 case.
3764 overhead in the common reps==1 case.
3764
3765
3765 2003-04-29 Fernando Perez <fperez@colorado.edu>
3766 2003-04-29 Fernando Perez <fperez@colorado.edu>
3766
3767
3767 * IPython/genutils.py (timings_out): Modified to use the resource
3768 * IPython/genutils.py (timings_out): Modified to use the resource
3768 module, which avoids the wraparound problems of time.clock().
3769 module, which avoids the wraparound problems of time.clock().
3769
3770
3770 2003-04-17 *** Released version 0.2.15pre4
3771 2003-04-17 *** Released version 0.2.15pre4
3771
3772
3772 2003-04-17 Fernando Perez <fperez@colorado.edu>
3773 2003-04-17 Fernando Perez <fperez@colorado.edu>
3773
3774
3774 * setup.py (scriptfiles): Split windows-specific stuff over to a
3775 * setup.py (scriptfiles): Split windows-specific stuff over to a
3775 separate file, in an attempt to have a Windows GUI installer.
3776 separate file, in an attempt to have a Windows GUI installer.
3776 That didn't work, but part of the groundwork is done.
3777 That didn't work, but part of the groundwork is done.
3777
3778
3778 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3779 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3779 indent/unindent with 4 spaces. Particularly useful in combination
3780 indent/unindent with 4 spaces. Particularly useful in combination
3780 with the new auto-indent option.
3781 with the new auto-indent option.
3781
3782
3782 2003-04-16 Fernando Perez <fperez@colorado.edu>
3783 2003-04-16 Fernando Perez <fperez@colorado.edu>
3783
3784
3784 * IPython/Magic.py: various replacements of self.rc for
3785 * IPython/Magic.py: various replacements of self.rc for
3785 self.shell.rc. A lot more remains to be done to fully disentangle
3786 self.shell.rc. A lot more remains to be done to fully disentangle
3786 this class from the main Shell class.
3787 this class from the main Shell class.
3787
3788
3788 * IPython/GnuplotRuntime.py: added checks for mouse support so
3789 * IPython/GnuplotRuntime.py: added checks for mouse support so
3789 that we don't try to enable it if the current gnuplot doesn't
3790 that we don't try to enable it if the current gnuplot doesn't
3790 really support it. Also added checks so that we don't try to
3791 really support it. Also added checks so that we don't try to
3791 enable persist under Windows (where Gnuplot doesn't recognize the
3792 enable persist under Windows (where Gnuplot doesn't recognize the
3792 option).
3793 option).
3793
3794
3794 * IPython/iplib.py (InteractiveShell.interact): Added optional
3795 * IPython/iplib.py (InteractiveShell.interact): Added optional
3795 auto-indenting code, after a patch by King C. Shu
3796 auto-indenting code, after a patch by King C. Shu
3796 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3797 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3797 get along well with pasting indented code. If I ever figure out
3798 get along well with pasting indented code. If I ever figure out
3798 how to make that part go well, it will become on by default.
3799 how to make that part go well, it will become on by default.
3799
3800
3800 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3801 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3801 crash ipython if there was an unmatched '%' in the user's prompt
3802 crash ipython if there was an unmatched '%' in the user's prompt
3802 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3803 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3803
3804
3804 * IPython/iplib.py (InteractiveShell.interact): removed the
3805 * IPython/iplib.py (InteractiveShell.interact): removed the
3805 ability to ask the user whether he wants to crash or not at the
3806 ability to ask the user whether he wants to crash or not at the
3806 'last line' exception handler. Calling functions at that point
3807 'last line' exception handler. Calling functions at that point
3807 changes the stack, and the error reports would have incorrect
3808 changes the stack, and the error reports would have incorrect
3808 tracebacks.
3809 tracebacks.
3809
3810
3810 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3811 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3811 pass through a peger a pretty-printed form of any object. After a
3812 pass through a peger a pretty-printed form of any object. After a
3812 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3813 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3813
3814
3814 2003-04-14 Fernando Perez <fperez@colorado.edu>
3815 2003-04-14 Fernando Perez <fperez@colorado.edu>
3815
3816
3816 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3817 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3817 all files in ~ would be modified at first install (instead of
3818 all files in ~ would be modified at first install (instead of
3818 ~/.ipython). This could be potentially disastrous, as the
3819 ~/.ipython). This could be potentially disastrous, as the
3819 modification (make line-endings native) could damage binary files.
3820 modification (make line-endings native) could damage binary files.
3820
3821
3821 2003-04-10 Fernando Perez <fperez@colorado.edu>
3822 2003-04-10 Fernando Perez <fperez@colorado.edu>
3822
3823
3823 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3824 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3824 handle only lines which are invalid python. This now means that
3825 handle only lines which are invalid python. This now means that
3825 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3826 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3826 for the bug report.
3827 for the bug report.
3827
3828
3828 2003-04-01 Fernando Perez <fperez@colorado.edu>
3829 2003-04-01 Fernando Perez <fperez@colorado.edu>
3829
3830
3830 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3831 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3831 where failing to set sys.last_traceback would crash pdb.pm().
3832 where failing to set sys.last_traceback would crash pdb.pm().
3832 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3833 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3833 report.
3834 report.
3834
3835
3835 2003-03-25 Fernando Perez <fperez@colorado.edu>
3836 2003-03-25 Fernando Perez <fperez@colorado.edu>
3836
3837
3837 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3838 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3838 before printing it (it had a lot of spurious blank lines at the
3839 before printing it (it had a lot of spurious blank lines at the
3839 end).
3840 end).
3840
3841
3841 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3842 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3842 output would be sent 21 times! Obviously people don't use this
3843 output would be sent 21 times! Obviously people don't use this
3843 too often, or I would have heard about it.
3844 too often, or I would have heard about it.
3844
3845
3845 2003-03-24 Fernando Perez <fperez@colorado.edu>
3846 2003-03-24 Fernando Perez <fperez@colorado.edu>
3846
3847
3847 * setup.py (scriptfiles): renamed the data_files parameter from
3848 * setup.py (scriptfiles): renamed the data_files parameter from
3848 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3849 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3849 for the patch.
3850 for the patch.
3850
3851
3851 2003-03-20 Fernando Perez <fperez@colorado.edu>
3852 2003-03-20 Fernando Perez <fperez@colorado.edu>
3852
3853
3853 * IPython/genutils.py (error): added error() and fatal()
3854 * IPython/genutils.py (error): added error() and fatal()
3854 functions.
3855 functions.
3855
3856
3856 2003-03-18 *** Released version 0.2.15pre3
3857 2003-03-18 *** Released version 0.2.15pre3
3857
3858
3858 2003-03-18 Fernando Perez <fperez@colorado.edu>
3859 2003-03-18 Fernando Perez <fperez@colorado.edu>
3859
3860
3860 * setupext/install_data_ext.py
3861 * setupext/install_data_ext.py
3861 (install_data_ext.initialize_options): Class contributed by Jack
3862 (install_data_ext.initialize_options): Class contributed by Jack
3862 Moffit for fixing the old distutils hack. He is sending this to
3863 Moffit for fixing the old distutils hack. He is sending this to
3863 the distutils folks so in the future we may not need it as a
3864 the distutils folks so in the future we may not need it as a
3864 private fix.
3865 private fix.
3865
3866
3866 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3867 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3867 changes for Debian packaging. See his patch for full details.
3868 changes for Debian packaging. See his patch for full details.
3868 The old distutils hack of making the ipythonrc* files carry a
3869 The old distutils hack of making the ipythonrc* files carry a
3869 bogus .py extension is gone, at last. Examples were moved to a
3870 bogus .py extension is gone, at last. Examples were moved to a
3870 separate subdir under doc/, and the separate executable scripts
3871 separate subdir under doc/, and the separate executable scripts
3871 now live in their own directory. Overall a great cleanup. The
3872 now live in their own directory. Overall a great cleanup. The
3872 manual was updated to use the new files, and setup.py has been
3873 manual was updated to use the new files, and setup.py has been
3873 fixed for this setup.
3874 fixed for this setup.
3874
3875
3875 * IPython/PyColorize.py (Parser.usage): made non-executable and
3876 * IPython/PyColorize.py (Parser.usage): made non-executable and
3876 created a pycolor wrapper around it to be included as a script.
3877 created a pycolor wrapper around it to be included as a script.
3877
3878
3878 2003-03-12 *** Released version 0.2.15pre2
3879 2003-03-12 *** Released version 0.2.15pre2
3879
3880
3880 2003-03-12 Fernando Perez <fperez@colorado.edu>
3881 2003-03-12 Fernando Perez <fperez@colorado.edu>
3881
3882
3882 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3883 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3883 long-standing problem with garbage characters in some terminals.
3884 long-standing problem with garbage characters in some terminals.
3884 The issue was really that the \001 and \002 escapes must _only_ be
3885 The issue was really that the \001 and \002 escapes must _only_ be
3885 passed to input prompts (which call readline), but _never_ to
3886 passed to input prompts (which call readline), but _never_ to
3886 normal text to be printed on screen. I changed ColorANSI to have
3887 normal text to be printed on screen. I changed ColorANSI to have
3887 two classes: TermColors and InputTermColors, each with the
3888 two classes: TermColors and InputTermColors, each with the
3888 appropriate escapes for input prompts or normal text. The code in
3889 appropriate escapes for input prompts or normal text. The code in
3889 Prompts.py got slightly more complicated, but this very old and
3890 Prompts.py got slightly more complicated, but this very old and
3890 annoying bug is finally fixed.
3891 annoying bug is finally fixed.
3891
3892
3892 All the credit for nailing down the real origin of this problem
3893 All the credit for nailing down the real origin of this problem
3893 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3894 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3894 *Many* thanks to him for spending quite a bit of effort on this.
3895 *Many* thanks to him for spending quite a bit of effort on this.
3895
3896
3896 2003-03-05 *** Released version 0.2.15pre1
3897 2003-03-05 *** Released version 0.2.15pre1
3897
3898
3898 2003-03-03 Fernando Perez <fperez@colorado.edu>
3899 2003-03-03 Fernando Perez <fperez@colorado.edu>
3899
3900
3900 * IPython/FakeModule.py: Moved the former _FakeModule to a
3901 * IPython/FakeModule.py: Moved the former _FakeModule to a
3901 separate file, because it's also needed by Magic (to fix a similar
3902 separate file, because it's also needed by Magic (to fix a similar
3902 pickle-related issue in @run).
3903 pickle-related issue in @run).
3903
3904
3904 2003-03-02 Fernando Perez <fperez@colorado.edu>
3905 2003-03-02 Fernando Perez <fperez@colorado.edu>
3905
3906
3906 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3907 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3907 the autocall option at runtime.
3908 the autocall option at runtime.
3908 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3909 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3909 across Magic.py to start separating Magic from InteractiveShell.
3910 across Magic.py to start separating Magic from InteractiveShell.
3910 (Magic._ofind): Fixed to return proper namespace for dotted
3911 (Magic._ofind): Fixed to return proper namespace for dotted
3911 names. Before, a dotted name would always return 'not currently
3912 names. Before, a dotted name would always return 'not currently
3912 defined', because it would find the 'parent'. s.x would be found,
3913 defined', because it would find the 'parent'. s.x would be found,
3913 but since 'x' isn't defined by itself, it would get confused.
3914 but since 'x' isn't defined by itself, it would get confused.
3914 (Magic.magic_run): Fixed pickling problems reported by Ralf
3915 (Magic.magic_run): Fixed pickling problems reported by Ralf
3915 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3916 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3916 that I'd used when Mike Heeter reported similar issues at the
3917 that I'd used when Mike Heeter reported similar issues at the
3917 top-level, but now for @run. It boils down to injecting the
3918 top-level, but now for @run. It boils down to injecting the
3918 namespace where code is being executed with something that looks
3919 namespace where code is being executed with something that looks
3919 enough like a module to fool pickle.dump(). Since a pickle stores
3920 enough like a module to fool pickle.dump(). Since a pickle stores
3920 a named reference to the importing module, we need this for
3921 a named reference to the importing module, we need this for
3921 pickles to save something sensible.
3922 pickles to save something sensible.
3922
3923
3923 * IPython/ipmaker.py (make_IPython): added an autocall option.
3924 * IPython/ipmaker.py (make_IPython): added an autocall option.
3924
3925
3925 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3926 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3926 the auto-eval code. Now autocalling is an option, and the code is
3927 the auto-eval code. Now autocalling is an option, and the code is
3927 also vastly safer. There is no more eval() involved at all.
3928 also vastly safer. There is no more eval() involved at all.
3928
3929
3929 2003-03-01 Fernando Perez <fperez@colorado.edu>
3930 2003-03-01 Fernando Perez <fperez@colorado.edu>
3930
3931
3931 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3932 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3932 dict with named keys instead of a tuple.
3933 dict with named keys instead of a tuple.
3933
3934
3934 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3935 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3935
3936
3936 * setup.py (make_shortcut): Fixed message about directories
3937 * setup.py (make_shortcut): Fixed message about directories
3937 created during Windows installation (the directories were ok, just
3938 created during Windows installation (the directories were ok, just
3938 the printed message was misleading). Thanks to Chris Liechti
3939 the printed message was misleading). Thanks to Chris Liechti
3939 <cliechti-AT-gmx.net> for the heads up.
3940 <cliechti-AT-gmx.net> for the heads up.
3940
3941
3941 2003-02-21 Fernando Perez <fperez@colorado.edu>
3942 2003-02-21 Fernando Perez <fperez@colorado.edu>
3942
3943
3943 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3944 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3944 of ValueError exception when checking for auto-execution. This
3945 of ValueError exception when checking for auto-execution. This
3945 one is raised by things like Numeric arrays arr.flat when the
3946 one is raised by things like Numeric arrays arr.flat when the
3946 array is non-contiguous.
3947 array is non-contiguous.
3947
3948
3948 2003-01-31 Fernando Perez <fperez@colorado.edu>
3949 2003-01-31 Fernando Perez <fperez@colorado.edu>
3949
3950
3950 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3951 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3951 not return any value at all (even though the command would get
3952 not return any value at all (even though the command would get
3952 executed).
3953 executed).
3953 (xsys): Flush stdout right after printing the command to ensure
3954 (xsys): Flush stdout right after printing the command to ensure
3954 proper ordering of commands and command output in the total
3955 proper ordering of commands and command output in the total
3955 output.
3956 output.
3956 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3957 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3957 system/getoutput as defaults. The old ones are kept for
3958 system/getoutput as defaults. The old ones are kept for
3958 compatibility reasons, so no code which uses this library needs
3959 compatibility reasons, so no code which uses this library needs
3959 changing.
3960 changing.
3960
3961
3961 2003-01-27 *** Released version 0.2.14
3962 2003-01-27 *** Released version 0.2.14
3962
3963
3963 2003-01-25 Fernando Perez <fperez@colorado.edu>
3964 2003-01-25 Fernando Perez <fperez@colorado.edu>
3964
3965
3965 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3966 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3966 functions defined in previous edit sessions could not be re-edited
3967 functions defined in previous edit sessions could not be re-edited
3967 (because the temp files were immediately removed). Now temp files
3968 (because the temp files were immediately removed). Now temp files
3968 are removed only at IPython's exit.
3969 are removed only at IPython's exit.
3969 (Magic.magic_run): Improved @run to perform shell-like expansions
3970 (Magic.magic_run): Improved @run to perform shell-like expansions
3970 on its arguments (~users and $VARS). With this, @run becomes more
3971 on its arguments (~users and $VARS). With this, @run becomes more
3971 like a normal command-line.
3972 like a normal command-line.
3972
3973
3973 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3974 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3974 bugs related to embedding and cleaned up that code. A fairly
3975 bugs related to embedding and cleaned up that code. A fairly
3975 important one was the impossibility to access the global namespace
3976 important one was the impossibility to access the global namespace
3976 through the embedded IPython (only local variables were visible).
3977 through the embedded IPython (only local variables were visible).
3977
3978
3978 2003-01-14 Fernando Perez <fperez@colorado.edu>
3979 2003-01-14 Fernando Perez <fperez@colorado.edu>
3979
3980
3980 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3981 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3981 auto-calling to be a bit more conservative. Now it doesn't get
3982 auto-calling to be a bit more conservative. Now it doesn't get
3982 triggered if any of '!=()<>' are in the rest of the input line, to
3983 triggered if any of '!=()<>' are in the rest of the input line, to
3983 allow comparing callables. Thanks to Alex for the heads up.
3984 allow comparing callables. Thanks to Alex for the heads up.
3984
3985
3985 2003-01-07 Fernando Perez <fperez@colorado.edu>
3986 2003-01-07 Fernando Perez <fperez@colorado.edu>
3986
3987
3987 * IPython/genutils.py (page): fixed estimation of the number of
3988 * IPython/genutils.py (page): fixed estimation of the number of
3988 lines in a string to be paged to simply count newlines. This
3989 lines in a string to be paged to simply count newlines. This
3989 prevents over-guessing due to embedded escape sequences. A better
3990 prevents over-guessing due to embedded escape sequences. A better
3990 long-term solution would involve stripping out the control chars
3991 long-term solution would involve stripping out the control chars
3991 for the count, but it's potentially so expensive I just don't
3992 for the count, but it's potentially so expensive I just don't
3992 think it's worth doing.
3993 think it's worth doing.
3993
3994
3994 2002-12-19 *** Released version 0.2.14pre50
3995 2002-12-19 *** Released version 0.2.14pre50
3995
3996
3996 2002-12-19 Fernando Perez <fperez@colorado.edu>
3997 2002-12-19 Fernando Perez <fperez@colorado.edu>
3997
3998
3998 * tools/release (version): Changed release scripts to inform
3999 * tools/release (version): Changed release scripts to inform
3999 Andrea and build a NEWS file with a list of recent changes.
4000 Andrea and build a NEWS file with a list of recent changes.
4000
4001
4001 * IPython/ColorANSI.py (__all__): changed terminal detection
4002 * IPython/ColorANSI.py (__all__): changed terminal detection
4002 code. Seems to work better for xterms without breaking
4003 code. Seems to work better for xterms without breaking
4003 konsole. Will need more testing to determine if WinXP and Mac OSX
4004 konsole. Will need more testing to determine if WinXP and Mac OSX
4004 also work ok.
4005 also work ok.
4005
4006
4006 2002-12-18 *** Released version 0.2.14pre49
4007 2002-12-18 *** Released version 0.2.14pre49
4007
4008
4008 2002-12-18 Fernando Perez <fperez@colorado.edu>
4009 2002-12-18 Fernando Perez <fperez@colorado.edu>
4009
4010
4010 * Docs: added new info about Mac OSX, from Andrea.
4011 * Docs: added new info about Mac OSX, from Andrea.
4011
4012
4012 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4013 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4013 allow direct plotting of python strings whose format is the same
4014 allow direct plotting of python strings whose format is the same
4014 of gnuplot data files.
4015 of gnuplot data files.
4015
4016
4016 2002-12-16 Fernando Perez <fperez@colorado.edu>
4017 2002-12-16 Fernando Perez <fperez@colorado.edu>
4017
4018
4018 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4019 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4019 value of exit question to be acknowledged.
4020 value of exit question to be acknowledged.
4020
4021
4021 2002-12-03 Fernando Perez <fperez@colorado.edu>
4022 2002-12-03 Fernando Perez <fperez@colorado.edu>
4022
4023
4023 * IPython/ipmaker.py: removed generators, which had been added
4024 * IPython/ipmaker.py: removed generators, which had been added
4024 by mistake in an earlier debugging run. This was causing trouble
4025 by mistake in an earlier debugging run. This was causing trouble
4025 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4026 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4026 for pointing this out.
4027 for pointing this out.
4027
4028
4028 2002-11-17 Fernando Perez <fperez@colorado.edu>
4029 2002-11-17 Fernando Perez <fperez@colorado.edu>
4029
4030
4030 * Manual: updated the Gnuplot section.
4031 * Manual: updated the Gnuplot section.
4031
4032
4032 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4033 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4033 a much better split of what goes in Runtime and what goes in
4034 a much better split of what goes in Runtime and what goes in
4034 Interactive.
4035 Interactive.
4035
4036
4036 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4037 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4037 being imported from iplib.
4038 being imported from iplib.
4038
4039
4039 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4040 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4040 for command-passing. Now the global Gnuplot instance is called
4041 for command-passing. Now the global Gnuplot instance is called
4041 'gp' instead of 'g', which was really a far too fragile and
4042 'gp' instead of 'g', which was really a far too fragile and
4042 common name.
4043 common name.
4043
4044
4044 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4045 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4045 bounding boxes generated by Gnuplot for square plots.
4046 bounding boxes generated by Gnuplot for square plots.
4046
4047
4047 * IPython/genutils.py (popkey): new function added. I should
4048 * IPython/genutils.py (popkey): new function added. I should
4048 suggest this on c.l.py as a dict method, it seems useful.
4049 suggest this on c.l.py as a dict method, it seems useful.
4049
4050
4050 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4051 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4051 to transparently handle PostScript generation. MUCH better than
4052 to transparently handle PostScript generation. MUCH better than
4052 the previous plot_eps/replot_eps (which I removed now). The code
4053 the previous plot_eps/replot_eps (which I removed now). The code
4053 is also fairly clean and well documented now (including
4054 is also fairly clean and well documented now (including
4054 docstrings).
4055 docstrings).
4055
4056
4056 2002-11-13 Fernando Perez <fperez@colorado.edu>
4057 2002-11-13 Fernando Perez <fperez@colorado.edu>
4057
4058
4058 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4059 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4059 (inconsistent with options).
4060 (inconsistent with options).
4060
4061
4061 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4062 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4062 manually disabled, I don't know why. Fixed it.
4063 manually disabled, I don't know why. Fixed it.
4063 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4064 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4064 eps output.
4065 eps output.
4065
4066
4066 2002-11-12 Fernando Perez <fperez@colorado.edu>
4067 2002-11-12 Fernando Perez <fperez@colorado.edu>
4067
4068
4068 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4069 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4069 don't propagate up to caller. Fixes crash reported by François
4070 don't propagate up to caller. Fixes crash reported by François
4070 Pinard.
4071 Pinard.
4071
4072
4072 2002-11-09 Fernando Perez <fperez@colorado.edu>
4073 2002-11-09 Fernando Perez <fperez@colorado.edu>
4073
4074
4074 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4075 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4075 history file for new users.
4076 history file for new users.
4076 (make_IPython): fixed bug where initial install would leave the
4077 (make_IPython): fixed bug where initial install would leave the
4077 user running in the .ipython dir.
4078 user running in the .ipython dir.
4078 (make_IPython): fixed bug where config dir .ipython would be
4079 (make_IPython): fixed bug where config dir .ipython would be
4079 created regardless of the given -ipythondir option. Thanks to Cory
4080 created regardless of the given -ipythondir option. Thanks to Cory
4080 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4081 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4081
4082
4082 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4083 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4083 type confirmations. Will need to use it in all of IPython's code
4084 type confirmations. Will need to use it in all of IPython's code
4084 consistently.
4085 consistently.
4085
4086
4086 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4087 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4087 context to print 31 lines instead of the default 5. This will make
4088 context to print 31 lines instead of the default 5. This will make
4088 the crash reports extremely detailed in case the problem is in
4089 the crash reports extremely detailed in case the problem is in
4089 libraries I don't have access to.
4090 libraries I don't have access to.
4090
4091
4091 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4092 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4092 line of defense' code to still crash, but giving users fair
4093 line of defense' code to still crash, but giving users fair
4093 warning. I don't want internal errors to go unreported: if there's
4094 warning. I don't want internal errors to go unreported: if there's
4094 an internal problem, IPython should crash and generate a full
4095 an internal problem, IPython should crash and generate a full
4095 report.
4096 report.
4096
4097
4097 2002-11-08 Fernando Perez <fperez@colorado.edu>
4098 2002-11-08 Fernando Perez <fperez@colorado.edu>
4098
4099
4099 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4100 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4100 otherwise uncaught exceptions which can appear if people set
4101 otherwise uncaught exceptions which can appear if people set
4101 sys.stdout to something badly broken. Thanks to a crash report
4102 sys.stdout to something badly broken. Thanks to a crash report
4102 from henni-AT-mail.brainbot.com.
4103 from henni-AT-mail.brainbot.com.
4103
4104
4104 2002-11-04 Fernando Perez <fperez@colorado.edu>
4105 2002-11-04 Fernando Perez <fperez@colorado.edu>
4105
4106
4106 * IPython/iplib.py (InteractiveShell.interact): added
4107 * IPython/iplib.py (InteractiveShell.interact): added
4107 __IPYTHON__active to the builtins. It's a flag which goes on when
4108 __IPYTHON__active to the builtins. It's a flag which goes on when
4108 the interaction starts and goes off again when it stops. This
4109 the interaction starts and goes off again when it stops. This
4109 allows embedding code to detect being inside IPython. Before this
4110 allows embedding code to detect being inside IPython. Before this
4110 was done via __IPYTHON__, but that only shows that an IPython
4111 was done via __IPYTHON__, but that only shows that an IPython
4111 instance has been created.
4112 instance has been created.
4112
4113
4113 * IPython/Magic.py (Magic.magic_env): I realized that in a
4114 * IPython/Magic.py (Magic.magic_env): I realized that in a
4114 UserDict, instance.data holds the data as a normal dict. So I
4115 UserDict, instance.data holds the data as a normal dict. So I
4115 modified @env to return os.environ.data instead of rebuilding a
4116 modified @env to return os.environ.data instead of rebuilding a
4116 dict by hand.
4117 dict by hand.
4117
4118
4118 2002-11-02 Fernando Perez <fperez@colorado.edu>
4119 2002-11-02 Fernando Perez <fperez@colorado.edu>
4119
4120
4120 * IPython/genutils.py (warn): changed so that level 1 prints no
4121 * IPython/genutils.py (warn): changed so that level 1 prints no
4121 header. Level 2 is now the default (with 'WARNING' header, as
4122 header. Level 2 is now the default (with 'WARNING' header, as
4122 before). I think I tracked all places where changes were needed in
4123 before). I think I tracked all places where changes were needed in
4123 IPython, but outside code using the old level numbering may have
4124 IPython, but outside code using the old level numbering may have
4124 broken.
4125 broken.
4125
4126
4126 * IPython/iplib.py (InteractiveShell.runcode): added this to
4127 * IPython/iplib.py (InteractiveShell.runcode): added this to
4127 handle the tracebacks in SystemExit traps correctly. The previous
4128 handle the tracebacks in SystemExit traps correctly. The previous
4128 code (through interact) was printing more of the stack than
4129 code (through interact) was printing more of the stack than
4129 necessary, showing IPython internal code to the user.
4130 necessary, showing IPython internal code to the user.
4130
4131
4131 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4132 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4132 default. Now that the default at the confirmation prompt is yes,
4133 default. Now that the default at the confirmation prompt is yes,
4133 it's not so intrusive. François' argument that ipython sessions
4134 it's not so intrusive. François' argument that ipython sessions
4134 tend to be complex enough not to lose them from an accidental C-d,
4135 tend to be complex enough not to lose them from an accidental C-d,
4135 is a valid one.
4136 is a valid one.
4136
4137
4137 * IPython/iplib.py (InteractiveShell.interact): added a
4138 * IPython/iplib.py (InteractiveShell.interact): added a
4138 showtraceback() call to the SystemExit trap, and modified the exit
4139 showtraceback() call to the SystemExit trap, and modified the exit
4139 confirmation to have yes as the default.
4140 confirmation to have yes as the default.
4140
4141
4141 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4142 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4142 this file. It's been gone from the code for a long time, this was
4143 this file. It's been gone from the code for a long time, this was
4143 simply leftover junk.
4144 simply leftover junk.
4144
4145
4145 2002-11-01 Fernando Perez <fperez@colorado.edu>
4146 2002-11-01 Fernando Perez <fperez@colorado.edu>
4146
4147
4147 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4148 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4148 added. If set, IPython now traps EOF and asks for
4149 added. If set, IPython now traps EOF and asks for
4149 confirmation. After a request by François Pinard.
4150 confirmation. After a request by François Pinard.
4150
4151
4151 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4152 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4152 of @abort, and with a new (better) mechanism for handling the
4153 of @abort, and with a new (better) mechanism for handling the
4153 exceptions.
4154 exceptions.
4154
4155
4155 2002-10-27 Fernando Perez <fperez@colorado.edu>
4156 2002-10-27 Fernando Perez <fperez@colorado.edu>
4156
4157
4157 * IPython/usage.py (__doc__): updated the --help information and
4158 * IPython/usage.py (__doc__): updated the --help information and
4158 the ipythonrc file to indicate that -log generates
4159 the ipythonrc file to indicate that -log generates
4159 ./ipython.log. Also fixed the corresponding info in @logstart.
4160 ./ipython.log. Also fixed the corresponding info in @logstart.
4160 This and several other fixes in the manuals thanks to reports by
4161 This and several other fixes in the manuals thanks to reports by
4161 François Pinard <pinard-AT-iro.umontreal.ca>.
4162 François Pinard <pinard-AT-iro.umontreal.ca>.
4162
4163
4163 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4164 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4164 refer to @logstart (instead of @log, which doesn't exist).
4165 refer to @logstart (instead of @log, which doesn't exist).
4165
4166
4166 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4167 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4167 AttributeError crash. Thanks to Christopher Armstrong
4168 AttributeError crash. Thanks to Christopher Armstrong
4168 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4169 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4169 introduced recently (in 0.2.14pre37) with the fix to the eval
4170 introduced recently (in 0.2.14pre37) with the fix to the eval
4170 problem mentioned below.
4171 problem mentioned below.
4171
4172
4172 2002-10-17 Fernando Perez <fperez@colorado.edu>
4173 2002-10-17 Fernando Perez <fperez@colorado.edu>
4173
4174
4174 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4175 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4175 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4176 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4176
4177
4177 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4178 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4178 this function to fix a problem reported by Alex Schmolck. He saw
4179 this function to fix a problem reported by Alex Schmolck. He saw
4179 it with list comprehensions and generators, which were getting
4180 it with list comprehensions and generators, which were getting
4180 called twice. The real problem was an 'eval' call in testing for
4181 called twice. The real problem was an 'eval' call in testing for
4181 automagic which was evaluating the input line silently.
4182 automagic which was evaluating the input line silently.
4182
4183
4183 This is a potentially very nasty bug, if the input has side
4184 This is a potentially very nasty bug, if the input has side
4184 effects which must not be repeated. The code is much cleaner now,
4185 effects which must not be repeated. The code is much cleaner now,
4185 without any blanket 'except' left and with a regexp test for
4186 without any blanket 'except' left and with a regexp test for
4186 actual function names.
4187 actual function names.
4187
4188
4188 But an eval remains, which I'm not fully comfortable with. I just
4189 But an eval remains, which I'm not fully comfortable with. I just
4189 don't know how to find out if an expression could be a callable in
4190 don't know how to find out if an expression could be a callable in
4190 the user's namespace without doing an eval on the string. However
4191 the user's namespace without doing an eval on the string. However
4191 that string is now much more strictly checked so that no code
4192 that string is now much more strictly checked so that no code
4192 slips by, so the eval should only happen for things that can
4193 slips by, so the eval should only happen for things that can
4193 really be only function/method names.
4194 really be only function/method names.
4194
4195
4195 2002-10-15 Fernando Perez <fperez@colorado.edu>
4196 2002-10-15 Fernando Perez <fperez@colorado.edu>
4196
4197
4197 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4198 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4198 OSX information to main manual, removed README_Mac_OSX file from
4199 OSX information to main manual, removed README_Mac_OSX file from
4199 distribution. Also updated credits for recent additions.
4200 distribution. Also updated credits for recent additions.
4200
4201
4201 2002-10-10 Fernando Perez <fperez@colorado.edu>
4202 2002-10-10 Fernando Perez <fperez@colorado.edu>
4202
4203
4203 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4204 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4204 terminal-related issues. Many thanks to Andrea Riciputi
4205 terminal-related issues. Many thanks to Andrea Riciputi
4205 <andrea.riciputi-AT-libero.it> for writing it.
4206 <andrea.riciputi-AT-libero.it> for writing it.
4206
4207
4207 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4208 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4208 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4209 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4209
4210
4210 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4211 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4211 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4212 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4212 <syver-en-AT-online.no> who both submitted patches for this problem.
4213 <syver-en-AT-online.no> who both submitted patches for this problem.
4213
4214
4214 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4215 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4215 global embedding to make sure that things don't overwrite user
4216 global embedding to make sure that things don't overwrite user
4216 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4217 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4217
4218
4218 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4219 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4219 compatibility. Thanks to Hayden Callow
4220 compatibility. Thanks to Hayden Callow
4220 <h.callow-AT-elec.canterbury.ac.nz>
4221 <h.callow-AT-elec.canterbury.ac.nz>
4221
4222
4222 2002-10-04 Fernando Perez <fperez@colorado.edu>
4223 2002-10-04 Fernando Perez <fperez@colorado.edu>
4223
4224
4224 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4225 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4225 Gnuplot.File objects.
4226 Gnuplot.File objects.
4226
4227
4227 2002-07-23 Fernando Perez <fperez@colorado.edu>
4228 2002-07-23 Fernando Perez <fperez@colorado.edu>
4228
4229
4229 * IPython/genutils.py (timing): Added timings() and timing() for
4230 * IPython/genutils.py (timing): Added timings() and timing() for
4230 quick access to the most commonly needed data, the execution
4231 quick access to the most commonly needed data, the execution
4231 times. Old timing() renamed to timings_out().
4232 times. Old timing() renamed to timings_out().
4232
4233
4233 2002-07-18 Fernando Perez <fperez@colorado.edu>
4234 2002-07-18 Fernando Perez <fperez@colorado.edu>
4234
4235
4235 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4236 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4236 bug with nested instances disrupting the parent's tab completion.
4237 bug with nested instances disrupting the parent's tab completion.
4237
4238
4238 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4239 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4239 all_completions code to begin the emacs integration.
4240 all_completions code to begin the emacs integration.
4240
4241
4241 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4242 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4242 argument to allow titling individual arrays when plotting.
4243 argument to allow titling individual arrays when plotting.
4243
4244
4244 2002-07-15 Fernando Perez <fperez@colorado.edu>
4245 2002-07-15 Fernando Perez <fperez@colorado.edu>
4245
4246
4246 * setup.py (make_shortcut): changed to retrieve the value of
4247 * setup.py (make_shortcut): changed to retrieve the value of
4247 'Program Files' directory from the registry (this value changes in
4248 'Program Files' directory from the registry (this value changes in
4248 non-english versions of Windows). Thanks to Thomas Fanslau
4249 non-english versions of Windows). Thanks to Thomas Fanslau
4249 <tfanslau-AT-gmx.de> for the report.
4250 <tfanslau-AT-gmx.de> for the report.
4250
4251
4251 2002-07-10 Fernando Perez <fperez@colorado.edu>
4252 2002-07-10 Fernando Perez <fperez@colorado.edu>
4252
4253
4253 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4254 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4254 a bug in pdb, which crashes if a line with only whitespace is
4255 a bug in pdb, which crashes if a line with only whitespace is
4255 entered. Bug report submitted to sourceforge.
4256 entered. Bug report submitted to sourceforge.
4256
4257
4257 2002-07-09 Fernando Perez <fperez@colorado.edu>
4258 2002-07-09 Fernando Perez <fperez@colorado.edu>
4258
4259
4259 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4260 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4260 reporting exceptions (it's a bug in inspect.py, I just set a
4261 reporting exceptions (it's a bug in inspect.py, I just set a
4261 workaround).
4262 workaround).
4262
4263
4263 2002-07-08 Fernando Perez <fperez@colorado.edu>
4264 2002-07-08 Fernando Perez <fperez@colorado.edu>
4264
4265
4265 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4266 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4266 __IPYTHON__ in __builtins__ to show up in user_ns.
4267 __IPYTHON__ in __builtins__ to show up in user_ns.
4267
4268
4268 2002-07-03 Fernando Perez <fperez@colorado.edu>
4269 2002-07-03 Fernando Perez <fperez@colorado.edu>
4269
4270
4270 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4271 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4271 name from @gp_set_instance to @gp_set_default.
4272 name from @gp_set_instance to @gp_set_default.
4272
4273
4273 * IPython/ipmaker.py (make_IPython): default editor value set to
4274 * IPython/ipmaker.py (make_IPython): default editor value set to
4274 '0' (a string), to match the rc file. Otherwise will crash when
4275 '0' (a string), to match the rc file. Otherwise will crash when
4275 .strip() is called on it.
4276 .strip() is called on it.
4276
4277
4277
4278
4278 2002-06-28 Fernando Perez <fperez@colorado.edu>
4279 2002-06-28 Fernando Perez <fperez@colorado.edu>
4279
4280
4280 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4281 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4281 of files in current directory when a file is executed via
4282 of files in current directory when a file is executed via
4282 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4283 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4283
4284
4284 * setup.py (manfiles): fix for rpm builds, submitted by RA
4285 * setup.py (manfiles): fix for rpm builds, submitted by RA
4285 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4286 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4286
4287
4287 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4288 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4288 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4289 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4289 string!). A. Schmolck caught this one.
4290 string!). A. Schmolck caught this one.
4290
4291
4291 2002-06-27 Fernando Perez <fperez@colorado.edu>
4292 2002-06-27 Fernando Perez <fperez@colorado.edu>
4292
4293
4293 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4294 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4294 defined files at the cmd line. __name__ wasn't being set to
4295 defined files at the cmd line. __name__ wasn't being set to
4295 __main__.
4296 __main__.
4296
4297
4297 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4298 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4298 regular lists and tuples besides Numeric arrays.
4299 regular lists and tuples besides Numeric arrays.
4299
4300
4300 * IPython/Prompts.py (CachedOutput.__call__): Added output
4301 * IPython/Prompts.py (CachedOutput.__call__): Added output
4301 supression for input ending with ';'. Similar to Mathematica and
4302 supression for input ending with ';'. Similar to Mathematica and
4302 Matlab. The _* vars and Out[] list are still updated, just like
4303 Matlab. The _* vars and Out[] list are still updated, just like
4303 Mathematica behaves.
4304 Mathematica behaves.
4304
4305
4305 2002-06-25 Fernando Perez <fperez@colorado.edu>
4306 2002-06-25 Fernando Perez <fperez@colorado.edu>
4306
4307
4307 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4308 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4308 .ini extensions for profiels under Windows.
4309 .ini extensions for profiels under Windows.
4309
4310
4310 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4311 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4311 string form. Fix contributed by Alexander Schmolck
4312 string form. Fix contributed by Alexander Schmolck
4312 <a.schmolck-AT-gmx.net>
4313 <a.schmolck-AT-gmx.net>
4313
4314
4314 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4315 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4315 pre-configured Gnuplot instance.
4316 pre-configured Gnuplot instance.
4316
4317
4317 2002-06-21 Fernando Perez <fperez@colorado.edu>
4318 2002-06-21 Fernando Perez <fperez@colorado.edu>
4318
4319
4319 * IPython/numutils.py (exp_safe): new function, works around the
4320 * IPython/numutils.py (exp_safe): new function, works around the
4320 underflow problems in Numeric.
4321 underflow problems in Numeric.
4321 (log2): New fn. Safe log in base 2: returns exact integer answer
4322 (log2): New fn. Safe log in base 2: returns exact integer answer
4322 for exact integer powers of 2.
4323 for exact integer powers of 2.
4323
4324
4324 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4325 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4325 properly.
4326 properly.
4326
4327
4327 2002-06-20 Fernando Perez <fperez@colorado.edu>
4328 2002-06-20 Fernando Perez <fperez@colorado.edu>
4328
4329
4329 * IPython/genutils.py (timing): new function like
4330 * IPython/genutils.py (timing): new function like
4330 Mathematica's. Similar to time_test, but returns more info.
4331 Mathematica's. Similar to time_test, but returns more info.
4331
4332
4332 2002-06-18 Fernando Perez <fperez@colorado.edu>
4333 2002-06-18 Fernando Perez <fperez@colorado.edu>
4333
4334
4334 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4335 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4335 according to Mike Heeter's suggestions.
4336 according to Mike Heeter's suggestions.
4336
4337
4337 2002-06-16 Fernando Perez <fperez@colorado.edu>
4338 2002-06-16 Fernando Perez <fperez@colorado.edu>
4338
4339
4339 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4340 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4340 system. GnuplotMagic is gone as a user-directory option. New files
4341 system. GnuplotMagic is gone as a user-directory option. New files
4341 make it easier to use all the gnuplot stuff both from external
4342 make it easier to use all the gnuplot stuff both from external
4342 programs as well as from IPython. Had to rewrite part of
4343 programs as well as from IPython. Had to rewrite part of
4343 hardcopy() b/c of a strange bug: often the ps files simply don't
4344 hardcopy() b/c of a strange bug: often the ps files simply don't
4344 get created, and require a repeat of the command (often several
4345 get created, and require a repeat of the command (often several
4345 times).
4346 times).
4346
4347
4347 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4348 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4348 resolve output channel at call time, so that if sys.stderr has
4349 resolve output channel at call time, so that if sys.stderr has
4349 been redirected by user this gets honored.
4350 been redirected by user this gets honored.
4350
4351
4351 2002-06-13 Fernando Perez <fperez@colorado.edu>
4352 2002-06-13 Fernando Perez <fperez@colorado.edu>
4352
4353
4353 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4354 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4354 IPShell. Kept a copy with the old names to avoid breaking people's
4355 IPShell. Kept a copy with the old names to avoid breaking people's
4355 embedded code.
4356 embedded code.
4356
4357
4357 * IPython/ipython: simplified it to the bare minimum after
4358 * IPython/ipython: simplified it to the bare minimum after
4358 Holger's suggestions. Added info about how to use it in
4359 Holger's suggestions. Added info about how to use it in
4359 PYTHONSTARTUP.
4360 PYTHONSTARTUP.
4360
4361
4361 * IPython/Shell.py (IPythonShell): changed the options passing
4362 * IPython/Shell.py (IPythonShell): changed the options passing
4362 from a string with funky %s replacements to a straight list. Maybe
4363 from a string with funky %s replacements to a straight list. Maybe
4363 a bit more typing, but it follows sys.argv conventions, so there's
4364 a bit more typing, but it follows sys.argv conventions, so there's
4364 less special-casing to remember.
4365 less special-casing to remember.
4365
4366
4366 2002-06-12 Fernando Perez <fperez@colorado.edu>
4367 2002-06-12 Fernando Perez <fperez@colorado.edu>
4367
4368
4368 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4369 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4369 command. Thanks to a suggestion by Mike Heeter.
4370 command. Thanks to a suggestion by Mike Heeter.
4370 (Magic.magic_pfile): added behavior to look at filenames if given
4371 (Magic.magic_pfile): added behavior to look at filenames if given
4371 arg is not a defined object.
4372 arg is not a defined object.
4372 (Magic.magic_save): New @save function to save code snippets. Also
4373 (Magic.magic_save): New @save function to save code snippets. Also
4373 a Mike Heeter idea.
4374 a Mike Heeter idea.
4374
4375
4375 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4376 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4376 plot() and replot(). Much more convenient now, especially for
4377 plot() and replot(). Much more convenient now, especially for
4377 interactive use.
4378 interactive use.
4378
4379
4379 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4380 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4380 filenames.
4381 filenames.
4381
4382
4382 2002-06-02 Fernando Perez <fperez@colorado.edu>
4383 2002-06-02 Fernando Perez <fperez@colorado.edu>
4383
4384
4384 * IPython/Struct.py (Struct.__init__): modified to admit
4385 * IPython/Struct.py (Struct.__init__): modified to admit
4385 initialization via another struct.
4386 initialization via another struct.
4386
4387
4387 * IPython/genutils.py (SystemExec.__init__): New stateful
4388 * IPython/genutils.py (SystemExec.__init__): New stateful
4388 interface to xsys and bq. Useful for writing system scripts.
4389 interface to xsys and bq. Useful for writing system scripts.
4389
4390
4390 2002-05-30 Fernando Perez <fperez@colorado.edu>
4391 2002-05-30 Fernando Perez <fperez@colorado.edu>
4391
4392
4392 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4393 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4393 documents. This will make the user download smaller (it's getting
4394 documents. This will make the user download smaller (it's getting
4394 too big).
4395 too big).
4395
4396
4396 2002-05-29 Fernando Perez <fperez@colorado.edu>
4397 2002-05-29 Fernando Perez <fperez@colorado.edu>
4397
4398
4398 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4399 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4399 fix problems with shelve and pickle. Seems to work, but I don't
4400 fix problems with shelve and pickle. Seems to work, but I don't
4400 know if corner cases break it. Thanks to Mike Heeter
4401 know if corner cases break it. Thanks to Mike Heeter
4401 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4402 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4402
4403
4403 2002-05-24 Fernando Perez <fperez@colorado.edu>
4404 2002-05-24 Fernando Perez <fperez@colorado.edu>
4404
4405
4405 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4406 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4406 macros having broken.
4407 macros having broken.
4407
4408
4408 2002-05-21 Fernando Perez <fperez@colorado.edu>
4409 2002-05-21 Fernando Perez <fperez@colorado.edu>
4409
4410
4410 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4411 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4411 introduced logging bug: all history before logging started was
4412 introduced logging bug: all history before logging started was
4412 being written one character per line! This came from the redesign
4413 being written one character per line! This came from the redesign
4413 of the input history as a special list which slices to strings,
4414 of the input history as a special list which slices to strings,
4414 not to lists.
4415 not to lists.
4415
4416
4416 2002-05-20 Fernando Perez <fperez@colorado.edu>
4417 2002-05-20 Fernando Perez <fperez@colorado.edu>
4417
4418
4418 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4419 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4419 be an attribute of all classes in this module. The design of these
4420 be an attribute of all classes in this module. The design of these
4420 classes needs some serious overhauling.
4421 classes needs some serious overhauling.
4421
4422
4422 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4423 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4423 which was ignoring '_' in option names.
4424 which was ignoring '_' in option names.
4424
4425
4425 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4426 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4426 'Verbose_novars' to 'Context' and made it the new default. It's a
4427 'Verbose_novars' to 'Context' and made it the new default. It's a
4427 bit more readable and also safer than verbose.
4428 bit more readable and also safer than verbose.
4428
4429
4429 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4430 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4430 triple-quoted strings.
4431 triple-quoted strings.
4431
4432
4432 * IPython/OInspect.py (__all__): new module exposing the object
4433 * IPython/OInspect.py (__all__): new module exposing the object
4433 introspection facilities. Now the corresponding magics are dummy
4434 introspection facilities. Now the corresponding magics are dummy
4434 wrappers around this. Having this module will make it much easier
4435 wrappers around this. Having this module will make it much easier
4435 to put these functions into our modified pdb.
4436 to put these functions into our modified pdb.
4436 This new object inspector system uses the new colorizing module,
4437 This new object inspector system uses the new colorizing module,
4437 so source code and other things are nicely syntax highlighted.
4438 so source code and other things are nicely syntax highlighted.
4438
4439
4439 2002-05-18 Fernando Perez <fperez@colorado.edu>
4440 2002-05-18 Fernando Perez <fperez@colorado.edu>
4440
4441
4441 * IPython/ColorANSI.py: Split the coloring tools into a separate
4442 * IPython/ColorANSI.py: Split the coloring tools into a separate
4442 module so I can use them in other code easier (they were part of
4443 module so I can use them in other code easier (they were part of
4443 ultraTB).
4444 ultraTB).
4444
4445
4445 2002-05-17 Fernando Perez <fperez@colorado.edu>
4446 2002-05-17 Fernando Perez <fperez@colorado.edu>
4446
4447
4447 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4448 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4448 fixed it to set the global 'g' also to the called instance, as
4449 fixed it to set the global 'g' also to the called instance, as
4449 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4450 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4450 user's 'g' variables).
4451 user's 'g' variables).
4451
4452
4452 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4453 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4453 global variables (aliases to _ih,_oh) so that users which expect
4454 global variables (aliases to _ih,_oh) so that users which expect
4454 In[5] or Out[7] to work aren't unpleasantly surprised.
4455 In[5] or Out[7] to work aren't unpleasantly surprised.
4455 (InputList.__getslice__): new class to allow executing slices of
4456 (InputList.__getslice__): new class to allow executing slices of
4456 input history directly. Very simple class, complements the use of
4457 input history directly. Very simple class, complements the use of
4457 macros.
4458 macros.
4458
4459
4459 2002-05-16 Fernando Perez <fperez@colorado.edu>
4460 2002-05-16 Fernando Perez <fperez@colorado.edu>
4460
4461
4461 * setup.py (docdirbase): make doc directory be just doc/IPython
4462 * setup.py (docdirbase): make doc directory be just doc/IPython
4462 without version numbers, it will reduce clutter for users.
4463 without version numbers, it will reduce clutter for users.
4463
4464
4464 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4465 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4465 execfile call to prevent possible memory leak. See for details:
4466 execfile call to prevent possible memory leak. See for details:
4466 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4467 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4467
4468
4468 2002-05-15 Fernando Perez <fperez@colorado.edu>
4469 2002-05-15 Fernando Perez <fperez@colorado.edu>
4469
4470
4470 * IPython/Magic.py (Magic.magic_psource): made the object
4471 * IPython/Magic.py (Magic.magic_psource): made the object
4471 introspection names be more standard: pdoc, pdef, pfile and
4472 introspection names be more standard: pdoc, pdef, pfile and
4472 psource. They all print/page their output, and it makes
4473 psource. They all print/page their output, and it makes
4473 remembering them easier. Kept old names for compatibility as
4474 remembering them easier. Kept old names for compatibility as
4474 aliases.
4475 aliases.
4475
4476
4476 2002-05-14 Fernando Perez <fperez@colorado.edu>
4477 2002-05-14 Fernando Perez <fperez@colorado.edu>
4477
4478
4478 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4479 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4479 what the mouse problem was. The trick is to use gnuplot with temp
4480 what the mouse problem was. The trick is to use gnuplot with temp
4480 files and NOT with pipes (for data communication), because having
4481 files and NOT with pipes (for data communication), because having
4481 both pipes and the mouse on is bad news.
4482 both pipes and the mouse on is bad news.
4482
4483
4483 2002-05-13 Fernando Perez <fperez@colorado.edu>
4484 2002-05-13 Fernando Perez <fperez@colorado.edu>
4484
4485
4485 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4486 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4486 bug. Information would be reported about builtins even when
4487 bug. Information would be reported about builtins even when
4487 user-defined functions overrode them.
4488 user-defined functions overrode them.
4488
4489
4489 2002-05-11 Fernando Perez <fperez@colorado.edu>
4490 2002-05-11 Fernando Perez <fperez@colorado.edu>
4490
4491
4491 * IPython/__init__.py (__all__): removed FlexCompleter from
4492 * IPython/__init__.py (__all__): removed FlexCompleter from
4492 __all__ so that things don't fail in platforms without readline.
4493 __all__ so that things don't fail in platforms without readline.
4493
4494
4494 2002-05-10 Fernando Perez <fperez@colorado.edu>
4495 2002-05-10 Fernando Perez <fperez@colorado.edu>
4495
4496
4496 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4497 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4497 it requires Numeric, effectively making Numeric a dependency for
4498 it requires Numeric, effectively making Numeric a dependency for
4498 IPython.
4499 IPython.
4499
4500
4500 * Released 0.2.13
4501 * Released 0.2.13
4501
4502
4502 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4503 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4503 profiler interface. Now all the major options from the profiler
4504 profiler interface. Now all the major options from the profiler
4504 module are directly supported in IPython, both for single
4505 module are directly supported in IPython, both for single
4505 expressions (@prun) and for full programs (@run -p).
4506 expressions (@prun) and for full programs (@run -p).
4506
4507
4507 2002-05-09 Fernando Perez <fperez@colorado.edu>
4508 2002-05-09 Fernando Perez <fperez@colorado.edu>
4508
4509
4509 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4510 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4510 magic properly formatted for screen.
4511 magic properly formatted for screen.
4511
4512
4512 * setup.py (make_shortcut): Changed things to put pdf version in
4513 * setup.py (make_shortcut): Changed things to put pdf version in
4513 doc/ instead of doc/manual (had to change lyxport a bit).
4514 doc/ instead of doc/manual (had to change lyxport a bit).
4514
4515
4515 * IPython/Magic.py (Profile.string_stats): made profile runs go
4516 * IPython/Magic.py (Profile.string_stats): made profile runs go
4516 through pager (they are long and a pager allows searching, saving,
4517 through pager (they are long and a pager allows searching, saving,
4517 etc.)
4518 etc.)
4518
4519
4519 2002-05-08 Fernando Perez <fperez@colorado.edu>
4520 2002-05-08 Fernando Perez <fperez@colorado.edu>
4520
4521
4521 * Released 0.2.12
4522 * Released 0.2.12
4522
4523
4523 2002-05-06 Fernando Perez <fperez@colorado.edu>
4524 2002-05-06 Fernando Perez <fperez@colorado.edu>
4524
4525
4525 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4526 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4526 introduced); 'hist n1 n2' was broken.
4527 introduced); 'hist n1 n2' was broken.
4527 (Magic.magic_pdb): added optional on/off arguments to @pdb
4528 (Magic.magic_pdb): added optional on/off arguments to @pdb
4528 (Magic.magic_run): added option -i to @run, which executes code in
4529 (Magic.magic_run): added option -i to @run, which executes code in
4529 the IPython namespace instead of a clean one. Also added @irun as
4530 the IPython namespace instead of a clean one. Also added @irun as
4530 an alias to @run -i.
4531 an alias to @run -i.
4531
4532
4532 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4533 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4533 fixed (it didn't really do anything, the namespaces were wrong).
4534 fixed (it didn't really do anything, the namespaces were wrong).
4534
4535
4535 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4536 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4536
4537
4537 * IPython/__init__.py (__all__): Fixed package namespace, now
4538 * IPython/__init__.py (__all__): Fixed package namespace, now
4538 'import IPython' does give access to IPython.<all> as
4539 'import IPython' does give access to IPython.<all> as
4539 expected. Also renamed __release__ to Release.
4540 expected. Also renamed __release__ to Release.
4540
4541
4541 * IPython/Debugger.py (__license__): created new Pdb class which
4542 * IPython/Debugger.py (__license__): created new Pdb class which
4542 functions like a drop-in for the normal pdb.Pdb but does NOT
4543 functions like a drop-in for the normal pdb.Pdb but does NOT
4543 import readline by default. This way it doesn't muck up IPython's
4544 import readline by default. This way it doesn't muck up IPython's
4544 readline handling, and now tab-completion finally works in the
4545 readline handling, and now tab-completion finally works in the
4545 debugger -- sort of. It completes things globally visible, but the
4546 debugger -- sort of. It completes things globally visible, but the
4546 completer doesn't track the stack as pdb walks it. That's a bit
4547 completer doesn't track the stack as pdb walks it. That's a bit
4547 tricky, and I'll have to implement it later.
4548 tricky, and I'll have to implement it later.
4548
4549
4549 2002-05-05 Fernando Perez <fperez@colorado.edu>
4550 2002-05-05 Fernando Perez <fperez@colorado.edu>
4550
4551
4551 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4552 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4552 magic docstrings when printed via ? (explicit \'s were being
4553 magic docstrings when printed via ? (explicit \'s were being
4553 printed).
4554 printed).
4554
4555
4555 * IPython/ipmaker.py (make_IPython): fixed namespace
4556 * IPython/ipmaker.py (make_IPython): fixed namespace
4556 identification bug. Now variables loaded via logs or command-line
4557 identification bug. Now variables loaded via logs or command-line
4557 files are recognized in the interactive namespace by @who.
4558 files are recognized in the interactive namespace by @who.
4558
4559
4559 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4560 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4560 log replay system stemming from the string form of Structs.
4561 log replay system stemming from the string form of Structs.
4561
4562
4562 * IPython/Magic.py (Macro.__init__): improved macros to properly
4563 * IPython/Magic.py (Macro.__init__): improved macros to properly
4563 handle magic commands in them.
4564 handle magic commands in them.
4564 (Magic.magic_logstart): usernames are now expanded so 'logstart
4565 (Magic.magic_logstart): usernames are now expanded so 'logstart
4565 ~/mylog' now works.
4566 ~/mylog' now works.
4566
4567
4567 * IPython/iplib.py (complete): fixed bug where paths starting with
4568 * IPython/iplib.py (complete): fixed bug where paths starting with
4568 '/' would be completed as magic names.
4569 '/' would be completed as magic names.
4569
4570
4570 2002-05-04 Fernando Perez <fperez@colorado.edu>
4571 2002-05-04 Fernando Perez <fperez@colorado.edu>
4571
4572
4572 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4573 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4573 allow running full programs under the profiler's control.
4574 allow running full programs under the profiler's control.
4574
4575
4575 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4576 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4576 mode to report exceptions verbosely but without formatting
4577 mode to report exceptions verbosely but without formatting
4577 variables. This addresses the issue of ipython 'freezing' (it's
4578 variables. This addresses the issue of ipython 'freezing' (it's
4578 not frozen, but caught in an expensive formatting loop) when huge
4579 not frozen, but caught in an expensive formatting loop) when huge
4579 variables are in the context of an exception.
4580 variables are in the context of an exception.
4580 (VerboseTB.text): Added '--->' markers at line where exception was
4581 (VerboseTB.text): Added '--->' markers at line where exception was
4581 triggered. Much clearer to read, especially in NoColor modes.
4582 triggered. Much clearer to read, especially in NoColor modes.
4582
4583
4583 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4584 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4584 implemented in reverse when changing to the new parse_options().
4585 implemented in reverse when changing to the new parse_options().
4585
4586
4586 2002-05-03 Fernando Perez <fperez@colorado.edu>
4587 2002-05-03 Fernando Perez <fperez@colorado.edu>
4587
4588
4588 * IPython/Magic.py (Magic.parse_options): new function so that
4589 * IPython/Magic.py (Magic.parse_options): new function so that
4589 magics can parse options easier.
4590 magics can parse options easier.
4590 (Magic.magic_prun): new function similar to profile.run(),
4591 (Magic.magic_prun): new function similar to profile.run(),
4591 suggested by Chris Hart.
4592 suggested by Chris Hart.
4592 (Magic.magic_cd): fixed behavior so that it only changes if
4593 (Magic.magic_cd): fixed behavior so that it only changes if
4593 directory actually is in history.
4594 directory actually is in history.
4594
4595
4595 * IPython/usage.py (__doc__): added information about potential
4596 * IPython/usage.py (__doc__): added information about potential
4596 slowness of Verbose exception mode when there are huge data
4597 slowness of Verbose exception mode when there are huge data
4597 structures to be formatted (thanks to Archie Paulson).
4598 structures to be formatted (thanks to Archie Paulson).
4598
4599
4599 * IPython/ipmaker.py (make_IPython): Changed default logging
4600 * IPython/ipmaker.py (make_IPython): Changed default logging
4600 (when simply called with -log) to use curr_dir/ipython.log in
4601 (when simply called with -log) to use curr_dir/ipython.log in
4601 rotate mode. Fixed crash which was occuring with -log before
4602 rotate mode. Fixed crash which was occuring with -log before
4602 (thanks to Jim Boyle).
4603 (thanks to Jim Boyle).
4603
4604
4604 2002-05-01 Fernando Perez <fperez@colorado.edu>
4605 2002-05-01 Fernando Perez <fperez@colorado.edu>
4605
4606
4606 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4607 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4607 was nasty -- though somewhat of a corner case).
4608 was nasty -- though somewhat of a corner case).
4608
4609
4609 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4610 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4610 text (was a bug).
4611 text (was a bug).
4611
4612
4612 2002-04-30 Fernando Perez <fperez@colorado.edu>
4613 2002-04-30 Fernando Perez <fperez@colorado.edu>
4613
4614
4614 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4615 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4615 a print after ^D or ^C from the user so that the In[] prompt
4616 a print after ^D or ^C from the user so that the In[] prompt
4616 doesn't over-run the gnuplot one.
4617 doesn't over-run the gnuplot one.
4617
4618
4618 2002-04-29 Fernando Perez <fperez@colorado.edu>
4619 2002-04-29 Fernando Perez <fperez@colorado.edu>
4619
4620
4620 * Released 0.2.10
4621 * Released 0.2.10
4621
4622
4622 * IPython/__release__.py (version): get date dynamically.
4623 * IPython/__release__.py (version): get date dynamically.
4623
4624
4624 * Misc. documentation updates thanks to Arnd's comments. Also ran
4625 * Misc. documentation updates thanks to Arnd's comments. Also ran
4625 a full spellcheck on the manual (hadn't been done in a while).
4626 a full spellcheck on the manual (hadn't been done in a while).
4626
4627
4627 2002-04-27 Fernando Perez <fperez@colorado.edu>
4628 2002-04-27 Fernando Perez <fperez@colorado.edu>
4628
4629
4629 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4630 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4630 starting a log in mid-session would reset the input history list.
4631 starting a log in mid-session would reset the input history list.
4631
4632
4632 2002-04-26 Fernando Perez <fperez@colorado.edu>
4633 2002-04-26 Fernando Perez <fperez@colorado.edu>
4633
4634
4634 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4635 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4635 all files were being included in an update. Now anything in
4636 all files were being included in an update. Now anything in
4636 UserConfig that matches [A-Za-z]*.py will go (this excludes
4637 UserConfig that matches [A-Za-z]*.py will go (this excludes
4637 __init__.py)
4638 __init__.py)
4638
4639
4639 2002-04-25 Fernando Perez <fperez@colorado.edu>
4640 2002-04-25 Fernando Perez <fperez@colorado.edu>
4640
4641
4641 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4642 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4642 to __builtins__ so that any form of embedded or imported code can
4643 to __builtins__ so that any form of embedded or imported code can
4643 test for being inside IPython.
4644 test for being inside IPython.
4644
4645
4645 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4646 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4646 changed to GnuplotMagic because it's now an importable module,
4647 changed to GnuplotMagic because it's now an importable module,
4647 this makes the name follow that of the standard Gnuplot module.
4648 this makes the name follow that of the standard Gnuplot module.
4648 GnuplotMagic can now be loaded at any time in mid-session.
4649 GnuplotMagic can now be loaded at any time in mid-session.
4649
4650
4650 2002-04-24 Fernando Perez <fperez@colorado.edu>
4651 2002-04-24 Fernando Perez <fperez@colorado.edu>
4651
4652
4652 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4653 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4653 the globals (IPython has its own namespace) and the
4654 the globals (IPython has its own namespace) and the
4654 PhysicalQuantity stuff is much better anyway.
4655 PhysicalQuantity stuff is much better anyway.
4655
4656
4656 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4657 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4657 embedding example to standard user directory for
4658 embedding example to standard user directory for
4658 distribution. Also put it in the manual.
4659 distribution. Also put it in the manual.
4659
4660
4660 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4661 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4661 instance as first argument (so it doesn't rely on some obscure
4662 instance as first argument (so it doesn't rely on some obscure
4662 hidden global).
4663 hidden global).
4663
4664
4664 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4665 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4665 delimiters. While it prevents ().TAB from working, it allows
4666 delimiters. While it prevents ().TAB from working, it allows
4666 completions in open (... expressions. This is by far a more common
4667 completions in open (... expressions. This is by far a more common
4667 case.
4668 case.
4668
4669
4669 2002-04-23 Fernando Perez <fperez@colorado.edu>
4670 2002-04-23 Fernando Perez <fperez@colorado.edu>
4670
4671
4671 * IPython/Extensions/InterpreterPasteInput.py: new
4672 * IPython/Extensions/InterpreterPasteInput.py: new
4672 syntax-processing module for pasting lines with >>> or ... at the
4673 syntax-processing module for pasting lines with >>> or ... at the
4673 start.
4674 start.
4674
4675
4675 * IPython/Extensions/PhysicalQ_Interactive.py
4676 * IPython/Extensions/PhysicalQ_Interactive.py
4676 (PhysicalQuantityInteractive.__int__): fixed to work with either
4677 (PhysicalQuantityInteractive.__int__): fixed to work with either
4677 Numeric or math.
4678 Numeric or math.
4678
4679
4679 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4680 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4680 provided profiles. Now we have:
4681 provided profiles. Now we have:
4681 -math -> math module as * and cmath with its own namespace.
4682 -math -> math module as * and cmath with its own namespace.
4682 -numeric -> Numeric as *, plus gnuplot & grace
4683 -numeric -> Numeric as *, plus gnuplot & grace
4683 -physics -> same as before
4684 -physics -> same as before
4684
4685
4685 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4686 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4686 user-defined magics wouldn't be found by @magic if they were
4687 user-defined magics wouldn't be found by @magic if they were
4687 defined as class methods. Also cleaned up the namespace search
4688 defined as class methods. Also cleaned up the namespace search
4688 logic and the string building (to use %s instead of many repeated
4689 logic and the string building (to use %s instead of many repeated
4689 string adds).
4690 string adds).
4690
4691
4691 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4692 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4692 of user-defined magics to operate with class methods (cleaner, in
4693 of user-defined magics to operate with class methods (cleaner, in
4693 line with the gnuplot code).
4694 line with the gnuplot code).
4694
4695
4695 2002-04-22 Fernando Perez <fperez@colorado.edu>
4696 2002-04-22 Fernando Perez <fperez@colorado.edu>
4696
4697
4697 * setup.py: updated dependency list so that manual is updated when
4698 * setup.py: updated dependency list so that manual is updated when
4698 all included files change.
4699 all included files change.
4699
4700
4700 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4701 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4701 the delimiter removal option (the fix is ugly right now).
4702 the delimiter removal option (the fix is ugly right now).
4702
4703
4703 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4704 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4704 all of the math profile (quicker loading, no conflict between
4705 all of the math profile (quicker loading, no conflict between
4705 g-9.8 and g-gnuplot).
4706 g-9.8 and g-gnuplot).
4706
4707
4707 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4708 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4708 name of post-mortem files to IPython_crash_report.txt.
4709 name of post-mortem files to IPython_crash_report.txt.
4709
4710
4710 * Cleanup/update of the docs. Added all the new readline info and
4711 * Cleanup/update of the docs. Added all the new readline info and
4711 formatted all lists as 'real lists'.
4712 formatted all lists as 'real lists'.
4712
4713
4713 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4714 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4714 tab-completion options, since the full readline parse_and_bind is
4715 tab-completion options, since the full readline parse_and_bind is
4715 now accessible.
4716 now accessible.
4716
4717
4717 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4718 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4718 handling of readline options. Now users can specify any string to
4719 handling of readline options. Now users can specify any string to
4719 be passed to parse_and_bind(), as well as the delimiters to be
4720 be passed to parse_and_bind(), as well as the delimiters to be
4720 removed.
4721 removed.
4721 (InteractiveShell.__init__): Added __name__ to the global
4722 (InteractiveShell.__init__): Added __name__ to the global
4722 namespace so that things like Itpl which rely on its existence
4723 namespace so that things like Itpl which rely on its existence
4723 don't crash.
4724 don't crash.
4724 (InteractiveShell._prefilter): Defined the default with a _ so
4725 (InteractiveShell._prefilter): Defined the default with a _ so
4725 that prefilter() is easier to override, while the default one
4726 that prefilter() is easier to override, while the default one
4726 remains available.
4727 remains available.
4727
4728
4728 2002-04-18 Fernando Perez <fperez@colorado.edu>
4729 2002-04-18 Fernando Perez <fperez@colorado.edu>
4729
4730
4730 * Added information about pdb in the docs.
4731 * Added information about pdb in the docs.
4731
4732
4732 2002-04-17 Fernando Perez <fperez@colorado.edu>
4733 2002-04-17 Fernando Perez <fperez@colorado.edu>
4733
4734
4734 * IPython/ipmaker.py (make_IPython): added rc_override option to
4735 * IPython/ipmaker.py (make_IPython): added rc_override option to
4735 allow passing config options at creation time which may override
4736 allow passing config options at creation time which may override
4736 anything set in the config files or command line. This is
4737 anything set in the config files or command line. This is
4737 particularly useful for configuring embedded instances.
4738 particularly useful for configuring embedded instances.
4738
4739
4739 2002-04-15 Fernando Perez <fperez@colorado.edu>
4740 2002-04-15 Fernando Perez <fperez@colorado.edu>
4740
4741
4741 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4742 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4742 crash embedded instances because of the input cache falling out of
4743 crash embedded instances because of the input cache falling out of
4743 sync with the output counter.
4744 sync with the output counter.
4744
4745
4745 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4746 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4746 mode which calls pdb after an uncaught exception in IPython itself.
4747 mode which calls pdb after an uncaught exception in IPython itself.
4747
4748
4748 2002-04-14 Fernando Perez <fperez@colorado.edu>
4749 2002-04-14 Fernando Perez <fperez@colorado.edu>
4749
4750
4750 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4751 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4751 readline, fix it back after each call.
4752 readline, fix it back after each call.
4752
4753
4753 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4754 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4754 method to force all access via __call__(), which guarantees that
4755 method to force all access via __call__(), which guarantees that
4755 traceback references are properly deleted.
4756 traceback references are properly deleted.
4756
4757
4757 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4758 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4758 improve printing when pprint is in use.
4759 improve printing when pprint is in use.
4759
4760
4760 2002-04-13 Fernando Perez <fperez@colorado.edu>
4761 2002-04-13 Fernando Perez <fperez@colorado.edu>
4761
4762
4762 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4763 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4763 exceptions aren't caught anymore. If the user triggers one, he
4764 exceptions aren't caught anymore. If the user triggers one, he
4764 should know why he's doing it and it should go all the way up,
4765 should know why he's doing it and it should go all the way up,
4765 just like any other exception. So now @abort will fully kill the
4766 just like any other exception. So now @abort will fully kill the
4766 embedded interpreter and the embedding code (unless that happens
4767 embedded interpreter and the embedding code (unless that happens
4767 to catch SystemExit).
4768 to catch SystemExit).
4768
4769
4769 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4770 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4770 and a debugger() method to invoke the interactive pdb debugger
4771 and a debugger() method to invoke the interactive pdb debugger
4771 after printing exception information. Also added the corresponding
4772 after printing exception information. Also added the corresponding
4772 -pdb option and @pdb magic to control this feature, and updated
4773 -pdb option and @pdb magic to control this feature, and updated
4773 the docs. After a suggestion from Christopher Hart
4774 the docs. After a suggestion from Christopher Hart
4774 (hart-AT-caltech.edu).
4775 (hart-AT-caltech.edu).
4775
4776
4776 2002-04-12 Fernando Perez <fperez@colorado.edu>
4777 2002-04-12 Fernando Perez <fperez@colorado.edu>
4777
4778
4778 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4779 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4779 the exception handlers defined by the user (not the CrashHandler)
4780 the exception handlers defined by the user (not the CrashHandler)
4780 so that user exceptions don't trigger an ipython bug report.
4781 so that user exceptions don't trigger an ipython bug report.
4781
4782
4782 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4783 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4783 configurable (it should have always been so).
4784 configurable (it should have always been so).
4784
4785
4785 2002-03-26 Fernando Perez <fperez@colorado.edu>
4786 2002-03-26 Fernando Perez <fperez@colorado.edu>
4786
4787
4787 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4788 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4788 and there to fix embedding namespace issues. This should all be
4789 and there to fix embedding namespace issues. This should all be
4789 done in a more elegant way.
4790 done in a more elegant way.
4790
4791
4791 2002-03-25 Fernando Perez <fperez@colorado.edu>
4792 2002-03-25 Fernando Perez <fperez@colorado.edu>
4792
4793
4793 * IPython/genutils.py (get_home_dir): Try to make it work under
4794 * IPython/genutils.py (get_home_dir): Try to make it work under
4794 win9x also.
4795 win9x also.
4795
4796
4796 2002-03-20 Fernando Perez <fperez@colorado.edu>
4797 2002-03-20 Fernando Perez <fperez@colorado.edu>
4797
4798
4798 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4799 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4799 sys.displayhook untouched upon __init__.
4800 sys.displayhook untouched upon __init__.
4800
4801
4801 2002-03-19 Fernando Perez <fperez@colorado.edu>
4802 2002-03-19 Fernando Perez <fperez@colorado.edu>
4802
4803
4803 * Released 0.2.9 (for embedding bug, basically).
4804 * Released 0.2.9 (for embedding bug, basically).
4804
4805
4805 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4806 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4806 exceptions so that enclosing shell's state can be restored.
4807 exceptions so that enclosing shell's state can be restored.
4807
4808
4808 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4809 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4809 naming conventions in the .ipython/ dir.
4810 naming conventions in the .ipython/ dir.
4810
4811
4811 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4812 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4812 from delimiters list so filenames with - in them get expanded.
4813 from delimiters list so filenames with - in them get expanded.
4813
4814
4814 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4815 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4815 sys.displayhook not being properly restored after an embedded call.
4816 sys.displayhook not being properly restored after an embedded call.
4816
4817
4817 2002-03-18 Fernando Perez <fperez@colorado.edu>
4818 2002-03-18 Fernando Perez <fperez@colorado.edu>
4818
4819
4819 * Released 0.2.8
4820 * Released 0.2.8
4820
4821
4821 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4822 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4822 some files weren't being included in a -upgrade.
4823 some files weren't being included in a -upgrade.
4823 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4824 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4824 on' so that the first tab completes.
4825 on' so that the first tab completes.
4825 (InteractiveShell.handle_magic): fixed bug with spaces around
4826 (InteractiveShell.handle_magic): fixed bug with spaces around
4826 quotes breaking many magic commands.
4827 quotes breaking many magic commands.
4827
4828
4828 * setup.py: added note about ignoring the syntax error messages at
4829 * setup.py: added note about ignoring the syntax error messages at
4829 installation.
4830 installation.
4830
4831
4831 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4832 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4832 streamlining the gnuplot interface, now there's only one magic @gp.
4833 streamlining the gnuplot interface, now there's only one magic @gp.
4833
4834
4834 2002-03-17 Fernando Perez <fperez@colorado.edu>
4835 2002-03-17 Fernando Perez <fperez@colorado.edu>
4835
4836
4836 * IPython/UserConfig/magic_gnuplot.py: new name for the
4837 * IPython/UserConfig/magic_gnuplot.py: new name for the
4837 example-magic_pm.py file. Much enhanced system, now with a shell
4838 example-magic_pm.py file. Much enhanced system, now with a shell
4838 for communicating directly with gnuplot, one command at a time.
4839 for communicating directly with gnuplot, one command at a time.
4839
4840
4840 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4841 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4841 setting __name__=='__main__'.
4842 setting __name__=='__main__'.
4842
4843
4843 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4844 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4844 mini-shell for accessing gnuplot from inside ipython. Should
4845 mini-shell for accessing gnuplot from inside ipython. Should
4845 extend it later for grace access too. Inspired by Arnd's
4846 extend it later for grace access too. Inspired by Arnd's
4846 suggestion.
4847 suggestion.
4847
4848
4848 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4849 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4849 calling magic functions with () in their arguments. Thanks to Arnd
4850 calling magic functions with () in their arguments. Thanks to Arnd
4850 Baecker for pointing this to me.
4851 Baecker for pointing this to me.
4851
4852
4852 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4853 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4853 infinitely for integer or complex arrays (only worked with floats).
4854 infinitely for integer or complex arrays (only worked with floats).
4854
4855
4855 2002-03-16 Fernando Perez <fperez@colorado.edu>
4856 2002-03-16 Fernando Perez <fperez@colorado.edu>
4856
4857
4857 * setup.py: Merged setup and setup_windows into a single script
4858 * setup.py: Merged setup and setup_windows into a single script
4858 which properly handles things for windows users.
4859 which properly handles things for windows users.
4859
4860
4860 2002-03-15 Fernando Perez <fperez@colorado.edu>
4861 2002-03-15 Fernando Perez <fperez@colorado.edu>
4861
4862
4862 * Big change to the manual: now the magics are all automatically
4863 * Big change to the manual: now the magics are all automatically
4863 documented. This information is generated from their docstrings
4864 documented. This information is generated from their docstrings
4864 and put in a latex file included by the manual lyx file. This way
4865 and put in a latex file included by the manual lyx file. This way
4865 we get always up to date information for the magics. The manual
4866 we get always up to date information for the magics. The manual
4866 now also has proper version information, also auto-synced.
4867 now also has proper version information, also auto-synced.
4867
4868
4868 For this to work, an undocumented --magic_docstrings option was added.
4869 For this to work, an undocumented --magic_docstrings option was added.
4869
4870
4870 2002-03-13 Fernando Perez <fperez@colorado.edu>
4871 2002-03-13 Fernando Perez <fperez@colorado.edu>
4871
4872
4872 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4873 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4873 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4874 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4874
4875
4875 2002-03-12 Fernando Perez <fperez@colorado.edu>
4876 2002-03-12 Fernando Perez <fperez@colorado.edu>
4876
4877
4877 * IPython/ultraTB.py (TermColors): changed color escapes again to
4878 * IPython/ultraTB.py (TermColors): changed color escapes again to
4878 fix the (old, reintroduced) line-wrapping bug. Basically, if
4879 fix the (old, reintroduced) line-wrapping bug. Basically, if
4879 \001..\002 aren't given in the color escapes, lines get wrapped
4880 \001..\002 aren't given in the color escapes, lines get wrapped
4880 weirdly. But giving those screws up old xterms and emacs terms. So
4881 weirdly. But giving those screws up old xterms and emacs terms. So
4881 I added some logic for emacs terms to be ok, but I can't identify old
4882 I added some logic for emacs terms to be ok, but I can't identify old
4882 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4883 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4883
4884
4884 2002-03-10 Fernando Perez <fperez@colorado.edu>
4885 2002-03-10 Fernando Perez <fperez@colorado.edu>
4885
4886
4886 * IPython/usage.py (__doc__): Various documentation cleanups and
4887 * IPython/usage.py (__doc__): Various documentation cleanups and
4887 updates, both in usage docstrings and in the manual.
4888 updates, both in usage docstrings and in the manual.
4888
4889
4889 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4890 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4890 handling of caching. Set minimum acceptabe value for having a
4891 handling of caching. Set minimum acceptabe value for having a
4891 cache at 20 values.
4892 cache at 20 values.
4892
4893
4893 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4894 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4894 install_first_time function to a method, renamed it and added an
4895 install_first_time function to a method, renamed it and added an
4895 'upgrade' mode. Now people can update their config directory with
4896 'upgrade' mode. Now people can update their config directory with
4896 a simple command line switch (-upgrade, also new).
4897 a simple command line switch (-upgrade, also new).
4897
4898
4898 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4899 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4899 @file (convenient for automagic users under Python >= 2.2).
4900 @file (convenient for automagic users under Python >= 2.2).
4900 Removed @files (it seemed more like a plural than an abbrev. of
4901 Removed @files (it seemed more like a plural than an abbrev. of
4901 'file show').
4902 'file show').
4902
4903
4903 * IPython/iplib.py (install_first_time): Fixed crash if there were
4904 * IPython/iplib.py (install_first_time): Fixed crash if there were
4904 backup files ('~') in .ipython/ install directory.
4905 backup files ('~') in .ipython/ install directory.
4905
4906
4906 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4907 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4907 system. Things look fine, but these changes are fairly
4908 system. Things look fine, but these changes are fairly
4908 intrusive. Test them for a few days.
4909 intrusive. Test them for a few days.
4909
4910
4910 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4911 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4911 the prompts system. Now all in/out prompt strings are user
4912 the prompts system. Now all in/out prompt strings are user
4912 controllable. This is particularly useful for embedding, as one
4913 controllable. This is particularly useful for embedding, as one
4913 can tag embedded instances with particular prompts.
4914 can tag embedded instances with particular prompts.
4914
4915
4915 Also removed global use of sys.ps1/2, which now allows nested
4916 Also removed global use of sys.ps1/2, which now allows nested
4916 embeddings without any problems. Added command-line options for
4917 embeddings without any problems. Added command-line options for
4917 the prompt strings.
4918 the prompt strings.
4918
4919
4919 2002-03-08 Fernando Perez <fperez@colorado.edu>
4920 2002-03-08 Fernando Perez <fperez@colorado.edu>
4920
4921
4921 * IPython/UserConfig/example-embed-short.py (ipshell): added
4922 * IPython/UserConfig/example-embed-short.py (ipshell): added
4922 example file with the bare minimum code for embedding.
4923 example file with the bare minimum code for embedding.
4923
4924
4924 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4925 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4925 functionality for the embeddable shell to be activated/deactivated
4926 functionality for the embeddable shell to be activated/deactivated
4926 either globally or at each call.
4927 either globally or at each call.
4927
4928
4928 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4929 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4929 rewriting the prompt with '--->' for auto-inputs with proper
4930 rewriting the prompt with '--->' for auto-inputs with proper
4930 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4931 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4931 this is handled by the prompts class itself, as it should.
4932 this is handled by the prompts class itself, as it should.
4932
4933
4933 2002-03-05 Fernando Perez <fperez@colorado.edu>
4934 2002-03-05 Fernando Perez <fperez@colorado.edu>
4934
4935
4935 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4936 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4936 @logstart to avoid name clashes with the math log function.
4937 @logstart to avoid name clashes with the math log function.
4937
4938
4938 * Big updates to X/Emacs section of the manual.
4939 * Big updates to X/Emacs section of the manual.
4939
4940
4940 * Removed ipython_emacs. Milan explained to me how to pass
4941 * Removed ipython_emacs. Milan explained to me how to pass
4941 arguments to ipython through Emacs. Some day I'm going to end up
4942 arguments to ipython through Emacs. Some day I'm going to end up
4942 learning some lisp...
4943 learning some lisp...
4943
4944
4944 2002-03-04 Fernando Perez <fperez@colorado.edu>
4945 2002-03-04 Fernando Perez <fperez@colorado.edu>
4945
4946
4946 * IPython/ipython_emacs: Created script to be used as the
4947 * IPython/ipython_emacs: Created script to be used as the
4947 py-python-command Emacs variable so we can pass IPython
4948 py-python-command Emacs variable so we can pass IPython
4948 parameters. I can't figure out how to tell Emacs directly to pass
4949 parameters. I can't figure out how to tell Emacs directly to pass
4949 parameters to IPython, so a dummy shell script will do it.
4950 parameters to IPython, so a dummy shell script will do it.
4950
4951
4951 Other enhancements made for things to work better under Emacs'
4952 Other enhancements made for things to work better under Emacs'
4952 various types of terminals. Many thanks to Milan Zamazal
4953 various types of terminals. Many thanks to Milan Zamazal
4953 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4954 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4954
4955
4955 2002-03-01 Fernando Perez <fperez@colorado.edu>
4956 2002-03-01 Fernando Perez <fperez@colorado.edu>
4956
4957
4957 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4958 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4958 that loading of readline is now optional. This gives better
4959 that loading of readline is now optional. This gives better
4959 control to emacs users.
4960 control to emacs users.
4960
4961
4961 * IPython/ultraTB.py (__date__): Modified color escape sequences
4962 * IPython/ultraTB.py (__date__): Modified color escape sequences
4962 and now things work fine under xterm and in Emacs' term buffers
4963 and now things work fine under xterm and in Emacs' term buffers
4963 (though not shell ones). Well, in emacs you get colors, but all
4964 (though not shell ones). Well, in emacs you get colors, but all
4964 seem to be 'light' colors (no difference between dark and light
4965 seem to be 'light' colors (no difference between dark and light
4965 ones). But the garbage chars are gone, and also in xterms. It
4966 ones). But the garbage chars are gone, and also in xterms. It
4966 seems that now I'm using 'cleaner' ansi sequences.
4967 seems that now I'm using 'cleaner' ansi sequences.
4967
4968
4968 2002-02-21 Fernando Perez <fperez@colorado.edu>
4969 2002-02-21 Fernando Perez <fperez@colorado.edu>
4969
4970
4970 * Released 0.2.7 (mainly to publish the scoping fix).
4971 * Released 0.2.7 (mainly to publish the scoping fix).
4971
4972
4972 * IPython/Logger.py (Logger.logstate): added. A corresponding
4973 * IPython/Logger.py (Logger.logstate): added. A corresponding
4973 @logstate magic was created.
4974 @logstate magic was created.
4974
4975
4975 * IPython/Magic.py: fixed nested scoping problem under Python
4976 * IPython/Magic.py: fixed nested scoping problem under Python
4976 2.1.x (automagic wasn't working).
4977 2.1.x (automagic wasn't working).
4977
4978
4978 2002-02-20 Fernando Perez <fperez@colorado.edu>
4979 2002-02-20 Fernando Perez <fperez@colorado.edu>
4979
4980
4980 * Released 0.2.6.
4981 * Released 0.2.6.
4981
4982
4982 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4983 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4983 option so that logs can come out without any headers at all.
4984 option so that logs can come out without any headers at all.
4984
4985
4985 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4986 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4986 SciPy.
4987 SciPy.
4987
4988
4988 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4989 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4989 that embedded IPython calls don't require vars() to be explicitly
4990 that embedded IPython calls don't require vars() to be explicitly
4990 passed. Now they are extracted from the caller's frame (code
4991 passed. Now they are extracted from the caller's frame (code
4991 snatched from Eric Jones' weave). Added better documentation to
4992 snatched from Eric Jones' weave). Added better documentation to
4992 the section on embedding and the example file.
4993 the section on embedding and the example file.
4993
4994
4994 * IPython/genutils.py (page): Changed so that under emacs, it just
4995 * IPython/genutils.py (page): Changed so that under emacs, it just
4995 prints the string. You can then page up and down in the emacs
4996 prints the string. You can then page up and down in the emacs
4996 buffer itself. This is how the builtin help() works.
4997 buffer itself. This is how the builtin help() works.
4997
4998
4998 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4999 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4999 macro scoping: macros need to be executed in the user's namespace
5000 macro scoping: macros need to be executed in the user's namespace
5000 to work as if they had been typed by the user.
5001 to work as if they had been typed by the user.
5001
5002
5002 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5003 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5003 execute automatically (no need to type 'exec...'). They then
5004 execute automatically (no need to type 'exec...'). They then
5004 behave like 'true macros'. The printing system was also modified
5005 behave like 'true macros'. The printing system was also modified
5005 for this to work.
5006 for this to work.
5006
5007
5007 2002-02-19 Fernando Perez <fperez@colorado.edu>
5008 2002-02-19 Fernando Perez <fperez@colorado.edu>
5008
5009
5009 * IPython/genutils.py (page_file): new function for paging files
5010 * IPython/genutils.py (page_file): new function for paging files
5010 in an OS-independent way. Also necessary for file viewing to work
5011 in an OS-independent way. Also necessary for file viewing to work
5011 well inside Emacs buffers.
5012 well inside Emacs buffers.
5012 (page): Added checks for being in an emacs buffer.
5013 (page): Added checks for being in an emacs buffer.
5013 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5014 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5014 same bug in iplib.
5015 same bug in iplib.
5015
5016
5016 2002-02-18 Fernando Perez <fperez@colorado.edu>
5017 2002-02-18 Fernando Perez <fperez@colorado.edu>
5017
5018
5018 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5019 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5019 of readline so that IPython can work inside an Emacs buffer.
5020 of readline so that IPython can work inside an Emacs buffer.
5020
5021
5021 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5022 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5022 method signatures (they weren't really bugs, but it looks cleaner
5023 method signatures (they weren't really bugs, but it looks cleaner
5023 and keeps PyChecker happy).
5024 and keeps PyChecker happy).
5024
5025
5025 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5026 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5026 for implementing various user-defined hooks. Currently only
5027 for implementing various user-defined hooks. Currently only
5027 display is done.
5028 display is done.
5028
5029
5029 * IPython/Prompts.py (CachedOutput._display): changed display
5030 * IPython/Prompts.py (CachedOutput._display): changed display
5030 functions so that they can be dynamically changed by users easily.
5031 functions so that they can be dynamically changed by users easily.
5031
5032
5032 * IPython/Extensions/numeric_formats.py (num_display): added an
5033 * IPython/Extensions/numeric_formats.py (num_display): added an
5033 extension for printing NumPy arrays in flexible manners. It
5034 extension for printing NumPy arrays in flexible manners. It
5034 doesn't do anything yet, but all the structure is in
5035 doesn't do anything yet, but all the structure is in
5035 place. Ultimately the plan is to implement output format control
5036 place. Ultimately the plan is to implement output format control
5036 like in Octave.
5037 like in Octave.
5037
5038
5038 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5039 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5039 methods are found at run-time by all the automatic machinery.
5040 methods are found at run-time by all the automatic machinery.
5040
5041
5041 2002-02-17 Fernando Perez <fperez@colorado.edu>
5042 2002-02-17 Fernando Perez <fperez@colorado.edu>
5042
5043
5043 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5044 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5044 whole file a little.
5045 whole file a little.
5045
5046
5046 * ToDo: closed this document. Now there's a new_design.lyx
5047 * ToDo: closed this document. Now there's a new_design.lyx
5047 document for all new ideas. Added making a pdf of it for the
5048 document for all new ideas. Added making a pdf of it for the
5048 end-user distro.
5049 end-user distro.
5049
5050
5050 * IPython/Logger.py (Logger.switch_log): Created this to replace
5051 * IPython/Logger.py (Logger.switch_log): Created this to replace
5051 logon() and logoff(). It also fixes a nasty crash reported by
5052 logon() and logoff(). It also fixes a nasty crash reported by
5052 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5053 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5053
5054
5054 * IPython/iplib.py (complete): got auto-completion to work with
5055 * IPython/iplib.py (complete): got auto-completion to work with
5055 automagic (I had wanted this for a long time).
5056 automagic (I had wanted this for a long time).
5056
5057
5057 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5058 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5058 to @file, since file() is now a builtin and clashes with automagic
5059 to @file, since file() is now a builtin and clashes with automagic
5059 for @file.
5060 for @file.
5060
5061
5061 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5062 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5062 of this was previously in iplib, which had grown to more than 2000
5063 of this was previously in iplib, which had grown to more than 2000
5063 lines, way too long. No new functionality, but it makes managing
5064 lines, way too long. No new functionality, but it makes managing
5064 the code a bit easier.
5065 the code a bit easier.
5065
5066
5066 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5067 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5067 information to crash reports.
5068 information to crash reports.
5068
5069
5069 2002-02-12 Fernando Perez <fperez@colorado.edu>
5070 2002-02-12 Fernando Perez <fperez@colorado.edu>
5070
5071
5071 * Released 0.2.5.
5072 * Released 0.2.5.
5072
5073
5073 2002-02-11 Fernando Perez <fperez@colorado.edu>
5074 2002-02-11 Fernando Perez <fperez@colorado.edu>
5074
5075
5075 * Wrote a relatively complete Windows installer. It puts
5076 * Wrote a relatively complete Windows installer. It puts
5076 everything in place, creates Start Menu entries and fixes the
5077 everything in place, creates Start Menu entries and fixes the
5077 color issues. Nothing fancy, but it works.
5078 color issues. Nothing fancy, but it works.
5078
5079
5079 2002-02-10 Fernando Perez <fperez@colorado.edu>
5080 2002-02-10 Fernando Perez <fperez@colorado.edu>
5080
5081
5081 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5082 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5082 os.path.expanduser() call so that we can type @run ~/myfile.py and
5083 os.path.expanduser() call so that we can type @run ~/myfile.py and
5083 have thigs work as expected.
5084 have thigs work as expected.
5084
5085
5085 * IPython/genutils.py (page): fixed exception handling so things
5086 * IPython/genutils.py (page): fixed exception handling so things
5086 work both in Unix and Windows correctly. Quitting a pager triggers
5087 work both in Unix and Windows correctly. Quitting a pager triggers
5087 an IOError/broken pipe in Unix, and in windows not finding a pager
5088 an IOError/broken pipe in Unix, and in windows not finding a pager
5088 is also an IOError, so I had to actually look at the return value
5089 is also an IOError, so I had to actually look at the return value
5089 of the exception, not just the exception itself. Should be ok now.
5090 of the exception, not just the exception itself. Should be ok now.
5090
5091
5091 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5092 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5092 modified to allow case-insensitive color scheme changes.
5093 modified to allow case-insensitive color scheme changes.
5093
5094
5094 2002-02-09 Fernando Perez <fperez@colorado.edu>
5095 2002-02-09 Fernando Perez <fperez@colorado.edu>
5095
5096
5096 * IPython/genutils.py (native_line_ends): new function to leave
5097 * IPython/genutils.py (native_line_ends): new function to leave
5097 user config files with os-native line-endings.
5098 user config files with os-native line-endings.
5098
5099
5099 * README and manual updates.
5100 * README and manual updates.
5100
5101
5101 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5102 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5102 instead of StringType to catch Unicode strings.
5103 instead of StringType to catch Unicode strings.
5103
5104
5104 * IPython/genutils.py (filefind): fixed bug for paths with
5105 * IPython/genutils.py (filefind): fixed bug for paths with
5105 embedded spaces (very common in Windows).
5106 embedded spaces (very common in Windows).
5106
5107
5107 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5108 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5108 files under Windows, so that they get automatically associated
5109 files under Windows, so that they get automatically associated
5109 with a text editor. Windows makes it a pain to handle
5110 with a text editor. Windows makes it a pain to handle
5110 extension-less files.
5111 extension-less files.
5111
5112
5112 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5113 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5113 warning about readline only occur for Posix. In Windows there's no
5114 warning about readline only occur for Posix. In Windows there's no
5114 way to get readline, so why bother with the warning.
5115 way to get readline, so why bother with the warning.
5115
5116
5116 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5117 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5117 for __str__ instead of dir(self), since dir() changed in 2.2.
5118 for __str__ instead of dir(self), since dir() changed in 2.2.
5118
5119
5119 * Ported to Windows! Tested on XP, I suspect it should work fine
5120 * Ported to Windows! Tested on XP, I suspect it should work fine
5120 on NT/2000, but I don't think it will work on 98 et al. That
5121 on NT/2000, but I don't think it will work on 98 et al. That
5121 series of Windows is such a piece of junk anyway that I won't try
5122 series of Windows is such a piece of junk anyway that I won't try
5122 porting it there. The XP port was straightforward, showed a few
5123 porting it there. The XP port was straightforward, showed a few
5123 bugs here and there (fixed all), in particular some string
5124 bugs here and there (fixed all), in particular some string
5124 handling stuff which required considering Unicode strings (which
5125 handling stuff which required considering Unicode strings (which
5125 Windows uses). This is good, but hasn't been too tested :) No
5126 Windows uses). This is good, but hasn't been too tested :) No
5126 fancy installer yet, I'll put a note in the manual so people at
5127 fancy installer yet, I'll put a note in the manual so people at
5127 least make manually a shortcut.
5128 least make manually a shortcut.
5128
5129
5129 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5130 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5130 into a single one, "colors". This now controls both prompt and
5131 into a single one, "colors". This now controls both prompt and
5131 exception color schemes, and can be changed both at startup
5132 exception color schemes, and can be changed both at startup
5132 (either via command-line switches or via ipythonrc files) and at
5133 (either via command-line switches or via ipythonrc files) and at
5133 runtime, with @colors.
5134 runtime, with @colors.
5134 (Magic.magic_run): renamed @prun to @run and removed the old
5135 (Magic.magic_run): renamed @prun to @run and removed the old
5135 @run. The two were too similar to warrant keeping both.
5136 @run. The two were too similar to warrant keeping both.
5136
5137
5137 2002-02-03 Fernando Perez <fperez@colorado.edu>
5138 2002-02-03 Fernando Perez <fperez@colorado.edu>
5138
5139
5139 * IPython/iplib.py (install_first_time): Added comment on how to
5140 * IPython/iplib.py (install_first_time): Added comment on how to
5140 configure the color options for first-time users. Put a <return>
5141 configure the color options for first-time users. Put a <return>
5141 request at the end so that small-terminal users get a chance to
5142 request at the end so that small-terminal users get a chance to
5142 read the startup info.
5143 read the startup info.
5143
5144
5144 2002-01-23 Fernando Perez <fperez@colorado.edu>
5145 2002-01-23 Fernando Perez <fperez@colorado.edu>
5145
5146
5146 * IPython/iplib.py (CachedOutput.update): Changed output memory
5147 * IPython/iplib.py (CachedOutput.update): Changed output memory
5147 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5148 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5148 input history we still use _i. Did this b/c these variable are
5149 input history we still use _i. Did this b/c these variable are
5149 very commonly used in interactive work, so the less we need to
5150 very commonly used in interactive work, so the less we need to
5150 type the better off we are.
5151 type the better off we are.
5151 (Magic.magic_prun): updated @prun to better handle the namespaces
5152 (Magic.magic_prun): updated @prun to better handle the namespaces
5152 the file will run in, including a fix for __name__ not being set
5153 the file will run in, including a fix for __name__ not being set
5153 before.
5154 before.
5154
5155
5155 2002-01-20 Fernando Perez <fperez@colorado.edu>
5156 2002-01-20 Fernando Perez <fperez@colorado.edu>
5156
5157
5157 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5158 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5158 extra garbage for Python 2.2. Need to look more carefully into
5159 extra garbage for Python 2.2. Need to look more carefully into
5159 this later.
5160 this later.
5160
5161
5161 2002-01-19 Fernando Perez <fperez@colorado.edu>
5162 2002-01-19 Fernando Perez <fperez@colorado.edu>
5162
5163
5163 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5164 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5164 display SyntaxError exceptions properly formatted when they occur
5165 display SyntaxError exceptions properly formatted when they occur
5165 (they can be triggered by imported code).
5166 (they can be triggered by imported code).
5166
5167
5167 2002-01-18 Fernando Perez <fperez@colorado.edu>
5168 2002-01-18 Fernando Perez <fperez@colorado.edu>
5168
5169
5169 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5170 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5170 SyntaxError exceptions are reported nicely formatted, instead of
5171 SyntaxError exceptions are reported nicely formatted, instead of
5171 spitting out only offset information as before.
5172 spitting out only offset information as before.
5172 (Magic.magic_prun): Added the @prun function for executing
5173 (Magic.magic_prun): Added the @prun function for executing
5173 programs with command line args inside IPython.
5174 programs with command line args inside IPython.
5174
5175
5175 2002-01-16 Fernando Perez <fperez@colorado.edu>
5176 2002-01-16 Fernando Perez <fperez@colorado.edu>
5176
5177
5177 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5178 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5178 to *not* include the last item given in a range. This brings their
5179 to *not* include the last item given in a range. This brings their
5179 behavior in line with Python's slicing:
5180 behavior in line with Python's slicing:
5180 a[n1:n2] -> a[n1]...a[n2-1]
5181 a[n1:n2] -> a[n1]...a[n2-1]
5181 It may be a bit less convenient, but I prefer to stick to Python's
5182 It may be a bit less convenient, but I prefer to stick to Python's
5182 conventions *everywhere*, so users never have to wonder.
5183 conventions *everywhere*, so users never have to wonder.
5183 (Magic.magic_macro): Added @macro function to ease the creation of
5184 (Magic.magic_macro): Added @macro function to ease the creation of
5184 macros.
5185 macros.
5185
5186
5186 2002-01-05 Fernando Perez <fperez@colorado.edu>
5187 2002-01-05 Fernando Perez <fperez@colorado.edu>
5187
5188
5188 * Released 0.2.4.
5189 * Released 0.2.4.
5189
5190
5190 * IPython/iplib.py (Magic.magic_pdef):
5191 * IPython/iplib.py (Magic.magic_pdef):
5191 (InteractiveShell.safe_execfile): report magic lines and error
5192 (InteractiveShell.safe_execfile): report magic lines and error
5192 lines without line numbers so one can easily copy/paste them for
5193 lines without line numbers so one can easily copy/paste them for
5193 re-execution.
5194 re-execution.
5194
5195
5195 * Updated manual with recent changes.
5196 * Updated manual with recent changes.
5196
5197
5197 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5198 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5198 docstring printing when class? is called. Very handy for knowing
5199 docstring printing when class? is called. Very handy for knowing
5199 how to create class instances (as long as __init__ is well
5200 how to create class instances (as long as __init__ is well
5200 documented, of course :)
5201 documented, of course :)
5201 (Magic.magic_doc): print both class and constructor docstrings.
5202 (Magic.magic_doc): print both class and constructor docstrings.
5202 (Magic.magic_pdef): give constructor info if passed a class and
5203 (Magic.magic_pdef): give constructor info if passed a class and
5203 __call__ info for callable object instances.
5204 __call__ info for callable object instances.
5204
5205
5205 2002-01-04 Fernando Perez <fperez@colorado.edu>
5206 2002-01-04 Fernando Perez <fperez@colorado.edu>
5206
5207
5207 * Made deep_reload() off by default. It doesn't always work
5208 * Made deep_reload() off by default. It doesn't always work
5208 exactly as intended, so it's probably safer to have it off. It's
5209 exactly as intended, so it's probably safer to have it off. It's
5209 still available as dreload() anyway, so nothing is lost.
5210 still available as dreload() anyway, so nothing is lost.
5210
5211
5211 2002-01-02 Fernando Perez <fperez@colorado.edu>
5212 2002-01-02 Fernando Perez <fperez@colorado.edu>
5212
5213
5213 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5214 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5214 so I wanted an updated release).
5215 so I wanted an updated release).
5215
5216
5216 2001-12-27 Fernando Perez <fperez@colorado.edu>
5217 2001-12-27 Fernando Perez <fperez@colorado.edu>
5217
5218
5218 * IPython/iplib.py (InteractiveShell.interact): Added the original
5219 * IPython/iplib.py (InteractiveShell.interact): Added the original
5219 code from 'code.py' for this module in order to change the
5220 code from 'code.py' for this module in order to change the
5220 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5221 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5221 the history cache would break when the user hit Ctrl-C, and
5222 the history cache would break when the user hit Ctrl-C, and
5222 interact() offers no way to add any hooks to it.
5223 interact() offers no way to add any hooks to it.
5223
5224
5224 2001-12-23 Fernando Perez <fperez@colorado.edu>
5225 2001-12-23 Fernando Perez <fperez@colorado.edu>
5225
5226
5226 * setup.py: added check for 'MANIFEST' before trying to remove
5227 * setup.py: added check for 'MANIFEST' before trying to remove
5227 it. Thanks to Sean Reifschneider.
5228 it. Thanks to Sean Reifschneider.
5228
5229
5229 2001-12-22 Fernando Perez <fperez@colorado.edu>
5230 2001-12-22 Fernando Perez <fperez@colorado.edu>
5230
5231
5231 * Released 0.2.2.
5232 * Released 0.2.2.
5232
5233
5233 * Finished (reasonably) writing the manual. Later will add the
5234 * Finished (reasonably) writing the manual. Later will add the
5234 python-standard navigation stylesheets, but for the time being
5235 python-standard navigation stylesheets, but for the time being
5235 it's fairly complete. Distribution will include html and pdf
5236 it's fairly complete. Distribution will include html and pdf
5236 versions.
5237 versions.
5237
5238
5238 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5239 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5239 (MayaVi author).
5240 (MayaVi author).
5240
5241
5241 2001-12-21 Fernando Perez <fperez@colorado.edu>
5242 2001-12-21 Fernando Perez <fperez@colorado.edu>
5242
5243
5243 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5244 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5244 good public release, I think (with the manual and the distutils
5245 good public release, I think (with the manual and the distutils
5245 installer). The manual can use some work, but that can go
5246 installer). The manual can use some work, but that can go
5246 slowly. Otherwise I think it's quite nice for end users. Next
5247 slowly. Otherwise I think it's quite nice for end users. Next
5247 summer, rewrite the guts of it...
5248 summer, rewrite the guts of it...
5248
5249
5249 * Changed format of ipythonrc files to use whitespace as the
5250 * Changed format of ipythonrc files to use whitespace as the
5250 separator instead of an explicit '='. Cleaner.
5251 separator instead of an explicit '='. Cleaner.
5251
5252
5252 2001-12-20 Fernando Perez <fperez@colorado.edu>
5253 2001-12-20 Fernando Perez <fperez@colorado.edu>
5253
5254
5254 * Started a manual in LyX. For now it's just a quick merge of the
5255 * Started a manual in LyX. For now it's just a quick merge of the
5255 various internal docstrings and READMEs. Later it may grow into a
5256 various internal docstrings and READMEs. Later it may grow into a
5256 nice, full-blown manual.
5257 nice, full-blown manual.
5257
5258
5258 * Set up a distutils based installer. Installation should now be
5259 * Set up a distutils based installer. Installation should now be
5259 trivially simple for end-users.
5260 trivially simple for end-users.
5260
5261
5261 2001-12-11 Fernando Perez <fperez@colorado.edu>
5262 2001-12-11 Fernando Perez <fperez@colorado.edu>
5262
5263
5263 * Released 0.2.0. First public release, announced it at
5264 * Released 0.2.0. First public release, announced it at
5264 comp.lang.python. From now on, just bugfixes...
5265 comp.lang.python. From now on, just bugfixes...
5265
5266
5266 * Went through all the files, set copyright/license notices and
5267 * Went through all the files, set copyright/license notices and
5267 cleaned up things. Ready for release.
5268 cleaned up things. Ready for release.
5268
5269
5269 2001-12-10 Fernando Perez <fperez@colorado.edu>
5270 2001-12-10 Fernando Perez <fperez@colorado.edu>
5270
5271
5271 * Changed the first-time installer not to use tarfiles. It's more
5272 * Changed the first-time installer not to use tarfiles. It's more
5272 robust now and less unix-dependent. Also makes it easier for
5273 robust now and less unix-dependent. Also makes it easier for
5273 people to later upgrade versions.
5274 people to later upgrade versions.
5274
5275
5275 * Changed @exit to @abort to reflect the fact that it's pretty
5276 * Changed @exit to @abort to reflect the fact that it's pretty
5276 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5277 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5277 becomes significant only when IPyhton is embedded: in that case,
5278 becomes significant only when IPyhton is embedded: in that case,
5278 C-D closes IPython only, but @abort kills the enclosing program
5279 C-D closes IPython only, but @abort kills the enclosing program
5279 too (unless it had called IPython inside a try catching
5280 too (unless it had called IPython inside a try catching
5280 SystemExit).
5281 SystemExit).
5281
5282
5282 * Created Shell module which exposes the actuall IPython Shell
5283 * Created Shell module which exposes the actuall IPython Shell
5283 classes, currently the normal and the embeddable one. This at
5284 classes, currently the normal and the embeddable one. This at
5284 least offers a stable interface we won't need to change when
5285 least offers a stable interface we won't need to change when
5285 (later) the internals are rewritten. That rewrite will be confined
5286 (later) the internals are rewritten. That rewrite will be confined
5286 to iplib and ipmaker, but the Shell interface should remain as is.
5287 to iplib and ipmaker, but the Shell interface should remain as is.
5287
5288
5288 * Added embed module which offers an embeddable IPShell object,
5289 * Added embed module which offers an embeddable IPShell object,
5289 useful to fire up IPython *inside* a running program. Great for
5290 useful to fire up IPython *inside* a running program. Great for
5290 debugging or dynamical data analysis.
5291 debugging or dynamical data analysis.
5291
5292
5292 2001-12-08 Fernando Perez <fperez@colorado.edu>
5293 2001-12-08 Fernando Perez <fperez@colorado.edu>
5293
5294
5294 * Fixed small bug preventing seeing info from methods of defined
5295 * Fixed small bug preventing seeing info from methods of defined
5295 objects (incorrect namespace in _ofind()).
5296 objects (incorrect namespace in _ofind()).
5296
5297
5297 * Documentation cleanup. Moved the main usage docstrings to a
5298 * Documentation cleanup. Moved the main usage docstrings to a
5298 separate file, usage.py (cleaner to maintain, and hopefully in the
5299 separate file, usage.py (cleaner to maintain, and hopefully in the
5299 future some perlpod-like way of producing interactive, man and
5300 future some perlpod-like way of producing interactive, man and
5300 html docs out of it will be found).
5301 html docs out of it will be found).
5301
5302
5302 * Added @profile to see your profile at any time.
5303 * Added @profile to see your profile at any time.
5303
5304
5304 * Added @p as an alias for 'print'. It's especially convenient if
5305 * Added @p as an alias for 'print'. It's especially convenient if
5305 using automagic ('p x' prints x).
5306 using automagic ('p x' prints x).
5306
5307
5307 * Small cleanups and fixes after a pychecker run.
5308 * Small cleanups and fixes after a pychecker run.
5308
5309
5309 * Changed the @cd command to handle @cd - and @cd -<n> for
5310 * Changed the @cd command to handle @cd - and @cd -<n> for
5310 visiting any directory in _dh.
5311 visiting any directory in _dh.
5311
5312
5312 * Introduced _dh, a history of visited directories. @dhist prints
5313 * Introduced _dh, a history of visited directories. @dhist prints
5313 it out with numbers.
5314 it out with numbers.
5314
5315
5315 2001-12-07 Fernando Perez <fperez@colorado.edu>
5316 2001-12-07 Fernando Perez <fperez@colorado.edu>
5316
5317
5317 * Released 0.1.22
5318 * Released 0.1.22
5318
5319
5319 * Made initialization a bit more robust against invalid color
5320 * Made initialization a bit more robust against invalid color
5320 options in user input (exit, not traceback-crash).
5321 options in user input (exit, not traceback-crash).
5321
5322
5322 * Changed the bug crash reporter to write the report only in the
5323 * Changed the bug crash reporter to write the report only in the
5323 user's .ipython directory. That way IPython won't litter people's
5324 user's .ipython directory. That way IPython won't litter people's
5324 hard disks with crash files all over the place. Also print on
5325 hard disks with crash files all over the place. Also print on
5325 screen the necessary mail command.
5326 screen the necessary mail command.
5326
5327
5327 * With the new ultraTB, implemented LightBG color scheme for light
5328 * With the new ultraTB, implemented LightBG color scheme for light
5328 background terminals. A lot of people like white backgrounds, so I
5329 background terminals. A lot of people like white backgrounds, so I
5329 guess we should at least give them something readable.
5330 guess we should at least give them something readable.
5330
5331
5331 2001-12-06 Fernando Perez <fperez@colorado.edu>
5332 2001-12-06 Fernando Perez <fperez@colorado.edu>
5332
5333
5333 * Modified the structure of ultraTB. Now there's a proper class
5334 * Modified the structure of ultraTB. Now there's a proper class
5334 for tables of color schemes which allow adding schemes easily and
5335 for tables of color schemes which allow adding schemes easily and
5335 switching the active scheme without creating a new instance every
5336 switching the active scheme without creating a new instance every
5336 time (which was ridiculous). The syntax for creating new schemes
5337 time (which was ridiculous). The syntax for creating new schemes
5337 is also cleaner. I think ultraTB is finally done, with a clean
5338 is also cleaner. I think ultraTB is finally done, with a clean
5338 class structure. Names are also much cleaner (now there's proper
5339 class structure. Names are also much cleaner (now there's proper
5339 color tables, no need for every variable to also have 'color' in
5340 color tables, no need for every variable to also have 'color' in
5340 its name).
5341 its name).
5341
5342
5342 * Broke down genutils into separate files. Now genutils only
5343 * Broke down genutils into separate files. Now genutils only
5343 contains utility functions, and classes have been moved to their
5344 contains utility functions, and classes have been moved to their
5344 own files (they had enough independent functionality to warrant
5345 own files (they had enough independent functionality to warrant
5345 it): ConfigLoader, OutputTrap, Struct.
5346 it): ConfigLoader, OutputTrap, Struct.
5346
5347
5347 2001-12-05 Fernando Perez <fperez@colorado.edu>
5348 2001-12-05 Fernando Perez <fperez@colorado.edu>
5348
5349
5349 * IPython turns 21! Released version 0.1.21, as a candidate for
5350 * IPython turns 21! Released version 0.1.21, as a candidate for
5350 public consumption. If all goes well, release in a few days.
5351 public consumption. If all goes well, release in a few days.
5351
5352
5352 * Fixed path bug (files in Extensions/ directory wouldn't be found
5353 * Fixed path bug (files in Extensions/ directory wouldn't be found
5353 unless IPython/ was explicitly in sys.path).
5354 unless IPython/ was explicitly in sys.path).
5354
5355
5355 * Extended the FlexCompleter class as MagicCompleter to allow
5356 * Extended the FlexCompleter class as MagicCompleter to allow
5356 completion of @-starting lines.
5357 completion of @-starting lines.
5357
5358
5358 * Created __release__.py file as a central repository for release
5359 * Created __release__.py file as a central repository for release
5359 info that other files can read from.
5360 info that other files can read from.
5360
5361
5361 * Fixed small bug in logging: when logging was turned on in
5362 * Fixed small bug in logging: when logging was turned on in
5362 mid-session, old lines with special meanings (!@?) were being
5363 mid-session, old lines with special meanings (!@?) were being
5363 logged without the prepended comment, which is necessary since
5364 logged without the prepended comment, which is necessary since
5364 they are not truly valid python syntax. This should make session
5365 they are not truly valid python syntax. This should make session
5365 restores produce less errors.
5366 restores produce less errors.
5366
5367
5367 * The namespace cleanup forced me to make a FlexCompleter class
5368 * The namespace cleanup forced me to make a FlexCompleter class
5368 which is nothing but a ripoff of rlcompleter, but with selectable
5369 which is nothing but a ripoff of rlcompleter, but with selectable
5369 namespace (rlcompleter only works in __main__.__dict__). I'll try
5370 namespace (rlcompleter only works in __main__.__dict__). I'll try
5370 to submit a note to the authors to see if this change can be
5371 to submit a note to the authors to see if this change can be
5371 incorporated in future rlcompleter releases (Dec.6: done)
5372 incorporated in future rlcompleter releases (Dec.6: done)
5372
5373
5373 * More fixes to namespace handling. It was a mess! Now all
5374 * More fixes to namespace handling. It was a mess! Now all
5374 explicit references to __main__.__dict__ are gone (except when
5375 explicit references to __main__.__dict__ are gone (except when
5375 really needed) and everything is handled through the namespace
5376 really needed) and everything is handled through the namespace
5376 dicts in the IPython instance. We seem to be getting somewhere
5377 dicts in the IPython instance. We seem to be getting somewhere
5377 with this, finally...
5378 with this, finally...
5378
5379
5379 * Small documentation updates.
5380 * Small documentation updates.
5380
5381
5381 * Created the Extensions directory under IPython (with an
5382 * Created the Extensions directory under IPython (with an
5382 __init__.py). Put the PhysicalQ stuff there. This directory should
5383 __init__.py). Put the PhysicalQ stuff there. This directory should
5383 be used for all special-purpose extensions.
5384 be used for all special-purpose extensions.
5384
5385
5385 * File renaming:
5386 * File renaming:
5386 ipythonlib --> ipmaker
5387 ipythonlib --> ipmaker
5387 ipplib --> iplib
5388 ipplib --> iplib
5388 This makes a bit more sense in terms of what these files actually do.
5389 This makes a bit more sense in terms of what these files actually do.
5389
5390
5390 * Moved all the classes and functions in ipythonlib to ipplib, so
5391 * Moved all the classes and functions in ipythonlib to ipplib, so
5391 now ipythonlib only has make_IPython(). This will ease up its
5392 now ipythonlib only has make_IPython(). This will ease up its
5392 splitting in smaller functional chunks later.
5393 splitting in smaller functional chunks later.
5393
5394
5394 * Cleaned up (done, I think) output of @whos. Better column
5395 * Cleaned up (done, I think) output of @whos. Better column
5395 formatting, and now shows str(var) for as much as it can, which is
5396 formatting, and now shows str(var) for as much as it can, which is
5396 typically what one gets with a 'print var'.
5397 typically what one gets with a 'print var'.
5397
5398
5398 2001-12-04 Fernando Perez <fperez@colorado.edu>
5399 2001-12-04 Fernando Perez <fperez@colorado.edu>
5399
5400
5400 * Fixed namespace problems. Now builtin/IPyhton/user names get
5401 * Fixed namespace problems. Now builtin/IPyhton/user names get
5401 properly reported in their namespace. Internal namespace handling
5402 properly reported in their namespace. Internal namespace handling
5402 is finally getting decent (not perfect yet, but much better than
5403 is finally getting decent (not perfect yet, but much better than
5403 the ad-hoc mess we had).
5404 the ad-hoc mess we had).
5404
5405
5405 * Removed -exit option. If people just want to run a python
5406 * Removed -exit option. If people just want to run a python
5406 script, that's what the normal interpreter is for. Less
5407 script, that's what the normal interpreter is for. Less
5407 unnecessary options, less chances for bugs.
5408 unnecessary options, less chances for bugs.
5408
5409
5409 * Added a crash handler which generates a complete post-mortem if
5410 * Added a crash handler which generates a complete post-mortem if
5410 IPython crashes. This will help a lot in tracking bugs down the
5411 IPython crashes. This will help a lot in tracking bugs down the
5411 road.
5412 road.
5412
5413
5413 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5414 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5414 which were boud to functions being reassigned would bypass the
5415 which were boud to functions being reassigned would bypass the
5415 logger, breaking the sync of _il with the prompt counter. This
5416 logger, breaking the sync of _il with the prompt counter. This
5416 would then crash IPython later when a new line was logged.
5417 would then crash IPython later when a new line was logged.
5417
5418
5418 2001-12-02 Fernando Perez <fperez@colorado.edu>
5419 2001-12-02 Fernando Perez <fperez@colorado.edu>
5419
5420
5420 * Made IPython a package. This means people don't have to clutter
5421 * Made IPython a package. This means people don't have to clutter
5421 their sys.path with yet another directory. Changed the INSTALL
5422 their sys.path with yet another directory. Changed the INSTALL
5422 file accordingly.
5423 file accordingly.
5423
5424
5424 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5425 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5425 sorts its output (so @who shows it sorted) and @whos formats the
5426 sorts its output (so @who shows it sorted) and @whos formats the
5426 table according to the width of the first column. Nicer, easier to
5427 table according to the width of the first column. Nicer, easier to
5427 read. Todo: write a generic table_format() which takes a list of
5428 read. Todo: write a generic table_format() which takes a list of
5428 lists and prints it nicely formatted, with optional row/column
5429 lists and prints it nicely formatted, with optional row/column
5429 separators and proper padding and justification.
5430 separators and proper padding and justification.
5430
5431
5431 * Released 0.1.20
5432 * Released 0.1.20
5432
5433
5433 * Fixed bug in @log which would reverse the inputcache list (a
5434 * Fixed bug in @log which would reverse the inputcache list (a
5434 copy operation was missing).
5435 copy operation was missing).
5435
5436
5436 * Code cleanup. @config was changed to use page(). Better, since
5437 * Code cleanup. @config was changed to use page(). Better, since
5437 its output is always quite long.
5438 its output is always quite long.
5438
5439
5439 * Itpl is back as a dependency. I was having too many problems
5440 * Itpl is back as a dependency. I was having too many problems
5440 getting the parametric aliases to work reliably, and it's just
5441 getting the parametric aliases to work reliably, and it's just
5441 easier to code weird string operations with it than playing %()s
5442 easier to code weird string operations with it than playing %()s
5442 games. It's only ~6k, so I don't think it's too big a deal.
5443 games. It's only ~6k, so I don't think it's too big a deal.
5443
5444
5444 * Found (and fixed) a very nasty bug with history. !lines weren't
5445 * Found (and fixed) a very nasty bug with history. !lines weren't
5445 getting cached, and the out of sync caches would crash
5446 getting cached, and the out of sync caches would crash
5446 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5447 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5447 division of labor a bit better. Bug fixed, cleaner structure.
5448 division of labor a bit better. Bug fixed, cleaner structure.
5448
5449
5449 2001-12-01 Fernando Perez <fperez@colorado.edu>
5450 2001-12-01 Fernando Perez <fperez@colorado.edu>
5450
5451
5451 * Released 0.1.19
5452 * Released 0.1.19
5452
5453
5453 * Added option -n to @hist to prevent line number printing. Much
5454 * Added option -n to @hist to prevent line number printing. Much
5454 easier to copy/paste code this way.
5455 easier to copy/paste code this way.
5455
5456
5456 * Created global _il to hold the input list. Allows easy
5457 * Created global _il to hold the input list. Allows easy
5457 re-execution of blocks of code by slicing it (inspired by Janko's
5458 re-execution of blocks of code by slicing it (inspired by Janko's
5458 comment on 'macros').
5459 comment on 'macros').
5459
5460
5460 * Small fixes and doc updates.
5461 * Small fixes and doc updates.
5461
5462
5462 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5463 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5463 much too fragile with automagic. Handles properly multi-line
5464 much too fragile with automagic. Handles properly multi-line
5464 statements and takes parameters.
5465 statements and takes parameters.
5465
5466
5466 2001-11-30 Fernando Perez <fperez@colorado.edu>
5467 2001-11-30 Fernando Perez <fperez@colorado.edu>
5467
5468
5468 * Version 0.1.18 released.
5469 * Version 0.1.18 released.
5469
5470
5470 * Fixed nasty namespace bug in initial module imports.
5471 * Fixed nasty namespace bug in initial module imports.
5471
5472
5472 * Added copyright/license notes to all code files (except
5473 * Added copyright/license notes to all code files (except
5473 DPyGetOpt). For the time being, LGPL. That could change.
5474 DPyGetOpt). For the time being, LGPL. That could change.
5474
5475
5475 * Rewrote a much nicer README, updated INSTALL, cleaned up
5476 * Rewrote a much nicer README, updated INSTALL, cleaned up
5476 ipythonrc-* samples.
5477 ipythonrc-* samples.
5477
5478
5478 * Overall code/documentation cleanup. Basically ready for
5479 * Overall code/documentation cleanup. Basically ready for
5479 release. Only remaining thing: licence decision (LGPL?).
5480 release. Only remaining thing: licence decision (LGPL?).
5480
5481
5481 * Converted load_config to a class, ConfigLoader. Now recursion
5482 * Converted load_config to a class, ConfigLoader. Now recursion
5482 control is better organized. Doesn't include the same file twice.
5483 control is better organized. Doesn't include the same file twice.
5483
5484
5484 2001-11-29 Fernando Perez <fperez@colorado.edu>
5485 2001-11-29 Fernando Perez <fperez@colorado.edu>
5485
5486
5486 * Got input history working. Changed output history variables from
5487 * Got input history working. Changed output history variables from
5487 _p to _o so that _i is for input and _o for output. Just cleaner
5488 _p to _o so that _i is for input and _o for output. Just cleaner
5488 convention.
5489 convention.
5489
5490
5490 * Implemented parametric aliases. This pretty much allows the
5491 * Implemented parametric aliases. This pretty much allows the
5491 alias system to offer full-blown shell convenience, I think.
5492 alias system to offer full-blown shell convenience, I think.
5492
5493
5493 * Version 0.1.17 released, 0.1.18 opened.
5494 * Version 0.1.17 released, 0.1.18 opened.
5494
5495
5495 * dot_ipython/ipythonrc (alias): added documentation.
5496 * dot_ipython/ipythonrc (alias): added documentation.
5496 (xcolor): Fixed small bug (xcolors -> xcolor)
5497 (xcolor): Fixed small bug (xcolors -> xcolor)
5497
5498
5498 * Changed the alias system. Now alias is a magic command to define
5499 * Changed the alias system. Now alias is a magic command to define
5499 aliases just like the shell. Rationale: the builtin magics should
5500 aliases just like the shell. Rationale: the builtin magics should
5500 be there for things deeply connected to IPython's
5501 be there for things deeply connected to IPython's
5501 architecture. And this is a much lighter system for what I think
5502 architecture. And this is a much lighter system for what I think
5502 is the really important feature: allowing users to define quickly
5503 is the really important feature: allowing users to define quickly
5503 magics that will do shell things for them, so they can customize
5504 magics that will do shell things for them, so they can customize
5504 IPython easily to match their work habits. If someone is really
5505 IPython easily to match their work habits. If someone is really
5505 desperate to have another name for a builtin alias, they can
5506 desperate to have another name for a builtin alias, they can
5506 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5507 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5507 works.
5508 works.
5508
5509
5509 2001-11-28 Fernando Perez <fperez@colorado.edu>
5510 2001-11-28 Fernando Perez <fperez@colorado.edu>
5510
5511
5511 * Changed @file so that it opens the source file at the proper
5512 * Changed @file so that it opens the source file at the proper
5512 line. Since it uses less, if your EDITOR environment is
5513 line. Since it uses less, if your EDITOR environment is
5513 configured, typing v will immediately open your editor of choice
5514 configured, typing v will immediately open your editor of choice
5514 right at the line where the object is defined. Not as quick as
5515 right at the line where the object is defined. Not as quick as
5515 having a direct @edit command, but for all intents and purposes it
5516 having a direct @edit command, but for all intents and purposes it
5516 works. And I don't have to worry about writing @edit to deal with
5517 works. And I don't have to worry about writing @edit to deal with
5517 all the editors, less does that.
5518 all the editors, less does that.
5518
5519
5519 * Version 0.1.16 released, 0.1.17 opened.
5520 * Version 0.1.16 released, 0.1.17 opened.
5520
5521
5521 * Fixed some nasty bugs in the page/page_dumb combo that could
5522 * Fixed some nasty bugs in the page/page_dumb combo that could
5522 crash IPython.
5523 crash IPython.
5523
5524
5524 2001-11-27 Fernando Perez <fperez@colorado.edu>
5525 2001-11-27 Fernando Perez <fperez@colorado.edu>
5525
5526
5526 * Version 0.1.15 released, 0.1.16 opened.
5527 * Version 0.1.15 released, 0.1.16 opened.
5527
5528
5528 * Finally got ? and ?? to work for undefined things: now it's
5529 * Finally got ? and ?? to work for undefined things: now it's
5529 possible to type {}.get? and get information about the get method
5530 possible to type {}.get? and get information about the get method
5530 of dicts, or os.path? even if only os is defined (so technically
5531 of dicts, or os.path? even if only os is defined (so technically
5531 os.path isn't). Works at any level. For example, after import os,
5532 os.path isn't). Works at any level. For example, after import os,
5532 os?, os.path?, os.path.abspath? all work. This is great, took some
5533 os?, os.path?, os.path.abspath? all work. This is great, took some
5533 work in _ofind.
5534 work in _ofind.
5534
5535
5535 * Fixed more bugs with logging. The sanest way to do it was to add
5536 * Fixed more bugs with logging. The sanest way to do it was to add
5536 to @log a 'mode' parameter. Killed two in one shot (this mode
5537 to @log a 'mode' parameter. Killed two in one shot (this mode
5537 option was a request of Janko's). I think it's finally clean
5538 option was a request of Janko's). I think it's finally clean
5538 (famous last words).
5539 (famous last words).
5539
5540
5540 * Added a page_dumb() pager which does a decent job of paging on
5541 * Added a page_dumb() pager which does a decent job of paging on
5541 screen, if better things (like less) aren't available. One less
5542 screen, if better things (like less) aren't available. One less
5542 unix dependency (someday maybe somebody will port this to
5543 unix dependency (someday maybe somebody will port this to
5543 windows).
5544 windows).
5544
5545
5545 * Fixed problem in magic_log: would lock of logging out if log
5546 * Fixed problem in magic_log: would lock of logging out if log
5546 creation failed (because it would still think it had succeeded).
5547 creation failed (because it would still think it had succeeded).
5547
5548
5548 * Improved the page() function using curses to auto-detect screen
5549 * Improved the page() function using curses to auto-detect screen
5549 size. Now it can make a much better decision on whether to print
5550 size. Now it can make a much better decision on whether to print
5550 or page a string. Option screen_length was modified: a value 0
5551 or page a string. Option screen_length was modified: a value 0
5551 means auto-detect, and that's the default now.
5552 means auto-detect, and that's the default now.
5552
5553
5553 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5554 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5554 go out. I'll test it for a few days, then talk to Janko about
5555 go out. I'll test it for a few days, then talk to Janko about
5555 licences and announce it.
5556 licences and announce it.
5556
5557
5557 * Fixed the length of the auto-generated ---> prompt which appears
5558 * Fixed the length of the auto-generated ---> prompt which appears
5558 for auto-parens and auto-quotes. Getting this right isn't trivial,
5559 for auto-parens and auto-quotes. Getting this right isn't trivial,
5559 with all the color escapes, different prompt types and optional
5560 with all the color escapes, different prompt types and optional
5560 separators. But it seems to be working in all the combinations.
5561 separators. But it seems to be working in all the combinations.
5561
5562
5562 2001-11-26 Fernando Perez <fperez@colorado.edu>
5563 2001-11-26 Fernando Perez <fperez@colorado.edu>
5563
5564
5564 * Wrote a regexp filter to get option types from the option names
5565 * Wrote a regexp filter to get option types from the option names
5565 string. This eliminates the need to manually keep two duplicate
5566 string. This eliminates the need to manually keep two duplicate
5566 lists.
5567 lists.
5567
5568
5568 * Removed the unneeded check_option_names. Now options are handled
5569 * Removed the unneeded check_option_names. Now options are handled
5569 in a much saner manner and it's easy to visually check that things
5570 in a much saner manner and it's easy to visually check that things
5570 are ok.
5571 are ok.
5571
5572
5572 * Updated version numbers on all files I modified to carry a
5573 * Updated version numbers on all files I modified to carry a
5573 notice so Janko and Nathan have clear version markers.
5574 notice so Janko and Nathan have clear version markers.
5574
5575
5575 * Updated docstring for ultraTB with my changes. I should send
5576 * Updated docstring for ultraTB with my changes. I should send
5576 this to Nathan.
5577 this to Nathan.
5577
5578
5578 * Lots of small fixes. Ran everything through pychecker again.
5579 * Lots of small fixes. Ran everything through pychecker again.
5579
5580
5580 * Made loading of deep_reload an cmd line option. If it's not too
5581 * Made loading of deep_reload an cmd line option. If it's not too
5581 kosher, now people can just disable it. With -nodeep_reload it's
5582 kosher, now people can just disable it. With -nodeep_reload it's
5582 still available as dreload(), it just won't overwrite reload().
5583 still available as dreload(), it just won't overwrite reload().
5583
5584
5584 * Moved many options to the no| form (-opt and -noopt
5585 * Moved many options to the no| form (-opt and -noopt
5585 accepted). Cleaner.
5586 accepted). Cleaner.
5586
5587
5587 * Changed magic_log so that if called with no parameters, it uses
5588 * Changed magic_log so that if called with no parameters, it uses
5588 'rotate' mode. That way auto-generated logs aren't automatically
5589 'rotate' mode. That way auto-generated logs aren't automatically
5589 over-written. For normal logs, now a backup is made if it exists
5590 over-written. For normal logs, now a backup is made if it exists
5590 (only 1 level of backups). A new 'backup' mode was added to the
5591 (only 1 level of backups). A new 'backup' mode was added to the
5591 Logger class to support this. This was a request by Janko.
5592 Logger class to support this. This was a request by Janko.
5592
5593
5593 * Added @logoff/@logon to stop/restart an active log.
5594 * Added @logoff/@logon to stop/restart an active log.
5594
5595
5595 * Fixed a lot of bugs in log saving/replay. It was pretty
5596 * Fixed a lot of bugs in log saving/replay. It was pretty
5596 broken. Now special lines (!@,/) appear properly in the command
5597 broken. Now special lines (!@,/) appear properly in the command
5597 history after a log replay.
5598 history after a log replay.
5598
5599
5599 * Tried and failed to implement full session saving via pickle. My
5600 * Tried and failed to implement full session saving via pickle. My
5600 idea was to pickle __main__.__dict__, but modules can't be
5601 idea was to pickle __main__.__dict__, but modules can't be
5601 pickled. This would be a better alternative to replaying logs, but
5602 pickled. This would be a better alternative to replaying logs, but
5602 seems quite tricky to get to work. Changed -session to be called
5603 seems quite tricky to get to work. Changed -session to be called
5603 -logplay, which more accurately reflects what it does. And if we
5604 -logplay, which more accurately reflects what it does. And if we
5604 ever get real session saving working, -session is now available.
5605 ever get real session saving working, -session is now available.
5605
5606
5606 * Implemented color schemes for prompts also. As for tracebacks,
5607 * Implemented color schemes for prompts also. As for tracebacks,
5607 currently only NoColor and Linux are supported. But now the
5608 currently only NoColor and Linux are supported. But now the
5608 infrastructure is in place, based on a generic ColorScheme
5609 infrastructure is in place, based on a generic ColorScheme
5609 class. So writing and activating new schemes both for the prompts
5610 class. So writing and activating new schemes both for the prompts
5610 and the tracebacks should be straightforward.
5611 and the tracebacks should be straightforward.
5611
5612
5612 * Version 0.1.13 released, 0.1.14 opened.
5613 * Version 0.1.13 released, 0.1.14 opened.
5613
5614
5614 * Changed handling of options for output cache. Now counter is
5615 * Changed handling of options for output cache. Now counter is
5615 hardwired starting at 1 and one specifies the maximum number of
5616 hardwired starting at 1 and one specifies the maximum number of
5616 entries *in the outcache* (not the max prompt counter). This is
5617 entries *in the outcache* (not the max prompt counter). This is
5617 much better, since many statements won't increase the cache
5618 much better, since many statements won't increase the cache
5618 count. It also eliminated some confusing options, now there's only
5619 count. It also eliminated some confusing options, now there's only
5619 one: cache_size.
5620 one: cache_size.
5620
5621
5621 * Added 'alias' magic function and magic_alias option in the
5622 * Added 'alias' magic function and magic_alias option in the
5622 ipythonrc file. Now the user can easily define whatever names he
5623 ipythonrc file. Now the user can easily define whatever names he
5623 wants for the magic functions without having to play weird
5624 wants for the magic functions without having to play weird
5624 namespace games. This gives IPython a real shell-like feel.
5625 namespace games. This gives IPython a real shell-like feel.
5625
5626
5626 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5627 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5627 @ or not).
5628 @ or not).
5628
5629
5629 This was one of the last remaining 'visible' bugs (that I know
5630 This was one of the last remaining 'visible' bugs (that I know
5630 of). I think if I can clean up the session loading so it works
5631 of). I think if I can clean up the session loading so it works
5631 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5632 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5632 about licensing).
5633 about licensing).
5633
5634
5634 2001-11-25 Fernando Perez <fperez@colorado.edu>
5635 2001-11-25 Fernando Perez <fperez@colorado.edu>
5635
5636
5636 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5637 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5637 there's a cleaner distinction between what ? and ?? show.
5638 there's a cleaner distinction between what ? and ?? show.
5638
5639
5639 * Added screen_length option. Now the user can define his own
5640 * Added screen_length option. Now the user can define his own
5640 screen size for page() operations.
5641 screen size for page() operations.
5641
5642
5642 * Implemented magic shell-like functions with automatic code
5643 * Implemented magic shell-like functions with automatic code
5643 generation. Now adding another function is just a matter of adding
5644 generation. Now adding another function is just a matter of adding
5644 an entry to a dict, and the function is dynamically generated at
5645 an entry to a dict, and the function is dynamically generated at
5645 run-time. Python has some really cool features!
5646 run-time. Python has some really cool features!
5646
5647
5647 * Renamed many options to cleanup conventions a little. Now all
5648 * Renamed many options to cleanup conventions a little. Now all
5648 are lowercase, and only underscores where needed. Also in the code
5649 are lowercase, and only underscores where needed. Also in the code
5649 option name tables are clearer.
5650 option name tables are clearer.
5650
5651
5651 * Changed prompts a little. Now input is 'In [n]:' instead of
5652 * Changed prompts a little. Now input is 'In [n]:' instead of
5652 'In[n]:='. This allows it the numbers to be aligned with the
5653 'In[n]:='. This allows it the numbers to be aligned with the
5653 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5654 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5654 Python (it was a Mathematica thing). The '...' continuation prompt
5655 Python (it was a Mathematica thing). The '...' continuation prompt
5655 was also changed a little to align better.
5656 was also changed a little to align better.
5656
5657
5657 * Fixed bug when flushing output cache. Not all _p<n> variables
5658 * Fixed bug when flushing output cache. Not all _p<n> variables
5658 exist, so their deletion needs to be wrapped in a try:
5659 exist, so their deletion needs to be wrapped in a try:
5659
5660
5660 * Figured out how to properly use inspect.formatargspec() (it
5661 * Figured out how to properly use inspect.formatargspec() (it
5661 requires the args preceded by *). So I removed all the code from
5662 requires the args preceded by *). So I removed all the code from
5662 _get_pdef in Magic, which was just replicating that.
5663 _get_pdef in Magic, which was just replicating that.
5663
5664
5664 * Added test to prefilter to allow redefining magic function names
5665 * Added test to prefilter to allow redefining magic function names
5665 as variables. This is ok, since the @ form is always available,
5666 as variables. This is ok, since the @ form is always available,
5666 but whe should allow the user to define a variable called 'ls' if
5667 but whe should allow the user to define a variable called 'ls' if
5667 he needs it.
5668 he needs it.
5668
5669
5669 * Moved the ToDo information from README into a separate ToDo.
5670 * Moved the ToDo information from README into a separate ToDo.
5670
5671
5671 * General code cleanup and small bugfixes. I think it's close to a
5672 * General code cleanup and small bugfixes. I think it's close to a
5672 state where it can be released, obviously with a big 'beta'
5673 state where it can be released, obviously with a big 'beta'
5673 warning on it.
5674 warning on it.
5674
5675
5675 * Got the magic function split to work. Now all magics are defined
5676 * Got the magic function split to work. Now all magics are defined
5676 in a separate class. It just organizes things a bit, and now
5677 in a separate class. It just organizes things a bit, and now
5677 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5678 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5678 was too long).
5679 was too long).
5679
5680
5680 * Changed @clear to @reset to avoid potential confusions with
5681 * Changed @clear to @reset to avoid potential confusions with
5681 the shell command clear. Also renamed @cl to @clear, which does
5682 the shell command clear. Also renamed @cl to @clear, which does
5682 exactly what people expect it to from their shell experience.
5683 exactly what people expect it to from their shell experience.
5683
5684
5684 Added a check to the @reset command (since it's so
5685 Added a check to the @reset command (since it's so
5685 destructive, it's probably a good idea to ask for confirmation).
5686 destructive, it's probably a good idea to ask for confirmation).
5686 But now reset only works for full namespace resetting. Since the
5687 But now reset only works for full namespace resetting. Since the
5687 del keyword is already there for deleting a few specific
5688 del keyword is already there for deleting a few specific
5688 variables, I don't see the point of having a redundant magic
5689 variables, I don't see the point of having a redundant magic
5689 function for the same task.
5690 function for the same task.
5690
5691
5691 2001-11-24 Fernando Perez <fperez@colorado.edu>
5692 2001-11-24 Fernando Perez <fperez@colorado.edu>
5692
5693
5693 * Updated the builtin docs (esp. the ? ones).
5694 * Updated the builtin docs (esp. the ? ones).
5694
5695
5695 * Ran all the code through pychecker. Not terribly impressed with
5696 * Ran all the code through pychecker. Not terribly impressed with
5696 it: lots of spurious warnings and didn't really find anything of
5697 it: lots of spurious warnings and didn't really find anything of
5697 substance (just a few modules being imported and not used).
5698 substance (just a few modules being imported and not used).
5698
5699
5699 * Implemented the new ultraTB functionality into IPython. New
5700 * Implemented the new ultraTB functionality into IPython. New
5700 option: xcolors. This chooses color scheme. xmode now only selects
5701 option: xcolors. This chooses color scheme. xmode now only selects
5701 between Plain and Verbose. Better orthogonality.
5702 between Plain and Verbose. Better orthogonality.
5702
5703
5703 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5704 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5704 mode and color scheme for the exception handlers. Now it's
5705 mode and color scheme for the exception handlers. Now it's
5705 possible to have the verbose traceback with no coloring.
5706 possible to have the verbose traceback with no coloring.
5706
5707
5707 2001-11-23 Fernando Perez <fperez@colorado.edu>
5708 2001-11-23 Fernando Perez <fperez@colorado.edu>
5708
5709
5709 * Version 0.1.12 released, 0.1.13 opened.
5710 * Version 0.1.12 released, 0.1.13 opened.
5710
5711
5711 * Removed option to set auto-quote and auto-paren escapes by
5712 * Removed option to set auto-quote and auto-paren escapes by
5712 user. The chances of breaking valid syntax are just too high. If
5713 user. The chances of breaking valid syntax are just too high. If
5713 someone *really* wants, they can always dig into the code.
5714 someone *really* wants, they can always dig into the code.
5714
5715
5715 * Made prompt separators configurable.
5716 * Made prompt separators configurable.
5716
5717
5717 2001-11-22 Fernando Perez <fperez@colorado.edu>
5718 2001-11-22 Fernando Perez <fperez@colorado.edu>
5718
5719
5719 * Small bugfixes in many places.
5720 * Small bugfixes in many places.
5720
5721
5721 * Removed the MyCompleter class from ipplib. It seemed redundant
5722 * Removed the MyCompleter class from ipplib. It seemed redundant
5722 with the C-p,C-n history search functionality. Less code to
5723 with the C-p,C-n history search functionality. Less code to
5723 maintain.
5724 maintain.
5724
5725
5725 * Moved all the original ipython.py code into ipythonlib.py. Right
5726 * Moved all the original ipython.py code into ipythonlib.py. Right
5726 now it's just one big dump into a function called make_IPython, so
5727 now it's just one big dump into a function called make_IPython, so
5727 no real modularity has been gained. But at least it makes the
5728 no real modularity has been gained. But at least it makes the
5728 wrapper script tiny, and since ipythonlib is a module, it gets
5729 wrapper script tiny, and since ipythonlib is a module, it gets
5729 compiled and startup is much faster.
5730 compiled and startup is much faster.
5730
5731
5731 This is a reasobably 'deep' change, so we should test it for a
5732 This is a reasobably 'deep' change, so we should test it for a
5732 while without messing too much more with the code.
5733 while without messing too much more with the code.
5733
5734
5734 2001-11-21 Fernando Perez <fperez@colorado.edu>
5735 2001-11-21 Fernando Perez <fperez@colorado.edu>
5735
5736
5736 * Version 0.1.11 released, 0.1.12 opened for further work.
5737 * Version 0.1.11 released, 0.1.12 opened for further work.
5737
5738
5738 * Removed dependency on Itpl. It was only needed in one place. It
5739 * Removed dependency on Itpl. It was only needed in one place. It
5739 would be nice if this became part of python, though. It makes life
5740 would be nice if this became part of python, though. It makes life
5740 *a lot* easier in some cases.
5741 *a lot* easier in some cases.
5741
5742
5742 * Simplified the prefilter code a bit. Now all handlers are
5743 * Simplified the prefilter code a bit. Now all handlers are
5743 expected to explicitly return a value (at least a blank string).
5744 expected to explicitly return a value (at least a blank string).
5744
5745
5745 * Heavy edits in ipplib. Removed the help system altogether. Now
5746 * Heavy edits in ipplib. Removed the help system altogether. Now
5746 obj?/?? is used for inspecting objects, a magic @doc prints
5747 obj?/?? is used for inspecting objects, a magic @doc prints
5747 docstrings, and full-blown Python help is accessed via the 'help'
5748 docstrings, and full-blown Python help is accessed via the 'help'
5748 keyword. This cleans up a lot of code (less to maintain) and does
5749 keyword. This cleans up a lot of code (less to maintain) and does
5749 the job. Since 'help' is now a standard Python component, might as
5750 the job. Since 'help' is now a standard Python component, might as
5750 well use it and remove duplicate functionality.
5751 well use it and remove duplicate functionality.
5751
5752
5752 Also removed the option to use ipplib as a standalone program. By
5753 Also removed the option to use ipplib as a standalone program. By
5753 now it's too dependent on other parts of IPython to function alone.
5754 now it's too dependent on other parts of IPython to function alone.
5754
5755
5755 * Fixed bug in genutils.pager. It would crash if the pager was
5756 * Fixed bug in genutils.pager. It would crash if the pager was
5756 exited immediately after opening (broken pipe).
5757 exited immediately after opening (broken pipe).
5757
5758
5758 * Trimmed down the VerboseTB reporting a little. The header is
5759 * Trimmed down the VerboseTB reporting a little. The header is
5759 much shorter now and the repeated exception arguments at the end
5760 much shorter now and the repeated exception arguments at the end
5760 have been removed. For interactive use the old header seemed a bit
5761 have been removed. For interactive use the old header seemed a bit
5761 excessive.
5762 excessive.
5762
5763
5763 * Fixed small bug in output of @whos for variables with multi-word
5764 * Fixed small bug in output of @whos for variables with multi-word
5764 types (only first word was displayed).
5765 types (only first word was displayed).
5765
5766
5766 2001-11-17 Fernando Perez <fperez@colorado.edu>
5767 2001-11-17 Fernando Perez <fperez@colorado.edu>
5767
5768
5768 * Version 0.1.10 released, 0.1.11 opened for further work.
5769 * Version 0.1.10 released, 0.1.11 opened for further work.
5769
5770
5770 * Modified dirs and friends. dirs now *returns* the stack (not
5771 * Modified dirs and friends. dirs now *returns* the stack (not
5771 prints), so one can manipulate it as a variable. Convenient to
5772 prints), so one can manipulate it as a variable. Convenient to
5772 travel along many directories.
5773 travel along many directories.
5773
5774
5774 * Fixed bug in magic_pdef: would only work with functions with
5775 * Fixed bug in magic_pdef: would only work with functions with
5775 arguments with default values.
5776 arguments with default values.
5776
5777
5777 2001-11-14 Fernando Perez <fperez@colorado.edu>
5778 2001-11-14 Fernando Perez <fperez@colorado.edu>
5778
5779
5779 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5780 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5780 example with IPython. Various other minor fixes and cleanups.
5781 example with IPython. Various other minor fixes and cleanups.
5781
5782
5782 * Version 0.1.9 released, 0.1.10 opened for further work.
5783 * Version 0.1.9 released, 0.1.10 opened for further work.
5783
5784
5784 * Added sys.path to the list of directories searched in the
5785 * Added sys.path to the list of directories searched in the
5785 execfile= option. It used to be the current directory and the
5786 execfile= option. It used to be the current directory and the
5786 user's IPYTHONDIR only.
5787 user's IPYTHONDIR only.
5787
5788
5788 2001-11-13 Fernando Perez <fperez@colorado.edu>
5789 2001-11-13 Fernando Perez <fperez@colorado.edu>
5789
5790
5790 * Reinstated the raw_input/prefilter separation that Janko had
5791 * Reinstated the raw_input/prefilter separation that Janko had
5791 initially. This gives a more convenient setup for extending the
5792 initially. This gives a more convenient setup for extending the
5792 pre-processor from the outside: raw_input always gets a string,
5793 pre-processor from the outside: raw_input always gets a string,
5793 and prefilter has to process it. We can then redefine prefilter
5794 and prefilter has to process it. We can then redefine prefilter
5794 from the outside and implement extensions for special
5795 from the outside and implement extensions for special
5795 purposes.
5796 purposes.
5796
5797
5797 Today I got one for inputting PhysicalQuantity objects
5798 Today I got one for inputting PhysicalQuantity objects
5798 (from Scientific) without needing any function calls at
5799 (from Scientific) without needing any function calls at
5799 all. Extremely convenient, and it's all done as a user-level
5800 all. Extremely convenient, and it's all done as a user-level
5800 extension (no IPython code was touched). Now instead of:
5801 extension (no IPython code was touched). Now instead of:
5801 a = PhysicalQuantity(4.2,'m/s**2')
5802 a = PhysicalQuantity(4.2,'m/s**2')
5802 one can simply say
5803 one can simply say
5803 a = 4.2 m/s**2
5804 a = 4.2 m/s**2
5804 or even
5805 or even
5805 a = 4.2 m/s^2
5806 a = 4.2 m/s^2
5806
5807
5807 I use this, but it's also a proof of concept: IPython really is
5808 I use this, but it's also a proof of concept: IPython really is
5808 fully user-extensible, even at the level of the parsing of the
5809 fully user-extensible, even at the level of the parsing of the
5809 command line. It's not trivial, but it's perfectly doable.
5810 command line. It's not trivial, but it's perfectly doable.
5810
5811
5811 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5812 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5812 the problem of modules being loaded in the inverse order in which
5813 the problem of modules being loaded in the inverse order in which
5813 they were defined in
5814 they were defined in
5814
5815
5815 * Version 0.1.8 released, 0.1.9 opened for further work.
5816 * Version 0.1.8 released, 0.1.9 opened for further work.
5816
5817
5817 * Added magics pdef, source and file. They respectively show the
5818 * Added magics pdef, source and file. They respectively show the
5818 definition line ('prototype' in C), source code and full python
5819 definition line ('prototype' in C), source code and full python
5819 file for any callable object. The object inspector oinfo uses
5820 file for any callable object. The object inspector oinfo uses
5820 these to show the same information.
5821 these to show the same information.
5821
5822
5822 * Version 0.1.7 released, 0.1.8 opened for further work.
5823 * Version 0.1.7 released, 0.1.8 opened for further work.
5823
5824
5824 * Separated all the magic functions into a class called Magic. The
5825 * Separated all the magic functions into a class called Magic. The
5825 InteractiveShell class was becoming too big for Xemacs to handle
5826 InteractiveShell class was becoming too big for Xemacs to handle
5826 (de-indenting a line would lock it up for 10 seconds while it
5827 (de-indenting a line would lock it up for 10 seconds while it
5827 backtracked on the whole class!)
5828 backtracked on the whole class!)
5828
5829
5829 FIXME: didn't work. It can be done, but right now namespaces are
5830 FIXME: didn't work. It can be done, but right now namespaces are
5830 all messed up. Do it later (reverted it for now, so at least
5831 all messed up. Do it later (reverted it for now, so at least
5831 everything works as before).
5832 everything works as before).
5832
5833
5833 * Got the object introspection system (magic_oinfo) working! I
5834 * Got the object introspection system (magic_oinfo) working! I
5834 think this is pretty much ready for release to Janko, so he can
5835 think this is pretty much ready for release to Janko, so he can
5835 test it for a while and then announce it. Pretty much 100% of what
5836 test it for a while and then announce it. Pretty much 100% of what
5836 I wanted for the 'phase 1' release is ready. Happy, tired.
5837 I wanted for the 'phase 1' release is ready. Happy, tired.
5837
5838
5838 2001-11-12 Fernando Perez <fperez@colorado.edu>
5839 2001-11-12 Fernando Perez <fperez@colorado.edu>
5839
5840
5840 * Version 0.1.6 released, 0.1.7 opened for further work.
5841 * Version 0.1.6 released, 0.1.7 opened for further work.
5841
5842
5842 * Fixed bug in printing: it used to test for truth before
5843 * Fixed bug in printing: it used to test for truth before
5843 printing, so 0 wouldn't print. Now checks for None.
5844 printing, so 0 wouldn't print. Now checks for None.
5844
5845
5845 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5846 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5846 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5847 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5847 reaches by hand into the outputcache. Think of a better way to do
5848 reaches by hand into the outputcache. Think of a better way to do
5848 this later.
5849 this later.
5849
5850
5850 * Various small fixes thanks to Nathan's comments.
5851 * Various small fixes thanks to Nathan's comments.
5851
5852
5852 * Changed magic_pprint to magic_Pprint. This way it doesn't
5853 * Changed magic_pprint to magic_Pprint. This way it doesn't
5853 collide with pprint() and the name is consistent with the command
5854 collide with pprint() and the name is consistent with the command
5854 line option.
5855 line option.
5855
5856
5856 * Changed prompt counter behavior to be fully like
5857 * Changed prompt counter behavior to be fully like
5857 Mathematica's. That is, even input that doesn't return a result
5858 Mathematica's. That is, even input that doesn't return a result
5858 raises the prompt counter. The old behavior was kind of confusing
5859 raises the prompt counter. The old behavior was kind of confusing
5859 (getting the same prompt number several times if the operation
5860 (getting the same prompt number several times if the operation
5860 didn't return a result).
5861 didn't return a result).
5861
5862
5862 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5863 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5863
5864
5864 * Fixed -Classic mode (wasn't working anymore).
5865 * Fixed -Classic mode (wasn't working anymore).
5865
5866
5866 * Added colored prompts using Nathan's new code. Colors are
5867 * Added colored prompts using Nathan's new code. Colors are
5867 currently hardwired, they can be user-configurable. For
5868 currently hardwired, they can be user-configurable. For
5868 developers, they can be chosen in file ipythonlib.py, at the
5869 developers, they can be chosen in file ipythonlib.py, at the
5869 beginning of the CachedOutput class def.
5870 beginning of the CachedOutput class def.
5870
5871
5871 2001-11-11 Fernando Perez <fperez@colorado.edu>
5872 2001-11-11 Fernando Perez <fperez@colorado.edu>
5872
5873
5873 * Version 0.1.5 released, 0.1.6 opened for further work.
5874 * Version 0.1.5 released, 0.1.6 opened for further work.
5874
5875
5875 * Changed magic_env to *return* the environment as a dict (not to
5876 * Changed magic_env to *return* the environment as a dict (not to
5876 print it). This way it prints, but it can also be processed.
5877 print it). This way it prints, but it can also be processed.
5877
5878
5878 * Added Verbose exception reporting to interactive
5879 * Added Verbose exception reporting to interactive
5879 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5880 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5880 traceback. Had to make some changes to the ultraTB file. This is
5881 traceback. Had to make some changes to the ultraTB file. This is
5881 probably the last 'big' thing in my mental todo list. This ties
5882 probably the last 'big' thing in my mental todo list. This ties
5882 in with the next entry:
5883 in with the next entry:
5883
5884
5884 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5885 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5885 has to specify is Plain, Color or Verbose for all exception
5886 has to specify is Plain, Color or Verbose for all exception
5886 handling.
5887 handling.
5887
5888
5888 * Removed ShellServices option. All this can really be done via
5889 * Removed ShellServices option. All this can really be done via
5889 the magic system. It's easier to extend, cleaner and has automatic
5890 the magic system. It's easier to extend, cleaner and has automatic
5890 namespace protection and documentation.
5891 namespace protection and documentation.
5891
5892
5892 2001-11-09 Fernando Perez <fperez@colorado.edu>
5893 2001-11-09 Fernando Perez <fperez@colorado.edu>
5893
5894
5894 * Fixed bug in output cache flushing (missing parameter to
5895 * Fixed bug in output cache flushing (missing parameter to
5895 __init__). Other small bugs fixed (found using pychecker).
5896 __init__). Other small bugs fixed (found using pychecker).
5896
5897
5897 * Version 0.1.4 opened for bugfixing.
5898 * Version 0.1.4 opened for bugfixing.
5898
5899
5899 2001-11-07 Fernando Perez <fperez@colorado.edu>
5900 2001-11-07 Fernando Perez <fperez@colorado.edu>
5900
5901
5901 * Version 0.1.3 released, mainly because of the raw_input bug.
5902 * Version 0.1.3 released, mainly because of the raw_input bug.
5902
5903
5903 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5904 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5904 and when testing for whether things were callable, a call could
5905 and when testing for whether things were callable, a call could
5905 actually be made to certain functions. They would get called again
5906 actually be made to certain functions. They would get called again
5906 once 'really' executed, with a resulting double call. A disaster
5907 once 'really' executed, with a resulting double call. A disaster
5907 in many cases (list.reverse() would never work!).
5908 in many cases (list.reverse() would never work!).
5908
5909
5909 * Removed prefilter() function, moved its code to raw_input (which
5910 * Removed prefilter() function, moved its code to raw_input (which
5910 after all was just a near-empty caller for prefilter). This saves
5911 after all was just a near-empty caller for prefilter). This saves
5911 a function call on every prompt, and simplifies the class a tiny bit.
5912 a function call on every prompt, and simplifies the class a tiny bit.
5912
5913
5913 * Fix _ip to __ip name in magic example file.
5914 * Fix _ip to __ip name in magic example file.
5914
5915
5915 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5916 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5916 work with non-gnu versions of tar.
5917 work with non-gnu versions of tar.
5917
5918
5918 2001-11-06 Fernando Perez <fperez@colorado.edu>
5919 2001-11-06 Fernando Perez <fperez@colorado.edu>
5919
5920
5920 * Version 0.1.2. Just to keep track of the recent changes.
5921 * Version 0.1.2. Just to keep track of the recent changes.
5921
5922
5922 * Fixed nasty bug in output prompt routine. It used to check 'if
5923 * Fixed nasty bug in output prompt routine. It used to check 'if
5923 arg != None...'. Problem is, this fails if arg implements a
5924 arg != None...'. Problem is, this fails if arg implements a
5924 special comparison (__cmp__) which disallows comparing to
5925 special comparison (__cmp__) which disallows comparing to
5925 None. Found it when trying to use the PhysicalQuantity module from
5926 None. Found it when trying to use the PhysicalQuantity module from
5926 ScientificPython.
5927 ScientificPython.
5927
5928
5928 2001-11-05 Fernando Perez <fperez@colorado.edu>
5929 2001-11-05 Fernando Perez <fperez@colorado.edu>
5929
5930
5930 * Also added dirs. Now the pushd/popd/dirs family functions
5931 * Also added dirs. Now the pushd/popd/dirs family functions
5931 basically like the shell, with the added convenience of going home
5932 basically like the shell, with the added convenience of going home
5932 when called with no args.
5933 when called with no args.
5933
5934
5934 * pushd/popd slightly modified to mimic shell behavior more
5935 * pushd/popd slightly modified to mimic shell behavior more
5935 closely.
5936 closely.
5936
5937
5937 * Added env,pushd,popd from ShellServices as magic functions. I
5938 * Added env,pushd,popd from ShellServices as magic functions. I
5938 think the cleanest will be to port all desired functions from
5939 think the cleanest will be to port all desired functions from
5939 ShellServices as magics and remove ShellServices altogether. This
5940 ShellServices as magics and remove ShellServices altogether. This
5940 will provide a single, clean way of adding functionality
5941 will provide a single, clean way of adding functionality
5941 (shell-type or otherwise) to IP.
5942 (shell-type or otherwise) to IP.
5942
5943
5943 2001-11-04 Fernando Perez <fperez@colorado.edu>
5944 2001-11-04 Fernando Perez <fperez@colorado.edu>
5944
5945
5945 * Added .ipython/ directory to sys.path. This way users can keep
5946 * Added .ipython/ directory to sys.path. This way users can keep
5946 customizations there and access them via import.
5947 customizations there and access them via import.
5947
5948
5948 2001-11-03 Fernando Perez <fperez@colorado.edu>
5949 2001-11-03 Fernando Perez <fperez@colorado.edu>
5949
5950
5950 * Opened version 0.1.1 for new changes.
5951 * Opened version 0.1.1 for new changes.
5951
5952
5952 * Changed version number to 0.1.0: first 'public' release, sent to
5953 * Changed version number to 0.1.0: first 'public' release, sent to
5953 Nathan and Janko.
5954 Nathan and Janko.
5954
5955
5955 * Lots of small fixes and tweaks.
5956 * Lots of small fixes and tweaks.
5956
5957
5957 * Minor changes to whos format. Now strings are shown, snipped if
5958 * Minor changes to whos format. Now strings are shown, snipped if
5958 too long.
5959 too long.
5959
5960
5960 * Changed ShellServices to work on __main__ so they show up in @who
5961 * Changed ShellServices to work on __main__ so they show up in @who
5961
5962
5962 * Help also works with ? at the end of a line:
5963 * Help also works with ? at the end of a line:
5963 ?sin and sin?
5964 ?sin and sin?
5964 both produce the same effect. This is nice, as often I use the
5965 both produce the same effect. This is nice, as often I use the
5965 tab-complete to find the name of a method, but I used to then have
5966 tab-complete to find the name of a method, but I used to then have
5966 to go to the beginning of the line to put a ? if I wanted more
5967 to go to the beginning of the line to put a ? if I wanted more
5967 info. Now I can just add the ? and hit return. Convenient.
5968 info. Now I can just add the ? and hit return. Convenient.
5968
5969
5969 2001-11-02 Fernando Perez <fperez@colorado.edu>
5970 2001-11-02 Fernando Perez <fperez@colorado.edu>
5970
5971
5971 * Python version check (>=2.1) added.
5972 * Python version check (>=2.1) added.
5972
5973
5973 * Added LazyPython documentation. At this point the docs are quite
5974 * Added LazyPython documentation. At this point the docs are quite
5974 a mess. A cleanup is in order.
5975 a mess. A cleanup is in order.
5975
5976
5976 * Auto-installer created. For some bizarre reason, the zipfiles
5977 * Auto-installer created. For some bizarre reason, the zipfiles
5977 module isn't working on my system. So I made a tar version
5978 module isn't working on my system. So I made a tar version
5978 (hopefully the command line options in various systems won't kill
5979 (hopefully the command line options in various systems won't kill
5979 me).
5980 me).
5980
5981
5981 * Fixes to Struct in genutils. Now all dictionary-like methods are
5982 * Fixes to Struct in genutils. Now all dictionary-like methods are
5982 protected (reasonably).
5983 protected (reasonably).
5983
5984
5984 * Added pager function to genutils and changed ? to print usage
5985 * Added pager function to genutils and changed ? to print usage
5985 note through it (it was too long).
5986 note through it (it was too long).
5986
5987
5987 * Added the LazyPython functionality. Works great! I changed the
5988 * Added the LazyPython functionality. Works great! I changed the
5988 auto-quote escape to ';', it's on home row and next to '. But
5989 auto-quote escape to ';', it's on home row and next to '. But
5989 both auto-quote and auto-paren (still /) escapes are command-line
5990 both auto-quote and auto-paren (still /) escapes are command-line
5990 parameters.
5991 parameters.
5991
5992
5992
5993
5993 2001-11-01 Fernando Perez <fperez@colorado.edu>
5994 2001-11-01 Fernando Perez <fperez@colorado.edu>
5994
5995
5995 * Version changed to 0.0.7. Fairly large change: configuration now
5996 * Version changed to 0.0.7. Fairly large change: configuration now
5996 is all stored in a directory, by default .ipython. There, all
5997 is all stored in a directory, by default .ipython. There, all
5997 config files have normal looking names (not .names)
5998 config files have normal looking names (not .names)
5998
5999
5999 * Version 0.0.6 Released first to Lucas and Archie as a test
6000 * Version 0.0.6 Released first to Lucas and Archie as a test
6000 run. Since it's the first 'semi-public' release, change version to
6001 run. Since it's the first 'semi-public' release, change version to
6001 > 0.0.6 for any changes now.
6002 > 0.0.6 for any changes now.
6002
6003
6003 * Stuff I had put in the ipplib.py changelog:
6004 * Stuff I had put in the ipplib.py changelog:
6004
6005
6005 Changes to InteractiveShell:
6006 Changes to InteractiveShell:
6006
6007
6007 - Made the usage message a parameter.
6008 - Made the usage message a parameter.
6008
6009
6009 - Require the name of the shell variable to be given. It's a bit
6010 - Require the name of the shell variable to be given. It's a bit
6010 of a hack, but allows the name 'shell' not to be hardwired in the
6011 of a hack, but allows the name 'shell' not to be hardwired in the
6011 magic (@) handler, which is problematic b/c it requires
6012 magic (@) handler, which is problematic b/c it requires
6012 polluting the global namespace with 'shell'. This in turn is
6013 polluting the global namespace with 'shell'. This in turn is
6013 fragile: if a user redefines a variable called shell, things
6014 fragile: if a user redefines a variable called shell, things
6014 break.
6015 break.
6015
6016
6016 - magic @: all functions available through @ need to be defined
6017 - magic @: all functions available through @ need to be defined
6017 as magic_<name>, even though they can be called simply as
6018 as magic_<name>, even though they can be called simply as
6018 @<name>. This allows the special command @magic to gather
6019 @<name>. This allows the special command @magic to gather
6019 information automatically about all existing magic functions,
6020 information automatically about all existing magic functions,
6020 even if they are run-time user extensions, by parsing the shell
6021 even if they are run-time user extensions, by parsing the shell
6021 instance __dict__ looking for special magic_ names.
6022 instance __dict__ looking for special magic_ names.
6022
6023
6023 - mainloop: added *two* local namespace parameters. This allows
6024 - mainloop: added *two* local namespace parameters. This allows
6024 the class to differentiate between parameters which were there
6025 the class to differentiate between parameters which were there
6025 before and after command line initialization was processed. This
6026 before and after command line initialization was processed. This
6026 way, later @who can show things loaded at startup by the
6027 way, later @who can show things loaded at startup by the
6027 user. This trick was necessary to make session saving/reloading
6028 user. This trick was necessary to make session saving/reloading
6028 really work: ideally after saving/exiting/reloading a session,
6029 really work: ideally after saving/exiting/reloading a session,
6029 *everything* should look the same, including the output of @who. I
6030 *everything* should look the same, including the output of @who. I
6030 was only able to make this work with this double namespace
6031 was only able to make this work with this double namespace
6031 trick.
6032 trick.
6032
6033
6033 - added a header to the logfile which allows (almost) full
6034 - added a header to the logfile which allows (almost) full
6034 session restoring.
6035 session restoring.
6035
6036
6036 - prepend lines beginning with @ or !, with a and log
6037 - prepend lines beginning with @ or !, with a and log
6037 them. Why? !lines: may be useful to know what you did @lines:
6038 them. Why? !lines: may be useful to know what you did @lines:
6038 they may affect session state. So when restoring a session, at
6039 they may affect session state. So when restoring a session, at
6039 least inform the user of their presence. I couldn't quite get
6040 least inform the user of their presence. I couldn't quite get
6040 them to properly re-execute, but at least the user is warned.
6041 them to properly re-execute, but at least the user is warned.
6041
6042
6042 * Started ChangeLog.
6043 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now