##// END OF EJS Templates
- set the default value of autoedit_syntax to be false. Too many complaints....
fperez -
Show More
@@ -1,296 +1,285 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 Pdb debugger class.
4 4
5 5 Modified from the standard pdb.Pdb class to avoid including readline, so that
6 6 the command line completion of other programs which include this isn't
7 7 damaged.
8 8
9 9 In the future, this class will be expanded with improvements over the standard
10 10 pdb.
11 11
12 12 The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor
13 13 changes. Licensing should therefore be under the standard Python terms. For
14 14 details on the PSF (Python Software Foundation) standard license, see:
15 15
16 16 http://www.python.org/2.2.3/license.html
17 17
18 $Id: Debugger.py 1029 2006-01-18 07:33:38Z fperez $"""
18 $Id: Debugger.py 1324 2006-05-24 20:25:11Z fperez $"""
19 19
20 20 #*****************************************************************************
21 21 #
22 22 # Since this file is essentially a modified copy of the pdb module which is
23 23 # part of the standard Python distribution, I assume that the proper procedure
24 24 # is to maintain its copyright as belonging to the Python Software Foundation
25 25 # (in addition to my own, for all new code).
26 26 #
27 27 # Copyright (C) 2001 Python Software Foundation, www.python.org
28 28 # Copyright (C) 2005-2006 Fernando Perez. <fperez@colorado.edu>
29 29 #
30 30 # Distributed under the terms of the BSD License. The full license is in
31 31 # the file COPYING, distributed as part of this software.
32 32 #
33 33 #*****************************************************************************
34 34
35
36 35 from IPython import Release
37 36 __author__ = '%s <%s>' % Release.authors['Fernando']
38 37 __license__ = 'Python'
39 38
40 39 import bdb
41 40 import cmd
42 41 import linecache
43 42 import os
44 43 import pdb
45 44 import sys
46 45
47 46 from IPython import PyColorize, ColorANSI
48 47 from IPython.genutils import Term
49 48 from IPython.excolors import ExceptionColors
50 49
51 50 def _file_lines(fname):
52 51 """Return the contents of a named file as a list of lines.
53 52
54 53 This function never raises an IOError exception: if the file can't be
55 54 read, it simply returns an empty list."""
56 55
57 56 try:
58 57 outfile = open(fname)
59 58 except IOError:
60 59 return []
61 60 else:
62 61 out = outfile.readlines()
63 62 outfile.close()
64 63 return out
65 64
66
67 65 class Pdb(pdb.Pdb):
68 66 """Modified Pdb class, does not load readline."""
69 67
70 68 # Ugly hack: we can't call the parent constructor, because it binds
71 69 # readline and breaks tab-completion. This means we have to COPY the
72 70 # constructor here, and that requires tracking various python versions.
73 71
74 72 def __init__(self,color_scheme='NoColor'):
75 73 bdb.Bdb.__init__(self)
76 74 cmd.Cmd.__init__(self,completekey=None) # don't load readline
77 75 self.prompt = 'ipdb> ' # The default prompt is '(Pdb)'
78 76 self.aliases = {}
79 77
80 78 # These two lines are part of the py2.4 constructor, let's put them
81 79 # unconditionally here as they won't cause any problems in 2.3.
82 80 self.mainpyfile = ''
83 81 self._wait_for_mainpyfile = 0
84 82
85 83 # Read $HOME/.pdbrc and ./.pdbrc
86 84 try:
87 85 self.rcLines = _file_lines(os.path.join(os.environ['HOME'],
88 86 ".pdbrc"))
89 87 except KeyError:
90 88 self.rcLines = []
91 89 self.rcLines.extend(_file_lines(".pdbrc"))
92 90
93 91 # Create color table: we copy the default one from the traceback
94 92 # module and add a few attributes needed for debugging
95 93 self.color_scheme_table = ExceptionColors.copy()
96 94
97 95 # shorthands
98 96 C = ColorANSI.TermColors
99 97 cst = self.color_scheme_table
100 98
101 99 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
102 100 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
103 101
104 102 cst['Linux'].colors.breakpoint_enabled = C.LightRed
105 103 cst['Linux'].colors.breakpoint_disabled = C.Red
106 104
107 105 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
108 106 cst['LightBG'].colors.breakpoint_disabled = C.Red
109 107
110 108 self.set_colors(color_scheme)
111 109
112 110 def set_colors(self, scheme):
113 111 """Shorthand access to the color table scheme selector method."""
114 112 self.color_scheme_table.set_active_scheme(scheme)
115 113
116
117 114 def interaction(self, frame, traceback):
118 115 __IPYTHON__.set_completer_frame(frame)
119 116 pdb.Pdb.interaction(self, frame, traceback)
120 117
121
122 118 def do_up(self, arg):
123 119 pdb.Pdb.do_up(self, arg)
124 120 __IPYTHON__.set_completer_frame(self.curframe)
125 121 do_u = do_up
126 122
127
128 123 def do_down(self, arg):
129 124 pdb.Pdb.do_down(self, arg)
130 125 __IPYTHON__.set_completer_frame(self.curframe)
131 126 do_d = do_down
132 127
133
134 128 def postloop(self):
135 129 __IPYTHON__.set_completer_frame(None)
136 130
137
138 131 def print_stack_trace(self):
139 132 try:
140 133 for frame_lineno in self.stack:
141 134 self.print_stack_entry(frame_lineno, context = 5)
142 135 except KeyboardInterrupt:
143 136 pass
144 137
145
146 138 def print_stack_entry(self,frame_lineno,prompt_prefix='\n-> ',
147 139 context = 3):
148 140 frame, lineno = frame_lineno
149 141 print >>Term.cout, self.format_stack_entry(frame_lineno, '', context)
150 142
151
152 143 def format_stack_entry(self, frame_lineno, lprefix=': ', context = 3):
153 144 import linecache, repr
154 145
155 ret = ""
146 ret = []
156 147
157 148 Colors = self.color_scheme_table.active_colors
158 149 ColorsNormal = Colors.Normal
159 150 tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal)
160 tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
151 tpl_call = '%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal)
161 152 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
162 153 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line,
163 154 ColorsNormal)
164 155
165 156 frame, lineno = frame_lineno
166 157
167 158 return_value = ''
168 159 if '__return__' in frame.f_locals:
169 160 rv = frame.f_locals['__return__']
170 161 #return_value += '->'
171 162 return_value += repr.repr(rv) + '\n'
172 ret += return_value
163 ret.append(return_value)
173 164
174 165 #s = filename + '(' + `lineno` + ')'
175 166 filename = self.canonic(frame.f_code.co_filename)
176 167 link = tpl_link % filename
177 168
178 169 if frame.f_code.co_name:
179 170 func = frame.f_code.co_name
180 171 else:
181 172 func = "<lambda>"
182 173
183 174 call = ''
184 175 if func != '?':
185 176 if '__args__' in frame.f_locals:
186 177 args = repr.repr(frame.f_locals['__args__'])
187 178 else:
188 179 args = '()'
189 180 call = tpl_call % (func, args)
190 181
191 level = '%s %s\n' % (link, call)
192 ret += level
182 # The level info should be generated in the same format pdb uses, to
183 # avoid breaking the pdbtrack functionality of python-mode in *emacs.
184 ret.append('> %s(%s)%s\n' % (link,lineno,call))
193 185
194 186 start = lineno - 1 - context//2
195 187 lines = linecache.getlines(filename)
196 188 start = max(start, 0)
197 189 start = min(start, len(lines) - context)
198 190 lines = lines[start : start + context]
199 191
200 for i in range(len(lines)):
201 line = lines[i]
202 if start + 1 + i == lineno:
203 ret += self.__format_line(tpl_line_em, filename, start + 1 + i, line, arrow = True)
204 else:
205 ret += self.__format_line(tpl_line, filename, start + 1 + i, line, arrow = False)
206
207 return ret
192 for i,line in enumerate(lines):
193 show_arrow = (start + 1 + i == lineno)
194 ret.append(self.__format_line(tpl_line_em, filename,
195 start + 1 + i, line,
196 arrow = show_arrow) )
208 197
198 return ''.join(ret)
209 199
210 200 def __format_line(self, tpl_line, filename, lineno, line, arrow = False):
211 201 bp_mark = ""
212 202 bp_mark_color = ""
213 203
214 204 bp = None
215 205 if lineno in self.get_file_breaks(filename):
216 206 bps = self.get_breaks(filename, lineno)
217 207 bp = bps[-1]
218 208
219 209 if bp:
220 210 Colors = self.color_scheme_table.active_colors
221 211 bp_mark = str(bp.number)
222 212 bp_mark_color = Colors.breakpoint_enabled
223 213 if not bp.enabled:
224 214 bp_mark_color = Colors.breakpoint_disabled
225 215
226 216 numbers_width = 7
227 217 if arrow:
228 218 # This is the line with the error
229 219 pad = numbers_width - len(str(lineno)) - len(bp_mark)
230 220 if pad >= 3:
231 221 marker = '-'*(pad-3) + '-> '
232 222 elif pad == 2:
233 223 marker = '> '
234 224 elif pad == 1:
235 225 marker = '>'
236 226 else:
237 227 marker = ''
238 228 num = '%s%s' % (marker, str(lineno))
239 229 line = tpl_line % (bp_mark_color + bp_mark, num, line)
240 230 else:
241 231 num = '%*s' % (numbers_width - len(bp_mark), str(lineno))
242 232 line = tpl_line % (bp_mark_color + bp_mark, num, line)
243 233
244 234 return line
245 235
246
247 236 def do_list(self, arg):
248 237 self.lastcmd = 'list'
249 238 last = None
250 239 if arg:
251 240 try:
252 241 x = eval(arg, {}, {})
253 242 if type(x) == type(()):
254 243 first, last = x
255 244 first = int(first)
256 245 last = int(last)
257 246 if last < first:
258 247 # Assume it's a count
259 248 last = first + last
260 249 else:
261 250 first = max(1, int(x) - 5)
262 251 except:
263 252 print '*** Error in argument:', `arg`
264 253 return
265 254 elif self.lineno is None:
266 255 first = max(1, self.curframe.f_lineno - 5)
267 256 else:
268 257 first = self.lineno + 1
269 258 if last is None:
270 259 last = first + 10
271 260 filename = self.curframe.f_code.co_filename
272 261 try:
273 262 Colors = self.color_scheme_table.active_colors
274 263 ColorsNormal = Colors.Normal
275 264 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
276 265 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
277 266 src = []
278 267 for lineno in range(first, last+1):
279 268 line = linecache.getline(filename, lineno)
280 269 if not line:
281 270 break
282 271
283 272 if lineno == self.curframe.f_lineno:
284 273 line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True)
285 274 else:
286 275 line = self.__format_line(tpl_line, filename, lineno, line, arrow = False)
287 276
288 277 src.append(line)
289 278 self.lineno = lineno
290 279
291 280 print >>Term.cout, ''.join(src)
292 281
293 282 except KeyboardInterrupt:
294 283 pass
295 284
296 285 do_l = do_list
@@ -1,31 +1,30 b''
1 1 """ User configuration file for IPython
2 2
3 3 This is a more flexible and safe way to configure ipython than *rc files
4 4 (ipythonrc, ipythonrc-pysh etc.)
5 5
6 6 This file is always imported on ipython startup. You can import the
7 7 ipython extensions you need here (see IPython/Extensions directory).
8 8
9 9 Feel free to edit this file to customize your ipython experience.
10 10
11 11 Note that as such this file does nothing, for backwards compatibility.
12 12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
13 13 you can do here.
14 14
15 15 """
16 16
17 17 # Most of your config files and extensions will probably start with this import
18 18
19 19 import IPython.ipapi
20 20 ip = IPython.ipapi.get()
21 21
22 22 # You probably want to uncomment this if you did %upgrade -nolegacy
23 23 # import ipy_defaults
24 24
25 25 def main():
26 26 o = ip.options
27 27 # An example on how to set options
28 28 #o.autocall = 1
29 29
30 30 main()
31
@@ -1,597 +1,597 b''
1 1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
2 # $Id: ipythonrc 1155 2006-02-12 01:21:00Z fperez $
2 # $Id: ipythonrc 1324 2006-05-24 20:25:11Z fperez $
3 3
4 4 #***************************************************************************
5 5 #
6 6 # Configuration file for IPython -- ipythonrc format
7 7 #
8 8 # The format of this file is simply one of 'key value' lines.
9 9 # Lines containing only whitespace at the beginning and then a # are ignored
10 10 # as comments. But comments can NOT be put on lines with data.
11 11
12 12 # The meaning and use of each key are explained below.
13 13
14 14 #---------------------------------------------------------------------------
15 15 # Section: included files
16 16
17 17 # Put one or more *config* files (with the syntax of this file) you want to
18 18 # include. For keys with a unique value the outermost file has precedence. For
19 19 # keys with multiple values, they all get assembled into a list which then
20 20 # gets loaded by IPython.
21 21
22 22 # In this file, all lists of things should simply be space-separated.
23 23
24 24 # This allows you to build hierarchies of files which recursively load
25 25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
26 26 # should only keep here basic things you always want available. Then you can
27 27 # include it in every other special-purpose config file you create.
28 28 include
29 29
30 30 #---------------------------------------------------------------------------
31 31 # Section: startup setup
32 32
33 33 # These are mostly things which parallel a command line option of the same
34 34 # name.
35 35
36 36 # Keys in this section should only appear once. If any key from this section
37 37 # is encountered more than once, the last value remains, all earlier ones get
38 38 # discarded.
39 39
40 40
41 41 # Automatic calling of callable objects. If set to 1 or 2, callable objects
42 42 # are automatically called when invoked at the command line, even if you don't
43 43 # type parentheses. IPython adds the parentheses for you. For example:
44 44
45 45 #In [1]: str 45
46 46 #------> str(45)
47 47 #Out[1]: '45'
48 48
49 49 # IPython reprints your line with '---->' indicating that it added
50 50 # parentheses. While this option is very convenient for interactive use, it
51 51 # may occasionally cause problems with objects which have side-effects if
52 52 # called unexpectedly.
53 53
54 54 # The valid values for autocall are:
55 55
56 56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
57 57
58 58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
59 59
60 60 # In this mode, you get:
61 61
62 62 #In [1]: callable
63 63 #Out[1]: <built-in function callable>
64 64
65 65 #In [2]: callable 'hello'
66 66 #------> callable('hello')
67 67 #Out[2]: False
68 68
69 69 # 2 -> Active always. Even if no arguments are present, the callable object
70 70 # is called:
71 71
72 72 #In [4]: callable
73 73 #------> callable()
74 74
75 75 # Note that even with autocall off, you can still use '/' at the start of a
76 76 # line to treat the first argument on the command line as a function and add
77 77 # parentheses to it:
78 78
79 79 #In [8]: /str 43
80 80 #------> str(43)
81 81 #Out[8]: '43'
82 82
83 83 autocall 1
84 84
85 85 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
86 86 # source code (see the 'editor' variable below), it is possible that you save
87 87 # a file with syntax errors in it. If this variable is true, IPython will ask
88 88 # you whether to re-open the editor immediately to correct such an error.
89 89
90 autoedit_syntax 1
90 autoedit_syntax 0
91 91
92 92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
93 93 # line, while also un-indenting automatically after 'raise' or 'return'.
94 94
95 95 # This feature uses the readline library, so it will honor your ~/.inputrc
96 96 # configuration (or whatever file your INPUTRC variable points to). Adding
97 97 # the following lines to your .inputrc file can make indent/unindenting more
98 98 # convenient (M-i indents, M-u unindents):
99 99
100 100 # $if Python
101 101 # "\M-i": " "
102 102 # "\M-u": "\d\d\d\d"
103 103 # $endif
104 104
105 105 # The feature is potentially a bit dangerous, because it can cause problems
106 106 # with pasting of indented code (the pasted code gets re-indented on each
107 107 # line). But it's a huge time-saver when working interactively. The magic
108 108 # function %autoindent allows you to toggle it on/off at runtime.
109 109
110 110 autoindent 1
111 111
112 112 # Auto-magic. This gives you access to all the magic functions without having
113 113 # to prepend them with an % sign. If you define a variable with the same name
114 114 # as a magic function (say who=1), you will need to access the magic function
115 115 # with % (%who in this example). However, if later you delete your variable
116 116 # (del who), you'll recover the automagic calling form.
117 117
118 118 # Considering that many magic functions provide a lot of shell-like
119 119 # functionality, automagic gives you something close to a full Python+system
120 120 # shell environment (and you can extend it further if you want).
121 121
122 122 automagic 1
123 123
124 124 # Size of the output cache. After this many entries are stored, the cache will
125 125 # get flushed. Depending on the size of your intermediate calculations, you
126 126 # may have memory problems if you make it too big, since keeping things in the
127 127 # cache prevents Python from reclaiming the memory for old results. Experiment
128 128 # with a value that works well for you.
129 129
130 130 # If you choose cache_size 0 IPython will revert to python's regular >>>
131 131 # unnumbered prompt. You will still have _, __ and ___ for your last three
132 132 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
133 133 # you are running on a slow machine or with very limited memory, this may
134 134 # help.
135 135
136 136 cache_size 1000
137 137
138 138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
139 139 # but that's your choice! Classic 1 -> same as IPython -classic.
140 140 # Note that this is _not_ the normal python interpreter, it's simply
141 141 # IPython emulating most of the classic interpreter's behavior.
142 142 classic 0
143 143
144 144 # colors - Coloring option for prompts and traceback printouts.
145 145
146 146 # Currently available schemes: NoColor, Linux, LightBG.
147 147
148 148 # This option allows coloring the prompts and traceback printouts. This
149 149 # requires a terminal which can properly handle color escape sequences. If you
150 150 # are having problems with this, use the NoColor scheme (uses no color escapes
151 151 # at all).
152 152
153 153 # The Linux option works well in linux console type environments: dark
154 154 # background with light fonts.
155 155
156 156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
157 157 # in light background terminals.
158 158
159 159 # keep uncommented only the one you want:
160 160 colors Linux
161 161 #colors LightBG
162 162 #colors NoColor
163 163
164 164 ########################
165 165 # Note to Windows users
166 166 #
167 167 # Color and readline support is avaialble to Windows users via Gary Bishop's
168 168 # readline library. You can find Gary's tools at
169 169 # http://sourceforge.net/projects/uncpythontools.
170 170 # Note that his readline module requires in turn the ctypes library, available
171 171 # at http://starship.python.net/crew/theller/ctypes.
172 172 ########################
173 173
174 174 # color_info: IPython can display information about objects via a set of
175 175 # functions, and optionally can use colors for this, syntax highlighting
176 176 # source code and various other elements. This information is passed through a
177 177 # pager (it defaults to 'less' if $PAGER is not set).
178 178
179 179 # If your pager has problems, try to setting it to properly handle escapes
180 180 # (see the less manpage for detail), or disable this option. The magic
181 181 # function %color_info allows you to toggle this interactively for testing.
182 182
183 183 color_info 1
184 184
185 185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
186 186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
187 187 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
188 188 # any confirmation.
189 189
190 190 confirm_exit 1
191 191
192 192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
193 193 # still available as dreload() and appears as a builtin.
194 194
195 195 deep_reload 0
196 196
197 197 # Which editor to use with the %edit command. If you leave this at 0, IPython
198 198 # will honor your EDITOR environment variable. Since this editor is invoked on
199 199 # the fly by ipython and is meant for editing small code snippets, you may
200 200 # want to use a small, lightweight editor here.
201 201
202 202 # For Emacs users, setting up your Emacs server properly as described in the
203 203 # manual is a good idea. An alternative is to use jed, a very light editor
204 204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
205 205
206 206 editor 0
207 207
208 208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
209 209 log 0
210 210
211 211 # Same as ipython -Logfile YourLogfileName.
212 212 # Don't use with log 1 (use one or the other)
213 213 logfile ''
214 214
215 215 # banner 0 -> same as ipython -nobanner
216 216 banner 1
217 217
218 218 # messages 0 -> same as ipython -nomessages
219 219 messages 1
220 220
221 221 # Automatically call the pdb debugger after every uncaught exception. If you
222 222 # are used to debugging using pdb, this puts you automatically inside of it
223 223 # after any call (either in IPython or in code called by it) which triggers an
224 224 # exception which goes uncaught.
225 225 pdb 0
226 226
227 227 # Enable the pprint module for printing. pprint tends to give a more readable
228 228 # display (than print) for complex nested data structures.
229 229 pprint 1
230 230
231 231 # Prompt strings
232 232
233 233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
234 234 # a few additional ones which are IPython-specific. All valid prompt escapes
235 235 # are described in detail in the Customization section of the IPython HTML/PDF
236 236 # manual.
237 237
238 238 # Use \# to represent the current prompt number, and quote them to protect
239 239 # spaces.
240 240 prompt_in1 'In [\#]: '
241 241
242 242 # \D is replaced by as many dots as there are digits in the
243 243 # current value of \#.
244 244 prompt_in2 ' .\D.: '
245 245
246 246 prompt_out 'Out[\#]: '
247 247
248 248 # Select whether to left-pad the output prompts to match the length of the
249 249 # input ones. This allows you for example to use a simple '>' as an output
250 250 # prompt, and yet have the output line up with the input. If set to false,
251 251 # the output prompts will be unpadded (flush left).
252 252 prompts_pad_left 1
253 253
254 254 # quick 1 -> same as ipython -quick
255 255 quick 0
256 256
257 257 # Use the readline library (1) or not (0). Most users will want this on, but
258 258 # if you experience strange problems with line management (mainly when using
259 259 # IPython inside Emacs buffers) you may try disabling it. Not having it on
260 260 # prevents you from getting command history with the arrow keys, searching and
261 261 # name completion using TAB.
262 262
263 263 readline 1
264 264
265 265 # Screen Length: number of lines of your screen. This is used to control
266 266 # printing of very long strings. Strings longer than this number of lines will
267 267 # be paged with the less command instead of directly printed.
268 268
269 269 # The default value for this is 0, which means IPython will auto-detect your
270 270 # screen size every time it needs to print. If for some reason this isn't
271 271 # working well (it needs curses support), specify it yourself. Otherwise don't
272 272 # change the default.
273 273
274 274 screen_length 0
275 275
276 276 # Prompt separators for input and output.
277 277 # Use \n for newline explicitly, without quotes.
278 278 # Use 0 (like at the cmd line) to turn off a given separator.
279 279
280 280 # The structure of prompt printing is:
281 281 # (SeparateIn)Input....
282 282 # (SeparateOut)Output...
283 283 # (SeparateOut2), # that is, no newline is printed after Out2
284 284 # By choosing these you can organize your output any way you want.
285 285
286 286 separate_in \n
287 287 separate_out 0
288 288 separate_out2 0
289 289
290 290 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
291 291 # Simply removes all input/output separators, overriding the choices above.
292 292 nosep 0
293 293
294 294 # Wildcard searches - IPython has a system for searching names using
295 295 # shell-like wildcards; type %psearch? for details. This variables sets
296 296 # whether by default such searches should be case sensitive or not. You can
297 297 # always override the default at the system command line or the IPython
298 298 # prompt.
299 299
300 300 wildcards_case_sensitive 1
301 301
302 302 # xmode - Exception reporting mode.
303 303
304 304 # Valid modes: Plain, Context and Verbose.
305 305
306 306 # Plain: similar to python's normal traceback printing.
307 307
308 308 # Context: prints 5 lines of context source code around each line in the
309 309 # traceback.
310 310
311 311 # Verbose: similar to Context, but additionally prints the variables currently
312 312 # visible where the exception happened (shortening their strings if too
313 313 # long). This can potentially be very slow, if you happen to have a huge data
314 314 # structure whose string representation is complex to compute. Your computer
315 315 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
316 316 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
317 317
318 318 #xmode Plain
319 319 xmode Context
320 320 #xmode Verbose
321 321
322 322 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
323 323 # !cmd) to be used in multi-line input (like for loops). For example, if you
324 324 # have this active, the following is valid in IPython:
325 325 #
326 326 #In [17]: for i in range(3):
327 327 # ....: mkdir $i
328 328 # ....: !touch $i/hello
329 329 # ....: ls -l $i
330 330
331 331 multi_line_specials 1
332 332
333 333 # wxversion: request a specific wxPython version (used for -wthread)
334 334
335 335 # Set this to the value of wxPython you want to use, but note that this
336 336 # feature requires you to have the wxversion Python module to work. If you
337 337 # don't have the wxversion module (try 'import wxversion' at the prompt to
338 338 # check) or simply want to leave the system to pick up the default, leave this
339 339 # variable at 0.
340 340
341 341 wxversion 0
342 342
343 343 #---------------------------------------------------------------------------
344 344 # Section: Readline configuration (readline is not available for MS-Windows)
345 345
346 346 # This is done via the following options:
347 347
348 348 # (i) readline_parse_and_bind: this option can appear as many times as you
349 349 # want, each time defining a string to be executed via a
350 350 # readline.parse_and_bind() command. The syntax for valid commands of this
351 351 # kind can be found by reading the documentation for the GNU readline library,
352 352 # as these commands are of the kind which readline accepts in its
353 353 # configuration file.
354 354
355 355 # The TAB key can be used to complete names at the command line in one of two
356 356 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
357 357 # completes as much as possible while 'menu-complete' cycles through all
358 358 # possible completions. Leave the one you prefer uncommented.
359 359
360 360 readline_parse_and_bind tab: complete
361 361 #readline_parse_and_bind tab: menu-complete
362 362
363 363 # This binds Control-l to printing the list of all possible completions when
364 364 # there is more than one (what 'complete' does when hitting TAB twice, or at
365 365 # the first TAB if show-all-if-ambiguous is on)
366 366 readline_parse_and_bind "\C-l": possible-completions
367 367
368 368 # This forces readline to automatically print the above list when tab
369 369 # completion is set to 'complete'. You can still get this list manually by
370 370 # using the key bound to 'possible-completions' (Control-l by default) or by
371 371 # hitting TAB twice. Turning this on makes the printing happen at the first
372 372 # TAB.
373 373 readline_parse_and_bind set show-all-if-ambiguous on
374 374
375 375 # If you have TAB set to complete names, you can rebind any key (Control-o by
376 376 # default) to insert a true TAB character.
377 377 readline_parse_and_bind "\C-o": tab-insert
378 378
379 379 # These commands allow you to indent/unindent easily, with the 4-space
380 380 # convention of the Python coding standards. Since IPython's internal
381 381 # auto-indent system also uses 4 spaces, you should not change the number of
382 382 # spaces in the code below.
383 383 readline_parse_and_bind "\M-i": " "
384 384 readline_parse_and_bind "\M-o": "\d\d\d\d"
385 385 readline_parse_and_bind "\M-I": "\d\d\d\d"
386 386
387 387 # Bindings for incremental searches in the history. These searches use the
388 388 # string typed so far on the command line and search anything in the previous
389 389 # input history containing them.
390 390 readline_parse_and_bind "\C-r": reverse-search-history
391 391 readline_parse_and_bind "\C-s": forward-search-history
392 392
393 393 # Bindings for completing the current line in the history of previous
394 394 # commands. This allows you to recall any previous command by typing its first
395 395 # few letters and hitting Control-p, bypassing all intermediate commands which
396 396 # may be in the history (much faster than hitting up-arrow 50 times!)
397 397 readline_parse_and_bind "\C-p": history-search-backward
398 398 readline_parse_and_bind "\C-n": history-search-forward
399 399
400 400 # I also like to have the same functionality on the plain arrow keys. If you'd
401 401 # rather have the arrows use all the history (and not just match what you've
402 402 # typed so far), comment out or delete the next two lines.
403 403 readline_parse_and_bind "\e[A": history-search-backward
404 404 readline_parse_and_bind "\e[B": history-search-forward
405 405
406 406 # These are typically on by default under *nix, but not win32.
407 407 readline_parse_and_bind "\C-k": kill-line
408 408 readline_parse_and_bind "\C-u": unix-line-discard
409 409
410 410 # (ii) readline_remove_delims: a string of characters to be removed from the
411 411 # default word-delimiters list used by readline, so that completions may be
412 412 # performed on strings which contain them.
413 413
414 414 readline_remove_delims -/~
415 415
416 416 # (iii) readline_merge_completions: whether to merge the result of all
417 417 # possible completions or not. If true, IPython will complete filenames,
418 418 # python names and aliases and return all possible completions. If you set it
419 419 # to false, each completer is used at a time, and only if it doesn't return
420 420 # any completions is the next one used.
421 421
422 422 # The default order is: [python_matches, file_matches, alias_matches]
423 423
424 424 readline_merge_completions 1
425 425
426 426 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
427 427 # will complete all attributes of an object, including all the special methods
428 428 # whose names start with single or double underscores (like __getitem__ or
429 429 # __class__).
430 430
431 431 # This variable allows you to control this completion behavior:
432 432
433 433 # readline_omit__names 1 -> completion will omit showing any names starting
434 434 # with two __, but it will still show names starting with one _.
435 435
436 436 # readline_omit__names 2 -> completion will omit all names beginning with one
437 437 # _ (which obviously means filtering out the double __ ones).
438 438
439 439 # Even when this option is set, you can still see those names by explicitly
440 440 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
441 441 # complete attribute names starting with '_'.
442 442
443 443 # This option is off by default so that new users see all attributes of any
444 444 # objects they are dealing with.
445 445
446 446 readline_omit__names 0
447 447
448 448 #---------------------------------------------------------------------------
449 449 # Section: modules to be loaded with 'import ...'
450 450
451 451 # List, separated by spaces, the names of the modules you want to import
452 452
453 453 # Example:
454 454 # import_mod sys os
455 455 # will produce internally the statements
456 456 # import sys
457 457 # import os
458 458
459 459 # Each import is executed in its own try/except block, so if one module
460 460 # fails to load the others will still be ok.
461 461
462 462 import_mod
463 463
464 464 #---------------------------------------------------------------------------
465 465 # Section: modules to import some functions from: 'from ... import ...'
466 466
467 467 # List, one per line, the modules for which you want only to import some
468 468 # functions. Give the module name first and then the name of functions to be
469 469 # imported from that module.
470 470
471 471 # Example:
472 472
473 473 # import_some IPython.genutils timing timings
474 474 # will produce internally the statement
475 475 # from IPython.genutils import timing, timings
476 476
477 477 # timing() and timings() are two IPython utilities for timing the execution of
478 478 # your own functions, which you may find useful. Just commment out the above
479 479 # line if you want to test them.
480 480
481 481 # If you have more than one modules_some line, each gets its own try/except
482 482 # block (like modules, see above).
483 483
484 484 import_some
485 485
486 486 #---------------------------------------------------------------------------
487 487 # Section: modules to import all from : 'from ... import *'
488 488
489 489 # List (same syntax as import_mod above) those modules for which you want to
490 490 # import all functions. Remember, this is a potentially dangerous thing to do,
491 491 # since it is very easy to overwrite names of things you need. Use with
492 492 # caution.
493 493
494 494 # Example:
495 495 # import_all sys os
496 496 # will produce internally the statements
497 497 # from sys import *
498 498 # from os import *
499 499
500 500 # As before, each will be called in a separate try/except block.
501 501
502 502 import_all
503 503
504 504 #---------------------------------------------------------------------------
505 505 # Section: Python code to execute.
506 506
507 507 # Put here code to be explicitly executed (keep it simple!)
508 508 # Put one line of python code per line. All whitespace is removed (this is a
509 509 # feature, not a bug), so don't get fancy building loops here.
510 510 # This is just for quick convenient creation of things you want available.
511 511
512 512 # Example:
513 513 # execute x = 1
514 514 # execute print 'hello world'; y = z = 'a'
515 515 # will produce internally
516 516 # x = 1
517 517 # print 'hello world'; y = z = 'a'
518 518 # and each *line* (not each statement, we don't do python syntax parsing) is
519 519 # executed in its own try/except block.
520 520
521 521 execute
522 522
523 523 # Note for the adventurous: you can use this to define your own names for the
524 524 # magic functions, by playing some namespace tricks:
525 525
526 526 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
527 527
528 528 # defines %pf as a new name for %profile.
529 529
530 530 #---------------------------------------------------------------------------
531 531 # Section: Pyhton files to load and execute.
532 532
533 533 # Put here the full names of files you want executed with execfile(file). If
534 534 # you want complicated initialization, just write whatever you want in a
535 535 # regular python file and load it from here.
536 536
537 537 # Filenames defined here (which *must* include the extension) are searched for
538 538 # through all of sys.path. Since IPython adds your .ipython directory to
539 539 # sys.path, they can also be placed in your .ipython dir and will be
540 540 # found. Otherwise (if you want to execute things not in .ipyton nor in
541 541 # sys.path) give a full path (you can use ~, it gets expanded)
542 542
543 543 # Example:
544 544 # execfile file1.py ~/file2.py
545 545 # will generate
546 546 # execfile('file1.py')
547 547 # execfile('_path_to_your_home/file2.py')
548 548
549 549 # As before, each file gets its own try/except block.
550 550
551 551 execfile
552 552
553 553 # If you are feeling adventurous, you can even add functionality to IPython
554 554 # through here. IPython works through a global variable called __ip which
555 555 # exists at the time when these files are read. If you know what you are doing
556 556 # (read the source) you can add functions to __ip in files loaded here.
557 557
558 558 # The file example-magic.py contains a simple but correct example. Try it:
559 559
560 560 # execfile example-magic.py
561 561
562 562 # Look at the examples in IPython/iplib.py for more details on how these magic
563 563 # functions need to process their arguments.
564 564
565 565 #---------------------------------------------------------------------------
566 566 # Section: aliases for system shell commands
567 567
568 568 # Here you can define your own names for system commands. The syntax is
569 569 # similar to that of the builtin %alias function:
570 570
571 571 # alias alias_name command_string
572 572
573 573 # The resulting aliases are auto-generated magic functions (hence usable as
574 574 # %alias_name)
575 575
576 576 # For example:
577 577
578 578 # alias myls ls -la
579 579
580 580 # will define 'myls' as an alias for executing the system command 'ls -la'.
581 581 # This allows you to customize IPython's environment to have the same aliases
582 582 # you are accustomed to from your own shell.
583 583
584 584 # You can also define aliases with parameters using %s specifiers (one per
585 585 # parameter):
586 586
587 587 # alias parts echo first %s second %s
588 588
589 589 # will give you in IPython:
590 590 # >>> %parts A B
591 591 # first A second B
592 592
593 593 # Use one 'alias' statement per alias you wish to define.
594 594
595 595 # alias
596 596
597 597 #************************* end of file <ipythonrc> ************************
@@ -1,750 +1,750 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 IPython -- An enhanced Interactive Python
4 4
5 5 Requires Python 2.1 or better.
6 6
7 7 This file contains the main make_IPython() starter function.
8 8
9 $Id: ipmaker.py 1260 2006-04-11 10:19:34Z vivainio $"""
9 $Id: ipmaker.py 1324 2006-05-24 20:25:11Z fperez $"""
10 10
11 11 #*****************************************************************************
12 12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 13 #
14 14 # Distributed under the terms of the BSD License. The full license is in
15 15 # the file COPYING, distributed as part of this software.
16 16 #*****************************************************************************
17 17
18 18 from IPython import Release
19 19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 20 __license__ = Release.license
21 21 __version__ = Release.version
22 22
23 23 credits._Printer__data = """
24 24 Python: %s
25 25
26 26 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
27 27 See http://ipython.scipy.org for more information.""" \
28 28 % credits._Printer__data
29 29
30 30 copyright._Printer__data += """
31 31
32 32 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
33 33 All Rights Reserved."""
34 34
35 35 #****************************************************************************
36 36 # Required modules
37 37
38 38 # From the standard library
39 39 import __main__
40 40 import __builtin__
41 41 import os
42 42 import re
43 43 import sys
44 44 import types
45 45 from pprint import pprint,pformat
46 46
47 47 # Our own
48 48 from IPython import DPyGetOpt
49 49 from IPython.ipstruct import Struct
50 50 from IPython.OutputTrap import OutputTrap
51 51 from IPython.ConfigLoader import ConfigLoader
52 52 from IPython.iplib import InteractiveShell
53 53 from IPython.usage import cmd_line_usage,interactive_usage
54 54 from IPython.genutils import *
55 55
56 56 #-----------------------------------------------------------------------------
57 57 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
58 58 rc_override=None,shell_class=InteractiveShell,
59 59 embedded=False,**kw):
60 60 """This is a dump of IPython into a single function.
61 61
62 62 Later it will have to be broken up in a sensible manner.
63 63
64 64 Arguments:
65 65
66 66 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
67 67 script name, b/c DPyGetOpt strips the first argument only for the real
68 68 sys.argv.
69 69
70 70 - user_ns: a dict to be used as the user's namespace."""
71 71
72 72 #----------------------------------------------------------------------
73 73 # Defaults and initialization
74 74
75 75 # For developer debugging, deactivates crash handler and uses pdb.
76 76 DEVDEBUG = False
77 77
78 78 if argv is None:
79 79 argv = sys.argv
80 80
81 81 # __IP is the main global that lives throughout and represents the whole
82 82 # application. If the user redefines it, all bets are off as to what
83 83 # happens.
84 84
85 85 # __IP is the name of he global which the caller will have accessible as
86 86 # __IP.name. We set its name via the first parameter passed to
87 87 # InteractiveShell:
88 88
89 89 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
90 90 embedded=embedded,**kw)
91 91
92 92 # Put 'help' in the user namespace
93 93 from site import _Helper
94 94 IP.user_ns['help'] = _Helper()
95 95
96 96
97 97 if DEVDEBUG:
98 98 # For developer debugging only (global flag)
99 99 from IPython import ultraTB
100 100 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
101 101
102 102 IP.BANNER_PARTS = ['Python %s\n'
103 103 'Type "copyright", "credits" or "license" '
104 104 'for more information.\n'
105 105 % (sys.version.split('\n')[0],),
106 106 "IPython %s -- An enhanced Interactive Python."
107 107 % (__version__,),
108 108 """? -> Introduction to IPython's features.
109 109 %magic -> Information about IPython's 'magic' % functions.
110 110 help -> Python's own help system.
111 111 object? -> Details about 'object'. ?object also works, ?? prints more.
112 112 """ ]
113 113
114 114 IP.usage = interactive_usage
115 115
116 116 # Platform-dependent suffix and directory names. We use _ipython instead
117 117 # of .ipython under win32 b/c there's software that breaks with .named
118 118 # directories on that platform.
119 119 if os.name == 'posix':
120 120 rc_suffix = ''
121 121 ipdir_def = '.ipython'
122 122 else:
123 123 rc_suffix = '.ini'
124 124 ipdir_def = '_ipython'
125 125
126 126 # default directory for configuration
127 127 ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR',
128 128 os.path.join(IP.home_dir,ipdir_def)))
129 129
130 130 # add personal .ipython dir to sys.path so that users can put things in
131 131 # there for customization
132 132 sys.path.append(ipythondir)
133 133
134 134 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
135 135
136 136 # we need the directory where IPython itself is installed
137 137 import IPython
138 138 IPython_dir = os.path.dirname(IPython.__file__)
139 139 del IPython
140 140
141 141 #-------------------------------------------------------------------------
142 142 # Command line handling
143 143
144 144 # Valid command line options (uses DPyGetOpt syntax, like Perl's
145 145 # GetOpt::Long)
146 146
147 147 # Any key not listed here gets deleted even if in the file (like session
148 148 # or profile). That's deliberate, to maintain the rc namespace clean.
149 149
150 150 # Each set of options appears twice: under _conv only the names are
151 151 # listed, indicating which type they must be converted to when reading the
152 152 # ipythonrc file. And under DPyGetOpt they are listed with the regular
153 153 # DPyGetOpt syntax (=s,=i,:f,etc).
154 154
155 155 # Make sure there's a space before each end of line (they get auto-joined!)
156 156 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
157 157 'c=s classic|cl color_info! colors=s confirm_exit! '
158 158 'debug! deep_reload! editor=s log|l messages! nosep pdb! '
159 159 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
160 160 'quick screen_length|sl=i prompts_pad_left=i '
161 161 'logfile|lf=s logplay|lp=s profile|p=s '
162 162 'readline! readline_merge_completions! '
163 163 'readline_omit__names! '
164 164 'rcfile=s separate_in|si=s separate_out|so=s '
165 165 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
166 166 'magic_docstrings system_verbose! '
167 167 'multi_line_specials! '
168 168 'wxversion=s '
169 169 'autoedit_syntax!')
170 170
171 171 # Options that can *only* appear at the cmd line (not in rcfiles).
172 172
173 173 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
174 174 # the 'C-c !' command in emacs automatically appends a -i option at the end.
175 175 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
176 176 'gthread! qthread! wthread! pylab! tk!')
177 177
178 178 # Build the actual name list to be used by DPyGetOpt
179 179 opts_names = qw(cmdline_opts) + qw(cmdline_only)
180 180
181 181 # Set sensible command line defaults.
182 182 # This should have everything from cmdline_opts and cmdline_only
183 183 opts_def = Struct(autocall = 1,
184 autoedit_syntax = 1,
184 autoedit_syntax = 0,
185 185 autoindent=0,
186 186 automagic = 1,
187 187 banner = 1,
188 188 cache_size = 1000,
189 189 c = '',
190 190 classic = 0,
191 191 colors = 'NoColor',
192 192 color_info = 0,
193 193 confirm_exit = 1,
194 194 debug = 0,
195 195 deep_reload = 0,
196 196 editor = '0',
197 197 help = 0,
198 198 ignore = 0,
199 199 ipythondir = ipythondir,
200 200 log = 0,
201 201 logfile = '',
202 202 logplay = '',
203 203 multi_line_specials = 1,
204 204 messages = 1,
205 205 nosep = 0,
206 206 pdb = 0,
207 207 pprint = 0,
208 208 profile = '',
209 209 prompt_in1 = 'In [\\#]: ',
210 210 prompt_in2 = ' .\\D.: ',
211 211 prompt_out = 'Out[\\#]: ',
212 212 prompts_pad_left = 1,
213 213 quick = 0,
214 214 readline = 1,
215 215 readline_merge_completions = 1,
216 216 readline_omit__names = 0,
217 217 rcfile = 'ipythonrc' + rc_suffix,
218 218 screen_length = 0,
219 219 separate_in = '\n',
220 220 separate_out = '\n',
221 221 separate_out2 = '',
222 222 system_verbose = 0,
223 223 gthread = 0,
224 224 qthread = 0,
225 225 wthread = 0,
226 226 pylab = 0,
227 227 tk = 0,
228 228 upgrade = 0,
229 229 Version = 0,
230 230 xmode = 'Verbose',
231 231 wildcards_case_sensitive = 1,
232 232 wxversion = '0',
233 233 magic_docstrings = 0, # undocumented, for doc generation
234 234 )
235 235
236 236 # Things that will *only* appear in rcfiles (not at the command line).
237 237 # Make sure there's a space before each end of line (they get auto-joined!)
238 238 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
239 239 qw_lol: 'import_some ',
240 240 # for things with embedded whitespace:
241 241 list_strings:'execute alias readline_parse_and_bind ',
242 242 # Regular strings need no conversion:
243 243 None:'readline_remove_delims ',
244 244 }
245 245 # Default values for these
246 246 rc_def = Struct(include = [],
247 247 import_mod = [],
248 248 import_all = [],
249 249 import_some = [[]],
250 250 execute = [],
251 251 execfile = [],
252 252 alias = [],
253 253 readline_parse_and_bind = [],
254 254 readline_remove_delims = '',
255 255 )
256 256
257 257 # Build the type conversion dictionary from the above tables:
258 258 typeconv = rcfile_opts.copy()
259 259 typeconv.update(optstr2types(cmdline_opts))
260 260
261 261 # FIXME: the None key appears in both, put that back together by hand. Ugly!
262 262 typeconv[None] += ' ' + rcfile_opts[None]
263 263
264 264 # Remove quotes at ends of all strings (used to protect spaces)
265 265 typeconv[unquote_ends] = typeconv[None]
266 266 del typeconv[None]
267 267
268 268 # Build the list we'll use to make all config decisions with defaults:
269 269 opts_all = opts_def.copy()
270 270 opts_all.update(rc_def)
271 271
272 272 # Build conflict resolver for recursive loading of config files:
273 273 # - preserve means the outermost file maintains the value, it is not
274 274 # overwritten if an included file has the same key.
275 275 # - add_flip applies + to the two values, so it better make sense to add
276 276 # those types of keys. But it flips them first so that things loaded
277 277 # deeper in the inclusion chain have lower precedence.
278 278 conflict = {'preserve': ' '.join([ typeconv[int],
279 279 typeconv[unquote_ends] ]),
280 280 'add_flip': ' '.join([ typeconv[qwflat],
281 281 typeconv[qw_lol],
282 282 typeconv[list_strings] ])
283 283 }
284 284
285 285 # Now actually process the command line
286 286 getopt = DPyGetOpt.DPyGetOpt()
287 287 getopt.setIgnoreCase(0)
288 288
289 289 getopt.parseConfiguration(opts_names)
290 290
291 291 try:
292 292 getopt.processArguments(argv)
293 293 except:
294 294 print cmd_line_usage
295 295 warn('\nError in Arguments: ' + `sys.exc_value`)
296 296 sys.exit(1)
297 297
298 298 # convert the options dict to a struct for much lighter syntax later
299 299 opts = Struct(getopt.optionValues)
300 300 args = getopt.freeValues
301 301
302 302 # this is the struct (which has default values at this point) with which
303 303 # we make all decisions:
304 304 opts_all.update(opts)
305 305
306 306 # Options that force an immediate exit
307 307 if opts_all.help:
308 308 page(cmd_line_usage)
309 309 sys.exit()
310 310
311 311 if opts_all.Version:
312 312 print __version__
313 313 sys.exit()
314 314
315 315 if opts_all.magic_docstrings:
316 316 IP.magic_magic('-latex')
317 317 sys.exit()
318 318
319 319 # Create user config directory if it doesn't exist. This must be done
320 320 # *after* getting the cmd line options.
321 321 if not os.path.isdir(opts_all.ipythondir):
322 322 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
323 323
324 324 # upgrade user config files while preserving a copy of the originals
325 325 if opts_all.upgrade:
326 326 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
327 327
328 328 # check mutually exclusive options in the *original* command line
329 329 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
330 330 qw('classic profile'),qw('classic rcfile')])
331 331
332 332 #---------------------------------------------------------------------------
333 333 # Log replay
334 334
335 335 # if -logplay, we need to 'become' the other session. That basically means
336 336 # replacing the current command line environment with that of the old
337 337 # session and moving on.
338 338
339 339 # this is needed so that later we know we're in session reload mode, as
340 340 # opts_all will get overwritten:
341 341 load_logplay = 0
342 342
343 343 if opts_all.logplay:
344 344 load_logplay = opts_all.logplay
345 345 opts_debug_save = opts_all.debug
346 346 try:
347 347 logplay = open(opts_all.logplay)
348 348 except IOError:
349 349 if opts_all.debug: IP.InteractiveTB()
350 350 warn('Could not open logplay file '+`opts_all.logplay`)
351 351 # restore state as if nothing had happened and move on, but make
352 352 # sure that later we don't try to actually load the session file
353 353 logplay = None
354 354 load_logplay = 0
355 355 del opts_all.logplay
356 356 else:
357 357 try:
358 358 logplay.readline()
359 359 logplay.readline();
360 360 # this reloads that session's command line
361 361 cmd = logplay.readline()[6:]
362 362 exec cmd
363 363 # restore the true debug flag given so that the process of
364 364 # session loading itself can be monitored.
365 365 opts.debug = opts_debug_save
366 366 # save the logplay flag so later we don't overwrite the log
367 367 opts.logplay = load_logplay
368 368 # now we must update our own structure with defaults
369 369 opts_all.update(opts)
370 370 # now load args
371 371 cmd = logplay.readline()[6:]
372 372 exec cmd
373 373 logplay.close()
374 374 except:
375 375 logplay.close()
376 376 if opts_all.debug: IP.InteractiveTB()
377 377 warn("Logplay file lacking full configuration information.\n"
378 378 "I'll try to read it, but some things may not work.")
379 379
380 380 #-------------------------------------------------------------------------
381 381 # set up output traps: catch all output from files, being run, modules
382 382 # loaded, etc. Then give it to the user in a clean form at the end.
383 383
384 384 msg_out = 'Output messages. '
385 385 msg_err = 'Error messages. '
386 386 msg_sep = '\n'
387 387 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
388 388 msg_err,msg_sep,debug,
389 389 quiet_out=1),
390 390 user_exec = OutputTrap('User File Execution',msg_out,
391 391 msg_err,msg_sep,debug),
392 392 logplay = OutputTrap('Log Loader',msg_out,
393 393 msg_err,msg_sep,debug),
394 394 summary = ''
395 395 )
396 396
397 397 #-------------------------------------------------------------------------
398 398 # Process user ipythonrc-type configuration files
399 399
400 400 # turn on output trapping and log to msg.config
401 401 # remember that with debug on, trapping is actually disabled
402 402 msg.config.trap_all()
403 403
404 404 # look for rcfile in current or default directory
405 405 try:
406 406 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
407 407 except IOError:
408 408 if opts_all.debug: IP.InteractiveTB()
409 409 warn('Configuration file %s not found. Ignoring request.'
410 410 % (opts_all.rcfile) )
411 411
412 412 # 'profiles' are a shorthand notation for config filenames
413 413 if opts_all.profile:
414 414
415 415 try:
416 416 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
417 417 + rc_suffix,
418 418 opts_all.ipythondir)
419 419 except IOError:
420 420 if opts_all.debug: IP.InteractiveTB()
421 421 opts.profile = '' # remove profile from options if invalid
422 422 # We won't warn anymore, primary method is ipy_profile_PROFNAME
423 423 # which does trigger a warning.
424 424
425 425 # load the config file
426 426 rcfiledata = None
427 427 if opts_all.quick:
428 428 print 'Launching IPython in quick mode. No config file read.'
429 429 elif opts_all.classic:
430 430 print 'Launching IPython in classic mode. No config file read.'
431 431 elif opts_all.rcfile:
432 432 try:
433 433 cfg_loader = ConfigLoader(conflict)
434 434 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
435 435 'include',opts_all.ipythondir,
436 436 purge = 1,
437 437 unique = conflict['preserve'])
438 438 except:
439 439 IP.InteractiveTB()
440 440 warn('Problems loading configuration file '+
441 441 `opts_all.rcfile`+
442 442 '\nStarting with default -bare bones- configuration.')
443 443 else:
444 444 warn('No valid configuration file found in either currrent directory\n'+
445 445 'or in the IPython config. directory: '+`opts_all.ipythondir`+
446 446 '\nProceeding with internal defaults.')
447 447
448 448 #------------------------------------------------------------------------
449 449 # Set exception handlers in mode requested by user.
450 450 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
451 451 IP.magic_xmode(opts_all.xmode)
452 452 otrap.release_out()
453 453
454 454 #------------------------------------------------------------------------
455 455 # Execute user config
456 456
457 457 # Create a valid config structure with the right precedence order:
458 458 # defaults < rcfile < command line. This needs to be in the instance, so
459 459 # that method calls below that rely on it find it.
460 460 IP.rc = rc_def.copy()
461 461
462 462 # Work with a local alias inside this routine to avoid unnecessary
463 463 # attribute lookups.
464 464 IP_rc = IP.rc
465 465
466 466 IP_rc.update(opts_def)
467 467 if rcfiledata:
468 468 # now we can update
469 469 IP_rc.update(rcfiledata)
470 470 IP_rc.update(opts)
471 471 IP_rc.update(rc_override)
472 472
473 473 # Store the original cmd line for reference:
474 474 IP_rc.opts = opts
475 475 IP_rc.args = args
476 476
477 477 # create a *runtime* Struct like rc for holding parameters which may be
478 478 # created and/or modified by runtime user extensions.
479 479 IP.runtime_rc = Struct()
480 480
481 481 # from this point on, all config should be handled through IP_rc,
482 482 # opts* shouldn't be used anymore.
483 483
484 484
485 485 # update IP_rc with some special things that need manual
486 486 # tweaks. Basically options which affect other options. I guess this
487 487 # should just be written so that options are fully orthogonal and we
488 488 # wouldn't worry about this stuff!
489 489
490 490 if IP_rc.classic:
491 491 IP_rc.quick = 1
492 492 IP_rc.cache_size = 0
493 493 IP_rc.pprint = 0
494 494 IP_rc.prompt_in1 = '>>> '
495 495 IP_rc.prompt_in2 = '... '
496 496 IP_rc.prompt_out = ''
497 497 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
498 498 IP_rc.colors = 'NoColor'
499 499 IP_rc.xmode = 'Plain'
500 500
501 501 IP.pre_config_initialization()
502 502 # configure readline
503 503 # Define the history file for saving commands in between sessions
504 504 if IP_rc.profile:
505 505 histfname = 'history-%s' % IP_rc.profile
506 506 else:
507 507 histfname = 'history'
508 508 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
509 509
510 510 # update exception handlers with rc file status
511 511 otrap.trap_out() # I don't want these messages ever.
512 512 IP.magic_xmode(IP_rc.xmode)
513 513 otrap.release_out()
514 514
515 515 # activate logging if requested and not reloading a log
516 516 if IP_rc.logplay:
517 517 IP.magic_logstart(IP_rc.logplay + ' append')
518 518 elif IP_rc.logfile:
519 519 IP.magic_logstart(IP_rc.logfile)
520 520 elif IP_rc.log:
521 521 IP.magic_logstart()
522 522
523 523 # find user editor so that it we don't have to look it up constantly
524 524 if IP_rc.editor.strip()=='0':
525 525 try:
526 526 ed = os.environ['EDITOR']
527 527 except KeyError:
528 528 if os.name == 'posix':
529 529 ed = 'vi' # the only one guaranteed to be there!
530 530 else:
531 531 ed = 'notepad' # same in Windows!
532 532 IP_rc.editor = ed
533 533
534 534 # Keep track of whether this is an embedded instance or not (useful for
535 535 # post-mortems).
536 536 IP_rc.embedded = IP.embedded
537 537
538 538 # Recursive reload
539 539 try:
540 540 from IPython import deep_reload
541 541 if IP_rc.deep_reload:
542 542 __builtin__.reload = deep_reload.reload
543 543 else:
544 544 __builtin__.dreload = deep_reload.reload
545 545 del deep_reload
546 546 except ImportError:
547 547 pass
548 548
549 549 # Save the current state of our namespace so that the interactive shell
550 550 # can later know which variables have been created by us from config files
551 551 # and loading. This way, loading a file (in any way) is treated just like
552 552 # defining things on the command line, and %who works as expected.
553 553
554 554 # DON'T do anything that affects the namespace beyond this point!
555 555 IP.internal_ns.update(__main__.__dict__)
556 556
557 557 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
558 558
559 559 # Now run through the different sections of the users's config
560 560 if IP_rc.debug:
561 561 print 'Trying to execute the following configuration structure:'
562 562 print '(Things listed first are deeper in the inclusion tree and get'
563 563 print 'loaded first).\n'
564 564 pprint(IP_rc.__dict__)
565 565
566 566 for mod in IP_rc.import_mod:
567 567 try:
568 568 exec 'import '+mod in IP.user_ns
569 569 except :
570 570 IP.InteractiveTB()
571 571 import_fail_info(mod)
572 572
573 573 for mod_fn in IP_rc.import_some:
574 574 if mod_fn == []: break
575 575 mod,fn = mod_fn[0],','.join(mod_fn[1:])
576 576 try:
577 577 exec 'from '+mod+' import '+fn in IP.user_ns
578 578 except :
579 579 IP.InteractiveTB()
580 580 import_fail_info(mod,fn)
581 581
582 582 for mod in IP_rc.import_all:
583 583 try:
584 584 exec 'from '+mod+' import *' in IP.user_ns
585 585 except :
586 586 IP.InteractiveTB()
587 587 import_fail_info(mod)
588 588
589 589 for code in IP_rc.execute:
590 590 try:
591 591 exec code in IP.user_ns
592 592 except:
593 593 IP.InteractiveTB()
594 594 warn('Failure executing code: ' + `code`)
595 595
596 596 # Execute the files the user wants in ipythonrc
597 597 for file in IP_rc.execfile:
598 598 try:
599 599 file = filefind(file,sys.path+[IPython_dir])
600 600 except IOError:
601 601 warn(itpl('File $file not found. Skipping it.'))
602 602 else:
603 603 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
604 604
605 605 # finally, try importing ipy_*_conf for final configuration
606 606 try:
607 607 import ipy_system_conf
608 608 except ImportError:
609 609 if opts_all.debug: IP.InteractiveTB()
610 610 warn("Could not import 'ipy_system_conf'")
611 611 except:
612 612 IP.InteractiveTB()
613 613 import_fail_info('ipy_system_conf')
614 614
615 615 if opts_all.profile:
616 616 profmodname = 'ipy_profile_' + opts_all.profile
617 617 try:
618 618 __import__(profmodname)
619 619 except ImportError:
620 620 # only warn if ipythonrc-PROFNAME didn't exist
621 621 if opts.profile =='':
622 622 warn("Could not start with profile '%s'!\n ('%s/%s.py' does not exist? run '%%upgrade')" % (
623 623 opts_all.profile, ipythondir, profmodname)
624 624
625 625 )
626 626 except:
627 627 print "Error importing",profmodname
628 628 IP.InteractiveTB()
629 629 import_fail_info(profmodname)
630 630
631 631 try:
632 632 import ipy_user_conf
633 633 except ImportError:
634 634 if opts_all.debug: IP.InteractiveTB()
635 635 warn("Could not import user config!\n ('%s/ipy_user_conf.py' does not exist? Please run '%%upgrade')\n" %
636 636 ipythondir)
637 637 except:
638 638 print "Error importing ipy_user_conf"
639 639 IP.InteractiveTB()
640 640 import_fail_info("ipy_user_conf")
641 641
642 642
643 643 # release stdout and stderr and save config log into a global summary
644 644 msg.config.release_all()
645 645 if IP_rc.messages:
646 646 msg.summary += msg.config.summary_all()
647 647
648 648 #------------------------------------------------------------------------
649 649 # Setup interactive session
650 650
651 651 # Now we should be fully configured. We can then execute files or load
652 652 # things only needed for interactive use. Then we'll open the shell.
653 653
654 654 # Take a snapshot of the user namespace before opening the shell. That way
655 655 # we'll be able to identify which things were interactively defined and
656 656 # which were defined through config files.
657 657 IP.user_config_ns = IP.user_ns.copy()
658 658
659 659 # Force reading a file as if it were a session log. Slower but safer.
660 660 if load_logplay:
661 661 print 'Replaying log...'
662 662 try:
663 663 if IP_rc.debug:
664 664 logplay_quiet = 0
665 665 else:
666 666 logplay_quiet = 1
667 667
668 668 msg.logplay.trap_all()
669 669 IP.safe_execfile(load_logplay,IP.user_ns,
670 670 islog = 1, quiet = logplay_quiet)
671 671 msg.logplay.release_all()
672 672 if IP_rc.messages:
673 673 msg.summary += msg.logplay.summary_all()
674 674 except:
675 675 warn('Problems replaying logfile %s.' % load_logplay)
676 676 IP.InteractiveTB()
677 677
678 678 # Load remaining files in command line
679 679 msg.user_exec.trap_all()
680 680
681 681 # Do NOT execute files named in the command line as scripts to be loaded
682 682 # by embedded instances. Doing so has the potential for an infinite
683 683 # recursion if there are exceptions thrown in the process.
684 684
685 685 # XXX FIXME: the execution of user files should be moved out to after
686 686 # ipython is fully initialized, just as if they were run via %run at the
687 687 # ipython prompt. This would also give them the benefit of ipython's
688 688 # nice tracebacks.
689 689
690 690 if (not embedded and IP_rc.args and
691 691 not IP_rc.args[0].lower().endswith('.ipy')):
692 692 name_save = IP.user_ns['__name__']
693 693 IP.user_ns['__name__'] = '__main__'
694 694 # Set our own excepthook in case the user code tries to call it
695 695 # directly. This prevents triggering the IPython crash handler.
696 696 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
697 697
698 698 save_argv = sys.argv[:] # save it for later restoring
699 699
700 700 sys.argv = args
701 701
702 702 try:
703 703 IP.safe_execfile(args[0], IP.user_ns)
704 704 finally:
705 705 # Reset our crash handler in place
706 706 sys.excepthook = old_excepthook
707 707 sys.argv = save_argv
708 708 IP.user_ns['__name__'] = name_save
709 709
710 710 msg.user_exec.release_all()
711 711 if IP_rc.messages:
712 712 msg.summary += msg.user_exec.summary_all()
713 713
714 714 # since we can't specify a null string on the cmd line, 0 is the equivalent:
715 715 if IP_rc.nosep:
716 716 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
717 717 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
718 718 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
719 719 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
720 720 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
721 721 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
722 722 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
723 723
724 724 # Determine how many lines at the bottom of the screen are needed for
725 725 # showing prompts, so we can know wheter long strings are to be printed or
726 726 # paged:
727 727 num_lines_bot = IP_rc.separate_in.count('\n')+1
728 728 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
729 729
730 730 # configure startup banner
731 731 if IP_rc.c: # regular python doesn't print the banner with -c
732 732 IP_rc.banner = 0
733 733 if IP_rc.banner:
734 734 BANN_P = IP.BANNER_PARTS
735 735 else:
736 736 BANN_P = []
737 737
738 738 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
739 739
740 740 # add message log (possibly empty)
741 741 if msg.summary: BANN_P.append(msg.summary)
742 742 # Final banner is a string
743 743 IP.BANNER = '\n'.join(BANN_P)
744 744
745 745 # Finalize the IPython instance. This assumes the rc structure is fully
746 746 # in place.
747 747 IP.post_config_initialization()
748 748
749 749 return IP
750 750 #************************ end of file <ipmaker.py> **************************
@@ -1,5407 +1,5420 b''
1 1 2006-05-24 Fernando Perez <Fernando.Perez@colorado.edu>
2 2
3 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
4 python-mode recognizes our debugger mode.
5
6 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
7 tracebacks when walking the stack so that the stack tracking system
8 in emacs' python-mode can identify the frames correctly.
9
10 * IPython/ipmaker.py (make_IPython): make the internal (and
11 default config) autoedit_syntax value false by default. Too many
12 users have complained to me (both on and off-list) about problems
13 with this option being on by default, so I'm making it default to
14 off. It can still be enabled by anyone via the usual mechanisms.
15
3 16 * IPython/completer.py (Completer.attr_matches): add support for
4 17 PyCrust-style _getAttributeNames magic method. Patch contributed
5 18 by <mscott-AT-goldenspud.com>. Closes #50.
6 19
7 20 * IPython/iplib.py (InteractiveShell.__init__): remove the
8 21 deletion of exit/quit from __builtin__, which can break
9 22 third-party tools like the Zope debugging console. The
10 23 %exit/%quit magics remain. In general, it's probably a good idea
11 24 not to delete anything from __builtin__, since we never know what
12 25 that will break. In any case, python now (for 2.5) will support
13 26 'real' exit/quit, so this issue is moot. Closes #55.
14 27
15 28 * IPython/genutils.py (with_obj): rename the 'with' function to
16 29 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
17 30 becomes a language keyword. Closes #53.
18 31
19 32 * IPython/FakeModule.py (FakeModule.__init__): add a proper
20 33 __file__ attribute to this so it fools more things into thinking
21 34 it is a real module. Closes #59.
22 35
23 36 * IPython/Magic.py (magic_edit): add -n option to open the editor
24 37 at a specific line number. After a patch by Stefan van der Walt.
25 38
26 39 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
27 40
28 41 * IPython/iplib.py (edit_syntax_error): fix crash when for some
29 42 reason the file could not be opened. After automatic crash
30 43 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
31 44 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
32 45 (_should_recompile): Don't fire editor if using %bg, since there
33 46 is no file in the first place. From the same report as above.
34 47 (raw_input): protect against faulty third-party prefilters. After
35 48 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
36 49 while running under SAGE.
37 50
38 51 2006-05-23 Ville Vainio <vivainio@gmail.com>
39 52
40 53 * ipapi.py: Stripped down ip.to_user_ns() to work only as
41 54 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
42 55 now returns None (again), unless dummy is specifically allowed by
43 56 ipapi.get(allow_dummy=True).
44 57
45 58 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
46 59
47 60 * IPython: remove all 2.2-compatibility objects and hacks from
48 61 everywhere, since we only support 2.3 at this point. Docs
49 62 updated.
50 63
51 64 * IPython/ipapi.py (IPApi.__init__): Clean up of all getters.
52 65 Anything requiring extra validation can be turned into a Python
53 66 property in the future. I used a property for the db one b/c
54 67 there was a nasty circularity problem with the initialization
55 68 order, which right now I don't have time to clean up.
56 69
57 70 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
58 71 another locking bug reported by Jorgen. I'm not 100% sure though,
59 72 so more testing is needed...
60 73
61 74 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
62 75
63 76 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
64 77 local variables from any routine in user code (typically executed
65 78 with %run) directly into the interactive namespace. Very useful
66 79 when doing complex debugging.
67 80 (IPythonNotRunning): Changed the default None object to a dummy
68 81 whose attributes can be queried as well as called without
69 82 exploding, to ease writing code which works transparently both in
70 83 and out of ipython and uses some of this API.
71 84
72 85 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
73 86
74 87 * IPython/hooks.py (result_display): Fix the fact that our display
75 88 hook was using str() instead of repr(), as the default python
76 89 console does. This had gone unnoticed b/c it only happened if
77 90 %Pprint was off, but the inconsistency was there.
78 91
79 92 2006-05-15 Ville Vainio <vivainio@gmail.com>
80 93
81 94 * Oinspect.py: Only show docstring for nonexisting/binary files
82 95 when doing object??, closing ticket #62
83 96
84 97 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
85 98
86 99 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
87 100 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
88 101 was being released in a routine which hadn't checked if it had
89 102 been the one to acquire it.
90 103
91 104 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
92 105
93 106 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
94 107
95 108 2006-04-11 Ville Vainio <vivainio@gmail.com>
96 109
97 110 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
98 111 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
99 112 prefilters, allowing stuff like magics and aliases in the file.
100 113
101 114 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
102 115 added. Supported now are "%clear in" and "%clear out" (clear input and
103 116 output history, respectively). Also fixed CachedOutput.flush to
104 117 properly flush the output cache.
105 118
106 119 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
107 120 half-success (and fail explicitly).
108 121
109 122 2006-03-28 Ville Vainio <vivainio@gmail.com>
110 123
111 124 * iplib.py: Fix quoting of aliases so that only argless ones
112 125 are quoted
113 126
114 127 2006-03-28 Ville Vainio <vivainio@gmail.com>
115 128
116 129 * iplib.py: Quote aliases with spaces in the name.
117 130 "c:\program files\blah\bin" is now legal alias target.
118 131
119 132 * ext_rehashdir.py: Space no longer allowed as arg
120 133 separator, since space is legal in path names.
121 134
122 135 2006-03-16 Ville Vainio <vivainio@gmail.com>
123 136
124 137 * upgrade_dir.py: Take path.py from Extensions, correcting
125 138 %upgrade magic
126 139
127 140 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
128 141
129 142 * hooks.py: Only enclose editor binary in quotes if legal and
130 143 necessary (space in the name, and is an existing file). Fixes a bug
131 144 reported by Zachary Pincus.
132 145
133 146 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
134 147
135 148 * Manual: thanks to a tip on proper color handling for Emacs, by
136 149 Eric J Haywiser <ejh1-AT-MIT.EDU>.
137 150
138 151 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
139 152 by applying the provided patch. Thanks to Liu Jin
140 153 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
141 154 XEmacs/Linux, I'm trusting the submitter that it actually helps
142 155 under win32/GNU Emacs. Will revisit if any problems are reported.
143 156
144 157 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
145 158
146 159 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
147 160 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
148 161
149 162 2006-03-12 Ville Vainio <vivainio@gmail.com>
150 163
151 164 * Magic.py (magic_timeit): Added %timeit magic, contributed by
152 165 Torsten Marek.
153 166
154 167 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
155 168
156 169 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
157 170 line ranges works again.
158 171
159 172 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
160 173
161 174 * IPython/iplib.py (showtraceback): add back sys.last_traceback
162 175 and friends, after a discussion with Zach Pincus on ipython-user.
163 176 I'm not 100% sure, but after thinking aobut it quite a bit, it may
164 177 be OK. Testing with the multithreaded shells didn't reveal any
165 178 problems, but let's keep an eye out.
166 179
167 180 In the process, I fixed a few things which were calling
168 181 self.InteractiveTB() directly (like safe_execfile), which is a
169 182 mistake: ALL exception reporting should be done by calling
170 183 self.showtraceback(), which handles state and tab-completion and
171 184 more.
172 185
173 186 2006-03-01 Ville Vainio <vivainio@gmail.com>
174 187
175 188 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
176 189 To use, do "from ipipe import *".
177 190
178 191 2006-02-24 Ville Vainio <vivainio@gmail.com>
179 192
180 193 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
181 194 "cleanly" and safely than the older upgrade mechanism.
182 195
183 196 2006-02-21 Ville Vainio <vivainio@gmail.com>
184 197
185 198 * Magic.py: %save works again.
186 199
187 200 2006-02-15 Ville Vainio <vivainio@gmail.com>
188 201
189 202 * Magic.py: %Pprint works again
190 203
191 204 * Extensions/ipy_sane_defaults.py: Provide everything provided
192 205 in default ipythonrc, to make it possible to have a completely empty
193 206 ipythonrc (and thus completely rc-file free configuration)
194 207
195 208
196 209 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
197 210
198 211 * IPython/hooks.py (editor): quote the call to the editor command,
199 212 to allow commands with spaces in them. Problem noted by watching
200 213 Ian Oswald's video about textpad under win32 at
201 214 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
202 215
203 216 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
204 217 describing magics (we haven't used @ for a loong time).
205 218
206 219 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
207 220 contributed by marienz to close
208 221 http://www.scipy.net/roundup/ipython/issue53.
209 222
210 223 2006-02-10 Ville Vainio <vivainio@gmail.com>
211 224
212 225 * genutils.py: getoutput now works in win32 too
213 226
214 227 * completer.py: alias and magic completion only invoked
215 228 at the first "item" in the line, to avoid "cd %store"
216 229 nonsense.
217 230
218 231 2006-02-09 Ville Vainio <vivainio@gmail.com>
219 232
220 233 * test/*: Added a unit testing framework (finally).
221 234 '%run runtests.py' to run test_*.
222 235
223 236 * ipapi.py: Exposed runlines and set_custom_exc
224 237
225 238 2006-02-07 Ville Vainio <vivainio@gmail.com>
226 239
227 240 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
228 241 instead use "f(1 2)" as before.
229 242
230 243 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
231 244
232 245 * IPython/demo.py (IPythonDemo): Add new classes to the demo
233 246 facilities, for demos processed by the IPython input filter
234 247 (IPythonDemo), and for running a script one-line-at-a-time as a
235 248 demo, both for pure Python (LineDemo) and for IPython-processed
236 249 input (IPythonLineDemo). After a request by Dave Kohel, from the
237 250 SAGE team.
238 251 (Demo.edit): added and edit() method to the demo objects, to edit
239 252 the in-memory copy of the last executed block.
240 253
241 254 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
242 255 processing to %edit, %macro and %save. These commands can now be
243 256 invoked on the unprocessed input as it was typed by the user
244 257 (without any prefilters applied). After requests by the SAGE team
245 258 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
246 259
247 260 2006-02-01 Ville Vainio <vivainio@gmail.com>
248 261
249 262 * setup.py, eggsetup.py: easy_install ipython==dev works
250 263 correctly now (on Linux)
251 264
252 265 * ipy_user_conf,ipmaker: user config changes, removed spurious
253 266 warnings
254 267
255 268 * iplib: if rc.banner is string, use it as is.
256 269
257 270 * Magic: %pycat accepts a string argument and pages it's contents.
258 271
259 272
260 273 2006-01-30 Ville Vainio <vivainio@gmail.com>
261 274
262 275 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
263 276 Now %store and bookmarks work through PickleShare, meaning that
264 277 concurrent access is possible and all ipython sessions see the
265 278 same database situation all the time, instead of snapshot of
266 279 the situation when the session was started. Hence, %bookmark
267 280 results are immediately accessible from othes sessions. The database
268 281 is also available for use by user extensions. See:
269 282 http://www.python.org/pypi/pickleshare
270 283
271 284 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
272 285
273 286 * aliases can now be %store'd
274 287
275 288 * path.py move to Extensions so that pickleshare does not need
276 289 IPython-specific import. Extensions added to pythonpath right
277 290 at __init__.
278 291
279 292 * iplib.py: ipalias deprecated/redundant; aliases are converted and
280 293 called with _ip.system and the pre-transformed command string.
281 294
282 295 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
283 296
284 297 * IPython/iplib.py (interact): Fix that we were not catching
285 298 KeyboardInterrupt exceptions properly. I'm not quite sure why the
286 299 logic here had to change, but it's fixed now.
287 300
288 301 2006-01-29 Ville Vainio <vivainio@gmail.com>
289 302
290 303 * iplib.py: Try to import pyreadline on Windows.
291 304
292 305 2006-01-27 Ville Vainio <vivainio@gmail.com>
293 306
294 307 * iplib.py: Expose ipapi as _ip in builtin namespace.
295 308 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
296 309 and ip_set_hook (-> _ip.set_hook) redundant. % and !
297 310 syntax now produce _ip.* variant of the commands.
298 311
299 312 * "_ip.options().autoedit_syntax = 2" automatically throws
300 313 user to editor for syntax error correction without prompting.
301 314
302 315 2006-01-27 Ville Vainio <vivainio@gmail.com>
303 316
304 317 * ipmaker.py: Give "realistic" sys.argv for scripts (without
305 318 'ipython' at argv[0]) executed through command line.
306 319 NOTE: this DEPRECATES calling ipython with multiple scripts
307 320 ("ipython a.py b.py c.py")
308 321
309 322 * iplib.py, hooks.py: Added configurable input prefilter,
310 323 named 'input_prefilter'. See ext_rescapture.py for example
311 324 usage.
312 325
313 326 * ext_rescapture.py, Magic.py: Better system command output capture
314 327 through 'var = !ls' (deprecates user-visible %sc). Same notation
315 328 applies for magics, 'var = %alias' assigns alias list to var.
316 329
317 330 * ipapi.py: added meta() for accessing extension-usable data store.
318 331
319 332 * iplib.py: added InteractiveShell.getapi(). New magics should be
320 333 written doing self.getapi() instead of using the shell directly.
321 334
322 335 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
323 336 %store foo >> ~/myfoo.txt to store variables to files (in clean
324 337 textual form, not a restorable pickle).
325 338
326 339 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
327 340
328 341 * usage.py, Magic.py: added %quickref
329 342
330 343 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
331 344
332 345 * GetoptErrors when invoking magics etc. with wrong args
333 346 are now more helpful:
334 347 GetoptError: option -l not recognized (allowed: "qb" )
335 348
336 349 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
337 350
338 351 * IPython/demo.py (Demo.show): Flush stdout after each block, so
339 352 computationally intensive blocks don't appear to stall the demo.
340 353
341 354 2006-01-24 Ville Vainio <vivainio@gmail.com>
342 355
343 356 * iplib.py, hooks.py: 'result_display' hook can return a non-None
344 357 value to manipulate resulting history entry.
345 358
346 359 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
347 360 to instance methods of IPApi class, to make extending an embedded
348 361 IPython feasible. See ext_rehashdir.py for example usage.
349 362
350 363 * Merged 1071-1076 from banches/0.7.1
351 364
352 365
353 366 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
354 367
355 368 * tools/release (daystamp): Fix build tools to use the new
356 369 eggsetup.py script to build lightweight eggs.
357 370
358 371 * Applied changesets 1062 and 1064 before 0.7.1 release.
359 372
360 373 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
361 374 see the raw input history (without conversions like %ls ->
362 375 ipmagic("ls")). After a request from W. Stein, SAGE
363 376 (http://modular.ucsd.edu/sage) developer. This information is
364 377 stored in the input_hist_raw attribute of the IPython instance, so
365 378 developers can access it if needed (it's an InputList instance).
366 379
367 380 * Versionstring = 0.7.2.svn
368 381
369 382 * eggsetup.py: A separate script for constructing eggs, creates
370 383 proper launch scripts even on Windows (an .exe file in
371 384 \python24\scripts).
372 385
373 386 * ipapi.py: launch_new_instance, launch entry point needed for the
374 387 egg.
375 388
376 389 2006-01-23 Ville Vainio <vivainio@gmail.com>
377 390
378 391 * Added %cpaste magic for pasting python code
379 392
380 393 2006-01-22 Ville Vainio <vivainio@gmail.com>
381 394
382 395 * Merge from branches/0.7.1 into trunk, revs 1052-1057
383 396
384 397 * Versionstring = 0.7.2.svn
385 398
386 399 * eggsetup.py: A separate script for constructing eggs, creates
387 400 proper launch scripts even on Windows (an .exe file in
388 401 \python24\scripts).
389 402
390 403 * ipapi.py: launch_new_instance, launch entry point needed for the
391 404 egg.
392 405
393 406 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
394 407
395 408 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
396 409 %pfile foo would print the file for foo even if it was a binary.
397 410 Now, extensions '.so' and '.dll' are skipped.
398 411
399 412 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
400 413 bug, where macros would fail in all threaded modes. I'm not 100%
401 414 sure, so I'm going to put out an rc instead of making a release
402 415 today, and wait for feedback for at least a few days.
403 416
404 417 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
405 418 it...) the handling of pasting external code with autoindent on.
406 419 To get out of a multiline input, the rule will appear for most
407 420 users unchanged: two blank lines or change the indent level
408 421 proposed by IPython. But there is a twist now: you can
409 422 add/subtract only *one or two spaces*. If you add/subtract three
410 423 or more (unless you completely delete the line), IPython will
411 424 accept that line, and you'll need to enter a second one of pure
412 425 whitespace. I know it sounds complicated, but I can't find a
413 426 different solution that covers all the cases, with the right
414 427 heuristics. Hopefully in actual use, nobody will really notice
415 428 all these strange rules and things will 'just work'.
416 429
417 430 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
418 431
419 432 * IPython/iplib.py (interact): catch exceptions which can be
420 433 triggered asynchronously by signal handlers. Thanks to an
421 434 automatic crash report, submitted by Colin Kingsley
422 435 <tercel-AT-gentoo.org>.
423 436
424 437 2006-01-20 Ville Vainio <vivainio@gmail.com>
425 438
426 439 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
427 440 (%rehashdir, very useful, try it out) of how to extend ipython
428 441 with new magics. Also added Extensions dir to pythonpath to make
429 442 importing extensions easy.
430 443
431 444 * %store now complains when trying to store interactively declared
432 445 classes / instances of those classes.
433 446
434 447 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
435 448 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
436 449 if they exist, and ipy_user_conf.py with some defaults is created for
437 450 the user.
438 451
439 452 * Startup rehashing done by the config file, not InterpreterExec.
440 453 This means system commands are available even without selecting the
441 454 pysh profile. It's the sensible default after all.
442 455
443 456 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
444 457
445 458 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
446 459 multiline code with autoindent on working. But I am really not
447 460 sure, so this needs more testing. Will commit a debug-enabled
448 461 version for now, while I test it some more, so that Ville and
449 462 others may also catch any problems. Also made
450 463 self.indent_current_str() a method, to ensure that there's no
451 464 chance of the indent space count and the corresponding string
452 465 falling out of sync. All code needing the string should just call
453 466 the method.
454 467
455 468 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
456 469
457 470 * IPython/Magic.py (magic_edit): fix check for when users don't
458 471 save their output files, the try/except was in the wrong section.
459 472
460 473 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
461 474
462 475 * IPython/Magic.py (magic_run): fix __file__ global missing from
463 476 script's namespace when executed via %run. After a report by
464 477 Vivian.
465 478
466 479 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
467 480 when using python 2.4. The parent constructor changed in 2.4, and
468 481 we need to track it directly (we can't call it, as it messes up
469 482 readline and tab-completion inside our pdb would stop working).
470 483 After a bug report by R. Bernstein <rocky-AT-panix.com>.
471 484
472 485 2006-01-16 Ville Vainio <vivainio@gmail.com>
473 486
474 487 * Ipython/magic.py:Reverted back to old %edit functionality
475 488 that returns file contents on exit.
476 489
477 490 * IPython/path.py: Added Jason Orendorff's "path" module to
478 491 IPython tree, http://www.jorendorff.com/articles/python/path/.
479 492 You can get path objects conveniently through %sc, and !!, e.g.:
480 493 sc files=ls
481 494 for p in files.paths: # or files.p
482 495 print p,p.mtime
483 496
484 497 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
485 498 now work again without considering the exclusion regexp -
486 499 hence, things like ',foo my/path' turn to 'foo("my/path")'
487 500 instead of syntax error.
488 501
489 502
490 503 2006-01-14 Ville Vainio <vivainio@gmail.com>
491 504
492 505 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
493 506 ipapi decorators for python 2.4 users, options() provides access to rc
494 507 data.
495 508
496 509 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
497 510 as path separators (even on Linux ;-). Space character after
498 511 backslash (as yielded by tab completer) is still space;
499 512 "%cd long\ name" works as expected.
500 513
501 514 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
502 515 as "chain of command", with priority. API stays the same,
503 516 TryNext exception raised by a hook function signals that
504 517 current hook failed and next hook should try handling it, as
505 518 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
506 519 requested configurable display hook, which is now implemented.
507 520
508 521 2006-01-13 Ville Vainio <vivainio@gmail.com>
509 522
510 523 * IPython/platutils*.py: platform specific utility functions,
511 524 so far only set_term_title is implemented (change terminal
512 525 label in windowing systems). %cd now changes the title to
513 526 current dir.
514 527
515 528 * IPython/Release.py: Added myself to "authors" list,
516 529 had to create new files.
517 530
518 531 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
519 532 shell escape; not a known bug but had potential to be one in the
520 533 future.
521 534
522 535 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
523 536 extension API for IPython! See the module for usage example. Fix
524 537 OInspect for docstring-less magic functions.
525 538
526 539
527 540 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
528 541
529 542 * IPython/iplib.py (raw_input): temporarily deactivate all
530 543 attempts at allowing pasting of code with autoindent on. It
531 544 introduced bugs (reported by Prabhu) and I can't seem to find a
532 545 robust combination which works in all cases. Will have to revisit
533 546 later.
534 547
535 548 * IPython/genutils.py: remove isspace() function. We've dropped
536 549 2.2 compatibility, so it's OK to use the string method.
537 550
538 551 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
539 552
540 553 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
541 554 matching what NOT to autocall on, to include all python binary
542 555 operators (including things like 'and', 'or', 'is' and 'in').
543 556 Prompted by a bug report on 'foo & bar', but I realized we had
544 557 many more potential bug cases with other operators. The regexp is
545 558 self.re_exclude_auto, it's fairly commented.
546 559
547 560 2006-01-12 Ville Vainio <vivainio@gmail.com>
548 561
549 562 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
550 563 Prettified and hardened string/backslash quoting with ipsystem(),
551 564 ipalias() and ipmagic(). Now even \ characters are passed to
552 565 %magics, !shell escapes and aliases exactly as they are in the
553 566 ipython command line. Should improve backslash experience,
554 567 particularly in Windows (path delimiter for some commands that
555 568 won't understand '/'), but Unix benefits as well (regexps). %cd
556 569 magic still doesn't support backslash path delimiters, though. Also
557 570 deleted all pretense of supporting multiline command strings in
558 571 !system or %magic commands. Thanks to Jerry McRae for suggestions.
559 572
560 573 * doc/build_doc_instructions.txt added. Documentation on how to
561 574 use doc/update_manual.py, added yesterday. Both files contributed
562 575 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
563 576 doc/*.sh for deprecation at a later date.
564 577
565 578 * /ipython.py Added ipython.py to root directory for
566 579 zero-installation (tar xzvf ipython.tgz; cd ipython; python
567 580 ipython.py) and development convenience (no need to kee doing
568 581 "setup.py install" between changes).
569 582
570 583 * Made ! and !! shell escapes work (again) in multiline expressions:
571 584 if 1:
572 585 !ls
573 586 !!ls
574 587
575 588 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
576 589
577 590 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
578 591 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
579 592 module in case-insensitive installation. Was causing crashes
580 593 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
581 594
582 595 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
583 596 <marienz-AT-gentoo.org>, closes
584 597 http://www.scipy.net/roundup/ipython/issue51.
585 598
586 599 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
587 600
588 601 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
589 602 problem of excessive CPU usage under *nix and keyboard lag under
590 603 win32.
591 604
592 605 2006-01-10 *** Released version 0.7.0
593 606
594 607 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
595 608
596 609 * IPython/Release.py (revision): tag version number to 0.7.0,
597 610 ready for release.
598 611
599 612 * IPython/Magic.py (magic_edit): Add print statement to %edit so
600 613 it informs the user of the name of the temp. file used. This can
601 614 help if you decide later to reuse that same file, so you know
602 615 where to copy the info from.
603 616
604 617 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
605 618
606 619 * setup_bdist_egg.py: little script to build an egg. Added
607 620 support in the release tools as well.
608 621
609 622 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
610 623
611 624 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
612 625 version selection (new -wxversion command line and ipythonrc
613 626 parameter). Patch contributed by Arnd Baecker
614 627 <arnd.baecker-AT-web.de>.
615 628
616 629 * IPython/iplib.py (embed_mainloop): fix tab-completion in
617 630 embedded instances, for variables defined at the interactive
618 631 prompt of the embedded ipython. Reported by Arnd.
619 632
620 633 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
621 634 it can be used as a (stateful) toggle, or with a direct parameter.
622 635
623 636 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
624 637 could be triggered in certain cases and cause the traceback
625 638 printer not to work.
626 639
627 640 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
628 641
629 642 * IPython/iplib.py (_should_recompile): Small fix, closes
630 643 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
631 644
632 645 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
633 646
634 647 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
635 648 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
636 649 Moad for help with tracking it down.
637 650
638 651 * IPython/iplib.py (handle_auto): fix autocall handling for
639 652 objects which support BOTH __getitem__ and __call__ (so that f [x]
640 653 is left alone, instead of becoming f([x]) automatically).
641 654
642 655 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
643 656 Ville's patch.
644 657
645 658 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
646 659
647 660 * IPython/iplib.py (handle_auto): changed autocall semantics to
648 661 include 'smart' mode, where the autocall transformation is NOT
649 662 applied if there are no arguments on the line. This allows you to
650 663 just type 'foo' if foo is a callable to see its internal form,
651 664 instead of having it called with no arguments (typically a
652 665 mistake). The old 'full' autocall still exists: for that, you
653 666 need to set the 'autocall' parameter to 2 in your ipythonrc file.
654 667
655 668 * IPython/completer.py (Completer.attr_matches): add
656 669 tab-completion support for Enthoughts' traits. After a report by
657 670 Arnd and a patch by Prabhu.
658 671
659 672 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
660 673
661 674 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
662 675 Schmolck's patch to fix inspect.getinnerframes().
663 676
664 677 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
665 678 for embedded instances, regarding handling of namespaces and items
666 679 added to the __builtin__ one. Multiple embedded instances and
667 680 recursive embeddings should work better now (though I'm not sure
668 681 I've got all the corner cases fixed, that code is a bit of a brain
669 682 twister).
670 683
671 684 * IPython/Magic.py (magic_edit): added support to edit in-memory
672 685 macros (automatically creates the necessary temp files). %edit
673 686 also doesn't return the file contents anymore, it's just noise.
674 687
675 688 * IPython/completer.py (Completer.attr_matches): revert change to
676 689 complete only on attributes listed in __all__. I realized it
677 690 cripples the tab-completion system as a tool for exploring the
678 691 internals of unknown libraries (it renders any non-__all__
679 692 attribute off-limits). I got bit by this when trying to see
680 693 something inside the dis module.
681 694
682 695 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
683 696
684 697 * IPython/iplib.py (InteractiveShell.__init__): add .meta
685 698 namespace for users and extension writers to hold data in. This
686 699 follows the discussion in
687 700 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
688 701
689 702 * IPython/completer.py (IPCompleter.complete): small patch to help
690 703 tab-completion under Emacs, after a suggestion by John Barnard
691 704 <barnarj-AT-ccf.org>.
692 705
693 706 * IPython/Magic.py (Magic.extract_input_slices): added support for
694 707 the slice notation in magics to use N-M to represent numbers N...M
695 708 (closed endpoints). This is used by %macro and %save.
696 709
697 710 * IPython/completer.py (Completer.attr_matches): for modules which
698 711 define __all__, complete only on those. After a patch by Jeffrey
699 712 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
700 713 speed up this routine.
701 714
702 715 * IPython/Logger.py (Logger.log): fix a history handling bug. I
703 716 don't know if this is the end of it, but the behavior now is
704 717 certainly much more correct. Note that coupled with macros,
705 718 slightly surprising (at first) behavior may occur: a macro will in
706 719 general expand to multiple lines of input, so upon exiting, the
707 720 in/out counters will both be bumped by the corresponding amount
708 721 (as if the macro's contents had been typed interactively). Typing
709 722 %hist will reveal the intermediate (silently processed) lines.
710 723
711 724 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
712 725 pickle to fail (%run was overwriting __main__ and not restoring
713 726 it, but pickle relies on __main__ to operate).
714 727
715 728 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
716 729 using properties, but forgot to make the main InteractiveShell
717 730 class a new-style class. Properties fail silently, and
718 731 misteriously, with old-style class (getters work, but
719 732 setters don't do anything).
720 733
721 734 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
722 735
723 736 * IPython/Magic.py (magic_history): fix history reporting bug (I
724 737 know some nasties are still there, I just can't seem to find a
725 738 reproducible test case to track them down; the input history is
726 739 falling out of sync...)
727 740
728 741 * IPython/iplib.py (handle_shell_escape): fix bug where both
729 742 aliases and system accesses where broken for indented code (such
730 743 as loops).
731 744
732 745 * IPython/genutils.py (shell): fix small but critical bug for
733 746 win32 system access.
734 747
735 748 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
736 749
737 750 * IPython/iplib.py (showtraceback): remove use of the
738 751 sys.last_{type/value/traceback} structures, which are non
739 752 thread-safe.
740 753 (_prefilter): change control flow to ensure that we NEVER
741 754 introspect objects when autocall is off. This will guarantee that
742 755 having an input line of the form 'x.y', where access to attribute
743 756 'y' has side effects, doesn't trigger the side effect TWICE. It
744 757 is important to note that, with autocall on, these side effects
745 758 can still happen.
746 759 (ipsystem): new builtin, to complete the ip{magic/alias/system}
747 760 trio. IPython offers these three kinds of special calls which are
748 761 not python code, and it's a good thing to have their call method
749 762 be accessible as pure python functions (not just special syntax at
750 763 the command line). It gives us a better internal implementation
751 764 structure, as well as exposing these for user scripting more
752 765 cleanly.
753 766
754 767 * IPython/macro.py (Macro.__init__): moved macros to a standalone
755 768 file. Now that they'll be more likely to be used with the
756 769 persistance system (%store), I want to make sure their module path
757 770 doesn't change in the future, so that we don't break things for
758 771 users' persisted data.
759 772
760 773 * IPython/iplib.py (autoindent_update): move indentation
761 774 management into the _text_ processing loop, not the keyboard
762 775 interactive one. This is necessary to correctly process non-typed
763 776 multiline input (such as macros).
764 777
765 778 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
766 779 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
767 780 which was producing problems in the resulting manual.
768 781 (magic_whos): improve reporting of instances (show their class,
769 782 instead of simply printing 'instance' which isn't terribly
770 783 informative).
771 784
772 785 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
773 786 (minor mods) to support network shares under win32.
774 787
775 788 * IPython/winconsole.py (get_console_size): add new winconsole
776 789 module and fixes to page_dumb() to improve its behavior under
777 790 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
778 791
779 792 * IPython/Magic.py (Macro): simplified Macro class to just
780 793 subclass list. We've had only 2.2 compatibility for a very long
781 794 time, yet I was still avoiding subclassing the builtin types. No
782 795 more (I'm also starting to use properties, though I won't shift to
783 796 2.3-specific features quite yet).
784 797 (magic_store): added Ville's patch for lightweight variable
785 798 persistence, after a request on the user list by Matt Wilkie
786 799 <maphew-AT-gmail.com>. The new %store magic's docstring has full
787 800 details.
788 801
789 802 * IPython/iplib.py (InteractiveShell.post_config_initialization):
790 803 changed the default logfile name from 'ipython.log' to
791 804 'ipython_log.py'. These logs are real python files, and now that
792 805 we have much better multiline support, people are more likely to
793 806 want to use them as such. Might as well name them correctly.
794 807
795 808 * IPython/Magic.py: substantial cleanup. While we can't stop
796 809 using magics as mixins, due to the existing customizations 'out
797 810 there' which rely on the mixin naming conventions, at least I
798 811 cleaned out all cross-class name usage. So once we are OK with
799 812 breaking compatibility, the two systems can be separated.
800 813
801 814 * IPython/Logger.py: major cleanup. This one is NOT a mixin
802 815 anymore, and the class is a fair bit less hideous as well. New
803 816 features were also introduced: timestamping of input, and logging
804 817 of output results. These are user-visible with the -t and -o
805 818 options to %logstart. Closes
806 819 http://www.scipy.net/roundup/ipython/issue11 and a request by
807 820 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
808 821
809 822 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
810 823
811 824 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
812 825 better hadnle backslashes in paths. See the thread 'More Windows
813 826 questions part 2 - \/ characters revisited' on the iypthon user
814 827 list:
815 828 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
816 829
817 830 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
818 831
819 832 (InteractiveShell.__init__): change threaded shells to not use the
820 833 ipython crash handler. This was causing more problems than not,
821 834 as exceptions in the main thread (GUI code, typically) would
822 835 always show up as a 'crash', when they really weren't.
823 836
824 837 The colors and exception mode commands (%colors/%xmode) have been
825 838 synchronized to also take this into account, so users can get
826 839 verbose exceptions for their threaded code as well. I also added
827 840 support for activating pdb inside this exception handler as well,
828 841 so now GUI authors can use IPython's enhanced pdb at runtime.
829 842
830 843 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
831 844 true by default, and add it to the shipped ipythonrc file. Since
832 845 this asks the user before proceeding, I think it's OK to make it
833 846 true by default.
834 847
835 848 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
836 849 of the previous special-casing of input in the eval loop. I think
837 850 this is cleaner, as they really are commands and shouldn't have
838 851 a special role in the middle of the core code.
839 852
840 853 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
841 854
842 855 * IPython/iplib.py (edit_syntax_error): added support for
843 856 automatically reopening the editor if the file had a syntax error
844 857 in it. Thanks to scottt who provided the patch at:
845 858 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
846 859 version committed).
847 860
848 861 * IPython/iplib.py (handle_normal): add suport for multi-line
849 862 input with emtpy lines. This fixes
850 863 http://www.scipy.net/roundup/ipython/issue43 and a similar
851 864 discussion on the user list.
852 865
853 866 WARNING: a behavior change is necessarily introduced to support
854 867 blank lines: now a single blank line with whitespace does NOT
855 868 break the input loop, which means that when autoindent is on, by
856 869 default hitting return on the next (indented) line does NOT exit.
857 870
858 871 Instead, to exit a multiline input you can either have:
859 872
860 873 - TWO whitespace lines (just hit return again), or
861 874 - a single whitespace line of a different length than provided
862 875 by the autoindent (add or remove a space).
863 876
864 877 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
865 878 module to better organize all readline-related functionality.
866 879 I've deleted FlexCompleter and put all completion clases here.
867 880
868 881 * IPython/iplib.py (raw_input): improve indentation management.
869 882 It is now possible to paste indented code with autoindent on, and
870 883 the code is interpreted correctly (though it still looks bad on
871 884 screen, due to the line-oriented nature of ipython).
872 885 (MagicCompleter.complete): change behavior so that a TAB key on an
873 886 otherwise empty line actually inserts a tab, instead of completing
874 887 on the entire global namespace. This makes it easier to use the
875 888 TAB key for indentation. After a request by Hans Meine
876 889 <hans_meine-AT-gmx.net>
877 890 (_prefilter): add support so that typing plain 'exit' or 'quit'
878 891 does a sensible thing. Originally I tried to deviate as little as
879 892 possible from the default python behavior, but even that one may
880 893 change in this direction (thread on python-dev to that effect).
881 894 Regardless, ipython should do the right thing even if CPython's
882 895 '>>>' prompt doesn't.
883 896 (InteractiveShell): removed subclassing code.InteractiveConsole
884 897 class. By now we'd overridden just about all of its methods: I've
885 898 copied the remaining two over, and now ipython is a standalone
886 899 class. This will provide a clearer picture for the chainsaw
887 900 branch refactoring.
888 901
889 902 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
890 903
891 904 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
892 905 failures for objects which break when dir() is called on them.
893 906
894 907 * IPython/FlexCompleter.py (Completer.__init__): Added support for
895 908 distinct local and global namespaces in the completer API. This
896 909 change allows us top properly handle completion with distinct
897 910 scopes, including in embedded instances (this had never really
898 911 worked correctly).
899 912
900 913 Note: this introduces a change in the constructor for
901 914 MagicCompleter, as a new global_namespace parameter is now the
902 915 second argument (the others were bumped one position).
903 916
904 917 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
905 918
906 919 * IPython/iplib.py (embed_mainloop): fix tab-completion in
907 920 embedded instances (which can be done now thanks to Vivian's
908 921 frame-handling fixes for pdb).
909 922 (InteractiveShell.__init__): Fix namespace handling problem in
910 923 embedded instances. We were overwriting __main__ unconditionally,
911 924 and this should only be done for 'full' (non-embedded) IPython;
912 925 embedded instances must respect the caller's __main__. Thanks to
913 926 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
914 927
915 928 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
916 929
917 930 * setup.py: added download_url to setup(). This registers the
918 931 download address at PyPI, which is not only useful to humans
919 932 browsing the site, but is also picked up by setuptools (the Eggs
920 933 machinery). Thanks to Ville and R. Kern for the info/discussion
921 934 on this.
922 935
923 936 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
924 937
925 938 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
926 939 This brings a lot of nice functionality to the pdb mode, which now
927 940 has tab-completion, syntax highlighting, and better stack handling
928 941 than before. Many thanks to Vivian De Smedt
929 942 <vivian-AT-vdesmedt.com> for the original patches.
930 943
931 944 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
932 945
933 946 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
934 947 sequence to consistently accept the banner argument. The
935 948 inconsistency was tripping SAGE, thanks to Gary Zablackis
936 949 <gzabl-AT-yahoo.com> for the report.
937 950
938 951 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
939 952
940 953 * IPython/iplib.py (InteractiveShell.post_config_initialization):
941 954 Fix bug where a naked 'alias' call in the ipythonrc file would
942 955 cause a crash. Bug reported by Jorgen Stenarson.
943 956
944 957 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
945 958
946 959 * IPython/ipmaker.py (make_IPython): cleanups which should improve
947 960 startup time.
948 961
949 962 * IPython/iplib.py (runcode): my globals 'fix' for embedded
950 963 instances had introduced a bug with globals in normal code. Now
951 964 it's working in all cases.
952 965
953 966 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
954 967 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
955 968 has been introduced to set the default case sensitivity of the
956 969 searches. Users can still select either mode at runtime on a
957 970 per-search basis.
958 971
959 972 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
960 973
961 974 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
962 975 attributes in wildcard searches for subclasses. Modified version
963 976 of a patch by Jorgen.
964 977
965 978 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
966 979
967 980 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
968 981 embedded instances. I added a user_global_ns attribute to the
969 982 InteractiveShell class to handle this.
970 983
971 984 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
972 985
973 986 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
974 987 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
975 988 (reported under win32, but may happen also in other platforms).
976 989 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
977 990
978 991 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
979 992
980 993 * IPython/Magic.py (magic_psearch): new support for wildcard
981 994 patterns. Now, typing ?a*b will list all names which begin with a
982 995 and end in b, for example. The %psearch magic has full
983 996 docstrings. Many thanks to JΓΆrgen Stenarson
984 997 <jorgen.stenarson-AT-bostream.nu>, author of the patches
985 998 implementing this functionality.
986 999
987 1000 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
988 1001
989 1002 * Manual: fixed long-standing annoyance of double-dashes (as in
990 1003 --prefix=~, for example) being stripped in the HTML version. This
991 1004 is a latex2html bug, but a workaround was provided. Many thanks
992 1005 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
993 1006 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
994 1007 rolling. This seemingly small issue had tripped a number of users
995 1008 when first installing, so I'm glad to see it gone.
996 1009
997 1010 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
998 1011
999 1012 * IPython/Extensions/numeric_formats.py: fix missing import,
1000 1013 reported by Stephen Walton.
1001 1014
1002 1015 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1003 1016
1004 1017 * IPython/demo.py: finish demo module, fully documented now.
1005 1018
1006 1019 * IPython/genutils.py (file_read): simple little utility to read a
1007 1020 file and ensure it's closed afterwards.
1008 1021
1009 1022 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1010 1023
1011 1024 * IPython/demo.py (Demo.__init__): added support for individually
1012 1025 tagging blocks for automatic execution.
1013 1026
1014 1027 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1015 1028 syntax-highlighted python sources, requested by John.
1016 1029
1017 1030 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1018 1031
1019 1032 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1020 1033 finishing.
1021 1034
1022 1035 * IPython/genutils.py (shlex_split): moved from Magic to here,
1023 1036 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1024 1037
1025 1038 * IPython/demo.py (Demo.__init__): added support for silent
1026 1039 blocks, improved marks as regexps, docstrings written.
1027 1040 (Demo.__init__): better docstring, added support for sys.argv.
1028 1041
1029 1042 * IPython/genutils.py (marquee): little utility used by the demo
1030 1043 code, handy in general.
1031 1044
1032 1045 * IPython/demo.py (Demo.__init__): new class for interactive
1033 1046 demos. Not documented yet, I just wrote it in a hurry for
1034 1047 scipy'05. Will docstring later.
1035 1048
1036 1049 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1037 1050
1038 1051 * IPython/Shell.py (sigint_handler): Drastic simplification which
1039 1052 also seems to make Ctrl-C work correctly across threads! This is
1040 1053 so simple, that I can't beleive I'd missed it before. Needs more
1041 1054 testing, though.
1042 1055 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1043 1056 like this before...
1044 1057
1045 1058 * IPython/genutils.py (get_home_dir): add protection against
1046 1059 non-dirs in win32 registry.
1047 1060
1048 1061 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1049 1062 bug where dict was mutated while iterating (pysh crash).
1050 1063
1051 1064 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1052 1065
1053 1066 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1054 1067 spurious newlines added by this routine. After a report by
1055 1068 F. Mantegazza.
1056 1069
1057 1070 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1058 1071
1059 1072 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1060 1073 calls. These were a leftover from the GTK 1.x days, and can cause
1061 1074 problems in certain cases (after a report by John Hunter).
1062 1075
1063 1076 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1064 1077 os.getcwd() fails at init time. Thanks to patch from David Remahl
1065 1078 <chmod007-AT-mac.com>.
1066 1079 (InteractiveShell.__init__): prevent certain special magics from
1067 1080 being shadowed by aliases. Closes
1068 1081 http://www.scipy.net/roundup/ipython/issue41.
1069 1082
1070 1083 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1071 1084
1072 1085 * IPython/iplib.py (InteractiveShell.complete): Added new
1073 1086 top-level completion method to expose the completion mechanism
1074 1087 beyond readline-based environments.
1075 1088
1076 1089 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1077 1090
1078 1091 * tools/ipsvnc (svnversion): fix svnversion capture.
1079 1092
1080 1093 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1081 1094 attribute to self, which was missing. Before, it was set by a
1082 1095 routine which in certain cases wasn't being called, so the
1083 1096 instance could end up missing the attribute. This caused a crash.
1084 1097 Closes http://www.scipy.net/roundup/ipython/issue40.
1085 1098
1086 1099 2005-08-16 Fernando Perez <fperez@colorado.edu>
1087 1100
1088 1101 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1089 1102 contains non-string attribute. Closes
1090 1103 http://www.scipy.net/roundup/ipython/issue38.
1091 1104
1092 1105 2005-08-14 Fernando Perez <fperez@colorado.edu>
1093 1106
1094 1107 * tools/ipsvnc: Minor improvements, to add changeset info.
1095 1108
1096 1109 2005-08-12 Fernando Perez <fperez@colorado.edu>
1097 1110
1098 1111 * IPython/iplib.py (runsource): remove self.code_to_run_src
1099 1112 attribute. I realized this is nothing more than
1100 1113 '\n'.join(self.buffer), and having the same data in two different
1101 1114 places is just asking for synchronization bugs. This may impact
1102 1115 people who have custom exception handlers, so I need to warn
1103 1116 ipython-dev about it (F. Mantegazza may use them).
1104 1117
1105 1118 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1106 1119
1107 1120 * IPython/genutils.py: fix 2.2 compatibility (generators)
1108 1121
1109 1122 2005-07-18 Fernando Perez <fperez@colorado.edu>
1110 1123
1111 1124 * IPython/genutils.py (get_home_dir): fix to help users with
1112 1125 invalid $HOME under win32.
1113 1126
1114 1127 2005-07-17 Fernando Perez <fperez@colorado.edu>
1115 1128
1116 1129 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1117 1130 some old hacks and clean up a bit other routines; code should be
1118 1131 simpler and a bit faster.
1119 1132
1120 1133 * IPython/iplib.py (interact): removed some last-resort attempts
1121 1134 to survive broken stdout/stderr. That code was only making it
1122 1135 harder to abstract out the i/o (necessary for gui integration),
1123 1136 and the crashes it could prevent were extremely rare in practice
1124 1137 (besides being fully user-induced in a pretty violent manner).
1125 1138
1126 1139 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1127 1140 Nothing major yet, but the code is simpler to read; this should
1128 1141 make it easier to do more serious modifications in the future.
1129 1142
1130 1143 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1131 1144 which broke in .15 (thanks to a report by Ville).
1132 1145
1133 1146 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1134 1147 be quite correct, I know next to nothing about unicode). This
1135 1148 will allow unicode strings to be used in prompts, amongst other
1136 1149 cases. It also will prevent ipython from crashing when unicode
1137 1150 shows up unexpectedly in many places. If ascii encoding fails, we
1138 1151 assume utf_8. Currently the encoding is not a user-visible
1139 1152 setting, though it could be made so if there is demand for it.
1140 1153
1141 1154 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1142 1155
1143 1156 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1144 1157
1145 1158 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1146 1159
1147 1160 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1148 1161 code can work transparently for 2.2/2.3.
1149 1162
1150 1163 2005-07-16 Fernando Perez <fperez@colorado.edu>
1151 1164
1152 1165 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1153 1166 out of the color scheme table used for coloring exception
1154 1167 tracebacks. This allows user code to add new schemes at runtime.
1155 1168 This is a minimally modified version of the patch at
1156 1169 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1157 1170 for the contribution.
1158 1171
1159 1172 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1160 1173 slightly modified version of the patch in
1161 1174 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1162 1175 to remove the previous try/except solution (which was costlier).
1163 1176 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1164 1177
1165 1178 2005-06-08 Fernando Perez <fperez@colorado.edu>
1166 1179
1167 1180 * IPython/iplib.py (write/write_err): Add methods to abstract all
1168 1181 I/O a bit more.
1169 1182
1170 1183 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1171 1184 warning, reported by Aric Hagberg, fix by JD Hunter.
1172 1185
1173 1186 2005-06-02 *** Released version 0.6.15
1174 1187
1175 1188 2005-06-01 Fernando Perez <fperez@colorado.edu>
1176 1189
1177 1190 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1178 1191 tab-completion of filenames within open-quoted strings. Note that
1179 1192 this requires that in ~/.ipython/ipythonrc, users change the
1180 1193 readline delimiters configuration to read:
1181 1194
1182 1195 readline_remove_delims -/~
1183 1196
1184 1197
1185 1198 2005-05-31 *** Released version 0.6.14
1186 1199
1187 1200 2005-05-29 Fernando Perez <fperez@colorado.edu>
1188 1201
1189 1202 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1190 1203 with files not on the filesystem. Reported by Eliyahu Sandler
1191 1204 <eli@gondolin.net>
1192 1205
1193 1206 2005-05-22 Fernando Perez <fperez@colorado.edu>
1194 1207
1195 1208 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1196 1209 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1197 1210
1198 1211 2005-05-19 Fernando Perez <fperez@colorado.edu>
1199 1212
1200 1213 * IPython/iplib.py (safe_execfile): close a file which could be
1201 1214 left open (causing problems in win32, which locks open files).
1202 1215 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1203 1216
1204 1217 2005-05-18 Fernando Perez <fperez@colorado.edu>
1205 1218
1206 1219 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1207 1220 keyword arguments correctly to safe_execfile().
1208 1221
1209 1222 2005-05-13 Fernando Perez <fperez@colorado.edu>
1210 1223
1211 1224 * ipython.1: Added info about Qt to manpage, and threads warning
1212 1225 to usage page (invoked with --help).
1213 1226
1214 1227 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1215 1228 new matcher (it goes at the end of the priority list) to do
1216 1229 tab-completion on named function arguments. Submitted by George
1217 1230 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1218 1231 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1219 1232 for more details.
1220 1233
1221 1234 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1222 1235 SystemExit exceptions in the script being run. Thanks to a report
1223 1236 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1224 1237 producing very annoying behavior when running unit tests.
1225 1238
1226 1239 2005-05-12 Fernando Perez <fperez@colorado.edu>
1227 1240
1228 1241 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1229 1242 which I'd broken (again) due to a changed regexp. In the process,
1230 1243 added ';' as an escape to auto-quote the whole line without
1231 1244 splitting its arguments. Thanks to a report by Jerry McRae
1232 1245 <qrs0xyc02-AT-sneakemail.com>.
1233 1246
1234 1247 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1235 1248 possible crashes caused by a TokenError. Reported by Ed Schofield
1236 1249 <schofield-AT-ftw.at>.
1237 1250
1238 1251 2005-05-06 Fernando Perez <fperez@colorado.edu>
1239 1252
1240 1253 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1241 1254
1242 1255 2005-04-29 Fernando Perez <fperez@colorado.edu>
1243 1256
1244 1257 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1245 1258 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1246 1259 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1247 1260 which provides support for Qt interactive usage (similar to the
1248 1261 existing one for WX and GTK). This had been often requested.
1249 1262
1250 1263 2005-04-14 *** Released version 0.6.13
1251 1264
1252 1265 2005-04-08 Fernando Perez <fperez@colorado.edu>
1253 1266
1254 1267 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1255 1268 from _ofind, which gets called on almost every input line. Now,
1256 1269 we only try to get docstrings if they are actually going to be
1257 1270 used (the overhead of fetching unnecessary docstrings can be
1258 1271 noticeable for certain objects, such as Pyro proxies).
1259 1272
1260 1273 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1261 1274 for completers. For some reason I had been passing them the state
1262 1275 variable, which completers never actually need, and was in
1263 1276 conflict with the rlcompleter API. Custom completers ONLY need to
1264 1277 take the text parameter.
1265 1278
1266 1279 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1267 1280 work correctly in pysh. I've also moved all the logic which used
1268 1281 to be in pysh.py here, which will prevent problems with future
1269 1282 upgrades. However, this time I must warn users to update their
1270 1283 pysh profile to include the line
1271 1284
1272 1285 import_all IPython.Extensions.InterpreterExec
1273 1286
1274 1287 because otherwise things won't work for them. They MUST also
1275 1288 delete pysh.py and the line
1276 1289
1277 1290 execfile pysh.py
1278 1291
1279 1292 from their ipythonrc-pysh.
1280 1293
1281 1294 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1282 1295 robust in the face of objects whose dir() returns non-strings
1283 1296 (which it shouldn't, but some broken libs like ITK do). Thanks to
1284 1297 a patch by John Hunter (implemented differently, though). Also
1285 1298 minor improvements by using .extend instead of + on lists.
1286 1299
1287 1300 * pysh.py:
1288 1301
1289 1302 2005-04-06 Fernando Perez <fperez@colorado.edu>
1290 1303
1291 1304 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1292 1305 by default, so that all users benefit from it. Those who don't
1293 1306 want it can still turn it off.
1294 1307
1295 1308 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1296 1309 config file, I'd forgotten about this, so users were getting it
1297 1310 off by default.
1298 1311
1299 1312 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1300 1313 consistency. Now magics can be called in multiline statements,
1301 1314 and python variables can be expanded in magic calls via $var.
1302 1315 This makes the magic system behave just like aliases or !system
1303 1316 calls.
1304 1317
1305 1318 2005-03-28 Fernando Perez <fperez@colorado.edu>
1306 1319
1307 1320 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1308 1321 expensive string additions for building command. Add support for
1309 1322 trailing ';' when autocall is used.
1310 1323
1311 1324 2005-03-26 Fernando Perez <fperez@colorado.edu>
1312 1325
1313 1326 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1314 1327 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1315 1328 ipython.el robust against prompts with any number of spaces
1316 1329 (including 0) after the ':' character.
1317 1330
1318 1331 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1319 1332 continuation prompt, which misled users to think the line was
1320 1333 already indented. Closes debian Bug#300847, reported to me by
1321 1334 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1322 1335
1323 1336 2005-03-23 Fernando Perez <fperez@colorado.edu>
1324 1337
1325 1338 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1326 1339 properly aligned if they have embedded newlines.
1327 1340
1328 1341 * IPython/iplib.py (runlines): Add a public method to expose
1329 1342 IPython's code execution machinery, so that users can run strings
1330 1343 as if they had been typed at the prompt interactively.
1331 1344 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1332 1345 methods which can call the system shell, but with python variable
1333 1346 expansion. The three such methods are: __IPYTHON__.system,
1334 1347 .getoutput and .getoutputerror. These need to be documented in a
1335 1348 'public API' section (to be written) of the manual.
1336 1349
1337 1350 2005-03-20 Fernando Perez <fperez@colorado.edu>
1338 1351
1339 1352 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1340 1353 for custom exception handling. This is quite powerful, and it
1341 1354 allows for user-installable exception handlers which can trap
1342 1355 custom exceptions at runtime and treat them separately from
1343 1356 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1344 1357 Mantegazza <mantegazza-AT-ill.fr>.
1345 1358 (InteractiveShell.set_custom_completer): public API function to
1346 1359 add new completers at runtime.
1347 1360
1348 1361 2005-03-19 Fernando Perez <fperez@colorado.edu>
1349 1362
1350 1363 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1351 1364 allow objects which provide their docstrings via non-standard
1352 1365 mechanisms (like Pyro proxies) to still be inspected by ipython's
1353 1366 ? system.
1354 1367
1355 1368 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1356 1369 automatic capture system. I tried quite hard to make it work
1357 1370 reliably, and simply failed. I tried many combinations with the
1358 1371 subprocess module, but eventually nothing worked in all needed
1359 1372 cases (not blocking stdin for the child, duplicating stdout
1360 1373 without blocking, etc). The new %sc/%sx still do capture to these
1361 1374 magical list/string objects which make shell use much more
1362 1375 conveninent, so not all is lost.
1363 1376
1364 1377 XXX - FIX MANUAL for the change above!
1365 1378
1366 1379 (runsource): I copied code.py's runsource() into ipython to modify
1367 1380 it a bit. Now the code object and source to be executed are
1368 1381 stored in ipython. This makes this info accessible to third-party
1369 1382 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1370 1383 Mantegazza <mantegazza-AT-ill.fr>.
1371 1384
1372 1385 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1373 1386 history-search via readline (like C-p/C-n). I'd wanted this for a
1374 1387 long time, but only recently found out how to do it. For users
1375 1388 who already have their ipythonrc files made and want this, just
1376 1389 add:
1377 1390
1378 1391 readline_parse_and_bind "\e[A": history-search-backward
1379 1392 readline_parse_and_bind "\e[B": history-search-forward
1380 1393
1381 1394 2005-03-18 Fernando Perez <fperez@colorado.edu>
1382 1395
1383 1396 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1384 1397 LSString and SList classes which allow transparent conversions
1385 1398 between list mode and whitespace-separated string.
1386 1399 (magic_r): Fix recursion problem in %r.
1387 1400
1388 1401 * IPython/genutils.py (LSString): New class to be used for
1389 1402 automatic storage of the results of all alias/system calls in _o
1390 1403 and _e (stdout/err). These provide a .l/.list attribute which
1391 1404 does automatic splitting on newlines. This means that for most
1392 1405 uses, you'll never need to do capturing of output with %sc/%sx
1393 1406 anymore, since ipython keeps this always done for you. Note that
1394 1407 only the LAST results are stored, the _o/e variables are
1395 1408 overwritten on each call. If you need to save their contents
1396 1409 further, simply bind them to any other name.
1397 1410
1398 1411 2005-03-17 Fernando Perez <fperez@colorado.edu>
1399 1412
1400 1413 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1401 1414 prompt namespace handling.
1402 1415
1403 1416 2005-03-16 Fernando Perez <fperez@colorado.edu>
1404 1417
1405 1418 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1406 1419 classic prompts to be '>>> ' (final space was missing, and it
1407 1420 trips the emacs python mode).
1408 1421 (BasePrompt.__str__): Added safe support for dynamic prompt
1409 1422 strings. Now you can set your prompt string to be '$x', and the
1410 1423 value of x will be printed from your interactive namespace. The
1411 1424 interpolation syntax includes the full Itpl support, so
1412 1425 ${foo()+x+bar()} is a valid prompt string now, and the function
1413 1426 calls will be made at runtime.
1414 1427
1415 1428 2005-03-15 Fernando Perez <fperez@colorado.edu>
1416 1429
1417 1430 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1418 1431 avoid name clashes in pylab. %hist still works, it just forwards
1419 1432 the call to %history.
1420 1433
1421 1434 2005-03-02 *** Released version 0.6.12
1422 1435
1423 1436 2005-03-02 Fernando Perez <fperez@colorado.edu>
1424 1437
1425 1438 * IPython/iplib.py (handle_magic): log magic calls properly as
1426 1439 ipmagic() function calls.
1427 1440
1428 1441 * IPython/Magic.py (magic_time): Improved %time to support
1429 1442 statements and provide wall-clock as well as CPU time.
1430 1443
1431 1444 2005-02-27 Fernando Perez <fperez@colorado.edu>
1432 1445
1433 1446 * IPython/hooks.py: New hooks module, to expose user-modifiable
1434 1447 IPython functionality in a clean manner. For now only the editor
1435 1448 hook is actually written, and other thigns which I intend to turn
1436 1449 into proper hooks aren't yet there. The display and prefilter
1437 1450 stuff, for example, should be hooks. But at least now the
1438 1451 framework is in place, and the rest can be moved here with more
1439 1452 time later. IPython had had a .hooks variable for a long time for
1440 1453 this purpose, but I'd never actually used it for anything.
1441 1454
1442 1455 2005-02-26 Fernando Perez <fperez@colorado.edu>
1443 1456
1444 1457 * IPython/ipmaker.py (make_IPython): make the default ipython
1445 1458 directory be called _ipython under win32, to follow more the
1446 1459 naming peculiarities of that platform (where buggy software like
1447 1460 Visual Sourcesafe breaks with .named directories). Reported by
1448 1461 Ville Vainio.
1449 1462
1450 1463 2005-02-23 Fernando Perez <fperez@colorado.edu>
1451 1464
1452 1465 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1453 1466 auto_aliases for win32 which were causing problems. Users can
1454 1467 define the ones they personally like.
1455 1468
1456 1469 2005-02-21 Fernando Perez <fperez@colorado.edu>
1457 1470
1458 1471 * IPython/Magic.py (magic_time): new magic to time execution of
1459 1472 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1460 1473
1461 1474 2005-02-19 Fernando Perez <fperez@colorado.edu>
1462 1475
1463 1476 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1464 1477 into keys (for prompts, for example).
1465 1478
1466 1479 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1467 1480 prompts in case users want them. This introduces a small behavior
1468 1481 change: ipython does not automatically add a space to all prompts
1469 1482 anymore. To get the old prompts with a space, users should add it
1470 1483 manually to their ipythonrc file, so for example prompt_in1 should
1471 1484 now read 'In [\#]: ' instead of 'In [\#]:'.
1472 1485 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1473 1486 file) to control left-padding of secondary prompts.
1474 1487
1475 1488 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1476 1489 the profiler can't be imported. Fix for Debian, which removed
1477 1490 profile.py because of License issues. I applied a slightly
1478 1491 modified version of the original Debian patch at
1479 1492 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1480 1493
1481 1494 2005-02-17 Fernando Perez <fperez@colorado.edu>
1482 1495
1483 1496 * IPython/genutils.py (native_line_ends): Fix bug which would
1484 1497 cause improper line-ends under win32 b/c I was not opening files
1485 1498 in binary mode. Bug report and fix thanks to Ville.
1486 1499
1487 1500 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1488 1501 trying to catch spurious foo[1] autocalls. My fix actually broke
1489 1502 ',/' autoquote/call with explicit escape (bad regexp).
1490 1503
1491 1504 2005-02-15 *** Released version 0.6.11
1492 1505
1493 1506 2005-02-14 Fernando Perez <fperez@colorado.edu>
1494 1507
1495 1508 * IPython/background_jobs.py: New background job management
1496 1509 subsystem. This is implemented via a new set of classes, and
1497 1510 IPython now provides a builtin 'jobs' object for background job
1498 1511 execution. A convenience %bg magic serves as a lightweight
1499 1512 frontend for starting the more common type of calls. This was
1500 1513 inspired by discussions with B. Granger and the BackgroundCommand
1501 1514 class described in the book Python Scripting for Computational
1502 1515 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1503 1516 (although ultimately no code from this text was used, as IPython's
1504 1517 system is a separate implementation).
1505 1518
1506 1519 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1507 1520 to control the completion of single/double underscore names
1508 1521 separately. As documented in the example ipytonrc file, the
1509 1522 readline_omit__names variable can now be set to 2, to omit even
1510 1523 single underscore names. Thanks to a patch by Brian Wong
1511 1524 <BrianWong-AT-AirgoNetworks.Com>.
1512 1525 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1513 1526 be autocalled as foo([1]) if foo were callable. A problem for
1514 1527 things which are both callable and implement __getitem__.
1515 1528 (init_readline): Fix autoindentation for win32. Thanks to a patch
1516 1529 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1517 1530
1518 1531 2005-02-12 Fernando Perez <fperez@colorado.edu>
1519 1532
1520 1533 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1521 1534 which I had written long ago to sort out user error messages which
1522 1535 may occur during startup. This seemed like a good idea initially,
1523 1536 but it has proven a disaster in retrospect. I don't want to
1524 1537 change much code for now, so my fix is to set the internal 'debug'
1525 1538 flag to true everywhere, whose only job was precisely to control
1526 1539 this subsystem. This closes issue 28 (as well as avoiding all
1527 1540 sorts of strange hangups which occur from time to time).
1528 1541
1529 1542 2005-02-07 Fernando Perez <fperez@colorado.edu>
1530 1543
1531 1544 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1532 1545 previous call produced a syntax error.
1533 1546
1534 1547 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1535 1548 classes without constructor.
1536 1549
1537 1550 2005-02-06 Fernando Perez <fperez@colorado.edu>
1538 1551
1539 1552 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1540 1553 completions with the results of each matcher, so we return results
1541 1554 to the user from all namespaces. This breaks with ipython
1542 1555 tradition, but I think it's a nicer behavior. Now you get all
1543 1556 possible completions listed, from all possible namespaces (python,
1544 1557 filesystem, magics...) After a request by John Hunter
1545 1558 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1546 1559
1547 1560 2005-02-05 Fernando Perez <fperez@colorado.edu>
1548 1561
1549 1562 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1550 1563 the call had quote characters in it (the quotes were stripped).
1551 1564
1552 1565 2005-01-31 Fernando Perez <fperez@colorado.edu>
1553 1566
1554 1567 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1555 1568 Itpl.itpl() to make the code more robust against psyco
1556 1569 optimizations.
1557 1570
1558 1571 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1559 1572 of causing an exception. Quicker, cleaner.
1560 1573
1561 1574 2005-01-28 Fernando Perez <fperez@colorado.edu>
1562 1575
1563 1576 * scripts/ipython_win_post_install.py (install): hardcode
1564 1577 sys.prefix+'python.exe' as the executable path. It turns out that
1565 1578 during the post-installation run, sys.executable resolves to the
1566 1579 name of the binary installer! I should report this as a distutils
1567 1580 bug, I think. I updated the .10 release with this tiny fix, to
1568 1581 avoid annoying the lists further.
1569 1582
1570 1583 2005-01-27 *** Released version 0.6.10
1571 1584
1572 1585 2005-01-27 Fernando Perez <fperez@colorado.edu>
1573 1586
1574 1587 * IPython/numutils.py (norm): Added 'inf' as optional name for
1575 1588 L-infinity norm, included references to mathworld.com for vector
1576 1589 norm definitions.
1577 1590 (amin/amax): added amin/amax for array min/max. Similar to what
1578 1591 pylab ships with after the recent reorganization of names.
1579 1592 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1580 1593
1581 1594 * ipython.el: committed Alex's recent fixes and improvements.
1582 1595 Tested with python-mode from CVS, and it looks excellent. Since
1583 1596 python-mode hasn't released anything in a while, I'm temporarily
1584 1597 putting a copy of today's CVS (v 4.70) of python-mode in:
1585 1598 http://ipython.scipy.org/tmp/python-mode.el
1586 1599
1587 1600 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1588 1601 sys.executable for the executable name, instead of assuming it's
1589 1602 called 'python.exe' (the post-installer would have produced broken
1590 1603 setups on systems with a differently named python binary).
1591 1604
1592 1605 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1593 1606 references to os.linesep, to make the code more
1594 1607 platform-independent. This is also part of the win32 coloring
1595 1608 fixes.
1596 1609
1597 1610 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1598 1611 lines, which actually cause coloring bugs because the length of
1599 1612 the line is very difficult to correctly compute with embedded
1600 1613 escapes. This was the source of all the coloring problems under
1601 1614 Win32. I think that _finally_, Win32 users have a properly
1602 1615 working ipython in all respects. This would never have happened
1603 1616 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1604 1617
1605 1618 2005-01-26 *** Released version 0.6.9
1606 1619
1607 1620 2005-01-25 Fernando Perez <fperez@colorado.edu>
1608 1621
1609 1622 * setup.py: finally, we have a true Windows installer, thanks to
1610 1623 the excellent work of Viktor Ransmayr
1611 1624 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1612 1625 Windows users. The setup routine is quite a bit cleaner thanks to
1613 1626 this, and the post-install script uses the proper functions to
1614 1627 allow a clean de-installation using the standard Windows Control
1615 1628 Panel.
1616 1629
1617 1630 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1618 1631 environment variable under all OSes (including win32) if
1619 1632 available. This will give consistency to win32 users who have set
1620 1633 this variable for any reason. If os.environ['HOME'] fails, the
1621 1634 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1622 1635
1623 1636 2005-01-24 Fernando Perez <fperez@colorado.edu>
1624 1637
1625 1638 * IPython/numutils.py (empty_like): add empty_like(), similar to
1626 1639 zeros_like() but taking advantage of the new empty() Numeric routine.
1627 1640
1628 1641 2005-01-23 *** Released version 0.6.8
1629 1642
1630 1643 2005-01-22 Fernando Perez <fperez@colorado.edu>
1631 1644
1632 1645 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1633 1646 automatic show() calls. After discussing things with JDH, it
1634 1647 turns out there are too many corner cases where this can go wrong.
1635 1648 It's best not to try to be 'too smart', and simply have ipython
1636 1649 reproduce as much as possible the default behavior of a normal
1637 1650 python shell.
1638 1651
1639 1652 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1640 1653 line-splitting regexp and _prefilter() to avoid calling getattr()
1641 1654 on assignments. This closes
1642 1655 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1643 1656 readline uses getattr(), so a simple <TAB> keypress is still
1644 1657 enough to trigger getattr() calls on an object.
1645 1658
1646 1659 2005-01-21 Fernando Perez <fperez@colorado.edu>
1647 1660
1648 1661 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1649 1662 docstring under pylab so it doesn't mask the original.
1650 1663
1651 1664 2005-01-21 *** Released version 0.6.7
1652 1665
1653 1666 2005-01-21 Fernando Perez <fperez@colorado.edu>
1654 1667
1655 1668 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1656 1669 signal handling for win32 users in multithreaded mode.
1657 1670
1658 1671 2005-01-17 Fernando Perez <fperez@colorado.edu>
1659 1672
1660 1673 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1661 1674 instances with no __init__. After a crash report by Norbert Nemec
1662 1675 <Norbert-AT-nemec-online.de>.
1663 1676
1664 1677 2005-01-14 Fernando Perez <fperez@colorado.edu>
1665 1678
1666 1679 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1667 1680 names for verbose exceptions, when multiple dotted names and the
1668 1681 'parent' object were present on the same line.
1669 1682
1670 1683 2005-01-11 Fernando Perez <fperez@colorado.edu>
1671 1684
1672 1685 * IPython/genutils.py (flag_calls): new utility to trap and flag
1673 1686 calls in functions. I need it to clean up matplotlib support.
1674 1687 Also removed some deprecated code in genutils.
1675 1688
1676 1689 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1677 1690 that matplotlib scripts called with %run, which don't call show()
1678 1691 themselves, still have their plotting windows open.
1679 1692
1680 1693 2005-01-05 Fernando Perez <fperez@colorado.edu>
1681 1694
1682 1695 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1683 1696 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1684 1697
1685 1698 2004-12-19 Fernando Perez <fperez@colorado.edu>
1686 1699
1687 1700 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1688 1701 parent_runcode, which was an eyesore. The same result can be
1689 1702 obtained with Python's regular superclass mechanisms.
1690 1703
1691 1704 2004-12-17 Fernando Perez <fperez@colorado.edu>
1692 1705
1693 1706 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1694 1707 reported by Prabhu.
1695 1708 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1696 1709 sys.stderr) instead of explicitly calling sys.stderr. This helps
1697 1710 maintain our I/O abstractions clean, for future GUI embeddings.
1698 1711
1699 1712 * IPython/genutils.py (info): added new utility for sys.stderr
1700 1713 unified info message handling (thin wrapper around warn()).
1701 1714
1702 1715 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1703 1716 composite (dotted) names on verbose exceptions.
1704 1717 (VerboseTB.nullrepr): harden against another kind of errors which
1705 1718 Python's inspect module can trigger, and which were crashing
1706 1719 IPython. Thanks to a report by Marco Lombardi
1707 1720 <mlombard-AT-ma010192.hq.eso.org>.
1708 1721
1709 1722 2004-12-13 *** Released version 0.6.6
1710 1723
1711 1724 2004-12-12 Fernando Perez <fperez@colorado.edu>
1712 1725
1713 1726 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1714 1727 generated by pygtk upon initialization if it was built without
1715 1728 threads (for matplotlib users). After a crash reported by
1716 1729 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1717 1730
1718 1731 * IPython/ipmaker.py (make_IPython): fix small bug in the
1719 1732 import_some parameter for multiple imports.
1720 1733
1721 1734 * IPython/iplib.py (ipmagic): simplified the interface of
1722 1735 ipmagic() to take a single string argument, just as it would be
1723 1736 typed at the IPython cmd line.
1724 1737 (ipalias): Added new ipalias() with an interface identical to
1725 1738 ipmagic(). This completes exposing a pure python interface to the
1726 1739 alias and magic system, which can be used in loops or more complex
1727 1740 code where IPython's automatic line mangling is not active.
1728 1741
1729 1742 * IPython/genutils.py (timing): changed interface of timing to
1730 1743 simply run code once, which is the most common case. timings()
1731 1744 remains unchanged, for the cases where you want multiple runs.
1732 1745
1733 1746 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1734 1747 bug where Python2.2 crashes with exec'ing code which does not end
1735 1748 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1736 1749 before.
1737 1750
1738 1751 2004-12-10 Fernando Perez <fperez@colorado.edu>
1739 1752
1740 1753 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1741 1754 -t to -T, to accomodate the new -t flag in %run (the %run and
1742 1755 %prun options are kind of intermixed, and it's not easy to change
1743 1756 this with the limitations of python's getopt).
1744 1757
1745 1758 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1746 1759 the execution of scripts. It's not as fine-tuned as timeit.py,
1747 1760 but it works from inside ipython (and under 2.2, which lacks
1748 1761 timeit.py). Optionally a number of runs > 1 can be given for
1749 1762 timing very short-running code.
1750 1763
1751 1764 * IPython/genutils.py (uniq_stable): new routine which returns a
1752 1765 list of unique elements in any iterable, but in stable order of
1753 1766 appearance. I needed this for the ultraTB fixes, and it's a handy
1754 1767 utility.
1755 1768
1756 1769 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1757 1770 dotted names in Verbose exceptions. This had been broken since
1758 1771 the very start, now x.y will properly be printed in a Verbose
1759 1772 traceback, instead of x being shown and y appearing always as an
1760 1773 'undefined global'. Getting this to work was a bit tricky,
1761 1774 because by default python tokenizers are stateless. Saved by
1762 1775 python's ability to easily add a bit of state to an arbitrary
1763 1776 function (without needing to build a full-blown callable object).
1764 1777
1765 1778 Also big cleanup of this code, which had horrendous runtime
1766 1779 lookups of zillions of attributes for colorization. Moved all
1767 1780 this code into a few templates, which make it cleaner and quicker.
1768 1781
1769 1782 Printout quality was also improved for Verbose exceptions: one
1770 1783 variable per line, and memory addresses are printed (this can be
1771 1784 quite handy in nasty debugging situations, which is what Verbose
1772 1785 is for).
1773 1786
1774 1787 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1775 1788 the command line as scripts to be loaded by embedded instances.
1776 1789 Doing so has the potential for an infinite recursion if there are
1777 1790 exceptions thrown in the process. This fixes a strange crash
1778 1791 reported by Philippe MULLER <muller-AT-irit.fr>.
1779 1792
1780 1793 2004-12-09 Fernando Perez <fperez@colorado.edu>
1781 1794
1782 1795 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1783 1796 to reflect new names in matplotlib, which now expose the
1784 1797 matlab-compatible interface via a pylab module instead of the
1785 1798 'matlab' name. The new code is backwards compatible, so users of
1786 1799 all matplotlib versions are OK. Patch by J. Hunter.
1787 1800
1788 1801 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1789 1802 of __init__ docstrings for instances (class docstrings are already
1790 1803 automatically printed). Instances with customized docstrings
1791 1804 (indep. of the class) are also recognized and all 3 separate
1792 1805 docstrings are printed (instance, class, constructor). After some
1793 1806 comments/suggestions by J. Hunter.
1794 1807
1795 1808 2004-12-05 Fernando Perez <fperez@colorado.edu>
1796 1809
1797 1810 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1798 1811 warnings when tab-completion fails and triggers an exception.
1799 1812
1800 1813 2004-12-03 Fernando Perez <fperez@colorado.edu>
1801 1814
1802 1815 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1803 1816 be triggered when using 'run -p'. An incorrect option flag was
1804 1817 being set ('d' instead of 'D').
1805 1818 (manpage): fix missing escaped \- sign.
1806 1819
1807 1820 2004-11-30 *** Released version 0.6.5
1808 1821
1809 1822 2004-11-30 Fernando Perez <fperez@colorado.edu>
1810 1823
1811 1824 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1812 1825 setting with -d option.
1813 1826
1814 1827 * setup.py (docfiles): Fix problem where the doc glob I was using
1815 1828 was COMPLETELY BROKEN. It was giving the right files by pure
1816 1829 accident, but failed once I tried to include ipython.el. Note:
1817 1830 glob() does NOT allow you to do exclusion on multiple endings!
1818 1831
1819 1832 2004-11-29 Fernando Perez <fperez@colorado.edu>
1820 1833
1821 1834 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1822 1835 the manpage as the source. Better formatting & consistency.
1823 1836
1824 1837 * IPython/Magic.py (magic_run): Added new -d option, to run
1825 1838 scripts under the control of the python pdb debugger. Note that
1826 1839 this required changing the %prun option -d to -D, to avoid a clash
1827 1840 (since %run must pass options to %prun, and getopt is too dumb to
1828 1841 handle options with string values with embedded spaces). Thanks
1829 1842 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1830 1843 (magic_who_ls): added type matching to %who and %whos, so that one
1831 1844 can filter their output to only include variables of certain
1832 1845 types. Another suggestion by Matthew.
1833 1846 (magic_whos): Added memory summaries in kb and Mb for arrays.
1834 1847 (magic_who): Improve formatting (break lines every 9 vars).
1835 1848
1836 1849 2004-11-28 Fernando Perez <fperez@colorado.edu>
1837 1850
1838 1851 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1839 1852 cache when empty lines were present.
1840 1853
1841 1854 2004-11-24 Fernando Perez <fperez@colorado.edu>
1842 1855
1843 1856 * IPython/usage.py (__doc__): document the re-activated threading
1844 1857 options for WX and GTK.
1845 1858
1846 1859 2004-11-23 Fernando Perez <fperez@colorado.edu>
1847 1860
1848 1861 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1849 1862 the -wthread and -gthread options, along with a new -tk one to try
1850 1863 and coordinate Tk threading with wx/gtk. The tk support is very
1851 1864 platform dependent, since it seems to require Tcl and Tk to be
1852 1865 built with threads (Fedora1/2 appears NOT to have it, but in
1853 1866 Prabhu's Debian boxes it works OK). But even with some Tk
1854 1867 limitations, this is a great improvement.
1855 1868
1856 1869 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1857 1870 info in user prompts. Patch by Prabhu.
1858 1871
1859 1872 2004-11-18 Fernando Perez <fperez@colorado.edu>
1860 1873
1861 1874 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1862 1875 EOFErrors and bail, to avoid infinite loops if a non-terminating
1863 1876 file is fed into ipython. Patch submitted in issue 19 by user,
1864 1877 many thanks.
1865 1878
1866 1879 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1867 1880 autoquote/parens in continuation prompts, which can cause lots of
1868 1881 problems. Closes roundup issue 20.
1869 1882
1870 1883 2004-11-17 Fernando Perez <fperez@colorado.edu>
1871 1884
1872 1885 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1873 1886 reported as debian bug #280505. I'm not sure my local changelog
1874 1887 entry has the proper debian format (Jack?).
1875 1888
1876 1889 2004-11-08 *** Released version 0.6.4
1877 1890
1878 1891 2004-11-08 Fernando Perez <fperez@colorado.edu>
1879 1892
1880 1893 * IPython/iplib.py (init_readline): Fix exit message for Windows
1881 1894 when readline is active. Thanks to a report by Eric Jones
1882 1895 <eric-AT-enthought.com>.
1883 1896
1884 1897 2004-11-07 Fernando Perez <fperez@colorado.edu>
1885 1898
1886 1899 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1887 1900 sometimes seen by win2k/cygwin users.
1888 1901
1889 1902 2004-11-06 Fernando Perez <fperez@colorado.edu>
1890 1903
1891 1904 * IPython/iplib.py (interact): Change the handling of %Exit from
1892 1905 trying to propagate a SystemExit to an internal ipython flag.
1893 1906 This is less elegant than using Python's exception mechanism, but
1894 1907 I can't get that to work reliably with threads, so under -pylab
1895 1908 %Exit was hanging IPython. Cross-thread exception handling is
1896 1909 really a bitch. Thaks to a bug report by Stephen Walton
1897 1910 <stephen.walton-AT-csun.edu>.
1898 1911
1899 1912 2004-11-04 Fernando Perez <fperez@colorado.edu>
1900 1913
1901 1914 * IPython/iplib.py (raw_input_original): store a pointer to the
1902 1915 true raw_input to harden against code which can modify it
1903 1916 (wx.py.PyShell does this and would otherwise crash ipython).
1904 1917 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1905 1918
1906 1919 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1907 1920 Ctrl-C problem, which does not mess up the input line.
1908 1921
1909 1922 2004-11-03 Fernando Perez <fperez@colorado.edu>
1910 1923
1911 1924 * IPython/Release.py: Changed licensing to BSD, in all files.
1912 1925 (name): lowercase name for tarball/RPM release.
1913 1926
1914 1927 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1915 1928 use throughout ipython.
1916 1929
1917 1930 * IPython/Magic.py (Magic._ofind): Switch to using the new
1918 1931 OInspect.getdoc() function.
1919 1932
1920 1933 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1921 1934 of the line currently being canceled via Ctrl-C. It's extremely
1922 1935 ugly, but I don't know how to do it better (the problem is one of
1923 1936 handling cross-thread exceptions).
1924 1937
1925 1938 2004-10-28 Fernando Perez <fperez@colorado.edu>
1926 1939
1927 1940 * IPython/Shell.py (signal_handler): add signal handlers to trap
1928 1941 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1929 1942 report by Francesc Alted.
1930 1943
1931 1944 2004-10-21 Fernando Perez <fperez@colorado.edu>
1932 1945
1933 1946 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1934 1947 to % for pysh syntax extensions.
1935 1948
1936 1949 2004-10-09 Fernando Perez <fperez@colorado.edu>
1937 1950
1938 1951 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1939 1952 arrays to print a more useful summary, without calling str(arr).
1940 1953 This avoids the problem of extremely lengthy computations which
1941 1954 occur if arr is large, and appear to the user as a system lockup
1942 1955 with 100% cpu activity. After a suggestion by Kristian Sandberg
1943 1956 <Kristian.Sandberg@colorado.edu>.
1944 1957 (Magic.__init__): fix bug in global magic escapes not being
1945 1958 correctly set.
1946 1959
1947 1960 2004-10-08 Fernando Perez <fperez@colorado.edu>
1948 1961
1949 1962 * IPython/Magic.py (__license__): change to absolute imports of
1950 1963 ipython's own internal packages, to start adapting to the absolute
1951 1964 import requirement of PEP-328.
1952 1965
1953 1966 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1954 1967 files, and standardize author/license marks through the Release
1955 1968 module instead of having per/file stuff (except for files with
1956 1969 particular licenses, like the MIT/PSF-licensed codes).
1957 1970
1958 1971 * IPython/Debugger.py: remove dead code for python 2.1
1959 1972
1960 1973 2004-10-04 Fernando Perez <fperez@colorado.edu>
1961 1974
1962 1975 * IPython/iplib.py (ipmagic): New function for accessing magics
1963 1976 via a normal python function call.
1964 1977
1965 1978 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1966 1979 from '@' to '%', to accomodate the new @decorator syntax of python
1967 1980 2.4.
1968 1981
1969 1982 2004-09-29 Fernando Perez <fperez@colorado.edu>
1970 1983
1971 1984 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1972 1985 matplotlib.use to prevent running scripts which try to switch
1973 1986 interactive backends from within ipython. This will just crash
1974 1987 the python interpreter, so we can't allow it (but a detailed error
1975 1988 is given to the user).
1976 1989
1977 1990 2004-09-28 Fernando Perez <fperez@colorado.edu>
1978 1991
1979 1992 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1980 1993 matplotlib-related fixes so that using @run with non-matplotlib
1981 1994 scripts doesn't pop up spurious plot windows. This requires
1982 1995 matplotlib >= 0.63, where I had to make some changes as well.
1983 1996
1984 1997 * IPython/ipmaker.py (make_IPython): update version requirement to
1985 1998 python 2.2.
1986 1999
1987 2000 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1988 2001 banner arg for embedded customization.
1989 2002
1990 2003 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1991 2004 explicit uses of __IP as the IPython's instance name. Now things
1992 2005 are properly handled via the shell.name value. The actual code
1993 2006 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1994 2007 is much better than before. I'll clean things completely when the
1995 2008 magic stuff gets a real overhaul.
1996 2009
1997 2010 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1998 2011 minor changes to debian dir.
1999 2012
2000 2013 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2001 2014 pointer to the shell itself in the interactive namespace even when
2002 2015 a user-supplied dict is provided. This is needed for embedding
2003 2016 purposes (found by tests with Michel Sanner).
2004 2017
2005 2018 2004-09-27 Fernando Perez <fperez@colorado.edu>
2006 2019
2007 2020 * IPython/UserConfig/ipythonrc: remove []{} from
2008 2021 readline_remove_delims, so that things like [modname.<TAB> do
2009 2022 proper completion. This disables [].TAB, but that's a less common
2010 2023 case than module names in list comprehensions, for example.
2011 2024 Thanks to a report by Andrea Riciputi.
2012 2025
2013 2026 2004-09-09 Fernando Perez <fperez@colorado.edu>
2014 2027
2015 2028 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2016 2029 blocking problems in win32 and osx. Fix by John.
2017 2030
2018 2031 2004-09-08 Fernando Perez <fperez@colorado.edu>
2019 2032
2020 2033 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2021 2034 for Win32 and OSX. Fix by John Hunter.
2022 2035
2023 2036 2004-08-30 *** Released version 0.6.3
2024 2037
2025 2038 2004-08-30 Fernando Perez <fperez@colorado.edu>
2026 2039
2027 2040 * setup.py (isfile): Add manpages to list of dependent files to be
2028 2041 updated.
2029 2042
2030 2043 2004-08-27 Fernando Perez <fperez@colorado.edu>
2031 2044
2032 2045 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2033 2046 for now. They don't really work with standalone WX/GTK code
2034 2047 (though matplotlib IS working fine with both of those backends).
2035 2048 This will neeed much more testing. I disabled most things with
2036 2049 comments, so turning it back on later should be pretty easy.
2037 2050
2038 2051 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2039 2052 autocalling of expressions like r'foo', by modifying the line
2040 2053 split regexp. Closes
2041 2054 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2042 2055 Riley <ipythonbugs-AT-sabi.net>.
2043 2056 (InteractiveShell.mainloop): honor --nobanner with banner
2044 2057 extensions.
2045 2058
2046 2059 * IPython/Shell.py: Significant refactoring of all classes, so
2047 2060 that we can really support ALL matplotlib backends and threading
2048 2061 models (John spotted a bug with Tk which required this). Now we
2049 2062 should support single-threaded, WX-threads and GTK-threads, both
2050 2063 for generic code and for matplotlib.
2051 2064
2052 2065 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2053 2066 -pylab, to simplify things for users. Will also remove the pylab
2054 2067 profile, since now all of matplotlib configuration is directly
2055 2068 handled here. This also reduces startup time.
2056 2069
2057 2070 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2058 2071 shell wasn't being correctly called. Also in IPShellWX.
2059 2072
2060 2073 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2061 2074 fine-tune banner.
2062 2075
2063 2076 * IPython/numutils.py (spike): Deprecate these spike functions,
2064 2077 delete (long deprecated) gnuplot_exec handler.
2065 2078
2066 2079 2004-08-26 Fernando Perez <fperez@colorado.edu>
2067 2080
2068 2081 * ipython.1: Update for threading options, plus some others which
2069 2082 were missing.
2070 2083
2071 2084 * IPython/ipmaker.py (__call__): Added -wthread option for
2072 2085 wxpython thread handling. Make sure threading options are only
2073 2086 valid at the command line.
2074 2087
2075 2088 * scripts/ipython: moved shell selection into a factory function
2076 2089 in Shell.py, to keep the starter script to a minimum.
2077 2090
2078 2091 2004-08-25 Fernando Perez <fperez@colorado.edu>
2079 2092
2080 2093 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2081 2094 John. Along with some recent changes he made to matplotlib, the
2082 2095 next versions of both systems should work very well together.
2083 2096
2084 2097 2004-08-24 Fernando Perez <fperez@colorado.edu>
2085 2098
2086 2099 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2087 2100 tried to switch the profiling to using hotshot, but I'm getting
2088 2101 strange errors from prof.runctx() there. I may be misreading the
2089 2102 docs, but it looks weird. For now the profiling code will
2090 2103 continue to use the standard profiler.
2091 2104
2092 2105 2004-08-23 Fernando Perez <fperez@colorado.edu>
2093 2106
2094 2107 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2095 2108 threaded shell, by John Hunter. It's not quite ready yet, but
2096 2109 close.
2097 2110
2098 2111 2004-08-22 Fernando Perez <fperez@colorado.edu>
2099 2112
2100 2113 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2101 2114 in Magic and ultraTB.
2102 2115
2103 2116 * ipython.1: document threading options in manpage.
2104 2117
2105 2118 * scripts/ipython: Changed name of -thread option to -gthread,
2106 2119 since this is GTK specific. I want to leave the door open for a
2107 2120 -wthread option for WX, which will most likely be necessary. This
2108 2121 change affects usage and ipmaker as well.
2109 2122
2110 2123 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2111 2124 handle the matplotlib shell issues. Code by John Hunter
2112 2125 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2113 2126 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2114 2127 broken (and disabled for end users) for now, but it puts the
2115 2128 infrastructure in place.
2116 2129
2117 2130 2004-08-21 Fernando Perez <fperez@colorado.edu>
2118 2131
2119 2132 * ipythonrc-pylab: Add matplotlib support.
2120 2133
2121 2134 * matplotlib_config.py: new files for matplotlib support, part of
2122 2135 the pylab profile.
2123 2136
2124 2137 * IPython/usage.py (__doc__): documented the threading options.
2125 2138
2126 2139 2004-08-20 Fernando Perez <fperez@colorado.edu>
2127 2140
2128 2141 * ipython: Modified the main calling routine to handle the -thread
2129 2142 and -mpthread options. This needs to be done as a top-level hack,
2130 2143 because it determines which class to instantiate for IPython
2131 2144 itself.
2132 2145
2133 2146 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2134 2147 classes to support multithreaded GTK operation without blocking,
2135 2148 and matplotlib with all backends. This is a lot of still very
2136 2149 experimental code, and threads are tricky. So it may still have a
2137 2150 few rough edges... This code owes a lot to
2138 2151 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2139 2152 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2140 2153 to John Hunter for all the matplotlib work.
2141 2154
2142 2155 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2143 2156 options for gtk thread and matplotlib support.
2144 2157
2145 2158 2004-08-16 Fernando Perez <fperez@colorado.edu>
2146 2159
2147 2160 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2148 2161 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2149 2162 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2150 2163
2151 2164 2004-08-11 Fernando Perez <fperez@colorado.edu>
2152 2165
2153 2166 * setup.py (isfile): Fix build so documentation gets updated for
2154 2167 rpms (it was only done for .tgz builds).
2155 2168
2156 2169 2004-08-10 Fernando Perez <fperez@colorado.edu>
2157 2170
2158 2171 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2159 2172
2160 2173 * iplib.py : Silence syntax error exceptions in tab-completion.
2161 2174
2162 2175 2004-08-05 Fernando Perez <fperez@colorado.edu>
2163 2176
2164 2177 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2165 2178 'color off' mark for continuation prompts. This was causing long
2166 2179 continuation lines to mis-wrap.
2167 2180
2168 2181 2004-08-01 Fernando Perez <fperez@colorado.edu>
2169 2182
2170 2183 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2171 2184 for building ipython to be a parameter. All this is necessary
2172 2185 right now to have a multithreaded version, but this insane
2173 2186 non-design will be cleaned up soon. For now, it's a hack that
2174 2187 works.
2175 2188
2176 2189 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2177 2190 args in various places. No bugs so far, but it's a dangerous
2178 2191 practice.
2179 2192
2180 2193 2004-07-31 Fernando Perez <fperez@colorado.edu>
2181 2194
2182 2195 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2183 2196 fix completion of files with dots in their names under most
2184 2197 profiles (pysh was OK because the completion order is different).
2185 2198
2186 2199 2004-07-27 Fernando Perez <fperez@colorado.edu>
2187 2200
2188 2201 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2189 2202 keywords manually, b/c the one in keyword.py was removed in python
2190 2203 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2191 2204 This is NOT a bug under python 2.3 and earlier.
2192 2205
2193 2206 2004-07-26 Fernando Perez <fperez@colorado.edu>
2194 2207
2195 2208 * IPython/ultraTB.py (VerboseTB.text): Add another
2196 2209 linecache.checkcache() call to try to prevent inspect.py from
2197 2210 crashing under python 2.3. I think this fixes
2198 2211 http://www.scipy.net/roundup/ipython/issue17.
2199 2212
2200 2213 2004-07-26 *** Released version 0.6.2
2201 2214
2202 2215 2004-07-26 Fernando Perez <fperez@colorado.edu>
2203 2216
2204 2217 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2205 2218 fail for any number.
2206 2219 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2207 2220 empty bookmarks.
2208 2221
2209 2222 2004-07-26 *** Released version 0.6.1
2210 2223
2211 2224 2004-07-26 Fernando Perez <fperez@colorado.edu>
2212 2225
2213 2226 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2214 2227
2215 2228 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2216 2229 escaping '()[]{}' in filenames.
2217 2230
2218 2231 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2219 2232 Python 2.2 users who lack a proper shlex.split.
2220 2233
2221 2234 2004-07-19 Fernando Perez <fperez@colorado.edu>
2222 2235
2223 2236 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2224 2237 for reading readline's init file. I follow the normal chain:
2225 2238 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2226 2239 report by Mike Heeter. This closes
2227 2240 http://www.scipy.net/roundup/ipython/issue16.
2228 2241
2229 2242 2004-07-18 Fernando Perez <fperez@colorado.edu>
2230 2243
2231 2244 * IPython/iplib.py (__init__): Add better handling of '\' under
2232 2245 Win32 for filenames. After a patch by Ville.
2233 2246
2234 2247 2004-07-17 Fernando Perez <fperez@colorado.edu>
2235 2248
2236 2249 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2237 2250 autocalling would be triggered for 'foo is bar' if foo is
2238 2251 callable. I also cleaned up the autocall detection code to use a
2239 2252 regexp, which is faster. Bug reported by Alexander Schmolck.
2240 2253
2241 2254 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2242 2255 '?' in them would confuse the help system. Reported by Alex
2243 2256 Schmolck.
2244 2257
2245 2258 2004-07-16 Fernando Perez <fperez@colorado.edu>
2246 2259
2247 2260 * IPython/GnuplotInteractive.py (__all__): added plot2.
2248 2261
2249 2262 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2250 2263 plotting dictionaries, lists or tuples of 1d arrays.
2251 2264
2252 2265 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2253 2266 optimizations.
2254 2267
2255 2268 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2256 2269 the information which was there from Janko's original IPP code:
2257 2270
2258 2271 03.05.99 20:53 porto.ifm.uni-kiel.de
2259 2272 --Started changelog.
2260 2273 --make clear do what it say it does
2261 2274 --added pretty output of lines from inputcache
2262 2275 --Made Logger a mixin class, simplifies handling of switches
2263 2276 --Added own completer class. .string<TAB> expands to last history
2264 2277 line which starts with string. The new expansion is also present
2265 2278 with Ctrl-r from the readline library. But this shows, who this
2266 2279 can be done for other cases.
2267 2280 --Added convention that all shell functions should accept a
2268 2281 parameter_string This opens the door for different behaviour for
2269 2282 each function. @cd is a good example of this.
2270 2283
2271 2284 04.05.99 12:12 porto.ifm.uni-kiel.de
2272 2285 --added logfile rotation
2273 2286 --added new mainloop method which freezes first the namespace
2274 2287
2275 2288 07.05.99 21:24 porto.ifm.uni-kiel.de
2276 2289 --added the docreader classes. Now there is a help system.
2277 2290 -This is only a first try. Currently it's not easy to put new
2278 2291 stuff in the indices. But this is the way to go. Info would be
2279 2292 better, but HTML is every where and not everybody has an info
2280 2293 system installed and it's not so easy to change html-docs to info.
2281 2294 --added global logfile option
2282 2295 --there is now a hook for object inspection method pinfo needs to
2283 2296 be provided for this. Can be reached by two '??'.
2284 2297
2285 2298 08.05.99 20:51 porto.ifm.uni-kiel.de
2286 2299 --added a README
2287 2300 --bug in rc file. Something has changed so functions in the rc
2288 2301 file need to reference the shell and not self. Not clear if it's a
2289 2302 bug or feature.
2290 2303 --changed rc file for new behavior
2291 2304
2292 2305 2004-07-15 Fernando Perez <fperez@colorado.edu>
2293 2306
2294 2307 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2295 2308 cache was falling out of sync in bizarre manners when multi-line
2296 2309 input was present. Minor optimizations and cleanup.
2297 2310
2298 2311 (Logger): Remove old Changelog info for cleanup. This is the
2299 2312 information which was there from Janko's original code:
2300 2313
2301 2314 Changes to Logger: - made the default log filename a parameter
2302 2315
2303 2316 - put a check for lines beginning with !@? in log(). Needed
2304 2317 (even if the handlers properly log their lines) for mid-session
2305 2318 logging activation to work properly. Without this, lines logged
2306 2319 in mid session, which get read from the cache, would end up
2307 2320 'bare' (with !@? in the open) in the log. Now they are caught
2308 2321 and prepended with a #.
2309 2322
2310 2323 * IPython/iplib.py (InteractiveShell.init_readline): added check
2311 2324 in case MagicCompleter fails to be defined, so we don't crash.
2312 2325
2313 2326 2004-07-13 Fernando Perez <fperez@colorado.edu>
2314 2327
2315 2328 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2316 2329 of EPS if the requested filename ends in '.eps'.
2317 2330
2318 2331 2004-07-04 Fernando Perez <fperez@colorado.edu>
2319 2332
2320 2333 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2321 2334 escaping of quotes when calling the shell.
2322 2335
2323 2336 2004-07-02 Fernando Perez <fperez@colorado.edu>
2324 2337
2325 2338 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2326 2339 gettext not working because we were clobbering '_'. Fixes
2327 2340 http://www.scipy.net/roundup/ipython/issue6.
2328 2341
2329 2342 2004-07-01 Fernando Perez <fperez@colorado.edu>
2330 2343
2331 2344 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2332 2345 into @cd. Patch by Ville.
2333 2346
2334 2347 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2335 2348 new function to store things after ipmaker runs. Patch by Ville.
2336 2349 Eventually this will go away once ipmaker is removed and the class
2337 2350 gets cleaned up, but for now it's ok. Key functionality here is
2338 2351 the addition of the persistent storage mechanism, a dict for
2339 2352 keeping data across sessions (for now just bookmarks, but more can
2340 2353 be implemented later).
2341 2354
2342 2355 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2343 2356 persistent across sections. Patch by Ville, I modified it
2344 2357 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2345 2358 added a '-l' option to list all bookmarks.
2346 2359
2347 2360 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2348 2361 center for cleanup. Registered with atexit.register(). I moved
2349 2362 here the old exit_cleanup(). After a patch by Ville.
2350 2363
2351 2364 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2352 2365 characters in the hacked shlex_split for python 2.2.
2353 2366
2354 2367 * IPython/iplib.py (file_matches): more fixes to filenames with
2355 2368 whitespace in them. It's not perfect, but limitations in python's
2356 2369 readline make it impossible to go further.
2357 2370
2358 2371 2004-06-29 Fernando Perez <fperez@colorado.edu>
2359 2372
2360 2373 * IPython/iplib.py (file_matches): escape whitespace correctly in
2361 2374 filename completions. Bug reported by Ville.
2362 2375
2363 2376 2004-06-28 Fernando Perez <fperez@colorado.edu>
2364 2377
2365 2378 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2366 2379 the history file will be called 'history-PROFNAME' (or just
2367 2380 'history' if no profile is loaded). I was getting annoyed at
2368 2381 getting my Numerical work history clobbered by pysh sessions.
2369 2382
2370 2383 * IPython/iplib.py (InteractiveShell.__init__): Internal
2371 2384 getoutputerror() function so that we can honor the system_verbose
2372 2385 flag for _all_ system calls. I also added escaping of #
2373 2386 characters here to avoid confusing Itpl.
2374 2387
2375 2388 * IPython/Magic.py (shlex_split): removed call to shell in
2376 2389 parse_options and replaced it with shlex.split(). The annoying
2377 2390 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2378 2391 to backport it from 2.3, with several frail hacks (the shlex
2379 2392 module is rather limited in 2.2). Thanks to a suggestion by Ville
2380 2393 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2381 2394 problem.
2382 2395
2383 2396 (Magic.magic_system_verbose): new toggle to print the actual
2384 2397 system calls made by ipython. Mainly for debugging purposes.
2385 2398
2386 2399 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2387 2400 doesn't support persistence. Reported (and fix suggested) by
2388 2401 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2389 2402
2390 2403 2004-06-26 Fernando Perez <fperez@colorado.edu>
2391 2404
2392 2405 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2393 2406 continue prompts.
2394 2407
2395 2408 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2396 2409 function (basically a big docstring) and a few more things here to
2397 2410 speedup startup. pysh.py is now very lightweight. We want because
2398 2411 it gets execfile'd, while InterpreterExec gets imported, so
2399 2412 byte-compilation saves time.
2400 2413
2401 2414 2004-06-25 Fernando Perez <fperez@colorado.edu>
2402 2415
2403 2416 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2404 2417 -NUM', which was recently broken.
2405 2418
2406 2419 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2407 2420 in multi-line input (but not !!, which doesn't make sense there).
2408 2421
2409 2422 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2410 2423 It's just too useful, and people can turn it off in the less
2411 2424 common cases where it's a problem.
2412 2425
2413 2426 2004-06-24 Fernando Perez <fperez@colorado.edu>
2414 2427
2415 2428 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2416 2429 special syntaxes (like alias calling) is now allied in multi-line
2417 2430 input. This is still _very_ experimental, but it's necessary for
2418 2431 efficient shell usage combining python looping syntax with system
2419 2432 calls. For now it's restricted to aliases, I don't think it
2420 2433 really even makes sense to have this for magics.
2421 2434
2422 2435 2004-06-23 Fernando Perez <fperez@colorado.edu>
2423 2436
2424 2437 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2425 2438 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2426 2439
2427 2440 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2428 2441 extensions under Windows (after code sent by Gary Bishop). The
2429 2442 extensions considered 'executable' are stored in IPython's rc
2430 2443 structure as win_exec_ext.
2431 2444
2432 2445 * IPython/genutils.py (shell): new function, like system() but
2433 2446 without return value. Very useful for interactive shell work.
2434 2447
2435 2448 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2436 2449 delete aliases.
2437 2450
2438 2451 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2439 2452 sure that the alias table doesn't contain python keywords.
2440 2453
2441 2454 2004-06-21 Fernando Perez <fperez@colorado.edu>
2442 2455
2443 2456 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2444 2457 non-existent items are found in $PATH. Reported by Thorsten.
2445 2458
2446 2459 2004-06-20 Fernando Perez <fperez@colorado.edu>
2447 2460
2448 2461 * IPython/iplib.py (complete): modified the completer so that the
2449 2462 order of priorities can be easily changed at runtime.
2450 2463
2451 2464 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2452 2465 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2453 2466
2454 2467 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2455 2468 expand Python variables prepended with $ in all system calls. The
2456 2469 same was done to InteractiveShell.handle_shell_escape. Now all
2457 2470 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2458 2471 expansion of python variables and expressions according to the
2459 2472 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2460 2473
2461 2474 Though PEP-215 has been rejected, a similar (but simpler) one
2462 2475 seems like it will go into Python 2.4, PEP-292 -
2463 2476 http://www.python.org/peps/pep-0292.html.
2464 2477
2465 2478 I'll keep the full syntax of PEP-215, since IPython has since the
2466 2479 start used Ka-Ping Yee's reference implementation discussed there
2467 2480 (Itpl), and I actually like the powerful semantics it offers.
2468 2481
2469 2482 In order to access normal shell variables, the $ has to be escaped
2470 2483 via an extra $. For example:
2471 2484
2472 2485 In [7]: PATH='a python variable'
2473 2486
2474 2487 In [8]: !echo $PATH
2475 2488 a python variable
2476 2489
2477 2490 In [9]: !echo $$PATH
2478 2491 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2479 2492
2480 2493 (Magic.parse_options): escape $ so the shell doesn't evaluate
2481 2494 things prematurely.
2482 2495
2483 2496 * IPython/iplib.py (InteractiveShell.call_alias): added the
2484 2497 ability for aliases to expand python variables via $.
2485 2498
2486 2499 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2487 2500 system, now there's a @rehash/@rehashx pair of magics. These work
2488 2501 like the csh rehash command, and can be invoked at any time. They
2489 2502 build a table of aliases to everything in the user's $PATH
2490 2503 (@rehash uses everything, @rehashx is slower but only adds
2491 2504 executable files). With this, the pysh.py-based shell profile can
2492 2505 now simply call rehash upon startup, and full access to all
2493 2506 programs in the user's path is obtained.
2494 2507
2495 2508 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2496 2509 functionality is now fully in place. I removed the old dynamic
2497 2510 code generation based approach, in favor of a much lighter one
2498 2511 based on a simple dict. The advantage is that this allows me to
2499 2512 now have thousands of aliases with negligible cost (unthinkable
2500 2513 with the old system).
2501 2514
2502 2515 2004-06-19 Fernando Perez <fperez@colorado.edu>
2503 2516
2504 2517 * IPython/iplib.py (__init__): extended MagicCompleter class to
2505 2518 also complete (last in priority) on user aliases.
2506 2519
2507 2520 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2508 2521 call to eval.
2509 2522 (ItplNS.__init__): Added a new class which functions like Itpl,
2510 2523 but allows configuring the namespace for the evaluation to occur
2511 2524 in.
2512 2525
2513 2526 2004-06-18 Fernando Perez <fperez@colorado.edu>
2514 2527
2515 2528 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2516 2529 better message when 'exit' or 'quit' are typed (a common newbie
2517 2530 confusion).
2518 2531
2519 2532 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2520 2533 check for Windows users.
2521 2534
2522 2535 * IPython/iplib.py (InteractiveShell.user_setup): removed
2523 2536 disabling of colors for Windows. I'll test at runtime and issue a
2524 2537 warning if Gary's readline isn't found, as to nudge users to
2525 2538 download it.
2526 2539
2527 2540 2004-06-16 Fernando Perez <fperez@colorado.edu>
2528 2541
2529 2542 * IPython/genutils.py (Stream.__init__): changed to print errors
2530 2543 to sys.stderr. I had a circular dependency here. Now it's
2531 2544 possible to run ipython as IDLE's shell (consider this pre-alpha,
2532 2545 since true stdout things end up in the starting terminal instead
2533 2546 of IDLE's out).
2534 2547
2535 2548 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2536 2549 users who haven't # updated their prompt_in2 definitions. Remove
2537 2550 eventually.
2538 2551 (multiple_replace): added credit to original ASPN recipe.
2539 2552
2540 2553 2004-06-15 Fernando Perez <fperez@colorado.edu>
2541 2554
2542 2555 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2543 2556 list of auto-defined aliases.
2544 2557
2545 2558 2004-06-13 Fernando Perez <fperez@colorado.edu>
2546 2559
2547 2560 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2548 2561 install was really requested (so setup.py can be used for other
2549 2562 things under Windows).
2550 2563
2551 2564 2004-06-10 Fernando Perez <fperez@colorado.edu>
2552 2565
2553 2566 * IPython/Logger.py (Logger.create_log): Manually remove any old
2554 2567 backup, since os.remove may fail under Windows. Fixes bug
2555 2568 reported by Thorsten.
2556 2569
2557 2570 2004-06-09 Fernando Perez <fperez@colorado.edu>
2558 2571
2559 2572 * examples/example-embed.py: fixed all references to %n (replaced
2560 2573 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2561 2574 for all examples and the manual as well.
2562 2575
2563 2576 2004-06-08 Fernando Perez <fperez@colorado.edu>
2564 2577
2565 2578 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2566 2579 alignment and color management. All 3 prompt subsystems now
2567 2580 inherit from BasePrompt.
2568 2581
2569 2582 * tools/release: updates for windows installer build and tag rpms
2570 2583 with python version (since paths are fixed).
2571 2584
2572 2585 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2573 2586 which will become eventually obsolete. Also fixed the default
2574 2587 prompt_in2 to use \D, so at least new users start with the correct
2575 2588 defaults.
2576 2589 WARNING: Users with existing ipythonrc files will need to apply
2577 2590 this fix manually!
2578 2591
2579 2592 * setup.py: make windows installer (.exe). This is finally the
2580 2593 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2581 2594 which I hadn't included because it required Python 2.3 (or recent
2582 2595 distutils).
2583 2596
2584 2597 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2585 2598 usage of new '\D' escape.
2586 2599
2587 2600 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2588 2601 lacks os.getuid())
2589 2602 (CachedOutput.set_colors): Added the ability to turn coloring
2590 2603 on/off with @colors even for manually defined prompt colors. It
2591 2604 uses a nasty global, but it works safely and via the generic color
2592 2605 handling mechanism.
2593 2606 (Prompt2.__init__): Introduced new escape '\D' for continuation
2594 2607 prompts. It represents the counter ('\#') as dots.
2595 2608 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2596 2609 need to update their ipythonrc files and replace '%n' with '\D' in
2597 2610 their prompt_in2 settings everywhere. Sorry, but there's
2598 2611 otherwise no clean way to get all prompts to properly align. The
2599 2612 ipythonrc shipped with IPython has been updated.
2600 2613
2601 2614 2004-06-07 Fernando Perez <fperez@colorado.edu>
2602 2615
2603 2616 * setup.py (isfile): Pass local_icons option to latex2html, so the
2604 2617 resulting HTML file is self-contained. Thanks to
2605 2618 dryice-AT-liu.com.cn for the tip.
2606 2619
2607 2620 * pysh.py: I created a new profile 'shell', which implements a
2608 2621 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2609 2622 system shell, nor will it become one anytime soon. It's mainly
2610 2623 meant to illustrate the use of the new flexible bash-like prompts.
2611 2624 I guess it could be used by hardy souls for true shell management,
2612 2625 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2613 2626 profile. This uses the InterpreterExec extension provided by
2614 2627 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2615 2628
2616 2629 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2617 2630 auto-align itself with the length of the previous input prompt
2618 2631 (taking into account the invisible color escapes).
2619 2632 (CachedOutput.__init__): Large restructuring of this class. Now
2620 2633 all three prompts (primary1, primary2, output) are proper objects,
2621 2634 managed by the 'parent' CachedOutput class. The code is still a
2622 2635 bit hackish (all prompts share state via a pointer to the cache),
2623 2636 but it's overall far cleaner than before.
2624 2637
2625 2638 * IPython/genutils.py (getoutputerror): modified to add verbose,
2626 2639 debug and header options. This makes the interface of all getout*
2627 2640 functions uniform.
2628 2641 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2629 2642
2630 2643 * IPython/Magic.py (Magic.default_option): added a function to
2631 2644 allow registering default options for any magic command. This
2632 2645 makes it easy to have profiles which customize the magics globally
2633 2646 for a certain use. The values set through this function are
2634 2647 picked up by the parse_options() method, which all magics should
2635 2648 use to parse their options.
2636 2649
2637 2650 * IPython/genutils.py (warn): modified the warnings framework to
2638 2651 use the Term I/O class. I'm trying to slowly unify all of
2639 2652 IPython's I/O operations to pass through Term.
2640 2653
2641 2654 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2642 2655 the secondary prompt to correctly match the length of the primary
2643 2656 one for any prompt. Now multi-line code will properly line up
2644 2657 even for path dependent prompts, such as the new ones available
2645 2658 via the prompt_specials.
2646 2659
2647 2660 2004-06-06 Fernando Perez <fperez@colorado.edu>
2648 2661
2649 2662 * IPython/Prompts.py (prompt_specials): Added the ability to have
2650 2663 bash-like special sequences in the prompts, which get
2651 2664 automatically expanded. Things like hostname, current working
2652 2665 directory and username are implemented already, but it's easy to
2653 2666 add more in the future. Thanks to a patch by W.J. van der Laan
2654 2667 <gnufnork-AT-hetdigitalegat.nl>
2655 2668 (prompt_specials): Added color support for prompt strings, so
2656 2669 users can define arbitrary color setups for their prompts.
2657 2670
2658 2671 2004-06-05 Fernando Perez <fperez@colorado.edu>
2659 2672
2660 2673 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2661 2674 code to load Gary Bishop's readline and configure it
2662 2675 automatically. Thanks to Gary for help on this.
2663 2676
2664 2677 2004-06-01 Fernando Perez <fperez@colorado.edu>
2665 2678
2666 2679 * IPython/Logger.py (Logger.create_log): fix bug for logging
2667 2680 with no filename (previous fix was incomplete).
2668 2681
2669 2682 2004-05-25 Fernando Perez <fperez@colorado.edu>
2670 2683
2671 2684 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2672 2685 parens would get passed to the shell.
2673 2686
2674 2687 2004-05-20 Fernando Perez <fperez@colorado.edu>
2675 2688
2676 2689 * IPython/Magic.py (Magic.magic_prun): changed default profile
2677 2690 sort order to 'time' (the more common profiling need).
2678 2691
2679 2692 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2680 2693 so that source code shown is guaranteed in sync with the file on
2681 2694 disk (also changed in psource). Similar fix to the one for
2682 2695 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2683 2696 <yann.ledu-AT-noos.fr>.
2684 2697
2685 2698 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2686 2699 with a single option would not be correctly parsed. Closes
2687 2700 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2688 2701 introduced in 0.6.0 (on 2004-05-06).
2689 2702
2690 2703 2004-05-13 *** Released version 0.6.0
2691 2704
2692 2705 2004-05-13 Fernando Perez <fperez@colorado.edu>
2693 2706
2694 2707 * debian/: Added debian/ directory to CVS, so that debian support
2695 2708 is publicly accessible. The debian package is maintained by Jack
2696 2709 Moffit <jack-AT-xiph.org>.
2697 2710
2698 2711 * Documentation: included the notes about an ipython-based system
2699 2712 shell (the hypothetical 'pysh') into the new_design.pdf document,
2700 2713 so that these ideas get distributed to users along with the
2701 2714 official documentation.
2702 2715
2703 2716 2004-05-10 Fernando Perez <fperez@colorado.edu>
2704 2717
2705 2718 * IPython/Logger.py (Logger.create_log): fix recently introduced
2706 2719 bug (misindented line) where logstart would fail when not given an
2707 2720 explicit filename.
2708 2721
2709 2722 2004-05-09 Fernando Perez <fperez@colorado.edu>
2710 2723
2711 2724 * IPython/Magic.py (Magic.parse_options): skip system call when
2712 2725 there are no options to look for. Faster, cleaner for the common
2713 2726 case.
2714 2727
2715 2728 * Documentation: many updates to the manual: describing Windows
2716 2729 support better, Gnuplot updates, credits, misc small stuff. Also
2717 2730 updated the new_design doc a bit.
2718 2731
2719 2732 2004-05-06 *** Released version 0.6.0.rc1
2720 2733
2721 2734 2004-05-06 Fernando Perez <fperez@colorado.edu>
2722 2735
2723 2736 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2724 2737 operations to use the vastly more efficient list/''.join() method.
2725 2738 (FormattedTB.text): Fix
2726 2739 http://www.scipy.net/roundup/ipython/issue12 - exception source
2727 2740 extract not updated after reload. Thanks to Mike Salib
2728 2741 <msalib-AT-mit.edu> for pinning the source of the problem.
2729 2742 Fortunately, the solution works inside ipython and doesn't require
2730 2743 any changes to python proper.
2731 2744
2732 2745 * IPython/Magic.py (Magic.parse_options): Improved to process the
2733 2746 argument list as a true shell would (by actually using the
2734 2747 underlying system shell). This way, all @magics automatically get
2735 2748 shell expansion for variables. Thanks to a comment by Alex
2736 2749 Schmolck.
2737 2750
2738 2751 2004-04-04 Fernando Perez <fperez@colorado.edu>
2739 2752
2740 2753 * IPython/iplib.py (InteractiveShell.interact): Added a special
2741 2754 trap for a debugger quit exception, which is basically impossible
2742 2755 to handle by normal mechanisms, given what pdb does to the stack.
2743 2756 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2744 2757
2745 2758 2004-04-03 Fernando Perez <fperez@colorado.edu>
2746 2759
2747 2760 * IPython/genutils.py (Term): Standardized the names of the Term
2748 2761 class streams to cin/cout/cerr, following C++ naming conventions
2749 2762 (I can't use in/out/err because 'in' is not a valid attribute
2750 2763 name).
2751 2764
2752 2765 * IPython/iplib.py (InteractiveShell.interact): don't increment
2753 2766 the prompt if there's no user input. By Daniel 'Dang' Griffith
2754 2767 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2755 2768 Francois Pinard.
2756 2769
2757 2770 2004-04-02 Fernando Perez <fperez@colorado.edu>
2758 2771
2759 2772 * IPython/genutils.py (Stream.__init__): Modified to survive at
2760 2773 least importing in contexts where stdin/out/err aren't true file
2761 2774 objects, such as PyCrust (they lack fileno() and mode). However,
2762 2775 the recovery facilities which rely on these things existing will
2763 2776 not work.
2764 2777
2765 2778 2004-04-01 Fernando Perez <fperez@colorado.edu>
2766 2779
2767 2780 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2768 2781 use the new getoutputerror() function, so it properly
2769 2782 distinguishes stdout/err.
2770 2783
2771 2784 * IPython/genutils.py (getoutputerror): added a function to
2772 2785 capture separately the standard output and error of a command.
2773 2786 After a comment from dang on the mailing lists. This code is
2774 2787 basically a modified version of commands.getstatusoutput(), from
2775 2788 the standard library.
2776 2789
2777 2790 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2778 2791 '!!' as a special syntax (shorthand) to access @sx.
2779 2792
2780 2793 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2781 2794 command and return its output as a list split on '\n'.
2782 2795
2783 2796 2004-03-31 Fernando Perez <fperez@colorado.edu>
2784 2797
2785 2798 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2786 2799 method to dictionaries used as FakeModule instances if they lack
2787 2800 it. At least pydoc in python2.3 breaks for runtime-defined
2788 2801 functions without this hack. At some point I need to _really_
2789 2802 understand what FakeModule is doing, because it's a gross hack.
2790 2803 But it solves Arnd's problem for now...
2791 2804
2792 2805 2004-02-27 Fernando Perez <fperez@colorado.edu>
2793 2806
2794 2807 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2795 2808 mode would behave erratically. Also increased the number of
2796 2809 possible logs in rotate mod to 999. Thanks to Rod Holland
2797 2810 <rhh@StructureLABS.com> for the report and fixes.
2798 2811
2799 2812 2004-02-26 Fernando Perez <fperez@colorado.edu>
2800 2813
2801 2814 * IPython/genutils.py (page): Check that the curses module really
2802 2815 has the initscr attribute before trying to use it. For some
2803 2816 reason, the Solaris curses module is missing this. I think this
2804 2817 should be considered a Solaris python bug, but I'm not sure.
2805 2818
2806 2819 2004-01-17 Fernando Perez <fperez@colorado.edu>
2807 2820
2808 2821 * IPython/genutils.py (Stream.__init__): Changes to try to make
2809 2822 ipython robust against stdin/out/err being closed by the user.
2810 2823 This is 'user error' (and blocks a normal python session, at least
2811 2824 the stdout case). However, Ipython should be able to survive such
2812 2825 instances of abuse as gracefully as possible. To simplify the
2813 2826 coding and maintain compatibility with Gary Bishop's Term
2814 2827 contributions, I've made use of classmethods for this. I think
2815 2828 this introduces a dependency on python 2.2.
2816 2829
2817 2830 2004-01-13 Fernando Perez <fperez@colorado.edu>
2818 2831
2819 2832 * IPython/numutils.py (exp_safe): simplified the code a bit and
2820 2833 removed the need for importing the kinds module altogether.
2821 2834
2822 2835 2004-01-06 Fernando Perez <fperez@colorado.edu>
2823 2836
2824 2837 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2825 2838 a magic function instead, after some community feedback. No
2826 2839 special syntax will exist for it, but its name is deliberately
2827 2840 very short.
2828 2841
2829 2842 2003-12-20 Fernando Perez <fperez@colorado.edu>
2830 2843
2831 2844 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2832 2845 new functionality, to automagically assign the result of a shell
2833 2846 command to a variable. I'll solicit some community feedback on
2834 2847 this before making it permanent.
2835 2848
2836 2849 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2837 2850 requested about callables for which inspect couldn't obtain a
2838 2851 proper argspec. Thanks to a crash report sent by Etienne
2839 2852 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2840 2853
2841 2854 2003-12-09 Fernando Perez <fperez@colorado.edu>
2842 2855
2843 2856 * IPython/genutils.py (page): patch for the pager to work across
2844 2857 various versions of Windows. By Gary Bishop.
2845 2858
2846 2859 2003-12-04 Fernando Perez <fperez@colorado.edu>
2847 2860
2848 2861 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2849 2862 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2850 2863 While I tested this and it looks ok, there may still be corner
2851 2864 cases I've missed.
2852 2865
2853 2866 2003-12-01 Fernando Perez <fperez@colorado.edu>
2854 2867
2855 2868 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2856 2869 where a line like 'p,q=1,2' would fail because the automagic
2857 2870 system would be triggered for @p.
2858 2871
2859 2872 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2860 2873 cleanups, code unmodified.
2861 2874
2862 2875 * IPython/genutils.py (Term): added a class for IPython to handle
2863 2876 output. In most cases it will just be a proxy for stdout/err, but
2864 2877 having this allows modifications to be made for some platforms,
2865 2878 such as handling color escapes under Windows. All of this code
2866 2879 was contributed by Gary Bishop, with minor modifications by me.
2867 2880 The actual changes affect many files.
2868 2881
2869 2882 2003-11-30 Fernando Perez <fperez@colorado.edu>
2870 2883
2871 2884 * IPython/iplib.py (file_matches): new completion code, courtesy
2872 2885 of Jeff Collins. This enables filename completion again under
2873 2886 python 2.3, which disabled it at the C level.
2874 2887
2875 2888 2003-11-11 Fernando Perez <fperez@colorado.edu>
2876 2889
2877 2890 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2878 2891 for Numeric.array(map(...)), but often convenient.
2879 2892
2880 2893 2003-11-05 Fernando Perez <fperez@colorado.edu>
2881 2894
2882 2895 * IPython/numutils.py (frange): Changed a call from int() to
2883 2896 int(round()) to prevent a problem reported with arange() in the
2884 2897 numpy list.
2885 2898
2886 2899 2003-10-06 Fernando Perez <fperez@colorado.edu>
2887 2900
2888 2901 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2889 2902 prevent crashes if sys lacks an argv attribute (it happens with
2890 2903 embedded interpreters which build a bare-bones sys module).
2891 2904 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2892 2905
2893 2906 2003-09-24 Fernando Perez <fperez@colorado.edu>
2894 2907
2895 2908 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2896 2909 to protect against poorly written user objects where __getattr__
2897 2910 raises exceptions other than AttributeError. Thanks to a bug
2898 2911 report by Oliver Sander <osander-AT-gmx.de>.
2899 2912
2900 2913 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2901 2914 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2902 2915
2903 2916 2003-09-09 Fernando Perez <fperez@colorado.edu>
2904 2917
2905 2918 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2906 2919 unpacking a list whith a callable as first element would
2907 2920 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2908 2921 Collins.
2909 2922
2910 2923 2003-08-25 *** Released version 0.5.0
2911 2924
2912 2925 2003-08-22 Fernando Perez <fperez@colorado.edu>
2913 2926
2914 2927 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2915 2928 improperly defined user exceptions. Thanks to feedback from Mark
2916 2929 Russell <mrussell-AT-verio.net>.
2917 2930
2918 2931 2003-08-20 Fernando Perez <fperez@colorado.edu>
2919 2932
2920 2933 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2921 2934 printing so that it would print multi-line string forms starting
2922 2935 with a new line. This way the formatting is better respected for
2923 2936 objects which work hard to make nice string forms.
2924 2937
2925 2938 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2926 2939 autocall would overtake data access for objects with both
2927 2940 __getitem__ and __call__.
2928 2941
2929 2942 2003-08-19 *** Released version 0.5.0-rc1
2930 2943
2931 2944 2003-08-19 Fernando Perez <fperez@colorado.edu>
2932 2945
2933 2946 * IPython/deep_reload.py (load_tail): single tiny change here
2934 2947 seems to fix the long-standing bug of dreload() failing to work
2935 2948 for dotted names. But this module is pretty tricky, so I may have
2936 2949 missed some subtlety. Needs more testing!.
2937 2950
2938 2951 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2939 2952 exceptions which have badly implemented __str__ methods.
2940 2953 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2941 2954 which I've been getting reports about from Python 2.3 users. I
2942 2955 wish I had a simple test case to reproduce the problem, so I could
2943 2956 either write a cleaner workaround or file a bug report if
2944 2957 necessary.
2945 2958
2946 2959 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2947 2960 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2948 2961 a bug report by Tjabo Kloppenburg.
2949 2962
2950 2963 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2951 2964 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2952 2965 seems rather unstable. Thanks to a bug report by Tjabo
2953 2966 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2954 2967
2955 2968 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2956 2969 this out soon because of the critical fixes in the inner loop for
2957 2970 generators.
2958 2971
2959 2972 * IPython/Magic.py (Magic.getargspec): removed. This (and
2960 2973 _get_def) have been obsoleted by OInspect for a long time, I
2961 2974 hadn't noticed that they were dead code.
2962 2975 (Magic._ofind): restored _ofind functionality for a few literals
2963 2976 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2964 2977 for things like "hello".capitalize?, since that would require a
2965 2978 potentially dangerous eval() again.
2966 2979
2967 2980 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2968 2981 logic a bit more to clean up the escapes handling and minimize the
2969 2982 use of _ofind to only necessary cases. The interactive 'feel' of
2970 2983 IPython should have improved quite a bit with the changes in
2971 2984 _prefilter and _ofind (besides being far safer than before).
2972 2985
2973 2986 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2974 2987 obscure, never reported). Edit would fail to find the object to
2975 2988 edit under some circumstances.
2976 2989 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2977 2990 which were causing double-calling of generators. Those eval calls
2978 2991 were _very_ dangerous, since code with side effects could be
2979 2992 triggered. As they say, 'eval is evil'... These were the
2980 2993 nastiest evals in IPython. Besides, _ofind is now far simpler,
2981 2994 and it should also be quite a bit faster. Its use of inspect is
2982 2995 also safer, so perhaps some of the inspect-related crashes I've
2983 2996 seen lately with Python 2.3 might be taken care of. That will
2984 2997 need more testing.
2985 2998
2986 2999 2003-08-17 Fernando Perez <fperez@colorado.edu>
2987 3000
2988 3001 * IPython/iplib.py (InteractiveShell._prefilter): significant
2989 3002 simplifications to the logic for handling user escapes. Faster
2990 3003 and simpler code.
2991 3004
2992 3005 2003-08-14 Fernando Perez <fperez@colorado.edu>
2993 3006
2994 3007 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2995 3008 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2996 3009 but it should be quite a bit faster. And the recursive version
2997 3010 generated O(log N) intermediate storage for all rank>1 arrays,
2998 3011 even if they were contiguous.
2999 3012 (l1norm): Added this function.
3000 3013 (norm): Added this function for arbitrary norms (including
3001 3014 l-infinity). l1 and l2 are still special cases for convenience
3002 3015 and speed.
3003 3016
3004 3017 2003-08-03 Fernando Perez <fperez@colorado.edu>
3005 3018
3006 3019 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3007 3020 exceptions, which now raise PendingDeprecationWarnings in Python
3008 3021 2.3. There were some in Magic and some in Gnuplot2.
3009 3022
3010 3023 2003-06-30 Fernando Perez <fperez@colorado.edu>
3011 3024
3012 3025 * IPython/genutils.py (page): modified to call curses only for
3013 3026 terminals where TERM=='xterm'. After problems under many other
3014 3027 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3015 3028
3016 3029 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3017 3030 would be triggered when readline was absent. This was just an old
3018 3031 debugging statement I'd forgotten to take out.
3019 3032
3020 3033 2003-06-20 Fernando Perez <fperez@colorado.edu>
3021 3034
3022 3035 * IPython/genutils.py (clock): modified to return only user time
3023 3036 (not counting system time), after a discussion on scipy. While
3024 3037 system time may be a useful quantity occasionally, it may much
3025 3038 more easily be skewed by occasional swapping or other similar
3026 3039 activity.
3027 3040
3028 3041 2003-06-05 Fernando Perez <fperez@colorado.edu>
3029 3042
3030 3043 * IPython/numutils.py (identity): new function, for building
3031 3044 arbitrary rank Kronecker deltas (mostly backwards compatible with
3032 3045 Numeric.identity)
3033 3046
3034 3047 2003-06-03 Fernando Perez <fperez@colorado.edu>
3035 3048
3036 3049 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3037 3050 arguments passed to magics with spaces, to allow trailing '\' to
3038 3051 work normally (mainly for Windows users).
3039 3052
3040 3053 2003-05-29 Fernando Perez <fperez@colorado.edu>
3041 3054
3042 3055 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3043 3056 instead of pydoc.help. This fixes a bizarre behavior where
3044 3057 printing '%s' % locals() would trigger the help system. Now
3045 3058 ipython behaves like normal python does.
3046 3059
3047 3060 Note that if one does 'from pydoc import help', the bizarre
3048 3061 behavior returns, but this will also happen in normal python, so
3049 3062 it's not an ipython bug anymore (it has to do with how pydoc.help
3050 3063 is implemented).
3051 3064
3052 3065 2003-05-22 Fernando Perez <fperez@colorado.edu>
3053 3066
3054 3067 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3055 3068 return [] instead of None when nothing matches, also match to end
3056 3069 of line. Patch by Gary Bishop.
3057 3070
3058 3071 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3059 3072 protection as before, for files passed on the command line. This
3060 3073 prevents the CrashHandler from kicking in if user files call into
3061 3074 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3062 3075 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3063 3076
3064 3077 2003-05-20 *** Released version 0.4.0
3065 3078
3066 3079 2003-05-20 Fernando Perez <fperez@colorado.edu>
3067 3080
3068 3081 * setup.py: added support for manpages. It's a bit hackish b/c of
3069 3082 a bug in the way the bdist_rpm distutils target handles gzipped
3070 3083 manpages, but it works. After a patch by Jack.
3071 3084
3072 3085 2003-05-19 Fernando Perez <fperez@colorado.edu>
3073 3086
3074 3087 * IPython/numutils.py: added a mockup of the kinds module, since
3075 3088 it was recently removed from Numeric. This way, numutils will
3076 3089 work for all users even if they are missing kinds.
3077 3090
3078 3091 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3079 3092 failure, which can occur with SWIG-wrapped extensions. After a
3080 3093 crash report from Prabhu.
3081 3094
3082 3095 2003-05-16 Fernando Perez <fperez@colorado.edu>
3083 3096
3084 3097 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3085 3098 protect ipython from user code which may call directly
3086 3099 sys.excepthook (this looks like an ipython crash to the user, even
3087 3100 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3088 3101 This is especially important to help users of WxWindows, but may
3089 3102 also be useful in other cases.
3090 3103
3091 3104 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3092 3105 an optional tb_offset to be specified, and to preserve exception
3093 3106 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3094 3107
3095 3108 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3096 3109
3097 3110 2003-05-15 Fernando Perez <fperez@colorado.edu>
3098 3111
3099 3112 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3100 3113 installing for a new user under Windows.
3101 3114
3102 3115 2003-05-12 Fernando Perez <fperez@colorado.edu>
3103 3116
3104 3117 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3105 3118 handler for Emacs comint-based lines. Currently it doesn't do
3106 3119 much (but importantly, it doesn't update the history cache). In
3107 3120 the future it may be expanded if Alex needs more functionality
3108 3121 there.
3109 3122
3110 3123 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3111 3124 info to crash reports.
3112 3125
3113 3126 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3114 3127 just like Python's -c. Also fixed crash with invalid -color
3115 3128 option value at startup. Thanks to Will French
3116 3129 <wfrench-AT-bestweb.net> for the bug report.
3117 3130
3118 3131 2003-05-09 Fernando Perez <fperez@colorado.edu>
3119 3132
3120 3133 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3121 3134 to EvalDict (it's a mapping, after all) and simplified its code
3122 3135 quite a bit, after a nice discussion on c.l.py where Gustavo
3123 3136 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3124 3137
3125 3138 2003-04-30 Fernando Perez <fperez@colorado.edu>
3126 3139
3127 3140 * IPython/genutils.py (timings_out): modified it to reduce its
3128 3141 overhead in the common reps==1 case.
3129 3142
3130 3143 2003-04-29 Fernando Perez <fperez@colorado.edu>
3131 3144
3132 3145 * IPython/genutils.py (timings_out): Modified to use the resource
3133 3146 module, which avoids the wraparound problems of time.clock().
3134 3147
3135 3148 2003-04-17 *** Released version 0.2.15pre4
3136 3149
3137 3150 2003-04-17 Fernando Perez <fperez@colorado.edu>
3138 3151
3139 3152 * setup.py (scriptfiles): Split windows-specific stuff over to a
3140 3153 separate file, in an attempt to have a Windows GUI installer.
3141 3154 That didn't work, but part of the groundwork is done.
3142 3155
3143 3156 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3144 3157 indent/unindent with 4 spaces. Particularly useful in combination
3145 3158 with the new auto-indent option.
3146 3159
3147 3160 2003-04-16 Fernando Perez <fperez@colorado.edu>
3148 3161
3149 3162 * IPython/Magic.py: various replacements of self.rc for
3150 3163 self.shell.rc. A lot more remains to be done to fully disentangle
3151 3164 this class from the main Shell class.
3152 3165
3153 3166 * IPython/GnuplotRuntime.py: added checks for mouse support so
3154 3167 that we don't try to enable it if the current gnuplot doesn't
3155 3168 really support it. Also added checks so that we don't try to
3156 3169 enable persist under Windows (where Gnuplot doesn't recognize the
3157 3170 option).
3158 3171
3159 3172 * IPython/iplib.py (InteractiveShell.interact): Added optional
3160 3173 auto-indenting code, after a patch by King C. Shu
3161 3174 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3162 3175 get along well with pasting indented code. If I ever figure out
3163 3176 how to make that part go well, it will become on by default.
3164 3177
3165 3178 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3166 3179 crash ipython if there was an unmatched '%' in the user's prompt
3167 3180 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3168 3181
3169 3182 * IPython/iplib.py (InteractiveShell.interact): removed the
3170 3183 ability to ask the user whether he wants to crash or not at the
3171 3184 'last line' exception handler. Calling functions at that point
3172 3185 changes the stack, and the error reports would have incorrect
3173 3186 tracebacks.
3174 3187
3175 3188 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3176 3189 pass through a peger a pretty-printed form of any object. After a
3177 3190 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3178 3191
3179 3192 2003-04-14 Fernando Perez <fperez@colorado.edu>
3180 3193
3181 3194 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3182 3195 all files in ~ would be modified at first install (instead of
3183 3196 ~/.ipython). This could be potentially disastrous, as the
3184 3197 modification (make line-endings native) could damage binary files.
3185 3198
3186 3199 2003-04-10 Fernando Perez <fperez@colorado.edu>
3187 3200
3188 3201 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3189 3202 handle only lines which are invalid python. This now means that
3190 3203 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3191 3204 for the bug report.
3192 3205
3193 3206 2003-04-01 Fernando Perez <fperez@colorado.edu>
3194 3207
3195 3208 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3196 3209 where failing to set sys.last_traceback would crash pdb.pm().
3197 3210 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3198 3211 report.
3199 3212
3200 3213 2003-03-25 Fernando Perez <fperez@colorado.edu>
3201 3214
3202 3215 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3203 3216 before printing it (it had a lot of spurious blank lines at the
3204 3217 end).
3205 3218
3206 3219 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3207 3220 output would be sent 21 times! Obviously people don't use this
3208 3221 too often, or I would have heard about it.
3209 3222
3210 3223 2003-03-24 Fernando Perez <fperez@colorado.edu>
3211 3224
3212 3225 * setup.py (scriptfiles): renamed the data_files parameter from
3213 3226 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3214 3227 for the patch.
3215 3228
3216 3229 2003-03-20 Fernando Perez <fperez@colorado.edu>
3217 3230
3218 3231 * IPython/genutils.py (error): added error() and fatal()
3219 3232 functions.
3220 3233
3221 3234 2003-03-18 *** Released version 0.2.15pre3
3222 3235
3223 3236 2003-03-18 Fernando Perez <fperez@colorado.edu>
3224 3237
3225 3238 * setupext/install_data_ext.py
3226 3239 (install_data_ext.initialize_options): Class contributed by Jack
3227 3240 Moffit for fixing the old distutils hack. He is sending this to
3228 3241 the distutils folks so in the future we may not need it as a
3229 3242 private fix.
3230 3243
3231 3244 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3232 3245 changes for Debian packaging. See his patch for full details.
3233 3246 The old distutils hack of making the ipythonrc* files carry a
3234 3247 bogus .py extension is gone, at last. Examples were moved to a
3235 3248 separate subdir under doc/, and the separate executable scripts
3236 3249 now live in their own directory. Overall a great cleanup. The
3237 3250 manual was updated to use the new files, and setup.py has been
3238 3251 fixed for this setup.
3239 3252
3240 3253 * IPython/PyColorize.py (Parser.usage): made non-executable and
3241 3254 created a pycolor wrapper around it to be included as a script.
3242 3255
3243 3256 2003-03-12 *** Released version 0.2.15pre2
3244 3257
3245 3258 2003-03-12 Fernando Perez <fperez@colorado.edu>
3246 3259
3247 3260 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3248 3261 long-standing problem with garbage characters in some terminals.
3249 3262 The issue was really that the \001 and \002 escapes must _only_ be
3250 3263 passed to input prompts (which call readline), but _never_ to
3251 3264 normal text to be printed on screen. I changed ColorANSI to have
3252 3265 two classes: TermColors and InputTermColors, each with the
3253 3266 appropriate escapes for input prompts or normal text. The code in
3254 3267 Prompts.py got slightly more complicated, but this very old and
3255 3268 annoying bug is finally fixed.
3256 3269
3257 3270 All the credit for nailing down the real origin of this problem
3258 3271 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3259 3272 *Many* thanks to him for spending quite a bit of effort on this.
3260 3273
3261 3274 2003-03-05 *** Released version 0.2.15pre1
3262 3275
3263 3276 2003-03-03 Fernando Perez <fperez@colorado.edu>
3264 3277
3265 3278 * IPython/FakeModule.py: Moved the former _FakeModule to a
3266 3279 separate file, because it's also needed by Magic (to fix a similar
3267 3280 pickle-related issue in @run).
3268 3281
3269 3282 2003-03-02 Fernando Perez <fperez@colorado.edu>
3270 3283
3271 3284 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3272 3285 the autocall option at runtime.
3273 3286 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3274 3287 across Magic.py to start separating Magic from InteractiveShell.
3275 3288 (Magic._ofind): Fixed to return proper namespace for dotted
3276 3289 names. Before, a dotted name would always return 'not currently
3277 3290 defined', because it would find the 'parent'. s.x would be found,
3278 3291 but since 'x' isn't defined by itself, it would get confused.
3279 3292 (Magic.magic_run): Fixed pickling problems reported by Ralf
3280 3293 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3281 3294 that I'd used when Mike Heeter reported similar issues at the
3282 3295 top-level, but now for @run. It boils down to injecting the
3283 3296 namespace where code is being executed with something that looks
3284 3297 enough like a module to fool pickle.dump(). Since a pickle stores
3285 3298 a named reference to the importing module, we need this for
3286 3299 pickles to save something sensible.
3287 3300
3288 3301 * IPython/ipmaker.py (make_IPython): added an autocall option.
3289 3302
3290 3303 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3291 3304 the auto-eval code. Now autocalling is an option, and the code is
3292 3305 also vastly safer. There is no more eval() involved at all.
3293 3306
3294 3307 2003-03-01 Fernando Perez <fperez@colorado.edu>
3295 3308
3296 3309 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3297 3310 dict with named keys instead of a tuple.
3298 3311
3299 3312 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3300 3313
3301 3314 * setup.py (make_shortcut): Fixed message about directories
3302 3315 created during Windows installation (the directories were ok, just
3303 3316 the printed message was misleading). Thanks to Chris Liechti
3304 3317 <cliechti-AT-gmx.net> for the heads up.
3305 3318
3306 3319 2003-02-21 Fernando Perez <fperez@colorado.edu>
3307 3320
3308 3321 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3309 3322 of ValueError exception when checking for auto-execution. This
3310 3323 one is raised by things like Numeric arrays arr.flat when the
3311 3324 array is non-contiguous.
3312 3325
3313 3326 2003-01-31 Fernando Perez <fperez@colorado.edu>
3314 3327
3315 3328 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3316 3329 not return any value at all (even though the command would get
3317 3330 executed).
3318 3331 (xsys): Flush stdout right after printing the command to ensure
3319 3332 proper ordering of commands and command output in the total
3320 3333 output.
3321 3334 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3322 3335 system/getoutput as defaults. The old ones are kept for
3323 3336 compatibility reasons, so no code which uses this library needs
3324 3337 changing.
3325 3338
3326 3339 2003-01-27 *** Released version 0.2.14
3327 3340
3328 3341 2003-01-25 Fernando Perez <fperez@colorado.edu>
3329 3342
3330 3343 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3331 3344 functions defined in previous edit sessions could not be re-edited
3332 3345 (because the temp files were immediately removed). Now temp files
3333 3346 are removed only at IPython's exit.
3334 3347 (Magic.magic_run): Improved @run to perform shell-like expansions
3335 3348 on its arguments (~users and $VARS). With this, @run becomes more
3336 3349 like a normal command-line.
3337 3350
3338 3351 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3339 3352 bugs related to embedding and cleaned up that code. A fairly
3340 3353 important one was the impossibility to access the global namespace
3341 3354 through the embedded IPython (only local variables were visible).
3342 3355
3343 3356 2003-01-14 Fernando Perez <fperez@colorado.edu>
3344 3357
3345 3358 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3346 3359 auto-calling to be a bit more conservative. Now it doesn't get
3347 3360 triggered if any of '!=()<>' are in the rest of the input line, to
3348 3361 allow comparing callables. Thanks to Alex for the heads up.
3349 3362
3350 3363 2003-01-07 Fernando Perez <fperez@colorado.edu>
3351 3364
3352 3365 * IPython/genutils.py (page): fixed estimation of the number of
3353 3366 lines in a string to be paged to simply count newlines. This
3354 3367 prevents over-guessing due to embedded escape sequences. A better
3355 3368 long-term solution would involve stripping out the control chars
3356 3369 for the count, but it's potentially so expensive I just don't
3357 3370 think it's worth doing.
3358 3371
3359 3372 2002-12-19 *** Released version 0.2.14pre50
3360 3373
3361 3374 2002-12-19 Fernando Perez <fperez@colorado.edu>
3362 3375
3363 3376 * tools/release (version): Changed release scripts to inform
3364 3377 Andrea and build a NEWS file with a list of recent changes.
3365 3378
3366 3379 * IPython/ColorANSI.py (__all__): changed terminal detection
3367 3380 code. Seems to work better for xterms without breaking
3368 3381 konsole. Will need more testing to determine if WinXP and Mac OSX
3369 3382 also work ok.
3370 3383
3371 3384 2002-12-18 *** Released version 0.2.14pre49
3372 3385
3373 3386 2002-12-18 Fernando Perez <fperez@colorado.edu>
3374 3387
3375 3388 * Docs: added new info about Mac OSX, from Andrea.
3376 3389
3377 3390 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3378 3391 allow direct plotting of python strings whose format is the same
3379 3392 of gnuplot data files.
3380 3393
3381 3394 2002-12-16 Fernando Perez <fperez@colorado.edu>
3382 3395
3383 3396 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3384 3397 value of exit question to be acknowledged.
3385 3398
3386 3399 2002-12-03 Fernando Perez <fperez@colorado.edu>
3387 3400
3388 3401 * IPython/ipmaker.py: removed generators, which had been added
3389 3402 by mistake in an earlier debugging run. This was causing trouble
3390 3403 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3391 3404 for pointing this out.
3392 3405
3393 3406 2002-11-17 Fernando Perez <fperez@colorado.edu>
3394 3407
3395 3408 * Manual: updated the Gnuplot section.
3396 3409
3397 3410 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3398 3411 a much better split of what goes in Runtime and what goes in
3399 3412 Interactive.
3400 3413
3401 3414 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3402 3415 being imported from iplib.
3403 3416
3404 3417 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3405 3418 for command-passing. Now the global Gnuplot instance is called
3406 3419 'gp' instead of 'g', which was really a far too fragile and
3407 3420 common name.
3408 3421
3409 3422 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3410 3423 bounding boxes generated by Gnuplot for square plots.
3411 3424
3412 3425 * IPython/genutils.py (popkey): new function added. I should
3413 3426 suggest this on c.l.py as a dict method, it seems useful.
3414 3427
3415 3428 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3416 3429 to transparently handle PostScript generation. MUCH better than
3417 3430 the previous plot_eps/replot_eps (which I removed now). The code
3418 3431 is also fairly clean and well documented now (including
3419 3432 docstrings).
3420 3433
3421 3434 2002-11-13 Fernando Perez <fperez@colorado.edu>
3422 3435
3423 3436 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3424 3437 (inconsistent with options).
3425 3438
3426 3439 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3427 3440 manually disabled, I don't know why. Fixed it.
3428 3441 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3429 3442 eps output.
3430 3443
3431 3444 2002-11-12 Fernando Perez <fperez@colorado.edu>
3432 3445
3433 3446 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3434 3447 don't propagate up to caller. Fixes crash reported by François
3435 3448 Pinard.
3436 3449
3437 3450 2002-11-09 Fernando Perez <fperez@colorado.edu>
3438 3451
3439 3452 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3440 3453 history file for new users.
3441 3454 (make_IPython): fixed bug where initial install would leave the
3442 3455 user running in the .ipython dir.
3443 3456 (make_IPython): fixed bug where config dir .ipython would be
3444 3457 created regardless of the given -ipythondir option. Thanks to Cory
3445 3458 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3446 3459
3447 3460 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3448 3461 type confirmations. Will need to use it in all of IPython's code
3449 3462 consistently.
3450 3463
3451 3464 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3452 3465 context to print 31 lines instead of the default 5. This will make
3453 3466 the crash reports extremely detailed in case the problem is in
3454 3467 libraries I don't have access to.
3455 3468
3456 3469 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3457 3470 line of defense' code to still crash, but giving users fair
3458 3471 warning. I don't want internal errors to go unreported: if there's
3459 3472 an internal problem, IPython should crash and generate a full
3460 3473 report.
3461 3474
3462 3475 2002-11-08 Fernando Perez <fperez@colorado.edu>
3463 3476
3464 3477 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3465 3478 otherwise uncaught exceptions which can appear if people set
3466 3479 sys.stdout to something badly broken. Thanks to a crash report
3467 3480 from henni-AT-mail.brainbot.com.
3468 3481
3469 3482 2002-11-04 Fernando Perez <fperez@colorado.edu>
3470 3483
3471 3484 * IPython/iplib.py (InteractiveShell.interact): added
3472 3485 __IPYTHON__active to the builtins. It's a flag which goes on when
3473 3486 the interaction starts and goes off again when it stops. This
3474 3487 allows embedding code to detect being inside IPython. Before this
3475 3488 was done via __IPYTHON__, but that only shows that an IPython
3476 3489 instance has been created.
3477 3490
3478 3491 * IPython/Magic.py (Magic.magic_env): I realized that in a
3479 3492 UserDict, instance.data holds the data as a normal dict. So I
3480 3493 modified @env to return os.environ.data instead of rebuilding a
3481 3494 dict by hand.
3482 3495
3483 3496 2002-11-02 Fernando Perez <fperez@colorado.edu>
3484 3497
3485 3498 * IPython/genutils.py (warn): changed so that level 1 prints no
3486 3499 header. Level 2 is now the default (with 'WARNING' header, as
3487 3500 before). I think I tracked all places where changes were needed in
3488 3501 IPython, but outside code using the old level numbering may have
3489 3502 broken.
3490 3503
3491 3504 * IPython/iplib.py (InteractiveShell.runcode): added this to
3492 3505 handle the tracebacks in SystemExit traps correctly. The previous
3493 3506 code (through interact) was printing more of the stack than
3494 3507 necessary, showing IPython internal code to the user.
3495 3508
3496 3509 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3497 3510 default. Now that the default at the confirmation prompt is yes,
3498 3511 it's not so intrusive. François' argument that ipython sessions
3499 3512 tend to be complex enough not to lose them from an accidental C-d,
3500 3513 is a valid one.
3501 3514
3502 3515 * IPython/iplib.py (InteractiveShell.interact): added a
3503 3516 showtraceback() call to the SystemExit trap, and modified the exit
3504 3517 confirmation to have yes as the default.
3505 3518
3506 3519 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3507 3520 this file. It's been gone from the code for a long time, this was
3508 3521 simply leftover junk.
3509 3522
3510 3523 2002-11-01 Fernando Perez <fperez@colorado.edu>
3511 3524
3512 3525 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3513 3526 added. If set, IPython now traps EOF and asks for
3514 3527 confirmation. After a request by François Pinard.
3515 3528
3516 3529 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3517 3530 of @abort, and with a new (better) mechanism for handling the
3518 3531 exceptions.
3519 3532
3520 3533 2002-10-27 Fernando Perez <fperez@colorado.edu>
3521 3534
3522 3535 * IPython/usage.py (__doc__): updated the --help information and
3523 3536 the ipythonrc file to indicate that -log generates
3524 3537 ./ipython.log. Also fixed the corresponding info in @logstart.
3525 3538 This and several other fixes in the manuals thanks to reports by
3526 3539 François Pinard <pinard-AT-iro.umontreal.ca>.
3527 3540
3528 3541 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3529 3542 refer to @logstart (instead of @log, which doesn't exist).
3530 3543
3531 3544 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3532 3545 AttributeError crash. Thanks to Christopher Armstrong
3533 3546 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3534 3547 introduced recently (in 0.2.14pre37) with the fix to the eval
3535 3548 problem mentioned below.
3536 3549
3537 3550 2002-10-17 Fernando Perez <fperez@colorado.edu>
3538 3551
3539 3552 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3540 3553 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3541 3554
3542 3555 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3543 3556 this function to fix a problem reported by Alex Schmolck. He saw
3544 3557 it with list comprehensions and generators, which were getting
3545 3558 called twice. The real problem was an 'eval' call in testing for
3546 3559 automagic which was evaluating the input line silently.
3547 3560
3548 3561 This is a potentially very nasty bug, if the input has side
3549 3562 effects which must not be repeated. The code is much cleaner now,
3550 3563 without any blanket 'except' left and with a regexp test for
3551 3564 actual function names.
3552 3565
3553 3566 But an eval remains, which I'm not fully comfortable with. I just
3554 3567 don't know how to find out if an expression could be a callable in
3555 3568 the user's namespace without doing an eval on the string. However
3556 3569 that string is now much more strictly checked so that no code
3557 3570 slips by, so the eval should only happen for things that can
3558 3571 really be only function/method names.
3559 3572
3560 3573 2002-10-15 Fernando Perez <fperez@colorado.edu>
3561 3574
3562 3575 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3563 3576 OSX information to main manual, removed README_Mac_OSX file from
3564 3577 distribution. Also updated credits for recent additions.
3565 3578
3566 3579 2002-10-10 Fernando Perez <fperez@colorado.edu>
3567 3580
3568 3581 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3569 3582 terminal-related issues. Many thanks to Andrea Riciputi
3570 3583 <andrea.riciputi-AT-libero.it> for writing it.
3571 3584
3572 3585 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3573 3586 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3574 3587
3575 3588 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3576 3589 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3577 3590 <syver-en-AT-online.no> who both submitted patches for this problem.
3578 3591
3579 3592 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3580 3593 global embedding to make sure that things don't overwrite user
3581 3594 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3582 3595
3583 3596 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3584 3597 compatibility. Thanks to Hayden Callow
3585 3598 <h.callow-AT-elec.canterbury.ac.nz>
3586 3599
3587 3600 2002-10-04 Fernando Perez <fperez@colorado.edu>
3588 3601
3589 3602 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3590 3603 Gnuplot.File objects.
3591 3604
3592 3605 2002-07-23 Fernando Perez <fperez@colorado.edu>
3593 3606
3594 3607 * IPython/genutils.py (timing): Added timings() and timing() for
3595 3608 quick access to the most commonly needed data, the execution
3596 3609 times. Old timing() renamed to timings_out().
3597 3610
3598 3611 2002-07-18 Fernando Perez <fperez@colorado.edu>
3599 3612
3600 3613 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3601 3614 bug with nested instances disrupting the parent's tab completion.
3602 3615
3603 3616 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3604 3617 all_completions code to begin the emacs integration.
3605 3618
3606 3619 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3607 3620 argument to allow titling individual arrays when plotting.
3608 3621
3609 3622 2002-07-15 Fernando Perez <fperez@colorado.edu>
3610 3623
3611 3624 * setup.py (make_shortcut): changed to retrieve the value of
3612 3625 'Program Files' directory from the registry (this value changes in
3613 3626 non-english versions of Windows). Thanks to Thomas Fanslau
3614 3627 <tfanslau-AT-gmx.de> for the report.
3615 3628
3616 3629 2002-07-10 Fernando Perez <fperez@colorado.edu>
3617 3630
3618 3631 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3619 3632 a bug in pdb, which crashes if a line with only whitespace is
3620 3633 entered. Bug report submitted to sourceforge.
3621 3634
3622 3635 2002-07-09 Fernando Perez <fperez@colorado.edu>
3623 3636
3624 3637 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3625 3638 reporting exceptions (it's a bug in inspect.py, I just set a
3626 3639 workaround).
3627 3640
3628 3641 2002-07-08 Fernando Perez <fperez@colorado.edu>
3629 3642
3630 3643 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3631 3644 __IPYTHON__ in __builtins__ to show up in user_ns.
3632 3645
3633 3646 2002-07-03 Fernando Perez <fperez@colorado.edu>
3634 3647
3635 3648 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3636 3649 name from @gp_set_instance to @gp_set_default.
3637 3650
3638 3651 * IPython/ipmaker.py (make_IPython): default editor value set to
3639 3652 '0' (a string), to match the rc file. Otherwise will crash when
3640 3653 .strip() is called on it.
3641 3654
3642 3655
3643 3656 2002-06-28 Fernando Perez <fperez@colorado.edu>
3644 3657
3645 3658 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3646 3659 of files in current directory when a file is executed via
3647 3660 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3648 3661
3649 3662 * setup.py (manfiles): fix for rpm builds, submitted by RA
3650 3663 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3651 3664
3652 3665 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3653 3666 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3654 3667 string!). A. Schmolck caught this one.
3655 3668
3656 3669 2002-06-27 Fernando Perez <fperez@colorado.edu>
3657 3670
3658 3671 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3659 3672 defined files at the cmd line. __name__ wasn't being set to
3660 3673 __main__.
3661 3674
3662 3675 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3663 3676 regular lists and tuples besides Numeric arrays.
3664 3677
3665 3678 * IPython/Prompts.py (CachedOutput.__call__): Added output
3666 3679 supression for input ending with ';'. Similar to Mathematica and
3667 3680 Matlab. The _* vars and Out[] list are still updated, just like
3668 3681 Mathematica behaves.
3669 3682
3670 3683 2002-06-25 Fernando Perez <fperez@colorado.edu>
3671 3684
3672 3685 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3673 3686 .ini extensions for profiels under Windows.
3674 3687
3675 3688 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3676 3689 string form. Fix contributed by Alexander Schmolck
3677 3690 <a.schmolck-AT-gmx.net>
3678 3691
3679 3692 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3680 3693 pre-configured Gnuplot instance.
3681 3694
3682 3695 2002-06-21 Fernando Perez <fperez@colorado.edu>
3683 3696
3684 3697 * IPython/numutils.py (exp_safe): new function, works around the
3685 3698 underflow problems in Numeric.
3686 3699 (log2): New fn. Safe log in base 2: returns exact integer answer
3687 3700 for exact integer powers of 2.
3688 3701
3689 3702 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3690 3703 properly.
3691 3704
3692 3705 2002-06-20 Fernando Perez <fperez@colorado.edu>
3693 3706
3694 3707 * IPython/genutils.py (timing): new function like
3695 3708 Mathematica's. Similar to time_test, but returns more info.
3696 3709
3697 3710 2002-06-18 Fernando Perez <fperez@colorado.edu>
3698 3711
3699 3712 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3700 3713 according to Mike Heeter's suggestions.
3701 3714
3702 3715 2002-06-16 Fernando Perez <fperez@colorado.edu>
3703 3716
3704 3717 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3705 3718 system. GnuplotMagic is gone as a user-directory option. New files
3706 3719 make it easier to use all the gnuplot stuff both from external
3707 3720 programs as well as from IPython. Had to rewrite part of
3708 3721 hardcopy() b/c of a strange bug: often the ps files simply don't
3709 3722 get created, and require a repeat of the command (often several
3710 3723 times).
3711 3724
3712 3725 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3713 3726 resolve output channel at call time, so that if sys.stderr has
3714 3727 been redirected by user this gets honored.
3715 3728
3716 3729 2002-06-13 Fernando Perez <fperez@colorado.edu>
3717 3730
3718 3731 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3719 3732 IPShell. Kept a copy with the old names to avoid breaking people's
3720 3733 embedded code.
3721 3734
3722 3735 * IPython/ipython: simplified it to the bare minimum after
3723 3736 Holger's suggestions. Added info about how to use it in
3724 3737 PYTHONSTARTUP.
3725 3738
3726 3739 * IPython/Shell.py (IPythonShell): changed the options passing
3727 3740 from a string with funky %s replacements to a straight list. Maybe
3728 3741 a bit more typing, but it follows sys.argv conventions, so there's
3729 3742 less special-casing to remember.
3730 3743
3731 3744 2002-06-12 Fernando Perez <fperez@colorado.edu>
3732 3745
3733 3746 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3734 3747 command. Thanks to a suggestion by Mike Heeter.
3735 3748 (Magic.magic_pfile): added behavior to look at filenames if given
3736 3749 arg is not a defined object.
3737 3750 (Magic.magic_save): New @save function to save code snippets. Also
3738 3751 a Mike Heeter idea.
3739 3752
3740 3753 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3741 3754 plot() and replot(). Much more convenient now, especially for
3742 3755 interactive use.
3743 3756
3744 3757 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3745 3758 filenames.
3746 3759
3747 3760 2002-06-02 Fernando Perez <fperez@colorado.edu>
3748 3761
3749 3762 * IPython/Struct.py (Struct.__init__): modified to admit
3750 3763 initialization via another struct.
3751 3764
3752 3765 * IPython/genutils.py (SystemExec.__init__): New stateful
3753 3766 interface to xsys and bq. Useful for writing system scripts.
3754 3767
3755 3768 2002-05-30 Fernando Perez <fperez@colorado.edu>
3756 3769
3757 3770 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3758 3771 documents. This will make the user download smaller (it's getting
3759 3772 too big).
3760 3773
3761 3774 2002-05-29 Fernando Perez <fperez@colorado.edu>
3762 3775
3763 3776 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3764 3777 fix problems with shelve and pickle. Seems to work, but I don't
3765 3778 know if corner cases break it. Thanks to Mike Heeter
3766 3779 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3767 3780
3768 3781 2002-05-24 Fernando Perez <fperez@colorado.edu>
3769 3782
3770 3783 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3771 3784 macros having broken.
3772 3785
3773 3786 2002-05-21 Fernando Perez <fperez@colorado.edu>
3774 3787
3775 3788 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3776 3789 introduced logging bug: all history before logging started was
3777 3790 being written one character per line! This came from the redesign
3778 3791 of the input history as a special list which slices to strings,
3779 3792 not to lists.
3780 3793
3781 3794 2002-05-20 Fernando Perez <fperez@colorado.edu>
3782 3795
3783 3796 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3784 3797 be an attribute of all classes in this module. The design of these
3785 3798 classes needs some serious overhauling.
3786 3799
3787 3800 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3788 3801 which was ignoring '_' in option names.
3789 3802
3790 3803 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3791 3804 'Verbose_novars' to 'Context' and made it the new default. It's a
3792 3805 bit more readable and also safer than verbose.
3793 3806
3794 3807 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3795 3808 triple-quoted strings.
3796 3809
3797 3810 * IPython/OInspect.py (__all__): new module exposing the object
3798 3811 introspection facilities. Now the corresponding magics are dummy
3799 3812 wrappers around this. Having this module will make it much easier
3800 3813 to put these functions into our modified pdb.
3801 3814 This new object inspector system uses the new colorizing module,
3802 3815 so source code and other things are nicely syntax highlighted.
3803 3816
3804 3817 2002-05-18 Fernando Perez <fperez@colorado.edu>
3805 3818
3806 3819 * IPython/ColorANSI.py: Split the coloring tools into a separate
3807 3820 module so I can use them in other code easier (they were part of
3808 3821 ultraTB).
3809 3822
3810 3823 2002-05-17 Fernando Perez <fperez@colorado.edu>
3811 3824
3812 3825 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3813 3826 fixed it to set the global 'g' also to the called instance, as
3814 3827 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3815 3828 user's 'g' variables).
3816 3829
3817 3830 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3818 3831 global variables (aliases to _ih,_oh) so that users which expect
3819 3832 In[5] or Out[7] to work aren't unpleasantly surprised.
3820 3833 (InputList.__getslice__): new class to allow executing slices of
3821 3834 input history directly. Very simple class, complements the use of
3822 3835 macros.
3823 3836
3824 3837 2002-05-16 Fernando Perez <fperez@colorado.edu>
3825 3838
3826 3839 * setup.py (docdirbase): make doc directory be just doc/IPython
3827 3840 without version numbers, it will reduce clutter for users.
3828 3841
3829 3842 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3830 3843 execfile call to prevent possible memory leak. See for details:
3831 3844 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3832 3845
3833 3846 2002-05-15 Fernando Perez <fperez@colorado.edu>
3834 3847
3835 3848 * IPython/Magic.py (Magic.magic_psource): made the object
3836 3849 introspection names be more standard: pdoc, pdef, pfile and
3837 3850 psource. They all print/page their output, and it makes
3838 3851 remembering them easier. Kept old names for compatibility as
3839 3852 aliases.
3840 3853
3841 3854 2002-05-14 Fernando Perez <fperez@colorado.edu>
3842 3855
3843 3856 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3844 3857 what the mouse problem was. The trick is to use gnuplot with temp
3845 3858 files and NOT with pipes (for data communication), because having
3846 3859 both pipes and the mouse on is bad news.
3847 3860
3848 3861 2002-05-13 Fernando Perez <fperez@colorado.edu>
3849 3862
3850 3863 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3851 3864 bug. Information would be reported about builtins even when
3852 3865 user-defined functions overrode them.
3853 3866
3854 3867 2002-05-11 Fernando Perez <fperez@colorado.edu>
3855 3868
3856 3869 * IPython/__init__.py (__all__): removed FlexCompleter from
3857 3870 __all__ so that things don't fail in platforms without readline.
3858 3871
3859 3872 2002-05-10 Fernando Perez <fperez@colorado.edu>
3860 3873
3861 3874 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3862 3875 it requires Numeric, effectively making Numeric a dependency for
3863 3876 IPython.
3864 3877
3865 3878 * Released 0.2.13
3866 3879
3867 3880 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3868 3881 profiler interface. Now all the major options from the profiler
3869 3882 module are directly supported in IPython, both for single
3870 3883 expressions (@prun) and for full programs (@run -p).
3871 3884
3872 3885 2002-05-09 Fernando Perez <fperez@colorado.edu>
3873 3886
3874 3887 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3875 3888 magic properly formatted for screen.
3876 3889
3877 3890 * setup.py (make_shortcut): Changed things to put pdf version in
3878 3891 doc/ instead of doc/manual (had to change lyxport a bit).
3879 3892
3880 3893 * IPython/Magic.py (Profile.string_stats): made profile runs go
3881 3894 through pager (they are long and a pager allows searching, saving,
3882 3895 etc.)
3883 3896
3884 3897 2002-05-08 Fernando Perez <fperez@colorado.edu>
3885 3898
3886 3899 * Released 0.2.12
3887 3900
3888 3901 2002-05-06 Fernando Perez <fperez@colorado.edu>
3889 3902
3890 3903 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3891 3904 introduced); 'hist n1 n2' was broken.
3892 3905 (Magic.magic_pdb): added optional on/off arguments to @pdb
3893 3906 (Magic.magic_run): added option -i to @run, which executes code in
3894 3907 the IPython namespace instead of a clean one. Also added @irun as
3895 3908 an alias to @run -i.
3896 3909
3897 3910 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3898 3911 fixed (it didn't really do anything, the namespaces were wrong).
3899 3912
3900 3913 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3901 3914
3902 3915 * IPython/__init__.py (__all__): Fixed package namespace, now
3903 3916 'import IPython' does give access to IPython.<all> as
3904 3917 expected. Also renamed __release__ to Release.
3905 3918
3906 3919 * IPython/Debugger.py (__license__): created new Pdb class which
3907 3920 functions like a drop-in for the normal pdb.Pdb but does NOT
3908 3921 import readline by default. This way it doesn't muck up IPython's
3909 3922 readline handling, and now tab-completion finally works in the
3910 3923 debugger -- sort of. It completes things globally visible, but the
3911 3924 completer doesn't track the stack as pdb walks it. That's a bit
3912 3925 tricky, and I'll have to implement it later.
3913 3926
3914 3927 2002-05-05 Fernando Perez <fperez@colorado.edu>
3915 3928
3916 3929 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3917 3930 magic docstrings when printed via ? (explicit \'s were being
3918 3931 printed).
3919 3932
3920 3933 * IPython/ipmaker.py (make_IPython): fixed namespace
3921 3934 identification bug. Now variables loaded via logs or command-line
3922 3935 files are recognized in the interactive namespace by @who.
3923 3936
3924 3937 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3925 3938 log replay system stemming from the string form of Structs.
3926 3939
3927 3940 * IPython/Magic.py (Macro.__init__): improved macros to properly
3928 3941 handle magic commands in them.
3929 3942 (Magic.magic_logstart): usernames are now expanded so 'logstart
3930 3943 ~/mylog' now works.
3931 3944
3932 3945 * IPython/iplib.py (complete): fixed bug where paths starting with
3933 3946 '/' would be completed as magic names.
3934 3947
3935 3948 2002-05-04 Fernando Perez <fperez@colorado.edu>
3936 3949
3937 3950 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3938 3951 allow running full programs under the profiler's control.
3939 3952
3940 3953 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3941 3954 mode to report exceptions verbosely but without formatting
3942 3955 variables. This addresses the issue of ipython 'freezing' (it's
3943 3956 not frozen, but caught in an expensive formatting loop) when huge
3944 3957 variables are in the context of an exception.
3945 3958 (VerboseTB.text): Added '--->' markers at line where exception was
3946 3959 triggered. Much clearer to read, especially in NoColor modes.
3947 3960
3948 3961 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3949 3962 implemented in reverse when changing to the new parse_options().
3950 3963
3951 3964 2002-05-03 Fernando Perez <fperez@colorado.edu>
3952 3965
3953 3966 * IPython/Magic.py (Magic.parse_options): new function so that
3954 3967 magics can parse options easier.
3955 3968 (Magic.magic_prun): new function similar to profile.run(),
3956 3969 suggested by Chris Hart.
3957 3970 (Magic.magic_cd): fixed behavior so that it only changes if
3958 3971 directory actually is in history.
3959 3972
3960 3973 * IPython/usage.py (__doc__): added information about potential
3961 3974 slowness of Verbose exception mode when there are huge data
3962 3975 structures to be formatted (thanks to Archie Paulson).
3963 3976
3964 3977 * IPython/ipmaker.py (make_IPython): Changed default logging
3965 3978 (when simply called with -log) to use curr_dir/ipython.log in
3966 3979 rotate mode. Fixed crash which was occuring with -log before
3967 3980 (thanks to Jim Boyle).
3968 3981
3969 3982 2002-05-01 Fernando Perez <fperez@colorado.edu>
3970 3983
3971 3984 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3972 3985 was nasty -- though somewhat of a corner case).
3973 3986
3974 3987 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3975 3988 text (was a bug).
3976 3989
3977 3990 2002-04-30 Fernando Perez <fperez@colorado.edu>
3978 3991
3979 3992 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3980 3993 a print after ^D or ^C from the user so that the In[] prompt
3981 3994 doesn't over-run the gnuplot one.
3982 3995
3983 3996 2002-04-29 Fernando Perez <fperez@colorado.edu>
3984 3997
3985 3998 * Released 0.2.10
3986 3999
3987 4000 * IPython/__release__.py (version): get date dynamically.
3988 4001
3989 4002 * Misc. documentation updates thanks to Arnd's comments. Also ran
3990 4003 a full spellcheck on the manual (hadn't been done in a while).
3991 4004
3992 4005 2002-04-27 Fernando Perez <fperez@colorado.edu>
3993 4006
3994 4007 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3995 4008 starting a log in mid-session would reset the input history list.
3996 4009
3997 4010 2002-04-26 Fernando Perez <fperez@colorado.edu>
3998 4011
3999 4012 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4000 4013 all files were being included in an update. Now anything in
4001 4014 UserConfig that matches [A-Za-z]*.py will go (this excludes
4002 4015 __init__.py)
4003 4016
4004 4017 2002-04-25 Fernando Perez <fperez@colorado.edu>
4005 4018
4006 4019 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4007 4020 to __builtins__ so that any form of embedded or imported code can
4008 4021 test for being inside IPython.
4009 4022
4010 4023 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4011 4024 changed to GnuplotMagic because it's now an importable module,
4012 4025 this makes the name follow that of the standard Gnuplot module.
4013 4026 GnuplotMagic can now be loaded at any time in mid-session.
4014 4027
4015 4028 2002-04-24 Fernando Perez <fperez@colorado.edu>
4016 4029
4017 4030 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4018 4031 the globals (IPython has its own namespace) and the
4019 4032 PhysicalQuantity stuff is much better anyway.
4020 4033
4021 4034 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4022 4035 embedding example to standard user directory for
4023 4036 distribution. Also put it in the manual.
4024 4037
4025 4038 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4026 4039 instance as first argument (so it doesn't rely on some obscure
4027 4040 hidden global).
4028 4041
4029 4042 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4030 4043 delimiters. While it prevents ().TAB from working, it allows
4031 4044 completions in open (... expressions. This is by far a more common
4032 4045 case.
4033 4046
4034 4047 2002-04-23 Fernando Perez <fperez@colorado.edu>
4035 4048
4036 4049 * IPython/Extensions/InterpreterPasteInput.py: new
4037 4050 syntax-processing module for pasting lines with >>> or ... at the
4038 4051 start.
4039 4052
4040 4053 * IPython/Extensions/PhysicalQ_Interactive.py
4041 4054 (PhysicalQuantityInteractive.__int__): fixed to work with either
4042 4055 Numeric or math.
4043 4056
4044 4057 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4045 4058 provided profiles. Now we have:
4046 4059 -math -> math module as * and cmath with its own namespace.
4047 4060 -numeric -> Numeric as *, plus gnuplot & grace
4048 4061 -physics -> same as before
4049 4062
4050 4063 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4051 4064 user-defined magics wouldn't be found by @magic if they were
4052 4065 defined as class methods. Also cleaned up the namespace search
4053 4066 logic and the string building (to use %s instead of many repeated
4054 4067 string adds).
4055 4068
4056 4069 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4057 4070 of user-defined magics to operate with class methods (cleaner, in
4058 4071 line with the gnuplot code).
4059 4072
4060 4073 2002-04-22 Fernando Perez <fperez@colorado.edu>
4061 4074
4062 4075 * setup.py: updated dependency list so that manual is updated when
4063 4076 all included files change.
4064 4077
4065 4078 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4066 4079 the delimiter removal option (the fix is ugly right now).
4067 4080
4068 4081 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4069 4082 all of the math profile (quicker loading, no conflict between
4070 4083 g-9.8 and g-gnuplot).
4071 4084
4072 4085 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4073 4086 name of post-mortem files to IPython_crash_report.txt.
4074 4087
4075 4088 * Cleanup/update of the docs. Added all the new readline info and
4076 4089 formatted all lists as 'real lists'.
4077 4090
4078 4091 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4079 4092 tab-completion options, since the full readline parse_and_bind is
4080 4093 now accessible.
4081 4094
4082 4095 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4083 4096 handling of readline options. Now users can specify any string to
4084 4097 be passed to parse_and_bind(), as well as the delimiters to be
4085 4098 removed.
4086 4099 (InteractiveShell.__init__): Added __name__ to the global
4087 4100 namespace so that things like Itpl which rely on its existence
4088 4101 don't crash.
4089 4102 (InteractiveShell._prefilter): Defined the default with a _ so
4090 4103 that prefilter() is easier to override, while the default one
4091 4104 remains available.
4092 4105
4093 4106 2002-04-18 Fernando Perez <fperez@colorado.edu>
4094 4107
4095 4108 * Added information about pdb in the docs.
4096 4109
4097 4110 2002-04-17 Fernando Perez <fperez@colorado.edu>
4098 4111
4099 4112 * IPython/ipmaker.py (make_IPython): added rc_override option to
4100 4113 allow passing config options at creation time which may override
4101 4114 anything set in the config files or command line. This is
4102 4115 particularly useful for configuring embedded instances.
4103 4116
4104 4117 2002-04-15 Fernando Perez <fperez@colorado.edu>
4105 4118
4106 4119 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4107 4120 crash embedded instances because of the input cache falling out of
4108 4121 sync with the output counter.
4109 4122
4110 4123 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4111 4124 mode which calls pdb after an uncaught exception in IPython itself.
4112 4125
4113 4126 2002-04-14 Fernando Perez <fperez@colorado.edu>
4114 4127
4115 4128 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4116 4129 readline, fix it back after each call.
4117 4130
4118 4131 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4119 4132 method to force all access via __call__(), which guarantees that
4120 4133 traceback references are properly deleted.
4121 4134
4122 4135 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4123 4136 improve printing when pprint is in use.
4124 4137
4125 4138 2002-04-13 Fernando Perez <fperez@colorado.edu>
4126 4139
4127 4140 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4128 4141 exceptions aren't caught anymore. If the user triggers one, he
4129 4142 should know why he's doing it and it should go all the way up,
4130 4143 just like any other exception. So now @abort will fully kill the
4131 4144 embedded interpreter and the embedding code (unless that happens
4132 4145 to catch SystemExit).
4133 4146
4134 4147 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4135 4148 and a debugger() method to invoke the interactive pdb debugger
4136 4149 after printing exception information. Also added the corresponding
4137 4150 -pdb option and @pdb magic to control this feature, and updated
4138 4151 the docs. After a suggestion from Christopher Hart
4139 4152 (hart-AT-caltech.edu).
4140 4153
4141 4154 2002-04-12 Fernando Perez <fperez@colorado.edu>
4142 4155
4143 4156 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4144 4157 the exception handlers defined by the user (not the CrashHandler)
4145 4158 so that user exceptions don't trigger an ipython bug report.
4146 4159
4147 4160 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4148 4161 configurable (it should have always been so).
4149 4162
4150 4163 2002-03-26 Fernando Perez <fperez@colorado.edu>
4151 4164
4152 4165 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4153 4166 and there to fix embedding namespace issues. This should all be
4154 4167 done in a more elegant way.
4155 4168
4156 4169 2002-03-25 Fernando Perez <fperez@colorado.edu>
4157 4170
4158 4171 * IPython/genutils.py (get_home_dir): Try to make it work under
4159 4172 win9x also.
4160 4173
4161 4174 2002-03-20 Fernando Perez <fperez@colorado.edu>
4162 4175
4163 4176 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4164 4177 sys.displayhook untouched upon __init__.
4165 4178
4166 4179 2002-03-19 Fernando Perez <fperez@colorado.edu>
4167 4180
4168 4181 * Released 0.2.9 (for embedding bug, basically).
4169 4182
4170 4183 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4171 4184 exceptions so that enclosing shell's state can be restored.
4172 4185
4173 4186 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4174 4187 naming conventions in the .ipython/ dir.
4175 4188
4176 4189 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4177 4190 from delimiters list so filenames with - in them get expanded.
4178 4191
4179 4192 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4180 4193 sys.displayhook not being properly restored after an embedded call.
4181 4194
4182 4195 2002-03-18 Fernando Perez <fperez@colorado.edu>
4183 4196
4184 4197 * Released 0.2.8
4185 4198
4186 4199 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4187 4200 some files weren't being included in a -upgrade.
4188 4201 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4189 4202 on' so that the first tab completes.
4190 4203 (InteractiveShell.handle_magic): fixed bug with spaces around
4191 4204 quotes breaking many magic commands.
4192 4205
4193 4206 * setup.py: added note about ignoring the syntax error messages at
4194 4207 installation.
4195 4208
4196 4209 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4197 4210 streamlining the gnuplot interface, now there's only one magic @gp.
4198 4211
4199 4212 2002-03-17 Fernando Perez <fperez@colorado.edu>
4200 4213
4201 4214 * IPython/UserConfig/magic_gnuplot.py: new name for the
4202 4215 example-magic_pm.py file. Much enhanced system, now with a shell
4203 4216 for communicating directly with gnuplot, one command at a time.
4204 4217
4205 4218 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4206 4219 setting __name__=='__main__'.
4207 4220
4208 4221 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4209 4222 mini-shell for accessing gnuplot from inside ipython. Should
4210 4223 extend it later for grace access too. Inspired by Arnd's
4211 4224 suggestion.
4212 4225
4213 4226 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4214 4227 calling magic functions with () in their arguments. Thanks to Arnd
4215 4228 Baecker for pointing this to me.
4216 4229
4217 4230 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4218 4231 infinitely for integer or complex arrays (only worked with floats).
4219 4232
4220 4233 2002-03-16 Fernando Perez <fperez@colorado.edu>
4221 4234
4222 4235 * setup.py: Merged setup and setup_windows into a single script
4223 4236 which properly handles things for windows users.
4224 4237
4225 4238 2002-03-15 Fernando Perez <fperez@colorado.edu>
4226 4239
4227 4240 * Big change to the manual: now the magics are all automatically
4228 4241 documented. This information is generated from their docstrings
4229 4242 and put in a latex file included by the manual lyx file. This way
4230 4243 we get always up to date information for the magics. The manual
4231 4244 now also has proper version information, also auto-synced.
4232 4245
4233 4246 For this to work, an undocumented --magic_docstrings option was added.
4234 4247
4235 4248 2002-03-13 Fernando Perez <fperez@colorado.edu>
4236 4249
4237 4250 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4238 4251 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4239 4252
4240 4253 2002-03-12 Fernando Perez <fperez@colorado.edu>
4241 4254
4242 4255 * IPython/ultraTB.py (TermColors): changed color escapes again to
4243 4256 fix the (old, reintroduced) line-wrapping bug. Basically, if
4244 4257 \001..\002 aren't given in the color escapes, lines get wrapped
4245 4258 weirdly. But giving those screws up old xterms and emacs terms. So
4246 4259 I added some logic for emacs terms to be ok, but I can't identify old
4247 4260 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4248 4261
4249 4262 2002-03-10 Fernando Perez <fperez@colorado.edu>
4250 4263
4251 4264 * IPython/usage.py (__doc__): Various documentation cleanups and
4252 4265 updates, both in usage docstrings and in the manual.
4253 4266
4254 4267 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4255 4268 handling of caching. Set minimum acceptabe value for having a
4256 4269 cache at 20 values.
4257 4270
4258 4271 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4259 4272 install_first_time function to a method, renamed it and added an
4260 4273 'upgrade' mode. Now people can update their config directory with
4261 4274 a simple command line switch (-upgrade, also new).
4262 4275
4263 4276 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4264 4277 @file (convenient for automagic users under Python >= 2.2).
4265 4278 Removed @files (it seemed more like a plural than an abbrev. of
4266 4279 'file show').
4267 4280
4268 4281 * IPython/iplib.py (install_first_time): Fixed crash if there were
4269 4282 backup files ('~') in .ipython/ install directory.
4270 4283
4271 4284 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4272 4285 system. Things look fine, but these changes are fairly
4273 4286 intrusive. Test them for a few days.
4274 4287
4275 4288 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4276 4289 the prompts system. Now all in/out prompt strings are user
4277 4290 controllable. This is particularly useful for embedding, as one
4278 4291 can tag embedded instances with particular prompts.
4279 4292
4280 4293 Also removed global use of sys.ps1/2, which now allows nested
4281 4294 embeddings without any problems. Added command-line options for
4282 4295 the prompt strings.
4283 4296
4284 4297 2002-03-08 Fernando Perez <fperez@colorado.edu>
4285 4298
4286 4299 * IPython/UserConfig/example-embed-short.py (ipshell): added
4287 4300 example file with the bare minimum code for embedding.
4288 4301
4289 4302 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4290 4303 functionality for the embeddable shell to be activated/deactivated
4291 4304 either globally or at each call.
4292 4305
4293 4306 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4294 4307 rewriting the prompt with '--->' for auto-inputs with proper
4295 4308 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4296 4309 this is handled by the prompts class itself, as it should.
4297 4310
4298 4311 2002-03-05 Fernando Perez <fperez@colorado.edu>
4299 4312
4300 4313 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4301 4314 @logstart to avoid name clashes with the math log function.
4302 4315
4303 4316 * Big updates to X/Emacs section of the manual.
4304 4317
4305 4318 * Removed ipython_emacs. Milan explained to me how to pass
4306 4319 arguments to ipython through Emacs. Some day I'm going to end up
4307 4320 learning some lisp...
4308 4321
4309 4322 2002-03-04 Fernando Perez <fperez@colorado.edu>
4310 4323
4311 4324 * IPython/ipython_emacs: Created script to be used as the
4312 4325 py-python-command Emacs variable so we can pass IPython
4313 4326 parameters. I can't figure out how to tell Emacs directly to pass
4314 4327 parameters to IPython, so a dummy shell script will do it.
4315 4328
4316 4329 Other enhancements made for things to work better under Emacs'
4317 4330 various types of terminals. Many thanks to Milan Zamazal
4318 4331 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4319 4332
4320 4333 2002-03-01 Fernando Perez <fperez@colorado.edu>
4321 4334
4322 4335 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4323 4336 that loading of readline is now optional. This gives better
4324 4337 control to emacs users.
4325 4338
4326 4339 * IPython/ultraTB.py (__date__): Modified color escape sequences
4327 4340 and now things work fine under xterm and in Emacs' term buffers
4328 4341 (though not shell ones). Well, in emacs you get colors, but all
4329 4342 seem to be 'light' colors (no difference between dark and light
4330 4343 ones). But the garbage chars are gone, and also in xterms. It
4331 4344 seems that now I'm using 'cleaner' ansi sequences.
4332 4345
4333 4346 2002-02-21 Fernando Perez <fperez@colorado.edu>
4334 4347
4335 4348 * Released 0.2.7 (mainly to publish the scoping fix).
4336 4349
4337 4350 * IPython/Logger.py (Logger.logstate): added. A corresponding
4338 4351 @logstate magic was created.
4339 4352
4340 4353 * IPython/Magic.py: fixed nested scoping problem under Python
4341 4354 2.1.x (automagic wasn't working).
4342 4355
4343 4356 2002-02-20 Fernando Perez <fperez@colorado.edu>
4344 4357
4345 4358 * Released 0.2.6.
4346 4359
4347 4360 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4348 4361 option so that logs can come out without any headers at all.
4349 4362
4350 4363 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4351 4364 SciPy.
4352 4365
4353 4366 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4354 4367 that embedded IPython calls don't require vars() to be explicitly
4355 4368 passed. Now they are extracted from the caller's frame (code
4356 4369 snatched from Eric Jones' weave). Added better documentation to
4357 4370 the section on embedding and the example file.
4358 4371
4359 4372 * IPython/genutils.py (page): Changed so that under emacs, it just
4360 4373 prints the string. You can then page up and down in the emacs
4361 4374 buffer itself. This is how the builtin help() works.
4362 4375
4363 4376 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4364 4377 macro scoping: macros need to be executed in the user's namespace
4365 4378 to work as if they had been typed by the user.
4366 4379
4367 4380 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4368 4381 execute automatically (no need to type 'exec...'). They then
4369 4382 behave like 'true macros'. The printing system was also modified
4370 4383 for this to work.
4371 4384
4372 4385 2002-02-19 Fernando Perez <fperez@colorado.edu>
4373 4386
4374 4387 * IPython/genutils.py (page_file): new function for paging files
4375 4388 in an OS-independent way. Also necessary for file viewing to work
4376 4389 well inside Emacs buffers.
4377 4390 (page): Added checks for being in an emacs buffer.
4378 4391 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4379 4392 same bug in iplib.
4380 4393
4381 4394 2002-02-18 Fernando Perez <fperez@colorado.edu>
4382 4395
4383 4396 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4384 4397 of readline so that IPython can work inside an Emacs buffer.
4385 4398
4386 4399 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4387 4400 method signatures (they weren't really bugs, but it looks cleaner
4388 4401 and keeps PyChecker happy).
4389 4402
4390 4403 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4391 4404 for implementing various user-defined hooks. Currently only
4392 4405 display is done.
4393 4406
4394 4407 * IPython/Prompts.py (CachedOutput._display): changed display
4395 4408 functions so that they can be dynamically changed by users easily.
4396 4409
4397 4410 * IPython/Extensions/numeric_formats.py (num_display): added an
4398 4411 extension for printing NumPy arrays in flexible manners. It
4399 4412 doesn't do anything yet, but all the structure is in
4400 4413 place. Ultimately the plan is to implement output format control
4401 4414 like in Octave.
4402 4415
4403 4416 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4404 4417 methods are found at run-time by all the automatic machinery.
4405 4418
4406 4419 2002-02-17 Fernando Perez <fperez@colorado.edu>
4407 4420
4408 4421 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4409 4422 whole file a little.
4410 4423
4411 4424 * ToDo: closed this document. Now there's a new_design.lyx
4412 4425 document for all new ideas. Added making a pdf of it for the
4413 4426 end-user distro.
4414 4427
4415 4428 * IPython/Logger.py (Logger.switch_log): Created this to replace
4416 4429 logon() and logoff(). It also fixes a nasty crash reported by
4417 4430 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4418 4431
4419 4432 * IPython/iplib.py (complete): got auto-completion to work with
4420 4433 automagic (I had wanted this for a long time).
4421 4434
4422 4435 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4423 4436 to @file, since file() is now a builtin and clashes with automagic
4424 4437 for @file.
4425 4438
4426 4439 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4427 4440 of this was previously in iplib, which had grown to more than 2000
4428 4441 lines, way too long. No new functionality, but it makes managing
4429 4442 the code a bit easier.
4430 4443
4431 4444 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4432 4445 information to crash reports.
4433 4446
4434 4447 2002-02-12 Fernando Perez <fperez@colorado.edu>
4435 4448
4436 4449 * Released 0.2.5.
4437 4450
4438 4451 2002-02-11 Fernando Perez <fperez@colorado.edu>
4439 4452
4440 4453 * Wrote a relatively complete Windows installer. It puts
4441 4454 everything in place, creates Start Menu entries and fixes the
4442 4455 color issues. Nothing fancy, but it works.
4443 4456
4444 4457 2002-02-10 Fernando Perez <fperez@colorado.edu>
4445 4458
4446 4459 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4447 4460 os.path.expanduser() call so that we can type @run ~/myfile.py and
4448 4461 have thigs work as expected.
4449 4462
4450 4463 * IPython/genutils.py (page): fixed exception handling so things
4451 4464 work both in Unix and Windows correctly. Quitting a pager triggers
4452 4465 an IOError/broken pipe in Unix, and in windows not finding a pager
4453 4466 is also an IOError, so I had to actually look at the return value
4454 4467 of the exception, not just the exception itself. Should be ok now.
4455 4468
4456 4469 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4457 4470 modified to allow case-insensitive color scheme changes.
4458 4471
4459 4472 2002-02-09 Fernando Perez <fperez@colorado.edu>
4460 4473
4461 4474 * IPython/genutils.py (native_line_ends): new function to leave
4462 4475 user config files with os-native line-endings.
4463 4476
4464 4477 * README and manual updates.
4465 4478
4466 4479 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4467 4480 instead of StringType to catch Unicode strings.
4468 4481
4469 4482 * IPython/genutils.py (filefind): fixed bug for paths with
4470 4483 embedded spaces (very common in Windows).
4471 4484
4472 4485 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4473 4486 files under Windows, so that they get automatically associated
4474 4487 with a text editor. Windows makes it a pain to handle
4475 4488 extension-less files.
4476 4489
4477 4490 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4478 4491 warning about readline only occur for Posix. In Windows there's no
4479 4492 way to get readline, so why bother with the warning.
4480 4493
4481 4494 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4482 4495 for __str__ instead of dir(self), since dir() changed in 2.2.
4483 4496
4484 4497 * Ported to Windows! Tested on XP, I suspect it should work fine
4485 4498 on NT/2000, but I don't think it will work on 98 et al. That
4486 4499 series of Windows is such a piece of junk anyway that I won't try
4487 4500 porting it there. The XP port was straightforward, showed a few
4488 4501 bugs here and there (fixed all), in particular some string
4489 4502 handling stuff which required considering Unicode strings (which
4490 4503 Windows uses). This is good, but hasn't been too tested :) No
4491 4504 fancy installer yet, I'll put a note in the manual so people at
4492 4505 least make manually a shortcut.
4493 4506
4494 4507 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4495 4508 into a single one, "colors". This now controls both prompt and
4496 4509 exception color schemes, and can be changed both at startup
4497 4510 (either via command-line switches or via ipythonrc files) and at
4498 4511 runtime, with @colors.
4499 4512 (Magic.magic_run): renamed @prun to @run and removed the old
4500 4513 @run. The two were too similar to warrant keeping both.
4501 4514
4502 4515 2002-02-03 Fernando Perez <fperez@colorado.edu>
4503 4516
4504 4517 * IPython/iplib.py (install_first_time): Added comment on how to
4505 4518 configure the color options for first-time users. Put a <return>
4506 4519 request at the end so that small-terminal users get a chance to
4507 4520 read the startup info.
4508 4521
4509 4522 2002-01-23 Fernando Perez <fperez@colorado.edu>
4510 4523
4511 4524 * IPython/iplib.py (CachedOutput.update): Changed output memory
4512 4525 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4513 4526 input history we still use _i. Did this b/c these variable are
4514 4527 very commonly used in interactive work, so the less we need to
4515 4528 type the better off we are.
4516 4529 (Magic.magic_prun): updated @prun to better handle the namespaces
4517 4530 the file will run in, including a fix for __name__ not being set
4518 4531 before.
4519 4532
4520 4533 2002-01-20 Fernando Perez <fperez@colorado.edu>
4521 4534
4522 4535 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4523 4536 extra garbage for Python 2.2. Need to look more carefully into
4524 4537 this later.
4525 4538
4526 4539 2002-01-19 Fernando Perez <fperez@colorado.edu>
4527 4540
4528 4541 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4529 4542 display SyntaxError exceptions properly formatted when they occur
4530 4543 (they can be triggered by imported code).
4531 4544
4532 4545 2002-01-18 Fernando Perez <fperez@colorado.edu>
4533 4546
4534 4547 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4535 4548 SyntaxError exceptions are reported nicely formatted, instead of
4536 4549 spitting out only offset information as before.
4537 4550 (Magic.magic_prun): Added the @prun function for executing
4538 4551 programs with command line args inside IPython.
4539 4552
4540 4553 2002-01-16 Fernando Perez <fperez@colorado.edu>
4541 4554
4542 4555 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4543 4556 to *not* include the last item given in a range. This brings their
4544 4557 behavior in line with Python's slicing:
4545 4558 a[n1:n2] -> a[n1]...a[n2-1]
4546 4559 It may be a bit less convenient, but I prefer to stick to Python's
4547 4560 conventions *everywhere*, so users never have to wonder.
4548 4561 (Magic.magic_macro): Added @macro function to ease the creation of
4549 4562 macros.
4550 4563
4551 4564 2002-01-05 Fernando Perez <fperez@colorado.edu>
4552 4565
4553 4566 * Released 0.2.4.
4554 4567
4555 4568 * IPython/iplib.py (Magic.magic_pdef):
4556 4569 (InteractiveShell.safe_execfile): report magic lines and error
4557 4570 lines without line numbers so one can easily copy/paste them for
4558 4571 re-execution.
4559 4572
4560 4573 * Updated manual with recent changes.
4561 4574
4562 4575 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4563 4576 docstring printing when class? is called. Very handy for knowing
4564 4577 how to create class instances (as long as __init__ is well
4565 4578 documented, of course :)
4566 4579 (Magic.magic_doc): print both class and constructor docstrings.
4567 4580 (Magic.magic_pdef): give constructor info if passed a class and
4568 4581 __call__ info for callable object instances.
4569 4582
4570 4583 2002-01-04 Fernando Perez <fperez@colorado.edu>
4571 4584
4572 4585 * Made deep_reload() off by default. It doesn't always work
4573 4586 exactly as intended, so it's probably safer to have it off. It's
4574 4587 still available as dreload() anyway, so nothing is lost.
4575 4588
4576 4589 2002-01-02 Fernando Perez <fperez@colorado.edu>
4577 4590
4578 4591 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4579 4592 so I wanted an updated release).
4580 4593
4581 4594 2001-12-27 Fernando Perez <fperez@colorado.edu>
4582 4595
4583 4596 * IPython/iplib.py (InteractiveShell.interact): Added the original
4584 4597 code from 'code.py' for this module in order to change the
4585 4598 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4586 4599 the history cache would break when the user hit Ctrl-C, and
4587 4600 interact() offers no way to add any hooks to it.
4588 4601
4589 4602 2001-12-23 Fernando Perez <fperez@colorado.edu>
4590 4603
4591 4604 * setup.py: added check for 'MANIFEST' before trying to remove
4592 4605 it. Thanks to Sean Reifschneider.
4593 4606
4594 4607 2001-12-22 Fernando Perez <fperez@colorado.edu>
4595 4608
4596 4609 * Released 0.2.2.
4597 4610
4598 4611 * Finished (reasonably) writing the manual. Later will add the
4599 4612 python-standard navigation stylesheets, but for the time being
4600 4613 it's fairly complete. Distribution will include html and pdf
4601 4614 versions.
4602 4615
4603 4616 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4604 4617 (MayaVi author).
4605 4618
4606 4619 2001-12-21 Fernando Perez <fperez@colorado.edu>
4607 4620
4608 4621 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4609 4622 good public release, I think (with the manual and the distutils
4610 4623 installer). The manual can use some work, but that can go
4611 4624 slowly. Otherwise I think it's quite nice for end users. Next
4612 4625 summer, rewrite the guts of it...
4613 4626
4614 4627 * Changed format of ipythonrc files to use whitespace as the
4615 4628 separator instead of an explicit '='. Cleaner.
4616 4629
4617 4630 2001-12-20 Fernando Perez <fperez@colorado.edu>
4618 4631
4619 4632 * Started a manual in LyX. For now it's just a quick merge of the
4620 4633 various internal docstrings and READMEs. Later it may grow into a
4621 4634 nice, full-blown manual.
4622 4635
4623 4636 * Set up a distutils based installer. Installation should now be
4624 4637 trivially simple for end-users.
4625 4638
4626 4639 2001-12-11 Fernando Perez <fperez@colorado.edu>
4627 4640
4628 4641 * Released 0.2.0. First public release, announced it at
4629 4642 comp.lang.python. From now on, just bugfixes...
4630 4643
4631 4644 * Went through all the files, set copyright/license notices and
4632 4645 cleaned up things. Ready for release.
4633 4646
4634 4647 2001-12-10 Fernando Perez <fperez@colorado.edu>
4635 4648
4636 4649 * Changed the first-time installer not to use tarfiles. It's more
4637 4650 robust now and less unix-dependent. Also makes it easier for
4638 4651 people to later upgrade versions.
4639 4652
4640 4653 * Changed @exit to @abort to reflect the fact that it's pretty
4641 4654 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4642 4655 becomes significant only when IPyhton is embedded: in that case,
4643 4656 C-D closes IPython only, but @abort kills the enclosing program
4644 4657 too (unless it had called IPython inside a try catching
4645 4658 SystemExit).
4646 4659
4647 4660 * Created Shell module which exposes the actuall IPython Shell
4648 4661 classes, currently the normal and the embeddable one. This at
4649 4662 least offers a stable interface we won't need to change when
4650 4663 (later) the internals are rewritten. That rewrite will be confined
4651 4664 to iplib and ipmaker, but the Shell interface should remain as is.
4652 4665
4653 4666 * Added embed module which offers an embeddable IPShell object,
4654 4667 useful to fire up IPython *inside* a running program. Great for
4655 4668 debugging or dynamical data analysis.
4656 4669
4657 4670 2001-12-08 Fernando Perez <fperez@colorado.edu>
4658 4671
4659 4672 * Fixed small bug preventing seeing info from methods of defined
4660 4673 objects (incorrect namespace in _ofind()).
4661 4674
4662 4675 * Documentation cleanup. Moved the main usage docstrings to a
4663 4676 separate file, usage.py (cleaner to maintain, and hopefully in the
4664 4677 future some perlpod-like way of producing interactive, man and
4665 4678 html docs out of it will be found).
4666 4679
4667 4680 * Added @profile to see your profile at any time.
4668 4681
4669 4682 * Added @p as an alias for 'print'. It's especially convenient if
4670 4683 using automagic ('p x' prints x).
4671 4684
4672 4685 * Small cleanups and fixes after a pychecker run.
4673 4686
4674 4687 * Changed the @cd command to handle @cd - and @cd -<n> for
4675 4688 visiting any directory in _dh.
4676 4689
4677 4690 * Introduced _dh, a history of visited directories. @dhist prints
4678 4691 it out with numbers.
4679 4692
4680 4693 2001-12-07 Fernando Perez <fperez@colorado.edu>
4681 4694
4682 4695 * Released 0.1.22
4683 4696
4684 4697 * Made initialization a bit more robust against invalid color
4685 4698 options in user input (exit, not traceback-crash).
4686 4699
4687 4700 * Changed the bug crash reporter to write the report only in the
4688 4701 user's .ipython directory. That way IPython won't litter people's
4689 4702 hard disks with crash files all over the place. Also print on
4690 4703 screen the necessary mail command.
4691 4704
4692 4705 * With the new ultraTB, implemented LightBG color scheme for light
4693 4706 background terminals. A lot of people like white backgrounds, so I
4694 4707 guess we should at least give them something readable.
4695 4708
4696 4709 2001-12-06 Fernando Perez <fperez@colorado.edu>
4697 4710
4698 4711 * Modified the structure of ultraTB. Now there's a proper class
4699 4712 for tables of color schemes which allow adding schemes easily and
4700 4713 switching the active scheme without creating a new instance every
4701 4714 time (which was ridiculous). The syntax for creating new schemes
4702 4715 is also cleaner. I think ultraTB is finally done, with a clean
4703 4716 class structure. Names are also much cleaner (now there's proper
4704 4717 color tables, no need for every variable to also have 'color' in
4705 4718 its name).
4706 4719
4707 4720 * Broke down genutils into separate files. Now genutils only
4708 4721 contains utility functions, and classes have been moved to their
4709 4722 own files (they had enough independent functionality to warrant
4710 4723 it): ConfigLoader, OutputTrap, Struct.
4711 4724
4712 4725 2001-12-05 Fernando Perez <fperez@colorado.edu>
4713 4726
4714 4727 * IPython turns 21! Released version 0.1.21, as a candidate for
4715 4728 public consumption. If all goes well, release in a few days.
4716 4729
4717 4730 * Fixed path bug (files in Extensions/ directory wouldn't be found
4718 4731 unless IPython/ was explicitly in sys.path).
4719 4732
4720 4733 * Extended the FlexCompleter class as MagicCompleter to allow
4721 4734 completion of @-starting lines.
4722 4735
4723 4736 * Created __release__.py file as a central repository for release
4724 4737 info that other files can read from.
4725 4738
4726 4739 * Fixed small bug in logging: when logging was turned on in
4727 4740 mid-session, old lines with special meanings (!@?) were being
4728 4741 logged without the prepended comment, which is necessary since
4729 4742 they are not truly valid python syntax. This should make session
4730 4743 restores produce less errors.
4731 4744
4732 4745 * The namespace cleanup forced me to make a FlexCompleter class
4733 4746 which is nothing but a ripoff of rlcompleter, but with selectable
4734 4747 namespace (rlcompleter only works in __main__.__dict__). I'll try
4735 4748 to submit a note to the authors to see if this change can be
4736 4749 incorporated in future rlcompleter releases (Dec.6: done)
4737 4750
4738 4751 * More fixes to namespace handling. It was a mess! Now all
4739 4752 explicit references to __main__.__dict__ are gone (except when
4740 4753 really needed) and everything is handled through the namespace
4741 4754 dicts in the IPython instance. We seem to be getting somewhere
4742 4755 with this, finally...
4743 4756
4744 4757 * Small documentation updates.
4745 4758
4746 4759 * Created the Extensions directory under IPython (with an
4747 4760 __init__.py). Put the PhysicalQ stuff there. This directory should
4748 4761 be used for all special-purpose extensions.
4749 4762
4750 4763 * File renaming:
4751 4764 ipythonlib --> ipmaker
4752 4765 ipplib --> iplib
4753 4766 This makes a bit more sense in terms of what these files actually do.
4754 4767
4755 4768 * Moved all the classes and functions in ipythonlib to ipplib, so
4756 4769 now ipythonlib only has make_IPython(). This will ease up its
4757 4770 splitting in smaller functional chunks later.
4758 4771
4759 4772 * Cleaned up (done, I think) output of @whos. Better column
4760 4773 formatting, and now shows str(var) for as much as it can, which is
4761 4774 typically what one gets with a 'print var'.
4762 4775
4763 4776 2001-12-04 Fernando Perez <fperez@colorado.edu>
4764 4777
4765 4778 * Fixed namespace problems. Now builtin/IPyhton/user names get
4766 4779 properly reported in their namespace. Internal namespace handling
4767 4780 is finally getting decent (not perfect yet, but much better than
4768 4781 the ad-hoc mess we had).
4769 4782
4770 4783 * Removed -exit option. If people just want to run a python
4771 4784 script, that's what the normal interpreter is for. Less
4772 4785 unnecessary options, less chances for bugs.
4773 4786
4774 4787 * Added a crash handler which generates a complete post-mortem if
4775 4788 IPython crashes. This will help a lot in tracking bugs down the
4776 4789 road.
4777 4790
4778 4791 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4779 4792 which were boud to functions being reassigned would bypass the
4780 4793 logger, breaking the sync of _il with the prompt counter. This
4781 4794 would then crash IPython later when a new line was logged.
4782 4795
4783 4796 2001-12-02 Fernando Perez <fperez@colorado.edu>
4784 4797
4785 4798 * Made IPython a package. This means people don't have to clutter
4786 4799 their sys.path with yet another directory. Changed the INSTALL
4787 4800 file accordingly.
4788 4801
4789 4802 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4790 4803 sorts its output (so @who shows it sorted) and @whos formats the
4791 4804 table according to the width of the first column. Nicer, easier to
4792 4805 read. Todo: write a generic table_format() which takes a list of
4793 4806 lists and prints it nicely formatted, with optional row/column
4794 4807 separators and proper padding and justification.
4795 4808
4796 4809 * Released 0.1.20
4797 4810
4798 4811 * Fixed bug in @log which would reverse the inputcache list (a
4799 4812 copy operation was missing).
4800 4813
4801 4814 * Code cleanup. @config was changed to use page(). Better, since
4802 4815 its output is always quite long.
4803 4816
4804 4817 * Itpl is back as a dependency. I was having too many problems
4805 4818 getting the parametric aliases to work reliably, and it's just
4806 4819 easier to code weird string operations with it than playing %()s
4807 4820 games. It's only ~6k, so I don't think it's too big a deal.
4808 4821
4809 4822 * Found (and fixed) a very nasty bug with history. !lines weren't
4810 4823 getting cached, and the out of sync caches would crash
4811 4824 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4812 4825 division of labor a bit better. Bug fixed, cleaner structure.
4813 4826
4814 4827 2001-12-01 Fernando Perez <fperez@colorado.edu>
4815 4828
4816 4829 * Released 0.1.19
4817 4830
4818 4831 * Added option -n to @hist to prevent line number printing. Much
4819 4832 easier to copy/paste code this way.
4820 4833
4821 4834 * Created global _il to hold the input list. Allows easy
4822 4835 re-execution of blocks of code by slicing it (inspired by Janko's
4823 4836 comment on 'macros').
4824 4837
4825 4838 * Small fixes and doc updates.
4826 4839
4827 4840 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4828 4841 much too fragile with automagic. Handles properly multi-line
4829 4842 statements and takes parameters.
4830 4843
4831 4844 2001-11-30 Fernando Perez <fperez@colorado.edu>
4832 4845
4833 4846 * Version 0.1.18 released.
4834 4847
4835 4848 * Fixed nasty namespace bug in initial module imports.
4836 4849
4837 4850 * Added copyright/license notes to all code files (except
4838 4851 DPyGetOpt). For the time being, LGPL. That could change.
4839 4852
4840 4853 * Rewrote a much nicer README, updated INSTALL, cleaned up
4841 4854 ipythonrc-* samples.
4842 4855
4843 4856 * Overall code/documentation cleanup. Basically ready for
4844 4857 release. Only remaining thing: licence decision (LGPL?).
4845 4858
4846 4859 * Converted load_config to a class, ConfigLoader. Now recursion
4847 4860 control is better organized. Doesn't include the same file twice.
4848 4861
4849 4862 2001-11-29 Fernando Perez <fperez@colorado.edu>
4850 4863
4851 4864 * Got input history working. Changed output history variables from
4852 4865 _p to _o so that _i is for input and _o for output. Just cleaner
4853 4866 convention.
4854 4867
4855 4868 * Implemented parametric aliases. This pretty much allows the
4856 4869 alias system to offer full-blown shell convenience, I think.
4857 4870
4858 4871 * Version 0.1.17 released, 0.1.18 opened.
4859 4872
4860 4873 * dot_ipython/ipythonrc (alias): added documentation.
4861 4874 (xcolor): Fixed small bug (xcolors -> xcolor)
4862 4875
4863 4876 * Changed the alias system. Now alias is a magic command to define
4864 4877 aliases just like the shell. Rationale: the builtin magics should
4865 4878 be there for things deeply connected to IPython's
4866 4879 architecture. And this is a much lighter system for what I think
4867 4880 is the really important feature: allowing users to define quickly
4868 4881 magics that will do shell things for them, so they can customize
4869 4882 IPython easily to match their work habits. If someone is really
4870 4883 desperate to have another name for a builtin alias, they can
4871 4884 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4872 4885 works.
4873 4886
4874 4887 2001-11-28 Fernando Perez <fperez@colorado.edu>
4875 4888
4876 4889 * Changed @file so that it opens the source file at the proper
4877 4890 line. Since it uses less, if your EDITOR environment is
4878 4891 configured, typing v will immediately open your editor of choice
4879 4892 right at the line where the object is defined. Not as quick as
4880 4893 having a direct @edit command, but for all intents and purposes it
4881 4894 works. And I don't have to worry about writing @edit to deal with
4882 4895 all the editors, less does that.
4883 4896
4884 4897 * Version 0.1.16 released, 0.1.17 opened.
4885 4898
4886 4899 * Fixed some nasty bugs in the page/page_dumb combo that could
4887 4900 crash IPython.
4888 4901
4889 4902 2001-11-27 Fernando Perez <fperez@colorado.edu>
4890 4903
4891 4904 * Version 0.1.15 released, 0.1.16 opened.
4892 4905
4893 4906 * Finally got ? and ?? to work for undefined things: now it's
4894 4907 possible to type {}.get? and get information about the get method
4895 4908 of dicts, or os.path? even if only os is defined (so technically
4896 4909 os.path isn't). Works at any level. For example, after import os,
4897 4910 os?, os.path?, os.path.abspath? all work. This is great, took some
4898 4911 work in _ofind.
4899 4912
4900 4913 * Fixed more bugs with logging. The sanest way to do it was to add
4901 4914 to @log a 'mode' parameter. Killed two in one shot (this mode
4902 4915 option was a request of Janko's). I think it's finally clean
4903 4916 (famous last words).
4904 4917
4905 4918 * Added a page_dumb() pager which does a decent job of paging on
4906 4919 screen, if better things (like less) aren't available. One less
4907 4920 unix dependency (someday maybe somebody will port this to
4908 4921 windows).
4909 4922
4910 4923 * Fixed problem in magic_log: would lock of logging out if log
4911 4924 creation failed (because it would still think it had succeeded).
4912 4925
4913 4926 * Improved the page() function using curses to auto-detect screen
4914 4927 size. Now it can make a much better decision on whether to print
4915 4928 or page a string. Option screen_length was modified: a value 0
4916 4929 means auto-detect, and that's the default now.
4917 4930
4918 4931 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4919 4932 go out. I'll test it for a few days, then talk to Janko about
4920 4933 licences and announce it.
4921 4934
4922 4935 * Fixed the length of the auto-generated ---> prompt which appears
4923 4936 for auto-parens and auto-quotes. Getting this right isn't trivial,
4924 4937 with all the color escapes, different prompt types and optional
4925 4938 separators. But it seems to be working in all the combinations.
4926 4939
4927 4940 2001-11-26 Fernando Perez <fperez@colorado.edu>
4928 4941
4929 4942 * Wrote a regexp filter to get option types from the option names
4930 4943 string. This eliminates the need to manually keep two duplicate
4931 4944 lists.
4932 4945
4933 4946 * Removed the unneeded check_option_names. Now options are handled
4934 4947 in a much saner manner and it's easy to visually check that things
4935 4948 are ok.
4936 4949
4937 4950 * Updated version numbers on all files I modified to carry a
4938 4951 notice so Janko and Nathan have clear version markers.
4939 4952
4940 4953 * Updated docstring for ultraTB with my changes. I should send
4941 4954 this to Nathan.
4942 4955
4943 4956 * Lots of small fixes. Ran everything through pychecker again.
4944 4957
4945 4958 * Made loading of deep_reload an cmd line option. If it's not too
4946 4959 kosher, now people can just disable it. With -nodeep_reload it's
4947 4960 still available as dreload(), it just won't overwrite reload().
4948 4961
4949 4962 * Moved many options to the no| form (-opt and -noopt
4950 4963 accepted). Cleaner.
4951 4964
4952 4965 * Changed magic_log so that if called with no parameters, it uses
4953 4966 'rotate' mode. That way auto-generated logs aren't automatically
4954 4967 over-written. For normal logs, now a backup is made if it exists
4955 4968 (only 1 level of backups). A new 'backup' mode was added to the
4956 4969 Logger class to support this. This was a request by Janko.
4957 4970
4958 4971 * Added @logoff/@logon to stop/restart an active log.
4959 4972
4960 4973 * Fixed a lot of bugs in log saving/replay. It was pretty
4961 4974 broken. Now special lines (!@,/) appear properly in the command
4962 4975 history after a log replay.
4963 4976
4964 4977 * Tried and failed to implement full session saving via pickle. My
4965 4978 idea was to pickle __main__.__dict__, but modules can't be
4966 4979 pickled. This would be a better alternative to replaying logs, but
4967 4980 seems quite tricky to get to work. Changed -session to be called
4968 4981 -logplay, which more accurately reflects what it does. And if we
4969 4982 ever get real session saving working, -session is now available.
4970 4983
4971 4984 * Implemented color schemes for prompts also. As for tracebacks,
4972 4985 currently only NoColor and Linux are supported. But now the
4973 4986 infrastructure is in place, based on a generic ColorScheme
4974 4987 class. So writing and activating new schemes both for the prompts
4975 4988 and the tracebacks should be straightforward.
4976 4989
4977 4990 * Version 0.1.13 released, 0.1.14 opened.
4978 4991
4979 4992 * Changed handling of options for output cache. Now counter is
4980 4993 hardwired starting at 1 and one specifies the maximum number of
4981 4994 entries *in the outcache* (not the max prompt counter). This is
4982 4995 much better, since many statements won't increase the cache
4983 4996 count. It also eliminated some confusing options, now there's only
4984 4997 one: cache_size.
4985 4998
4986 4999 * Added 'alias' magic function and magic_alias option in the
4987 5000 ipythonrc file. Now the user can easily define whatever names he
4988 5001 wants for the magic functions without having to play weird
4989 5002 namespace games. This gives IPython a real shell-like feel.
4990 5003
4991 5004 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4992 5005 @ or not).
4993 5006
4994 5007 This was one of the last remaining 'visible' bugs (that I know
4995 5008 of). I think if I can clean up the session loading so it works
4996 5009 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4997 5010 about licensing).
4998 5011
4999 5012 2001-11-25 Fernando Perez <fperez@colorado.edu>
5000 5013
5001 5014 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5002 5015 there's a cleaner distinction between what ? and ?? show.
5003 5016
5004 5017 * Added screen_length option. Now the user can define his own
5005 5018 screen size for page() operations.
5006 5019
5007 5020 * Implemented magic shell-like functions with automatic code
5008 5021 generation. Now adding another function is just a matter of adding
5009 5022 an entry to a dict, and the function is dynamically generated at
5010 5023 run-time. Python has some really cool features!
5011 5024
5012 5025 * Renamed many options to cleanup conventions a little. Now all
5013 5026 are lowercase, and only underscores where needed. Also in the code
5014 5027 option name tables are clearer.
5015 5028
5016 5029 * Changed prompts a little. Now input is 'In [n]:' instead of
5017 5030 'In[n]:='. This allows it the numbers to be aligned with the
5018 5031 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5019 5032 Python (it was a Mathematica thing). The '...' continuation prompt
5020 5033 was also changed a little to align better.
5021 5034
5022 5035 * Fixed bug when flushing output cache. Not all _p<n> variables
5023 5036 exist, so their deletion needs to be wrapped in a try:
5024 5037
5025 5038 * Figured out how to properly use inspect.formatargspec() (it
5026 5039 requires the args preceded by *). So I removed all the code from
5027 5040 _get_pdef in Magic, which was just replicating that.
5028 5041
5029 5042 * Added test to prefilter to allow redefining magic function names
5030 5043 as variables. This is ok, since the @ form is always available,
5031 5044 but whe should allow the user to define a variable called 'ls' if
5032 5045 he needs it.
5033 5046
5034 5047 * Moved the ToDo information from README into a separate ToDo.
5035 5048
5036 5049 * General code cleanup and small bugfixes. I think it's close to a
5037 5050 state where it can be released, obviously with a big 'beta'
5038 5051 warning on it.
5039 5052
5040 5053 * Got the magic function split to work. Now all magics are defined
5041 5054 in a separate class. It just organizes things a bit, and now
5042 5055 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5043 5056 was too long).
5044 5057
5045 5058 * Changed @clear to @reset to avoid potential confusions with
5046 5059 the shell command clear. Also renamed @cl to @clear, which does
5047 5060 exactly what people expect it to from their shell experience.
5048 5061
5049 5062 Added a check to the @reset command (since it's so
5050 5063 destructive, it's probably a good idea to ask for confirmation).
5051 5064 But now reset only works for full namespace resetting. Since the
5052 5065 del keyword is already there for deleting a few specific
5053 5066 variables, I don't see the point of having a redundant magic
5054 5067 function for the same task.
5055 5068
5056 5069 2001-11-24 Fernando Perez <fperez@colorado.edu>
5057 5070
5058 5071 * Updated the builtin docs (esp. the ? ones).
5059 5072
5060 5073 * Ran all the code through pychecker. Not terribly impressed with
5061 5074 it: lots of spurious warnings and didn't really find anything of
5062 5075 substance (just a few modules being imported and not used).
5063 5076
5064 5077 * Implemented the new ultraTB functionality into IPython. New
5065 5078 option: xcolors. This chooses color scheme. xmode now only selects
5066 5079 between Plain and Verbose. Better orthogonality.
5067 5080
5068 5081 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5069 5082 mode and color scheme for the exception handlers. Now it's
5070 5083 possible to have the verbose traceback with no coloring.
5071 5084
5072 5085 2001-11-23 Fernando Perez <fperez@colorado.edu>
5073 5086
5074 5087 * Version 0.1.12 released, 0.1.13 opened.
5075 5088
5076 5089 * Removed option to set auto-quote and auto-paren escapes by
5077 5090 user. The chances of breaking valid syntax are just too high. If
5078 5091 someone *really* wants, they can always dig into the code.
5079 5092
5080 5093 * Made prompt separators configurable.
5081 5094
5082 5095 2001-11-22 Fernando Perez <fperez@colorado.edu>
5083 5096
5084 5097 * Small bugfixes in many places.
5085 5098
5086 5099 * Removed the MyCompleter class from ipplib. It seemed redundant
5087 5100 with the C-p,C-n history search functionality. Less code to
5088 5101 maintain.
5089 5102
5090 5103 * Moved all the original ipython.py code into ipythonlib.py. Right
5091 5104 now it's just one big dump into a function called make_IPython, so
5092 5105 no real modularity has been gained. But at least it makes the
5093 5106 wrapper script tiny, and since ipythonlib is a module, it gets
5094 5107 compiled and startup is much faster.
5095 5108
5096 5109 This is a reasobably 'deep' change, so we should test it for a
5097 5110 while without messing too much more with the code.
5098 5111
5099 5112 2001-11-21 Fernando Perez <fperez@colorado.edu>
5100 5113
5101 5114 * Version 0.1.11 released, 0.1.12 opened for further work.
5102 5115
5103 5116 * Removed dependency on Itpl. It was only needed in one place. It
5104 5117 would be nice if this became part of python, though. It makes life
5105 5118 *a lot* easier in some cases.
5106 5119
5107 5120 * Simplified the prefilter code a bit. Now all handlers are
5108 5121 expected to explicitly return a value (at least a blank string).
5109 5122
5110 5123 * Heavy edits in ipplib. Removed the help system altogether. Now
5111 5124 obj?/?? is used for inspecting objects, a magic @doc prints
5112 5125 docstrings, and full-blown Python help is accessed via the 'help'
5113 5126 keyword. This cleans up a lot of code (less to maintain) and does
5114 5127 the job. Since 'help' is now a standard Python component, might as
5115 5128 well use it and remove duplicate functionality.
5116 5129
5117 5130 Also removed the option to use ipplib as a standalone program. By
5118 5131 now it's too dependent on other parts of IPython to function alone.
5119 5132
5120 5133 * Fixed bug in genutils.pager. It would crash if the pager was
5121 5134 exited immediately after opening (broken pipe).
5122 5135
5123 5136 * Trimmed down the VerboseTB reporting a little. The header is
5124 5137 much shorter now and the repeated exception arguments at the end
5125 5138 have been removed. For interactive use the old header seemed a bit
5126 5139 excessive.
5127 5140
5128 5141 * Fixed small bug in output of @whos for variables with multi-word
5129 5142 types (only first word was displayed).
5130 5143
5131 5144 2001-11-17 Fernando Perez <fperez@colorado.edu>
5132 5145
5133 5146 * Version 0.1.10 released, 0.1.11 opened for further work.
5134 5147
5135 5148 * Modified dirs and friends. dirs now *returns* the stack (not
5136 5149 prints), so one can manipulate it as a variable. Convenient to
5137 5150 travel along many directories.
5138 5151
5139 5152 * Fixed bug in magic_pdef: would only work with functions with
5140 5153 arguments with default values.
5141 5154
5142 5155 2001-11-14 Fernando Perez <fperez@colorado.edu>
5143 5156
5144 5157 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5145 5158 example with IPython. Various other minor fixes and cleanups.
5146 5159
5147 5160 * Version 0.1.9 released, 0.1.10 opened for further work.
5148 5161
5149 5162 * Added sys.path to the list of directories searched in the
5150 5163 execfile= option. It used to be the current directory and the
5151 5164 user's IPYTHONDIR only.
5152 5165
5153 5166 2001-11-13 Fernando Perez <fperez@colorado.edu>
5154 5167
5155 5168 * Reinstated the raw_input/prefilter separation that Janko had
5156 5169 initially. This gives a more convenient setup for extending the
5157 5170 pre-processor from the outside: raw_input always gets a string,
5158 5171 and prefilter has to process it. We can then redefine prefilter
5159 5172 from the outside and implement extensions for special
5160 5173 purposes.
5161 5174
5162 5175 Today I got one for inputting PhysicalQuantity objects
5163 5176 (from Scientific) without needing any function calls at
5164 5177 all. Extremely convenient, and it's all done as a user-level
5165 5178 extension (no IPython code was touched). Now instead of:
5166 5179 a = PhysicalQuantity(4.2,'m/s**2')
5167 5180 one can simply say
5168 5181 a = 4.2 m/s**2
5169 5182 or even
5170 5183 a = 4.2 m/s^2
5171 5184
5172 5185 I use this, but it's also a proof of concept: IPython really is
5173 5186 fully user-extensible, even at the level of the parsing of the
5174 5187 command line. It's not trivial, but it's perfectly doable.
5175 5188
5176 5189 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5177 5190 the problem of modules being loaded in the inverse order in which
5178 5191 they were defined in
5179 5192
5180 5193 * Version 0.1.8 released, 0.1.9 opened for further work.
5181 5194
5182 5195 * Added magics pdef, source and file. They respectively show the
5183 5196 definition line ('prototype' in C), source code and full python
5184 5197 file for any callable object. The object inspector oinfo uses
5185 5198 these to show the same information.
5186 5199
5187 5200 * Version 0.1.7 released, 0.1.8 opened for further work.
5188 5201
5189 5202 * Separated all the magic functions into a class called Magic. The
5190 5203 InteractiveShell class was becoming too big for Xemacs to handle
5191 5204 (de-indenting a line would lock it up for 10 seconds while it
5192 5205 backtracked on the whole class!)
5193 5206
5194 5207 FIXME: didn't work. It can be done, but right now namespaces are
5195 5208 all messed up. Do it later (reverted it for now, so at least
5196 5209 everything works as before).
5197 5210
5198 5211 * Got the object introspection system (magic_oinfo) working! I
5199 5212 think this is pretty much ready for release to Janko, so he can
5200 5213 test it for a while and then announce it. Pretty much 100% of what
5201 5214 I wanted for the 'phase 1' release is ready. Happy, tired.
5202 5215
5203 5216 2001-11-12 Fernando Perez <fperez@colorado.edu>
5204 5217
5205 5218 * Version 0.1.6 released, 0.1.7 opened for further work.
5206 5219
5207 5220 * Fixed bug in printing: it used to test for truth before
5208 5221 printing, so 0 wouldn't print. Now checks for None.
5209 5222
5210 5223 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5211 5224 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5212 5225 reaches by hand into the outputcache. Think of a better way to do
5213 5226 this later.
5214 5227
5215 5228 * Various small fixes thanks to Nathan's comments.
5216 5229
5217 5230 * Changed magic_pprint to magic_Pprint. This way it doesn't
5218 5231 collide with pprint() and the name is consistent with the command
5219 5232 line option.
5220 5233
5221 5234 * Changed prompt counter behavior to be fully like
5222 5235 Mathematica's. That is, even input that doesn't return a result
5223 5236 raises the prompt counter. The old behavior was kind of confusing
5224 5237 (getting the same prompt number several times if the operation
5225 5238 didn't return a result).
5226 5239
5227 5240 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5228 5241
5229 5242 * Fixed -Classic mode (wasn't working anymore).
5230 5243
5231 5244 * Added colored prompts using Nathan's new code. Colors are
5232 5245 currently hardwired, they can be user-configurable. For
5233 5246 developers, they can be chosen in file ipythonlib.py, at the
5234 5247 beginning of the CachedOutput class def.
5235 5248
5236 5249 2001-11-11 Fernando Perez <fperez@colorado.edu>
5237 5250
5238 5251 * Version 0.1.5 released, 0.1.6 opened for further work.
5239 5252
5240 5253 * Changed magic_env to *return* the environment as a dict (not to
5241 5254 print it). This way it prints, but it can also be processed.
5242 5255
5243 5256 * Added Verbose exception reporting to interactive
5244 5257 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5245 5258 traceback. Had to make some changes to the ultraTB file. This is
5246 5259 probably the last 'big' thing in my mental todo list. This ties
5247 5260 in with the next entry:
5248 5261
5249 5262 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5250 5263 has to specify is Plain, Color or Verbose for all exception
5251 5264 handling.
5252 5265
5253 5266 * Removed ShellServices option. All this can really be done via
5254 5267 the magic system. It's easier to extend, cleaner and has automatic
5255 5268 namespace protection and documentation.
5256 5269
5257 5270 2001-11-09 Fernando Perez <fperez@colorado.edu>
5258 5271
5259 5272 * Fixed bug in output cache flushing (missing parameter to
5260 5273 __init__). Other small bugs fixed (found using pychecker).
5261 5274
5262 5275 * Version 0.1.4 opened for bugfixing.
5263 5276
5264 5277 2001-11-07 Fernando Perez <fperez@colorado.edu>
5265 5278
5266 5279 * Version 0.1.3 released, mainly because of the raw_input bug.
5267 5280
5268 5281 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5269 5282 and when testing for whether things were callable, a call could
5270 5283 actually be made to certain functions. They would get called again
5271 5284 once 'really' executed, with a resulting double call. A disaster
5272 5285 in many cases (list.reverse() would never work!).
5273 5286
5274 5287 * Removed prefilter() function, moved its code to raw_input (which
5275 5288 after all was just a near-empty caller for prefilter). This saves
5276 5289 a function call on every prompt, and simplifies the class a tiny bit.
5277 5290
5278 5291 * Fix _ip to __ip name in magic example file.
5279 5292
5280 5293 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5281 5294 work with non-gnu versions of tar.
5282 5295
5283 5296 2001-11-06 Fernando Perez <fperez@colorado.edu>
5284 5297
5285 5298 * Version 0.1.2. Just to keep track of the recent changes.
5286 5299
5287 5300 * Fixed nasty bug in output prompt routine. It used to check 'if
5288 5301 arg != None...'. Problem is, this fails if arg implements a
5289 5302 special comparison (__cmp__) which disallows comparing to
5290 5303 None. Found it when trying to use the PhysicalQuantity module from
5291 5304 ScientificPython.
5292 5305
5293 5306 2001-11-05 Fernando Perez <fperez@colorado.edu>
5294 5307
5295 5308 * Also added dirs. Now the pushd/popd/dirs family functions
5296 5309 basically like the shell, with the added convenience of going home
5297 5310 when called with no args.
5298 5311
5299 5312 * pushd/popd slightly modified to mimic shell behavior more
5300 5313 closely.
5301 5314
5302 5315 * Added env,pushd,popd from ShellServices as magic functions. I
5303 5316 think the cleanest will be to port all desired functions from
5304 5317 ShellServices as magics and remove ShellServices altogether. This
5305 5318 will provide a single, clean way of adding functionality
5306 5319 (shell-type or otherwise) to IP.
5307 5320
5308 5321 2001-11-04 Fernando Perez <fperez@colorado.edu>
5309 5322
5310 5323 * Added .ipython/ directory to sys.path. This way users can keep
5311 5324 customizations there and access them via import.
5312 5325
5313 5326 2001-11-03 Fernando Perez <fperez@colorado.edu>
5314 5327
5315 5328 * Opened version 0.1.1 for new changes.
5316 5329
5317 5330 * Changed version number to 0.1.0: first 'public' release, sent to
5318 5331 Nathan and Janko.
5319 5332
5320 5333 * Lots of small fixes and tweaks.
5321 5334
5322 5335 * Minor changes to whos format. Now strings are shown, snipped if
5323 5336 too long.
5324 5337
5325 5338 * Changed ShellServices to work on __main__ so they show up in @who
5326 5339
5327 5340 * Help also works with ? at the end of a line:
5328 5341 ?sin and sin?
5329 5342 both produce the same effect. This is nice, as often I use the
5330 5343 tab-complete to find the name of a method, but I used to then have
5331 5344 to go to the beginning of the line to put a ? if I wanted more
5332 5345 info. Now I can just add the ? and hit return. Convenient.
5333 5346
5334 5347 2001-11-02 Fernando Perez <fperez@colorado.edu>
5335 5348
5336 5349 * Python version check (>=2.1) added.
5337 5350
5338 5351 * Added LazyPython documentation. At this point the docs are quite
5339 5352 a mess. A cleanup is in order.
5340 5353
5341 5354 * Auto-installer created. For some bizarre reason, the zipfiles
5342 5355 module isn't working on my system. So I made a tar version
5343 5356 (hopefully the command line options in various systems won't kill
5344 5357 me).
5345 5358
5346 5359 * Fixes to Struct in genutils. Now all dictionary-like methods are
5347 5360 protected (reasonably).
5348 5361
5349 5362 * Added pager function to genutils and changed ? to print usage
5350 5363 note through it (it was too long).
5351 5364
5352 5365 * Added the LazyPython functionality. Works great! I changed the
5353 5366 auto-quote escape to ';', it's on home row and next to '. But
5354 5367 both auto-quote and auto-paren (still /) escapes are command-line
5355 5368 parameters.
5356 5369
5357 5370
5358 5371 2001-11-01 Fernando Perez <fperez@colorado.edu>
5359 5372
5360 5373 * Version changed to 0.0.7. Fairly large change: configuration now
5361 5374 is all stored in a directory, by default .ipython. There, all
5362 5375 config files have normal looking names (not .names)
5363 5376
5364 5377 * Version 0.0.6 Released first to Lucas and Archie as a test
5365 5378 run. Since it's the first 'semi-public' release, change version to
5366 5379 > 0.0.6 for any changes now.
5367 5380
5368 5381 * Stuff I had put in the ipplib.py changelog:
5369 5382
5370 5383 Changes to InteractiveShell:
5371 5384
5372 5385 - Made the usage message a parameter.
5373 5386
5374 5387 - Require the name of the shell variable to be given. It's a bit
5375 5388 of a hack, but allows the name 'shell' not to be hardwire in the
5376 5389 magic (@) handler, which is problematic b/c it requires
5377 5390 polluting the global namespace with 'shell'. This in turn is
5378 5391 fragile: if a user redefines a variable called shell, things
5379 5392 break.
5380 5393
5381 5394 - magic @: all functions available through @ need to be defined
5382 5395 as magic_<name>, even though they can be called simply as
5383 5396 @<name>. This allows the special command @magic to gather
5384 5397 information automatically about all existing magic functions,
5385 5398 even if they are run-time user extensions, by parsing the shell
5386 5399 instance __dict__ looking for special magic_ names.
5387 5400
5388 5401 - mainloop: added *two* local namespace parameters. This allows
5389 5402 the class to differentiate between parameters which were there
5390 5403 before and after command line initialization was processed. This
5391 5404 way, later @who can show things loaded at startup by the
5392 5405 user. This trick was necessary to make session saving/reloading
5393 5406 really work: ideally after saving/exiting/reloading a session,
5394 5407 *everythin* should look the same, including the output of @who. I
5395 5408 was only able to make this work with this double namespace
5396 5409 trick.
5397 5410
5398 5411 - added a header to the logfile which allows (almost) full
5399 5412 session restoring.
5400 5413
5401 5414 - prepend lines beginning with @ or !, with a and log
5402 5415 them. Why? !lines: may be useful to know what you did @lines:
5403 5416 they may affect session state. So when restoring a session, at
5404 5417 least inform the user of their presence. I couldn't quite get
5405 5418 them to properly re-execute, but at least the user is warned.
5406 5419
5407 5420 * Started ChangeLog.
@@ -1,402 +1,408 b''
1 1 ;;; ipython.el --- Adds support for IPython to python-mode.el
2 2
3 3 ;; Copyright (C) 2002, 2003, 2004, 2005 Alexander Schmolck
4 4 ;; Author: Alexander Schmolck
5 5 ;; Keywords: ipython python languages oop
6 6 ;; URL: http://ipython.scipy.org
7 7 ;; Compatibility: Emacs21, XEmacs21
8 8 ;; FIXME: #$@! INPUT RING
9 (defconst ipython-version "$Revision: 1211 $"
9 (defconst ipython-version "$Revision: 1324 $"
10 10 "VC version number.")
11 11
12 12 ;;; Commentary
13 13 ;; This library makes all the functionality python-mode has when running with
14 14 ;; the normal python-interpreter available for ipython, too. It also enables a
15 15 ;; persistent py-shell command history accross sessions (if you exit python
16 16 ;; with C-d in py-shell) and defines the command `ipython-to-doctest', which
17 17 ;; can be used to convert bits of a ipython session into something that can be
18 18 ;; used for doctests. To install, put this file somewhere in your emacs
19 19 ;; `load-path' [1] and add the following line to your ~/.emacs file (the first
20 20 ;; line only needed if the default (``"ipython"``) is wrong)::
21 21 ;;
22 22 ;; (setq ipython-command "/SOME-PATH/ipython")
23 23 ;; (require 'ipython)
24 24 ;;
25 25 ;; Ipython will be set as the default python shell, but only if the ipython
26 26 ;; executable is in the path. For ipython sessions autocompletion with <tab>
27 27 ;; is also enabled (experimental feature!). Please also note that all the
28 28 ;; terminal functions in py-shell are handled by emacs's comint, **not** by
29 29 ;; (i)python, so importing readline etc. will have 0 effect.
30 30 ;;
31 31 ;; To start an interactive ipython session run `py-shell' with ``M-x py-shell``
32 32 ;; (or the default keybinding ``C-c C-!``).
33 33 ;;
34 34 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
35 35 ;; will work fine for most cases, doing certain things (like the
36 36 ;; autocompletion and a decent scheme to switch between python interpreters)
37 37 ;; properly will also require changes to ipython that will likely have to wait
38 38 ;; for a larger rewrite scheduled some time in the future.
39 39 ;;
40 40 ;; Also note that you currently NEED THE CVS VERSION OF PYTHON.EL.
41 41 ;;
42 42 ;; Further note that I don't know whether this runs under windows or not and
43 43 ;; that if it doesn't I can't really help much, not being afflicted myself.
44 44 ;;
45 45 ;;
46 46 ;; Hints for effective usage
47 47 ;; -------------------------
48 48 ;;
49 49 ;; - IMO the best feature by far of the ipython/emacs combo is how much easier it
50 ;; makes it to find and fix bugs thanks to the ``@pdb on``/ pdbtrack combo. Try
51 ;; it: first in the ipython to shell do ``@pdb on`` then do something that will
50 ;; makes it to find and fix bugs thanks to the ``%pdb on``/ pdbtrack combo. Try
51 ;; it: first in the ipython to shell do ``%pdb on`` then do something that will
52 52 ;; raise an exception (FIXME nice example) -- and be amazed how easy it is to
53 53 ;; inspect the live objects in each stack frames and to jump to the
54 54 ;; corresponding sourcecode locations as you walk up and down the stack trace
55 55 ;; (even without ``%pdb on`` you can always use ``C-c -`` (`py-up-exception')
56 56 ;; to jump to the corresponding source code locations).
57 57 ;;
58 58 ;; - emacs gives you much more powerful commandline editing and output searching
59 59 ;; capabilities than ipython-standalone -- isearch is your friend if you
60 60 ;; quickly want to print 'DEBUG ...' to stdout out etc.
61 61 ;;
62 62 ;; - This is not really specific to ipython, but for more convenient history
63 63 ;; access you might want to add something like the following to *the beggining*
64 64 ;; of your ``.emacs`` (if you want behavior that's more similar to stand-alone
65 65 ;; ipython, you can change ``meta p`` etc. for ``control p``)::
66 66 ;;
67 67 ;; (require 'comint)
68 68 ;; (define-key comint-mode-map [(meta p)]
69 69 ;; 'comint-previous-matching-input-from-input)
70 70 ;; (define-key comint-mode-map [(meta n)]
71 71 ;; 'comint-next-matching-input-from-input)
72 72 ;; (define-key comint-mode-map [(control meta n)]
73 73 ;; 'comint-next-input)
74 74 ;; (define-key comint-mode-map [(control meta p)]
75 75 ;; 'comint-previous-input)
76 76 ;;
77 77 ;; - Be aware that if you customize py-python-command previously, this value
78 78 ;; will override what ipython.el does (because loading the customization
79 79 ;; variables comes later).
80 80 ;;
81 81 ;; Please send comments and feedback to the ipython-list
82 82 ;; (<ipython-user@scipy.net>) where I (a.s.) or someone else will try to
83 83 ;; answer them (it helps if you specify your emacs version, OS etc;
84 84 ;; familiarity with <http://www.catb.org/~esr/faqs/smart-questions.html> might
85 85 ;; speed up things further).
86 86 ;;
87 87 ;; Footnotes:
88 88 ;;
89 89 ;; [1] If you don't know what `load-path' is, C-h v load-path will tell
90 90 ;; you; if required you can also add a new directory. So assuming that
91 91 ;; ipython.el resides in ~/el/, put this in your emacs:
92 92 ;;
93 93 ;;
94 94 ;; (add-to-list 'load-path "~/el")
95 95 ;; (setq ipython-command "/some-path/ipython")
96 96 ;; (require 'ipython)
97 97 ;;
98 98 ;;
99 99 ;;
100 100 ;;
101 101 ;; TODO:
102 102 ;; - do autocompletion properly
103 103 ;; - implement a proper switching between python interpreters
104 104 ;;
105 105 ;; BUGS:
106 106 ;; - neither::
107 107 ;;
108 108 ;; (py-shell "-c print 'FOOBAR'")
109 109 ;;
110 110 ;; nor::
111 111 ;;
112 112 ;; (let ((py-python-command-args (append py-python-command-args
113 113 ;; '("-c" "print 'FOOBAR'"))))
114 114 ;; (py-shell))
115 115 ;;
116 116 ;; seem to print anything as they should
117 117 ;;
118 118 ;; - look into init priority issues with `py-python-command' (if it's set
119 119 ;; via custom)
120 120
121 121
122 122 ;;; Code
123 123 (require 'cl)
124 124 (require 'shell)
125 125 (require 'executable)
126 126 (require 'ansi-color)
127 127
128 128 (defcustom ipython-command "ipython"
129 129 "*Shell command used to start ipython."
130 130 :type 'string
131 131 :group 'python)
132 132
133 133 ;; Users can set this to nil
134 134 (defvar py-shell-initial-switch-buffers t
135 135 "If nil, don't switch to the *Python* buffer on the first call to
136 136 `py-shell'.")
137 137
138 138 (defvar ipython-backup-of-py-python-command nil
139 139 "HACK")
140 140
141 141
142 142 (defvar ipython-de-input-prompt-regexp "\\(?:
143 143 In \\[[0-9]+\\]: *.*
144 144 ----+> \\(.*
145 145 \\)[\n]?\\)\\|\\(?:
146 146 In \\[[0-9]+\\]: *\\(.*
147 147 \\)\\)\\|^[ ]\\{3\\}[.]\\{3,\\}: *\\(.*
148 148 \\)"
149 149 "A regular expression to match the IPython input prompt and the python
150 150 command after it. The first match group is for a command that is rewritten,
151 151 the second for a 'normal' command, and the third for a multiline command.")
152 152 (defvar ipython-de-output-prompt-regexp "^Out\\[[0-9]+\\]: "
153 153 "A regular expression to match the output prompt of IPython.")
154 154
155 155
156 156 (if (not (executable-find ipython-command))
157 157 (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
158 158 ipython-command))
159 159 ;; XXX load python-mode, so that we can screw around with its variables
160 160 ;; this has the disadvantage that python-mode is loaded even if no
161 161 ;; python-file is ever edited etc. but it means that `py-shell' works
162 162 ;; without loading a python-file first. Obviously screwing around with
163 163 ;; python-mode's variables like this is a mess, but well.
164 164 (require 'python-mode)
165 165 ;; turn on ansi colors for ipython and activate completion
166 166 (defun ipython-shell-hook ()
167 167 ;; the following is to synchronize dir-changes
168 168 (make-local-variable 'shell-dirstack)
169 169 (setq shell-dirstack nil)
170 170 (make-local-variable 'shell-last-dir)
171 171 (setq shell-last-dir nil)
172 172 (make-local-variable 'shell-dirtrackp)
173 173 (setq shell-dirtrackp t)
174 174 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
175 175
176 176 (ansi-color-for-comint-mode-on)
177 177 (define-key py-shell-map [tab] 'ipython-complete)
178 178 ;;XXX this is really just a cheap hack, it only completes symbols in the
179 179 ;;interactive session -- useful nonetheless.
180 (define-key py-mode-map [(meta tab)] 'ipython-complete))
180 (define-key py-mode-map [(meta tab)] 'ipython-complete)
181
182 )
181 183 (add-hook 'py-shell-hook 'ipython-shell-hook)
182 184 ;; Regular expression that describes tracebacks for IPython in context and
183 185 ;; verbose mode.
184 186
185 187 ;;Adapt python-mode settings for ipython.
186 188 ;; (this works for %xmode 'verbose' or 'context')
187 189
188 190 ;; XXX putative regexps for syntax errors; unfortunately the
189 191 ;; current python-mode traceback-line-re scheme is too primitive,
190 192 ;; so it's either matching syntax errors, *or* everything else
191 193 ;; (XXX: should ask Fernando for a change)
192 194 ;;"^ File \"\\(.*?\\)\", line \\([0-9]+\\).*\n.*\n.*\nSyntaxError:"
193 195 ;;^ File \"\\(.*?\\)\", line \\([0-9]+\\)"
196
194 197 (setq py-traceback-line-re
195 198 "\\(^[^\t ].+?\\.py\\).*\n +[0-9]+[^\00]*?\n-+> \\([0-9]+\\) +")
196 199
200 ;; Recognize the ipython pdb, whose prompt is 'ipdb>' instead of '(Pdb)'
201 (setq py-pdbtrack-input-prompt "\n[(<]*[Ii]?[Pp]db[>)]+ ")
202
197 203 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
198 204 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
199 205 ;; select a suitable color-scheme
200 206 (unless (member "-colors" py-python-command-args)
201 207 (setq py-python-command-args
202 208 (nconc py-python-command-args
203 209 (list "-colors"
204 210 (cond
205 211 ((eq frame-background-mode 'dark)
206 212 "DarkBG")
207 213 ((eq frame-background-mode 'light)
208 214 "LightBG")
209 215 (t ; default (backg-mode isn't always set by XEmacs)
210 216 "LightBG"))))))
211 217 (unless (equal ipython-backup-of-py-python-command py-python-command)
212 218 (setq ipython-backup-of-py-python-command py-python-command))
213 219 (setq py-python-command ipython-command))
214 220
215 221
216 222 ;; MODIFY py-shell so that it loads the editing history
217 223 (defadvice py-shell (around py-shell-with-history)
218 224 "Add persistent command-history support (in
219 225 $PYTHONHISTORY (or \"~/.ipython/history\", if we use IPython)). Also, if
220 226 `py-shell-initial-switch-buffers' is nil, it only switches to *Python* if that
221 227 buffer already exists."
222 228 (if (comint-check-proc "*Python*")
223 229 ad-do-it
224 230 (setq comint-input-ring-file-name
225 231 (if (string-equal py-python-command ipython-command)
226 232 (concat (or (getenv "IPYTHONDIR") "~/.ipython") "/history")
227 233 (or (getenv "PYTHONHISTORY") "~/.python-history.py")))
228 234 (comint-read-input-ring t)
229 235 (let ((buf (current-buffer)))
230 236 ad-do-it
231 237 (unless py-shell-initial-switch-buffers
232 238 (switch-to-buffer-other-window buf)))))
233 239 (ad-activate 'py-shell)
234 240 ;; (defadvice py-execute-region (before py-execute-buffer-ensure-process)
235 241 ;; "HACK: test that ipython is already running before executing something.
236 242 ;; Doing this properly seems not worth the bother (unless people actually
237 243 ;; request it)."
238 244 ;; (unless (comint-check-proc "*Python*")
239 245 ;; (error "Sorry you have to first do M-x py-shell to send something to ipython.")))
240 246 ;; (ad-activate 'py-execute-region)
241 247
242 248 (defadvice py-execute-region (around py-execute-buffer-ensure-process)
243 249 "HACK: if `py-shell' is not active or ASYNC is explicitly desired, fall back
244 250 to python instead of ipython."
245 251 (let ((py-python-command (if (and (comint-check-proc "*Python*") (not async))
246 252 py-python-command
247 253 ipython-backup-of-py-python-command)))
248 254 ad-do-it))
249 255 (ad-activate 'py-execute-region)
250 256
251 257 (defun ipython-to-doctest (start end)
252 258 "Transform a cut-and-pasted bit from an IPython session into something that
253 259 looks like it came from a normal interactive python session, so that it can
254 260 be used in doctests. Example:
255 261
256 262
257 263 In [1]: import sys
258 264
259 265 In [2]: sys.stdout.write 'Hi!\n'
260 266 ------> sys.stdout.write ('Hi!\n')
261 267 Hi!
262 268
263 269 In [3]: 3 + 4
264 270 Out[3]: 7
265 271
266 272 gets converted to:
267 273
268 274 >>> import sys
269 275 >>> sys.stdout.write ('Hi!\n')
270 276 Hi!
271 277 >>> 3 + 4
272 278 7
273 279
274 280 "
275 281 (interactive "*r\n")
276 282 ;(message (format "###DEBUG s:%de:%d" start end))
277 283 (save-excursion
278 284 (save-match-data
279 285 ;; replace ``In [3]: bla`` with ``>>> bla`` and
280 286 ;; ``... : bla`` with ``... bla``
281 287 (goto-char start)
282 288 (while (re-search-forward ipython-de-input-prompt-regexp end t)
283 289 ;(message "finding 1")
284 290 (cond ((match-string 3) ;continued
285 291 (replace-match "... \\3" t nil))
286 292 (t
287 293 (replace-match ">>> \\1\\2" t nil))))
288 294 ;; replace ``
289 295 (goto-char start)
290 296 (while (re-search-forward ipython-de-output-prompt-regexp end t)
291 297 (replace-match "" t nil)))))
292 298
293 299 (defvar ipython-completion-command-string
294 300 "print ';'.join(__IP.Completer.all_completions('%s')) #PYTHON-MODE SILENT\n"
295 301 "The string send to ipython to query for all possible completions")
296 302
297 303
298 304 ;; xemacs doesn't have `comint-preoutput-filter-functions' so we'll try the
299 305 ;; following wonderful hack to work around this case
300 306 (if (featurep 'xemacs)
301 307 ;;xemacs
302 308 (defun ipython-complete ()
303 309 "Try to complete the python symbol before point. Only knows about the stuff
304 310 in the current *Python* session."
305 311 (interactive)
306 312 (let* ((ugly-return nil)
307 313 (sep ";")
308 314 (python-process (or (get-buffer-process (current-buffer))
309 315 ;XXX hack for .py buffers
310 316 (get-process py-which-bufname)))
311 317 ;; XXX currently we go backwards to find the beginning of an
312 318 ;; expression part; a more powerful approach in the future might be
313 319 ;; to let ipython have the complete line, so that context can be used
314 320 ;; to do things like filename completion etc.
315 321 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
316 322 (point)))
317 323 (end (point))
318 324 (pattern (buffer-substring-no-properties beg end))
319 325 (completions nil)
320 326 (completion-table nil)
321 327 completion
322 328 (comint-output-filter-functions
323 329 (append comint-output-filter-functions
324 330 '(ansi-color-filter-apply
325 331 (lambda (string)
326 332 ;(message (format "DEBUG filtering: %s" string))
327 333 (setq ugly-return (concat ugly-return string))
328 334 (delete-region comint-last-output-start
329 335 (process-mark (get-buffer-process (current-buffer)))))))))
330 336 ;(message (format "#DEBUG pattern: '%s'" pattern))
331 337 (process-send-string python-process
332 338 (format ipython-completion-command-string pattern))
333 339 (accept-process-output python-process)
334 340 ;(message (format "DEBUG return: %s" ugly-return))
335 341 (setq completions
336 342 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
337 343 (setq completion-table (loop for str in completions
338 344 collect (list str nil)))
339 345 (setq completion (try-completion pattern completion-table))
340 346 (cond ((eq completion t))
341 347 ((null completion)
342 348 (message "Can't find completion for \"%s\"" pattern)
343 349 (ding))
344 350 ((not (string= pattern completion))
345 351 (delete-region beg end)
346 352 (insert completion))
347 353 (t
348 354 (message "Making completion list...")
349 355 (with-output-to-temp-buffer "*Python Completions*"
350 356 (display-completion-list (all-completions pattern completion-table)))
351 357 (message "Making completion list...%s" "done")))))
352 358 ;; emacs
353 359 (defun ipython-complete ()
354 360 "Try to complete the python symbol before point. Only knows about the stuff
355 361 in the current *Python* session."
356 362 (interactive)
357 363 (let* ((ugly-return nil)
358 364 (sep ";")
359 365 (python-process (or (get-buffer-process (current-buffer))
360 366 ;XXX hack for .py buffers
361 367 (get-process py-which-bufname)))
362 368 ;; XXX currently we go backwards to find the beginning of an
363 369 ;; expression part; a more powerful approach in the future might be
364 370 ;; to let ipython have the complete line, so that context can be used
365 371 ;; to do things like filename completion etc.
366 372 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
367 373 (point)))
368 374 (end (point))
369 375 (pattern (buffer-substring-no-properties beg end))
370 376 (completions nil)
371 377 (completion-table nil)
372 378 completion
373 379 (comint-preoutput-filter-functions
374 380 (append comint-preoutput-filter-functions
375 381 '(ansi-color-filter-apply
376 382 (lambda (string)
377 383 (setq ugly-return (concat ugly-return string))
378 384 "")))))
379 385 (process-send-string python-process
380 386 (format ipython-completion-command-string pattern))
381 387 (accept-process-output python-process)
382 388 (setq completions
383 389 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
384 390 ;(message (format "DEBUG completions: %S" completions))
385 391 (setq completion-table (loop for str in completions
386 392 collect (list str nil)))
387 393 (setq completion (try-completion pattern completion-table))
388 394 (cond ((eq completion t))
389 395 ((null completion)
390 396 (message "Can't find completion for \"%s\"" pattern)
391 397 (ding))
392 398 ((not (string= pattern completion))
393 399 (delete-region beg end)
394 400 (insert completion))
395 401 (t
396 402 (message "Making completion list...")
397 403 (with-output-to-temp-buffer "*IPython Completions*"
398 404 (display-completion-list (all-completions pattern completion-table)))
399 405 (message "Making completion list...%s" "done")))))
400 406 )
401 407
402 408 (provide 'ipython)
General Comments 0
You need to be logged in to leave comments. Login now