##// END OF EJS Templates
IPython/Extensions/ipipe.py: Added a Table ihist that can be used to...
walter.doerwald -
Show More
@@ -1,1727 +1,1765 b''
1 # -*- coding: iso-8859-1 -*-
1 # -*- coding: iso-8859-1 -*-
2
2
3 import curses, fcntl, signal, struct, tty, textwrap, inspect
3 import curses, fcntl, signal, struct, tty, textwrap, inspect
4
4
5 from IPython import ipapi
6
5 import astyle, ipipe
7 import astyle, ipipe
6
8
7
9
8 # Python 2.3 compatibility
10 # Python 2.3 compatibility
9 try:
11 try:
10 set
12 set
11 except NameError:
13 except NameError:
12 import sets
14 import sets
13 set = sets.Set
15 set = sets.Set
14
16
15 # Python 2.3 compatibility
17 # Python 2.3 compatibility
16 try:
18 try:
17 sorted
19 sorted
18 except NameError:
20 except NameError:
19 from ipipe import sorted
21 from ipipe import sorted
20
22
21
23
22 class UnassignedKeyError(Exception):
24 class UnassignedKeyError(Exception):
23 """
25 """
24 Exception that is used for reporting unassigned keys.
26 Exception that is used for reporting unassigned keys.
25 """
27 """
26
28
27
29
28 class UnknownCommandError(Exception):
30 class UnknownCommandError(Exception):
29 """
31 """
30 Exception that is used for reporting unknown commands (this should never
32 Exception that is used for reporting unknown commands (this should never
31 happen).
33 happen).
32 """
34 """
33
35
34
36
35 class CommandError(Exception):
37 class CommandError(Exception):
36 """
38 """
37 Exception that is used for reporting that a command can't be executed.
39 Exception that is used for reporting that a command can't be executed.
38 """
40 """
39
41
40
42
41 class Keymap(dict):
43 class Keymap(dict):
42 """
44 """
43 Stores mapping of keys to commands.
45 Stores mapping of keys to commands.
44 """
46 """
45 def __init__(self):
47 def __init__(self):
46 self._keymap = {}
48 self._keymap = {}
47
49
48 def __setitem__(self, key, command):
50 def __setitem__(self, key, command):
49 if isinstance(key, str):
51 if isinstance(key, str):
50 for c in key:
52 for c in key:
51 dict.__setitem__(self, ord(c), command)
53 dict.__setitem__(self, ord(c), command)
52 else:
54 else:
53 dict.__setitem__(self, key, command)
55 dict.__setitem__(self, key, command)
54
56
55 def __getitem__(self, key):
57 def __getitem__(self, key):
56 if isinstance(key, str):
58 if isinstance(key, str):
57 key = ord(key)
59 key = ord(key)
58 return dict.__getitem__(self, key)
60 return dict.__getitem__(self, key)
59
61
60 def __detitem__(self, key):
62 def __detitem__(self, key):
61 if isinstance(key, str):
63 if isinstance(key, str):
62 key = ord(key)
64 key = ord(key)
63 dict.__detitem__(self, key)
65 dict.__detitem__(self, key)
64
66
65 def register(self, command, *keys):
67 def register(self, command, *keys):
66 for key in keys:
68 for key in keys:
67 self[key] = command
69 self[key] = command
68
70
69 def get(self, key, default=None):
71 def get(self, key, default=None):
70 if isinstance(key, str):
72 if isinstance(key, str):
71 key = ord(key)
73 key = ord(key)
72 return dict.get(self, key, default)
74 return dict.get(self, key, default)
73
75
74 def findkey(self, command, default=ipipe.noitem):
76 def findkey(self, command, default=ipipe.noitem):
75 for (key, commandcandidate) in self.iteritems():
77 for (key, commandcandidate) in self.iteritems():
76 if commandcandidate == command:
78 if commandcandidate == command:
77 return key
79 return key
78 if default is ipipe.noitem:
80 if default is ipipe.noitem:
79 raise KeyError(command)
81 raise KeyError(command)
80 return default
82 return default
81
83
82
84
83 class _BrowserCachedItem(object):
85 class _BrowserCachedItem(object):
84 # This is used internally by ``ibrowse`` to store a item together with its
86 # This is used internally by ``ibrowse`` to store a item together with its
85 # marked status.
87 # marked status.
86 __slots__ = ("item", "marked")
88 __slots__ = ("item", "marked")
87
89
88 def __init__(self, item):
90 def __init__(self, item):
89 self.item = item
91 self.item = item
90 self.marked = False
92 self.marked = False
91
93
92
94
93 class _BrowserHelp(object):
95 class _BrowserHelp(object):
94 style_header = astyle.Style.fromstr("yellow:black:bold")
96 style_header = astyle.Style.fromstr("yellow:black:bold")
95 # This is used internally by ``ibrowse`` for displaying the help screen.
97 # This is used internally by ``ibrowse`` for displaying the help screen.
96 def __init__(self, browser):
98 def __init__(self, browser):
97 self.browser = browser
99 self.browser = browser
98
100
99 def __xrepr__(self, mode):
101 def __xrepr__(self, mode):
100 yield (-1, True)
102 yield (-1, True)
101 if mode == "header" or mode == "footer":
103 if mode == "header" or mode == "footer":
102 yield (astyle.style_default, "ibrowse help screen")
104 yield (astyle.style_default, "ibrowse help screen")
103 else:
105 else:
104 yield (astyle.style_default, repr(self))
106 yield (astyle.style_default, repr(self))
105
107
106 def __iter__(self):
108 def __iter__(self):
107 # Get reverse key mapping
109 # Get reverse key mapping
108 allkeys = {}
110 allkeys = {}
109 for (key, cmd) in self.browser.keymap.iteritems():
111 for (key, cmd) in self.browser.keymap.iteritems():
110 allkeys.setdefault(cmd, []).append(key)
112 allkeys.setdefault(cmd, []).append(key)
111
113
112 fields = ("key", "description")
114 fields = ("key", "description")
113
115
114 commands = []
116 commands = []
115 for name in dir(self.browser):
117 for name in dir(self.browser):
116 if name.startswith("cmd_"):
118 if name.startswith("cmd_"):
117 command = getattr(self.browser, name)
119 command = getattr(self.browser, name)
118 commands.append((inspect.getsourcelines(command)[-1], name[4:], command))
120 commands.append((inspect.getsourcelines(command)[-1], name[4:], command))
119 commands.sort()
121 commands.sort()
120 commands = [(c[1], c[2]) for c in commands]
122 commands = [(c[1], c[2]) for c in commands]
121 for (i, (name, command)) in enumerate(commands):
123 for (i, (name, command)) in enumerate(commands):
122 if i:
124 if i:
123 yield ipipe.Fields(fields, key="", description="")
125 yield ipipe.Fields(fields, key="", description="")
124
126
125 description = command.__doc__
127 description = command.__doc__
126 if description is None:
128 if description is None:
127 lines = []
129 lines = []
128 else:
130 else:
129 lines = [l.strip() for l in description.splitlines() if l.strip()]
131 lines = [l.strip() for l in description.splitlines() if l.strip()]
130 description = "\n".join(lines)
132 description = "\n".join(lines)
131 lines = textwrap.wrap(description, 60)
133 lines = textwrap.wrap(description, 60)
132 keys = allkeys.get(name, [])
134 keys = allkeys.get(name, [])
133
135
134 yield ipipe.Fields(fields, key="", description=astyle.Text((self.style_header, name)))
136 yield ipipe.Fields(fields, key="", description=astyle.Text((self.style_header, name)))
135 for i in xrange(max(len(keys), len(lines))):
137 for i in xrange(max(len(keys), len(lines))):
136 try:
138 try:
137 key = self.browser.keylabel(keys[i])
139 key = self.browser.keylabel(keys[i])
138 except IndexError:
140 except IndexError:
139 key = ""
141 key = ""
140 try:
142 try:
141 line = lines[i]
143 line = lines[i]
142 except IndexError:
144 except IndexError:
143 line = ""
145 line = ""
144 yield ipipe.Fields(fields, key=key, description=line)
146 yield ipipe.Fields(fields, key=key, description=line)
145
147
146
148
147 class _BrowserLevel(object):
149 class _BrowserLevel(object):
148 # This is used internally to store the state (iterator, fetch items,
150 # This is used internally to store the state (iterator, fetch items,
149 # position of cursor and screen, etc.) of one browser level
151 # position of cursor and screen, etc.) of one browser level
150 # An ``ibrowse`` object keeps multiple ``_BrowserLevel`` objects in
152 # An ``ibrowse`` object keeps multiple ``_BrowserLevel`` objects in
151 # a stack.
153 # a stack.
152 def __init__(self, browser, input, mainsizey, *attrs):
154 def __init__(self, browser, input, mainsizey, *attrs):
153 self.browser = browser
155 self.browser = browser
154 self.input = input
156 self.input = input
155 self.header = [x for x in ipipe.xrepr(input, "header") if not isinstance(x[0], int)]
157 self.header = [x for x in ipipe.xrepr(input, "header") if not isinstance(x[0], int)]
156 # iterator for the input
158 # iterator for the input
157 self.iterator = ipipe.xiter(input)
159 self.iterator = ipipe.xiter(input)
158
160
159 # is the iterator exhausted?
161 # is the iterator exhausted?
160 self.exhausted = False
162 self.exhausted = False
161
163
162 # attributes to be display (autodetected if empty)
164 # attributes to be display (autodetected if empty)
163 self.attrs = attrs
165 self.attrs = attrs
164
166
165 # fetched items (+ marked flag)
167 # fetched items (+ marked flag)
166 self.items = ipipe.deque()
168 self.items = ipipe.deque()
167
169
168 # Number of marked objects
170 # Number of marked objects
169 self.marked = 0
171 self.marked = 0
170
172
171 # Vertical cursor position
173 # Vertical cursor position
172 self.cury = 0
174 self.cury = 0
173
175
174 # Horizontal cursor position
176 # Horizontal cursor position
175 self.curx = 0
177 self.curx = 0
176
178
177 # Index of first data column
179 # Index of first data column
178 self.datastartx = 0
180 self.datastartx = 0
179
181
180 # Index of first data line
182 # Index of first data line
181 self.datastarty = 0
183 self.datastarty = 0
182
184
183 # height of the data display area
185 # height of the data display area
184 self.mainsizey = mainsizey
186 self.mainsizey = mainsizey
185
187
186 # width of the data display area (changes when scrolling)
188 # width of the data display area (changes when scrolling)
187 self.mainsizex = 0
189 self.mainsizex = 0
188
190
189 # Size of row number (changes when scrolling)
191 # Size of row number (changes when scrolling)
190 self.numbersizex = 0
192 self.numbersizex = 0
191
193
192 # Attributes to display (in this order)
194 # Attributes to display (in this order)
193 self.displayattrs = []
195 self.displayattrs = []
194
196
195 # index and attribute under the cursor
197 # index and attribute under the cursor
196 self.displayattr = (None, ipipe.noitem)
198 self.displayattr = (None, ipipe.noitem)
197
199
198 # Maps attributes to column widths
200 # Maps attributes to column widths
199 self.colwidths = {}
201 self.colwidths = {}
200
202
201 # Set of hidden attributes
203 # Set of hidden attributes
202 self.hiddenattrs = set()
204 self.hiddenattrs = set()
203
205
204 # This takes care of all the caches etc.
206 # This takes care of all the caches etc.
205 self.moveto(0, 0, refresh=True)
207 self.moveto(0, 0, refresh=True)
206
208
207 def fetch(self, count):
209 def fetch(self, count):
208 # Try to fill ``self.items`` with at least ``count`` objects.
210 # Try to fill ``self.items`` with at least ``count`` objects.
209 have = len(self.items)
211 have = len(self.items)
210 while not self.exhausted and have < count:
212 while not self.exhausted and have < count:
211 try:
213 try:
212 item = self.iterator.next()
214 item = self.iterator.next()
213 except StopIteration:
215 except StopIteration:
214 self.exhausted = True
216 self.exhausted = True
215 break
217 break
216 except (KeyboardInterrupt, SystemExit):
218 except (KeyboardInterrupt, SystemExit):
217 raise
219 raise
218 except Exception, exc:
220 except Exception, exc:
219 have += 1
221 have += 1
220 self.items.append(_BrowserCachedItem(exc))
222 self.items.append(_BrowserCachedItem(exc))
221 self.exhausted = True
223 self.exhausted = True
222 break
224 break
223 else:
225 else:
224 have += 1
226 have += 1
225 self.items.append(_BrowserCachedItem(item))
227 self.items.append(_BrowserCachedItem(item))
226
228
227 def calcdisplayattrs(self):
229 def calcdisplayattrs(self):
228 # Calculate which attributes are available from the objects that are
230 # Calculate which attributes are available from the objects that are
229 # currently visible on screen (and store it in ``self.displayattrs``)
231 # currently visible on screen (and store it in ``self.displayattrs``)
230
232
231 attrs = set()
233 attrs = set()
232 self.displayattrs = []
234 self.displayattrs = []
233 if self.attrs:
235 if self.attrs:
234 # If the browser object specifies a fixed list of attributes,
236 # If the browser object specifies a fixed list of attributes,
235 # simply use it (removing hidden attributes).
237 # simply use it (removing hidden attributes).
236 for attr in self.attrs:
238 for attr in self.attrs:
237 attr = ipipe.upgradexattr(attr)
239 attr = ipipe.upgradexattr(attr)
238 if attr not in attrs and attr not in self.hiddenattrs:
240 if attr not in attrs and attr not in self.hiddenattrs:
239 self.displayattrs.append(attr)
241 self.displayattrs.append(attr)
240 attrs.add(attr)
242 attrs.add(attr)
241 else:
243 else:
242 endy = min(self.datastarty+self.mainsizey, len(self.items))
244 endy = min(self.datastarty+self.mainsizey, len(self.items))
243 for i in xrange(self.datastarty, endy):
245 for i in xrange(self.datastarty, endy):
244 for attr in ipipe.xattrs(self.items[i].item, "default"):
246 for attr in ipipe.xattrs(self.items[i].item, "default"):
245 if attr not in attrs and attr not in self.hiddenattrs:
247 if attr not in attrs and attr not in self.hiddenattrs:
246 self.displayattrs.append(attr)
248 self.displayattrs.append(attr)
247 attrs.add(attr)
249 attrs.add(attr)
248
250
249 def getrow(self, i):
251 def getrow(self, i):
250 # Return a dictionary with the attributes for the object
252 # Return a dictionary with the attributes for the object
251 # ``self.items[i]``. Attribute names are taken from
253 # ``self.items[i]``. Attribute names are taken from
252 # ``self.displayattrs`` so ``calcdisplayattrs()`` must have been
254 # ``self.displayattrs`` so ``calcdisplayattrs()`` must have been
253 # called before.
255 # called before.
254 row = {}
256 row = {}
255 item = self.items[i].item
257 item = self.items[i].item
256 for attr in self.displayattrs:
258 for attr in self.displayattrs:
257 try:
259 try:
258 value = attr.value(item)
260 value = attr.value(item)
259 except (KeyboardInterrupt, SystemExit):
261 except (KeyboardInterrupt, SystemExit):
260 raise
262 raise
261 except Exception, exc:
263 except Exception, exc:
262 value = exc
264 value = exc
263 # only store attribute if it exists (or we got an exception)
265 # only store attribute if it exists (or we got an exception)
264 if value is not ipipe.noitem:
266 if value is not ipipe.noitem:
265 # remember alignment, length and colored text
267 # remember alignment, length and colored text
266 row[attr] = ipipe.xformat(value, "cell", self.browser.maxattrlength)
268 row[attr] = ipipe.xformat(value, "cell", self.browser.maxattrlength)
267 return row
269 return row
268
270
269 def calcwidths(self):
271 def calcwidths(self):
270 # Recalculate the displayed fields and their widths.
272 # Recalculate the displayed fields and their widths.
271 # ``calcdisplayattrs()'' must have been called and the cache
273 # ``calcdisplayattrs()'' must have been called and the cache
272 # for attributes of the objects on screen (``self.displayrows``)
274 # for attributes of the objects on screen (``self.displayrows``)
273 # must have been filled. This sets ``self.colwidths`` which maps
275 # must have been filled. This sets ``self.colwidths`` which maps
274 # attribute descriptors to widths.
276 # attribute descriptors to widths.
275 self.colwidths = {}
277 self.colwidths = {}
276 for row in self.displayrows:
278 for row in self.displayrows:
277 for attr in self.displayattrs:
279 for attr in self.displayattrs:
278 try:
280 try:
279 length = row[attr][1]
281 length = row[attr][1]
280 except KeyError:
282 except KeyError:
281 length = 0
283 length = 0
282 # always add attribute to colwidths, even if it doesn't exist
284 # always add attribute to colwidths, even if it doesn't exist
283 if attr not in self.colwidths:
285 if attr not in self.colwidths:
284 self.colwidths[attr] = len(attr.name())
286 self.colwidths[attr] = len(attr.name())
285 newwidth = max(self.colwidths[attr], length)
287 newwidth = max(self.colwidths[attr], length)
286 self.colwidths[attr] = newwidth
288 self.colwidths[attr] = newwidth
287
289
288 # How many characters do we need to paint the largest item number?
290 # How many characters do we need to paint the largest item number?
289 self.numbersizex = len(str(self.datastarty+self.mainsizey-1))
291 self.numbersizex = len(str(self.datastarty+self.mainsizey-1))
290 # How must space have we got to display data?
292 # How must space have we got to display data?
291 self.mainsizex = self.browser.scrsizex-self.numbersizex-3
293 self.mainsizex = self.browser.scrsizex-self.numbersizex-3
292 # width of all columns
294 # width of all columns
293 self.datasizex = sum(self.colwidths.itervalues()) + len(self.colwidths)
295 self.datasizex = sum(self.colwidths.itervalues()) + len(self.colwidths)
294
296
295 def calcdisplayattr(self):
297 def calcdisplayattr(self):
296 # Find out which attribute the cursor is on and store this
298 # Find out which attribute the cursor is on and store this
297 # information in ``self.displayattr``.
299 # information in ``self.displayattr``.
298 pos = 0
300 pos = 0
299 for (i, attr) in enumerate(self.displayattrs):
301 for (i, attr) in enumerate(self.displayattrs):
300 if pos+self.colwidths[attr] >= self.curx:
302 if pos+self.colwidths[attr] >= self.curx:
301 self.displayattr = (i, attr)
303 self.displayattr = (i, attr)
302 break
304 break
303 pos += self.colwidths[attr]+1
305 pos += self.colwidths[attr]+1
304 else:
306 else:
305 self.displayattr = (None, ipipe.noitem)
307 self.displayattr = (None, ipipe.noitem)
306
308
307 def moveto(self, x, y, refresh=False):
309 def moveto(self, x, y, refresh=False):
308 # Move the cursor to the position ``(x,y)`` (in data coordinates,
310 # Move the cursor to the position ``(x,y)`` (in data coordinates,
309 # not in screen coordinates). If ``refresh`` is true, all cached
311 # not in screen coordinates). If ``refresh`` is true, all cached
310 # values will be recalculated (e.g. because the list has been
312 # values will be recalculated (e.g. because the list has been
311 # resorted, so screen positions etc. are no longer valid).
313 # resorted, so screen positions etc. are no longer valid).
312 olddatastarty = self.datastarty
314 olddatastarty = self.datastarty
313 oldx = self.curx
315 oldx = self.curx
314 oldy = self.cury
316 oldy = self.cury
315 x = int(x+0.5)
317 x = int(x+0.5)
316 y = int(y+0.5)
318 y = int(y+0.5)
317 newx = x # remember where we wanted to move
319 newx = x # remember where we wanted to move
318 newy = y # remember where we wanted to move
320 newy = y # remember where we wanted to move
319
321
320 scrollbordery = min(self.browser.scrollbordery, self.mainsizey//2)
322 scrollbordery = min(self.browser.scrollbordery, self.mainsizey//2)
321 scrollborderx = min(self.browser.scrollborderx, self.mainsizex//2)
323 scrollborderx = min(self.browser.scrollborderx, self.mainsizex//2)
322
324
323 # Make sure that the cursor didn't leave the main area vertically
325 # Make sure that the cursor didn't leave the main area vertically
324 if y < 0:
326 if y < 0:
325 y = 0
327 y = 0
326 # try to get enough items to fill the screen
328 # try to get enough items to fill the screen
327 self.fetch(max(y+scrollbordery+1, self.mainsizey))
329 self.fetch(max(y+scrollbordery+1, self.mainsizey))
328 if y >= len(self.items):
330 if y >= len(self.items):
329 y = max(0, len(self.items)-1)
331 y = max(0, len(self.items)-1)
330
332
331 # Make sure that the cursor stays on screen vertically
333 # Make sure that the cursor stays on screen vertically
332 if y < self.datastarty+scrollbordery:
334 if y < self.datastarty+scrollbordery:
333 self.datastarty = max(0, y-scrollbordery)
335 self.datastarty = max(0, y-scrollbordery)
334 elif y >= self.datastarty+self.mainsizey-scrollbordery:
336 elif y >= self.datastarty+self.mainsizey-scrollbordery:
335 self.datastarty = max(0, min(y-self.mainsizey+scrollbordery+1,
337 self.datastarty = max(0, min(y-self.mainsizey+scrollbordery+1,
336 len(self.items)-self.mainsizey))
338 len(self.items)-self.mainsizey))
337
339
338 if refresh: # Do we need to refresh the complete display?
340 if refresh: # Do we need to refresh the complete display?
339 self.calcdisplayattrs()
341 self.calcdisplayattrs()
340 endy = min(self.datastarty+self.mainsizey, len(self.items))
342 endy = min(self.datastarty+self.mainsizey, len(self.items))
341 self.displayrows = map(self.getrow, xrange(self.datastarty, endy))
343 self.displayrows = map(self.getrow, xrange(self.datastarty, endy))
342 self.calcwidths()
344 self.calcwidths()
343 # Did we scroll vertically => update displayrows
345 # Did we scroll vertically => update displayrows
344 # and various other attributes
346 # and various other attributes
345 elif self.datastarty != olddatastarty:
347 elif self.datastarty != olddatastarty:
346 # Recalculate which attributes we have to display
348 # Recalculate which attributes we have to display
347 olddisplayattrs = self.displayattrs
349 olddisplayattrs = self.displayattrs
348 self.calcdisplayattrs()
350 self.calcdisplayattrs()
349 # If there are new attributes, recreate the cache
351 # If there are new attributes, recreate the cache
350 if self.displayattrs != olddisplayattrs:
352 if self.displayattrs != olddisplayattrs:
351 endy = min(self.datastarty+self.mainsizey, len(self.items))
353 endy = min(self.datastarty+self.mainsizey, len(self.items))
352 self.displayrows = map(self.getrow, xrange(self.datastarty, endy))
354 self.displayrows = map(self.getrow, xrange(self.datastarty, endy))
353 elif self.datastarty<olddatastarty: # we did scroll up
355 elif self.datastarty<olddatastarty: # we did scroll up
354 # drop rows from the end
356 # drop rows from the end
355 del self.displayrows[self.datastarty-olddatastarty:]
357 del self.displayrows[self.datastarty-olddatastarty:]
356 # fetch new items
358 # fetch new items
357 for i in xrange(min(olddatastarty, self.datastarty+self.mainsizey)-1,
359 for i in xrange(min(olddatastarty, self.datastarty+self.mainsizey)-1,
358 self.datastarty-1, -1):
360 self.datastarty-1, -1):
359 try:
361 try:
360 row = self.getrow(i)
362 row = self.getrow(i)
361 except IndexError:
363 except IndexError:
362 # we didn't have enough objects to fill the screen
364 # we didn't have enough objects to fill the screen
363 break
365 break
364 self.displayrows.insert(0, row)
366 self.displayrows.insert(0, row)
365 else: # we did scroll down
367 else: # we did scroll down
366 # drop rows from the start
368 # drop rows from the start
367 del self.displayrows[:self.datastarty-olddatastarty]
369 del self.displayrows[:self.datastarty-olddatastarty]
368 # fetch new items
370 # fetch new items
369 for i in xrange(max(olddatastarty+self.mainsizey, self.datastarty),
371 for i in xrange(max(olddatastarty+self.mainsizey, self.datastarty),
370 self.datastarty+self.mainsizey):
372 self.datastarty+self.mainsizey):
371 try:
373 try:
372 row = self.getrow(i)
374 row = self.getrow(i)
373 except IndexError:
375 except IndexError:
374 # we didn't have enough objects to fill the screen
376 # we didn't have enough objects to fill the screen
375 break
377 break
376 self.displayrows.append(row)
378 self.displayrows.append(row)
377 self.calcwidths()
379 self.calcwidths()
378
380
379 # Make sure that the cursor didn't leave the data area horizontally
381 # Make sure that the cursor didn't leave the data area horizontally
380 if x < 0:
382 if x < 0:
381 x = 0
383 x = 0
382 elif x >= self.datasizex:
384 elif x >= self.datasizex:
383 x = max(0, self.datasizex-1)
385 x = max(0, self.datasizex-1)
384
386
385 # Make sure that the cursor stays on screen horizontally
387 # Make sure that the cursor stays on screen horizontally
386 if x < self.datastartx+scrollborderx:
388 if x < self.datastartx+scrollborderx:
387 self.datastartx = max(0, x-scrollborderx)
389 self.datastartx = max(0, x-scrollborderx)
388 elif x >= self.datastartx+self.mainsizex-scrollborderx:
390 elif x >= self.datastartx+self.mainsizex-scrollborderx:
389 self.datastartx = max(0, min(x-self.mainsizex+scrollborderx+1,
391 self.datastartx = max(0, min(x-self.mainsizex+scrollborderx+1,
390 self.datasizex-self.mainsizex))
392 self.datasizex-self.mainsizex))
391
393
392 if x == oldx and y == oldy and (x != newx or y != newy): # couldn't move
394 if x == oldx and y == oldy and (x != newx or y != newy): # couldn't move
393 self.browser.beep()
395 self.browser.beep()
394 else:
396 else:
395 self.curx = x
397 self.curx = x
396 self.cury = y
398 self.cury = y
397 self.calcdisplayattr()
399 self.calcdisplayattr()
398
400
399 def sort(self, key, reverse=False):
401 def sort(self, key, reverse=False):
400 """
402 """
401 Sort the currently list of items using the key function ``key``. If
403 Sort the currently list of items using the key function ``key``. If
402 ``reverse`` is true the sort order is reversed.
404 ``reverse`` is true the sort order is reversed.
403 """
405 """
404 curitem = self.items[self.cury] # Remember where the cursor is now
406 curitem = self.items[self.cury] # Remember where the cursor is now
405
407
406 # Sort items
408 # Sort items
407 def realkey(item):
409 def realkey(item):
408 return key(item.item)
410 return key(item.item)
409 self.items = ipipe.deque(sorted(self.items, key=realkey, reverse=reverse))
411 self.items = ipipe.deque(sorted(self.items, key=realkey, reverse=reverse))
410
412
411 # Find out where the object under the cursor went
413 # Find out where the object under the cursor went
412 cury = self.cury
414 cury = self.cury
413 for (i, item) in enumerate(self.items):
415 for (i, item) in enumerate(self.items):
414 if item is curitem:
416 if item is curitem:
415 cury = i
417 cury = i
416 break
418 break
417
419
418 self.moveto(self.curx, cury, refresh=True)
420 self.moveto(self.curx, cury, refresh=True)
419
421
420 def refresh(self):
422 def refresh(self):
421 """
423 """
422 Restart iterating the input.
424 Restart iterating the input.
423 """
425 """
424 self.iterator = ipipe.xiter(self.input)
426 self.iterator = ipipe.xiter(self.input)
425 self.items.clear()
427 self.items.clear()
426 self.exhausted = False
428 self.exhausted = False
427 self.datastartx = self.datastarty = 0
429 self.datastartx = self.datastarty = 0
428 self.moveto(0, 0, refresh=True)
430 self.moveto(0, 0, refresh=True)
429
431
430 def refreshfind(self):
432 def refreshfind(self):
431 """
433 """
432 Restart iterating the input and go back to the same object as before
434 Restart iterating the input and go back to the same object as before
433 (if it can be found in the new iterator).
435 (if it can be found in the new iterator).
434 """
436 """
435 try:
437 try:
436 oldobject = self.items[self.cury].item
438 oldobject = self.items[self.cury].item
437 except IndexError:
439 except IndexError:
438 oldobject = ipipe.noitem
440 oldobject = ipipe.noitem
439 self.iterator = ipipe.xiter(self.input)
441 self.iterator = ipipe.xiter(self.input)
440 self.items.clear()
442 self.items.clear()
441 self.exhausted = False
443 self.exhausted = False
442 while True:
444 while True:
443 self.fetch(len(self.items)+1)
445 self.fetch(len(self.items)+1)
444 if self.exhausted:
446 if self.exhausted:
445 curses.beep()
447 curses.beep()
446 self.datastartx = self.datastarty = 0
448 self.datastartx = self.datastarty = 0
447 self.moveto(self.curx, 0, refresh=True)
449 self.moveto(self.curx, 0, refresh=True)
448 break
450 break
449 if self.items[-1].item == oldobject:
451 if self.items[-1].item == oldobject:
450 self.datastartx = self.datastarty = 0
452 self.datastartx = self.datastarty = 0
451 self.moveto(self.curx, len(self.items)-1, refresh=True)
453 self.moveto(self.curx, len(self.items)-1, refresh=True)
452 break
454 break
453
455
454
456
455 class _CommandInput(object):
457 class _CommandInput(object):
456 keymap = Keymap()
458 keymap = Keymap()
457 keymap.register("left", curses.KEY_LEFT)
459 keymap.register("left", curses.KEY_LEFT)
458 keymap.register("right", curses.KEY_RIGHT)
460 keymap.register("right", curses.KEY_RIGHT)
459 keymap.register("home", curses.KEY_HOME, "\x01") # Ctrl-A
461 keymap.register("home", curses.KEY_HOME, "\x01") # Ctrl-A
460 keymap.register("end", curses.KEY_END, "\x05") # Ctrl-E
462 keymap.register("end", curses.KEY_END, "\x05") # Ctrl-E
461 # FIXME: What's happening here?
463 # FIXME: What's happening here?
462 keymap.register("backspace", curses.KEY_BACKSPACE, "\x08\x7f")
464 keymap.register("backspace", curses.KEY_BACKSPACE, "\x08\x7f")
463 keymap.register("delete", curses.KEY_DC)
465 keymap.register("delete", curses.KEY_DC)
464 keymap.register("delend", 0x0b) # Ctrl-K
466 keymap.register("delend", 0x0b) # Ctrl-K
465 keymap.register("execute", "\r\n")
467 keymap.register("execute", "\r\n")
466 keymap.register("up", curses.KEY_UP)
468 keymap.register("up", curses.KEY_UP)
467 keymap.register("down", curses.KEY_DOWN)
469 keymap.register("down", curses.KEY_DOWN)
468 keymap.register("incsearchup", curses.KEY_PPAGE)
470 keymap.register("incsearchup", curses.KEY_PPAGE)
469 keymap.register("incsearchdown", curses.KEY_NPAGE)
471 keymap.register("incsearchdown", curses.KEY_NPAGE)
470 keymap.register("exit", "\x18"), # Ctrl-X
472 keymap.register("exit", "\x18"), # Ctrl-X
471
473
472 def __init__(self, prompt):
474 def __init__(self, prompt):
473 self.prompt = prompt
475 self.prompt = prompt
474 self.history = []
476 self.history = []
475 self.maxhistory = 100
477 self.maxhistory = 100
476 self.input = ""
478 self.input = ""
477 self.curx = 0
479 self.curx = 0
478 self.cury = -1 # blank line
480 self.cury = -1 # blank line
479
481
480 def start(self):
482 def start(self):
481 self.input = ""
483 self.input = ""
482 self.curx = 0
484 self.curx = 0
483 self.cury = -1 # blank line
485 self.cury = -1 # blank line
484
486
485 def handlekey(self, browser, key):
487 def handlekey(self, browser, key):
486 cmdname = self.keymap.get(key, None)
488 cmdname = self.keymap.get(key, None)
487 if cmdname is not None:
489 if cmdname is not None:
488 cmdfunc = getattr(self, "cmd_%s" % cmdname, None)
490 cmdfunc = getattr(self, "cmd_%s" % cmdname, None)
489 if cmdfunc is not None:
491 if cmdfunc is not None:
490 return cmdfunc(browser)
492 return cmdfunc(browser)
491 curses.beep()
493 curses.beep()
492 elif key != -1:
494 elif key != -1:
493 try:
495 try:
494 char = chr(key)
496 char = chr(key)
495 except ValueError:
497 except ValueError:
496 curses.beep()
498 curses.beep()
497 else:
499 else:
498 return self.handlechar(browser, char)
500 return self.handlechar(browser, char)
499
501
500 def handlechar(self, browser, char):
502 def handlechar(self, browser, char):
501 self.input = self.input[:self.curx] + char + self.input[self.curx:]
503 self.input = self.input[:self.curx] + char + self.input[self.curx:]
502 self.curx += 1
504 self.curx += 1
503 return True
505 return True
504
506
505 def dohistory(self):
507 def dohistory(self):
506 self.history.insert(0, self.input)
508 self.history.insert(0, self.input)
507 del self.history[:-self.maxhistory]
509 del self.history[:-self.maxhistory]
508
510
509 def cmd_backspace(self, browser):
511 def cmd_backspace(self, browser):
510 if self.curx:
512 if self.curx:
511 self.input = self.input[:self.curx-1] + self.input[self.curx:]
513 self.input = self.input[:self.curx-1] + self.input[self.curx:]
512 self.curx -= 1
514 self.curx -= 1
513 return True
515 return True
514 else:
516 else:
515 curses.beep()
517 curses.beep()
516
518
517 def cmd_delete(self, browser):
519 def cmd_delete(self, browser):
518 if self.curx<len(self.input):
520 if self.curx<len(self.input):
519 self.input = self.input[:self.curx] + self.input[self.curx+1:]
521 self.input = self.input[:self.curx] + self.input[self.curx+1:]
520 return True
522 return True
521 else:
523 else:
522 curses.beep()
524 curses.beep()
523
525
524 def cmd_delend(self, browser):
526 def cmd_delend(self, browser):
525 if self.curx<len(self.input):
527 if self.curx<len(self.input):
526 self.input = self.input[:self.curx]
528 self.input = self.input[:self.curx]
527 return True
529 return True
528
530
529 def cmd_left(self, browser):
531 def cmd_left(self, browser):
530 if self.curx:
532 if self.curx:
531 self.curx -= 1
533 self.curx -= 1
532 return True
534 return True
533 else:
535 else:
534 curses.beep()
536 curses.beep()
535
537
536 def cmd_right(self, browser):
538 def cmd_right(self, browser):
537 if self.curx < len(self.input):
539 if self.curx < len(self.input):
538 self.curx += 1
540 self.curx += 1
539 return True
541 return True
540 else:
542 else:
541 curses.beep()
543 curses.beep()
542
544
543 def cmd_home(self, browser):
545 def cmd_home(self, browser):
544 if self.curx:
546 if self.curx:
545 self.curx = 0
547 self.curx = 0
546 return True
548 return True
547 else:
549 else:
548 curses.beep()
550 curses.beep()
549
551
550 def cmd_end(self, browser):
552 def cmd_end(self, browser):
551 if self.curx < len(self.input):
553 if self.curx < len(self.input):
552 self.curx = len(self.input)
554 self.curx = len(self.input)
553 return True
555 return True
554 else:
556 else:
555 curses.beep()
557 curses.beep()
556
558
557 def cmd_up(self, browser):
559 def cmd_up(self, browser):
558 if self.cury < len(self.history)-1:
560 if self.cury < len(self.history)-1:
559 self.cury += 1
561 self.cury += 1
560 self.input = self.history[self.cury]
562 self.input = self.history[self.cury]
561 self.curx = len(self.input)
563 self.curx = len(self.input)
562 return True
564 return True
563 else:
565 else:
564 curses.beep()
566 curses.beep()
565
567
566 def cmd_down(self, browser):
568 def cmd_down(self, browser):
567 if self.cury >= 0:
569 if self.cury >= 0:
568 self.cury -= 1
570 self.cury -= 1
569 if self.cury>=0:
571 if self.cury>=0:
570 self.input = self.history[self.cury]
572 self.input = self.history[self.cury]
571 else:
573 else:
572 self.input = ""
574 self.input = ""
573 self.curx = len(self.input)
575 self.curx = len(self.input)
574 return True
576 return True
575 else:
577 else:
576 curses.beep()
578 curses.beep()
577
579
578 def cmd_incsearchup(self, browser):
580 def cmd_incsearchup(self, browser):
579 prefix = self.input[:self.curx]
581 prefix = self.input[:self.curx]
580 cury = self.cury
582 cury = self.cury
581 while True:
583 while True:
582 cury += 1
584 cury += 1
583 if cury >= len(self.history):
585 if cury >= len(self.history):
584 break
586 break
585 if self.history[cury].startswith(prefix):
587 if self.history[cury].startswith(prefix):
586 self.input = self.history[cury]
588 self.input = self.history[cury]
587 self.cury = cury
589 self.cury = cury
588 return True
590 return True
589 curses.beep()
591 curses.beep()
590
592
591 def cmd_incsearchdown(self, browser):
593 def cmd_incsearchdown(self, browser):
592 prefix = self.input[:self.curx]
594 prefix = self.input[:self.curx]
593 cury = self.cury
595 cury = self.cury
594 while True:
596 while True:
595 cury -= 1
597 cury -= 1
596 if cury <= 0:
598 if cury <= 0:
597 break
599 break
598 if self.history[cury].startswith(prefix):
600 if self.history[cury].startswith(prefix):
599 self.input = self.history[self.cury]
601 self.input = self.history[self.cury]
600 self.cury = cury
602 self.cury = cury
601 return True
603 return True
602 curses.beep()
604 curses.beep()
603
605
604 def cmd_exit(self, browser):
606 def cmd_exit(self, browser):
605 browser.mode = "default"
607 browser.mode = "default"
606 return True
608 return True
607
609
608 def cmd_execute(self, browser):
610 def cmd_execute(self, browser):
609 raise NotImplementedError
611 raise NotImplementedError
610
612
611
613
612 class _CommandGoto(_CommandInput):
614 class _CommandGoto(_CommandInput):
613 def __init__(self):
615 def __init__(self):
614 _CommandInput.__init__(self, "goto object #")
616 _CommandInput.__init__(self, "goto object #")
615
617
616 def handlechar(self, browser, char):
618 def handlechar(self, browser, char):
617 # Only accept digits
619 # Only accept digits
618 if not "0" <= char <= "9":
620 if not "0" <= char <= "9":
619 curses.beep()
621 curses.beep()
620 else:
622 else:
621 return _CommandInput.handlechar(self, browser, char)
623 return _CommandInput.handlechar(self, browser, char)
622
624
623 def cmd_execute(self, browser):
625 def cmd_execute(self, browser):
624 level = browser.levels[-1]
626 level = browser.levels[-1]
625 if self.input:
627 if self.input:
626 self.dohistory()
628 self.dohistory()
627 level.moveto(level.curx, int(self.input))
629 level.moveto(level.curx, int(self.input))
628 browser.mode = "default"
630 browser.mode = "default"
629 return True
631 return True
630
632
631
633
632 class _CommandFind(_CommandInput):
634 class _CommandFind(_CommandInput):
633 def __init__(self):
635 def __init__(self):
634 _CommandInput.__init__(self, "find expression")
636 _CommandInput.__init__(self, "find expression")
635
637
636 def cmd_execute(self, browser):
638 def cmd_execute(self, browser):
637 level = browser.levels[-1]
639 level = browser.levels[-1]
638 if self.input:
640 if self.input:
639 self.dohistory()
641 self.dohistory()
640 while True:
642 while True:
641 cury = level.cury
643 cury = level.cury
642 level.moveto(level.curx, cury+1)
644 level.moveto(level.curx, cury+1)
643 if cury == level.cury:
645 if cury == level.cury:
644 curses.beep()
646 curses.beep()
645 break # hit end
647 break # hit end
646 item = level.items[level.cury].item
648 item = level.items[level.cury].item
647 try:
649 try:
648 globals = ipipe.getglobals(None)
650 globals = ipipe.getglobals(None)
649 if eval(self.input, globals, ipipe.AttrNamespace(item)):
651 if eval(self.input, globals, ipipe.AttrNamespace(item)):
650 break # found something
652 break # found something
651 except (KeyboardInterrupt, SystemExit):
653 except (KeyboardInterrupt, SystemExit):
652 raise
654 raise
653 except Exception, exc:
655 except Exception, exc:
654 browser.report(exc)
656 browser.report(exc)
655 curses.beep()
657 curses.beep()
656 break # break on error
658 break # break on error
657 browser.mode = "default"
659 browser.mode = "default"
658 return True
660 return True
659
661
660
662
661 class _CommandFindBackwards(_CommandInput):
663 class _CommandFindBackwards(_CommandInput):
662 def __init__(self):
664 def __init__(self):
663 _CommandInput.__init__(self, "find backwards expression")
665 _CommandInput.__init__(self, "find backwards expression")
664
666
665 def cmd_execute(self, browser):
667 def cmd_execute(self, browser):
666 level = browser.levels[-1]
668 level = browser.levels[-1]
667 if self.input:
669 if self.input:
668 self.dohistory()
670 self.dohistory()
669 while level.cury:
671 while level.cury:
670 level.moveto(level.curx, level.cury-1)
672 level.moveto(level.curx, level.cury-1)
671 item = level.items[level.cury].item
673 item = level.items[level.cury].item
672 try:
674 try:
673 globals = ipipe.getglobals(None)
675 globals = ipipe.getglobals(None)
674 if eval(self.input, globals, ipipe.AttrNamespace(item)):
676 if eval(self.input, globals, ipipe.AttrNamespace(item)):
675 break # found something
677 break # found something
676 except (KeyboardInterrupt, SystemExit):
678 except (KeyboardInterrupt, SystemExit):
677 raise
679 raise
678 except Exception, exc:
680 except Exception, exc:
679 browser.report(exc)
681 browser.report(exc)
680 curses.beep()
682 curses.beep()
681 break # break on error
683 break # break on error
682 else:
684 else:
683 curses.beep()
685 curses.beep()
684 browser.mode = "default"
686 browser.mode = "default"
685 return True
687 return True
686
688
687
689
688 class ibrowse(ipipe.Display):
690 class ibrowse(ipipe.Display):
689 # Show this many lines from the previous screen when paging horizontally
691 # Show this many lines from the previous screen when paging horizontally
690 pageoverlapx = 1
692 pageoverlapx = 1
691
693
692 # Show this many lines from the previous screen when paging vertically
694 # Show this many lines from the previous screen when paging vertically
693 pageoverlapy = 1
695 pageoverlapy = 1
694
696
695 # Start scrolling when the cursor is less than this number of columns
697 # Start scrolling when the cursor is less than this number of columns
696 # away from the left or right screen edge
698 # away from the left or right screen edge
697 scrollborderx = 10
699 scrollborderx = 10
698
700
699 # Start scrolling when the cursor is less than this number of lines
701 # Start scrolling when the cursor is less than this number of lines
700 # away from the top or bottom screen edge
702 # away from the top or bottom screen edge
701 scrollbordery = 5
703 scrollbordery = 5
702
704
703 # Accelerate by this factor when scrolling horizontally
705 # Accelerate by this factor when scrolling horizontally
704 acceleratex = 1.05
706 acceleratex = 1.05
705
707
706 # Accelerate by this factor when scrolling vertically
708 # Accelerate by this factor when scrolling vertically
707 acceleratey = 1.05
709 acceleratey = 1.05
708
710
709 # The maximum horizontal scroll speed
711 # The maximum horizontal scroll speed
710 # (as a factor of the screen width (i.e. 0.5 == half a screen width)
712 # (as a factor of the screen width (i.e. 0.5 == half a screen width)
711 maxspeedx = 0.5
713 maxspeedx = 0.5
712
714
713 # The maximum vertical scroll speed
715 # The maximum vertical scroll speed
714 # (as a factor of the screen height (i.e. 0.5 == half a screen height)
716 # (as a factor of the screen height (i.e. 0.5 == half a screen height)
715 maxspeedy = 0.5
717 maxspeedy = 0.5
716
718
717 # The maximum number of header lines for browser level
719 # The maximum number of header lines for browser level
718 # if the nesting is deeper, only the innermost levels are displayed
720 # if the nesting is deeper, only the innermost levels are displayed
719 maxheaders = 5
721 maxheaders = 5
720
722
721 # The approximate maximum length of a column entry
723 # The approximate maximum length of a column entry
722 maxattrlength = 200
724 maxattrlength = 200
723
725
724 # Styles for various parts of the GUI
726 # Styles for various parts of the GUI
725 style_objheadertext = astyle.Style.fromstr("white:black:bold|reverse")
727 style_objheadertext = astyle.Style.fromstr("white:black:bold|reverse")
726 style_objheadernumber = astyle.Style.fromstr("white:blue:bold|reverse")
728 style_objheadernumber = astyle.Style.fromstr("white:blue:bold|reverse")
727 style_objheaderobject = astyle.Style.fromstr("white:black:reverse")
729 style_objheaderobject = astyle.Style.fromstr("white:black:reverse")
728 style_colheader = astyle.Style.fromstr("blue:white:reverse")
730 style_colheader = astyle.Style.fromstr("blue:white:reverse")
729 style_colheaderhere = astyle.Style.fromstr("green:black:bold|reverse")
731 style_colheaderhere = astyle.Style.fromstr("green:black:bold|reverse")
730 style_colheadersep = astyle.Style.fromstr("blue:black:reverse")
732 style_colheadersep = astyle.Style.fromstr("blue:black:reverse")
731 style_number = astyle.Style.fromstr("blue:white:reverse")
733 style_number = astyle.Style.fromstr("blue:white:reverse")
732 style_numberhere = astyle.Style.fromstr("green:black:bold|reverse")
734 style_numberhere = astyle.Style.fromstr("green:black:bold|reverse")
733 style_sep = astyle.Style.fromstr("blue:black")
735 style_sep = astyle.Style.fromstr("blue:black")
734 style_data = astyle.Style.fromstr("white:black")
736 style_data = astyle.Style.fromstr("white:black")
735 style_datapad = astyle.Style.fromstr("blue:black:bold")
737 style_datapad = astyle.Style.fromstr("blue:black:bold")
736 style_footer = astyle.Style.fromstr("black:white")
738 style_footer = astyle.Style.fromstr("black:white")
737 style_report = astyle.Style.fromstr("white:black")
739 style_report = astyle.Style.fromstr("white:black")
738
740
739 # Column separator in header
741 # Column separator in header
740 headersepchar = "|"
742 headersepchar = "|"
741
743
742 # Character for padding data cell entries
744 # Character for padding data cell entries
743 datapadchar = "."
745 datapadchar = "."
744
746
745 # Column separator in data area
747 # Column separator in data area
746 datasepchar = "|"
748 datasepchar = "|"
747
749
748 # Character to use for "empty" cell (i.e. for non-existing attributes)
750 # Character to use for "empty" cell (i.e. for non-existing attributes)
749 nodatachar = "-"
751 nodatachar = "-"
750
752
751 # Prompts for modes that require keyboard input
753 # Prompts for modes that require keyboard input
752 prompts = {
754 prompts = {
753 "goto": _CommandGoto(),
755 "goto": _CommandGoto(),
754 "find": _CommandFind(),
756 "find": _CommandFind(),
755 "findbackwards": _CommandFindBackwards()
757 "findbackwards": _CommandFindBackwards()
756 }
758 }
757
759
758 # Maps curses key codes to "function" names
760 # Maps curses key codes to "function" names
759 keymap = Keymap()
761 keymap = Keymap()
760 keymap.register("quit", "q")
762 keymap.register("quit", "q")
761 keymap.register("up", curses.KEY_UP)
763 keymap.register("up", curses.KEY_UP)
762 keymap.register("down", curses.KEY_DOWN)
764 keymap.register("down", curses.KEY_DOWN)
763 keymap.register("pageup", curses.KEY_PPAGE)
765 keymap.register("pageup", curses.KEY_PPAGE)
764 keymap.register("pagedown", curses.KEY_NPAGE)
766 keymap.register("pagedown", curses.KEY_NPAGE)
765 keymap.register("left", curses.KEY_LEFT)
767 keymap.register("left", curses.KEY_LEFT)
766 keymap.register("right", curses.KEY_RIGHT)
768 keymap.register("right", curses.KEY_RIGHT)
767 keymap.register("home", curses.KEY_HOME, "\x01")
769 keymap.register("home", curses.KEY_HOME, "\x01")
768 keymap.register("end", curses.KEY_END, "\x05")
770 keymap.register("end", curses.KEY_END, "\x05")
769 keymap.register("prevattr", "<\x1b")
771 keymap.register("prevattr", "<\x1b")
770 keymap.register("nextattr", ">\t")
772 keymap.register("nextattr", ">\t")
771 keymap.register("pick", "p")
773 keymap.register("pick", "p")
772 keymap.register("pickattr", "P")
774 keymap.register("pickattr", "P")
773 keymap.register("pickallattrs", "C")
775 keymap.register("pickallattrs", "C")
774 keymap.register("pickmarked", "m")
776 keymap.register("pickmarked", "m")
775 keymap.register("pickmarkedattr", "M")
777 keymap.register("pickmarkedattr", "M")
778 keymap.register("pickinput", "i")
779 keymap.register("pickinputattr", "I")
776 keymap.register("hideattr", "h")
780 keymap.register("hideattr", "h")
777 keymap.register("unhideattrs", "H")
781 keymap.register("unhideattrs", "H")
778 keymap.register("help", "?")
782 keymap.register("help", "?")
779 keymap.register("enter", "\r\n")
783 keymap.register("enter", "\r\n")
780 keymap.register("enterattr", "E")
784 keymap.register("enterattr", "E")
781 # FIXME: What's happening here?
785 # FIXME: What's happening here?
782 keymap.register("leave", curses.KEY_BACKSPACE, "x\x08\x7f")
786 keymap.register("leave", curses.KEY_BACKSPACE, "x\x08\x7f")
783 keymap.register("detail", "d")
787 keymap.register("detail", "d")
784 keymap.register("detailattr", "D")
788 keymap.register("detailattr", "D")
785 keymap.register("tooglemark", " ")
789 keymap.register("tooglemark", " ")
786 keymap.register("markrange", "%")
790 keymap.register("markrange", "%")
787 keymap.register("sortattrasc", "v")
791 keymap.register("sortattrasc", "v")
788 keymap.register("sortattrdesc", "V")
792 keymap.register("sortattrdesc", "V")
789 keymap.register("goto", "g")
793 keymap.register("goto", "g")
790 keymap.register("find", "f")
794 keymap.register("find", "f")
791 keymap.register("findbackwards", "b")
795 keymap.register("findbackwards", "b")
792 keymap.register("refresh", "r")
796 keymap.register("refresh", "r")
793 keymap.register("refreshfind", "R")
797 keymap.register("refreshfind", "R")
794
798
795 def __init__(self, *attrs):
799 def __init__(self, *attrs):
796 """
800 """
797 Create a new browser. If ``attrs`` is not empty, it is the list
801 Create a new browser. If ``attrs`` is not empty, it is the list
798 of attributes that will be displayed in the browser, otherwise
802 of attributes that will be displayed in the browser, otherwise
799 these will be determined by the objects on screen.
803 these will be determined by the objects on screen.
800 """
804 """
801 self.attrs = attrs
805 self.attrs = attrs
802
806
803 # Stack of browser levels
807 # Stack of browser levels
804 self.levels = []
808 self.levels = []
805 # how many colums to scroll (Changes when accelerating)
809 # how many colums to scroll (Changes when accelerating)
806 self.stepx = 1.
810 self.stepx = 1.
807
811
808 # how many rows to scroll (Changes when accelerating)
812 # how many rows to scroll (Changes when accelerating)
809 self.stepy = 1.
813 self.stepy = 1.
810
814
811 # Beep on the edges of the data area? (Will be set to ``False``
815 # Beep on the edges of the data area? (Will be set to ``False``
812 # once the cursor hits the edge of the screen, so we don't get
816 # once the cursor hits the edge of the screen, so we don't get
813 # multiple beeps).
817 # multiple beeps).
814 self._dobeep = True
818 self._dobeep = True
815
819
816 # Cache for registered ``curses`` colors and styles.
820 # Cache for registered ``curses`` colors and styles.
817 self._styles = {}
821 self._styles = {}
818 self._colors = {}
822 self._colors = {}
819 self._maxcolor = 1
823 self._maxcolor = 1
820
824
821 # How many header lines do we want to paint (the numbers of levels
825 # How many header lines do we want to paint (the numbers of levels
822 # we have, but with an upper bound)
826 # we have, but with an upper bound)
823 self._headerlines = 1
827 self._headerlines = 1
824
828
825 # Index of first header line
829 # Index of first header line
826 self._firstheaderline = 0
830 self._firstheaderline = 0
827
831
828 # curses window
832 # curses window
829 self.scr = None
833 self.scr = None
830 # report in the footer line (error, executed command etc.)
834 # report in the footer line (error, executed command etc.)
831 self._report = None
835 self._report = None
832
836
833 # value to be returned to the caller (set by commands)
837 # value to be returned to the caller (set by commands)
834 self.returnvalue = None
838 self.returnvalue = None
835
839
836 # The mode the browser is in
840 # The mode the browser is in
837 # e.g. normal browsing or entering an argument for a command
841 # e.g. normal browsing or entering an argument for a command
838 self.mode = "default"
842 self.mode = "default"
839
843
840 # set by the SIGWINCH signal handler
844 # set by the SIGWINCH signal handler
841 self.resized = False
845 self.resized = False
842
846
843 def nextstepx(self, step):
847 def nextstepx(self, step):
844 """
848 """
845 Accelerate horizontally.
849 Accelerate horizontally.
846 """
850 """
847 return max(1., min(step*self.acceleratex,
851 return max(1., min(step*self.acceleratex,
848 self.maxspeedx*self.levels[-1].mainsizex))
852 self.maxspeedx*self.levels[-1].mainsizex))
849
853
850 def nextstepy(self, step):
854 def nextstepy(self, step):
851 """
855 """
852 Accelerate vertically.
856 Accelerate vertically.
853 """
857 """
854 return max(1., min(step*self.acceleratey,
858 return max(1., min(step*self.acceleratey,
855 self.maxspeedy*self.levels[-1].mainsizey))
859 self.maxspeedy*self.levels[-1].mainsizey))
856
860
857 def getstyle(self, style):
861 def getstyle(self, style):
858 """
862 """
859 Register the ``style`` with ``curses`` or get it from the cache,
863 Register the ``style`` with ``curses`` or get it from the cache,
860 if it has been registered before.
864 if it has been registered before.
861 """
865 """
862 try:
866 try:
863 return self._styles[style.fg, style.bg, style.attrs]
867 return self._styles[style.fg, style.bg, style.attrs]
864 except KeyError:
868 except KeyError:
865 attrs = 0
869 attrs = 0
866 for b in astyle.A2CURSES:
870 for b in astyle.A2CURSES:
867 if style.attrs & b:
871 if style.attrs & b:
868 attrs |= astyle.A2CURSES[b]
872 attrs |= astyle.A2CURSES[b]
869 try:
873 try:
870 color = self._colors[style.fg, style.bg]
874 color = self._colors[style.fg, style.bg]
871 except KeyError:
875 except KeyError:
872 curses.init_pair(
876 curses.init_pair(
873 self._maxcolor,
877 self._maxcolor,
874 astyle.COLOR2CURSES[style.fg],
878 astyle.COLOR2CURSES[style.fg],
875 astyle.COLOR2CURSES[style.bg]
879 astyle.COLOR2CURSES[style.bg]
876 )
880 )
877 color = curses.color_pair(self._maxcolor)
881 color = curses.color_pair(self._maxcolor)
878 self._colors[style.fg, style.bg] = color
882 self._colors[style.fg, style.bg] = color
879 self._maxcolor += 1
883 self._maxcolor += 1
880 c = color | attrs
884 c = color | attrs
881 self._styles[style.fg, style.bg, style.attrs] = c
885 self._styles[style.fg, style.bg, style.attrs] = c
882 return c
886 return c
883
887
884 def addstr(self, y, x, begx, endx, text, style):
888 def addstr(self, y, x, begx, endx, text, style):
885 """
889 """
886 A version of ``curses.addstr()`` that can handle ``x`` coordinates
890 A version of ``curses.addstr()`` that can handle ``x`` coordinates
887 that are outside the screen.
891 that are outside the screen.
888 """
892 """
889 text2 = text[max(0, begx-x):max(0, endx-x)]
893 text2 = text[max(0, begx-x):max(0, endx-x)]
890 if text2:
894 if text2:
891 self.scr.addstr(y, max(x, begx), text2, self.getstyle(style))
895 self.scr.addstr(y, max(x, begx), text2, self.getstyle(style))
892 return len(text)
896 return len(text)
893
897
894 def addchr(self, y, x, begx, endx, c, l, style):
898 def addchr(self, y, x, begx, endx, c, l, style):
895 x0 = max(x, begx)
899 x0 = max(x, begx)
896 x1 = min(x+l, endx)
900 x1 = min(x+l, endx)
897 if x1>x0:
901 if x1>x0:
898 self.scr.addstr(y, x0, c*(x1-x0), self.getstyle(style))
902 self.scr.addstr(y, x0, c*(x1-x0), self.getstyle(style))
899 return l
903 return l
900
904
901 def _calcheaderlines(self, levels):
905 def _calcheaderlines(self, levels):
902 # Calculate how many headerlines do we have to display, if we have
906 # Calculate how many headerlines do we have to display, if we have
903 # ``levels`` browser levels
907 # ``levels`` browser levels
904 if levels is None:
908 if levels is None:
905 levels = len(self.levels)
909 levels = len(self.levels)
906 self._headerlines = min(self.maxheaders, levels)
910 self._headerlines = min(self.maxheaders, levels)
907 self._firstheaderline = levels-self._headerlines
911 self._firstheaderline = levels-self._headerlines
908
912
909 def getstylehere(self, style):
913 def getstylehere(self, style):
910 """
914 """
911 Return a style for displaying the original style ``style``
915 Return a style for displaying the original style ``style``
912 in the row the cursor is on.
916 in the row the cursor is on.
913 """
917 """
914 return astyle.Style(style.fg, astyle.COLOR_BLUE, style.attrs | astyle.A_BOLD)
918 return astyle.Style(style.fg, astyle.COLOR_BLUE, style.attrs | astyle.A_BOLD)
915
919
916 def report(self, msg):
920 def report(self, msg):
917 """
921 """
918 Store the message ``msg`` for display below the footer line. This
922 Store the message ``msg`` for display below the footer line. This
919 will be displayed as soon as the screen is redrawn.
923 will be displayed as soon as the screen is redrawn.
920 """
924 """
921 self._report = msg
925 self._report = msg
922
926
923 def enter(self, item, *attrs):
927 def enter(self, item, *attrs):
924 """
928 """
925 Enter the object ``item``. If ``attrs`` is specified, it will be used
929 Enter the object ``item``. If ``attrs`` is specified, it will be used
926 as a fixed list of attributes to display.
930 as a fixed list of attributes to display.
927 """
931 """
928 if self.levels and item is self.levels[-1].input:
932 if self.levels and item is self.levels[-1].input:
929 curses.beep()
933 curses.beep()
930 self.report(CommandError("Recursion on input object"))
934 self.report(CommandError("Recursion on input object"))
931 else:
935 else:
932 oldlevels = len(self.levels)
936 oldlevels = len(self.levels)
933 self._calcheaderlines(oldlevels+1)
937 self._calcheaderlines(oldlevels+1)
934 try:
938 try:
935 level = _BrowserLevel(
939 level = _BrowserLevel(
936 self,
940 self,
937 item,
941 item,
938 self.scrsizey-1-self._headerlines-2,
942 self.scrsizey-1-self._headerlines-2,
939 *attrs
943 *attrs
940 )
944 )
941 except (KeyboardInterrupt, SystemExit):
945 except (KeyboardInterrupt, SystemExit):
942 raise
946 raise
943 except Exception, exc:
947 except Exception, exc:
944 if not self.levels:
948 if not self.levels:
945 raise
949 raise
946 self._calcheaderlines(oldlevels)
950 self._calcheaderlines(oldlevels)
947 curses.beep()
951 curses.beep()
948 self.report(exc)
952 self.report(exc)
949 else:
953 else:
950 self.levels.append(level)
954 self.levels.append(level)
951
955
952 def startkeyboardinput(self, mode):
956 def startkeyboardinput(self, mode):
953 """
957 """
954 Enter mode ``mode``, which requires keyboard input.
958 Enter mode ``mode``, which requires keyboard input.
955 """
959 """
956 self.mode = mode
960 self.mode = mode
957 self.prompts[mode].start()
961 self.prompts[mode].start()
958
962
959 def keylabel(self, keycode):
963 def keylabel(self, keycode):
960 """
964 """
961 Return a pretty name for the ``curses`` key ``keycode`` (used in the
965 Return a pretty name for the ``curses`` key ``keycode`` (used in the
962 help screen and in reports about unassigned keys).
966 help screen and in reports about unassigned keys).
963 """
967 """
964 if keycode <= 0xff:
968 if keycode <= 0xff:
965 specialsnames = {
969 specialsnames = {
966 ord("\n"): "RETURN",
970 ord("\n"): "RETURN",
967 ord(" "): "SPACE",
971 ord(" "): "SPACE",
968 ord("\t"): "TAB",
972 ord("\t"): "TAB",
969 ord("\x7f"): "DELETE",
973 ord("\x7f"): "DELETE",
970 ord("\x08"): "BACKSPACE",
974 ord("\x08"): "BACKSPACE",
971 }
975 }
972 if keycode in specialsnames:
976 if keycode in specialsnames:
973 return specialsnames[keycode]
977 return specialsnames[keycode]
974 elif 0x00 < keycode < 0x20:
978 elif 0x00 < keycode < 0x20:
975 return "CTRL-%s" % chr(keycode + 64)
979 return "CTRL-%s" % chr(keycode + 64)
976 return repr(chr(keycode))
980 return repr(chr(keycode))
977 for name in dir(curses):
981 for name in dir(curses):
978 if name.startswith("KEY_") and getattr(curses, name) == keycode:
982 if name.startswith("KEY_") and getattr(curses, name) == keycode:
979 return name
983 return name
980 return str(keycode)
984 return str(keycode)
981
985
982 def beep(self, force=False):
986 def beep(self, force=False):
983 if force or self._dobeep:
987 if force or self._dobeep:
984 curses.beep()
988 curses.beep()
985 # don't beep again (as long as the same key is pressed)
989 # don't beep again (as long as the same key is pressed)
986 self._dobeep = False
990 self._dobeep = False
987
991
988 def cmd_up(self):
992 def cmd_up(self):
989 """
993 """
990 Move the cursor to the previous row.
994 Move the cursor to the previous row.
991 """
995 """
992 level = self.levels[-1]
996 level = self.levels[-1]
993 self.report("up")
997 self.report("up")
994 level.moveto(level.curx, level.cury-self.stepy)
998 level.moveto(level.curx, level.cury-self.stepy)
995
999
996 def cmd_down(self):
1000 def cmd_down(self):
997 """
1001 """
998 Move the cursor to the next row.
1002 Move the cursor to the next row.
999 """
1003 """
1000 level = self.levels[-1]
1004 level = self.levels[-1]
1001 self.report("down")
1005 self.report("down")
1002 level.moveto(level.curx, level.cury+self.stepy)
1006 level.moveto(level.curx, level.cury+self.stepy)
1003
1007
1004 def cmd_pageup(self):
1008 def cmd_pageup(self):
1005 """
1009 """
1006 Move the cursor up one page.
1010 Move the cursor up one page.
1007 """
1011 """
1008 level = self.levels[-1]
1012 level = self.levels[-1]
1009 self.report("page up")
1013 self.report("page up")
1010 level.moveto(level.curx, level.cury-level.mainsizey+self.pageoverlapy)
1014 level.moveto(level.curx, level.cury-level.mainsizey+self.pageoverlapy)
1011
1015
1012 def cmd_pagedown(self):
1016 def cmd_pagedown(self):
1013 """
1017 """
1014 Move the cursor down one page.
1018 Move the cursor down one page.
1015 """
1019 """
1016 level = self.levels[-1]
1020 level = self.levels[-1]
1017 self.report("page down")
1021 self.report("page down")
1018 level.moveto(level.curx, level.cury+level.mainsizey-self.pageoverlapy)
1022 level.moveto(level.curx, level.cury+level.mainsizey-self.pageoverlapy)
1019
1023
1020 def cmd_left(self):
1024 def cmd_left(self):
1021 """
1025 """
1022 Move the cursor left.
1026 Move the cursor left.
1023 """
1027 """
1024 level = self.levels[-1]
1028 level = self.levels[-1]
1025 self.report("left")
1029 self.report("left")
1026 level.moveto(level.curx-self.stepx, level.cury)
1030 level.moveto(level.curx-self.stepx, level.cury)
1027
1031
1028 def cmd_right(self):
1032 def cmd_right(self):
1029 """
1033 """
1030 Move the cursor right.
1034 Move the cursor right.
1031 """
1035 """
1032 level = self.levels[-1]
1036 level = self.levels[-1]
1033 self.report("right")
1037 self.report("right")
1034 level.moveto(level.curx+self.stepx, level.cury)
1038 level.moveto(level.curx+self.stepx, level.cury)
1035
1039
1036 def cmd_home(self):
1040 def cmd_home(self):
1037 """
1041 """
1038 Move the cursor to the first column.
1042 Move the cursor to the first column.
1039 """
1043 """
1040 level = self.levels[-1]
1044 level = self.levels[-1]
1041 self.report("home")
1045 self.report("home")
1042 level.moveto(0, level.cury)
1046 level.moveto(0, level.cury)
1043
1047
1044 def cmd_end(self):
1048 def cmd_end(self):
1045 """
1049 """
1046 Move the cursor to the last column.
1050 Move the cursor to the last column.
1047 """
1051 """
1048 level = self.levels[-1]
1052 level = self.levels[-1]
1049 self.report("end")
1053 self.report("end")
1050 level.moveto(level.datasizex+level.mainsizey-self.pageoverlapx, level.cury)
1054 level.moveto(level.datasizex+level.mainsizey-self.pageoverlapx, level.cury)
1051
1055
1052 def cmd_prevattr(self):
1056 def cmd_prevattr(self):
1053 """
1057 """
1054 Move the cursor one attribute column to the left.
1058 Move the cursor one attribute column to the left.
1055 """
1059 """
1056 level = self.levels[-1]
1060 level = self.levels[-1]
1057 if level.displayattr[0] is None or level.displayattr[0] == 0:
1061 if level.displayattr[0] is None or level.displayattr[0] == 0:
1058 self.beep()
1062 self.beep()
1059 else:
1063 else:
1060 self.report("prevattr")
1064 self.report("prevattr")
1061 pos = 0
1065 pos = 0
1062 for (i, attrname) in enumerate(level.displayattrs):
1066 for (i, attrname) in enumerate(level.displayattrs):
1063 if i == level.displayattr[0]-1:
1067 if i == level.displayattr[0]-1:
1064 break
1068 break
1065 pos += level.colwidths[attrname] + 1
1069 pos += level.colwidths[attrname] + 1
1066 level.moveto(pos, level.cury)
1070 level.moveto(pos, level.cury)
1067
1071
1068 def cmd_nextattr(self):
1072 def cmd_nextattr(self):
1069 """
1073 """
1070 Move the cursor one attribute column to the right.
1074 Move the cursor one attribute column to the right.
1071 """
1075 """
1072 level = self.levels[-1]
1076 level = self.levels[-1]
1073 if level.displayattr[0] is None or level.displayattr[0] == len(level.displayattrs)-1:
1077 if level.displayattr[0] is None or level.displayattr[0] == len(level.displayattrs)-1:
1074 self.beep()
1078 self.beep()
1075 else:
1079 else:
1076 self.report("nextattr")
1080 self.report("nextattr")
1077 pos = 0
1081 pos = 0
1078 for (i, attrname) in enumerate(level.displayattrs):
1082 for (i, attrname) in enumerate(level.displayattrs):
1079 if i == level.displayattr[0]+1:
1083 if i == level.displayattr[0]+1:
1080 break
1084 break
1081 pos += level.colwidths[attrname] + 1
1085 pos += level.colwidths[attrname] + 1
1082 level.moveto(pos, level.cury)
1086 level.moveto(pos, level.cury)
1083
1087
1084 def cmd_pick(self):
1088 def cmd_pick(self):
1085 """
1089 """
1086 'Pick' the object under the cursor (i.e. the row the cursor is on).
1090 'Pick' the object under the cursor (i.e. the row the cursor is on).
1087 This leaves the browser and returns the picked object to the caller.
1091 This leaves the browser and returns the picked object to the caller.
1088 (In IPython this object will be available as the ``_`` variable.)
1092 (In IPython this object will be available as the ``_`` variable.)
1089 """
1093 """
1090 level = self.levels[-1]
1094 level = self.levels[-1]
1091 self.returnvalue = level.items[level.cury].item
1095 self.returnvalue = level.items[level.cury].item
1092 return True
1096 return True
1093
1097
1094 def cmd_pickattr(self):
1098 def cmd_pickattr(self):
1095 """
1099 """
1096 'Pick' the attribute under the cursor (i.e. the row/column the
1100 'Pick' the attribute under the cursor (i.e. the row/column the
1097 cursor is on).
1101 cursor is on).
1098 """
1102 """
1099 level = self.levels[-1]
1103 level = self.levels[-1]
1100 attr = level.displayattr[1]
1104 attr = level.displayattr[1]
1101 if attr is ipipe.noitem:
1105 if attr is ipipe.noitem:
1102 curses.beep()
1106 curses.beep()
1103 self.report(CommandError("no column under cursor"))
1107 self.report(CommandError("no column under cursor"))
1104 return
1108 return
1105 value = attr.value(level.items[level.cury].item)
1109 value = attr.value(level.items[level.cury].item)
1106 if value is ipipe.noitem:
1110 if value is ipipe.noitem:
1107 curses.beep()
1111 curses.beep()
1108 self.report(AttributeError(attr.name()))
1112 self.report(AttributeError(attr.name()))
1109 else:
1113 else:
1110 self.returnvalue = value
1114 self.returnvalue = value
1111 return True
1115 return True
1112
1116
1113 def cmd_pickallattrs(self):
1117 def cmd_pickallattrs(self):
1114 """
1118 """
1115 Pick' the complete column under the cursor (i.e. the attribute under
1119 Pick' the complete column under the cursor (i.e. the attribute under
1116 the cursor) from all currently fetched objects. These attributes
1120 the cursor) from all currently fetched objects. These attributes
1117 will be returned as a list.
1121 will be returned as a list.
1118 """
1122 """
1119 level = self.levels[-1]
1123 level = self.levels[-1]
1120 attr = level.displayattr[1]
1124 attr = level.displayattr[1]
1121 if attr is ipipe.noitem:
1125 if attr is ipipe.noitem:
1122 curses.beep()
1126 curses.beep()
1123 self.report(CommandError("no column under cursor"))
1127 self.report(CommandError("no column under cursor"))
1124 return
1128 return
1125 result = []
1129 result = []
1126 for cache in level.items:
1130 for cache in level.items:
1127 value = attr.value(cache.item)
1131 value = attr.value(cache.item)
1128 if value is not ipipe.noitem:
1132 if value is not ipipe.noitem:
1129 result.append(value)
1133 result.append(value)
1130 self.returnvalue = result
1134 self.returnvalue = result
1131 return True
1135 return True
1132
1136
1133 def cmd_pickmarked(self):
1137 def cmd_pickmarked(self):
1134 """
1138 """
1135 'Pick' marked objects. Marked objects will be returned as a list.
1139 'Pick' marked objects. Marked objects will be returned as a list.
1136 """
1140 """
1137 level = self.levels[-1]
1141 level = self.levels[-1]
1138 self.returnvalue = [cache.item for cache in level.items if cache.marked]
1142 self.returnvalue = [cache.item for cache in level.items if cache.marked]
1139 return True
1143 return True
1140
1144
1141 def cmd_pickmarkedattr(self):
1145 def cmd_pickmarkedattr(self):
1142 """
1146 """
1143 'Pick' the attribute under the cursor from all marked objects
1147 'Pick' the attribute under the cursor from all marked objects
1144 (This returns a list).
1148 (This returns a list).
1145 """
1149 """
1146
1150
1147 level = self.levels[-1]
1151 level = self.levels[-1]
1148 attr = level.displayattr[1]
1152 attr = level.displayattr[1]
1149 if attr is ipipe.noitem:
1153 if attr is ipipe.noitem:
1150 curses.beep()
1154 curses.beep()
1151 self.report(CommandError("no column under cursor"))
1155 self.report(CommandError("no column under cursor"))
1152 return
1156 return
1153 result = []
1157 result = []
1154 for cache in level.items:
1158 for cache in level.items:
1155 if cache.marked:
1159 if cache.marked:
1156 value = attr.value(cache.item)
1160 value = attr.value(cache.item)
1157 if value is not ipipe.noitem:
1161 if value is not ipipe.noitem:
1158 result.append(value)
1162 result.append(value)
1159 self.returnvalue = result
1163 self.returnvalue = result
1160 return True
1164 return True
1161
1165
1166 def cmd_pickinput(self):
1167 """
1168 Use the object under the cursor (i.e. the row the cursor is on) as
1169 the next input line. This leaves the browser and puts the picked object
1170 in the input.
1171 """
1172 level = self.levels[-1]
1173 value = level.items[level.cury].item
1174 self.returnvalue = None
1175 api = ipapi.get()
1176 api.set_next_input(str(value))
1177 return True
1178
1179 def cmd_pickinputattr(self):
1180 """
1181 Use the attribute under the cursor i.e. the row/column the cursor is on)
1182 as the next input line. This leaves the browser and puts the picked
1183 object in the input.
1184 """
1185 level = self.levels[-1]
1186 attr = level.displayattr[1]
1187 if attr is ipipe.noitem:
1188 curses.beep()
1189 self.report(CommandError("no column under cursor"))
1190 return
1191 value = attr.value(level.items[level.cury].item)
1192 if value is ipipe.noitem:
1193 curses.beep()
1194 self.report(AttributeError(attr.name()))
1195 self.returnvalue = None
1196 api = ipapi.get()
1197 api.set_next_input(str(value))
1198 return True
1199
1162 def cmd_markrange(self):
1200 def cmd_markrange(self):
1163 """
1201 """
1164 Mark all objects from the last marked object before the current cursor
1202 Mark all objects from the last marked object before the current cursor
1165 position to the cursor position.
1203 position to the cursor position.
1166 """
1204 """
1167 level = self.levels[-1]
1205 level = self.levels[-1]
1168 self.report("markrange")
1206 self.report("markrange")
1169 start = None
1207 start = None
1170 if level.items:
1208 if level.items:
1171 for i in xrange(level.cury, -1, -1):
1209 for i in xrange(level.cury, -1, -1):
1172 if level.items[i].marked:
1210 if level.items[i].marked:
1173 start = i
1211 start = i
1174 break
1212 break
1175 if start is None:
1213 if start is None:
1176 self.report(CommandError("no mark before cursor"))
1214 self.report(CommandError("no mark before cursor"))
1177 curses.beep()
1215 curses.beep()
1178 else:
1216 else:
1179 for i in xrange(start, level.cury+1):
1217 for i in xrange(start, level.cury+1):
1180 cache = level.items[i]
1218 cache = level.items[i]
1181 if not cache.marked:
1219 if not cache.marked:
1182 cache.marked = True
1220 cache.marked = True
1183 level.marked += 1
1221 level.marked += 1
1184
1222
1185 def cmd_enter(self):
1223 def cmd_enter(self):
1186 """
1224 """
1187 Enter the object under the cursor. (what this mean depends on the object
1225 Enter the object under the cursor. (what this mean depends on the object
1188 itself (i.e. how it implements iteration). This opens a new browser 'level'.
1226 itself (i.e. how it implements iteration). This opens a new browser 'level'.
1189 """
1227 """
1190 level = self.levels[-1]
1228 level = self.levels[-1]
1191 try:
1229 try:
1192 item = level.items[level.cury].item
1230 item = level.items[level.cury].item
1193 except IndexError:
1231 except IndexError:
1194 self.report(CommandError("No object"))
1232 self.report(CommandError("No object"))
1195 curses.beep()
1233 curses.beep()
1196 else:
1234 else:
1197 self.report("entering object...")
1235 self.report("entering object...")
1198 self.enter(item)
1236 self.enter(item)
1199
1237
1200 def cmd_leave(self):
1238 def cmd_leave(self):
1201 """
1239 """
1202 Leave the current browser level and go back to the previous one.
1240 Leave the current browser level and go back to the previous one.
1203 """
1241 """
1204 self.report("leave")
1242 self.report("leave")
1205 if len(self.levels) > 1:
1243 if len(self.levels) > 1:
1206 self._calcheaderlines(len(self.levels)-1)
1244 self._calcheaderlines(len(self.levels)-1)
1207 self.levels.pop(-1)
1245 self.levels.pop(-1)
1208 else:
1246 else:
1209 self.report(CommandError("This is the last level"))
1247 self.report(CommandError("This is the last level"))
1210 curses.beep()
1248 curses.beep()
1211
1249
1212 def cmd_enterattr(self):
1250 def cmd_enterattr(self):
1213 """
1251 """
1214 Enter the attribute under the cursor.
1252 Enter the attribute under the cursor.
1215 """
1253 """
1216 level = self.levels[-1]
1254 level = self.levels[-1]
1217 attr = level.displayattr[1]
1255 attr = level.displayattr[1]
1218 if attr is ipipe.noitem:
1256 if attr is ipipe.noitem:
1219 curses.beep()
1257 curses.beep()
1220 self.report(CommandError("no column under cursor"))
1258 self.report(CommandError("no column under cursor"))
1221 return
1259 return
1222 try:
1260 try:
1223 item = level.items[level.cury].item
1261 item = level.items[level.cury].item
1224 except IndexError:
1262 except IndexError:
1225 self.report(CommandError("No object"))
1263 self.report(CommandError("No object"))
1226 curses.beep()
1264 curses.beep()
1227 else:
1265 else:
1228 value = attr.value(item)
1266 value = attr.value(item)
1229 name = attr.name()
1267 name = attr.name()
1230 if value is ipipe.noitem:
1268 if value is ipipe.noitem:
1231 self.report(AttributeError(name))
1269 self.report(AttributeError(name))
1232 else:
1270 else:
1233 self.report("entering object attribute %s..." % name)
1271 self.report("entering object attribute %s..." % name)
1234 self.enter(value)
1272 self.enter(value)
1235
1273
1236 def cmd_detail(self):
1274 def cmd_detail(self):
1237 """
1275 """
1238 Show a detail view of the object under the cursor. This shows the
1276 Show a detail view of the object under the cursor. This shows the
1239 name, type, doc string and value of the object attributes (and it
1277 name, type, doc string and value of the object attributes (and it
1240 might show more attributes than in the list view, depending on
1278 might show more attributes than in the list view, depending on
1241 the object).
1279 the object).
1242 """
1280 """
1243 level = self.levels[-1]
1281 level = self.levels[-1]
1244 try:
1282 try:
1245 item = level.items[level.cury].item
1283 item = level.items[level.cury].item
1246 except IndexError:
1284 except IndexError:
1247 self.report(CommandError("No object"))
1285 self.report(CommandError("No object"))
1248 curses.beep()
1286 curses.beep()
1249 else:
1287 else:
1250 self.report("entering detail view for object...")
1288 self.report("entering detail view for object...")
1251 attrs = [ipipe.AttributeDetail(item, attr) for attr in ipipe.xattrs(item, "detail")]
1289 attrs = [ipipe.AttributeDetail(item, attr) for attr in ipipe.xattrs(item, "detail")]
1252 self.enter(attrs)
1290 self.enter(attrs)
1253
1291
1254 def cmd_detailattr(self):
1292 def cmd_detailattr(self):
1255 """
1293 """
1256 Show a detail view of the attribute under the cursor.
1294 Show a detail view of the attribute under the cursor.
1257 """
1295 """
1258 level = self.levels[-1]
1296 level = self.levels[-1]
1259 attr = level.displayattr[1]
1297 attr = level.displayattr[1]
1260 if attr is ipipe.noitem:
1298 if attr is ipipe.noitem:
1261 curses.beep()
1299 curses.beep()
1262 self.report(CommandError("no attribute"))
1300 self.report(CommandError("no attribute"))
1263 return
1301 return
1264 try:
1302 try:
1265 item = level.items[level.cury].item
1303 item = level.items[level.cury].item
1266 except IndexError:
1304 except IndexError:
1267 self.report(CommandError("No object"))
1305 self.report(CommandError("No object"))
1268 curses.beep()
1306 curses.beep()
1269 else:
1307 else:
1270 try:
1308 try:
1271 item = attr.value(item)
1309 item = attr.value(item)
1272 except (KeyboardInterrupt, SystemExit):
1310 except (KeyboardInterrupt, SystemExit):
1273 raise
1311 raise
1274 except Exception, exc:
1312 except Exception, exc:
1275 self.report(exc)
1313 self.report(exc)
1276 else:
1314 else:
1277 self.report("entering detail view for attribute %s..." % attr.name())
1315 self.report("entering detail view for attribute %s..." % attr.name())
1278 attrs = [ipipe.AttributeDetail(item, attr) for attr in ipipe.xattrs(item, "detail")]
1316 attrs = [ipipe.AttributeDetail(item, attr) for attr in ipipe.xattrs(item, "detail")]
1279 self.enter(attrs)
1317 self.enter(attrs)
1280
1318
1281 def cmd_tooglemark(self):
1319 def cmd_tooglemark(self):
1282 """
1320 """
1283 Mark/unmark the object under the cursor. Marked objects have a '!'
1321 Mark/unmark the object under the cursor. Marked objects have a '!'
1284 after the row number).
1322 after the row number).
1285 """
1323 """
1286 level = self.levels[-1]
1324 level = self.levels[-1]
1287 self.report("toggle mark")
1325 self.report("toggle mark")
1288 try:
1326 try:
1289 item = level.items[level.cury]
1327 item = level.items[level.cury]
1290 except IndexError: # no items?
1328 except IndexError: # no items?
1291 pass
1329 pass
1292 else:
1330 else:
1293 if item.marked:
1331 if item.marked:
1294 item.marked = False
1332 item.marked = False
1295 level.marked -= 1
1333 level.marked -= 1
1296 else:
1334 else:
1297 item.marked = True
1335 item.marked = True
1298 level.marked += 1
1336 level.marked += 1
1299
1337
1300 def cmd_sortattrasc(self):
1338 def cmd_sortattrasc(self):
1301 """
1339 """
1302 Sort the objects (in ascending order) using the attribute under
1340 Sort the objects (in ascending order) using the attribute under
1303 the cursor as the sort key.
1341 the cursor as the sort key.
1304 """
1342 """
1305 level = self.levels[-1]
1343 level = self.levels[-1]
1306 attr = level.displayattr[1]
1344 attr = level.displayattr[1]
1307 if attr is ipipe.noitem:
1345 if attr is ipipe.noitem:
1308 curses.beep()
1346 curses.beep()
1309 self.report(CommandError("no column under cursor"))
1347 self.report(CommandError("no column under cursor"))
1310 return
1348 return
1311 self.report("sort by %s (ascending)" % attr.name())
1349 self.report("sort by %s (ascending)" % attr.name())
1312 def key(item):
1350 def key(item):
1313 try:
1351 try:
1314 return attr.value(item)
1352 return attr.value(item)
1315 except (KeyboardInterrupt, SystemExit):
1353 except (KeyboardInterrupt, SystemExit):
1316 raise
1354 raise
1317 except Exception:
1355 except Exception:
1318 return None
1356 return None
1319 level.sort(key)
1357 level.sort(key)
1320
1358
1321 def cmd_sortattrdesc(self):
1359 def cmd_sortattrdesc(self):
1322 """
1360 """
1323 Sort the objects (in descending order) using the attribute under
1361 Sort the objects (in descending order) using the attribute under
1324 the cursor as the sort key.
1362 the cursor as the sort key.
1325 """
1363 """
1326 level = self.levels[-1]
1364 level = self.levels[-1]
1327 attr = level.displayattr[1]
1365 attr = level.displayattr[1]
1328 if attr is ipipe.noitem:
1366 if attr is ipipe.noitem:
1329 curses.beep()
1367 curses.beep()
1330 self.report(CommandError("no column under cursor"))
1368 self.report(CommandError("no column under cursor"))
1331 return
1369 return
1332 self.report("sort by %s (descending)" % attr.name())
1370 self.report("sort by %s (descending)" % attr.name())
1333 def key(item):
1371 def key(item):
1334 try:
1372 try:
1335 return attr.value(item)
1373 return attr.value(item)
1336 except (KeyboardInterrupt, SystemExit):
1374 except (KeyboardInterrupt, SystemExit):
1337 raise
1375 raise
1338 except Exception:
1376 except Exception:
1339 return None
1377 return None
1340 level.sort(key, reverse=True)
1378 level.sort(key, reverse=True)
1341
1379
1342 def cmd_hideattr(self):
1380 def cmd_hideattr(self):
1343 """
1381 """
1344 Hide the attribute under the cursor.
1382 Hide the attribute under the cursor.
1345 """
1383 """
1346 level = self.levels[-1]
1384 level = self.levels[-1]
1347 if level.displayattr[0] is None:
1385 if level.displayattr[0] is None:
1348 self.beep()
1386 self.beep()
1349 else:
1387 else:
1350 self.report("hideattr")
1388 self.report("hideattr")
1351 level.hiddenattrs.add(level.displayattr[1])
1389 level.hiddenattrs.add(level.displayattr[1])
1352 level.moveto(level.curx, level.cury, refresh=True)
1390 level.moveto(level.curx, level.cury, refresh=True)
1353
1391
1354 def cmd_unhideattrs(self):
1392 def cmd_unhideattrs(self):
1355 """
1393 """
1356 Make all attributes visible again.
1394 Make all attributes visible again.
1357 """
1395 """
1358 level = self.levels[-1]
1396 level = self.levels[-1]
1359 self.report("unhideattrs")
1397 self.report("unhideattrs")
1360 level.hiddenattrs.clear()
1398 level.hiddenattrs.clear()
1361 level.moveto(level.curx, level.cury, refresh=True)
1399 level.moveto(level.curx, level.cury, refresh=True)
1362
1400
1363 def cmd_goto(self):
1401 def cmd_goto(self):
1364 """
1402 """
1365 Jump to a row. The row number can be entered at the
1403 Jump to a row. The row number can be entered at the
1366 bottom of the screen.
1404 bottom of the screen.
1367 """
1405 """
1368 self.startkeyboardinput("goto")
1406 self.startkeyboardinput("goto")
1369
1407
1370 def cmd_find(self):
1408 def cmd_find(self):
1371 """
1409 """
1372 Search forward for a row. The search condition can be entered at the
1410 Search forward for a row. The search condition can be entered at the
1373 bottom of the screen.
1411 bottom of the screen.
1374 """
1412 """
1375 self.startkeyboardinput("find")
1413 self.startkeyboardinput("find")
1376
1414
1377 def cmd_findbackwards(self):
1415 def cmd_findbackwards(self):
1378 """
1416 """
1379 Search backward for a row. The search condition can be entered at the
1417 Search backward for a row. The search condition can be entered at the
1380 bottom of the screen.
1418 bottom of the screen.
1381 """
1419 """
1382 self.startkeyboardinput("findbackwards")
1420 self.startkeyboardinput("findbackwards")
1383
1421
1384 def cmd_refresh(self):
1422 def cmd_refresh(self):
1385 """
1423 """
1386 Refreshes the display by restarting the iterator.
1424 Refreshes the display by restarting the iterator.
1387 """
1425 """
1388 level = self.levels[-1]
1426 level = self.levels[-1]
1389 self.report("refresh")
1427 self.report("refresh")
1390 level.refresh()
1428 level.refresh()
1391
1429
1392 def cmd_refreshfind(self):
1430 def cmd_refreshfind(self):
1393 """
1431 """
1394 Refreshes the display by restarting the iterator and goes back to the
1432 Refreshes the display by restarting the iterator and goes back to the
1395 same object the cursor was on before restarting (if this object can't be
1433 same object the cursor was on before restarting (if this object can't be
1396 found the cursor jumps back to the first object).
1434 found the cursor jumps back to the first object).
1397 """
1435 """
1398 level = self.levels[-1]
1436 level = self.levels[-1]
1399 self.report("refreshfind")
1437 self.report("refreshfind")
1400 level.refreshfind()
1438 level.refreshfind()
1401
1439
1402 def cmd_help(self):
1440 def cmd_help(self):
1403 """
1441 """
1404 Opens the help screen as a new browser level, describing keyboard
1442 Opens the help screen as a new browser level, describing keyboard
1405 shortcuts.
1443 shortcuts.
1406 """
1444 """
1407 for level in self.levels:
1445 for level in self.levels:
1408 if isinstance(level.input, _BrowserHelp):
1446 if isinstance(level.input, _BrowserHelp):
1409 curses.beep()
1447 curses.beep()
1410 self.report(CommandError("help already active"))
1448 self.report(CommandError("help already active"))
1411 return
1449 return
1412
1450
1413 self.enter(_BrowserHelp(self))
1451 self.enter(_BrowserHelp(self))
1414
1452
1415 def cmd_quit(self):
1453 def cmd_quit(self):
1416 """
1454 """
1417 Quit the browser and return to the IPython prompt.
1455 Quit the browser and return to the IPython prompt.
1418 """
1456 """
1419 self.returnvalue = None
1457 self.returnvalue = None
1420 return True
1458 return True
1421
1459
1422 def sigwinchhandler(self, signal, frame):
1460 def sigwinchhandler(self, signal, frame):
1423 self.resized = True
1461 self.resized = True
1424
1462
1425 def _dodisplay(self, scr):
1463 def _dodisplay(self, scr):
1426 """
1464 """
1427 This method is the workhorse of the browser. It handles screen
1465 This method is the workhorse of the browser. It handles screen
1428 drawing and the keyboard.
1466 drawing and the keyboard.
1429 """
1467 """
1430 self.scr = scr
1468 self.scr = scr
1431 curses.halfdelay(1)
1469 curses.halfdelay(1)
1432 footery = 2
1470 footery = 2
1433
1471
1434 keys = []
1472 keys = []
1435 for cmd in ("quit", "help"):
1473 for cmd in ("quit", "help"):
1436 key = self.keymap.findkey(cmd, None)
1474 key = self.keymap.findkey(cmd, None)
1437 if key is not None:
1475 if key is not None:
1438 keys.append("%s=%s" % (self.keylabel(key), cmd))
1476 keys.append("%s=%s" % (self.keylabel(key), cmd))
1439 helpmsg = " | %s" % " ".join(keys)
1477 helpmsg = " | %s" % " ".join(keys)
1440
1478
1441 scr.clear()
1479 scr.clear()
1442 msg = "Fetching first batch of objects..."
1480 msg = "Fetching first batch of objects..."
1443 (self.scrsizey, self.scrsizex) = scr.getmaxyx()
1481 (self.scrsizey, self.scrsizex) = scr.getmaxyx()
1444 scr.addstr(self.scrsizey//2, (self.scrsizex-len(msg))//2, msg)
1482 scr.addstr(self.scrsizey//2, (self.scrsizex-len(msg))//2, msg)
1445 scr.refresh()
1483 scr.refresh()
1446
1484
1447 lastc = -1
1485 lastc = -1
1448
1486
1449 self.levels = []
1487 self.levels = []
1450 # enter the first level
1488 # enter the first level
1451 self.enter(self.input, *self.attrs)
1489 self.enter(self.input, *self.attrs)
1452
1490
1453 self._calcheaderlines(None)
1491 self._calcheaderlines(None)
1454
1492
1455 while True:
1493 while True:
1456 level = self.levels[-1]
1494 level = self.levels[-1]
1457 (self.scrsizey, self.scrsizex) = scr.getmaxyx()
1495 (self.scrsizey, self.scrsizex) = scr.getmaxyx()
1458 level.mainsizey = self.scrsizey-1-self._headerlines-footery
1496 level.mainsizey = self.scrsizey-1-self._headerlines-footery
1459
1497
1460 # Paint object header
1498 # Paint object header
1461 for i in xrange(self._firstheaderline, self._firstheaderline+self._headerlines):
1499 for i in xrange(self._firstheaderline, self._firstheaderline+self._headerlines):
1462 lv = self.levels[i]
1500 lv = self.levels[i]
1463 posx = 0
1501 posx = 0
1464 posy = i-self._firstheaderline
1502 posy = i-self._firstheaderline
1465 endx = self.scrsizex
1503 endx = self.scrsizex
1466 if i: # not the first level
1504 if i: # not the first level
1467 msg = " (%d/%d" % (self.levels[i-1].cury, len(self.levels[i-1].items))
1505 msg = " (%d/%d" % (self.levels[i-1].cury, len(self.levels[i-1].items))
1468 if not self.levels[i-1].exhausted:
1506 if not self.levels[i-1].exhausted:
1469 msg += "+"
1507 msg += "+"
1470 msg += ") "
1508 msg += ") "
1471 endx -= len(msg)+1
1509 endx -= len(msg)+1
1472 posx += self.addstr(posy, posx, 0, endx, " ibrowse #%d: " % i, self.style_objheadertext)
1510 posx += self.addstr(posy, posx, 0, endx, " ibrowse #%d: " % i, self.style_objheadertext)
1473 for (style, text) in lv.header:
1511 for (style, text) in lv.header:
1474 posx += self.addstr(posy, posx, 0, endx, text, self.style_objheaderobject)
1512 posx += self.addstr(posy, posx, 0, endx, text, self.style_objheaderobject)
1475 if posx >= endx:
1513 if posx >= endx:
1476 break
1514 break
1477 if i:
1515 if i:
1478 posx += self.addstr(posy, posx, 0, self.scrsizex, msg, self.style_objheadernumber)
1516 posx += self.addstr(posy, posx, 0, self.scrsizex, msg, self.style_objheadernumber)
1479 posx += self.addchr(posy, posx, 0, self.scrsizex, " ", self.scrsizex-posx, self.style_objheadernumber)
1517 posx += self.addchr(posy, posx, 0, self.scrsizex, " ", self.scrsizex-posx, self.style_objheadernumber)
1480
1518
1481 if not level.items:
1519 if not level.items:
1482 self.addchr(self._headerlines, 0, 0, self.scrsizex, " ", self.scrsizex, self.style_colheader)
1520 self.addchr(self._headerlines, 0, 0, self.scrsizex, " ", self.scrsizex, self.style_colheader)
1483 self.addstr(self._headerlines+1, 0, 0, self.scrsizex, " <empty>", astyle.style_error)
1521 self.addstr(self._headerlines+1, 0, 0, self.scrsizex, " <empty>", astyle.style_error)
1484 scr.clrtobot()
1522 scr.clrtobot()
1485 else:
1523 else:
1486 # Paint column headers
1524 # Paint column headers
1487 scr.move(self._headerlines, 0)
1525 scr.move(self._headerlines, 0)
1488 scr.addstr(" %*s " % (level.numbersizex, "#"), self.getstyle(self.style_colheader))
1526 scr.addstr(" %*s " % (level.numbersizex, "#"), self.getstyle(self.style_colheader))
1489 scr.addstr(self.headersepchar, self.getstyle(self.style_colheadersep))
1527 scr.addstr(self.headersepchar, self.getstyle(self.style_colheadersep))
1490 begx = level.numbersizex+3
1528 begx = level.numbersizex+3
1491 posx = begx-level.datastartx
1529 posx = begx-level.datastartx
1492 for attr in level.displayattrs:
1530 for attr in level.displayattrs:
1493 attrname = attr.name()
1531 attrname = attr.name()
1494 cwidth = level.colwidths[attr]
1532 cwidth = level.colwidths[attr]
1495 header = attrname.ljust(cwidth)
1533 header = attrname.ljust(cwidth)
1496 if attr is level.displayattr[1]:
1534 if attr is level.displayattr[1]:
1497 style = self.style_colheaderhere
1535 style = self.style_colheaderhere
1498 else:
1536 else:
1499 style = self.style_colheader
1537 style = self.style_colheader
1500 posx += self.addstr(self._headerlines, posx, begx, self.scrsizex, header, style)
1538 posx += self.addstr(self._headerlines, posx, begx, self.scrsizex, header, style)
1501 posx += self.addstr(self._headerlines, posx, begx, self.scrsizex, self.headersepchar, self.style_colheadersep)
1539 posx += self.addstr(self._headerlines, posx, begx, self.scrsizex, self.headersepchar, self.style_colheadersep)
1502 if posx >= self.scrsizex:
1540 if posx >= self.scrsizex:
1503 break
1541 break
1504 else:
1542 else:
1505 scr.addstr(" "*(self.scrsizex-posx), self.getstyle(self.style_colheader))
1543 scr.addstr(" "*(self.scrsizex-posx), self.getstyle(self.style_colheader))
1506
1544
1507 # Paint rows
1545 # Paint rows
1508 posy = self._headerlines+1+level.datastarty
1546 posy = self._headerlines+1+level.datastarty
1509 for i in xrange(level.datastarty, min(level.datastarty+level.mainsizey, len(level.items))):
1547 for i in xrange(level.datastarty, min(level.datastarty+level.mainsizey, len(level.items))):
1510 cache = level.items[i]
1548 cache = level.items[i]
1511 if i == level.cury:
1549 if i == level.cury:
1512 style = self.style_numberhere
1550 style = self.style_numberhere
1513 else:
1551 else:
1514 style = self.style_number
1552 style = self.style_number
1515
1553
1516 posy = self._headerlines+1+i-level.datastarty
1554 posy = self._headerlines+1+i-level.datastarty
1517 posx = begx-level.datastartx
1555 posx = begx-level.datastartx
1518
1556
1519 scr.move(posy, 0)
1557 scr.move(posy, 0)
1520 scr.addstr(" %*d%s" % (level.numbersizex, i, " !"[cache.marked]), self.getstyle(style))
1558 scr.addstr(" %*d%s" % (level.numbersizex, i, " !"[cache.marked]), self.getstyle(style))
1521 scr.addstr(self.headersepchar, self.getstyle(self.style_sep))
1559 scr.addstr(self.headersepchar, self.getstyle(self.style_sep))
1522
1560
1523 for attrname in level.displayattrs:
1561 for attrname in level.displayattrs:
1524 cwidth = level.colwidths[attrname]
1562 cwidth = level.colwidths[attrname]
1525 try:
1563 try:
1526 (align, length, parts) = level.displayrows[i-level.datastarty][attrname]
1564 (align, length, parts) = level.displayrows[i-level.datastarty][attrname]
1527 except KeyError:
1565 except KeyError:
1528 align = 2
1566 align = 2
1529 style = astyle.style_nodata
1567 style = astyle.style_nodata
1530 if i == level.cury:
1568 if i == level.cury:
1531 style = self.getstylehere(style)
1569 style = self.getstylehere(style)
1532 padstyle = self.style_datapad
1570 padstyle = self.style_datapad
1533 sepstyle = self.style_sep
1571 sepstyle = self.style_sep
1534 if i == level.cury:
1572 if i == level.cury:
1535 padstyle = self.getstylehere(padstyle)
1573 padstyle = self.getstylehere(padstyle)
1536 sepstyle = self.getstylehere(sepstyle)
1574 sepstyle = self.getstylehere(sepstyle)
1537 if align == 2:
1575 if align == 2:
1538 posx += self.addchr(posy, posx, begx, self.scrsizex, self.nodatachar, cwidth, style)
1576 posx += self.addchr(posy, posx, begx, self.scrsizex, self.nodatachar, cwidth, style)
1539 else:
1577 else:
1540 if align == 1:
1578 if align == 1:
1541 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, cwidth-length, padstyle)
1579 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, cwidth-length, padstyle)
1542 elif align == 0:
1580 elif align == 0:
1543 pad1 = (cwidth-length)//2
1581 pad1 = (cwidth-length)//2
1544 pad2 = cwidth-length-len(pad1)
1582 pad2 = cwidth-length-len(pad1)
1545 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, pad1, padstyle)
1583 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, pad1, padstyle)
1546 for (style, text) in parts:
1584 for (style, text) in parts:
1547 if i == level.cury:
1585 if i == level.cury:
1548 style = self.getstylehere(style)
1586 style = self.getstylehere(style)
1549 posx += self.addstr(posy, posx, begx, self.scrsizex, text, style)
1587 posx += self.addstr(posy, posx, begx, self.scrsizex, text, style)
1550 if posx >= self.scrsizex:
1588 if posx >= self.scrsizex:
1551 break
1589 break
1552 if align == -1:
1590 if align == -1:
1553 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, cwidth-length, padstyle)
1591 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, cwidth-length, padstyle)
1554 elif align == 0:
1592 elif align == 0:
1555 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, pad2, padstyle)
1593 posx += self.addchr(posy, posx, begx, self.scrsizex, self.datapadchar, pad2, padstyle)
1556 posx += self.addstr(posy, posx, begx, self.scrsizex, self.datasepchar, sepstyle)
1594 posx += self.addstr(posy, posx, begx, self.scrsizex, self.datasepchar, sepstyle)
1557 else:
1595 else:
1558 scr.clrtoeol()
1596 scr.clrtoeol()
1559
1597
1560 # Add blank row headers for the rest of the screen
1598 # Add blank row headers for the rest of the screen
1561 for posy in xrange(posy+1, self.scrsizey-2):
1599 for posy in xrange(posy+1, self.scrsizey-2):
1562 scr.addstr(posy, 0, " " * (level.numbersizex+2), self.getstyle(self.style_colheader))
1600 scr.addstr(posy, 0, " " * (level.numbersizex+2), self.getstyle(self.style_colheader))
1563 scr.clrtoeol()
1601 scr.clrtoeol()
1564
1602
1565 posy = self.scrsizey-footery
1603 posy = self.scrsizey-footery
1566 # Display footer
1604 # Display footer
1567 scr.addstr(posy, 0, " "*self.scrsizex, self.getstyle(self.style_footer))
1605 scr.addstr(posy, 0, " "*self.scrsizex, self.getstyle(self.style_footer))
1568
1606
1569 if level.exhausted:
1607 if level.exhausted:
1570 flag = ""
1608 flag = ""
1571 else:
1609 else:
1572 flag = "+"
1610 flag = "+"
1573
1611
1574 endx = self.scrsizex-len(helpmsg)-1
1612 endx = self.scrsizex-len(helpmsg)-1
1575 scr.addstr(posy, endx, helpmsg, self.getstyle(self.style_footer))
1613 scr.addstr(posy, endx, helpmsg, self.getstyle(self.style_footer))
1576
1614
1577 posx = 0
1615 posx = 0
1578 msg = " %d%s objects (%d marked): " % (len(level.items), flag, level.marked)
1616 msg = " %d%s objects (%d marked): " % (len(level.items), flag, level.marked)
1579 posx += self.addstr(posy, posx, 0, endx, msg, self.style_footer)
1617 posx += self.addstr(posy, posx, 0, endx, msg, self.style_footer)
1580 try:
1618 try:
1581 item = level.items[level.cury].item
1619 item = level.items[level.cury].item
1582 except IndexError: # empty
1620 except IndexError: # empty
1583 pass
1621 pass
1584 else:
1622 else:
1585 for (nostyle, text) in ipipe.xrepr(item, "footer"):
1623 for (nostyle, text) in ipipe.xrepr(item, "footer"):
1586 if not isinstance(nostyle, int):
1624 if not isinstance(nostyle, int):
1587 posx += self.addstr(posy, posx, 0, endx, text, self.style_footer)
1625 posx += self.addstr(posy, posx, 0, endx, text, self.style_footer)
1588 if posx >= endx:
1626 if posx >= endx:
1589 break
1627 break
1590
1628
1591 attrstyle = [(astyle.style_default, "no attribute")]
1629 attrstyle = [(astyle.style_default, "no attribute")]
1592 attr = level.displayattr[1]
1630 attr = level.displayattr[1]
1593 if attr is not ipipe.noitem and not isinstance(attr, ipipe.SelfDescriptor):
1631 if attr is not ipipe.noitem and not isinstance(attr, ipipe.SelfDescriptor):
1594 posx += self.addstr(posy, posx, 0, endx, " | ", self.style_footer)
1632 posx += self.addstr(posy, posx, 0, endx, " | ", self.style_footer)
1595 posx += self.addstr(posy, posx, 0, endx, attr.name(), self.style_footer)
1633 posx += self.addstr(posy, posx, 0, endx, attr.name(), self.style_footer)
1596 posx += self.addstr(posy, posx, 0, endx, ": ", self.style_footer)
1634 posx += self.addstr(posy, posx, 0, endx, ": ", self.style_footer)
1597 try:
1635 try:
1598 value = attr.value(item)
1636 value = attr.value(item)
1599 except (SystemExit, KeyboardInterrupt):
1637 except (SystemExit, KeyboardInterrupt):
1600 raise
1638 raise
1601 except Exception, exc:
1639 except Exception, exc:
1602 value = exc
1640 value = exc
1603 if value is not ipipe.noitem:
1641 if value is not ipipe.noitem:
1604 attrstyle = ipipe.xrepr(value, "footer")
1642 attrstyle = ipipe.xrepr(value, "footer")
1605 for (nostyle, text) in attrstyle:
1643 for (nostyle, text) in attrstyle:
1606 if not isinstance(nostyle, int):
1644 if not isinstance(nostyle, int):
1607 posx += self.addstr(posy, posx, 0, endx, text, self.style_footer)
1645 posx += self.addstr(posy, posx, 0, endx, text, self.style_footer)
1608 if posx >= endx:
1646 if posx >= endx:
1609 break
1647 break
1610
1648
1611 try:
1649 try:
1612 # Display input prompt
1650 # Display input prompt
1613 if self.mode in self.prompts:
1651 if self.mode in self.prompts:
1614 history = self.prompts[self.mode]
1652 history = self.prompts[self.mode]
1615 posx = 0
1653 posx = 0
1616 posy = self.scrsizey-1
1654 posy = self.scrsizey-1
1617 posx += self.addstr(posy, posx, 0, endx, history.prompt, astyle.style_default)
1655 posx += self.addstr(posy, posx, 0, endx, history.prompt, astyle.style_default)
1618 posx += self.addstr(posy, posx, 0, endx, " [", astyle.style_default)
1656 posx += self.addstr(posy, posx, 0, endx, " [", astyle.style_default)
1619 if history.cury==-1:
1657 if history.cury==-1:
1620 text = "new"
1658 text = "new"
1621 else:
1659 else:
1622 text = str(history.cury+1)
1660 text = str(history.cury+1)
1623 posx += self.addstr(posy, posx, 0, endx, text, astyle.style_type_number)
1661 posx += self.addstr(posy, posx, 0, endx, text, astyle.style_type_number)
1624 if history.history:
1662 if history.history:
1625 posx += self.addstr(posy, posx, 0, endx, "/", astyle.style_default)
1663 posx += self.addstr(posy, posx, 0, endx, "/", astyle.style_default)
1626 posx += self.addstr(posy, posx, 0, endx, str(len(history.history)), astyle.style_type_number)
1664 posx += self.addstr(posy, posx, 0, endx, str(len(history.history)), astyle.style_type_number)
1627 posx += self.addstr(posy, posx, 0, endx, "]: ", astyle.style_default)
1665 posx += self.addstr(posy, posx, 0, endx, "]: ", astyle.style_default)
1628 inputstartx = posx
1666 inputstartx = posx
1629 posx += self.addstr(posy, posx, 0, endx, history.input, astyle.style_default)
1667 posx += self.addstr(posy, posx, 0, endx, history.input, astyle.style_default)
1630 # Display report
1668 # Display report
1631 else:
1669 else:
1632 if self._report is not None:
1670 if self._report is not None:
1633 if isinstance(self._report, Exception):
1671 if isinstance(self._report, Exception):
1634 style = self.getstyle(astyle.style_error)
1672 style = self.getstyle(astyle.style_error)
1635 if self._report.__class__.__module__ == "exceptions":
1673 if self._report.__class__.__module__ == "exceptions":
1636 msg = "%s: %s" % \
1674 msg = "%s: %s" % \
1637 (self._report.__class__.__name__, self._report)
1675 (self._report.__class__.__name__, self._report)
1638 else:
1676 else:
1639 msg = "%s.%s: %s" % \
1677 msg = "%s.%s: %s" % \
1640 (self._report.__class__.__module__,
1678 (self._report.__class__.__module__,
1641 self._report.__class__.__name__, self._report)
1679 self._report.__class__.__name__, self._report)
1642 else:
1680 else:
1643 style = self.getstyle(self.style_report)
1681 style = self.getstyle(self.style_report)
1644 msg = self._report
1682 msg = self._report
1645 scr.addstr(self.scrsizey-1, 0, msg[:self.scrsizex], style)
1683 scr.addstr(self.scrsizey-1, 0, msg[:self.scrsizex], style)
1646 self._report = None
1684 self._report = None
1647 else:
1685 else:
1648 scr.move(self.scrsizey-1, 0)
1686 scr.move(self.scrsizey-1, 0)
1649 except curses.error:
1687 except curses.error:
1650 # Protect against errors from writing to the last line
1688 # Protect against errors from writing to the last line
1651 pass
1689 pass
1652 scr.clrtoeol()
1690 scr.clrtoeol()
1653
1691
1654 # Position cursor
1692 # Position cursor
1655 if self.mode in self.prompts:
1693 if self.mode in self.prompts:
1656 history = self.prompts[self.mode]
1694 history = self.prompts[self.mode]
1657 scr.move(self.scrsizey-1, inputstartx+history.curx)
1695 scr.move(self.scrsizey-1, inputstartx+history.curx)
1658 else:
1696 else:
1659 scr.move(
1697 scr.move(
1660 1+self._headerlines+level.cury-level.datastarty,
1698 1+self._headerlines+level.cury-level.datastarty,
1661 level.numbersizex+3+level.curx-level.datastartx
1699 level.numbersizex+3+level.curx-level.datastartx
1662 )
1700 )
1663 scr.refresh()
1701 scr.refresh()
1664
1702
1665 # Check keyboard
1703 # Check keyboard
1666 while True:
1704 while True:
1667 c = scr.getch()
1705 c = scr.getch()
1668 if self.resized:
1706 if self.resized:
1669 size = fcntl.ioctl(0, tty.TIOCGWINSZ, "12345678")
1707 size = fcntl.ioctl(0, tty.TIOCGWINSZ, "12345678")
1670 size = struct.unpack("4H", size)
1708 size = struct.unpack("4H", size)
1671 oldsize = scr.getmaxyx()
1709 oldsize = scr.getmaxyx()
1672 scr.erase()
1710 scr.erase()
1673 curses.resize_term(size[0], size[1])
1711 curses.resize_term(size[0], size[1])
1674 newsize = scr.getmaxyx()
1712 newsize = scr.getmaxyx()
1675 scr.erase()
1713 scr.erase()
1676 for l in self.levels:
1714 for l in self.levels:
1677 l.mainsizey += newsize[0]-oldsize[0]
1715 l.mainsizey += newsize[0]-oldsize[0]
1678 l.moveto(l.curx, l.cury, refresh=True)
1716 l.moveto(l.curx, l.cury, refresh=True)
1679 scr.refresh()
1717 scr.refresh()
1680 self.resized = False
1718 self.resized = False
1681 break # Redisplay
1719 break # Redisplay
1682 if self.mode in self.prompts:
1720 if self.mode in self.prompts:
1683 if self.prompts[self.mode].handlekey(self, c):
1721 if self.prompts[self.mode].handlekey(self, c):
1684 break # Redisplay
1722 break # Redisplay
1685 else:
1723 else:
1686 # if no key is pressed slow down and beep again
1724 # if no key is pressed slow down and beep again
1687 if c == -1:
1725 if c == -1:
1688 self.stepx = 1.
1726 self.stepx = 1.
1689 self.stepy = 1.
1727 self.stepy = 1.
1690 self._dobeep = True
1728 self._dobeep = True
1691 else:
1729 else:
1692 # if a different key was pressed slow down and beep too
1730 # if a different key was pressed slow down and beep too
1693 if c != lastc:
1731 if c != lastc:
1694 lastc = c
1732 lastc = c
1695 self.stepx = 1.
1733 self.stepx = 1.
1696 self.stepy = 1.
1734 self.stepy = 1.
1697 self._dobeep = True
1735 self._dobeep = True
1698 cmdname = self.keymap.get(c, None)
1736 cmdname = self.keymap.get(c, None)
1699 if cmdname is None:
1737 if cmdname is None:
1700 self.report(
1738 self.report(
1701 UnassignedKeyError("Unassigned key %s" %
1739 UnassignedKeyError("Unassigned key %s" %
1702 self.keylabel(c)))
1740 self.keylabel(c)))
1703 else:
1741 else:
1704 cmdfunc = getattr(self, "cmd_%s" % cmdname, None)
1742 cmdfunc = getattr(self, "cmd_%s" % cmdname, None)
1705 if cmdfunc is None:
1743 if cmdfunc is None:
1706 self.report(
1744 self.report(
1707 UnknownCommandError("Unknown command %r" %
1745 UnknownCommandError("Unknown command %r" %
1708 (cmdname,)))
1746 (cmdname,)))
1709 elif cmdfunc():
1747 elif cmdfunc():
1710 returnvalue = self.returnvalue
1748 returnvalue = self.returnvalue
1711 self.returnvalue = None
1749 self.returnvalue = None
1712 return returnvalue
1750 return returnvalue
1713 self.stepx = self.nextstepx(self.stepx)
1751 self.stepx = self.nextstepx(self.stepx)
1714 self.stepy = self.nextstepy(self.stepy)
1752 self.stepy = self.nextstepy(self.stepy)
1715 curses.flushinp() # get rid of type ahead
1753 curses.flushinp() # get rid of type ahead
1716 break # Redisplay
1754 break # Redisplay
1717 self.scr = None
1755 self.scr = None
1718
1756
1719 def display(self):
1757 def display(self):
1720 if hasattr(curses, "resize_term"):
1758 if hasattr(curses, "resize_term"):
1721 oldhandler = signal.signal(signal.SIGWINCH, self.sigwinchhandler)
1759 oldhandler = signal.signal(signal.SIGWINCH, self.sigwinchhandler)
1722 try:
1760 try:
1723 return curses.wrapper(self._dodisplay)
1761 return curses.wrapper(self._dodisplay)
1724 finally:
1762 finally:
1725 signal.signal(signal.SIGWINCH, oldhandler)
1763 signal.signal(signal.SIGWINCH, oldhandler)
1726 else:
1764 else:
1727 return curses.wrapper(self._dodisplay)
1765 return curses.wrapper(self._dodisplay)
@@ -1,2153 +1,2175 b''
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",
139 "idump", "iless"
139 "ienv", "ihist", "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
199
200 def item(iterator, index, default=noitem):
200 def item(iterator, index, default=noitem):
201 """
201 """
202 Return the ``index``th item from the iterator ``iterator``.
202 Return the ``index``th item from the iterator ``iterator``.
203 ``index`` must be an integer (negative integers are relative to the
203 ``index`` must be an integer (negative integers are relative to the
204 end (i.e. the last items produced by the iterator)).
204 end (i.e. the last items produced by the iterator)).
205
205
206 If ``default`` is given, this will be the default value when
206 If ``default`` is given, this will be the default value when
207 the iterator doesn't contain an item at this position. Otherwise an
207 the iterator doesn't contain an item at this position. Otherwise an
208 ``IndexError`` will be raised.
208 ``IndexError`` will be raised.
209
209
210 Note that using this function will partially or totally exhaust the
210 Note that using this function will partially or totally exhaust the
211 iterator.
211 iterator.
212 """
212 """
213 i = index
213 i = index
214 if i>=0:
214 if i>=0:
215 for item in iterator:
215 for item in iterator:
216 if not i:
216 if not i:
217 return item
217 return item
218 i -= 1
218 i -= 1
219 else:
219 else:
220 i = -index
220 i = -index
221 cache = deque()
221 cache = deque()
222 for item in iterator:
222 for item in iterator:
223 cache.append(item)
223 cache.append(item)
224 if len(cache)>i:
224 if len(cache)>i:
225 cache.popleft()
225 cache.popleft()
226 if len(cache)==i:
226 if len(cache)==i:
227 return cache.popleft()
227 return cache.popleft()
228 if default is noitem:
228 if default is noitem:
229 raise IndexError(index)
229 raise IndexError(index)
230 else:
230 else:
231 return default
231 return default
232
232
233
233
234 def getglobals(g):
234 def getglobals(g):
235 """
235 """
236 Return the global namespace that is used for expression strings in
236 Return the global namespace that is used for expression strings in
237 ``ifilter`` and others. This is ``g`` or (if ``g`` is ``None``) IPython's
237 ``ifilter`` and others. This is ``g`` or (if ``g`` is ``None``) IPython's
238 user namespace.
238 user namespace.
239 """
239 """
240 if g is None:
240 if g is None:
241 if ipapi is not None:
241 if ipapi is not None:
242 api = ipapi.get()
242 api = ipapi.get()
243 if api is not None:
243 if api is not None:
244 return api.user_ns
244 return api.user_ns
245 return globals()
245 return globals()
246 return g
246 return g
247
247
248
248
249 class Descriptor(object):
249 class Descriptor(object):
250 """
250 """
251 A ``Descriptor`` object is used for describing the attributes of objects.
251 A ``Descriptor`` object is used for describing the attributes of objects.
252 """
252 """
253 def __hash__(self):
253 def __hash__(self):
254 return hash(self.__class__) ^ hash(self.key())
254 return hash(self.__class__) ^ hash(self.key())
255
255
256 def __eq__(self, other):
256 def __eq__(self, other):
257 return self.__class__ is other.__class__ and self.key() == other.key()
257 return self.__class__ is other.__class__ and self.key() == other.key()
258
258
259 def __ne__(self, other):
259 def __ne__(self, other):
260 return self.__class__ is not other.__class__ or self.key() != other.key()
260 return self.__class__ is not other.__class__ or self.key() != other.key()
261
261
262 def key(self):
262 def key(self):
263 pass
263 pass
264
264
265 def name(self):
265 def name(self):
266 """
266 """
267 Return the name of this attribute for display by a ``Display`` object
267 Return the name of this attribute for display by a ``Display`` object
268 (e.g. as a column title).
268 (e.g. as a column title).
269 """
269 """
270 key = self.key()
270 key = self.key()
271 if key is None:
271 if key is None:
272 return "_"
272 return "_"
273 return str(key)
273 return str(key)
274
274
275 def attrtype(self, obj):
275 def attrtype(self, obj):
276 """
276 """
277 Return the type of this attribute (i.e. something like "attribute" or
277 Return the type of this attribute (i.e. something like "attribute" or
278 "method").
278 "method").
279 """
279 """
280
280
281 def valuetype(self, obj):
281 def valuetype(self, obj):
282 """
282 """
283 Return the type of this attribute value of the object ``obj``.
283 Return the type of this attribute value of the object ``obj``.
284 """
284 """
285
285
286 def value(self, obj):
286 def value(self, obj):
287 """
287 """
288 Return the value of this attribute of the object ``obj``.
288 Return the value of this attribute of the object ``obj``.
289 """
289 """
290
290
291 def doc(self, obj):
291 def doc(self, obj):
292 """
292 """
293 Return the documentation for this attribute.
293 Return the documentation for this attribute.
294 """
294 """
295
295
296 def shortdoc(self, obj):
296 def shortdoc(self, obj):
297 """
297 """
298 Return a short documentation for this attribute (defaulting to the
298 Return a short documentation for this attribute (defaulting to the
299 first line).
299 first line).
300 """
300 """
301 doc = self.doc(obj)
301 doc = self.doc(obj)
302 if doc is not None:
302 if doc is not None:
303 doc = doc.strip().splitlines()[0].strip()
303 doc = doc.strip().splitlines()[0].strip()
304 return doc
304 return doc
305
305
306 def iter(self, obj):
306 def iter(self, obj):
307 """
307 """
308 Return an iterator for this attribute of the object ``obj``.
308 Return an iterator for this attribute of the object ``obj``.
309 """
309 """
310 return xiter(self.value(obj))
310 return xiter(self.value(obj))
311
311
312
312
313 class SelfDescriptor(Descriptor):
313 class SelfDescriptor(Descriptor):
314 """
314 """
315 A ``SelfDescriptor`` describes the object itself.
315 A ``SelfDescriptor`` describes the object itself.
316 """
316 """
317 def key(self):
317 def key(self):
318 return None
318 return None
319
319
320 def attrtype(self, obj):
320 def attrtype(self, obj):
321 return "self"
321 return "self"
322
322
323 def valuetype(self, obj):
323 def valuetype(self, obj):
324 return type(obj)
324 return type(obj)
325
325
326 def value(self, obj):
326 def value(self, obj):
327 return obj
327 return obj
328
328
329 def __repr__(self):
329 def __repr__(self):
330 return "Self"
330 return "Self"
331
331
332 selfdescriptor = SelfDescriptor() # there's no need for more than one
332 selfdescriptor = SelfDescriptor() # there's no need for more than one
333
333
334
334
335 class AttributeDescriptor(Descriptor):
335 class AttributeDescriptor(Descriptor):
336 """
336 """
337 An ``AttributeDescriptor`` describes a simple attribute of an object.
337 An ``AttributeDescriptor`` describes a simple attribute of an object.
338 """
338 """
339 __slots__ = ("_name", "_doc")
339 __slots__ = ("_name", "_doc")
340
340
341 def __init__(self, name, doc=None):
341 def __init__(self, name, doc=None):
342 self._name = name
342 self._name = name
343 self._doc = doc
343 self._doc = doc
344
344
345 def key(self):
345 def key(self):
346 return self._name
346 return self._name
347
347
348 def doc(self, obj):
348 def doc(self, obj):
349 return self._doc
349 return self._doc
350
350
351 def attrtype(self, obj):
351 def attrtype(self, obj):
352 return "attr"
352 return "attr"
353
353
354 def valuetype(self, obj):
354 def valuetype(self, obj):
355 return type(getattr(obj, self._name))
355 return type(getattr(obj, self._name))
356
356
357 def value(self, obj):
357 def value(self, obj):
358 return getattr(obj, self._name)
358 return getattr(obj, self._name)
359
359
360 def __repr__(self):
360 def __repr__(self):
361 if self._doc is None:
361 if self._doc is None:
362 return "Attribute(%r)" % self._name
362 return "Attribute(%r)" % self._name
363 else:
363 else:
364 return "Attribute(%r, %r)" % (self._name, self._doc)
364 return "Attribute(%r, %r)" % (self._name, self._doc)
365
365
366
366
367 class IndexDescriptor(Descriptor):
367 class IndexDescriptor(Descriptor):
368 """
368 """
369 An ``IndexDescriptor`` describes an "attribute" of an object that is fetched
369 An ``IndexDescriptor`` describes an "attribute" of an object that is fetched
370 via ``__getitem__``.
370 via ``__getitem__``.
371 """
371 """
372 __slots__ = ("_index",)
372 __slots__ = ("_index",)
373
373
374 def __init__(self, index):
374 def __init__(self, index):
375 self._index = index
375 self._index = index
376
376
377 def key(self):
377 def key(self):
378 return self._index
378 return self._index
379
379
380 def attrtype(self, obj):
380 def attrtype(self, obj):
381 return "item"
381 return "item"
382
382
383 def valuetype(self, obj):
383 def valuetype(self, obj):
384 return type(obj[self._index])
384 return type(obj[self._index])
385
385
386 def value(self, obj):
386 def value(self, obj):
387 return obj[self._index]
387 return obj[self._index]
388
388
389 def __repr__(self):
389 def __repr__(self):
390 return "Index(%r)" % self._index
390 return "Index(%r)" % self._index
391
391
392
392
393 class MethodDescriptor(Descriptor):
393 class MethodDescriptor(Descriptor):
394 """
394 """
395 A ``MethodDescriptor`` describes a method of an object that can be called
395 A ``MethodDescriptor`` describes a method of an object that can be called
396 without argument. Note that this method shouldn't change the object.
396 without argument. Note that this method shouldn't change the object.
397 """
397 """
398 __slots__ = ("_name", "_doc")
398 __slots__ = ("_name", "_doc")
399
399
400 def __init__(self, name, doc=None):
400 def __init__(self, name, doc=None):
401 self._name = name
401 self._name = name
402 self._doc = doc
402 self._doc = doc
403
403
404 def key(self):
404 def key(self):
405 return self._name
405 return self._name
406
406
407 def doc(self, obj):
407 def doc(self, obj):
408 if self._doc is None:
408 if self._doc is None:
409 return getattr(obj, self._name).__doc__
409 return getattr(obj, self._name).__doc__
410 return self._doc
410 return self._doc
411
411
412 def attrtype(self, obj):
412 def attrtype(self, obj):
413 return "method"
413 return "method"
414
414
415 def valuetype(self, obj):
415 def valuetype(self, obj):
416 return type(self.value(obj))
416 return type(self.value(obj))
417
417
418 def value(self, obj):
418 def value(self, obj):
419 return getattr(obj, self._name)()
419 return getattr(obj, self._name)()
420
420
421 def __repr__(self):
421 def __repr__(self):
422 if self._doc is None:
422 if self._doc is None:
423 return "Method(%r)" % self._name
423 return "Method(%r)" % self._name
424 else:
424 else:
425 return "Method(%r, %r)" % (self._name, self._doc)
425 return "Method(%r, %r)" % (self._name, self._doc)
426
426
427
427
428 class IterAttributeDescriptor(Descriptor):
428 class IterAttributeDescriptor(Descriptor):
429 """
429 """
430 An ``IterAttributeDescriptor`` works like an ``AttributeDescriptor`` but
430 An ``IterAttributeDescriptor`` works like an ``AttributeDescriptor`` but
431 doesn't return an attribute values (because this value might be e.g. a large
431 doesn't return an attribute values (because this value might be e.g. a large
432 list).
432 list).
433 """
433 """
434 __slots__ = ("_name", "_doc")
434 __slots__ = ("_name", "_doc")
435
435
436 def __init__(self, name, doc=None):
436 def __init__(self, name, doc=None):
437 self._name = name
437 self._name = name
438 self._doc = doc
438 self._doc = doc
439
439
440 def key(self):
440 def key(self):
441 return self._name
441 return self._name
442
442
443 def doc(self, obj):
443 def doc(self, obj):
444 return self._doc
444 return self._doc
445
445
446 def attrtype(self, obj):
446 def attrtype(self, obj):
447 return "iter"
447 return "iter"
448
448
449 def valuetype(self, obj):
449 def valuetype(self, obj):
450 return noitem
450 return noitem
451
451
452 def value(self, obj):
452 def value(self, obj):
453 return noitem
453 return noitem
454
454
455 def iter(self, obj):
455 def iter(self, obj):
456 return xiter(getattr(obj, self._name))
456 return xiter(getattr(obj, self._name))
457
457
458 def __repr__(self):
458 def __repr__(self):
459 if self._doc is None:
459 if self._doc is None:
460 return "IterAttribute(%r)" % self._name
460 return "IterAttribute(%r)" % self._name
461 else:
461 else:
462 return "IterAttribute(%r, %r)" % (self._name, self._doc)
462 return "IterAttribute(%r, %r)" % (self._name, self._doc)
463
463
464
464
465 class IterMethodDescriptor(Descriptor):
465 class IterMethodDescriptor(Descriptor):
466 """
466 """
467 An ``IterMethodDescriptor`` works like an ``MethodDescriptor`` but doesn't
467 An ``IterMethodDescriptor`` works like an ``MethodDescriptor`` but doesn't
468 return an attribute values (because this value might be e.g. a large list).
468 return an attribute values (because this value might be e.g. a large list).
469 """
469 """
470 __slots__ = ("_name", "_doc")
470 __slots__ = ("_name", "_doc")
471
471
472 def __init__(self, name, doc=None):
472 def __init__(self, name, doc=None):
473 self._name = name
473 self._name = name
474 self._doc = doc
474 self._doc = doc
475
475
476 def key(self):
476 def key(self):
477 return self._name
477 return self._name
478
478
479 def doc(self, obj):
479 def doc(self, obj):
480 if self._doc is None:
480 if self._doc is None:
481 return getattr(obj, self._name).__doc__
481 return getattr(obj, self._name).__doc__
482 return self._doc
482 return self._doc
483
483
484 def attrtype(self, obj):
484 def attrtype(self, obj):
485 return "itermethod"
485 return "itermethod"
486
486
487 def valuetype(self, obj):
487 def valuetype(self, obj):
488 return noitem
488 return noitem
489
489
490 def value(self, obj):
490 def value(self, obj):
491 return noitem
491 return noitem
492
492
493 def iter(self, obj):
493 def iter(self, obj):
494 return xiter(getattr(obj, self._name)())
494 return xiter(getattr(obj, self._name)())
495
495
496 def __repr__(self):
496 def __repr__(self):
497 if self._doc is None:
497 if self._doc is None:
498 return "IterMethod(%r)" % self._name
498 return "IterMethod(%r)" % self._name
499 else:
499 else:
500 return "IterMethod(%r, %r)" % (self._name, self._doc)
500 return "IterMethod(%r, %r)" % (self._name, self._doc)
501
501
502
502
503 class FunctionDescriptor(Descriptor):
503 class FunctionDescriptor(Descriptor):
504 """
504 """
505 A ``FunctionDescriptor`` turns a function into a descriptor. The function
505 A ``FunctionDescriptor`` turns a function into a descriptor. The function
506 will be called with the object to get the type and value of the attribute.
506 will be called with the object to get the type and value of the attribute.
507 """
507 """
508 __slots__ = ("_function", "_name", "_doc")
508 __slots__ = ("_function", "_name", "_doc")
509
509
510 def __init__(self, function, name=None, doc=None):
510 def __init__(self, function, name=None, doc=None):
511 self._function = function
511 self._function = function
512 self._name = name
512 self._name = name
513 self._doc = doc
513 self._doc = doc
514
514
515 def key(self):
515 def key(self):
516 return self._function
516 return self._function
517
517
518 def name(self):
518 def name(self):
519 if self._name is not None:
519 if self._name is not None:
520 return self._name
520 return self._name
521 return getattr(self._function, "__xname__", self._function.__name__)
521 return getattr(self._function, "__xname__", self._function.__name__)
522
522
523 def doc(self, obj):
523 def doc(self, obj):
524 if self._doc is None:
524 if self._doc is None:
525 return self._function.__doc__
525 return self._function.__doc__
526 return self._doc
526 return self._doc
527
527
528 def attrtype(self, obj):
528 def attrtype(self, obj):
529 return "function"
529 return "function"
530
530
531 def valuetype(self, obj):
531 def valuetype(self, obj):
532 return type(self._function(obj))
532 return type(self._function(obj))
533
533
534 def value(self, obj):
534 def value(self, obj):
535 return self._function(obj)
535 return self._function(obj)
536
536
537 def __repr__(self):
537 def __repr__(self):
538 if self._doc is None:
538 if self._doc is None:
539 return "Function(%r)" % self._name
539 return "Function(%r)" % self._name
540 else:
540 else:
541 return "Function(%r, %r)" % (self._name, self._doc)
541 return "Function(%r, %r)" % (self._name, self._doc)
542
542
543
543
544 class Table(object):
544 class Table(object):
545 """
545 """
546 A ``Table`` is an object that produces items (just like a normal Python
546 A ``Table`` is an object that produces items (just like a normal Python
547 iterator/generator does) and can be used as the first object in a pipeline
547 iterator/generator does) and can be used as the first object in a pipeline
548 expression. The displayhook will open the default browser for such an object
548 expression. The displayhook will open the default browser for such an object
549 (instead of simply printing the ``repr()`` result).
549 (instead of simply printing the ``repr()`` result).
550 """
550 """
551
551
552 # We want to support ``foo`` and ``foo()`` in pipeline expression:
552 # We want to support ``foo`` and ``foo()`` in pipeline expression:
553 # So we implement the required operators (``|`` and ``+``) in the metaclass,
553 # So we implement the required operators (``|`` and ``+``) in the metaclass,
554 # instantiate the class and forward the operator to the instance
554 # instantiate the class and forward the operator to the instance
555 class __metaclass__(type):
555 class __metaclass__(type):
556 def __iter__(self):
556 def __iter__(self):
557 return iter(self())
557 return iter(self())
558
558
559 def __or__(self, other):
559 def __or__(self, other):
560 return self() | other
560 return self() | other
561
561
562 def __add__(self, other):
562 def __add__(self, other):
563 return self() + other
563 return self() + other
564
564
565 def __radd__(self, other):
565 def __radd__(self, other):
566 return other + self()
566 return other + self()
567
567
568 def __getitem__(self, index):
568 def __getitem__(self, index):
569 return self()[index]
569 return self()[index]
570
570
571 def __getitem__(self, index):
571 def __getitem__(self, index):
572 return item(self, index)
572 return item(self, index)
573
573
574 def __contains__(self, item):
574 def __contains__(self, item):
575 for haveitem in self:
575 for haveitem in self:
576 if item == haveitem:
576 if item == haveitem:
577 return True
577 return True
578 return False
578 return False
579
579
580 def __or__(self, other):
580 def __or__(self, other):
581 # autoinstantiate right hand side
581 # autoinstantiate right hand side
582 if isinstance(other, type) and issubclass(other, (Table, Display)):
582 if isinstance(other, type) and issubclass(other, (Table, Display)):
583 other = other()
583 other = other()
584 # treat simple strings and functions as ``ieval`` instances
584 # treat simple strings and functions as ``ieval`` instances
585 elif not isinstance(other, Display) and not isinstance(other, Table):
585 elif not isinstance(other, Display) and not isinstance(other, Table):
586 other = ieval(other)
586 other = ieval(other)
587 # forward operations to the right hand side
587 # forward operations to the right hand side
588 return other.__ror__(self)
588 return other.__ror__(self)
589
589
590 def __add__(self, other):
590 def __add__(self, other):
591 # autoinstantiate right hand side
591 # autoinstantiate right hand side
592 if isinstance(other, type) and issubclass(other, Table):
592 if isinstance(other, type) and issubclass(other, Table):
593 other = other()
593 other = other()
594 return ichain(self, other)
594 return ichain(self, other)
595
595
596 def __radd__(self, other):
596 def __radd__(self, other):
597 # autoinstantiate left hand side
597 # autoinstantiate left hand side
598 if isinstance(other, type) and issubclass(other, Table):
598 if isinstance(other, type) and issubclass(other, Table):
599 other = other()
599 other = other()
600 return ichain(other, self)
600 return ichain(other, self)
601
601
602
602
603 class Pipe(Table):
603 class Pipe(Table):
604 """
604 """
605 A ``Pipe`` is an object that can be used in a pipeline expression. It
605 A ``Pipe`` is an object that can be used in a pipeline expression. It
606 processes the objects it gets from its input ``Table``/``Pipe``. Note that
606 processes the objects it gets from its input ``Table``/``Pipe``. Note that
607 a ``Pipe`` object can't be used as the first object in a pipeline
607 a ``Pipe`` object can't be used as the first object in a pipeline
608 expression, as it doesn't produces items itself.
608 expression, as it doesn't produces items itself.
609 """
609 """
610 class __metaclass__(Table.__metaclass__):
610 class __metaclass__(Table.__metaclass__):
611 def __ror__(self, input):
611 def __ror__(self, input):
612 return input | self()
612 return input | self()
613
613
614 def __ror__(self, input):
614 def __ror__(self, input):
615 # autoinstantiate left hand side
615 # autoinstantiate left hand side
616 if isinstance(input, type) and issubclass(input, Table):
616 if isinstance(input, type) and issubclass(input, Table):
617 input = input()
617 input = input()
618 self.input = input
618 self.input = input
619 return self
619 return self
620
620
621
621
622 def xrepr(item, mode="default"):
622 def xrepr(item, mode="default"):
623 """
623 """
624 Generic function that adds color output and different display modes to ``repr``.
624 Generic function that adds color output and different display modes to ``repr``.
625
625
626 The result of an ``xrepr`` call is iterable and consists of ``(style, string)``
626 The result of an ``xrepr`` call is iterable and consists of ``(style, string)``
627 tuples. The ``style`` in this tuple must be a ``Style`` object from the
627 tuples. The ``style`` in this tuple must be a ``Style`` object from the
628 ``astring`` module. To reconfigure the output the first yielded tuple can be
628 ``astring`` module. To reconfigure the output the first yielded tuple can be
629 a ``(aligment, full)`` tuple instead of a ``(style, string)`` tuple.
629 a ``(aligment, full)`` tuple instead of a ``(style, string)`` tuple.
630 ``alignment`` can be -1 for left aligned, 0 for centered and 1 for right
630 ``alignment`` can be -1 for left aligned, 0 for centered and 1 for right
631 aligned (the default is left alignment). ``full`` is a boolean that specifies
631 aligned (the default is left alignment). ``full`` is a boolean that specifies
632 whether the complete output must be displayed or the ``Display`` object is
632 whether the complete output must be displayed or the ``Display`` object is
633 allowed to stop output after enough text has been produced (e.g. a syntax
633 allowed to stop output after enough text has been produced (e.g. a syntax
634 highlighted text line would use ``True``, but for a large data structure
634 highlighted text line would use ``True``, but for a large data structure
635 (i.e. a nested list, tuple or dictionary) ``False`` would be used).
635 (i.e. a nested list, tuple or dictionary) ``False`` would be used).
636 The default is full output.
636 The default is full output.
637
637
638 There are four different possible values for ``mode`` depending on where
638 There are four different possible values for ``mode`` depending on where
639 the ``Display`` object will display ``item``:
639 the ``Display`` object will display ``item``:
640
640
641 * ``"header"``: ``item`` will be displayed in a header line (this is used by
641 * ``"header"``: ``item`` will be displayed in a header line (this is used by
642 ``ibrowse``).
642 ``ibrowse``).
643 * ``"footer"``: ``item`` will be displayed in a footer line (this is used by
643 * ``"footer"``: ``item`` will be displayed in a footer line (this is used by
644 ``ibrowse``).
644 ``ibrowse``).
645 * ``"cell"``: ``item`` will be displayed in a table cell/list.
645 * ``"cell"``: ``item`` will be displayed in a table cell/list.
646 * ``"default"``: default mode. If an ``xrepr`` implementation recursively
646 * ``"default"``: default mode. If an ``xrepr`` implementation recursively
647 outputs objects, ``"default"`` must be passed in the recursive calls to
647 outputs objects, ``"default"`` must be passed in the recursive calls to
648 ``xrepr``.
648 ``xrepr``.
649
649
650 If no implementation is registered for ``item``, ``xrepr`` will try the
650 If no implementation is registered for ``item``, ``xrepr`` will try the
651 ``__xrepr__`` method on ``item``. If ``item`` doesn't have an ``__xrepr__``
651 ``__xrepr__`` method on ``item``. If ``item`` doesn't have an ``__xrepr__``
652 method it falls back to ``repr``/``__repr__`` for all modes.
652 method it falls back to ``repr``/``__repr__`` for all modes.
653 """
653 """
654 try:
654 try:
655 func = item.__xrepr__
655 func = item.__xrepr__
656 except AttributeError:
656 except AttributeError:
657 yield (astyle.style_default, repr(item))
657 yield (astyle.style_default, repr(item))
658 else:
658 else:
659 try:
659 try:
660 for x in func(mode):
660 for x in func(mode):
661 yield x
661 yield x
662 except (KeyboardInterrupt, SystemExit):
662 except (KeyboardInterrupt, SystemExit):
663 raise
663 raise
664 except Exception:
664 except Exception:
665 yield (astyle.style_default, repr(item))
665 yield (astyle.style_default, repr(item))
666 xrepr = simplegeneric.generic(xrepr)
666 xrepr = simplegeneric.generic(xrepr)
667
667
668
668
669 def xrepr_none(self, mode="default"):
669 def xrepr_none(self, mode="default"):
670 yield (astyle.style_type_none, repr(self))
670 yield (astyle.style_type_none, repr(self))
671 xrepr.when_object(None)(xrepr_none)
671 xrepr.when_object(None)(xrepr_none)
672
672
673
673
674 def xrepr_noitem(self, mode="default"):
674 def xrepr_noitem(self, mode="default"):
675 yield (2, True)
675 yield (2, True)
676 yield (astyle.style_nodata, "<?>")
676 yield (astyle.style_nodata, "<?>")
677 xrepr.when_object(noitem)(xrepr_noitem)
677 xrepr.when_object(noitem)(xrepr_noitem)
678
678
679
679
680 def xrepr_bool(self, mode="default"):
680 def xrepr_bool(self, mode="default"):
681 yield (astyle.style_type_bool, repr(self))
681 yield (astyle.style_type_bool, repr(self))
682 xrepr.when_type(bool)(xrepr_bool)
682 xrepr.when_type(bool)(xrepr_bool)
683
683
684
684
685 def xrepr_str(self, mode="default"):
685 def xrepr_str(self, mode="default"):
686 if mode == "cell":
686 if mode == "cell":
687 yield (astyle.style_default, repr(self.expandtabs(tab))[1:-1])
687 yield (astyle.style_default, repr(self.expandtabs(tab))[1:-1])
688 else:
688 else:
689 yield (astyle.style_default, repr(self))
689 yield (astyle.style_default, repr(self))
690 xrepr.when_type(str)(xrepr_str)
690 xrepr.when_type(str)(xrepr_str)
691
691
692
692
693 def xrepr_unicode(self, mode="default"):
693 def xrepr_unicode(self, mode="default"):
694 if mode == "cell":
694 if mode == "cell":
695 yield (astyle.style_default, repr(self.expandtabs(tab))[2:-1])
695 yield (astyle.style_default, repr(self.expandtabs(tab))[2:-1])
696 else:
696 else:
697 yield (astyle.style_default, repr(self))
697 yield (astyle.style_default, repr(self))
698 xrepr.when_type(unicode)(xrepr_unicode)
698 xrepr.when_type(unicode)(xrepr_unicode)
699
699
700
700
701 def xrepr_number(self, mode="default"):
701 def xrepr_number(self, mode="default"):
702 yield (1, True)
702 yield (1, True)
703 yield (astyle.style_type_number, repr(self))
703 yield (astyle.style_type_number, repr(self))
704 xrepr.when_type(int)(xrepr_number)
704 xrepr.when_type(int)(xrepr_number)
705 xrepr.when_type(long)(xrepr_number)
705 xrepr.when_type(long)(xrepr_number)
706 xrepr.when_type(float)(xrepr_number)
706 xrepr.when_type(float)(xrepr_number)
707
707
708
708
709 def xrepr_complex(self, mode="default"):
709 def xrepr_complex(self, mode="default"):
710 yield (astyle.style_type_number, repr(self))
710 yield (astyle.style_type_number, repr(self))
711 xrepr.when_type(complex)(xrepr_number)
711 xrepr.when_type(complex)(xrepr_number)
712
712
713
713
714 def xrepr_datetime(self, mode="default"):
714 def xrepr_datetime(self, mode="default"):
715 if mode == "cell":
715 if mode == "cell":
716 # Don't use strftime() here, as this requires year >= 1900
716 # Don't use strftime() here, as this requires year >= 1900
717 yield (astyle.style_type_datetime,
717 yield (astyle.style_type_datetime,
718 "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
718 "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
719 (self.year, self.month, self.day,
719 (self.year, self.month, self.day,
720 self.hour, self.minute, self.second,
720 self.hour, self.minute, self.second,
721 self.microsecond),
721 self.microsecond),
722 )
722 )
723 else:
723 else:
724 yield (astyle.style_type_datetime, repr(self))
724 yield (astyle.style_type_datetime, repr(self))
725 xrepr.when_type(datetime.datetime)(xrepr_datetime)
725 xrepr.when_type(datetime.datetime)(xrepr_datetime)
726
726
727
727
728 def xrepr_date(self, mode="default"):
728 def xrepr_date(self, mode="default"):
729 if mode == "cell":
729 if mode == "cell":
730 yield (astyle.style_type_datetime,
730 yield (astyle.style_type_datetime,
731 "%04d-%02d-%02d" % (self.year, self.month, self.day))
731 "%04d-%02d-%02d" % (self.year, self.month, self.day))
732 else:
732 else:
733 yield (astyle.style_type_datetime, repr(self))
733 yield (astyle.style_type_datetime, repr(self))
734 xrepr.when_type(datetime.date)(xrepr_date)
734 xrepr.when_type(datetime.date)(xrepr_date)
735
735
736
736
737 def xrepr_time(self, mode="default"):
737 def xrepr_time(self, mode="default"):
738 if mode == "cell":
738 if mode == "cell":
739 yield (astyle.style_type_datetime,
739 yield (astyle.style_type_datetime,
740 "%02d:%02d:%02d.%06d" % \
740 "%02d:%02d:%02d.%06d" % \
741 (self.hour, self.minute, self.second, self.microsecond))
741 (self.hour, self.minute, self.second, self.microsecond))
742 else:
742 else:
743 yield (astyle.style_type_datetime, repr(self))
743 yield (astyle.style_type_datetime, repr(self))
744 xrepr.when_type(datetime.time)(xrepr_time)
744 xrepr.when_type(datetime.time)(xrepr_time)
745
745
746
746
747 def xrepr_timedelta(self, mode="default"):
747 def xrepr_timedelta(self, mode="default"):
748 yield (astyle.style_type_datetime, repr(self))
748 yield (astyle.style_type_datetime, repr(self))
749 xrepr.when_type(datetime.timedelta)(xrepr_timedelta)
749 xrepr.when_type(datetime.timedelta)(xrepr_timedelta)
750
750
751
751
752 def xrepr_type(self, mode="default"):
752 def xrepr_type(self, mode="default"):
753 if self.__module__ == "__builtin__":
753 if self.__module__ == "__builtin__":
754 yield (astyle.style_type_type, self.__name__)
754 yield (astyle.style_type_type, self.__name__)
755 else:
755 else:
756 yield (astyle.style_type_type, "%s.%s" % (self.__module__, self.__name__))
756 yield (astyle.style_type_type, "%s.%s" % (self.__module__, self.__name__))
757 xrepr.when_type(type)(xrepr_type)
757 xrepr.when_type(type)(xrepr_type)
758
758
759
759
760 def xrepr_exception(self, mode="default"):
760 def xrepr_exception(self, mode="default"):
761 if self.__class__.__module__ == "exceptions":
761 if self.__class__.__module__ == "exceptions":
762 classname = self.__class__.__name__
762 classname = self.__class__.__name__
763 else:
763 else:
764 classname = "%s.%s" % \
764 classname = "%s.%s" % \
765 (self.__class__.__module__, self.__class__.__name__)
765 (self.__class__.__module__, self.__class__.__name__)
766 if mode == "header" or mode == "footer":
766 if mode == "header" or mode == "footer":
767 yield (astyle.style_error, "%s: %s" % (classname, self))
767 yield (astyle.style_error, "%s: %s" % (classname, self))
768 else:
768 else:
769 yield (astyle.style_error, classname)
769 yield (astyle.style_error, classname)
770 xrepr.when_type(Exception)(xrepr_exception)
770 xrepr.when_type(Exception)(xrepr_exception)
771
771
772
772
773 def xrepr_listtuple(self, mode="default"):
773 def xrepr_listtuple(self, mode="default"):
774 if mode == "header" or mode == "footer":
774 if mode == "header" or mode == "footer":
775 if self.__class__.__module__ == "__builtin__":
775 if self.__class__.__module__ == "__builtin__":
776 classname = self.__class__.__name__
776 classname = self.__class__.__name__
777 else:
777 else:
778 classname = "%s.%s" % \
778 classname = "%s.%s" % \
779 (self.__class__.__module__,self.__class__.__name__)
779 (self.__class__.__module__,self.__class__.__name__)
780 yield (astyle.style_default,
780 yield (astyle.style_default,
781 "<%s object with %d items at 0x%x>" % \
781 "<%s object with %d items at 0x%x>" % \
782 (classname, len(self), id(self)))
782 (classname, len(self), id(self)))
783 else:
783 else:
784 yield (-1, False)
784 yield (-1, False)
785 if isinstance(self, list):
785 if isinstance(self, list):
786 yield (astyle.style_default, "[")
786 yield (astyle.style_default, "[")
787 end = "]"
787 end = "]"
788 else:
788 else:
789 yield (astyle.style_default, "(")
789 yield (astyle.style_default, "(")
790 end = ")"
790 end = ")"
791 for (i, subself) in enumerate(self):
791 for (i, subself) in enumerate(self):
792 if i:
792 if i:
793 yield (astyle.style_default, ", ")
793 yield (astyle.style_default, ", ")
794 for part in xrepr(subself, "default"):
794 for part in xrepr(subself, "default"):
795 yield part
795 yield part
796 yield (astyle.style_default, end)
796 yield (astyle.style_default, end)
797 xrepr.when_type(list)(xrepr_listtuple)
797 xrepr.when_type(list)(xrepr_listtuple)
798 xrepr.when_type(tuple)(xrepr_listtuple)
798 xrepr.when_type(tuple)(xrepr_listtuple)
799
799
800
800
801 def xrepr_dict(self, mode="default"):
801 def xrepr_dict(self, mode="default"):
802 if mode == "header" or mode == "footer":
802 if mode == "header" or mode == "footer":
803 if self.__class__.__module__ == "__builtin__":
803 if self.__class__.__module__ == "__builtin__":
804 classname = self.__class__.__name__
804 classname = self.__class__.__name__
805 else:
805 else:
806 classname = "%s.%s" % \
806 classname = "%s.%s" % \
807 (self.__class__.__module__,self.__class__.__name__)
807 (self.__class__.__module__,self.__class__.__name__)
808 yield (astyle.style_default,
808 yield (astyle.style_default,
809 "<%s object with %d items at 0x%x>" % \
809 "<%s object with %d items at 0x%x>" % \
810 (classname, len(self), id(self)))
810 (classname, len(self), id(self)))
811 else:
811 else:
812 yield (-1, False)
812 yield (-1, False)
813 if isinstance(self, dict):
813 if isinstance(self, dict):
814 yield (astyle.style_default, "{")
814 yield (astyle.style_default, "{")
815 end = "}"
815 end = "}"
816 else:
816 else:
817 yield (astyle.style_default, "dictproxy((")
817 yield (astyle.style_default, "dictproxy((")
818 end = "})"
818 end = "})"
819 for (i, (key, value)) in enumerate(self.iteritems()):
819 for (i, (key, value)) in enumerate(self.iteritems()):
820 if i:
820 if i:
821 yield (astyle.style_default, ", ")
821 yield (astyle.style_default, ", ")
822 for part in xrepr(key, "default"):
822 for part in xrepr(key, "default"):
823 yield part
823 yield part
824 yield (astyle.style_default, ": ")
824 yield (astyle.style_default, ": ")
825 for part in xrepr(value, "default"):
825 for part in xrepr(value, "default"):
826 yield part
826 yield part
827 yield (astyle.style_default, end)
827 yield (astyle.style_default, end)
828 xrepr.when_type(dict)(xrepr_dict)
828 xrepr.when_type(dict)(xrepr_dict)
829 xrepr.when_type(types.DictProxyType)(xrepr_dict)
829 xrepr.when_type(types.DictProxyType)(xrepr_dict)
830
830
831
831
832 def upgradexattr(attr):
832 def upgradexattr(attr):
833 """
833 """
834 Convert an attribute descriptor string to a real descriptor object.
834 Convert an attribute descriptor string to a real descriptor object.
835
835
836 If attr already is a descriptor object return if unmodified. A
836 If attr already is a descriptor object return if unmodified. A
837 ``SelfDescriptor`` will be returned if ``attr`` is ``None``. ``"foo"``
837 ``SelfDescriptor`` will be returned if ``attr`` is ``None``. ``"foo"``
838 returns an ``AttributeDescriptor`` for the attribute named ``"foo"``.
838 returns an ``AttributeDescriptor`` for the attribute named ``"foo"``.
839 ``"foo()"`` returns a ``MethodDescriptor`` for the method named ``"foo"``.
839 ``"foo()"`` returns a ``MethodDescriptor`` for the method named ``"foo"``.
840 ``"-foo"`` will return an ``IterAttributeDescriptor`` for the attribute
840 ``"-foo"`` will return an ``IterAttributeDescriptor`` for the attribute
841 named ``"foo"`` and ``"-foo()"`` will return an ``IterMethodDescriptor``
841 named ``"foo"`` and ``"-foo()"`` will return an ``IterMethodDescriptor``
842 for the method named ``"foo"``. Furthermore integer will return the appropriate
842 for the method named ``"foo"``. Furthermore integer will return the appropriate
843 ``IndexDescriptor`` and callables will return a ``FunctionDescriptor``.
843 ``IndexDescriptor`` and callables will return a ``FunctionDescriptor``.
844 """
844 """
845 if attr is None:
845 if attr is None:
846 return selfdescriptor
846 return selfdescriptor
847 elif isinstance(attr, Descriptor):
847 elif isinstance(attr, Descriptor):
848 return attr
848 return attr
849 elif isinstance(attr, str):
849 elif isinstance(attr, str):
850 if attr.endswith("()"):
850 if attr.endswith("()"):
851 if attr.startswith("-"):
851 if attr.startswith("-"):
852 return IterMethodDescriptor(attr[1:-2])
852 return IterMethodDescriptor(attr[1:-2])
853 else:
853 else:
854 return MethodDescriptor(attr[:-2])
854 return MethodDescriptor(attr[:-2])
855 else:
855 else:
856 if attr.startswith("-"):
856 if attr.startswith("-"):
857 return IterAttributeDescriptor(attr[1:])
857 return IterAttributeDescriptor(attr[1:])
858 else:
858 else:
859 return AttributeDescriptor(attr)
859 return AttributeDescriptor(attr)
860 elif isinstance(attr, (int, long)):
860 elif isinstance(attr, (int, long)):
861 return IndexDescriptor(attr)
861 return IndexDescriptor(attr)
862 elif callable(attr):
862 elif callable(attr):
863 return FunctionDescriptor(attr)
863 return FunctionDescriptor(attr)
864 else:
864 else:
865 raise TypeError("can't handle descriptor %r" % attr)
865 raise TypeError("can't handle descriptor %r" % attr)
866
866
867
867
868 def xattrs(item, mode="default"):
868 def xattrs(item, mode="default"):
869 """
869 """
870 Generic function that returns an iterable of attribute descriptors
870 Generic function that returns an iterable of attribute descriptors
871 to be used for displaying the attributes ob the object ``item`` in display
871 to be used for displaying the attributes ob the object ``item`` in display
872 mode ``mode``.
872 mode ``mode``.
873
873
874 There are two possible modes:
874 There are two possible modes:
875
875
876 * ``"detail"``: The ``Display`` object wants to display a detailed list
876 * ``"detail"``: The ``Display`` object wants to display a detailed list
877 of the object attributes.
877 of the object attributes.
878 * ``"default"``: The ``Display`` object wants to display the object in a
878 * ``"default"``: The ``Display`` object wants to display the object in a
879 list view.
879 list view.
880
880
881 If no implementation is registered for the object ``item`` ``xattrs`` falls
881 If no implementation is registered for the object ``item`` ``xattrs`` falls
882 back to trying the ``__xattrs__`` method of the object. If this doesn't
882 back to trying the ``__xattrs__`` method of the object. If this doesn't
883 exist either, ``dir(item)`` is used for ``"detail"`` mode and ``(None,)``
883 exist either, ``dir(item)`` is used for ``"detail"`` mode and ``(None,)``
884 for ``"default"`` mode.
884 for ``"default"`` mode.
885
885
886 The implementation must yield attribute descriptor (see the class
886 The implementation must yield attribute descriptor (see the class
887 ``Descriptor`` for more info). The ``__xattrs__`` method may also return
887 ``Descriptor`` for more info). The ``__xattrs__`` method may also return
888 attribute descriptor string (and ``None``) which will be converted to real
888 attribute descriptor string (and ``None``) which will be converted to real
889 descriptors by ``upgradexattr()``.
889 descriptors by ``upgradexattr()``.
890 """
890 """
891 try:
891 try:
892 func = item.__xattrs__
892 func = item.__xattrs__
893 except AttributeError:
893 except AttributeError:
894 if mode == "detail":
894 if mode == "detail":
895 for attrname in dir(item):
895 for attrname in dir(item):
896 yield AttributeDescriptor(attrname)
896 yield AttributeDescriptor(attrname)
897 else:
897 else:
898 yield selfdescriptor
898 yield selfdescriptor
899 else:
899 else:
900 for attr in func(mode):
900 for attr in func(mode):
901 yield upgradexattr(attr)
901 yield upgradexattr(attr)
902 xattrs = simplegeneric.generic(xattrs)
902 xattrs = simplegeneric.generic(xattrs)
903
903
904
904
905 def xattrs_complex(self, mode="default"):
905 def xattrs_complex(self, mode="default"):
906 if mode == "detail":
906 if mode == "detail":
907 return (AttributeDescriptor("real"), AttributeDescriptor("imag"))
907 return (AttributeDescriptor("real"), AttributeDescriptor("imag"))
908 return (selfdescriptor,)
908 return (selfdescriptor,)
909 xattrs.when_type(complex)(xattrs_complex)
909 xattrs.when_type(complex)(xattrs_complex)
910
910
911
911
912 def _isdict(item):
912 def _isdict(item):
913 try:
913 try:
914 itermeth = item.__class__.__iter__
914 itermeth = item.__class__.__iter__
915 except (AttributeError, TypeError):
915 except (AttributeError, TypeError):
916 return False
916 return False
917 return itermeth is dict.__iter__ or itermeth is types.DictProxyType.__iter__
917 return itermeth is dict.__iter__ or itermeth is types.DictProxyType.__iter__
918
918
919
919
920 def _isstr(item):
920 def _isstr(item):
921 if not isinstance(item, basestring):
921 if not isinstance(item, basestring):
922 return False
922 return False
923 try:
923 try:
924 itermeth = item.__class__.__iter__
924 itermeth = item.__class__.__iter__
925 except AttributeError:
925 except AttributeError:
926 return True
926 return True
927 return False # ``__iter__`` has been redefined
927 return False # ``__iter__`` has been redefined
928
928
929
929
930 def xiter(item):
930 def xiter(item):
931 """
931 """
932 Generic function that implements iteration for pipeline expression. If no
932 Generic function that implements iteration for pipeline expression. If no
933 implementation is registered for ``item`` ``xiter`` falls back to ``iter``.
933 implementation is registered for ``item`` ``xiter`` falls back to ``iter``.
934 """
934 """
935 try:
935 try:
936 func = item.__xiter__
936 func = item.__xiter__
937 except AttributeError:
937 except AttributeError:
938 if _isdict(item):
938 if _isdict(item):
939 def items(item):
939 def items(item):
940 fields = ("key", "value")
940 fields = ("key", "value")
941 for (key, value) in item.iteritems():
941 for (key, value) in item.iteritems():
942 yield Fields(fields, key=key, value=value)
942 yield Fields(fields, key=key, value=value)
943 return items(item)
943 return items(item)
944 elif isinstance(item, new.module):
944 elif isinstance(item, new.module):
945 def items(item):
945 def items(item):
946 fields = ("key", "value")
946 fields = ("key", "value")
947 for key in sorted(item.__dict__):
947 for key in sorted(item.__dict__):
948 yield Fields(fields, key=key, value=getattr(item, key))
948 yield Fields(fields, key=key, value=getattr(item, key))
949 return items(item)
949 return items(item)
950 elif _isstr(item):
950 elif _isstr(item):
951 if not item:
951 if not item:
952 raise ValueError("can't enter empty string")
952 raise ValueError("can't enter empty string")
953 lines = item.splitlines()
953 lines = item.splitlines()
954 if len(lines) == 1:
954 if len(lines) == 1:
955 def iterone(item):
955 def iterone(item):
956 yield item
956 yield item
957 return iterone(item)
957 return iterone(item)
958 else:
958 else:
959 return iter(lines)
959 return iter(lines)
960 return iter(item)
960 return iter(item)
961 else:
961 else:
962 return iter(func()) # iter() just to be safe
962 return iter(func()) # iter() just to be safe
963 xiter = simplegeneric.generic(xiter)
963 xiter = simplegeneric.generic(xiter)
964
964
965
965
966 class ichain(Pipe):
966 class ichain(Pipe):
967 """
967 """
968 Chains multiple ``Table``s into one.
968 Chains multiple ``Table``s into one.
969 """
969 """
970
970
971 def __init__(self, *iters):
971 def __init__(self, *iters):
972 self.iters = iters
972 self.iters = iters
973
973
974 def __iter__(self):
974 def __iter__(self):
975 return itertools.chain(*self.iters)
975 return itertools.chain(*self.iters)
976
976
977 def __xrepr__(self, mode="default"):
977 def __xrepr__(self, mode="default"):
978 if mode == "header" or mode == "footer":
978 if mode == "header" or mode == "footer":
979 for (i, item) in enumerate(self.iters):
979 for (i, item) in enumerate(self.iters):
980 if i:
980 if i:
981 yield (astyle.style_default, "+")
981 yield (astyle.style_default, "+")
982 if isinstance(item, Pipe):
982 if isinstance(item, Pipe):
983 yield (astyle.style_default, "(")
983 yield (astyle.style_default, "(")
984 for part in xrepr(item, mode):
984 for part in xrepr(item, mode):
985 yield part
985 yield part
986 if isinstance(item, Pipe):
986 if isinstance(item, Pipe):
987 yield (astyle.style_default, ")")
987 yield (astyle.style_default, ")")
988 else:
988 else:
989 yield (astyle.style_default, repr(self))
989 yield (astyle.style_default, repr(self))
990
990
991 def __repr__(self):
991 def __repr__(self):
992 args = ", ".join([repr(it) for it in self.iters])
992 args = ", ".join([repr(it) for it in self.iters])
993 return "%s.%s(%s)" % \
993 return "%s.%s(%s)" % \
994 (self.__class__.__module__, self.__class__.__name__, args)
994 (self.__class__.__module__, self.__class__.__name__, args)
995
995
996
996
997 class ifile(path.path):
997 class ifile(path.path):
998 """
998 """
999 file (or directory) object.
999 file (or directory) object.
1000 """
1000 """
1001
1001
1002 def getmode(self):
1002 def getmode(self):
1003 return self.stat().st_mode
1003 return self.stat().st_mode
1004 mode = property(getmode, None, None, "Access mode")
1004 mode = property(getmode, None, None, "Access mode")
1005
1005
1006 def gettype(self):
1006 def gettype(self):
1007 data = [
1007 data = [
1008 (stat.S_ISREG, "file"),
1008 (stat.S_ISREG, "file"),
1009 (stat.S_ISDIR, "dir"),
1009 (stat.S_ISDIR, "dir"),
1010 (stat.S_ISCHR, "chardev"),
1010 (stat.S_ISCHR, "chardev"),
1011 (stat.S_ISBLK, "blockdev"),
1011 (stat.S_ISBLK, "blockdev"),
1012 (stat.S_ISFIFO, "fifo"),
1012 (stat.S_ISFIFO, "fifo"),
1013 (stat.S_ISLNK, "symlink"),
1013 (stat.S_ISLNK, "symlink"),
1014 (stat.S_ISSOCK,"socket"),
1014 (stat.S_ISSOCK,"socket"),
1015 ]
1015 ]
1016 lstat = self.lstat()
1016 lstat = self.lstat()
1017 if lstat is not None:
1017 if lstat is not None:
1018 types = set([text for (func, text) in data if func(lstat.st_mode)])
1018 types = set([text for (func, text) in data if func(lstat.st_mode)])
1019 else:
1019 else:
1020 types = set()
1020 types = set()
1021 m = self.mode
1021 m = self.mode
1022 types.update([text for (func, text) in data if func(m)])
1022 types.update([text for (func, text) in data if func(m)])
1023 return ", ".join(types)
1023 return ", ".join(types)
1024 type = property(gettype, None, None, "file type (file, directory, link, etc.)")
1024 type = property(gettype, None, None, "file type (file, directory, link, etc.)")
1025
1025
1026 def getmodestr(self):
1026 def getmodestr(self):
1027 m = self.mode
1027 m = self.mode
1028 data = [
1028 data = [
1029 (stat.S_IRUSR, "-r"),
1029 (stat.S_IRUSR, "-r"),
1030 (stat.S_IWUSR, "-w"),
1030 (stat.S_IWUSR, "-w"),
1031 (stat.S_IXUSR, "-x"),
1031 (stat.S_IXUSR, "-x"),
1032 (stat.S_IRGRP, "-r"),
1032 (stat.S_IRGRP, "-r"),
1033 (stat.S_IWGRP, "-w"),
1033 (stat.S_IWGRP, "-w"),
1034 (stat.S_IXGRP, "-x"),
1034 (stat.S_IXGRP, "-x"),
1035 (stat.S_IROTH, "-r"),
1035 (stat.S_IROTH, "-r"),
1036 (stat.S_IWOTH, "-w"),
1036 (stat.S_IWOTH, "-w"),
1037 (stat.S_IXOTH, "-x"),
1037 (stat.S_IXOTH, "-x"),
1038 ]
1038 ]
1039 return "".join([text[bool(m&bit)] for (bit, text) in data])
1039 return "".join([text[bool(m&bit)] for (bit, text) in data])
1040
1040
1041 modestr = property(getmodestr, None, None, "Access mode as string")
1041 modestr = property(getmodestr, None, None, "Access mode as string")
1042
1042
1043 def getblocks(self):
1043 def getblocks(self):
1044 return self.stat().st_blocks
1044 return self.stat().st_blocks
1045 blocks = property(getblocks, None, None, "File size in blocks")
1045 blocks = property(getblocks, None, None, "File size in blocks")
1046
1046
1047 def getblksize(self):
1047 def getblksize(self):
1048 return self.stat().st_blksize
1048 return self.stat().st_blksize
1049 blksize = property(getblksize, None, None, "Filesystem block size")
1049 blksize = property(getblksize, None, None, "Filesystem block size")
1050
1050
1051 def getdev(self):
1051 def getdev(self):
1052 return self.stat().st_dev
1052 return self.stat().st_dev
1053 dev = property(getdev)
1053 dev = property(getdev)
1054
1054
1055 def getnlink(self):
1055 def getnlink(self):
1056 return self.stat().st_nlink
1056 return self.stat().st_nlink
1057 nlink = property(getnlink, None, None, "Number of links")
1057 nlink = property(getnlink, None, None, "Number of links")
1058
1058
1059 def getuid(self):
1059 def getuid(self):
1060 return self.stat().st_uid
1060 return self.stat().st_uid
1061 uid = property(getuid, None, None, "User id of file owner")
1061 uid = property(getuid, None, None, "User id of file owner")
1062
1062
1063 def getgid(self):
1063 def getgid(self):
1064 return self.stat().st_gid
1064 return self.stat().st_gid
1065 gid = property(getgid, None, None, "Group id of file owner")
1065 gid = property(getgid, None, None, "Group id of file owner")
1066
1066
1067 def getowner(self):
1067 def getowner(self):
1068 stat = self.stat()
1068 stat = self.stat()
1069 try:
1069 try:
1070 return pwd.getpwuid(stat.st_uid).pw_name
1070 return pwd.getpwuid(stat.st_uid).pw_name
1071 except KeyError:
1071 except KeyError:
1072 return stat.st_uid
1072 return stat.st_uid
1073 owner = property(getowner, None, None, "Owner name (or id)")
1073 owner = property(getowner, None, None, "Owner name (or id)")
1074
1074
1075 def getgroup(self):
1075 def getgroup(self):
1076 stat = self.stat()
1076 stat = self.stat()
1077 try:
1077 try:
1078 return grp.getgrgid(stat.st_gid).gr_name
1078 return grp.getgrgid(stat.st_gid).gr_name
1079 except KeyError:
1079 except KeyError:
1080 return stat.st_gid
1080 return stat.st_gid
1081 group = property(getgroup, None, None, "Group name (or id)")
1081 group = property(getgroup, None, None, "Group name (or id)")
1082
1082
1083 def getadate(self):
1083 def getadate(self):
1084 return datetime.datetime.utcfromtimestamp(self.atime)
1084 return datetime.datetime.utcfromtimestamp(self.atime)
1085 adate = property(getadate, None, None, "Access date")
1085 adate = property(getadate, None, None, "Access date")
1086
1086
1087 def getcdate(self):
1087 def getcdate(self):
1088 return datetime.datetime.utcfromtimestamp(self.ctime)
1088 return datetime.datetime.utcfromtimestamp(self.ctime)
1089 cdate = property(getcdate, None, None, "Creation date")
1089 cdate = property(getcdate, None, None, "Creation date")
1090
1090
1091 def getmdate(self):
1091 def getmdate(self):
1092 return datetime.datetime.utcfromtimestamp(self.mtime)
1092 return datetime.datetime.utcfromtimestamp(self.mtime)
1093 mdate = property(getmdate, None, None, "Modification date")
1093 mdate = property(getmdate, None, None, "Modification date")
1094
1094
1095 def mimetype(self):
1095 def mimetype(self):
1096 """
1096 """
1097 Return MIME type guessed from the extension.
1097 Return MIME type guessed from the extension.
1098 """
1098 """
1099 return mimetypes.guess_type(self.basename())[0]
1099 return mimetypes.guess_type(self.basename())[0]
1100
1100
1101 def encoding(self):
1101 def encoding(self):
1102 """
1102 """
1103 Return guessed compression (like "compress" or "gzip").
1103 Return guessed compression (like "compress" or "gzip").
1104 """
1104 """
1105 return mimetypes.guess_type(self.basename())[1]
1105 return mimetypes.guess_type(self.basename())[1]
1106
1106
1107 def __repr__(self):
1107 def __repr__(self):
1108 return "ifile(%s)" % path._base.__repr__(self)
1108 return "ifile(%s)" % path._base.__repr__(self)
1109
1109
1110 if sys.platform == "win32":
1110 if sys.platform == "win32":
1111 defaultattrs = (None, "type", "size", "modestr", "mdate")
1111 defaultattrs = (None, "type", "size", "modestr", "mdate")
1112 else:
1112 else:
1113 defaultattrs = (None, "type", "size", "modestr", "owner", "group", "mdate")
1113 defaultattrs = (None, "type", "size", "modestr", "owner", "group", "mdate")
1114
1114
1115 def __xattrs__(self, mode="default"):
1115 def __xattrs__(self, mode="default"):
1116 if mode == "detail":
1116 if mode == "detail":
1117 return (
1117 return (
1118 "name",
1118 "name",
1119 "basename()",
1119 "basename()",
1120 "abspath()",
1120 "abspath()",
1121 "realpath()",
1121 "realpath()",
1122 "type",
1122 "type",
1123 "mode",
1123 "mode",
1124 "modestr",
1124 "modestr",
1125 "stat()",
1125 "stat()",
1126 "lstat()",
1126 "lstat()",
1127 "uid",
1127 "uid",
1128 "gid",
1128 "gid",
1129 "owner",
1129 "owner",
1130 "group",
1130 "group",
1131 "dev",
1131 "dev",
1132 "nlink",
1132 "nlink",
1133 "ctime",
1133 "ctime",
1134 "mtime",
1134 "mtime",
1135 "atime",
1135 "atime",
1136 "cdate",
1136 "cdate",
1137 "mdate",
1137 "mdate",
1138 "adate",
1138 "adate",
1139 "size",
1139 "size",
1140 "blocks",
1140 "blocks",
1141 "blksize",
1141 "blksize",
1142 "isdir()",
1142 "isdir()",
1143 "islink()",
1143 "islink()",
1144 "mimetype()",
1144 "mimetype()",
1145 "encoding()",
1145 "encoding()",
1146 "-listdir()",
1146 "-listdir()",
1147 "-dirs()",
1147 "-dirs()",
1148 "-files()",
1148 "-files()",
1149 "-walk()",
1149 "-walk()",
1150 "-walkdirs()",
1150 "-walkdirs()",
1151 "-walkfiles()",
1151 "-walkfiles()",
1152 )
1152 )
1153 else:
1153 else:
1154 return self.defaultattrs
1154 return self.defaultattrs
1155
1155
1156
1156
1157 def xiter_ifile(self):
1157 def xiter_ifile(self):
1158 if self.isdir():
1158 if self.isdir():
1159 yield (self / os.pardir).abspath()
1159 yield (self / os.pardir).abspath()
1160 for child in sorted(self.listdir()):
1160 for child in sorted(self.listdir()):
1161 yield child
1161 yield child
1162 else:
1162 else:
1163 f = self.open("rb")
1163 f = self.open("rb")
1164 for line in f:
1164 for line in f:
1165 yield line
1165 yield line
1166 f.close()
1166 f.close()
1167 xiter.when_type(ifile)(xiter_ifile)
1167 xiter.when_type(ifile)(xiter_ifile)
1168
1168
1169
1169
1170 # We need to implement ``xrepr`` for ``ifile`` as a generic function, because
1170 # We need to implement ``xrepr`` for ``ifile`` as a generic function, because
1171 # otherwise ``xrepr_str`` would kick in.
1171 # otherwise ``xrepr_str`` would kick in.
1172 def xrepr_ifile(self, mode="default"):
1172 def xrepr_ifile(self, mode="default"):
1173 try:
1173 try:
1174 if self.isdir():
1174 if self.isdir():
1175 name = "idir"
1175 name = "idir"
1176 style = astyle.style_dir
1176 style = astyle.style_dir
1177 else:
1177 else:
1178 name = "ifile"
1178 name = "ifile"
1179 style = astyle.style_file
1179 style = astyle.style_file
1180 except IOError:
1180 except IOError:
1181 name = "ifile"
1181 name = "ifile"
1182 style = astyle.style_default
1182 style = astyle.style_default
1183 if mode in ("cell", "header", "footer"):
1183 if mode in ("cell", "header", "footer"):
1184 abspath = repr(path._base(self.normpath()))
1184 abspath = repr(path._base(self.normpath()))
1185 if abspath.startswith("u"):
1185 if abspath.startswith("u"):
1186 abspath = abspath[2:-1]
1186 abspath = abspath[2:-1]
1187 else:
1187 else:
1188 abspath = abspath[1:-1]
1188 abspath = abspath[1:-1]
1189 if mode == "cell":
1189 if mode == "cell":
1190 yield (style, abspath)
1190 yield (style, abspath)
1191 else:
1191 else:
1192 yield (style, "%s(%s)" % (name, abspath))
1192 yield (style, "%s(%s)" % (name, abspath))
1193 else:
1193 else:
1194 yield (style, repr(self))
1194 yield (style, repr(self))
1195 xrepr.when_type(ifile)(xrepr_ifile)
1195 xrepr.when_type(ifile)(xrepr_ifile)
1196
1196
1197
1197
1198 class ils(Table):
1198 class ils(Table):
1199 """
1199 """
1200 List the current (or a specified) directory.
1200 List the current (or a specified) directory.
1201
1201
1202 Examples:
1202 Examples:
1203
1203
1204 >>> ils
1204 >>> ils
1205 >>> ils("/usr/local/lib/python2.4")
1205 >>> ils("/usr/local/lib/python2.4")
1206 >>> ils("~")
1206 >>> ils("~")
1207 """
1207 """
1208 def __init__(self, base=os.curdir, dirs=True, files=True):
1208 def __init__(self, base=os.curdir, dirs=True, files=True):
1209 self.base = os.path.expanduser(base)
1209 self.base = os.path.expanduser(base)
1210 self.dirs = dirs
1210 self.dirs = dirs
1211 self.files = files
1211 self.files = files
1212
1212
1213 def __iter__(self):
1213 def __iter__(self):
1214 base = ifile(self.base)
1214 base = ifile(self.base)
1215 yield (base / os.pardir).abspath()
1215 yield (base / os.pardir).abspath()
1216 for child in sorted(base.listdir()):
1216 for child in sorted(base.listdir()):
1217 if self.dirs:
1217 if self.dirs:
1218 if self.files:
1218 if self.files:
1219 yield child
1219 yield child
1220 else:
1220 else:
1221 if child.isdir():
1221 if child.isdir():
1222 yield child
1222 yield child
1223 elif self.files:
1223 elif self.files:
1224 if not child.isdir():
1224 if not child.isdir():
1225 yield child
1225 yield child
1226
1226
1227 def __xrepr__(self, mode="default"):
1227 def __xrepr__(self, mode="default"):
1228 return xrepr(ifile(self.base), mode)
1228 return xrepr(ifile(self.base), mode)
1229
1229
1230 def __repr__(self):
1230 def __repr__(self):
1231 return "%s.%s(%r)" % \
1231 return "%s.%s(%r)" % \
1232 (self.__class__.__module__, self.__class__.__name__, self.base)
1232 (self.__class__.__module__, self.__class__.__name__, self.base)
1233
1233
1234
1234
1235 class iglob(Table):
1235 class iglob(Table):
1236 """
1236 """
1237 List all files and directories matching a specified pattern.
1237 List all files and directories matching a specified pattern.
1238 (See ``glob.glob()`` for more info.).
1238 (See ``glob.glob()`` for more info.).
1239
1239
1240 Examples:
1240 Examples:
1241
1241
1242 >>> iglob("*.py")
1242 >>> iglob("*.py")
1243 """
1243 """
1244 def __init__(self, glob):
1244 def __init__(self, glob):
1245 self.glob = glob
1245 self.glob = glob
1246
1246
1247 def __iter__(self):
1247 def __iter__(self):
1248 for name in glob.glob(self.glob):
1248 for name in glob.glob(self.glob):
1249 yield ifile(name)
1249 yield ifile(name)
1250
1250
1251 def __xrepr__(self, mode="default"):
1251 def __xrepr__(self, mode="default"):
1252 if mode == "header" or mode == "footer" or mode == "cell":
1252 if mode == "header" or mode == "footer" or mode == "cell":
1253 yield (astyle.style_default,
1253 yield (astyle.style_default,
1254 "%s(%r)" % (self.__class__.__name__, self.glob))
1254 "%s(%r)" % (self.__class__.__name__, self.glob))
1255 else:
1255 else:
1256 yield (astyle.style_default, repr(self))
1256 yield (astyle.style_default, repr(self))
1257
1257
1258 def __repr__(self):
1258 def __repr__(self):
1259 return "%s.%s(%r)" % \
1259 return "%s.%s(%r)" % \
1260 (self.__class__.__module__, self.__class__.__name__, self.glob)
1260 (self.__class__.__module__, self.__class__.__name__, self.glob)
1261
1261
1262
1262
1263 class iwalk(Table):
1263 class iwalk(Table):
1264 """
1264 """
1265 List all files and directories in a directory and it's subdirectory.
1265 List all files and directories in a directory and it's subdirectory.
1266
1266
1267 >>> iwalk
1267 >>> iwalk
1268 >>> iwalk("/usr/local/lib/python2.4")
1268 >>> iwalk("/usr/local/lib/python2.4")
1269 >>> iwalk("~")
1269 >>> iwalk("~")
1270 """
1270 """
1271 def __init__(self, base=os.curdir, dirs=True, files=True):
1271 def __init__(self, base=os.curdir, dirs=True, files=True):
1272 self.base = os.path.expanduser(base)
1272 self.base = os.path.expanduser(base)
1273 self.dirs = dirs
1273 self.dirs = dirs
1274 self.files = files
1274 self.files = files
1275
1275
1276 def __iter__(self):
1276 def __iter__(self):
1277 for (dirpath, dirnames, filenames) in os.walk(self.base):
1277 for (dirpath, dirnames, filenames) in os.walk(self.base):
1278 if self.dirs:
1278 if self.dirs:
1279 for name in sorted(dirnames):
1279 for name in sorted(dirnames):
1280 yield ifile(os.path.join(dirpath, name))
1280 yield ifile(os.path.join(dirpath, name))
1281 if self.files:
1281 if self.files:
1282 for name in sorted(filenames):
1282 for name in sorted(filenames):
1283 yield ifile(os.path.join(dirpath, name))
1283 yield ifile(os.path.join(dirpath, name))
1284
1284
1285 def __xrepr__(self, mode="default"):
1285 def __xrepr__(self, mode="default"):
1286 if mode == "header" or mode == "footer" or mode == "cell":
1286 if mode == "header" or mode == "footer" or mode == "cell":
1287 yield (astyle.style_default,
1287 yield (astyle.style_default,
1288 "%s(%r)" % (self.__class__.__name__, self.base))
1288 "%s(%r)" % (self.__class__.__name__, self.base))
1289 else:
1289 else:
1290 yield (astyle.style_default, repr(self))
1290 yield (astyle.style_default, repr(self))
1291
1291
1292 def __repr__(self):
1292 def __repr__(self):
1293 return "%s.%s(%r)" % \
1293 return "%s.%s(%r)" % \
1294 (self.__class__.__module__, self.__class__.__name__, self.base)
1294 (self.__class__.__module__, self.__class__.__name__, self.base)
1295
1295
1296
1296
1297 class ipwdentry(object):
1297 class ipwdentry(object):
1298 """
1298 """
1299 ``ipwdentry`` objects encapsulate entries in the Unix user account and
1299 ``ipwdentry`` objects encapsulate entries in the Unix user account and
1300 password database.
1300 password database.
1301 """
1301 """
1302 def __init__(self, id):
1302 def __init__(self, id):
1303 self._id = id
1303 self._id = id
1304 self._entry = None
1304 self._entry = None
1305
1305
1306 def __eq__(self, other):
1306 def __eq__(self, other):
1307 return self.__class__ is other.__class__ and self._id == other._id
1307 return self.__class__ is other.__class__ and self._id == other._id
1308
1308
1309 def __ne__(self, other):
1309 def __ne__(self, other):
1310 return self.__class__ is not other.__class__ or self._id != other._id
1310 return self.__class__ is not other.__class__ or self._id != other._id
1311
1311
1312 def _getentry(self):
1312 def _getentry(self):
1313 if self._entry is None:
1313 if self._entry is None:
1314 if isinstance(self._id, basestring):
1314 if isinstance(self._id, basestring):
1315 self._entry = pwd.getpwnam(self._id)
1315 self._entry = pwd.getpwnam(self._id)
1316 else:
1316 else:
1317 self._entry = pwd.getpwuid(self._id)
1317 self._entry = pwd.getpwuid(self._id)
1318 return self._entry
1318 return self._entry
1319
1319
1320 def getname(self):
1320 def getname(self):
1321 if isinstance(self._id, basestring):
1321 if isinstance(self._id, basestring):
1322 return self._id
1322 return self._id
1323 else:
1323 else:
1324 return self._getentry().pw_name
1324 return self._getentry().pw_name
1325 name = property(getname, None, None, "User name")
1325 name = property(getname, None, None, "User name")
1326
1326
1327 def getpasswd(self):
1327 def getpasswd(self):
1328 return self._getentry().pw_passwd
1328 return self._getentry().pw_passwd
1329 passwd = property(getpasswd, None, None, "Password")
1329 passwd = property(getpasswd, None, None, "Password")
1330
1330
1331 def getuid(self):
1331 def getuid(self):
1332 if isinstance(self._id, basestring):
1332 if isinstance(self._id, basestring):
1333 return self._getentry().pw_uid
1333 return self._getentry().pw_uid
1334 else:
1334 else:
1335 return self._id
1335 return self._id
1336 uid = property(getuid, None, None, "User id")
1336 uid = property(getuid, None, None, "User id")
1337
1337
1338 def getgid(self):
1338 def getgid(self):
1339 return self._getentry().pw_gid
1339 return self._getentry().pw_gid
1340 gid = property(getgid, None, None, "Primary group id")
1340 gid = property(getgid, None, None, "Primary group id")
1341
1341
1342 def getgroup(self):
1342 def getgroup(self):
1343 return igrpentry(self.gid)
1343 return igrpentry(self.gid)
1344 group = property(getgroup, None, None, "Group")
1344 group = property(getgroup, None, None, "Group")
1345
1345
1346 def getgecos(self):
1346 def getgecos(self):
1347 return self._getentry().pw_gecos
1347 return self._getentry().pw_gecos
1348 gecos = property(getgecos, None, None, "Information (e.g. full user name)")
1348 gecos = property(getgecos, None, None, "Information (e.g. full user name)")
1349
1349
1350 def getdir(self):
1350 def getdir(self):
1351 return self._getentry().pw_dir
1351 return self._getentry().pw_dir
1352 dir = property(getdir, None, None, "$HOME directory")
1352 dir = property(getdir, None, None, "$HOME directory")
1353
1353
1354 def getshell(self):
1354 def getshell(self):
1355 return self._getentry().pw_shell
1355 return self._getentry().pw_shell
1356 shell = property(getshell, None, None, "Login shell")
1356 shell = property(getshell, None, None, "Login shell")
1357
1357
1358 def __xattrs__(self, mode="default"):
1358 def __xattrs__(self, mode="default"):
1359 return ("name", "passwd", "uid", "gid", "gecos", "dir", "shell")
1359 return ("name", "passwd", "uid", "gid", "gecos", "dir", "shell")
1360
1360
1361 def __repr__(self):
1361 def __repr__(self):
1362 return "%s.%s(%r)" % \
1362 return "%s.%s(%r)" % \
1363 (self.__class__.__module__, self.__class__.__name__, self._id)
1363 (self.__class__.__module__, self.__class__.__name__, self._id)
1364
1364
1365
1365
1366 class ipwd(Table):
1366 class ipwd(Table):
1367 """
1367 """
1368 List all entries in the Unix user account and password database.
1368 List all entries in the Unix user account and password database.
1369
1369
1370 Example:
1370 Example:
1371
1371
1372 >>> ipwd | isort("uid")
1372 >>> ipwd | isort("uid")
1373 """
1373 """
1374 def __iter__(self):
1374 def __iter__(self):
1375 for entry in pwd.getpwall():
1375 for entry in pwd.getpwall():
1376 yield ipwdentry(entry.pw_name)
1376 yield ipwdentry(entry.pw_name)
1377
1377
1378 def __xrepr__(self, mode="default"):
1378 def __xrepr__(self, mode="default"):
1379 if mode == "header" or mode == "footer" or mode == "cell":
1379 if mode == "header" or mode == "footer" or mode == "cell":
1380 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1380 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1381 else:
1381 else:
1382 yield (astyle.style_default, repr(self))
1382 yield (astyle.style_default, repr(self))
1383
1383
1384
1384
1385 class igrpentry(object):
1385 class igrpentry(object):
1386 """
1386 """
1387 ``igrpentry`` objects encapsulate entries in the Unix group database.
1387 ``igrpentry`` objects encapsulate entries in the Unix group database.
1388 """
1388 """
1389 def __init__(self, id):
1389 def __init__(self, id):
1390 self._id = id
1390 self._id = id
1391 self._entry = None
1391 self._entry = None
1392
1392
1393 def __eq__(self, other):
1393 def __eq__(self, other):
1394 return self.__class__ is other.__class__ and self._id == other._id
1394 return self.__class__ is other.__class__ and self._id == other._id
1395
1395
1396 def __ne__(self, other):
1396 def __ne__(self, other):
1397 return self.__class__ is not other.__class__ or self._id != other._id
1397 return self.__class__ is not other.__class__ or self._id != other._id
1398
1398
1399 def _getentry(self):
1399 def _getentry(self):
1400 if self._entry is None:
1400 if self._entry is None:
1401 if isinstance(self._id, basestring):
1401 if isinstance(self._id, basestring):
1402 self._entry = grp.getgrnam(self._id)
1402 self._entry = grp.getgrnam(self._id)
1403 else:
1403 else:
1404 self._entry = grp.getgrgid(self._id)
1404 self._entry = grp.getgrgid(self._id)
1405 return self._entry
1405 return self._entry
1406
1406
1407 def getname(self):
1407 def getname(self):
1408 if isinstance(self._id, basestring):
1408 if isinstance(self._id, basestring):
1409 return self._id
1409 return self._id
1410 else:
1410 else:
1411 return self._getentry().gr_name
1411 return self._getentry().gr_name
1412 name = property(getname, None, None, "Group name")
1412 name = property(getname, None, None, "Group name")
1413
1413
1414 def getpasswd(self):
1414 def getpasswd(self):
1415 return self._getentry().gr_passwd
1415 return self._getentry().gr_passwd
1416 passwd = property(getpasswd, None, None, "Password")
1416 passwd = property(getpasswd, None, None, "Password")
1417
1417
1418 def getgid(self):
1418 def getgid(self):
1419 if isinstance(self._id, basestring):
1419 if isinstance(self._id, basestring):
1420 return self._getentry().gr_gid
1420 return self._getentry().gr_gid
1421 else:
1421 else:
1422 return self._id
1422 return self._id
1423 gid = property(getgid, None, None, "Group id")
1423 gid = property(getgid, None, None, "Group id")
1424
1424
1425 def getmem(self):
1425 def getmem(self):
1426 return self._getentry().gr_mem
1426 return self._getentry().gr_mem
1427 mem = property(getmem, None, None, "Members")
1427 mem = property(getmem, None, None, "Members")
1428
1428
1429 def __xattrs__(self, mode="default"):
1429 def __xattrs__(self, mode="default"):
1430 return ("name", "passwd", "gid", "mem")
1430 return ("name", "passwd", "gid", "mem")
1431
1431
1432 def __xrepr__(self, mode="default"):
1432 def __xrepr__(self, mode="default"):
1433 if mode == "header" or mode == "footer" or mode == "cell":
1433 if mode == "header" or mode == "footer" or mode == "cell":
1434 yield (astyle.style_default, "group ")
1434 yield (astyle.style_default, "group ")
1435 try:
1435 try:
1436 yield (astyle.style_default, self.name)
1436 yield (astyle.style_default, self.name)
1437 except KeyError:
1437 except KeyError:
1438 if isinstance(self._id, basestring):
1438 if isinstance(self._id, basestring):
1439 yield (astyle.style_default, self.name_id)
1439 yield (astyle.style_default, self.name_id)
1440 else:
1440 else:
1441 yield (astyle.style_type_number, str(self._id))
1441 yield (astyle.style_type_number, str(self._id))
1442 else:
1442 else:
1443 yield (astyle.style_default, repr(self))
1443 yield (astyle.style_default, repr(self))
1444
1444
1445 def __iter__(self):
1445 def __iter__(self):
1446 for member in self.mem:
1446 for member in self.mem:
1447 yield ipwdentry(member)
1447 yield ipwdentry(member)
1448
1448
1449 def __repr__(self):
1449 def __repr__(self):
1450 return "%s.%s(%r)" % \
1450 return "%s.%s(%r)" % \
1451 (self.__class__.__module__, self.__class__.__name__, self._id)
1451 (self.__class__.__module__, self.__class__.__name__, self._id)
1452
1452
1453
1453
1454 class igrp(Table):
1454 class igrp(Table):
1455 """
1455 """
1456 This ``Table`` lists all entries in the Unix group database.
1456 This ``Table`` lists all entries in the Unix group database.
1457 """
1457 """
1458 def __iter__(self):
1458 def __iter__(self):
1459 for entry in grp.getgrall():
1459 for entry in grp.getgrall():
1460 yield igrpentry(entry.gr_name)
1460 yield igrpentry(entry.gr_name)
1461
1461
1462 def __xrepr__(self, mode="default"):
1462 def __xrepr__(self, mode="default"):
1463 if mode == "header" or mode == "footer":
1463 if mode == "header" or mode == "footer":
1464 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1464 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1465 else:
1465 else:
1466 yield (astyle.style_default, repr(self))
1466 yield (astyle.style_default, repr(self))
1467
1467
1468
1468
1469 class Fields(object):
1469 class Fields(object):
1470 def __init__(self, fieldnames, **fields):
1470 def __init__(self, fieldnames, **fields):
1471 self.__fieldnames = [upgradexattr(fieldname) for fieldname in fieldnames]
1471 self.__fieldnames = [upgradexattr(fieldname) for fieldname in fieldnames]
1472 for (key, value) in fields.iteritems():
1472 for (key, value) in fields.iteritems():
1473 setattr(self, key, value)
1473 setattr(self, key, value)
1474
1474
1475 def __xattrs__(self, mode="default"):
1475 def __xattrs__(self, mode="default"):
1476 return self.__fieldnames
1476 return self.__fieldnames
1477
1477
1478 def __xrepr__(self, mode="default"):
1478 def __xrepr__(self, mode="default"):
1479 yield (-1, False)
1479 yield (-1, False)
1480 if mode == "header" or mode == "cell":
1480 if mode == "header" or mode == "cell":
1481 yield (astyle.style_default, self.__class__.__name__)
1481 yield (astyle.style_default, self.__class__.__name__)
1482 yield (astyle.style_default, "(")
1482 yield (astyle.style_default, "(")
1483 for (i, f) in enumerate(self.__fieldnames):
1483 for (i, f) in enumerate(self.__fieldnames):
1484 if i:
1484 if i:
1485 yield (astyle.style_default, ", ")
1485 yield (astyle.style_default, ", ")
1486 yield (astyle.style_default, f.name())
1486 yield (astyle.style_default, f.name())
1487 yield (astyle.style_default, "=")
1487 yield (astyle.style_default, "=")
1488 for part in xrepr(getattr(self, f), "default"):
1488 for part in xrepr(getattr(self, f), "default"):
1489 yield part
1489 yield part
1490 yield (astyle.style_default, ")")
1490 yield (astyle.style_default, ")")
1491 elif mode == "footer":
1491 elif mode == "footer":
1492 yield (astyle.style_default, self.__class__.__name__)
1492 yield (astyle.style_default, self.__class__.__name__)
1493 yield (astyle.style_default, "(")
1493 yield (astyle.style_default, "(")
1494 for (i, f) in enumerate(self.__fieldnames):
1494 for (i, f) in enumerate(self.__fieldnames):
1495 if i:
1495 if i:
1496 yield (astyle.style_default, ", ")
1496 yield (astyle.style_default, ", ")
1497 yield (astyle.style_default, f.name())
1497 yield (astyle.style_default, f.name())
1498 yield (astyle.style_default, ")")
1498 yield (astyle.style_default, ")")
1499 else:
1499 else:
1500 yield (astyle.style_default, repr(self))
1500 yield (astyle.style_default, repr(self))
1501
1501
1502
1502
1503 class FieldTable(Table, list):
1503 class FieldTable(Table, list):
1504 def __init__(self, *fields):
1504 def __init__(self, *fields):
1505 Table.__init__(self)
1505 Table.__init__(self)
1506 list.__init__(self)
1506 list.__init__(self)
1507 self.fields = fields
1507 self.fields = fields
1508
1508
1509 def add(self, **fields):
1509 def add(self, **fields):
1510 self.append(Fields(self.fields, **fields))
1510 self.append(Fields(self.fields, **fields))
1511
1511
1512 def __xrepr__(self, mode="default"):
1512 def __xrepr__(self, mode="default"):
1513 yield (-1, False)
1513 yield (-1, False)
1514 if mode == "header" or mode == "footer":
1514 if mode == "header" or mode == "footer":
1515 yield (astyle.style_default, self.__class__.__name__)
1515 yield (astyle.style_default, self.__class__.__name__)
1516 yield (astyle.style_default, "(")
1516 yield (astyle.style_default, "(")
1517 for (i, f) in enumerate(self.__fieldnames):
1517 for (i, f) in enumerate(self.__fieldnames):
1518 if i:
1518 if i:
1519 yield (astyle.style_default, ", ")
1519 yield (astyle.style_default, ", ")
1520 yield (astyle.style_default, f)
1520 yield (astyle.style_default, f)
1521 yield (astyle.style_default, ")")
1521 yield (astyle.style_default, ")")
1522 else:
1522 else:
1523 yield (astyle.style_default, repr(self))
1523 yield (astyle.style_default, repr(self))
1524
1524
1525 def __repr__(self):
1525 def __repr__(self):
1526 return "<%s.%s object with fields=%r at 0x%x>" % \
1526 return "<%s.%s object with fields=%r at 0x%x>" % \
1527 (self.__class__.__module__, self.__class__.__name__,
1527 (self.__class__.__module__, self.__class__.__name__,
1528 ", ".join(map(repr, self.fields)), id(self))
1528 ", ".join(map(repr, self.fields)), id(self))
1529
1529
1530
1530
1531 class List(list):
1531 class List(list):
1532 def __xattrs__(self, mode="default"):
1532 def __xattrs__(self, mode="default"):
1533 return xrange(len(self))
1533 return xrange(len(self))
1534
1534
1535 def __xrepr__(self, mode="default"):
1535 def __xrepr__(self, mode="default"):
1536 yield (-1, False)
1536 yield (-1, False)
1537 if mode == "header" or mode == "cell" or mode == "footer" or mode == "default":
1537 if mode == "header" or mode == "cell" or mode == "footer" or mode == "default":
1538 yield (astyle.style_default, self.__class__.__name__)
1538 yield (astyle.style_default, self.__class__.__name__)
1539 yield (astyle.style_default, "(")
1539 yield (astyle.style_default, "(")
1540 for (i, item) in enumerate(self):
1540 for (i, item) in enumerate(self):
1541 if i:
1541 if i:
1542 yield (astyle.style_default, ", ")
1542 yield (astyle.style_default, ", ")
1543 for part in xrepr(item, "default"):
1543 for part in xrepr(item, "default"):
1544 yield part
1544 yield part
1545 yield (astyle.style_default, ")")
1545 yield (astyle.style_default, ")")
1546 else:
1546 else:
1547 yield (astyle.style_default, repr(self))
1547 yield (astyle.style_default, repr(self))
1548
1548
1549
1549
1550 class ienv(Table):
1550 class ienv(Table):
1551 """
1551 """
1552 List environment variables.
1552 List environment variables.
1553
1553
1554 Example:
1554 Example:
1555
1555
1556 >>> ienv
1556 >>> ienv
1557 """
1557 """
1558
1558
1559 def __iter__(self):
1559 def __iter__(self):
1560 fields = ("key", "value")
1560 fields = ("key", "value")
1561 for (key, value) in os.environ.iteritems():
1561 for (key, value) in os.environ.iteritems():
1562 yield Fields(fields, key=key, value=value)
1562 yield Fields(fields, key=key, value=value)
1563
1563
1564 def __xrepr__(self, mode="default"):
1564 def __xrepr__(self, mode="default"):
1565 if mode == "header" or mode == "cell":
1565 if mode == "header" or mode == "cell":
1566 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1566 yield (astyle.style_default, "%s()" % self.__class__.__name__)
1567 else:
1567 else:
1568 yield (astyle.style_default, repr(self))
1568 yield (astyle.style_default, repr(self))
1569
1569
1570
1570
1571 class ihist(Table):
1572 """
1573 IPython input history
1574
1575 Example:
1576
1577 >>> ihist
1578 >>> ihist(True) (raw mode)
1579 """
1580 def __init__(self, raw=False):
1581 self.raw = raw
1582
1583 def __iter__(self):
1584 api = ipapi.get()
1585 if self.raw:
1586 for line in api.IP.input_hist_raw:
1587 yield line.rstrip("\n")
1588 else:
1589 for line in api.IP.input_hist:
1590 yield line.rstrip("\n")
1591
1592
1571 class icsv(Pipe):
1593 class icsv(Pipe):
1572 """
1594 """
1573 This ``Pipe`` lists turn the input (with must be a pipe outputting lines
1595 This ``Pipe`` lists turn the input (with must be a pipe outputting lines
1574 or an ``ifile``) into lines of CVS columns.
1596 or an ``ifile``) into lines of CVS columns.
1575 """
1597 """
1576 def __init__(self, **csvargs):
1598 def __init__(self, **csvargs):
1577 """
1599 """
1578 Create an ``icsv`` object. ``cvsargs`` will be passed through as
1600 Create an ``icsv`` object. ``cvsargs`` will be passed through as
1579 keyword arguments to ``cvs.reader()``.
1601 keyword arguments to ``cvs.reader()``.
1580 """
1602 """
1581 self.csvargs = csvargs
1603 self.csvargs = csvargs
1582
1604
1583 def __iter__(self):
1605 def __iter__(self):
1584 input = self.input
1606 input = self.input
1585 if isinstance(input, ifile):
1607 if isinstance(input, ifile):
1586 input = input.open("rb")
1608 input = input.open("rb")
1587 reader = csv.reader(input, **self.csvargs)
1609 reader = csv.reader(input, **self.csvargs)
1588 for line in reader:
1610 for line in reader:
1589 yield List(line)
1611 yield List(line)
1590
1612
1591 def __xrepr__(self, mode="default"):
1613 def __xrepr__(self, mode="default"):
1592 yield (-1, False)
1614 yield (-1, False)
1593 if mode == "header" or mode == "footer":
1615 if mode == "header" or mode == "footer":
1594 input = getattr(self, "input", None)
1616 input = getattr(self, "input", None)
1595 if input is not None:
1617 if input is not None:
1596 for part in xrepr(input, mode):
1618 for part in xrepr(input, mode):
1597 yield part
1619 yield part
1598 yield (astyle.style_default, " | ")
1620 yield (astyle.style_default, " | ")
1599 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1621 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1600 for (i, (name, value)) in enumerate(self.csvargs.iteritems()):
1622 for (i, (name, value)) in enumerate(self.csvargs.iteritems()):
1601 if i:
1623 if i:
1602 yield (astyle.style_default, ", ")
1624 yield (astyle.style_default, ", ")
1603 yield (astyle.style_default, name)
1625 yield (astyle.style_default, name)
1604 yield (astyle.style_default, "=")
1626 yield (astyle.style_default, "=")
1605 for part in xrepr(value, "default"):
1627 for part in xrepr(value, "default"):
1606 yield part
1628 yield part
1607 yield (astyle.style_default, ")")
1629 yield (astyle.style_default, ")")
1608 else:
1630 else:
1609 yield (astyle.style_default, repr(self))
1631 yield (astyle.style_default, repr(self))
1610
1632
1611 def __repr__(self):
1633 def __repr__(self):
1612 args = ", ".join(["%s=%r" % item for item in self.csvargs.iteritems()])
1634 args = ", ".join(["%s=%r" % item for item in self.csvargs.iteritems()])
1613 return "<%s.%s %s at 0x%x>" % \
1635 return "<%s.%s %s at 0x%x>" % \
1614 (self.__class__.__module__, self.__class__.__name__, args, id(self))
1636 (self.__class__.__module__, self.__class__.__name__, args, id(self))
1615
1637
1616
1638
1617 class ix(Table):
1639 class ix(Table):
1618 """
1640 """
1619 Execute a system command and list its output as lines
1641 Execute a system command and list its output as lines
1620 (similar to ``os.popen()``).
1642 (similar to ``os.popen()``).
1621
1643
1622 Examples:
1644 Examples:
1623
1645
1624 >>> ix("ps x")
1646 >>> ix("ps x")
1625 >>> ix("find .") | ifile
1647 >>> ix("find .") | ifile
1626 """
1648 """
1627 def __init__(self, cmd):
1649 def __init__(self, cmd):
1628 self.cmd = cmd
1650 self.cmd = cmd
1629 self._pipeout = None
1651 self._pipeout = None
1630
1652
1631 def __iter__(self):
1653 def __iter__(self):
1632 (_pipein, self._pipeout) = os.popen4(self.cmd)
1654 (_pipein, self._pipeout) = os.popen4(self.cmd)
1633 _pipein.close()
1655 _pipein.close()
1634 for l in self._pipeout:
1656 for l in self._pipeout:
1635 yield l.rstrip("\r\n")
1657 yield l.rstrip("\r\n")
1636 self._pipeout.close()
1658 self._pipeout.close()
1637 self._pipeout = None
1659 self._pipeout = None
1638
1660
1639 def __del__(self):
1661 def __del__(self):
1640 if self._pipeout is not None and not self._pipeout.closed:
1662 if self._pipeout is not None and not self._pipeout.closed:
1641 self._pipeout.close()
1663 self._pipeout.close()
1642 self._pipeout = None
1664 self._pipeout = None
1643
1665
1644 def __xrepr__(self, mode="default"):
1666 def __xrepr__(self, mode="default"):
1645 if mode == "header" or mode == "footer":
1667 if mode == "header" or mode == "footer":
1646 yield (astyle.style_default,
1668 yield (astyle.style_default,
1647 "%s(%r)" % (self.__class__.__name__, self.cmd))
1669 "%s(%r)" % (self.__class__.__name__, self.cmd))
1648 else:
1670 else:
1649 yield (astyle.style_default, repr(self))
1671 yield (astyle.style_default, repr(self))
1650
1672
1651 def __repr__(self):
1673 def __repr__(self):
1652 return "%s.%s(%r)" % \
1674 return "%s.%s(%r)" % \
1653 (self.__class__.__module__, self.__class__.__name__, self.cmd)
1675 (self.__class__.__module__, self.__class__.__name__, self.cmd)
1654
1676
1655
1677
1656 class ifilter(Pipe):
1678 class ifilter(Pipe):
1657 """
1679 """
1658 Filter an input pipe. Only objects where an expression evaluates to true
1680 Filter an input pipe. Only objects where an expression evaluates to true
1659 (and doesn't raise an exception) are listed.
1681 (and doesn't raise an exception) are listed.
1660
1682
1661 Examples:
1683 Examples:
1662
1684
1663 >>> ils | ifilter("_.isfile() and size>1000")
1685 >>> ils | ifilter("_.isfile() and size>1000")
1664 >>> igrp | ifilter("len(mem)")
1686 >>> igrp | ifilter("len(mem)")
1665 >>> sys.modules | ifilter(lambda _:_.value is not None)
1687 >>> sys.modules | ifilter(lambda _:_.value is not None)
1666 """
1688 """
1667
1689
1668 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1690 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1669 """
1691 """
1670 Create an ``ifilter`` object. ``expr`` can be a callable or a string
1692 Create an ``ifilter`` object. ``expr`` can be a callable or a string
1671 containing an expression. ``globals`` will be used as the global
1693 containing an expression. ``globals`` will be used as the global
1672 namespace for calling string expressions (defaulting to IPython's
1694 namespace for calling string expressions (defaulting to IPython's
1673 user namespace). ``errors`` specifies how exception during evaluation
1695 user namespace). ``errors`` specifies how exception during evaluation
1674 of ``expr`` are handled:
1696 of ``expr`` are handled:
1675
1697
1676 * ``drop``: drop all items that have errors;
1698 * ``drop``: drop all items that have errors;
1677
1699
1678 * ``keep``: keep all items that have errors;
1700 * ``keep``: keep all items that have errors;
1679
1701
1680 * ``keeperror``: keep the exception of all items that have errors;
1702 * ``keeperror``: keep the exception of all items that have errors;
1681
1703
1682 * ``raise``: raise the exception;
1704 * ``raise``: raise the exception;
1683
1705
1684 * ``raiseifallfail``: raise the first exception if all items have errors;
1706 * ``raiseifallfail``: raise the first exception if all items have errors;
1685 otherwise drop those with errors (this is the default).
1707 otherwise drop those with errors (this is the default).
1686 """
1708 """
1687 self.expr = expr
1709 self.expr = expr
1688 self.globals = globals
1710 self.globals = globals
1689 self.errors = errors
1711 self.errors = errors
1690
1712
1691 def __iter__(self):
1713 def __iter__(self):
1692 if callable(self.expr):
1714 if callable(self.expr):
1693 test = self.expr
1715 test = self.expr
1694 else:
1716 else:
1695 g = getglobals(self.globals)
1717 g = getglobals(self.globals)
1696 expr = compile(self.expr, "ipipe-expression", "eval")
1718 expr = compile(self.expr, "ipipe-expression", "eval")
1697 def test(item):
1719 def test(item):
1698 return eval(expr, g, AttrNamespace(item))
1720 return eval(expr, g, AttrNamespace(item))
1699
1721
1700 ok = 0
1722 ok = 0
1701 exc_info = None
1723 exc_info = None
1702 for item in xiter(self.input):
1724 for item in xiter(self.input):
1703 try:
1725 try:
1704 if test(item):
1726 if test(item):
1705 yield item
1727 yield item
1706 ok += 1
1728 ok += 1
1707 except (KeyboardInterrupt, SystemExit):
1729 except (KeyboardInterrupt, SystemExit):
1708 raise
1730 raise
1709 except Exception, exc:
1731 except Exception, exc:
1710 if self.errors == "drop":
1732 if self.errors == "drop":
1711 pass # Ignore errors
1733 pass # Ignore errors
1712 elif self.errors == "keep":
1734 elif self.errors == "keep":
1713 yield item
1735 yield item
1714 elif self.errors == "keeperror":
1736 elif self.errors == "keeperror":
1715 yield exc
1737 yield exc
1716 elif self.errors == "raise":
1738 elif self.errors == "raise":
1717 raise
1739 raise
1718 elif self.errors == "raiseifallfail":
1740 elif self.errors == "raiseifallfail":
1719 if exc_info is None:
1741 if exc_info is None:
1720 exc_info = sys.exc_info()
1742 exc_info = sys.exc_info()
1721 if not ok and exc_info is not None:
1743 if not ok and exc_info is not None:
1722 raise exc_info[0], exc_info[1], exc_info[2]
1744 raise exc_info[0], exc_info[1], exc_info[2]
1723
1745
1724 def __xrepr__(self, mode="default"):
1746 def __xrepr__(self, mode="default"):
1725 if mode == "header" or mode == "footer":
1747 if mode == "header" or mode == "footer":
1726 input = getattr(self, "input", None)
1748 input = getattr(self, "input", None)
1727 if input is not None:
1749 if input is not None:
1728 for part in xrepr(input, mode):
1750 for part in xrepr(input, mode):
1729 yield part
1751 yield part
1730 yield (astyle.style_default, " | ")
1752 yield (astyle.style_default, " | ")
1731 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1753 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1732 for part in xrepr(self.expr, "default"):
1754 for part in xrepr(self.expr, "default"):
1733 yield part
1755 yield part
1734 yield (astyle.style_default, ")")
1756 yield (astyle.style_default, ")")
1735 else:
1757 else:
1736 yield (astyle.style_default, repr(self))
1758 yield (astyle.style_default, repr(self))
1737
1759
1738 def __repr__(self):
1760 def __repr__(self):
1739 return "<%s.%s expr=%r at 0x%x>" % \
1761 return "<%s.%s expr=%r at 0x%x>" % \
1740 (self.__class__.__module__, self.__class__.__name__,
1762 (self.__class__.__module__, self.__class__.__name__,
1741 self.expr, id(self))
1763 self.expr, id(self))
1742
1764
1743
1765
1744 class ieval(Pipe):
1766 class ieval(Pipe):
1745 """
1767 """
1746 Evaluate an expression for each object in the input pipe.
1768 Evaluate an expression for each object in the input pipe.
1747
1769
1748 Examples:
1770 Examples:
1749
1771
1750 >>> ils | ieval("_.abspath()")
1772 >>> ils | ieval("_.abspath()")
1751 >>> sys.path | ieval(ifile)
1773 >>> sys.path | ieval(ifile)
1752 """
1774 """
1753
1775
1754 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1776 def __init__(self, expr, globals=None, errors="raiseifallfail"):
1755 """
1777 """
1756 Create an ``ieval`` object. ``expr`` can be a callable or a string
1778 Create an ``ieval`` object. ``expr`` can be a callable or a string
1757 containing an expression. For the meaning of ``globals`` and
1779 containing an expression. For the meaning of ``globals`` and
1758 ``errors`` see ``ifilter``.
1780 ``errors`` see ``ifilter``.
1759 """
1781 """
1760 self.expr = expr
1782 self.expr = expr
1761 self.globals = globals
1783 self.globals = globals
1762 self.errors = errors
1784 self.errors = errors
1763
1785
1764 def __iter__(self):
1786 def __iter__(self):
1765 if callable(self.expr):
1787 if callable(self.expr):
1766 do = self.expr
1788 do = self.expr
1767 else:
1789 else:
1768 g = getglobals(self.globals)
1790 g = getglobals(self.globals)
1769 expr = compile(self.expr, "ipipe-expression", "eval")
1791 expr = compile(self.expr, "ipipe-expression", "eval")
1770 def do(item):
1792 def do(item):
1771 return eval(expr, g, AttrNamespace(item))
1793 return eval(expr, g, AttrNamespace(item))
1772
1794
1773 ok = 0
1795 ok = 0
1774 exc_info = None
1796 exc_info = None
1775 for item in xiter(self.input):
1797 for item in xiter(self.input):
1776 try:
1798 try:
1777 yield do(item)
1799 yield do(item)
1778 except (KeyboardInterrupt, SystemExit):
1800 except (KeyboardInterrupt, SystemExit):
1779 raise
1801 raise
1780 except Exception, exc:
1802 except Exception, exc:
1781 if self.errors == "drop":
1803 if self.errors == "drop":
1782 pass # Ignore errors
1804 pass # Ignore errors
1783 elif self.errors == "keep":
1805 elif self.errors == "keep":
1784 yield item
1806 yield item
1785 elif self.errors == "keeperror":
1807 elif self.errors == "keeperror":
1786 yield exc
1808 yield exc
1787 elif self.errors == "raise":
1809 elif self.errors == "raise":
1788 raise
1810 raise
1789 elif self.errors == "raiseifallfail":
1811 elif self.errors == "raiseifallfail":
1790 if exc_info is None:
1812 if exc_info is None:
1791 exc_info = sys.exc_info()
1813 exc_info = sys.exc_info()
1792 if not ok and exc_info is not None:
1814 if not ok and exc_info is not None:
1793 raise exc_info[0], exc_info[1], exc_info[2]
1815 raise exc_info[0], exc_info[1], exc_info[2]
1794
1816
1795 def __xrepr__(self, mode="default"):
1817 def __xrepr__(self, mode="default"):
1796 if mode == "header" or mode == "footer":
1818 if mode == "header" or mode == "footer":
1797 input = getattr(self, "input", None)
1819 input = getattr(self, "input", None)
1798 if input is not None:
1820 if input is not None:
1799 for part in xrepr(input, mode):
1821 for part in xrepr(input, mode):
1800 yield part
1822 yield part
1801 yield (astyle.style_default, " | ")
1823 yield (astyle.style_default, " | ")
1802 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1824 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1803 for part in xrepr(self.expr, "default"):
1825 for part in xrepr(self.expr, "default"):
1804 yield part
1826 yield part
1805 yield (astyle.style_default, ")")
1827 yield (astyle.style_default, ")")
1806 else:
1828 else:
1807 yield (astyle.style_default, repr(self))
1829 yield (astyle.style_default, repr(self))
1808
1830
1809 def __repr__(self):
1831 def __repr__(self):
1810 return "<%s.%s expr=%r at 0x%x>" % \
1832 return "<%s.%s expr=%r at 0x%x>" % \
1811 (self.__class__.__module__, self.__class__.__name__,
1833 (self.__class__.__module__, self.__class__.__name__,
1812 self.expr, id(self))
1834 self.expr, id(self))
1813
1835
1814
1836
1815 class ienum(Pipe):
1837 class ienum(Pipe):
1816 """
1838 """
1817 Enumerate the input pipe (i.e. wrap each input object in an object
1839 Enumerate the input pipe (i.e. wrap each input object in an object
1818 with ``index`` and ``object`` attributes).
1840 with ``index`` and ``object`` attributes).
1819
1841
1820 Examples:
1842 Examples:
1821
1843
1822 >>> xrange(20) | ieval("_,_*_") | ienum | ifilter("index % 2 == 0") | ieval("object")
1844 >>> xrange(20) | ieval("_,_*_") | ienum | ifilter("index % 2 == 0") | ieval("object")
1823 """
1845 """
1824 def __iter__(self):
1846 def __iter__(self):
1825 fields = ("index", "object")
1847 fields = ("index", "object")
1826 for (index, object) in enumerate(xiter(self.input)):
1848 for (index, object) in enumerate(xiter(self.input)):
1827 yield Fields(fields, index=index, object=object)
1849 yield Fields(fields, index=index, object=object)
1828
1850
1829
1851
1830 class isort(Pipe):
1852 class isort(Pipe):
1831 """
1853 """
1832 Sorts the input pipe.
1854 Sorts the input pipe.
1833
1855
1834 Examples:
1856 Examples:
1835
1857
1836 >>> ils | isort("size")
1858 >>> ils | isort("size")
1837 >>> ils | isort("_.isdir(), _.lower()", reverse=True)
1859 >>> ils | isort("_.isdir(), _.lower()", reverse=True)
1838 """
1860 """
1839
1861
1840 def __init__(self, key=None, globals=None, reverse=False):
1862 def __init__(self, key=None, globals=None, reverse=False):
1841 """
1863 """
1842 Create an ``isort`` object. ``key`` can be a callable or a string
1864 Create an ``isort`` object. ``key`` can be a callable or a string
1843 containing an expression (or ``None`` in which case the items
1865 containing an expression (or ``None`` in which case the items
1844 themselves will be sorted). If ``reverse`` is true the sort order
1866 themselves will be sorted). If ``reverse`` is true the sort order
1845 will be reversed. For the meaning of ``globals`` see ``ifilter``.
1867 will be reversed. For the meaning of ``globals`` see ``ifilter``.
1846 """
1868 """
1847 self.key = key
1869 self.key = key
1848 self.globals = globals
1870 self.globals = globals
1849 self.reverse = reverse
1871 self.reverse = reverse
1850
1872
1851 def __iter__(self):
1873 def __iter__(self):
1852 if self.key is None:
1874 if self.key is None:
1853 items = sorted(xiter(self.input), reverse=self.reverse)
1875 items = sorted(xiter(self.input), reverse=self.reverse)
1854 elif callable(self.key):
1876 elif callable(self.key):
1855 items = sorted(xiter(self.input), key=self.key, reverse=self.reverse)
1877 items = sorted(xiter(self.input), key=self.key, reverse=self.reverse)
1856 else:
1878 else:
1857 g = getglobals(self.globals)
1879 g = getglobals(self.globals)
1858 key = compile(self.key, "ipipe-expression", "eval")
1880 key = compile(self.key, "ipipe-expression", "eval")
1859 def realkey(item):
1881 def realkey(item):
1860 return eval(key, g, AttrNamespace(item))
1882 return eval(key, g, AttrNamespace(item))
1861 items = sorted(xiter(self.input), key=realkey, reverse=self.reverse)
1883 items = sorted(xiter(self.input), key=realkey, reverse=self.reverse)
1862 for item in items:
1884 for item in items:
1863 yield item
1885 yield item
1864
1886
1865 def __xrepr__(self, mode="default"):
1887 def __xrepr__(self, mode="default"):
1866 if mode == "header" or mode == "footer":
1888 if mode == "header" or mode == "footer":
1867 input = getattr(self, "input", None)
1889 input = getattr(self, "input", None)
1868 if input is not None:
1890 if input is not None:
1869 for part in xrepr(input, mode):
1891 for part in xrepr(input, mode):
1870 yield part
1892 yield part
1871 yield (astyle.style_default, " | ")
1893 yield (astyle.style_default, " | ")
1872 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1894 yield (astyle.style_default, "%s(" % self.__class__.__name__)
1873 for part in xrepr(self.key, "default"):
1895 for part in xrepr(self.key, "default"):
1874 yield part
1896 yield part
1875 if self.reverse:
1897 if self.reverse:
1876 yield (astyle.style_default, ", ")
1898 yield (astyle.style_default, ", ")
1877 for part in xrepr(True, "default"):
1899 for part in xrepr(True, "default"):
1878 yield part
1900 yield part
1879 yield (astyle.style_default, ")")
1901 yield (astyle.style_default, ")")
1880 else:
1902 else:
1881 yield (astyle.style_default, repr(self))
1903 yield (astyle.style_default, repr(self))
1882
1904
1883 def __repr__(self):
1905 def __repr__(self):
1884 return "<%s.%s key=%r reverse=%r at 0x%x>" % \
1906 return "<%s.%s key=%r reverse=%r at 0x%x>" % \
1885 (self.__class__.__module__, self.__class__.__name__,
1907 (self.__class__.__module__, self.__class__.__name__,
1886 self.key, self.reverse, id(self))
1908 self.key, self.reverse, id(self))
1887
1909
1888
1910
1889 tab = 3 # for expandtabs()
1911 tab = 3 # for expandtabs()
1890
1912
1891 def _format(field):
1913 def _format(field):
1892 if isinstance(field, str):
1914 if isinstance(field, str):
1893 text = repr(field.expandtabs(tab))[1:-1]
1915 text = repr(field.expandtabs(tab))[1:-1]
1894 elif isinstance(field, unicode):
1916 elif isinstance(field, unicode):
1895 text = repr(field.expandtabs(tab))[2:-1]
1917 text = repr(field.expandtabs(tab))[2:-1]
1896 elif isinstance(field, datetime.datetime):
1918 elif isinstance(field, datetime.datetime):
1897 # Don't use strftime() here, as this requires year >= 1900
1919 # Don't use strftime() here, as this requires year >= 1900
1898 text = "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
1920 text = "%04d-%02d-%02d %02d:%02d:%02d.%06d" % \
1899 (field.year, field.month, field.day,
1921 (field.year, field.month, field.day,
1900 field.hour, field.minute, field.second, field.microsecond)
1922 field.hour, field.minute, field.second, field.microsecond)
1901 elif isinstance(field, datetime.date):
1923 elif isinstance(field, datetime.date):
1902 text = "%04d-%02d-%02d" % (field.year, field.month, field.day)
1924 text = "%04d-%02d-%02d" % (field.year, field.month, field.day)
1903 else:
1925 else:
1904 text = repr(field)
1926 text = repr(field)
1905 return text
1927 return text
1906
1928
1907
1929
1908 class Display(object):
1930 class Display(object):
1909 class __metaclass__(type):
1931 class __metaclass__(type):
1910 def __ror__(self, input):
1932 def __ror__(self, input):
1911 return input | self()
1933 return input | self()
1912
1934
1913 def __ror__(self, input):
1935 def __ror__(self, input):
1914 self.input = input
1936 self.input = input
1915 return self
1937 return self
1916
1938
1917 def display(self):
1939 def display(self):
1918 pass
1940 pass
1919
1941
1920
1942
1921 class iless(Display):
1943 class iless(Display):
1922 cmd = "less --quit-if-one-screen --LONG-PROMPT --LINE-NUMBERS --chop-long-lines --shift=8 --RAW-CONTROL-CHARS"
1944 cmd = "less --quit-if-one-screen --LONG-PROMPT --LINE-NUMBERS --chop-long-lines --shift=8 --RAW-CONTROL-CHARS"
1923
1945
1924 def display(self):
1946 def display(self):
1925 try:
1947 try:
1926 pager = os.popen(self.cmd, "w")
1948 pager = os.popen(self.cmd, "w")
1927 try:
1949 try:
1928 for item in xiter(self.input):
1950 for item in xiter(self.input):
1929 first = False
1951 first = False
1930 for attr in xattrs(item, "default"):
1952 for attr in xattrs(item, "default"):
1931 if first:
1953 if first:
1932 first = False
1954 first = False
1933 else:
1955 else:
1934 pager.write(" ")
1956 pager.write(" ")
1935 attr = upgradexattr(attr)
1957 attr = upgradexattr(attr)
1936 if not isinstance(attr, SelfDescriptor):
1958 if not isinstance(attr, SelfDescriptor):
1937 pager.write(attr.name())
1959 pager.write(attr.name())
1938 pager.write("=")
1960 pager.write("=")
1939 pager.write(str(attr.value(item)))
1961 pager.write(str(attr.value(item)))
1940 pager.write("\n")
1962 pager.write("\n")
1941 finally:
1963 finally:
1942 pager.close()
1964 pager.close()
1943 except Exception, exc:
1965 except Exception, exc:
1944 print "%s: %s" % (exc.__class__.__name__, str(exc))
1966 print "%s: %s" % (exc.__class__.__name__, str(exc))
1945
1967
1946
1968
1947 def xformat(value, mode, maxlength):
1969 def xformat(value, mode, maxlength):
1948 align = None
1970 align = None
1949 full = True
1971 full = True
1950 width = 0
1972 width = 0
1951 text = astyle.Text()
1973 text = astyle.Text()
1952 for (style, part) in xrepr(value, mode):
1974 for (style, part) in xrepr(value, mode):
1953 # only consider the first result
1975 # only consider the first result
1954 if align is None:
1976 if align is None:
1955 if isinstance(style, int):
1977 if isinstance(style, int):
1956 # (style, text) really is (alignment, stop)
1978 # (style, text) really is (alignment, stop)
1957 align = style
1979 align = style
1958 full = part
1980 full = part
1959 continue
1981 continue
1960 else:
1982 else:
1961 align = -1
1983 align = -1
1962 full = True
1984 full = True
1963 if not isinstance(style, int):
1985 if not isinstance(style, int):
1964 text.append((style, part))
1986 text.append((style, part))
1965 width += len(part)
1987 width += len(part)
1966 if width >= maxlength and not full:
1988 if width >= maxlength and not full:
1967 text.append((astyle.style_ellisis, "..."))
1989 text.append((astyle.style_ellisis, "..."))
1968 width += 3
1990 width += 3
1969 break
1991 break
1970 if align is None: # default to left alignment
1992 if align is None: # default to left alignment
1971 align = -1
1993 align = -1
1972 return (align, width, text)
1994 return (align, width, text)
1973
1995
1974
1996
1975 class idump(Display):
1997 class idump(Display):
1976 # The approximate maximum length of a column entry
1998 # The approximate maximum length of a column entry
1977 maxattrlength = 200
1999 maxattrlength = 200
1978
2000
1979 # Style for column names
2001 # Style for column names
1980 style_header = astyle.Style.fromstr("white:black:bold")
2002 style_header = astyle.Style.fromstr("white:black:bold")
1981
2003
1982 def __init__(self, *attrs):
2004 def __init__(self, *attrs):
1983 self.attrs = [upgradexattr(attr) for attr in attrs]
2005 self.attrs = [upgradexattr(attr) for attr in attrs]
1984 self.headerpadchar = " "
2006 self.headerpadchar = " "
1985 self.headersepchar = "|"
2007 self.headersepchar = "|"
1986 self.datapadchar = " "
2008 self.datapadchar = " "
1987 self.datasepchar = "|"
2009 self.datasepchar = "|"
1988
2010
1989 def display(self):
2011 def display(self):
1990 stream = genutils.Term.cout
2012 stream = genutils.Term.cout
1991 allattrs = []
2013 allattrs = []
1992 attrset = set()
2014 attrset = set()
1993 colwidths = {}
2015 colwidths = {}
1994 rows = []
2016 rows = []
1995 for item in xiter(self.input):
2017 for item in xiter(self.input):
1996 row = {}
2018 row = {}
1997 attrs = self.attrs
2019 attrs = self.attrs
1998 if not attrs:
2020 if not attrs:
1999 attrs = xattrs(item, "default")
2021 attrs = xattrs(item, "default")
2000 for attr in attrs:
2022 for attr in attrs:
2001 if attr not in attrset:
2023 if attr not in attrset:
2002 allattrs.append(attr)
2024 allattrs.append(attr)
2003 attrset.add(attr)
2025 attrset.add(attr)
2004 colwidths[attr] = len(attr.name())
2026 colwidths[attr] = len(attr.name())
2005 try:
2027 try:
2006 value = attr.value(item)
2028 value = attr.value(item)
2007 except (KeyboardInterrupt, SystemExit):
2029 except (KeyboardInterrupt, SystemExit):
2008 raise
2030 raise
2009 except Exception, exc:
2031 except Exception, exc:
2010 value = exc
2032 value = exc
2011 (align, width, text) = xformat(value, "cell", self.maxattrlength)
2033 (align, width, text) = xformat(value, "cell", self.maxattrlength)
2012 colwidths[attr] = max(colwidths[attr], width)
2034 colwidths[attr] = max(colwidths[attr], width)
2013 # remember alignment, length and colored parts
2035 # remember alignment, length and colored parts
2014 row[attr] = (align, width, text)
2036 row[attr] = (align, width, text)
2015 rows.append(row)
2037 rows.append(row)
2016
2038
2017 stream.write("\n")
2039 stream.write("\n")
2018 for (i, attr) in enumerate(allattrs):
2040 for (i, attr) in enumerate(allattrs):
2019 attrname = attr.name()
2041 attrname = attr.name()
2020 self.style_header(attrname).write(stream)
2042 self.style_header(attrname).write(stream)
2021 spc = colwidths[attr] - len(attrname)
2043 spc = colwidths[attr] - len(attrname)
2022 if i < len(colwidths)-1:
2044 if i < len(colwidths)-1:
2023 stream.write(self.headerpadchar*spc)
2045 stream.write(self.headerpadchar*spc)
2024 stream.write(self.headersepchar)
2046 stream.write(self.headersepchar)
2025 stream.write("\n")
2047 stream.write("\n")
2026
2048
2027 for row in rows:
2049 for row in rows:
2028 for (i, attr) in enumerate(allattrs):
2050 for (i, attr) in enumerate(allattrs):
2029 (align, width, text) = row[attr]
2051 (align, width, text) = row[attr]
2030 spc = colwidths[attr] - width
2052 spc = colwidths[attr] - width
2031 if align == -1:
2053 if align == -1:
2032 text.write(stream)
2054 text.write(stream)
2033 if i < len(colwidths)-1:
2055 if i < len(colwidths)-1:
2034 stream.write(self.datapadchar*spc)
2056 stream.write(self.datapadchar*spc)
2035 elif align == 0:
2057 elif align == 0:
2036 spc = colwidths[attr] - width
2058 spc = colwidths[attr] - width
2037 spc1 = spc//2
2059 spc1 = spc//2
2038 spc2 = spc-spc1
2060 spc2 = spc-spc1
2039 stream.write(self.datapadchar*spc1)
2061 stream.write(self.datapadchar*spc1)
2040 text.write(stream)
2062 text.write(stream)
2041 if i < len(colwidths)-1:
2063 if i < len(colwidths)-1:
2042 stream.write(self.datapadchar*spc2)
2064 stream.write(self.datapadchar*spc2)
2043 else:
2065 else:
2044 stream.write(self.datapadchar*spc)
2066 stream.write(self.datapadchar*spc)
2045 text.write(stream)
2067 text.write(stream)
2046 if i < len(colwidths)-1:
2068 if i < len(colwidths)-1:
2047 stream.write(self.datasepchar)
2069 stream.write(self.datasepchar)
2048 stream.write("\n")
2070 stream.write("\n")
2049
2071
2050
2072
2051 class AttributeDetail(Table):
2073 class AttributeDetail(Table):
2052 """
2074 """
2053 ``AttributeDetail`` objects are use for displaying a detailed list of object
2075 ``AttributeDetail`` objects are use for displaying a detailed list of object
2054 attributes.
2076 attributes.
2055 """
2077 """
2056 def __init__(self, object, descriptor):
2078 def __init__(self, object, descriptor):
2057 self.object = object
2079 self.object = object
2058 self.descriptor = descriptor
2080 self.descriptor = descriptor
2059
2081
2060 def __iter__(self):
2082 def __iter__(self):
2061 return self.descriptor.iter(self.object)
2083 return self.descriptor.iter(self.object)
2062
2084
2063 def name(self):
2085 def name(self):
2064 return self.descriptor.name()
2086 return self.descriptor.name()
2065
2087
2066 def attrtype(self):
2088 def attrtype(self):
2067 return self.descriptor.attrtype(self.object)
2089 return self.descriptor.attrtype(self.object)
2068
2090
2069 def valuetype(self):
2091 def valuetype(self):
2070 return self.descriptor.valuetype(self.object)
2092 return self.descriptor.valuetype(self.object)
2071
2093
2072 def doc(self):
2094 def doc(self):
2073 return self.descriptor.doc(self.object)
2095 return self.descriptor.doc(self.object)
2074
2096
2075 def shortdoc(self):
2097 def shortdoc(self):
2076 return self.descriptor.shortdoc(self.object)
2098 return self.descriptor.shortdoc(self.object)
2077
2099
2078 def value(self):
2100 def value(self):
2079 return self.descriptor.value(self.object)
2101 return self.descriptor.value(self.object)
2080
2102
2081 def __xattrs__(self, mode="default"):
2103 def __xattrs__(self, mode="default"):
2082 attrs = ("name()", "attrtype()", "valuetype()", "value()", "shortdoc()")
2104 attrs = ("name()", "attrtype()", "valuetype()", "value()", "shortdoc()")
2083 if mode == "detail":
2105 if mode == "detail":
2084 attrs += ("doc()",)
2106 attrs += ("doc()",)
2085 return attrs
2107 return attrs
2086
2108
2087 def __xrepr__(self, mode="default"):
2109 def __xrepr__(self, mode="default"):
2088 yield (-1, True)
2110 yield (-1, True)
2089 valuetype = self.valuetype()
2111 valuetype = self.valuetype()
2090 if valuetype is not noitem:
2112 if valuetype is not noitem:
2091 for part in xrepr(valuetype):
2113 for part in xrepr(valuetype):
2092 yield part
2114 yield part
2093 yield (astyle.style_default, " ")
2115 yield (astyle.style_default, " ")
2094 yield (astyle.style_default, self.attrtype())
2116 yield (astyle.style_default, self.attrtype())
2095 yield (astyle.style_default, " ")
2117 yield (astyle.style_default, " ")
2096 yield (astyle.style_default, self.name())
2118 yield (astyle.style_default, self.name())
2097 yield (astyle.style_default, " of ")
2119 yield (astyle.style_default, " of ")
2098 for part in xrepr(self.object):
2120 for part in xrepr(self.object):
2099 yield part
2121 yield part
2100
2122
2101
2123
2102 try:
2124 try:
2103 from ibrowse import ibrowse
2125 from ibrowse import ibrowse
2104 except ImportError:
2126 except ImportError:
2105 # No curses (probably Windows)
2127 # No curses (probably Windows)
2106 try:
2128 try:
2107 from igrid import igrid
2129 from igrid import igrid
2108 except ImportError:
2130 except ImportError:
2109 # no wx eithevn do => use ``idump`` as the default display.
2131 # no wx eithevn do => use ``idump`` as the default display.
2110 defaultdisplay = idump
2132 defaultdisplay = idump
2111 else:
2133 else:
2112 defaultdisplay = igrid
2134 defaultdisplay = igrid
2113 __all__.append("igrid")
2135 __all__.append("igrid")
2114 else:
2136 else:
2115 defaultdisplay = ibrowse
2137 defaultdisplay = ibrowse
2116 __all__.append("ibrowse")
2138 __all__.append("ibrowse")
2117
2139
2118
2140
2119 # If we're running under IPython, install an IPython displayhook that
2141 # If we're running under IPython, install an IPython displayhook that
2120 # returns the object from Display.display(), else install a displayhook
2142 # returns the object from Display.display(), else install a displayhook
2121 # directly as sys.displayhook
2143 # directly as sys.displayhook
2122 api = None
2144 api = None
2123 if ipapi is not None:
2145 if ipapi is not None:
2124 try:
2146 try:
2125 api = ipapi.get()
2147 api = ipapi.get()
2126 except AttributeError:
2148 except AttributeError:
2127 pass
2149 pass
2128
2150
2129 if api is not None:
2151 if api is not None:
2130 def displayhook(self, obj):
2152 def displayhook(self, obj):
2131 if isinstance(obj, type) and issubclass(obj, Table):
2153 if isinstance(obj, type) and issubclass(obj, Table):
2132 obj = obj()
2154 obj = obj()
2133 if isinstance(obj, Table):
2155 if isinstance(obj, Table):
2134 obj = obj | defaultdisplay
2156 obj = obj | defaultdisplay
2135 if isinstance(obj, Display):
2157 if isinstance(obj, Display):
2136 return obj.display()
2158 return obj.display()
2137 else:
2159 else:
2138 raise ipapi.TryNext
2160 raise ipapi.TryNext
2139 api.set_hook("result_display", displayhook)
2161 api.set_hook("result_display", displayhook)
2140 else:
2162 else:
2141 def installdisplayhook():
2163 def installdisplayhook():
2142 _originalhook = sys.displayhook
2164 _originalhook = sys.displayhook
2143 def displayhook(obj):
2165 def displayhook(obj):
2144 if isinstance(obj, type) and issubclass(obj, Table):
2166 if isinstance(obj, type) and issubclass(obj, Table):
2145 obj = obj()
2167 obj = obj()
2146 if isinstance(obj, Table):
2168 if isinstance(obj, Table):
2147 obj = obj | defaultdisplay
2169 obj = obj | defaultdisplay
2148 if isinstance(obj, Display):
2170 if isinstance(obj, Display):
2149 return obj.display()
2171 return obj.display()
2150 else:
2172 else:
2151 _originalhook(obj)
2173 _originalhook(obj)
2152 sys.displayhook = displayhook
2174 sys.displayhook = displayhook
2153 installdisplayhook()
2175 installdisplayhook()
@@ -1,6734 +1,6744 b''
1 2007-05-24 Walter Doerwald <walter@livinglogic.de>
2
3 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
4 browse the IPython input history
5
6 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
7 (mapped to "i") can be used to put the object under the curser in the input
8 line. pickinputattr (mapped to "I") does the same for the attribute under
9 the cursor.
10
1 2007-05-24 Ville Vainio <vivainio@gmail.com>
11 2007-05-24 Ville Vainio <vivainio@gmail.com>
2
12
3 * Grand magic cleansing (changeset [2380]):
13 * Grand magic cleansing (changeset [2380]):
4
14
5 * Introduce ipy_legacy.py where the following magics were
15 * Introduce ipy_legacy.py where the following magics were
6 moved:
16 moved:
7
17
8 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
18 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
9
19
10 If you need them, either use default profile or "import ipy_legacy"
20 If you need them, either use default profile or "import ipy_legacy"
11 in your ipy_user_conf.py
21 in your ipy_user_conf.py
12
22
13 * Move sh and scipy profile to Extensions from UserConfig. this implies
23 * Move sh and scipy profile to Extensions from UserConfig. this implies
14 you should not edit them, but you don't need to run %upgrade when
24 you should not edit them, but you don't need to run %upgrade when
15 upgrading IPython anymore.
25 upgrading IPython anymore.
16
26
17 * %hist/%history now operates in "raw" mode by default. To get the old
27 * %hist/%history now operates in "raw" mode by default. To get the old
18 behaviour, run '%hist -n' (native mode).
28 behaviour, run '%hist -n' (native mode).
19
29
20 * split ipy_stock_completers.py to ipy_stock_completers.py and
30 * split ipy_stock_completers.py to ipy_stock_completers.py and
21 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
31 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
22 installed as default.
32 installed as default.
23
33
24 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
34 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
25 handling.
35 handling.
26
36
27 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
37 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
28 input if readline is available.
38 input if readline is available.
29
39
30 2007-05-23 Ville Vainio <vivainio@gmail.com>
40 2007-05-23 Ville Vainio <vivainio@gmail.com>
31
41
32 * macro.py: %store uses __getstate__ properly
42 * macro.py: %store uses __getstate__ properly
33
43
34 * exesetup.py: added new setup script for creating
44 * exesetup.py: added new setup script for creating
35 standalone IPython executables with py2exe (i.e.
45 standalone IPython executables with py2exe (i.e.
36 no python installation required).
46 no python installation required).
37
47
38 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
48 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
39 its place.
49 its place.
40
50
41 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
51 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
42
52
43 2007-05-21 Ville Vainio <vivainio@gmail.com>
53 2007-05-21 Ville Vainio <vivainio@gmail.com>
44
54
45 * platutil_win32.py (set_term_title): handle
55 * platutil_win32.py (set_term_title): handle
46 failure of 'title' system call properly.
56 failure of 'title' system call properly.
47
57
48 2007-05-17 Walter Doerwald <walter@livinglogic.de>
58 2007-05-17 Walter Doerwald <walter@livinglogic.de>
49
59
50 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
60 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
51 (Bug detected by Paul Mueller).
61 (Bug detected by Paul Mueller).
52
62
53 2007-05-16 Ville Vainio <vivainio@gmail.com>
63 2007-05-16 Ville Vainio <vivainio@gmail.com>
54
64
55 * ipy_profile_sci.py, ipython_win_post_install.py: Create
65 * ipy_profile_sci.py, ipython_win_post_install.py: Create
56 new "sci" profile, effectively a modern version of the old
66 new "sci" profile, effectively a modern version of the old
57 "scipy" profile (which is now slated for deprecation).
67 "scipy" profile (which is now slated for deprecation).
58
68
59 2007-05-15 Ville Vainio <vivainio@gmail.com>
69 2007-05-15 Ville Vainio <vivainio@gmail.com>
60
70
61 * pycolorize.py, pycolor.1: Paul Mueller's patches that
71 * pycolorize.py, pycolor.1: Paul Mueller's patches that
62 make pycolorize read input from stdin when run without arguments.
72 make pycolorize read input from stdin when run without arguments.
63
73
64 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
74 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
65
75
66 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
76 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
67 it in sh profile (instead of ipy_system_conf.py).
77 it in sh profile (instead of ipy_system_conf.py).
68
78
69 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
79 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
70 aliases are now lower case on windows (MyCommand.exe => mycommand).
80 aliases are now lower case on windows (MyCommand.exe => mycommand).
71
81
72 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
82 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
73 Macros are now callable objects that inherit from ipapi.IPyAutocall,
83 Macros are now callable objects that inherit from ipapi.IPyAutocall,
74 i.e. get autocalled regardless of system autocall setting.
84 i.e. get autocalled regardless of system autocall setting.
75
85
76 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
86 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
77
87
78 * IPython/rlineimpl.py: check for clear_history in readline and
88 * IPython/rlineimpl.py: check for clear_history in readline and
79 make it a dummy no-op if not available. This function isn't
89 make it a dummy no-op if not available. This function isn't
80 guaranteed to be in the API and appeared in Python 2.4, so we need
90 guaranteed to be in the API and appeared in Python 2.4, so we need
81 to check it ourselves. Also, clean up this file quite a bit.
91 to check it ourselves. Also, clean up this file quite a bit.
82
92
83 * ipython.1: update man page and full manual with information
93 * ipython.1: update man page and full manual with information
84 about threads (remove outdated warning). Closes #151.
94 about threads (remove outdated warning). Closes #151.
85
95
86 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
96 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
87
97
88 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
98 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
89 in trunk (note that this made it into the 0.8.1 release already,
99 in trunk (note that this made it into the 0.8.1 release already,
90 but the changelogs didn't get coordinated). Many thanks to Gael
100 but the changelogs didn't get coordinated). Many thanks to Gael
91 Varoquaux <gael.varoquaux-AT-normalesup.org>
101 Varoquaux <gael.varoquaux-AT-normalesup.org>
92
102
93 2007-05-09 *** Released version 0.8.1
103 2007-05-09 *** Released version 0.8.1
94
104
95 2007-05-10 Walter Doerwald <walter@livinglogic.de>
105 2007-05-10 Walter Doerwald <walter@livinglogic.de>
96
106
97 * IPython/Extensions/igrid.py: Incorporate html help into
107 * IPython/Extensions/igrid.py: Incorporate html help into
98 the module, so we don't have to search for the file.
108 the module, so we don't have to search for the file.
99
109
100 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
110 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
101
111
102 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
112 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
103
113
104 2007-04-30 Ville Vainio <vivainio@gmail.com>
114 2007-04-30 Ville Vainio <vivainio@gmail.com>
105
115
106 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
116 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
107 user has illegal (non-ascii) home directory name
117 user has illegal (non-ascii) home directory name
108
118
109 2007-04-27 Ville Vainio <vivainio@gmail.com>
119 2007-04-27 Ville Vainio <vivainio@gmail.com>
110
120
111 * platutils_win32.py: implement set_term_title for windows
121 * platutils_win32.py: implement set_term_title for windows
112
122
113 * Update version number
123 * Update version number
114
124
115 * ipy_profile_sh.py: more informative prompt (2 dir levels)
125 * ipy_profile_sh.py: more informative prompt (2 dir levels)
116
126
117 2007-04-26 Walter Doerwald <walter@livinglogic.de>
127 2007-04-26 Walter Doerwald <walter@livinglogic.de>
118
128
119 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
129 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
120 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
130 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
121 bug discovered by Ville).
131 bug discovered by Ville).
122
132
123 2007-04-26 Ville Vainio <vivainio@gmail.com>
133 2007-04-26 Ville Vainio <vivainio@gmail.com>
124
134
125 * Extensions/ipy_completers.py: Olivier's module completer now
135 * Extensions/ipy_completers.py: Olivier's module completer now
126 saves the list of root modules if it takes > 4 secs on the first run.
136 saves the list of root modules if it takes > 4 secs on the first run.
127
137
128 * Magic.py (%rehashx): %rehashx now clears the completer cache
138 * Magic.py (%rehashx): %rehashx now clears the completer cache
129
139
130
140
131 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
141 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
132
142
133 * ipython.el: fix incorrect color scheme, reported by Stefan.
143 * ipython.el: fix incorrect color scheme, reported by Stefan.
134 Closes #149.
144 Closes #149.
135
145
136 * IPython/PyColorize.py (Parser.format2): fix state-handling
146 * IPython/PyColorize.py (Parser.format2): fix state-handling
137 logic. I still don't like how that code handles state, but at
147 logic. I still don't like how that code handles state, but at
138 least now it should be correct, if inelegant. Closes #146.
148 least now it should be correct, if inelegant. Closes #146.
139
149
140 2007-04-25 Ville Vainio <vivainio@gmail.com>
150 2007-04-25 Ville Vainio <vivainio@gmail.com>
141
151
142 * Extensions/ipy_which.py: added extension for %which magic, works
152 * Extensions/ipy_which.py: added extension for %which magic, works
143 a lot like unix 'which' but also finds and expands aliases, and
153 a lot like unix 'which' but also finds and expands aliases, and
144 allows wildcards.
154 allows wildcards.
145
155
146 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
156 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
147 as opposed to returning nothing.
157 as opposed to returning nothing.
148
158
149 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
159 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
150 ipy_stock_completers on default profile, do import on sh profile.
160 ipy_stock_completers on default profile, do import on sh profile.
151
161
152 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
162 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
153
163
154 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
164 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
155 like ipython.py foo.py which raised a IndexError.
165 like ipython.py foo.py which raised a IndexError.
156
166
157 2007-04-21 Ville Vainio <vivainio@gmail.com>
167 2007-04-21 Ville Vainio <vivainio@gmail.com>
158
168
159 * Extensions/ipy_extutil.py: added extension to manage other ipython
169 * Extensions/ipy_extutil.py: added extension to manage other ipython
160 extensions. Now only supports 'ls' == list extensions.
170 extensions. Now only supports 'ls' == list extensions.
161
171
162 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
172 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
163
173
164 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
174 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
165 would prevent use of the exception system outside of a running
175 would prevent use of the exception system outside of a running
166 IPython instance.
176 IPython instance.
167
177
168 2007-04-20 Ville Vainio <vivainio@gmail.com>
178 2007-04-20 Ville Vainio <vivainio@gmail.com>
169
179
170 * Extensions/ipy_render.py: added extension for easy
180 * Extensions/ipy_render.py: added extension for easy
171 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
181 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
172 'Iptl' template notation,
182 'Iptl' template notation,
173
183
174 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
184 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
175 safer & faster 'import' completer.
185 safer & faster 'import' completer.
176
186
177 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
187 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
178 and _ip.defalias(name, command).
188 and _ip.defalias(name, command).
179
189
180 * Extensions/ipy_exportdb.py: New extension for exporting all the
190 * Extensions/ipy_exportdb.py: New extension for exporting all the
181 %store'd data in a portable format (normal ipapi calls like
191 %store'd data in a portable format (normal ipapi calls like
182 defmacro() etc.)
192 defmacro() etc.)
183
193
184 2007-04-19 Ville Vainio <vivainio@gmail.com>
194 2007-04-19 Ville Vainio <vivainio@gmail.com>
185
195
186 * upgrade_dir.py: skip junk files like *.pyc
196 * upgrade_dir.py: skip junk files like *.pyc
187
197
188 * Release.py: version number to 0.8.1
198 * Release.py: version number to 0.8.1
189
199
190 2007-04-18 Ville Vainio <vivainio@gmail.com>
200 2007-04-18 Ville Vainio <vivainio@gmail.com>
191
201
192 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
202 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
193 and later on win32.
203 and later on win32.
194
204
195 2007-04-16 Ville Vainio <vivainio@gmail.com>
205 2007-04-16 Ville Vainio <vivainio@gmail.com>
196
206
197 * iplib.py (showtraceback): Do not crash when running w/o readline.
207 * iplib.py (showtraceback): Do not crash when running w/o readline.
198
208
199 2007-04-12 Walter Doerwald <walter@livinglogic.de>
209 2007-04-12 Walter Doerwald <walter@livinglogic.de>
200
210
201 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
211 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
202 sorted (case sensitive with files and dirs mixed).
212 sorted (case sensitive with files and dirs mixed).
203
213
204 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
214 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
205
215
206 * IPython/Release.py (version): Open trunk for 0.8.1 development.
216 * IPython/Release.py (version): Open trunk for 0.8.1 development.
207
217
208 2007-04-10 *** Released version 0.8.0
218 2007-04-10 *** Released version 0.8.0
209
219
210 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
220 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
211
221
212 * Tag 0.8.0 for release.
222 * Tag 0.8.0 for release.
213
223
214 * IPython/iplib.py (reloadhist): add API function to cleanly
224 * IPython/iplib.py (reloadhist): add API function to cleanly
215 reload the readline history, which was growing inappropriately on
225 reload the readline history, which was growing inappropriately on
216 every %run call.
226 every %run call.
217
227
218 * win32_manual_post_install.py (run): apply last part of Nicolas
228 * win32_manual_post_install.py (run): apply last part of Nicolas
219 Pernetty's patch (I'd accidentally applied it in a different
229 Pernetty's patch (I'd accidentally applied it in a different
220 directory and this particular file didn't get patched).
230 directory and this particular file didn't get patched).
221
231
222 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
232 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
223
233
224 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
234 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
225 find the main thread id and use the proper API call. Thanks to
235 find the main thread id and use the proper API call. Thanks to
226 Stefan for the fix.
236 Stefan for the fix.
227
237
228 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
238 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
229 unit tests to reflect fixed ticket #52, and add more tests sent by
239 unit tests to reflect fixed ticket #52, and add more tests sent by
230 him.
240 him.
231
241
232 * IPython/iplib.py (raw_input): restore the readline completer
242 * IPython/iplib.py (raw_input): restore the readline completer
233 state on every input, in case third-party code messed it up.
243 state on every input, in case third-party code messed it up.
234 (_prefilter): revert recent addition of early-escape checks which
244 (_prefilter): revert recent addition of early-escape checks which
235 prevent many valid alias calls from working.
245 prevent many valid alias calls from working.
236
246
237 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
247 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
238 flag for sigint handler so we don't run a full signal() call on
248 flag for sigint handler so we don't run a full signal() call on
239 each runcode access.
249 each runcode access.
240
250
241 * IPython/Magic.py (magic_whos): small improvement to diagnostic
251 * IPython/Magic.py (magic_whos): small improvement to diagnostic
242 message.
252 message.
243
253
244 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
254 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
245
255
246 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
256 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
247 asynchronous exceptions working, i.e., Ctrl-C can actually
257 asynchronous exceptions working, i.e., Ctrl-C can actually
248 interrupt long-running code in the multithreaded shells.
258 interrupt long-running code in the multithreaded shells.
249
259
250 This is using Tomer Filiba's great ctypes-based trick:
260 This is using Tomer Filiba's great ctypes-based trick:
251 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
261 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
252 this in the past, but hadn't been able to make it work before. So
262 this in the past, but hadn't been able to make it work before. So
253 far it looks like it's actually running, but this needs more
263 far it looks like it's actually running, but this needs more
254 testing. If it really works, I'll be *very* happy, and we'll owe
264 testing. If it really works, I'll be *very* happy, and we'll owe
255 a huge thank you to Tomer. My current implementation is ugly,
265 a huge thank you to Tomer. My current implementation is ugly,
256 hackish and uses nasty globals, but I don't want to try and clean
266 hackish and uses nasty globals, but I don't want to try and clean
257 anything up until we know if it actually works.
267 anything up until we know if it actually works.
258
268
259 NOTE: this feature needs ctypes to work. ctypes is included in
269 NOTE: this feature needs ctypes to work. ctypes is included in
260 Python2.5, but 2.4 users will need to manually install it. This
270 Python2.5, but 2.4 users will need to manually install it. This
261 feature makes multi-threaded shells so much more usable that it's
271 feature makes multi-threaded shells so much more usable that it's
262 a minor price to pay (ctypes is very easy to install, already a
272 a minor price to pay (ctypes is very easy to install, already a
263 requirement for win32 and available in major linux distros).
273 requirement for win32 and available in major linux distros).
264
274
265 2007-04-04 Ville Vainio <vivainio@gmail.com>
275 2007-04-04 Ville Vainio <vivainio@gmail.com>
266
276
267 * Extensions/ipy_completers.py, ipy_stock_completers.py:
277 * Extensions/ipy_completers.py, ipy_stock_completers.py:
268 Moved implementations of 'bundled' completers to ipy_completers.py,
278 Moved implementations of 'bundled' completers to ipy_completers.py,
269 they are only enabled in ipy_stock_completers.py.
279 they are only enabled in ipy_stock_completers.py.
270
280
271 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
281 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
272
282
273 * IPython/PyColorize.py (Parser.format2): Fix identation of
283 * IPython/PyColorize.py (Parser.format2): Fix identation of
274 colorzied output and return early if color scheme is NoColor, to
284 colorzied output and return early if color scheme is NoColor, to
275 avoid unnecessary and expensive tokenization. Closes #131.
285 avoid unnecessary and expensive tokenization. Closes #131.
276
286
277 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
287 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
278
288
279 * IPython/Debugger.py: disable the use of pydb version 1.17. It
289 * IPython/Debugger.py: disable the use of pydb version 1.17. It
280 has a critical bug (a missing import that makes post-mortem not
290 has a critical bug (a missing import that makes post-mortem not
281 work at all). Unfortunately as of this time, this is the version
291 work at all). Unfortunately as of this time, this is the version
282 shipped with Ubuntu Edgy, so quite a few people have this one. I
292 shipped with Ubuntu Edgy, so quite a few people have this one. I
283 hope Edgy will update to a more recent package.
293 hope Edgy will update to a more recent package.
284
294
285 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
295 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
286
296
287 * IPython/iplib.py (_prefilter): close #52, second part of a patch
297 * IPython/iplib.py (_prefilter): close #52, second part of a patch
288 set by Stefan (only the first part had been applied before).
298 set by Stefan (only the first part had been applied before).
289
299
290 * IPython/Extensions/ipy_stock_completers.py (module_completer):
300 * IPython/Extensions/ipy_stock_completers.py (module_completer):
291 remove usage of the dangerous pkgutil.walk_packages(). See
301 remove usage of the dangerous pkgutil.walk_packages(). See
292 details in comments left in the code.
302 details in comments left in the code.
293
303
294 * IPython/Magic.py (magic_whos): add support for numpy arrays
304 * IPython/Magic.py (magic_whos): add support for numpy arrays
295 similar to what we had for Numeric.
305 similar to what we had for Numeric.
296
306
297 * IPython/completer.py (IPCompleter.complete): extend the
307 * IPython/completer.py (IPCompleter.complete): extend the
298 complete() call API to support completions by other mechanisms
308 complete() call API to support completions by other mechanisms
299 than readline. Closes #109.
309 than readline. Closes #109.
300
310
301 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
311 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
302 protect against a bug in Python's execfile(). Closes #123.
312 protect against a bug in Python's execfile(). Closes #123.
303
313
304 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
314 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
305
315
306 * IPython/iplib.py (split_user_input): ensure that when splitting
316 * IPython/iplib.py (split_user_input): ensure that when splitting
307 user input, the part that can be treated as a python name is pure
317 user input, the part that can be treated as a python name is pure
308 ascii (Python identifiers MUST be pure ascii). Part of the
318 ascii (Python identifiers MUST be pure ascii). Part of the
309 ongoing Unicode support work.
319 ongoing Unicode support work.
310
320
311 * IPython/Prompts.py (prompt_specials_color): Add \N for the
321 * IPython/Prompts.py (prompt_specials_color): Add \N for the
312 actual prompt number, without any coloring. This allows users to
322 actual prompt number, without any coloring. This allows users to
313 produce numbered prompts with their own colors. Added after a
323 produce numbered prompts with their own colors. Added after a
314 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
324 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
315
325
316 2007-03-31 Walter Doerwald <walter@livinglogic.de>
326 2007-03-31 Walter Doerwald <walter@livinglogic.de>
317
327
318 * IPython/Extensions/igrid.py: Map the return key
328 * IPython/Extensions/igrid.py: Map the return key
319 to enter() and shift-return to enterattr().
329 to enter() and shift-return to enterattr().
320
330
321 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
331 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
322
332
323 * IPython/Magic.py (magic_psearch): add unicode support by
333 * IPython/Magic.py (magic_psearch): add unicode support by
324 encoding to ascii the input, since this routine also only deals
334 encoding to ascii the input, since this routine also only deals
325 with valid Python names. Fixes a bug reported by Stefan.
335 with valid Python names. Fixes a bug reported by Stefan.
326
336
327 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
337 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
328
338
329 * IPython/Magic.py (_inspect): convert unicode input into ascii
339 * IPython/Magic.py (_inspect): convert unicode input into ascii
330 before trying to evaluate it as a Python identifier. This fixes a
340 before trying to evaluate it as a Python identifier. This fixes a
331 problem that the new unicode support had introduced when analyzing
341 problem that the new unicode support had introduced when analyzing
332 long definition lines for functions.
342 long definition lines for functions.
333
343
334 2007-03-24 Walter Doerwald <walter@livinglogic.de>
344 2007-03-24 Walter Doerwald <walter@livinglogic.de>
335
345
336 * IPython/Extensions/igrid.py: Fix picking. Using
346 * IPython/Extensions/igrid.py: Fix picking. Using
337 igrid with wxPython 2.6 and -wthread should work now.
347 igrid with wxPython 2.6 and -wthread should work now.
338 igrid.display() simply tries to create a frame without
348 igrid.display() simply tries to create a frame without
339 an application. Only if this fails an application is created.
349 an application. Only if this fails an application is created.
340
350
341 2007-03-23 Walter Doerwald <walter@livinglogic.de>
351 2007-03-23 Walter Doerwald <walter@livinglogic.de>
342
352
343 * IPython/Extensions/path.py: Updated to version 2.2.
353 * IPython/Extensions/path.py: Updated to version 2.2.
344
354
345 2007-03-23 Ville Vainio <vivainio@gmail.com>
355 2007-03-23 Ville Vainio <vivainio@gmail.com>
346
356
347 * iplib.py: recursive alias expansion now works better, so that
357 * iplib.py: recursive alias expansion now works better, so that
348 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
358 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
349 doesn't trip up the process, if 'd' has been aliased to 'ls'.
359 doesn't trip up the process, if 'd' has been aliased to 'ls'.
350
360
351 * Extensions/ipy_gnuglobal.py added, provides %global magic
361 * Extensions/ipy_gnuglobal.py added, provides %global magic
352 for users of http://www.gnu.org/software/global
362 for users of http://www.gnu.org/software/global
353
363
354 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
364 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
355 Closes #52. Patch by Stefan van der Walt.
365 Closes #52. Patch by Stefan van der Walt.
356
366
357 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
367 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
358
368
359 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
369 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
360 respect the __file__ attribute when using %run. Thanks to a bug
370 respect the __file__ attribute when using %run. Thanks to a bug
361 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
371 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
362
372
363 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
373 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
364
374
365 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
375 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
366 input. Patch sent by Stefan.
376 input. Patch sent by Stefan.
367
377
368 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
378 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
369 * IPython/Extensions/ipy_stock_completer.py
379 * IPython/Extensions/ipy_stock_completer.py
370 shlex_split, fix bug in shlex_split. len function
380 shlex_split, fix bug in shlex_split. len function
371 call was missing an if statement. Caused shlex_split to
381 call was missing an if statement. Caused shlex_split to
372 sometimes return "" as last element.
382 sometimes return "" as last element.
373
383
374 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
384 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
375
385
376 * IPython/completer.py
386 * IPython/completer.py
377 (IPCompleter.file_matches.single_dir_expand): fix a problem
387 (IPCompleter.file_matches.single_dir_expand): fix a problem
378 reported by Stefan, where directories containign a single subdir
388 reported by Stefan, where directories containign a single subdir
379 would be completed too early.
389 would be completed too early.
380
390
381 * IPython/Shell.py (_load_pylab): Make the execution of 'from
391 * IPython/Shell.py (_load_pylab): Make the execution of 'from
382 pylab import *' when -pylab is given be optional. A new flag,
392 pylab import *' when -pylab is given be optional. A new flag,
383 pylab_import_all controls this behavior, the default is True for
393 pylab_import_all controls this behavior, the default is True for
384 backwards compatibility.
394 backwards compatibility.
385
395
386 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
396 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
387 modified) R. Bernstein's patch for fully syntax highlighted
397 modified) R. Bernstein's patch for fully syntax highlighted
388 tracebacks. The functionality is also available under ultraTB for
398 tracebacks. The functionality is also available under ultraTB for
389 non-ipython users (someone using ultraTB but outside an ipython
399 non-ipython users (someone using ultraTB but outside an ipython
390 session). They can select the color scheme by setting the
400 session). They can select the color scheme by setting the
391 module-level global DEFAULT_SCHEME. The highlight functionality
401 module-level global DEFAULT_SCHEME. The highlight functionality
392 also works when debugging.
402 also works when debugging.
393
403
394 * IPython/genutils.py (IOStream.close): small patch by
404 * IPython/genutils.py (IOStream.close): small patch by
395 R. Bernstein for improved pydb support.
405 R. Bernstein for improved pydb support.
396
406
397 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
407 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
398 DaveS <davls@telus.net> to improve support of debugging under
408 DaveS <davls@telus.net> to improve support of debugging under
399 NTEmacs, including improved pydb behavior.
409 NTEmacs, including improved pydb behavior.
400
410
401 * IPython/Magic.py (magic_prun): Fix saving of profile info for
411 * IPython/Magic.py (magic_prun): Fix saving of profile info for
402 Python 2.5, where the stats object API changed a little. Thanks
412 Python 2.5, where the stats object API changed a little. Thanks
403 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
413 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
404
414
405 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
415 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
406 Pernetty's patch to improve support for (X)Emacs under Win32.
416 Pernetty's patch to improve support for (X)Emacs under Win32.
407
417
408 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
418 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
409
419
410 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
420 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
411 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
421 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
412 a report by Nik Tautenhahn.
422 a report by Nik Tautenhahn.
413
423
414 2007-03-16 Walter Doerwald <walter@livinglogic.de>
424 2007-03-16 Walter Doerwald <walter@livinglogic.de>
415
425
416 * setup.py: Add the igrid help files to the list of data files
426 * setup.py: Add the igrid help files to the list of data files
417 to be installed alongside igrid.
427 to be installed alongside igrid.
418 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
428 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
419 Show the input object of the igrid browser as the window tile.
429 Show the input object of the igrid browser as the window tile.
420 Show the object the cursor is on in the statusbar.
430 Show the object the cursor is on in the statusbar.
421
431
422 2007-03-15 Ville Vainio <vivainio@gmail.com>
432 2007-03-15 Ville Vainio <vivainio@gmail.com>
423
433
424 * Extensions/ipy_stock_completers.py: Fixed exception
434 * Extensions/ipy_stock_completers.py: Fixed exception
425 on mismatching quotes in %run completer. Patch by
435 on mismatching quotes in %run completer. Patch by
426 JοΏ½rgen Stenarson. Closes #127.
436 JοΏ½rgen Stenarson. Closes #127.
427
437
428 2007-03-14 Ville Vainio <vivainio@gmail.com>
438 2007-03-14 Ville Vainio <vivainio@gmail.com>
429
439
430 * Extensions/ext_rehashdir.py: Do not do auto_alias
440 * Extensions/ext_rehashdir.py: Do not do auto_alias
431 in %rehashdir, it clobbers %store'd aliases.
441 in %rehashdir, it clobbers %store'd aliases.
432
442
433 * UserConfig/ipy_profile_sh.py: envpersist.py extension
443 * UserConfig/ipy_profile_sh.py: envpersist.py extension
434 (beefed up %env) imported for sh profile.
444 (beefed up %env) imported for sh profile.
435
445
436 2007-03-10 Walter Doerwald <walter@livinglogic.de>
446 2007-03-10 Walter Doerwald <walter@livinglogic.de>
437
447
438 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
448 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
439 as the default browser.
449 as the default browser.
440 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
450 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
441 As igrid displays all attributes it ever encounters, fetch() (which has
451 As igrid displays all attributes it ever encounters, fetch() (which has
442 been renamed to _fetch()) doesn't have to recalculate the display attributes
452 been renamed to _fetch()) doesn't have to recalculate the display attributes
443 every time a new item is fetched. This should speed up scrolling.
453 every time a new item is fetched. This should speed up scrolling.
444
454
445 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
455 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
446
456
447 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
457 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
448 Schmolck's recently reported tab-completion bug (my previous one
458 Schmolck's recently reported tab-completion bug (my previous one
449 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
459 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
450
460
451 2007-03-09 Walter Doerwald <walter@livinglogic.de>
461 2007-03-09 Walter Doerwald <walter@livinglogic.de>
452
462
453 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
463 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
454 Close help window if exiting igrid.
464 Close help window if exiting igrid.
455
465
456 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
466 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
457
467
458 * IPython/Extensions/ipy_defaults.py: Check if readline is available
468 * IPython/Extensions/ipy_defaults.py: Check if readline is available
459 before calling functions from readline.
469 before calling functions from readline.
460
470
461 2007-03-02 Walter Doerwald <walter@livinglogic.de>
471 2007-03-02 Walter Doerwald <walter@livinglogic.de>
462
472
463 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
473 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
464 igrid is a wxPython-based display object for ipipe. If your system has
474 igrid is a wxPython-based display object for ipipe. If your system has
465 wx installed igrid will be the default display. Without wx ipipe falls
475 wx installed igrid will be the default display. Without wx ipipe falls
466 back to ibrowse (which needs curses). If no curses is installed ipipe
476 back to ibrowse (which needs curses). If no curses is installed ipipe
467 falls back to idump.
477 falls back to idump.
468
478
469 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
479 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
470
480
471 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
481 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
472 my changes from yesterday, they introduced bugs. Will reactivate
482 my changes from yesterday, they introduced bugs. Will reactivate
473 once I get a correct solution, which will be much easier thanks to
483 once I get a correct solution, which will be much easier thanks to
474 Dan Milstein's new prefilter test suite.
484 Dan Milstein's new prefilter test suite.
475
485
476 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
486 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
477
487
478 * IPython/iplib.py (split_user_input): fix input splitting so we
488 * IPython/iplib.py (split_user_input): fix input splitting so we
479 don't attempt attribute accesses on things that can't possibly be
489 don't attempt attribute accesses on things that can't possibly be
480 valid Python attributes. After a bug report by Alex Schmolck.
490 valid Python attributes. After a bug report by Alex Schmolck.
481 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
491 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
482 %magic with explicit % prefix.
492 %magic with explicit % prefix.
483
493
484 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
494 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
485
495
486 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
496 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
487 avoid a DeprecationWarning from GTK.
497 avoid a DeprecationWarning from GTK.
488
498
489 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
499 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
490
500
491 * IPython/genutils.py (clock): I modified clock() to return total
501 * IPython/genutils.py (clock): I modified clock() to return total
492 time, user+system. This is a more commonly needed metric. I also
502 time, user+system. This is a more commonly needed metric. I also
493 introduced the new clocku/clocks to get only user/system time if
503 introduced the new clocku/clocks to get only user/system time if
494 one wants those instead.
504 one wants those instead.
495
505
496 ***WARNING: API CHANGE*** clock() used to return only user time,
506 ***WARNING: API CHANGE*** clock() used to return only user time,
497 so if you want exactly the same results as before, use clocku
507 so if you want exactly the same results as before, use clocku
498 instead.
508 instead.
499
509
500 2007-02-22 Ville Vainio <vivainio@gmail.com>
510 2007-02-22 Ville Vainio <vivainio@gmail.com>
501
511
502 * IPython/Extensions/ipy_p4.py: Extension for improved
512 * IPython/Extensions/ipy_p4.py: Extension for improved
503 p4 (perforce version control system) experience.
513 p4 (perforce version control system) experience.
504 Adds %p4 magic with p4 command completion and
514 Adds %p4 magic with p4 command completion and
505 automatic -G argument (marshall output as python dict)
515 automatic -G argument (marshall output as python dict)
506
516
507 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
517 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
508
518
509 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
519 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
510 stop marks.
520 stop marks.
511 (ClearingMixin): a simple mixin to easily make a Demo class clear
521 (ClearingMixin): a simple mixin to easily make a Demo class clear
512 the screen in between blocks and have empty marquees. The
522 the screen in between blocks and have empty marquees. The
513 ClearDemo and ClearIPDemo classes that use it are included.
523 ClearDemo and ClearIPDemo classes that use it are included.
514
524
515 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
525 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
516
526
517 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
527 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
518 protect against exceptions at Python shutdown time. Patch
528 protect against exceptions at Python shutdown time. Patch
519 sumbmitted to upstream.
529 sumbmitted to upstream.
520
530
521 2007-02-14 Walter Doerwald <walter@livinglogic.de>
531 2007-02-14 Walter Doerwald <walter@livinglogic.de>
522
532
523 * IPython/Extensions/ibrowse.py: If entering the first object level
533 * IPython/Extensions/ibrowse.py: If entering the first object level
524 (i.e. the object for which the browser has been started) fails,
534 (i.e. the object for which the browser has been started) fails,
525 now the error is raised directly (aborting the browser) instead of
535 now the error is raised directly (aborting the browser) instead of
526 running into an empty levels list later.
536 running into an empty levels list later.
527
537
528 2007-02-03 Walter Doerwald <walter@livinglogic.de>
538 2007-02-03 Walter Doerwald <walter@livinglogic.de>
529
539
530 * IPython/Extensions/ipipe.py: Add an xrepr implementation
540 * IPython/Extensions/ipipe.py: Add an xrepr implementation
531 for the noitem object.
541 for the noitem object.
532
542
533 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
543 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
534
544
535 * IPython/completer.py (Completer.attr_matches): Fix small
545 * IPython/completer.py (Completer.attr_matches): Fix small
536 tab-completion bug with Enthought Traits objects with units.
546 tab-completion bug with Enthought Traits objects with units.
537 Thanks to a bug report by Tom Denniston
547 Thanks to a bug report by Tom Denniston
538 <tom.denniston-AT-alum.dartmouth.org>.
548 <tom.denniston-AT-alum.dartmouth.org>.
539
549
540 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
550 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
541
551
542 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
552 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
543 bug where only .ipy or .py would be completed. Once the first
553 bug where only .ipy or .py would be completed. Once the first
544 argument to %run has been given, all completions are valid because
554 argument to %run has been given, all completions are valid because
545 they are the arguments to the script, which may well be non-python
555 they are the arguments to the script, which may well be non-python
546 filenames.
556 filenames.
547
557
548 * IPython/irunner.py (InteractiveRunner.run_source): major updates
558 * IPython/irunner.py (InteractiveRunner.run_source): major updates
549 to irunner to allow it to correctly support real doctesting of
559 to irunner to allow it to correctly support real doctesting of
550 out-of-process ipython code.
560 out-of-process ipython code.
551
561
552 * IPython/Magic.py (magic_cd): Make the setting of the terminal
562 * IPython/Magic.py (magic_cd): Make the setting of the terminal
553 title an option (-noterm_title) because it completely breaks
563 title an option (-noterm_title) because it completely breaks
554 doctesting.
564 doctesting.
555
565
556 * IPython/demo.py: fix IPythonDemo class that was not actually working.
566 * IPython/demo.py: fix IPythonDemo class that was not actually working.
557
567
558 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
568 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
559
569
560 * IPython/irunner.py (main): fix small bug where extensions were
570 * IPython/irunner.py (main): fix small bug where extensions were
561 not being correctly recognized.
571 not being correctly recognized.
562
572
563 2007-01-23 Walter Doerwald <walter@livinglogic.de>
573 2007-01-23 Walter Doerwald <walter@livinglogic.de>
564
574
565 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
575 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
566 a string containing a single line yields the string itself as the
576 a string containing a single line yields the string itself as the
567 only item.
577 only item.
568
578
569 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
579 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
570 object if it's the same as the one on the last level (This avoids
580 object if it's the same as the one on the last level (This avoids
571 infinite recursion for one line strings).
581 infinite recursion for one line strings).
572
582
573 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
583 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
574
584
575 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
585 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
576 all output streams before printing tracebacks. This ensures that
586 all output streams before printing tracebacks. This ensures that
577 user output doesn't end up interleaved with traceback output.
587 user output doesn't end up interleaved with traceback output.
578
588
579 2007-01-10 Ville Vainio <vivainio@gmail.com>
589 2007-01-10 Ville Vainio <vivainio@gmail.com>
580
590
581 * Extensions/envpersist.py: Turbocharged %env that remembers
591 * Extensions/envpersist.py: Turbocharged %env that remembers
582 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
592 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
583 "%env VISUAL=jed".
593 "%env VISUAL=jed".
584
594
585 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
595 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
586
596
587 * IPython/iplib.py (showtraceback): ensure that we correctly call
597 * IPython/iplib.py (showtraceback): ensure that we correctly call
588 custom handlers in all cases (some with pdb were slipping through,
598 custom handlers in all cases (some with pdb were slipping through,
589 but I'm not exactly sure why).
599 but I'm not exactly sure why).
590
600
591 * IPython/Debugger.py (Tracer.__init__): added new class to
601 * IPython/Debugger.py (Tracer.__init__): added new class to
592 support set_trace-like usage of IPython's enhanced debugger.
602 support set_trace-like usage of IPython's enhanced debugger.
593
603
594 2006-12-24 Ville Vainio <vivainio@gmail.com>
604 2006-12-24 Ville Vainio <vivainio@gmail.com>
595
605
596 * ipmaker.py: more informative message when ipy_user_conf
606 * ipmaker.py: more informative message when ipy_user_conf
597 import fails (suggest running %upgrade).
607 import fails (suggest running %upgrade).
598
608
599 * tools/run_ipy_in_profiler.py: Utility to see where
609 * tools/run_ipy_in_profiler.py: Utility to see where
600 the time during IPython startup is spent.
610 the time during IPython startup is spent.
601
611
602 2006-12-20 Ville Vainio <vivainio@gmail.com>
612 2006-12-20 Ville Vainio <vivainio@gmail.com>
603
613
604 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
614 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
605
615
606 * ipapi.py: Add new ipapi method, expand_alias.
616 * ipapi.py: Add new ipapi method, expand_alias.
607
617
608 * Release.py: Bump up version to 0.7.4.svn
618 * Release.py: Bump up version to 0.7.4.svn
609
619
610 2006-12-17 Ville Vainio <vivainio@gmail.com>
620 2006-12-17 Ville Vainio <vivainio@gmail.com>
611
621
612 * Extensions/jobctrl.py: Fixed &cmd arg arg...
622 * Extensions/jobctrl.py: Fixed &cmd arg arg...
613 to work properly on posix too
623 to work properly on posix too
614
624
615 * Release.py: Update revnum (version is still just 0.7.3).
625 * Release.py: Update revnum (version is still just 0.7.3).
616
626
617 2006-12-15 Ville Vainio <vivainio@gmail.com>
627 2006-12-15 Ville Vainio <vivainio@gmail.com>
618
628
619 * scripts/ipython_win_post_install: create ipython.py in
629 * scripts/ipython_win_post_install: create ipython.py in
620 prefix + "/scripts".
630 prefix + "/scripts".
621
631
622 * Release.py: Update version to 0.7.3.
632 * Release.py: Update version to 0.7.3.
623
633
624 2006-12-14 Ville Vainio <vivainio@gmail.com>
634 2006-12-14 Ville Vainio <vivainio@gmail.com>
625
635
626 * scripts/ipython_win_post_install: Overwrite old shortcuts
636 * scripts/ipython_win_post_install: Overwrite old shortcuts
627 if they already exist
637 if they already exist
628
638
629 * Release.py: release 0.7.3rc2
639 * Release.py: release 0.7.3rc2
630
640
631 2006-12-13 Ville Vainio <vivainio@gmail.com>
641 2006-12-13 Ville Vainio <vivainio@gmail.com>
632
642
633 * Branch and update Release.py for 0.7.3rc1
643 * Branch and update Release.py for 0.7.3rc1
634
644
635 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
645 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
636
646
637 * IPython/Shell.py (IPShellWX): update for current WX naming
647 * IPython/Shell.py (IPShellWX): update for current WX naming
638 conventions, to avoid a deprecation warning with current WX
648 conventions, to avoid a deprecation warning with current WX
639 versions. Thanks to a report by Danny Shevitz.
649 versions. Thanks to a report by Danny Shevitz.
640
650
641 2006-12-12 Ville Vainio <vivainio@gmail.com>
651 2006-12-12 Ville Vainio <vivainio@gmail.com>
642
652
643 * ipmaker.py: apply david cournapeau's patch to make
653 * ipmaker.py: apply david cournapeau's patch to make
644 import_some work properly even when ipythonrc does
654 import_some work properly even when ipythonrc does
645 import_some on empty list (it was an old bug!).
655 import_some on empty list (it was an old bug!).
646
656
647 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
657 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
648 Add deprecation note to ipythonrc and a url to wiki
658 Add deprecation note to ipythonrc and a url to wiki
649 in ipy_user_conf.py
659 in ipy_user_conf.py
650
660
651
661
652 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
662 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
653 as if it was typed on IPython command prompt, i.e.
663 as if it was typed on IPython command prompt, i.e.
654 as IPython script.
664 as IPython script.
655
665
656 * example-magic.py, magic_grepl.py: remove outdated examples
666 * example-magic.py, magic_grepl.py: remove outdated examples
657
667
658 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
668 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
659
669
660 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
670 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
661 is called before any exception has occurred.
671 is called before any exception has occurred.
662
672
663 2006-12-08 Ville Vainio <vivainio@gmail.com>
673 2006-12-08 Ville Vainio <vivainio@gmail.com>
664
674
665 * Extensions/ipy_stock_completers.py: fix cd completer
675 * Extensions/ipy_stock_completers.py: fix cd completer
666 to translate /'s to \'s again.
676 to translate /'s to \'s again.
667
677
668 * completer.py: prevent traceback on file completions w/
678 * completer.py: prevent traceback on file completions w/
669 backslash.
679 backslash.
670
680
671 * Release.py: Update release number to 0.7.3b3 for release
681 * Release.py: Update release number to 0.7.3b3 for release
672
682
673 2006-12-07 Ville Vainio <vivainio@gmail.com>
683 2006-12-07 Ville Vainio <vivainio@gmail.com>
674
684
675 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
685 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
676 while executing external code. Provides more shell-like behaviour
686 while executing external code. Provides more shell-like behaviour
677 and overall better response to ctrl + C / ctrl + break.
687 and overall better response to ctrl + C / ctrl + break.
678
688
679 * tools/make_tarball.py: new script to create tarball straight from svn
689 * tools/make_tarball.py: new script to create tarball straight from svn
680 (setup.py sdist doesn't work on win32).
690 (setup.py sdist doesn't work on win32).
681
691
682 * Extensions/ipy_stock_completers.py: fix cd completer to give up
692 * Extensions/ipy_stock_completers.py: fix cd completer to give up
683 on dirnames with spaces and use the default completer instead.
693 on dirnames with spaces and use the default completer instead.
684
694
685 * Revision.py: Change version to 0.7.3b2 for release.
695 * Revision.py: Change version to 0.7.3b2 for release.
686
696
687 2006-12-05 Ville Vainio <vivainio@gmail.com>
697 2006-12-05 Ville Vainio <vivainio@gmail.com>
688
698
689 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
699 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
690 pydb patch 4 (rm debug printing, py 2.5 checking)
700 pydb patch 4 (rm debug printing, py 2.5 checking)
691
701
692 2006-11-30 Walter Doerwald <walter@livinglogic.de>
702 2006-11-30 Walter Doerwald <walter@livinglogic.de>
693 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
703 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
694 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
704 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
695 "refreshfind" (mapped to "R") does the same but tries to go back to the same
705 "refreshfind" (mapped to "R") does the same but tries to go back to the same
696 object the cursor was on before the refresh. The command "markrange" is
706 object the cursor was on before the refresh. The command "markrange" is
697 mapped to "%" now.
707 mapped to "%" now.
698 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
708 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
699
709
700 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
710 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
701
711
702 * IPython/Magic.py (magic_debug): new %debug magic to activate the
712 * IPython/Magic.py (magic_debug): new %debug magic to activate the
703 interactive debugger on the last traceback, without having to call
713 interactive debugger on the last traceback, without having to call
704 %pdb and rerun your code. Made minor changes in various modules,
714 %pdb and rerun your code. Made minor changes in various modules,
705 should automatically recognize pydb if available.
715 should automatically recognize pydb if available.
706
716
707 2006-11-28 Ville Vainio <vivainio@gmail.com>
717 2006-11-28 Ville Vainio <vivainio@gmail.com>
708
718
709 * completer.py: If the text start with !, show file completions
719 * completer.py: If the text start with !, show file completions
710 properly. This helps when trying to complete command name
720 properly. This helps when trying to complete command name
711 for shell escapes.
721 for shell escapes.
712
722
713 2006-11-27 Ville Vainio <vivainio@gmail.com>
723 2006-11-27 Ville Vainio <vivainio@gmail.com>
714
724
715 * ipy_stock_completers.py: bzr completer submitted by Stefan van
725 * ipy_stock_completers.py: bzr completer submitted by Stefan van
716 der Walt. Clean up svn and hg completers by using a common
726 der Walt. Clean up svn and hg completers by using a common
717 vcs_completer.
727 vcs_completer.
718
728
719 2006-11-26 Ville Vainio <vivainio@gmail.com>
729 2006-11-26 Ville Vainio <vivainio@gmail.com>
720
730
721 * Remove ipconfig and %config; you should use _ip.options structure
731 * Remove ipconfig and %config; you should use _ip.options structure
722 directly instead!
732 directly instead!
723
733
724 * genutils.py: add wrap_deprecated function for deprecating callables
734 * genutils.py: add wrap_deprecated function for deprecating callables
725
735
726 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
736 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
727 _ip.system instead. ipalias is redundant.
737 _ip.system instead. ipalias is redundant.
728
738
729 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
739 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
730 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
740 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
731 explicit.
741 explicit.
732
742
733 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
743 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
734 completer. Try it by entering 'hg ' and pressing tab.
744 completer. Try it by entering 'hg ' and pressing tab.
735
745
736 * macro.py: Give Macro a useful __repr__ method
746 * macro.py: Give Macro a useful __repr__ method
737
747
738 * Magic.py: %whos abbreviates the typename of Macro for brevity.
748 * Magic.py: %whos abbreviates the typename of Macro for brevity.
739
749
740 2006-11-24 Walter Doerwald <walter@livinglogic.de>
750 2006-11-24 Walter Doerwald <walter@livinglogic.de>
741 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
751 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
742 we don't get a duplicate ipipe module, where registration of the xrepr
752 we don't get a duplicate ipipe module, where registration of the xrepr
743 implementation for Text is useless.
753 implementation for Text is useless.
744
754
745 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
755 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
746
756
747 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
757 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
748
758
749 2006-11-24 Ville Vainio <vivainio@gmail.com>
759 2006-11-24 Ville Vainio <vivainio@gmail.com>
750
760
751 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
761 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
752 try to use "cProfile" instead of the slower pure python
762 try to use "cProfile" instead of the slower pure python
753 "profile"
763 "profile"
754
764
755 2006-11-23 Ville Vainio <vivainio@gmail.com>
765 2006-11-23 Ville Vainio <vivainio@gmail.com>
756
766
757 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
767 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
758 Qt+IPython+Designer link in documentation.
768 Qt+IPython+Designer link in documentation.
759
769
760 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
770 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
761 correct Pdb object to %pydb.
771 correct Pdb object to %pydb.
762
772
763
773
764 2006-11-22 Walter Doerwald <walter@livinglogic.de>
774 2006-11-22 Walter Doerwald <walter@livinglogic.de>
765 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
775 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
766 generic xrepr(), otherwise the list implementation would kick in.
776 generic xrepr(), otherwise the list implementation would kick in.
767
777
768 2006-11-21 Ville Vainio <vivainio@gmail.com>
778 2006-11-21 Ville Vainio <vivainio@gmail.com>
769
779
770 * upgrade_dir.py: Now actually overwrites a nonmodified user file
780 * upgrade_dir.py: Now actually overwrites a nonmodified user file
771 with one from UserConfig.
781 with one from UserConfig.
772
782
773 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
783 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
774 it was missing which broke the sh profile.
784 it was missing which broke the sh profile.
775
785
776 * completer.py: file completer now uses explicit '/' instead
786 * completer.py: file completer now uses explicit '/' instead
777 of os.path.join, expansion of 'foo' was broken on win32
787 of os.path.join, expansion of 'foo' was broken on win32
778 if there was one directory with name 'foobar'.
788 if there was one directory with name 'foobar'.
779
789
780 * A bunch of patches from Kirill Smelkov:
790 * A bunch of patches from Kirill Smelkov:
781
791
782 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
792 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
783
793
784 * [patch 7/9] Implement %page -r (page in raw mode) -
794 * [patch 7/9] Implement %page -r (page in raw mode) -
785
795
786 * [patch 5/9] ScientificPython webpage has moved
796 * [patch 5/9] ScientificPython webpage has moved
787
797
788 * [patch 4/9] The manual mentions %ds, should be %dhist
798 * [patch 4/9] The manual mentions %ds, should be %dhist
789
799
790 * [patch 3/9] Kill old bits from %prun doc.
800 * [patch 3/9] Kill old bits from %prun doc.
791
801
792 * [patch 1/9] Fix typos here and there.
802 * [patch 1/9] Fix typos here and there.
793
803
794 2006-11-08 Ville Vainio <vivainio@gmail.com>
804 2006-11-08 Ville Vainio <vivainio@gmail.com>
795
805
796 * completer.py (attr_matches): catch all exceptions raised
806 * completer.py (attr_matches): catch all exceptions raised
797 by eval of expr with dots.
807 by eval of expr with dots.
798
808
799 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
809 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
800
810
801 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
811 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
802 input if it starts with whitespace. This allows you to paste
812 input if it starts with whitespace. This allows you to paste
803 indented input from any editor without manually having to type in
813 indented input from any editor without manually having to type in
804 the 'if 1:', which is convenient when working interactively.
814 the 'if 1:', which is convenient when working interactively.
805 Slightly modifed version of a patch by Bo Peng
815 Slightly modifed version of a patch by Bo Peng
806 <bpeng-AT-rice.edu>.
816 <bpeng-AT-rice.edu>.
807
817
808 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
818 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
809
819
810 * IPython/irunner.py (main): modified irunner so it automatically
820 * IPython/irunner.py (main): modified irunner so it automatically
811 recognizes the right runner to use based on the extension (.py for
821 recognizes the right runner to use based on the extension (.py for
812 python, .ipy for ipython and .sage for sage).
822 python, .ipy for ipython and .sage for sage).
813
823
814 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
824 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
815 visible in ipapi as ip.config(), to programatically control the
825 visible in ipapi as ip.config(), to programatically control the
816 internal rc object. There's an accompanying %config magic for
826 internal rc object. There's an accompanying %config magic for
817 interactive use, which has been enhanced to match the
827 interactive use, which has been enhanced to match the
818 funtionality in ipconfig.
828 funtionality in ipconfig.
819
829
820 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
830 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
821 so it's not just a toggle, it now takes an argument. Add support
831 so it's not just a toggle, it now takes an argument. Add support
822 for a customizable header when making system calls, as the new
832 for a customizable header when making system calls, as the new
823 system_header variable in the ipythonrc file.
833 system_header variable in the ipythonrc file.
824
834
825 2006-11-03 Walter Doerwald <walter@livinglogic.de>
835 2006-11-03 Walter Doerwald <walter@livinglogic.de>
826
836
827 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
837 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
828 generic functions (using Philip J. Eby's simplegeneric package).
838 generic functions (using Philip J. Eby's simplegeneric package).
829 This makes it possible to customize the display of third-party classes
839 This makes it possible to customize the display of third-party classes
830 without having to monkeypatch them. xiter() no longer supports a mode
840 without having to monkeypatch them. xiter() no longer supports a mode
831 argument and the XMode class has been removed. The same functionality can
841 argument and the XMode class has been removed. The same functionality can
832 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
842 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
833 One consequence of the switch to generic functions is that xrepr() and
843 One consequence of the switch to generic functions is that xrepr() and
834 xattrs() implementation must define the default value for the mode
844 xattrs() implementation must define the default value for the mode
835 argument themselves and xattrs() implementations must return real
845 argument themselves and xattrs() implementations must return real
836 descriptors.
846 descriptors.
837
847
838 * IPython/external: This new subpackage will contain all third-party
848 * IPython/external: This new subpackage will contain all third-party
839 packages that are bundled with IPython. (The first one is simplegeneric).
849 packages that are bundled with IPython. (The first one is simplegeneric).
840
850
841 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
851 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
842 directory which as been dropped in r1703.
852 directory which as been dropped in r1703.
843
853
844 * IPython/Extensions/ipipe.py (iless): Fixed.
854 * IPython/Extensions/ipipe.py (iless): Fixed.
845
855
846 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
856 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
847
857
848 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
858 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
849
859
850 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
860 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
851 handling in variable expansion so that shells and magics recognize
861 handling in variable expansion so that shells and magics recognize
852 function local scopes correctly. Bug reported by Brian.
862 function local scopes correctly. Bug reported by Brian.
853
863
854 * scripts/ipython: remove the very first entry in sys.path which
864 * scripts/ipython: remove the very first entry in sys.path which
855 Python auto-inserts for scripts, so that sys.path under IPython is
865 Python auto-inserts for scripts, so that sys.path under IPython is
856 as similar as possible to that under plain Python.
866 as similar as possible to that under plain Python.
857
867
858 * IPython/completer.py (IPCompleter.file_matches): Fix
868 * IPython/completer.py (IPCompleter.file_matches): Fix
859 tab-completion so that quotes are not closed unless the completion
869 tab-completion so that quotes are not closed unless the completion
860 is unambiguous. After a request by Stefan. Minor cleanups in
870 is unambiguous. After a request by Stefan. Minor cleanups in
861 ipy_stock_completers.
871 ipy_stock_completers.
862
872
863 2006-11-02 Ville Vainio <vivainio@gmail.com>
873 2006-11-02 Ville Vainio <vivainio@gmail.com>
864
874
865 * ipy_stock_completers.py: Add %run and %cd completers.
875 * ipy_stock_completers.py: Add %run and %cd completers.
866
876
867 * completer.py: Try running custom completer for both
877 * completer.py: Try running custom completer for both
868 "foo" and "%foo" if the command is just "foo". Ignore case
878 "foo" and "%foo" if the command is just "foo". Ignore case
869 when filtering possible completions.
879 when filtering possible completions.
870
880
871 * UserConfig/ipy_user_conf.py: install stock completers as default
881 * UserConfig/ipy_user_conf.py: install stock completers as default
872
882
873 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
883 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
874 simplified readline history save / restore through a wrapper
884 simplified readline history save / restore through a wrapper
875 function
885 function
876
886
877
887
878 2006-10-31 Ville Vainio <vivainio@gmail.com>
888 2006-10-31 Ville Vainio <vivainio@gmail.com>
879
889
880 * strdispatch.py, completer.py, ipy_stock_completers.py:
890 * strdispatch.py, completer.py, ipy_stock_completers.py:
881 Allow str_key ("command") in completer hooks. Implement
891 Allow str_key ("command") in completer hooks. Implement
882 trivial completer for 'import' (stdlib modules only). Rename
892 trivial completer for 'import' (stdlib modules only). Rename
883 ipy_linux_package_managers.py to ipy_stock_completers.py.
893 ipy_linux_package_managers.py to ipy_stock_completers.py.
884 SVN completer.
894 SVN completer.
885
895
886 * Extensions/ledit.py: %magic line editor for easily and
896 * Extensions/ledit.py: %magic line editor for easily and
887 incrementally manipulating lists of strings. The magic command
897 incrementally manipulating lists of strings. The magic command
888 name is %led.
898 name is %led.
889
899
890 2006-10-30 Ville Vainio <vivainio@gmail.com>
900 2006-10-30 Ville Vainio <vivainio@gmail.com>
891
901
892 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
902 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
893 Bernsteins's patches for pydb integration.
903 Bernsteins's patches for pydb integration.
894 http://bashdb.sourceforge.net/pydb/
904 http://bashdb.sourceforge.net/pydb/
895
905
896 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
906 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
897 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
907 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
898 custom completer hook to allow the users to implement their own
908 custom completer hook to allow the users to implement their own
899 completers. See ipy_linux_package_managers.py for example. The
909 completers. See ipy_linux_package_managers.py for example. The
900 hook name is 'complete_command'.
910 hook name is 'complete_command'.
901
911
902 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
912 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
903
913
904 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
914 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
905 Numeric leftovers.
915 Numeric leftovers.
906
916
907 * ipython.el (py-execute-region): apply Stefan's patch to fix
917 * ipython.el (py-execute-region): apply Stefan's patch to fix
908 garbled results if the python shell hasn't been previously started.
918 garbled results if the python shell hasn't been previously started.
909
919
910 * IPython/genutils.py (arg_split): moved to genutils, since it's a
920 * IPython/genutils.py (arg_split): moved to genutils, since it's a
911 pretty generic function and useful for other things.
921 pretty generic function and useful for other things.
912
922
913 * IPython/OInspect.py (getsource): Add customizable source
923 * IPython/OInspect.py (getsource): Add customizable source
914 extractor. After a request/patch form W. Stein (SAGE).
924 extractor. After a request/patch form W. Stein (SAGE).
915
925
916 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
926 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
917 window size to a more reasonable value from what pexpect does,
927 window size to a more reasonable value from what pexpect does,
918 since their choice causes wrapping bugs with long input lines.
928 since their choice causes wrapping bugs with long input lines.
919
929
920 2006-10-28 Ville Vainio <vivainio@gmail.com>
930 2006-10-28 Ville Vainio <vivainio@gmail.com>
921
931
922 * Magic.py (%run): Save and restore the readline history from
932 * Magic.py (%run): Save and restore the readline history from
923 file around %run commands to prevent side effects from
933 file around %run commands to prevent side effects from
924 %runned programs that might use readline (e.g. pydb).
934 %runned programs that might use readline (e.g. pydb).
925
935
926 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
936 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
927 invoking the pydb enhanced debugger.
937 invoking the pydb enhanced debugger.
928
938
929 2006-10-23 Walter Doerwald <walter@livinglogic.de>
939 2006-10-23 Walter Doerwald <walter@livinglogic.de>
930
940
931 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
941 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
932 call the base class method and propagate the return value to
942 call the base class method and propagate the return value to
933 ifile. This is now done by path itself.
943 ifile. This is now done by path itself.
934
944
935 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
945 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
936
946
937 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
947 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
938 api: set_crash_handler(), to expose the ability to change the
948 api: set_crash_handler(), to expose the ability to change the
939 internal crash handler.
949 internal crash handler.
940
950
941 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
951 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
942 the various parameters of the crash handler so that apps using
952 the various parameters of the crash handler so that apps using
943 IPython as their engine can customize crash handling. Ipmlemented
953 IPython as their engine can customize crash handling. Ipmlemented
944 at the request of SAGE.
954 at the request of SAGE.
945
955
946 2006-10-14 Ville Vainio <vivainio@gmail.com>
956 2006-10-14 Ville Vainio <vivainio@gmail.com>
947
957
948 * Magic.py, ipython.el: applied first "safe" part of Rocky
958 * Magic.py, ipython.el: applied first "safe" part of Rocky
949 Bernstein's patch set for pydb integration.
959 Bernstein's patch set for pydb integration.
950
960
951 * Magic.py (%unalias, %alias): %store'd aliases can now be
961 * Magic.py (%unalias, %alias): %store'd aliases can now be
952 removed with '%unalias'. %alias w/o args now shows most
962 removed with '%unalias'. %alias w/o args now shows most
953 interesting (stored / manually defined) aliases last
963 interesting (stored / manually defined) aliases last
954 where they catch the eye w/o scrolling.
964 where they catch the eye w/o scrolling.
955
965
956 * Magic.py (%rehashx), ext_rehashdir.py: files with
966 * Magic.py (%rehashx), ext_rehashdir.py: files with
957 'py' extension are always considered executable, even
967 'py' extension are always considered executable, even
958 when not in PATHEXT environment variable.
968 when not in PATHEXT environment variable.
959
969
960 2006-10-12 Ville Vainio <vivainio@gmail.com>
970 2006-10-12 Ville Vainio <vivainio@gmail.com>
961
971
962 * jobctrl.py: Add new "jobctrl" extension for spawning background
972 * jobctrl.py: Add new "jobctrl" extension for spawning background
963 processes with "&find /". 'import jobctrl' to try it out. Requires
973 processes with "&find /". 'import jobctrl' to try it out. Requires
964 'subprocess' module, standard in python 2.4+.
974 'subprocess' module, standard in python 2.4+.
965
975
966 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
976 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
967 so if foo -> bar and bar -> baz, then foo -> baz.
977 so if foo -> bar and bar -> baz, then foo -> baz.
968
978
969 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
979 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
970
980
971 * IPython/Magic.py (Magic.parse_options): add a new posix option
981 * IPython/Magic.py (Magic.parse_options): add a new posix option
972 to allow parsing of input args in magics that doesn't strip quotes
982 to allow parsing of input args in magics that doesn't strip quotes
973 (if posix=False). This also closes %timeit bug reported by
983 (if posix=False). This also closes %timeit bug reported by
974 Stefan.
984 Stefan.
975
985
976 2006-10-03 Ville Vainio <vivainio@gmail.com>
986 2006-10-03 Ville Vainio <vivainio@gmail.com>
977
987
978 * iplib.py (raw_input, interact): Return ValueError catching for
988 * iplib.py (raw_input, interact): Return ValueError catching for
979 raw_input. Fixes infinite loop for sys.stdin.close() or
989 raw_input. Fixes infinite loop for sys.stdin.close() or
980 sys.stdout.close().
990 sys.stdout.close().
981
991
982 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
992 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
983
993
984 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
994 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
985 to help in handling doctests. irunner is now pretty useful for
995 to help in handling doctests. irunner is now pretty useful for
986 running standalone scripts and simulate a full interactive session
996 running standalone scripts and simulate a full interactive session
987 in a format that can be then pasted as a doctest.
997 in a format that can be then pasted as a doctest.
988
998
989 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
999 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
990 on top of the default (useless) ones. This also fixes the nasty
1000 on top of the default (useless) ones. This also fixes the nasty
991 way in which 2.5's Quitter() exits (reverted [1785]).
1001 way in which 2.5's Quitter() exits (reverted [1785]).
992
1002
993 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1003 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
994 2.5.
1004 2.5.
995
1005
996 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1006 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
997 color scheme is updated as well when color scheme is changed
1007 color scheme is updated as well when color scheme is changed
998 interactively.
1008 interactively.
999
1009
1000 2006-09-27 Ville Vainio <vivainio@gmail.com>
1010 2006-09-27 Ville Vainio <vivainio@gmail.com>
1001
1011
1002 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1012 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1003 infinite loop and just exit. It's a hack, but will do for a while.
1013 infinite loop and just exit. It's a hack, but will do for a while.
1004
1014
1005 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1015 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1006
1016
1007 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1017 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1008 the constructor, this makes it possible to get a list of only directories
1018 the constructor, this makes it possible to get a list of only directories
1009 or only files.
1019 or only files.
1010
1020
1011 2006-08-12 Ville Vainio <vivainio@gmail.com>
1021 2006-08-12 Ville Vainio <vivainio@gmail.com>
1012
1022
1013 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1023 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1014 they broke unittest
1024 they broke unittest
1015
1025
1016 2006-08-11 Ville Vainio <vivainio@gmail.com>
1026 2006-08-11 Ville Vainio <vivainio@gmail.com>
1017
1027
1018 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1028 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1019 by resolving issue properly, i.e. by inheriting FakeModule
1029 by resolving issue properly, i.e. by inheriting FakeModule
1020 from types.ModuleType. Pickling ipython interactive data
1030 from types.ModuleType. Pickling ipython interactive data
1021 should still work as usual (testing appreciated).
1031 should still work as usual (testing appreciated).
1022
1032
1023 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1033 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1024
1034
1025 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1035 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1026 running under python 2.3 with code from 2.4 to fix a bug with
1036 running under python 2.3 with code from 2.4 to fix a bug with
1027 help(). Reported by the Debian maintainers, Norbert Tretkowski
1037 help(). Reported by the Debian maintainers, Norbert Tretkowski
1028 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1038 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1029 <afayolle-AT-debian.org>.
1039 <afayolle-AT-debian.org>.
1030
1040
1031 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1041 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1032
1042
1033 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1043 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1034 (which was displaying "quit" twice).
1044 (which was displaying "quit" twice).
1035
1045
1036 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1046 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1037
1047
1038 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1048 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1039 the mode argument).
1049 the mode argument).
1040
1050
1041 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1051 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1042
1052
1043 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1053 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1044 not running under IPython.
1054 not running under IPython.
1045
1055
1046 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1056 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1047 and make it iterable (iterating over the attribute itself). Add two new
1057 and make it iterable (iterating over the attribute itself). Add two new
1048 magic strings for __xattrs__(): If the string starts with "-", the attribute
1058 magic strings for __xattrs__(): If the string starts with "-", the attribute
1049 will not be displayed in ibrowse's detail view (but it can still be
1059 will not be displayed in ibrowse's detail view (but it can still be
1050 iterated over). This makes it possible to add attributes that are large
1060 iterated over). This makes it possible to add attributes that are large
1051 lists or generator methods to the detail view. Replace magic attribute names
1061 lists or generator methods to the detail view. Replace magic attribute names
1052 and _attrname() and _getattr() with "descriptors": For each type of magic
1062 and _attrname() and _getattr() with "descriptors": For each type of magic
1053 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1063 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1054 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1064 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1055 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1065 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1056 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1066 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1057 are still supported.
1067 are still supported.
1058
1068
1059 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1069 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1060 fails in ibrowse.fetch(), the exception object is added as the last item
1070 fails in ibrowse.fetch(), the exception object is added as the last item
1061 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1071 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1062 a generator throws an exception midway through execution.
1072 a generator throws an exception midway through execution.
1063
1073
1064 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1074 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1065 encoding into methods.
1075 encoding into methods.
1066
1076
1067 2006-07-26 Ville Vainio <vivainio@gmail.com>
1077 2006-07-26 Ville Vainio <vivainio@gmail.com>
1068
1078
1069 * iplib.py: history now stores multiline input as single
1079 * iplib.py: history now stores multiline input as single
1070 history entries. Patch by Jorgen Cederlof.
1080 history entries. Patch by Jorgen Cederlof.
1071
1081
1072 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1082 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1073
1083
1074 * IPython/Extensions/ibrowse.py: Make cursor visible over
1084 * IPython/Extensions/ibrowse.py: Make cursor visible over
1075 non existing attributes.
1085 non existing attributes.
1076
1086
1077 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1087 2006-07-14 Walter Doerwald <walter@livinglogic.de>
1078
1088
1079 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1089 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
1080 error output of the running command doesn't mess up the screen.
1090 error output of the running command doesn't mess up the screen.
1081
1091
1082 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1092 2006-07-13 Walter Doerwald <walter@livinglogic.de>
1083
1093
1084 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1094 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1085 argument. This sorts the items themselves.
1095 argument. This sorts the items themselves.
1086
1096
1087 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1097 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1088
1098
1089 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1099 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1090 Compile expression strings into code objects. This should speed
1100 Compile expression strings into code objects. This should speed
1091 up ifilter and friends somewhat.
1101 up ifilter and friends somewhat.
1092
1102
1093 2006-07-08 Ville Vainio <vivainio@gmail.com>
1103 2006-07-08 Ville Vainio <vivainio@gmail.com>
1094
1104
1095 * Magic.py: %cpaste now strips > from the beginning of lines
1105 * Magic.py: %cpaste now strips > from the beginning of lines
1096 to ease pasting quoted code from emails. Contributed by
1106 to ease pasting quoted code from emails. Contributed by
1097 Stefan van der Walt.
1107 Stefan van der Walt.
1098
1108
1099 2006-06-29 Ville Vainio <vivainio@gmail.com>
1109 2006-06-29 Ville Vainio <vivainio@gmail.com>
1100
1110
1101 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1111 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1102 mode, patch contributed by Darren Dale. NEEDS TESTING!
1112 mode, patch contributed by Darren Dale. NEEDS TESTING!
1103
1113
1104 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1114 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1105
1115
1106 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1116 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1107 a blue background. Fix fetching new display rows when the browser
1117 a blue background. Fix fetching new display rows when the browser
1108 scrolls more than a screenful (e.g. by using the goto command).
1118 scrolls more than a screenful (e.g. by using the goto command).
1109
1119
1110 2006-06-27 Ville Vainio <vivainio@gmail.com>
1120 2006-06-27 Ville Vainio <vivainio@gmail.com>
1111
1121
1112 * Magic.py (_inspect, _ofind) Apply David Huard's
1122 * Magic.py (_inspect, _ofind) Apply David Huard's
1113 patch for displaying the correct docstring for 'property'
1123 patch for displaying the correct docstring for 'property'
1114 attributes.
1124 attributes.
1115
1125
1116 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1126 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1117
1127
1118 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1128 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1119 commands into the methods implementing them.
1129 commands into the methods implementing them.
1120
1130
1121 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1131 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1122
1132
1123 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1133 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1124 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1134 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1125 autoindent support was authored by Jin Liu.
1135 autoindent support was authored by Jin Liu.
1126
1136
1127 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1137 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1128
1138
1129 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1139 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1130 for keymaps with a custom class that simplifies handling.
1140 for keymaps with a custom class that simplifies handling.
1131
1141
1132 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1142 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1133
1143
1134 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1144 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1135 resizing. This requires Python 2.5 to work.
1145 resizing. This requires Python 2.5 to work.
1136
1146
1137 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1147 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1138
1148
1139 * IPython/Extensions/ibrowse.py: Add two new commands to
1149 * IPython/Extensions/ibrowse.py: Add two new commands to
1140 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1150 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1141 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1151 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1142 attributes again. Remapped the help command to "?". Display
1152 attributes again. Remapped the help command to "?". Display
1143 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1153 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1144 as keys for the "home" and "end" commands. Add three new commands
1154 as keys for the "home" and "end" commands. Add three new commands
1145 to the input mode for "find" and friends: "delend" (CTRL-K)
1155 to the input mode for "find" and friends: "delend" (CTRL-K)
1146 deletes to the end of line. "incsearchup" searches upwards in the
1156 deletes to the end of line. "incsearchup" searches upwards in the
1147 command history for an input that starts with the text before the cursor.
1157 command history for an input that starts with the text before the cursor.
1148 "incsearchdown" does the same downwards. Removed a bogus mapping of
1158 "incsearchdown" does the same downwards. Removed a bogus mapping of
1149 the x key to "delete".
1159 the x key to "delete".
1150
1160
1151 2006-06-15 Ville Vainio <vivainio@gmail.com>
1161 2006-06-15 Ville Vainio <vivainio@gmail.com>
1152
1162
1153 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1163 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1154 used to create prompts dynamically, instead of the "old" way of
1164 used to create prompts dynamically, instead of the "old" way of
1155 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1165 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1156 way still works (it's invoked by the default hook), of course.
1166 way still works (it's invoked by the default hook), of course.
1157
1167
1158 * Prompts.py: added generate_output_prompt hook for altering output
1168 * Prompts.py: added generate_output_prompt hook for altering output
1159 prompt
1169 prompt
1160
1170
1161 * Release.py: Changed version string to 0.7.3.svn.
1171 * Release.py: Changed version string to 0.7.3.svn.
1162
1172
1163 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1173 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1164
1174
1165 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1175 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1166 the call to fetch() always tries to fetch enough data for at least one
1176 the call to fetch() always tries to fetch enough data for at least one
1167 full screen. This makes it possible to simply call moveto(0,0,True) in
1177 full screen. This makes it possible to simply call moveto(0,0,True) in
1168 the constructor. Fix typos and removed the obsolete goto attribute.
1178 the constructor. Fix typos and removed the obsolete goto attribute.
1169
1179
1170 2006-06-12 Ville Vainio <vivainio@gmail.com>
1180 2006-06-12 Ville Vainio <vivainio@gmail.com>
1171
1181
1172 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1182 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1173 allowing $variable interpolation within multiline statements,
1183 allowing $variable interpolation within multiline statements,
1174 though so far only with "sh" profile for a testing period.
1184 though so far only with "sh" profile for a testing period.
1175 The patch also enables splitting long commands with \ but it
1185 The patch also enables splitting long commands with \ but it
1176 doesn't work properly yet.
1186 doesn't work properly yet.
1177
1187
1178 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1188 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1179
1189
1180 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1190 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1181 input history and the position of the cursor in the input history for
1191 input history and the position of the cursor in the input history for
1182 the find, findbackwards and goto command.
1192 the find, findbackwards and goto command.
1183
1193
1184 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1194 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1185
1195
1186 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1196 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1187 implements the basic functionality of browser commands that require
1197 implements the basic functionality of browser commands that require
1188 input. Reimplement the goto, find and findbackwards commands as
1198 input. Reimplement the goto, find and findbackwards commands as
1189 subclasses of _CommandInput. Add an input history and keymaps to those
1199 subclasses of _CommandInput. Add an input history and keymaps to those
1190 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1200 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1191 execute commands.
1201 execute commands.
1192
1202
1193 2006-06-07 Ville Vainio <vivainio@gmail.com>
1203 2006-06-07 Ville Vainio <vivainio@gmail.com>
1194
1204
1195 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1205 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1196 running the batch files instead of leaving the session open.
1206 running the batch files instead of leaving the session open.
1197
1207
1198 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1208 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1199
1209
1200 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1210 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1201 the original fix was incomplete. Patch submitted by W. Maier.
1211 the original fix was incomplete. Patch submitted by W. Maier.
1202
1212
1203 2006-06-07 Ville Vainio <vivainio@gmail.com>
1213 2006-06-07 Ville Vainio <vivainio@gmail.com>
1204
1214
1205 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1215 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1206 Confirmation prompts can be supressed by 'quiet' option.
1216 Confirmation prompts can be supressed by 'quiet' option.
1207 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1217 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1208
1218
1209 2006-06-06 *** Released version 0.7.2
1219 2006-06-06 *** Released version 0.7.2
1210
1220
1211 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1221 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1212
1222
1213 * IPython/Release.py (version): Made 0.7.2 final for release.
1223 * IPython/Release.py (version): Made 0.7.2 final for release.
1214 Repo tagged and release cut.
1224 Repo tagged and release cut.
1215
1225
1216 2006-06-05 Ville Vainio <vivainio@gmail.com>
1226 2006-06-05 Ville Vainio <vivainio@gmail.com>
1217
1227
1218 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1228 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1219 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1229 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1220
1230
1221 * upgrade_dir.py: try import 'path' module a bit harder
1231 * upgrade_dir.py: try import 'path' module a bit harder
1222 (for %upgrade)
1232 (for %upgrade)
1223
1233
1224 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1234 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1225
1235
1226 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1236 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1227 instead of looping 20 times.
1237 instead of looping 20 times.
1228
1238
1229 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1239 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1230 correctly at initialization time. Bug reported by Krishna Mohan
1240 correctly at initialization time. Bug reported by Krishna Mohan
1231 Gundu <gkmohan-AT-gmail.com> on the user list.
1241 Gundu <gkmohan-AT-gmail.com> on the user list.
1232
1242
1233 * IPython/Release.py (version): Mark 0.7.2 version to start
1243 * IPython/Release.py (version): Mark 0.7.2 version to start
1234 testing for release on 06/06.
1244 testing for release on 06/06.
1235
1245
1236 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1246 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1237
1247
1238 * scripts/irunner: thin script interface so users don't have to
1248 * scripts/irunner: thin script interface so users don't have to
1239 find the module and call it as an executable, since modules rarely
1249 find the module and call it as an executable, since modules rarely
1240 live in people's PATH.
1250 live in people's PATH.
1241
1251
1242 * IPython/irunner.py (InteractiveRunner.__init__): added
1252 * IPython/irunner.py (InteractiveRunner.__init__): added
1243 delaybeforesend attribute to control delays with newer versions of
1253 delaybeforesend attribute to control delays with newer versions of
1244 pexpect. Thanks to detailed help from pexpect's author, Noah
1254 pexpect. Thanks to detailed help from pexpect's author, Noah
1245 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1255 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1246 correctly (it works in NoColor mode).
1256 correctly (it works in NoColor mode).
1247
1257
1248 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1258 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1249 SAGE list, from improper log() calls.
1259 SAGE list, from improper log() calls.
1250
1260
1251 2006-05-31 Ville Vainio <vivainio@gmail.com>
1261 2006-05-31 Ville Vainio <vivainio@gmail.com>
1252
1262
1253 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1263 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1254 with args in parens to work correctly with dirs that have spaces.
1264 with args in parens to work correctly with dirs that have spaces.
1255
1265
1256 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1266 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1257
1267
1258 * IPython/Logger.py (Logger.logstart): add option to log raw input
1268 * IPython/Logger.py (Logger.logstart): add option to log raw input
1259 instead of the processed one. A -r flag was added to the
1269 instead of the processed one. A -r flag was added to the
1260 %logstart magic used for controlling logging.
1270 %logstart magic used for controlling logging.
1261
1271
1262 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1272 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1263
1273
1264 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1274 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1265 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1275 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1266 recognize the option. After a bug report by Will Maier. This
1276 recognize the option. After a bug report by Will Maier. This
1267 closes #64 (will do it after confirmation from W. Maier).
1277 closes #64 (will do it after confirmation from W. Maier).
1268
1278
1269 * IPython/irunner.py: New module to run scripts as if manually
1279 * IPython/irunner.py: New module to run scripts as if manually
1270 typed into an interactive environment, based on pexpect. After a
1280 typed into an interactive environment, based on pexpect. After a
1271 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1281 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1272 ipython-user list. Simple unittests in the tests/ directory.
1282 ipython-user list. Simple unittests in the tests/ directory.
1273
1283
1274 * tools/release: add Will Maier, OpenBSD port maintainer, to
1284 * tools/release: add Will Maier, OpenBSD port maintainer, to
1275 recepients list. We are now officially part of the OpenBSD ports:
1285 recepients list. We are now officially part of the OpenBSD ports:
1276 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1286 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1277 work.
1287 work.
1278
1288
1279 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1289 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1280
1290
1281 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1291 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1282 so that it doesn't break tkinter apps.
1292 so that it doesn't break tkinter apps.
1283
1293
1284 * IPython/iplib.py (_prefilter): fix bug where aliases would
1294 * IPython/iplib.py (_prefilter): fix bug where aliases would
1285 shadow variables when autocall was fully off. Reported by SAGE
1295 shadow variables when autocall was fully off. Reported by SAGE
1286 author William Stein.
1296 author William Stein.
1287
1297
1288 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1298 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1289 at what detail level strings are computed when foo? is requested.
1299 at what detail level strings are computed when foo? is requested.
1290 This allows users to ask for example that the string form of an
1300 This allows users to ask for example that the string form of an
1291 object is only computed when foo?? is called, or even never, by
1301 object is only computed when foo?? is called, or even never, by
1292 setting the object_info_string_level >= 2 in the configuration
1302 setting the object_info_string_level >= 2 in the configuration
1293 file. This new option has been added and documented. After a
1303 file. This new option has been added and documented. After a
1294 request by SAGE to be able to control the printing of very large
1304 request by SAGE to be able to control the printing of very large
1295 objects more easily.
1305 objects more easily.
1296
1306
1297 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1307 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1298
1308
1299 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1309 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1300 from sys.argv, to be 100% consistent with how Python itself works
1310 from sys.argv, to be 100% consistent with how Python itself works
1301 (as seen for example with python -i file.py). After a bug report
1311 (as seen for example with python -i file.py). After a bug report
1302 by Jeffrey Collins.
1312 by Jeffrey Collins.
1303
1313
1304 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1314 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1305 nasty bug which was preventing custom namespaces with -pylab,
1315 nasty bug which was preventing custom namespaces with -pylab,
1306 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1316 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1307 compatibility (long gone from mpl).
1317 compatibility (long gone from mpl).
1308
1318
1309 * IPython/ipapi.py (make_session): name change: create->make. We
1319 * IPython/ipapi.py (make_session): name change: create->make. We
1310 use make in other places (ipmaker,...), it's shorter and easier to
1320 use make in other places (ipmaker,...), it's shorter and easier to
1311 type and say, etc. I'm trying to clean things before 0.7.2 so
1321 type and say, etc. I'm trying to clean things before 0.7.2 so
1312 that I can keep things stable wrt to ipapi in the chainsaw branch.
1322 that I can keep things stable wrt to ipapi in the chainsaw branch.
1313
1323
1314 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1324 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1315 python-mode recognizes our debugger mode. Add support for
1325 python-mode recognizes our debugger mode. Add support for
1316 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1326 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1317 <m.liu.jin-AT-gmail.com> originally written by
1327 <m.liu.jin-AT-gmail.com> originally written by
1318 doxgen-AT-newsmth.net (with minor modifications for xemacs
1328 doxgen-AT-newsmth.net (with minor modifications for xemacs
1319 compatibility)
1329 compatibility)
1320
1330
1321 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1331 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1322 tracebacks when walking the stack so that the stack tracking system
1332 tracebacks when walking the stack so that the stack tracking system
1323 in emacs' python-mode can identify the frames correctly.
1333 in emacs' python-mode can identify the frames correctly.
1324
1334
1325 * IPython/ipmaker.py (make_IPython): make the internal (and
1335 * IPython/ipmaker.py (make_IPython): make the internal (and
1326 default config) autoedit_syntax value false by default. Too many
1336 default config) autoedit_syntax value false by default. Too many
1327 users have complained to me (both on and off-list) about problems
1337 users have complained to me (both on and off-list) about problems
1328 with this option being on by default, so I'm making it default to
1338 with this option being on by default, so I'm making it default to
1329 off. It can still be enabled by anyone via the usual mechanisms.
1339 off. It can still be enabled by anyone via the usual mechanisms.
1330
1340
1331 * IPython/completer.py (Completer.attr_matches): add support for
1341 * IPython/completer.py (Completer.attr_matches): add support for
1332 PyCrust-style _getAttributeNames magic method. Patch contributed
1342 PyCrust-style _getAttributeNames magic method. Patch contributed
1333 by <mscott-AT-goldenspud.com>. Closes #50.
1343 by <mscott-AT-goldenspud.com>. Closes #50.
1334
1344
1335 * IPython/iplib.py (InteractiveShell.__init__): remove the
1345 * IPython/iplib.py (InteractiveShell.__init__): remove the
1336 deletion of exit/quit from __builtin__, which can break
1346 deletion of exit/quit from __builtin__, which can break
1337 third-party tools like the Zope debugging console. The
1347 third-party tools like the Zope debugging console. The
1338 %exit/%quit magics remain. In general, it's probably a good idea
1348 %exit/%quit magics remain. In general, it's probably a good idea
1339 not to delete anything from __builtin__, since we never know what
1349 not to delete anything from __builtin__, since we never know what
1340 that will break. In any case, python now (for 2.5) will support
1350 that will break. In any case, python now (for 2.5) will support
1341 'real' exit/quit, so this issue is moot. Closes #55.
1351 'real' exit/quit, so this issue is moot. Closes #55.
1342
1352
1343 * IPython/genutils.py (with_obj): rename the 'with' function to
1353 * IPython/genutils.py (with_obj): rename the 'with' function to
1344 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1354 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1345 becomes a language keyword. Closes #53.
1355 becomes a language keyword. Closes #53.
1346
1356
1347 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1357 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1348 __file__ attribute to this so it fools more things into thinking
1358 __file__ attribute to this so it fools more things into thinking
1349 it is a real module. Closes #59.
1359 it is a real module. Closes #59.
1350
1360
1351 * IPython/Magic.py (magic_edit): add -n option to open the editor
1361 * IPython/Magic.py (magic_edit): add -n option to open the editor
1352 at a specific line number. After a patch by Stefan van der Walt.
1362 at a specific line number. After a patch by Stefan van der Walt.
1353
1363
1354 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1364 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1355
1365
1356 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1366 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1357 reason the file could not be opened. After automatic crash
1367 reason the file could not be opened. After automatic crash
1358 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1368 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1359 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1369 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1360 (_should_recompile): Don't fire editor if using %bg, since there
1370 (_should_recompile): Don't fire editor if using %bg, since there
1361 is no file in the first place. From the same report as above.
1371 is no file in the first place. From the same report as above.
1362 (raw_input): protect against faulty third-party prefilters. After
1372 (raw_input): protect against faulty third-party prefilters. After
1363 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1373 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1364 while running under SAGE.
1374 while running under SAGE.
1365
1375
1366 2006-05-23 Ville Vainio <vivainio@gmail.com>
1376 2006-05-23 Ville Vainio <vivainio@gmail.com>
1367
1377
1368 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1378 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1369 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1379 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1370 now returns None (again), unless dummy is specifically allowed by
1380 now returns None (again), unless dummy is specifically allowed by
1371 ipapi.get(allow_dummy=True).
1381 ipapi.get(allow_dummy=True).
1372
1382
1373 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1383 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1374
1384
1375 * IPython: remove all 2.2-compatibility objects and hacks from
1385 * IPython: remove all 2.2-compatibility objects and hacks from
1376 everywhere, since we only support 2.3 at this point. Docs
1386 everywhere, since we only support 2.3 at this point. Docs
1377 updated.
1387 updated.
1378
1388
1379 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1389 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1380 Anything requiring extra validation can be turned into a Python
1390 Anything requiring extra validation can be turned into a Python
1381 property in the future. I used a property for the db one b/c
1391 property in the future. I used a property for the db one b/c
1382 there was a nasty circularity problem with the initialization
1392 there was a nasty circularity problem with the initialization
1383 order, which right now I don't have time to clean up.
1393 order, which right now I don't have time to clean up.
1384
1394
1385 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1395 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1386 another locking bug reported by Jorgen. I'm not 100% sure though,
1396 another locking bug reported by Jorgen. I'm not 100% sure though,
1387 so more testing is needed...
1397 so more testing is needed...
1388
1398
1389 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1399 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1390
1400
1391 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1401 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1392 local variables from any routine in user code (typically executed
1402 local variables from any routine in user code (typically executed
1393 with %run) directly into the interactive namespace. Very useful
1403 with %run) directly into the interactive namespace. Very useful
1394 when doing complex debugging.
1404 when doing complex debugging.
1395 (IPythonNotRunning): Changed the default None object to a dummy
1405 (IPythonNotRunning): Changed the default None object to a dummy
1396 whose attributes can be queried as well as called without
1406 whose attributes can be queried as well as called without
1397 exploding, to ease writing code which works transparently both in
1407 exploding, to ease writing code which works transparently both in
1398 and out of ipython and uses some of this API.
1408 and out of ipython and uses some of this API.
1399
1409
1400 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1410 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1401
1411
1402 * IPython/hooks.py (result_display): Fix the fact that our display
1412 * IPython/hooks.py (result_display): Fix the fact that our display
1403 hook was using str() instead of repr(), as the default python
1413 hook was using str() instead of repr(), as the default python
1404 console does. This had gone unnoticed b/c it only happened if
1414 console does. This had gone unnoticed b/c it only happened if
1405 %Pprint was off, but the inconsistency was there.
1415 %Pprint was off, but the inconsistency was there.
1406
1416
1407 2006-05-15 Ville Vainio <vivainio@gmail.com>
1417 2006-05-15 Ville Vainio <vivainio@gmail.com>
1408
1418
1409 * Oinspect.py: Only show docstring for nonexisting/binary files
1419 * Oinspect.py: Only show docstring for nonexisting/binary files
1410 when doing object??, closing ticket #62
1420 when doing object??, closing ticket #62
1411
1421
1412 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1422 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1413
1423
1414 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1424 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1415 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1425 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1416 was being released in a routine which hadn't checked if it had
1426 was being released in a routine which hadn't checked if it had
1417 been the one to acquire it.
1427 been the one to acquire it.
1418
1428
1419 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1429 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1420
1430
1421 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1431 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1422
1432
1423 2006-04-11 Ville Vainio <vivainio@gmail.com>
1433 2006-04-11 Ville Vainio <vivainio@gmail.com>
1424
1434
1425 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1435 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1426 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1436 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1427 prefilters, allowing stuff like magics and aliases in the file.
1437 prefilters, allowing stuff like magics and aliases in the file.
1428
1438
1429 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1439 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1430 added. Supported now are "%clear in" and "%clear out" (clear input and
1440 added. Supported now are "%clear in" and "%clear out" (clear input and
1431 output history, respectively). Also fixed CachedOutput.flush to
1441 output history, respectively). Also fixed CachedOutput.flush to
1432 properly flush the output cache.
1442 properly flush the output cache.
1433
1443
1434 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1444 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1435 half-success (and fail explicitly).
1445 half-success (and fail explicitly).
1436
1446
1437 2006-03-28 Ville Vainio <vivainio@gmail.com>
1447 2006-03-28 Ville Vainio <vivainio@gmail.com>
1438
1448
1439 * iplib.py: Fix quoting of aliases so that only argless ones
1449 * iplib.py: Fix quoting of aliases so that only argless ones
1440 are quoted
1450 are quoted
1441
1451
1442 2006-03-28 Ville Vainio <vivainio@gmail.com>
1452 2006-03-28 Ville Vainio <vivainio@gmail.com>
1443
1453
1444 * iplib.py: Quote aliases with spaces in the name.
1454 * iplib.py: Quote aliases with spaces in the name.
1445 "c:\program files\blah\bin" is now legal alias target.
1455 "c:\program files\blah\bin" is now legal alias target.
1446
1456
1447 * ext_rehashdir.py: Space no longer allowed as arg
1457 * ext_rehashdir.py: Space no longer allowed as arg
1448 separator, since space is legal in path names.
1458 separator, since space is legal in path names.
1449
1459
1450 2006-03-16 Ville Vainio <vivainio@gmail.com>
1460 2006-03-16 Ville Vainio <vivainio@gmail.com>
1451
1461
1452 * upgrade_dir.py: Take path.py from Extensions, correcting
1462 * upgrade_dir.py: Take path.py from Extensions, correcting
1453 %upgrade magic
1463 %upgrade magic
1454
1464
1455 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1465 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1456
1466
1457 * hooks.py: Only enclose editor binary in quotes if legal and
1467 * hooks.py: Only enclose editor binary in quotes if legal and
1458 necessary (space in the name, and is an existing file). Fixes a bug
1468 necessary (space in the name, and is an existing file). Fixes a bug
1459 reported by Zachary Pincus.
1469 reported by Zachary Pincus.
1460
1470
1461 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1471 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1462
1472
1463 * Manual: thanks to a tip on proper color handling for Emacs, by
1473 * Manual: thanks to a tip on proper color handling for Emacs, by
1464 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1474 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1465
1475
1466 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1476 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1467 by applying the provided patch. Thanks to Liu Jin
1477 by applying the provided patch. Thanks to Liu Jin
1468 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1478 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1469 XEmacs/Linux, I'm trusting the submitter that it actually helps
1479 XEmacs/Linux, I'm trusting the submitter that it actually helps
1470 under win32/GNU Emacs. Will revisit if any problems are reported.
1480 under win32/GNU Emacs. Will revisit if any problems are reported.
1471
1481
1472 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1482 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1473
1483
1474 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1484 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1475 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1485 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1476
1486
1477 2006-03-12 Ville Vainio <vivainio@gmail.com>
1487 2006-03-12 Ville Vainio <vivainio@gmail.com>
1478
1488
1479 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1489 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1480 Torsten Marek.
1490 Torsten Marek.
1481
1491
1482 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1492 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1483
1493
1484 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1494 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1485 line ranges works again.
1495 line ranges works again.
1486
1496
1487 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1497 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1488
1498
1489 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1499 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1490 and friends, after a discussion with Zach Pincus on ipython-user.
1500 and friends, after a discussion with Zach Pincus on ipython-user.
1491 I'm not 100% sure, but after thinking about it quite a bit, it may
1501 I'm not 100% sure, but after thinking about it quite a bit, it may
1492 be OK. Testing with the multithreaded shells didn't reveal any
1502 be OK. Testing with the multithreaded shells didn't reveal any
1493 problems, but let's keep an eye out.
1503 problems, but let's keep an eye out.
1494
1504
1495 In the process, I fixed a few things which were calling
1505 In the process, I fixed a few things which were calling
1496 self.InteractiveTB() directly (like safe_execfile), which is a
1506 self.InteractiveTB() directly (like safe_execfile), which is a
1497 mistake: ALL exception reporting should be done by calling
1507 mistake: ALL exception reporting should be done by calling
1498 self.showtraceback(), which handles state and tab-completion and
1508 self.showtraceback(), which handles state and tab-completion and
1499 more.
1509 more.
1500
1510
1501 2006-03-01 Ville Vainio <vivainio@gmail.com>
1511 2006-03-01 Ville Vainio <vivainio@gmail.com>
1502
1512
1503 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1513 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1504 To use, do "from ipipe import *".
1514 To use, do "from ipipe import *".
1505
1515
1506 2006-02-24 Ville Vainio <vivainio@gmail.com>
1516 2006-02-24 Ville Vainio <vivainio@gmail.com>
1507
1517
1508 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1518 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1509 "cleanly" and safely than the older upgrade mechanism.
1519 "cleanly" and safely than the older upgrade mechanism.
1510
1520
1511 2006-02-21 Ville Vainio <vivainio@gmail.com>
1521 2006-02-21 Ville Vainio <vivainio@gmail.com>
1512
1522
1513 * Magic.py: %save works again.
1523 * Magic.py: %save works again.
1514
1524
1515 2006-02-15 Ville Vainio <vivainio@gmail.com>
1525 2006-02-15 Ville Vainio <vivainio@gmail.com>
1516
1526
1517 * Magic.py: %Pprint works again
1527 * Magic.py: %Pprint works again
1518
1528
1519 * Extensions/ipy_sane_defaults.py: Provide everything provided
1529 * Extensions/ipy_sane_defaults.py: Provide everything provided
1520 in default ipythonrc, to make it possible to have a completely empty
1530 in default ipythonrc, to make it possible to have a completely empty
1521 ipythonrc (and thus completely rc-file free configuration)
1531 ipythonrc (and thus completely rc-file free configuration)
1522
1532
1523 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1533 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1524
1534
1525 * IPython/hooks.py (editor): quote the call to the editor command,
1535 * IPython/hooks.py (editor): quote the call to the editor command,
1526 to allow commands with spaces in them. Problem noted by watching
1536 to allow commands with spaces in them. Problem noted by watching
1527 Ian Oswald's video about textpad under win32 at
1537 Ian Oswald's video about textpad under win32 at
1528 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1538 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1529
1539
1530 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1540 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1531 describing magics (we haven't used @ for a loong time).
1541 describing magics (we haven't used @ for a loong time).
1532
1542
1533 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1543 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1534 contributed by marienz to close
1544 contributed by marienz to close
1535 http://www.scipy.net/roundup/ipython/issue53.
1545 http://www.scipy.net/roundup/ipython/issue53.
1536
1546
1537 2006-02-10 Ville Vainio <vivainio@gmail.com>
1547 2006-02-10 Ville Vainio <vivainio@gmail.com>
1538
1548
1539 * genutils.py: getoutput now works in win32 too
1549 * genutils.py: getoutput now works in win32 too
1540
1550
1541 * completer.py: alias and magic completion only invoked
1551 * completer.py: alias and magic completion only invoked
1542 at the first "item" in the line, to avoid "cd %store"
1552 at the first "item" in the line, to avoid "cd %store"
1543 nonsense.
1553 nonsense.
1544
1554
1545 2006-02-09 Ville Vainio <vivainio@gmail.com>
1555 2006-02-09 Ville Vainio <vivainio@gmail.com>
1546
1556
1547 * test/*: Added a unit testing framework (finally).
1557 * test/*: Added a unit testing framework (finally).
1548 '%run runtests.py' to run test_*.
1558 '%run runtests.py' to run test_*.
1549
1559
1550 * ipapi.py: Exposed runlines and set_custom_exc
1560 * ipapi.py: Exposed runlines and set_custom_exc
1551
1561
1552 2006-02-07 Ville Vainio <vivainio@gmail.com>
1562 2006-02-07 Ville Vainio <vivainio@gmail.com>
1553
1563
1554 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1564 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1555 instead use "f(1 2)" as before.
1565 instead use "f(1 2)" as before.
1556
1566
1557 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1567 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1558
1568
1559 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1569 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1560 facilities, for demos processed by the IPython input filter
1570 facilities, for demos processed by the IPython input filter
1561 (IPythonDemo), and for running a script one-line-at-a-time as a
1571 (IPythonDemo), and for running a script one-line-at-a-time as a
1562 demo, both for pure Python (LineDemo) and for IPython-processed
1572 demo, both for pure Python (LineDemo) and for IPython-processed
1563 input (IPythonLineDemo). After a request by Dave Kohel, from the
1573 input (IPythonLineDemo). After a request by Dave Kohel, from the
1564 SAGE team.
1574 SAGE team.
1565 (Demo.edit): added an edit() method to the demo objects, to edit
1575 (Demo.edit): added an edit() method to the demo objects, to edit
1566 the in-memory copy of the last executed block.
1576 the in-memory copy of the last executed block.
1567
1577
1568 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1578 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1569 processing to %edit, %macro and %save. These commands can now be
1579 processing to %edit, %macro and %save. These commands can now be
1570 invoked on the unprocessed input as it was typed by the user
1580 invoked on the unprocessed input as it was typed by the user
1571 (without any prefilters applied). After requests by the SAGE team
1581 (without any prefilters applied). After requests by the SAGE team
1572 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1582 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1573
1583
1574 2006-02-01 Ville Vainio <vivainio@gmail.com>
1584 2006-02-01 Ville Vainio <vivainio@gmail.com>
1575
1585
1576 * setup.py, eggsetup.py: easy_install ipython==dev works
1586 * setup.py, eggsetup.py: easy_install ipython==dev works
1577 correctly now (on Linux)
1587 correctly now (on Linux)
1578
1588
1579 * ipy_user_conf,ipmaker: user config changes, removed spurious
1589 * ipy_user_conf,ipmaker: user config changes, removed spurious
1580 warnings
1590 warnings
1581
1591
1582 * iplib: if rc.banner is string, use it as is.
1592 * iplib: if rc.banner is string, use it as is.
1583
1593
1584 * Magic: %pycat accepts a string argument and pages it's contents.
1594 * Magic: %pycat accepts a string argument and pages it's contents.
1585
1595
1586
1596
1587 2006-01-30 Ville Vainio <vivainio@gmail.com>
1597 2006-01-30 Ville Vainio <vivainio@gmail.com>
1588
1598
1589 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1599 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1590 Now %store and bookmarks work through PickleShare, meaning that
1600 Now %store and bookmarks work through PickleShare, meaning that
1591 concurrent access is possible and all ipython sessions see the
1601 concurrent access is possible and all ipython sessions see the
1592 same database situation all the time, instead of snapshot of
1602 same database situation all the time, instead of snapshot of
1593 the situation when the session was started. Hence, %bookmark
1603 the situation when the session was started. Hence, %bookmark
1594 results are immediately accessible from othes sessions. The database
1604 results are immediately accessible from othes sessions. The database
1595 is also available for use by user extensions. See:
1605 is also available for use by user extensions. See:
1596 http://www.python.org/pypi/pickleshare
1606 http://www.python.org/pypi/pickleshare
1597
1607
1598 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1608 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1599
1609
1600 * aliases can now be %store'd
1610 * aliases can now be %store'd
1601
1611
1602 * path.py moved to Extensions so that pickleshare does not need
1612 * path.py moved to Extensions so that pickleshare does not need
1603 IPython-specific import. Extensions added to pythonpath right
1613 IPython-specific import. Extensions added to pythonpath right
1604 at __init__.
1614 at __init__.
1605
1615
1606 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1616 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1607 called with _ip.system and the pre-transformed command string.
1617 called with _ip.system and the pre-transformed command string.
1608
1618
1609 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1619 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1610
1620
1611 * IPython/iplib.py (interact): Fix that we were not catching
1621 * IPython/iplib.py (interact): Fix that we were not catching
1612 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1622 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1613 logic here had to change, but it's fixed now.
1623 logic here had to change, but it's fixed now.
1614
1624
1615 2006-01-29 Ville Vainio <vivainio@gmail.com>
1625 2006-01-29 Ville Vainio <vivainio@gmail.com>
1616
1626
1617 * iplib.py: Try to import pyreadline on Windows.
1627 * iplib.py: Try to import pyreadline on Windows.
1618
1628
1619 2006-01-27 Ville Vainio <vivainio@gmail.com>
1629 2006-01-27 Ville Vainio <vivainio@gmail.com>
1620
1630
1621 * iplib.py: Expose ipapi as _ip in builtin namespace.
1631 * iplib.py: Expose ipapi as _ip in builtin namespace.
1622 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1632 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1623 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1633 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1624 syntax now produce _ip.* variant of the commands.
1634 syntax now produce _ip.* variant of the commands.
1625
1635
1626 * "_ip.options().autoedit_syntax = 2" automatically throws
1636 * "_ip.options().autoedit_syntax = 2" automatically throws
1627 user to editor for syntax error correction without prompting.
1637 user to editor for syntax error correction without prompting.
1628
1638
1629 2006-01-27 Ville Vainio <vivainio@gmail.com>
1639 2006-01-27 Ville Vainio <vivainio@gmail.com>
1630
1640
1631 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1641 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1632 'ipython' at argv[0]) executed through command line.
1642 'ipython' at argv[0]) executed through command line.
1633 NOTE: this DEPRECATES calling ipython with multiple scripts
1643 NOTE: this DEPRECATES calling ipython with multiple scripts
1634 ("ipython a.py b.py c.py")
1644 ("ipython a.py b.py c.py")
1635
1645
1636 * iplib.py, hooks.py: Added configurable input prefilter,
1646 * iplib.py, hooks.py: Added configurable input prefilter,
1637 named 'input_prefilter'. See ext_rescapture.py for example
1647 named 'input_prefilter'. See ext_rescapture.py for example
1638 usage.
1648 usage.
1639
1649
1640 * ext_rescapture.py, Magic.py: Better system command output capture
1650 * ext_rescapture.py, Magic.py: Better system command output capture
1641 through 'var = !ls' (deprecates user-visible %sc). Same notation
1651 through 'var = !ls' (deprecates user-visible %sc). Same notation
1642 applies for magics, 'var = %alias' assigns alias list to var.
1652 applies for magics, 'var = %alias' assigns alias list to var.
1643
1653
1644 * ipapi.py: added meta() for accessing extension-usable data store.
1654 * ipapi.py: added meta() for accessing extension-usable data store.
1645
1655
1646 * iplib.py: added InteractiveShell.getapi(). New magics should be
1656 * iplib.py: added InteractiveShell.getapi(). New magics should be
1647 written doing self.getapi() instead of using the shell directly.
1657 written doing self.getapi() instead of using the shell directly.
1648
1658
1649 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1659 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1650 %store foo >> ~/myfoo.txt to store variables to files (in clean
1660 %store foo >> ~/myfoo.txt to store variables to files (in clean
1651 textual form, not a restorable pickle).
1661 textual form, not a restorable pickle).
1652
1662
1653 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1663 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1654
1664
1655 * usage.py, Magic.py: added %quickref
1665 * usage.py, Magic.py: added %quickref
1656
1666
1657 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1667 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1658
1668
1659 * GetoptErrors when invoking magics etc. with wrong args
1669 * GetoptErrors when invoking magics etc. with wrong args
1660 are now more helpful:
1670 are now more helpful:
1661 GetoptError: option -l not recognized (allowed: "qb" )
1671 GetoptError: option -l not recognized (allowed: "qb" )
1662
1672
1663 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1673 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1664
1674
1665 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1675 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1666 computationally intensive blocks don't appear to stall the demo.
1676 computationally intensive blocks don't appear to stall the demo.
1667
1677
1668 2006-01-24 Ville Vainio <vivainio@gmail.com>
1678 2006-01-24 Ville Vainio <vivainio@gmail.com>
1669
1679
1670 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1680 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1671 value to manipulate resulting history entry.
1681 value to manipulate resulting history entry.
1672
1682
1673 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1683 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1674 to instance methods of IPApi class, to make extending an embedded
1684 to instance methods of IPApi class, to make extending an embedded
1675 IPython feasible. See ext_rehashdir.py for example usage.
1685 IPython feasible. See ext_rehashdir.py for example usage.
1676
1686
1677 * Merged 1071-1076 from branches/0.7.1
1687 * Merged 1071-1076 from branches/0.7.1
1678
1688
1679
1689
1680 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1690 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1681
1691
1682 * tools/release (daystamp): Fix build tools to use the new
1692 * tools/release (daystamp): Fix build tools to use the new
1683 eggsetup.py script to build lightweight eggs.
1693 eggsetup.py script to build lightweight eggs.
1684
1694
1685 * Applied changesets 1062 and 1064 before 0.7.1 release.
1695 * Applied changesets 1062 and 1064 before 0.7.1 release.
1686
1696
1687 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1697 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1688 see the raw input history (without conversions like %ls ->
1698 see the raw input history (without conversions like %ls ->
1689 ipmagic("ls")). After a request from W. Stein, SAGE
1699 ipmagic("ls")). After a request from W. Stein, SAGE
1690 (http://modular.ucsd.edu/sage) developer. This information is
1700 (http://modular.ucsd.edu/sage) developer. This information is
1691 stored in the input_hist_raw attribute of the IPython instance, so
1701 stored in the input_hist_raw attribute of the IPython instance, so
1692 developers can access it if needed (it's an InputList instance).
1702 developers can access it if needed (it's an InputList instance).
1693
1703
1694 * Versionstring = 0.7.2.svn
1704 * Versionstring = 0.7.2.svn
1695
1705
1696 * eggsetup.py: A separate script for constructing eggs, creates
1706 * eggsetup.py: A separate script for constructing eggs, creates
1697 proper launch scripts even on Windows (an .exe file in
1707 proper launch scripts even on Windows (an .exe file in
1698 \python24\scripts).
1708 \python24\scripts).
1699
1709
1700 * ipapi.py: launch_new_instance, launch entry point needed for the
1710 * ipapi.py: launch_new_instance, launch entry point needed for the
1701 egg.
1711 egg.
1702
1712
1703 2006-01-23 Ville Vainio <vivainio@gmail.com>
1713 2006-01-23 Ville Vainio <vivainio@gmail.com>
1704
1714
1705 * Added %cpaste magic for pasting python code
1715 * Added %cpaste magic for pasting python code
1706
1716
1707 2006-01-22 Ville Vainio <vivainio@gmail.com>
1717 2006-01-22 Ville Vainio <vivainio@gmail.com>
1708
1718
1709 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1719 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1710
1720
1711 * Versionstring = 0.7.2.svn
1721 * Versionstring = 0.7.2.svn
1712
1722
1713 * eggsetup.py: A separate script for constructing eggs, creates
1723 * eggsetup.py: A separate script for constructing eggs, creates
1714 proper launch scripts even on Windows (an .exe file in
1724 proper launch scripts even on Windows (an .exe file in
1715 \python24\scripts).
1725 \python24\scripts).
1716
1726
1717 * ipapi.py: launch_new_instance, launch entry point needed for the
1727 * ipapi.py: launch_new_instance, launch entry point needed for the
1718 egg.
1728 egg.
1719
1729
1720 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1730 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1721
1731
1722 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1732 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1723 %pfile foo would print the file for foo even if it was a binary.
1733 %pfile foo would print the file for foo even if it was a binary.
1724 Now, extensions '.so' and '.dll' are skipped.
1734 Now, extensions '.so' and '.dll' are skipped.
1725
1735
1726 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1736 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1727 bug, where macros would fail in all threaded modes. I'm not 100%
1737 bug, where macros would fail in all threaded modes. I'm not 100%
1728 sure, so I'm going to put out an rc instead of making a release
1738 sure, so I'm going to put out an rc instead of making a release
1729 today, and wait for feedback for at least a few days.
1739 today, and wait for feedback for at least a few days.
1730
1740
1731 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1741 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1732 it...) the handling of pasting external code with autoindent on.
1742 it...) the handling of pasting external code with autoindent on.
1733 To get out of a multiline input, the rule will appear for most
1743 To get out of a multiline input, the rule will appear for most
1734 users unchanged: two blank lines or change the indent level
1744 users unchanged: two blank lines or change the indent level
1735 proposed by IPython. But there is a twist now: you can
1745 proposed by IPython. But there is a twist now: you can
1736 add/subtract only *one or two spaces*. If you add/subtract three
1746 add/subtract only *one or two spaces*. If you add/subtract three
1737 or more (unless you completely delete the line), IPython will
1747 or more (unless you completely delete the line), IPython will
1738 accept that line, and you'll need to enter a second one of pure
1748 accept that line, and you'll need to enter a second one of pure
1739 whitespace. I know it sounds complicated, but I can't find a
1749 whitespace. I know it sounds complicated, but I can't find a
1740 different solution that covers all the cases, with the right
1750 different solution that covers all the cases, with the right
1741 heuristics. Hopefully in actual use, nobody will really notice
1751 heuristics. Hopefully in actual use, nobody will really notice
1742 all these strange rules and things will 'just work'.
1752 all these strange rules and things will 'just work'.
1743
1753
1744 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1754 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1745
1755
1746 * IPython/iplib.py (interact): catch exceptions which can be
1756 * IPython/iplib.py (interact): catch exceptions which can be
1747 triggered asynchronously by signal handlers. Thanks to an
1757 triggered asynchronously by signal handlers. Thanks to an
1748 automatic crash report, submitted by Colin Kingsley
1758 automatic crash report, submitted by Colin Kingsley
1749 <tercel-AT-gentoo.org>.
1759 <tercel-AT-gentoo.org>.
1750
1760
1751 2006-01-20 Ville Vainio <vivainio@gmail.com>
1761 2006-01-20 Ville Vainio <vivainio@gmail.com>
1752
1762
1753 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1763 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1754 (%rehashdir, very useful, try it out) of how to extend ipython
1764 (%rehashdir, very useful, try it out) of how to extend ipython
1755 with new magics. Also added Extensions dir to pythonpath to make
1765 with new magics. Also added Extensions dir to pythonpath to make
1756 importing extensions easy.
1766 importing extensions easy.
1757
1767
1758 * %store now complains when trying to store interactively declared
1768 * %store now complains when trying to store interactively declared
1759 classes / instances of those classes.
1769 classes / instances of those classes.
1760
1770
1761 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1771 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1762 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1772 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1763 if they exist, and ipy_user_conf.py with some defaults is created for
1773 if they exist, and ipy_user_conf.py with some defaults is created for
1764 the user.
1774 the user.
1765
1775
1766 * Startup rehashing done by the config file, not InterpreterExec.
1776 * Startup rehashing done by the config file, not InterpreterExec.
1767 This means system commands are available even without selecting the
1777 This means system commands are available even without selecting the
1768 pysh profile. It's the sensible default after all.
1778 pysh profile. It's the sensible default after all.
1769
1779
1770 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1780 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1771
1781
1772 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1782 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1773 multiline code with autoindent on working. But I am really not
1783 multiline code with autoindent on working. But I am really not
1774 sure, so this needs more testing. Will commit a debug-enabled
1784 sure, so this needs more testing. Will commit a debug-enabled
1775 version for now, while I test it some more, so that Ville and
1785 version for now, while I test it some more, so that Ville and
1776 others may also catch any problems. Also made
1786 others may also catch any problems. Also made
1777 self.indent_current_str() a method, to ensure that there's no
1787 self.indent_current_str() a method, to ensure that there's no
1778 chance of the indent space count and the corresponding string
1788 chance of the indent space count and the corresponding string
1779 falling out of sync. All code needing the string should just call
1789 falling out of sync. All code needing the string should just call
1780 the method.
1790 the method.
1781
1791
1782 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1792 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1783
1793
1784 * IPython/Magic.py (magic_edit): fix check for when users don't
1794 * IPython/Magic.py (magic_edit): fix check for when users don't
1785 save their output files, the try/except was in the wrong section.
1795 save their output files, the try/except was in the wrong section.
1786
1796
1787 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1797 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1788
1798
1789 * IPython/Magic.py (magic_run): fix __file__ global missing from
1799 * IPython/Magic.py (magic_run): fix __file__ global missing from
1790 script's namespace when executed via %run. After a report by
1800 script's namespace when executed via %run. After a report by
1791 Vivian.
1801 Vivian.
1792
1802
1793 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1803 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1794 when using python 2.4. The parent constructor changed in 2.4, and
1804 when using python 2.4. The parent constructor changed in 2.4, and
1795 we need to track it directly (we can't call it, as it messes up
1805 we need to track it directly (we can't call it, as it messes up
1796 readline and tab-completion inside our pdb would stop working).
1806 readline and tab-completion inside our pdb would stop working).
1797 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1807 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1798
1808
1799 2006-01-16 Ville Vainio <vivainio@gmail.com>
1809 2006-01-16 Ville Vainio <vivainio@gmail.com>
1800
1810
1801 * Ipython/magic.py: Reverted back to old %edit functionality
1811 * Ipython/magic.py: Reverted back to old %edit functionality
1802 that returns file contents on exit.
1812 that returns file contents on exit.
1803
1813
1804 * IPython/path.py: Added Jason Orendorff's "path" module to
1814 * IPython/path.py: Added Jason Orendorff's "path" module to
1805 IPython tree, http://www.jorendorff.com/articles/python/path/.
1815 IPython tree, http://www.jorendorff.com/articles/python/path/.
1806 You can get path objects conveniently through %sc, and !!, e.g.:
1816 You can get path objects conveniently through %sc, and !!, e.g.:
1807 sc files=ls
1817 sc files=ls
1808 for p in files.paths: # or files.p
1818 for p in files.paths: # or files.p
1809 print p,p.mtime
1819 print p,p.mtime
1810
1820
1811 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1821 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1812 now work again without considering the exclusion regexp -
1822 now work again without considering the exclusion regexp -
1813 hence, things like ',foo my/path' turn to 'foo("my/path")'
1823 hence, things like ',foo my/path' turn to 'foo("my/path")'
1814 instead of syntax error.
1824 instead of syntax error.
1815
1825
1816
1826
1817 2006-01-14 Ville Vainio <vivainio@gmail.com>
1827 2006-01-14 Ville Vainio <vivainio@gmail.com>
1818
1828
1819 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1829 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1820 ipapi decorators for python 2.4 users, options() provides access to rc
1830 ipapi decorators for python 2.4 users, options() provides access to rc
1821 data.
1831 data.
1822
1832
1823 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1833 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1824 as path separators (even on Linux ;-). Space character after
1834 as path separators (even on Linux ;-). Space character after
1825 backslash (as yielded by tab completer) is still space;
1835 backslash (as yielded by tab completer) is still space;
1826 "%cd long\ name" works as expected.
1836 "%cd long\ name" works as expected.
1827
1837
1828 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1838 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1829 as "chain of command", with priority. API stays the same,
1839 as "chain of command", with priority. API stays the same,
1830 TryNext exception raised by a hook function signals that
1840 TryNext exception raised by a hook function signals that
1831 current hook failed and next hook should try handling it, as
1841 current hook failed and next hook should try handling it, as
1832 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1842 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1833 requested configurable display hook, which is now implemented.
1843 requested configurable display hook, which is now implemented.
1834
1844
1835 2006-01-13 Ville Vainio <vivainio@gmail.com>
1845 2006-01-13 Ville Vainio <vivainio@gmail.com>
1836
1846
1837 * IPython/platutils*.py: platform specific utility functions,
1847 * IPython/platutils*.py: platform specific utility functions,
1838 so far only set_term_title is implemented (change terminal
1848 so far only set_term_title is implemented (change terminal
1839 label in windowing systems). %cd now changes the title to
1849 label in windowing systems). %cd now changes the title to
1840 current dir.
1850 current dir.
1841
1851
1842 * IPython/Release.py: Added myself to "authors" list,
1852 * IPython/Release.py: Added myself to "authors" list,
1843 had to create new files.
1853 had to create new files.
1844
1854
1845 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1855 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1846 shell escape; not a known bug but had potential to be one in the
1856 shell escape; not a known bug but had potential to be one in the
1847 future.
1857 future.
1848
1858
1849 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1859 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1850 extension API for IPython! See the module for usage example. Fix
1860 extension API for IPython! See the module for usage example. Fix
1851 OInspect for docstring-less magic functions.
1861 OInspect for docstring-less magic functions.
1852
1862
1853
1863
1854 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1864 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1855
1865
1856 * IPython/iplib.py (raw_input): temporarily deactivate all
1866 * IPython/iplib.py (raw_input): temporarily deactivate all
1857 attempts at allowing pasting of code with autoindent on. It
1867 attempts at allowing pasting of code with autoindent on. It
1858 introduced bugs (reported by Prabhu) and I can't seem to find a
1868 introduced bugs (reported by Prabhu) and I can't seem to find a
1859 robust combination which works in all cases. Will have to revisit
1869 robust combination which works in all cases. Will have to revisit
1860 later.
1870 later.
1861
1871
1862 * IPython/genutils.py: remove isspace() function. We've dropped
1872 * IPython/genutils.py: remove isspace() function. We've dropped
1863 2.2 compatibility, so it's OK to use the string method.
1873 2.2 compatibility, so it's OK to use the string method.
1864
1874
1865 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1875 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1866
1876
1867 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1877 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1868 matching what NOT to autocall on, to include all python binary
1878 matching what NOT to autocall on, to include all python binary
1869 operators (including things like 'and', 'or', 'is' and 'in').
1879 operators (including things like 'and', 'or', 'is' and 'in').
1870 Prompted by a bug report on 'foo & bar', but I realized we had
1880 Prompted by a bug report on 'foo & bar', but I realized we had
1871 many more potential bug cases with other operators. The regexp is
1881 many more potential bug cases with other operators. The regexp is
1872 self.re_exclude_auto, it's fairly commented.
1882 self.re_exclude_auto, it's fairly commented.
1873
1883
1874 2006-01-12 Ville Vainio <vivainio@gmail.com>
1884 2006-01-12 Ville Vainio <vivainio@gmail.com>
1875
1885
1876 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1886 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1877 Prettified and hardened string/backslash quoting with ipsystem(),
1887 Prettified and hardened string/backslash quoting with ipsystem(),
1878 ipalias() and ipmagic(). Now even \ characters are passed to
1888 ipalias() and ipmagic(). Now even \ characters are passed to
1879 %magics, !shell escapes and aliases exactly as they are in the
1889 %magics, !shell escapes and aliases exactly as they are in the
1880 ipython command line. Should improve backslash experience,
1890 ipython command line. Should improve backslash experience,
1881 particularly in Windows (path delimiter for some commands that
1891 particularly in Windows (path delimiter for some commands that
1882 won't understand '/'), but Unix benefits as well (regexps). %cd
1892 won't understand '/'), but Unix benefits as well (regexps). %cd
1883 magic still doesn't support backslash path delimiters, though. Also
1893 magic still doesn't support backslash path delimiters, though. Also
1884 deleted all pretense of supporting multiline command strings in
1894 deleted all pretense of supporting multiline command strings in
1885 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1895 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1886
1896
1887 * doc/build_doc_instructions.txt added. Documentation on how to
1897 * doc/build_doc_instructions.txt added. Documentation on how to
1888 use doc/update_manual.py, added yesterday. Both files contributed
1898 use doc/update_manual.py, added yesterday. Both files contributed
1889 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1899 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1890 doc/*.sh for deprecation at a later date.
1900 doc/*.sh for deprecation at a later date.
1891
1901
1892 * /ipython.py Added ipython.py to root directory for
1902 * /ipython.py Added ipython.py to root directory for
1893 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1903 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1894 ipython.py) and development convenience (no need to keep doing
1904 ipython.py) and development convenience (no need to keep doing
1895 "setup.py install" between changes).
1905 "setup.py install" between changes).
1896
1906
1897 * Made ! and !! shell escapes work (again) in multiline expressions:
1907 * Made ! and !! shell escapes work (again) in multiline expressions:
1898 if 1:
1908 if 1:
1899 !ls
1909 !ls
1900 !!ls
1910 !!ls
1901
1911
1902 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1912 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1903
1913
1904 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1914 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1905 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1915 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1906 module in case-insensitive installation. Was causing crashes
1916 module in case-insensitive installation. Was causing crashes
1907 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1917 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1908
1918
1909 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1919 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1910 <marienz-AT-gentoo.org>, closes
1920 <marienz-AT-gentoo.org>, closes
1911 http://www.scipy.net/roundup/ipython/issue51.
1921 http://www.scipy.net/roundup/ipython/issue51.
1912
1922
1913 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1923 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1914
1924
1915 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1925 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1916 problem of excessive CPU usage under *nix and keyboard lag under
1926 problem of excessive CPU usage under *nix and keyboard lag under
1917 win32.
1927 win32.
1918
1928
1919 2006-01-10 *** Released version 0.7.0
1929 2006-01-10 *** Released version 0.7.0
1920
1930
1921 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1931 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1922
1932
1923 * IPython/Release.py (revision): tag version number to 0.7.0,
1933 * IPython/Release.py (revision): tag version number to 0.7.0,
1924 ready for release.
1934 ready for release.
1925
1935
1926 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1936 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1927 it informs the user of the name of the temp. file used. This can
1937 it informs the user of the name of the temp. file used. This can
1928 help if you decide later to reuse that same file, so you know
1938 help if you decide later to reuse that same file, so you know
1929 where to copy the info from.
1939 where to copy the info from.
1930
1940
1931 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1941 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1932
1942
1933 * setup_bdist_egg.py: little script to build an egg. Added
1943 * setup_bdist_egg.py: little script to build an egg. Added
1934 support in the release tools as well.
1944 support in the release tools as well.
1935
1945
1936 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1946 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1937
1947
1938 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1948 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1939 version selection (new -wxversion command line and ipythonrc
1949 version selection (new -wxversion command line and ipythonrc
1940 parameter). Patch contributed by Arnd Baecker
1950 parameter). Patch contributed by Arnd Baecker
1941 <arnd.baecker-AT-web.de>.
1951 <arnd.baecker-AT-web.de>.
1942
1952
1943 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1953 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1944 embedded instances, for variables defined at the interactive
1954 embedded instances, for variables defined at the interactive
1945 prompt of the embedded ipython. Reported by Arnd.
1955 prompt of the embedded ipython. Reported by Arnd.
1946
1956
1947 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1957 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1948 it can be used as a (stateful) toggle, or with a direct parameter.
1958 it can be used as a (stateful) toggle, or with a direct parameter.
1949
1959
1950 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1960 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1951 could be triggered in certain cases and cause the traceback
1961 could be triggered in certain cases and cause the traceback
1952 printer not to work.
1962 printer not to work.
1953
1963
1954 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1964 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1955
1965
1956 * IPython/iplib.py (_should_recompile): Small fix, closes
1966 * IPython/iplib.py (_should_recompile): Small fix, closes
1957 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1967 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1958
1968
1959 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1969 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1960
1970
1961 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1971 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1962 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1972 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1963 Moad for help with tracking it down.
1973 Moad for help with tracking it down.
1964
1974
1965 * IPython/iplib.py (handle_auto): fix autocall handling for
1975 * IPython/iplib.py (handle_auto): fix autocall handling for
1966 objects which support BOTH __getitem__ and __call__ (so that f [x]
1976 objects which support BOTH __getitem__ and __call__ (so that f [x]
1967 is left alone, instead of becoming f([x]) automatically).
1977 is left alone, instead of becoming f([x]) automatically).
1968
1978
1969 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1979 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1970 Ville's patch.
1980 Ville's patch.
1971
1981
1972 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1982 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1973
1983
1974 * IPython/iplib.py (handle_auto): changed autocall semantics to
1984 * IPython/iplib.py (handle_auto): changed autocall semantics to
1975 include 'smart' mode, where the autocall transformation is NOT
1985 include 'smart' mode, where the autocall transformation is NOT
1976 applied if there are no arguments on the line. This allows you to
1986 applied if there are no arguments on the line. This allows you to
1977 just type 'foo' if foo is a callable to see its internal form,
1987 just type 'foo' if foo is a callable to see its internal form,
1978 instead of having it called with no arguments (typically a
1988 instead of having it called with no arguments (typically a
1979 mistake). The old 'full' autocall still exists: for that, you
1989 mistake). The old 'full' autocall still exists: for that, you
1980 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1990 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1981
1991
1982 * IPython/completer.py (Completer.attr_matches): add
1992 * IPython/completer.py (Completer.attr_matches): add
1983 tab-completion support for Enthoughts' traits. After a report by
1993 tab-completion support for Enthoughts' traits. After a report by
1984 Arnd and a patch by Prabhu.
1994 Arnd and a patch by Prabhu.
1985
1995
1986 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1996 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1987
1997
1988 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1998 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1989 Schmolck's patch to fix inspect.getinnerframes().
1999 Schmolck's patch to fix inspect.getinnerframes().
1990
2000
1991 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2001 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1992 for embedded instances, regarding handling of namespaces and items
2002 for embedded instances, regarding handling of namespaces and items
1993 added to the __builtin__ one. Multiple embedded instances and
2003 added to the __builtin__ one. Multiple embedded instances and
1994 recursive embeddings should work better now (though I'm not sure
2004 recursive embeddings should work better now (though I'm not sure
1995 I've got all the corner cases fixed, that code is a bit of a brain
2005 I've got all the corner cases fixed, that code is a bit of a brain
1996 twister).
2006 twister).
1997
2007
1998 * IPython/Magic.py (magic_edit): added support to edit in-memory
2008 * IPython/Magic.py (magic_edit): added support to edit in-memory
1999 macros (automatically creates the necessary temp files). %edit
2009 macros (automatically creates the necessary temp files). %edit
2000 also doesn't return the file contents anymore, it's just noise.
2010 also doesn't return the file contents anymore, it's just noise.
2001
2011
2002 * IPython/completer.py (Completer.attr_matches): revert change to
2012 * IPython/completer.py (Completer.attr_matches): revert change to
2003 complete only on attributes listed in __all__. I realized it
2013 complete only on attributes listed in __all__. I realized it
2004 cripples the tab-completion system as a tool for exploring the
2014 cripples the tab-completion system as a tool for exploring the
2005 internals of unknown libraries (it renders any non-__all__
2015 internals of unknown libraries (it renders any non-__all__
2006 attribute off-limits). I got bit by this when trying to see
2016 attribute off-limits). I got bit by this when trying to see
2007 something inside the dis module.
2017 something inside the dis module.
2008
2018
2009 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2019 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2010
2020
2011 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2021 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2012 namespace for users and extension writers to hold data in. This
2022 namespace for users and extension writers to hold data in. This
2013 follows the discussion in
2023 follows the discussion in
2014 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2024 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2015
2025
2016 * IPython/completer.py (IPCompleter.complete): small patch to help
2026 * IPython/completer.py (IPCompleter.complete): small patch to help
2017 tab-completion under Emacs, after a suggestion by John Barnard
2027 tab-completion under Emacs, after a suggestion by John Barnard
2018 <barnarj-AT-ccf.org>.
2028 <barnarj-AT-ccf.org>.
2019
2029
2020 * IPython/Magic.py (Magic.extract_input_slices): added support for
2030 * IPython/Magic.py (Magic.extract_input_slices): added support for
2021 the slice notation in magics to use N-M to represent numbers N...M
2031 the slice notation in magics to use N-M to represent numbers N...M
2022 (closed endpoints). This is used by %macro and %save.
2032 (closed endpoints). This is used by %macro and %save.
2023
2033
2024 * IPython/completer.py (Completer.attr_matches): for modules which
2034 * IPython/completer.py (Completer.attr_matches): for modules which
2025 define __all__, complete only on those. After a patch by Jeffrey
2035 define __all__, complete only on those. After a patch by Jeffrey
2026 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2036 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2027 speed up this routine.
2037 speed up this routine.
2028
2038
2029 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2039 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2030 don't know if this is the end of it, but the behavior now is
2040 don't know if this is the end of it, but the behavior now is
2031 certainly much more correct. Note that coupled with macros,
2041 certainly much more correct. Note that coupled with macros,
2032 slightly surprising (at first) behavior may occur: a macro will in
2042 slightly surprising (at first) behavior may occur: a macro will in
2033 general expand to multiple lines of input, so upon exiting, the
2043 general expand to multiple lines of input, so upon exiting, the
2034 in/out counters will both be bumped by the corresponding amount
2044 in/out counters will both be bumped by the corresponding amount
2035 (as if the macro's contents had been typed interactively). Typing
2045 (as if the macro's contents had been typed interactively). Typing
2036 %hist will reveal the intermediate (silently processed) lines.
2046 %hist will reveal the intermediate (silently processed) lines.
2037
2047
2038 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2048 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2039 pickle to fail (%run was overwriting __main__ and not restoring
2049 pickle to fail (%run was overwriting __main__ and not restoring
2040 it, but pickle relies on __main__ to operate).
2050 it, but pickle relies on __main__ to operate).
2041
2051
2042 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2052 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2043 using properties, but forgot to make the main InteractiveShell
2053 using properties, but forgot to make the main InteractiveShell
2044 class a new-style class. Properties fail silently, and
2054 class a new-style class. Properties fail silently, and
2045 mysteriously, with old-style class (getters work, but
2055 mysteriously, with old-style class (getters work, but
2046 setters don't do anything).
2056 setters don't do anything).
2047
2057
2048 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2058 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2049
2059
2050 * IPython/Magic.py (magic_history): fix history reporting bug (I
2060 * IPython/Magic.py (magic_history): fix history reporting bug (I
2051 know some nasties are still there, I just can't seem to find a
2061 know some nasties are still there, I just can't seem to find a
2052 reproducible test case to track them down; the input history is
2062 reproducible test case to track them down; the input history is
2053 falling out of sync...)
2063 falling out of sync...)
2054
2064
2055 * IPython/iplib.py (handle_shell_escape): fix bug where both
2065 * IPython/iplib.py (handle_shell_escape): fix bug where both
2056 aliases and system accesses where broken for indented code (such
2066 aliases and system accesses where broken for indented code (such
2057 as loops).
2067 as loops).
2058
2068
2059 * IPython/genutils.py (shell): fix small but critical bug for
2069 * IPython/genutils.py (shell): fix small but critical bug for
2060 win32 system access.
2070 win32 system access.
2061
2071
2062 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2072 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2063
2073
2064 * IPython/iplib.py (showtraceback): remove use of the
2074 * IPython/iplib.py (showtraceback): remove use of the
2065 sys.last_{type/value/traceback} structures, which are non
2075 sys.last_{type/value/traceback} structures, which are non
2066 thread-safe.
2076 thread-safe.
2067 (_prefilter): change control flow to ensure that we NEVER
2077 (_prefilter): change control flow to ensure that we NEVER
2068 introspect objects when autocall is off. This will guarantee that
2078 introspect objects when autocall is off. This will guarantee that
2069 having an input line of the form 'x.y', where access to attribute
2079 having an input line of the form 'x.y', where access to attribute
2070 'y' has side effects, doesn't trigger the side effect TWICE. It
2080 'y' has side effects, doesn't trigger the side effect TWICE. It
2071 is important to note that, with autocall on, these side effects
2081 is important to note that, with autocall on, these side effects
2072 can still happen.
2082 can still happen.
2073 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2083 (ipsystem): new builtin, to complete the ip{magic/alias/system}
2074 trio. IPython offers these three kinds of special calls which are
2084 trio. IPython offers these three kinds of special calls which are
2075 not python code, and it's a good thing to have their call method
2085 not python code, and it's a good thing to have their call method
2076 be accessible as pure python functions (not just special syntax at
2086 be accessible as pure python functions (not just special syntax at
2077 the command line). It gives us a better internal implementation
2087 the command line). It gives us a better internal implementation
2078 structure, as well as exposing these for user scripting more
2088 structure, as well as exposing these for user scripting more
2079 cleanly.
2089 cleanly.
2080
2090
2081 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2091 * IPython/macro.py (Macro.__init__): moved macros to a standalone
2082 file. Now that they'll be more likely to be used with the
2092 file. Now that they'll be more likely to be used with the
2083 persistance system (%store), I want to make sure their module path
2093 persistance system (%store), I want to make sure their module path
2084 doesn't change in the future, so that we don't break things for
2094 doesn't change in the future, so that we don't break things for
2085 users' persisted data.
2095 users' persisted data.
2086
2096
2087 * IPython/iplib.py (autoindent_update): move indentation
2097 * IPython/iplib.py (autoindent_update): move indentation
2088 management into the _text_ processing loop, not the keyboard
2098 management into the _text_ processing loop, not the keyboard
2089 interactive one. This is necessary to correctly process non-typed
2099 interactive one. This is necessary to correctly process non-typed
2090 multiline input (such as macros).
2100 multiline input (such as macros).
2091
2101
2092 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2102 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2093 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2103 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2094 which was producing problems in the resulting manual.
2104 which was producing problems in the resulting manual.
2095 (magic_whos): improve reporting of instances (show their class,
2105 (magic_whos): improve reporting of instances (show their class,
2096 instead of simply printing 'instance' which isn't terribly
2106 instead of simply printing 'instance' which isn't terribly
2097 informative).
2107 informative).
2098
2108
2099 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2109 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2100 (minor mods) to support network shares under win32.
2110 (minor mods) to support network shares under win32.
2101
2111
2102 * IPython/winconsole.py (get_console_size): add new winconsole
2112 * IPython/winconsole.py (get_console_size): add new winconsole
2103 module and fixes to page_dumb() to improve its behavior under
2113 module and fixes to page_dumb() to improve its behavior under
2104 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2114 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2105
2115
2106 * IPython/Magic.py (Macro): simplified Macro class to just
2116 * IPython/Magic.py (Macro): simplified Macro class to just
2107 subclass list. We've had only 2.2 compatibility for a very long
2117 subclass list. We've had only 2.2 compatibility for a very long
2108 time, yet I was still avoiding subclassing the builtin types. No
2118 time, yet I was still avoiding subclassing the builtin types. No
2109 more (I'm also starting to use properties, though I won't shift to
2119 more (I'm also starting to use properties, though I won't shift to
2110 2.3-specific features quite yet).
2120 2.3-specific features quite yet).
2111 (magic_store): added Ville's patch for lightweight variable
2121 (magic_store): added Ville's patch for lightweight variable
2112 persistence, after a request on the user list by Matt Wilkie
2122 persistence, after a request on the user list by Matt Wilkie
2113 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2123 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2114 details.
2124 details.
2115
2125
2116 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2126 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2117 changed the default logfile name from 'ipython.log' to
2127 changed the default logfile name from 'ipython.log' to
2118 'ipython_log.py'. These logs are real python files, and now that
2128 'ipython_log.py'. These logs are real python files, and now that
2119 we have much better multiline support, people are more likely to
2129 we have much better multiline support, people are more likely to
2120 want to use them as such. Might as well name them correctly.
2130 want to use them as such. Might as well name them correctly.
2121
2131
2122 * IPython/Magic.py: substantial cleanup. While we can't stop
2132 * IPython/Magic.py: substantial cleanup. While we can't stop
2123 using magics as mixins, due to the existing customizations 'out
2133 using magics as mixins, due to the existing customizations 'out
2124 there' which rely on the mixin naming conventions, at least I
2134 there' which rely on the mixin naming conventions, at least I
2125 cleaned out all cross-class name usage. So once we are OK with
2135 cleaned out all cross-class name usage. So once we are OK with
2126 breaking compatibility, the two systems can be separated.
2136 breaking compatibility, the two systems can be separated.
2127
2137
2128 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2138 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2129 anymore, and the class is a fair bit less hideous as well. New
2139 anymore, and the class is a fair bit less hideous as well. New
2130 features were also introduced: timestamping of input, and logging
2140 features were also introduced: timestamping of input, and logging
2131 of output results. These are user-visible with the -t and -o
2141 of output results. These are user-visible with the -t and -o
2132 options to %logstart. Closes
2142 options to %logstart. Closes
2133 http://www.scipy.net/roundup/ipython/issue11 and a request by
2143 http://www.scipy.net/roundup/ipython/issue11 and a request by
2134 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2144 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2135
2145
2136 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2146 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2137
2147
2138 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2148 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2139 better handle backslashes in paths. See the thread 'More Windows
2149 better handle backslashes in paths. See the thread 'More Windows
2140 questions part 2 - \/ characters revisited' on the iypthon user
2150 questions part 2 - \/ characters revisited' on the iypthon user
2141 list:
2151 list:
2142 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2152 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2143
2153
2144 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2154 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2145
2155
2146 (InteractiveShell.__init__): change threaded shells to not use the
2156 (InteractiveShell.__init__): change threaded shells to not use the
2147 ipython crash handler. This was causing more problems than not,
2157 ipython crash handler. This was causing more problems than not,
2148 as exceptions in the main thread (GUI code, typically) would
2158 as exceptions in the main thread (GUI code, typically) would
2149 always show up as a 'crash', when they really weren't.
2159 always show up as a 'crash', when they really weren't.
2150
2160
2151 The colors and exception mode commands (%colors/%xmode) have been
2161 The colors and exception mode commands (%colors/%xmode) have been
2152 synchronized to also take this into account, so users can get
2162 synchronized to also take this into account, so users can get
2153 verbose exceptions for their threaded code as well. I also added
2163 verbose exceptions for their threaded code as well. I also added
2154 support for activating pdb inside this exception handler as well,
2164 support for activating pdb inside this exception handler as well,
2155 so now GUI authors can use IPython's enhanced pdb at runtime.
2165 so now GUI authors can use IPython's enhanced pdb at runtime.
2156
2166
2157 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2167 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2158 true by default, and add it to the shipped ipythonrc file. Since
2168 true by default, and add it to the shipped ipythonrc file. Since
2159 this asks the user before proceeding, I think it's OK to make it
2169 this asks the user before proceeding, I think it's OK to make it
2160 true by default.
2170 true by default.
2161
2171
2162 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2172 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2163 of the previous special-casing of input in the eval loop. I think
2173 of the previous special-casing of input in the eval loop. I think
2164 this is cleaner, as they really are commands and shouldn't have
2174 this is cleaner, as they really are commands and shouldn't have
2165 a special role in the middle of the core code.
2175 a special role in the middle of the core code.
2166
2176
2167 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2177 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2168
2178
2169 * IPython/iplib.py (edit_syntax_error): added support for
2179 * IPython/iplib.py (edit_syntax_error): added support for
2170 automatically reopening the editor if the file had a syntax error
2180 automatically reopening the editor if the file had a syntax error
2171 in it. Thanks to scottt who provided the patch at:
2181 in it. Thanks to scottt who provided the patch at:
2172 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2182 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2173 version committed).
2183 version committed).
2174
2184
2175 * IPython/iplib.py (handle_normal): add suport for multi-line
2185 * IPython/iplib.py (handle_normal): add suport for multi-line
2176 input with emtpy lines. This fixes
2186 input with emtpy lines. This fixes
2177 http://www.scipy.net/roundup/ipython/issue43 and a similar
2187 http://www.scipy.net/roundup/ipython/issue43 and a similar
2178 discussion on the user list.
2188 discussion on the user list.
2179
2189
2180 WARNING: a behavior change is necessarily introduced to support
2190 WARNING: a behavior change is necessarily introduced to support
2181 blank lines: now a single blank line with whitespace does NOT
2191 blank lines: now a single blank line with whitespace does NOT
2182 break the input loop, which means that when autoindent is on, by
2192 break the input loop, which means that when autoindent is on, by
2183 default hitting return on the next (indented) line does NOT exit.
2193 default hitting return on the next (indented) line does NOT exit.
2184
2194
2185 Instead, to exit a multiline input you can either have:
2195 Instead, to exit a multiline input you can either have:
2186
2196
2187 - TWO whitespace lines (just hit return again), or
2197 - TWO whitespace lines (just hit return again), or
2188 - a single whitespace line of a different length than provided
2198 - a single whitespace line of a different length than provided
2189 by the autoindent (add or remove a space).
2199 by the autoindent (add or remove a space).
2190
2200
2191 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2201 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2192 module to better organize all readline-related functionality.
2202 module to better organize all readline-related functionality.
2193 I've deleted FlexCompleter and put all completion clases here.
2203 I've deleted FlexCompleter and put all completion clases here.
2194
2204
2195 * IPython/iplib.py (raw_input): improve indentation management.
2205 * IPython/iplib.py (raw_input): improve indentation management.
2196 It is now possible to paste indented code with autoindent on, and
2206 It is now possible to paste indented code with autoindent on, and
2197 the code is interpreted correctly (though it still looks bad on
2207 the code is interpreted correctly (though it still looks bad on
2198 screen, due to the line-oriented nature of ipython).
2208 screen, due to the line-oriented nature of ipython).
2199 (MagicCompleter.complete): change behavior so that a TAB key on an
2209 (MagicCompleter.complete): change behavior so that a TAB key on an
2200 otherwise empty line actually inserts a tab, instead of completing
2210 otherwise empty line actually inserts a tab, instead of completing
2201 on the entire global namespace. This makes it easier to use the
2211 on the entire global namespace. This makes it easier to use the
2202 TAB key for indentation. After a request by Hans Meine
2212 TAB key for indentation. After a request by Hans Meine
2203 <hans_meine-AT-gmx.net>
2213 <hans_meine-AT-gmx.net>
2204 (_prefilter): add support so that typing plain 'exit' or 'quit'
2214 (_prefilter): add support so that typing plain 'exit' or 'quit'
2205 does a sensible thing. Originally I tried to deviate as little as
2215 does a sensible thing. Originally I tried to deviate as little as
2206 possible from the default python behavior, but even that one may
2216 possible from the default python behavior, but even that one may
2207 change in this direction (thread on python-dev to that effect).
2217 change in this direction (thread on python-dev to that effect).
2208 Regardless, ipython should do the right thing even if CPython's
2218 Regardless, ipython should do the right thing even if CPython's
2209 '>>>' prompt doesn't.
2219 '>>>' prompt doesn't.
2210 (InteractiveShell): removed subclassing code.InteractiveConsole
2220 (InteractiveShell): removed subclassing code.InteractiveConsole
2211 class. By now we'd overridden just about all of its methods: I've
2221 class. By now we'd overridden just about all of its methods: I've
2212 copied the remaining two over, and now ipython is a standalone
2222 copied the remaining two over, and now ipython is a standalone
2213 class. This will provide a clearer picture for the chainsaw
2223 class. This will provide a clearer picture for the chainsaw
2214 branch refactoring.
2224 branch refactoring.
2215
2225
2216 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2226 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2217
2227
2218 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2228 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2219 failures for objects which break when dir() is called on them.
2229 failures for objects which break when dir() is called on them.
2220
2230
2221 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2231 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2222 distinct local and global namespaces in the completer API. This
2232 distinct local and global namespaces in the completer API. This
2223 change allows us to properly handle completion with distinct
2233 change allows us to properly handle completion with distinct
2224 scopes, including in embedded instances (this had never really
2234 scopes, including in embedded instances (this had never really
2225 worked correctly).
2235 worked correctly).
2226
2236
2227 Note: this introduces a change in the constructor for
2237 Note: this introduces a change in the constructor for
2228 MagicCompleter, as a new global_namespace parameter is now the
2238 MagicCompleter, as a new global_namespace parameter is now the
2229 second argument (the others were bumped one position).
2239 second argument (the others were bumped one position).
2230
2240
2231 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2241 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2232
2242
2233 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2243 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2234 embedded instances (which can be done now thanks to Vivian's
2244 embedded instances (which can be done now thanks to Vivian's
2235 frame-handling fixes for pdb).
2245 frame-handling fixes for pdb).
2236 (InteractiveShell.__init__): Fix namespace handling problem in
2246 (InteractiveShell.__init__): Fix namespace handling problem in
2237 embedded instances. We were overwriting __main__ unconditionally,
2247 embedded instances. We were overwriting __main__ unconditionally,
2238 and this should only be done for 'full' (non-embedded) IPython;
2248 and this should only be done for 'full' (non-embedded) IPython;
2239 embedded instances must respect the caller's __main__. Thanks to
2249 embedded instances must respect the caller's __main__. Thanks to
2240 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2250 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2241
2251
2242 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2252 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2243
2253
2244 * setup.py: added download_url to setup(). This registers the
2254 * setup.py: added download_url to setup(). This registers the
2245 download address at PyPI, which is not only useful to humans
2255 download address at PyPI, which is not only useful to humans
2246 browsing the site, but is also picked up by setuptools (the Eggs
2256 browsing the site, but is also picked up by setuptools (the Eggs
2247 machinery). Thanks to Ville and R. Kern for the info/discussion
2257 machinery). Thanks to Ville and R. Kern for the info/discussion
2248 on this.
2258 on this.
2249
2259
2250 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2260 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2251
2261
2252 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2262 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2253 This brings a lot of nice functionality to the pdb mode, which now
2263 This brings a lot of nice functionality to the pdb mode, which now
2254 has tab-completion, syntax highlighting, and better stack handling
2264 has tab-completion, syntax highlighting, and better stack handling
2255 than before. Many thanks to Vivian De Smedt
2265 than before. Many thanks to Vivian De Smedt
2256 <vivian-AT-vdesmedt.com> for the original patches.
2266 <vivian-AT-vdesmedt.com> for the original patches.
2257
2267
2258 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2268 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2259
2269
2260 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2270 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2261 sequence to consistently accept the banner argument. The
2271 sequence to consistently accept the banner argument. The
2262 inconsistency was tripping SAGE, thanks to Gary Zablackis
2272 inconsistency was tripping SAGE, thanks to Gary Zablackis
2263 <gzabl-AT-yahoo.com> for the report.
2273 <gzabl-AT-yahoo.com> for the report.
2264
2274
2265 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2275 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2266
2276
2267 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2277 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2268 Fix bug where a naked 'alias' call in the ipythonrc file would
2278 Fix bug where a naked 'alias' call in the ipythonrc file would
2269 cause a crash. Bug reported by Jorgen Stenarson.
2279 cause a crash. Bug reported by Jorgen Stenarson.
2270
2280
2271 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2281 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2272
2282
2273 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2283 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2274 startup time.
2284 startup time.
2275
2285
2276 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2286 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2277 instances had introduced a bug with globals in normal code. Now
2287 instances had introduced a bug with globals in normal code. Now
2278 it's working in all cases.
2288 it's working in all cases.
2279
2289
2280 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2290 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2281 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2291 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2282 has been introduced to set the default case sensitivity of the
2292 has been introduced to set the default case sensitivity of the
2283 searches. Users can still select either mode at runtime on a
2293 searches. Users can still select either mode at runtime on a
2284 per-search basis.
2294 per-search basis.
2285
2295
2286 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2296 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2287
2297
2288 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2298 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2289 attributes in wildcard searches for subclasses. Modified version
2299 attributes in wildcard searches for subclasses. Modified version
2290 of a patch by Jorgen.
2300 of a patch by Jorgen.
2291
2301
2292 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2302 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2293
2303
2294 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2304 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2295 embedded instances. I added a user_global_ns attribute to the
2305 embedded instances. I added a user_global_ns attribute to the
2296 InteractiveShell class to handle this.
2306 InteractiveShell class to handle this.
2297
2307
2298 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2308 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2299
2309
2300 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2310 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2301 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2311 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2302 (reported under win32, but may happen also in other platforms).
2312 (reported under win32, but may happen also in other platforms).
2303 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2313 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2304
2314
2305 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2315 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2306
2316
2307 * IPython/Magic.py (magic_psearch): new support for wildcard
2317 * IPython/Magic.py (magic_psearch): new support for wildcard
2308 patterns. Now, typing ?a*b will list all names which begin with a
2318 patterns. Now, typing ?a*b will list all names which begin with a
2309 and end in b, for example. The %psearch magic has full
2319 and end in b, for example. The %psearch magic has full
2310 docstrings. Many thanks to JΓΆrgen Stenarson
2320 docstrings. Many thanks to JΓΆrgen Stenarson
2311 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2321 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2312 implementing this functionality.
2322 implementing this functionality.
2313
2323
2314 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2324 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2315
2325
2316 * Manual: fixed long-standing annoyance of double-dashes (as in
2326 * Manual: fixed long-standing annoyance of double-dashes (as in
2317 --prefix=~, for example) being stripped in the HTML version. This
2327 --prefix=~, for example) being stripped in the HTML version. This
2318 is a latex2html bug, but a workaround was provided. Many thanks
2328 is a latex2html bug, but a workaround was provided. Many thanks
2319 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2329 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2320 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2330 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2321 rolling. This seemingly small issue had tripped a number of users
2331 rolling. This seemingly small issue had tripped a number of users
2322 when first installing, so I'm glad to see it gone.
2332 when first installing, so I'm glad to see it gone.
2323
2333
2324 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2334 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2325
2335
2326 * IPython/Extensions/numeric_formats.py: fix missing import,
2336 * IPython/Extensions/numeric_formats.py: fix missing import,
2327 reported by Stephen Walton.
2337 reported by Stephen Walton.
2328
2338
2329 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2339 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2330
2340
2331 * IPython/demo.py: finish demo module, fully documented now.
2341 * IPython/demo.py: finish demo module, fully documented now.
2332
2342
2333 * IPython/genutils.py (file_read): simple little utility to read a
2343 * IPython/genutils.py (file_read): simple little utility to read a
2334 file and ensure it's closed afterwards.
2344 file and ensure it's closed afterwards.
2335
2345
2336 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2346 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2337
2347
2338 * IPython/demo.py (Demo.__init__): added support for individually
2348 * IPython/demo.py (Demo.__init__): added support for individually
2339 tagging blocks for automatic execution.
2349 tagging blocks for automatic execution.
2340
2350
2341 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2351 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2342 syntax-highlighted python sources, requested by John.
2352 syntax-highlighted python sources, requested by John.
2343
2353
2344 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2354 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2345
2355
2346 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2356 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2347 finishing.
2357 finishing.
2348
2358
2349 * IPython/genutils.py (shlex_split): moved from Magic to here,
2359 * IPython/genutils.py (shlex_split): moved from Magic to here,
2350 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2360 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2351
2361
2352 * IPython/demo.py (Demo.__init__): added support for silent
2362 * IPython/demo.py (Demo.__init__): added support for silent
2353 blocks, improved marks as regexps, docstrings written.
2363 blocks, improved marks as regexps, docstrings written.
2354 (Demo.__init__): better docstring, added support for sys.argv.
2364 (Demo.__init__): better docstring, added support for sys.argv.
2355
2365
2356 * IPython/genutils.py (marquee): little utility used by the demo
2366 * IPython/genutils.py (marquee): little utility used by the demo
2357 code, handy in general.
2367 code, handy in general.
2358
2368
2359 * IPython/demo.py (Demo.__init__): new class for interactive
2369 * IPython/demo.py (Demo.__init__): new class for interactive
2360 demos. Not documented yet, I just wrote it in a hurry for
2370 demos. Not documented yet, I just wrote it in a hurry for
2361 scipy'05. Will docstring later.
2371 scipy'05. Will docstring later.
2362
2372
2363 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2373 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2364
2374
2365 * IPython/Shell.py (sigint_handler): Drastic simplification which
2375 * IPython/Shell.py (sigint_handler): Drastic simplification which
2366 also seems to make Ctrl-C work correctly across threads! This is
2376 also seems to make Ctrl-C work correctly across threads! This is
2367 so simple, that I can't beleive I'd missed it before. Needs more
2377 so simple, that I can't beleive I'd missed it before. Needs more
2368 testing, though.
2378 testing, though.
2369 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2379 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2370 like this before...
2380 like this before...
2371
2381
2372 * IPython/genutils.py (get_home_dir): add protection against
2382 * IPython/genutils.py (get_home_dir): add protection against
2373 non-dirs in win32 registry.
2383 non-dirs in win32 registry.
2374
2384
2375 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2385 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2376 bug where dict was mutated while iterating (pysh crash).
2386 bug where dict was mutated while iterating (pysh crash).
2377
2387
2378 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2388 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2379
2389
2380 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2390 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2381 spurious newlines added by this routine. After a report by
2391 spurious newlines added by this routine. After a report by
2382 F. Mantegazza.
2392 F. Mantegazza.
2383
2393
2384 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2394 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2385
2395
2386 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2396 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2387 calls. These were a leftover from the GTK 1.x days, and can cause
2397 calls. These were a leftover from the GTK 1.x days, and can cause
2388 problems in certain cases (after a report by John Hunter).
2398 problems in certain cases (after a report by John Hunter).
2389
2399
2390 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2400 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2391 os.getcwd() fails at init time. Thanks to patch from David Remahl
2401 os.getcwd() fails at init time. Thanks to patch from David Remahl
2392 <chmod007-AT-mac.com>.
2402 <chmod007-AT-mac.com>.
2393 (InteractiveShell.__init__): prevent certain special magics from
2403 (InteractiveShell.__init__): prevent certain special magics from
2394 being shadowed by aliases. Closes
2404 being shadowed by aliases. Closes
2395 http://www.scipy.net/roundup/ipython/issue41.
2405 http://www.scipy.net/roundup/ipython/issue41.
2396
2406
2397 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2407 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2398
2408
2399 * IPython/iplib.py (InteractiveShell.complete): Added new
2409 * IPython/iplib.py (InteractiveShell.complete): Added new
2400 top-level completion method to expose the completion mechanism
2410 top-level completion method to expose the completion mechanism
2401 beyond readline-based environments.
2411 beyond readline-based environments.
2402
2412
2403 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2413 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2404
2414
2405 * tools/ipsvnc (svnversion): fix svnversion capture.
2415 * tools/ipsvnc (svnversion): fix svnversion capture.
2406
2416
2407 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2417 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2408 attribute to self, which was missing. Before, it was set by a
2418 attribute to self, which was missing. Before, it was set by a
2409 routine which in certain cases wasn't being called, so the
2419 routine which in certain cases wasn't being called, so the
2410 instance could end up missing the attribute. This caused a crash.
2420 instance could end up missing the attribute. This caused a crash.
2411 Closes http://www.scipy.net/roundup/ipython/issue40.
2421 Closes http://www.scipy.net/roundup/ipython/issue40.
2412
2422
2413 2005-08-16 Fernando Perez <fperez@colorado.edu>
2423 2005-08-16 Fernando Perez <fperez@colorado.edu>
2414
2424
2415 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2425 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2416 contains non-string attribute. Closes
2426 contains non-string attribute. Closes
2417 http://www.scipy.net/roundup/ipython/issue38.
2427 http://www.scipy.net/roundup/ipython/issue38.
2418
2428
2419 2005-08-14 Fernando Perez <fperez@colorado.edu>
2429 2005-08-14 Fernando Perez <fperez@colorado.edu>
2420
2430
2421 * tools/ipsvnc: Minor improvements, to add changeset info.
2431 * tools/ipsvnc: Minor improvements, to add changeset info.
2422
2432
2423 2005-08-12 Fernando Perez <fperez@colorado.edu>
2433 2005-08-12 Fernando Perez <fperez@colorado.edu>
2424
2434
2425 * IPython/iplib.py (runsource): remove self.code_to_run_src
2435 * IPython/iplib.py (runsource): remove self.code_to_run_src
2426 attribute. I realized this is nothing more than
2436 attribute. I realized this is nothing more than
2427 '\n'.join(self.buffer), and having the same data in two different
2437 '\n'.join(self.buffer), and having the same data in two different
2428 places is just asking for synchronization bugs. This may impact
2438 places is just asking for synchronization bugs. This may impact
2429 people who have custom exception handlers, so I need to warn
2439 people who have custom exception handlers, so I need to warn
2430 ipython-dev about it (F. Mantegazza may use them).
2440 ipython-dev about it (F. Mantegazza may use them).
2431
2441
2432 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2442 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2433
2443
2434 * IPython/genutils.py: fix 2.2 compatibility (generators)
2444 * IPython/genutils.py: fix 2.2 compatibility (generators)
2435
2445
2436 2005-07-18 Fernando Perez <fperez@colorado.edu>
2446 2005-07-18 Fernando Perez <fperez@colorado.edu>
2437
2447
2438 * IPython/genutils.py (get_home_dir): fix to help users with
2448 * IPython/genutils.py (get_home_dir): fix to help users with
2439 invalid $HOME under win32.
2449 invalid $HOME under win32.
2440
2450
2441 2005-07-17 Fernando Perez <fperez@colorado.edu>
2451 2005-07-17 Fernando Perez <fperez@colorado.edu>
2442
2452
2443 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2453 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2444 some old hacks and clean up a bit other routines; code should be
2454 some old hacks and clean up a bit other routines; code should be
2445 simpler and a bit faster.
2455 simpler and a bit faster.
2446
2456
2447 * IPython/iplib.py (interact): removed some last-resort attempts
2457 * IPython/iplib.py (interact): removed some last-resort attempts
2448 to survive broken stdout/stderr. That code was only making it
2458 to survive broken stdout/stderr. That code was only making it
2449 harder to abstract out the i/o (necessary for gui integration),
2459 harder to abstract out the i/o (necessary for gui integration),
2450 and the crashes it could prevent were extremely rare in practice
2460 and the crashes it could prevent were extremely rare in practice
2451 (besides being fully user-induced in a pretty violent manner).
2461 (besides being fully user-induced in a pretty violent manner).
2452
2462
2453 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2463 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2454 Nothing major yet, but the code is simpler to read; this should
2464 Nothing major yet, but the code is simpler to read; this should
2455 make it easier to do more serious modifications in the future.
2465 make it easier to do more serious modifications in the future.
2456
2466
2457 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2467 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2458 which broke in .15 (thanks to a report by Ville).
2468 which broke in .15 (thanks to a report by Ville).
2459
2469
2460 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2470 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2461 be quite correct, I know next to nothing about unicode). This
2471 be quite correct, I know next to nothing about unicode). This
2462 will allow unicode strings to be used in prompts, amongst other
2472 will allow unicode strings to be used in prompts, amongst other
2463 cases. It also will prevent ipython from crashing when unicode
2473 cases. It also will prevent ipython from crashing when unicode
2464 shows up unexpectedly in many places. If ascii encoding fails, we
2474 shows up unexpectedly in many places. If ascii encoding fails, we
2465 assume utf_8. Currently the encoding is not a user-visible
2475 assume utf_8. Currently the encoding is not a user-visible
2466 setting, though it could be made so if there is demand for it.
2476 setting, though it could be made so if there is demand for it.
2467
2477
2468 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2478 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2469
2479
2470 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2480 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2471
2481
2472 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2482 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2473
2483
2474 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2484 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2475 code can work transparently for 2.2/2.3.
2485 code can work transparently for 2.2/2.3.
2476
2486
2477 2005-07-16 Fernando Perez <fperez@colorado.edu>
2487 2005-07-16 Fernando Perez <fperez@colorado.edu>
2478
2488
2479 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2489 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2480 out of the color scheme table used for coloring exception
2490 out of the color scheme table used for coloring exception
2481 tracebacks. This allows user code to add new schemes at runtime.
2491 tracebacks. This allows user code to add new schemes at runtime.
2482 This is a minimally modified version of the patch at
2492 This is a minimally modified version of the patch at
2483 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2493 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2484 for the contribution.
2494 for the contribution.
2485
2495
2486 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2496 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2487 slightly modified version of the patch in
2497 slightly modified version of the patch in
2488 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2498 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2489 to remove the previous try/except solution (which was costlier).
2499 to remove the previous try/except solution (which was costlier).
2490 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2500 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2491
2501
2492 2005-06-08 Fernando Perez <fperez@colorado.edu>
2502 2005-06-08 Fernando Perez <fperez@colorado.edu>
2493
2503
2494 * IPython/iplib.py (write/write_err): Add methods to abstract all
2504 * IPython/iplib.py (write/write_err): Add methods to abstract all
2495 I/O a bit more.
2505 I/O a bit more.
2496
2506
2497 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2507 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2498 warning, reported by Aric Hagberg, fix by JD Hunter.
2508 warning, reported by Aric Hagberg, fix by JD Hunter.
2499
2509
2500 2005-06-02 *** Released version 0.6.15
2510 2005-06-02 *** Released version 0.6.15
2501
2511
2502 2005-06-01 Fernando Perez <fperez@colorado.edu>
2512 2005-06-01 Fernando Perez <fperez@colorado.edu>
2503
2513
2504 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2514 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2505 tab-completion of filenames within open-quoted strings. Note that
2515 tab-completion of filenames within open-quoted strings. Note that
2506 this requires that in ~/.ipython/ipythonrc, users change the
2516 this requires that in ~/.ipython/ipythonrc, users change the
2507 readline delimiters configuration to read:
2517 readline delimiters configuration to read:
2508
2518
2509 readline_remove_delims -/~
2519 readline_remove_delims -/~
2510
2520
2511
2521
2512 2005-05-31 *** Released version 0.6.14
2522 2005-05-31 *** Released version 0.6.14
2513
2523
2514 2005-05-29 Fernando Perez <fperez@colorado.edu>
2524 2005-05-29 Fernando Perez <fperez@colorado.edu>
2515
2525
2516 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2526 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2517 with files not on the filesystem. Reported by Eliyahu Sandler
2527 with files not on the filesystem. Reported by Eliyahu Sandler
2518 <eli@gondolin.net>
2528 <eli@gondolin.net>
2519
2529
2520 2005-05-22 Fernando Perez <fperez@colorado.edu>
2530 2005-05-22 Fernando Perez <fperez@colorado.edu>
2521
2531
2522 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2532 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2523 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2533 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2524
2534
2525 2005-05-19 Fernando Perez <fperez@colorado.edu>
2535 2005-05-19 Fernando Perez <fperez@colorado.edu>
2526
2536
2527 * IPython/iplib.py (safe_execfile): close a file which could be
2537 * IPython/iplib.py (safe_execfile): close a file which could be
2528 left open (causing problems in win32, which locks open files).
2538 left open (causing problems in win32, which locks open files).
2529 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2539 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2530
2540
2531 2005-05-18 Fernando Perez <fperez@colorado.edu>
2541 2005-05-18 Fernando Perez <fperez@colorado.edu>
2532
2542
2533 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2543 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2534 keyword arguments correctly to safe_execfile().
2544 keyword arguments correctly to safe_execfile().
2535
2545
2536 2005-05-13 Fernando Perez <fperez@colorado.edu>
2546 2005-05-13 Fernando Perez <fperez@colorado.edu>
2537
2547
2538 * ipython.1: Added info about Qt to manpage, and threads warning
2548 * ipython.1: Added info about Qt to manpage, and threads warning
2539 to usage page (invoked with --help).
2549 to usage page (invoked with --help).
2540
2550
2541 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2551 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2542 new matcher (it goes at the end of the priority list) to do
2552 new matcher (it goes at the end of the priority list) to do
2543 tab-completion on named function arguments. Submitted by George
2553 tab-completion on named function arguments. Submitted by George
2544 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2554 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2545 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2555 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2546 for more details.
2556 for more details.
2547
2557
2548 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2558 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2549 SystemExit exceptions in the script being run. Thanks to a report
2559 SystemExit exceptions in the script being run. Thanks to a report
2550 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2560 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2551 producing very annoying behavior when running unit tests.
2561 producing very annoying behavior when running unit tests.
2552
2562
2553 2005-05-12 Fernando Perez <fperez@colorado.edu>
2563 2005-05-12 Fernando Perez <fperez@colorado.edu>
2554
2564
2555 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2565 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2556 which I'd broken (again) due to a changed regexp. In the process,
2566 which I'd broken (again) due to a changed regexp. In the process,
2557 added ';' as an escape to auto-quote the whole line without
2567 added ';' as an escape to auto-quote the whole line without
2558 splitting its arguments. Thanks to a report by Jerry McRae
2568 splitting its arguments. Thanks to a report by Jerry McRae
2559 <qrs0xyc02-AT-sneakemail.com>.
2569 <qrs0xyc02-AT-sneakemail.com>.
2560
2570
2561 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2571 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2562 possible crashes caused by a TokenError. Reported by Ed Schofield
2572 possible crashes caused by a TokenError. Reported by Ed Schofield
2563 <schofield-AT-ftw.at>.
2573 <schofield-AT-ftw.at>.
2564
2574
2565 2005-05-06 Fernando Perez <fperez@colorado.edu>
2575 2005-05-06 Fernando Perez <fperez@colorado.edu>
2566
2576
2567 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2577 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2568
2578
2569 2005-04-29 Fernando Perez <fperez@colorado.edu>
2579 2005-04-29 Fernando Perez <fperez@colorado.edu>
2570
2580
2571 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2581 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2572 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2582 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2573 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2583 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2574 which provides support for Qt interactive usage (similar to the
2584 which provides support for Qt interactive usage (similar to the
2575 existing one for WX and GTK). This had been often requested.
2585 existing one for WX and GTK). This had been often requested.
2576
2586
2577 2005-04-14 *** Released version 0.6.13
2587 2005-04-14 *** Released version 0.6.13
2578
2588
2579 2005-04-08 Fernando Perez <fperez@colorado.edu>
2589 2005-04-08 Fernando Perez <fperez@colorado.edu>
2580
2590
2581 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2591 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2582 from _ofind, which gets called on almost every input line. Now,
2592 from _ofind, which gets called on almost every input line. Now,
2583 we only try to get docstrings if they are actually going to be
2593 we only try to get docstrings if they are actually going to be
2584 used (the overhead of fetching unnecessary docstrings can be
2594 used (the overhead of fetching unnecessary docstrings can be
2585 noticeable for certain objects, such as Pyro proxies).
2595 noticeable for certain objects, such as Pyro proxies).
2586
2596
2587 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2597 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2588 for completers. For some reason I had been passing them the state
2598 for completers. For some reason I had been passing them the state
2589 variable, which completers never actually need, and was in
2599 variable, which completers never actually need, and was in
2590 conflict with the rlcompleter API. Custom completers ONLY need to
2600 conflict with the rlcompleter API. Custom completers ONLY need to
2591 take the text parameter.
2601 take the text parameter.
2592
2602
2593 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2603 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2594 work correctly in pysh. I've also moved all the logic which used
2604 work correctly in pysh. I've also moved all the logic which used
2595 to be in pysh.py here, which will prevent problems with future
2605 to be in pysh.py here, which will prevent problems with future
2596 upgrades. However, this time I must warn users to update their
2606 upgrades. However, this time I must warn users to update their
2597 pysh profile to include the line
2607 pysh profile to include the line
2598
2608
2599 import_all IPython.Extensions.InterpreterExec
2609 import_all IPython.Extensions.InterpreterExec
2600
2610
2601 because otherwise things won't work for them. They MUST also
2611 because otherwise things won't work for them. They MUST also
2602 delete pysh.py and the line
2612 delete pysh.py and the line
2603
2613
2604 execfile pysh.py
2614 execfile pysh.py
2605
2615
2606 from their ipythonrc-pysh.
2616 from their ipythonrc-pysh.
2607
2617
2608 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2618 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2609 robust in the face of objects whose dir() returns non-strings
2619 robust in the face of objects whose dir() returns non-strings
2610 (which it shouldn't, but some broken libs like ITK do). Thanks to
2620 (which it shouldn't, but some broken libs like ITK do). Thanks to
2611 a patch by John Hunter (implemented differently, though). Also
2621 a patch by John Hunter (implemented differently, though). Also
2612 minor improvements by using .extend instead of + on lists.
2622 minor improvements by using .extend instead of + on lists.
2613
2623
2614 * pysh.py:
2624 * pysh.py:
2615
2625
2616 2005-04-06 Fernando Perez <fperez@colorado.edu>
2626 2005-04-06 Fernando Perez <fperez@colorado.edu>
2617
2627
2618 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2628 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2619 by default, so that all users benefit from it. Those who don't
2629 by default, so that all users benefit from it. Those who don't
2620 want it can still turn it off.
2630 want it can still turn it off.
2621
2631
2622 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2632 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2623 config file, I'd forgotten about this, so users were getting it
2633 config file, I'd forgotten about this, so users were getting it
2624 off by default.
2634 off by default.
2625
2635
2626 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2636 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2627 consistency. Now magics can be called in multiline statements,
2637 consistency. Now magics can be called in multiline statements,
2628 and python variables can be expanded in magic calls via $var.
2638 and python variables can be expanded in magic calls via $var.
2629 This makes the magic system behave just like aliases or !system
2639 This makes the magic system behave just like aliases or !system
2630 calls.
2640 calls.
2631
2641
2632 2005-03-28 Fernando Perez <fperez@colorado.edu>
2642 2005-03-28 Fernando Perez <fperez@colorado.edu>
2633
2643
2634 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2644 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2635 expensive string additions for building command. Add support for
2645 expensive string additions for building command. Add support for
2636 trailing ';' when autocall is used.
2646 trailing ';' when autocall is used.
2637
2647
2638 2005-03-26 Fernando Perez <fperez@colorado.edu>
2648 2005-03-26 Fernando Perez <fperez@colorado.edu>
2639
2649
2640 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2650 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2641 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2651 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2642 ipython.el robust against prompts with any number of spaces
2652 ipython.el robust against prompts with any number of spaces
2643 (including 0) after the ':' character.
2653 (including 0) after the ':' character.
2644
2654
2645 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2655 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2646 continuation prompt, which misled users to think the line was
2656 continuation prompt, which misled users to think the line was
2647 already indented. Closes debian Bug#300847, reported to me by
2657 already indented. Closes debian Bug#300847, reported to me by
2648 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2658 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2649
2659
2650 2005-03-23 Fernando Perez <fperez@colorado.edu>
2660 2005-03-23 Fernando Perez <fperez@colorado.edu>
2651
2661
2652 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2662 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2653 properly aligned if they have embedded newlines.
2663 properly aligned if they have embedded newlines.
2654
2664
2655 * IPython/iplib.py (runlines): Add a public method to expose
2665 * IPython/iplib.py (runlines): Add a public method to expose
2656 IPython's code execution machinery, so that users can run strings
2666 IPython's code execution machinery, so that users can run strings
2657 as if they had been typed at the prompt interactively.
2667 as if they had been typed at the prompt interactively.
2658 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2668 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2659 methods which can call the system shell, but with python variable
2669 methods which can call the system shell, but with python variable
2660 expansion. The three such methods are: __IPYTHON__.system,
2670 expansion. The three such methods are: __IPYTHON__.system,
2661 .getoutput and .getoutputerror. These need to be documented in a
2671 .getoutput and .getoutputerror. These need to be documented in a
2662 'public API' section (to be written) of the manual.
2672 'public API' section (to be written) of the manual.
2663
2673
2664 2005-03-20 Fernando Perez <fperez@colorado.edu>
2674 2005-03-20 Fernando Perez <fperez@colorado.edu>
2665
2675
2666 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2676 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2667 for custom exception handling. This is quite powerful, and it
2677 for custom exception handling. This is quite powerful, and it
2668 allows for user-installable exception handlers which can trap
2678 allows for user-installable exception handlers which can trap
2669 custom exceptions at runtime and treat them separately from
2679 custom exceptions at runtime and treat them separately from
2670 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2680 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2671 Mantegazza <mantegazza-AT-ill.fr>.
2681 Mantegazza <mantegazza-AT-ill.fr>.
2672 (InteractiveShell.set_custom_completer): public API function to
2682 (InteractiveShell.set_custom_completer): public API function to
2673 add new completers at runtime.
2683 add new completers at runtime.
2674
2684
2675 2005-03-19 Fernando Perez <fperez@colorado.edu>
2685 2005-03-19 Fernando Perez <fperez@colorado.edu>
2676
2686
2677 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2687 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2678 allow objects which provide their docstrings via non-standard
2688 allow objects which provide their docstrings via non-standard
2679 mechanisms (like Pyro proxies) to still be inspected by ipython's
2689 mechanisms (like Pyro proxies) to still be inspected by ipython's
2680 ? system.
2690 ? system.
2681
2691
2682 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2692 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2683 automatic capture system. I tried quite hard to make it work
2693 automatic capture system. I tried quite hard to make it work
2684 reliably, and simply failed. I tried many combinations with the
2694 reliably, and simply failed. I tried many combinations with the
2685 subprocess module, but eventually nothing worked in all needed
2695 subprocess module, but eventually nothing worked in all needed
2686 cases (not blocking stdin for the child, duplicating stdout
2696 cases (not blocking stdin for the child, duplicating stdout
2687 without blocking, etc). The new %sc/%sx still do capture to these
2697 without blocking, etc). The new %sc/%sx still do capture to these
2688 magical list/string objects which make shell use much more
2698 magical list/string objects which make shell use much more
2689 conveninent, so not all is lost.
2699 conveninent, so not all is lost.
2690
2700
2691 XXX - FIX MANUAL for the change above!
2701 XXX - FIX MANUAL for the change above!
2692
2702
2693 (runsource): I copied code.py's runsource() into ipython to modify
2703 (runsource): I copied code.py's runsource() into ipython to modify
2694 it a bit. Now the code object and source to be executed are
2704 it a bit. Now the code object and source to be executed are
2695 stored in ipython. This makes this info accessible to third-party
2705 stored in ipython. This makes this info accessible to third-party
2696 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2706 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2697 Mantegazza <mantegazza-AT-ill.fr>.
2707 Mantegazza <mantegazza-AT-ill.fr>.
2698
2708
2699 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2709 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2700 history-search via readline (like C-p/C-n). I'd wanted this for a
2710 history-search via readline (like C-p/C-n). I'd wanted this for a
2701 long time, but only recently found out how to do it. For users
2711 long time, but only recently found out how to do it. For users
2702 who already have their ipythonrc files made and want this, just
2712 who already have their ipythonrc files made and want this, just
2703 add:
2713 add:
2704
2714
2705 readline_parse_and_bind "\e[A": history-search-backward
2715 readline_parse_and_bind "\e[A": history-search-backward
2706 readline_parse_and_bind "\e[B": history-search-forward
2716 readline_parse_and_bind "\e[B": history-search-forward
2707
2717
2708 2005-03-18 Fernando Perez <fperez@colorado.edu>
2718 2005-03-18 Fernando Perez <fperez@colorado.edu>
2709
2719
2710 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2720 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2711 LSString and SList classes which allow transparent conversions
2721 LSString and SList classes which allow transparent conversions
2712 between list mode and whitespace-separated string.
2722 between list mode and whitespace-separated string.
2713 (magic_r): Fix recursion problem in %r.
2723 (magic_r): Fix recursion problem in %r.
2714
2724
2715 * IPython/genutils.py (LSString): New class to be used for
2725 * IPython/genutils.py (LSString): New class to be used for
2716 automatic storage of the results of all alias/system calls in _o
2726 automatic storage of the results of all alias/system calls in _o
2717 and _e (stdout/err). These provide a .l/.list attribute which
2727 and _e (stdout/err). These provide a .l/.list attribute which
2718 does automatic splitting on newlines. This means that for most
2728 does automatic splitting on newlines. This means that for most
2719 uses, you'll never need to do capturing of output with %sc/%sx
2729 uses, you'll never need to do capturing of output with %sc/%sx
2720 anymore, since ipython keeps this always done for you. Note that
2730 anymore, since ipython keeps this always done for you. Note that
2721 only the LAST results are stored, the _o/e variables are
2731 only the LAST results are stored, the _o/e variables are
2722 overwritten on each call. If you need to save their contents
2732 overwritten on each call. If you need to save their contents
2723 further, simply bind them to any other name.
2733 further, simply bind them to any other name.
2724
2734
2725 2005-03-17 Fernando Perez <fperez@colorado.edu>
2735 2005-03-17 Fernando Perez <fperez@colorado.edu>
2726
2736
2727 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2737 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2728 prompt namespace handling.
2738 prompt namespace handling.
2729
2739
2730 2005-03-16 Fernando Perez <fperez@colorado.edu>
2740 2005-03-16 Fernando Perez <fperez@colorado.edu>
2731
2741
2732 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2742 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2733 classic prompts to be '>>> ' (final space was missing, and it
2743 classic prompts to be '>>> ' (final space was missing, and it
2734 trips the emacs python mode).
2744 trips the emacs python mode).
2735 (BasePrompt.__str__): Added safe support for dynamic prompt
2745 (BasePrompt.__str__): Added safe support for dynamic prompt
2736 strings. Now you can set your prompt string to be '$x', and the
2746 strings. Now you can set your prompt string to be '$x', and the
2737 value of x will be printed from your interactive namespace. The
2747 value of x will be printed from your interactive namespace. The
2738 interpolation syntax includes the full Itpl support, so
2748 interpolation syntax includes the full Itpl support, so
2739 ${foo()+x+bar()} is a valid prompt string now, and the function
2749 ${foo()+x+bar()} is a valid prompt string now, and the function
2740 calls will be made at runtime.
2750 calls will be made at runtime.
2741
2751
2742 2005-03-15 Fernando Perez <fperez@colorado.edu>
2752 2005-03-15 Fernando Perez <fperez@colorado.edu>
2743
2753
2744 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2754 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2745 avoid name clashes in pylab. %hist still works, it just forwards
2755 avoid name clashes in pylab. %hist still works, it just forwards
2746 the call to %history.
2756 the call to %history.
2747
2757
2748 2005-03-02 *** Released version 0.6.12
2758 2005-03-02 *** Released version 0.6.12
2749
2759
2750 2005-03-02 Fernando Perez <fperez@colorado.edu>
2760 2005-03-02 Fernando Perez <fperez@colorado.edu>
2751
2761
2752 * IPython/iplib.py (handle_magic): log magic calls properly as
2762 * IPython/iplib.py (handle_magic): log magic calls properly as
2753 ipmagic() function calls.
2763 ipmagic() function calls.
2754
2764
2755 * IPython/Magic.py (magic_time): Improved %time to support
2765 * IPython/Magic.py (magic_time): Improved %time to support
2756 statements and provide wall-clock as well as CPU time.
2766 statements and provide wall-clock as well as CPU time.
2757
2767
2758 2005-02-27 Fernando Perez <fperez@colorado.edu>
2768 2005-02-27 Fernando Perez <fperez@colorado.edu>
2759
2769
2760 * IPython/hooks.py: New hooks module, to expose user-modifiable
2770 * IPython/hooks.py: New hooks module, to expose user-modifiable
2761 IPython functionality in a clean manner. For now only the editor
2771 IPython functionality in a clean manner. For now only the editor
2762 hook is actually written, and other thigns which I intend to turn
2772 hook is actually written, and other thigns which I intend to turn
2763 into proper hooks aren't yet there. The display and prefilter
2773 into proper hooks aren't yet there. The display and prefilter
2764 stuff, for example, should be hooks. But at least now the
2774 stuff, for example, should be hooks. But at least now the
2765 framework is in place, and the rest can be moved here with more
2775 framework is in place, and the rest can be moved here with more
2766 time later. IPython had had a .hooks variable for a long time for
2776 time later. IPython had had a .hooks variable for a long time for
2767 this purpose, but I'd never actually used it for anything.
2777 this purpose, but I'd never actually used it for anything.
2768
2778
2769 2005-02-26 Fernando Perez <fperez@colorado.edu>
2779 2005-02-26 Fernando Perez <fperez@colorado.edu>
2770
2780
2771 * IPython/ipmaker.py (make_IPython): make the default ipython
2781 * IPython/ipmaker.py (make_IPython): make the default ipython
2772 directory be called _ipython under win32, to follow more the
2782 directory be called _ipython under win32, to follow more the
2773 naming peculiarities of that platform (where buggy software like
2783 naming peculiarities of that platform (where buggy software like
2774 Visual Sourcesafe breaks with .named directories). Reported by
2784 Visual Sourcesafe breaks with .named directories). Reported by
2775 Ville Vainio.
2785 Ville Vainio.
2776
2786
2777 2005-02-23 Fernando Perez <fperez@colorado.edu>
2787 2005-02-23 Fernando Perez <fperez@colorado.edu>
2778
2788
2779 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2789 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2780 auto_aliases for win32 which were causing problems. Users can
2790 auto_aliases for win32 which were causing problems. Users can
2781 define the ones they personally like.
2791 define the ones they personally like.
2782
2792
2783 2005-02-21 Fernando Perez <fperez@colorado.edu>
2793 2005-02-21 Fernando Perez <fperez@colorado.edu>
2784
2794
2785 * IPython/Magic.py (magic_time): new magic to time execution of
2795 * IPython/Magic.py (magic_time): new magic to time execution of
2786 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2796 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2787
2797
2788 2005-02-19 Fernando Perez <fperez@colorado.edu>
2798 2005-02-19 Fernando Perez <fperez@colorado.edu>
2789
2799
2790 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2800 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2791 into keys (for prompts, for example).
2801 into keys (for prompts, for example).
2792
2802
2793 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2803 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2794 prompts in case users want them. This introduces a small behavior
2804 prompts in case users want them. This introduces a small behavior
2795 change: ipython does not automatically add a space to all prompts
2805 change: ipython does not automatically add a space to all prompts
2796 anymore. To get the old prompts with a space, users should add it
2806 anymore. To get the old prompts with a space, users should add it
2797 manually to their ipythonrc file, so for example prompt_in1 should
2807 manually to their ipythonrc file, so for example prompt_in1 should
2798 now read 'In [\#]: ' instead of 'In [\#]:'.
2808 now read 'In [\#]: ' instead of 'In [\#]:'.
2799 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2809 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2800 file) to control left-padding of secondary prompts.
2810 file) to control left-padding of secondary prompts.
2801
2811
2802 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2812 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2803 the profiler can't be imported. Fix for Debian, which removed
2813 the profiler can't be imported. Fix for Debian, which removed
2804 profile.py because of License issues. I applied a slightly
2814 profile.py because of License issues. I applied a slightly
2805 modified version of the original Debian patch at
2815 modified version of the original Debian patch at
2806 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2816 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2807
2817
2808 2005-02-17 Fernando Perez <fperez@colorado.edu>
2818 2005-02-17 Fernando Perez <fperez@colorado.edu>
2809
2819
2810 * IPython/genutils.py (native_line_ends): Fix bug which would
2820 * IPython/genutils.py (native_line_ends): Fix bug which would
2811 cause improper line-ends under win32 b/c I was not opening files
2821 cause improper line-ends under win32 b/c I was not opening files
2812 in binary mode. Bug report and fix thanks to Ville.
2822 in binary mode. Bug report and fix thanks to Ville.
2813
2823
2814 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2824 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2815 trying to catch spurious foo[1] autocalls. My fix actually broke
2825 trying to catch spurious foo[1] autocalls. My fix actually broke
2816 ',/' autoquote/call with explicit escape (bad regexp).
2826 ',/' autoquote/call with explicit escape (bad regexp).
2817
2827
2818 2005-02-15 *** Released version 0.6.11
2828 2005-02-15 *** Released version 0.6.11
2819
2829
2820 2005-02-14 Fernando Perez <fperez@colorado.edu>
2830 2005-02-14 Fernando Perez <fperez@colorado.edu>
2821
2831
2822 * IPython/background_jobs.py: New background job management
2832 * IPython/background_jobs.py: New background job management
2823 subsystem. This is implemented via a new set of classes, and
2833 subsystem. This is implemented via a new set of classes, and
2824 IPython now provides a builtin 'jobs' object for background job
2834 IPython now provides a builtin 'jobs' object for background job
2825 execution. A convenience %bg magic serves as a lightweight
2835 execution. A convenience %bg magic serves as a lightweight
2826 frontend for starting the more common type of calls. This was
2836 frontend for starting the more common type of calls. This was
2827 inspired by discussions with B. Granger and the BackgroundCommand
2837 inspired by discussions with B. Granger and the BackgroundCommand
2828 class described in the book Python Scripting for Computational
2838 class described in the book Python Scripting for Computational
2829 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2839 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2830 (although ultimately no code from this text was used, as IPython's
2840 (although ultimately no code from this text was used, as IPython's
2831 system is a separate implementation).
2841 system is a separate implementation).
2832
2842
2833 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2843 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2834 to control the completion of single/double underscore names
2844 to control the completion of single/double underscore names
2835 separately. As documented in the example ipytonrc file, the
2845 separately. As documented in the example ipytonrc file, the
2836 readline_omit__names variable can now be set to 2, to omit even
2846 readline_omit__names variable can now be set to 2, to omit even
2837 single underscore names. Thanks to a patch by Brian Wong
2847 single underscore names. Thanks to a patch by Brian Wong
2838 <BrianWong-AT-AirgoNetworks.Com>.
2848 <BrianWong-AT-AirgoNetworks.Com>.
2839 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2849 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2840 be autocalled as foo([1]) if foo were callable. A problem for
2850 be autocalled as foo([1]) if foo were callable. A problem for
2841 things which are both callable and implement __getitem__.
2851 things which are both callable and implement __getitem__.
2842 (init_readline): Fix autoindentation for win32. Thanks to a patch
2852 (init_readline): Fix autoindentation for win32. Thanks to a patch
2843 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2853 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2844
2854
2845 2005-02-12 Fernando Perez <fperez@colorado.edu>
2855 2005-02-12 Fernando Perez <fperez@colorado.edu>
2846
2856
2847 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2857 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2848 which I had written long ago to sort out user error messages which
2858 which I had written long ago to sort out user error messages which
2849 may occur during startup. This seemed like a good idea initially,
2859 may occur during startup. This seemed like a good idea initially,
2850 but it has proven a disaster in retrospect. I don't want to
2860 but it has proven a disaster in retrospect. I don't want to
2851 change much code for now, so my fix is to set the internal 'debug'
2861 change much code for now, so my fix is to set the internal 'debug'
2852 flag to true everywhere, whose only job was precisely to control
2862 flag to true everywhere, whose only job was precisely to control
2853 this subsystem. This closes issue 28 (as well as avoiding all
2863 this subsystem. This closes issue 28 (as well as avoiding all
2854 sorts of strange hangups which occur from time to time).
2864 sorts of strange hangups which occur from time to time).
2855
2865
2856 2005-02-07 Fernando Perez <fperez@colorado.edu>
2866 2005-02-07 Fernando Perez <fperez@colorado.edu>
2857
2867
2858 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2868 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2859 previous call produced a syntax error.
2869 previous call produced a syntax error.
2860
2870
2861 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2871 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2862 classes without constructor.
2872 classes without constructor.
2863
2873
2864 2005-02-06 Fernando Perez <fperez@colorado.edu>
2874 2005-02-06 Fernando Perez <fperez@colorado.edu>
2865
2875
2866 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2876 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2867 completions with the results of each matcher, so we return results
2877 completions with the results of each matcher, so we return results
2868 to the user from all namespaces. This breaks with ipython
2878 to the user from all namespaces. This breaks with ipython
2869 tradition, but I think it's a nicer behavior. Now you get all
2879 tradition, but I think it's a nicer behavior. Now you get all
2870 possible completions listed, from all possible namespaces (python,
2880 possible completions listed, from all possible namespaces (python,
2871 filesystem, magics...) After a request by John Hunter
2881 filesystem, magics...) After a request by John Hunter
2872 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2882 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2873
2883
2874 2005-02-05 Fernando Perez <fperez@colorado.edu>
2884 2005-02-05 Fernando Perez <fperez@colorado.edu>
2875
2885
2876 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2886 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2877 the call had quote characters in it (the quotes were stripped).
2887 the call had quote characters in it (the quotes were stripped).
2878
2888
2879 2005-01-31 Fernando Perez <fperez@colorado.edu>
2889 2005-01-31 Fernando Perez <fperez@colorado.edu>
2880
2890
2881 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2891 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2882 Itpl.itpl() to make the code more robust against psyco
2892 Itpl.itpl() to make the code more robust against psyco
2883 optimizations.
2893 optimizations.
2884
2894
2885 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2895 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2886 of causing an exception. Quicker, cleaner.
2896 of causing an exception. Quicker, cleaner.
2887
2897
2888 2005-01-28 Fernando Perez <fperez@colorado.edu>
2898 2005-01-28 Fernando Perez <fperez@colorado.edu>
2889
2899
2890 * scripts/ipython_win_post_install.py (install): hardcode
2900 * scripts/ipython_win_post_install.py (install): hardcode
2891 sys.prefix+'python.exe' as the executable path. It turns out that
2901 sys.prefix+'python.exe' as the executable path. It turns out that
2892 during the post-installation run, sys.executable resolves to the
2902 during the post-installation run, sys.executable resolves to the
2893 name of the binary installer! I should report this as a distutils
2903 name of the binary installer! I should report this as a distutils
2894 bug, I think. I updated the .10 release with this tiny fix, to
2904 bug, I think. I updated the .10 release with this tiny fix, to
2895 avoid annoying the lists further.
2905 avoid annoying the lists further.
2896
2906
2897 2005-01-27 *** Released version 0.6.10
2907 2005-01-27 *** Released version 0.6.10
2898
2908
2899 2005-01-27 Fernando Perez <fperez@colorado.edu>
2909 2005-01-27 Fernando Perez <fperez@colorado.edu>
2900
2910
2901 * IPython/numutils.py (norm): Added 'inf' as optional name for
2911 * IPython/numutils.py (norm): Added 'inf' as optional name for
2902 L-infinity norm, included references to mathworld.com for vector
2912 L-infinity norm, included references to mathworld.com for vector
2903 norm definitions.
2913 norm definitions.
2904 (amin/amax): added amin/amax for array min/max. Similar to what
2914 (amin/amax): added amin/amax for array min/max. Similar to what
2905 pylab ships with after the recent reorganization of names.
2915 pylab ships with after the recent reorganization of names.
2906 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2916 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2907
2917
2908 * ipython.el: committed Alex's recent fixes and improvements.
2918 * ipython.el: committed Alex's recent fixes and improvements.
2909 Tested with python-mode from CVS, and it looks excellent. Since
2919 Tested with python-mode from CVS, and it looks excellent. Since
2910 python-mode hasn't released anything in a while, I'm temporarily
2920 python-mode hasn't released anything in a while, I'm temporarily
2911 putting a copy of today's CVS (v 4.70) of python-mode in:
2921 putting a copy of today's CVS (v 4.70) of python-mode in:
2912 http://ipython.scipy.org/tmp/python-mode.el
2922 http://ipython.scipy.org/tmp/python-mode.el
2913
2923
2914 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2924 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2915 sys.executable for the executable name, instead of assuming it's
2925 sys.executable for the executable name, instead of assuming it's
2916 called 'python.exe' (the post-installer would have produced broken
2926 called 'python.exe' (the post-installer would have produced broken
2917 setups on systems with a differently named python binary).
2927 setups on systems with a differently named python binary).
2918
2928
2919 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2929 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2920 references to os.linesep, to make the code more
2930 references to os.linesep, to make the code more
2921 platform-independent. This is also part of the win32 coloring
2931 platform-independent. This is also part of the win32 coloring
2922 fixes.
2932 fixes.
2923
2933
2924 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2934 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2925 lines, which actually cause coloring bugs because the length of
2935 lines, which actually cause coloring bugs because the length of
2926 the line is very difficult to correctly compute with embedded
2936 the line is very difficult to correctly compute with embedded
2927 escapes. This was the source of all the coloring problems under
2937 escapes. This was the source of all the coloring problems under
2928 Win32. I think that _finally_, Win32 users have a properly
2938 Win32. I think that _finally_, Win32 users have a properly
2929 working ipython in all respects. This would never have happened
2939 working ipython in all respects. This would never have happened
2930 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2940 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2931
2941
2932 2005-01-26 *** Released version 0.6.9
2942 2005-01-26 *** Released version 0.6.9
2933
2943
2934 2005-01-25 Fernando Perez <fperez@colorado.edu>
2944 2005-01-25 Fernando Perez <fperez@colorado.edu>
2935
2945
2936 * setup.py: finally, we have a true Windows installer, thanks to
2946 * setup.py: finally, we have a true Windows installer, thanks to
2937 the excellent work of Viktor Ransmayr
2947 the excellent work of Viktor Ransmayr
2938 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2948 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2939 Windows users. The setup routine is quite a bit cleaner thanks to
2949 Windows users. The setup routine is quite a bit cleaner thanks to
2940 this, and the post-install script uses the proper functions to
2950 this, and the post-install script uses the proper functions to
2941 allow a clean de-installation using the standard Windows Control
2951 allow a clean de-installation using the standard Windows Control
2942 Panel.
2952 Panel.
2943
2953
2944 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2954 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2945 environment variable under all OSes (including win32) if
2955 environment variable under all OSes (including win32) if
2946 available. This will give consistency to win32 users who have set
2956 available. This will give consistency to win32 users who have set
2947 this variable for any reason. If os.environ['HOME'] fails, the
2957 this variable for any reason. If os.environ['HOME'] fails, the
2948 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2958 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2949
2959
2950 2005-01-24 Fernando Perez <fperez@colorado.edu>
2960 2005-01-24 Fernando Perez <fperez@colorado.edu>
2951
2961
2952 * IPython/numutils.py (empty_like): add empty_like(), similar to
2962 * IPython/numutils.py (empty_like): add empty_like(), similar to
2953 zeros_like() but taking advantage of the new empty() Numeric routine.
2963 zeros_like() but taking advantage of the new empty() Numeric routine.
2954
2964
2955 2005-01-23 *** Released version 0.6.8
2965 2005-01-23 *** Released version 0.6.8
2956
2966
2957 2005-01-22 Fernando Perez <fperez@colorado.edu>
2967 2005-01-22 Fernando Perez <fperez@colorado.edu>
2958
2968
2959 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2969 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2960 automatic show() calls. After discussing things with JDH, it
2970 automatic show() calls. After discussing things with JDH, it
2961 turns out there are too many corner cases where this can go wrong.
2971 turns out there are too many corner cases where this can go wrong.
2962 It's best not to try to be 'too smart', and simply have ipython
2972 It's best not to try to be 'too smart', and simply have ipython
2963 reproduce as much as possible the default behavior of a normal
2973 reproduce as much as possible the default behavior of a normal
2964 python shell.
2974 python shell.
2965
2975
2966 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2976 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2967 line-splitting regexp and _prefilter() to avoid calling getattr()
2977 line-splitting regexp and _prefilter() to avoid calling getattr()
2968 on assignments. This closes
2978 on assignments. This closes
2969 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2979 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2970 readline uses getattr(), so a simple <TAB> keypress is still
2980 readline uses getattr(), so a simple <TAB> keypress is still
2971 enough to trigger getattr() calls on an object.
2981 enough to trigger getattr() calls on an object.
2972
2982
2973 2005-01-21 Fernando Perez <fperez@colorado.edu>
2983 2005-01-21 Fernando Perez <fperez@colorado.edu>
2974
2984
2975 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2985 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2976 docstring under pylab so it doesn't mask the original.
2986 docstring under pylab so it doesn't mask the original.
2977
2987
2978 2005-01-21 *** Released version 0.6.7
2988 2005-01-21 *** Released version 0.6.7
2979
2989
2980 2005-01-21 Fernando Perez <fperez@colorado.edu>
2990 2005-01-21 Fernando Perez <fperez@colorado.edu>
2981
2991
2982 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2992 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2983 signal handling for win32 users in multithreaded mode.
2993 signal handling for win32 users in multithreaded mode.
2984
2994
2985 2005-01-17 Fernando Perez <fperez@colorado.edu>
2995 2005-01-17 Fernando Perez <fperez@colorado.edu>
2986
2996
2987 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2997 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2988 instances with no __init__. After a crash report by Norbert Nemec
2998 instances with no __init__. After a crash report by Norbert Nemec
2989 <Norbert-AT-nemec-online.de>.
2999 <Norbert-AT-nemec-online.de>.
2990
3000
2991 2005-01-14 Fernando Perez <fperez@colorado.edu>
3001 2005-01-14 Fernando Perez <fperez@colorado.edu>
2992
3002
2993 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3003 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2994 names for verbose exceptions, when multiple dotted names and the
3004 names for verbose exceptions, when multiple dotted names and the
2995 'parent' object were present on the same line.
3005 'parent' object were present on the same line.
2996
3006
2997 2005-01-11 Fernando Perez <fperez@colorado.edu>
3007 2005-01-11 Fernando Perez <fperez@colorado.edu>
2998
3008
2999 * IPython/genutils.py (flag_calls): new utility to trap and flag
3009 * IPython/genutils.py (flag_calls): new utility to trap and flag
3000 calls in functions. I need it to clean up matplotlib support.
3010 calls in functions. I need it to clean up matplotlib support.
3001 Also removed some deprecated code in genutils.
3011 Also removed some deprecated code in genutils.
3002
3012
3003 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3013 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3004 that matplotlib scripts called with %run, which don't call show()
3014 that matplotlib scripts called with %run, which don't call show()
3005 themselves, still have their plotting windows open.
3015 themselves, still have their plotting windows open.
3006
3016
3007 2005-01-05 Fernando Perez <fperez@colorado.edu>
3017 2005-01-05 Fernando Perez <fperez@colorado.edu>
3008
3018
3009 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3019 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3010 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3020 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3011
3021
3012 2004-12-19 Fernando Perez <fperez@colorado.edu>
3022 2004-12-19 Fernando Perez <fperez@colorado.edu>
3013
3023
3014 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3024 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3015 parent_runcode, which was an eyesore. The same result can be
3025 parent_runcode, which was an eyesore. The same result can be
3016 obtained with Python's regular superclass mechanisms.
3026 obtained with Python's regular superclass mechanisms.
3017
3027
3018 2004-12-17 Fernando Perez <fperez@colorado.edu>
3028 2004-12-17 Fernando Perez <fperez@colorado.edu>
3019
3029
3020 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3030 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3021 reported by Prabhu.
3031 reported by Prabhu.
3022 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3032 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3023 sys.stderr) instead of explicitly calling sys.stderr. This helps
3033 sys.stderr) instead of explicitly calling sys.stderr. This helps
3024 maintain our I/O abstractions clean, for future GUI embeddings.
3034 maintain our I/O abstractions clean, for future GUI embeddings.
3025
3035
3026 * IPython/genutils.py (info): added new utility for sys.stderr
3036 * IPython/genutils.py (info): added new utility for sys.stderr
3027 unified info message handling (thin wrapper around warn()).
3037 unified info message handling (thin wrapper around warn()).
3028
3038
3029 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3039 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3030 composite (dotted) names on verbose exceptions.
3040 composite (dotted) names on verbose exceptions.
3031 (VerboseTB.nullrepr): harden against another kind of errors which
3041 (VerboseTB.nullrepr): harden against another kind of errors which
3032 Python's inspect module can trigger, and which were crashing
3042 Python's inspect module can trigger, and which were crashing
3033 IPython. Thanks to a report by Marco Lombardi
3043 IPython. Thanks to a report by Marco Lombardi
3034 <mlombard-AT-ma010192.hq.eso.org>.
3044 <mlombard-AT-ma010192.hq.eso.org>.
3035
3045
3036 2004-12-13 *** Released version 0.6.6
3046 2004-12-13 *** Released version 0.6.6
3037
3047
3038 2004-12-12 Fernando Perez <fperez@colorado.edu>
3048 2004-12-12 Fernando Perez <fperez@colorado.edu>
3039
3049
3040 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3050 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3041 generated by pygtk upon initialization if it was built without
3051 generated by pygtk upon initialization if it was built without
3042 threads (for matplotlib users). After a crash reported by
3052 threads (for matplotlib users). After a crash reported by
3043 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3053 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3044
3054
3045 * IPython/ipmaker.py (make_IPython): fix small bug in the
3055 * IPython/ipmaker.py (make_IPython): fix small bug in the
3046 import_some parameter for multiple imports.
3056 import_some parameter for multiple imports.
3047
3057
3048 * IPython/iplib.py (ipmagic): simplified the interface of
3058 * IPython/iplib.py (ipmagic): simplified the interface of
3049 ipmagic() to take a single string argument, just as it would be
3059 ipmagic() to take a single string argument, just as it would be
3050 typed at the IPython cmd line.
3060 typed at the IPython cmd line.
3051 (ipalias): Added new ipalias() with an interface identical to
3061 (ipalias): Added new ipalias() with an interface identical to
3052 ipmagic(). This completes exposing a pure python interface to the
3062 ipmagic(). This completes exposing a pure python interface to the
3053 alias and magic system, which can be used in loops or more complex
3063 alias and magic system, which can be used in loops or more complex
3054 code where IPython's automatic line mangling is not active.
3064 code where IPython's automatic line mangling is not active.
3055
3065
3056 * IPython/genutils.py (timing): changed interface of timing to
3066 * IPython/genutils.py (timing): changed interface of timing to
3057 simply run code once, which is the most common case. timings()
3067 simply run code once, which is the most common case. timings()
3058 remains unchanged, for the cases where you want multiple runs.
3068 remains unchanged, for the cases where you want multiple runs.
3059
3069
3060 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3070 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3061 bug where Python2.2 crashes with exec'ing code which does not end
3071 bug where Python2.2 crashes with exec'ing code which does not end
3062 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3072 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3063 before.
3073 before.
3064
3074
3065 2004-12-10 Fernando Perez <fperez@colorado.edu>
3075 2004-12-10 Fernando Perez <fperez@colorado.edu>
3066
3076
3067 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3077 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3068 -t to -T, to accomodate the new -t flag in %run (the %run and
3078 -t to -T, to accomodate the new -t flag in %run (the %run and
3069 %prun options are kind of intermixed, and it's not easy to change
3079 %prun options are kind of intermixed, and it's not easy to change
3070 this with the limitations of python's getopt).
3080 this with the limitations of python's getopt).
3071
3081
3072 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3082 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3073 the execution of scripts. It's not as fine-tuned as timeit.py,
3083 the execution of scripts. It's not as fine-tuned as timeit.py,
3074 but it works from inside ipython (and under 2.2, which lacks
3084 but it works from inside ipython (and under 2.2, which lacks
3075 timeit.py). Optionally a number of runs > 1 can be given for
3085 timeit.py). Optionally a number of runs > 1 can be given for
3076 timing very short-running code.
3086 timing very short-running code.
3077
3087
3078 * IPython/genutils.py (uniq_stable): new routine which returns a
3088 * IPython/genutils.py (uniq_stable): new routine which returns a
3079 list of unique elements in any iterable, but in stable order of
3089 list of unique elements in any iterable, but in stable order of
3080 appearance. I needed this for the ultraTB fixes, and it's a handy
3090 appearance. I needed this for the ultraTB fixes, and it's a handy
3081 utility.
3091 utility.
3082
3092
3083 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3093 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
3084 dotted names in Verbose exceptions. This had been broken since
3094 dotted names in Verbose exceptions. This had been broken since
3085 the very start, now x.y will properly be printed in a Verbose
3095 the very start, now x.y will properly be printed in a Verbose
3086 traceback, instead of x being shown and y appearing always as an
3096 traceback, instead of x being shown and y appearing always as an
3087 'undefined global'. Getting this to work was a bit tricky,
3097 'undefined global'. Getting this to work was a bit tricky,
3088 because by default python tokenizers are stateless. Saved by
3098 because by default python tokenizers are stateless. Saved by
3089 python's ability to easily add a bit of state to an arbitrary
3099 python's ability to easily add a bit of state to an arbitrary
3090 function (without needing to build a full-blown callable object).
3100 function (without needing to build a full-blown callable object).
3091
3101
3092 Also big cleanup of this code, which had horrendous runtime
3102 Also big cleanup of this code, which had horrendous runtime
3093 lookups of zillions of attributes for colorization. Moved all
3103 lookups of zillions of attributes for colorization. Moved all
3094 this code into a few templates, which make it cleaner and quicker.
3104 this code into a few templates, which make it cleaner and quicker.
3095
3105
3096 Printout quality was also improved for Verbose exceptions: one
3106 Printout quality was also improved for Verbose exceptions: one
3097 variable per line, and memory addresses are printed (this can be
3107 variable per line, and memory addresses are printed (this can be
3098 quite handy in nasty debugging situations, which is what Verbose
3108 quite handy in nasty debugging situations, which is what Verbose
3099 is for).
3109 is for).
3100
3110
3101 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3111 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3102 the command line as scripts to be loaded by embedded instances.
3112 the command line as scripts to be loaded by embedded instances.
3103 Doing so has the potential for an infinite recursion if there are
3113 Doing so has the potential for an infinite recursion if there are
3104 exceptions thrown in the process. This fixes a strange crash
3114 exceptions thrown in the process. This fixes a strange crash
3105 reported by Philippe MULLER <muller-AT-irit.fr>.
3115 reported by Philippe MULLER <muller-AT-irit.fr>.
3106
3116
3107 2004-12-09 Fernando Perez <fperez@colorado.edu>
3117 2004-12-09 Fernando Perez <fperez@colorado.edu>
3108
3118
3109 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3119 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3110 to reflect new names in matplotlib, which now expose the
3120 to reflect new names in matplotlib, which now expose the
3111 matlab-compatible interface via a pylab module instead of the
3121 matlab-compatible interface via a pylab module instead of the
3112 'matlab' name. The new code is backwards compatible, so users of
3122 'matlab' name. The new code is backwards compatible, so users of
3113 all matplotlib versions are OK. Patch by J. Hunter.
3123 all matplotlib versions are OK. Patch by J. Hunter.
3114
3124
3115 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3125 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3116 of __init__ docstrings for instances (class docstrings are already
3126 of __init__ docstrings for instances (class docstrings are already
3117 automatically printed). Instances with customized docstrings
3127 automatically printed). Instances with customized docstrings
3118 (indep. of the class) are also recognized and all 3 separate
3128 (indep. of the class) are also recognized and all 3 separate
3119 docstrings are printed (instance, class, constructor). After some
3129 docstrings are printed (instance, class, constructor). After some
3120 comments/suggestions by J. Hunter.
3130 comments/suggestions by J. Hunter.
3121
3131
3122 2004-12-05 Fernando Perez <fperez@colorado.edu>
3132 2004-12-05 Fernando Perez <fperez@colorado.edu>
3123
3133
3124 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3134 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3125 warnings when tab-completion fails and triggers an exception.
3135 warnings when tab-completion fails and triggers an exception.
3126
3136
3127 2004-12-03 Fernando Perez <fperez@colorado.edu>
3137 2004-12-03 Fernando Perez <fperez@colorado.edu>
3128
3138
3129 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3139 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3130 be triggered when using 'run -p'. An incorrect option flag was
3140 be triggered when using 'run -p'. An incorrect option flag was
3131 being set ('d' instead of 'D').
3141 being set ('d' instead of 'D').
3132 (manpage): fix missing escaped \- sign.
3142 (manpage): fix missing escaped \- sign.
3133
3143
3134 2004-11-30 *** Released version 0.6.5
3144 2004-11-30 *** Released version 0.6.5
3135
3145
3136 2004-11-30 Fernando Perez <fperez@colorado.edu>
3146 2004-11-30 Fernando Perez <fperez@colorado.edu>
3137
3147
3138 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3148 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3139 setting with -d option.
3149 setting with -d option.
3140
3150
3141 * setup.py (docfiles): Fix problem where the doc glob I was using
3151 * setup.py (docfiles): Fix problem where the doc glob I was using
3142 was COMPLETELY BROKEN. It was giving the right files by pure
3152 was COMPLETELY BROKEN. It was giving the right files by pure
3143 accident, but failed once I tried to include ipython.el. Note:
3153 accident, but failed once I tried to include ipython.el. Note:
3144 glob() does NOT allow you to do exclusion on multiple endings!
3154 glob() does NOT allow you to do exclusion on multiple endings!
3145
3155
3146 2004-11-29 Fernando Perez <fperez@colorado.edu>
3156 2004-11-29 Fernando Perez <fperez@colorado.edu>
3147
3157
3148 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3158 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3149 the manpage as the source. Better formatting & consistency.
3159 the manpage as the source. Better formatting & consistency.
3150
3160
3151 * IPython/Magic.py (magic_run): Added new -d option, to run
3161 * IPython/Magic.py (magic_run): Added new -d option, to run
3152 scripts under the control of the python pdb debugger. Note that
3162 scripts under the control of the python pdb debugger. Note that
3153 this required changing the %prun option -d to -D, to avoid a clash
3163 this required changing the %prun option -d to -D, to avoid a clash
3154 (since %run must pass options to %prun, and getopt is too dumb to
3164 (since %run must pass options to %prun, and getopt is too dumb to
3155 handle options with string values with embedded spaces). Thanks
3165 handle options with string values with embedded spaces). Thanks
3156 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3166 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3157 (magic_who_ls): added type matching to %who and %whos, so that one
3167 (magic_who_ls): added type matching to %who and %whos, so that one
3158 can filter their output to only include variables of certain
3168 can filter their output to only include variables of certain
3159 types. Another suggestion by Matthew.
3169 types. Another suggestion by Matthew.
3160 (magic_whos): Added memory summaries in kb and Mb for arrays.
3170 (magic_whos): Added memory summaries in kb and Mb for arrays.
3161 (magic_who): Improve formatting (break lines every 9 vars).
3171 (magic_who): Improve formatting (break lines every 9 vars).
3162
3172
3163 2004-11-28 Fernando Perez <fperez@colorado.edu>
3173 2004-11-28 Fernando Perez <fperez@colorado.edu>
3164
3174
3165 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3175 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3166 cache when empty lines were present.
3176 cache when empty lines were present.
3167
3177
3168 2004-11-24 Fernando Perez <fperez@colorado.edu>
3178 2004-11-24 Fernando Perez <fperez@colorado.edu>
3169
3179
3170 * IPython/usage.py (__doc__): document the re-activated threading
3180 * IPython/usage.py (__doc__): document the re-activated threading
3171 options for WX and GTK.
3181 options for WX and GTK.
3172
3182
3173 2004-11-23 Fernando Perez <fperez@colorado.edu>
3183 2004-11-23 Fernando Perez <fperez@colorado.edu>
3174
3184
3175 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3185 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3176 the -wthread and -gthread options, along with a new -tk one to try
3186 the -wthread and -gthread options, along with a new -tk one to try
3177 and coordinate Tk threading with wx/gtk. The tk support is very
3187 and coordinate Tk threading with wx/gtk. The tk support is very
3178 platform dependent, since it seems to require Tcl and Tk to be
3188 platform dependent, since it seems to require Tcl and Tk to be
3179 built with threads (Fedora1/2 appears NOT to have it, but in
3189 built with threads (Fedora1/2 appears NOT to have it, but in
3180 Prabhu's Debian boxes it works OK). But even with some Tk
3190 Prabhu's Debian boxes it works OK). But even with some Tk
3181 limitations, this is a great improvement.
3191 limitations, this is a great improvement.
3182
3192
3183 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3193 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3184 info in user prompts. Patch by Prabhu.
3194 info in user prompts. Patch by Prabhu.
3185
3195
3186 2004-11-18 Fernando Perez <fperez@colorado.edu>
3196 2004-11-18 Fernando Perez <fperez@colorado.edu>
3187
3197
3188 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3198 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3189 EOFErrors and bail, to avoid infinite loops if a non-terminating
3199 EOFErrors and bail, to avoid infinite loops if a non-terminating
3190 file is fed into ipython. Patch submitted in issue 19 by user,
3200 file is fed into ipython. Patch submitted in issue 19 by user,
3191 many thanks.
3201 many thanks.
3192
3202
3193 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3203 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3194 autoquote/parens in continuation prompts, which can cause lots of
3204 autoquote/parens in continuation prompts, which can cause lots of
3195 problems. Closes roundup issue 20.
3205 problems. Closes roundup issue 20.
3196
3206
3197 2004-11-17 Fernando Perez <fperez@colorado.edu>
3207 2004-11-17 Fernando Perez <fperez@colorado.edu>
3198
3208
3199 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3209 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3200 reported as debian bug #280505. I'm not sure my local changelog
3210 reported as debian bug #280505. I'm not sure my local changelog
3201 entry has the proper debian format (Jack?).
3211 entry has the proper debian format (Jack?).
3202
3212
3203 2004-11-08 *** Released version 0.6.4
3213 2004-11-08 *** Released version 0.6.4
3204
3214
3205 2004-11-08 Fernando Perez <fperez@colorado.edu>
3215 2004-11-08 Fernando Perez <fperez@colorado.edu>
3206
3216
3207 * IPython/iplib.py (init_readline): Fix exit message for Windows
3217 * IPython/iplib.py (init_readline): Fix exit message for Windows
3208 when readline is active. Thanks to a report by Eric Jones
3218 when readline is active. Thanks to a report by Eric Jones
3209 <eric-AT-enthought.com>.
3219 <eric-AT-enthought.com>.
3210
3220
3211 2004-11-07 Fernando Perez <fperez@colorado.edu>
3221 2004-11-07 Fernando Perez <fperez@colorado.edu>
3212
3222
3213 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3223 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3214 sometimes seen by win2k/cygwin users.
3224 sometimes seen by win2k/cygwin users.
3215
3225
3216 2004-11-06 Fernando Perez <fperez@colorado.edu>
3226 2004-11-06 Fernando Perez <fperez@colorado.edu>
3217
3227
3218 * IPython/iplib.py (interact): Change the handling of %Exit from
3228 * IPython/iplib.py (interact): Change the handling of %Exit from
3219 trying to propagate a SystemExit to an internal ipython flag.
3229 trying to propagate a SystemExit to an internal ipython flag.
3220 This is less elegant than using Python's exception mechanism, but
3230 This is less elegant than using Python's exception mechanism, but
3221 I can't get that to work reliably with threads, so under -pylab
3231 I can't get that to work reliably with threads, so under -pylab
3222 %Exit was hanging IPython. Cross-thread exception handling is
3232 %Exit was hanging IPython. Cross-thread exception handling is
3223 really a bitch. Thaks to a bug report by Stephen Walton
3233 really a bitch. Thaks to a bug report by Stephen Walton
3224 <stephen.walton-AT-csun.edu>.
3234 <stephen.walton-AT-csun.edu>.
3225
3235
3226 2004-11-04 Fernando Perez <fperez@colorado.edu>
3236 2004-11-04 Fernando Perez <fperez@colorado.edu>
3227
3237
3228 * IPython/iplib.py (raw_input_original): store a pointer to the
3238 * IPython/iplib.py (raw_input_original): store a pointer to the
3229 true raw_input to harden against code which can modify it
3239 true raw_input to harden against code which can modify it
3230 (wx.py.PyShell does this and would otherwise crash ipython).
3240 (wx.py.PyShell does this and would otherwise crash ipython).
3231 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3241 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3232
3242
3233 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3243 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3234 Ctrl-C problem, which does not mess up the input line.
3244 Ctrl-C problem, which does not mess up the input line.
3235
3245
3236 2004-11-03 Fernando Perez <fperez@colorado.edu>
3246 2004-11-03 Fernando Perez <fperez@colorado.edu>
3237
3247
3238 * IPython/Release.py: Changed licensing to BSD, in all files.
3248 * IPython/Release.py: Changed licensing to BSD, in all files.
3239 (name): lowercase name for tarball/RPM release.
3249 (name): lowercase name for tarball/RPM release.
3240
3250
3241 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3251 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3242 use throughout ipython.
3252 use throughout ipython.
3243
3253
3244 * IPython/Magic.py (Magic._ofind): Switch to using the new
3254 * IPython/Magic.py (Magic._ofind): Switch to using the new
3245 OInspect.getdoc() function.
3255 OInspect.getdoc() function.
3246
3256
3247 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3257 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3248 of the line currently being canceled via Ctrl-C. It's extremely
3258 of the line currently being canceled via Ctrl-C. It's extremely
3249 ugly, but I don't know how to do it better (the problem is one of
3259 ugly, but I don't know how to do it better (the problem is one of
3250 handling cross-thread exceptions).
3260 handling cross-thread exceptions).
3251
3261
3252 2004-10-28 Fernando Perez <fperez@colorado.edu>
3262 2004-10-28 Fernando Perez <fperez@colorado.edu>
3253
3263
3254 * IPython/Shell.py (signal_handler): add signal handlers to trap
3264 * IPython/Shell.py (signal_handler): add signal handlers to trap
3255 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3265 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3256 report by Francesc Alted.
3266 report by Francesc Alted.
3257
3267
3258 2004-10-21 Fernando Perez <fperez@colorado.edu>
3268 2004-10-21 Fernando Perez <fperez@colorado.edu>
3259
3269
3260 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3270 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3261 to % for pysh syntax extensions.
3271 to % for pysh syntax extensions.
3262
3272
3263 2004-10-09 Fernando Perez <fperez@colorado.edu>
3273 2004-10-09 Fernando Perez <fperez@colorado.edu>
3264
3274
3265 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3275 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3266 arrays to print a more useful summary, without calling str(arr).
3276 arrays to print a more useful summary, without calling str(arr).
3267 This avoids the problem of extremely lengthy computations which
3277 This avoids the problem of extremely lengthy computations which
3268 occur if arr is large, and appear to the user as a system lockup
3278 occur if arr is large, and appear to the user as a system lockup
3269 with 100% cpu activity. After a suggestion by Kristian Sandberg
3279 with 100% cpu activity. After a suggestion by Kristian Sandberg
3270 <Kristian.Sandberg@colorado.edu>.
3280 <Kristian.Sandberg@colorado.edu>.
3271 (Magic.__init__): fix bug in global magic escapes not being
3281 (Magic.__init__): fix bug in global magic escapes not being
3272 correctly set.
3282 correctly set.
3273
3283
3274 2004-10-08 Fernando Perez <fperez@colorado.edu>
3284 2004-10-08 Fernando Perez <fperez@colorado.edu>
3275
3285
3276 * IPython/Magic.py (__license__): change to absolute imports of
3286 * IPython/Magic.py (__license__): change to absolute imports of
3277 ipython's own internal packages, to start adapting to the absolute
3287 ipython's own internal packages, to start adapting to the absolute
3278 import requirement of PEP-328.
3288 import requirement of PEP-328.
3279
3289
3280 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3290 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3281 files, and standardize author/license marks through the Release
3291 files, and standardize author/license marks through the Release
3282 module instead of having per/file stuff (except for files with
3292 module instead of having per/file stuff (except for files with
3283 particular licenses, like the MIT/PSF-licensed codes).
3293 particular licenses, like the MIT/PSF-licensed codes).
3284
3294
3285 * IPython/Debugger.py: remove dead code for python 2.1
3295 * IPython/Debugger.py: remove dead code for python 2.1
3286
3296
3287 2004-10-04 Fernando Perez <fperez@colorado.edu>
3297 2004-10-04 Fernando Perez <fperez@colorado.edu>
3288
3298
3289 * IPython/iplib.py (ipmagic): New function for accessing magics
3299 * IPython/iplib.py (ipmagic): New function for accessing magics
3290 via a normal python function call.
3300 via a normal python function call.
3291
3301
3292 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3302 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3293 from '@' to '%', to accomodate the new @decorator syntax of python
3303 from '@' to '%', to accomodate the new @decorator syntax of python
3294 2.4.
3304 2.4.
3295
3305
3296 2004-09-29 Fernando Perez <fperez@colorado.edu>
3306 2004-09-29 Fernando Perez <fperez@colorado.edu>
3297
3307
3298 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3308 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3299 matplotlib.use to prevent running scripts which try to switch
3309 matplotlib.use to prevent running scripts which try to switch
3300 interactive backends from within ipython. This will just crash
3310 interactive backends from within ipython. This will just crash
3301 the python interpreter, so we can't allow it (but a detailed error
3311 the python interpreter, so we can't allow it (but a detailed error
3302 is given to the user).
3312 is given to the user).
3303
3313
3304 2004-09-28 Fernando Perez <fperez@colorado.edu>
3314 2004-09-28 Fernando Perez <fperez@colorado.edu>
3305
3315
3306 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3316 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3307 matplotlib-related fixes so that using @run with non-matplotlib
3317 matplotlib-related fixes so that using @run with non-matplotlib
3308 scripts doesn't pop up spurious plot windows. This requires
3318 scripts doesn't pop up spurious plot windows. This requires
3309 matplotlib >= 0.63, where I had to make some changes as well.
3319 matplotlib >= 0.63, where I had to make some changes as well.
3310
3320
3311 * IPython/ipmaker.py (make_IPython): update version requirement to
3321 * IPython/ipmaker.py (make_IPython): update version requirement to
3312 python 2.2.
3322 python 2.2.
3313
3323
3314 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3324 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3315 banner arg for embedded customization.
3325 banner arg for embedded customization.
3316
3326
3317 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3327 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3318 explicit uses of __IP as the IPython's instance name. Now things
3328 explicit uses of __IP as the IPython's instance name. Now things
3319 are properly handled via the shell.name value. The actual code
3329 are properly handled via the shell.name value. The actual code
3320 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3330 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3321 is much better than before. I'll clean things completely when the
3331 is much better than before. I'll clean things completely when the
3322 magic stuff gets a real overhaul.
3332 magic stuff gets a real overhaul.
3323
3333
3324 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3334 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3325 minor changes to debian dir.
3335 minor changes to debian dir.
3326
3336
3327 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3337 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3328 pointer to the shell itself in the interactive namespace even when
3338 pointer to the shell itself in the interactive namespace even when
3329 a user-supplied dict is provided. This is needed for embedding
3339 a user-supplied dict is provided. This is needed for embedding
3330 purposes (found by tests with Michel Sanner).
3340 purposes (found by tests with Michel Sanner).
3331
3341
3332 2004-09-27 Fernando Perez <fperez@colorado.edu>
3342 2004-09-27 Fernando Perez <fperez@colorado.edu>
3333
3343
3334 * IPython/UserConfig/ipythonrc: remove []{} from
3344 * IPython/UserConfig/ipythonrc: remove []{} from
3335 readline_remove_delims, so that things like [modname.<TAB> do
3345 readline_remove_delims, so that things like [modname.<TAB> do
3336 proper completion. This disables [].TAB, but that's a less common
3346 proper completion. This disables [].TAB, but that's a less common
3337 case than module names in list comprehensions, for example.
3347 case than module names in list comprehensions, for example.
3338 Thanks to a report by Andrea Riciputi.
3348 Thanks to a report by Andrea Riciputi.
3339
3349
3340 2004-09-09 Fernando Perez <fperez@colorado.edu>
3350 2004-09-09 Fernando Perez <fperez@colorado.edu>
3341
3351
3342 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3352 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3343 blocking problems in win32 and osx. Fix by John.
3353 blocking problems in win32 and osx. Fix by John.
3344
3354
3345 2004-09-08 Fernando Perez <fperez@colorado.edu>
3355 2004-09-08 Fernando Perez <fperez@colorado.edu>
3346
3356
3347 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3357 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3348 for Win32 and OSX. Fix by John Hunter.
3358 for Win32 and OSX. Fix by John Hunter.
3349
3359
3350 2004-08-30 *** Released version 0.6.3
3360 2004-08-30 *** Released version 0.6.3
3351
3361
3352 2004-08-30 Fernando Perez <fperez@colorado.edu>
3362 2004-08-30 Fernando Perez <fperez@colorado.edu>
3353
3363
3354 * setup.py (isfile): Add manpages to list of dependent files to be
3364 * setup.py (isfile): Add manpages to list of dependent files to be
3355 updated.
3365 updated.
3356
3366
3357 2004-08-27 Fernando Perez <fperez@colorado.edu>
3367 2004-08-27 Fernando Perez <fperez@colorado.edu>
3358
3368
3359 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3369 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3360 for now. They don't really work with standalone WX/GTK code
3370 for now. They don't really work with standalone WX/GTK code
3361 (though matplotlib IS working fine with both of those backends).
3371 (though matplotlib IS working fine with both of those backends).
3362 This will neeed much more testing. I disabled most things with
3372 This will neeed much more testing. I disabled most things with
3363 comments, so turning it back on later should be pretty easy.
3373 comments, so turning it back on later should be pretty easy.
3364
3374
3365 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3375 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3366 autocalling of expressions like r'foo', by modifying the line
3376 autocalling of expressions like r'foo', by modifying the line
3367 split regexp. Closes
3377 split regexp. Closes
3368 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3378 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3369 Riley <ipythonbugs-AT-sabi.net>.
3379 Riley <ipythonbugs-AT-sabi.net>.
3370 (InteractiveShell.mainloop): honor --nobanner with banner
3380 (InteractiveShell.mainloop): honor --nobanner with banner
3371 extensions.
3381 extensions.
3372
3382
3373 * IPython/Shell.py: Significant refactoring of all classes, so
3383 * IPython/Shell.py: Significant refactoring of all classes, so
3374 that we can really support ALL matplotlib backends and threading
3384 that we can really support ALL matplotlib backends and threading
3375 models (John spotted a bug with Tk which required this). Now we
3385 models (John spotted a bug with Tk which required this). Now we
3376 should support single-threaded, WX-threads and GTK-threads, both
3386 should support single-threaded, WX-threads and GTK-threads, both
3377 for generic code and for matplotlib.
3387 for generic code and for matplotlib.
3378
3388
3379 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3389 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3380 -pylab, to simplify things for users. Will also remove the pylab
3390 -pylab, to simplify things for users. Will also remove the pylab
3381 profile, since now all of matplotlib configuration is directly
3391 profile, since now all of matplotlib configuration is directly
3382 handled here. This also reduces startup time.
3392 handled here. This also reduces startup time.
3383
3393
3384 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3394 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3385 shell wasn't being correctly called. Also in IPShellWX.
3395 shell wasn't being correctly called. Also in IPShellWX.
3386
3396
3387 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3397 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3388 fine-tune banner.
3398 fine-tune banner.
3389
3399
3390 * IPython/numutils.py (spike): Deprecate these spike functions,
3400 * IPython/numutils.py (spike): Deprecate these spike functions,
3391 delete (long deprecated) gnuplot_exec handler.
3401 delete (long deprecated) gnuplot_exec handler.
3392
3402
3393 2004-08-26 Fernando Perez <fperez@colorado.edu>
3403 2004-08-26 Fernando Perez <fperez@colorado.edu>
3394
3404
3395 * ipython.1: Update for threading options, plus some others which
3405 * ipython.1: Update for threading options, plus some others which
3396 were missing.
3406 were missing.
3397
3407
3398 * IPython/ipmaker.py (__call__): Added -wthread option for
3408 * IPython/ipmaker.py (__call__): Added -wthread option for
3399 wxpython thread handling. Make sure threading options are only
3409 wxpython thread handling. Make sure threading options are only
3400 valid at the command line.
3410 valid at the command line.
3401
3411
3402 * scripts/ipython: moved shell selection into a factory function
3412 * scripts/ipython: moved shell selection into a factory function
3403 in Shell.py, to keep the starter script to a minimum.
3413 in Shell.py, to keep the starter script to a minimum.
3404
3414
3405 2004-08-25 Fernando Perez <fperez@colorado.edu>
3415 2004-08-25 Fernando Perez <fperez@colorado.edu>
3406
3416
3407 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3417 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3408 John. Along with some recent changes he made to matplotlib, the
3418 John. Along with some recent changes he made to matplotlib, the
3409 next versions of both systems should work very well together.
3419 next versions of both systems should work very well together.
3410
3420
3411 2004-08-24 Fernando Perez <fperez@colorado.edu>
3421 2004-08-24 Fernando Perez <fperez@colorado.edu>
3412
3422
3413 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3423 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3414 tried to switch the profiling to using hotshot, but I'm getting
3424 tried to switch the profiling to using hotshot, but I'm getting
3415 strange errors from prof.runctx() there. I may be misreading the
3425 strange errors from prof.runctx() there. I may be misreading the
3416 docs, but it looks weird. For now the profiling code will
3426 docs, but it looks weird. For now the profiling code will
3417 continue to use the standard profiler.
3427 continue to use the standard profiler.
3418
3428
3419 2004-08-23 Fernando Perez <fperez@colorado.edu>
3429 2004-08-23 Fernando Perez <fperez@colorado.edu>
3420
3430
3421 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3431 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3422 threaded shell, by John Hunter. It's not quite ready yet, but
3432 threaded shell, by John Hunter. It's not quite ready yet, but
3423 close.
3433 close.
3424
3434
3425 2004-08-22 Fernando Perez <fperez@colorado.edu>
3435 2004-08-22 Fernando Perez <fperez@colorado.edu>
3426
3436
3427 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3437 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3428 in Magic and ultraTB.
3438 in Magic and ultraTB.
3429
3439
3430 * ipython.1: document threading options in manpage.
3440 * ipython.1: document threading options in manpage.
3431
3441
3432 * scripts/ipython: Changed name of -thread option to -gthread,
3442 * scripts/ipython: Changed name of -thread option to -gthread,
3433 since this is GTK specific. I want to leave the door open for a
3443 since this is GTK specific. I want to leave the door open for a
3434 -wthread option for WX, which will most likely be necessary. This
3444 -wthread option for WX, which will most likely be necessary. This
3435 change affects usage and ipmaker as well.
3445 change affects usage and ipmaker as well.
3436
3446
3437 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3447 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3438 handle the matplotlib shell issues. Code by John Hunter
3448 handle the matplotlib shell issues. Code by John Hunter
3439 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3449 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3440 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3450 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3441 broken (and disabled for end users) for now, but it puts the
3451 broken (and disabled for end users) for now, but it puts the
3442 infrastructure in place.
3452 infrastructure in place.
3443
3453
3444 2004-08-21 Fernando Perez <fperez@colorado.edu>
3454 2004-08-21 Fernando Perez <fperez@colorado.edu>
3445
3455
3446 * ipythonrc-pylab: Add matplotlib support.
3456 * ipythonrc-pylab: Add matplotlib support.
3447
3457
3448 * matplotlib_config.py: new files for matplotlib support, part of
3458 * matplotlib_config.py: new files for matplotlib support, part of
3449 the pylab profile.
3459 the pylab profile.
3450
3460
3451 * IPython/usage.py (__doc__): documented the threading options.
3461 * IPython/usage.py (__doc__): documented the threading options.
3452
3462
3453 2004-08-20 Fernando Perez <fperez@colorado.edu>
3463 2004-08-20 Fernando Perez <fperez@colorado.edu>
3454
3464
3455 * ipython: Modified the main calling routine to handle the -thread
3465 * ipython: Modified the main calling routine to handle the -thread
3456 and -mpthread options. This needs to be done as a top-level hack,
3466 and -mpthread options. This needs to be done as a top-level hack,
3457 because it determines which class to instantiate for IPython
3467 because it determines which class to instantiate for IPython
3458 itself.
3468 itself.
3459
3469
3460 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3470 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3461 classes to support multithreaded GTK operation without blocking,
3471 classes to support multithreaded GTK operation without blocking,
3462 and matplotlib with all backends. This is a lot of still very
3472 and matplotlib with all backends. This is a lot of still very
3463 experimental code, and threads are tricky. So it may still have a
3473 experimental code, and threads are tricky. So it may still have a
3464 few rough edges... This code owes a lot to
3474 few rough edges... This code owes a lot to
3465 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3475 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3466 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3476 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3467 to John Hunter for all the matplotlib work.
3477 to John Hunter for all the matplotlib work.
3468
3478
3469 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3479 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3470 options for gtk thread and matplotlib support.
3480 options for gtk thread and matplotlib support.
3471
3481
3472 2004-08-16 Fernando Perez <fperez@colorado.edu>
3482 2004-08-16 Fernando Perez <fperez@colorado.edu>
3473
3483
3474 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3484 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3475 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3485 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3476 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3486 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3477
3487
3478 2004-08-11 Fernando Perez <fperez@colorado.edu>
3488 2004-08-11 Fernando Perez <fperez@colorado.edu>
3479
3489
3480 * setup.py (isfile): Fix build so documentation gets updated for
3490 * setup.py (isfile): Fix build so documentation gets updated for
3481 rpms (it was only done for .tgz builds).
3491 rpms (it was only done for .tgz builds).
3482
3492
3483 2004-08-10 Fernando Perez <fperez@colorado.edu>
3493 2004-08-10 Fernando Perez <fperez@colorado.edu>
3484
3494
3485 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3495 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3486
3496
3487 * iplib.py : Silence syntax error exceptions in tab-completion.
3497 * iplib.py : Silence syntax error exceptions in tab-completion.
3488
3498
3489 2004-08-05 Fernando Perez <fperez@colorado.edu>
3499 2004-08-05 Fernando Perez <fperez@colorado.edu>
3490
3500
3491 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3501 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3492 'color off' mark for continuation prompts. This was causing long
3502 'color off' mark for continuation prompts. This was causing long
3493 continuation lines to mis-wrap.
3503 continuation lines to mis-wrap.
3494
3504
3495 2004-08-01 Fernando Perez <fperez@colorado.edu>
3505 2004-08-01 Fernando Perez <fperez@colorado.edu>
3496
3506
3497 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3507 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3498 for building ipython to be a parameter. All this is necessary
3508 for building ipython to be a parameter. All this is necessary
3499 right now to have a multithreaded version, but this insane
3509 right now to have a multithreaded version, but this insane
3500 non-design will be cleaned up soon. For now, it's a hack that
3510 non-design will be cleaned up soon. For now, it's a hack that
3501 works.
3511 works.
3502
3512
3503 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3513 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3504 args in various places. No bugs so far, but it's a dangerous
3514 args in various places. No bugs so far, but it's a dangerous
3505 practice.
3515 practice.
3506
3516
3507 2004-07-31 Fernando Perez <fperez@colorado.edu>
3517 2004-07-31 Fernando Perez <fperez@colorado.edu>
3508
3518
3509 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3519 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3510 fix completion of files with dots in their names under most
3520 fix completion of files with dots in their names under most
3511 profiles (pysh was OK because the completion order is different).
3521 profiles (pysh was OK because the completion order is different).
3512
3522
3513 2004-07-27 Fernando Perez <fperez@colorado.edu>
3523 2004-07-27 Fernando Perez <fperez@colorado.edu>
3514
3524
3515 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3525 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3516 keywords manually, b/c the one in keyword.py was removed in python
3526 keywords manually, b/c the one in keyword.py was removed in python
3517 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3527 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3518 This is NOT a bug under python 2.3 and earlier.
3528 This is NOT a bug under python 2.3 and earlier.
3519
3529
3520 2004-07-26 Fernando Perez <fperez@colorado.edu>
3530 2004-07-26 Fernando Perez <fperez@colorado.edu>
3521
3531
3522 * IPython/ultraTB.py (VerboseTB.text): Add another
3532 * IPython/ultraTB.py (VerboseTB.text): Add another
3523 linecache.checkcache() call to try to prevent inspect.py from
3533 linecache.checkcache() call to try to prevent inspect.py from
3524 crashing under python 2.3. I think this fixes
3534 crashing under python 2.3. I think this fixes
3525 http://www.scipy.net/roundup/ipython/issue17.
3535 http://www.scipy.net/roundup/ipython/issue17.
3526
3536
3527 2004-07-26 *** Released version 0.6.2
3537 2004-07-26 *** Released version 0.6.2
3528
3538
3529 2004-07-26 Fernando Perez <fperez@colorado.edu>
3539 2004-07-26 Fernando Perez <fperez@colorado.edu>
3530
3540
3531 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3541 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3532 fail for any number.
3542 fail for any number.
3533 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3543 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3534 empty bookmarks.
3544 empty bookmarks.
3535
3545
3536 2004-07-26 *** Released version 0.6.1
3546 2004-07-26 *** Released version 0.6.1
3537
3547
3538 2004-07-26 Fernando Perez <fperez@colorado.edu>
3548 2004-07-26 Fernando Perez <fperez@colorado.edu>
3539
3549
3540 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3550 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3541
3551
3542 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3552 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3543 escaping '()[]{}' in filenames.
3553 escaping '()[]{}' in filenames.
3544
3554
3545 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3555 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3546 Python 2.2 users who lack a proper shlex.split.
3556 Python 2.2 users who lack a proper shlex.split.
3547
3557
3548 2004-07-19 Fernando Perez <fperez@colorado.edu>
3558 2004-07-19 Fernando Perez <fperez@colorado.edu>
3549
3559
3550 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3560 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3551 for reading readline's init file. I follow the normal chain:
3561 for reading readline's init file. I follow the normal chain:
3552 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3562 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3553 report by Mike Heeter. This closes
3563 report by Mike Heeter. This closes
3554 http://www.scipy.net/roundup/ipython/issue16.
3564 http://www.scipy.net/roundup/ipython/issue16.
3555
3565
3556 2004-07-18 Fernando Perez <fperez@colorado.edu>
3566 2004-07-18 Fernando Perez <fperez@colorado.edu>
3557
3567
3558 * IPython/iplib.py (__init__): Add better handling of '\' under
3568 * IPython/iplib.py (__init__): Add better handling of '\' under
3559 Win32 for filenames. After a patch by Ville.
3569 Win32 for filenames. After a patch by Ville.
3560
3570
3561 2004-07-17 Fernando Perez <fperez@colorado.edu>
3571 2004-07-17 Fernando Perez <fperez@colorado.edu>
3562
3572
3563 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3573 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3564 autocalling would be triggered for 'foo is bar' if foo is
3574 autocalling would be triggered for 'foo is bar' if foo is
3565 callable. I also cleaned up the autocall detection code to use a
3575 callable. I also cleaned up the autocall detection code to use a
3566 regexp, which is faster. Bug reported by Alexander Schmolck.
3576 regexp, which is faster. Bug reported by Alexander Schmolck.
3567
3577
3568 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3578 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3569 '?' in them would confuse the help system. Reported by Alex
3579 '?' in them would confuse the help system. Reported by Alex
3570 Schmolck.
3580 Schmolck.
3571
3581
3572 2004-07-16 Fernando Perez <fperez@colorado.edu>
3582 2004-07-16 Fernando Perez <fperez@colorado.edu>
3573
3583
3574 * IPython/GnuplotInteractive.py (__all__): added plot2.
3584 * IPython/GnuplotInteractive.py (__all__): added plot2.
3575
3585
3576 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3586 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3577 plotting dictionaries, lists or tuples of 1d arrays.
3587 plotting dictionaries, lists or tuples of 1d arrays.
3578
3588
3579 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3589 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3580 optimizations.
3590 optimizations.
3581
3591
3582 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3592 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3583 the information which was there from Janko's original IPP code:
3593 the information which was there from Janko's original IPP code:
3584
3594
3585 03.05.99 20:53 porto.ifm.uni-kiel.de
3595 03.05.99 20:53 porto.ifm.uni-kiel.de
3586 --Started changelog.
3596 --Started changelog.
3587 --make clear do what it say it does
3597 --make clear do what it say it does
3588 --added pretty output of lines from inputcache
3598 --added pretty output of lines from inputcache
3589 --Made Logger a mixin class, simplifies handling of switches
3599 --Made Logger a mixin class, simplifies handling of switches
3590 --Added own completer class. .string<TAB> expands to last history
3600 --Added own completer class. .string<TAB> expands to last history
3591 line which starts with string. The new expansion is also present
3601 line which starts with string. The new expansion is also present
3592 with Ctrl-r from the readline library. But this shows, who this
3602 with Ctrl-r from the readline library. But this shows, who this
3593 can be done for other cases.
3603 can be done for other cases.
3594 --Added convention that all shell functions should accept a
3604 --Added convention that all shell functions should accept a
3595 parameter_string This opens the door for different behaviour for
3605 parameter_string This opens the door for different behaviour for
3596 each function. @cd is a good example of this.
3606 each function. @cd is a good example of this.
3597
3607
3598 04.05.99 12:12 porto.ifm.uni-kiel.de
3608 04.05.99 12:12 porto.ifm.uni-kiel.de
3599 --added logfile rotation
3609 --added logfile rotation
3600 --added new mainloop method which freezes first the namespace
3610 --added new mainloop method which freezes first the namespace
3601
3611
3602 07.05.99 21:24 porto.ifm.uni-kiel.de
3612 07.05.99 21:24 porto.ifm.uni-kiel.de
3603 --added the docreader classes. Now there is a help system.
3613 --added the docreader classes. Now there is a help system.
3604 -This is only a first try. Currently it's not easy to put new
3614 -This is only a first try. Currently it's not easy to put new
3605 stuff in the indices. But this is the way to go. Info would be
3615 stuff in the indices. But this is the way to go. Info would be
3606 better, but HTML is every where and not everybody has an info
3616 better, but HTML is every where and not everybody has an info
3607 system installed and it's not so easy to change html-docs to info.
3617 system installed and it's not so easy to change html-docs to info.
3608 --added global logfile option
3618 --added global logfile option
3609 --there is now a hook for object inspection method pinfo needs to
3619 --there is now a hook for object inspection method pinfo needs to
3610 be provided for this. Can be reached by two '??'.
3620 be provided for this. Can be reached by two '??'.
3611
3621
3612 08.05.99 20:51 porto.ifm.uni-kiel.de
3622 08.05.99 20:51 porto.ifm.uni-kiel.de
3613 --added a README
3623 --added a README
3614 --bug in rc file. Something has changed so functions in the rc
3624 --bug in rc file. Something has changed so functions in the rc
3615 file need to reference the shell and not self. Not clear if it's a
3625 file need to reference the shell and not self. Not clear if it's a
3616 bug or feature.
3626 bug or feature.
3617 --changed rc file for new behavior
3627 --changed rc file for new behavior
3618
3628
3619 2004-07-15 Fernando Perez <fperez@colorado.edu>
3629 2004-07-15 Fernando Perez <fperez@colorado.edu>
3620
3630
3621 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3631 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3622 cache was falling out of sync in bizarre manners when multi-line
3632 cache was falling out of sync in bizarre manners when multi-line
3623 input was present. Minor optimizations and cleanup.
3633 input was present. Minor optimizations and cleanup.
3624
3634
3625 (Logger): Remove old Changelog info for cleanup. This is the
3635 (Logger): Remove old Changelog info for cleanup. This is the
3626 information which was there from Janko's original code:
3636 information which was there from Janko's original code:
3627
3637
3628 Changes to Logger: - made the default log filename a parameter
3638 Changes to Logger: - made the default log filename a parameter
3629
3639
3630 - put a check for lines beginning with !@? in log(). Needed
3640 - put a check for lines beginning with !@? in log(). Needed
3631 (even if the handlers properly log their lines) for mid-session
3641 (even if the handlers properly log their lines) for mid-session
3632 logging activation to work properly. Without this, lines logged
3642 logging activation to work properly. Without this, lines logged
3633 in mid session, which get read from the cache, would end up
3643 in mid session, which get read from the cache, would end up
3634 'bare' (with !@? in the open) in the log. Now they are caught
3644 'bare' (with !@? in the open) in the log. Now they are caught
3635 and prepended with a #.
3645 and prepended with a #.
3636
3646
3637 * IPython/iplib.py (InteractiveShell.init_readline): added check
3647 * IPython/iplib.py (InteractiveShell.init_readline): added check
3638 in case MagicCompleter fails to be defined, so we don't crash.
3648 in case MagicCompleter fails to be defined, so we don't crash.
3639
3649
3640 2004-07-13 Fernando Perez <fperez@colorado.edu>
3650 2004-07-13 Fernando Perez <fperez@colorado.edu>
3641
3651
3642 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3652 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3643 of EPS if the requested filename ends in '.eps'.
3653 of EPS if the requested filename ends in '.eps'.
3644
3654
3645 2004-07-04 Fernando Perez <fperez@colorado.edu>
3655 2004-07-04 Fernando Perez <fperez@colorado.edu>
3646
3656
3647 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3657 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3648 escaping of quotes when calling the shell.
3658 escaping of quotes when calling the shell.
3649
3659
3650 2004-07-02 Fernando Perez <fperez@colorado.edu>
3660 2004-07-02 Fernando Perez <fperez@colorado.edu>
3651
3661
3652 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3662 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3653 gettext not working because we were clobbering '_'. Fixes
3663 gettext not working because we were clobbering '_'. Fixes
3654 http://www.scipy.net/roundup/ipython/issue6.
3664 http://www.scipy.net/roundup/ipython/issue6.
3655
3665
3656 2004-07-01 Fernando Perez <fperez@colorado.edu>
3666 2004-07-01 Fernando Perez <fperez@colorado.edu>
3657
3667
3658 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3668 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3659 into @cd. Patch by Ville.
3669 into @cd. Patch by Ville.
3660
3670
3661 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3671 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3662 new function to store things after ipmaker runs. Patch by Ville.
3672 new function to store things after ipmaker runs. Patch by Ville.
3663 Eventually this will go away once ipmaker is removed and the class
3673 Eventually this will go away once ipmaker is removed and the class
3664 gets cleaned up, but for now it's ok. Key functionality here is
3674 gets cleaned up, but for now it's ok. Key functionality here is
3665 the addition of the persistent storage mechanism, a dict for
3675 the addition of the persistent storage mechanism, a dict for
3666 keeping data across sessions (for now just bookmarks, but more can
3676 keeping data across sessions (for now just bookmarks, but more can
3667 be implemented later).
3677 be implemented later).
3668
3678
3669 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3679 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3670 persistent across sections. Patch by Ville, I modified it
3680 persistent across sections. Patch by Ville, I modified it
3671 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3681 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3672 added a '-l' option to list all bookmarks.
3682 added a '-l' option to list all bookmarks.
3673
3683
3674 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3684 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3675 center for cleanup. Registered with atexit.register(). I moved
3685 center for cleanup. Registered with atexit.register(). I moved
3676 here the old exit_cleanup(). After a patch by Ville.
3686 here the old exit_cleanup(). After a patch by Ville.
3677
3687
3678 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3688 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3679 characters in the hacked shlex_split for python 2.2.
3689 characters in the hacked shlex_split for python 2.2.
3680
3690
3681 * IPython/iplib.py (file_matches): more fixes to filenames with
3691 * IPython/iplib.py (file_matches): more fixes to filenames with
3682 whitespace in them. It's not perfect, but limitations in python's
3692 whitespace in them. It's not perfect, but limitations in python's
3683 readline make it impossible to go further.
3693 readline make it impossible to go further.
3684
3694
3685 2004-06-29 Fernando Perez <fperez@colorado.edu>
3695 2004-06-29 Fernando Perez <fperez@colorado.edu>
3686
3696
3687 * IPython/iplib.py (file_matches): escape whitespace correctly in
3697 * IPython/iplib.py (file_matches): escape whitespace correctly in
3688 filename completions. Bug reported by Ville.
3698 filename completions. Bug reported by Ville.
3689
3699
3690 2004-06-28 Fernando Perez <fperez@colorado.edu>
3700 2004-06-28 Fernando Perez <fperez@colorado.edu>
3691
3701
3692 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3702 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3693 the history file will be called 'history-PROFNAME' (or just
3703 the history file will be called 'history-PROFNAME' (or just
3694 'history' if no profile is loaded). I was getting annoyed at
3704 'history' if no profile is loaded). I was getting annoyed at
3695 getting my Numerical work history clobbered by pysh sessions.
3705 getting my Numerical work history clobbered by pysh sessions.
3696
3706
3697 * IPython/iplib.py (InteractiveShell.__init__): Internal
3707 * IPython/iplib.py (InteractiveShell.__init__): Internal
3698 getoutputerror() function so that we can honor the system_verbose
3708 getoutputerror() function so that we can honor the system_verbose
3699 flag for _all_ system calls. I also added escaping of #
3709 flag for _all_ system calls. I also added escaping of #
3700 characters here to avoid confusing Itpl.
3710 characters here to avoid confusing Itpl.
3701
3711
3702 * IPython/Magic.py (shlex_split): removed call to shell in
3712 * IPython/Magic.py (shlex_split): removed call to shell in
3703 parse_options and replaced it with shlex.split(). The annoying
3713 parse_options and replaced it with shlex.split(). The annoying
3704 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3714 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3705 to backport it from 2.3, with several frail hacks (the shlex
3715 to backport it from 2.3, with several frail hacks (the shlex
3706 module is rather limited in 2.2). Thanks to a suggestion by Ville
3716 module is rather limited in 2.2). Thanks to a suggestion by Ville
3707 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3717 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3708 problem.
3718 problem.
3709
3719
3710 (Magic.magic_system_verbose): new toggle to print the actual
3720 (Magic.magic_system_verbose): new toggle to print the actual
3711 system calls made by ipython. Mainly for debugging purposes.
3721 system calls made by ipython. Mainly for debugging purposes.
3712
3722
3713 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3723 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3714 doesn't support persistence. Reported (and fix suggested) by
3724 doesn't support persistence. Reported (and fix suggested) by
3715 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3725 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3716
3726
3717 2004-06-26 Fernando Perez <fperez@colorado.edu>
3727 2004-06-26 Fernando Perez <fperez@colorado.edu>
3718
3728
3719 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3729 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3720 continue prompts.
3730 continue prompts.
3721
3731
3722 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3732 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3723 function (basically a big docstring) and a few more things here to
3733 function (basically a big docstring) and a few more things here to
3724 speedup startup. pysh.py is now very lightweight. We want because
3734 speedup startup. pysh.py is now very lightweight. We want because
3725 it gets execfile'd, while InterpreterExec gets imported, so
3735 it gets execfile'd, while InterpreterExec gets imported, so
3726 byte-compilation saves time.
3736 byte-compilation saves time.
3727
3737
3728 2004-06-25 Fernando Perez <fperez@colorado.edu>
3738 2004-06-25 Fernando Perez <fperez@colorado.edu>
3729
3739
3730 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3740 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3731 -NUM', which was recently broken.
3741 -NUM', which was recently broken.
3732
3742
3733 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3743 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3734 in multi-line input (but not !!, which doesn't make sense there).
3744 in multi-line input (but not !!, which doesn't make sense there).
3735
3745
3736 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3746 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3737 It's just too useful, and people can turn it off in the less
3747 It's just too useful, and people can turn it off in the less
3738 common cases where it's a problem.
3748 common cases where it's a problem.
3739
3749
3740 2004-06-24 Fernando Perez <fperez@colorado.edu>
3750 2004-06-24 Fernando Perez <fperez@colorado.edu>
3741
3751
3742 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3752 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3743 special syntaxes (like alias calling) is now allied in multi-line
3753 special syntaxes (like alias calling) is now allied in multi-line
3744 input. This is still _very_ experimental, but it's necessary for
3754 input. This is still _very_ experimental, but it's necessary for
3745 efficient shell usage combining python looping syntax with system
3755 efficient shell usage combining python looping syntax with system
3746 calls. For now it's restricted to aliases, I don't think it
3756 calls. For now it's restricted to aliases, I don't think it
3747 really even makes sense to have this for magics.
3757 really even makes sense to have this for magics.
3748
3758
3749 2004-06-23 Fernando Perez <fperez@colorado.edu>
3759 2004-06-23 Fernando Perez <fperez@colorado.edu>
3750
3760
3751 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3761 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3752 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3762 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3753
3763
3754 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3764 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3755 extensions under Windows (after code sent by Gary Bishop). The
3765 extensions under Windows (after code sent by Gary Bishop). The
3756 extensions considered 'executable' are stored in IPython's rc
3766 extensions considered 'executable' are stored in IPython's rc
3757 structure as win_exec_ext.
3767 structure as win_exec_ext.
3758
3768
3759 * IPython/genutils.py (shell): new function, like system() but
3769 * IPython/genutils.py (shell): new function, like system() but
3760 without return value. Very useful for interactive shell work.
3770 without return value. Very useful for interactive shell work.
3761
3771
3762 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3772 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3763 delete aliases.
3773 delete aliases.
3764
3774
3765 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3775 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3766 sure that the alias table doesn't contain python keywords.
3776 sure that the alias table doesn't contain python keywords.
3767
3777
3768 2004-06-21 Fernando Perez <fperez@colorado.edu>
3778 2004-06-21 Fernando Perez <fperez@colorado.edu>
3769
3779
3770 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3780 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3771 non-existent items are found in $PATH. Reported by Thorsten.
3781 non-existent items are found in $PATH. Reported by Thorsten.
3772
3782
3773 2004-06-20 Fernando Perez <fperez@colorado.edu>
3783 2004-06-20 Fernando Perez <fperez@colorado.edu>
3774
3784
3775 * IPython/iplib.py (complete): modified the completer so that the
3785 * IPython/iplib.py (complete): modified the completer so that the
3776 order of priorities can be easily changed at runtime.
3786 order of priorities can be easily changed at runtime.
3777
3787
3778 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3788 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3779 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3789 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3780
3790
3781 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3791 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3782 expand Python variables prepended with $ in all system calls. The
3792 expand Python variables prepended with $ in all system calls. The
3783 same was done to InteractiveShell.handle_shell_escape. Now all
3793 same was done to InteractiveShell.handle_shell_escape. Now all
3784 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3794 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3785 expansion of python variables and expressions according to the
3795 expansion of python variables and expressions according to the
3786 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3796 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3787
3797
3788 Though PEP-215 has been rejected, a similar (but simpler) one
3798 Though PEP-215 has been rejected, a similar (but simpler) one
3789 seems like it will go into Python 2.4, PEP-292 -
3799 seems like it will go into Python 2.4, PEP-292 -
3790 http://www.python.org/peps/pep-0292.html.
3800 http://www.python.org/peps/pep-0292.html.
3791
3801
3792 I'll keep the full syntax of PEP-215, since IPython has since the
3802 I'll keep the full syntax of PEP-215, since IPython has since the
3793 start used Ka-Ping Yee's reference implementation discussed there
3803 start used Ka-Ping Yee's reference implementation discussed there
3794 (Itpl), and I actually like the powerful semantics it offers.
3804 (Itpl), and I actually like the powerful semantics it offers.
3795
3805
3796 In order to access normal shell variables, the $ has to be escaped
3806 In order to access normal shell variables, the $ has to be escaped
3797 via an extra $. For example:
3807 via an extra $. For example:
3798
3808
3799 In [7]: PATH='a python variable'
3809 In [7]: PATH='a python variable'
3800
3810
3801 In [8]: !echo $PATH
3811 In [8]: !echo $PATH
3802 a python variable
3812 a python variable
3803
3813
3804 In [9]: !echo $$PATH
3814 In [9]: !echo $$PATH
3805 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3815 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3806
3816
3807 (Magic.parse_options): escape $ so the shell doesn't evaluate
3817 (Magic.parse_options): escape $ so the shell doesn't evaluate
3808 things prematurely.
3818 things prematurely.
3809
3819
3810 * IPython/iplib.py (InteractiveShell.call_alias): added the
3820 * IPython/iplib.py (InteractiveShell.call_alias): added the
3811 ability for aliases to expand python variables via $.
3821 ability for aliases to expand python variables via $.
3812
3822
3813 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3823 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3814 system, now there's a @rehash/@rehashx pair of magics. These work
3824 system, now there's a @rehash/@rehashx pair of magics. These work
3815 like the csh rehash command, and can be invoked at any time. They
3825 like the csh rehash command, and can be invoked at any time. They
3816 build a table of aliases to everything in the user's $PATH
3826 build a table of aliases to everything in the user's $PATH
3817 (@rehash uses everything, @rehashx is slower but only adds
3827 (@rehash uses everything, @rehashx is slower but only adds
3818 executable files). With this, the pysh.py-based shell profile can
3828 executable files). With this, the pysh.py-based shell profile can
3819 now simply call rehash upon startup, and full access to all
3829 now simply call rehash upon startup, and full access to all
3820 programs in the user's path is obtained.
3830 programs in the user's path is obtained.
3821
3831
3822 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3832 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3823 functionality is now fully in place. I removed the old dynamic
3833 functionality is now fully in place. I removed the old dynamic
3824 code generation based approach, in favor of a much lighter one
3834 code generation based approach, in favor of a much lighter one
3825 based on a simple dict. The advantage is that this allows me to
3835 based on a simple dict. The advantage is that this allows me to
3826 now have thousands of aliases with negligible cost (unthinkable
3836 now have thousands of aliases with negligible cost (unthinkable
3827 with the old system).
3837 with the old system).
3828
3838
3829 2004-06-19 Fernando Perez <fperez@colorado.edu>
3839 2004-06-19 Fernando Perez <fperez@colorado.edu>
3830
3840
3831 * IPython/iplib.py (__init__): extended MagicCompleter class to
3841 * IPython/iplib.py (__init__): extended MagicCompleter class to
3832 also complete (last in priority) on user aliases.
3842 also complete (last in priority) on user aliases.
3833
3843
3834 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3844 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3835 call to eval.
3845 call to eval.
3836 (ItplNS.__init__): Added a new class which functions like Itpl,
3846 (ItplNS.__init__): Added a new class which functions like Itpl,
3837 but allows configuring the namespace for the evaluation to occur
3847 but allows configuring the namespace for the evaluation to occur
3838 in.
3848 in.
3839
3849
3840 2004-06-18 Fernando Perez <fperez@colorado.edu>
3850 2004-06-18 Fernando Perez <fperez@colorado.edu>
3841
3851
3842 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3852 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3843 better message when 'exit' or 'quit' are typed (a common newbie
3853 better message when 'exit' or 'quit' are typed (a common newbie
3844 confusion).
3854 confusion).
3845
3855
3846 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3856 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3847 check for Windows users.
3857 check for Windows users.
3848
3858
3849 * IPython/iplib.py (InteractiveShell.user_setup): removed
3859 * IPython/iplib.py (InteractiveShell.user_setup): removed
3850 disabling of colors for Windows. I'll test at runtime and issue a
3860 disabling of colors for Windows. I'll test at runtime and issue a
3851 warning if Gary's readline isn't found, as to nudge users to
3861 warning if Gary's readline isn't found, as to nudge users to
3852 download it.
3862 download it.
3853
3863
3854 2004-06-16 Fernando Perez <fperez@colorado.edu>
3864 2004-06-16 Fernando Perez <fperez@colorado.edu>
3855
3865
3856 * IPython/genutils.py (Stream.__init__): changed to print errors
3866 * IPython/genutils.py (Stream.__init__): changed to print errors
3857 to sys.stderr. I had a circular dependency here. Now it's
3867 to sys.stderr. I had a circular dependency here. Now it's
3858 possible to run ipython as IDLE's shell (consider this pre-alpha,
3868 possible to run ipython as IDLE's shell (consider this pre-alpha,
3859 since true stdout things end up in the starting terminal instead
3869 since true stdout things end up in the starting terminal instead
3860 of IDLE's out).
3870 of IDLE's out).
3861
3871
3862 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3872 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3863 users who haven't # updated their prompt_in2 definitions. Remove
3873 users who haven't # updated their prompt_in2 definitions. Remove
3864 eventually.
3874 eventually.
3865 (multiple_replace): added credit to original ASPN recipe.
3875 (multiple_replace): added credit to original ASPN recipe.
3866
3876
3867 2004-06-15 Fernando Perez <fperez@colorado.edu>
3877 2004-06-15 Fernando Perez <fperez@colorado.edu>
3868
3878
3869 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3879 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3870 list of auto-defined aliases.
3880 list of auto-defined aliases.
3871
3881
3872 2004-06-13 Fernando Perez <fperez@colorado.edu>
3882 2004-06-13 Fernando Perez <fperez@colorado.edu>
3873
3883
3874 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3884 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3875 install was really requested (so setup.py can be used for other
3885 install was really requested (so setup.py can be used for other
3876 things under Windows).
3886 things under Windows).
3877
3887
3878 2004-06-10 Fernando Perez <fperez@colorado.edu>
3888 2004-06-10 Fernando Perez <fperez@colorado.edu>
3879
3889
3880 * IPython/Logger.py (Logger.create_log): Manually remove any old
3890 * IPython/Logger.py (Logger.create_log): Manually remove any old
3881 backup, since os.remove may fail under Windows. Fixes bug
3891 backup, since os.remove may fail under Windows. Fixes bug
3882 reported by Thorsten.
3892 reported by Thorsten.
3883
3893
3884 2004-06-09 Fernando Perez <fperez@colorado.edu>
3894 2004-06-09 Fernando Perez <fperez@colorado.edu>
3885
3895
3886 * examples/example-embed.py: fixed all references to %n (replaced
3896 * examples/example-embed.py: fixed all references to %n (replaced
3887 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3897 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3888 for all examples and the manual as well.
3898 for all examples and the manual as well.
3889
3899
3890 2004-06-08 Fernando Perez <fperez@colorado.edu>
3900 2004-06-08 Fernando Perez <fperez@colorado.edu>
3891
3901
3892 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3902 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3893 alignment and color management. All 3 prompt subsystems now
3903 alignment and color management. All 3 prompt subsystems now
3894 inherit from BasePrompt.
3904 inherit from BasePrompt.
3895
3905
3896 * tools/release: updates for windows installer build and tag rpms
3906 * tools/release: updates for windows installer build and tag rpms
3897 with python version (since paths are fixed).
3907 with python version (since paths are fixed).
3898
3908
3899 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3909 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3900 which will become eventually obsolete. Also fixed the default
3910 which will become eventually obsolete. Also fixed the default
3901 prompt_in2 to use \D, so at least new users start with the correct
3911 prompt_in2 to use \D, so at least new users start with the correct
3902 defaults.
3912 defaults.
3903 WARNING: Users with existing ipythonrc files will need to apply
3913 WARNING: Users with existing ipythonrc files will need to apply
3904 this fix manually!
3914 this fix manually!
3905
3915
3906 * setup.py: make windows installer (.exe). This is finally the
3916 * setup.py: make windows installer (.exe). This is finally the
3907 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3917 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3908 which I hadn't included because it required Python 2.3 (or recent
3918 which I hadn't included because it required Python 2.3 (or recent
3909 distutils).
3919 distutils).
3910
3920
3911 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3921 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3912 usage of new '\D' escape.
3922 usage of new '\D' escape.
3913
3923
3914 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3924 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3915 lacks os.getuid())
3925 lacks os.getuid())
3916 (CachedOutput.set_colors): Added the ability to turn coloring
3926 (CachedOutput.set_colors): Added the ability to turn coloring
3917 on/off with @colors even for manually defined prompt colors. It
3927 on/off with @colors even for manually defined prompt colors. It
3918 uses a nasty global, but it works safely and via the generic color
3928 uses a nasty global, but it works safely and via the generic color
3919 handling mechanism.
3929 handling mechanism.
3920 (Prompt2.__init__): Introduced new escape '\D' for continuation
3930 (Prompt2.__init__): Introduced new escape '\D' for continuation
3921 prompts. It represents the counter ('\#') as dots.
3931 prompts. It represents the counter ('\#') as dots.
3922 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3932 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3923 need to update their ipythonrc files and replace '%n' with '\D' in
3933 need to update their ipythonrc files and replace '%n' with '\D' in
3924 their prompt_in2 settings everywhere. Sorry, but there's
3934 their prompt_in2 settings everywhere. Sorry, but there's
3925 otherwise no clean way to get all prompts to properly align. The
3935 otherwise no clean way to get all prompts to properly align. The
3926 ipythonrc shipped with IPython has been updated.
3936 ipythonrc shipped with IPython has been updated.
3927
3937
3928 2004-06-07 Fernando Perez <fperez@colorado.edu>
3938 2004-06-07 Fernando Perez <fperez@colorado.edu>
3929
3939
3930 * setup.py (isfile): Pass local_icons option to latex2html, so the
3940 * setup.py (isfile): Pass local_icons option to latex2html, so the
3931 resulting HTML file is self-contained. Thanks to
3941 resulting HTML file is self-contained. Thanks to
3932 dryice-AT-liu.com.cn for the tip.
3942 dryice-AT-liu.com.cn for the tip.
3933
3943
3934 * pysh.py: I created a new profile 'shell', which implements a
3944 * pysh.py: I created a new profile 'shell', which implements a
3935 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3945 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3936 system shell, nor will it become one anytime soon. It's mainly
3946 system shell, nor will it become one anytime soon. It's mainly
3937 meant to illustrate the use of the new flexible bash-like prompts.
3947 meant to illustrate the use of the new flexible bash-like prompts.
3938 I guess it could be used by hardy souls for true shell management,
3948 I guess it could be used by hardy souls for true shell management,
3939 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3949 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3940 profile. This uses the InterpreterExec extension provided by
3950 profile. This uses the InterpreterExec extension provided by
3941 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3951 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3942
3952
3943 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3953 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3944 auto-align itself with the length of the previous input prompt
3954 auto-align itself with the length of the previous input prompt
3945 (taking into account the invisible color escapes).
3955 (taking into account the invisible color escapes).
3946 (CachedOutput.__init__): Large restructuring of this class. Now
3956 (CachedOutput.__init__): Large restructuring of this class. Now
3947 all three prompts (primary1, primary2, output) are proper objects,
3957 all three prompts (primary1, primary2, output) are proper objects,
3948 managed by the 'parent' CachedOutput class. The code is still a
3958 managed by the 'parent' CachedOutput class. The code is still a
3949 bit hackish (all prompts share state via a pointer to the cache),
3959 bit hackish (all prompts share state via a pointer to the cache),
3950 but it's overall far cleaner than before.
3960 but it's overall far cleaner than before.
3951
3961
3952 * IPython/genutils.py (getoutputerror): modified to add verbose,
3962 * IPython/genutils.py (getoutputerror): modified to add verbose,
3953 debug and header options. This makes the interface of all getout*
3963 debug and header options. This makes the interface of all getout*
3954 functions uniform.
3964 functions uniform.
3955 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3965 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3956
3966
3957 * IPython/Magic.py (Magic.default_option): added a function to
3967 * IPython/Magic.py (Magic.default_option): added a function to
3958 allow registering default options for any magic command. This
3968 allow registering default options for any magic command. This
3959 makes it easy to have profiles which customize the magics globally
3969 makes it easy to have profiles which customize the magics globally
3960 for a certain use. The values set through this function are
3970 for a certain use. The values set through this function are
3961 picked up by the parse_options() method, which all magics should
3971 picked up by the parse_options() method, which all magics should
3962 use to parse their options.
3972 use to parse their options.
3963
3973
3964 * IPython/genutils.py (warn): modified the warnings framework to
3974 * IPython/genutils.py (warn): modified the warnings framework to
3965 use the Term I/O class. I'm trying to slowly unify all of
3975 use the Term I/O class. I'm trying to slowly unify all of
3966 IPython's I/O operations to pass through Term.
3976 IPython's I/O operations to pass through Term.
3967
3977
3968 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3978 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3969 the secondary prompt to correctly match the length of the primary
3979 the secondary prompt to correctly match the length of the primary
3970 one for any prompt. Now multi-line code will properly line up
3980 one for any prompt. Now multi-line code will properly line up
3971 even for path dependent prompts, such as the new ones available
3981 even for path dependent prompts, such as the new ones available
3972 via the prompt_specials.
3982 via the prompt_specials.
3973
3983
3974 2004-06-06 Fernando Perez <fperez@colorado.edu>
3984 2004-06-06 Fernando Perez <fperez@colorado.edu>
3975
3985
3976 * IPython/Prompts.py (prompt_specials): Added the ability to have
3986 * IPython/Prompts.py (prompt_specials): Added the ability to have
3977 bash-like special sequences in the prompts, which get
3987 bash-like special sequences in the prompts, which get
3978 automatically expanded. Things like hostname, current working
3988 automatically expanded. Things like hostname, current working
3979 directory and username are implemented already, but it's easy to
3989 directory and username are implemented already, but it's easy to
3980 add more in the future. Thanks to a patch by W.J. van der Laan
3990 add more in the future. Thanks to a patch by W.J. van der Laan
3981 <gnufnork-AT-hetdigitalegat.nl>
3991 <gnufnork-AT-hetdigitalegat.nl>
3982 (prompt_specials): Added color support for prompt strings, so
3992 (prompt_specials): Added color support for prompt strings, so
3983 users can define arbitrary color setups for their prompts.
3993 users can define arbitrary color setups for their prompts.
3984
3994
3985 2004-06-05 Fernando Perez <fperez@colorado.edu>
3995 2004-06-05 Fernando Perez <fperez@colorado.edu>
3986
3996
3987 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3997 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3988 code to load Gary Bishop's readline and configure it
3998 code to load Gary Bishop's readline and configure it
3989 automatically. Thanks to Gary for help on this.
3999 automatically. Thanks to Gary for help on this.
3990
4000
3991 2004-06-01 Fernando Perez <fperez@colorado.edu>
4001 2004-06-01 Fernando Perez <fperez@colorado.edu>
3992
4002
3993 * IPython/Logger.py (Logger.create_log): fix bug for logging
4003 * IPython/Logger.py (Logger.create_log): fix bug for logging
3994 with no filename (previous fix was incomplete).
4004 with no filename (previous fix was incomplete).
3995
4005
3996 2004-05-25 Fernando Perez <fperez@colorado.edu>
4006 2004-05-25 Fernando Perez <fperez@colorado.edu>
3997
4007
3998 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4008 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3999 parens would get passed to the shell.
4009 parens would get passed to the shell.
4000
4010
4001 2004-05-20 Fernando Perez <fperez@colorado.edu>
4011 2004-05-20 Fernando Perez <fperez@colorado.edu>
4002
4012
4003 * IPython/Magic.py (Magic.magic_prun): changed default profile
4013 * IPython/Magic.py (Magic.magic_prun): changed default profile
4004 sort order to 'time' (the more common profiling need).
4014 sort order to 'time' (the more common profiling need).
4005
4015
4006 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4016 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4007 so that source code shown is guaranteed in sync with the file on
4017 so that source code shown is guaranteed in sync with the file on
4008 disk (also changed in psource). Similar fix to the one for
4018 disk (also changed in psource). Similar fix to the one for
4009 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4019 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4010 <yann.ledu-AT-noos.fr>.
4020 <yann.ledu-AT-noos.fr>.
4011
4021
4012 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4022 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4013 with a single option would not be correctly parsed. Closes
4023 with a single option would not be correctly parsed. Closes
4014 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4024 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4015 introduced in 0.6.0 (on 2004-05-06).
4025 introduced in 0.6.0 (on 2004-05-06).
4016
4026
4017 2004-05-13 *** Released version 0.6.0
4027 2004-05-13 *** Released version 0.6.0
4018
4028
4019 2004-05-13 Fernando Perez <fperez@colorado.edu>
4029 2004-05-13 Fernando Perez <fperez@colorado.edu>
4020
4030
4021 * debian/: Added debian/ directory to CVS, so that debian support
4031 * debian/: Added debian/ directory to CVS, so that debian support
4022 is publicly accessible. The debian package is maintained by Jack
4032 is publicly accessible. The debian package is maintained by Jack
4023 Moffit <jack-AT-xiph.org>.
4033 Moffit <jack-AT-xiph.org>.
4024
4034
4025 * Documentation: included the notes about an ipython-based system
4035 * Documentation: included the notes about an ipython-based system
4026 shell (the hypothetical 'pysh') into the new_design.pdf document,
4036 shell (the hypothetical 'pysh') into the new_design.pdf document,
4027 so that these ideas get distributed to users along with the
4037 so that these ideas get distributed to users along with the
4028 official documentation.
4038 official documentation.
4029
4039
4030 2004-05-10 Fernando Perez <fperez@colorado.edu>
4040 2004-05-10 Fernando Perez <fperez@colorado.edu>
4031
4041
4032 * IPython/Logger.py (Logger.create_log): fix recently introduced
4042 * IPython/Logger.py (Logger.create_log): fix recently introduced
4033 bug (misindented line) where logstart would fail when not given an
4043 bug (misindented line) where logstart would fail when not given an
4034 explicit filename.
4044 explicit filename.
4035
4045
4036 2004-05-09 Fernando Perez <fperez@colorado.edu>
4046 2004-05-09 Fernando Perez <fperez@colorado.edu>
4037
4047
4038 * IPython/Magic.py (Magic.parse_options): skip system call when
4048 * IPython/Magic.py (Magic.parse_options): skip system call when
4039 there are no options to look for. Faster, cleaner for the common
4049 there are no options to look for. Faster, cleaner for the common
4040 case.
4050 case.
4041
4051
4042 * Documentation: many updates to the manual: describing Windows
4052 * Documentation: many updates to the manual: describing Windows
4043 support better, Gnuplot updates, credits, misc small stuff. Also
4053 support better, Gnuplot updates, credits, misc small stuff. Also
4044 updated the new_design doc a bit.
4054 updated the new_design doc a bit.
4045
4055
4046 2004-05-06 *** Released version 0.6.0.rc1
4056 2004-05-06 *** Released version 0.6.0.rc1
4047
4057
4048 2004-05-06 Fernando Perez <fperez@colorado.edu>
4058 2004-05-06 Fernando Perez <fperez@colorado.edu>
4049
4059
4050 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4060 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4051 operations to use the vastly more efficient list/''.join() method.
4061 operations to use the vastly more efficient list/''.join() method.
4052 (FormattedTB.text): Fix
4062 (FormattedTB.text): Fix
4053 http://www.scipy.net/roundup/ipython/issue12 - exception source
4063 http://www.scipy.net/roundup/ipython/issue12 - exception source
4054 extract not updated after reload. Thanks to Mike Salib
4064 extract not updated after reload. Thanks to Mike Salib
4055 <msalib-AT-mit.edu> for pinning the source of the problem.
4065 <msalib-AT-mit.edu> for pinning the source of the problem.
4056 Fortunately, the solution works inside ipython and doesn't require
4066 Fortunately, the solution works inside ipython and doesn't require
4057 any changes to python proper.
4067 any changes to python proper.
4058
4068
4059 * IPython/Magic.py (Magic.parse_options): Improved to process the
4069 * IPython/Magic.py (Magic.parse_options): Improved to process the
4060 argument list as a true shell would (by actually using the
4070 argument list as a true shell would (by actually using the
4061 underlying system shell). This way, all @magics automatically get
4071 underlying system shell). This way, all @magics automatically get
4062 shell expansion for variables. Thanks to a comment by Alex
4072 shell expansion for variables. Thanks to a comment by Alex
4063 Schmolck.
4073 Schmolck.
4064
4074
4065 2004-04-04 Fernando Perez <fperez@colorado.edu>
4075 2004-04-04 Fernando Perez <fperez@colorado.edu>
4066
4076
4067 * IPython/iplib.py (InteractiveShell.interact): Added a special
4077 * IPython/iplib.py (InteractiveShell.interact): Added a special
4068 trap for a debugger quit exception, which is basically impossible
4078 trap for a debugger quit exception, which is basically impossible
4069 to handle by normal mechanisms, given what pdb does to the stack.
4079 to handle by normal mechanisms, given what pdb does to the stack.
4070 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4080 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4071
4081
4072 2004-04-03 Fernando Perez <fperez@colorado.edu>
4082 2004-04-03 Fernando Perez <fperez@colorado.edu>
4073
4083
4074 * IPython/genutils.py (Term): Standardized the names of the Term
4084 * IPython/genutils.py (Term): Standardized the names of the Term
4075 class streams to cin/cout/cerr, following C++ naming conventions
4085 class streams to cin/cout/cerr, following C++ naming conventions
4076 (I can't use in/out/err because 'in' is not a valid attribute
4086 (I can't use in/out/err because 'in' is not a valid attribute
4077 name).
4087 name).
4078
4088
4079 * IPython/iplib.py (InteractiveShell.interact): don't increment
4089 * IPython/iplib.py (InteractiveShell.interact): don't increment
4080 the prompt if there's no user input. By Daniel 'Dang' Griffith
4090 the prompt if there's no user input. By Daniel 'Dang' Griffith
4081 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4091 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
4082 Francois Pinard.
4092 Francois Pinard.
4083
4093
4084 2004-04-02 Fernando Perez <fperez@colorado.edu>
4094 2004-04-02 Fernando Perez <fperez@colorado.edu>
4085
4095
4086 * IPython/genutils.py (Stream.__init__): Modified to survive at
4096 * IPython/genutils.py (Stream.__init__): Modified to survive at
4087 least importing in contexts where stdin/out/err aren't true file
4097 least importing in contexts where stdin/out/err aren't true file
4088 objects, such as PyCrust (they lack fileno() and mode). However,
4098 objects, such as PyCrust (they lack fileno() and mode). However,
4089 the recovery facilities which rely on these things existing will
4099 the recovery facilities which rely on these things existing will
4090 not work.
4100 not work.
4091
4101
4092 2004-04-01 Fernando Perez <fperez@colorado.edu>
4102 2004-04-01 Fernando Perez <fperez@colorado.edu>
4093
4103
4094 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4104 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4095 use the new getoutputerror() function, so it properly
4105 use the new getoutputerror() function, so it properly
4096 distinguishes stdout/err.
4106 distinguishes stdout/err.
4097
4107
4098 * IPython/genutils.py (getoutputerror): added a function to
4108 * IPython/genutils.py (getoutputerror): added a function to
4099 capture separately the standard output and error of a command.
4109 capture separately the standard output and error of a command.
4100 After a comment from dang on the mailing lists. This code is
4110 After a comment from dang on the mailing lists. This code is
4101 basically a modified version of commands.getstatusoutput(), from
4111 basically a modified version of commands.getstatusoutput(), from
4102 the standard library.
4112 the standard library.
4103
4113
4104 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4114 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4105 '!!' as a special syntax (shorthand) to access @sx.
4115 '!!' as a special syntax (shorthand) to access @sx.
4106
4116
4107 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4117 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4108 command and return its output as a list split on '\n'.
4118 command and return its output as a list split on '\n'.
4109
4119
4110 2004-03-31 Fernando Perez <fperez@colorado.edu>
4120 2004-03-31 Fernando Perez <fperez@colorado.edu>
4111
4121
4112 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4122 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4113 method to dictionaries used as FakeModule instances if they lack
4123 method to dictionaries used as FakeModule instances if they lack
4114 it. At least pydoc in python2.3 breaks for runtime-defined
4124 it. At least pydoc in python2.3 breaks for runtime-defined
4115 functions without this hack. At some point I need to _really_
4125 functions without this hack. At some point I need to _really_
4116 understand what FakeModule is doing, because it's a gross hack.
4126 understand what FakeModule is doing, because it's a gross hack.
4117 But it solves Arnd's problem for now...
4127 But it solves Arnd's problem for now...
4118
4128
4119 2004-02-27 Fernando Perez <fperez@colorado.edu>
4129 2004-02-27 Fernando Perez <fperez@colorado.edu>
4120
4130
4121 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4131 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4122 mode would behave erratically. Also increased the number of
4132 mode would behave erratically. Also increased the number of
4123 possible logs in rotate mod to 999. Thanks to Rod Holland
4133 possible logs in rotate mod to 999. Thanks to Rod Holland
4124 <rhh@StructureLABS.com> for the report and fixes.
4134 <rhh@StructureLABS.com> for the report and fixes.
4125
4135
4126 2004-02-26 Fernando Perez <fperez@colorado.edu>
4136 2004-02-26 Fernando Perez <fperez@colorado.edu>
4127
4137
4128 * IPython/genutils.py (page): Check that the curses module really
4138 * IPython/genutils.py (page): Check that the curses module really
4129 has the initscr attribute before trying to use it. For some
4139 has the initscr attribute before trying to use it. For some
4130 reason, the Solaris curses module is missing this. I think this
4140 reason, the Solaris curses module is missing this. I think this
4131 should be considered a Solaris python bug, but I'm not sure.
4141 should be considered a Solaris python bug, but I'm not sure.
4132
4142
4133 2004-01-17 Fernando Perez <fperez@colorado.edu>
4143 2004-01-17 Fernando Perez <fperez@colorado.edu>
4134
4144
4135 * IPython/genutils.py (Stream.__init__): Changes to try to make
4145 * IPython/genutils.py (Stream.__init__): Changes to try to make
4136 ipython robust against stdin/out/err being closed by the user.
4146 ipython robust against stdin/out/err being closed by the user.
4137 This is 'user error' (and blocks a normal python session, at least
4147 This is 'user error' (and blocks a normal python session, at least
4138 the stdout case). However, Ipython should be able to survive such
4148 the stdout case). However, Ipython should be able to survive such
4139 instances of abuse as gracefully as possible. To simplify the
4149 instances of abuse as gracefully as possible. To simplify the
4140 coding and maintain compatibility with Gary Bishop's Term
4150 coding and maintain compatibility with Gary Bishop's Term
4141 contributions, I've made use of classmethods for this. I think
4151 contributions, I've made use of classmethods for this. I think
4142 this introduces a dependency on python 2.2.
4152 this introduces a dependency on python 2.2.
4143
4153
4144 2004-01-13 Fernando Perez <fperez@colorado.edu>
4154 2004-01-13 Fernando Perez <fperez@colorado.edu>
4145
4155
4146 * IPython/numutils.py (exp_safe): simplified the code a bit and
4156 * IPython/numutils.py (exp_safe): simplified the code a bit and
4147 removed the need for importing the kinds module altogether.
4157 removed the need for importing the kinds module altogether.
4148
4158
4149 2004-01-06 Fernando Perez <fperez@colorado.edu>
4159 2004-01-06 Fernando Perez <fperez@colorado.edu>
4150
4160
4151 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4161 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4152 a magic function instead, after some community feedback. No
4162 a magic function instead, after some community feedback. No
4153 special syntax will exist for it, but its name is deliberately
4163 special syntax will exist for it, but its name is deliberately
4154 very short.
4164 very short.
4155
4165
4156 2003-12-20 Fernando Perez <fperez@colorado.edu>
4166 2003-12-20 Fernando Perez <fperez@colorado.edu>
4157
4167
4158 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4168 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4159 new functionality, to automagically assign the result of a shell
4169 new functionality, to automagically assign the result of a shell
4160 command to a variable. I'll solicit some community feedback on
4170 command to a variable. I'll solicit some community feedback on
4161 this before making it permanent.
4171 this before making it permanent.
4162
4172
4163 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4173 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4164 requested about callables for which inspect couldn't obtain a
4174 requested about callables for which inspect couldn't obtain a
4165 proper argspec. Thanks to a crash report sent by Etienne
4175 proper argspec. Thanks to a crash report sent by Etienne
4166 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4176 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4167
4177
4168 2003-12-09 Fernando Perez <fperez@colorado.edu>
4178 2003-12-09 Fernando Perez <fperez@colorado.edu>
4169
4179
4170 * IPython/genutils.py (page): patch for the pager to work across
4180 * IPython/genutils.py (page): patch for the pager to work across
4171 various versions of Windows. By Gary Bishop.
4181 various versions of Windows. By Gary Bishop.
4172
4182
4173 2003-12-04 Fernando Perez <fperez@colorado.edu>
4183 2003-12-04 Fernando Perez <fperez@colorado.edu>
4174
4184
4175 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4185 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4176 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4186 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4177 While I tested this and it looks ok, there may still be corner
4187 While I tested this and it looks ok, there may still be corner
4178 cases I've missed.
4188 cases I've missed.
4179
4189
4180 2003-12-01 Fernando Perez <fperez@colorado.edu>
4190 2003-12-01 Fernando Perez <fperez@colorado.edu>
4181
4191
4182 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4192 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4183 where a line like 'p,q=1,2' would fail because the automagic
4193 where a line like 'p,q=1,2' would fail because the automagic
4184 system would be triggered for @p.
4194 system would be triggered for @p.
4185
4195
4186 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4196 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4187 cleanups, code unmodified.
4197 cleanups, code unmodified.
4188
4198
4189 * IPython/genutils.py (Term): added a class for IPython to handle
4199 * IPython/genutils.py (Term): added a class for IPython to handle
4190 output. In most cases it will just be a proxy for stdout/err, but
4200 output. In most cases it will just be a proxy for stdout/err, but
4191 having this allows modifications to be made for some platforms,
4201 having this allows modifications to be made for some platforms,
4192 such as handling color escapes under Windows. All of this code
4202 such as handling color escapes under Windows. All of this code
4193 was contributed by Gary Bishop, with minor modifications by me.
4203 was contributed by Gary Bishop, with minor modifications by me.
4194 The actual changes affect many files.
4204 The actual changes affect many files.
4195
4205
4196 2003-11-30 Fernando Perez <fperez@colorado.edu>
4206 2003-11-30 Fernando Perez <fperez@colorado.edu>
4197
4207
4198 * IPython/iplib.py (file_matches): new completion code, courtesy
4208 * IPython/iplib.py (file_matches): new completion code, courtesy
4199 of Jeff Collins. This enables filename completion again under
4209 of Jeff Collins. This enables filename completion again under
4200 python 2.3, which disabled it at the C level.
4210 python 2.3, which disabled it at the C level.
4201
4211
4202 2003-11-11 Fernando Perez <fperez@colorado.edu>
4212 2003-11-11 Fernando Perez <fperez@colorado.edu>
4203
4213
4204 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4214 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4205 for Numeric.array(map(...)), but often convenient.
4215 for Numeric.array(map(...)), but often convenient.
4206
4216
4207 2003-11-05 Fernando Perez <fperez@colorado.edu>
4217 2003-11-05 Fernando Perez <fperez@colorado.edu>
4208
4218
4209 * IPython/numutils.py (frange): Changed a call from int() to
4219 * IPython/numutils.py (frange): Changed a call from int() to
4210 int(round()) to prevent a problem reported with arange() in the
4220 int(round()) to prevent a problem reported with arange() in the
4211 numpy list.
4221 numpy list.
4212
4222
4213 2003-10-06 Fernando Perez <fperez@colorado.edu>
4223 2003-10-06 Fernando Perez <fperez@colorado.edu>
4214
4224
4215 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4225 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4216 prevent crashes if sys lacks an argv attribute (it happens with
4226 prevent crashes if sys lacks an argv attribute (it happens with
4217 embedded interpreters which build a bare-bones sys module).
4227 embedded interpreters which build a bare-bones sys module).
4218 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4228 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4219
4229
4220 2003-09-24 Fernando Perez <fperez@colorado.edu>
4230 2003-09-24 Fernando Perez <fperez@colorado.edu>
4221
4231
4222 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4232 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4223 to protect against poorly written user objects where __getattr__
4233 to protect against poorly written user objects where __getattr__
4224 raises exceptions other than AttributeError. Thanks to a bug
4234 raises exceptions other than AttributeError. Thanks to a bug
4225 report by Oliver Sander <osander-AT-gmx.de>.
4235 report by Oliver Sander <osander-AT-gmx.de>.
4226
4236
4227 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4237 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4228 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4238 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4229
4239
4230 2003-09-09 Fernando Perez <fperez@colorado.edu>
4240 2003-09-09 Fernando Perez <fperez@colorado.edu>
4231
4241
4232 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4242 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4233 unpacking a list whith a callable as first element would
4243 unpacking a list whith a callable as first element would
4234 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4244 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4235 Collins.
4245 Collins.
4236
4246
4237 2003-08-25 *** Released version 0.5.0
4247 2003-08-25 *** Released version 0.5.0
4238
4248
4239 2003-08-22 Fernando Perez <fperez@colorado.edu>
4249 2003-08-22 Fernando Perez <fperez@colorado.edu>
4240
4250
4241 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4251 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4242 improperly defined user exceptions. Thanks to feedback from Mark
4252 improperly defined user exceptions. Thanks to feedback from Mark
4243 Russell <mrussell-AT-verio.net>.
4253 Russell <mrussell-AT-verio.net>.
4244
4254
4245 2003-08-20 Fernando Perez <fperez@colorado.edu>
4255 2003-08-20 Fernando Perez <fperez@colorado.edu>
4246
4256
4247 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4257 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4248 printing so that it would print multi-line string forms starting
4258 printing so that it would print multi-line string forms starting
4249 with a new line. This way the formatting is better respected for
4259 with a new line. This way the formatting is better respected for
4250 objects which work hard to make nice string forms.
4260 objects which work hard to make nice string forms.
4251
4261
4252 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4262 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4253 autocall would overtake data access for objects with both
4263 autocall would overtake data access for objects with both
4254 __getitem__ and __call__.
4264 __getitem__ and __call__.
4255
4265
4256 2003-08-19 *** Released version 0.5.0-rc1
4266 2003-08-19 *** Released version 0.5.0-rc1
4257
4267
4258 2003-08-19 Fernando Perez <fperez@colorado.edu>
4268 2003-08-19 Fernando Perez <fperez@colorado.edu>
4259
4269
4260 * IPython/deep_reload.py (load_tail): single tiny change here
4270 * IPython/deep_reload.py (load_tail): single tiny change here
4261 seems to fix the long-standing bug of dreload() failing to work
4271 seems to fix the long-standing bug of dreload() failing to work
4262 for dotted names. But this module is pretty tricky, so I may have
4272 for dotted names. But this module is pretty tricky, so I may have
4263 missed some subtlety. Needs more testing!.
4273 missed some subtlety. Needs more testing!.
4264
4274
4265 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4275 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4266 exceptions which have badly implemented __str__ methods.
4276 exceptions which have badly implemented __str__ methods.
4267 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4277 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4268 which I've been getting reports about from Python 2.3 users. I
4278 which I've been getting reports about from Python 2.3 users. I
4269 wish I had a simple test case to reproduce the problem, so I could
4279 wish I had a simple test case to reproduce the problem, so I could
4270 either write a cleaner workaround or file a bug report if
4280 either write a cleaner workaround or file a bug report if
4271 necessary.
4281 necessary.
4272
4282
4273 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4283 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4274 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4284 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4275 a bug report by Tjabo Kloppenburg.
4285 a bug report by Tjabo Kloppenburg.
4276
4286
4277 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4287 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4278 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4288 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4279 seems rather unstable. Thanks to a bug report by Tjabo
4289 seems rather unstable. Thanks to a bug report by Tjabo
4280 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4290 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4281
4291
4282 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4292 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4283 this out soon because of the critical fixes in the inner loop for
4293 this out soon because of the critical fixes in the inner loop for
4284 generators.
4294 generators.
4285
4295
4286 * IPython/Magic.py (Magic.getargspec): removed. This (and
4296 * IPython/Magic.py (Magic.getargspec): removed. This (and
4287 _get_def) have been obsoleted by OInspect for a long time, I
4297 _get_def) have been obsoleted by OInspect for a long time, I
4288 hadn't noticed that they were dead code.
4298 hadn't noticed that they were dead code.
4289 (Magic._ofind): restored _ofind functionality for a few literals
4299 (Magic._ofind): restored _ofind functionality for a few literals
4290 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4300 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4291 for things like "hello".capitalize?, since that would require a
4301 for things like "hello".capitalize?, since that would require a
4292 potentially dangerous eval() again.
4302 potentially dangerous eval() again.
4293
4303
4294 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4304 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4295 logic a bit more to clean up the escapes handling and minimize the
4305 logic a bit more to clean up the escapes handling and minimize the
4296 use of _ofind to only necessary cases. The interactive 'feel' of
4306 use of _ofind to only necessary cases. The interactive 'feel' of
4297 IPython should have improved quite a bit with the changes in
4307 IPython should have improved quite a bit with the changes in
4298 _prefilter and _ofind (besides being far safer than before).
4308 _prefilter and _ofind (besides being far safer than before).
4299
4309
4300 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4310 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4301 obscure, never reported). Edit would fail to find the object to
4311 obscure, never reported). Edit would fail to find the object to
4302 edit under some circumstances.
4312 edit under some circumstances.
4303 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4313 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4304 which were causing double-calling of generators. Those eval calls
4314 which were causing double-calling of generators. Those eval calls
4305 were _very_ dangerous, since code with side effects could be
4315 were _very_ dangerous, since code with side effects could be
4306 triggered. As they say, 'eval is evil'... These were the
4316 triggered. As they say, 'eval is evil'... These were the
4307 nastiest evals in IPython. Besides, _ofind is now far simpler,
4317 nastiest evals in IPython. Besides, _ofind is now far simpler,
4308 and it should also be quite a bit faster. Its use of inspect is
4318 and it should also be quite a bit faster. Its use of inspect is
4309 also safer, so perhaps some of the inspect-related crashes I've
4319 also safer, so perhaps some of the inspect-related crashes I've
4310 seen lately with Python 2.3 might be taken care of. That will
4320 seen lately with Python 2.3 might be taken care of. That will
4311 need more testing.
4321 need more testing.
4312
4322
4313 2003-08-17 Fernando Perez <fperez@colorado.edu>
4323 2003-08-17 Fernando Perez <fperez@colorado.edu>
4314
4324
4315 * IPython/iplib.py (InteractiveShell._prefilter): significant
4325 * IPython/iplib.py (InteractiveShell._prefilter): significant
4316 simplifications to the logic for handling user escapes. Faster
4326 simplifications to the logic for handling user escapes. Faster
4317 and simpler code.
4327 and simpler code.
4318
4328
4319 2003-08-14 Fernando Perez <fperez@colorado.edu>
4329 2003-08-14 Fernando Perez <fperez@colorado.edu>
4320
4330
4321 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4331 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4322 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4332 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4323 but it should be quite a bit faster. And the recursive version
4333 but it should be quite a bit faster. And the recursive version
4324 generated O(log N) intermediate storage for all rank>1 arrays,
4334 generated O(log N) intermediate storage for all rank>1 arrays,
4325 even if they were contiguous.
4335 even if they were contiguous.
4326 (l1norm): Added this function.
4336 (l1norm): Added this function.
4327 (norm): Added this function for arbitrary norms (including
4337 (norm): Added this function for arbitrary norms (including
4328 l-infinity). l1 and l2 are still special cases for convenience
4338 l-infinity). l1 and l2 are still special cases for convenience
4329 and speed.
4339 and speed.
4330
4340
4331 2003-08-03 Fernando Perez <fperez@colorado.edu>
4341 2003-08-03 Fernando Perez <fperez@colorado.edu>
4332
4342
4333 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4343 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4334 exceptions, which now raise PendingDeprecationWarnings in Python
4344 exceptions, which now raise PendingDeprecationWarnings in Python
4335 2.3. There were some in Magic and some in Gnuplot2.
4345 2.3. There were some in Magic and some in Gnuplot2.
4336
4346
4337 2003-06-30 Fernando Perez <fperez@colorado.edu>
4347 2003-06-30 Fernando Perez <fperez@colorado.edu>
4338
4348
4339 * IPython/genutils.py (page): modified to call curses only for
4349 * IPython/genutils.py (page): modified to call curses only for
4340 terminals where TERM=='xterm'. After problems under many other
4350 terminals where TERM=='xterm'. After problems under many other
4341 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4351 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4342
4352
4343 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4353 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4344 would be triggered when readline was absent. This was just an old
4354 would be triggered when readline was absent. This was just an old
4345 debugging statement I'd forgotten to take out.
4355 debugging statement I'd forgotten to take out.
4346
4356
4347 2003-06-20 Fernando Perez <fperez@colorado.edu>
4357 2003-06-20 Fernando Perez <fperez@colorado.edu>
4348
4358
4349 * IPython/genutils.py (clock): modified to return only user time
4359 * IPython/genutils.py (clock): modified to return only user time
4350 (not counting system time), after a discussion on scipy. While
4360 (not counting system time), after a discussion on scipy. While
4351 system time may be a useful quantity occasionally, it may much
4361 system time may be a useful quantity occasionally, it may much
4352 more easily be skewed by occasional swapping or other similar
4362 more easily be skewed by occasional swapping or other similar
4353 activity.
4363 activity.
4354
4364
4355 2003-06-05 Fernando Perez <fperez@colorado.edu>
4365 2003-06-05 Fernando Perez <fperez@colorado.edu>
4356
4366
4357 * IPython/numutils.py (identity): new function, for building
4367 * IPython/numutils.py (identity): new function, for building
4358 arbitrary rank Kronecker deltas (mostly backwards compatible with
4368 arbitrary rank Kronecker deltas (mostly backwards compatible with
4359 Numeric.identity)
4369 Numeric.identity)
4360
4370
4361 2003-06-03 Fernando Perez <fperez@colorado.edu>
4371 2003-06-03 Fernando Perez <fperez@colorado.edu>
4362
4372
4363 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4373 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4364 arguments passed to magics with spaces, to allow trailing '\' to
4374 arguments passed to magics with spaces, to allow trailing '\' to
4365 work normally (mainly for Windows users).
4375 work normally (mainly for Windows users).
4366
4376
4367 2003-05-29 Fernando Perez <fperez@colorado.edu>
4377 2003-05-29 Fernando Perez <fperez@colorado.edu>
4368
4378
4369 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4379 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4370 instead of pydoc.help. This fixes a bizarre behavior where
4380 instead of pydoc.help. This fixes a bizarre behavior where
4371 printing '%s' % locals() would trigger the help system. Now
4381 printing '%s' % locals() would trigger the help system. Now
4372 ipython behaves like normal python does.
4382 ipython behaves like normal python does.
4373
4383
4374 Note that if one does 'from pydoc import help', the bizarre
4384 Note that if one does 'from pydoc import help', the bizarre
4375 behavior returns, but this will also happen in normal python, so
4385 behavior returns, but this will also happen in normal python, so
4376 it's not an ipython bug anymore (it has to do with how pydoc.help
4386 it's not an ipython bug anymore (it has to do with how pydoc.help
4377 is implemented).
4387 is implemented).
4378
4388
4379 2003-05-22 Fernando Perez <fperez@colorado.edu>
4389 2003-05-22 Fernando Perez <fperez@colorado.edu>
4380
4390
4381 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4391 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4382 return [] instead of None when nothing matches, also match to end
4392 return [] instead of None when nothing matches, also match to end
4383 of line. Patch by Gary Bishop.
4393 of line. Patch by Gary Bishop.
4384
4394
4385 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4395 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4386 protection as before, for files passed on the command line. This
4396 protection as before, for files passed on the command line. This
4387 prevents the CrashHandler from kicking in if user files call into
4397 prevents the CrashHandler from kicking in if user files call into
4388 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4398 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4389 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4399 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4390
4400
4391 2003-05-20 *** Released version 0.4.0
4401 2003-05-20 *** Released version 0.4.0
4392
4402
4393 2003-05-20 Fernando Perez <fperez@colorado.edu>
4403 2003-05-20 Fernando Perez <fperez@colorado.edu>
4394
4404
4395 * setup.py: added support for manpages. It's a bit hackish b/c of
4405 * setup.py: added support for manpages. It's a bit hackish b/c of
4396 a bug in the way the bdist_rpm distutils target handles gzipped
4406 a bug in the way the bdist_rpm distutils target handles gzipped
4397 manpages, but it works. After a patch by Jack.
4407 manpages, but it works. After a patch by Jack.
4398
4408
4399 2003-05-19 Fernando Perez <fperez@colorado.edu>
4409 2003-05-19 Fernando Perez <fperez@colorado.edu>
4400
4410
4401 * IPython/numutils.py: added a mockup of the kinds module, since
4411 * IPython/numutils.py: added a mockup of the kinds module, since
4402 it was recently removed from Numeric. This way, numutils will
4412 it was recently removed from Numeric. This way, numutils will
4403 work for all users even if they are missing kinds.
4413 work for all users even if they are missing kinds.
4404
4414
4405 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4415 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4406 failure, which can occur with SWIG-wrapped extensions. After a
4416 failure, which can occur with SWIG-wrapped extensions. After a
4407 crash report from Prabhu.
4417 crash report from Prabhu.
4408
4418
4409 2003-05-16 Fernando Perez <fperez@colorado.edu>
4419 2003-05-16 Fernando Perez <fperez@colorado.edu>
4410
4420
4411 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4421 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4412 protect ipython from user code which may call directly
4422 protect ipython from user code which may call directly
4413 sys.excepthook (this looks like an ipython crash to the user, even
4423 sys.excepthook (this looks like an ipython crash to the user, even
4414 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4424 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4415 This is especially important to help users of WxWindows, but may
4425 This is especially important to help users of WxWindows, but may
4416 also be useful in other cases.
4426 also be useful in other cases.
4417
4427
4418 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4428 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4419 an optional tb_offset to be specified, and to preserve exception
4429 an optional tb_offset to be specified, and to preserve exception
4420 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4430 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4421
4431
4422 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4432 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4423
4433
4424 2003-05-15 Fernando Perez <fperez@colorado.edu>
4434 2003-05-15 Fernando Perez <fperez@colorado.edu>
4425
4435
4426 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4436 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4427 installing for a new user under Windows.
4437 installing for a new user under Windows.
4428
4438
4429 2003-05-12 Fernando Perez <fperez@colorado.edu>
4439 2003-05-12 Fernando Perez <fperez@colorado.edu>
4430
4440
4431 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4441 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4432 handler for Emacs comint-based lines. Currently it doesn't do
4442 handler for Emacs comint-based lines. Currently it doesn't do
4433 much (but importantly, it doesn't update the history cache). In
4443 much (but importantly, it doesn't update the history cache). In
4434 the future it may be expanded if Alex needs more functionality
4444 the future it may be expanded if Alex needs more functionality
4435 there.
4445 there.
4436
4446
4437 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4447 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4438 info to crash reports.
4448 info to crash reports.
4439
4449
4440 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4450 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4441 just like Python's -c. Also fixed crash with invalid -color
4451 just like Python's -c. Also fixed crash with invalid -color
4442 option value at startup. Thanks to Will French
4452 option value at startup. Thanks to Will French
4443 <wfrench-AT-bestweb.net> for the bug report.
4453 <wfrench-AT-bestweb.net> for the bug report.
4444
4454
4445 2003-05-09 Fernando Perez <fperez@colorado.edu>
4455 2003-05-09 Fernando Perez <fperez@colorado.edu>
4446
4456
4447 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4457 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4448 to EvalDict (it's a mapping, after all) and simplified its code
4458 to EvalDict (it's a mapping, after all) and simplified its code
4449 quite a bit, after a nice discussion on c.l.py where Gustavo
4459 quite a bit, after a nice discussion on c.l.py where Gustavo
4450 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4460 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4451
4461
4452 2003-04-30 Fernando Perez <fperez@colorado.edu>
4462 2003-04-30 Fernando Perez <fperez@colorado.edu>
4453
4463
4454 * IPython/genutils.py (timings_out): modified it to reduce its
4464 * IPython/genutils.py (timings_out): modified it to reduce its
4455 overhead in the common reps==1 case.
4465 overhead in the common reps==1 case.
4456
4466
4457 2003-04-29 Fernando Perez <fperez@colorado.edu>
4467 2003-04-29 Fernando Perez <fperez@colorado.edu>
4458
4468
4459 * IPython/genutils.py (timings_out): Modified to use the resource
4469 * IPython/genutils.py (timings_out): Modified to use the resource
4460 module, which avoids the wraparound problems of time.clock().
4470 module, which avoids the wraparound problems of time.clock().
4461
4471
4462 2003-04-17 *** Released version 0.2.15pre4
4472 2003-04-17 *** Released version 0.2.15pre4
4463
4473
4464 2003-04-17 Fernando Perez <fperez@colorado.edu>
4474 2003-04-17 Fernando Perez <fperez@colorado.edu>
4465
4475
4466 * setup.py (scriptfiles): Split windows-specific stuff over to a
4476 * setup.py (scriptfiles): Split windows-specific stuff over to a
4467 separate file, in an attempt to have a Windows GUI installer.
4477 separate file, in an attempt to have a Windows GUI installer.
4468 That didn't work, but part of the groundwork is done.
4478 That didn't work, but part of the groundwork is done.
4469
4479
4470 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4480 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4471 indent/unindent with 4 spaces. Particularly useful in combination
4481 indent/unindent with 4 spaces. Particularly useful in combination
4472 with the new auto-indent option.
4482 with the new auto-indent option.
4473
4483
4474 2003-04-16 Fernando Perez <fperez@colorado.edu>
4484 2003-04-16 Fernando Perez <fperez@colorado.edu>
4475
4485
4476 * IPython/Magic.py: various replacements of self.rc for
4486 * IPython/Magic.py: various replacements of self.rc for
4477 self.shell.rc. A lot more remains to be done to fully disentangle
4487 self.shell.rc. A lot more remains to be done to fully disentangle
4478 this class from the main Shell class.
4488 this class from the main Shell class.
4479
4489
4480 * IPython/GnuplotRuntime.py: added checks for mouse support so
4490 * IPython/GnuplotRuntime.py: added checks for mouse support so
4481 that we don't try to enable it if the current gnuplot doesn't
4491 that we don't try to enable it if the current gnuplot doesn't
4482 really support it. Also added checks so that we don't try to
4492 really support it. Also added checks so that we don't try to
4483 enable persist under Windows (where Gnuplot doesn't recognize the
4493 enable persist under Windows (where Gnuplot doesn't recognize the
4484 option).
4494 option).
4485
4495
4486 * IPython/iplib.py (InteractiveShell.interact): Added optional
4496 * IPython/iplib.py (InteractiveShell.interact): Added optional
4487 auto-indenting code, after a patch by King C. Shu
4497 auto-indenting code, after a patch by King C. Shu
4488 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4498 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4489 get along well with pasting indented code. If I ever figure out
4499 get along well with pasting indented code. If I ever figure out
4490 how to make that part go well, it will become on by default.
4500 how to make that part go well, it will become on by default.
4491
4501
4492 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4502 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4493 crash ipython if there was an unmatched '%' in the user's prompt
4503 crash ipython if there was an unmatched '%' in the user's prompt
4494 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4504 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4495
4505
4496 * IPython/iplib.py (InteractiveShell.interact): removed the
4506 * IPython/iplib.py (InteractiveShell.interact): removed the
4497 ability to ask the user whether he wants to crash or not at the
4507 ability to ask the user whether he wants to crash or not at the
4498 'last line' exception handler. Calling functions at that point
4508 'last line' exception handler. Calling functions at that point
4499 changes the stack, and the error reports would have incorrect
4509 changes the stack, and the error reports would have incorrect
4500 tracebacks.
4510 tracebacks.
4501
4511
4502 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4512 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4503 pass through a peger a pretty-printed form of any object. After a
4513 pass through a peger a pretty-printed form of any object. After a
4504 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4514 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4505
4515
4506 2003-04-14 Fernando Perez <fperez@colorado.edu>
4516 2003-04-14 Fernando Perez <fperez@colorado.edu>
4507
4517
4508 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4518 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4509 all files in ~ would be modified at first install (instead of
4519 all files in ~ would be modified at first install (instead of
4510 ~/.ipython). This could be potentially disastrous, as the
4520 ~/.ipython). This could be potentially disastrous, as the
4511 modification (make line-endings native) could damage binary files.
4521 modification (make line-endings native) could damage binary files.
4512
4522
4513 2003-04-10 Fernando Perez <fperez@colorado.edu>
4523 2003-04-10 Fernando Perez <fperez@colorado.edu>
4514
4524
4515 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4525 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4516 handle only lines which are invalid python. This now means that
4526 handle only lines which are invalid python. This now means that
4517 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4527 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4518 for the bug report.
4528 for the bug report.
4519
4529
4520 2003-04-01 Fernando Perez <fperez@colorado.edu>
4530 2003-04-01 Fernando Perez <fperez@colorado.edu>
4521
4531
4522 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4532 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4523 where failing to set sys.last_traceback would crash pdb.pm().
4533 where failing to set sys.last_traceback would crash pdb.pm().
4524 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4534 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4525 report.
4535 report.
4526
4536
4527 2003-03-25 Fernando Perez <fperez@colorado.edu>
4537 2003-03-25 Fernando Perez <fperez@colorado.edu>
4528
4538
4529 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4539 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4530 before printing it (it had a lot of spurious blank lines at the
4540 before printing it (it had a lot of spurious blank lines at the
4531 end).
4541 end).
4532
4542
4533 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4543 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4534 output would be sent 21 times! Obviously people don't use this
4544 output would be sent 21 times! Obviously people don't use this
4535 too often, or I would have heard about it.
4545 too often, or I would have heard about it.
4536
4546
4537 2003-03-24 Fernando Perez <fperez@colorado.edu>
4547 2003-03-24 Fernando Perez <fperez@colorado.edu>
4538
4548
4539 * setup.py (scriptfiles): renamed the data_files parameter from
4549 * setup.py (scriptfiles): renamed the data_files parameter from
4540 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4550 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4541 for the patch.
4551 for the patch.
4542
4552
4543 2003-03-20 Fernando Perez <fperez@colorado.edu>
4553 2003-03-20 Fernando Perez <fperez@colorado.edu>
4544
4554
4545 * IPython/genutils.py (error): added error() and fatal()
4555 * IPython/genutils.py (error): added error() and fatal()
4546 functions.
4556 functions.
4547
4557
4548 2003-03-18 *** Released version 0.2.15pre3
4558 2003-03-18 *** Released version 0.2.15pre3
4549
4559
4550 2003-03-18 Fernando Perez <fperez@colorado.edu>
4560 2003-03-18 Fernando Perez <fperez@colorado.edu>
4551
4561
4552 * setupext/install_data_ext.py
4562 * setupext/install_data_ext.py
4553 (install_data_ext.initialize_options): Class contributed by Jack
4563 (install_data_ext.initialize_options): Class contributed by Jack
4554 Moffit for fixing the old distutils hack. He is sending this to
4564 Moffit for fixing the old distutils hack. He is sending this to
4555 the distutils folks so in the future we may not need it as a
4565 the distutils folks so in the future we may not need it as a
4556 private fix.
4566 private fix.
4557
4567
4558 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4568 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4559 changes for Debian packaging. See his patch for full details.
4569 changes for Debian packaging. See his patch for full details.
4560 The old distutils hack of making the ipythonrc* files carry a
4570 The old distutils hack of making the ipythonrc* files carry a
4561 bogus .py extension is gone, at last. Examples were moved to a
4571 bogus .py extension is gone, at last. Examples were moved to a
4562 separate subdir under doc/, and the separate executable scripts
4572 separate subdir under doc/, and the separate executable scripts
4563 now live in their own directory. Overall a great cleanup. The
4573 now live in their own directory. Overall a great cleanup. The
4564 manual was updated to use the new files, and setup.py has been
4574 manual was updated to use the new files, and setup.py has been
4565 fixed for this setup.
4575 fixed for this setup.
4566
4576
4567 * IPython/PyColorize.py (Parser.usage): made non-executable and
4577 * IPython/PyColorize.py (Parser.usage): made non-executable and
4568 created a pycolor wrapper around it to be included as a script.
4578 created a pycolor wrapper around it to be included as a script.
4569
4579
4570 2003-03-12 *** Released version 0.2.15pre2
4580 2003-03-12 *** Released version 0.2.15pre2
4571
4581
4572 2003-03-12 Fernando Perez <fperez@colorado.edu>
4582 2003-03-12 Fernando Perez <fperez@colorado.edu>
4573
4583
4574 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4584 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4575 long-standing problem with garbage characters in some terminals.
4585 long-standing problem with garbage characters in some terminals.
4576 The issue was really that the \001 and \002 escapes must _only_ be
4586 The issue was really that the \001 and \002 escapes must _only_ be
4577 passed to input prompts (which call readline), but _never_ to
4587 passed to input prompts (which call readline), but _never_ to
4578 normal text to be printed on screen. I changed ColorANSI to have
4588 normal text to be printed on screen. I changed ColorANSI to have
4579 two classes: TermColors and InputTermColors, each with the
4589 two classes: TermColors and InputTermColors, each with the
4580 appropriate escapes for input prompts or normal text. The code in
4590 appropriate escapes for input prompts or normal text. The code in
4581 Prompts.py got slightly more complicated, but this very old and
4591 Prompts.py got slightly more complicated, but this very old and
4582 annoying bug is finally fixed.
4592 annoying bug is finally fixed.
4583
4593
4584 All the credit for nailing down the real origin of this problem
4594 All the credit for nailing down the real origin of this problem
4585 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4595 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4586 *Many* thanks to him for spending quite a bit of effort on this.
4596 *Many* thanks to him for spending quite a bit of effort on this.
4587
4597
4588 2003-03-05 *** Released version 0.2.15pre1
4598 2003-03-05 *** Released version 0.2.15pre1
4589
4599
4590 2003-03-03 Fernando Perez <fperez@colorado.edu>
4600 2003-03-03 Fernando Perez <fperez@colorado.edu>
4591
4601
4592 * IPython/FakeModule.py: Moved the former _FakeModule to a
4602 * IPython/FakeModule.py: Moved the former _FakeModule to a
4593 separate file, because it's also needed by Magic (to fix a similar
4603 separate file, because it's also needed by Magic (to fix a similar
4594 pickle-related issue in @run).
4604 pickle-related issue in @run).
4595
4605
4596 2003-03-02 Fernando Perez <fperez@colorado.edu>
4606 2003-03-02 Fernando Perez <fperez@colorado.edu>
4597
4607
4598 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4608 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4599 the autocall option at runtime.
4609 the autocall option at runtime.
4600 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4610 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4601 across Magic.py to start separating Magic from InteractiveShell.
4611 across Magic.py to start separating Magic from InteractiveShell.
4602 (Magic._ofind): Fixed to return proper namespace for dotted
4612 (Magic._ofind): Fixed to return proper namespace for dotted
4603 names. Before, a dotted name would always return 'not currently
4613 names. Before, a dotted name would always return 'not currently
4604 defined', because it would find the 'parent'. s.x would be found,
4614 defined', because it would find the 'parent'. s.x would be found,
4605 but since 'x' isn't defined by itself, it would get confused.
4615 but since 'x' isn't defined by itself, it would get confused.
4606 (Magic.magic_run): Fixed pickling problems reported by Ralf
4616 (Magic.magic_run): Fixed pickling problems reported by Ralf
4607 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4617 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4608 that I'd used when Mike Heeter reported similar issues at the
4618 that I'd used when Mike Heeter reported similar issues at the
4609 top-level, but now for @run. It boils down to injecting the
4619 top-level, but now for @run. It boils down to injecting the
4610 namespace where code is being executed with something that looks
4620 namespace where code is being executed with something that looks
4611 enough like a module to fool pickle.dump(). Since a pickle stores
4621 enough like a module to fool pickle.dump(). Since a pickle stores
4612 a named reference to the importing module, we need this for
4622 a named reference to the importing module, we need this for
4613 pickles to save something sensible.
4623 pickles to save something sensible.
4614
4624
4615 * IPython/ipmaker.py (make_IPython): added an autocall option.
4625 * IPython/ipmaker.py (make_IPython): added an autocall option.
4616
4626
4617 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4627 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4618 the auto-eval code. Now autocalling is an option, and the code is
4628 the auto-eval code. Now autocalling is an option, and the code is
4619 also vastly safer. There is no more eval() involved at all.
4629 also vastly safer. There is no more eval() involved at all.
4620
4630
4621 2003-03-01 Fernando Perez <fperez@colorado.edu>
4631 2003-03-01 Fernando Perez <fperez@colorado.edu>
4622
4632
4623 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4633 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4624 dict with named keys instead of a tuple.
4634 dict with named keys instead of a tuple.
4625
4635
4626 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4636 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4627
4637
4628 * setup.py (make_shortcut): Fixed message about directories
4638 * setup.py (make_shortcut): Fixed message about directories
4629 created during Windows installation (the directories were ok, just
4639 created during Windows installation (the directories were ok, just
4630 the printed message was misleading). Thanks to Chris Liechti
4640 the printed message was misleading). Thanks to Chris Liechti
4631 <cliechti-AT-gmx.net> for the heads up.
4641 <cliechti-AT-gmx.net> for the heads up.
4632
4642
4633 2003-02-21 Fernando Perez <fperez@colorado.edu>
4643 2003-02-21 Fernando Perez <fperez@colorado.edu>
4634
4644
4635 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4645 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4636 of ValueError exception when checking for auto-execution. This
4646 of ValueError exception when checking for auto-execution. This
4637 one is raised by things like Numeric arrays arr.flat when the
4647 one is raised by things like Numeric arrays arr.flat when the
4638 array is non-contiguous.
4648 array is non-contiguous.
4639
4649
4640 2003-01-31 Fernando Perez <fperez@colorado.edu>
4650 2003-01-31 Fernando Perez <fperez@colorado.edu>
4641
4651
4642 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4652 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4643 not return any value at all (even though the command would get
4653 not return any value at all (even though the command would get
4644 executed).
4654 executed).
4645 (xsys): Flush stdout right after printing the command to ensure
4655 (xsys): Flush stdout right after printing the command to ensure
4646 proper ordering of commands and command output in the total
4656 proper ordering of commands and command output in the total
4647 output.
4657 output.
4648 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4658 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4649 system/getoutput as defaults. The old ones are kept for
4659 system/getoutput as defaults. The old ones are kept for
4650 compatibility reasons, so no code which uses this library needs
4660 compatibility reasons, so no code which uses this library needs
4651 changing.
4661 changing.
4652
4662
4653 2003-01-27 *** Released version 0.2.14
4663 2003-01-27 *** Released version 0.2.14
4654
4664
4655 2003-01-25 Fernando Perez <fperez@colorado.edu>
4665 2003-01-25 Fernando Perez <fperez@colorado.edu>
4656
4666
4657 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4667 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4658 functions defined in previous edit sessions could not be re-edited
4668 functions defined in previous edit sessions could not be re-edited
4659 (because the temp files were immediately removed). Now temp files
4669 (because the temp files were immediately removed). Now temp files
4660 are removed only at IPython's exit.
4670 are removed only at IPython's exit.
4661 (Magic.magic_run): Improved @run to perform shell-like expansions
4671 (Magic.magic_run): Improved @run to perform shell-like expansions
4662 on its arguments (~users and $VARS). With this, @run becomes more
4672 on its arguments (~users and $VARS). With this, @run becomes more
4663 like a normal command-line.
4673 like a normal command-line.
4664
4674
4665 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4675 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4666 bugs related to embedding and cleaned up that code. A fairly
4676 bugs related to embedding and cleaned up that code. A fairly
4667 important one was the impossibility to access the global namespace
4677 important one was the impossibility to access the global namespace
4668 through the embedded IPython (only local variables were visible).
4678 through the embedded IPython (only local variables were visible).
4669
4679
4670 2003-01-14 Fernando Perez <fperez@colorado.edu>
4680 2003-01-14 Fernando Perez <fperez@colorado.edu>
4671
4681
4672 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4682 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4673 auto-calling to be a bit more conservative. Now it doesn't get
4683 auto-calling to be a bit more conservative. Now it doesn't get
4674 triggered if any of '!=()<>' are in the rest of the input line, to
4684 triggered if any of '!=()<>' are in the rest of the input line, to
4675 allow comparing callables. Thanks to Alex for the heads up.
4685 allow comparing callables. Thanks to Alex for the heads up.
4676
4686
4677 2003-01-07 Fernando Perez <fperez@colorado.edu>
4687 2003-01-07 Fernando Perez <fperez@colorado.edu>
4678
4688
4679 * IPython/genutils.py (page): fixed estimation of the number of
4689 * IPython/genutils.py (page): fixed estimation of the number of
4680 lines in a string to be paged to simply count newlines. This
4690 lines in a string to be paged to simply count newlines. This
4681 prevents over-guessing due to embedded escape sequences. A better
4691 prevents over-guessing due to embedded escape sequences. A better
4682 long-term solution would involve stripping out the control chars
4692 long-term solution would involve stripping out the control chars
4683 for the count, but it's potentially so expensive I just don't
4693 for the count, but it's potentially so expensive I just don't
4684 think it's worth doing.
4694 think it's worth doing.
4685
4695
4686 2002-12-19 *** Released version 0.2.14pre50
4696 2002-12-19 *** Released version 0.2.14pre50
4687
4697
4688 2002-12-19 Fernando Perez <fperez@colorado.edu>
4698 2002-12-19 Fernando Perez <fperez@colorado.edu>
4689
4699
4690 * tools/release (version): Changed release scripts to inform
4700 * tools/release (version): Changed release scripts to inform
4691 Andrea and build a NEWS file with a list of recent changes.
4701 Andrea and build a NEWS file with a list of recent changes.
4692
4702
4693 * IPython/ColorANSI.py (__all__): changed terminal detection
4703 * IPython/ColorANSI.py (__all__): changed terminal detection
4694 code. Seems to work better for xterms without breaking
4704 code. Seems to work better for xterms without breaking
4695 konsole. Will need more testing to determine if WinXP and Mac OSX
4705 konsole. Will need more testing to determine if WinXP and Mac OSX
4696 also work ok.
4706 also work ok.
4697
4707
4698 2002-12-18 *** Released version 0.2.14pre49
4708 2002-12-18 *** Released version 0.2.14pre49
4699
4709
4700 2002-12-18 Fernando Perez <fperez@colorado.edu>
4710 2002-12-18 Fernando Perez <fperez@colorado.edu>
4701
4711
4702 * Docs: added new info about Mac OSX, from Andrea.
4712 * Docs: added new info about Mac OSX, from Andrea.
4703
4713
4704 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4714 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4705 allow direct plotting of python strings whose format is the same
4715 allow direct plotting of python strings whose format is the same
4706 of gnuplot data files.
4716 of gnuplot data files.
4707
4717
4708 2002-12-16 Fernando Perez <fperez@colorado.edu>
4718 2002-12-16 Fernando Perez <fperez@colorado.edu>
4709
4719
4710 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4720 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4711 value of exit question to be acknowledged.
4721 value of exit question to be acknowledged.
4712
4722
4713 2002-12-03 Fernando Perez <fperez@colorado.edu>
4723 2002-12-03 Fernando Perez <fperez@colorado.edu>
4714
4724
4715 * IPython/ipmaker.py: removed generators, which had been added
4725 * IPython/ipmaker.py: removed generators, which had been added
4716 by mistake in an earlier debugging run. This was causing trouble
4726 by mistake in an earlier debugging run. This was causing trouble
4717 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4727 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4718 for pointing this out.
4728 for pointing this out.
4719
4729
4720 2002-11-17 Fernando Perez <fperez@colorado.edu>
4730 2002-11-17 Fernando Perez <fperez@colorado.edu>
4721
4731
4722 * Manual: updated the Gnuplot section.
4732 * Manual: updated the Gnuplot section.
4723
4733
4724 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4734 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4725 a much better split of what goes in Runtime and what goes in
4735 a much better split of what goes in Runtime and what goes in
4726 Interactive.
4736 Interactive.
4727
4737
4728 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4738 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4729 being imported from iplib.
4739 being imported from iplib.
4730
4740
4731 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4741 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4732 for command-passing. Now the global Gnuplot instance is called
4742 for command-passing. Now the global Gnuplot instance is called
4733 'gp' instead of 'g', which was really a far too fragile and
4743 'gp' instead of 'g', which was really a far too fragile and
4734 common name.
4744 common name.
4735
4745
4736 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4746 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4737 bounding boxes generated by Gnuplot for square plots.
4747 bounding boxes generated by Gnuplot for square plots.
4738
4748
4739 * IPython/genutils.py (popkey): new function added. I should
4749 * IPython/genutils.py (popkey): new function added. I should
4740 suggest this on c.l.py as a dict method, it seems useful.
4750 suggest this on c.l.py as a dict method, it seems useful.
4741
4751
4742 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4752 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4743 to transparently handle PostScript generation. MUCH better than
4753 to transparently handle PostScript generation. MUCH better than
4744 the previous plot_eps/replot_eps (which I removed now). The code
4754 the previous plot_eps/replot_eps (which I removed now). The code
4745 is also fairly clean and well documented now (including
4755 is also fairly clean and well documented now (including
4746 docstrings).
4756 docstrings).
4747
4757
4748 2002-11-13 Fernando Perez <fperez@colorado.edu>
4758 2002-11-13 Fernando Perez <fperez@colorado.edu>
4749
4759
4750 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4760 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4751 (inconsistent with options).
4761 (inconsistent with options).
4752
4762
4753 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4763 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4754 manually disabled, I don't know why. Fixed it.
4764 manually disabled, I don't know why. Fixed it.
4755 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4765 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4756 eps output.
4766 eps output.
4757
4767
4758 2002-11-12 Fernando Perez <fperez@colorado.edu>
4768 2002-11-12 Fernando Perez <fperez@colorado.edu>
4759
4769
4760 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4770 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4761 don't propagate up to caller. Fixes crash reported by François
4771 don't propagate up to caller. Fixes crash reported by François
4762 Pinard.
4772 Pinard.
4763
4773
4764 2002-11-09 Fernando Perez <fperez@colorado.edu>
4774 2002-11-09 Fernando Perez <fperez@colorado.edu>
4765
4775
4766 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4776 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4767 history file for new users.
4777 history file for new users.
4768 (make_IPython): fixed bug where initial install would leave the
4778 (make_IPython): fixed bug where initial install would leave the
4769 user running in the .ipython dir.
4779 user running in the .ipython dir.
4770 (make_IPython): fixed bug where config dir .ipython would be
4780 (make_IPython): fixed bug where config dir .ipython would be
4771 created regardless of the given -ipythondir option. Thanks to Cory
4781 created regardless of the given -ipythondir option. Thanks to Cory
4772 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4782 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4773
4783
4774 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4784 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4775 type confirmations. Will need to use it in all of IPython's code
4785 type confirmations. Will need to use it in all of IPython's code
4776 consistently.
4786 consistently.
4777
4787
4778 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4788 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4779 context to print 31 lines instead of the default 5. This will make
4789 context to print 31 lines instead of the default 5. This will make
4780 the crash reports extremely detailed in case the problem is in
4790 the crash reports extremely detailed in case the problem is in
4781 libraries I don't have access to.
4791 libraries I don't have access to.
4782
4792
4783 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4793 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4784 line of defense' code to still crash, but giving users fair
4794 line of defense' code to still crash, but giving users fair
4785 warning. I don't want internal errors to go unreported: if there's
4795 warning. I don't want internal errors to go unreported: if there's
4786 an internal problem, IPython should crash and generate a full
4796 an internal problem, IPython should crash and generate a full
4787 report.
4797 report.
4788
4798
4789 2002-11-08 Fernando Perez <fperez@colorado.edu>
4799 2002-11-08 Fernando Perez <fperez@colorado.edu>
4790
4800
4791 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4801 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4792 otherwise uncaught exceptions which can appear if people set
4802 otherwise uncaught exceptions which can appear if people set
4793 sys.stdout to something badly broken. Thanks to a crash report
4803 sys.stdout to something badly broken. Thanks to a crash report
4794 from henni-AT-mail.brainbot.com.
4804 from henni-AT-mail.brainbot.com.
4795
4805
4796 2002-11-04 Fernando Perez <fperez@colorado.edu>
4806 2002-11-04 Fernando Perez <fperez@colorado.edu>
4797
4807
4798 * IPython/iplib.py (InteractiveShell.interact): added
4808 * IPython/iplib.py (InteractiveShell.interact): added
4799 __IPYTHON__active to the builtins. It's a flag which goes on when
4809 __IPYTHON__active to the builtins. It's a flag which goes on when
4800 the interaction starts and goes off again when it stops. This
4810 the interaction starts and goes off again when it stops. This
4801 allows embedding code to detect being inside IPython. Before this
4811 allows embedding code to detect being inside IPython. Before this
4802 was done via __IPYTHON__, but that only shows that an IPython
4812 was done via __IPYTHON__, but that only shows that an IPython
4803 instance has been created.
4813 instance has been created.
4804
4814
4805 * IPython/Magic.py (Magic.magic_env): I realized that in a
4815 * IPython/Magic.py (Magic.magic_env): I realized that in a
4806 UserDict, instance.data holds the data as a normal dict. So I
4816 UserDict, instance.data holds the data as a normal dict. So I
4807 modified @env to return os.environ.data instead of rebuilding a
4817 modified @env to return os.environ.data instead of rebuilding a
4808 dict by hand.
4818 dict by hand.
4809
4819
4810 2002-11-02 Fernando Perez <fperez@colorado.edu>
4820 2002-11-02 Fernando Perez <fperez@colorado.edu>
4811
4821
4812 * IPython/genutils.py (warn): changed so that level 1 prints no
4822 * IPython/genutils.py (warn): changed so that level 1 prints no
4813 header. Level 2 is now the default (with 'WARNING' header, as
4823 header. Level 2 is now the default (with 'WARNING' header, as
4814 before). I think I tracked all places where changes were needed in
4824 before). I think I tracked all places where changes were needed in
4815 IPython, but outside code using the old level numbering may have
4825 IPython, but outside code using the old level numbering may have
4816 broken.
4826 broken.
4817
4827
4818 * IPython/iplib.py (InteractiveShell.runcode): added this to
4828 * IPython/iplib.py (InteractiveShell.runcode): added this to
4819 handle the tracebacks in SystemExit traps correctly. The previous
4829 handle the tracebacks in SystemExit traps correctly. The previous
4820 code (through interact) was printing more of the stack than
4830 code (through interact) was printing more of the stack than
4821 necessary, showing IPython internal code to the user.
4831 necessary, showing IPython internal code to the user.
4822
4832
4823 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4833 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4824 default. Now that the default at the confirmation prompt is yes,
4834 default. Now that the default at the confirmation prompt is yes,
4825 it's not so intrusive. François' argument that ipython sessions
4835 it's not so intrusive. François' argument that ipython sessions
4826 tend to be complex enough not to lose them from an accidental C-d,
4836 tend to be complex enough not to lose them from an accidental C-d,
4827 is a valid one.
4837 is a valid one.
4828
4838
4829 * IPython/iplib.py (InteractiveShell.interact): added a
4839 * IPython/iplib.py (InteractiveShell.interact): added a
4830 showtraceback() call to the SystemExit trap, and modified the exit
4840 showtraceback() call to the SystemExit trap, and modified the exit
4831 confirmation to have yes as the default.
4841 confirmation to have yes as the default.
4832
4842
4833 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4843 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4834 this file. It's been gone from the code for a long time, this was
4844 this file. It's been gone from the code for a long time, this was
4835 simply leftover junk.
4845 simply leftover junk.
4836
4846
4837 2002-11-01 Fernando Perez <fperez@colorado.edu>
4847 2002-11-01 Fernando Perez <fperez@colorado.edu>
4838
4848
4839 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4849 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4840 added. If set, IPython now traps EOF and asks for
4850 added. If set, IPython now traps EOF and asks for
4841 confirmation. After a request by François Pinard.
4851 confirmation. After a request by François Pinard.
4842
4852
4843 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4853 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4844 of @abort, and with a new (better) mechanism for handling the
4854 of @abort, and with a new (better) mechanism for handling the
4845 exceptions.
4855 exceptions.
4846
4856
4847 2002-10-27 Fernando Perez <fperez@colorado.edu>
4857 2002-10-27 Fernando Perez <fperez@colorado.edu>
4848
4858
4849 * IPython/usage.py (__doc__): updated the --help information and
4859 * IPython/usage.py (__doc__): updated the --help information and
4850 the ipythonrc file to indicate that -log generates
4860 the ipythonrc file to indicate that -log generates
4851 ./ipython.log. Also fixed the corresponding info in @logstart.
4861 ./ipython.log. Also fixed the corresponding info in @logstart.
4852 This and several other fixes in the manuals thanks to reports by
4862 This and several other fixes in the manuals thanks to reports by
4853 François Pinard <pinard-AT-iro.umontreal.ca>.
4863 François Pinard <pinard-AT-iro.umontreal.ca>.
4854
4864
4855 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4865 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4856 refer to @logstart (instead of @log, which doesn't exist).
4866 refer to @logstart (instead of @log, which doesn't exist).
4857
4867
4858 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4868 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4859 AttributeError crash. Thanks to Christopher Armstrong
4869 AttributeError crash. Thanks to Christopher Armstrong
4860 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4870 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4861 introduced recently (in 0.2.14pre37) with the fix to the eval
4871 introduced recently (in 0.2.14pre37) with the fix to the eval
4862 problem mentioned below.
4872 problem mentioned below.
4863
4873
4864 2002-10-17 Fernando Perez <fperez@colorado.edu>
4874 2002-10-17 Fernando Perez <fperez@colorado.edu>
4865
4875
4866 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4876 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4867 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4877 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4868
4878
4869 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4879 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4870 this function to fix a problem reported by Alex Schmolck. He saw
4880 this function to fix a problem reported by Alex Schmolck. He saw
4871 it with list comprehensions and generators, which were getting
4881 it with list comprehensions and generators, which were getting
4872 called twice. The real problem was an 'eval' call in testing for
4882 called twice. The real problem was an 'eval' call in testing for
4873 automagic which was evaluating the input line silently.
4883 automagic which was evaluating the input line silently.
4874
4884
4875 This is a potentially very nasty bug, if the input has side
4885 This is a potentially very nasty bug, if the input has side
4876 effects which must not be repeated. The code is much cleaner now,
4886 effects which must not be repeated. The code is much cleaner now,
4877 without any blanket 'except' left and with a regexp test for
4887 without any blanket 'except' left and with a regexp test for
4878 actual function names.
4888 actual function names.
4879
4889
4880 But an eval remains, which I'm not fully comfortable with. I just
4890 But an eval remains, which I'm not fully comfortable with. I just
4881 don't know how to find out if an expression could be a callable in
4891 don't know how to find out if an expression could be a callable in
4882 the user's namespace without doing an eval on the string. However
4892 the user's namespace without doing an eval on the string. However
4883 that string is now much more strictly checked so that no code
4893 that string is now much more strictly checked so that no code
4884 slips by, so the eval should only happen for things that can
4894 slips by, so the eval should only happen for things that can
4885 really be only function/method names.
4895 really be only function/method names.
4886
4896
4887 2002-10-15 Fernando Perez <fperez@colorado.edu>
4897 2002-10-15 Fernando Perez <fperez@colorado.edu>
4888
4898
4889 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4899 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4890 OSX information to main manual, removed README_Mac_OSX file from
4900 OSX information to main manual, removed README_Mac_OSX file from
4891 distribution. Also updated credits for recent additions.
4901 distribution. Also updated credits for recent additions.
4892
4902
4893 2002-10-10 Fernando Perez <fperez@colorado.edu>
4903 2002-10-10 Fernando Perez <fperez@colorado.edu>
4894
4904
4895 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4905 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4896 terminal-related issues. Many thanks to Andrea Riciputi
4906 terminal-related issues. Many thanks to Andrea Riciputi
4897 <andrea.riciputi-AT-libero.it> for writing it.
4907 <andrea.riciputi-AT-libero.it> for writing it.
4898
4908
4899 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4909 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4900 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4910 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4901
4911
4902 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4912 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4903 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4913 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4904 <syver-en-AT-online.no> who both submitted patches for this problem.
4914 <syver-en-AT-online.no> who both submitted patches for this problem.
4905
4915
4906 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4916 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4907 global embedding to make sure that things don't overwrite user
4917 global embedding to make sure that things don't overwrite user
4908 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4918 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4909
4919
4910 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4920 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4911 compatibility. Thanks to Hayden Callow
4921 compatibility. Thanks to Hayden Callow
4912 <h.callow-AT-elec.canterbury.ac.nz>
4922 <h.callow-AT-elec.canterbury.ac.nz>
4913
4923
4914 2002-10-04 Fernando Perez <fperez@colorado.edu>
4924 2002-10-04 Fernando Perez <fperez@colorado.edu>
4915
4925
4916 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4926 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4917 Gnuplot.File objects.
4927 Gnuplot.File objects.
4918
4928
4919 2002-07-23 Fernando Perez <fperez@colorado.edu>
4929 2002-07-23 Fernando Perez <fperez@colorado.edu>
4920
4930
4921 * IPython/genutils.py (timing): Added timings() and timing() for
4931 * IPython/genutils.py (timing): Added timings() and timing() for
4922 quick access to the most commonly needed data, the execution
4932 quick access to the most commonly needed data, the execution
4923 times. Old timing() renamed to timings_out().
4933 times. Old timing() renamed to timings_out().
4924
4934
4925 2002-07-18 Fernando Perez <fperez@colorado.edu>
4935 2002-07-18 Fernando Perez <fperez@colorado.edu>
4926
4936
4927 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4937 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4928 bug with nested instances disrupting the parent's tab completion.
4938 bug with nested instances disrupting the parent's tab completion.
4929
4939
4930 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4940 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4931 all_completions code to begin the emacs integration.
4941 all_completions code to begin the emacs integration.
4932
4942
4933 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4943 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4934 argument to allow titling individual arrays when plotting.
4944 argument to allow titling individual arrays when plotting.
4935
4945
4936 2002-07-15 Fernando Perez <fperez@colorado.edu>
4946 2002-07-15 Fernando Perez <fperez@colorado.edu>
4937
4947
4938 * setup.py (make_shortcut): changed to retrieve the value of
4948 * setup.py (make_shortcut): changed to retrieve the value of
4939 'Program Files' directory from the registry (this value changes in
4949 'Program Files' directory from the registry (this value changes in
4940 non-english versions of Windows). Thanks to Thomas Fanslau
4950 non-english versions of Windows). Thanks to Thomas Fanslau
4941 <tfanslau-AT-gmx.de> for the report.
4951 <tfanslau-AT-gmx.de> for the report.
4942
4952
4943 2002-07-10 Fernando Perez <fperez@colorado.edu>
4953 2002-07-10 Fernando Perez <fperez@colorado.edu>
4944
4954
4945 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4955 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4946 a bug in pdb, which crashes if a line with only whitespace is
4956 a bug in pdb, which crashes if a line with only whitespace is
4947 entered. Bug report submitted to sourceforge.
4957 entered. Bug report submitted to sourceforge.
4948
4958
4949 2002-07-09 Fernando Perez <fperez@colorado.edu>
4959 2002-07-09 Fernando Perez <fperez@colorado.edu>
4950
4960
4951 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4961 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4952 reporting exceptions (it's a bug in inspect.py, I just set a
4962 reporting exceptions (it's a bug in inspect.py, I just set a
4953 workaround).
4963 workaround).
4954
4964
4955 2002-07-08 Fernando Perez <fperez@colorado.edu>
4965 2002-07-08 Fernando Perez <fperez@colorado.edu>
4956
4966
4957 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4967 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4958 __IPYTHON__ in __builtins__ to show up in user_ns.
4968 __IPYTHON__ in __builtins__ to show up in user_ns.
4959
4969
4960 2002-07-03 Fernando Perez <fperez@colorado.edu>
4970 2002-07-03 Fernando Perez <fperez@colorado.edu>
4961
4971
4962 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4972 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4963 name from @gp_set_instance to @gp_set_default.
4973 name from @gp_set_instance to @gp_set_default.
4964
4974
4965 * IPython/ipmaker.py (make_IPython): default editor value set to
4975 * IPython/ipmaker.py (make_IPython): default editor value set to
4966 '0' (a string), to match the rc file. Otherwise will crash when
4976 '0' (a string), to match the rc file. Otherwise will crash when
4967 .strip() is called on it.
4977 .strip() is called on it.
4968
4978
4969
4979
4970 2002-06-28 Fernando Perez <fperez@colorado.edu>
4980 2002-06-28 Fernando Perez <fperez@colorado.edu>
4971
4981
4972 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4982 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4973 of files in current directory when a file is executed via
4983 of files in current directory when a file is executed via
4974 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4984 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4975
4985
4976 * setup.py (manfiles): fix for rpm builds, submitted by RA
4986 * setup.py (manfiles): fix for rpm builds, submitted by RA
4977 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4987 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4978
4988
4979 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4989 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4980 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4990 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4981 string!). A. Schmolck caught this one.
4991 string!). A. Schmolck caught this one.
4982
4992
4983 2002-06-27 Fernando Perez <fperez@colorado.edu>
4993 2002-06-27 Fernando Perez <fperez@colorado.edu>
4984
4994
4985 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4995 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4986 defined files at the cmd line. __name__ wasn't being set to
4996 defined files at the cmd line. __name__ wasn't being set to
4987 __main__.
4997 __main__.
4988
4998
4989 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4999 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4990 regular lists and tuples besides Numeric arrays.
5000 regular lists and tuples besides Numeric arrays.
4991
5001
4992 * IPython/Prompts.py (CachedOutput.__call__): Added output
5002 * IPython/Prompts.py (CachedOutput.__call__): Added output
4993 supression for input ending with ';'. Similar to Mathematica and
5003 supression for input ending with ';'. Similar to Mathematica and
4994 Matlab. The _* vars and Out[] list are still updated, just like
5004 Matlab. The _* vars and Out[] list are still updated, just like
4995 Mathematica behaves.
5005 Mathematica behaves.
4996
5006
4997 2002-06-25 Fernando Perez <fperez@colorado.edu>
5007 2002-06-25 Fernando Perez <fperez@colorado.edu>
4998
5008
4999 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5009 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5000 .ini extensions for profiels under Windows.
5010 .ini extensions for profiels under Windows.
5001
5011
5002 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5012 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5003 string form. Fix contributed by Alexander Schmolck
5013 string form. Fix contributed by Alexander Schmolck
5004 <a.schmolck-AT-gmx.net>
5014 <a.schmolck-AT-gmx.net>
5005
5015
5006 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5016 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5007 pre-configured Gnuplot instance.
5017 pre-configured Gnuplot instance.
5008
5018
5009 2002-06-21 Fernando Perez <fperez@colorado.edu>
5019 2002-06-21 Fernando Perez <fperez@colorado.edu>
5010
5020
5011 * IPython/numutils.py (exp_safe): new function, works around the
5021 * IPython/numutils.py (exp_safe): new function, works around the
5012 underflow problems in Numeric.
5022 underflow problems in Numeric.
5013 (log2): New fn. Safe log in base 2: returns exact integer answer
5023 (log2): New fn. Safe log in base 2: returns exact integer answer
5014 for exact integer powers of 2.
5024 for exact integer powers of 2.
5015
5025
5016 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5026 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5017 properly.
5027 properly.
5018
5028
5019 2002-06-20 Fernando Perez <fperez@colorado.edu>
5029 2002-06-20 Fernando Perez <fperez@colorado.edu>
5020
5030
5021 * IPython/genutils.py (timing): new function like
5031 * IPython/genutils.py (timing): new function like
5022 Mathematica's. Similar to time_test, but returns more info.
5032 Mathematica's. Similar to time_test, but returns more info.
5023
5033
5024 2002-06-18 Fernando Perez <fperez@colorado.edu>
5034 2002-06-18 Fernando Perez <fperez@colorado.edu>
5025
5035
5026 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5036 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5027 according to Mike Heeter's suggestions.
5037 according to Mike Heeter's suggestions.
5028
5038
5029 2002-06-16 Fernando Perez <fperez@colorado.edu>
5039 2002-06-16 Fernando Perez <fperez@colorado.edu>
5030
5040
5031 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5041 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5032 system. GnuplotMagic is gone as a user-directory option. New files
5042 system. GnuplotMagic is gone as a user-directory option. New files
5033 make it easier to use all the gnuplot stuff both from external
5043 make it easier to use all the gnuplot stuff both from external
5034 programs as well as from IPython. Had to rewrite part of
5044 programs as well as from IPython. Had to rewrite part of
5035 hardcopy() b/c of a strange bug: often the ps files simply don't
5045 hardcopy() b/c of a strange bug: often the ps files simply don't
5036 get created, and require a repeat of the command (often several
5046 get created, and require a repeat of the command (often several
5037 times).
5047 times).
5038
5048
5039 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5049 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5040 resolve output channel at call time, so that if sys.stderr has
5050 resolve output channel at call time, so that if sys.stderr has
5041 been redirected by user this gets honored.
5051 been redirected by user this gets honored.
5042
5052
5043 2002-06-13 Fernando Perez <fperez@colorado.edu>
5053 2002-06-13 Fernando Perez <fperez@colorado.edu>
5044
5054
5045 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5055 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5046 IPShell. Kept a copy with the old names to avoid breaking people's
5056 IPShell. Kept a copy with the old names to avoid breaking people's
5047 embedded code.
5057 embedded code.
5048
5058
5049 * IPython/ipython: simplified it to the bare minimum after
5059 * IPython/ipython: simplified it to the bare minimum after
5050 Holger's suggestions. Added info about how to use it in
5060 Holger's suggestions. Added info about how to use it in
5051 PYTHONSTARTUP.
5061 PYTHONSTARTUP.
5052
5062
5053 * IPython/Shell.py (IPythonShell): changed the options passing
5063 * IPython/Shell.py (IPythonShell): changed the options passing
5054 from a string with funky %s replacements to a straight list. Maybe
5064 from a string with funky %s replacements to a straight list. Maybe
5055 a bit more typing, but it follows sys.argv conventions, so there's
5065 a bit more typing, but it follows sys.argv conventions, so there's
5056 less special-casing to remember.
5066 less special-casing to remember.
5057
5067
5058 2002-06-12 Fernando Perez <fperez@colorado.edu>
5068 2002-06-12 Fernando Perez <fperez@colorado.edu>
5059
5069
5060 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5070 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5061 command. Thanks to a suggestion by Mike Heeter.
5071 command. Thanks to a suggestion by Mike Heeter.
5062 (Magic.magic_pfile): added behavior to look at filenames if given
5072 (Magic.magic_pfile): added behavior to look at filenames if given
5063 arg is not a defined object.
5073 arg is not a defined object.
5064 (Magic.magic_save): New @save function to save code snippets. Also
5074 (Magic.magic_save): New @save function to save code snippets. Also
5065 a Mike Heeter idea.
5075 a Mike Heeter idea.
5066
5076
5067 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5077 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5068 plot() and replot(). Much more convenient now, especially for
5078 plot() and replot(). Much more convenient now, especially for
5069 interactive use.
5079 interactive use.
5070
5080
5071 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5081 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5072 filenames.
5082 filenames.
5073
5083
5074 2002-06-02 Fernando Perez <fperez@colorado.edu>
5084 2002-06-02 Fernando Perez <fperez@colorado.edu>
5075
5085
5076 * IPython/Struct.py (Struct.__init__): modified to admit
5086 * IPython/Struct.py (Struct.__init__): modified to admit
5077 initialization via another struct.
5087 initialization via another struct.
5078
5088
5079 * IPython/genutils.py (SystemExec.__init__): New stateful
5089 * IPython/genutils.py (SystemExec.__init__): New stateful
5080 interface to xsys and bq. Useful for writing system scripts.
5090 interface to xsys and bq. Useful for writing system scripts.
5081
5091
5082 2002-05-30 Fernando Perez <fperez@colorado.edu>
5092 2002-05-30 Fernando Perez <fperez@colorado.edu>
5083
5093
5084 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5094 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5085 documents. This will make the user download smaller (it's getting
5095 documents. This will make the user download smaller (it's getting
5086 too big).
5096 too big).
5087
5097
5088 2002-05-29 Fernando Perez <fperez@colorado.edu>
5098 2002-05-29 Fernando Perez <fperez@colorado.edu>
5089
5099
5090 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5100 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5091 fix problems with shelve and pickle. Seems to work, but I don't
5101 fix problems with shelve and pickle. Seems to work, but I don't
5092 know if corner cases break it. Thanks to Mike Heeter
5102 know if corner cases break it. Thanks to Mike Heeter
5093 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5103 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5094
5104
5095 2002-05-24 Fernando Perez <fperez@colorado.edu>
5105 2002-05-24 Fernando Perez <fperez@colorado.edu>
5096
5106
5097 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5107 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5098 macros having broken.
5108 macros having broken.
5099
5109
5100 2002-05-21 Fernando Perez <fperez@colorado.edu>
5110 2002-05-21 Fernando Perez <fperez@colorado.edu>
5101
5111
5102 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5112 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5103 introduced logging bug: all history before logging started was
5113 introduced logging bug: all history before logging started was
5104 being written one character per line! This came from the redesign
5114 being written one character per line! This came from the redesign
5105 of the input history as a special list which slices to strings,
5115 of the input history as a special list which slices to strings,
5106 not to lists.
5116 not to lists.
5107
5117
5108 2002-05-20 Fernando Perez <fperez@colorado.edu>
5118 2002-05-20 Fernando Perez <fperez@colorado.edu>
5109
5119
5110 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5120 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5111 be an attribute of all classes in this module. The design of these
5121 be an attribute of all classes in this module. The design of these
5112 classes needs some serious overhauling.
5122 classes needs some serious overhauling.
5113
5123
5114 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5124 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5115 which was ignoring '_' in option names.
5125 which was ignoring '_' in option names.
5116
5126
5117 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5127 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5118 'Verbose_novars' to 'Context' and made it the new default. It's a
5128 'Verbose_novars' to 'Context' and made it the new default. It's a
5119 bit more readable and also safer than verbose.
5129 bit more readable and also safer than verbose.
5120
5130
5121 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5131 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5122 triple-quoted strings.
5132 triple-quoted strings.
5123
5133
5124 * IPython/OInspect.py (__all__): new module exposing the object
5134 * IPython/OInspect.py (__all__): new module exposing the object
5125 introspection facilities. Now the corresponding magics are dummy
5135 introspection facilities. Now the corresponding magics are dummy
5126 wrappers around this. Having this module will make it much easier
5136 wrappers around this. Having this module will make it much easier
5127 to put these functions into our modified pdb.
5137 to put these functions into our modified pdb.
5128 This new object inspector system uses the new colorizing module,
5138 This new object inspector system uses the new colorizing module,
5129 so source code and other things are nicely syntax highlighted.
5139 so source code and other things are nicely syntax highlighted.
5130
5140
5131 2002-05-18 Fernando Perez <fperez@colorado.edu>
5141 2002-05-18 Fernando Perez <fperez@colorado.edu>
5132
5142
5133 * IPython/ColorANSI.py: Split the coloring tools into a separate
5143 * IPython/ColorANSI.py: Split the coloring tools into a separate
5134 module so I can use them in other code easier (they were part of
5144 module so I can use them in other code easier (they were part of
5135 ultraTB).
5145 ultraTB).
5136
5146
5137 2002-05-17 Fernando Perez <fperez@colorado.edu>
5147 2002-05-17 Fernando Perez <fperez@colorado.edu>
5138
5148
5139 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5149 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5140 fixed it to set the global 'g' also to the called instance, as
5150 fixed it to set the global 'g' also to the called instance, as
5141 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5151 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5142 user's 'g' variables).
5152 user's 'g' variables).
5143
5153
5144 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5154 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5145 global variables (aliases to _ih,_oh) so that users which expect
5155 global variables (aliases to _ih,_oh) so that users which expect
5146 In[5] or Out[7] to work aren't unpleasantly surprised.
5156 In[5] or Out[7] to work aren't unpleasantly surprised.
5147 (InputList.__getslice__): new class to allow executing slices of
5157 (InputList.__getslice__): new class to allow executing slices of
5148 input history directly. Very simple class, complements the use of
5158 input history directly. Very simple class, complements the use of
5149 macros.
5159 macros.
5150
5160
5151 2002-05-16 Fernando Perez <fperez@colorado.edu>
5161 2002-05-16 Fernando Perez <fperez@colorado.edu>
5152
5162
5153 * setup.py (docdirbase): make doc directory be just doc/IPython
5163 * setup.py (docdirbase): make doc directory be just doc/IPython
5154 without version numbers, it will reduce clutter for users.
5164 without version numbers, it will reduce clutter for users.
5155
5165
5156 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5166 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5157 execfile call to prevent possible memory leak. See for details:
5167 execfile call to prevent possible memory leak. See for details:
5158 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5168 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5159
5169
5160 2002-05-15 Fernando Perez <fperez@colorado.edu>
5170 2002-05-15 Fernando Perez <fperez@colorado.edu>
5161
5171
5162 * IPython/Magic.py (Magic.magic_psource): made the object
5172 * IPython/Magic.py (Magic.magic_psource): made the object
5163 introspection names be more standard: pdoc, pdef, pfile and
5173 introspection names be more standard: pdoc, pdef, pfile and
5164 psource. They all print/page their output, and it makes
5174 psource. They all print/page their output, and it makes
5165 remembering them easier. Kept old names for compatibility as
5175 remembering them easier. Kept old names for compatibility as
5166 aliases.
5176 aliases.
5167
5177
5168 2002-05-14 Fernando Perez <fperez@colorado.edu>
5178 2002-05-14 Fernando Perez <fperez@colorado.edu>
5169
5179
5170 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5180 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5171 what the mouse problem was. The trick is to use gnuplot with temp
5181 what the mouse problem was. The trick is to use gnuplot with temp
5172 files and NOT with pipes (for data communication), because having
5182 files and NOT with pipes (for data communication), because having
5173 both pipes and the mouse on is bad news.
5183 both pipes and the mouse on is bad news.
5174
5184
5175 2002-05-13 Fernando Perez <fperez@colorado.edu>
5185 2002-05-13 Fernando Perez <fperez@colorado.edu>
5176
5186
5177 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5187 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5178 bug. Information would be reported about builtins even when
5188 bug. Information would be reported about builtins even when
5179 user-defined functions overrode them.
5189 user-defined functions overrode them.
5180
5190
5181 2002-05-11 Fernando Perez <fperez@colorado.edu>
5191 2002-05-11 Fernando Perez <fperez@colorado.edu>
5182
5192
5183 * IPython/__init__.py (__all__): removed FlexCompleter from
5193 * IPython/__init__.py (__all__): removed FlexCompleter from
5184 __all__ so that things don't fail in platforms without readline.
5194 __all__ so that things don't fail in platforms without readline.
5185
5195
5186 2002-05-10 Fernando Perez <fperez@colorado.edu>
5196 2002-05-10 Fernando Perez <fperez@colorado.edu>
5187
5197
5188 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5198 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5189 it requires Numeric, effectively making Numeric a dependency for
5199 it requires Numeric, effectively making Numeric a dependency for
5190 IPython.
5200 IPython.
5191
5201
5192 * Released 0.2.13
5202 * Released 0.2.13
5193
5203
5194 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5204 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5195 profiler interface. Now all the major options from the profiler
5205 profiler interface. Now all the major options from the profiler
5196 module are directly supported in IPython, both for single
5206 module are directly supported in IPython, both for single
5197 expressions (@prun) and for full programs (@run -p).
5207 expressions (@prun) and for full programs (@run -p).
5198
5208
5199 2002-05-09 Fernando Perez <fperez@colorado.edu>
5209 2002-05-09 Fernando Perez <fperez@colorado.edu>
5200
5210
5201 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5211 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5202 magic properly formatted for screen.
5212 magic properly formatted for screen.
5203
5213
5204 * setup.py (make_shortcut): Changed things to put pdf version in
5214 * setup.py (make_shortcut): Changed things to put pdf version in
5205 doc/ instead of doc/manual (had to change lyxport a bit).
5215 doc/ instead of doc/manual (had to change lyxport a bit).
5206
5216
5207 * IPython/Magic.py (Profile.string_stats): made profile runs go
5217 * IPython/Magic.py (Profile.string_stats): made profile runs go
5208 through pager (they are long and a pager allows searching, saving,
5218 through pager (they are long and a pager allows searching, saving,
5209 etc.)
5219 etc.)
5210
5220
5211 2002-05-08 Fernando Perez <fperez@colorado.edu>
5221 2002-05-08 Fernando Perez <fperez@colorado.edu>
5212
5222
5213 * Released 0.2.12
5223 * Released 0.2.12
5214
5224
5215 2002-05-06 Fernando Perez <fperez@colorado.edu>
5225 2002-05-06 Fernando Perez <fperez@colorado.edu>
5216
5226
5217 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5227 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5218 introduced); 'hist n1 n2' was broken.
5228 introduced); 'hist n1 n2' was broken.
5219 (Magic.magic_pdb): added optional on/off arguments to @pdb
5229 (Magic.magic_pdb): added optional on/off arguments to @pdb
5220 (Magic.magic_run): added option -i to @run, which executes code in
5230 (Magic.magic_run): added option -i to @run, which executes code in
5221 the IPython namespace instead of a clean one. Also added @irun as
5231 the IPython namespace instead of a clean one. Also added @irun as
5222 an alias to @run -i.
5232 an alias to @run -i.
5223
5233
5224 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5234 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5225 fixed (it didn't really do anything, the namespaces were wrong).
5235 fixed (it didn't really do anything, the namespaces were wrong).
5226
5236
5227 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5237 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5228
5238
5229 * IPython/__init__.py (__all__): Fixed package namespace, now
5239 * IPython/__init__.py (__all__): Fixed package namespace, now
5230 'import IPython' does give access to IPython.<all> as
5240 'import IPython' does give access to IPython.<all> as
5231 expected. Also renamed __release__ to Release.
5241 expected. Also renamed __release__ to Release.
5232
5242
5233 * IPython/Debugger.py (__license__): created new Pdb class which
5243 * IPython/Debugger.py (__license__): created new Pdb class which
5234 functions like a drop-in for the normal pdb.Pdb but does NOT
5244 functions like a drop-in for the normal pdb.Pdb but does NOT
5235 import readline by default. This way it doesn't muck up IPython's
5245 import readline by default. This way it doesn't muck up IPython's
5236 readline handling, and now tab-completion finally works in the
5246 readline handling, and now tab-completion finally works in the
5237 debugger -- sort of. It completes things globally visible, but the
5247 debugger -- sort of. It completes things globally visible, but the
5238 completer doesn't track the stack as pdb walks it. That's a bit
5248 completer doesn't track the stack as pdb walks it. That's a bit
5239 tricky, and I'll have to implement it later.
5249 tricky, and I'll have to implement it later.
5240
5250
5241 2002-05-05 Fernando Perez <fperez@colorado.edu>
5251 2002-05-05 Fernando Perez <fperez@colorado.edu>
5242
5252
5243 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5253 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5244 magic docstrings when printed via ? (explicit \'s were being
5254 magic docstrings when printed via ? (explicit \'s were being
5245 printed).
5255 printed).
5246
5256
5247 * IPython/ipmaker.py (make_IPython): fixed namespace
5257 * IPython/ipmaker.py (make_IPython): fixed namespace
5248 identification bug. Now variables loaded via logs or command-line
5258 identification bug. Now variables loaded via logs or command-line
5249 files are recognized in the interactive namespace by @who.
5259 files are recognized in the interactive namespace by @who.
5250
5260
5251 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5261 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5252 log replay system stemming from the string form of Structs.
5262 log replay system stemming from the string form of Structs.
5253
5263
5254 * IPython/Magic.py (Macro.__init__): improved macros to properly
5264 * IPython/Magic.py (Macro.__init__): improved macros to properly
5255 handle magic commands in them.
5265 handle magic commands in them.
5256 (Magic.magic_logstart): usernames are now expanded so 'logstart
5266 (Magic.magic_logstart): usernames are now expanded so 'logstart
5257 ~/mylog' now works.
5267 ~/mylog' now works.
5258
5268
5259 * IPython/iplib.py (complete): fixed bug where paths starting with
5269 * IPython/iplib.py (complete): fixed bug where paths starting with
5260 '/' would be completed as magic names.
5270 '/' would be completed as magic names.
5261
5271
5262 2002-05-04 Fernando Perez <fperez@colorado.edu>
5272 2002-05-04 Fernando Perez <fperez@colorado.edu>
5263
5273
5264 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5274 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5265 allow running full programs under the profiler's control.
5275 allow running full programs under the profiler's control.
5266
5276
5267 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5277 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5268 mode to report exceptions verbosely but without formatting
5278 mode to report exceptions verbosely but without formatting
5269 variables. This addresses the issue of ipython 'freezing' (it's
5279 variables. This addresses the issue of ipython 'freezing' (it's
5270 not frozen, but caught in an expensive formatting loop) when huge
5280 not frozen, but caught in an expensive formatting loop) when huge
5271 variables are in the context of an exception.
5281 variables are in the context of an exception.
5272 (VerboseTB.text): Added '--->' markers at line where exception was
5282 (VerboseTB.text): Added '--->' markers at line where exception was
5273 triggered. Much clearer to read, especially in NoColor modes.
5283 triggered. Much clearer to read, especially in NoColor modes.
5274
5284
5275 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5285 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5276 implemented in reverse when changing to the new parse_options().
5286 implemented in reverse when changing to the new parse_options().
5277
5287
5278 2002-05-03 Fernando Perez <fperez@colorado.edu>
5288 2002-05-03 Fernando Perez <fperez@colorado.edu>
5279
5289
5280 * IPython/Magic.py (Magic.parse_options): new function so that
5290 * IPython/Magic.py (Magic.parse_options): new function so that
5281 magics can parse options easier.
5291 magics can parse options easier.
5282 (Magic.magic_prun): new function similar to profile.run(),
5292 (Magic.magic_prun): new function similar to profile.run(),
5283 suggested by Chris Hart.
5293 suggested by Chris Hart.
5284 (Magic.magic_cd): fixed behavior so that it only changes if
5294 (Magic.magic_cd): fixed behavior so that it only changes if
5285 directory actually is in history.
5295 directory actually is in history.
5286
5296
5287 * IPython/usage.py (__doc__): added information about potential
5297 * IPython/usage.py (__doc__): added information about potential
5288 slowness of Verbose exception mode when there are huge data
5298 slowness of Verbose exception mode when there are huge data
5289 structures to be formatted (thanks to Archie Paulson).
5299 structures to be formatted (thanks to Archie Paulson).
5290
5300
5291 * IPython/ipmaker.py (make_IPython): Changed default logging
5301 * IPython/ipmaker.py (make_IPython): Changed default logging
5292 (when simply called with -log) to use curr_dir/ipython.log in
5302 (when simply called with -log) to use curr_dir/ipython.log in
5293 rotate mode. Fixed crash which was occuring with -log before
5303 rotate mode. Fixed crash which was occuring with -log before
5294 (thanks to Jim Boyle).
5304 (thanks to Jim Boyle).
5295
5305
5296 2002-05-01 Fernando Perez <fperez@colorado.edu>
5306 2002-05-01 Fernando Perez <fperez@colorado.edu>
5297
5307
5298 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5308 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5299 was nasty -- though somewhat of a corner case).
5309 was nasty -- though somewhat of a corner case).
5300
5310
5301 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5311 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5302 text (was a bug).
5312 text (was a bug).
5303
5313
5304 2002-04-30 Fernando Perez <fperez@colorado.edu>
5314 2002-04-30 Fernando Perez <fperez@colorado.edu>
5305
5315
5306 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5316 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5307 a print after ^D or ^C from the user so that the In[] prompt
5317 a print after ^D or ^C from the user so that the In[] prompt
5308 doesn't over-run the gnuplot one.
5318 doesn't over-run the gnuplot one.
5309
5319
5310 2002-04-29 Fernando Perez <fperez@colorado.edu>
5320 2002-04-29 Fernando Perez <fperez@colorado.edu>
5311
5321
5312 * Released 0.2.10
5322 * Released 0.2.10
5313
5323
5314 * IPython/__release__.py (version): get date dynamically.
5324 * IPython/__release__.py (version): get date dynamically.
5315
5325
5316 * Misc. documentation updates thanks to Arnd's comments. Also ran
5326 * Misc. documentation updates thanks to Arnd's comments. Also ran
5317 a full spellcheck on the manual (hadn't been done in a while).
5327 a full spellcheck on the manual (hadn't been done in a while).
5318
5328
5319 2002-04-27 Fernando Perez <fperez@colorado.edu>
5329 2002-04-27 Fernando Perez <fperez@colorado.edu>
5320
5330
5321 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5331 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5322 starting a log in mid-session would reset the input history list.
5332 starting a log in mid-session would reset the input history list.
5323
5333
5324 2002-04-26 Fernando Perez <fperez@colorado.edu>
5334 2002-04-26 Fernando Perez <fperez@colorado.edu>
5325
5335
5326 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5336 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5327 all files were being included in an update. Now anything in
5337 all files were being included in an update. Now anything in
5328 UserConfig that matches [A-Za-z]*.py will go (this excludes
5338 UserConfig that matches [A-Za-z]*.py will go (this excludes
5329 __init__.py)
5339 __init__.py)
5330
5340
5331 2002-04-25 Fernando Perez <fperez@colorado.edu>
5341 2002-04-25 Fernando Perez <fperez@colorado.edu>
5332
5342
5333 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5343 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5334 to __builtins__ so that any form of embedded or imported code can
5344 to __builtins__ so that any form of embedded or imported code can
5335 test for being inside IPython.
5345 test for being inside IPython.
5336
5346
5337 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5347 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5338 changed to GnuplotMagic because it's now an importable module,
5348 changed to GnuplotMagic because it's now an importable module,
5339 this makes the name follow that of the standard Gnuplot module.
5349 this makes the name follow that of the standard Gnuplot module.
5340 GnuplotMagic can now be loaded at any time in mid-session.
5350 GnuplotMagic can now be loaded at any time in mid-session.
5341
5351
5342 2002-04-24 Fernando Perez <fperez@colorado.edu>
5352 2002-04-24 Fernando Perez <fperez@colorado.edu>
5343
5353
5344 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5354 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5345 the globals (IPython has its own namespace) and the
5355 the globals (IPython has its own namespace) and the
5346 PhysicalQuantity stuff is much better anyway.
5356 PhysicalQuantity stuff is much better anyway.
5347
5357
5348 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5358 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5349 embedding example to standard user directory for
5359 embedding example to standard user directory for
5350 distribution. Also put it in the manual.
5360 distribution. Also put it in the manual.
5351
5361
5352 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5362 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5353 instance as first argument (so it doesn't rely on some obscure
5363 instance as first argument (so it doesn't rely on some obscure
5354 hidden global).
5364 hidden global).
5355
5365
5356 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5366 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5357 delimiters. While it prevents ().TAB from working, it allows
5367 delimiters. While it prevents ().TAB from working, it allows
5358 completions in open (... expressions. This is by far a more common
5368 completions in open (... expressions. This is by far a more common
5359 case.
5369 case.
5360
5370
5361 2002-04-23 Fernando Perez <fperez@colorado.edu>
5371 2002-04-23 Fernando Perez <fperez@colorado.edu>
5362
5372
5363 * IPython/Extensions/InterpreterPasteInput.py: new
5373 * IPython/Extensions/InterpreterPasteInput.py: new
5364 syntax-processing module for pasting lines with >>> or ... at the
5374 syntax-processing module for pasting lines with >>> or ... at the
5365 start.
5375 start.
5366
5376
5367 * IPython/Extensions/PhysicalQ_Interactive.py
5377 * IPython/Extensions/PhysicalQ_Interactive.py
5368 (PhysicalQuantityInteractive.__int__): fixed to work with either
5378 (PhysicalQuantityInteractive.__int__): fixed to work with either
5369 Numeric or math.
5379 Numeric or math.
5370
5380
5371 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5381 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5372 provided profiles. Now we have:
5382 provided profiles. Now we have:
5373 -math -> math module as * and cmath with its own namespace.
5383 -math -> math module as * and cmath with its own namespace.
5374 -numeric -> Numeric as *, plus gnuplot & grace
5384 -numeric -> Numeric as *, plus gnuplot & grace
5375 -physics -> same as before
5385 -physics -> same as before
5376
5386
5377 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5387 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5378 user-defined magics wouldn't be found by @magic if they were
5388 user-defined magics wouldn't be found by @magic if they were
5379 defined as class methods. Also cleaned up the namespace search
5389 defined as class methods. Also cleaned up the namespace search
5380 logic and the string building (to use %s instead of many repeated
5390 logic and the string building (to use %s instead of many repeated
5381 string adds).
5391 string adds).
5382
5392
5383 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5393 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5384 of user-defined magics to operate with class methods (cleaner, in
5394 of user-defined magics to operate with class methods (cleaner, in
5385 line with the gnuplot code).
5395 line with the gnuplot code).
5386
5396
5387 2002-04-22 Fernando Perez <fperez@colorado.edu>
5397 2002-04-22 Fernando Perez <fperez@colorado.edu>
5388
5398
5389 * setup.py: updated dependency list so that manual is updated when
5399 * setup.py: updated dependency list so that manual is updated when
5390 all included files change.
5400 all included files change.
5391
5401
5392 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5402 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5393 the delimiter removal option (the fix is ugly right now).
5403 the delimiter removal option (the fix is ugly right now).
5394
5404
5395 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5405 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5396 all of the math profile (quicker loading, no conflict between
5406 all of the math profile (quicker loading, no conflict between
5397 g-9.8 and g-gnuplot).
5407 g-9.8 and g-gnuplot).
5398
5408
5399 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5409 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5400 name of post-mortem files to IPython_crash_report.txt.
5410 name of post-mortem files to IPython_crash_report.txt.
5401
5411
5402 * Cleanup/update of the docs. Added all the new readline info and
5412 * Cleanup/update of the docs. Added all the new readline info and
5403 formatted all lists as 'real lists'.
5413 formatted all lists as 'real lists'.
5404
5414
5405 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5415 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5406 tab-completion options, since the full readline parse_and_bind is
5416 tab-completion options, since the full readline parse_and_bind is
5407 now accessible.
5417 now accessible.
5408
5418
5409 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5419 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5410 handling of readline options. Now users can specify any string to
5420 handling of readline options. Now users can specify any string to
5411 be passed to parse_and_bind(), as well as the delimiters to be
5421 be passed to parse_and_bind(), as well as the delimiters to be
5412 removed.
5422 removed.
5413 (InteractiveShell.__init__): Added __name__ to the global
5423 (InteractiveShell.__init__): Added __name__ to the global
5414 namespace so that things like Itpl which rely on its existence
5424 namespace so that things like Itpl which rely on its existence
5415 don't crash.
5425 don't crash.
5416 (InteractiveShell._prefilter): Defined the default with a _ so
5426 (InteractiveShell._prefilter): Defined the default with a _ so
5417 that prefilter() is easier to override, while the default one
5427 that prefilter() is easier to override, while the default one
5418 remains available.
5428 remains available.
5419
5429
5420 2002-04-18 Fernando Perez <fperez@colorado.edu>
5430 2002-04-18 Fernando Perez <fperez@colorado.edu>
5421
5431
5422 * Added information about pdb in the docs.
5432 * Added information about pdb in the docs.
5423
5433
5424 2002-04-17 Fernando Perez <fperez@colorado.edu>
5434 2002-04-17 Fernando Perez <fperez@colorado.edu>
5425
5435
5426 * IPython/ipmaker.py (make_IPython): added rc_override option to
5436 * IPython/ipmaker.py (make_IPython): added rc_override option to
5427 allow passing config options at creation time which may override
5437 allow passing config options at creation time which may override
5428 anything set in the config files or command line. This is
5438 anything set in the config files or command line. This is
5429 particularly useful for configuring embedded instances.
5439 particularly useful for configuring embedded instances.
5430
5440
5431 2002-04-15 Fernando Perez <fperez@colorado.edu>
5441 2002-04-15 Fernando Perez <fperez@colorado.edu>
5432
5442
5433 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5443 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5434 crash embedded instances because of the input cache falling out of
5444 crash embedded instances because of the input cache falling out of
5435 sync with the output counter.
5445 sync with the output counter.
5436
5446
5437 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5447 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5438 mode which calls pdb after an uncaught exception in IPython itself.
5448 mode which calls pdb after an uncaught exception in IPython itself.
5439
5449
5440 2002-04-14 Fernando Perez <fperez@colorado.edu>
5450 2002-04-14 Fernando Perez <fperez@colorado.edu>
5441
5451
5442 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5452 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5443 readline, fix it back after each call.
5453 readline, fix it back after each call.
5444
5454
5445 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5455 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5446 method to force all access via __call__(), which guarantees that
5456 method to force all access via __call__(), which guarantees that
5447 traceback references are properly deleted.
5457 traceback references are properly deleted.
5448
5458
5449 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5459 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5450 improve printing when pprint is in use.
5460 improve printing when pprint is in use.
5451
5461
5452 2002-04-13 Fernando Perez <fperez@colorado.edu>
5462 2002-04-13 Fernando Perez <fperez@colorado.edu>
5453
5463
5454 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5464 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5455 exceptions aren't caught anymore. If the user triggers one, he
5465 exceptions aren't caught anymore. If the user triggers one, he
5456 should know why he's doing it and it should go all the way up,
5466 should know why he's doing it and it should go all the way up,
5457 just like any other exception. So now @abort will fully kill the
5467 just like any other exception. So now @abort will fully kill the
5458 embedded interpreter and the embedding code (unless that happens
5468 embedded interpreter and the embedding code (unless that happens
5459 to catch SystemExit).
5469 to catch SystemExit).
5460
5470
5461 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5471 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5462 and a debugger() method to invoke the interactive pdb debugger
5472 and a debugger() method to invoke the interactive pdb debugger
5463 after printing exception information. Also added the corresponding
5473 after printing exception information. Also added the corresponding
5464 -pdb option and @pdb magic to control this feature, and updated
5474 -pdb option and @pdb magic to control this feature, and updated
5465 the docs. After a suggestion from Christopher Hart
5475 the docs. After a suggestion from Christopher Hart
5466 (hart-AT-caltech.edu).
5476 (hart-AT-caltech.edu).
5467
5477
5468 2002-04-12 Fernando Perez <fperez@colorado.edu>
5478 2002-04-12 Fernando Perez <fperez@colorado.edu>
5469
5479
5470 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5480 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5471 the exception handlers defined by the user (not the CrashHandler)
5481 the exception handlers defined by the user (not the CrashHandler)
5472 so that user exceptions don't trigger an ipython bug report.
5482 so that user exceptions don't trigger an ipython bug report.
5473
5483
5474 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5484 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5475 configurable (it should have always been so).
5485 configurable (it should have always been so).
5476
5486
5477 2002-03-26 Fernando Perez <fperez@colorado.edu>
5487 2002-03-26 Fernando Perez <fperez@colorado.edu>
5478
5488
5479 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5489 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5480 and there to fix embedding namespace issues. This should all be
5490 and there to fix embedding namespace issues. This should all be
5481 done in a more elegant way.
5491 done in a more elegant way.
5482
5492
5483 2002-03-25 Fernando Perez <fperez@colorado.edu>
5493 2002-03-25 Fernando Perez <fperez@colorado.edu>
5484
5494
5485 * IPython/genutils.py (get_home_dir): Try to make it work under
5495 * IPython/genutils.py (get_home_dir): Try to make it work under
5486 win9x also.
5496 win9x also.
5487
5497
5488 2002-03-20 Fernando Perez <fperez@colorado.edu>
5498 2002-03-20 Fernando Perez <fperez@colorado.edu>
5489
5499
5490 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5500 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5491 sys.displayhook untouched upon __init__.
5501 sys.displayhook untouched upon __init__.
5492
5502
5493 2002-03-19 Fernando Perez <fperez@colorado.edu>
5503 2002-03-19 Fernando Perez <fperez@colorado.edu>
5494
5504
5495 * Released 0.2.9 (for embedding bug, basically).
5505 * Released 0.2.9 (for embedding bug, basically).
5496
5506
5497 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5507 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5498 exceptions so that enclosing shell's state can be restored.
5508 exceptions so that enclosing shell's state can be restored.
5499
5509
5500 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5510 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5501 naming conventions in the .ipython/ dir.
5511 naming conventions in the .ipython/ dir.
5502
5512
5503 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5513 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5504 from delimiters list so filenames with - in them get expanded.
5514 from delimiters list so filenames with - in them get expanded.
5505
5515
5506 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5516 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5507 sys.displayhook not being properly restored after an embedded call.
5517 sys.displayhook not being properly restored after an embedded call.
5508
5518
5509 2002-03-18 Fernando Perez <fperez@colorado.edu>
5519 2002-03-18 Fernando Perez <fperez@colorado.edu>
5510
5520
5511 * Released 0.2.8
5521 * Released 0.2.8
5512
5522
5513 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5523 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5514 some files weren't being included in a -upgrade.
5524 some files weren't being included in a -upgrade.
5515 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5525 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5516 on' so that the first tab completes.
5526 on' so that the first tab completes.
5517 (InteractiveShell.handle_magic): fixed bug with spaces around
5527 (InteractiveShell.handle_magic): fixed bug with spaces around
5518 quotes breaking many magic commands.
5528 quotes breaking many magic commands.
5519
5529
5520 * setup.py: added note about ignoring the syntax error messages at
5530 * setup.py: added note about ignoring the syntax error messages at
5521 installation.
5531 installation.
5522
5532
5523 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5533 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5524 streamlining the gnuplot interface, now there's only one magic @gp.
5534 streamlining the gnuplot interface, now there's only one magic @gp.
5525
5535
5526 2002-03-17 Fernando Perez <fperez@colorado.edu>
5536 2002-03-17 Fernando Perez <fperez@colorado.edu>
5527
5537
5528 * IPython/UserConfig/magic_gnuplot.py: new name for the
5538 * IPython/UserConfig/magic_gnuplot.py: new name for the
5529 example-magic_pm.py file. Much enhanced system, now with a shell
5539 example-magic_pm.py file. Much enhanced system, now with a shell
5530 for communicating directly with gnuplot, one command at a time.
5540 for communicating directly with gnuplot, one command at a time.
5531
5541
5532 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5542 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5533 setting __name__=='__main__'.
5543 setting __name__=='__main__'.
5534
5544
5535 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5545 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5536 mini-shell for accessing gnuplot from inside ipython. Should
5546 mini-shell for accessing gnuplot from inside ipython. Should
5537 extend it later for grace access too. Inspired by Arnd's
5547 extend it later for grace access too. Inspired by Arnd's
5538 suggestion.
5548 suggestion.
5539
5549
5540 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5550 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5541 calling magic functions with () in their arguments. Thanks to Arnd
5551 calling magic functions with () in their arguments. Thanks to Arnd
5542 Baecker for pointing this to me.
5552 Baecker for pointing this to me.
5543
5553
5544 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5554 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5545 infinitely for integer or complex arrays (only worked with floats).
5555 infinitely for integer or complex arrays (only worked with floats).
5546
5556
5547 2002-03-16 Fernando Perez <fperez@colorado.edu>
5557 2002-03-16 Fernando Perez <fperez@colorado.edu>
5548
5558
5549 * setup.py: Merged setup and setup_windows into a single script
5559 * setup.py: Merged setup and setup_windows into a single script
5550 which properly handles things for windows users.
5560 which properly handles things for windows users.
5551
5561
5552 2002-03-15 Fernando Perez <fperez@colorado.edu>
5562 2002-03-15 Fernando Perez <fperez@colorado.edu>
5553
5563
5554 * Big change to the manual: now the magics are all automatically
5564 * Big change to the manual: now the magics are all automatically
5555 documented. This information is generated from their docstrings
5565 documented. This information is generated from their docstrings
5556 and put in a latex file included by the manual lyx file. This way
5566 and put in a latex file included by the manual lyx file. This way
5557 we get always up to date information for the magics. The manual
5567 we get always up to date information for the magics. The manual
5558 now also has proper version information, also auto-synced.
5568 now also has proper version information, also auto-synced.
5559
5569
5560 For this to work, an undocumented --magic_docstrings option was added.
5570 For this to work, an undocumented --magic_docstrings option was added.
5561
5571
5562 2002-03-13 Fernando Perez <fperez@colorado.edu>
5572 2002-03-13 Fernando Perez <fperez@colorado.edu>
5563
5573
5564 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5574 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5565 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5575 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5566
5576
5567 2002-03-12 Fernando Perez <fperez@colorado.edu>
5577 2002-03-12 Fernando Perez <fperez@colorado.edu>
5568
5578
5569 * IPython/ultraTB.py (TermColors): changed color escapes again to
5579 * IPython/ultraTB.py (TermColors): changed color escapes again to
5570 fix the (old, reintroduced) line-wrapping bug. Basically, if
5580 fix the (old, reintroduced) line-wrapping bug. Basically, if
5571 \001..\002 aren't given in the color escapes, lines get wrapped
5581 \001..\002 aren't given in the color escapes, lines get wrapped
5572 weirdly. But giving those screws up old xterms and emacs terms. So
5582 weirdly. But giving those screws up old xterms and emacs terms. So
5573 I added some logic for emacs terms to be ok, but I can't identify old
5583 I added some logic for emacs terms to be ok, but I can't identify old
5574 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5584 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5575
5585
5576 2002-03-10 Fernando Perez <fperez@colorado.edu>
5586 2002-03-10 Fernando Perez <fperez@colorado.edu>
5577
5587
5578 * IPython/usage.py (__doc__): Various documentation cleanups and
5588 * IPython/usage.py (__doc__): Various documentation cleanups and
5579 updates, both in usage docstrings and in the manual.
5589 updates, both in usage docstrings and in the manual.
5580
5590
5581 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5591 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5582 handling of caching. Set minimum acceptabe value for having a
5592 handling of caching. Set minimum acceptabe value for having a
5583 cache at 20 values.
5593 cache at 20 values.
5584
5594
5585 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5595 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5586 install_first_time function to a method, renamed it and added an
5596 install_first_time function to a method, renamed it and added an
5587 'upgrade' mode. Now people can update their config directory with
5597 'upgrade' mode. Now people can update their config directory with
5588 a simple command line switch (-upgrade, also new).
5598 a simple command line switch (-upgrade, also new).
5589
5599
5590 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5600 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5591 @file (convenient for automagic users under Python >= 2.2).
5601 @file (convenient for automagic users under Python >= 2.2).
5592 Removed @files (it seemed more like a plural than an abbrev. of
5602 Removed @files (it seemed more like a plural than an abbrev. of
5593 'file show').
5603 'file show').
5594
5604
5595 * IPython/iplib.py (install_first_time): Fixed crash if there were
5605 * IPython/iplib.py (install_first_time): Fixed crash if there were
5596 backup files ('~') in .ipython/ install directory.
5606 backup files ('~') in .ipython/ install directory.
5597
5607
5598 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5608 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5599 system. Things look fine, but these changes are fairly
5609 system. Things look fine, but these changes are fairly
5600 intrusive. Test them for a few days.
5610 intrusive. Test them for a few days.
5601
5611
5602 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5612 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5603 the prompts system. Now all in/out prompt strings are user
5613 the prompts system. Now all in/out prompt strings are user
5604 controllable. This is particularly useful for embedding, as one
5614 controllable. This is particularly useful for embedding, as one
5605 can tag embedded instances with particular prompts.
5615 can tag embedded instances with particular prompts.
5606
5616
5607 Also removed global use of sys.ps1/2, which now allows nested
5617 Also removed global use of sys.ps1/2, which now allows nested
5608 embeddings without any problems. Added command-line options for
5618 embeddings without any problems. Added command-line options for
5609 the prompt strings.
5619 the prompt strings.
5610
5620
5611 2002-03-08 Fernando Perez <fperez@colorado.edu>
5621 2002-03-08 Fernando Perez <fperez@colorado.edu>
5612
5622
5613 * IPython/UserConfig/example-embed-short.py (ipshell): added
5623 * IPython/UserConfig/example-embed-short.py (ipshell): added
5614 example file with the bare minimum code for embedding.
5624 example file with the bare minimum code for embedding.
5615
5625
5616 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5626 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5617 functionality for the embeddable shell to be activated/deactivated
5627 functionality for the embeddable shell to be activated/deactivated
5618 either globally or at each call.
5628 either globally or at each call.
5619
5629
5620 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5630 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5621 rewriting the prompt with '--->' for auto-inputs with proper
5631 rewriting the prompt with '--->' for auto-inputs with proper
5622 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5632 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5623 this is handled by the prompts class itself, as it should.
5633 this is handled by the prompts class itself, as it should.
5624
5634
5625 2002-03-05 Fernando Perez <fperez@colorado.edu>
5635 2002-03-05 Fernando Perez <fperez@colorado.edu>
5626
5636
5627 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5637 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5628 @logstart to avoid name clashes with the math log function.
5638 @logstart to avoid name clashes with the math log function.
5629
5639
5630 * Big updates to X/Emacs section of the manual.
5640 * Big updates to X/Emacs section of the manual.
5631
5641
5632 * Removed ipython_emacs. Milan explained to me how to pass
5642 * Removed ipython_emacs. Milan explained to me how to pass
5633 arguments to ipython through Emacs. Some day I'm going to end up
5643 arguments to ipython through Emacs. Some day I'm going to end up
5634 learning some lisp...
5644 learning some lisp...
5635
5645
5636 2002-03-04 Fernando Perez <fperez@colorado.edu>
5646 2002-03-04 Fernando Perez <fperez@colorado.edu>
5637
5647
5638 * IPython/ipython_emacs: Created script to be used as the
5648 * IPython/ipython_emacs: Created script to be used as the
5639 py-python-command Emacs variable so we can pass IPython
5649 py-python-command Emacs variable so we can pass IPython
5640 parameters. I can't figure out how to tell Emacs directly to pass
5650 parameters. I can't figure out how to tell Emacs directly to pass
5641 parameters to IPython, so a dummy shell script will do it.
5651 parameters to IPython, so a dummy shell script will do it.
5642
5652
5643 Other enhancements made for things to work better under Emacs'
5653 Other enhancements made for things to work better under Emacs'
5644 various types of terminals. Many thanks to Milan Zamazal
5654 various types of terminals. Many thanks to Milan Zamazal
5645 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5655 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5646
5656
5647 2002-03-01 Fernando Perez <fperez@colorado.edu>
5657 2002-03-01 Fernando Perez <fperez@colorado.edu>
5648
5658
5649 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5659 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5650 that loading of readline is now optional. This gives better
5660 that loading of readline is now optional. This gives better
5651 control to emacs users.
5661 control to emacs users.
5652
5662
5653 * IPython/ultraTB.py (__date__): Modified color escape sequences
5663 * IPython/ultraTB.py (__date__): Modified color escape sequences
5654 and now things work fine under xterm and in Emacs' term buffers
5664 and now things work fine under xterm and in Emacs' term buffers
5655 (though not shell ones). Well, in emacs you get colors, but all
5665 (though not shell ones). Well, in emacs you get colors, but all
5656 seem to be 'light' colors (no difference between dark and light
5666 seem to be 'light' colors (no difference between dark and light
5657 ones). But the garbage chars are gone, and also in xterms. It
5667 ones). But the garbage chars are gone, and also in xterms. It
5658 seems that now I'm using 'cleaner' ansi sequences.
5668 seems that now I'm using 'cleaner' ansi sequences.
5659
5669
5660 2002-02-21 Fernando Perez <fperez@colorado.edu>
5670 2002-02-21 Fernando Perez <fperez@colorado.edu>
5661
5671
5662 * Released 0.2.7 (mainly to publish the scoping fix).
5672 * Released 0.2.7 (mainly to publish the scoping fix).
5663
5673
5664 * IPython/Logger.py (Logger.logstate): added. A corresponding
5674 * IPython/Logger.py (Logger.logstate): added. A corresponding
5665 @logstate magic was created.
5675 @logstate magic was created.
5666
5676
5667 * IPython/Magic.py: fixed nested scoping problem under Python
5677 * IPython/Magic.py: fixed nested scoping problem under Python
5668 2.1.x (automagic wasn't working).
5678 2.1.x (automagic wasn't working).
5669
5679
5670 2002-02-20 Fernando Perez <fperez@colorado.edu>
5680 2002-02-20 Fernando Perez <fperez@colorado.edu>
5671
5681
5672 * Released 0.2.6.
5682 * Released 0.2.6.
5673
5683
5674 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5684 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5675 option so that logs can come out without any headers at all.
5685 option so that logs can come out without any headers at all.
5676
5686
5677 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5687 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5678 SciPy.
5688 SciPy.
5679
5689
5680 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5690 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5681 that embedded IPython calls don't require vars() to be explicitly
5691 that embedded IPython calls don't require vars() to be explicitly
5682 passed. Now they are extracted from the caller's frame (code
5692 passed. Now they are extracted from the caller's frame (code
5683 snatched from Eric Jones' weave). Added better documentation to
5693 snatched from Eric Jones' weave). Added better documentation to
5684 the section on embedding and the example file.
5694 the section on embedding and the example file.
5685
5695
5686 * IPython/genutils.py (page): Changed so that under emacs, it just
5696 * IPython/genutils.py (page): Changed so that under emacs, it just
5687 prints the string. You can then page up and down in the emacs
5697 prints the string. You can then page up and down in the emacs
5688 buffer itself. This is how the builtin help() works.
5698 buffer itself. This is how the builtin help() works.
5689
5699
5690 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5700 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5691 macro scoping: macros need to be executed in the user's namespace
5701 macro scoping: macros need to be executed in the user's namespace
5692 to work as if they had been typed by the user.
5702 to work as if they had been typed by the user.
5693
5703
5694 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5704 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5695 execute automatically (no need to type 'exec...'). They then
5705 execute automatically (no need to type 'exec...'). They then
5696 behave like 'true macros'. The printing system was also modified
5706 behave like 'true macros'. The printing system was also modified
5697 for this to work.
5707 for this to work.
5698
5708
5699 2002-02-19 Fernando Perez <fperez@colorado.edu>
5709 2002-02-19 Fernando Perez <fperez@colorado.edu>
5700
5710
5701 * IPython/genutils.py (page_file): new function for paging files
5711 * IPython/genutils.py (page_file): new function for paging files
5702 in an OS-independent way. Also necessary for file viewing to work
5712 in an OS-independent way. Also necessary for file viewing to work
5703 well inside Emacs buffers.
5713 well inside Emacs buffers.
5704 (page): Added checks for being in an emacs buffer.
5714 (page): Added checks for being in an emacs buffer.
5705 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5715 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5706 same bug in iplib.
5716 same bug in iplib.
5707
5717
5708 2002-02-18 Fernando Perez <fperez@colorado.edu>
5718 2002-02-18 Fernando Perez <fperez@colorado.edu>
5709
5719
5710 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5720 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5711 of readline so that IPython can work inside an Emacs buffer.
5721 of readline so that IPython can work inside an Emacs buffer.
5712
5722
5713 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5723 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5714 method signatures (they weren't really bugs, but it looks cleaner
5724 method signatures (they weren't really bugs, but it looks cleaner
5715 and keeps PyChecker happy).
5725 and keeps PyChecker happy).
5716
5726
5717 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5727 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5718 for implementing various user-defined hooks. Currently only
5728 for implementing various user-defined hooks. Currently only
5719 display is done.
5729 display is done.
5720
5730
5721 * IPython/Prompts.py (CachedOutput._display): changed display
5731 * IPython/Prompts.py (CachedOutput._display): changed display
5722 functions so that they can be dynamically changed by users easily.
5732 functions so that they can be dynamically changed by users easily.
5723
5733
5724 * IPython/Extensions/numeric_formats.py (num_display): added an
5734 * IPython/Extensions/numeric_formats.py (num_display): added an
5725 extension for printing NumPy arrays in flexible manners. It
5735 extension for printing NumPy arrays in flexible manners. It
5726 doesn't do anything yet, but all the structure is in
5736 doesn't do anything yet, but all the structure is in
5727 place. Ultimately the plan is to implement output format control
5737 place. Ultimately the plan is to implement output format control
5728 like in Octave.
5738 like in Octave.
5729
5739
5730 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5740 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5731 methods are found at run-time by all the automatic machinery.
5741 methods are found at run-time by all the automatic machinery.
5732
5742
5733 2002-02-17 Fernando Perez <fperez@colorado.edu>
5743 2002-02-17 Fernando Perez <fperez@colorado.edu>
5734
5744
5735 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5745 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5736 whole file a little.
5746 whole file a little.
5737
5747
5738 * ToDo: closed this document. Now there's a new_design.lyx
5748 * ToDo: closed this document. Now there's a new_design.lyx
5739 document for all new ideas. Added making a pdf of it for the
5749 document for all new ideas. Added making a pdf of it for the
5740 end-user distro.
5750 end-user distro.
5741
5751
5742 * IPython/Logger.py (Logger.switch_log): Created this to replace
5752 * IPython/Logger.py (Logger.switch_log): Created this to replace
5743 logon() and logoff(). It also fixes a nasty crash reported by
5753 logon() and logoff(). It also fixes a nasty crash reported by
5744 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5754 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5745
5755
5746 * IPython/iplib.py (complete): got auto-completion to work with
5756 * IPython/iplib.py (complete): got auto-completion to work with
5747 automagic (I had wanted this for a long time).
5757 automagic (I had wanted this for a long time).
5748
5758
5749 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5759 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5750 to @file, since file() is now a builtin and clashes with automagic
5760 to @file, since file() is now a builtin and clashes with automagic
5751 for @file.
5761 for @file.
5752
5762
5753 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5763 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5754 of this was previously in iplib, which had grown to more than 2000
5764 of this was previously in iplib, which had grown to more than 2000
5755 lines, way too long. No new functionality, but it makes managing
5765 lines, way too long. No new functionality, but it makes managing
5756 the code a bit easier.
5766 the code a bit easier.
5757
5767
5758 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5768 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5759 information to crash reports.
5769 information to crash reports.
5760
5770
5761 2002-02-12 Fernando Perez <fperez@colorado.edu>
5771 2002-02-12 Fernando Perez <fperez@colorado.edu>
5762
5772
5763 * Released 0.2.5.
5773 * Released 0.2.5.
5764
5774
5765 2002-02-11 Fernando Perez <fperez@colorado.edu>
5775 2002-02-11 Fernando Perez <fperez@colorado.edu>
5766
5776
5767 * Wrote a relatively complete Windows installer. It puts
5777 * Wrote a relatively complete Windows installer. It puts
5768 everything in place, creates Start Menu entries and fixes the
5778 everything in place, creates Start Menu entries and fixes the
5769 color issues. Nothing fancy, but it works.
5779 color issues. Nothing fancy, but it works.
5770
5780
5771 2002-02-10 Fernando Perez <fperez@colorado.edu>
5781 2002-02-10 Fernando Perez <fperez@colorado.edu>
5772
5782
5773 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5783 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5774 os.path.expanduser() call so that we can type @run ~/myfile.py and
5784 os.path.expanduser() call so that we can type @run ~/myfile.py and
5775 have thigs work as expected.
5785 have thigs work as expected.
5776
5786
5777 * IPython/genutils.py (page): fixed exception handling so things
5787 * IPython/genutils.py (page): fixed exception handling so things
5778 work both in Unix and Windows correctly. Quitting a pager triggers
5788 work both in Unix and Windows correctly. Quitting a pager triggers
5779 an IOError/broken pipe in Unix, and in windows not finding a pager
5789 an IOError/broken pipe in Unix, and in windows not finding a pager
5780 is also an IOError, so I had to actually look at the return value
5790 is also an IOError, so I had to actually look at the return value
5781 of the exception, not just the exception itself. Should be ok now.
5791 of the exception, not just the exception itself. Should be ok now.
5782
5792
5783 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5793 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5784 modified to allow case-insensitive color scheme changes.
5794 modified to allow case-insensitive color scheme changes.
5785
5795
5786 2002-02-09 Fernando Perez <fperez@colorado.edu>
5796 2002-02-09 Fernando Perez <fperez@colorado.edu>
5787
5797
5788 * IPython/genutils.py (native_line_ends): new function to leave
5798 * IPython/genutils.py (native_line_ends): new function to leave
5789 user config files with os-native line-endings.
5799 user config files with os-native line-endings.
5790
5800
5791 * README and manual updates.
5801 * README and manual updates.
5792
5802
5793 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5803 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5794 instead of StringType to catch Unicode strings.
5804 instead of StringType to catch Unicode strings.
5795
5805
5796 * IPython/genutils.py (filefind): fixed bug for paths with
5806 * IPython/genutils.py (filefind): fixed bug for paths with
5797 embedded spaces (very common in Windows).
5807 embedded spaces (very common in Windows).
5798
5808
5799 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5809 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5800 files under Windows, so that they get automatically associated
5810 files under Windows, so that they get automatically associated
5801 with a text editor. Windows makes it a pain to handle
5811 with a text editor. Windows makes it a pain to handle
5802 extension-less files.
5812 extension-less files.
5803
5813
5804 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5814 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5805 warning about readline only occur for Posix. In Windows there's no
5815 warning about readline only occur for Posix. In Windows there's no
5806 way to get readline, so why bother with the warning.
5816 way to get readline, so why bother with the warning.
5807
5817
5808 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5818 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5809 for __str__ instead of dir(self), since dir() changed in 2.2.
5819 for __str__ instead of dir(self), since dir() changed in 2.2.
5810
5820
5811 * Ported to Windows! Tested on XP, I suspect it should work fine
5821 * Ported to Windows! Tested on XP, I suspect it should work fine
5812 on NT/2000, but I don't think it will work on 98 et al. That
5822 on NT/2000, but I don't think it will work on 98 et al. That
5813 series of Windows is such a piece of junk anyway that I won't try
5823 series of Windows is such a piece of junk anyway that I won't try
5814 porting it there. The XP port was straightforward, showed a few
5824 porting it there. The XP port was straightforward, showed a few
5815 bugs here and there (fixed all), in particular some string
5825 bugs here and there (fixed all), in particular some string
5816 handling stuff which required considering Unicode strings (which
5826 handling stuff which required considering Unicode strings (which
5817 Windows uses). This is good, but hasn't been too tested :) No
5827 Windows uses). This is good, but hasn't been too tested :) No
5818 fancy installer yet, I'll put a note in the manual so people at
5828 fancy installer yet, I'll put a note in the manual so people at
5819 least make manually a shortcut.
5829 least make manually a shortcut.
5820
5830
5821 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5831 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5822 into a single one, "colors". This now controls both prompt and
5832 into a single one, "colors". This now controls both prompt and
5823 exception color schemes, and can be changed both at startup
5833 exception color schemes, and can be changed both at startup
5824 (either via command-line switches or via ipythonrc files) and at
5834 (either via command-line switches or via ipythonrc files) and at
5825 runtime, with @colors.
5835 runtime, with @colors.
5826 (Magic.magic_run): renamed @prun to @run and removed the old
5836 (Magic.magic_run): renamed @prun to @run and removed the old
5827 @run. The two were too similar to warrant keeping both.
5837 @run. The two were too similar to warrant keeping both.
5828
5838
5829 2002-02-03 Fernando Perez <fperez@colorado.edu>
5839 2002-02-03 Fernando Perez <fperez@colorado.edu>
5830
5840
5831 * IPython/iplib.py (install_first_time): Added comment on how to
5841 * IPython/iplib.py (install_first_time): Added comment on how to
5832 configure the color options for first-time users. Put a <return>
5842 configure the color options for first-time users. Put a <return>
5833 request at the end so that small-terminal users get a chance to
5843 request at the end so that small-terminal users get a chance to
5834 read the startup info.
5844 read the startup info.
5835
5845
5836 2002-01-23 Fernando Perez <fperez@colorado.edu>
5846 2002-01-23 Fernando Perez <fperez@colorado.edu>
5837
5847
5838 * IPython/iplib.py (CachedOutput.update): Changed output memory
5848 * IPython/iplib.py (CachedOutput.update): Changed output memory
5839 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5849 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5840 input history we still use _i. Did this b/c these variable are
5850 input history we still use _i. Did this b/c these variable are
5841 very commonly used in interactive work, so the less we need to
5851 very commonly used in interactive work, so the less we need to
5842 type the better off we are.
5852 type the better off we are.
5843 (Magic.magic_prun): updated @prun to better handle the namespaces
5853 (Magic.magic_prun): updated @prun to better handle the namespaces
5844 the file will run in, including a fix for __name__ not being set
5854 the file will run in, including a fix for __name__ not being set
5845 before.
5855 before.
5846
5856
5847 2002-01-20 Fernando Perez <fperez@colorado.edu>
5857 2002-01-20 Fernando Perez <fperez@colorado.edu>
5848
5858
5849 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5859 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5850 extra garbage for Python 2.2. Need to look more carefully into
5860 extra garbage for Python 2.2. Need to look more carefully into
5851 this later.
5861 this later.
5852
5862
5853 2002-01-19 Fernando Perez <fperez@colorado.edu>
5863 2002-01-19 Fernando Perez <fperez@colorado.edu>
5854
5864
5855 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5865 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5856 display SyntaxError exceptions properly formatted when they occur
5866 display SyntaxError exceptions properly formatted when they occur
5857 (they can be triggered by imported code).
5867 (they can be triggered by imported code).
5858
5868
5859 2002-01-18 Fernando Perez <fperez@colorado.edu>
5869 2002-01-18 Fernando Perez <fperez@colorado.edu>
5860
5870
5861 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5871 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5862 SyntaxError exceptions are reported nicely formatted, instead of
5872 SyntaxError exceptions are reported nicely formatted, instead of
5863 spitting out only offset information as before.
5873 spitting out only offset information as before.
5864 (Magic.magic_prun): Added the @prun function for executing
5874 (Magic.magic_prun): Added the @prun function for executing
5865 programs with command line args inside IPython.
5875 programs with command line args inside IPython.
5866
5876
5867 2002-01-16 Fernando Perez <fperez@colorado.edu>
5877 2002-01-16 Fernando Perez <fperez@colorado.edu>
5868
5878
5869 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5879 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5870 to *not* include the last item given in a range. This brings their
5880 to *not* include the last item given in a range. This brings their
5871 behavior in line with Python's slicing:
5881 behavior in line with Python's slicing:
5872 a[n1:n2] -> a[n1]...a[n2-1]
5882 a[n1:n2] -> a[n1]...a[n2-1]
5873 It may be a bit less convenient, but I prefer to stick to Python's
5883 It may be a bit less convenient, but I prefer to stick to Python's
5874 conventions *everywhere*, so users never have to wonder.
5884 conventions *everywhere*, so users never have to wonder.
5875 (Magic.magic_macro): Added @macro function to ease the creation of
5885 (Magic.magic_macro): Added @macro function to ease the creation of
5876 macros.
5886 macros.
5877
5887
5878 2002-01-05 Fernando Perez <fperez@colorado.edu>
5888 2002-01-05 Fernando Perez <fperez@colorado.edu>
5879
5889
5880 * Released 0.2.4.
5890 * Released 0.2.4.
5881
5891
5882 * IPython/iplib.py (Magic.magic_pdef):
5892 * IPython/iplib.py (Magic.magic_pdef):
5883 (InteractiveShell.safe_execfile): report magic lines and error
5893 (InteractiveShell.safe_execfile): report magic lines and error
5884 lines without line numbers so one can easily copy/paste them for
5894 lines without line numbers so one can easily copy/paste them for
5885 re-execution.
5895 re-execution.
5886
5896
5887 * Updated manual with recent changes.
5897 * Updated manual with recent changes.
5888
5898
5889 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5899 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5890 docstring printing when class? is called. Very handy for knowing
5900 docstring printing when class? is called. Very handy for knowing
5891 how to create class instances (as long as __init__ is well
5901 how to create class instances (as long as __init__ is well
5892 documented, of course :)
5902 documented, of course :)
5893 (Magic.magic_doc): print both class and constructor docstrings.
5903 (Magic.magic_doc): print both class and constructor docstrings.
5894 (Magic.magic_pdef): give constructor info if passed a class and
5904 (Magic.magic_pdef): give constructor info if passed a class and
5895 __call__ info for callable object instances.
5905 __call__ info for callable object instances.
5896
5906
5897 2002-01-04 Fernando Perez <fperez@colorado.edu>
5907 2002-01-04 Fernando Perez <fperez@colorado.edu>
5898
5908
5899 * Made deep_reload() off by default. It doesn't always work
5909 * Made deep_reload() off by default. It doesn't always work
5900 exactly as intended, so it's probably safer to have it off. It's
5910 exactly as intended, so it's probably safer to have it off. It's
5901 still available as dreload() anyway, so nothing is lost.
5911 still available as dreload() anyway, so nothing is lost.
5902
5912
5903 2002-01-02 Fernando Perez <fperez@colorado.edu>
5913 2002-01-02 Fernando Perez <fperez@colorado.edu>
5904
5914
5905 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5915 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5906 so I wanted an updated release).
5916 so I wanted an updated release).
5907
5917
5908 2001-12-27 Fernando Perez <fperez@colorado.edu>
5918 2001-12-27 Fernando Perez <fperez@colorado.edu>
5909
5919
5910 * IPython/iplib.py (InteractiveShell.interact): Added the original
5920 * IPython/iplib.py (InteractiveShell.interact): Added the original
5911 code from 'code.py' for this module in order to change the
5921 code from 'code.py' for this module in order to change the
5912 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5922 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5913 the history cache would break when the user hit Ctrl-C, and
5923 the history cache would break when the user hit Ctrl-C, and
5914 interact() offers no way to add any hooks to it.
5924 interact() offers no way to add any hooks to it.
5915
5925
5916 2001-12-23 Fernando Perez <fperez@colorado.edu>
5926 2001-12-23 Fernando Perez <fperez@colorado.edu>
5917
5927
5918 * setup.py: added check for 'MANIFEST' before trying to remove
5928 * setup.py: added check for 'MANIFEST' before trying to remove
5919 it. Thanks to Sean Reifschneider.
5929 it. Thanks to Sean Reifschneider.
5920
5930
5921 2001-12-22 Fernando Perez <fperez@colorado.edu>
5931 2001-12-22 Fernando Perez <fperez@colorado.edu>
5922
5932
5923 * Released 0.2.2.
5933 * Released 0.2.2.
5924
5934
5925 * Finished (reasonably) writing the manual. Later will add the
5935 * Finished (reasonably) writing the manual. Later will add the
5926 python-standard navigation stylesheets, but for the time being
5936 python-standard navigation stylesheets, but for the time being
5927 it's fairly complete. Distribution will include html and pdf
5937 it's fairly complete. Distribution will include html and pdf
5928 versions.
5938 versions.
5929
5939
5930 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5940 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5931 (MayaVi author).
5941 (MayaVi author).
5932
5942
5933 2001-12-21 Fernando Perez <fperez@colorado.edu>
5943 2001-12-21 Fernando Perez <fperez@colorado.edu>
5934
5944
5935 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5945 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5936 good public release, I think (with the manual and the distutils
5946 good public release, I think (with the manual and the distutils
5937 installer). The manual can use some work, but that can go
5947 installer). The manual can use some work, but that can go
5938 slowly. Otherwise I think it's quite nice for end users. Next
5948 slowly. Otherwise I think it's quite nice for end users. Next
5939 summer, rewrite the guts of it...
5949 summer, rewrite the guts of it...
5940
5950
5941 * Changed format of ipythonrc files to use whitespace as the
5951 * Changed format of ipythonrc files to use whitespace as the
5942 separator instead of an explicit '='. Cleaner.
5952 separator instead of an explicit '='. Cleaner.
5943
5953
5944 2001-12-20 Fernando Perez <fperez@colorado.edu>
5954 2001-12-20 Fernando Perez <fperez@colorado.edu>
5945
5955
5946 * Started a manual in LyX. For now it's just a quick merge of the
5956 * Started a manual in LyX. For now it's just a quick merge of the
5947 various internal docstrings and READMEs. Later it may grow into a
5957 various internal docstrings and READMEs. Later it may grow into a
5948 nice, full-blown manual.
5958 nice, full-blown manual.
5949
5959
5950 * Set up a distutils based installer. Installation should now be
5960 * Set up a distutils based installer. Installation should now be
5951 trivially simple for end-users.
5961 trivially simple for end-users.
5952
5962
5953 2001-12-11 Fernando Perez <fperez@colorado.edu>
5963 2001-12-11 Fernando Perez <fperez@colorado.edu>
5954
5964
5955 * Released 0.2.0. First public release, announced it at
5965 * Released 0.2.0. First public release, announced it at
5956 comp.lang.python. From now on, just bugfixes...
5966 comp.lang.python. From now on, just bugfixes...
5957
5967
5958 * Went through all the files, set copyright/license notices and
5968 * Went through all the files, set copyright/license notices and
5959 cleaned up things. Ready for release.
5969 cleaned up things. Ready for release.
5960
5970
5961 2001-12-10 Fernando Perez <fperez@colorado.edu>
5971 2001-12-10 Fernando Perez <fperez@colorado.edu>
5962
5972
5963 * Changed the first-time installer not to use tarfiles. It's more
5973 * Changed the first-time installer not to use tarfiles. It's more
5964 robust now and less unix-dependent. Also makes it easier for
5974 robust now and less unix-dependent. Also makes it easier for
5965 people to later upgrade versions.
5975 people to later upgrade versions.
5966
5976
5967 * Changed @exit to @abort to reflect the fact that it's pretty
5977 * Changed @exit to @abort to reflect the fact that it's pretty
5968 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5978 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5969 becomes significant only when IPyhton is embedded: in that case,
5979 becomes significant only when IPyhton is embedded: in that case,
5970 C-D closes IPython only, but @abort kills the enclosing program
5980 C-D closes IPython only, but @abort kills the enclosing program
5971 too (unless it had called IPython inside a try catching
5981 too (unless it had called IPython inside a try catching
5972 SystemExit).
5982 SystemExit).
5973
5983
5974 * Created Shell module which exposes the actuall IPython Shell
5984 * Created Shell module which exposes the actuall IPython Shell
5975 classes, currently the normal and the embeddable one. This at
5985 classes, currently the normal and the embeddable one. This at
5976 least offers a stable interface we won't need to change when
5986 least offers a stable interface we won't need to change when
5977 (later) the internals are rewritten. That rewrite will be confined
5987 (later) the internals are rewritten. That rewrite will be confined
5978 to iplib and ipmaker, but the Shell interface should remain as is.
5988 to iplib and ipmaker, but the Shell interface should remain as is.
5979
5989
5980 * Added embed module which offers an embeddable IPShell object,
5990 * Added embed module which offers an embeddable IPShell object,
5981 useful to fire up IPython *inside* a running program. Great for
5991 useful to fire up IPython *inside* a running program. Great for
5982 debugging or dynamical data analysis.
5992 debugging or dynamical data analysis.
5983
5993
5984 2001-12-08 Fernando Perez <fperez@colorado.edu>
5994 2001-12-08 Fernando Perez <fperez@colorado.edu>
5985
5995
5986 * Fixed small bug preventing seeing info from methods of defined
5996 * Fixed small bug preventing seeing info from methods of defined
5987 objects (incorrect namespace in _ofind()).
5997 objects (incorrect namespace in _ofind()).
5988
5998
5989 * Documentation cleanup. Moved the main usage docstrings to a
5999 * Documentation cleanup. Moved the main usage docstrings to a
5990 separate file, usage.py (cleaner to maintain, and hopefully in the
6000 separate file, usage.py (cleaner to maintain, and hopefully in the
5991 future some perlpod-like way of producing interactive, man and
6001 future some perlpod-like way of producing interactive, man and
5992 html docs out of it will be found).
6002 html docs out of it will be found).
5993
6003
5994 * Added @profile to see your profile at any time.
6004 * Added @profile to see your profile at any time.
5995
6005
5996 * Added @p as an alias for 'print'. It's especially convenient if
6006 * Added @p as an alias for 'print'. It's especially convenient if
5997 using automagic ('p x' prints x).
6007 using automagic ('p x' prints x).
5998
6008
5999 * Small cleanups and fixes after a pychecker run.
6009 * Small cleanups and fixes after a pychecker run.
6000
6010
6001 * Changed the @cd command to handle @cd - and @cd -<n> for
6011 * Changed the @cd command to handle @cd - and @cd -<n> for
6002 visiting any directory in _dh.
6012 visiting any directory in _dh.
6003
6013
6004 * Introduced _dh, a history of visited directories. @dhist prints
6014 * Introduced _dh, a history of visited directories. @dhist prints
6005 it out with numbers.
6015 it out with numbers.
6006
6016
6007 2001-12-07 Fernando Perez <fperez@colorado.edu>
6017 2001-12-07 Fernando Perez <fperez@colorado.edu>
6008
6018
6009 * Released 0.1.22
6019 * Released 0.1.22
6010
6020
6011 * Made initialization a bit more robust against invalid color
6021 * Made initialization a bit more robust against invalid color
6012 options in user input (exit, not traceback-crash).
6022 options in user input (exit, not traceback-crash).
6013
6023
6014 * Changed the bug crash reporter to write the report only in the
6024 * Changed the bug crash reporter to write the report only in the
6015 user's .ipython directory. That way IPython won't litter people's
6025 user's .ipython directory. That way IPython won't litter people's
6016 hard disks with crash files all over the place. Also print on
6026 hard disks with crash files all over the place. Also print on
6017 screen the necessary mail command.
6027 screen the necessary mail command.
6018
6028
6019 * With the new ultraTB, implemented LightBG color scheme for light
6029 * With the new ultraTB, implemented LightBG color scheme for light
6020 background terminals. A lot of people like white backgrounds, so I
6030 background terminals. A lot of people like white backgrounds, so I
6021 guess we should at least give them something readable.
6031 guess we should at least give them something readable.
6022
6032
6023 2001-12-06 Fernando Perez <fperez@colorado.edu>
6033 2001-12-06 Fernando Perez <fperez@colorado.edu>
6024
6034
6025 * Modified the structure of ultraTB. Now there's a proper class
6035 * Modified the structure of ultraTB. Now there's a proper class
6026 for tables of color schemes which allow adding schemes easily and
6036 for tables of color schemes which allow adding schemes easily and
6027 switching the active scheme without creating a new instance every
6037 switching the active scheme without creating a new instance every
6028 time (which was ridiculous). The syntax for creating new schemes
6038 time (which was ridiculous). The syntax for creating new schemes
6029 is also cleaner. I think ultraTB is finally done, with a clean
6039 is also cleaner. I think ultraTB is finally done, with a clean
6030 class structure. Names are also much cleaner (now there's proper
6040 class structure. Names are also much cleaner (now there's proper
6031 color tables, no need for every variable to also have 'color' in
6041 color tables, no need for every variable to also have 'color' in
6032 its name).
6042 its name).
6033
6043
6034 * Broke down genutils into separate files. Now genutils only
6044 * Broke down genutils into separate files. Now genutils only
6035 contains utility functions, and classes have been moved to their
6045 contains utility functions, and classes have been moved to their
6036 own files (they had enough independent functionality to warrant
6046 own files (they had enough independent functionality to warrant
6037 it): ConfigLoader, OutputTrap, Struct.
6047 it): ConfigLoader, OutputTrap, Struct.
6038
6048
6039 2001-12-05 Fernando Perez <fperez@colorado.edu>
6049 2001-12-05 Fernando Perez <fperez@colorado.edu>
6040
6050
6041 * IPython turns 21! Released version 0.1.21, as a candidate for
6051 * IPython turns 21! Released version 0.1.21, as a candidate for
6042 public consumption. If all goes well, release in a few days.
6052 public consumption. If all goes well, release in a few days.
6043
6053
6044 * Fixed path bug (files in Extensions/ directory wouldn't be found
6054 * Fixed path bug (files in Extensions/ directory wouldn't be found
6045 unless IPython/ was explicitly in sys.path).
6055 unless IPython/ was explicitly in sys.path).
6046
6056
6047 * Extended the FlexCompleter class as MagicCompleter to allow
6057 * Extended the FlexCompleter class as MagicCompleter to allow
6048 completion of @-starting lines.
6058 completion of @-starting lines.
6049
6059
6050 * Created __release__.py file as a central repository for release
6060 * Created __release__.py file as a central repository for release
6051 info that other files can read from.
6061 info that other files can read from.
6052
6062
6053 * Fixed small bug in logging: when logging was turned on in
6063 * Fixed small bug in logging: when logging was turned on in
6054 mid-session, old lines with special meanings (!@?) were being
6064 mid-session, old lines with special meanings (!@?) were being
6055 logged without the prepended comment, which is necessary since
6065 logged without the prepended comment, which is necessary since
6056 they are not truly valid python syntax. This should make session
6066 they are not truly valid python syntax. This should make session
6057 restores produce less errors.
6067 restores produce less errors.
6058
6068
6059 * The namespace cleanup forced me to make a FlexCompleter class
6069 * The namespace cleanup forced me to make a FlexCompleter class
6060 which is nothing but a ripoff of rlcompleter, but with selectable
6070 which is nothing but a ripoff of rlcompleter, but with selectable
6061 namespace (rlcompleter only works in __main__.__dict__). I'll try
6071 namespace (rlcompleter only works in __main__.__dict__). I'll try
6062 to submit a note to the authors to see if this change can be
6072 to submit a note to the authors to see if this change can be
6063 incorporated in future rlcompleter releases (Dec.6: done)
6073 incorporated in future rlcompleter releases (Dec.6: done)
6064
6074
6065 * More fixes to namespace handling. It was a mess! Now all
6075 * More fixes to namespace handling. It was a mess! Now all
6066 explicit references to __main__.__dict__ are gone (except when
6076 explicit references to __main__.__dict__ are gone (except when
6067 really needed) and everything is handled through the namespace
6077 really needed) and everything is handled through the namespace
6068 dicts in the IPython instance. We seem to be getting somewhere
6078 dicts in the IPython instance. We seem to be getting somewhere
6069 with this, finally...
6079 with this, finally...
6070
6080
6071 * Small documentation updates.
6081 * Small documentation updates.
6072
6082
6073 * Created the Extensions directory under IPython (with an
6083 * Created the Extensions directory under IPython (with an
6074 __init__.py). Put the PhysicalQ stuff there. This directory should
6084 __init__.py). Put the PhysicalQ stuff there. This directory should
6075 be used for all special-purpose extensions.
6085 be used for all special-purpose extensions.
6076
6086
6077 * File renaming:
6087 * File renaming:
6078 ipythonlib --> ipmaker
6088 ipythonlib --> ipmaker
6079 ipplib --> iplib
6089 ipplib --> iplib
6080 This makes a bit more sense in terms of what these files actually do.
6090 This makes a bit more sense in terms of what these files actually do.
6081
6091
6082 * Moved all the classes and functions in ipythonlib to ipplib, so
6092 * Moved all the classes and functions in ipythonlib to ipplib, so
6083 now ipythonlib only has make_IPython(). This will ease up its
6093 now ipythonlib only has make_IPython(). This will ease up its
6084 splitting in smaller functional chunks later.
6094 splitting in smaller functional chunks later.
6085
6095
6086 * Cleaned up (done, I think) output of @whos. Better column
6096 * Cleaned up (done, I think) output of @whos. Better column
6087 formatting, and now shows str(var) for as much as it can, which is
6097 formatting, and now shows str(var) for as much as it can, which is
6088 typically what one gets with a 'print var'.
6098 typically what one gets with a 'print var'.
6089
6099
6090 2001-12-04 Fernando Perez <fperez@colorado.edu>
6100 2001-12-04 Fernando Perez <fperez@colorado.edu>
6091
6101
6092 * Fixed namespace problems. Now builtin/IPyhton/user names get
6102 * Fixed namespace problems. Now builtin/IPyhton/user names get
6093 properly reported in their namespace. Internal namespace handling
6103 properly reported in their namespace. Internal namespace handling
6094 is finally getting decent (not perfect yet, but much better than
6104 is finally getting decent (not perfect yet, but much better than
6095 the ad-hoc mess we had).
6105 the ad-hoc mess we had).
6096
6106
6097 * Removed -exit option. If people just want to run a python
6107 * Removed -exit option. If people just want to run a python
6098 script, that's what the normal interpreter is for. Less
6108 script, that's what the normal interpreter is for. Less
6099 unnecessary options, less chances for bugs.
6109 unnecessary options, less chances for bugs.
6100
6110
6101 * Added a crash handler which generates a complete post-mortem if
6111 * Added a crash handler which generates a complete post-mortem if
6102 IPython crashes. This will help a lot in tracking bugs down the
6112 IPython crashes. This will help a lot in tracking bugs down the
6103 road.
6113 road.
6104
6114
6105 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6115 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6106 which were boud to functions being reassigned would bypass the
6116 which were boud to functions being reassigned would bypass the
6107 logger, breaking the sync of _il with the prompt counter. This
6117 logger, breaking the sync of _il with the prompt counter. This
6108 would then crash IPython later when a new line was logged.
6118 would then crash IPython later when a new line was logged.
6109
6119
6110 2001-12-02 Fernando Perez <fperez@colorado.edu>
6120 2001-12-02 Fernando Perez <fperez@colorado.edu>
6111
6121
6112 * Made IPython a package. This means people don't have to clutter
6122 * Made IPython a package. This means people don't have to clutter
6113 their sys.path with yet another directory. Changed the INSTALL
6123 their sys.path with yet another directory. Changed the INSTALL
6114 file accordingly.
6124 file accordingly.
6115
6125
6116 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6126 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6117 sorts its output (so @who shows it sorted) and @whos formats the
6127 sorts its output (so @who shows it sorted) and @whos formats the
6118 table according to the width of the first column. Nicer, easier to
6128 table according to the width of the first column. Nicer, easier to
6119 read. Todo: write a generic table_format() which takes a list of
6129 read. Todo: write a generic table_format() which takes a list of
6120 lists and prints it nicely formatted, with optional row/column
6130 lists and prints it nicely formatted, with optional row/column
6121 separators and proper padding and justification.
6131 separators and proper padding and justification.
6122
6132
6123 * Released 0.1.20
6133 * Released 0.1.20
6124
6134
6125 * Fixed bug in @log which would reverse the inputcache list (a
6135 * Fixed bug in @log which would reverse the inputcache list (a
6126 copy operation was missing).
6136 copy operation was missing).
6127
6137
6128 * Code cleanup. @config was changed to use page(). Better, since
6138 * Code cleanup. @config was changed to use page(). Better, since
6129 its output is always quite long.
6139 its output is always quite long.
6130
6140
6131 * Itpl is back as a dependency. I was having too many problems
6141 * Itpl is back as a dependency. I was having too many problems
6132 getting the parametric aliases to work reliably, and it's just
6142 getting the parametric aliases to work reliably, and it's just
6133 easier to code weird string operations with it than playing %()s
6143 easier to code weird string operations with it than playing %()s
6134 games. It's only ~6k, so I don't think it's too big a deal.
6144 games. It's only ~6k, so I don't think it's too big a deal.
6135
6145
6136 * Found (and fixed) a very nasty bug with history. !lines weren't
6146 * Found (and fixed) a very nasty bug with history. !lines weren't
6137 getting cached, and the out of sync caches would crash
6147 getting cached, and the out of sync caches would crash
6138 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6148 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6139 division of labor a bit better. Bug fixed, cleaner structure.
6149 division of labor a bit better. Bug fixed, cleaner structure.
6140
6150
6141 2001-12-01 Fernando Perez <fperez@colorado.edu>
6151 2001-12-01 Fernando Perez <fperez@colorado.edu>
6142
6152
6143 * Released 0.1.19
6153 * Released 0.1.19
6144
6154
6145 * Added option -n to @hist to prevent line number printing. Much
6155 * Added option -n to @hist to prevent line number printing. Much
6146 easier to copy/paste code this way.
6156 easier to copy/paste code this way.
6147
6157
6148 * Created global _il to hold the input list. Allows easy
6158 * Created global _il to hold the input list. Allows easy
6149 re-execution of blocks of code by slicing it (inspired by Janko's
6159 re-execution of blocks of code by slicing it (inspired by Janko's
6150 comment on 'macros').
6160 comment on 'macros').
6151
6161
6152 * Small fixes and doc updates.
6162 * Small fixes and doc updates.
6153
6163
6154 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6164 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6155 much too fragile with automagic. Handles properly multi-line
6165 much too fragile with automagic. Handles properly multi-line
6156 statements and takes parameters.
6166 statements and takes parameters.
6157
6167
6158 2001-11-30 Fernando Perez <fperez@colorado.edu>
6168 2001-11-30 Fernando Perez <fperez@colorado.edu>
6159
6169
6160 * Version 0.1.18 released.
6170 * Version 0.1.18 released.
6161
6171
6162 * Fixed nasty namespace bug in initial module imports.
6172 * Fixed nasty namespace bug in initial module imports.
6163
6173
6164 * Added copyright/license notes to all code files (except
6174 * Added copyright/license notes to all code files (except
6165 DPyGetOpt). For the time being, LGPL. That could change.
6175 DPyGetOpt). For the time being, LGPL. That could change.
6166
6176
6167 * Rewrote a much nicer README, updated INSTALL, cleaned up
6177 * Rewrote a much nicer README, updated INSTALL, cleaned up
6168 ipythonrc-* samples.
6178 ipythonrc-* samples.
6169
6179
6170 * Overall code/documentation cleanup. Basically ready for
6180 * Overall code/documentation cleanup. Basically ready for
6171 release. Only remaining thing: licence decision (LGPL?).
6181 release. Only remaining thing: licence decision (LGPL?).
6172
6182
6173 * Converted load_config to a class, ConfigLoader. Now recursion
6183 * Converted load_config to a class, ConfigLoader. Now recursion
6174 control is better organized. Doesn't include the same file twice.
6184 control is better organized. Doesn't include the same file twice.
6175
6185
6176 2001-11-29 Fernando Perez <fperez@colorado.edu>
6186 2001-11-29 Fernando Perez <fperez@colorado.edu>
6177
6187
6178 * Got input history working. Changed output history variables from
6188 * Got input history working. Changed output history variables from
6179 _p to _o so that _i is for input and _o for output. Just cleaner
6189 _p to _o so that _i is for input and _o for output. Just cleaner
6180 convention.
6190 convention.
6181
6191
6182 * Implemented parametric aliases. This pretty much allows the
6192 * Implemented parametric aliases. This pretty much allows the
6183 alias system to offer full-blown shell convenience, I think.
6193 alias system to offer full-blown shell convenience, I think.
6184
6194
6185 * Version 0.1.17 released, 0.1.18 opened.
6195 * Version 0.1.17 released, 0.1.18 opened.
6186
6196
6187 * dot_ipython/ipythonrc (alias): added documentation.
6197 * dot_ipython/ipythonrc (alias): added documentation.
6188 (xcolor): Fixed small bug (xcolors -> xcolor)
6198 (xcolor): Fixed small bug (xcolors -> xcolor)
6189
6199
6190 * Changed the alias system. Now alias is a magic command to define
6200 * Changed the alias system. Now alias is a magic command to define
6191 aliases just like the shell. Rationale: the builtin magics should
6201 aliases just like the shell. Rationale: the builtin magics should
6192 be there for things deeply connected to IPython's
6202 be there for things deeply connected to IPython's
6193 architecture. And this is a much lighter system for what I think
6203 architecture. And this is a much lighter system for what I think
6194 is the really important feature: allowing users to define quickly
6204 is the really important feature: allowing users to define quickly
6195 magics that will do shell things for them, so they can customize
6205 magics that will do shell things for them, so they can customize
6196 IPython easily to match their work habits. If someone is really
6206 IPython easily to match their work habits. If someone is really
6197 desperate to have another name for a builtin alias, they can
6207 desperate to have another name for a builtin alias, they can
6198 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6208 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6199 works.
6209 works.
6200
6210
6201 2001-11-28 Fernando Perez <fperez@colorado.edu>
6211 2001-11-28 Fernando Perez <fperez@colorado.edu>
6202
6212
6203 * Changed @file so that it opens the source file at the proper
6213 * Changed @file so that it opens the source file at the proper
6204 line. Since it uses less, if your EDITOR environment is
6214 line. Since it uses less, if your EDITOR environment is
6205 configured, typing v will immediately open your editor of choice
6215 configured, typing v will immediately open your editor of choice
6206 right at the line where the object is defined. Not as quick as
6216 right at the line where the object is defined. Not as quick as
6207 having a direct @edit command, but for all intents and purposes it
6217 having a direct @edit command, but for all intents and purposes it
6208 works. And I don't have to worry about writing @edit to deal with
6218 works. And I don't have to worry about writing @edit to deal with
6209 all the editors, less does that.
6219 all the editors, less does that.
6210
6220
6211 * Version 0.1.16 released, 0.1.17 opened.
6221 * Version 0.1.16 released, 0.1.17 opened.
6212
6222
6213 * Fixed some nasty bugs in the page/page_dumb combo that could
6223 * Fixed some nasty bugs in the page/page_dumb combo that could
6214 crash IPython.
6224 crash IPython.
6215
6225
6216 2001-11-27 Fernando Perez <fperez@colorado.edu>
6226 2001-11-27 Fernando Perez <fperez@colorado.edu>
6217
6227
6218 * Version 0.1.15 released, 0.1.16 opened.
6228 * Version 0.1.15 released, 0.1.16 opened.
6219
6229
6220 * Finally got ? and ?? to work for undefined things: now it's
6230 * Finally got ? and ?? to work for undefined things: now it's
6221 possible to type {}.get? and get information about the get method
6231 possible to type {}.get? and get information about the get method
6222 of dicts, or os.path? even if only os is defined (so technically
6232 of dicts, or os.path? even if only os is defined (so technically
6223 os.path isn't). Works at any level. For example, after import os,
6233 os.path isn't). Works at any level. For example, after import os,
6224 os?, os.path?, os.path.abspath? all work. This is great, took some
6234 os?, os.path?, os.path.abspath? all work. This is great, took some
6225 work in _ofind.
6235 work in _ofind.
6226
6236
6227 * Fixed more bugs with logging. The sanest way to do it was to add
6237 * Fixed more bugs with logging. The sanest way to do it was to add
6228 to @log a 'mode' parameter. Killed two in one shot (this mode
6238 to @log a 'mode' parameter. Killed two in one shot (this mode
6229 option was a request of Janko's). I think it's finally clean
6239 option was a request of Janko's). I think it's finally clean
6230 (famous last words).
6240 (famous last words).
6231
6241
6232 * Added a page_dumb() pager which does a decent job of paging on
6242 * Added a page_dumb() pager which does a decent job of paging on
6233 screen, if better things (like less) aren't available. One less
6243 screen, if better things (like less) aren't available. One less
6234 unix dependency (someday maybe somebody will port this to
6244 unix dependency (someday maybe somebody will port this to
6235 windows).
6245 windows).
6236
6246
6237 * Fixed problem in magic_log: would lock of logging out if log
6247 * Fixed problem in magic_log: would lock of logging out if log
6238 creation failed (because it would still think it had succeeded).
6248 creation failed (because it would still think it had succeeded).
6239
6249
6240 * Improved the page() function using curses to auto-detect screen
6250 * Improved the page() function using curses to auto-detect screen
6241 size. Now it can make a much better decision on whether to print
6251 size. Now it can make a much better decision on whether to print
6242 or page a string. Option screen_length was modified: a value 0
6252 or page a string. Option screen_length was modified: a value 0
6243 means auto-detect, and that's the default now.
6253 means auto-detect, and that's the default now.
6244
6254
6245 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6255 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6246 go out. I'll test it for a few days, then talk to Janko about
6256 go out. I'll test it for a few days, then talk to Janko about
6247 licences and announce it.
6257 licences and announce it.
6248
6258
6249 * Fixed the length of the auto-generated ---> prompt which appears
6259 * Fixed the length of the auto-generated ---> prompt which appears
6250 for auto-parens and auto-quotes. Getting this right isn't trivial,
6260 for auto-parens and auto-quotes. Getting this right isn't trivial,
6251 with all the color escapes, different prompt types and optional
6261 with all the color escapes, different prompt types and optional
6252 separators. But it seems to be working in all the combinations.
6262 separators. But it seems to be working in all the combinations.
6253
6263
6254 2001-11-26 Fernando Perez <fperez@colorado.edu>
6264 2001-11-26 Fernando Perez <fperez@colorado.edu>
6255
6265
6256 * Wrote a regexp filter to get option types from the option names
6266 * Wrote a regexp filter to get option types from the option names
6257 string. This eliminates the need to manually keep two duplicate
6267 string. This eliminates the need to manually keep two duplicate
6258 lists.
6268 lists.
6259
6269
6260 * Removed the unneeded check_option_names. Now options are handled
6270 * Removed the unneeded check_option_names. Now options are handled
6261 in a much saner manner and it's easy to visually check that things
6271 in a much saner manner and it's easy to visually check that things
6262 are ok.
6272 are ok.
6263
6273
6264 * Updated version numbers on all files I modified to carry a
6274 * Updated version numbers on all files I modified to carry a
6265 notice so Janko and Nathan have clear version markers.
6275 notice so Janko and Nathan have clear version markers.
6266
6276
6267 * Updated docstring for ultraTB with my changes. I should send
6277 * Updated docstring for ultraTB with my changes. I should send
6268 this to Nathan.
6278 this to Nathan.
6269
6279
6270 * Lots of small fixes. Ran everything through pychecker again.
6280 * Lots of small fixes. Ran everything through pychecker again.
6271
6281
6272 * Made loading of deep_reload an cmd line option. If it's not too
6282 * Made loading of deep_reload an cmd line option. If it's not too
6273 kosher, now people can just disable it. With -nodeep_reload it's
6283 kosher, now people can just disable it. With -nodeep_reload it's
6274 still available as dreload(), it just won't overwrite reload().
6284 still available as dreload(), it just won't overwrite reload().
6275
6285
6276 * Moved many options to the no| form (-opt and -noopt
6286 * Moved many options to the no| form (-opt and -noopt
6277 accepted). Cleaner.
6287 accepted). Cleaner.
6278
6288
6279 * Changed magic_log so that if called with no parameters, it uses
6289 * Changed magic_log so that if called with no parameters, it uses
6280 'rotate' mode. That way auto-generated logs aren't automatically
6290 'rotate' mode. That way auto-generated logs aren't automatically
6281 over-written. For normal logs, now a backup is made if it exists
6291 over-written. For normal logs, now a backup is made if it exists
6282 (only 1 level of backups). A new 'backup' mode was added to the
6292 (only 1 level of backups). A new 'backup' mode was added to the
6283 Logger class to support this. This was a request by Janko.
6293 Logger class to support this. This was a request by Janko.
6284
6294
6285 * Added @logoff/@logon to stop/restart an active log.
6295 * Added @logoff/@logon to stop/restart an active log.
6286
6296
6287 * Fixed a lot of bugs in log saving/replay. It was pretty
6297 * Fixed a lot of bugs in log saving/replay. It was pretty
6288 broken. Now special lines (!@,/) appear properly in the command
6298 broken. Now special lines (!@,/) appear properly in the command
6289 history after a log replay.
6299 history after a log replay.
6290
6300
6291 * Tried and failed to implement full session saving via pickle. My
6301 * Tried and failed to implement full session saving via pickle. My
6292 idea was to pickle __main__.__dict__, but modules can't be
6302 idea was to pickle __main__.__dict__, but modules can't be
6293 pickled. This would be a better alternative to replaying logs, but
6303 pickled. This would be a better alternative to replaying logs, but
6294 seems quite tricky to get to work. Changed -session to be called
6304 seems quite tricky to get to work. Changed -session to be called
6295 -logplay, which more accurately reflects what it does. And if we
6305 -logplay, which more accurately reflects what it does. And if we
6296 ever get real session saving working, -session is now available.
6306 ever get real session saving working, -session is now available.
6297
6307
6298 * Implemented color schemes for prompts also. As for tracebacks,
6308 * Implemented color schemes for prompts also. As for tracebacks,
6299 currently only NoColor and Linux are supported. But now the
6309 currently only NoColor and Linux are supported. But now the
6300 infrastructure is in place, based on a generic ColorScheme
6310 infrastructure is in place, based on a generic ColorScheme
6301 class. So writing and activating new schemes both for the prompts
6311 class. So writing and activating new schemes both for the prompts
6302 and the tracebacks should be straightforward.
6312 and the tracebacks should be straightforward.
6303
6313
6304 * Version 0.1.13 released, 0.1.14 opened.
6314 * Version 0.1.13 released, 0.1.14 opened.
6305
6315
6306 * Changed handling of options for output cache. Now counter is
6316 * Changed handling of options for output cache. Now counter is
6307 hardwired starting at 1 and one specifies the maximum number of
6317 hardwired starting at 1 and one specifies the maximum number of
6308 entries *in the outcache* (not the max prompt counter). This is
6318 entries *in the outcache* (not the max prompt counter). This is
6309 much better, since many statements won't increase the cache
6319 much better, since many statements won't increase the cache
6310 count. It also eliminated some confusing options, now there's only
6320 count. It also eliminated some confusing options, now there's only
6311 one: cache_size.
6321 one: cache_size.
6312
6322
6313 * Added 'alias' magic function and magic_alias option in the
6323 * Added 'alias' magic function and magic_alias option in the
6314 ipythonrc file. Now the user can easily define whatever names he
6324 ipythonrc file. Now the user can easily define whatever names he
6315 wants for the magic functions without having to play weird
6325 wants for the magic functions without having to play weird
6316 namespace games. This gives IPython a real shell-like feel.
6326 namespace games. This gives IPython a real shell-like feel.
6317
6327
6318 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6328 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6319 @ or not).
6329 @ or not).
6320
6330
6321 This was one of the last remaining 'visible' bugs (that I know
6331 This was one of the last remaining 'visible' bugs (that I know
6322 of). I think if I can clean up the session loading so it works
6332 of). I think if I can clean up the session loading so it works
6323 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6333 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6324 about licensing).
6334 about licensing).
6325
6335
6326 2001-11-25 Fernando Perez <fperez@colorado.edu>
6336 2001-11-25 Fernando Perez <fperez@colorado.edu>
6327
6337
6328 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6338 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6329 there's a cleaner distinction between what ? and ?? show.
6339 there's a cleaner distinction between what ? and ?? show.
6330
6340
6331 * Added screen_length option. Now the user can define his own
6341 * Added screen_length option. Now the user can define his own
6332 screen size for page() operations.
6342 screen size for page() operations.
6333
6343
6334 * Implemented magic shell-like functions with automatic code
6344 * Implemented magic shell-like functions with automatic code
6335 generation. Now adding another function is just a matter of adding
6345 generation. Now adding another function is just a matter of adding
6336 an entry to a dict, and the function is dynamically generated at
6346 an entry to a dict, and the function is dynamically generated at
6337 run-time. Python has some really cool features!
6347 run-time. Python has some really cool features!
6338
6348
6339 * Renamed many options to cleanup conventions a little. Now all
6349 * Renamed many options to cleanup conventions a little. Now all
6340 are lowercase, and only underscores where needed. Also in the code
6350 are lowercase, and only underscores where needed. Also in the code
6341 option name tables are clearer.
6351 option name tables are clearer.
6342
6352
6343 * Changed prompts a little. Now input is 'In [n]:' instead of
6353 * Changed prompts a little. Now input is 'In [n]:' instead of
6344 'In[n]:='. This allows it the numbers to be aligned with the
6354 'In[n]:='. This allows it the numbers to be aligned with the
6345 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6355 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6346 Python (it was a Mathematica thing). The '...' continuation prompt
6356 Python (it was a Mathematica thing). The '...' continuation prompt
6347 was also changed a little to align better.
6357 was also changed a little to align better.
6348
6358
6349 * Fixed bug when flushing output cache. Not all _p<n> variables
6359 * Fixed bug when flushing output cache. Not all _p<n> variables
6350 exist, so their deletion needs to be wrapped in a try:
6360 exist, so their deletion needs to be wrapped in a try:
6351
6361
6352 * Figured out how to properly use inspect.formatargspec() (it
6362 * Figured out how to properly use inspect.formatargspec() (it
6353 requires the args preceded by *). So I removed all the code from
6363 requires the args preceded by *). So I removed all the code from
6354 _get_pdef in Magic, which was just replicating that.
6364 _get_pdef in Magic, which was just replicating that.
6355
6365
6356 * Added test to prefilter to allow redefining magic function names
6366 * Added test to prefilter to allow redefining magic function names
6357 as variables. This is ok, since the @ form is always available,
6367 as variables. This is ok, since the @ form is always available,
6358 but whe should allow the user to define a variable called 'ls' if
6368 but whe should allow the user to define a variable called 'ls' if
6359 he needs it.
6369 he needs it.
6360
6370
6361 * Moved the ToDo information from README into a separate ToDo.
6371 * Moved the ToDo information from README into a separate ToDo.
6362
6372
6363 * General code cleanup and small bugfixes. I think it's close to a
6373 * General code cleanup and small bugfixes. I think it's close to a
6364 state where it can be released, obviously with a big 'beta'
6374 state where it can be released, obviously with a big 'beta'
6365 warning on it.
6375 warning on it.
6366
6376
6367 * Got the magic function split to work. Now all magics are defined
6377 * Got the magic function split to work. Now all magics are defined
6368 in a separate class. It just organizes things a bit, and now
6378 in a separate class. It just organizes things a bit, and now
6369 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6379 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6370 was too long).
6380 was too long).
6371
6381
6372 * Changed @clear to @reset to avoid potential confusions with
6382 * Changed @clear to @reset to avoid potential confusions with
6373 the shell command clear. Also renamed @cl to @clear, which does
6383 the shell command clear. Also renamed @cl to @clear, which does
6374 exactly what people expect it to from their shell experience.
6384 exactly what people expect it to from their shell experience.
6375
6385
6376 Added a check to the @reset command (since it's so
6386 Added a check to the @reset command (since it's so
6377 destructive, it's probably a good idea to ask for confirmation).
6387 destructive, it's probably a good idea to ask for confirmation).
6378 But now reset only works for full namespace resetting. Since the
6388 But now reset only works for full namespace resetting. Since the
6379 del keyword is already there for deleting a few specific
6389 del keyword is already there for deleting a few specific
6380 variables, I don't see the point of having a redundant magic
6390 variables, I don't see the point of having a redundant magic
6381 function for the same task.
6391 function for the same task.
6382
6392
6383 2001-11-24 Fernando Perez <fperez@colorado.edu>
6393 2001-11-24 Fernando Perez <fperez@colorado.edu>
6384
6394
6385 * Updated the builtin docs (esp. the ? ones).
6395 * Updated the builtin docs (esp. the ? ones).
6386
6396
6387 * Ran all the code through pychecker. Not terribly impressed with
6397 * Ran all the code through pychecker. Not terribly impressed with
6388 it: lots of spurious warnings and didn't really find anything of
6398 it: lots of spurious warnings and didn't really find anything of
6389 substance (just a few modules being imported and not used).
6399 substance (just a few modules being imported and not used).
6390
6400
6391 * Implemented the new ultraTB functionality into IPython. New
6401 * Implemented the new ultraTB functionality into IPython. New
6392 option: xcolors. This chooses color scheme. xmode now only selects
6402 option: xcolors. This chooses color scheme. xmode now only selects
6393 between Plain and Verbose. Better orthogonality.
6403 between Plain and Verbose. Better orthogonality.
6394
6404
6395 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6405 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6396 mode and color scheme for the exception handlers. Now it's
6406 mode and color scheme for the exception handlers. Now it's
6397 possible to have the verbose traceback with no coloring.
6407 possible to have the verbose traceback with no coloring.
6398
6408
6399 2001-11-23 Fernando Perez <fperez@colorado.edu>
6409 2001-11-23 Fernando Perez <fperez@colorado.edu>
6400
6410
6401 * Version 0.1.12 released, 0.1.13 opened.
6411 * Version 0.1.12 released, 0.1.13 opened.
6402
6412
6403 * Removed option to set auto-quote and auto-paren escapes by
6413 * Removed option to set auto-quote and auto-paren escapes by
6404 user. The chances of breaking valid syntax are just too high. If
6414 user. The chances of breaking valid syntax are just too high. If
6405 someone *really* wants, they can always dig into the code.
6415 someone *really* wants, they can always dig into the code.
6406
6416
6407 * Made prompt separators configurable.
6417 * Made prompt separators configurable.
6408
6418
6409 2001-11-22 Fernando Perez <fperez@colorado.edu>
6419 2001-11-22 Fernando Perez <fperez@colorado.edu>
6410
6420
6411 * Small bugfixes in many places.
6421 * Small bugfixes in many places.
6412
6422
6413 * Removed the MyCompleter class from ipplib. It seemed redundant
6423 * Removed the MyCompleter class from ipplib. It seemed redundant
6414 with the C-p,C-n history search functionality. Less code to
6424 with the C-p,C-n history search functionality. Less code to
6415 maintain.
6425 maintain.
6416
6426
6417 * Moved all the original ipython.py code into ipythonlib.py. Right
6427 * Moved all the original ipython.py code into ipythonlib.py. Right
6418 now it's just one big dump into a function called make_IPython, so
6428 now it's just one big dump into a function called make_IPython, so
6419 no real modularity has been gained. But at least it makes the
6429 no real modularity has been gained. But at least it makes the
6420 wrapper script tiny, and since ipythonlib is a module, it gets
6430 wrapper script tiny, and since ipythonlib is a module, it gets
6421 compiled and startup is much faster.
6431 compiled and startup is much faster.
6422
6432
6423 This is a reasobably 'deep' change, so we should test it for a
6433 This is a reasobably 'deep' change, so we should test it for a
6424 while without messing too much more with the code.
6434 while without messing too much more with the code.
6425
6435
6426 2001-11-21 Fernando Perez <fperez@colorado.edu>
6436 2001-11-21 Fernando Perez <fperez@colorado.edu>
6427
6437
6428 * Version 0.1.11 released, 0.1.12 opened for further work.
6438 * Version 0.1.11 released, 0.1.12 opened for further work.
6429
6439
6430 * Removed dependency on Itpl. It was only needed in one place. It
6440 * Removed dependency on Itpl. It was only needed in one place. It
6431 would be nice if this became part of python, though. It makes life
6441 would be nice if this became part of python, though. It makes life
6432 *a lot* easier in some cases.
6442 *a lot* easier in some cases.
6433
6443
6434 * Simplified the prefilter code a bit. Now all handlers are
6444 * Simplified the prefilter code a bit. Now all handlers are
6435 expected to explicitly return a value (at least a blank string).
6445 expected to explicitly return a value (at least a blank string).
6436
6446
6437 * Heavy edits in ipplib. Removed the help system altogether. Now
6447 * Heavy edits in ipplib. Removed the help system altogether. Now
6438 obj?/?? is used for inspecting objects, a magic @doc prints
6448 obj?/?? is used for inspecting objects, a magic @doc prints
6439 docstrings, and full-blown Python help is accessed via the 'help'
6449 docstrings, and full-blown Python help is accessed via the 'help'
6440 keyword. This cleans up a lot of code (less to maintain) and does
6450 keyword. This cleans up a lot of code (less to maintain) and does
6441 the job. Since 'help' is now a standard Python component, might as
6451 the job. Since 'help' is now a standard Python component, might as
6442 well use it and remove duplicate functionality.
6452 well use it and remove duplicate functionality.
6443
6453
6444 Also removed the option to use ipplib as a standalone program. By
6454 Also removed the option to use ipplib as a standalone program. By
6445 now it's too dependent on other parts of IPython to function alone.
6455 now it's too dependent on other parts of IPython to function alone.
6446
6456
6447 * Fixed bug in genutils.pager. It would crash if the pager was
6457 * Fixed bug in genutils.pager. It would crash if the pager was
6448 exited immediately after opening (broken pipe).
6458 exited immediately after opening (broken pipe).
6449
6459
6450 * Trimmed down the VerboseTB reporting a little. The header is
6460 * Trimmed down the VerboseTB reporting a little. The header is
6451 much shorter now and the repeated exception arguments at the end
6461 much shorter now and the repeated exception arguments at the end
6452 have been removed. For interactive use the old header seemed a bit
6462 have been removed. For interactive use the old header seemed a bit
6453 excessive.
6463 excessive.
6454
6464
6455 * Fixed small bug in output of @whos for variables with multi-word
6465 * Fixed small bug in output of @whos for variables with multi-word
6456 types (only first word was displayed).
6466 types (only first word was displayed).
6457
6467
6458 2001-11-17 Fernando Perez <fperez@colorado.edu>
6468 2001-11-17 Fernando Perez <fperez@colorado.edu>
6459
6469
6460 * Version 0.1.10 released, 0.1.11 opened for further work.
6470 * Version 0.1.10 released, 0.1.11 opened for further work.
6461
6471
6462 * Modified dirs and friends. dirs now *returns* the stack (not
6472 * Modified dirs and friends. dirs now *returns* the stack (not
6463 prints), so one can manipulate it as a variable. Convenient to
6473 prints), so one can manipulate it as a variable. Convenient to
6464 travel along many directories.
6474 travel along many directories.
6465
6475
6466 * Fixed bug in magic_pdef: would only work with functions with
6476 * Fixed bug in magic_pdef: would only work with functions with
6467 arguments with default values.
6477 arguments with default values.
6468
6478
6469 2001-11-14 Fernando Perez <fperez@colorado.edu>
6479 2001-11-14 Fernando Perez <fperez@colorado.edu>
6470
6480
6471 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6481 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6472 example with IPython. Various other minor fixes and cleanups.
6482 example with IPython. Various other minor fixes and cleanups.
6473
6483
6474 * Version 0.1.9 released, 0.1.10 opened for further work.
6484 * Version 0.1.9 released, 0.1.10 opened for further work.
6475
6485
6476 * Added sys.path to the list of directories searched in the
6486 * Added sys.path to the list of directories searched in the
6477 execfile= option. It used to be the current directory and the
6487 execfile= option. It used to be the current directory and the
6478 user's IPYTHONDIR only.
6488 user's IPYTHONDIR only.
6479
6489
6480 2001-11-13 Fernando Perez <fperez@colorado.edu>
6490 2001-11-13 Fernando Perez <fperez@colorado.edu>
6481
6491
6482 * Reinstated the raw_input/prefilter separation that Janko had
6492 * Reinstated the raw_input/prefilter separation that Janko had
6483 initially. This gives a more convenient setup for extending the
6493 initially. This gives a more convenient setup for extending the
6484 pre-processor from the outside: raw_input always gets a string,
6494 pre-processor from the outside: raw_input always gets a string,
6485 and prefilter has to process it. We can then redefine prefilter
6495 and prefilter has to process it. We can then redefine prefilter
6486 from the outside and implement extensions for special
6496 from the outside and implement extensions for special
6487 purposes.
6497 purposes.
6488
6498
6489 Today I got one for inputting PhysicalQuantity objects
6499 Today I got one for inputting PhysicalQuantity objects
6490 (from Scientific) without needing any function calls at
6500 (from Scientific) without needing any function calls at
6491 all. Extremely convenient, and it's all done as a user-level
6501 all. Extremely convenient, and it's all done as a user-level
6492 extension (no IPython code was touched). Now instead of:
6502 extension (no IPython code was touched). Now instead of:
6493 a = PhysicalQuantity(4.2,'m/s**2')
6503 a = PhysicalQuantity(4.2,'m/s**2')
6494 one can simply say
6504 one can simply say
6495 a = 4.2 m/s**2
6505 a = 4.2 m/s**2
6496 or even
6506 or even
6497 a = 4.2 m/s^2
6507 a = 4.2 m/s^2
6498
6508
6499 I use this, but it's also a proof of concept: IPython really is
6509 I use this, but it's also a proof of concept: IPython really is
6500 fully user-extensible, even at the level of the parsing of the
6510 fully user-extensible, even at the level of the parsing of the
6501 command line. It's not trivial, but it's perfectly doable.
6511 command line. It's not trivial, but it's perfectly doable.
6502
6512
6503 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6513 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6504 the problem of modules being loaded in the inverse order in which
6514 the problem of modules being loaded in the inverse order in which
6505 they were defined in
6515 they were defined in
6506
6516
6507 * Version 0.1.8 released, 0.1.9 opened for further work.
6517 * Version 0.1.8 released, 0.1.9 opened for further work.
6508
6518
6509 * Added magics pdef, source and file. They respectively show the
6519 * Added magics pdef, source and file. They respectively show the
6510 definition line ('prototype' in C), source code and full python
6520 definition line ('prototype' in C), source code and full python
6511 file for any callable object. The object inspector oinfo uses
6521 file for any callable object. The object inspector oinfo uses
6512 these to show the same information.
6522 these to show the same information.
6513
6523
6514 * Version 0.1.7 released, 0.1.8 opened for further work.
6524 * Version 0.1.7 released, 0.1.8 opened for further work.
6515
6525
6516 * Separated all the magic functions into a class called Magic. The
6526 * Separated all the magic functions into a class called Magic. The
6517 InteractiveShell class was becoming too big for Xemacs to handle
6527 InteractiveShell class was becoming too big for Xemacs to handle
6518 (de-indenting a line would lock it up for 10 seconds while it
6528 (de-indenting a line would lock it up for 10 seconds while it
6519 backtracked on the whole class!)
6529 backtracked on the whole class!)
6520
6530
6521 FIXME: didn't work. It can be done, but right now namespaces are
6531 FIXME: didn't work. It can be done, but right now namespaces are
6522 all messed up. Do it later (reverted it for now, so at least
6532 all messed up. Do it later (reverted it for now, so at least
6523 everything works as before).
6533 everything works as before).
6524
6534
6525 * Got the object introspection system (magic_oinfo) working! I
6535 * Got the object introspection system (magic_oinfo) working! I
6526 think this is pretty much ready for release to Janko, so he can
6536 think this is pretty much ready for release to Janko, so he can
6527 test it for a while and then announce it. Pretty much 100% of what
6537 test it for a while and then announce it. Pretty much 100% of what
6528 I wanted for the 'phase 1' release is ready. Happy, tired.
6538 I wanted for the 'phase 1' release is ready. Happy, tired.
6529
6539
6530 2001-11-12 Fernando Perez <fperez@colorado.edu>
6540 2001-11-12 Fernando Perez <fperez@colorado.edu>
6531
6541
6532 * Version 0.1.6 released, 0.1.7 opened for further work.
6542 * Version 0.1.6 released, 0.1.7 opened for further work.
6533
6543
6534 * Fixed bug in printing: it used to test for truth before
6544 * Fixed bug in printing: it used to test for truth before
6535 printing, so 0 wouldn't print. Now checks for None.
6545 printing, so 0 wouldn't print. Now checks for None.
6536
6546
6537 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6547 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6538 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6548 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6539 reaches by hand into the outputcache. Think of a better way to do
6549 reaches by hand into the outputcache. Think of a better way to do
6540 this later.
6550 this later.
6541
6551
6542 * Various small fixes thanks to Nathan's comments.
6552 * Various small fixes thanks to Nathan's comments.
6543
6553
6544 * Changed magic_pprint to magic_Pprint. This way it doesn't
6554 * Changed magic_pprint to magic_Pprint. This way it doesn't
6545 collide with pprint() and the name is consistent with the command
6555 collide with pprint() and the name is consistent with the command
6546 line option.
6556 line option.
6547
6557
6548 * Changed prompt counter behavior to be fully like
6558 * Changed prompt counter behavior to be fully like
6549 Mathematica's. That is, even input that doesn't return a result
6559 Mathematica's. That is, even input that doesn't return a result
6550 raises the prompt counter. The old behavior was kind of confusing
6560 raises the prompt counter. The old behavior was kind of confusing
6551 (getting the same prompt number several times if the operation
6561 (getting the same prompt number several times if the operation
6552 didn't return a result).
6562 didn't return a result).
6553
6563
6554 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6564 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6555
6565
6556 * Fixed -Classic mode (wasn't working anymore).
6566 * Fixed -Classic mode (wasn't working anymore).
6557
6567
6558 * Added colored prompts using Nathan's new code. Colors are
6568 * Added colored prompts using Nathan's new code. Colors are
6559 currently hardwired, they can be user-configurable. For
6569 currently hardwired, they can be user-configurable. For
6560 developers, they can be chosen in file ipythonlib.py, at the
6570 developers, they can be chosen in file ipythonlib.py, at the
6561 beginning of the CachedOutput class def.
6571 beginning of the CachedOutput class def.
6562
6572
6563 2001-11-11 Fernando Perez <fperez@colorado.edu>
6573 2001-11-11 Fernando Perez <fperez@colorado.edu>
6564
6574
6565 * Version 0.1.5 released, 0.1.6 opened for further work.
6575 * Version 0.1.5 released, 0.1.6 opened for further work.
6566
6576
6567 * Changed magic_env to *return* the environment as a dict (not to
6577 * Changed magic_env to *return* the environment as a dict (not to
6568 print it). This way it prints, but it can also be processed.
6578 print it). This way it prints, but it can also be processed.
6569
6579
6570 * Added Verbose exception reporting to interactive
6580 * Added Verbose exception reporting to interactive
6571 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6581 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6572 traceback. Had to make some changes to the ultraTB file. This is
6582 traceback. Had to make some changes to the ultraTB file. This is
6573 probably the last 'big' thing in my mental todo list. This ties
6583 probably the last 'big' thing in my mental todo list. This ties
6574 in with the next entry:
6584 in with the next entry:
6575
6585
6576 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6586 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6577 has to specify is Plain, Color or Verbose for all exception
6587 has to specify is Plain, Color or Verbose for all exception
6578 handling.
6588 handling.
6579
6589
6580 * Removed ShellServices option. All this can really be done via
6590 * Removed ShellServices option. All this can really be done via
6581 the magic system. It's easier to extend, cleaner and has automatic
6591 the magic system. It's easier to extend, cleaner and has automatic
6582 namespace protection and documentation.
6592 namespace protection and documentation.
6583
6593
6584 2001-11-09 Fernando Perez <fperez@colorado.edu>
6594 2001-11-09 Fernando Perez <fperez@colorado.edu>
6585
6595
6586 * Fixed bug in output cache flushing (missing parameter to
6596 * Fixed bug in output cache flushing (missing parameter to
6587 __init__). Other small bugs fixed (found using pychecker).
6597 __init__). Other small bugs fixed (found using pychecker).
6588
6598
6589 * Version 0.1.4 opened for bugfixing.
6599 * Version 0.1.4 opened for bugfixing.
6590
6600
6591 2001-11-07 Fernando Perez <fperez@colorado.edu>
6601 2001-11-07 Fernando Perez <fperez@colorado.edu>
6592
6602
6593 * Version 0.1.3 released, mainly because of the raw_input bug.
6603 * Version 0.1.3 released, mainly because of the raw_input bug.
6594
6604
6595 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6605 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6596 and when testing for whether things were callable, a call could
6606 and when testing for whether things were callable, a call could
6597 actually be made to certain functions. They would get called again
6607 actually be made to certain functions. They would get called again
6598 once 'really' executed, with a resulting double call. A disaster
6608 once 'really' executed, with a resulting double call. A disaster
6599 in many cases (list.reverse() would never work!).
6609 in many cases (list.reverse() would never work!).
6600
6610
6601 * Removed prefilter() function, moved its code to raw_input (which
6611 * Removed prefilter() function, moved its code to raw_input (which
6602 after all was just a near-empty caller for prefilter). This saves
6612 after all was just a near-empty caller for prefilter). This saves
6603 a function call on every prompt, and simplifies the class a tiny bit.
6613 a function call on every prompt, and simplifies the class a tiny bit.
6604
6614
6605 * Fix _ip to __ip name in magic example file.
6615 * Fix _ip to __ip name in magic example file.
6606
6616
6607 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6617 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6608 work with non-gnu versions of tar.
6618 work with non-gnu versions of tar.
6609
6619
6610 2001-11-06 Fernando Perez <fperez@colorado.edu>
6620 2001-11-06 Fernando Perez <fperez@colorado.edu>
6611
6621
6612 * Version 0.1.2. Just to keep track of the recent changes.
6622 * Version 0.1.2. Just to keep track of the recent changes.
6613
6623
6614 * Fixed nasty bug in output prompt routine. It used to check 'if
6624 * Fixed nasty bug in output prompt routine. It used to check 'if
6615 arg != None...'. Problem is, this fails if arg implements a
6625 arg != None...'. Problem is, this fails if arg implements a
6616 special comparison (__cmp__) which disallows comparing to
6626 special comparison (__cmp__) which disallows comparing to
6617 None. Found it when trying to use the PhysicalQuantity module from
6627 None. Found it when trying to use the PhysicalQuantity module from
6618 ScientificPython.
6628 ScientificPython.
6619
6629
6620 2001-11-05 Fernando Perez <fperez@colorado.edu>
6630 2001-11-05 Fernando Perez <fperez@colorado.edu>
6621
6631
6622 * Also added dirs. Now the pushd/popd/dirs family functions
6632 * Also added dirs. Now the pushd/popd/dirs family functions
6623 basically like the shell, with the added convenience of going home
6633 basically like the shell, with the added convenience of going home
6624 when called with no args.
6634 when called with no args.
6625
6635
6626 * pushd/popd slightly modified to mimic shell behavior more
6636 * pushd/popd slightly modified to mimic shell behavior more
6627 closely.
6637 closely.
6628
6638
6629 * Added env,pushd,popd from ShellServices as magic functions. I
6639 * Added env,pushd,popd from ShellServices as magic functions. I
6630 think the cleanest will be to port all desired functions from
6640 think the cleanest will be to port all desired functions from
6631 ShellServices as magics and remove ShellServices altogether. This
6641 ShellServices as magics and remove ShellServices altogether. This
6632 will provide a single, clean way of adding functionality
6642 will provide a single, clean way of adding functionality
6633 (shell-type or otherwise) to IP.
6643 (shell-type or otherwise) to IP.
6634
6644
6635 2001-11-04 Fernando Perez <fperez@colorado.edu>
6645 2001-11-04 Fernando Perez <fperez@colorado.edu>
6636
6646
6637 * Added .ipython/ directory to sys.path. This way users can keep
6647 * Added .ipython/ directory to sys.path. This way users can keep
6638 customizations there and access them via import.
6648 customizations there and access them via import.
6639
6649
6640 2001-11-03 Fernando Perez <fperez@colorado.edu>
6650 2001-11-03 Fernando Perez <fperez@colorado.edu>
6641
6651
6642 * Opened version 0.1.1 for new changes.
6652 * Opened version 0.1.1 for new changes.
6643
6653
6644 * Changed version number to 0.1.0: first 'public' release, sent to
6654 * Changed version number to 0.1.0: first 'public' release, sent to
6645 Nathan and Janko.
6655 Nathan and Janko.
6646
6656
6647 * Lots of small fixes and tweaks.
6657 * Lots of small fixes and tweaks.
6648
6658
6649 * Minor changes to whos format. Now strings are shown, snipped if
6659 * Minor changes to whos format. Now strings are shown, snipped if
6650 too long.
6660 too long.
6651
6661
6652 * Changed ShellServices to work on __main__ so they show up in @who
6662 * Changed ShellServices to work on __main__ so they show up in @who
6653
6663
6654 * Help also works with ? at the end of a line:
6664 * Help also works with ? at the end of a line:
6655 ?sin and sin?
6665 ?sin and sin?
6656 both produce the same effect. This is nice, as often I use the
6666 both produce the same effect. This is nice, as often I use the
6657 tab-complete to find the name of a method, but I used to then have
6667 tab-complete to find the name of a method, but I used to then have
6658 to go to the beginning of the line to put a ? if I wanted more
6668 to go to the beginning of the line to put a ? if I wanted more
6659 info. Now I can just add the ? and hit return. Convenient.
6669 info. Now I can just add the ? and hit return. Convenient.
6660
6670
6661 2001-11-02 Fernando Perez <fperez@colorado.edu>
6671 2001-11-02 Fernando Perez <fperez@colorado.edu>
6662
6672
6663 * Python version check (>=2.1) added.
6673 * Python version check (>=2.1) added.
6664
6674
6665 * Added LazyPython documentation. At this point the docs are quite
6675 * Added LazyPython documentation. At this point the docs are quite
6666 a mess. A cleanup is in order.
6676 a mess. A cleanup is in order.
6667
6677
6668 * Auto-installer created. For some bizarre reason, the zipfiles
6678 * Auto-installer created. For some bizarre reason, the zipfiles
6669 module isn't working on my system. So I made a tar version
6679 module isn't working on my system. So I made a tar version
6670 (hopefully the command line options in various systems won't kill
6680 (hopefully the command line options in various systems won't kill
6671 me).
6681 me).
6672
6682
6673 * Fixes to Struct in genutils. Now all dictionary-like methods are
6683 * Fixes to Struct in genutils. Now all dictionary-like methods are
6674 protected (reasonably).
6684 protected (reasonably).
6675
6685
6676 * Added pager function to genutils and changed ? to print usage
6686 * Added pager function to genutils and changed ? to print usage
6677 note through it (it was too long).
6687 note through it (it was too long).
6678
6688
6679 * Added the LazyPython functionality. Works great! I changed the
6689 * Added the LazyPython functionality. Works great! I changed the
6680 auto-quote escape to ';', it's on home row and next to '. But
6690 auto-quote escape to ';', it's on home row and next to '. But
6681 both auto-quote and auto-paren (still /) escapes are command-line
6691 both auto-quote and auto-paren (still /) escapes are command-line
6682 parameters.
6692 parameters.
6683
6693
6684
6694
6685 2001-11-01 Fernando Perez <fperez@colorado.edu>
6695 2001-11-01 Fernando Perez <fperez@colorado.edu>
6686
6696
6687 * Version changed to 0.0.7. Fairly large change: configuration now
6697 * Version changed to 0.0.7. Fairly large change: configuration now
6688 is all stored in a directory, by default .ipython. There, all
6698 is all stored in a directory, by default .ipython. There, all
6689 config files have normal looking names (not .names)
6699 config files have normal looking names (not .names)
6690
6700
6691 * Version 0.0.6 Released first to Lucas and Archie as a test
6701 * Version 0.0.6 Released first to Lucas and Archie as a test
6692 run. Since it's the first 'semi-public' release, change version to
6702 run. Since it's the first 'semi-public' release, change version to
6693 > 0.0.6 for any changes now.
6703 > 0.0.6 for any changes now.
6694
6704
6695 * Stuff I had put in the ipplib.py changelog:
6705 * Stuff I had put in the ipplib.py changelog:
6696
6706
6697 Changes to InteractiveShell:
6707 Changes to InteractiveShell:
6698
6708
6699 - Made the usage message a parameter.
6709 - Made the usage message a parameter.
6700
6710
6701 - Require the name of the shell variable to be given. It's a bit
6711 - Require the name of the shell variable to be given. It's a bit
6702 of a hack, but allows the name 'shell' not to be hardwired in the
6712 of a hack, but allows the name 'shell' not to be hardwired in the
6703 magic (@) handler, which is problematic b/c it requires
6713 magic (@) handler, which is problematic b/c it requires
6704 polluting the global namespace with 'shell'. This in turn is
6714 polluting the global namespace with 'shell'. This in turn is
6705 fragile: if a user redefines a variable called shell, things
6715 fragile: if a user redefines a variable called shell, things
6706 break.
6716 break.
6707
6717
6708 - magic @: all functions available through @ need to be defined
6718 - magic @: all functions available through @ need to be defined
6709 as magic_<name>, even though they can be called simply as
6719 as magic_<name>, even though they can be called simply as
6710 @<name>. This allows the special command @magic to gather
6720 @<name>. This allows the special command @magic to gather
6711 information automatically about all existing magic functions,
6721 information automatically about all existing magic functions,
6712 even if they are run-time user extensions, by parsing the shell
6722 even if they are run-time user extensions, by parsing the shell
6713 instance __dict__ looking for special magic_ names.
6723 instance __dict__ looking for special magic_ names.
6714
6724
6715 - mainloop: added *two* local namespace parameters. This allows
6725 - mainloop: added *two* local namespace parameters. This allows
6716 the class to differentiate between parameters which were there
6726 the class to differentiate between parameters which were there
6717 before and after command line initialization was processed. This
6727 before and after command line initialization was processed. This
6718 way, later @who can show things loaded at startup by the
6728 way, later @who can show things loaded at startup by the
6719 user. This trick was necessary to make session saving/reloading
6729 user. This trick was necessary to make session saving/reloading
6720 really work: ideally after saving/exiting/reloading a session,
6730 really work: ideally after saving/exiting/reloading a session,
6721 *everything* should look the same, including the output of @who. I
6731 *everything* should look the same, including the output of @who. I
6722 was only able to make this work with this double namespace
6732 was only able to make this work with this double namespace
6723 trick.
6733 trick.
6724
6734
6725 - added a header to the logfile which allows (almost) full
6735 - added a header to the logfile which allows (almost) full
6726 session restoring.
6736 session restoring.
6727
6737
6728 - prepend lines beginning with @ or !, with a and log
6738 - prepend lines beginning with @ or !, with a and log
6729 them. Why? !lines: may be useful to know what you did @lines:
6739 them. Why? !lines: may be useful to know what you did @lines:
6730 they may affect session state. So when restoring a session, at
6740 they may affect session state. So when restoring a session, at
6731 least inform the user of their presence. I couldn't quite get
6741 least inform the user of their presence. I couldn't quite get
6732 them to properly re-execute, but at least the user is warned.
6742 them to properly re-execute, but at least the user is warned.
6733
6743
6734 * Started ChangeLog.
6744 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now