Show More
@@ -1,558 +1,565 b'' | |||||
1 | # -*- Mode: Shell-Script -*- Not really, but shows comments correctly |
|
1 | # -*- Mode: Shell-Script -*- Not really, but shows comments correctly | |
2 |
# $Id: ipythonrc 9 |
|
2 | # $Id: ipythonrc 963 2005-12-28 19:21:29Z fperez $ | |
3 |
|
3 | |||
4 | #*************************************************************************** |
|
4 | #*************************************************************************** | |
5 | # |
|
5 | # | |
6 | # Configuration file for IPython -- ipythonrc format |
|
6 | # Configuration file for IPython -- ipythonrc format | |
7 | # |
|
7 | # | |
8 | # The format of this file is simply one of 'key value' lines. |
|
8 | # The format of this file is simply one of 'key value' lines. | |
9 | # Lines containing only whitespace at the beginning and then a # are ignored |
|
9 | # Lines containing only whitespace at the beginning and then a # are ignored | |
10 | # as comments. But comments can NOT be put on lines with data. |
|
10 | # as comments. But comments can NOT be put on lines with data. | |
11 |
|
11 | |||
12 | # The meaning and use of each key are explained below. |
|
12 | # The meaning and use of each key are explained below. | |
13 |
|
13 | |||
14 | #--------------------------------------------------------------------------- |
|
14 | #--------------------------------------------------------------------------- | |
15 | # Section: included files |
|
15 | # Section: included files | |
16 |
|
16 | |||
17 | # Put one or more *config* files (with the syntax of this file) you want to |
|
17 | # Put one or more *config* files (with the syntax of this file) you want to | |
18 | # include. For keys with a unique value the outermost file has precedence. For |
|
18 | # include. For keys with a unique value the outermost file has precedence. For | |
19 | # keys with multiple values, they all get assembled into a list which then |
|
19 | # keys with multiple values, they all get assembled into a list which then | |
20 | # gets loaded by IPython. |
|
20 | # gets loaded by IPython. | |
21 |
|
21 | |||
22 | # In this file, all lists of things should simply be space-separated. |
|
22 | # In this file, all lists of things should simply be space-separated. | |
23 |
|
23 | |||
24 | # This allows you to build hierarchies of files which recursively load |
|
24 | # This allows you to build hierarchies of files which recursively load | |
25 | # lower-level services. If this is your main ~/.ipython/ipythonrc file, you |
|
25 | # lower-level services. If this is your main ~/.ipython/ipythonrc file, you | |
26 | # should only keep here basic things you always want available. Then you can |
|
26 | # should only keep here basic things you always want available. Then you can | |
27 | # include it in every other special-purpose config file you create. |
|
27 | # include it in every other special-purpose config file you create. | |
28 | include |
|
28 | include | |
29 |
|
29 | |||
30 | #--------------------------------------------------------------------------- |
|
30 | #--------------------------------------------------------------------------- | |
31 | # Section: startup setup |
|
31 | # Section: startup setup | |
32 |
|
32 | |||
33 | # These are mostly things which parallel a command line option of the same |
|
33 | # These are mostly things which parallel a command line option of the same | |
34 | # name. |
|
34 | # name. | |
35 |
|
35 | |||
36 | # Keys in this section should only appear once. If any key from this section |
|
36 | # Keys in this section should only appear once. If any key from this section | |
37 | # is encountered more than once, the last value remains, all earlier ones get |
|
37 | # is encountered more than once, the last value remains, all earlier ones get | |
38 | # discarded. |
|
38 | # discarded. | |
39 |
|
39 | |||
40 | # Automatic calling of callable objects. If set to true, callable objects are |
|
40 | # Automatic calling of callable objects. If set to true, callable objects are | |
41 | # automatically called when invoked at the command line, even if you don't |
|
41 | # automatically called when invoked at the command line, even if you don't | |
42 | # type parentheses. IPython adds the parentheses for you. For example: |
|
42 | # type parentheses. IPython adds the parentheses for you. For example: | |
43 |
|
43 | |||
44 | #In [1]: str 45 |
|
44 | #In [1]: str 45 | |
45 | #------> str(45) |
|
45 | #------> str(45) | |
46 | #Out[1]: '45' |
|
46 | #Out[1]: '45' | |
47 |
|
47 | |||
48 | # IPython reprints your line with '---->' indicating that it added |
|
48 | # IPython reprints your line with '---->' indicating that it added | |
49 | # parentheses. While this option is very convenient for interactive use, it |
|
49 | # parentheses. While this option is very convenient for interactive use, it | |
50 | # may occasionally cause problems with objects which have side-effects if |
|
50 | # may occasionally cause problems with objects which have side-effects if | |
51 | # called unexpectedly. Set it to 0 if you want to disable it. |
|
51 | # called unexpectedly. Set it to 0 if you want to disable it. | |
52 |
|
52 | |||
53 | # Note that even with autocall off, you can still use '/' at the start of a |
|
53 | # Note that even with autocall off, you can still use '/' at the start of a | |
54 | # line to treat the first argument on the command line as a function and add |
|
54 | # line to treat the first argument on the command line as a function and add | |
55 | # parentheses to it: |
|
55 | # parentheses to it: | |
56 |
|
56 | |||
57 | #In [8]: /str 43 |
|
57 | #In [8]: /str 43 | |
58 | #------> str(43) |
|
58 | #------> str(43) | |
59 | #Out[8]: '43' |
|
59 | #Out[8]: '43' | |
60 |
|
60 | |||
61 | autocall 1 |
|
61 | autocall 1 | |
62 |
|
62 | |||
|
63 | # Auto-edit syntax errors. When you use the %edit magic in ipython to edit | |||
|
64 | # source code (see the 'editor' variable below), it is possible that you save | |||
|
65 | # a file with syntax errors in it. If this variable is true, IPython will ask | |||
|
66 | # you whether to re-open the editor immediately to correct such an error. | |||
|
67 | ||||
|
68 | autoedit_syntax 1 | |||
|
69 | ||||
63 | # Auto-indent. IPython can recognize lines ending in ':' and indent the next |
|
70 | # Auto-indent. IPython can recognize lines ending in ':' and indent the next | |
64 | # line, while also un-indenting automatically after 'raise' or 'return'. |
|
71 | # line, while also un-indenting automatically after 'raise' or 'return'. | |
65 |
|
72 | |||
66 | # This feature uses the readline library, so it will honor your ~/.inputrc |
|
73 | # This feature uses the readline library, so it will honor your ~/.inputrc | |
67 | # configuration (or whatever file your INPUTRC variable points to). Adding |
|
74 | # configuration (or whatever file your INPUTRC variable points to). Adding | |
68 | # the following lines to your .inputrc file can make indent/unindenting more |
|
75 | # the following lines to your .inputrc file can make indent/unindenting more | |
69 | # convenient (M-i indents, M-u unindents): |
|
76 | # convenient (M-i indents, M-u unindents): | |
70 |
|
77 | |||
71 | # $if Python |
|
78 | # $if Python | |
72 | # "\M-i": " " |
|
79 | # "\M-i": " " | |
73 | # "\M-u": "\d\d\d\d" |
|
80 | # "\M-u": "\d\d\d\d" | |
74 | # $endif |
|
81 | # $endif | |
75 |
|
82 | |||
76 | # The feature is potentially a bit dangerous, because it can cause problems |
|
83 | # The feature is potentially a bit dangerous, because it can cause problems | |
77 | # with pasting of indented code (the pasted code gets re-indented on each |
|
84 | # with pasting of indented code (the pasted code gets re-indented on each | |
78 | # line). But it's a huge time-saver when working interactively. The magic |
|
85 | # line). But it's a huge time-saver when working interactively. The magic | |
79 | # function @autoindent allows you to toggle it on/off at runtime. |
|
86 | # function @autoindent allows you to toggle it on/off at runtime. | |
80 |
|
87 | |||
81 | autoindent 1 |
|
88 | autoindent 1 | |
82 |
|
89 | |||
83 | # Auto-magic. This gives you access to all the magic functions without having |
|
90 | # Auto-magic. This gives you access to all the magic functions without having | |
84 | # to prepend them with an @ sign. If you define a variable with the same name |
|
91 | # to prepend them with an @ sign. If you define a variable with the same name | |
85 | # as a magic function (say who=1), you will need to access the magic function |
|
92 | # as a magic function (say who=1), you will need to access the magic function | |
86 | # with @ (@who in this example). However, if later you delete your variable |
|
93 | # with @ (@who in this example). However, if later you delete your variable | |
87 | # (del who), you'll recover the automagic calling form. |
|
94 | # (del who), you'll recover the automagic calling form. | |
88 |
|
95 | |||
89 | # Considering that many magic functions provide a lot of shell-like |
|
96 | # Considering that many magic functions provide a lot of shell-like | |
90 | # functionality, automagic gives you something close to a full Python+system |
|
97 | # functionality, automagic gives you something close to a full Python+system | |
91 | # shell environment (and you can extend it further if you want). |
|
98 | # shell environment (and you can extend it further if you want). | |
92 |
|
99 | |||
93 | automagic 1 |
|
100 | automagic 1 | |
94 |
|
101 | |||
95 | # Size of the output cache. After this many entries are stored, the cache will |
|
102 | # Size of the output cache. After this many entries are stored, the cache will | |
96 | # get flushed. Depending on the size of your intermediate calculations, you |
|
103 | # get flushed. Depending on the size of your intermediate calculations, you | |
97 | # may have memory problems if you make it too big, since keeping things in the |
|
104 | # may have memory problems if you make it too big, since keeping things in the | |
98 | # cache prevents Python from reclaiming the memory for old results. Experiment |
|
105 | # cache prevents Python from reclaiming the memory for old results. Experiment | |
99 | # with a value that works well for you. |
|
106 | # with a value that works well for you. | |
100 |
|
107 | |||
101 | # If you choose cache_size 0 IPython will revert to python's regular >>> |
|
108 | # If you choose cache_size 0 IPython will revert to python's regular >>> | |
102 | # unnumbered prompt. You will still have _, __ and ___ for your last three |
|
109 | # unnumbered prompt. You will still have _, __ and ___ for your last three | |
103 | # results, but that will be it. No dynamic _1, _2, etc. will be created. If |
|
110 | # results, but that will be it. No dynamic _1, _2, etc. will be created. If | |
104 | # you are running on a slow machine or with very limited memory, this may |
|
111 | # you are running on a slow machine or with very limited memory, this may | |
105 | # help. |
|
112 | # help. | |
106 |
|
113 | |||
107 | cache_size 1000 |
|
114 | cache_size 1000 | |
108 |
|
115 | |||
109 | # Classic mode: Setting 'classic 1' you lose many of IPython niceties, |
|
116 | # Classic mode: Setting 'classic 1' you lose many of IPython niceties, | |
110 | # but that's your choice! Classic 1 -> same as IPython -classic. |
|
117 | # but that's your choice! Classic 1 -> same as IPython -classic. | |
111 | # Note that this is _not_ the normal python interpreter, it's simply |
|
118 | # Note that this is _not_ the normal python interpreter, it's simply | |
112 | # IPython emulating most of the classic interpreter's behavior. |
|
119 | # IPython emulating most of the classic interpreter's behavior. | |
113 | classic 0 |
|
120 | classic 0 | |
114 |
|
121 | |||
115 | # colors - Coloring option for prompts and traceback printouts. |
|
122 | # colors - Coloring option for prompts and traceback printouts. | |
116 |
|
123 | |||
117 | # Currently available schemes: NoColor, Linux, LightBG. |
|
124 | # Currently available schemes: NoColor, Linux, LightBG. | |
118 |
|
125 | |||
119 | # This option allows coloring the prompts and traceback printouts. This |
|
126 | # This option allows coloring the prompts and traceback printouts. This | |
120 | # requires a terminal which can properly handle color escape sequences. If you |
|
127 | # requires a terminal which can properly handle color escape sequences. If you | |
121 | # are having problems with this, use the NoColor scheme (uses no color escapes |
|
128 | # are having problems with this, use the NoColor scheme (uses no color escapes | |
122 | # at all). |
|
129 | # at all). | |
123 |
|
130 | |||
124 | # The Linux option works well in linux console type environments: dark |
|
131 | # The Linux option works well in linux console type environments: dark | |
125 | # background with light fonts. |
|
132 | # background with light fonts. | |
126 |
|
133 | |||
127 | # LightBG is similar to Linux but swaps dark/light colors to be more readable |
|
134 | # LightBG is similar to Linux but swaps dark/light colors to be more readable | |
128 | # in light background terminals. |
|
135 | # in light background terminals. | |
129 |
|
136 | |||
130 | # keep uncommented only the one you want: |
|
137 | # keep uncommented only the one you want: | |
131 | colors Linux |
|
138 | colors Linux | |
132 | #colors LightBG |
|
139 | #colors LightBG | |
133 | #colors NoColor |
|
140 | #colors NoColor | |
134 |
|
141 | |||
135 | ######################## |
|
142 | ######################## | |
136 | # Note to Windows users |
|
143 | # Note to Windows users | |
137 | # |
|
144 | # | |
138 | # Color and readline support is avaialble to Windows users via Gary Bishop's |
|
145 | # Color and readline support is avaialble to Windows users via Gary Bishop's | |
139 | # readline library. You can find Gary's tools at |
|
146 | # readline library. You can find Gary's tools at | |
140 | # http://sourceforge.net/projects/uncpythontools. |
|
147 | # http://sourceforge.net/projects/uncpythontools. | |
141 | # Note that his readline module requires in turn the ctypes library, available |
|
148 | # Note that his readline module requires in turn the ctypes library, available | |
142 | # at http://starship.python.net/crew/theller/ctypes. |
|
149 | # at http://starship.python.net/crew/theller/ctypes. | |
143 | ######################## |
|
150 | ######################## | |
144 |
|
151 | |||
145 | # color_info: IPython can display information about objects via a set of |
|
152 | # color_info: IPython can display information about objects via a set of | |
146 | # functions, and optionally can use colors for this, syntax highlighting |
|
153 | # functions, and optionally can use colors for this, syntax highlighting | |
147 | # source code and various other elements. This information is passed through a |
|
154 | # source code and various other elements. This information is passed through a | |
148 | # pager (it defaults to 'less' if $PAGER is not set). |
|
155 | # pager (it defaults to 'less' if $PAGER is not set). | |
149 |
|
156 | |||
150 | # If your pager has problems, try to setting it to properly handle escapes |
|
157 | # If your pager has problems, try to setting it to properly handle escapes | |
151 | # (see the less manpage for detail), or disable this option. The magic |
|
158 | # (see the less manpage for detail), or disable this option. The magic | |
152 | # function @color_info allows you to toggle this interactively for testing. |
|
159 | # function @color_info allows you to toggle this interactively for testing. | |
153 |
|
160 | |||
154 | color_info 1 |
|
161 | color_info 1 | |
155 |
|
162 | |||
156 | # confirm_exit: set to 1 if you want IPython to confirm when you try to exit |
|
163 | # confirm_exit: set to 1 if you want IPython to confirm when you try to exit | |
157 | # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using |
|
164 | # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using | |
158 | # the magic functions @Exit or @Quit you can force a direct exit, bypassing |
|
165 | # the magic functions @Exit or @Quit you can force a direct exit, bypassing | |
159 | # any confirmation. |
|
166 | # any confirmation. | |
160 |
|
167 | |||
161 | confirm_exit 1 |
|
168 | confirm_exit 1 | |
162 |
|
169 | |||
163 | # Use deep_reload() as a substitute for reload() by default. deep_reload() is |
|
170 | # Use deep_reload() as a substitute for reload() by default. deep_reload() is | |
164 | # still available as dreload() and appears as a builtin. |
|
171 | # still available as dreload() and appears as a builtin. | |
165 |
|
172 | |||
166 | deep_reload 0 |
|
173 | deep_reload 0 | |
167 |
|
174 | |||
168 | # Which editor to use with the @edit command. If you leave this at 0, IPython |
|
175 | # Which editor to use with the @edit command. If you leave this at 0, IPython | |
169 | # will honor your EDITOR environment variable. Since this editor is invoked on |
|
176 | # will honor your EDITOR environment variable. Since this editor is invoked on | |
170 | # the fly by ipython and is meant for editing small code snippets, you may |
|
177 | # the fly by ipython and is meant for editing small code snippets, you may | |
171 | # want to use a small, lightweight editor here. |
|
178 | # want to use a small, lightweight editor here. | |
172 |
|
179 | |||
173 | # For Emacs users, setting up your Emacs server properly as described in the |
|
180 | # For Emacs users, setting up your Emacs server properly as described in the | |
174 | # manual is a good idea. An alternative is to use jed, a very light editor |
|
181 | # manual is a good idea. An alternative is to use jed, a very light editor | |
175 | # with much of the feel of Emacs (though not as powerful for heavy-duty work). |
|
182 | # with much of the feel of Emacs (though not as powerful for heavy-duty work). | |
176 |
|
183 | |||
177 | editor 0 |
|
184 | editor 0 | |
178 |
|
185 | |||
179 | # log 1 -> same as ipython -log. This automatically logs to ./ipython.log |
|
186 | # log 1 -> same as ipython -log. This automatically logs to ./ipython.log | |
180 | log 0 |
|
187 | log 0 | |
181 |
|
188 | |||
182 | # Same as ipython -Logfile YourLogfileName. |
|
189 | # Same as ipython -Logfile YourLogfileName. | |
183 | # Don't use with log 1 (use one or the other) |
|
190 | # Don't use with log 1 (use one or the other) | |
184 | logfile '' |
|
191 | logfile '' | |
185 |
|
192 | |||
186 | # banner 0 -> same as ipython -nobanner |
|
193 | # banner 0 -> same as ipython -nobanner | |
187 | banner 1 |
|
194 | banner 1 | |
188 |
|
195 | |||
189 | # messages 0 -> same as ipython -nomessages |
|
196 | # messages 0 -> same as ipython -nomessages | |
190 | messages 1 |
|
197 | messages 1 | |
191 |
|
198 | |||
192 | # Automatically call the pdb debugger after every uncaught exception. If you |
|
199 | # Automatically call the pdb debugger after every uncaught exception. If you | |
193 | # are used to debugging using pdb, this puts you automatically inside of it |
|
200 | # are used to debugging using pdb, this puts you automatically inside of it | |
194 | # after any call (either in IPython or in code called by it) which triggers an |
|
201 | # after any call (either in IPython or in code called by it) which triggers an | |
195 | # exception which goes uncaught. |
|
202 | # exception which goes uncaught. | |
196 | pdb 0 |
|
203 | pdb 0 | |
197 |
|
204 | |||
198 | # Enable the pprint module for printing. pprint tends to give a more readable |
|
205 | # Enable the pprint module for printing. pprint tends to give a more readable | |
199 | # display (than print) for complex nested data structures. |
|
206 | # display (than print) for complex nested data structures. | |
200 | pprint 1 |
|
207 | pprint 1 | |
201 |
|
208 | |||
202 | # Prompt strings |
|
209 | # Prompt strings | |
203 |
|
210 | |||
204 | # Most bash-like escapes can be used to customize IPython's prompts, as well as |
|
211 | # Most bash-like escapes can be used to customize IPython's prompts, as well as | |
205 | # a few additional ones which are IPython-specific. All valid prompt escapes |
|
212 | # a few additional ones which are IPython-specific. All valid prompt escapes | |
206 | # are described in detail in the Customization section of the IPython HTML/PDF |
|
213 | # are described in detail in the Customization section of the IPython HTML/PDF | |
207 | # manual. |
|
214 | # manual. | |
208 |
|
215 | |||
209 | # Use \# to represent the current prompt number, and quote them to protect |
|
216 | # Use \# to represent the current prompt number, and quote them to protect | |
210 | # spaces. |
|
217 | # spaces. | |
211 | prompt_in1 'In [\#]: ' |
|
218 | prompt_in1 'In [\#]: ' | |
212 |
|
219 | |||
213 | # \D is replaced by as many dots as there are digits in the |
|
220 | # \D is replaced by as many dots as there are digits in the | |
214 | # current value of \#. |
|
221 | # current value of \#. | |
215 | prompt_in2 ' .\D.: ' |
|
222 | prompt_in2 ' .\D.: ' | |
216 |
|
223 | |||
217 | prompt_out 'Out[\#]: ' |
|
224 | prompt_out 'Out[\#]: ' | |
218 |
|
225 | |||
219 | # Select whether to left-pad the output prompts to match the length of the |
|
226 | # Select whether to left-pad the output prompts to match the length of the | |
220 | # input ones. This allows you for example to use a simple '>' as an output |
|
227 | # input ones. This allows you for example to use a simple '>' as an output | |
221 | # prompt, and yet have the output line up with the input. If set to false, |
|
228 | # prompt, and yet have the output line up with the input. If set to false, | |
222 | # the output prompts will be unpadded (flush left). |
|
229 | # the output prompts will be unpadded (flush left). | |
223 | prompts_pad_left 1 |
|
230 | prompts_pad_left 1 | |
224 |
|
231 | |||
225 | # quick 1 -> same as ipython -quick |
|
232 | # quick 1 -> same as ipython -quick | |
226 | quick 0 |
|
233 | quick 0 | |
227 |
|
234 | |||
228 | # Use the readline library (1) or not (0). Most users will want this on, but |
|
235 | # Use the readline library (1) or not (0). Most users will want this on, but | |
229 | # if you experience strange problems with line management (mainly when using |
|
236 | # if you experience strange problems with line management (mainly when using | |
230 | # IPython inside Emacs buffers) you may try disabling it. Not having it on |
|
237 | # IPython inside Emacs buffers) you may try disabling it. Not having it on | |
231 | # prevents you from getting command history with the arrow keys, searching and |
|
238 | # prevents you from getting command history with the arrow keys, searching and | |
232 | # name completion using TAB. |
|
239 | # name completion using TAB. | |
233 |
|
240 | |||
234 | readline 1 |
|
241 | readline 1 | |
235 |
|
242 | |||
236 | # Screen Length: number of lines of your screen. This is used to control |
|
243 | # Screen Length: number of lines of your screen. This is used to control | |
237 | # printing of very long strings. Strings longer than this number of lines will |
|
244 | # printing of very long strings. Strings longer than this number of lines will | |
238 | # be paged with the less command instead of directly printed. |
|
245 | # be paged with the less command instead of directly printed. | |
239 |
|
246 | |||
240 | # The default value for this is 0, which means IPython will auto-detect your |
|
247 | # The default value for this is 0, which means IPython will auto-detect your | |
241 | # screen size every time it needs to print. If for some reason this isn't |
|
248 | # screen size every time it needs to print. If for some reason this isn't | |
242 | # working well (it needs curses support), specify it yourself. Otherwise don't |
|
249 | # working well (it needs curses support), specify it yourself. Otherwise don't | |
243 | # change the default. |
|
250 | # change the default. | |
244 |
|
251 | |||
245 | screen_length 0 |
|
252 | screen_length 0 | |
246 |
|
253 | |||
247 | # Prompt separators for input and output. |
|
254 | # Prompt separators for input and output. | |
248 | # Use \n for newline explicitly, without quotes. |
|
255 | # Use \n for newline explicitly, without quotes. | |
249 | # Use 0 (like at the cmd line) to turn off a given separator. |
|
256 | # Use 0 (like at the cmd line) to turn off a given separator. | |
250 |
|
257 | |||
251 | # The structure of prompt printing is: |
|
258 | # The structure of prompt printing is: | |
252 | # (SeparateIn)Input.... |
|
259 | # (SeparateIn)Input.... | |
253 | # (SeparateOut)Output... |
|
260 | # (SeparateOut)Output... | |
254 | # (SeparateOut2), # that is, no newline is printed after Out2 |
|
261 | # (SeparateOut2), # that is, no newline is printed after Out2 | |
255 | # By choosing these you can organize your output any way you want. |
|
262 | # By choosing these you can organize your output any way you want. | |
256 |
|
263 | |||
257 | separate_in \n |
|
264 | separate_in \n | |
258 | separate_out 0 |
|
265 | separate_out 0 | |
259 | separate_out2 0 |
|
266 | separate_out2 0 | |
260 |
|
267 | |||
261 | # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'. |
|
268 | # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'. | |
262 | # Simply removes all input/output separators, overriding the choices above. |
|
269 | # Simply removes all input/output separators, overriding the choices above. | |
263 | nosep 0 |
|
270 | nosep 0 | |
264 |
|
271 | |||
265 | # Wildcard searches - IPython has a system for searching names using |
|
272 | # Wildcard searches - IPython has a system for searching names using | |
266 | # shell-like wildcards; type %psearch? for details. This variables sets |
|
273 | # shell-like wildcards; type %psearch? for details. This variables sets | |
267 | # whether by default such searches should be case sensitive or not. You can |
|
274 | # whether by default such searches should be case sensitive or not. You can | |
268 | # always override the default at the system command line or the IPython |
|
275 | # always override the default at the system command line or the IPython | |
269 | # prompt. |
|
276 | # prompt. | |
270 |
|
277 | |||
271 | wildcards_case_sensitive 1 |
|
278 | wildcards_case_sensitive 1 | |
272 |
|
279 | |||
273 | # xmode - Exception reporting mode. |
|
280 | # xmode - Exception reporting mode. | |
274 |
|
281 | |||
275 | # Valid modes: Plain, Context and Verbose. |
|
282 | # Valid modes: Plain, Context and Verbose. | |
276 |
|
283 | |||
277 | # Plain: similar to python's normal traceback printing. |
|
284 | # Plain: similar to python's normal traceback printing. | |
278 |
|
285 | |||
279 | # Context: prints 5 lines of context source code around each line in the |
|
286 | # Context: prints 5 lines of context source code around each line in the | |
280 | # traceback. |
|
287 | # traceback. | |
281 |
|
288 | |||
282 | # Verbose: similar to Context, but additionally prints the variables currently |
|
289 | # Verbose: similar to Context, but additionally prints the variables currently | |
283 | # visible where the exception happened (shortening their strings if too |
|
290 | # visible where the exception happened (shortening their strings if too | |
284 | # long). This can potentially be very slow, if you happen to have a huge data |
|
291 | # long). This can potentially be very slow, if you happen to have a huge data | |
285 | # structure whose string representation is complex to compute. Your computer |
|
292 | # structure whose string representation is complex to compute. Your computer | |
286 | # may appear to freeze for a while with cpu usage at 100%. If this occurs, you |
|
293 | # may appear to freeze for a while with cpu usage at 100%. If this occurs, you | |
287 | # can cancel the traceback with Ctrl-C (maybe hitting it more than once). |
|
294 | # can cancel the traceback with Ctrl-C (maybe hitting it more than once). | |
288 |
|
295 | |||
289 | #xmode Plain |
|
296 | #xmode Plain | |
290 | xmode Context |
|
297 | xmode Context | |
291 | #xmode Verbose |
|
298 | #xmode Verbose | |
292 |
|
299 | |||
293 | # multi_line_specials: if true, allow magics, aliases and shell escapes (via |
|
300 | # multi_line_specials: if true, allow magics, aliases and shell escapes (via | |
294 | # !cmd) to be used in multi-line input (like for loops). For example, if you |
|
301 | # !cmd) to be used in multi-line input (like for loops). For example, if you | |
295 | # have this active, the following is valid in IPython: |
|
302 | # have this active, the following is valid in IPython: | |
296 | # |
|
303 | # | |
297 | #In [17]: for i in range(3): |
|
304 | #In [17]: for i in range(3): | |
298 | # ....: mkdir $i |
|
305 | # ....: mkdir $i | |
299 | # ....: !touch $i/hello |
|
306 | # ....: !touch $i/hello | |
300 | # ....: ls -l $i |
|
307 | # ....: ls -l $i | |
301 |
|
308 | |||
302 | multi_line_specials 1 |
|
309 | multi_line_specials 1 | |
303 |
|
310 | |||
304 | #--------------------------------------------------------------------------- |
|
311 | #--------------------------------------------------------------------------- | |
305 | # Section: Readline configuration (readline is not available for MS-Windows) |
|
312 | # Section: Readline configuration (readline is not available for MS-Windows) | |
306 |
|
313 | |||
307 | # This is done via the following options: |
|
314 | # This is done via the following options: | |
308 |
|
315 | |||
309 | # (i) readline_parse_and_bind: this option can appear as many times as you |
|
316 | # (i) readline_parse_and_bind: this option can appear as many times as you | |
310 | # want, each time defining a string to be executed via a |
|
317 | # want, each time defining a string to be executed via a | |
311 | # readline.parse_and_bind() command. The syntax for valid commands of this |
|
318 | # readline.parse_and_bind() command. The syntax for valid commands of this | |
312 | # kind can be found by reading the documentation for the GNU readline library, |
|
319 | # kind can be found by reading the documentation for the GNU readline library, | |
313 | # as these commands are of the kind which readline accepts in its |
|
320 | # as these commands are of the kind which readline accepts in its | |
314 | # configuration file. |
|
321 | # configuration file. | |
315 |
|
322 | |||
316 | # The TAB key can be used to complete names at the command line in one of two |
|
323 | # The TAB key can be used to complete names at the command line in one of two | |
317 | # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only |
|
324 | # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only | |
318 | # completes as much as possible while 'menu-complete' cycles through all |
|
325 | # completes as much as possible while 'menu-complete' cycles through all | |
319 | # possible completions. Leave the one you prefer uncommented. |
|
326 | # possible completions. Leave the one you prefer uncommented. | |
320 |
|
327 | |||
321 | readline_parse_and_bind tab: complete |
|
328 | readline_parse_and_bind tab: complete | |
322 | #readline_parse_and_bind tab: menu-complete |
|
329 | #readline_parse_and_bind tab: menu-complete | |
323 |
|
330 | |||
324 | # This binds Control-l to printing the list of all possible completions when |
|
331 | # This binds Control-l to printing the list of all possible completions when | |
325 | # there is more than one (what 'complete' does when hitting TAB twice, or at |
|
332 | # there is more than one (what 'complete' does when hitting TAB twice, or at | |
326 | # the first TAB if show-all-if-ambiguous is on) |
|
333 | # the first TAB if show-all-if-ambiguous is on) | |
327 | readline_parse_and_bind "\C-l": possible-completions |
|
334 | readline_parse_and_bind "\C-l": possible-completions | |
328 |
|
335 | |||
329 | # This forces readline to automatically print the above list when tab |
|
336 | # This forces readline to automatically print the above list when tab | |
330 | # completion is set to 'complete'. You can still get this list manually by |
|
337 | # completion is set to 'complete'. You can still get this list manually by | |
331 | # using the key bound to 'possible-completions' (Control-l by default) or by |
|
338 | # using the key bound to 'possible-completions' (Control-l by default) or by | |
332 | # hitting TAB twice. Turning this on makes the printing happen at the first |
|
339 | # hitting TAB twice. Turning this on makes the printing happen at the first | |
333 | # TAB. |
|
340 | # TAB. | |
334 | readline_parse_and_bind set show-all-if-ambiguous on |
|
341 | readline_parse_and_bind set show-all-if-ambiguous on | |
335 |
|
342 | |||
336 | # If you have TAB set to complete names, you can rebind any key (Control-o by |
|
343 | # If you have TAB set to complete names, you can rebind any key (Control-o by | |
337 | # default) to insert a true TAB character. |
|
344 | # default) to insert a true TAB character. | |
338 | readline_parse_and_bind "\C-o": tab-insert |
|
345 | readline_parse_and_bind "\C-o": tab-insert | |
339 |
|
346 | |||
340 | # These commands allow you to indent/unindent easily, with the 4-space |
|
347 | # These commands allow you to indent/unindent easily, with the 4-space | |
341 | # convention of the Python coding standards. Since IPython's internal |
|
348 | # convention of the Python coding standards. Since IPython's internal | |
342 | # auto-indent system also uses 4 spaces, you should not change the number of |
|
349 | # auto-indent system also uses 4 spaces, you should not change the number of | |
343 | # spaces in the code below. |
|
350 | # spaces in the code below. | |
344 | readline_parse_and_bind "\M-i": " " |
|
351 | readline_parse_and_bind "\M-i": " " | |
345 | readline_parse_and_bind "\M-o": "\d\d\d\d" |
|
352 | readline_parse_and_bind "\M-o": "\d\d\d\d" | |
346 | readline_parse_and_bind "\M-I": "\d\d\d\d" |
|
353 | readline_parse_and_bind "\M-I": "\d\d\d\d" | |
347 |
|
354 | |||
348 | # Bindings for incremental searches in the history. These searches use the |
|
355 | # Bindings for incremental searches in the history. These searches use the | |
349 | # string typed so far on the command line and search anything in the previous |
|
356 | # string typed so far on the command line and search anything in the previous | |
350 | # input history containing them. |
|
357 | # input history containing them. | |
351 | readline_parse_and_bind "\C-r": reverse-search-history |
|
358 | readline_parse_and_bind "\C-r": reverse-search-history | |
352 | readline_parse_and_bind "\C-s": forward-search-history |
|
359 | readline_parse_and_bind "\C-s": forward-search-history | |
353 |
|
360 | |||
354 | # Bindings for completing the current line in the history of previous |
|
361 | # Bindings for completing the current line in the history of previous | |
355 | # commands. This allows you to recall any previous command by typing its first |
|
362 | # commands. This allows you to recall any previous command by typing its first | |
356 | # few letters and hitting Control-p, bypassing all intermediate commands which |
|
363 | # few letters and hitting Control-p, bypassing all intermediate commands which | |
357 | # may be in the history (much faster than hitting up-arrow 50 times!) |
|
364 | # may be in the history (much faster than hitting up-arrow 50 times!) | |
358 | readline_parse_and_bind "\C-p": history-search-backward |
|
365 | readline_parse_and_bind "\C-p": history-search-backward | |
359 | readline_parse_and_bind "\C-n": history-search-forward |
|
366 | readline_parse_and_bind "\C-n": history-search-forward | |
360 |
|
367 | |||
361 | # I also like to have the same functionality on the plain arrow keys. If you'd |
|
368 | # I also like to have the same functionality on the plain arrow keys. If you'd | |
362 | # rather have the arrows use all the history (and not just match what you've |
|
369 | # rather have the arrows use all the history (and not just match what you've | |
363 | # typed so far), comment out or delete the next two lines. |
|
370 | # typed so far), comment out or delete the next two lines. | |
364 | readline_parse_and_bind "\e[A": history-search-backward |
|
371 | readline_parse_and_bind "\e[A": history-search-backward | |
365 | readline_parse_and_bind "\e[B": history-search-forward |
|
372 | readline_parse_and_bind "\e[B": history-search-forward | |
366 |
|
373 | |||
367 | # These are typically on by default under *nix, but not win32. |
|
374 | # These are typically on by default under *nix, but not win32. | |
368 | readline_parse_and_bind "\C-k": kill-line |
|
375 | readline_parse_and_bind "\C-k": kill-line | |
369 | readline_parse_and_bind "\C-u": unix-line-discard |
|
376 | readline_parse_and_bind "\C-u": unix-line-discard | |
370 |
|
377 | |||
371 | # (ii) readline_remove_delims: a string of characters to be removed from the |
|
378 | # (ii) readline_remove_delims: a string of characters to be removed from the | |
372 | # default word-delimiters list used by readline, so that completions may be |
|
379 | # default word-delimiters list used by readline, so that completions may be | |
373 | # performed on strings which contain them. |
|
380 | # performed on strings which contain them. | |
374 |
|
381 | |||
375 | readline_remove_delims -/~ |
|
382 | readline_remove_delims -/~ | |
376 |
|
383 | |||
377 | # (iii) readline_merge_completions: whether to merge the result of all |
|
384 | # (iii) readline_merge_completions: whether to merge the result of all | |
378 | # possible completions or not. If true, IPython will complete filenames, |
|
385 | # possible completions or not. If true, IPython will complete filenames, | |
379 | # python names and aliases and return all possible completions. If you set it |
|
386 | # python names and aliases and return all possible completions. If you set it | |
380 | # to false, each completer is used at a time, and only if it doesn't return |
|
387 | # to false, each completer is used at a time, and only if it doesn't return | |
381 | # any completions is the next one used. |
|
388 | # any completions is the next one used. | |
382 |
|
389 | |||
383 | # The default order is: [python_matches, file_matches, alias_matches] |
|
390 | # The default order is: [python_matches, file_matches, alias_matches] | |
384 |
|
391 | |||
385 | readline_merge_completions 1 |
|
392 | readline_merge_completions 1 | |
386 |
|
393 | |||
387 | # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name |
|
394 | # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name | |
388 | # will complete all attributes of an object, including all the special methods |
|
395 | # will complete all attributes of an object, including all the special methods | |
389 | # whose names start with single or double underscores (like __getitem__ or |
|
396 | # whose names start with single or double underscores (like __getitem__ or | |
390 | # __class__). |
|
397 | # __class__). | |
391 |
|
398 | |||
392 | # This variable allows you to control this completion behavior: |
|
399 | # This variable allows you to control this completion behavior: | |
393 |
|
400 | |||
394 | # readline_omit__names 1 -> completion will omit showing any names starting |
|
401 | # readline_omit__names 1 -> completion will omit showing any names starting | |
395 | # with two __, but it will still show names starting with one _. |
|
402 | # with two __, but it will still show names starting with one _. | |
396 |
|
403 | |||
397 | # readline_omit__names 2 -> completion will omit all names beginning with one |
|
404 | # readline_omit__names 2 -> completion will omit all names beginning with one | |
398 | # _ (which obviously means filtering out the double __ ones). |
|
405 | # _ (which obviously means filtering out the double __ ones). | |
399 |
|
406 | |||
400 | # Even when this option is set, you can still see those names by explicitly |
|
407 | # Even when this option is set, you can still see those names by explicitly | |
401 | # typing a _ after the period and hitting <tab>: 'name._<tab>' will always |
|
408 | # typing a _ after the period and hitting <tab>: 'name._<tab>' will always | |
402 | # complete attribute names starting with '_'. |
|
409 | # complete attribute names starting with '_'. | |
403 |
|
410 | |||
404 | # This option is off by default so that new users see all attributes of any |
|
411 | # This option is off by default so that new users see all attributes of any | |
405 | # objects they are dealing with. |
|
412 | # objects they are dealing with. | |
406 |
|
413 | |||
407 | readline_omit__names 0 |
|
414 | readline_omit__names 0 | |
408 |
|
415 | |||
409 | #--------------------------------------------------------------------------- |
|
416 | #--------------------------------------------------------------------------- | |
410 | # Section: modules to be loaded with 'import ...' |
|
417 | # Section: modules to be loaded with 'import ...' | |
411 |
|
418 | |||
412 | # List, separated by spaces, the names of the modules you want to import |
|
419 | # List, separated by spaces, the names of the modules you want to import | |
413 |
|
420 | |||
414 | # Example: |
|
421 | # Example: | |
415 | # import_mod sys os |
|
422 | # import_mod sys os | |
416 | # will produce internally the statements |
|
423 | # will produce internally the statements | |
417 | # import sys |
|
424 | # import sys | |
418 | # import os |
|
425 | # import os | |
419 |
|
426 | |||
420 | # Each import is executed in its own try/except block, so if one module |
|
427 | # Each import is executed in its own try/except block, so if one module | |
421 | # fails to load the others will still be ok. |
|
428 | # fails to load the others will still be ok. | |
422 |
|
429 | |||
423 | import_mod |
|
430 | import_mod | |
424 |
|
431 | |||
425 | #--------------------------------------------------------------------------- |
|
432 | #--------------------------------------------------------------------------- | |
426 | # Section: modules to import some functions from: 'from ... import ...' |
|
433 | # Section: modules to import some functions from: 'from ... import ...' | |
427 |
|
434 | |||
428 | # List, one per line, the modules for which you want only to import some |
|
435 | # List, one per line, the modules for which you want only to import some | |
429 | # functions. Give the module name first and then the name of functions to be |
|
436 | # functions. Give the module name first and then the name of functions to be | |
430 | # imported from that module. |
|
437 | # imported from that module. | |
431 |
|
438 | |||
432 | # Example: |
|
439 | # Example: | |
433 |
|
440 | |||
434 | # import_some IPython.genutils timing timings |
|
441 | # import_some IPython.genutils timing timings | |
435 | # will produce internally the statement |
|
442 | # will produce internally the statement | |
436 | # from IPython.genutils import timing, timings |
|
443 | # from IPython.genutils import timing, timings | |
437 |
|
444 | |||
438 | # timing() and timings() are two IPython utilities for timing the execution of |
|
445 | # timing() and timings() are two IPython utilities for timing the execution of | |
439 | # your own functions, which you may find useful. Just commment out the above |
|
446 | # your own functions, which you may find useful. Just commment out the above | |
440 | # line if you want to test them. |
|
447 | # line if you want to test them. | |
441 |
|
448 | |||
442 | # If you have more than one modules_some line, each gets its own try/except |
|
449 | # If you have more than one modules_some line, each gets its own try/except | |
443 | # block (like modules, see above). |
|
450 | # block (like modules, see above). | |
444 |
|
451 | |||
445 | import_some |
|
452 | import_some | |
446 |
|
453 | |||
447 | #--------------------------------------------------------------------------- |
|
454 | #--------------------------------------------------------------------------- | |
448 | # Section: modules to import all from : 'from ... import *' |
|
455 | # Section: modules to import all from : 'from ... import *' | |
449 |
|
456 | |||
450 | # List (same syntax as import_mod above) those modules for which you want to |
|
457 | # List (same syntax as import_mod above) those modules for which you want to | |
451 | # import all functions. Remember, this is a potentially dangerous thing to do, |
|
458 | # import all functions. Remember, this is a potentially dangerous thing to do, | |
452 | # since it is very easy to overwrite names of things you need. Use with |
|
459 | # since it is very easy to overwrite names of things you need. Use with | |
453 | # caution. |
|
460 | # caution. | |
454 |
|
461 | |||
455 | # Example: |
|
462 | # Example: | |
456 | # import_all sys os |
|
463 | # import_all sys os | |
457 | # will produce internally the statements |
|
464 | # will produce internally the statements | |
458 | # from sys import * |
|
465 | # from sys import * | |
459 | # from os import * |
|
466 | # from os import * | |
460 |
|
467 | |||
461 | # As before, each will be called in a separate try/except block. |
|
468 | # As before, each will be called in a separate try/except block. | |
462 |
|
469 | |||
463 | import_all |
|
470 | import_all | |
464 |
|
471 | |||
465 | #--------------------------------------------------------------------------- |
|
472 | #--------------------------------------------------------------------------- | |
466 | # Section: Python code to execute. |
|
473 | # Section: Python code to execute. | |
467 |
|
474 | |||
468 | # Put here code to be explicitly executed (keep it simple!) |
|
475 | # Put here code to be explicitly executed (keep it simple!) | |
469 | # Put one line of python code per line. All whitespace is removed (this is a |
|
476 | # Put one line of python code per line. All whitespace is removed (this is a | |
470 | # feature, not a bug), so don't get fancy building loops here. |
|
477 | # feature, not a bug), so don't get fancy building loops here. | |
471 | # This is just for quick convenient creation of things you want available. |
|
478 | # This is just for quick convenient creation of things you want available. | |
472 |
|
479 | |||
473 | # Example: |
|
480 | # Example: | |
474 | # execute x = 1 |
|
481 | # execute x = 1 | |
475 | # execute print 'hello world'; y = z = 'a' |
|
482 | # execute print 'hello world'; y = z = 'a' | |
476 | # will produce internally |
|
483 | # will produce internally | |
477 | # x = 1 |
|
484 | # x = 1 | |
478 | # print 'hello world'; y = z = 'a' |
|
485 | # print 'hello world'; y = z = 'a' | |
479 | # and each *line* (not each statement, we don't do python syntax parsing) is |
|
486 | # and each *line* (not each statement, we don't do python syntax parsing) is | |
480 | # executed in its own try/except block. |
|
487 | # executed in its own try/except block. | |
481 |
|
488 | |||
482 | execute |
|
489 | execute | |
483 |
|
490 | |||
484 | # Note for the adventurous: you can use this to define your own names for the |
|
491 | # Note for the adventurous: you can use this to define your own names for the | |
485 | # magic functions, by playing some namespace tricks: |
|
492 | # magic functions, by playing some namespace tricks: | |
486 |
|
493 | |||
487 | # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile |
|
494 | # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile | |
488 |
|
495 | |||
489 | # defines @pf as a new name for @profile. |
|
496 | # defines @pf as a new name for @profile. | |
490 |
|
497 | |||
491 | #--------------------------------------------------------------------------- |
|
498 | #--------------------------------------------------------------------------- | |
492 | # Section: Pyhton files to load and execute. |
|
499 | # Section: Pyhton files to load and execute. | |
493 |
|
500 | |||
494 | # Put here the full names of files you want executed with execfile(file). If |
|
501 | # Put here the full names of files you want executed with execfile(file). If | |
495 | # you want complicated initialization, just write whatever you want in a |
|
502 | # you want complicated initialization, just write whatever you want in a | |
496 | # regular python file and load it from here. |
|
503 | # regular python file and load it from here. | |
497 |
|
504 | |||
498 | # Filenames defined here (which *must* include the extension) are searched for |
|
505 | # Filenames defined here (which *must* include the extension) are searched for | |
499 | # through all of sys.path. Since IPython adds your .ipython directory to |
|
506 | # through all of sys.path. Since IPython adds your .ipython directory to | |
500 | # sys.path, they can also be placed in your .ipython dir and will be |
|
507 | # sys.path, they can also be placed in your .ipython dir and will be | |
501 | # found. Otherwise (if you want to execute things not in .ipyton nor in |
|
508 | # found. Otherwise (if you want to execute things not in .ipyton nor in | |
502 | # sys.path) give a full path (you can use ~, it gets expanded) |
|
509 | # sys.path) give a full path (you can use ~, it gets expanded) | |
503 |
|
510 | |||
504 | # Example: |
|
511 | # Example: | |
505 | # execfile file1.py ~/file2.py |
|
512 | # execfile file1.py ~/file2.py | |
506 | # will generate |
|
513 | # will generate | |
507 | # execfile('file1.py') |
|
514 | # execfile('file1.py') | |
508 | # execfile('_path_to_your_home/file2.py') |
|
515 | # execfile('_path_to_your_home/file2.py') | |
509 |
|
516 | |||
510 | # As before, each file gets its own try/except block. |
|
517 | # As before, each file gets its own try/except block. | |
511 |
|
518 | |||
512 | execfile |
|
519 | execfile | |
513 |
|
520 | |||
514 | # If you are feeling adventurous, you can even add functionality to IPython |
|
521 | # If you are feeling adventurous, you can even add functionality to IPython | |
515 | # through here. IPython works through a global variable called __ip which |
|
522 | # through here. IPython works through a global variable called __ip which | |
516 | # exists at the time when these files are read. If you know what you are doing |
|
523 | # exists at the time when these files are read. If you know what you are doing | |
517 | # (read the source) you can add functions to __ip in files loaded here. |
|
524 | # (read the source) you can add functions to __ip in files loaded here. | |
518 |
|
525 | |||
519 | # The file example-magic.py contains a simple but correct example. Try it: |
|
526 | # The file example-magic.py contains a simple but correct example. Try it: | |
520 |
|
527 | |||
521 | # execfile example-magic.py |
|
528 | # execfile example-magic.py | |
522 |
|
529 | |||
523 | # Look at the examples in IPython/iplib.py for more details on how these magic |
|
530 | # Look at the examples in IPython/iplib.py for more details on how these magic | |
524 | # functions need to process their arguments. |
|
531 | # functions need to process their arguments. | |
525 |
|
532 | |||
526 | #--------------------------------------------------------------------------- |
|
533 | #--------------------------------------------------------------------------- | |
527 | # Section: aliases for system shell commands |
|
534 | # Section: aliases for system shell commands | |
528 |
|
535 | |||
529 | # Here you can define your own names for system commands. The syntax is |
|
536 | # Here you can define your own names for system commands. The syntax is | |
530 | # similar to that of the builtin @alias function: |
|
537 | # similar to that of the builtin @alias function: | |
531 |
|
538 | |||
532 | # alias alias_name command_string |
|
539 | # alias alias_name command_string | |
533 |
|
540 | |||
534 | # The resulting aliases are auto-generated magic functions (hence usable as |
|
541 | # The resulting aliases are auto-generated magic functions (hence usable as | |
535 | # @alias_name) |
|
542 | # @alias_name) | |
536 |
|
543 | |||
537 | # For example: |
|
544 | # For example: | |
538 |
|
545 | |||
539 | # alias myls ls -la |
|
546 | # alias myls ls -la | |
540 |
|
547 | |||
541 | # will define 'myls' as an alias for executing the system command 'ls -la'. |
|
548 | # will define 'myls' as an alias for executing the system command 'ls -la'. | |
542 | # This allows you to customize IPython's environment to have the same aliases |
|
549 | # This allows you to customize IPython's environment to have the same aliases | |
543 | # you are accustomed to from your own shell. |
|
550 | # you are accustomed to from your own shell. | |
544 |
|
551 | |||
545 | # You can also define aliases with parameters using %s specifiers (one per |
|
552 | # You can also define aliases with parameters using %s specifiers (one per | |
546 | # parameter): |
|
553 | # parameter): | |
547 |
|
554 | |||
548 | # alias parts echo first %s second %s |
|
555 | # alias parts echo first %s second %s | |
549 |
|
556 | |||
550 | # will give you in IPython: |
|
557 | # will give you in IPython: | |
551 | # >>> @parts A B |
|
558 | # >>> @parts A B | |
552 | # first A second B |
|
559 | # first A second B | |
553 |
|
560 | |||
554 | # Use one 'alias' statement per alias you wish to define. |
|
561 | # Use one 'alias' statement per alias you wish to define. | |
555 |
|
562 | |||
556 | # alias |
|
563 | # alias | |
557 |
|
564 | |||
558 | #************************* end of file <ipythonrc> ************************ |
|
565 | #************************* end of file <ipythonrc> ************************ |
@@ -1,1958 +1,1961 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | IPython -- An enhanced Interactive Python |
|
3 | IPython -- An enhanced Interactive Python | |
4 |
|
4 | |||
5 | Requires Python 2.1 or newer. |
|
5 | Requires Python 2.1 or newer. | |
6 |
|
6 | |||
7 | This file contains all the classes and helper functions specific to IPython. |
|
7 | This file contains all the classes and helper functions specific to IPython. | |
8 |
|
8 | |||
9 |
$Id: iplib.py 96 |
|
9 | $Id: iplib.py 963 2005-12-28 19:21:29Z fperez $ | |
10 | """ |
|
10 | """ | |
11 |
|
11 | |||
12 | #***************************************************************************** |
|
12 | #***************************************************************************** | |
13 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
|
13 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and | |
14 | # Copyright (C) 2001-2005 Fernando Perez. <fperez@colorado.edu> |
|
14 | # Copyright (C) 2001-2005 Fernando Perez. <fperez@colorado.edu> | |
15 | # |
|
15 | # | |
16 | # Distributed under the terms of the BSD License. The full license is in |
|
16 | # Distributed under the terms of the BSD License. The full license is in | |
17 | # the file COPYING, distributed as part of this software. |
|
17 | # the file COPYING, distributed as part of this software. | |
18 | # |
|
18 | # | |
19 | # Note: this code originally subclassed code.InteractiveConsole from the |
|
19 | # Note: this code originally subclassed code.InteractiveConsole from the | |
20 | # Python standard library. Over time, all of that class has been copied |
|
20 | # Python standard library. Over time, all of that class has been copied | |
21 | # verbatim here for modifications which could not be accomplished by |
|
21 | # verbatim here for modifications which could not be accomplished by | |
22 | # subclassing. At this point, there are no dependencies at all on the code |
|
22 | # subclassing. At this point, there are no dependencies at all on the code | |
23 | # module anymore (it is not even imported). The Python License (sec. 2) |
|
23 | # module anymore (it is not even imported). The Python License (sec. 2) | |
24 | # allows for this, but it's always nice to acknowledge credit where credit is |
|
24 | # allows for this, but it's always nice to acknowledge credit where credit is | |
25 | # due. |
|
25 | # due. | |
26 | #***************************************************************************** |
|
26 | #***************************************************************************** | |
27 |
|
27 | |||
28 | #**************************************************************************** |
|
28 | #**************************************************************************** | |
29 | # Modules and globals |
|
29 | # Modules and globals | |
30 |
|
30 | |||
31 | from __future__ import generators # for 2.2 backwards-compatibility |
|
31 | from __future__ import generators # for 2.2 backwards-compatibility | |
32 |
|
32 | |||
33 | from IPython import Release |
|
33 | from IPython import Release | |
34 | __author__ = '%s <%s>\n%s <%s>' % \ |
|
34 | __author__ = '%s <%s>\n%s <%s>' % \ | |
35 | ( Release.authors['Janko'] + Release.authors['Fernando'] ) |
|
35 | ( Release.authors['Janko'] + Release.authors['Fernando'] ) | |
36 | __license__ = Release.license |
|
36 | __license__ = Release.license | |
37 | __version__ = Release.version |
|
37 | __version__ = Release.version | |
38 |
|
38 | |||
39 | # Python standard modules |
|
39 | # Python standard modules | |
40 | import __main__ |
|
40 | import __main__ | |
41 | import __builtin__ |
|
41 | import __builtin__ | |
42 | import StringIO |
|
42 | import StringIO | |
43 | import bdb |
|
43 | import bdb | |
44 | import cPickle as pickle |
|
44 | import cPickle as pickle | |
45 | import codeop |
|
45 | import codeop | |
46 | import exceptions |
|
46 | import exceptions | |
47 | import glob |
|
47 | import glob | |
48 | import inspect |
|
48 | import inspect | |
49 | import keyword |
|
49 | import keyword | |
50 | import new |
|
50 | import new | |
51 | import os |
|
51 | import os | |
52 | import pdb |
|
52 | import pdb | |
53 | import pydoc |
|
53 | import pydoc | |
54 | import re |
|
54 | import re | |
55 | import shutil |
|
55 | import shutil | |
56 | import string |
|
56 | import string | |
57 | import sys |
|
57 | import sys | |
58 | import traceback |
|
58 | import traceback | |
59 | import types |
|
59 | import types | |
60 |
|
60 | |||
61 | from pprint import pprint, pformat |
|
61 | from pprint import pprint, pformat | |
62 |
|
62 | |||
63 | # IPython's own modules |
|
63 | # IPython's own modules | |
64 | import IPython |
|
64 | import IPython | |
65 | from IPython import OInspect,PyColorize,ultraTB |
|
65 | from IPython import OInspect,PyColorize,ultraTB | |
66 | from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names |
|
66 | from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names | |
67 | from IPython.FakeModule import FakeModule |
|
67 | from IPython.FakeModule import FakeModule | |
68 | from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns |
|
68 | from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns | |
69 | from IPython.Logger import Logger |
|
69 | from IPython.Logger import Logger | |
70 | from IPython.Magic import Magic,magic2python |
|
70 | from IPython.Magic import Magic,magic2python | |
71 | from IPython.Struct import Struct |
|
71 | from IPython.Struct import Struct | |
72 | from IPython.background_jobs import BackgroundJobManager |
|
72 | from IPython.background_jobs import BackgroundJobManager | |
73 | from IPython.usage import cmd_line_usage,interactive_usage |
|
73 | from IPython.usage import cmd_line_usage,interactive_usage | |
74 | from IPython.genutils import * |
|
74 | from IPython.genutils import * | |
75 |
|
75 | |||
76 | # store the builtin raw_input globally, and use this always, in case user code |
|
76 | # store the builtin raw_input globally, and use this always, in case user code | |
77 | # overwrites it (like wx.py.PyShell does) |
|
77 | # overwrites it (like wx.py.PyShell does) | |
78 | raw_input_original = raw_input |
|
78 | raw_input_original = raw_input | |
79 |
|
79 | |||
80 | #**************************************************************************** |
|
80 | #**************************************************************************** | |
81 | # Some utility function definitions |
|
81 | # Some utility function definitions | |
82 |
|
82 | |||
83 | # This can be replaced with an isspace() call once we drop 2.2 compatibility |
|
83 | # This can be replaced with an isspace() call once we drop 2.2 compatibility | |
84 | _isspace_match = re.compile(r'^\s+$').match |
|
84 | _isspace_match = re.compile(r'^\s+$').match | |
85 | def isspace(s): |
|
85 | def isspace(s): | |
86 | return bool(_isspace_match(s)) |
|
86 | return bool(_isspace_match(s)) | |
87 |
|
87 | |||
88 | def esc_quotes(strng): |
|
88 | def esc_quotes(strng): | |
89 | """Return the input string with single and double quotes escaped out""" |
|
89 | """Return the input string with single and double quotes escaped out""" | |
90 |
|
90 | |||
91 | return strng.replace('"','\\"').replace("'","\\'") |
|
91 | return strng.replace('"','\\"').replace("'","\\'") | |
92 |
|
92 | |||
93 | def import_fail_info(mod_name,fns=None): |
|
93 | def import_fail_info(mod_name,fns=None): | |
94 | """Inform load failure for a module.""" |
|
94 | """Inform load failure for a module.""" | |
95 |
|
95 | |||
96 | if fns == None: |
|
96 | if fns == None: | |
97 | warn("Loading of %s failed.\n" % (mod_name,)) |
|
97 | warn("Loading of %s failed.\n" % (mod_name,)) | |
98 | else: |
|
98 | else: | |
99 | warn("Loading of %s from %s failed.\n" % (fns,mod_name)) |
|
99 | warn("Loading of %s from %s failed.\n" % (fns,mod_name)) | |
100 |
|
100 | |||
101 | def qw_lol(indata): |
|
101 | def qw_lol(indata): | |
102 | """qw_lol('a b') -> [['a','b']], |
|
102 | """qw_lol('a b') -> [['a','b']], | |
103 | otherwise it's just a call to qw(). |
|
103 | otherwise it's just a call to qw(). | |
104 |
|
104 | |||
105 | We need this to make sure the modules_some keys *always* end up as a |
|
105 | We need this to make sure the modules_some keys *always* end up as a | |
106 | list of lists.""" |
|
106 | list of lists.""" | |
107 |
|
107 | |||
108 | if type(indata) in StringTypes: |
|
108 | if type(indata) in StringTypes: | |
109 | return [qw(indata)] |
|
109 | return [qw(indata)] | |
110 | else: |
|
110 | else: | |
111 | return qw(indata) |
|
111 | return qw(indata) | |
112 |
|
112 | |||
113 | def ipmagic(arg_s): |
|
113 | def ipmagic(arg_s): | |
114 | """Call a magic function by name. |
|
114 | """Call a magic function by name. | |
115 |
|
115 | |||
116 | Input: a string containing the name of the magic function to call and any |
|
116 | Input: a string containing the name of the magic function to call and any | |
117 | additional arguments to be passed to the magic. |
|
117 | additional arguments to be passed to the magic. | |
118 |
|
118 | |||
119 | ipmagic('name -opt foo bar') is equivalent to typing at the ipython |
|
119 | ipmagic('name -opt foo bar') is equivalent to typing at the ipython | |
120 | prompt: |
|
120 | prompt: | |
121 |
|
121 | |||
122 | In[1]: %name -opt foo bar |
|
122 | In[1]: %name -opt foo bar | |
123 |
|
123 | |||
124 | To call a magic without arguments, simply use ipmagic('name'). |
|
124 | To call a magic without arguments, simply use ipmagic('name'). | |
125 |
|
125 | |||
126 | This provides a proper Python function to call IPython's magics in any |
|
126 | This provides a proper Python function to call IPython's magics in any | |
127 | valid Python code you can type at the interpreter, including loops and |
|
127 | valid Python code you can type at the interpreter, including loops and | |
128 | compound statements. It is added by IPython to the Python builtin |
|
128 | compound statements. It is added by IPython to the Python builtin | |
129 | namespace upon initialization.""" |
|
129 | namespace upon initialization.""" | |
130 |
|
130 | |||
131 | args = arg_s.split(' ',1) |
|
131 | args = arg_s.split(' ',1) | |
132 | magic_name = args[0] |
|
132 | magic_name = args[0] | |
133 | if magic_name.startswith(__IPYTHON__.ESC_MAGIC): |
|
133 | if magic_name.startswith(__IPYTHON__.ESC_MAGIC): | |
134 | magic_name = magic_name[1:] |
|
134 | magic_name = magic_name[1:] | |
135 | try: |
|
135 | try: | |
136 | magic_args = args[1] |
|
136 | magic_args = args[1] | |
137 | except IndexError: |
|
137 | except IndexError: | |
138 | magic_args = '' |
|
138 | magic_args = '' | |
139 | fn = getattr(__IPYTHON__,'magic_'+magic_name,None) |
|
139 | fn = getattr(__IPYTHON__,'magic_'+magic_name,None) | |
140 | if fn is None: |
|
140 | if fn is None: | |
141 | error("Magic function `%s` not found." % magic_name) |
|
141 | error("Magic function `%s` not found." % magic_name) | |
142 | else: |
|
142 | else: | |
143 | magic_args = __IPYTHON__.var_expand(magic_args) |
|
143 | magic_args = __IPYTHON__.var_expand(magic_args) | |
144 | return fn(magic_args) |
|
144 | return fn(magic_args) | |
145 |
|
145 | |||
146 | def ipalias(arg_s): |
|
146 | def ipalias(arg_s): | |
147 | """Call an alias by name. |
|
147 | """Call an alias by name. | |
148 |
|
148 | |||
149 | Input: a string containing the name of the alias to call and any |
|
149 | Input: a string containing the name of the alias to call and any | |
150 | additional arguments to be passed to the magic. |
|
150 | additional arguments to be passed to the magic. | |
151 |
|
151 | |||
152 | ipalias('name -opt foo bar') is equivalent to typing at the ipython |
|
152 | ipalias('name -opt foo bar') is equivalent to typing at the ipython | |
153 | prompt: |
|
153 | prompt: | |
154 |
|
154 | |||
155 | In[1]: name -opt foo bar |
|
155 | In[1]: name -opt foo bar | |
156 |
|
156 | |||
157 | To call an alias without arguments, simply use ipalias('name'). |
|
157 | To call an alias without arguments, simply use ipalias('name'). | |
158 |
|
158 | |||
159 | This provides a proper Python function to call IPython's aliases in any |
|
159 | This provides a proper Python function to call IPython's aliases in any | |
160 | valid Python code you can type at the interpreter, including loops and |
|
160 | valid Python code you can type at the interpreter, including loops and | |
161 | compound statements. It is added by IPython to the Python builtin |
|
161 | compound statements. It is added by IPython to the Python builtin | |
162 | namespace upon initialization.""" |
|
162 | namespace upon initialization.""" | |
163 |
|
163 | |||
164 | args = arg_s.split(' ',1) |
|
164 | args = arg_s.split(' ',1) | |
165 | alias_name = args[0] |
|
165 | alias_name = args[0] | |
166 | try: |
|
166 | try: | |
167 | alias_args = args[1] |
|
167 | alias_args = args[1] | |
168 | except IndexError: |
|
168 | except IndexError: | |
169 | alias_args = '' |
|
169 | alias_args = '' | |
170 | if alias_name in __IPYTHON__.alias_table: |
|
170 | if alias_name in __IPYTHON__.alias_table: | |
171 | __IPYTHON__.call_alias(alias_name,alias_args) |
|
171 | __IPYTHON__.call_alias(alias_name,alias_args) | |
172 | else: |
|
172 | else: | |
173 | error("Alias `%s` not found." % alias_name) |
|
173 | error("Alias `%s` not found." % alias_name) | |
174 |
|
174 | |||
175 | def softspace(file, newvalue): |
|
175 | def softspace(file, newvalue): | |
176 | """Copied from code.py, to remove the dependency""" |
|
176 | """Copied from code.py, to remove the dependency""" | |
177 | oldvalue = 0 |
|
177 | oldvalue = 0 | |
178 | try: |
|
178 | try: | |
179 | oldvalue = file.softspace |
|
179 | oldvalue = file.softspace | |
180 | except AttributeError: |
|
180 | except AttributeError: | |
181 | pass |
|
181 | pass | |
182 | try: |
|
182 | try: | |
183 | file.softspace = newvalue |
|
183 | file.softspace = newvalue | |
184 | except (AttributeError, TypeError): |
|
184 | except (AttributeError, TypeError): | |
185 | # "attribute-less object" or "read-only attributes" |
|
185 | # "attribute-less object" or "read-only attributes" | |
186 | pass |
|
186 | pass | |
187 | return oldvalue |
|
187 | return oldvalue | |
188 |
|
188 | |||
189 |
|
189 | |||
190 | #**************************************************************************** |
|
190 | #**************************************************************************** | |
191 | # Local use exceptions |
|
191 | # Local use exceptions | |
192 | class SpaceInInput(exceptions.Exception): pass |
|
192 | class SpaceInInput(exceptions.Exception): pass | |
193 |
|
193 | |||
194 | #**************************************************************************** |
|
194 | #**************************************************************************** | |
195 | # Local use classes |
|
195 | # Local use classes | |
196 | class Bunch: pass |
|
196 | class Bunch: pass | |
197 |
|
197 | |||
198 | class InputList(list): |
|
198 | class InputList(list): | |
199 | """Class to store user input. |
|
199 | """Class to store user input. | |
200 |
|
200 | |||
201 | It's basically a list, but slices return a string instead of a list, thus |
|
201 | It's basically a list, but slices return a string instead of a list, thus | |
202 | allowing things like (assuming 'In' is an instance): |
|
202 | allowing things like (assuming 'In' is an instance): | |
203 |
|
203 | |||
204 | exec In[4:7] |
|
204 | exec In[4:7] | |
205 |
|
205 | |||
206 | or |
|
206 | or | |
207 |
|
207 | |||
208 | exec In[5:9] + In[14] + In[21:25]""" |
|
208 | exec In[5:9] + In[14] + In[21:25]""" | |
209 |
|
209 | |||
210 | def __getslice__(self,i,j): |
|
210 | def __getslice__(self,i,j): | |
211 | return ''.join(list.__getslice__(self,i,j)) |
|
211 | return ''.join(list.__getslice__(self,i,j)) | |
212 |
|
212 | |||
213 | class SyntaxTB(ultraTB.ListTB): |
|
213 | class SyntaxTB(ultraTB.ListTB): | |
214 | """Extension which holds some state: the last exception value""" |
|
214 | """Extension which holds some state: the last exception value""" | |
215 |
|
215 | |||
216 | def __init__(self,color_scheme = 'NoColor'): |
|
216 | def __init__(self,color_scheme = 'NoColor'): | |
217 | ultraTB.ListTB.__init__(self,color_scheme) |
|
217 | ultraTB.ListTB.__init__(self,color_scheme) | |
218 | self.last_syntax_error = None |
|
218 | self.last_syntax_error = None | |
219 |
|
219 | |||
220 | def __call__(self, etype, value, elist): |
|
220 | def __call__(self, etype, value, elist): | |
221 | self.last_syntax_error = value |
|
221 | self.last_syntax_error = value | |
222 | ultraTB.ListTB.__call__(self,etype,value,elist) |
|
222 | ultraTB.ListTB.__call__(self,etype,value,elist) | |
223 |
|
223 | |||
224 | def clear_err_state(self): |
|
224 | def clear_err_state(self): | |
225 | """Return the current error state and clear it""" |
|
225 | """Return the current error state and clear it""" | |
226 | e = self.last_syntax_error |
|
226 | e = self.last_syntax_error | |
227 | self.last_syntax_error = None |
|
227 | self.last_syntax_error = None | |
228 | return e |
|
228 | return e | |
229 |
|
229 | |||
230 | #**************************************************************************** |
|
230 | #**************************************************************************** | |
231 | # Main IPython class |
|
231 | # Main IPython class | |
232 | class InteractiveShell(Logger, Magic): |
|
232 | class InteractiveShell(Logger, Magic): | |
233 | """An enhanced console for Python.""" |
|
233 | """An enhanced console for Python.""" | |
234 |
|
234 | |||
235 | def __init__(self,name,usage=None,rc=Struct(opts=None,args=None), |
|
235 | def __init__(self,name,usage=None,rc=Struct(opts=None,args=None), | |
236 | user_ns = None,user_global_ns=None,banner2='', |
|
236 | user_ns = None,user_global_ns=None,banner2='', | |
237 | custom_exceptions=((),None),embedded=False): |
|
237 | custom_exceptions=((),None),embedded=False): | |
238 |
|
238 | |||
239 | # Put a reference to self in builtins so that any form of embedded or |
|
239 | # Put a reference to self in builtins so that any form of embedded or | |
240 | # imported code can test for being inside IPython. |
|
240 | # imported code can test for being inside IPython. | |
241 | __builtin__.__IPYTHON__ = self |
|
241 | __builtin__.__IPYTHON__ = self | |
242 |
|
242 | |||
243 | # And load into builtins ipmagic/ipalias as well |
|
243 | # And load into builtins ipmagic/ipalias as well | |
244 | __builtin__.ipmagic = ipmagic |
|
244 | __builtin__.ipmagic = ipmagic | |
245 | __builtin__.ipalias = ipalias |
|
245 | __builtin__.ipalias = ipalias | |
246 |
|
246 | |||
247 | # Add to __builtin__ other parts of IPython's public API |
|
247 | # Add to __builtin__ other parts of IPython's public API | |
248 | __builtin__.ip_set_hook = self.set_hook |
|
248 | __builtin__.ip_set_hook = self.set_hook | |
249 |
|
249 | |||
250 | # Keep in the builtins a flag for when IPython is active. We set it |
|
250 | # Keep in the builtins a flag for when IPython is active. We set it | |
251 | # with setdefault so that multiple nested IPythons don't clobber one |
|
251 | # with setdefault so that multiple nested IPythons don't clobber one | |
252 | # another. Each will increase its value by one upon being activated, |
|
252 | # another. Each will increase its value by one upon being activated, | |
253 | # which also gives us a way to determine the nesting level. |
|
253 | # which also gives us a way to determine the nesting level. | |
254 | __builtin__.__dict__.setdefault('__IPYTHON__active',0) |
|
254 | __builtin__.__dict__.setdefault('__IPYTHON__active',0) | |
255 |
|
255 | |||
256 | # Do the intuitively correct thing for quit/exit: we remove the |
|
256 | # Do the intuitively correct thing for quit/exit: we remove the | |
257 | # builtins if they exist, and our own prefilter routine will handle |
|
257 | # builtins if they exist, and our own prefilter routine will handle | |
258 | # these special cases |
|
258 | # these special cases | |
259 | try: |
|
259 | try: | |
260 | del __builtin__.exit, __builtin__.quit |
|
260 | del __builtin__.exit, __builtin__.quit | |
261 | except AttributeError: |
|
261 | except AttributeError: | |
262 | pass |
|
262 | pass | |
263 |
|
263 | |||
264 | # We need to know whether the instance is meant for embedding, since |
|
264 | # We need to know whether the instance is meant for embedding, since | |
265 | # global/local namespaces need to be handled differently in that case |
|
265 | # global/local namespaces need to be handled differently in that case | |
266 | self.embedded = embedded |
|
266 | self.embedded = embedded | |
267 |
|
267 | |||
268 | # command compiler |
|
268 | # command compiler | |
269 | self.compile = codeop.CommandCompiler() |
|
269 | self.compile = codeop.CommandCompiler() | |
270 |
|
270 | |||
271 | # User input buffer |
|
271 | # User input buffer | |
272 | self.buffer = [] |
|
272 | self.buffer = [] | |
273 |
|
273 | |||
274 | # Default name given in compilation of code |
|
274 | # Default name given in compilation of code | |
275 | self.filename = '<ipython console>' |
|
275 | self.filename = '<ipython console>' | |
276 |
|
276 | |||
277 | # Create the namespace where the user will operate. user_ns is |
|
277 | # Create the namespace where the user will operate. user_ns is | |
278 | # normally the only one used, and it is passed to the exec calls as |
|
278 | # normally the only one used, and it is passed to the exec calls as | |
279 | # the locals argument. But we do carry a user_global_ns namespace |
|
279 | # the locals argument. But we do carry a user_global_ns namespace | |
280 | # given as the exec 'globals' argument, This is useful in embedding |
|
280 | # given as the exec 'globals' argument, This is useful in embedding | |
281 | # situations where the ipython shell opens in a context where the |
|
281 | # situations where the ipython shell opens in a context where the | |
282 | # distinction between locals and globals is meaningful. |
|
282 | # distinction between locals and globals is meaningful. | |
283 |
|
283 | |||
284 | # FIXME. For some strange reason, __builtins__ is showing up at user |
|
284 | # FIXME. For some strange reason, __builtins__ is showing up at user | |
285 | # level as a dict instead of a module. This is a manual fix, but I |
|
285 | # level as a dict instead of a module. This is a manual fix, but I | |
286 | # should really track down where the problem is coming from. Alex |
|
286 | # should really track down where the problem is coming from. Alex | |
287 | # Schmolck reported this problem first. |
|
287 | # Schmolck reported this problem first. | |
288 |
|
288 | |||
289 | # A useful post by Alex Martelli on this topic: |
|
289 | # A useful post by Alex Martelli on this topic: | |
290 | # Re: inconsistent value from __builtins__ |
|
290 | # Re: inconsistent value from __builtins__ | |
291 | # Von: Alex Martelli <aleaxit@yahoo.com> |
|
291 | # Von: Alex Martelli <aleaxit@yahoo.com> | |
292 | # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends |
|
292 | # Datum: Freitag 01 Oktober 2004 04:45:34 nachmittags/abends | |
293 | # Gruppen: comp.lang.python |
|
293 | # Gruppen: comp.lang.python | |
294 | # Referenzen: 1 |
|
294 | # Referenzen: 1 | |
295 |
|
295 | |||
296 | # Michael Hohn <hohn@hooknose.lbl.gov> wrote: |
|
296 | # Michael Hohn <hohn@hooknose.lbl.gov> wrote: | |
297 | # > >>> print type(builtin_check.get_global_binding('__builtins__')) |
|
297 | # > >>> print type(builtin_check.get_global_binding('__builtins__')) | |
298 | # > <type 'dict'> |
|
298 | # > <type 'dict'> | |
299 | # > >>> print type(__builtins__) |
|
299 | # > >>> print type(__builtins__) | |
300 | # > <type 'module'> |
|
300 | # > <type 'module'> | |
301 | # > Is this difference in return value intentional? |
|
301 | # > Is this difference in return value intentional? | |
302 |
|
302 | |||
303 | # Well, it's documented that '__builtins__' can be either a dictionary |
|
303 | # Well, it's documented that '__builtins__' can be either a dictionary | |
304 | # or a module, and it's been that way for a long time. Whether it's |
|
304 | # or a module, and it's been that way for a long time. Whether it's | |
305 | # intentional (or sensible), I don't know. In any case, the idea is |
|
305 | # intentional (or sensible), I don't know. In any case, the idea is | |
306 | # that if you need to access the built-in namespace directly, you |
|
306 | # that if you need to access the built-in namespace directly, you | |
307 | # should start with "import __builtin__" (note, no 's') which will |
|
307 | # should start with "import __builtin__" (note, no 's') which will | |
308 | # definitely give you a module. Yeah, it's somewhatΒ confusing:-(. |
|
308 | # definitely give you a module. Yeah, it's somewhatΒ confusing:-(. | |
309 |
|
309 | |||
310 | if user_ns is None: |
|
310 | if user_ns is None: | |
311 | # Set __name__ to __main__ to better match the behavior of the |
|
311 | # Set __name__ to __main__ to better match the behavior of the | |
312 | # normal interpreter. |
|
312 | # normal interpreter. | |
313 | user_ns = {'__name__' :'__main__', |
|
313 | user_ns = {'__name__' :'__main__', | |
314 | '__builtins__' : __builtin__, |
|
314 | '__builtins__' : __builtin__, | |
315 | } |
|
315 | } | |
316 |
|
316 | |||
317 | if user_global_ns is None: |
|
317 | if user_global_ns is None: | |
318 | user_global_ns = {} |
|
318 | user_global_ns = {} | |
319 |
|
319 | |||
320 | # Assign namespaces |
|
320 | # Assign namespaces | |
321 | # This is the namespace where all normal user variables live |
|
321 | # This is the namespace where all normal user variables live | |
322 | self.user_ns = user_ns |
|
322 | self.user_ns = user_ns | |
323 | # Embedded instances require a separate namespace for globals. |
|
323 | # Embedded instances require a separate namespace for globals. | |
324 | # Normally this one is unused by non-embedded instances. |
|
324 | # Normally this one is unused by non-embedded instances. | |
325 | self.user_global_ns = user_global_ns |
|
325 | self.user_global_ns = user_global_ns | |
326 | # A namespace to keep track of internal data structures to prevent |
|
326 | # A namespace to keep track of internal data structures to prevent | |
327 | # them from cluttering user-visible stuff. Will be updated later |
|
327 | # them from cluttering user-visible stuff. Will be updated later | |
328 | self.internal_ns = {} |
|
328 | self.internal_ns = {} | |
329 |
|
329 | |||
330 | # Namespace of system aliases. Each entry in the alias |
|
330 | # Namespace of system aliases. Each entry in the alias | |
331 | # table must be a 2-tuple of the form (N,name), where N is the number |
|
331 | # table must be a 2-tuple of the form (N,name), where N is the number | |
332 | # of positional arguments of the alias. |
|
332 | # of positional arguments of the alias. | |
333 | self.alias_table = {} |
|
333 | self.alias_table = {} | |
334 |
|
334 | |||
335 | # A table holding all the namespaces IPython deals with, so that |
|
335 | # A table holding all the namespaces IPython deals with, so that | |
336 | # introspection facilities can search easily. |
|
336 | # introspection facilities can search easily. | |
337 | self.ns_table = {'user':user_ns, |
|
337 | self.ns_table = {'user':user_ns, | |
338 | 'user_global':user_global_ns, |
|
338 | 'user_global':user_global_ns, | |
339 | 'alias':self.alias_table, |
|
339 | 'alias':self.alias_table, | |
340 | 'internal':self.internal_ns, |
|
340 | 'internal':self.internal_ns, | |
341 | 'builtin':__builtin__.__dict__ |
|
341 | 'builtin':__builtin__.__dict__ | |
342 | } |
|
342 | } | |
343 |
|
343 | |||
344 | # The user namespace MUST have a pointer to the shell itself. |
|
344 | # The user namespace MUST have a pointer to the shell itself. | |
345 | self.user_ns[name] = self |
|
345 | self.user_ns[name] = self | |
346 |
|
346 | |||
347 | # We need to insert into sys.modules something that looks like a |
|
347 | # We need to insert into sys.modules something that looks like a | |
348 | # module but which accesses the IPython namespace, for shelve and |
|
348 | # module but which accesses the IPython namespace, for shelve and | |
349 | # pickle to work interactively. Normally they rely on getting |
|
349 | # pickle to work interactively. Normally they rely on getting | |
350 | # everything out of __main__, but for embedding purposes each IPython |
|
350 | # everything out of __main__, but for embedding purposes each IPython | |
351 | # instance has its own private namespace, so we can't go shoving |
|
351 | # instance has its own private namespace, so we can't go shoving | |
352 | # everything into __main__. |
|
352 | # everything into __main__. | |
353 |
|
353 | |||
354 | # note, however, that we should only do this for non-embedded |
|
354 | # note, however, that we should only do this for non-embedded | |
355 | # ipythons, which really mimic the __main__.__dict__ with their own |
|
355 | # ipythons, which really mimic the __main__.__dict__ with their own | |
356 | # namespace. Embedded instances, on the other hand, should not do |
|
356 | # namespace. Embedded instances, on the other hand, should not do | |
357 | # this because they need to manage the user local/global namespaces |
|
357 | # this because they need to manage the user local/global namespaces | |
358 | # only, but they live within a 'normal' __main__ (meaning, they |
|
358 | # only, but they live within a 'normal' __main__ (meaning, they | |
359 | # shouldn't overtake the execution environment of the script they're |
|
359 | # shouldn't overtake the execution environment of the script they're | |
360 | # embedded in). |
|
360 | # embedded in). | |
361 |
|
361 | |||
362 | if not embedded: |
|
362 | if not embedded: | |
363 | try: |
|
363 | try: | |
364 | main_name = self.user_ns['__name__'] |
|
364 | main_name = self.user_ns['__name__'] | |
365 | except KeyError: |
|
365 | except KeyError: | |
366 | raise KeyError,'user_ns dictionary MUST have a "__name__" key' |
|
366 | raise KeyError,'user_ns dictionary MUST have a "__name__" key' | |
367 | else: |
|
367 | else: | |
368 | #print "pickle hack in place" # dbg |
|
368 | #print "pickle hack in place" # dbg | |
369 | sys.modules[main_name] = FakeModule(self.user_ns) |
|
369 | sys.modules[main_name] = FakeModule(self.user_ns) | |
370 |
|
370 | |||
371 | # List of input with multi-line handling. |
|
371 | # List of input with multi-line handling. | |
372 | # Fill its zero entry, user counter starts at 1 |
|
372 | # Fill its zero entry, user counter starts at 1 | |
373 | self.input_hist = InputList(['\n']) |
|
373 | self.input_hist = InputList(['\n']) | |
374 |
|
374 | |||
375 | # list of visited directories |
|
375 | # list of visited directories | |
376 | try: |
|
376 | try: | |
377 | self.dir_hist = [os.getcwd()] |
|
377 | self.dir_hist = [os.getcwd()] | |
378 | except IOError, e: |
|
378 | except IOError, e: | |
379 | self.dir_hist = [] |
|
379 | self.dir_hist = [] | |
380 |
|
380 | |||
381 | # dict of output history |
|
381 | # dict of output history | |
382 | self.output_hist = {} |
|
382 | self.output_hist = {} | |
383 |
|
383 | |||
384 | # dict of things NOT to alias (keywords, builtins and some magics) |
|
384 | # dict of things NOT to alias (keywords, builtins and some magics) | |
385 | no_alias = {} |
|
385 | no_alias = {} | |
386 | no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias'] |
|
386 | no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias'] | |
387 | for key in keyword.kwlist + no_alias_magics: |
|
387 | for key in keyword.kwlist + no_alias_magics: | |
388 | no_alias[key] = 1 |
|
388 | no_alias[key] = 1 | |
389 | no_alias.update(__builtin__.__dict__) |
|
389 | no_alias.update(__builtin__.__dict__) | |
390 | self.no_alias = no_alias |
|
390 | self.no_alias = no_alias | |
391 |
|
391 | |||
392 | # make global variables for user access to these |
|
392 | # make global variables for user access to these | |
393 | self.user_ns['_ih'] = self.input_hist |
|
393 | self.user_ns['_ih'] = self.input_hist | |
394 | self.user_ns['_oh'] = self.output_hist |
|
394 | self.user_ns['_oh'] = self.output_hist | |
395 | self.user_ns['_dh'] = self.dir_hist |
|
395 | self.user_ns['_dh'] = self.dir_hist | |
396 |
|
396 | |||
397 | # user aliases to input and output histories |
|
397 | # user aliases to input and output histories | |
398 | self.user_ns['In'] = self.input_hist |
|
398 | self.user_ns['In'] = self.input_hist | |
399 | self.user_ns['Out'] = self.output_hist |
|
399 | self.user_ns['Out'] = self.output_hist | |
400 |
|
400 | |||
401 | # Store the actual shell's name |
|
401 | # Store the actual shell's name | |
402 | self.name = name |
|
402 | self.name = name | |
403 |
|
403 | |||
404 | # Object variable to store code object waiting execution. This is |
|
404 | # Object variable to store code object waiting execution. This is | |
405 | # used mainly by the multithreaded shells, but it can come in handy in |
|
405 | # used mainly by the multithreaded shells, but it can come in handy in | |
406 | # other situations. No need to use a Queue here, since it's a single |
|
406 | # other situations. No need to use a Queue here, since it's a single | |
407 | # item which gets cleared once run. |
|
407 | # item which gets cleared once run. | |
408 | self.code_to_run = None |
|
408 | self.code_to_run = None | |
409 |
|
409 | |||
410 | # Job manager (for jobs run as background threads) |
|
410 | # Job manager (for jobs run as background threads) | |
411 | self.jobs = BackgroundJobManager() |
|
411 | self.jobs = BackgroundJobManager() | |
412 | # Put the job manager into builtins so it's always there. |
|
412 | # Put the job manager into builtins so it's always there. | |
413 | __builtin__.jobs = self.jobs |
|
413 | __builtin__.jobs = self.jobs | |
414 |
|
414 | |||
415 | # escapes for automatic behavior on the command line |
|
415 | # escapes for automatic behavior on the command line | |
416 | self.ESC_SHELL = '!' |
|
416 | self.ESC_SHELL = '!' | |
417 | self.ESC_HELP = '?' |
|
417 | self.ESC_HELP = '?' | |
418 | self.ESC_MAGIC = '%' |
|
418 | self.ESC_MAGIC = '%' | |
419 | self.ESC_QUOTE = ',' |
|
419 | self.ESC_QUOTE = ',' | |
420 | self.ESC_QUOTE2 = ';' |
|
420 | self.ESC_QUOTE2 = ';' | |
421 | self.ESC_PAREN = '/' |
|
421 | self.ESC_PAREN = '/' | |
422 |
|
422 | |||
423 | # And their associated handlers |
|
423 | # And their associated handlers | |
424 | self.esc_handlers = {self.ESC_PAREN:self.handle_auto, |
|
424 | self.esc_handlers = {self.ESC_PAREN:self.handle_auto, | |
425 | self.ESC_QUOTE:self.handle_auto, |
|
425 | self.ESC_QUOTE:self.handle_auto, | |
426 | self.ESC_QUOTE2:self.handle_auto, |
|
426 | self.ESC_QUOTE2:self.handle_auto, | |
427 | self.ESC_MAGIC:self.handle_magic, |
|
427 | self.ESC_MAGIC:self.handle_magic, | |
428 | self.ESC_HELP:self.handle_help, |
|
428 | self.ESC_HELP:self.handle_help, | |
429 | self.ESC_SHELL:self.handle_shell_escape, |
|
429 | self.ESC_SHELL:self.handle_shell_escape, | |
430 | } |
|
430 | } | |
431 |
|
431 | |||
432 | # class initializations |
|
432 | # class initializations | |
433 | Logger.__init__(self,log_ns = self.user_ns) |
|
433 | Logger.__init__(self,log_ns = self.user_ns) | |
434 | Magic.__init__(self,self) |
|
434 | Magic.__init__(self,self) | |
435 |
|
435 | |||
436 | # an ugly hack to get a pointer to the shell, so I can start writing |
|
436 | # an ugly hack to get a pointer to the shell, so I can start writing | |
437 | # magic code via this pointer instead of the current mixin salad. |
|
437 | # magic code via this pointer instead of the current mixin salad. | |
438 | Magic.set_shell(self,self) |
|
438 | Magic.set_shell(self,self) | |
439 |
|
439 | |||
440 | # Python source parser/formatter for syntax highlighting |
|
440 | # Python source parser/formatter for syntax highlighting | |
441 | pyformat = PyColorize.Parser().format |
|
441 | pyformat = PyColorize.Parser().format | |
442 | self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors']) |
|
442 | self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors']) | |
443 |
|
443 | |||
444 | # hooks holds pointers used for user-side customizations |
|
444 | # hooks holds pointers used for user-side customizations | |
445 | self.hooks = Struct() |
|
445 | self.hooks = Struct() | |
446 |
|
446 | |||
447 | # Set all default hooks, defined in the IPython.hooks module. |
|
447 | # Set all default hooks, defined in the IPython.hooks module. | |
448 | hooks = IPython.hooks |
|
448 | hooks = IPython.hooks | |
449 | for hook_name in hooks.__all__: |
|
449 | for hook_name in hooks.__all__: | |
450 | self.set_hook(hook_name,getattr(hooks,hook_name)) |
|
450 | self.set_hook(hook_name,getattr(hooks,hook_name)) | |
451 |
|
451 | |||
452 | # Flag to mark unconditional exit |
|
452 | # Flag to mark unconditional exit | |
453 | self.exit_now = False |
|
453 | self.exit_now = False | |
454 |
|
454 | |||
455 | self.usage_min = """\ |
|
455 | self.usage_min = """\ | |
456 | An enhanced console for Python. |
|
456 | An enhanced console for Python. | |
457 | Some of its features are: |
|
457 | Some of its features are: | |
458 | - Readline support if the readline library is present. |
|
458 | - Readline support if the readline library is present. | |
459 | - Tab completion in the local namespace. |
|
459 | - Tab completion in the local namespace. | |
460 | - Logging of input, see command-line options. |
|
460 | - Logging of input, see command-line options. | |
461 | - System shell escape via ! , eg !ls. |
|
461 | - System shell escape via ! , eg !ls. | |
462 | - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.) |
|
462 | - Magic commands, starting with a % (like %ls, %pwd, %cd, etc.) | |
463 | - Keeps track of locally defined variables via %who, %whos. |
|
463 | - Keeps track of locally defined variables via %who, %whos. | |
464 | - Show object information with a ? eg ?x or x? (use ?? for more info). |
|
464 | - Show object information with a ? eg ?x or x? (use ?? for more info). | |
465 | """ |
|
465 | """ | |
466 | if usage: self.usage = usage |
|
466 | if usage: self.usage = usage | |
467 | else: self.usage = self.usage_min |
|
467 | else: self.usage = self.usage_min | |
468 |
|
468 | |||
469 | # Storage |
|
469 | # Storage | |
470 | self.rc = rc # This will hold all configuration information |
|
470 | self.rc = rc # This will hold all configuration information | |
471 | self.inputcache = [] |
|
471 | self.inputcache = [] | |
472 | self._boundcache = [] |
|
472 | self._boundcache = [] | |
473 | self.pager = 'less' |
|
473 | self.pager = 'less' | |
474 | # temporary files used for various purposes. Deleted at exit. |
|
474 | # temporary files used for various purposes. Deleted at exit. | |
475 | self.tempfiles = [] |
|
475 | self.tempfiles = [] | |
476 |
|
476 | |||
477 | # Keep track of readline usage (later set by init_readline) |
|
477 | # Keep track of readline usage (later set by init_readline) | |
478 | self.has_readline = False |
|
478 | self.has_readline = False | |
479 |
|
479 | |||
480 | # for pushd/popd management |
|
480 | # for pushd/popd management | |
481 | try: |
|
481 | try: | |
482 | self.home_dir = get_home_dir() |
|
482 | self.home_dir = get_home_dir() | |
483 | except HomeDirError,msg: |
|
483 | except HomeDirError,msg: | |
484 | fatal(msg) |
|
484 | fatal(msg) | |
485 |
|
485 | |||
486 | self.dir_stack = [os.getcwd().replace(self.home_dir,'~')] |
|
486 | self.dir_stack = [os.getcwd().replace(self.home_dir,'~')] | |
487 |
|
487 | |||
488 | # Functions to call the underlying shell. |
|
488 | # Functions to call the underlying shell. | |
489 |
|
489 | |||
490 | # utility to expand user variables via Itpl |
|
490 | # utility to expand user variables via Itpl | |
491 | self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'), |
|
491 | self.var_expand = lambda cmd: str(ItplNS(cmd.replace('#','\#'), | |
492 | self.user_ns)) |
|
492 | self.user_ns)) | |
493 | # The first is similar to os.system, but it doesn't return a value, |
|
493 | # The first is similar to os.system, but it doesn't return a value, | |
494 | # and it allows interpolation of variables in the user's namespace. |
|
494 | # and it allows interpolation of variables in the user's namespace. | |
495 | self.system = lambda cmd: shell(self.var_expand(cmd), |
|
495 | self.system = lambda cmd: shell(self.var_expand(cmd), | |
496 | header='IPython system call: ', |
|
496 | header='IPython system call: ', | |
497 | verbose=self.rc.system_verbose) |
|
497 | verbose=self.rc.system_verbose) | |
498 | # These are for getoutput and getoutputerror: |
|
498 | # These are for getoutput and getoutputerror: | |
499 | self.getoutput = lambda cmd: \ |
|
499 | self.getoutput = lambda cmd: \ | |
500 | getoutput(self.var_expand(cmd), |
|
500 | getoutput(self.var_expand(cmd), | |
501 | header='IPython system call: ', |
|
501 | header='IPython system call: ', | |
502 | verbose=self.rc.system_verbose) |
|
502 | verbose=self.rc.system_verbose) | |
503 | self.getoutputerror = lambda cmd: \ |
|
503 | self.getoutputerror = lambda cmd: \ | |
504 | getoutputerror(str(ItplNS(cmd.replace('#','\#'), |
|
504 | getoutputerror(str(ItplNS(cmd.replace('#','\#'), | |
505 | self.user_ns)), |
|
505 | self.user_ns)), | |
506 | header='IPython system call: ', |
|
506 | header='IPython system call: ', | |
507 | verbose=self.rc.system_verbose) |
|
507 | verbose=self.rc.system_verbose) | |
508 |
|
508 | |||
509 | # RegExp for splitting line contents into pre-char//first |
|
509 | # RegExp for splitting line contents into pre-char//first | |
510 | # word-method//rest. For clarity, each group in on one line. |
|
510 | # word-method//rest. For clarity, each group in on one line. | |
511 |
|
511 | |||
512 | # WARNING: update the regexp if the above escapes are changed, as they |
|
512 | # WARNING: update the regexp if the above escapes are changed, as they | |
513 | # are hardwired in. |
|
513 | # are hardwired in. | |
514 |
|
514 | |||
515 | # Don't get carried away with trying to make the autocalling catch too |
|
515 | # Don't get carried away with trying to make the autocalling catch too | |
516 | # much: it's better to be conservative rather than to trigger hidden |
|
516 | # much: it's better to be conservative rather than to trigger hidden | |
517 | # evals() somewhere and end up causing side effects. |
|
517 | # evals() somewhere and end up causing side effects. | |
518 |
|
518 | |||
519 | self.line_split = re.compile(r'^([\s*,;/])' |
|
519 | self.line_split = re.compile(r'^([\s*,;/])' | |
520 | r'([\?\w\.]+\w*\s*)' |
|
520 | r'([\?\w\.]+\w*\s*)' | |
521 | r'(\(?.*$)') |
|
521 | r'(\(?.*$)') | |
522 |
|
522 | |||
523 | # Original re, keep around for a while in case changes break something |
|
523 | # Original re, keep around for a while in case changes break something | |
524 | #self.line_split = re.compile(r'(^[\s*!\?%,/]?)' |
|
524 | #self.line_split = re.compile(r'(^[\s*!\?%,/]?)' | |
525 | # r'(\s*[\?\w\.]+\w*\s*)' |
|
525 | # r'(\s*[\?\w\.]+\w*\s*)' | |
526 | # r'(\(?.*$)') |
|
526 | # r'(\(?.*$)') | |
527 |
|
527 | |||
528 | # RegExp to identify potential function names |
|
528 | # RegExp to identify potential function names | |
529 | self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$') |
|
529 | self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$') | |
530 | # RegExp to exclude strings with this start from autocalling |
|
530 | # RegExp to exclude strings with this start from autocalling | |
531 | self.re_exclude_auto = re.compile('^[!=()<>,\*/\+-]|^is ') |
|
531 | self.re_exclude_auto = re.compile('^[!=()<>,\*/\+-]|^is ') | |
532 |
|
532 | |||
533 | # try to catch also methods for stuff in lists/tuples/dicts: off |
|
533 | # try to catch also methods for stuff in lists/tuples/dicts: off | |
534 | # (experimental). For this to work, the line_split regexp would need |
|
534 | # (experimental). For this to work, the line_split regexp would need | |
535 | # to be modified so it wouldn't break things at '['. That line is |
|
535 | # to be modified so it wouldn't break things at '['. That line is | |
536 | # nasty enough that I shouldn't change it until I can test it _well_. |
|
536 | # nasty enough that I shouldn't change it until I can test it _well_. | |
537 | #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$') |
|
537 | #self.re_fun_name = re.compile (r'[a-zA-Z_]([a-zA-Z0-9_.\[\]]*) ?$') | |
538 |
|
538 | |||
539 | # keep track of where we started running (mainly for crash post-mortem) |
|
539 | # keep track of where we started running (mainly for crash post-mortem) | |
540 | self.starting_dir = os.getcwd() |
|
540 | self.starting_dir = os.getcwd() | |
541 |
|
541 | |||
542 | # Attributes for Logger mixin class, make defaults here |
|
542 | # Attributes for Logger mixin class, make defaults here | |
543 | self._dolog = False |
|
543 | self._dolog = False | |
544 | self.LOG = '' |
|
544 | self.LOG = '' | |
545 | self.LOGDEF = '.InteractiveShell.log' |
|
545 | self.LOGDEF = '.InteractiveShell.log' | |
546 | self.LOGMODE = 'over' |
|
546 | self.LOGMODE = 'over' | |
547 | self.LOGHEAD = Itpl( |
|
547 | self.LOGHEAD = Itpl( | |
548 | """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE *** |
|
548 | """#log# Automatic Logger file. *** THIS MUST BE THE FIRST LINE *** | |
549 | #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW |
|
549 | #log# DO NOT CHANGE THIS LINE OR THE TWO BELOW | |
550 | #log# opts = $self.rc.opts |
|
550 | #log# opts = $self.rc.opts | |
551 | #log# args = $self.rc.args |
|
551 | #log# args = $self.rc.args | |
552 | #log# It is safe to make manual edits below here. |
|
552 | #log# It is safe to make manual edits below here. | |
553 | #log#----------------------------------------------------------------------- |
|
553 | #log#----------------------------------------------------------------------- | |
554 | """) |
|
554 | """) | |
555 | # Various switches which can be set |
|
555 | # Various switches which can be set | |
556 | self.CACHELENGTH = 5000 # this is cheap, it's just text |
|
556 | self.CACHELENGTH = 5000 # this is cheap, it's just text | |
557 | self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__ |
|
557 | self.BANNER = "Python %(version)s on %(platform)s\n" % sys.__dict__ | |
558 | self.banner2 = banner2 |
|
558 | self.banner2 = banner2 | |
559 |
|
559 | |||
560 | # TraceBack handlers: |
|
560 | # TraceBack handlers: | |
561 | # Need two, one for syntax errors and one for other exceptions. |
|
561 | # Need two, one for syntax errors and one for other exceptions. | |
562 | self.SyntaxTB = SyntaxTB(color_scheme='NoColor') |
|
562 | self.SyntaxTB = SyntaxTB(color_scheme='NoColor') | |
563 | # The interactive one is initialized with an offset, meaning we always |
|
563 | # The interactive one is initialized with an offset, meaning we always | |
564 | # want to remove the topmost item in the traceback, which is our own |
|
564 | # want to remove the topmost item in the traceback, which is our own | |
565 | # internal code. Valid modes: ['Plain','Context','Verbose'] |
|
565 | # internal code. Valid modes: ['Plain','Context','Verbose'] | |
566 | self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain', |
|
566 | self.InteractiveTB = ultraTB.AutoFormattedTB(mode = 'Plain', | |
567 | color_scheme='NoColor', |
|
567 | color_scheme='NoColor', | |
568 | tb_offset = 1) |
|
568 | tb_offset = 1) | |
569 | # and add any custom exception handlers the user may have specified |
|
569 | # and add any custom exception handlers the user may have specified | |
570 | self.set_custom_exc(*custom_exceptions) |
|
570 | self.set_custom_exc(*custom_exceptions) | |
571 |
|
571 | |||
572 | # Object inspector |
|
572 | # Object inspector | |
573 | self.inspector = OInspect.Inspector(OInspect.InspectColors, |
|
573 | self.inspector = OInspect.Inspector(OInspect.InspectColors, | |
574 | PyColorize.ANSICodeColors, |
|
574 | PyColorize.ANSICodeColors, | |
575 | 'NoColor') |
|
575 | 'NoColor') | |
576 | # indentation management |
|
576 | # indentation management | |
577 | self.autoindent = False |
|
577 | self.autoindent = False | |
578 | self.indent_current_nsp = 0 |
|
578 | self.indent_current_nsp = 0 | |
579 | self.indent_current = '' # actual indent string |
|
579 | self.indent_current = '' # actual indent string | |
580 |
|
580 | |||
581 | # Make some aliases automatically |
|
581 | # Make some aliases automatically | |
582 | # Prepare list of shell aliases to auto-define |
|
582 | # Prepare list of shell aliases to auto-define | |
583 | if os.name == 'posix': |
|
583 | if os.name == 'posix': | |
584 | auto_alias = ('mkdir mkdir', 'rmdir rmdir', |
|
584 | auto_alias = ('mkdir mkdir', 'rmdir rmdir', | |
585 | 'mv mv -i','rm rm -i','cp cp -i', |
|
585 | 'mv mv -i','rm rm -i','cp cp -i', | |
586 | 'cat cat','less less','clear clear', |
|
586 | 'cat cat','less less','clear clear', | |
587 | # a better ls |
|
587 | # a better ls | |
588 | 'ls ls -F', |
|
588 | 'ls ls -F', | |
589 | # long ls |
|
589 | # long ls | |
590 | 'll ls -lF', |
|
590 | 'll ls -lF', | |
591 | # color ls |
|
591 | # color ls | |
592 | 'lc ls -F -o --color', |
|
592 | 'lc ls -F -o --color', | |
593 | # ls normal files only |
|
593 | # ls normal files only | |
594 | 'lf ls -F -o --color %l | grep ^-', |
|
594 | 'lf ls -F -o --color %l | grep ^-', | |
595 | # ls symbolic links |
|
595 | # ls symbolic links | |
596 | 'lk ls -F -o --color %l | grep ^l', |
|
596 | 'lk ls -F -o --color %l | grep ^l', | |
597 | # directories or links to directories, |
|
597 | # directories or links to directories, | |
598 | 'ldir ls -F -o --color %l | grep /$', |
|
598 | 'ldir ls -F -o --color %l | grep /$', | |
599 | # things which are executable |
|
599 | # things which are executable | |
600 | 'lx ls -F -o --color %l | grep ^-..x', |
|
600 | 'lx ls -F -o --color %l | grep ^-..x', | |
601 | ) |
|
601 | ) | |
602 | elif os.name in ['nt','dos']: |
|
602 | elif os.name in ['nt','dos']: | |
603 | auto_alias = ('dir dir /on', 'ls dir /on', |
|
603 | auto_alias = ('dir dir /on', 'ls dir /on', | |
604 | 'ddir dir /ad /on', 'ldir dir /ad /on', |
|
604 | 'ddir dir /ad /on', 'ldir dir /ad /on', | |
605 | 'mkdir mkdir','rmdir rmdir','echo echo', |
|
605 | 'mkdir mkdir','rmdir rmdir','echo echo', | |
606 | 'ren ren','cls cls','copy copy') |
|
606 | 'ren ren','cls cls','copy copy') | |
607 | else: |
|
607 | else: | |
608 | auto_alias = () |
|
608 | auto_alias = () | |
609 | self.auto_alias = map(lambda s:s.split(None,1),auto_alias) |
|
609 | self.auto_alias = map(lambda s:s.split(None,1),auto_alias) | |
610 | # Call the actual (public) initializer |
|
610 | # Call the actual (public) initializer | |
611 | self.init_auto_alias() |
|
611 | self.init_auto_alias() | |
612 | # end __init__ |
|
612 | # end __init__ | |
613 |
|
613 | |||
614 | def set_hook(self,name,hook): |
|
614 | def set_hook(self,name,hook): | |
615 | """set_hook(name,hook) -> sets an internal IPython hook. |
|
615 | """set_hook(name,hook) -> sets an internal IPython hook. | |
616 |
|
616 | |||
617 | IPython exposes some of its internal API as user-modifiable hooks. By |
|
617 | IPython exposes some of its internal API as user-modifiable hooks. By | |
618 | resetting one of these hooks, you can modify IPython's behavior to |
|
618 | resetting one of these hooks, you can modify IPython's behavior to | |
619 | call at runtime your own routines.""" |
|
619 | call at runtime your own routines.""" | |
620 |
|
620 | |||
621 | # At some point in the future, this should validate the hook before it |
|
621 | # At some point in the future, this should validate the hook before it | |
622 | # accepts it. Probably at least check that the hook takes the number |
|
622 | # accepts it. Probably at least check that the hook takes the number | |
623 | # of args it's supposed to. |
|
623 | # of args it's supposed to. | |
624 | setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__)) |
|
624 | setattr(self.hooks,name,new.instancemethod(hook,self,self.__class__)) | |
625 |
|
625 | |||
626 | def set_custom_exc(self,exc_tuple,handler): |
|
626 | def set_custom_exc(self,exc_tuple,handler): | |
627 | """set_custom_exc(exc_tuple,handler) |
|
627 | """set_custom_exc(exc_tuple,handler) | |
628 |
|
628 | |||
629 | Set a custom exception handler, which will be called if any of the |
|
629 | Set a custom exception handler, which will be called if any of the | |
630 | exceptions in exc_tuple occur in the mainloop (specifically, in the |
|
630 | exceptions in exc_tuple occur in the mainloop (specifically, in the | |
631 | runcode() method. |
|
631 | runcode() method. | |
632 |
|
632 | |||
633 | Inputs: |
|
633 | Inputs: | |
634 |
|
634 | |||
635 | - exc_tuple: a *tuple* of valid exceptions to call the defined |
|
635 | - exc_tuple: a *tuple* of valid exceptions to call the defined | |
636 | handler for. It is very important that you use a tuple, and NOT A |
|
636 | handler for. It is very important that you use a tuple, and NOT A | |
637 | LIST here, because of the way Python's except statement works. If |
|
637 | LIST here, because of the way Python's except statement works. If | |
638 | you only want to trap a single exception, use a singleton tuple: |
|
638 | you only want to trap a single exception, use a singleton tuple: | |
639 |
|
639 | |||
640 | exc_tuple == (MyCustomException,) |
|
640 | exc_tuple == (MyCustomException,) | |
641 |
|
641 | |||
642 | - handler: this must be defined as a function with the following |
|
642 | - handler: this must be defined as a function with the following | |
643 | basic interface: def my_handler(self,etype,value,tb). |
|
643 | basic interface: def my_handler(self,etype,value,tb). | |
644 |
|
644 | |||
645 | This will be made into an instance method (via new.instancemethod) |
|
645 | This will be made into an instance method (via new.instancemethod) | |
646 | of IPython itself, and it will be called if any of the exceptions |
|
646 | of IPython itself, and it will be called if any of the exceptions | |
647 | listed in the exc_tuple are caught. If the handler is None, an |
|
647 | listed in the exc_tuple are caught. If the handler is None, an | |
648 | internal basic one is used, which just prints basic info. |
|
648 | internal basic one is used, which just prints basic info. | |
649 |
|
649 | |||
650 | WARNING: by putting in your own exception handler into IPython's main |
|
650 | WARNING: by putting in your own exception handler into IPython's main | |
651 | execution loop, you run a very good chance of nasty crashes. This |
|
651 | execution loop, you run a very good chance of nasty crashes. This | |
652 | facility should only be used if you really know what you are doing.""" |
|
652 | facility should only be used if you really know what you are doing.""" | |
653 |
|
653 | |||
654 | assert type(exc_tuple)==type(()) , \ |
|
654 | assert type(exc_tuple)==type(()) , \ | |
655 | "The custom exceptions must be given AS A TUPLE." |
|
655 | "The custom exceptions must be given AS A TUPLE." | |
656 |
|
656 | |||
657 | def dummy_handler(self,etype,value,tb): |
|
657 | def dummy_handler(self,etype,value,tb): | |
658 | print '*** Simple custom exception handler ***' |
|
658 | print '*** Simple custom exception handler ***' | |
659 | print 'Exception type :',etype |
|
659 | print 'Exception type :',etype | |
660 | print 'Exception value:',value |
|
660 | print 'Exception value:',value | |
661 | print 'Traceback :',tb |
|
661 | print 'Traceback :',tb | |
662 | print 'Source code :','\n'.join(self.buffer) |
|
662 | print 'Source code :','\n'.join(self.buffer) | |
663 |
|
663 | |||
664 | if handler is None: handler = dummy_handler |
|
664 | if handler is None: handler = dummy_handler | |
665 |
|
665 | |||
666 | self.CustomTB = new.instancemethod(handler,self,self.__class__) |
|
666 | self.CustomTB = new.instancemethod(handler,self,self.__class__) | |
667 | self.custom_exceptions = exc_tuple |
|
667 | self.custom_exceptions = exc_tuple | |
668 |
|
668 | |||
669 | def set_custom_completer(self,completer,pos=0): |
|
669 | def set_custom_completer(self,completer,pos=0): | |
670 | """set_custom_completer(completer,pos=0) |
|
670 | """set_custom_completer(completer,pos=0) | |
671 |
|
671 | |||
672 | Adds a new custom completer function. |
|
672 | Adds a new custom completer function. | |
673 |
|
673 | |||
674 | The position argument (defaults to 0) is the index in the completers |
|
674 | The position argument (defaults to 0) is the index in the completers | |
675 | list where you want the completer to be inserted.""" |
|
675 | list where you want the completer to be inserted.""" | |
676 |
|
676 | |||
677 | newcomp = new.instancemethod(completer,self.Completer, |
|
677 | newcomp = new.instancemethod(completer,self.Completer, | |
678 | self.Completer.__class__) |
|
678 | self.Completer.__class__) | |
679 | self.Completer.matchers.insert(pos,newcomp) |
|
679 | self.Completer.matchers.insert(pos,newcomp) | |
680 |
|
680 | |||
681 | def complete(self,text): |
|
681 | def complete(self,text): | |
682 | """Return a sorted list of all possible completions on text. |
|
682 | """Return a sorted list of all possible completions on text. | |
683 |
|
683 | |||
684 | Inputs: |
|
684 | Inputs: | |
685 |
|
685 | |||
686 | - text: a string of text to be completed on. |
|
686 | - text: a string of text to be completed on. | |
687 |
|
687 | |||
688 | This is a wrapper around the completion mechanism, similar to what |
|
688 | This is a wrapper around the completion mechanism, similar to what | |
689 | readline does at the command line when the TAB key is hit. By |
|
689 | readline does at the command line when the TAB key is hit. By | |
690 | exposing it as a method, it can be used by other non-readline |
|
690 | exposing it as a method, it can be used by other non-readline | |
691 | environments (such as GUIs) for text completion. |
|
691 | environments (such as GUIs) for text completion. | |
692 |
|
692 | |||
693 | Simple usage example: |
|
693 | Simple usage example: | |
694 |
|
694 | |||
695 | In [1]: x = 'hello' |
|
695 | In [1]: x = 'hello' | |
696 |
|
696 | |||
697 | In [2]: __IP.complete('x.l') |
|
697 | In [2]: __IP.complete('x.l') | |
698 | Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']""" |
|
698 | Out[2]: ['x.ljust', 'x.lower', 'x.lstrip']""" | |
699 |
|
699 | |||
700 | complete = self.Completer.complete |
|
700 | complete = self.Completer.complete | |
701 | state = 0 |
|
701 | state = 0 | |
702 | # use a dict so we get unique keys, since ipyhton's multiple |
|
702 | # use a dict so we get unique keys, since ipyhton's multiple | |
703 | # completers can return duplicates. |
|
703 | # completers can return duplicates. | |
704 | comps = {} |
|
704 | comps = {} | |
705 | while True: |
|
705 | while True: | |
706 | newcomp = complete(text,state) |
|
706 | newcomp = complete(text,state) | |
707 | if newcomp is None: |
|
707 | if newcomp is None: | |
708 | break |
|
708 | break | |
709 | comps[newcomp] = 1 |
|
709 | comps[newcomp] = 1 | |
710 | state += 1 |
|
710 | state += 1 | |
711 | outcomps = comps.keys() |
|
711 | outcomps = comps.keys() | |
712 | outcomps.sort() |
|
712 | outcomps.sort() | |
713 | return outcomps |
|
713 | return outcomps | |
714 |
|
714 | |||
715 | def set_completer_frame(self, frame): |
|
715 | def set_completer_frame(self, frame): | |
716 | if frame: |
|
716 | if frame: | |
717 | self.Completer.namespace = frame.f_locals |
|
717 | self.Completer.namespace = frame.f_locals | |
718 | self.Completer.global_namespace = frame.f_globals |
|
718 | self.Completer.global_namespace = frame.f_globals | |
719 | else: |
|
719 | else: | |
720 | self.Completer.namespace = self.user_ns |
|
720 | self.Completer.namespace = self.user_ns | |
721 | self.Completer.global_namespace = self.user_global_ns |
|
721 | self.Completer.global_namespace = self.user_global_ns | |
722 |
|
722 | |||
723 | def post_config_initialization(self): |
|
723 | def post_config_initialization(self): | |
724 | """Post configuration init method |
|
724 | """Post configuration init method | |
725 |
|
725 | |||
726 | This is called after the configuration files have been processed to |
|
726 | This is called after the configuration files have been processed to | |
727 | 'finalize' the initialization.""" |
|
727 | 'finalize' the initialization.""" | |
728 |
|
728 | |||
729 | rc = self.rc |
|
729 | rc = self.rc | |
730 |
|
730 | |||
731 | # Load readline proper |
|
731 | # Load readline proper | |
732 | if rc.readline: |
|
732 | if rc.readline: | |
733 | self.init_readline() |
|
733 | self.init_readline() | |
734 |
|
734 | |||
735 | # Set user colors (don't do it in the constructor above so that it |
|
735 | # Set user colors (don't do it in the constructor above so that it | |
736 | # doesn't crash if colors option is invalid) |
|
736 | # doesn't crash if colors option is invalid) | |
737 | self.magic_colors(rc.colors) |
|
737 | self.magic_colors(rc.colors) | |
738 |
|
738 | |||
739 | # Load user aliases |
|
739 | # Load user aliases | |
740 | for alias in rc.alias: |
|
740 | for alias in rc.alias: | |
741 | self.magic_alias(alias) |
|
741 | self.magic_alias(alias) | |
742 |
|
742 | |||
743 | # dynamic data that survives through sessions |
|
743 | # dynamic data that survives through sessions | |
744 | # XXX make the filename a config option? |
|
744 | # XXX make the filename a config option? | |
745 | persist_base = 'persist' |
|
745 | persist_base = 'persist' | |
746 | if rc.profile: |
|
746 | if rc.profile: | |
747 | persist_base += '_%s' % rc.profile |
|
747 | persist_base += '_%s' % rc.profile | |
748 | self.persist_fname = os.path.join(rc.ipythondir,persist_base) |
|
748 | self.persist_fname = os.path.join(rc.ipythondir,persist_base) | |
749 |
|
749 | |||
750 | try: |
|
750 | try: | |
751 | self.persist = pickle.load(file(self.persist_fname)) |
|
751 | self.persist = pickle.load(file(self.persist_fname)) | |
752 | except: |
|
752 | except: | |
753 | self.persist = {} |
|
753 | self.persist = {} | |
754 |
|
754 | |||
755 | def init_auto_alias(self): |
|
755 | def init_auto_alias(self): | |
756 | """Define some aliases automatically. |
|
756 | """Define some aliases automatically. | |
757 |
|
757 | |||
758 | These are ALL parameter-less aliases""" |
|
758 | These are ALL parameter-less aliases""" | |
759 | for alias,cmd in self.auto_alias: |
|
759 | for alias,cmd in self.auto_alias: | |
760 | self.alias_table[alias] = (0,cmd) |
|
760 | self.alias_table[alias] = (0,cmd) | |
761 |
|
761 | |||
762 | def alias_table_validate(self,verbose=0): |
|
762 | def alias_table_validate(self,verbose=0): | |
763 | """Update information about the alias table. |
|
763 | """Update information about the alias table. | |
764 |
|
764 | |||
765 | In particular, make sure no Python keywords/builtins are in it.""" |
|
765 | In particular, make sure no Python keywords/builtins are in it.""" | |
766 |
|
766 | |||
767 | no_alias = self.no_alias |
|
767 | no_alias = self.no_alias | |
768 | for k in self.alias_table.keys(): |
|
768 | for k in self.alias_table.keys(): | |
769 | if k in no_alias: |
|
769 | if k in no_alias: | |
770 | del self.alias_table[k] |
|
770 | del self.alias_table[k] | |
771 | if verbose: |
|
771 | if verbose: | |
772 | print ("Deleting alias <%s>, it's a Python " |
|
772 | print ("Deleting alias <%s>, it's a Python " | |
773 | "keyword or builtin." % k) |
|
773 | "keyword or builtin." % k) | |
774 |
|
774 | |||
775 | def set_autoindent(self,value=None): |
|
775 | def set_autoindent(self,value=None): | |
776 | """Set the autoindent flag, checking for readline support. |
|
776 | """Set the autoindent flag, checking for readline support. | |
777 |
|
777 | |||
778 | If called with no arguments, it acts as a toggle.""" |
|
778 | If called with no arguments, it acts as a toggle.""" | |
779 |
|
779 | |||
780 | if not self.has_readline: |
|
780 | if not self.has_readline: | |
781 | if os.name == 'posix': |
|
781 | if os.name == 'posix': | |
782 | warn("The auto-indent feature requires the readline library") |
|
782 | warn("The auto-indent feature requires the readline library") | |
783 | self.autoindent = 0 |
|
783 | self.autoindent = 0 | |
784 | return |
|
784 | return | |
785 | if value is None: |
|
785 | if value is None: | |
786 | self.autoindent = not self.autoindent |
|
786 | self.autoindent = not self.autoindent | |
787 | else: |
|
787 | else: | |
788 | self.autoindent = value |
|
788 | self.autoindent = value | |
789 |
|
789 | |||
790 | def rc_set_toggle(self,rc_field,value=None): |
|
790 | def rc_set_toggle(self,rc_field,value=None): | |
791 | """Set or toggle a field in IPython's rc config. structure. |
|
791 | """Set or toggle a field in IPython's rc config. structure. | |
792 |
|
792 | |||
793 | If called with no arguments, it acts as a toggle. |
|
793 | If called with no arguments, it acts as a toggle. | |
794 |
|
794 | |||
795 | If called with a non-existent field, the resulting AttributeError |
|
795 | If called with a non-existent field, the resulting AttributeError | |
796 | exception will propagate out.""" |
|
796 | exception will propagate out.""" | |
797 |
|
797 | |||
798 | rc_val = getattr(self.rc,rc_field) |
|
798 | rc_val = getattr(self.rc,rc_field) | |
799 | if value is None: |
|
799 | if value is None: | |
800 | value = not rc_val |
|
800 | value = not rc_val | |
801 | setattr(self.rc,rc_field,value) |
|
801 | setattr(self.rc,rc_field,value) | |
802 |
|
802 | |||
803 | def user_setup(self,ipythondir,rc_suffix,mode='install'): |
|
803 | def user_setup(self,ipythondir,rc_suffix,mode='install'): | |
804 | """Install the user configuration directory. |
|
804 | """Install the user configuration directory. | |
805 |
|
805 | |||
806 | Can be called when running for the first time or to upgrade the user's |
|
806 | Can be called when running for the first time or to upgrade the user's | |
807 | .ipython/ directory with the mode parameter. Valid modes are 'install' |
|
807 | .ipython/ directory with the mode parameter. Valid modes are 'install' | |
808 | and 'upgrade'.""" |
|
808 | and 'upgrade'.""" | |
809 |
|
809 | |||
810 | def wait(): |
|
810 | def wait(): | |
811 | try: |
|
811 | try: | |
812 | raw_input("Please press <RETURN> to start IPython.") |
|
812 | raw_input("Please press <RETURN> to start IPython.") | |
813 | except EOFError: |
|
813 | except EOFError: | |
814 | print >> Term.cout |
|
814 | print >> Term.cout | |
815 | print '*'*70 |
|
815 | print '*'*70 | |
816 |
|
816 | |||
817 | cwd = os.getcwd() # remember where we started |
|
817 | cwd = os.getcwd() # remember where we started | |
818 | glb = glob.glob |
|
818 | glb = glob.glob | |
819 | print '*'*70 |
|
819 | print '*'*70 | |
820 | if mode == 'install': |
|
820 | if mode == 'install': | |
821 | print \ |
|
821 | print \ | |
822 | """Welcome to IPython. I will try to create a personal configuration directory |
|
822 | """Welcome to IPython. I will try to create a personal configuration directory | |
823 | where you can customize many aspects of IPython's functionality in:\n""" |
|
823 | where you can customize many aspects of IPython's functionality in:\n""" | |
824 | else: |
|
824 | else: | |
825 | print 'I am going to upgrade your configuration in:' |
|
825 | print 'I am going to upgrade your configuration in:' | |
826 |
|
826 | |||
827 | print ipythondir |
|
827 | print ipythondir | |
828 |
|
828 | |||
829 | rcdirend = os.path.join('IPython','UserConfig') |
|
829 | rcdirend = os.path.join('IPython','UserConfig') | |
830 | cfg = lambda d: os.path.join(d,rcdirend) |
|
830 | cfg = lambda d: os.path.join(d,rcdirend) | |
831 | try: |
|
831 | try: | |
832 | rcdir = filter(os.path.isdir,map(cfg,sys.path))[0] |
|
832 | rcdir = filter(os.path.isdir,map(cfg,sys.path))[0] | |
833 | except IOError: |
|
833 | except IOError: | |
834 | warning = """ |
|
834 | warning = """ | |
835 | Installation error. IPython's directory was not found. |
|
835 | Installation error. IPython's directory was not found. | |
836 |
|
836 | |||
837 | Check the following: |
|
837 | Check the following: | |
838 |
|
838 | |||
839 | The ipython/IPython directory should be in a directory belonging to your |
|
839 | The ipython/IPython directory should be in a directory belonging to your | |
840 | PYTHONPATH environment variable (that is, it should be in a directory |
|
840 | PYTHONPATH environment variable (that is, it should be in a directory | |
841 | belonging to sys.path). You can copy it explicitly there or just link to it. |
|
841 | belonging to sys.path). You can copy it explicitly there or just link to it. | |
842 |
|
842 | |||
843 | IPython will proceed with builtin defaults. |
|
843 | IPython will proceed with builtin defaults. | |
844 | """ |
|
844 | """ | |
845 | warn(warning) |
|
845 | warn(warning) | |
846 | wait() |
|
846 | wait() | |
847 | return |
|
847 | return | |
848 |
|
848 | |||
849 | if mode == 'install': |
|
849 | if mode == 'install': | |
850 | try: |
|
850 | try: | |
851 | shutil.copytree(rcdir,ipythondir) |
|
851 | shutil.copytree(rcdir,ipythondir) | |
852 | os.chdir(ipythondir) |
|
852 | os.chdir(ipythondir) | |
853 | rc_files = glb("ipythonrc*") |
|
853 | rc_files = glb("ipythonrc*") | |
854 | for rc_file in rc_files: |
|
854 | for rc_file in rc_files: | |
855 | os.rename(rc_file,rc_file+rc_suffix) |
|
855 | os.rename(rc_file,rc_file+rc_suffix) | |
856 | except: |
|
856 | except: | |
857 | warning = """ |
|
857 | warning = """ | |
858 |
|
858 | |||
859 | There was a problem with the installation: |
|
859 | There was a problem with the installation: | |
860 | %s |
|
860 | %s | |
861 | Try to correct it or contact the developers if you think it's a bug. |
|
861 | Try to correct it or contact the developers if you think it's a bug. | |
862 | IPython will proceed with builtin defaults.""" % sys.exc_info()[1] |
|
862 | IPython will proceed with builtin defaults.""" % sys.exc_info()[1] | |
863 | warn(warning) |
|
863 | warn(warning) | |
864 | wait() |
|
864 | wait() | |
865 | return |
|
865 | return | |
866 |
|
866 | |||
867 | elif mode == 'upgrade': |
|
867 | elif mode == 'upgrade': | |
868 | try: |
|
868 | try: | |
869 | os.chdir(ipythondir) |
|
869 | os.chdir(ipythondir) | |
870 | except: |
|
870 | except: | |
871 | print """ |
|
871 | print """ | |
872 | Can not upgrade: changing to directory %s failed. Details: |
|
872 | Can not upgrade: changing to directory %s failed. Details: | |
873 | %s |
|
873 | %s | |
874 | """ % (ipythondir,sys.exc_info()[1]) |
|
874 | """ % (ipythondir,sys.exc_info()[1]) | |
875 | wait() |
|
875 | wait() | |
876 | return |
|
876 | return | |
877 | else: |
|
877 | else: | |
878 | sources = glb(os.path.join(rcdir,'[A-Za-z]*')) |
|
878 | sources = glb(os.path.join(rcdir,'[A-Za-z]*')) | |
879 | for new_full_path in sources: |
|
879 | for new_full_path in sources: | |
880 | new_filename = os.path.basename(new_full_path) |
|
880 | new_filename = os.path.basename(new_full_path) | |
881 | if new_filename.startswith('ipythonrc'): |
|
881 | if new_filename.startswith('ipythonrc'): | |
882 | new_filename = new_filename + rc_suffix |
|
882 | new_filename = new_filename + rc_suffix | |
883 | # The config directory should only contain files, skip any |
|
883 | # The config directory should only contain files, skip any | |
884 | # directories which may be there (like CVS) |
|
884 | # directories which may be there (like CVS) | |
885 | if os.path.isdir(new_full_path): |
|
885 | if os.path.isdir(new_full_path): | |
886 | continue |
|
886 | continue | |
887 | if os.path.exists(new_filename): |
|
887 | if os.path.exists(new_filename): | |
888 | old_file = new_filename+'.old' |
|
888 | old_file = new_filename+'.old' | |
889 | if os.path.exists(old_file): |
|
889 | if os.path.exists(old_file): | |
890 | os.remove(old_file) |
|
890 | os.remove(old_file) | |
891 | os.rename(new_filename,old_file) |
|
891 | os.rename(new_filename,old_file) | |
892 | shutil.copy(new_full_path,new_filename) |
|
892 | shutil.copy(new_full_path,new_filename) | |
893 | else: |
|
893 | else: | |
894 | raise ValueError,'unrecognized mode for install:',`mode` |
|
894 | raise ValueError,'unrecognized mode for install:',`mode` | |
895 |
|
895 | |||
896 | # Fix line-endings to those native to each platform in the config |
|
896 | # Fix line-endings to those native to each platform in the config | |
897 | # directory. |
|
897 | # directory. | |
898 | try: |
|
898 | try: | |
899 | os.chdir(ipythondir) |
|
899 | os.chdir(ipythondir) | |
900 | except: |
|
900 | except: | |
901 | print """ |
|
901 | print """ | |
902 | Problem: changing to directory %s failed. |
|
902 | Problem: changing to directory %s failed. | |
903 | Details: |
|
903 | Details: | |
904 | %s |
|
904 | %s | |
905 |
|
905 | |||
906 | Some configuration files may have incorrect line endings. This should not |
|
906 | Some configuration files may have incorrect line endings. This should not | |
907 | cause any problems during execution. """ % (ipythondir,sys.exc_info()[1]) |
|
907 | cause any problems during execution. """ % (ipythondir,sys.exc_info()[1]) | |
908 | wait() |
|
908 | wait() | |
909 | else: |
|
909 | else: | |
910 | for fname in glb('ipythonrc*'): |
|
910 | for fname in glb('ipythonrc*'): | |
911 | try: |
|
911 | try: | |
912 | native_line_ends(fname,backup=0) |
|
912 | native_line_ends(fname,backup=0) | |
913 | except IOError: |
|
913 | except IOError: | |
914 | pass |
|
914 | pass | |
915 |
|
915 | |||
916 | if mode == 'install': |
|
916 | if mode == 'install': | |
917 | print """ |
|
917 | print """ | |
918 | Successful installation! |
|
918 | Successful installation! | |
919 |
|
919 | |||
920 | Please read the sections 'Initial Configuration' and 'Quick Tips' in the |
|
920 | Please read the sections 'Initial Configuration' and 'Quick Tips' in the | |
921 | IPython manual (there are both HTML and PDF versions supplied with the |
|
921 | IPython manual (there are both HTML and PDF versions supplied with the | |
922 | distribution) to make sure that your system environment is properly configured |
|
922 | distribution) to make sure that your system environment is properly configured | |
923 | to take advantage of IPython's features.""" |
|
923 | to take advantage of IPython's features.""" | |
924 | else: |
|
924 | else: | |
925 | print """ |
|
925 | print """ | |
926 | Successful upgrade! |
|
926 | Successful upgrade! | |
927 |
|
927 | |||
928 | All files in your directory: |
|
928 | All files in your directory: | |
929 | %(ipythondir)s |
|
929 | %(ipythondir)s | |
930 | which would have been overwritten by the upgrade were backed up with a .old |
|
930 | which would have been overwritten by the upgrade were backed up with a .old | |
931 | extension. If you had made particular customizations in those files you may |
|
931 | extension. If you had made particular customizations in those files you may | |
932 | want to merge them back into the new files.""" % locals() |
|
932 | want to merge them back into the new files.""" % locals() | |
933 | wait() |
|
933 | wait() | |
934 | os.chdir(cwd) |
|
934 | os.chdir(cwd) | |
935 | # end user_setup() |
|
935 | # end user_setup() | |
936 |
|
936 | |||
937 | def atexit_operations(self): |
|
937 | def atexit_operations(self): | |
938 | """This will be executed at the time of exit. |
|
938 | """This will be executed at the time of exit. | |
939 |
|
939 | |||
940 | Saving of persistent data should be performed here. """ |
|
940 | Saving of persistent data should be performed here. """ | |
941 |
|
941 | |||
942 | # input history |
|
942 | # input history | |
943 | self.savehist() |
|
943 | self.savehist() | |
944 |
|
944 | |||
945 | # Cleanup all tempfiles left around |
|
945 | # Cleanup all tempfiles left around | |
946 | for tfile in self.tempfiles: |
|
946 | for tfile in self.tempfiles: | |
947 | try: |
|
947 | try: | |
948 | os.unlink(tfile) |
|
948 | os.unlink(tfile) | |
949 | except OSError: |
|
949 | except OSError: | |
950 | pass |
|
950 | pass | |
951 |
|
951 | |||
952 | # save the "persistent data" catch-all dictionary |
|
952 | # save the "persistent data" catch-all dictionary | |
953 | try: |
|
953 | try: | |
954 | pickle.dump(self.persist, open(self.persist_fname,"w")) |
|
954 | pickle.dump(self.persist, open(self.persist_fname,"w")) | |
955 | except: |
|
955 | except: | |
956 | print "*** ERROR *** persistent data saving failed." |
|
956 | print "*** ERROR *** persistent data saving failed." | |
957 |
|
957 | |||
958 | def savehist(self): |
|
958 | def savehist(self): | |
959 | """Save input history to a file (via readline library).""" |
|
959 | """Save input history to a file (via readline library).""" | |
960 | try: |
|
960 | try: | |
961 | self.readline.write_history_file(self.histfile) |
|
961 | self.readline.write_history_file(self.histfile) | |
962 | except: |
|
962 | except: | |
963 | print 'Unable to save IPython command history to file: ' + \ |
|
963 | print 'Unable to save IPython command history to file: ' + \ | |
964 | `self.histfile` |
|
964 | `self.histfile` | |
965 |
|
965 | |||
966 | def pre_readline(self): |
|
966 | def pre_readline(self): | |
967 | """readline hook to be used at the start of each line. |
|
967 | """readline hook to be used at the start of each line. | |
968 |
|
968 | |||
969 | Currently it handles auto-indent only.""" |
|
969 | Currently it handles auto-indent only.""" | |
970 |
|
970 | |||
971 | self.readline.insert_text(self.indent_current) |
|
971 | self.readline.insert_text(self.indent_current) | |
972 |
|
972 | |||
973 | def init_readline(self): |
|
973 | def init_readline(self): | |
974 | """Command history completion/saving/reloading.""" |
|
974 | """Command history completion/saving/reloading.""" | |
975 | try: |
|
975 | try: | |
976 | import readline |
|
976 | import readline | |
977 | except ImportError: |
|
977 | except ImportError: | |
978 | self.has_readline = 0 |
|
978 | self.has_readline = 0 | |
979 | self.readline = None |
|
979 | self.readline = None | |
980 | # no point in bugging windows users with this every time: |
|
980 | # no point in bugging windows users with this every time: | |
981 | if os.name == 'posix': |
|
981 | if os.name == 'posix': | |
982 | warn('Readline services not available on this platform.') |
|
982 | warn('Readline services not available on this platform.') | |
983 | else: |
|
983 | else: | |
984 | import atexit |
|
984 | import atexit | |
985 | from IPython.completer import IPCompleter |
|
985 | from IPython.completer import IPCompleter | |
986 | self.Completer = IPCompleter(self, |
|
986 | self.Completer = IPCompleter(self, | |
987 | self.user_ns, |
|
987 | self.user_ns, | |
988 | self.user_global_ns, |
|
988 | self.user_global_ns, | |
989 | self.rc.readline_omit__names, |
|
989 | self.rc.readline_omit__names, | |
990 | self.alias_table) |
|
990 | self.alias_table) | |
991 |
|
991 | |||
992 | # Platform-specific configuration |
|
992 | # Platform-specific configuration | |
993 | if os.name == 'nt': |
|
993 | if os.name == 'nt': | |
994 | self.readline_startup_hook = readline.set_pre_input_hook |
|
994 | self.readline_startup_hook = readline.set_pre_input_hook | |
995 | else: |
|
995 | else: | |
996 | self.readline_startup_hook = readline.set_startup_hook |
|
996 | self.readline_startup_hook = readline.set_startup_hook | |
997 |
|
997 | |||
998 | # Load user's initrc file (readline config) |
|
998 | # Load user's initrc file (readline config) | |
999 | inputrc_name = os.environ.get('INPUTRC') |
|
999 | inputrc_name = os.environ.get('INPUTRC') | |
1000 | if inputrc_name is None: |
|
1000 | if inputrc_name is None: | |
1001 | home_dir = get_home_dir() |
|
1001 | home_dir = get_home_dir() | |
1002 | if home_dir is not None: |
|
1002 | if home_dir is not None: | |
1003 | inputrc_name = os.path.join(home_dir,'.inputrc') |
|
1003 | inputrc_name = os.path.join(home_dir,'.inputrc') | |
1004 | if os.path.isfile(inputrc_name): |
|
1004 | if os.path.isfile(inputrc_name): | |
1005 | try: |
|
1005 | try: | |
1006 | readline.read_init_file(inputrc_name) |
|
1006 | readline.read_init_file(inputrc_name) | |
1007 | except: |
|
1007 | except: | |
1008 | warn('Problems reading readline initialization file <%s>' |
|
1008 | warn('Problems reading readline initialization file <%s>' | |
1009 | % inputrc_name) |
|
1009 | % inputrc_name) | |
1010 |
|
1010 | |||
1011 | self.has_readline = 1 |
|
1011 | self.has_readline = 1 | |
1012 | self.readline = readline |
|
1012 | self.readline = readline | |
1013 | # save this in sys so embedded copies can restore it properly |
|
1013 | # save this in sys so embedded copies can restore it properly | |
1014 | sys.ipcompleter = self.Completer.complete |
|
1014 | sys.ipcompleter = self.Completer.complete | |
1015 | readline.set_completer(self.Completer.complete) |
|
1015 | readline.set_completer(self.Completer.complete) | |
1016 |
|
1016 | |||
1017 | # Configure readline according to user's prefs |
|
1017 | # Configure readline according to user's prefs | |
1018 | for rlcommand in self.rc.readline_parse_and_bind: |
|
1018 | for rlcommand in self.rc.readline_parse_and_bind: | |
1019 | readline.parse_and_bind(rlcommand) |
|
1019 | readline.parse_and_bind(rlcommand) | |
1020 |
|
1020 | |||
1021 | # remove some chars from the delimiters list |
|
1021 | # remove some chars from the delimiters list | |
1022 | delims = readline.get_completer_delims() |
|
1022 | delims = readline.get_completer_delims() | |
1023 | delims = delims.translate(string._idmap, |
|
1023 | delims = delims.translate(string._idmap, | |
1024 | self.rc.readline_remove_delims) |
|
1024 | self.rc.readline_remove_delims) | |
1025 | readline.set_completer_delims(delims) |
|
1025 | readline.set_completer_delims(delims) | |
1026 | # otherwise we end up with a monster history after a while: |
|
1026 | # otherwise we end up with a monster history after a while: | |
1027 | readline.set_history_length(1000) |
|
1027 | readline.set_history_length(1000) | |
1028 | try: |
|
1028 | try: | |
1029 | #print '*** Reading readline history' # dbg |
|
1029 | #print '*** Reading readline history' # dbg | |
1030 | readline.read_history_file(self.histfile) |
|
1030 | readline.read_history_file(self.histfile) | |
1031 | except IOError: |
|
1031 | except IOError: | |
1032 | pass # It doesn't exist yet. |
|
1032 | pass # It doesn't exist yet. | |
1033 |
|
1033 | |||
1034 | atexit.register(self.atexit_operations) |
|
1034 | atexit.register(self.atexit_operations) | |
1035 | del atexit |
|
1035 | del atexit | |
1036 |
|
1036 | |||
1037 | # Configure auto-indent for all platforms |
|
1037 | # Configure auto-indent for all platforms | |
1038 | self.set_autoindent(self.rc.autoindent) |
|
1038 | self.set_autoindent(self.rc.autoindent) | |
1039 |
|
1039 | |||
1040 | def _should_recompile(self,e): |
|
1040 | def _should_recompile(self,e): | |
1041 | """Utility routine for edit_syntax_error""" |
|
1041 | """Utility routine for edit_syntax_error""" | |
1042 |
|
1042 | |||
1043 | if e.filename in ('<ipython console>','<input>','<string>', |
|
1043 | if e.filename in ('<ipython console>','<input>','<string>', | |
1044 | '<console>'): |
|
1044 | '<console>'): | |
1045 | return False |
|
1045 | return False | |
1046 | try: |
|
1046 | try: | |
1047 | if not ask_yes_no('Return to editor to correct syntax error? ' |
|
1047 | if not ask_yes_no('Return to editor to correct syntax error? ' | |
1048 | '[Y/n] ','y'): |
|
1048 | '[Y/n] ','y'): | |
1049 | return False |
|
1049 | return False | |
1050 | except EOFError: |
|
1050 | except EOFError: | |
1051 | return False |
|
1051 | return False | |
1052 | self.hooks.fix_error_editor(e.filename,e.lineno,e.offset,e.msg) |
|
1052 | self.hooks.fix_error_editor(e.filename,e.lineno,e.offset,e.msg) | |
1053 | return True |
|
1053 | return True | |
1054 |
|
1054 | |||
1055 | def edit_syntax_error(self): |
|
1055 | def edit_syntax_error(self): | |
1056 | """The bottom half of the syntax error handler called in the main loop. |
|
1056 | """The bottom half of the syntax error handler called in the main loop. | |
1057 |
|
1057 | |||
1058 | Loop until syntax error is fixed or user cancels. |
|
1058 | Loop until syntax error is fixed or user cancels. | |
1059 | """ |
|
1059 | """ | |
1060 |
|
1060 | |||
1061 | while self.SyntaxTB.last_syntax_error: |
|
1061 | while self.SyntaxTB.last_syntax_error: | |
1062 | # copy and clear last_syntax_error |
|
1062 | # copy and clear last_syntax_error | |
1063 | err = self.SyntaxTB.clear_err_state() |
|
1063 | err = self.SyntaxTB.clear_err_state() | |
1064 | if not self._should_recompile(err): |
|
1064 | if not self._should_recompile(err): | |
1065 | return |
|
1065 | return | |
1066 | try: |
|
1066 | try: | |
1067 | # may set last_syntax_error again if a SyntaxError is raised |
|
1067 | # may set last_syntax_error again if a SyntaxError is raised | |
1068 | self.safe_execfile(err.filename,self.shell.user_ns) |
|
1068 | self.safe_execfile(err.filename,self.shell.user_ns) | |
1069 | except: |
|
1069 | except: | |
1070 | self.showtraceback() |
|
1070 | self.showtraceback() | |
1071 | else: |
|
1071 | else: | |
1072 | f = file(err.filename) |
|
1072 | f = file(err.filename) | |
1073 | try: |
|
1073 | try: | |
1074 | sys.displayhook(f.read()) |
|
1074 | sys.displayhook(f.read()) | |
1075 | finally: |
|
1075 | finally: | |
1076 | f.close() |
|
1076 | f.close() | |
1077 |
|
1077 | |||
1078 | def showsyntaxerror(self, filename=None): |
|
1078 | def showsyntaxerror(self, filename=None): | |
1079 | """Display the syntax error that just occurred. |
|
1079 | """Display the syntax error that just occurred. | |
1080 |
|
1080 | |||
1081 | This doesn't display a stack trace because there isn't one. |
|
1081 | This doesn't display a stack trace because there isn't one. | |
1082 |
|
1082 | |||
1083 | If a filename is given, it is stuffed in the exception instead |
|
1083 | If a filename is given, it is stuffed in the exception instead | |
1084 | of what was there before (because Python's parser always uses |
|
1084 | of what was there before (because Python's parser always uses | |
1085 | "<string>" when reading from a string). |
|
1085 | "<string>" when reading from a string). | |
1086 | """ |
|
1086 | """ | |
1087 | type, value, sys.last_traceback = sys.exc_info() |
|
1087 | type, value, sys.last_traceback = sys.exc_info() | |
1088 | sys.last_type = type |
|
1088 | sys.last_type = type | |
1089 | sys.last_value = value |
|
1089 | sys.last_value = value | |
1090 | if filename and type is SyntaxError: |
|
1090 | if filename and type is SyntaxError: | |
1091 | # Work hard to stuff the correct filename in the exception |
|
1091 | # Work hard to stuff the correct filename in the exception | |
1092 | try: |
|
1092 | try: | |
1093 | msg, (dummy_filename, lineno, offset, line) = value |
|
1093 | msg, (dummy_filename, lineno, offset, line) = value | |
1094 | except: |
|
1094 | except: | |
1095 | # Not the format we expect; leave it alone |
|
1095 | # Not the format we expect; leave it alone | |
1096 | pass |
|
1096 | pass | |
1097 | else: |
|
1097 | else: | |
1098 | # Stuff in the right filename |
|
1098 | # Stuff in the right filename | |
1099 | try: |
|
1099 | try: | |
1100 | # Assume SyntaxError is a class exception |
|
1100 | # Assume SyntaxError is a class exception | |
1101 | value = SyntaxError(msg, (filename, lineno, offset, line)) |
|
1101 | value = SyntaxError(msg, (filename, lineno, offset, line)) | |
1102 | except: |
|
1102 | except: | |
1103 | # If that failed, assume SyntaxError is a string |
|
1103 | # If that failed, assume SyntaxError is a string | |
1104 | value = msg, (filename, lineno, offset, line) |
|
1104 | value = msg, (filename, lineno, offset, line) | |
1105 | self.SyntaxTB(type,value,[]) |
|
1105 | self.SyntaxTB(type,value,[]) | |
1106 |
|
1106 | |||
1107 | def debugger(self): |
|
1107 | def debugger(self): | |
1108 | """Call the pdb debugger.""" |
|
1108 | """Call the pdb debugger.""" | |
1109 |
|
1109 | |||
1110 | if not self.rc.pdb: |
|
1110 | if not self.rc.pdb: | |
1111 | return |
|
1111 | return | |
1112 | pdb.pm() |
|
1112 | pdb.pm() | |
1113 |
|
1113 | |||
1114 | def showtraceback(self,exc_tuple = None,filename=None): |
|
1114 | def showtraceback(self,exc_tuple = None,filename=None): | |
1115 | """Display the exception that just occurred.""" |
|
1115 | """Display the exception that just occurred.""" | |
1116 |
|
1116 | |||
1117 | # Though this won't be called by syntax errors in the input line, |
|
1117 | # Though this won't be called by syntax errors in the input line, | |
1118 | # there may be SyntaxError cases whith imported code. |
|
1118 | # there may be SyntaxError cases whith imported code. | |
1119 | if exc_tuple is None: |
|
1119 | if exc_tuple is None: | |
1120 | type, value, tb = sys.exc_info() |
|
1120 | type, value, tb = sys.exc_info() | |
1121 | else: |
|
1121 | else: | |
1122 | type, value, tb = exc_tuple |
|
1122 | type, value, tb = exc_tuple | |
1123 | if type is SyntaxError: |
|
1123 | if type is SyntaxError: | |
1124 | self.showsyntaxerror(filename) |
|
1124 | self.showsyntaxerror(filename) | |
1125 | else: |
|
1125 | else: | |
1126 | sys.last_type = type |
|
1126 | sys.last_type = type | |
1127 | sys.last_value = value |
|
1127 | sys.last_value = value | |
1128 | sys.last_traceback = tb |
|
1128 | sys.last_traceback = tb | |
1129 | self.InteractiveTB() |
|
1129 | self.InteractiveTB() | |
1130 | if self.InteractiveTB.call_pdb and self.has_readline: |
|
1130 | if self.InteractiveTB.call_pdb and self.has_readline: | |
1131 | # pdb mucks up readline, fix it back |
|
1131 | # pdb mucks up readline, fix it back | |
1132 | self.readline.set_completer(self.Completer.complete) |
|
1132 | self.readline.set_completer(self.Completer.complete) | |
1133 |
|
1133 | |||
1134 | def update_cache(self, line): |
|
1134 | def update_cache(self, line): | |
1135 | """puts line into cache""" |
|
1135 | """puts line into cache""" | |
1136 | self.inputcache.insert(0, line) # This copies the cache every time ... :-( |
|
1136 | self.inputcache.insert(0, line) # This copies the cache every time ... :-( | |
1137 | if len(self.inputcache) >= self.CACHELENGTH: |
|
1137 | if len(self.inputcache) >= self.CACHELENGTH: | |
1138 | self.inputcache.pop() # This doesn't :-) |
|
1138 | self.inputcache.pop() # This doesn't :-) | |
1139 |
|
1139 | |||
1140 | def mainloop(self,banner=None): |
|
1140 | def mainloop(self,banner=None): | |
1141 | """Creates the local namespace and starts the mainloop. |
|
1141 | """Creates the local namespace and starts the mainloop. | |
1142 |
|
1142 | |||
1143 | If an optional banner argument is given, it will override the |
|
1143 | If an optional banner argument is given, it will override the | |
1144 | internally created default banner.""" |
|
1144 | internally created default banner.""" | |
1145 |
|
1145 | |||
1146 | if self.rc.c: # Emulate Python's -c option |
|
1146 | if self.rc.c: # Emulate Python's -c option | |
1147 | self.exec_init_cmd() |
|
1147 | self.exec_init_cmd() | |
1148 | if banner is None: |
|
1148 | if banner is None: | |
1149 | if self.rc.banner: |
|
1149 | if self.rc.banner: | |
1150 | banner = self.BANNER+self.banner2 |
|
1150 | banner = self.BANNER+self.banner2 | |
1151 | else: |
|
1151 | else: | |
1152 | banner = '' |
|
1152 | banner = '' | |
1153 | self.interact(banner) |
|
1153 | self.interact(banner) | |
1154 |
|
1154 | |||
1155 | def exec_init_cmd(self): |
|
1155 | def exec_init_cmd(self): | |
1156 | """Execute a command given at the command line. |
|
1156 | """Execute a command given at the command line. | |
1157 |
|
1157 | |||
1158 | This emulates Python's -c option.""" |
|
1158 | This emulates Python's -c option.""" | |
1159 |
|
1159 | |||
1160 | sys.argv = ['-c'] |
|
1160 | sys.argv = ['-c'] | |
1161 | self.push(self.rc.c) |
|
1161 | self.push(self.rc.c) | |
1162 |
|
1162 | |||
1163 | def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): |
|
1163 | def embed_mainloop(self,header='',local_ns=None,global_ns=None,stack_depth=0): | |
1164 | """Embeds IPython into a running python program. |
|
1164 | """Embeds IPython into a running python program. | |
1165 |
|
1165 | |||
1166 | Input: |
|
1166 | Input: | |
1167 |
|
1167 | |||
1168 | - header: An optional header message can be specified. |
|
1168 | - header: An optional header message can be specified. | |
1169 |
|
1169 | |||
1170 | - local_ns, global_ns: working namespaces. If given as None, the |
|
1170 | - local_ns, global_ns: working namespaces. If given as None, the | |
1171 | IPython-initialized one is updated with __main__.__dict__, so that |
|
1171 | IPython-initialized one is updated with __main__.__dict__, so that | |
1172 | program variables become visible but user-specific configuration |
|
1172 | program variables become visible but user-specific configuration | |
1173 | remains possible. |
|
1173 | remains possible. | |
1174 |
|
1174 | |||
1175 | - stack_depth: specifies how many levels in the stack to go to |
|
1175 | - stack_depth: specifies how many levels in the stack to go to | |
1176 | looking for namespaces (when local_ns and global_ns are None). This |
|
1176 | looking for namespaces (when local_ns and global_ns are None). This | |
1177 | allows an intermediate caller to make sure that this function gets |
|
1177 | allows an intermediate caller to make sure that this function gets | |
1178 | the namespace from the intended level in the stack. By default (0) |
|
1178 | the namespace from the intended level in the stack. By default (0) | |
1179 | it will get its locals and globals from the immediate caller. |
|
1179 | it will get its locals and globals from the immediate caller. | |
1180 |
|
1180 | |||
1181 | Warning: it's possible to use this in a program which is being run by |
|
1181 | Warning: it's possible to use this in a program which is being run by | |
1182 | IPython itself (via %run), but some funny things will happen (a few |
|
1182 | IPython itself (via %run), but some funny things will happen (a few | |
1183 | globals get overwritten). In the future this will be cleaned up, as |
|
1183 | globals get overwritten). In the future this will be cleaned up, as | |
1184 | there is no fundamental reason why it can't work perfectly.""" |
|
1184 | there is no fundamental reason why it can't work perfectly.""" | |
1185 |
|
1185 | |||
1186 | # Get locals and globals from caller |
|
1186 | # Get locals and globals from caller | |
1187 | if local_ns is None or global_ns is None: |
|
1187 | if local_ns is None or global_ns is None: | |
1188 | call_frame = sys._getframe(stack_depth).f_back |
|
1188 | call_frame = sys._getframe(stack_depth).f_back | |
1189 |
|
1189 | |||
1190 | if local_ns is None: |
|
1190 | if local_ns is None: | |
1191 | local_ns = call_frame.f_locals |
|
1191 | local_ns = call_frame.f_locals | |
1192 | if global_ns is None: |
|
1192 | if global_ns is None: | |
1193 | global_ns = call_frame.f_globals |
|
1193 | global_ns = call_frame.f_globals | |
1194 |
|
1194 | |||
1195 | # Update namespaces and fire up interpreter |
|
1195 | # Update namespaces and fire up interpreter | |
1196 | self.user_ns = local_ns |
|
1196 | self.user_ns = local_ns | |
1197 | self.user_global_ns = global_ns |
|
1197 | self.user_global_ns = global_ns | |
1198 |
|
1198 | |||
1199 | # Patch for global embedding to make sure that things don't overwrite |
|
1199 | # Patch for global embedding to make sure that things don't overwrite | |
1200 | # user globals accidentally. Thanks to Richard <rxe@renre-europe.com> |
|
1200 | # user globals accidentally. Thanks to Richard <rxe@renre-europe.com> | |
1201 | # FIXME. Test this a bit more carefully (the if.. is new) |
|
1201 | # FIXME. Test this a bit more carefully (the if.. is new) | |
1202 | if local_ns is None and global_ns is None: |
|
1202 | if local_ns is None and global_ns is None: | |
1203 | self.user_global_ns.update(__main__.__dict__) |
|
1203 | self.user_global_ns.update(__main__.__dict__) | |
1204 |
|
1204 | |||
1205 | # make sure the tab-completer has the correct frame information, so it |
|
1205 | # make sure the tab-completer has the correct frame information, so it | |
1206 | # actually completes using the frame's locals/globals |
|
1206 | # actually completes using the frame's locals/globals | |
1207 | self.set_completer_frame(call_frame) |
|
1207 | self.set_completer_frame(call_frame) | |
1208 |
|
1208 | |||
1209 | self.interact(header) |
|
1209 | self.interact(header) | |
1210 |
|
1210 | |||
1211 | def interact(self, banner=None): |
|
1211 | def interact(self, banner=None): | |
1212 | """Closely emulate the interactive Python console. |
|
1212 | """Closely emulate the interactive Python console. | |
1213 |
|
1213 | |||
1214 | The optional banner argument specify the banner to print |
|
1214 | The optional banner argument specify the banner to print | |
1215 | before the first interaction; by default it prints a banner |
|
1215 | before the first interaction; by default it prints a banner | |
1216 | similar to the one printed by the real Python interpreter, |
|
1216 | similar to the one printed by the real Python interpreter, | |
1217 | followed by the current class name in parentheses (so as not |
|
1217 | followed by the current class name in parentheses (so as not | |
1218 | to confuse this with the real interpreter -- since it's so |
|
1218 | to confuse this with the real interpreter -- since it's so | |
1219 | close!). |
|
1219 | close!). | |
1220 |
|
1220 | |||
1221 | """ |
|
1221 | """ | |
1222 | cprt = 'Type "copyright", "credits" or "license" for more information.' |
|
1222 | cprt = 'Type "copyright", "credits" or "license" for more information.' | |
1223 | if banner is None: |
|
1223 | if banner is None: | |
1224 | self.write("Python %s on %s\n%s\n(%s)\n" % |
|
1224 | self.write("Python %s on %s\n%s\n(%s)\n" % | |
1225 | (sys.version, sys.platform, cprt, |
|
1225 | (sys.version, sys.platform, cprt, | |
1226 | self.__class__.__name__)) |
|
1226 | self.__class__.__name__)) | |
1227 | else: |
|
1227 | else: | |
1228 | self.write(banner) |
|
1228 | self.write(banner) | |
1229 |
|
1229 | |||
1230 | more = 0 |
|
1230 | more = 0 | |
1231 |
|
1231 | |||
1232 | # Mark activity in the builtins |
|
1232 | # Mark activity in the builtins | |
1233 | __builtin__.__dict__['__IPYTHON__active'] += 1 |
|
1233 | __builtin__.__dict__['__IPYTHON__active'] += 1 | |
1234 |
|
1234 | |||
1235 | # compiled regexps for autoindent management |
|
1235 | # compiled regexps for autoindent management | |
1236 | ini_spaces_re = re.compile(r'^(\s+)') |
|
1236 | ini_spaces_re = re.compile(r'^(\s+)') | |
1237 | dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass') |
|
1237 | dedent_re = re.compile(r'^\s+raise|^\s+return|^\s+pass') | |
1238 |
|
1238 | |||
1239 | # exit_now is set by a call to %Exit or %Quit |
|
1239 | # exit_now is set by a call to %Exit or %Quit | |
1240 | while not self.exit_now: |
|
1240 | while not self.exit_now: | |
1241 | try: |
|
1241 | try: | |
1242 | if more: |
|
1242 | if more: | |
1243 | prompt = self.outputcache.prompt2 |
|
1243 | prompt = self.outputcache.prompt2 | |
1244 | if self.autoindent: |
|
1244 | if self.autoindent: | |
1245 | self.readline_startup_hook(self.pre_readline) |
|
1245 | self.readline_startup_hook(self.pre_readline) | |
1246 | else: |
|
1246 | else: | |
1247 | prompt = self.outputcache.prompt1 |
|
1247 | prompt = self.outputcache.prompt1 | |
1248 | try: |
|
1248 | try: | |
1249 | line = self.raw_input(prompt,more) |
|
1249 | line = self.raw_input(prompt,more) | |
1250 | if self.autoindent: |
|
1250 | if self.autoindent: | |
1251 | self.readline_startup_hook(None) |
|
1251 | self.readline_startup_hook(None) | |
1252 | except EOFError: |
|
1252 | except EOFError: | |
1253 | if self.autoindent: |
|
1253 | if self.autoindent: | |
1254 | self.readline_startup_hook(None) |
|
1254 | self.readline_startup_hook(None) | |
1255 | self.write("\n") |
|
1255 | self.write("\n") | |
1256 | self.exit() |
|
1256 | self.exit() | |
1257 | else: |
|
1257 | else: | |
1258 | more = self.push(line) |
|
1258 | more = self.push(line) | |
1259 | # Auto-indent management |
|
1259 | # Auto-indent management | |
1260 | if self.autoindent: |
|
1260 | if self.autoindent: | |
1261 | if line: |
|
1261 | if line: | |
1262 | ini_spaces = ini_spaces_re.match(line) |
|
1262 | ini_spaces = ini_spaces_re.match(line) | |
1263 | if ini_spaces: |
|
1263 | if ini_spaces: | |
1264 | nspaces = ini_spaces.end() |
|
1264 | nspaces = ini_spaces.end() | |
1265 | else: |
|
1265 | else: | |
1266 | nspaces = 0 |
|
1266 | nspaces = 0 | |
1267 | self.indent_current_nsp = nspaces |
|
1267 | self.indent_current_nsp = nspaces | |
1268 |
|
1268 | |||
1269 | if line[-1] == ':': |
|
1269 | if line[-1] == ':': | |
1270 | self.indent_current_nsp += 4 |
|
1270 | self.indent_current_nsp += 4 | |
1271 | elif dedent_re.match(line): |
|
1271 | elif dedent_re.match(line): | |
1272 | self.indent_current_nsp -= 4 |
|
1272 | self.indent_current_nsp -= 4 | |
1273 | else: |
|
1273 | else: | |
1274 | self.indent_current_nsp = 0 |
|
1274 | self.indent_current_nsp = 0 | |
1275 |
|
1275 | |||
1276 | # indent_current is the actual string to be inserted |
|
1276 | # indent_current is the actual string to be inserted | |
1277 | # by the readline hooks for indentation |
|
1277 | # by the readline hooks for indentation | |
1278 | self.indent_current = ' '* self.indent_current_nsp |
|
1278 | self.indent_current = ' '* self.indent_current_nsp | |
1279 |
|
1279 | |||
1280 | if (self.SyntaxTB.last_syntax_error and |
|
1280 | if (self.SyntaxTB.last_syntax_error and | |
1281 | self.rc.autoedit_syntax): |
|
1281 | self.rc.autoedit_syntax): | |
1282 | self.edit_syntax_error() |
|
1282 | self.edit_syntax_error() | |
1283 |
|
1283 | |||
1284 | except KeyboardInterrupt: |
|
1284 | except KeyboardInterrupt: | |
1285 | self.write("\nKeyboardInterrupt\n") |
|
1285 | self.write("\nKeyboardInterrupt\n") | |
1286 | self.resetbuffer() |
|
1286 | self.resetbuffer() | |
1287 | more = 0 |
|
1287 | more = 0 | |
1288 | # keep cache in sync with the prompt counter: |
|
1288 | # keep cache in sync with the prompt counter: | |
1289 | self.outputcache.prompt_count -= 1 |
|
1289 | self.outputcache.prompt_count -= 1 | |
1290 |
|
1290 | |||
1291 | if self.autoindent: |
|
1291 | if self.autoindent: | |
1292 | self.indent_current_nsp = 0 |
|
1292 | self.indent_current_nsp = 0 | |
1293 | self.indent_current = ' '* self.indent_current_nsp |
|
1293 | self.indent_current = ' '* self.indent_current_nsp | |
1294 |
|
1294 | |||
1295 | except bdb.BdbQuit: |
|
1295 | except bdb.BdbQuit: | |
1296 | warn("The Python debugger has exited with a BdbQuit exception.\n" |
|
1296 | warn("The Python debugger has exited with a BdbQuit exception.\n" | |
1297 | "Because of how pdb handles the stack, it is impossible\n" |
|
1297 | "Because of how pdb handles the stack, it is impossible\n" | |
1298 | "for IPython to properly format this particular exception.\n" |
|
1298 | "for IPython to properly format this particular exception.\n" | |
1299 | "IPython will resume normal operation.") |
|
1299 | "IPython will resume normal operation.") | |
1300 |
|
1300 | |||
1301 | # We are off again... |
|
1301 | # We are off again... | |
1302 | __builtin__.__dict__['__IPYTHON__active'] -= 1 |
|
1302 | __builtin__.__dict__['__IPYTHON__active'] -= 1 | |
1303 |
|
1303 | |||
1304 | def excepthook(self, type, value, tb): |
|
1304 | def excepthook(self, type, value, tb): | |
1305 | """One more defense for GUI apps that call sys.excepthook. |
|
1305 | """One more defense for GUI apps that call sys.excepthook. | |
1306 |
|
1306 | |||
1307 | GUI frameworks like wxPython trap exceptions and call |
|
1307 | GUI frameworks like wxPython trap exceptions and call | |
1308 | sys.excepthook themselves. I guess this is a feature that |
|
1308 | sys.excepthook themselves. I guess this is a feature that | |
1309 | enables them to keep running after exceptions that would |
|
1309 | enables them to keep running after exceptions that would | |
1310 | otherwise kill their mainloop. This is a bother for IPython |
|
1310 | otherwise kill their mainloop. This is a bother for IPython | |
1311 | which excepts to catch all of the program exceptions with a try: |
|
1311 | which excepts to catch all of the program exceptions with a try: | |
1312 | except: statement. |
|
1312 | except: statement. | |
1313 |
|
1313 | |||
1314 | Normally, IPython sets sys.excepthook to a CrashHandler instance, so if |
|
1314 | Normally, IPython sets sys.excepthook to a CrashHandler instance, so if | |
1315 | any app directly invokes sys.excepthook, it will look to the user like |
|
1315 | any app directly invokes sys.excepthook, it will look to the user like | |
1316 | IPython crashed. In order to work around this, we can disable the |
|
1316 | IPython crashed. In order to work around this, we can disable the | |
1317 | CrashHandler and replace it with this excepthook instead, which prints a |
|
1317 | CrashHandler and replace it with this excepthook instead, which prints a | |
1318 | regular traceback using our InteractiveTB. In this fashion, apps which |
|
1318 | regular traceback using our InteractiveTB. In this fashion, apps which | |
1319 | call sys.excepthook will generate a regular-looking exception from |
|
1319 | call sys.excepthook will generate a regular-looking exception from | |
1320 | IPython, and the CrashHandler will only be triggered by real IPython |
|
1320 | IPython, and the CrashHandler will only be triggered by real IPython | |
1321 | crashes. |
|
1321 | crashes. | |
1322 |
|
1322 | |||
1323 | This hook should be used sparingly, only in places which are not likely |
|
1323 | This hook should be used sparingly, only in places which are not likely | |
1324 | to be true IPython errors. |
|
1324 | to be true IPython errors. | |
1325 | """ |
|
1325 | """ | |
1326 |
|
1326 | |||
1327 | self.InteractiveTB(type, value, tb, tb_offset=0) |
|
1327 | self.InteractiveTB(type, value, tb, tb_offset=0) | |
1328 | if self.InteractiveTB.call_pdb and self.has_readline: |
|
1328 | if self.InteractiveTB.call_pdb and self.has_readline: | |
1329 | self.readline.set_completer(self.Completer.complete) |
|
1329 | self.readline.set_completer(self.Completer.complete) | |
1330 |
|
1330 | |||
1331 | def call_alias(self,alias,rest=''): |
|
1331 | def call_alias(self,alias,rest=''): | |
1332 | """Call an alias given its name and the rest of the line. |
|
1332 | """Call an alias given its name and the rest of the line. | |
1333 |
|
1333 | |||
1334 | This function MUST be given a proper alias, because it doesn't make |
|
1334 | This function MUST be given a proper alias, because it doesn't make | |
1335 | any checks when looking up into the alias table. The caller is |
|
1335 | any checks when looking up into the alias table. The caller is | |
1336 | responsible for invoking it only with a valid alias.""" |
|
1336 | responsible for invoking it only with a valid alias.""" | |
1337 |
|
1337 | |||
1338 | #print 'ALIAS: <%s>+<%s>' % (alias,rest) # dbg |
|
1338 | #print 'ALIAS: <%s>+<%s>' % (alias,rest) # dbg | |
1339 | nargs,cmd = self.alias_table[alias] |
|
1339 | nargs,cmd = self.alias_table[alias] | |
1340 | # Expand the %l special to be the user's input line |
|
1340 | # Expand the %l special to be the user's input line | |
1341 | if cmd.find('%l') >= 0: |
|
1341 | if cmd.find('%l') >= 0: | |
1342 | cmd = cmd.replace('%l',rest) |
|
1342 | cmd = cmd.replace('%l',rest) | |
1343 | rest = '' |
|
1343 | rest = '' | |
1344 | if nargs==0: |
|
1344 | if nargs==0: | |
1345 | # Simple, argument-less aliases |
|
1345 | # Simple, argument-less aliases | |
1346 | cmd = '%s %s' % (cmd,rest) |
|
1346 | cmd = '%s %s' % (cmd,rest) | |
1347 | else: |
|
1347 | else: | |
1348 | # Handle aliases with positional arguments |
|
1348 | # Handle aliases with positional arguments | |
1349 | args = rest.split(None,nargs) |
|
1349 | args = rest.split(None,nargs) | |
1350 | if len(args)< nargs: |
|
1350 | if len(args)< nargs: | |
1351 | error('Alias <%s> requires %s arguments, %s given.' % |
|
1351 | error('Alias <%s> requires %s arguments, %s given.' % | |
1352 | (alias,nargs,len(args))) |
|
1352 | (alias,nargs,len(args))) | |
1353 | return |
|
1353 | return | |
1354 | cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:])) |
|
1354 | cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:])) | |
1355 | # Now call the macro, evaluating in the user's namespace |
|
1355 | # Now call the macro, evaluating in the user's namespace | |
1356 | try: |
|
1356 | try: | |
1357 | self.system(cmd) |
|
1357 | self.system(cmd) | |
1358 | except: |
|
1358 | except: | |
1359 | self.showtraceback() |
|
1359 | self.showtraceback() | |
1360 |
|
1360 | |||
1361 | def runlines(self,lines): |
|
1361 | def runlines(self,lines): | |
1362 | """Run a string of one or more lines of source. |
|
1362 | """Run a string of one or more lines of source. | |
1363 |
|
1363 | |||
1364 | This method is capable of running a string containing multiple source |
|
1364 | This method is capable of running a string containing multiple source | |
1365 | lines, as if they had been entered at the IPython prompt. Since it |
|
1365 | lines, as if they had been entered at the IPython prompt. Since it | |
1366 | exposes IPython's processing machinery, the given strings can contain |
|
1366 | exposes IPython's processing machinery, the given strings can contain | |
1367 | magic calls (%magic), special shell access (!cmd), etc.""" |
|
1367 | magic calls (%magic), special shell access (!cmd), etc.""" | |
1368 |
|
1368 | |||
1369 | # We must start with a clean buffer, in case this is run from an |
|
1369 | # We must start with a clean buffer, in case this is run from an | |
1370 | # interactive IPython session (via a magic, for example). |
|
1370 | # interactive IPython session (via a magic, for example). | |
1371 | self.resetbuffer() |
|
1371 | self.resetbuffer() | |
1372 | lines = lines.split('\n') |
|
1372 | lines = lines.split('\n') | |
1373 | more = 0 |
|
1373 | more = 0 | |
1374 | for line in lines: |
|
1374 | for line in lines: | |
1375 | # skip blank lines so we don't mess up the prompt counter, but do |
|
1375 | # skip blank lines so we don't mess up the prompt counter, but do | |
1376 | # NOT skip even a blank line if we are in a code block (more is |
|
1376 | # NOT skip even a blank line if we are in a code block (more is | |
1377 | # true) |
|
1377 | # true) | |
1378 | if line or more: |
|
1378 | if line or more: | |
1379 | more = self.push((self.prefilter(line,more))) |
|
1379 | more = self.push((self.prefilter(line,more))) | |
1380 | # IPython's runsource returns None if there was an error |
|
1380 | # IPython's runsource returns None if there was an error | |
1381 | # compiling the code. This allows us to stop processing right |
|
1381 | # compiling the code. This allows us to stop processing right | |
1382 | # away, so the user gets the error message at the right place. |
|
1382 | # away, so the user gets the error message at the right place. | |
1383 | if more is None: |
|
1383 | if more is None: | |
1384 | break |
|
1384 | break | |
1385 | # final newline in case the input didn't have it, so that the code |
|
1385 | # final newline in case the input didn't have it, so that the code | |
1386 | # actually does get executed |
|
1386 | # actually does get executed | |
1387 | if more: |
|
1387 | if more: | |
1388 | self.push('\n') |
|
1388 | self.push('\n') | |
1389 |
|
1389 | |||
1390 | def runsource(self, source, filename='<input>', symbol='single'): |
|
1390 | def runsource(self, source, filename='<input>', symbol='single'): | |
1391 | """Compile and run some source in the interpreter. |
|
1391 | """Compile and run some source in the interpreter. | |
1392 |
|
1392 | |||
1393 | Arguments are as for compile_command(). |
|
1393 | Arguments are as for compile_command(). | |
1394 |
|
1394 | |||
1395 | One several things can happen: |
|
1395 | One several things can happen: | |
1396 |
|
1396 | |||
1397 | 1) The input is incorrect; compile_command() raised an |
|
1397 | 1) The input is incorrect; compile_command() raised an | |
1398 | exception (SyntaxError or OverflowError). A syntax traceback |
|
1398 | exception (SyntaxError or OverflowError). A syntax traceback | |
1399 | will be printed by calling the showsyntaxerror() method. |
|
1399 | will be printed by calling the showsyntaxerror() method. | |
1400 |
|
1400 | |||
1401 | 2) The input is incomplete, and more input is required; |
|
1401 | 2) The input is incomplete, and more input is required; | |
1402 | compile_command() returned None. Nothing happens. |
|
1402 | compile_command() returned None. Nothing happens. | |
1403 |
|
1403 | |||
1404 | 3) The input is complete; compile_command() returned a code |
|
1404 | 3) The input is complete; compile_command() returned a code | |
1405 | object. The code is executed by calling self.runcode() (which |
|
1405 | object. The code is executed by calling self.runcode() (which | |
1406 | also handles run-time exceptions, except for SystemExit). |
|
1406 | also handles run-time exceptions, except for SystemExit). | |
1407 |
|
1407 | |||
1408 | The return value is: |
|
1408 | The return value is: | |
1409 |
|
1409 | |||
1410 | - True in case 2 |
|
1410 | - True in case 2 | |
1411 |
|
1411 | |||
1412 | - False in the other cases, unless an exception is raised, where |
|
1412 | - False in the other cases, unless an exception is raised, where | |
1413 | None is returned instead. This can be used by external callers to |
|
1413 | None is returned instead. This can be used by external callers to | |
1414 | know whether to continue feeding input or not. |
|
1414 | know whether to continue feeding input or not. | |
1415 |
|
1415 | |||
1416 | The return value can be used to decide whether to use sys.ps1 or |
|
1416 | The return value can be used to decide whether to use sys.ps1 or | |
1417 | sys.ps2 to prompt the next line.""" |
|
1417 | sys.ps2 to prompt the next line.""" | |
1418 |
|
1418 | |||
1419 | try: |
|
1419 | try: | |
1420 | code = self.compile(source,filename,symbol) |
|
1420 | code = self.compile(source,filename,symbol) | |
1421 | except (OverflowError, SyntaxError, ValueError): |
|
1421 | except (OverflowError, SyntaxError, ValueError): | |
1422 | # Case 1 |
|
1422 | # Case 1 | |
1423 | self.showsyntaxerror(filename) |
|
1423 | self.showsyntaxerror(filename) | |
1424 | return None |
|
1424 | return None | |
1425 |
|
1425 | |||
1426 | if code is None: |
|
1426 | if code is None: | |
1427 | # Case 2 |
|
1427 | # Case 2 | |
1428 | return True |
|
1428 | return True | |
1429 |
|
1429 | |||
1430 | # Case 3 |
|
1430 | # Case 3 | |
1431 | # We store the code object so that threaded shells and |
|
1431 | # We store the code object so that threaded shells and | |
1432 | # custom exception handlers can access all this info if needed. |
|
1432 | # custom exception handlers can access all this info if needed. | |
1433 | # The source corresponding to this can be obtained from the |
|
1433 | # The source corresponding to this can be obtained from the | |
1434 | # buffer attribute as '\n'.join(self.buffer). |
|
1434 | # buffer attribute as '\n'.join(self.buffer). | |
1435 | self.code_to_run = code |
|
1435 | self.code_to_run = code | |
1436 | # now actually execute the code object |
|
1436 | # now actually execute the code object | |
1437 | if self.runcode(code) == 0: |
|
1437 | if self.runcode(code) == 0: | |
1438 | return False |
|
1438 | return False | |
1439 | else: |
|
1439 | else: | |
1440 | return None |
|
1440 | return None | |
1441 |
|
1441 | |||
1442 | def runcode(self,code_obj): |
|
1442 | def runcode(self,code_obj): | |
1443 | """Execute a code object. |
|
1443 | """Execute a code object. | |
1444 |
|
1444 | |||
1445 | When an exception occurs, self.showtraceback() is called to display a |
|
1445 | When an exception occurs, self.showtraceback() is called to display a | |
1446 | traceback. |
|
1446 | traceback. | |
1447 |
|
1447 | |||
1448 | Return value: a flag indicating whether the code to be run completed |
|
1448 | Return value: a flag indicating whether the code to be run completed | |
1449 | successfully: |
|
1449 | successfully: | |
1450 |
|
1450 | |||
1451 | - 0: successful execution. |
|
1451 | - 0: successful execution. | |
1452 | - 1: an error occurred. |
|
1452 | - 1: an error occurred. | |
1453 | """ |
|
1453 | """ | |
1454 |
|
1454 | |||
1455 | # Set our own excepthook in case the user code tries to call it |
|
1455 | # Set our own excepthook in case the user code tries to call it | |
1456 | # directly, so that the IPython crash handler doesn't get triggered |
|
1456 | # directly, so that the IPython crash handler doesn't get triggered | |
1457 | old_excepthook,sys.excepthook = sys.excepthook, self.excepthook |
|
1457 | old_excepthook,sys.excepthook = sys.excepthook, self.excepthook | |
1458 | outflag = 1 # happens in more places, so it's easier as default |
|
1458 | outflag = 1 # happens in more places, so it's easier as default | |
1459 | try: |
|
1459 | try: | |
1460 | try: |
|
1460 | try: | |
1461 | # Embedded instances require separate global/local namespaces |
|
1461 | # Embedded instances require separate global/local namespaces | |
1462 | # so they can see both the surrounding (local) namespace and |
|
1462 | # so they can see both the surrounding (local) namespace and | |
1463 | # the module-level globals when called inside another function. |
|
1463 | # the module-level globals when called inside another function. | |
1464 | if self.embedded: |
|
1464 | if self.embedded: | |
1465 | exec code_obj in self.user_global_ns, self.user_ns |
|
1465 | exec code_obj in self.user_global_ns, self.user_ns | |
1466 | # Normal (non-embedded) instances should only have a single |
|
1466 | # Normal (non-embedded) instances should only have a single | |
1467 | # namespace for user code execution, otherwise functions won't |
|
1467 | # namespace for user code execution, otherwise functions won't | |
1468 | # see interactive top-level globals. |
|
1468 | # see interactive top-level globals. | |
1469 | else: |
|
1469 | else: | |
1470 | exec code_obj in self.user_ns |
|
1470 | exec code_obj in self.user_ns | |
1471 | finally: |
|
1471 | finally: | |
1472 | # Reset our crash handler in place |
|
1472 | # Reset our crash handler in place | |
1473 | sys.excepthook = old_excepthook |
|
1473 | sys.excepthook = old_excepthook | |
1474 | except SystemExit: |
|
1474 | except SystemExit: | |
1475 | self.resetbuffer() |
|
1475 | self.resetbuffer() | |
1476 | self.showtraceback() |
|
1476 | self.showtraceback() | |
1477 | warn("Type exit or quit to exit IPython " |
|
1477 | warn("Type exit or quit to exit IPython " | |
1478 | "(%Exit or %Quit do so unconditionally).",level=1) |
|
1478 | "(%Exit or %Quit do so unconditionally).",level=1) | |
1479 | except self.custom_exceptions: |
|
1479 | except self.custom_exceptions: | |
1480 | etype,value,tb = sys.exc_info() |
|
1480 | etype,value,tb = sys.exc_info() | |
1481 | self.CustomTB(etype,value,tb) |
|
1481 | self.CustomTB(etype,value,tb) | |
1482 | except: |
|
1482 | except: | |
1483 | self.showtraceback() |
|
1483 | self.showtraceback() | |
1484 | else: |
|
1484 | else: | |
1485 | outflag = 0 |
|
1485 | outflag = 0 | |
1486 | if softspace(sys.stdout, 0): |
|
1486 | if softspace(sys.stdout, 0): | |
1487 |
|
1487 | |||
1488 | # Flush out code object which has been run (and source) |
|
1488 | # Flush out code object which has been run (and source) | |
1489 | self.code_to_run = None |
|
1489 | self.code_to_run = None | |
1490 | return outflag |
|
1490 | return outflag | |
1491 |
|
1491 | |||
1492 | def push(self, line): |
|
1492 | def push(self, line): | |
1493 | """Push a line to the interpreter. |
|
1493 | """Push a line to the interpreter. | |
1494 |
|
1494 | |||
1495 | The line should not have a trailing newline; it may have |
|
1495 | The line should not have a trailing newline; it may have | |
1496 | internal newlines. The line is appended to a buffer and the |
|
1496 | internal newlines. The line is appended to a buffer and the | |
1497 | interpreter's runsource() method is called with the |
|
1497 | interpreter's runsource() method is called with the | |
1498 | concatenated contents of the buffer as source. If this |
|
1498 | concatenated contents of the buffer as source. If this | |
1499 | indicates that the command was executed or invalid, the buffer |
|
1499 | indicates that the command was executed or invalid, the buffer | |
1500 | is reset; otherwise, the command is incomplete, and the buffer |
|
1500 | is reset; otherwise, the command is incomplete, and the buffer | |
1501 | is left as it was after the line was appended. The return |
|
1501 | is left as it was after the line was appended. The return | |
1502 | value is 1 if more input is required, 0 if the line was dealt |
|
1502 | value is 1 if more input is required, 0 if the line was dealt | |
1503 | with in some way (this is the same as runsource()). |
|
1503 | with in some way (this is the same as runsource()). | |
1504 |
|
1504 | |||
1505 | """ |
|
1505 | """ | |
1506 | self.buffer.append(line) |
|
1506 | self.buffer.append(line) | |
1507 | more = self.runsource('\n'.join(self.buffer), self.filename) |
|
1507 | more = self.runsource('\n'.join(self.buffer), self.filename) | |
1508 | if not more: |
|
1508 | if not more: | |
1509 | self.resetbuffer() |
|
1509 | self.resetbuffer() | |
1510 | return more |
|
1510 | return more | |
1511 |
|
1511 | |||
1512 | def resetbuffer(self): |
|
1512 | def resetbuffer(self): | |
1513 | """Reset the input buffer.""" |
|
1513 | """Reset the input buffer.""" | |
1514 | self.buffer[:] = [] |
|
1514 | self.buffer[:] = [] | |
1515 |
|
1515 | |||
1516 | def raw_input(self,prompt='',continue_prompt=False): |
|
1516 | def raw_input(self,prompt='',continue_prompt=False): | |
1517 | """Write a prompt and read a line. |
|
1517 | """Write a prompt and read a line. | |
1518 |
|
1518 | |||
1519 | The returned line does not include the trailing newline. |
|
1519 | The returned line does not include the trailing newline. | |
1520 | When the user enters the EOF key sequence, EOFError is raised. |
|
1520 | When the user enters the EOF key sequence, EOFError is raised. | |
1521 |
|
1521 | |||
1522 | Optional inputs: |
|
1522 | Optional inputs: | |
1523 |
|
1523 | |||
1524 | - prompt(''): a string to be printed to prompt the user. |
|
1524 | - prompt(''): a string to be printed to prompt the user. | |
1525 |
|
1525 | |||
1526 | - continue_prompt(False): whether this line is the first one or a |
|
1526 | - continue_prompt(False): whether this line is the first one or a | |
1527 | continuation in a sequence of inputs. |
|
1527 | continuation in a sequence of inputs. | |
1528 | """ |
|
1528 | """ | |
1529 |
|
1529 | |||
1530 | line = raw_input_original(prompt) |
|
1530 | line = raw_input_original(prompt) | |
1531 | # Try to be reasonably smart about not re-indenting pasted input more |
|
1531 | # Try to be reasonably smart about not re-indenting pasted input more | |
1532 | # than necessary. We do this by trimming out the auto-indent initial |
|
1532 | # than necessary. We do this by trimming out the auto-indent initial | |
1533 | # spaces, if the user's actual input started itself with whitespace. |
|
1533 | # spaces, if the user's actual input started itself with whitespace. | |
1534 | if self.autoindent: |
|
1534 | if self.autoindent: | |
1535 | line2 = line[self.indent_current_nsp:] |
|
1535 | line2 = line[self.indent_current_nsp:] | |
1536 | if line2[0:1] in (' ','\t'): |
|
1536 | if line2[0:1] in (' ','\t'): | |
1537 | line = line2 |
|
1537 | line = line2 | |
1538 | return self.prefilter(line,continue_prompt) |
|
1538 | return self.prefilter(line,continue_prompt) | |
1539 |
|
1539 | |||
1540 | def split_user_input(self,line): |
|
1540 | def split_user_input(self,line): | |
1541 | """Split user input into pre-char, function part and rest.""" |
|
1541 | """Split user input into pre-char, function part and rest.""" | |
1542 |
|
1542 | |||
1543 | lsplit = self.line_split.match(line) |
|
1543 | lsplit = self.line_split.match(line) | |
1544 | if lsplit is None: # no regexp match returns None |
|
1544 | if lsplit is None: # no regexp match returns None | |
1545 | try: |
|
1545 | try: | |
1546 | iFun,theRest = line.split(None,1) |
|
1546 | iFun,theRest = line.split(None,1) | |
1547 | except ValueError: |
|
1547 | except ValueError: | |
1548 | iFun,theRest = line,'' |
|
1548 | iFun,theRest = line,'' | |
1549 | pre = re.match('^(\s*)(.*)',line).groups()[0] |
|
1549 | pre = re.match('^(\s*)(.*)',line).groups()[0] | |
1550 | else: |
|
1550 | else: | |
1551 | pre,iFun,theRest = lsplit.groups() |
|
1551 | pre,iFun,theRest = lsplit.groups() | |
1552 |
|
1552 | |||
1553 | #print 'line:<%s>' % line # dbg |
|
1553 | #print 'line:<%s>' % line # dbg | |
1554 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg |
|
1554 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun.strip(),theRest) # dbg | |
1555 | return pre,iFun.strip(),theRest |
|
1555 | return pre,iFun.strip(),theRest | |
1556 |
|
1556 | |||
1557 | def _prefilter(self, line, continue_prompt): |
|
1557 | def _prefilter(self, line, continue_prompt): | |
1558 | """Calls different preprocessors, depending on the form of line.""" |
|
1558 | """Calls different preprocessors, depending on the form of line.""" | |
1559 |
|
1559 | |||
1560 | # All handlers *must* return a value, even if it's blank (''). |
|
1560 | # All handlers *must* return a value, even if it's blank (''). | |
1561 |
|
1561 | |||
1562 | # Lines are NOT logged here. Handlers should process the line as |
|
1562 | # Lines are NOT logged here. Handlers should process the line as | |
1563 | # needed, update the cache AND log it (so that the input cache array |
|
1563 | # needed, update the cache AND log it (so that the input cache array | |
1564 | # stays synced). |
|
1564 | # stays synced). | |
1565 |
|
1565 | |||
1566 | # This function is _very_ delicate, and since it's also the one which |
|
1566 | # This function is _very_ delicate, and since it's also the one which | |
1567 | # determines IPython's response to user input, it must be as efficient |
|
1567 | # determines IPython's response to user input, it must be as efficient | |
1568 | # as possible. For this reason it has _many_ returns in it, trying |
|
1568 | # as possible. For this reason it has _many_ returns in it, trying | |
1569 | # always to exit as quickly as it can figure out what it needs to do. |
|
1569 | # always to exit as quickly as it can figure out what it needs to do. | |
1570 |
|
1570 | |||
1571 | # This function is the main responsible for maintaining IPython's |
|
1571 | # This function is the main responsible for maintaining IPython's | |
1572 | # behavior respectful of Python's semantics. So be _very_ careful if |
|
1572 | # behavior respectful of Python's semantics. So be _very_ careful if | |
1573 | # making changes to anything here. |
|
1573 | # making changes to anything here. | |
1574 |
|
1574 | |||
1575 | #..................................................................... |
|
1575 | #..................................................................... | |
1576 | # Code begins |
|
1576 | # Code begins | |
1577 |
|
1577 | |||
1578 | #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg |
|
1578 | #if line.startswith('%crash'): raise RuntimeError,'Crash now!' # dbg | |
1579 |
|
1579 | |||
1580 | # save the line away in case we crash, so the post-mortem handler can |
|
1580 | # save the line away in case we crash, so the post-mortem handler can | |
1581 | # record it |
|
1581 | # record it | |
1582 | self._last_input_line = line |
|
1582 | self._last_input_line = line | |
1583 |
|
1583 | |||
1584 | #print '***line: <%s>' % line # dbg |
|
1584 | #print '***line: <%s>' % line # dbg | |
1585 |
|
1585 | |||
1586 | # the input history needs to track even empty lines |
|
1586 | # the input history needs to track even empty lines | |
1587 | if not line.strip(): |
|
1587 | if not line.strip(): | |
1588 | if not continue_prompt: |
|
1588 | if not continue_prompt: | |
1589 | self.outputcache.prompt_count -= 1 |
|
1589 | self.outputcache.prompt_count -= 1 | |
1590 | return self.handle_normal(line,continue_prompt) |
|
1590 | return self.handle_normal(line,continue_prompt) | |
1591 | #return self.handle_normal('',continue_prompt) |
|
1591 | #return self.handle_normal('',continue_prompt) | |
1592 |
|
1592 | |||
1593 | # print '***cont',continue_prompt # dbg |
|
1593 | # print '***cont',continue_prompt # dbg | |
1594 | # special handlers are only allowed for single line statements |
|
1594 | # special handlers are only allowed for single line statements | |
1595 | if continue_prompt and not self.rc.multi_line_specials: |
|
1595 | if continue_prompt and not self.rc.multi_line_specials: | |
1596 | return self.handle_normal(line,continue_prompt) |
|
1596 | return self.handle_normal(line,continue_prompt) | |
1597 |
|
1597 | |||
1598 | # For the rest, we need the structure of the input |
|
1598 | # For the rest, we need the structure of the input | |
1599 | pre,iFun,theRest = self.split_user_input(line) |
|
1599 | pre,iFun,theRest = self.split_user_input(line) | |
1600 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg |
|
1600 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg | |
1601 |
|
1601 | |||
1602 | # First check for explicit escapes in the last/first character |
|
1602 | # First check for explicit escapes in the last/first character | |
1603 | handler = None |
|
1603 | handler = None | |
1604 | if line[-1] == self.ESC_HELP: |
|
1604 | if line[-1] == self.ESC_HELP: | |
1605 | handler = self.esc_handlers.get(line[-1]) # the ? can be at the end |
|
1605 | handler = self.esc_handlers.get(line[-1]) # the ? can be at the end | |
1606 | if handler is None: |
|
1606 | if handler is None: | |
1607 | # look at the first character of iFun, NOT of line, so we skip |
|
1607 | # look at the first character of iFun, NOT of line, so we skip | |
1608 | # leading whitespace in multiline input |
|
1608 | # leading whitespace in multiline input | |
1609 | handler = self.esc_handlers.get(iFun[0:1]) |
|
1609 | handler = self.esc_handlers.get(iFun[0:1]) | |
1610 | if handler is not None: |
|
1610 | if handler is not None: | |
1611 | return handler(line,continue_prompt,pre,iFun,theRest) |
|
1611 | return handler(line,continue_prompt,pre,iFun,theRest) | |
1612 | # Emacs ipython-mode tags certain input lines |
|
1612 | # Emacs ipython-mode tags certain input lines | |
1613 | if line.endswith('# PYTHON-MODE'): |
|
1613 | if line.endswith('# PYTHON-MODE'): | |
1614 | return self.handle_emacs(line,continue_prompt) |
|
1614 | return self.handle_emacs(line,continue_prompt) | |
1615 |
|
1615 | |||
1616 | # Next, check if we can automatically execute this thing |
|
1616 | # Next, check if we can automatically execute this thing | |
1617 |
|
1617 | |||
1618 | # Allow ! in multi-line statements if multi_line_specials is on: |
|
1618 | # Allow ! in multi-line statements if multi_line_specials is on: | |
1619 | if continue_prompt and self.rc.multi_line_specials and \ |
|
1619 | if continue_prompt and self.rc.multi_line_specials and \ | |
1620 | iFun.startswith(self.ESC_SHELL): |
|
1620 | iFun.startswith(self.ESC_SHELL): | |
1621 | return self.handle_shell_escape(line,continue_prompt, |
|
1621 | return self.handle_shell_escape(line,continue_prompt, | |
1622 | pre=pre,iFun=iFun, |
|
1622 | pre=pre,iFun=iFun, | |
1623 | theRest=theRest) |
|
1623 | theRest=theRest) | |
1624 |
|
1624 | |||
1625 | # Let's try to find if the input line is a magic fn |
|
1625 | # Let's try to find if the input line is a magic fn | |
1626 | oinfo = None |
|
1626 | oinfo = None | |
1627 | if hasattr(self,'magic_'+iFun): |
|
1627 | if hasattr(self,'magic_'+iFun): | |
1628 | oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic |
|
1628 | oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic | |
1629 | if oinfo['ismagic']: |
|
1629 | if oinfo['ismagic']: | |
1630 | # Be careful not to call magics when a variable assignment is |
|
1630 | # Be careful not to call magics when a variable assignment is | |
1631 | # being made (ls='hi', for example) |
|
1631 | # being made (ls='hi', for example) | |
1632 | if self.rc.automagic and \ |
|
1632 | if self.rc.automagic and \ | |
1633 | (len(theRest)==0 or theRest[0] not in '!=()<>,') and \ |
|
1633 | (len(theRest)==0 or theRest[0] not in '!=()<>,') and \ | |
1634 | (self.rc.multi_line_specials or not continue_prompt): |
|
1634 | (self.rc.multi_line_specials or not continue_prompt): | |
1635 | return self.handle_magic(line,continue_prompt, |
|
1635 | return self.handle_magic(line,continue_prompt, | |
1636 | pre,iFun,theRest) |
|
1636 | pre,iFun,theRest) | |
1637 | else: |
|
1637 | else: | |
1638 | return self.handle_normal(line,continue_prompt) |
|
1638 | return self.handle_normal(line,continue_prompt) | |
1639 |
|
1639 | |||
1640 | # If the rest of the line begins with an (in)equality, assginment or |
|
1640 | # If the rest of the line begins with an (in)equality, assginment or | |
1641 | # function call, we should not call _ofind but simply execute it. |
|
1641 | # function call, we should not call _ofind but simply execute it. | |
1642 | # This avoids spurious geattr() accesses on objects upon assignment. |
|
1642 | # This avoids spurious geattr() accesses on objects upon assignment. | |
1643 | # |
|
1643 | # | |
1644 | # It also allows users to assign to either alias or magic names true |
|
1644 | # It also allows users to assign to either alias or magic names true | |
1645 | # python variables (the magic/alias systems always take second seat to |
|
1645 | # python variables (the magic/alias systems always take second seat to | |
1646 | # true python code). |
|
1646 | # true python code). | |
1647 | if theRest and theRest[0] in '!=()': |
|
1647 | if theRest and theRest[0] in '!=()': | |
1648 | return self.handle_normal(line,continue_prompt) |
|
1648 | return self.handle_normal(line,continue_prompt) | |
1649 |
|
1649 | |||
1650 | if oinfo is None: |
|
1650 | if oinfo is None: | |
1651 | oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic |
|
1651 | oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic | |
1652 |
|
1652 | |||
1653 | if not oinfo['found']: |
|
1653 | if not oinfo['found']: | |
1654 | return self.handle_normal(line,continue_prompt) |
|
1654 | return self.handle_normal(line,continue_prompt) | |
1655 | else: |
|
1655 | else: | |
1656 | #print 'iFun <%s> rest <%s>' % (iFun,theRest) # dbg |
|
1656 | #print 'iFun <%s> rest <%s>' % (iFun,theRest) # dbg | |
1657 | if oinfo['isalias']: |
|
1657 | if oinfo['isalias']: | |
1658 | return self.handle_alias(line,continue_prompt, |
|
1658 | return self.handle_alias(line,continue_prompt, | |
1659 | pre,iFun,theRest) |
|
1659 | pre,iFun,theRest) | |
1660 |
|
1660 | |||
1661 | if self.rc.autocall and \ |
|
1661 | if self.rc.autocall and \ | |
1662 | not self.re_exclude_auto.match(theRest) and \ |
|
1662 | not self.re_exclude_auto.match(theRest) and \ | |
1663 | self.re_fun_name.match(iFun) and \ |
|
1663 | self.re_fun_name.match(iFun) and \ | |
1664 | callable(oinfo['obj']) : |
|
1664 | callable(oinfo['obj']) : | |
1665 | #print 'going auto' # dbg |
|
1665 | #print 'going auto' # dbg | |
1666 | return self.handle_auto(line,continue_prompt,pre,iFun,theRest) |
|
1666 | return self.handle_auto(line,continue_prompt,pre,iFun,theRest) | |
1667 | else: |
|
1667 | else: | |
1668 | #print 'was callable?', callable(oinfo['obj']) # dbg |
|
1668 | #print 'was callable?', callable(oinfo['obj']) # dbg | |
1669 | return self.handle_normal(line,continue_prompt) |
|
1669 | return self.handle_normal(line,continue_prompt) | |
1670 |
|
1670 | |||
1671 | # If we get here, we have a normal Python line. Log and return. |
|
1671 | # If we get here, we have a normal Python line. Log and return. | |
1672 | return self.handle_normal(line,continue_prompt) |
|
1672 | return self.handle_normal(line,continue_prompt) | |
1673 |
|
1673 | |||
1674 | def _prefilter_dumb(self, line, continue_prompt): |
|
1674 | def _prefilter_dumb(self, line, continue_prompt): | |
1675 | """simple prefilter function, for debugging""" |
|
1675 | """simple prefilter function, for debugging""" | |
1676 | return self.handle_normal(line,continue_prompt) |
|
1676 | return self.handle_normal(line,continue_prompt) | |
1677 |
|
1677 | |||
1678 | # Set the default prefilter() function (this can be user-overridden) |
|
1678 | # Set the default prefilter() function (this can be user-overridden) | |
1679 | prefilter = _prefilter |
|
1679 | prefilter = _prefilter | |
1680 |
|
1680 | |||
1681 | def handle_normal(self,line,continue_prompt=None, |
|
1681 | def handle_normal(self,line,continue_prompt=None, | |
1682 | pre=None,iFun=None,theRest=None): |
|
1682 | pre=None,iFun=None,theRest=None): | |
1683 | """Handle normal input lines. Use as a template for handlers.""" |
|
1683 | """Handle normal input lines. Use as a template for handlers.""" | |
1684 |
|
1684 | |||
1685 | # With autoindent on, we need some way to exit the input loop, and I |
|
1685 | # With autoindent on, we need some way to exit the input loop, and I | |
1686 | # don't want to force the user to have to backspace all the way to |
|
1686 | # don't want to force the user to have to backspace all the way to | |
1687 | # clear the line. The rule will be in this case, that either two |
|
1687 | # clear the line. The rule will be in this case, that either two | |
1688 | # lines of pure whitespace in a row, or a line of pure whitespace but |
|
1688 | # lines of pure whitespace in a row, or a line of pure whitespace but | |
1689 | # of a size different to the indent level, will exit the input loop. |
|
1689 | # of a size different to the indent level, will exit the input loop. | |
1690 | if (continue_prompt and self.autoindent and isspace(line) and |
|
1690 | if (continue_prompt and self.autoindent and isspace(line) and | |
1691 | (line != self.indent_current or isspace(self.buffer[-1]))): |
|
1691 | (line != self.indent_current or isspace(self.buffer[-1]))): | |
1692 | line = '' |
|
1692 | line = '' | |
1693 |
|
1693 | |||
1694 | self.log(line,continue_prompt) |
|
1694 | self.log(line,continue_prompt) | |
1695 | self.update_cache(line) |
|
1695 | self.update_cache(line) | |
1696 | return line |
|
1696 | return line | |
1697 |
|
1697 | |||
1698 | def handle_alias(self,line,continue_prompt=None, |
|
1698 | def handle_alias(self,line,continue_prompt=None, | |
1699 | pre=None,iFun=None,theRest=None): |
|
1699 | pre=None,iFun=None,theRest=None): | |
1700 | """Handle alias input lines. """ |
|
1700 | """Handle alias input lines. """ | |
1701 |
|
1701 | |||
1702 | theRest = esc_quotes(theRest) |
|
1702 | theRest = esc_quotes(theRest) | |
1703 | line_out = "%s%s.call_alias('%s','%s')" % (pre,self.name,iFun,theRest) |
|
1703 | line_out = "%s%s.call_alias('%s','%s')" % (pre,self.name,iFun,theRest) | |
1704 | self.log(line_out,continue_prompt) |
|
1704 | self.log(line_out,continue_prompt) | |
1705 | self.update_cache(line_out) |
|
1705 | self.update_cache(line_out) | |
1706 | return line_out |
|
1706 | return line_out | |
1707 |
|
1707 | |||
1708 | def handle_shell_escape(self, line, continue_prompt=None, |
|
1708 | def handle_shell_escape(self, line, continue_prompt=None, | |
1709 | pre=None,iFun=None,theRest=None): |
|
1709 | pre=None,iFun=None,theRest=None): | |
1710 | """Execute the line in a shell, empty return value""" |
|
1710 | """Execute the line in a shell, empty return value""" | |
1711 |
|
1711 | |||
1712 | #print 'line in :', `line` # dbg |
|
1712 | #print 'line in :', `line` # dbg | |
1713 | # Example of a special handler. Others follow a similar pattern. |
|
1713 | # Example of a special handler. Others follow a similar pattern. | |
1714 | if continue_prompt: # multi-line statements |
|
1714 | if continue_prompt: # multi-line statements | |
1715 | if iFun.startswith('!!'): |
|
1715 | if iFun.startswith('!!'): | |
1716 | print 'SyntaxError: !! is not allowed in multiline statements' |
|
1716 | print 'SyntaxError: !! is not allowed in multiline statements' | |
1717 | return pre |
|
1717 | return pre | |
1718 | else: |
|
1718 | else: | |
1719 | cmd = ("%s %s" % (iFun[1:],theRest)).replace('"','\\"') |
|
1719 | cmd = ("%s %s" % (iFun[1:],theRest)) #.replace('"','\\"') | |
1720 | line_out = '%s%s.system("%s")' % (pre,self.name,cmd) |
|
1720 | #line_out = '%s%s.system("%s")' % (pre,self.name,cmd) | |
|
1721 | line_out = '%s%s.system(r"""%s"""[:-1])' % (pre,self.name,cmd + "_") | |||
1721 | #line_out = ('%s%s.system(' % (pre,self.name)) + repr(cmd) + ')' |
|
1722 | #line_out = ('%s%s.system(' % (pre,self.name)) + repr(cmd) + ')' | |
1722 | else: # single-line input |
|
1723 | else: # single-line input | |
1723 | if line.startswith('!!'): |
|
1724 | if line.startswith('!!'): | |
1724 | # rewrite iFun/theRest to properly hold the call to %sx and |
|
1725 | # rewrite iFun/theRest to properly hold the call to %sx and | |
1725 | # the actual command to be executed, so handle_magic can work |
|
1726 | # the actual command to be executed, so handle_magic can work | |
1726 | # correctly |
|
1727 | # correctly | |
1727 | theRest = '%s %s' % (iFun[2:],theRest) |
|
1728 | theRest = '%s %s' % (iFun[2:],theRest) | |
1728 | iFun = 'sx' |
|
1729 | iFun = 'sx' | |
1729 | return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]), |
|
1730 | return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]), | |
1730 | continue_prompt,pre,iFun,theRest) |
|
1731 | continue_prompt,pre,iFun,theRest) | |
1731 | else: |
|
1732 | else: | |
1732 | cmd = esc_quotes(line[1:]) |
|
1733 | #cmd = esc_quotes(line[1:]) | |
1733 | line_out = '%s.system("%s")' % (self.name,cmd) |
|
1734 | cmd=line[1:] | |
|
1735 | #line_out = '%s.system("%s")' % (self.name,cmd) | |||
|
1736 | line_out = '%s.system(r"""%s"""[:-1])' % (self.name,cmd +"_") | |||
1734 | #line_out = ('%s.system(' % self.name) + repr(cmd)+ ')' |
|
1737 | #line_out = ('%s.system(' % self.name) + repr(cmd)+ ')' | |
1735 | # update cache/log and return |
|
1738 | # update cache/log and return | |
1736 | self.log(line_out,continue_prompt) |
|
1739 | self.log(line_out,continue_prompt) | |
1737 | self.update_cache(line_out) # readline cache gets normal line |
|
1740 | self.update_cache(line_out) # readline cache gets normal line | |
1738 | #print 'line out r:', `line_out` # dbg |
|
1741 | #print 'line out r:', `line_out` # dbg | |
1739 | #print 'line out s:', line_out # dbg |
|
1742 | #print 'line out s:', line_out # dbg | |
1740 | return line_out |
|
1743 | return line_out | |
1741 |
|
1744 | |||
1742 | def handle_magic(self, line, continue_prompt=None, |
|
1745 | def handle_magic(self, line, continue_prompt=None, | |
1743 | pre=None,iFun=None,theRest=None): |
|
1746 | pre=None,iFun=None,theRest=None): | |
1744 | """Execute magic functions. |
|
1747 | """Execute magic functions. | |
1745 |
|
1748 | |||
1746 | Also log them with a prepended # so the log is clean Python.""" |
|
1749 | Also log them with a prepended # so the log is clean Python.""" | |
1747 |
|
1750 | |||
1748 | cmd = '%sipmagic("%s")' % (pre,esc_quotes('%s %s' % (iFun,theRest))) |
|
1751 | cmd = '%sipmagic("%s")' % (pre,esc_quotes('%s %s' % (iFun,theRest))) | |
1749 | self.log(cmd,continue_prompt) |
|
1752 | self.log(cmd,continue_prompt) | |
1750 | self.update_cache(line) |
|
1753 | self.update_cache(line) | |
1751 | #print 'in handle_magic, cmd=<%s>' % cmd # dbg |
|
1754 | #print 'in handle_magic, cmd=<%s>' % cmd # dbg | |
1752 | return cmd |
|
1755 | return cmd | |
1753 |
|
1756 | |||
1754 | def handle_auto(self, line, continue_prompt=None, |
|
1757 | def handle_auto(self, line, continue_prompt=None, | |
1755 | pre=None,iFun=None,theRest=None): |
|
1758 | pre=None,iFun=None,theRest=None): | |
1756 | """Hande lines which can be auto-executed, quoting if requested.""" |
|
1759 | """Hande lines which can be auto-executed, quoting if requested.""" | |
1757 |
|
1760 | |||
1758 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg |
|
1761 | #print 'pre <%s> iFun <%s> rest <%s>' % (pre,iFun,theRest) # dbg | |
1759 |
|
1762 | |||
1760 | # This should only be active for single-line input! |
|
1763 | # This should only be active for single-line input! | |
1761 | if continue_prompt: |
|
1764 | if continue_prompt: | |
1762 | return line |
|
1765 | return line | |
1763 |
|
1766 | |||
1764 | if pre == self.ESC_QUOTE: |
|
1767 | if pre == self.ESC_QUOTE: | |
1765 | # Auto-quote splitting on whitespace |
|
1768 | # Auto-quote splitting on whitespace | |
1766 | newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) ) |
|
1769 | newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) ) | |
1767 | elif pre == self.ESC_QUOTE2: |
|
1770 | elif pre == self.ESC_QUOTE2: | |
1768 | # Auto-quote whole string |
|
1771 | # Auto-quote whole string | |
1769 | newcmd = '%s("%s")' % (iFun,theRest) |
|
1772 | newcmd = '%s("%s")' % (iFun,theRest) | |
1770 | else: |
|
1773 | else: | |
1771 | # Auto-paren |
|
1774 | # Auto-paren | |
1772 | if theRest[0:1] in ('=','['): |
|
1775 | if theRest[0:1] in ('=','['): | |
1773 | # Don't autocall in these cases. They can be either |
|
1776 | # Don't autocall in these cases. They can be either | |
1774 | # rebindings of an existing callable's name, or item access |
|
1777 | # rebindings of an existing callable's name, or item access | |
1775 | # for an object which is BOTH callable and implements |
|
1778 | # for an object which is BOTH callable and implements | |
1776 | # __getitem__. |
|
1779 | # __getitem__. | |
1777 | return '%s %s' % (iFun,theRest) |
|
1780 | return '%s %s' % (iFun,theRest) | |
1778 | if theRest.endswith(';'): |
|
1781 | if theRest.endswith(';'): | |
1779 | newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1]) |
|
1782 | newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1]) | |
1780 | else: |
|
1783 | else: | |
1781 | newcmd = '%s(%s)' % (iFun.rstrip(),theRest) |
|
1784 | newcmd = '%s(%s)' % (iFun.rstrip(),theRest) | |
1782 |
|
1785 | |||
1783 | print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd |
|
1786 | print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd | |
1784 | # log what is now valid Python, not the actual user input (without the |
|
1787 | # log what is now valid Python, not the actual user input (without the | |
1785 | # final newline) |
|
1788 | # final newline) | |
1786 | self.log(newcmd,continue_prompt) |
|
1789 | self.log(newcmd,continue_prompt) | |
1787 | return newcmd |
|
1790 | return newcmd | |
1788 |
|
1791 | |||
1789 | def handle_help(self, line, continue_prompt=None, |
|
1792 | def handle_help(self, line, continue_prompt=None, | |
1790 | pre=None,iFun=None,theRest=None): |
|
1793 | pre=None,iFun=None,theRest=None): | |
1791 | """Try to get some help for the object. |
|
1794 | """Try to get some help for the object. | |
1792 |
|
1795 | |||
1793 | obj? or ?obj -> basic information. |
|
1796 | obj? or ?obj -> basic information. | |
1794 | obj?? or ??obj -> more details. |
|
1797 | obj?? or ??obj -> more details. | |
1795 | """ |
|
1798 | """ | |
1796 |
|
1799 | |||
1797 | # We need to make sure that we don't process lines which would be |
|
1800 | # We need to make sure that we don't process lines which would be | |
1798 | # otherwise valid python, such as "x=1 # what?" |
|
1801 | # otherwise valid python, such as "x=1 # what?" | |
1799 | try: |
|
1802 | try: | |
1800 | codeop.compile_command(line) |
|
1803 | codeop.compile_command(line) | |
1801 | except SyntaxError: |
|
1804 | except SyntaxError: | |
1802 | # We should only handle as help stuff which is NOT valid syntax |
|
1805 | # We should only handle as help stuff which is NOT valid syntax | |
1803 | if line[0]==self.ESC_HELP: |
|
1806 | if line[0]==self.ESC_HELP: | |
1804 | line = line[1:] |
|
1807 | line = line[1:] | |
1805 | elif line[-1]==self.ESC_HELP: |
|
1808 | elif line[-1]==self.ESC_HELP: | |
1806 | line = line[:-1] |
|
1809 | line = line[:-1] | |
1807 | self.log('#?'+line) |
|
1810 | self.log('#?'+line) | |
1808 | self.update_cache(line) |
|
1811 | self.update_cache(line) | |
1809 | if line: |
|
1812 | if line: | |
1810 | self.magic_pinfo(line) |
|
1813 | self.magic_pinfo(line) | |
1811 | else: |
|
1814 | else: | |
1812 | page(self.usage,screen_lines=self.rc.screen_length) |
|
1815 | page(self.usage,screen_lines=self.rc.screen_length) | |
1813 | return '' # Empty string is needed here! |
|
1816 | return '' # Empty string is needed here! | |
1814 | except: |
|
1817 | except: | |
1815 | # Pass any other exceptions through to the normal handler |
|
1818 | # Pass any other exceptions through to the normal handler | |
1816 | return self.handle_normal(line,continue_prompt) |
|
1819 | return self.handle_normal(line,continue_prompt) | |
1817 | else: |
|
1820 | else: | |
1818 | # If the code compiles ok, we should handle it normally |
|
1821 | # If the code compiles ok, we should handle it normally | |
1819 | return self.handle_normal(line,continue_prompt) |
|
1822 | return self.handle_normal(line,continue_prompt) | |
1820 |
|
1823 | |||
1821 | def handle_emacs(self,line,continue_prompt=None, |
|
1824 | def handle_emacs(self,line,continue_prompt=None, | |
1822 | pre=None,iFun=None,theRest=None): |
|
1825 | pre=None,iFun=None,theRest=None): | |
1823 | """Handle input lines marked by python-mode.""" |
|
1826 | """Handle input lines marked by python-mode.""" | |
1824 |
|
1827 | |||
1825 | # Currently, nothing is done. Later more functionality can be added |
|
1828 | # Currently, nothing is done. Later more functionality can be added | |
1826 | # here if needed. |
|
1829 | # here if needed. | |
1827 |
|
1830 | |||
1828 | # The input cache shouldn't be updated |
|
1831 | # The input cache shouldn't be updated | |
1829 |
|
1832 | |||
1830 | return line |
|
1833 | return line | |
1831 |
|
1834 | |||
1832 | def write(self,data): |
|
1835 | def write(self,data): | |
1833 | """Write a string to the default output""" |
|
1836 | """Write a string to the default output""" | |
1834 | Term.cout.write(data) |
|
1837 | Term.cout.write(data) | |
1835 |
|
1838 | |||
1836 | def write_err(self,data): |
|
1839 | def write_err(self,data): | |
1837 | """Write a string to the default error output""" |
|
1840 | """Write a string to the default error output""" | |
1838 | Term.cerr.write(data) |
|
1841 | Term.cerr.write(data) | |
1839 |
|
1842 | |||
1840 | def exit(self): |
|
1843 | def exit(self): | |
1841 | """Handle interactive exit. |
|
1844 | """Handle interactive exit. | |
1842 |
|
1845 | |||
1843 | This method sets the exit_now attribute.""" |
|
1846 | This method sets the exit_now attribute.""" | |
1844 |
|
1847 | |||
1845 | if self.rc.confirm_exit: |
|
1848 | if self.rc.confirm_exit: | |
1846 | if ask_yes_no('Do you really want to exit ([y]/n)?','y'): |
|
1849 | if ask_yes_no('Do you really want to exit ([y]/n)?','y'): | |
1847 | self.exit_now = True |
|
1850 | self.exit_now = True | |
1848 | else: |
|
1851 | else: | |
1849 | self.exit_now = True |
|
1852 | self.exit_now = True | |
1850 | return self.exit_now |
|
1853 | return self.exit_now | |
1851 |
|
1854 | |||
1852 | def safe_execfile(self,fname,*where,**kw): |
|
1855 | def safe_execfile(self,fname,*where,**kw): | |
1853 | fname = os.path.expanduser(fname) |
|
1856 | fname = os.path.expanduser(fname) | |
1854 |
|
1857 | |||
1855 | # find things also in current directory |
|
1858 | # find things also in current directory | |
1856 | dname = os.path.dirname(fname) |
|
1859 | dname = os.path.dirname(fname) | |
1857 | if not sys.path.count(dname): |
|
1860 | if not sys.path.count(dname): | |
1858 | sys.path.append(dname) |
|
1861 | sys.path.append(dname) | |
1859 |
|
1862 | |||
1860 | try: |
|
1863 | try: | |
1861 | xfile = open(fname) |
|
1864 | xfile = open(fname) | |
1862 | except: |
|
1865 | except: | |
1863 | print >> Term.cerr, \ |
|
1866 | print >> Term.cerr, \ | |
1864 | 'Could not open file <%s> for safe execution.' % fname |
|
1867 | 'Could not open file <%s> for safe execution.' % fname | |
1865 | return None |
|
1868 | return None | |
1866 |
|
1869 | |||
1867 | kw.setdefault('islog',0) |
|
1870 | kw.setdefault('islog',0) | |
1868 | kw.setdefault('quiet',1) |
|
1871 | kw.setdefault('quiet',1) | |
1869 | kw.setdefault('exit_ignore',0) |
|
1872 | kw.setdefault('exit_ignore',0) | |
1870 | first = xfile.readline() |
|
1873 | first = xfile.readline() | |
1871 | _LOGHEAD = str(self.LOGHEAD).split('\n',1)[0].strip() |
|
1874 | _LOGHEAD = str(self.LOGHEAD).split('\n',1)[0].strip() | |
1872 | xfile.close() |
|
1875 | xfile.close() | |
1873 | # line by line execution |
|
1876 | # line by line execution | |
1874 | if first.startswith(_LOGHEAD) or kw['islog']: |
|
1877 | if first.startswith(_LOGHEAD) or kw['islog']: | |
1875 | print 'Loading log file <%s> one line at a time...' % fname |
|
1878 | print 'Loading log file <%s> one line at a time...' % fname | |
1876 | if kw['quiet']: |
|
1879 | if kw['quiet']: | |
1877 | stdout_save = sys.stdout |
|
1880 | stdout_save = sys.stdout | |
1878 | sys.stdout = StringIO.StringIO() |
|
1881 | sys.stdout = StringIO.StringIO() | |
1879 | try: |
|
1882 | try: | |
1880 | globs,locs = where[0:2] |
|
1883 | globs,locs = where[0:2] | |
1881 | except: |
|
1884 | except: | |
1882 | try: |
|
1885 | try: | |
1883 | globs = locs = where[0] |
|
1886 | globs = locs = where[0] | |
1884 | except: |
|
1887 | except: | |
1885 | globs = locs = globals() |
|
1888 | globs = locs = globals() | |
1886 | badblocks = [] |
|
1889 | badblocks = [] | |
1887 |
|
1890 | |||
1888 | # we also need to identify indented blocks of code when replaying |
|
1891 | # we also need to identify indented blocks of code when replaying | |
1889 | # logs and put them together before passing them to an exec |
|
1892 | # logs and put them together before passing them to an exec | |
1890 | # statement. This takes a bit of regexp and look-ahead work in the |
|
1893 | # statement. This takes a bit of regexp and look-ahead work in the | |
1891 | # file. It's easiest if we swallow the whole thing in memory |
|
1894 | # file. It's easiest if we swallow the whole thing in memory | |
1892 | # first, and manually walk through the lines list moving the |
|
1895 | # first, and manually walk through the lines list moving the | |
1893 | # counter ourselves. |
|
1896 | # counter ourselves. | |
1894 | indent_re = re.compile('\s+\S') |
|
1897 | indent_re = re.compile('\s+\S') | |
1895 | xfile = open(fname) |
|
1898 | xfile = open(fname) | |
1896 | filelines = xfile.readlines() |
|
1899 | filelines = xfile.readlines() | |
1897 | xfile.close() |
|
1900 | xfile.close() | |
1898 | nlines = len(filelines) |
|
1901 | nlines = len(filelines) | |
1899 | lnum = 0 |
|
1902 | lnum = 0 | |
1900 | while lnum < nlines: |
|
1903 | while lnum < nlines: | |
1901 | line = filelines[lnum] |
|
1904 | line = filelines[lnum] | |
1902 | lnum += 1 |
|
1905 | lnum += 1 | |
1903 | # don't re-insert logger status info into cache |
|
1906 | # don't re-insert logger status info into cache | |
1904 | if line.startswith('#log#'): |
|
1907 | if line.startswith('#log#'): | |
1905 | continue |
|
1908 | continue | |
1906 | elif line.startswith('#%s'% self.ESC_MAGIC): |
|
1909 | elif line.startswith('#%s'% self.ESC_MAGIC): | |
1907 | self.update_cache(line[1:]) |
|
1910 | self.update_cache(line[1:]) | |
1908 | line = magic2python(line) |
|
1911 | line = magic2python(line) | |
1909 | elif line.startswith('#!'): |
|
1912 | elif line.startswith('#!'): | |
1910 | self.update_cache(line[1:]) |
|
1913 | self.update_cache(line[1:]) | |
1911 | else: |
|
1914 | else: | |
1912 | # build a block of code (maybe a single line) for execution |
|
1915 | # build a block of code (maybe a single line) for execution | |
1913 | block = line |
|
1916 | block = line | |
1914 | try: |
|
1917 | try: | |
1915 | next = filelines[lnum] # lnum has already incremented |
|
1918 | next = filelines[lnum] # lnum has already incremented | |
1916 | except: |
|
1919 | except: | |
1917 | next = None |
|
1920 | next = None | |
1918 | while next and indent_re.match(next): |
|
1921 | while next and indent_re.match(next): | |
1919 | block += next |
|
1922 | block += next | |
1920 | lnum += 1 |
|
1923 | lnum += 1 | |
1921 | try: |
|
1924 | try: | |
1922 | next = filelines[lnum] |
|
1925 | next = filelines[lnum] | |
1923 | except: |
|
1926 | except: | |
1924 | next = None |
|
1927 | next = None | |
1925 | # now execute the block of one or more lines |
|
1928 | # now execute the block of one or more lines | |
1926 | try: |
|
1929 | try: | |
1927 | exec block in globs,locs |
|
1930 | exec block in globs,locs | |
1928 | self.update_cache(block.rstrip()) |
|
1931 | self.update_cache(block.rstrip()) | |
1929 | except SystemExit: |
|
1932 | except SystemExit: | |
1930 | pass |
|
1933 | pass | |
1931 | except: |
|
1934 | except: | |
1932 | badblocks.append(block.rstrip()) |
|
1935 | badblocks.append(block.rstrip()) | |
1933 | if kw['quiet']: # restore stdout |
|
1936 | if kw['quiet']: # restore stdout | |
1934 | sys.stdout.close() |
|
1937 | sys.stdout.close() | |
1935 | sys.stdout = stdout_save |
|
1938 | sys.stdout = stdout_save | |
1936 | print 'Finished replaying log file <%s>' % fname |
|
1939 | print 'Finished replaying log file <%s>' % fname | |
1937 | if badblocks: |
|
1940 | if badblocks: | |
1938 | print >> sys.stderr, ('\nThe following lines/blocks in file ' |
|
1941 | print >> sys.stderr, ('\nThe following lines/blocks in file ' | |
1939 | '<%s> reported errors:' % fname) |
|
1942 | '<%s> reported errors:' % fname) | |
1940 |
|
1943 | |||
1941 | for badline in badblocks: |
|
1944 | for badline in badblocks: | |
1942 | print >> sys.stderr, badline |
|
1945 | print >> sys.stderr, badline | |
1943 | else: # regular file execution |
|
1946 | else: # regular file execution | |
1944 | try: |
|
1947 | try: | |
1945 | execfile(fname,*where) |
|
1948 | execfile(fname,*where) | |
1946 | except SyntaxError: |
|
1949 | except SyntaxError: | |
1947 | etype, evalue = sys.exc_info()[0:2] |
|
1950 | etype, evalue = sys.exc_info()[0:2] | |
1948 | self.SyntaxTB(etype,evalue,[]) |
|
1951 | self.SyntaxTB(etype,evalue,[]) | |
1949 | warn('Failure executing file: <%s>' % fname) |
|
1952 | warn('Failure executing file: <%s>' % fname) | |
1950 | except SystemExit,status: |
|
1953 | except SystemExit,status: | |
1951 | if not kw['exit_ignore']: |
|
1954 | if not kw['exit_ignore']: | |
1952 | self.InteractiveTB() |
|
1955 | self.InteractiveTB() | |
1953 | warn('Failure executing file: <%s>' % fname) |
|
1956 | warn('Failure executing file: <%s>' % fname) | |
1954 | except: |
|
1957 | except: | |
1955 | self.InteractiveTB() |
|
1958 | self.InteractiveTB() | |
1956 | warn('Failure executing file: <%s>' % fname) |
|
1959 | warn('Failure executing file: <%s>' % fname) | |
1957 |
|
1960 | |||
1958 | #************************* end of file <iplib.py> ***************************** |
|
1961 | #************************* end of file <iplib.py> ***************************** |
@@ -1,737 +1,737 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | IPython -- An enhanced Interactive Python |
|
3 | IPython -- An enhanced Interactive Python | |
4 |
|
4 | |||
5 | Requires Python 2.1 or better. |
|
5 | Requires Python 2.1 or better. | |
6 |
|
6 | |||
7 | This file contains the main make_IPython() starter function. |
|
7 | This file contains the main make_IPython() starter function. | |
8 |
|
8 | |||
9 |
$Id: ipmaker.py 96 |
|
9 | $Id: ipmaker.py 963 2005-12-28 19:21:29Z fperez $""" | |
10 |
|
10 | |||
11 | #***************************************************************************** |
|
11 | #***************************************************************************** | |
12 | # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu> |
|
12 | # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu> | |
13 | # |
|
13 | # | |
14 | # Distributed under the terms of the BSD License. The full license is in |
|
14 | # Distributed under the terms of the BSD License. The full license is in | |
15 | # the file COPYING, distributed as part of this software. |
|
15 | # the file COPYING, distributed as part of this software. | |
16 | #***************************************************************************** |
|
16 | #***************************************************************************** | |
17 |
|
17 | |||
18 | from IPython import Release |
|
18 | from IPython import Release | |
19 | __author__ = '%s <%s>' % Release.authors['Fernando'] |
|
19 | __author__ = '%s <%s>' % Release.authors['Fernando'] | |
20 | __license__ = Release.license |
|
20 | __license__ = Release.license | |
21 | __version__ = Release.version |
|
21 | __version__ = Release.version | |
22 |
|
22 | |||
23 | credits._Printer__data = """ |
|
23 | credits._Printer__data = """ | |
24 | Python: %s |
|
24 | Python: %s | |
25 |
|
25 | |||
26 | IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users. |
|
26 | IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users. | |
27 | See http://ipython.scipy.org for more information.""" \ |
|
27 | See http://ipython.scipy.org for more information.""" \ | |
28 | % credits._Printer__data |
|
28 | % credits._Printer__data | |
29 |
|
29 | |||
30 | copyright._Printer__data += """ |
|
30 | copyright._Printer__data += """ | |
31 |
|
31 | |||
32 | Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray. |
|
32 | Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray. | |
33 | All Rights Reserved.""" |
|
33 | All Rights Reserved.""" | |
34 |
|
34 | |||
35 | #**************************************************************************** |
|
35 | #**************************************************************************** | |
36 | # Required modules |
|
36 | # Required modules | |
37 |
|
37 | |||
38 | # From the standard library |
|
38 | # From the standard library | |
39 | import __main__ |
|
39 | import __main__ | |
40 | import __builtin__ |
|
40 | import __builtin__ | |
41 | import os |
|
41 | import os | |
42 | import re |
|
42 | import re | |
43 | import sys |
|
43 | import sys | |
44 | import types |
|
44 | import types | |
45 | from pprint import pprint,pformat |
|
45 | from pprint import pprint,pformat | |
46 |
|
46 | |||
47 | # Our own |
|
47 | # Our own | |
48 | from IPython import DPyGetOpt |
|
48 | from IPython import DPyGetOpt | |
49 | from IPython.Struct import Struct |
|
49 | from IPython.Struct import Struct | |
50 | from IPython.OutputTrap import OutputTrap |
|
50 | from IPython.OutputTrap import OutputTrap | |
51 | from IPython.ConfigLoader import ConfigLoader |
|
51 | from IPython.ConfigLoader import ConfigLoader | |
52 | from IPython.iplib import InteractiveShell,qw_lol,import_fail_info |
|
52 | from IPython.iplib import InteractiveShell,qw_lol,import_fail_info | |
53 | from IPython.usage import cmd_line_usage,interactive_usage |
|
53 | from IPython.usage import cmd_line_usage,interactive_usage | |
54 | from IPython.Prompts import CachedOutput |
|
54 | from IPython.Prompts import CachedOutput | |
55 | from IPython.genutils import * |
|
55 | from IPython.genutils import * | |
56 |
|
56 | |||
57 | #----------------------------------------------------------------------------- |
|
57 | #----------------------------------------------------------------------------- | |
58 | def make_IPython(argv=None,user_ns=None,debug=1,rc_override=None, |
|
58 | def make_IPython(argv=None,user_ns=None,debug=1,rc_override=None, | |
59 | shell_class=InteractiveShell,embedded=False,**kw): |
|
59 | shell_class=InteractiveShell,embedded=False,**kw): | |
60 | """This is a dump of IPython into a single function. |
|
60 | """This is a dump of IPython into a single function. | |
61 |
|
61 | |||
62 | Later it will have to be broken up in a sensible manner. |
|
62 | Later it will have to be broken up in a sensible manner. | |
63 |
|
63 | |||
64 | Arguments: |
|
64 | Arguments: | |
65 |
|
65 | |||
66 | - argv: a list similar to sys.argv[1:]. It should NOT contain the desired |
|
66 | - argv: a list similar to sys.argv[1:]. It should NOT contain the desired | |
67 | script name, b/c DPyGetOpt strips the first argument only for the real |
|
67 | script name, b/c DPyGetOpt strips the first argument only for the real | |
68 | sys.argv. |
|
68 | sys.argv. | |
69 |
|
69 | |||
70 | - user_ns: a dict to be used as the user's namespace.""" |
|
70 | - user_ns: a dict to be used as the user's namespace.""" | |
71 |
|
71 | |||
72 | #---------------------------------------------------------------------- |
|
72 | #---------------------------------------------------------------------- | |
73 | # Defaults and initialization |
|
73 | # Defaults and initialization | |
74 |
|
74 | |||
75 | # For developer debugging, deactivates crash handler and uses pdb. |
|
75 | # For developer debugging, deactivates crash handler and uses pdb. | |
76 | DEVDEBUG = False |
|
76 | DEVDEBUG = False | |
77 |
|
77 | |||
78 | if argv is None: |
|
78 | if argv is None: | |
79 | argv = sys.argv |
|
79 | argv = sys.argv | |
80 |
|
80 | |||
81 | # __IP is the main global that lives throughout and represents the whole |
|
81 | # __IP is the main global that lives throughout and represents the whole | |
82 | # application. If the user redefines it, all bets are off as to what |
|
82 | # application. If the user redefines it, all bets are off as to what | |
83 | # happens. |
|
83 | # happens. | |
84 |
|
84 | |||
85 | # __IP is the name of he global which the caller will have accessible as |
|
85 | # __IP is the name of he global which the caller will have accessible as | |
86 | # __IP.name. We set its name via the first parameter passed to |
|
86 | # __IP.name. We set its name via the first parameter passed to | |
87 | # InteractiveShell: |
|
87 | # InteractiveShell: | |
88 |
|
88 | |||
89 | IP = shell_class('__IP',user_ns=user_ns,embedded=embedded,**kw) |
|
89 | IP = shell_class('__IP',user_ns=user_ns,embedded=embedded,**kw) | |
90 |
|
90 | |||
91 | # Put 'help' in the user namespace |
|
91 | # Put 'help' in the user namespace | |
92 | from site import _Helper |
|
92 | from site import _Helper | |
93 | IP.user_ns['help'] = _Helper() |
|
93 | IP.user_ns['help'] = _Helper() | |
94 |
|
94 | |||
95 | if DEVDEBUG: |
|
95 | if DEVDEBUG: | |
96 | # For developer debugging only (global flag) |
|
96 | # For developer debugging only (global flag) | |
97 | from IPython import ultraTB |
|
97 | from IPython import ultraTB | |
98 | sys.excepthook = ultraTB.VerboseTB(call_pdb=1) |
|
98 | sys.excepthook = ultraTB.VerboseTB(call_pdb=1) | |
99 | else: |
|
99 | else: | |
100 | # IPython itself shouldn't crash. This will produce a detailed |
|
100 | # IPython itself shouldn't crash. This will produce a detailed | |
101 | # post-mortem if it does |
|
101 | # post-mortem if it does | |
102 | from IPython import CrashHandler |
|
102 | from IPython import CrashHandler | |
103 | sys.excepthook = CrashHandler.CrashHandler(IP) |
|
103 | sys.excepthook = CrashHandler.CrashHandler(IP) | |
104 |
|
104 | |||
105 | IP.BANNER_PARTS = ['Python %s\n' |
|
105 | IP.BANNER_PARTS = ['Python %s\n' | |
106 | 'Type "copyright", "credits" or "license" ' |
|
106 | 'Type "copyright", "credits" or "license" ' | |
107 | 'for more information.\n' |
|
107 | 'for more information.\n' | |
108 | % (sys.version.split('\n')[0],), |
|
108 | % (sys.version.split('\n')[0],), | |
109 | "IPython %s -- An enhanced Interactive Python." |
|
109 | "IPython %s -- An enhanced Interactive Python." | |
110 | % (__version__,), |
|
110 | % (__version__,), | |
111 | """? -> Introduction to IPython's features. |
|
111 | """? -> Introduction to IPython's features. | |
112 | %magic -> Information about IPython's 'magic' % functions. |
|
112 | %magic -> Information about IPython's 'magic' % functions. | |
113 | help -> Python's own help system. |
|
113 | help -> Python's own help system. | |
114 | object? -> Details about 'object'. ?object also works, ?? prints more. |
|
114 | object? -> Details about 'object'. ?object also works, ?? prints more. | |
115 | """ ] |
|
115 | """ ] | |
116 |
|
116 | |||
117 | IP.usage = interactive_usage |
|
117 | IP.usage = interactive_usage | |
118 |
|
118 | |||
119 | # Platform-dependent suffix and directory names. We use _ipython instead |
|
119 | # Platform-dependent suffix and directory names. We use _ipython instead | |
120 | # of .ipython under win32 b/c there's software that breaks with .named |
|
120 | # of .ipython under win32 b/c there's software that breaks with .named | |
121 | # directories on that platform. |
|
121 | # directories on that platform. | |
122 | if os.name == 'posix': |
|
122 | if os.name == 'posix': | |
123 | rc_suffix = '' |
|
123 | rc_suffix = '' | |
124 | ipdir_def = '.ipython' |
|
124 | ipdir_def = '.ipython' | |
125 | else: |
|
125 | else: | |
126 | rc_suffix = '.ini' |
|
126 | rc_suffix = '.ini' | |
127 | ipdir_def = '_ipython' |
|
127 | ipdir_def = '_ipython' | |
128 |
|
128 | |||
129 | # default directory for configuration |
|
129 | # default directory for configuration | |
130 | ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR', |
|
130 | ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR', | |
131 | os.path.join(IP.home_dir,ipdir_def))) |
|
131 | os.path.join(IP.home_dir,ipdir_def))) | |
132 |
|
132 | |||
133 | # we need the directory where IPython itself is installed |
|
133 | # we need the directory where IPython itself is installed | |
134 | import IPython |
|
134 | import IPython | |
135 | IPython_dir = os.path.dirname(IPython.__file__) |
|
135 | IPython_dir = os.path.dirname(IPython.__file__) | |
136 | del IPython |
|
136 | del IPython | |
137 |
|
137 | |||
138 | #------------------------------------------------------------------------- |
|
138 | #------------------------------------------------------------------------- | |
139 | # Command line handling |
|
139 | # Command line handling | |
140 |
|
140 | |||
141 | # Valid command line options (uses DPyGetOpt syntax, like Perl's |
|
141 | # Valid command line options (uses DPyGetOpt syntax, like Perl's | |
142 | # GetOpt::Long) |
|
142 | # GetOpt::Long) | |
143 |
|
143 | |||
144 | # Any key not listed here gets deleted even if in the file (like session |
|
144 | # Any key not listed here gets deleted even if in the file (like session | |
145 | # or profile). That's deliberate, to maintain the rc namespace clean. |
|
145 | # or profile). That's deliberate, to maintain the rc namespace clean. | |
146 |
|
146 | |||
147 | # Each set of options appears twice: under _conv only the names are |
|
147 | # Each set of options appears twice: under _conv only the names are | |
148 | # listed, indicating which type they must be converted to when reading the |
|
148 | # listed, indicating which type they must be converted to when reading the | |
149 | # ipythonrc file. And under DPyGetOpt they are listed with the regular |
|
149 | # ipythonrc file. And under DPyGetOpt they are listed with the regular | |
150 | # DPyGetOpt syntax (=s,=i,:f,etc). |
|
150 | # DPyGetOpt syntax (=s,=i,:f,etc). | |
151 |
|
151 | |||
152 | # Make sure there's a space before each end of line (they get auto-joined!) |
|
152 | # Make sure there's a space before each end of line (they get auto-joined!) | |
153 | cmdline_opts = ('autocall! autoindent! automagic! banner! cache_size|cs=i ' |
|
153 | cmdline_opts = ('autocall! autoindent! automagic! banner! cache_size|cs=i ' | |
154 | 'c=s classic|cl color_info! colors=s confirm_exit! ' |
|
154 | 'c=s classic|cl color_info! colors=s confirm_exit! ' | |
155 | 'debug! deep_reload! editor=s log|l messages! nosep pdb! ' |
|
155 | 'debug! deep_reload! editor=s log|l messages! nosep pdb! ' | |
156 | 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s ' |
|
156 | 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s ' | |
157 | 'quick screen_length|sl=i prompts_pad_left=i ' |
|
157 | 'quick screen_length|sl=i prompts_pad_left=i ' | |
158 | 'logfile|lf=s logplay|lp=s profile|p=s ' |
|
158 | 'logfile|lf=s logplay|lp=s profile|p=s ' | |
159 | 'readline! readline_merge_completions! ' |
|
159 | 'readline! readline_merge_completions! ' | |
160 | 'readline_omit__names! ' |
|
160 | 'readline_omit__names! ' | |
161 | 'rcfile=s separate_in|si=s separate_out|so=s ' |
|
161 | 'rcfile=s separate_in|si=s separate_out|so=s ' | |
162 | 'separate_out2|so2=s xmode=s wildcards_case_sensitive! ' |
|
162 | 'separate_out2|so2=s xmode=s wildcards_case_sensitive! ' | |
163 | 'magic_docstrings system_verbose! ' |
|
163 | 'magic_docstrings system_verbose! ' | |
164 | 'multi_line_specials! ' |
|
164 | 'multi_line_specials! ' | |
165 | 'autoedit_syntax!') |
|
165 | 'autoedit_syntax!') | |
166 |
|
166 | |||
167 | # Options that can *only* appear at the cmd line (not in rcfiles). |
|
167 | # Options that can *only* appear at the cmd line (not in rcfiles). | |
168 |
|
168 | |||
169 | # The "ignore" option is a kludge so that Emacs buffers don't crash, since |
|
169 | # The "ignore" option is a kludge so that Emacs buffers don't crash, since | |
170 | # the 'C-c !' command in emacs automatically appends a -i option at the end. |
|
170 | # the 'C-c !' command in emacs automatically appends a -i option at the end. | |
171 | cmdline_only = ('help ignore|i ipythondir=s Version upgrade ' |
|
171 | cmdline_only = ('help ignore|i ipythondir=s Version upgrade ' | |
172 | 'gthread! qthread! wthread! pylab! tk!') |
|
172 | 'gthread! qthread! wthread! pylab! tk!') | |
173 |
|
173 | |||
174 | # Build the actual name list to be used by DPyGetOpt |
|
174 | # Build the actual name list to be used by DPyGetOpt | |
175 | opts_names = qw(cmdline_opts) + qw(cmdline_only) |
|
175 | opts_names = qw(cmdline_opts) + qw(cmdline_only) | |
176 |
|
176 | |||
177 | # Set sensible command line defaults. |
|
177 | # Set sensible command line defaults. | |
178 | # This should have everything from cmdline_opts and cmdline_only |
|
178 | # This should have everything from cmdline_opts and cmdline_only | |
179 | opts_def = Struct(autocall = 1, |
|
179 | opts_def = Struct(autocall = 1, | |
|
180 | autoedit_syntax = 1, | |||
180 | autoindent=0, |
|
181 | autoindent=0, | |
181 | automagic = 1, |
|
182 | automagic = 1, | |
182 | banner = 1, |
|
183 | banner = 1, | |
183 | cache_size = 1000, |
|
184 | cache_size = 1000, | |
184 | c = '', |
|
185 | c = '', | |
185 | classic = 0, |
|
186 | classic = 0, | |
186 | colors = 'NoColor', |
|
187 | colors = 'NoColor', | |
187 | color_info = 0, |
|
188 | color_info = 0, | |
188 | confirm_exit = 1, |
|
189 | confirm_exit = 1, | |
189 | debug = 0, |
|
190 | debug = 0, | |
190 | deep_reload = 0, |
|
191 | deep_reload = 0, | |
191 | editor = '0', |
|
192 | editor = '0', | |
192 | help = 0, |
|
193 | help = 0, | |
193 | ignore = 0, |
|
194 | ignore = 0, | |
194 | ipythondir = ipythondir, |
|
195 | ipythondir = ipythondir, | |
195 | log = 0, |
|
196 | log = 0, | |
196 | logfile = '', |
|
197 | logfile = '', | |
197 | logplay = '', |
|
198 | logplay = '', | |
198 | multi_line_specials = 1, |
|
199 | multi_line_specials = 1, | |
199 | messages = 1, |
|
200 | messages = 1, | |
200 | nosep = 0, |
|
201 | nosep = 0, | |
201 | pdb = 0, |
|
202 | pdb = 0, | |
202 | pprint = 0, |
|
203 | pprint = 0, | |
203 | profile = '', |
|
204 | profile = '', | |
204 | prompt_in1 = 'In [\\#]: ', |
|
205 | prompt_in1 = 'In [\\#]: ', | |
205 | prompt_in2 = ' .\\D.: ', |
|
206 | prompt_in2 = ' .\\D.: ', | |
206 | prompt_out = 'Out[\\#]: ', |
|
207 | prompt_out = 'Out[\\#]: ', | |
207 | prompts_pad_left = 1, |
|
208 | prompts_pad_left = 1, | |
208 | quick = 0, |
|
209 | quick = 0, | |
209 | readline = 1, |
|
210 | readline = 1, | |
210 | readline_merge_completions = 1, |
|
211 | readline_merge_completions = 1, | |
211 | readline_omit__names = 0, |
|
212 | readline_omit__names = 0, | |
212 | rcfile = 'ipythonrc' + rc_suffix, |
|
213 | rcfile = 'ipythonrc' + rc_suffix, | |
213 | screen_length = 0, |
|
214 | screen_length = 0, | |
214 | separate_in = '\n', |
|
215 | separate_in = '\n', | |
215 | separate_out = '\n', |
|
216 | separate_out = '\n', | |
216 | separate_out2 = '', |
|
217 | separate_out2 = '', | |
217 | system_verbose = 0, |
|
218 | system_verbose = 0, | |
218 | gthread = 0, |
|
219 | gthread = 0, | |
219 | qthread = 0, |
|
220 | qthread = 0, | |
220 | wthread = 0, |
|
221 | wthread = 0, | |
221 | pylab = 0, |
|
222 | pylab = 0, | |
222 | tk = 0, |
|
223 | tk = 0, | |
223 | upgrade = 0, |
|
224 | upgrade = 0, | |
224 | Version = 0, |
|
225 | Version = 0, | |
225 | xmode = 'Verbose', |
|
226 | xmode = 'Verbose', | |
226 | wildcards_case_sensitive = 1, |
|
227 | wildcards_case_sensitive = 1, | |
227 | magic_docstrings = 0, # undocumented, for doc generation |
|
228 | magic_docstrings = 0, # undocumented, for doc generation | |
228 | autoedit_syntax = 0, |
|
|||
229 | ) |
|
229 | ) | |
230 |
|
230 | |||
231 | # Things that will *only* appear in rcfiles (not at the command line). |
|
231 | # Things that will *only* appear in rcfiles (not at the command line). | |
232 | # Make sure there's a space before each end of line (they get auto-joined!) |
|
232 | # Make sure there's a space before each end of line (they get auto-joined!) | |
233 | rcfile_opts = { qwflat: 'include import_mod import_all execfile ', |
|
233 | rcfile_opts = { qwflat: 'include import_mod import_all execfile ', | |
234 | qw_lol: 'import_some ', |
|
234 | qw_lol: 'import_some ', | |
235 | # for things with embedded whitespace: |
|
235 | # for things with embedded whitespace: | |
236 | list_strings:'execute alias readline_parse_and_bind ', |
|
236 | list_strings:'execute alias readline_parse_and_bind ', | |
237 | # Regular strings need no conversion: |
|
237 | # Regular strings need no conversion: | |
238 | None:'readline_remove_delims ', |
|
238 | None:'readline_remove_delims ', | |
239 | } |
|
239 | } | |
240 | # Default values for these |
|
240 | # Default values for these | |
241 | rc_def = Struct(include = [], |
|
241 | rc_def = Struct(include = [], | |
242 | import_mod = [], |
|
242 | import_mod = [], | |
243 | import_all = [], |
|
243 | import_all = [], | |
244 | import_some = [[]], |
|
244 | import_some = [[]], | |
245 | execute = [], |
|
245 | execute = [], | |
246 | execfile = [], |
|
246 | execfile = [], | |
247 | alias = [], |
|
247 | alias = [], | |
248 | readline_parse_and_bind = [], |
|
248 | readline_parse_and_bind = [], | |
249 | readline_remove_delims = '', |
|
249 | readline_remove_delims = '', | |
250 | ) |
|
250 | ) | |
251 |
|
251 | |||
252 | # Build the type conversion dictionary from the above tables: |
|
252 | # Build the type conversion dictionary from the above tables: | |
253 | typeconv = rcfile_opts.copy() |
|
253 | typeconv = rcfile_opts.copy() | |
254 | typeconv.update(optstr2types(cmdline_opts)) |
|
254 | typeconv.update(optstr2types(cmdline_opts)) | |
255 |
|
255 | |||
256 | # FIXME: the None key appears in both, put that back together by hand. Ugly! |
|
256 | # FIXME: the None key appears in both, put that back together by hand. Ugly! | |
257 | typeconv[None] += ' ' + rcfile_opts[None] |
|
257 | typeconv[None] += ' ' + rcfile_opts[None] | |
258 |
|
258 | |||
259 | # Remove quotes at ends of all strings (used to protect spaces) |
|
259 | # Remove quotes at ends of all strings (used to protect spaces) | |
260 | typeconv[unquote_ends] = typeconv[None] |
|
260 | typeconv[unquote_ends] = typeconv[None] | |
261 | del typeconv[None] |
|
261 | del typeconv[None] | |
262 |
|
262 | |||
263 | # Build the list we'll use to make all config decisions with defaults: |
|
263 | # Build the list we'll use to make all config decisions with defaults: | |
264 | opts_all = opts_def.copy() |
|
264 | opts_all = opts_def.copy() | |
265 | opts_all.update(rc_def) |
|
265 | opts_all.update(rc_def) | |
266 |
|
266 | |||
267 | # Build conflict resolver for recursive loading of config files: |
|
267 | # Build conflict resolver for recursive loading of config files: | |
268 | # - preserve means the outermost file maintains the value, it is not |
|
268 | # - preserve means the outermost file maintains the value, it is not | |
269 | # overwritten if an included file has the same key. |
|
269 | # overwritten if an included file has the same key. | |
270 | # - add_flip applies + to the two values, so it better make sense to add |
|
270 | # - add_flip applies + to the two values, so it better make sense to add | |
271 | # those types of keys. But it flips them first so that things loaded |
|
271 | # those types of keys. But it flips them first so that things loaded | |
272 | # deeper in the inclusion chain have lower precedence. |
|
272 | # deeper in the inclusion chain have lower precedence. | |
273 | conflict = {'preserve': ' '.join([ typeconv[int], |
|
273 | conflict = {'preserve': ' '.join([ typeconv[int], | |
274 | typeconv[unquote_ends] ]), |
|
274 | typeconv[unquote_ends] ]), | |
275 | 'add_flip': ' '.join([ typeconv[qwflat], |
|
275 | 'add_flip': ' '.join([ typeconv[qwflat], | |
276 | typeconv[qw_lol], |
|
276 | typeconv[qw_lol], | |
277 | typeconv[list_strings] ]) |
|
277 | typeconv[list_strings] ]) | |
278 | } |
|
278 | } | |
279 |
|
279 | |||
280 | # Now actually process the command line |
|
280 | # Now actually process the command line | |
281 | getopt = DPyGetOpt.DPyGetOpt() |
|
281 | getopt = DPyGetOpt.DPyGetOpt() | |
282 | getopt.setIgnoreCase(0) |
|
282 | getopt.setIgnoreCase(0) | |
283 |
|
283 | |||
284 | getopt.parseConfiguration(opts_names) |
|
284 | getopt.parseConfiguration(opts_names) | |
285 |
|
285 | |||
286 | try: |
|
286 | try: | |
287 | getopt.processArguments(argv) |
|
287 | getopt.processArguments(argv) | |
288 | except: |
|
288 | except: | |
289 | print cmd_line_usage |
|
289 | print cmd_line_usage | |
290 | warn('\nError in Arguments: ' + `sys.exc_value`) |
|
290 | warn('\nError in Arguments: ' + `sys.exc_value`) | |
291 | sys.exit(1) |
|
291 | sys.exit(1) | |
292 |
|
292 | |||
293 | # convert the options dict to a struct for much lighter syntax later |
|
293 | # convert the options dict to a struct for much lighter syntax later | |
294 | opts = Struct(getopt.optionValues) |
|
294 | opts = Struct(getopt.optionValues) | |
295 | args = getopt.freeValues |
|
295 | args = getopt.freeValues | |
296 |
|
296 | |||
297 | # this is the struct (which has default values at this point) with which |
|
297 | # this is the struct (which has default values at this point) with which | |
298 | # we make all decisions: |
|
298 | # we make all decisions: | |
299 | opts_all.update(opts) |
|
299 | opts_all.update(opts) | |
300 |
|
300 | |||
301 | # Options that force an immediate exit |
|
301 | # Options that force an immediate exit | |
302 | if opts_all.help: |
|
302 | if opts_all.help: | |
303 | page(cmd_line_usage) |
|
303 | page(cmd_line_usage) | |
304 | sys.exit() |
|
304 | sys.exit() | |
305 |
|
305 | |||
306 | if opts_all.Version: |
|
306 | if opts_all.Version: | |
307 | print __version__ |
|
307 | print __version__ | |
308 | sys.exit() |
|
308 | sys.exit() | |
309 |
|
309 | |||
310 | if opts_all.magic_docstrings: |
|
310 | if opts_all.magic_docstrings: | |
311 | IP.magic_magic('-latex') |
|
311 | IP.magic_magic('-latex') | |
312 | sys.exit() |
|
312 | sys.exit() | |
313 |
|
313 | |||
314 | # Create user config directory if it doesn't exist. This must be done |
|
314 | # Create user config directory if it doesn't exist. This must be done | |
315 | # *after* getting the cmd line options. |
|
315 | # *after* getting the cmd line options. | |
316 | if not os.path.isdir(opts_all.ipythondir): |
|
316 | if not os.path.isdir(opts_all.ipythondir): | |
317 | IP.user_setup(opts_all.ipythondir,rc_suffix,'install') |
|
317 | IP.user_setup(opts_all.ipythondir,rc_suffix,'install') | |
318 |
|
318 | |||
319 | # upgrade user config files while preserving a copy of the originals |
|
319 | # upgrade user config files while preserving a copy of the originals | |
320 | if opts_all.upgrade: |
|
320 | if opts_all.upgrade: | |
321 | IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade') |
|
321 | IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade') | |
322 |
|
322 | |||
323 | # check mutually exclusive options in the *original* command line |
|
323 | # check mutually exclusive options in the *original* command line | |
324 | mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'), |
|
324 | mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'), | |
325 | qw('classic profile'),qw('classic rcfile')]) |
|
325 | qw('classic profile'),qw('classic rcfile')]) | |
326 |
|
326 | |||
327 | # default logfilename used when -log is called. |
|
327 | # default logfilename used when -log is called. | |
328 | IP.LOGDEF = 'ipython.log' |
|
328 | IP.LOGDEF = 'ipython.log' | |
329 |
|
329 | |||
330 | #--------------------------------------------------------------------------- |
|
330 | #--------------------------------------------------------------------------- | |
331 | # Log replay |
|
331 | # Log replay | |
332 |
|
332 | |||
333 | # if -logplay, we need to 'become' the other session. That basically means |
|
333 | # if -logplay, we need to 'become' the other session. That basically means | |
334 | # replacing the current command line environment with that of the old |
|
334 | # replacing the current command line environment with that of the old | |
335 | # session and moving on. |
|
335 | # session and moving on. | |
336 |
|
336 | |||
337 | # this is needed so that later we know we're in session reload mode, as |
|
337 | # this is needed so that later we know we're in session reload mode, as | |
338 | # opts_all will get overwritten: |
|
338 | # opts_all will get overwritten: | |
339 | load_logplay = 0 |
|
339 | load_logplay = 0 | |
340 |
|
340 | |||
341 | if opts_all.logplay: |
|
341 | if opts_all.logplay: | |
342 | load_logplay = opts_all.logplay |
|
342 | load_logplay = opts_all.logplay | |
343 | opts_debug_save = opts_all.debug |
|
343 | opts_debug_save = opts_all.debug | |
344 | try: |
|
344 | try: | |
345 | logplay = open(opts_all.logplay) |
|
345 | logplay = open(opts_all.logplay) | |
346 | except IOError: |
|
346 | except IOError: | |
347 | if opts_all.debug: IP.InteractiveTB() |
|
347 | if opts_all.debug: IP.InteractiveTB() | |
348 | warn('Could not open logplay file '+`opts_all.logplay`) |
|
348 | warn('Could not open logplay file '+`opts_all.logplay`) | |
349 | # restore state as if nothing had happened and move on, but make |
|
349 | # restore state as if nothing had happened and move on, but make | |
350 | # sure that later we don't try to actually load the session file |
|
350 | # sure that later we don't try to actually load the session file | |
351 | logplay = None |
|
351 | logplay = None | |
352 | load_logplay = 0 |
|
352 | load_logplay = 0 | |
353 | del opts_all.logplay |
|
353 | del opts_all.logplay | |
354 | else: |
|
354 | else: | |
355 | try: |
|
355 | try: | |
356 | logplay.readline() |
|
356 | logplay.readline() | |
357 | logplay.readline(); |
|
357 | logplay.readline(); | |
358 | # this reloads that session's command line |
|
358 | # this reloads that session's command line | |
359 | cmd = logplay.readline()[6:] |
|
359 | cmd = logplay.readline()[6:] | |
360 | exec cmd |
|
360 | exec cmd | |
361 | # restore the true debug flag given so that the process of |
|
361 | # restore the true debug flag given so that the process of | |
362 | # session loading itself can be monitored. |
|
362 | # session loading itself can be monitored. | |
363 | opts.debug = opts_debug_save |
|
363 | opts.debug = opts_debug_save | |
364 | # save the logplay flag so later we don't overwrite the log |
|
364 | # save the logplay flag so later we don't overwrite the log | |
365 | opts.logplay = load_logplay |
|
365 | opts.logplay = load_logplay | |
366 | # now we must update our own structure with defaults |
|
366 | # now we must update our own structure with defaults | |
367 | opts_all.update(opts) |
|
367 | opts_all.update(opts) | |
368 | # now load args |
|
368 | # now load args | |
369 | cmd = logplay.readline()[6:] |
|
369 | cmd = logplay.readline()[6:] | |
370 | exec cmd |
|
370 | exec cmd | |
371 | logplay.close() |
|
371 | logplay.close() | |
372 | except: |
|
372 | except: | |
373 | logplay.close() |
|
373 | logplay.close() | |
374 | if opts_all.debug: IP.InteractiveTB() |
|
374 | if opts_all.debug: IP.InteractiveTB() | |
375 | warn("Logplay file lacking full configuration information.\n" |
|
375 | warn("Logplay file lacking full configuration information.\n" | |
376 | "I'll try to read it, but some things may not work.") |
|
376 | "I'll try to read it, but some things may not work.") | |
377 |
|
377 | |||
378 | #------------------------------------------------------------------------- |
|
378 | #------------------------------------------------------------------------- | |
379 | # set up output traps: catch all output from files, being run, modules |
|
379 | # set up output traps: catch all output from files, being run, modules | |
380 | # loaded, etc. Then give it to the user in a clean form at the end. |
|
380 | # loaded, etc. Then give it to the user in a clean form at the end. | |
381 |
|
381 | |||
382 | msg_out = 'Output messages. ' |
|
382 | msg_out = 'Output messages. ' | |
383 | msg_err = 'Error messages. ' |
|
383 | msg_err = 'Error messages. ' | |
384 | msg_sep = '\n' |
|
384 | msg_sep = '\n' | |
385 | msg = Struct(config = OutputTrap('Configuration Loader',msg_out, |
|
385 | msg = Struct(config = OutputTrap('Configuration Loader',msg_out, | |
386 | msg_err,msg_sep,debug, |
|
386 | msg_err,msg_sep,debug, | |
387 | quiet_out=1), |
|
387 | quiet_out=1), | |
388 | user_exec = OutputTrap('User File Execution',msg_out, |
|
388 | user_exec = OutputTrap('User File Execution',msg_out, | |
389 | msg_err,msg_sep,debug), |
|
389 | msg_err,msg_sep,debug), | |
390 | logplay = OutputTrap('Log Loader',msg_out, |
|
390 | logplay = OutputTrap('Log Loader',msg_out, | |
391 | msg_err,msg_sep,debug), |
|
391 | msg_err,msg_sep,debug), | |
392 | summary = '' |
|
392 | summary = '' | |
393 | ) |
|
393 | ) | |
394 |
|
394 | |||
395 | #------------------------------------------------------------------------- |
|
395 | #------------------------------------------------------------------------- | |
396 | # Process user ipythonrc-type configuration files |
|
396 | # Process user ipythonrc-type configuration files | |
397 |
|
397 | |||
398 | # turn on output trapping and log to msg.config |
|
398 | # turn on output trapping and log to msg.config | |
399 | # remember that with debug on, trapping is actually disabled |
|
399 | # remember that with debug on, trapping is actually disabled | |
400 | msg.config.trap_all() |
|
400 | msg.config.trap_all() | |
401 |
|
401 | |||
402 | # look for rcfile in current or default directory |
|
402 | # look for rcfile in current or default directory | |
403 | try: |
|
403 | try: | |
404 | opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir) |
|
404 | opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir) | |
405 | except IOError: |
|
405 | except IOError: | |
406 | if opts_all.debug: IP.InteractiveTB() |
|
406 | if opts_all.debug: IP.InteractiveTB() | |
407 | warn('Configuration file %s not found. Ignoring request.' |
|
407 | warn('Configuration file %s not found. Ignoring request.' | |
408 | % (opts_all.rcfile) ) |
|
408 | % (opts_all.rcfile) ) | |
409 |
|
409 | |||
410 | # 'profiles' are a shorthand notation for config filenames |
|
410 | # 'profiles' are a shorthand notation for config filenames | |
411 | if opts_all.profile: |
|
411 | if opts_all.profile: | |
412 | try: |
|
412 | try: | |
413 | opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile |
|
413 | opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile | |
414 | + rc_suffix, |
|
414 | + rc_suffix, | |
415 | opts_all.ipythondir) |
|
415 | opts_all.ipythondir) | |
416 | except IOError: |
|
416 | except IOError: | |
417 | if opts_all.debug: IP.InteractiveTB() |
|
417 | if opts_all.debug: IP.InteractiveTB() | |
418 | opts.profile = '' # remove profile from options if invalid |
|
418 | opts.profile = '' # remove profile from options if invalid | |
419 | warn('Profile configuration file %s not found. Ignoring request.' |
|
419 | warn('Profile configuration file %s not found. Ignoring request.' | |
420 | % (opts_all.profile) ) |
|
420 | % (opts_all.profile) ) | |
421 |
|
421 | |||
422 | # load the config file |
|
422 | # load the config file | |
423 | rcfiledata = None |
|
423 | rcfiledata = None | |
424 | if opts_all.quick: |
|
424 | if opts_all.quick: | |
425 | print 'Launching IPython in quick mode. No config file read.' |
|
425 | print 'Launching IPython in quick mode. No config file read.' | |
426 | elif opts_all.classic: |
|
426 | elif opts_all.classic: | |
427 | print 'Launching IPython in classic mode. No config file read.' |
|
427 | print 'Launching IPython in classic mode. No config file read.' | |
428 | elif opts_all.rcfile: |
|
428 | elif opts_all.rcfile: | |
429 | try: |
|
429 | try: | |
430 | cfg_loader = ConfigLoader(conflict) |
|
430 | cfg_loader = ConfigLoader(conflict) | |
431 | rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv, |
|
431 | rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv, | |
432 | 'include',opts_all.ipythondir, |
|
432 | 'include',opts_all.ipythondir, | |
433 | purge = 1, |
|
433 | purge = 1, | |
434 | unique = conflict['preserve']) |
|
434 | unique = conflict['preserve']) | |
435 | except: |
|
435 | except: | |
436 | IP.InteractiveTB() |
|
436 | IP.InteractiveTB() | |
437 | warn('Problems loading configuration file '+ |
|
437 | warn('Problems loading configuration file '+ | |
438 | `opts_all.rcfile`+ |
|
438 | `opts_all.rcfile`+ | |
439 | '\nStarting with default -bare bones- configuration.') |
|
439 | '\nStarting with default -bare bones- configuration.') | |
440 | else: |
|
440 | else: | |
441 | warn('No valid configuration file found in either currrent directory\n'+ |
|
441 | warn('No valid configuration file found in either currrent directory\n'+ | |
442 | 'or in the IPython config. directory: '+`opts_all.ipythondir`+ |
|
442 | 'or in the IPython config. directory: '+`opts_all.ipythondir`+ | |
443 | '\nProceeding with internal defaults.') |
|
443 | '\nProceeding with internal defaults.') | |
444 |
|
444 | |||
445 | #------------------------------------------------------------------------ |
|
445 | #------------------------------------------------------------------------ | |
446 | # Set exception handlers in mode requested by user. |
|
446 | # Set exception handlers in mode requested by user. | |
447 | otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode |
|
447 | otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode | |
448 | IP.magic_xmode(opts_all.xmode) |
|
448 | IP.magic_xmode(opts_all.xmode) | |
449 | otrap.release_out() |
|
449 | otrap.release_out() | |
450 |
|
450 | |||
451 | #------------------------------------------------------------------------ |
|
451 | #------------------------------------------------------------------------ | |
452 | # Execute user config |
|
452 | # Execute user config | |
453 |
|
453 | |||
454 | # Create a valid config structure with the right precedence order: |
|
454 | # Create a valid config structure with the right precedence order: | |
455 | # defaults < rcfile < command line. This needs to be in the instance, so |
|
455 | # defaults < rcfile < command line. This needs to be in the instance, so | |
456 | # that method calls below that rely on it find it. |
|
456 | # that method calls below that rely on it find it. | |
457 | IP.rc = rc_def.copy() |
|
457 | IP.rc = rc_def.copy() | |
458 |
|
458 | |||
459 | # Work with a local alias inside this routine to avoid unnecessary |
|
459 | # Work with a local alias inside this routine to avoid unnecessary | |
460 | # attribute lookups. |
|
460 | # attribute lookups. | |
461 | IP_rc = IP.rc |
|
461 | IP_rc = IP.rc | |
462 |
|
462 | |||
463 | IP_rc.update(opts_def) |
|
463 | IP_rc.update(opts_def) | |
464 | if rcfiledata: |
|
464 | if rcfiledata: | |
465 | # now we can update |
|
465 | # now we can update | |
466 | IP_rc.update(rcfiledata) |
|
466 | IP_rc.update(rcfiledata) | |
467 | IP_rc.update(opts) |
|
467 | IP_rc.update(opts) | |
468 | IP_rc.update(rc_override) |
|
468 | IP_rc.update(rc_override) | |
469 |
|
469 | |||
470 | # Store the original cmd line for reference: |
|
470 | # Store the original cmd line for reference: | |
471 | IP_rc.opts = opts |
|
471 | IP_rc.opts = opts | |
472 | IP_rc.args = args |
|
472 | IP_rc.args = args | |
473 |
|
473 | |||
474 | # create a *runtime* Struct like rc for holding parameters which may be |
|
474 | # create a *runtime* Struct like rc for holding parameters which may be | |
475 | # created and/or modified by runtime user extensions. |
|
475 | # created and/or modified by runtime user extensions. | |
476 | IP.runtime_rc = Struct() |
|
476 | IP.runtime_rc = Struct() | |
477 |
|
477 | |||
478 | # from this point on, all config should be handled through IP_rc, |
|
478 | # from this point on, all config should be handled through IP_rc, | |
479 | # opts* shouldn't be used anymore. |
|
479 | # opts* shouldn't be used anymore. | |
480 |
|
480 | |||
481 | # add personal .ipython dir to sys.path so that users can put things in |
|
481 | # add personal .ipython dir to sys.path so that users can put things in | |
482 | # there for customization |
|
482 | # there for customization | |
483 | sys.path.append(IP_rc.ipythondir) |
|
483 | sys.path.append(IP_rc.ipythondir) | |
484 | sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran |
|
484 | sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran | |
485 |
|
485 | |||
486 | # update IP_rc with some special things that need manual |
|
486 | # update IP_rc with some special things that need manual | |
487 | # tweaks. Basically options which affect other options. I guess this |
|
487 | # tweaks. Basically options which affect other options. I guess this | |
488 | # should just be written so that options are fully orthogonal and we |
|
488 | # should just be written so that options are fully orthogonal and we | |
489 | # wouldn't worry about this stuff! |
|
489 | # wouldn't worry about this stuff! | |
490 |
|
490 | |||
491 | if IP_rc.classic: |
|
491 | if IP_rc.classic: | |
492 | IP_rc.quick = 1 |
|
492 | IP_rc.quick = 1 | |
493 | IP_rc.cache_size = 0 |
|
493 | IP_rc.cache_size = 0 | |
494 | IP_rc.pprint = 0 |
|
494 | IP_rc.pprint = 0 | |
495 | IP_rc.prompt_in1 = '>>> ' |
|
495 | IP_rc.prompt_in1 = '>>> ' | |
496 | IP_rc.prompt_in2 = '... ' |
|
496 | IP_rc.prompt_in2 = '... ' | |
497 | IP_rc.prompt_out = '' |
|
497 | IP_rc.prompt_out = '' | |
498 | IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' |
|
498 | IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' | |
499 | IP_rc.colors = 'NoColor' |
|
499 | IP_rc.colors = 'NoColor' | |
500 | IP_rc.xmode = 'Plain' |
|
500 | IP_rc.xmode = 'Plain' | |
501 |
|
501 | |||
502 | # configure readline |
|
502 | # configure readline | |
503 | # Define the history file for saving commands in between sessions |
|
503 | # Define the history file for saving commands in between sessions | |
504 | if IP_rc.profile: |
|
504 | if IP_rc.profile: | |
505 | histfname = 'history-%s' % IP_rc.profile |
|
505 | histfname = 'history-%s' % IP_rc.profile | |
506 | else: |
|
506 | else: | |
507 | histfname = 'history' |
|
507 | histfname = 'history' | |
508 | IP.histfile = os.path.join(opts_all.ipythondir,histfname) |
|
508 | IP.histfile = os.path.join(opts_all.ipythondir,histfname) | |
509 |
|
509 | |||
510 | # update exception handlers with rc file status |
|
510 | # update exception handlers with rc file status | |
511 | otrap.trap_out() # I don't want these messages ever. |
|
511 | otrap.trap_out() # I don't want these messages ever. | |
512 | IP.magic_xmode(IP_rc.xmode) |
|
512 | IP.magic_xmode(IP_rc.xmode) | |
513 | otrap.release_out() |
|
513 | otrap.release_out() | |
514 |
|
514 | |||
515 | # activate logging if requested and not reloading a log |
|
515 | # activate logging if requested and not reloading a log | |
516 | if IP_rc.logplay: |
|
516 | if IP_rc.logplay: | |
517 | IP.magic_logstart(IP_rc.logplay + ' append') |
|
517 | IP.magic_logstart(IP_rc.logplay + ' append') | |
518 | elif IP_rc.logfile: |
|
518 | elif IP_rc.logfile: | |
519 | IP.magic_logstart(IP_rc.logfile) |
|
519 | IP.magic_logstart(IP_rc.logfile) | |
520 | elif IP_rc.log: |
|
520 | elif IP_rc.log: | |
521 | IP.magic_logstart() |
|
521 | IP.magic_logstart() | |
522 |
|
522 | |||
523 | # find user editor so that it we don't have to look it up constantly |
|
523 | # find user editor so that it we don't have to look it up constantly | |
524 | if IP_rc.editor.strip()=='0': |
|
524 | if IP_rc.editor.strip()=='0': | |
525 | try: |
|
525 | try: | |
526 | ed = os.environ['EDITOR'] |
|
526 | ed = os.environ['EDITOR'] | |
527 | except KeyError: |
|
527 | except KeyError: | |
528 | if os.name == 'posix': |
|
528 | if os.name == 'posix': | |
529 | ed = 'vi' # the only one guaranteed to be there! |
|
529 | ed = 'vi' # the only one guaranteed to be there! | |
530 | else: |
|
530 | else: | |
531 | ed = 'notepad' # same in Windows! |
|
531 | ed = 'notepad' # same in Windows! | |
532 | IP_rc.editor = ed |
|
532 | IP_rc.editor = ed | |
533 |
|
533 | |||
534 | # Keep track of whether this is an embedded instance or not (useful for |
|
534 | # Keep track of whether this is an embedded instance or not (useful for | |
535 | # post-mortems). |
|
535 | # post-mortems). | |
536 | IP_rc.embedded = IP.embedded |
|
536 | IP_rc.embedded = IP.embedded | |
537 |
|
537 | |||
538 | # Recursive reload |
|
538 | # Recursive reload | |
539 | try: |
|
539 | try: | |
540 | from IPython import deep_reload |
|
540 | from IPython import deep_reload | |
541 | if IP_rc.deep_reload: |
|
541 | if IP_rc.deep_reload: | |
542 | __builtin__.reload = deep_reload.reload |
|
542 | __builtin__.reload = deep_reload.reload | |
543 | else: |
|
543 | else: | |
544 | __builtin__.dreload = deep_reload.reload |
|
544 | __builtin__.dreload = deep_reload.reload | |
545 | del deep_reload |
|
545 | del deep_reload | |
546 | except ImportError: |
|
546 | except ImportError: | |
547 | pass |
|
547 | pass | |
548 |
|
548 | |||
549 | # Save the current state of our namespace so that the interactive shell |
|
549 | # Save the current state of our namespace so that the interactive shell | |
550 | # can later know which variables have been created by us from config files |
|
550 | # can later know which variables have been created by us from config files | |
551 | # and loading. This way, loading a file (in any way) is treated just like |
|
551 | # and loading. This way, loading a file (in any way) is treated just like | |
552 | # defining things on the command line, and %who works as expected. |
|
552 | # defining things on the command line, and %who works as expected. | |
553 |
|
553 | |||
554 | # DON'T do anything that affects the namespace beyond this point! |
|
554 | # DON'T do anything that affects the namespace beyond this point! | |
555 | IP.internal_ns.update(__main__.__dict__) |
|
555 | IP.internal_ns.update(__main__.__dict__) | |
556 |
|
556 | |||
557 | #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who |
|
557 | #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who | |
558 |
|
558 | |||
559 | # Now run through the different sections of the users's config |
|
559 | # Now run through the different sections of the users's config | |
560 | if IP_rc.debug: |
|
560 | if IP_rc.debug: | |
561 | print 'Trying to execute the following configuration structure:' |
|
561 | print 'Trying to execute the following configuration structure:' | |
562 | print '(Things listed first are deeper in the inclusion tree and get' |
|
562 | print '(Things listed first are deeper in the inclusion tree and get' | |
563 | print 'loaded first).\n' |
|
563 | print 'loaded first).\n' | |
564 | pprint(IP_rc.__dict__) |
|
564 | pprint(IP_rc.__dict__) | |
565 |
|
565 | |||
566 | for mod in IP_rc.import_mod: |
|
566 | for mod in IP_rc.import_mod: | |
567 | try: |
|
567 | try: | |
568 | exec 'import '+mod in IP.user_ns |
|
568 | exec 'import '+mod in IP.user_ns | |
569 | except : |
|
569 | except : | |
570 | IP.InteractiveTB() |
|
570 | IP.InteractiveTB() | |
571 | import_fail_info(mod) |
|
571 | import_fail_info(mod) | |
572 |
|
572 | |||
573 | for mod_fn in IP_rc.import_some: |
|
573 | for mod_fn in IP_rc.import_some: | |
574 | if mod_fn == []: break |
|
574 | if mod_fn == []: break | |
575 | mod,fn = mod_fn[0],','.join(mod_fn[1:]) |
|
575 | mod,fn = mod_fn[0],','.join(mod_fn[1:]) | |
576 | try: |
|
576 | try: | |
577 | exec 'from '+mod+' import '+fn in IP.user_ns |
|
577 | exec 'from '+mod+' import '+fn in IP.user_ns | |
578 | except : |
|
578 | except : | |
579 | IP.InteractiveTB() |
|
579 | IP.InteractiveTB() | |
580 | import_fail_info(mod,fn) |
|
580 | import_fail_info(mod,fn) | |
581 |
|
581 | |||
582 | for mod in IP_rc.import_all: |
|
582 | for mod in IP_rc.import_all: | |
583 | try: |
|
583 | try: | |
584 | exec 'from '+mod+' import *' in IP.user_ns |
|
584 | exec 'from '+mod+' import *' in IP.user_ns | |
585 | except : |
|
585 | except : | |
586 | IP.InteractiveTB() |
|
586 | IP.InteractiveTB() | |
587 | import_fail_info(mod) |
|
587 | import_fail_info(mod) | |
588 |
|
588 | |||
589 | for code in IP_rc.execute: |
|
589 | for code in IP_rc.execute: | |
590 | try: |
|
590 | try: | |
591 | exec code in IP.user_ns |
|
591 | exec code in IP.user_ns | |
592 | except: |
|
592 | except: | |
593 | IP.InteractiveTB() |
|
593 | IP.InteractiveTB() | |
594 | warn('Failure executing code: ' + `code`) |
|
594 | warn('Failure executing code: ' + `code`) | |
595 |
|
595 | |||
596 | # Execute the files the user wants in ipythonrc |
|
596 | # Execute the files the user wants in ipythonrc | |
597 | for file in IP_rc.execfile: |
|
597 | for file in IP_rc.execfile: | |
598 | try: |
|
598 | try: | |
599 | file = filefind(file,sys.path+[IPython_dir]) |
|
599 | file = filefind(file,sys.path+[IPython_dir]) | |
600 | except IOError: |
|
600 | except IOError: | |
601 | warn(itpl('File $file not found. Skipping it.')) |
|
601 | warn(itpl('File $file not found. Skipping it.')) | |
602 | else: |
|
602 | else: | |
603 | IP.safe_execfile(os.path.expanduser(file),IP.user_ns) |
|
603 | IP.safe_execfile(os.path.expanduser(file),IP.user_ns) | |
604 |
|
604 | |||
605 | # release stdout and stderr and save config log into a global summary |
|
605 | # release stdout and stderr and save config log into a global summary | |
606 | msg.config.release_all() |
|
606 | msg.config.release_all() | |
607 | if IP_rc.messages: |
|
607 | if IP_rc.messages: | |
608 | msg.summary += msg.config.summary_all() |
|
608 | msg.summary += msg.config.summary_all() | |
609 |
|
609 | |||
610 | #------------------------------------------------------------------------ |
|
610 | #------------------------------------------------------------------------ | |
611 | # Setup interactive session |
|
611 | # Setup interactive session | |
612 |
|
612 | |||
613 | # Now we should be fully configured. We can then execute files or load |
|
613 | # Now we should be fully configured. We can then execute files or load | |
614 | # things only needed for interactive use. Then we'll open the shell. |
|
614 | # things only needed for interactive use. Then we'll open the shell. | |
615 |
|
615 | |||
616 | # Take a snapshot of the user namespace before opening the shell. That way |
|
616 | # Take a snapshot of the user namespace before opening the shell. That way | |
617 | # we'll be able to identify which things were interactively defined and |
|
617 | # we'll be able to identify which things were interactively defined and | |
618 | # which were defined through config files. |
|
618 | # which were defined through config files. | |
619 | IP.user_config_ns = IP.user_ns.copy() |
|
619 | IP.user_config_ns = IP.user_ns.copy() | |
620 |
|
620 | |||
621 | # Force reading a file as if it were a session log. Slower but safer. |
|
621 | # Force reading a file as if it were a session log. Slower but safer. | |
622 | if load_logplay: |
|
622 | if load_logplay: | |
623 | print 'Replaying log...' |
|
623 | print 'Replaying log...' | |
624 | try: |
|
624 | try: | |
625 | if IP_rc.debug: |
|
625 | if IP_rc.debug: | |
626 | logplay_quiet = 0 |
|
626 | logplay_quiet = 0 | |
627 | else: |
|
627 | else: | |
628 | logplay_quiet = 1 |
|
628 | logplay_quiet = 1 | |
629 |
|
629 | |||
630 | msg.logplay.trap_all() |
|
630 | msg.logplay.trap_all() | |
631 | IP.safe_execfile(load_logplay,IP.user_ns, |
|
631 | IP.safe_execfile(load_logplay,IP.user_ns, | |
632 | islog = 1, quiet = logplay_quiet) |
|
632 | islog = 1, quiet = logplay_quiet) | |
633 | msg.logplay.release_all() |
|
633 | msg.logplay.release_all() | |
634 | if IP_rc.messages: |
|
634 | if IP_rc.messages: | |
635 | msg.summary += msg.logplay.summary_all() |
|
635 | msg.summary += msg.logplay.summary_all() | |
636 | except: |
|
636 | except: | |
637 | warn('Problems replaying logfile %s.' % load_logplay) |
|
637 | warn('Problems replaying logfile %s.' % load_logplay) | |
638 | IP.InteractiveTB() |
|
638 | IP.InteractiveTB() | |
639 |
|
639 | |||
640 | # Load remaining files in command line |
|
640 | # Load remaining files in command line | |
641 | msg.user_exec.trap_all() |
|
641 | msg.user_exec.trap_all() | |
642 |
|
642 | |||
643 | # Do NOT execute files named in the command line as scripts to be loaded |
|
643 | # Do NOT execute files named in the command line as scripts to be loaded | |
644 | # by embedded instances. Doing so has the potential for an infinite |
|
644 | # by embedded instances. Doing so has the potential for an infinite | |
645 | # recursion if there are exceptions thrown in the process. |
|
645 | # recursion if there are exceptions thrown in the process. | |
646 |
|
646 | |||
647 | # XXX FIXME: the execution of user files should be moved out to after |
|
647 | # XXX FIXME: the execution of user files should be moved out to after | |
648 | # ipython is fully initialized, just as if they were run via %run at the |
|
648 | # ipython is fully initialized, just as if they were run via %run at the | |
649 | # ipython prompt. This would also give them the benefit of ipython's |
|
649 | # ipython prompt. This would also give them the benefit of ipython's | |
650 | # nice tracebacks. |
|
650 | # nice tracebacks. | |
651 |
|
651 | |||
652 | if not embedded and IP_rc.args: |
|
652 | if not embedded and IP_rc.args: | |
653 | name_save = IP.user_ns['__name__'] |
|
653 | name_save = IP.user_ns['__name__'] | |
654 | IP.user_ns['__name__'] = '__main__' |
|
654 | IP.user_ns['__name__'] = '__main__' | |
655 | try: |
|
655 | try: | |
656 | # Set our own excepthook in case the user code tries to call it |
|
656 | # Set our own excepthook in case the user code tries to call it | |
657 | # directly. This prevents triggering the IPython crash handler. |
|
657 | # directly. This prevents triggering the IPython crash handler. | |
658 | old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook |
|
658 | old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook | |
659 | for run in args: |
|
659 | for run in args: | |
660 | IP.safe_execfile(run,IP.user_ns) |
|
660 | IP.safe_execfile(run,IP.user_ns) | |
661 | finally: |
|
661 | finally: | |
662 | # Reset our crash handler in place |
|
662 | # Reset our crash handler in place | |
663 | sys.excepthook = old_excepthook |
|
663 | sys.excepthook = old_excepthook | |
664 |
|
664 | |||
665 | IP.user_ns['__name__'] = name_save |
|
665 | IP.user_ns['__name__'] = name_save | |
666 |
|
666 | |||
667 | msg.user_exec.release_all() |
|
667 | msg.user_exec.release_all() | |
668 | if IP_rc.messages: |
|
668 | if IP_rc.messages: | |
669 | msg.summary += msg.user_exec.summary_all() |
|
669 | msg.summary += msg.user_exec.summary_all() | |
670 |
|
670 | |||
671 | # since we can't specify a null string on the cmd line, 0 is the equivalent: |
|
671 | # since we can't specify a null string on the cmd line, 0 is the equivalent: | |
672 | if IP_rc.nosep: |
|
672 | if IP_rc.nosep: | |
673 | IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' |
|
673 | IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' | |
674 | if IP_rc.separate_in == '0': IP_rc.separate_in = '' |
|
674 | if IP_rc.separate_in == '0': IP_rc.separate_in = '' | |
675 | if IP_rc.separate_out == '0': IP_rc.separate_out = '' |
|
675 | if IP_rc.separate_out == '0': IP_rc.separate_out = '' | |
676 | if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = '' |
|
676 | if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = '' | |
677 | IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n') |
|
677 | IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n') | |
678 | IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n') |
|
678 | IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n') | |
679 | IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n') |
|
679 | IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n') | |
680 |
|
680 | |||
681 | # Determine how many lines at the bottom of the screen are needed for |
|
681 | # Determine how many lines at the bottom of the screen are needed for | |
682 | # showing prompts, so we can know wheter long strings are to be printed or |
|
682 | # showing prompts, so we can know wheter long strings are to be printed or | |
683 | # paged: |
|
683 | # paged: | |
684 | num_lines_bot = IP_rc.separate_in.count('\n')+1 |
|
684 | num_lines_bot = IP_rc.separate_in.count('\n')+1 | |
685 | IP_rc.screen_length = IP_rc.screen_length - num_lines_bot |
|
685 | IP_rc.screen_length = IP_rc.screen_length - num_lines_bot | |
686 | # Initialize cache, set in/out prompts and printing system |
|
686 | # Initialize cache, set in/out prompts and printing system | |
687 | IP.outputcache = CachedOutput(IP_rc.cache_size, |
|
687 | IP.outputcache = CachedOutput(IP_rc.cache_size, | |
688 | IP_rc.pprint, |
|
688 | IP_rc.pprint, | |
689 | input_sep = IP_rc.separate_in, |
|
689 | input_sep = IP_rc.separate_in, | |
690 | output_sep = IP_rc.separate_out, |
|
690 | output_sep = IP_rc.separate_out, | |
691 | output_sep2 = IP_rc.separate_out2, |
|
691 | output_sep2 = IP_rc.separate_out2, | |
692 | ps1 = IP_rc.prompt_in1, |
|
692 | ps1 = IP_rc.prompt_in1, | |
693 | ps2 = IP_rc.prompt_in2, |
|
693 | ps2 = IP_rc.prompt_in2, | |
694 | ps_out = IP_rc.prompt_out, |
|
694 | ps_out = IP_rc.prompt_out, | |
695 | user_ns = IP.user_ns, |
|
695 | user_ns = IP.user_ns, | |
696 | input_hist = IP.input_hist, |
|
696 | input_hist = IP.input_hist, | |
697 | pad_left = IP_rc.prompts_pad_left) |
|
697 | pad_left = IP_rc.prompts_pad_left) | |
698 |
|
698 | |||
699 | # user may have over-ridden the default print hook: |
|
699 | # user may have over-ridden the default print hook: | |
700 | try: |
|
700 | try: | |
701 | IP.outputcache.__class__.display = IP.hooks.display |
|
701 | IP.outputcache.__class__.display = IP.hooks.display | |
702 | except AttributeError: |
|
702 | except AttributeError: | |
703 | pass |
|
703 | pass | |
704 |
|
704 | |||
705 | # Set calling of pdb on exceptions |
|
705 | # Set calling of pdb on exceptions | |
706 | IP.InteractiveTB.call_pdb = IP_rc.pdb |
|
706 | IP.InteractiveTB.call_pdb = IP_rc.pdb | |
707 |
|
707 | |||
708 | # I don't like assigning globally to sys, because it means when embedding |
|
708 | # I don't like assigning globally to sys, because it means when embedding | |
709 | # instances, each embedded instance overrides the previous choice. But |
|
709 | # instances, each embedded instance overrides the previous choice. But | |
710 | # sys.displayhook seems to be called internally by exec, so I don't see a |
|
710 | # sys.displayhook seems to be called internally by exec, so I don't see a | |
711 | # way around it. |
|
711 | # way around it. | |
712 | sys.displayhook = IP.outputcache |
|
712 | sys.displayhook = IP.outputcache | |
713 |
|
713 | |||
714 | # we need to know globally if we're caching i/o or not |
|
714 | # we need to know globally if we're caching i/o or not | |
715 | IP.do_full_cache = IP.outputcache.do_full_cache |
|
715 | IP.do_full_cache = IP.outputcache.do_full_cache | |
716 |
|
716 | |||
717 | # configure startup banner |
|
717 | # configure startup banner | |
718 | if IP_rc.c: # regular python doesn't print the banner with -c |
|
718 | if IP_rc.c: # regular python doesn't print the banner with -c | |
719 | IP_rc.banner = 0 |
|
719 | IP_rc.banner = 0 | |
720 | if IP_rc.banner: |
|
720 | if IP_rc.banner: | |
721 | BANN_P = IP.BANNER_PARTS |
|
721 | BANN_P = IP.BANNER_PARTS | |
722 | else: |
|
722 | else: | |
723 | BANN_P = [] |
|
723 | BANN_P = [] | |
724 |
|
724 | |||
725 | if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile) |
|
725 | if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile) | |
726 |
|
726 | |||
727 | # add message log (possibly empty) |
|
727 | # add message log (possibly empty) | |
728 | if msg.summary: BANN_P.append(msg.summary) |
|
728 | if msg.summary: BANN_P.append(msg.summary) | |
729 | # Final banner is a string |
|
729 | # Final banner is a string | |
730 | IP.BANNER = '\n'.join(BANN_P) |
|
730 | IP.BANNER = '\n'.join(BANN_P) | |
731 |
|
731 | |||
732 | # Finalize the IPython instance. This assumes the rc structure is fully |
|
732 | # Finalize the IPython instance. This assumes the rc structure is fully | |
733 | # in place. |
|
733 | # in place. | |
734 | IP.post_config_initialization() |
|
734 | IP.post_config_initialization() | |
735 |
|
735 | |||
736 | return IP |
|
736 | return IP | |
737 | #************************ end of file <ipmaker.py> ************************** |
|
737 | #************************ end of file <ipmaker.py> ************************** |
@@ -1,4575 +1,4586 b'' | |||||
1 | 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu> |
|
1 | 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu> | |
2 |
|
2 | |||
|
3 | * IPython/iplib.py (handle_shell_escape): add Ville's patch to | |||
|
4 | better hadnle backslashes in paths. See the thread 'More Windows | |||
|
5 | questions part 2 - \/ characters revisited' on the iypthon user | |||
|
6 | list: | |||
|
7 | http://scipy.net/pipermail/ipython-user/2005-June/000907.html | |||
|
8 | ||||
|
9 | * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag | |||
|
10 | true by default, and add it to the shipped ipythonrc file. Since | |||
|
11 | this asks the user before proceeding, I think it's OK to make it | |||
|
12 | true by default. | |||
|
13 | ||||
3 | * IPython/Magic.py (magic_exit): make new exit/quit magics instead |
|
14 | * IPython/Magic.py (magic_exit): make new exit/quit magics instead | |
4 | of the previous special-casing of input in the eval loop. I think |
|
15 | of the previous special-casing of input in the eval loop. I think | |
5 | this is cleaner, as they really are commands and shouldn't have |
|
16 | this is cleaner, as they really are commands and shouldn't have | |
6 | a special role in the middle of the core code. |
|
17 | a special role in the middle of the core code. | |
7 |
|
18 | |||
8 | 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu> |
|
19 | 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu> | |
9 |
|
20 | |||
10 | * IPython/iplib.py (edit_syntax_error): added support for |
|
21 | * IPython/iplib.py (edit_syntax_error): added support for | |
11 | automatically reopening the editor if the file had a syntax error |
|
22 | automatically reopening the editor if the file had a syntax error | |
12 | in it. Thanks to scottt who provided the patch at: |
|
23 | in it. Thanks to scottt who provided the patch at: | |
13 | http://www.scipy.net/roundup/ipython/issue36 (slightly modified |
|
24 | http://www.scipy.net/roundup/ipython/issue36 (slightly modified | |
14 | version committed). |
|
25 | version committed). | |
15 |
|
26 | |||
16 | * IPython/iplib.py (handle_normal): add suport for multi-line |
|
27 | * IPython/iplib.py (handle_normal): add suport for multi-line | |
17 | input with emtpy lines. This fixes |
|
28 | input with emtpy lines. This fixes | |
18 | http://www.scipy.net/roundup/ipython/issue43 and a similar |
|
29 | http://www.scipy.net/roundup/ipython/issue43 and a similar | |
19 | discussion on the user list. |
|
30 | discussion on the user list. | |
20 |
|
31 | |||
21 | WARNING: a behavior change is necessarily introduced to support |
|
32 | WARNING: a behavior change is necessarily introduced to support | |
22 | blank lines: now a single blank line with whitespace does NOT |
|
33 | blank lines: now a single blank line with whitespace does NOT | |
23 | break the input loop, which means that when autoindent is on, by |
|
34 | break the input loop, which means that when autoindent is on, by | |
24 | default hitting return on the next (indented) line does NOT exit. |
|
35 | default hitting return on the next (indented) line does NOT exit. | |
25 |
|
36 | |||
26 | Instead, to exit a multiline input you can either have: |
|
37 | Instead, to exit a multiline input you can either have: | |
27 |
|
38 | |||
28 | - TWO whitespace lines (just hit return again), or |
|
39 | - TWO whitespace lines (just hit return again), or | |
29 | - a single whitespace line of a different length than provided |
|
40 | - a single whitespace line of a different length than provided | |
30 | by the autoindent (add or remove a space). |
|
41 | by the autoindent (add or remove a space). | |
31 |
|
42 | |||
32 | * IPython/completer.py (MagicCompleter.__init__): new 'completer' |
|
43 | * IPython/completer.py (MagicCompleter.__init__): new 'completer' | |
33 | module to better organize all readline-related functionality. |
|
44 | module to better organize all readline-related functionality. | |
34 | I've deleted FlexCompleter and put all completion clases here. |
|
45 | I've deleted FlexCompleter and put all completion clases here. | |
35 |
|
46 | |||
36 | * IPython/iplib.py (raw_input): improve indentation management. |
|
47 | * IPython/iplib.py (raw_input): improve indentation management. | |
37 | It is now possible to paste indented code with autoindent on, and |
|
48 | It is now possible to paste indented code with autoindent on, and | |
38 | the code is interpreted correctly (though it still looks bad on |
|
49 | the code is interpreted correctly (though it still looks bad on | |
39 | screen, due to the line-oriented nature of ipython). |
|
50 | screen, due to the line-oriented nature of ipython). | |
40 | (MagicCompleter.complete): change behavior so that a TAB key on an |
|
51 | (MagicCompleter.complete): change behavior so that a TAB key on an | |
41 | otherwise empty line actually inserts a tab, instead of completing |
|
52 | otherwise empty line actually inserts a tab, instead of completing | |
42 | on the entire global namespace. This makes it easier to use the |
|
53 | on the entire global namespace. This makes it easier to use the | |
43 | TAB key for indentation. After a request by Hans Meine |
|
54 | TAB key for indentation. After a request by Hans Meine | |
44 | <hans_meine-AT-gmx.net> |
|
55 | <hans_meine-AT-gmx.net> | |
45 | (_prefilter): add support so that typing plain 'exit' or 'quit' |
|
56 | (_prefilter): add support so that typing plain 'exit' or 'quit' | |
46 | does a sensible thing. Originally I tried to deviate as little as |
|
57 | does a sensible thing. Originally I tried to deviate as little as | |
47 | possible from the default python behavior, but even that one may |
|
58 | possible from the default python behavior, but even that one may | |
48 | change in this direction (thread on python-dev to that effect). |
|
59 | change in this direction (thread on python-dev to that effect). | |
49 | Regardless, ipython should do the right thing even if CPython's |
|
60 | Regardless, ipython should do the right thing even if CPython's | |
50 | '>>>' prompt doesn't. |
|
61 | '>>>' prompt doesn't. | |
51 | (InteractiveShell): removed subclassing code.InteractiveConsole |
|
62 | (InteractiveShell): removed subclassing code.InteractiveConsole | |
52 | class. By now we'd overridden just about all of its methods: I've |
|
63 | class. By now we'd overridden just about all of its methods: I've | |
53 | copied the remaining two over, and now ipython is a standalone |
|
64 | copied the remaining two over, and now ipython is a standalone | |
54 | class. This will provide a clearer picture for the chainsaw |
|
65 | class. This will provide a clearer picture for the chainsaw | |
55 | branch refactoring. |
|
66 | branch refactoring. | |
56 |
|
67 | |||
57 | 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu> |
|
68 | 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu> | |
58 |
|
69 | |||
59 | * IPython/ultraTB.py (VerboseTB.text): harden reporting against |
|
70 | * IPython/ultraTB.py (VerboseTB.text): harden reporting against | |
60 | failures for objects which break when dir() is called on them. |
|
71 | failures for objects which break when dir() is called on them. | |
61 |
|
72 | |||
62 | * IPython/FlexCompleter.py (Completer.__init__): Added support for |
|
73 | * IPython/FlexCompleter.py (Completer.__init__): Added support for | |
63 | distinct local and global namespaces in the completer API. This |
|
74 | distinct local and global namespaces in the completer API. This | |
64 | change allows us top properly handle completion with distinct |
|
75 | change allows us top properly handle completion with distinct | |
65 | scopes, including in embedded instances (this had never really |
|
76 | scopes, including in embedded instances (this had never really | |
66 | worked correctly). |
|
77 | worked correctly). | |
67 |
|
78 | |||
68 | Note: this introduces a change in the constructor for |
|
79 | Note: this introduces a change in the constructor for | |
69 | MagicCompleter, as a new global_namespace parameter is now the |
|
80 | MagicCompleter, as a new global_namespace parameter is now the | |
70 | second argument (the others were bumped one position). |
|
81 | second argument (the others were bumped one position). | |
71 |
|
82 | |||
72 | 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu> |
|
83 | 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu> | |
73 |
|
84 | |||
74 | * IPython/iplib.py (embed_mainloop): fix tab-completion in |
|
85 | * IPython/iplib.py (embed_mainloop): fix tab-completion in | |
75 | embedded instances (which can be done now thanks to Vivian's |
|
86 | embedded instances (which can be done now thanks to Vivian's | |
76 | frame-handling fixes for pdb). |
|
87 | frame-handling fixes for pdb). | |
77 | (InteractiveShell.__init__): Fix namespace handling problem in |
|
88 | (InteractiveShell.__init__): Fix namespace handling problem in | |
78 | embedded instances. We were overwriting __main__ unconditionally, |
|
89 | embedded instances. We were overwriting __main__ unconditionally, | |
79 | and this should only be done for 'full' (non-embedded) IPython; |
|
90 | and this should only be done for 'full' (non-embedded) IPython; | |
80 | embedded instances must respect the caller's __main__. Thanks to |
|
91 | embedded instances must respect the caller's __main__. Thanks to | |
81 | a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com> |
|
92 | a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com> | |
82 |
|
93 | |||
83 | 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu> |
|
94 | 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu> | |
84 |
|
95 | |||
85 | * setup.py: added download_url to setup(). This registers the |
|
96 | * setup.py: added download_url to setup(). This registers the | |
86 | download address at PyPI, which is not only useful to humans |
|
97 | download address at PyPI, which is not only useful to humans | |
87 | browsing the site, but is also picked up by setuptools (the Eggs |
|
98 | browsing the site, but is also picked up by setuptools (the Eggs | |
88 | machinery). Thanks to Ville and R. Kern for the info/discussion |
|
99 | machinery). Thanks to Ville and R. Kern for the info/discussion | |
89 | on this. |
|
100 | on this. | |
90 |
|
101 | |||
91 | 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu> |
|
102 | 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu> | |
92 |
|
103 | |||
93 | * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements. |
|
104 | * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements. | |
94 | This brings a lot of nice functionality to the pdb mode, which now |
|
105 | This brings a lot of nice functionality to the pdb mode, which now | |
95 | has tab-completion, syntax highlighting, and better stack handling |
|
106 | has tab-completion, syntax highlighting, and better stack handling | |
96 | than before. Many thanks to Vivian De Smedt |
|
107 | than before. Many thanks to Vivian De Smedt | |
97 | <vivian-AT-vdesmedt.com> for the original patches. |
|
108 | <vivian-AT-vdesmedt.com> for the original patches. | |
98 |
|
109 | |||
99 | 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu> |
|
110 | 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu> | |
100 |
|
111 | |||
101 | * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling |
|
112 | * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling | |
102 | sequence to consistently accept the banner argument. The |
|
113 | sequence to consistently accept the banner argument. The | |
103 | inconsistency was tripping SAGE, thanks to Gary Zablackis |
|
114 | inconsistency was tripping SAGE, thanks to Gary Zablackis | |
104 | <gzabl-AT-yahoo.com> for the report. |
|
115 | <gzabl-AT-yahoo.com> for the report. | |
105 |
|
116 | |||
106 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> |
|
117 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> | |
107 |
|
118 | |||
108 | * IPython/iplib.py (InteractiveShell.post_config_initialization): |
|
119 | * IPython/iplib.py (InteractiveShell.post_config_initialization): | |
109 | Fix bug where a naked 'alias' call in the ipythonrc file would |
|
120 | Fix bug where a naked 'alias' call in the ipythonrc file would | |
110 | cause a crash. Bug reported by Jorgen Stenarson. |
|
121 | cause a crash. Bug reported by Jorgen Stenarson. | |
111 |
|
122 | |||
112 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> |
|
123 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> | |
113 |
|
124 | |||
114 | * IPython/ipmaker.py (make_IPython): cleanups which should improve |
|
125 | * IPython/ipmaker.py (make_IPython): cleanups which should improve | |
115 | startup time. |
|
126 | startup time. | |
116 |
|
127 | |||
117 | * IPython/iplib.py (runcode): my globals 'fix' for embedded |
|
128 | * IPython/iplib.py (runcode): my globals 'fix' for embedded | |
118 | instances had introduced a bug with globals in normal code. Now |
|
129 | instances had introduced a bug with globals in normal code. Now | |
119 | it's working in all cases. |
|
130 | it's working in all cases. | |
120 |
|
131 | |||
121 | * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and |
|
132 | * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and | |
122 | API changes. A new ipytonrc option, 'wildcards_case_sensitive' |
|
133 | API changes. A new ipytonrc option, 'wildcards_case_sensitive' | |
123 | has been introduced to set the default case sensitivity of the |
|
134 | has been introduced to set the default case sensitivity of the | |
124 | searches. Users can still select either mode at runtime on a |
|
135 | searches. Users can still select either mode at runtime on a | |
125 | per-search basis. |
|
136 | per-search basis. | |
126 |
|
137 | |||
127 | 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu> |
|
138 | 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu> | |
128 |
|
139 | |||
129 | * IPython/wildcard.py (NameSpace.__init__): fix resolution of |
|
140 | * IPython/wildcard.py (NameSpace.__init__): fix resolution of | |
130 | attributes in wildcard searches for subclasses. Modified version |
|
141 | attributes in wildcard searches for subclasses. Modified version | |
131 | of a patch by Jorgen. |
|
142 | of a patch by Jorgen. | |
132 |
|
143 | |||
133 | 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu> |
|
144 | 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu> | |
134 |
|
145 | |||
135 | * IPython/iplib.py (embed_mainloop): Fix handling of globals for |
|
146 | * IPython/iplib.py (embed_mainloop): Fix handling of globals for | |
136 | embedded instances. I added a user_global_ns attribute to the |
|
147 | embedded instances. I added a user_global_ns attribute to the | |
137 | InteractiveShell class to handle this. |
|
148 | InteractiveShell class to handle this. | |
138 |
|
149 | |||
139 | 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu> |
|
150 | 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu> | |
140 |
|
151 | |||
141 | * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to |
|
152 | * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to | |
142 | idle_add, which fixes horrible keyboard lag problems under gtk 2.6 |
|
153 | idle_add, which fixes horrible keyboard lag problems under gtk 2.6 | |
143 | (reported under win32, but may happen also in other platforms). |
|
154 | (reported under win32, but may happen also in other platforms). | |
144 | Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm> |
|
155 | Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm> | |
145 |
|
156 | |||
146 | 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu> |
|
157 | 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu> | |
147 |
|
158 | |||
148 | * IPython/Magic.py (magic_psearch): new support for wildcard |
|
159 | * IPython/Magic.py (magic_psearch): new support for wildcard | |
149 | patterns. Now, typing ?a*b will list all names which begin with a |
|
160 | patterns. Now, typing ?a*b will list all names which begin with a | |
150 | and end in b, for example. The %psearch magic has full |
|
161 | and end in b, for example. The %psearch magic has full | |
151 | docstrings. Many thanks to JΓΆrgen Stenarson |
|
162 | docstrings. Many thanks to JΓΆrgen Stenarson | |
152 | <jorgen.stenarson-AT-bostream.nu>, author of the patches |
|
163 | <jorgen.stenarson-AT-bostream.nu>, author of the patches | |
153 | implementing this functionality. |
|
164 | implementing this functionality. | |
154 |
|
165 | |||
155 | 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu> |
|
166 | 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu> | |
156 |
|
167 | |||
157 | * Manual: fixed long-standing annoyance of double-dashes (as in |
|
168 | * Manual: fixed long-standing annoyance of double-dashes (as in | |
158 | --prefix=~, for example) being stripped in the HTML version. This |
|
169 | --prefix=~, for example) being stripped in the HTML version. This | |
159 | is a latex2html bug, but a workaround was provided. Many thanks |
|
170 | is a latex2html bug, but a workaround was provided. Many thanks | |
160 | to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed |
|
171 | to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed | |
161 | help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball |
|
172 | help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball | |
162 | rolling. This seemingly small issue had tripped a number of users |
|
173 | rolling. This seemingly small issue had tripped a number of users | |
163 | when first installing, so I'm glad to see it gone. |
|
174 | when first installing, so I'm glad to see it gone. | |
164 |
|
175 | |||
165 | 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu> |
|
176 | 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu> | |
166 |
|
177 | |||
167 | * IPython/Extensions/numeric_formats.py: fix missing import, |
|
178 | * IPython/Extensions/numeric_formats.py: fix missing import, | |
168 | reported by Stephen Walton. |
|
179 | reported by Stephen Walton. | |
169 |
|
180 | |||
170 | 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu> |
|
181 | 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu> | |
171 |
|
182 | |||
172 | * IPython/demo.py: finish demo module, fully documented now. |
|
183 | * IPython/demo.py: finish demo module, fully documented now. | |
173 |
|
184 | |||
174 | * IPython/genutils.py (file_read): simple little utility to read a |
|
185 | * IPython/genutils.py (file_read): simple little utility to read a | |
175 | file and ensure it's closed afterwards. |
|
186 | file and ensure it's closed afterwards. | |
176 |
|
187 | |||
177 | 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu> |
|
188 | 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu> | |
178 |
|
189 | |||
179 | * IPython/demo.py (Demo.__init__): added support for individually |
|
190 | * IPython/demo.py (Demo.__init__): added support for individually | |
180 | tagging blocks for automatic execution. |
|
191 | tagging blocks for automatic execution. | |
181 |
|
192 | |||
182 | * IPython/Magic.py (magic_pycat): new %pycat magic for showing |
|
193 | * IPython/Magic.py (magic_pycat): new %pycat magic for showing | |
183 | syntax-highlighted python sources, requested by John. |
|
194 | syntax-highlighted python sources, requested by John. | |
184 |
|
195 | |||
185 | 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu> |
|
196 | 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu> | |
186 |
|
197 | |||
187 | * IPython/demo.py (Demo.again): fix bug where again() blocks after |
|
198 | * IPython/demo.py (Demo.again): fix bug where again() blocks after | |
188 | finishing. |
|
199 | finishing. | |
189 |
|
200 | |||
190 | * IPython/genutils.py (shlex_split): moved from Magic to here, |
|
201 | * IPython/genutils.py (shlex_split): moved from Magic to here, | |
191 | where all 2.2 compatibility stuff lives. I needed it for demo.py. |
|
202 | where all 2.2 compatibility stuff lives. I needed it for demo.py. | |
192 |
|
203 | |||
193 | * IPython/demo.py (Demo.__init__): added support for silent |
|
204 | * IPython/demo.py (Demo.__init__): added support for silent | |
194 | blocks, improved marks as regexps, docstrings written. |
|
205 | blocks, improved marks as regexps, docstrings written. | |
195 | (Demo.__init__): better docstring, added support for sys.argv. |
|
206 | (Demo.__init__): better docstring, added support for sys.argv. | |
196 |
|
207 | |||
197 | * IPython/genutils.py (marquee): little utility used by the demo |
|
208 | * IPython/genutils.py (marquee): little utility used by the demo | |
198 | code, handy in general. |
|
209 | code, handy in general. | |
199 |
|
210 | |||
200 | * IPython/demo.py (Demo.__init__): new class for interactive |
|
211 | * IPython/demo.py (Demo.__init__): new class for interactive | |
201 | demos. Not documented yet, I just wrote it in a hurry for |
|
212 | demos. Not documented yet, I just wrote it in a hurry for | |
202 | scipy'05. Will docstring later. |
|
213 | scipy'05. Will docstring later. | |
203 |
|
214 | |||
204 | 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu> |
|
215 | 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu> | |
205 |
|
216 | |||
206 | * IPython/Shell.py (sigint_handler): Drastic simplification which |
|
217 | * IPython/Shell.py (sigint_handler): Drastic simplification which | |
207 | also seems to make Ctrl-C work correctly across threads! This is |
|
218 | also seems to make Ctrl-C work correctly across threads! This is | |
208 | so simple, that I can't beleive I'd missed it before. Needs more |
|
219 | so simple, that I can't beleive I'd missed it before. Needs more | |
209 | testing, though. |
|
220 | testing, though. | |
210 | (KBINT): Never mind, revert changes. I'm sure I'd tried something |
|
221 | (KBINT): Never mind, revert changes. I'm sure I'd tried something | |
211 | like this before... |
|
222 | like this before... | |
212 |
|
223 | |||
213 | * IPython/genutils.py (get_home_dir): add protection against |
|
224 | * IPython/genutils.py (get_home_dir): add protection against | |
214 | non-dirs in win32 registry. |
|
225 | non-dirs in win32 registry. | |
215 |
|
226 | |||
216 | * IPython/iplib.py (InteractiveShell.alias_table_validate): fix |
|
227 | * IPython/iplib.py (InteractiveShell.alias_table_validate): fix | |
217 | bug where dict was mutated while iterating (pysh crash). |
|
228 | bug where dict was mutated while iterating (pysh crash). | |
218 |
|
229 | |||
219 | 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu> |
|
230 | 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu> | |
220 |
|
231 | |||
221 | * IPython/iplib.py (handle_auto): Fix inconsistency arising from |
|
232 | * IPython/iplib.py (handle_auto): Fix inconsistency arising from | |
222 | spurious newlines added by this routine. After a report by |
|
233 | spurious newlines added by this routine. After a report by | |
223 | F. Mantegazza. |
|
234 | F. Mantegazza. | |
224 |
|
235 | |||
225 | 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu> |
|
236 | 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu> | |
226 |
|
237 | |||
227 | * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0") |
|
238 | * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0") | |
228 | calls. These were a leftover from the GTK 1.x days, and can cause |
|
239 | calls. These were a leftover from the GTK 1.x days, and can cause | |
229 | problems in certain cases (after a report by John Hunter). |
|
240 | problems in certain cases (after a report by John Hunter). | |
230 |
|
241 | |||
231 | * IPython/iplib.py (InteractiveShell.__init__): Trap exception if |
|
242 | * IPython/iplib.py (InteractiveShell.__init__): Trap exception if | |
232 | os.getcwd() fails at init time. Thanks to patch from David Remahl |
|
243 | os.getcwd() fails at init time. Thanks to patch from David Remahl | |
233 | <chmod007-AT-mac.com>. |
|
244 | <chmod007-AT-mac.com>. | |
234 | (InteractiveShell.__init__): prevent certain special magics from |
|
245 | (InteractiveShell.__init__): prevent certain special magics from | |
235 | being shadowed by aliases. Closes |
|
246 | being shadowed by aliases. Closes | |
236 | http://www.scipy.net/roundup/ipython/issue41. |
|
247 | http://www.scipy.net/roundup/ipython/issue41. | |
237 |
|
248 | |||
238 | 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu> |
|
249 | 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu> | |
239 |
|
250 | |||
240 | * IPython/iplib.py (InteractiveShell.complete): Added new |
|
251 | * IPython/iplib.py (InteractiveShell.complete): Added new | |
241 | top-level completion method to expose the completion mechanism |
|
252 | top-level completion method to expose the completion mechanism | |
242 | beyond readline-based environments. |
|
253 | beyond readline-based environments. | |
243 |
|
254 | |||
244 | 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu> |
|
255 | 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu> | |
245 |
|
256 | |||
246 | * tools/ipsvnc (svnversion): fix svnversion capture. |
|
257 | * tools/ipsvnc (svnversion): fix svnversion capture. | |
247 |
|
258 | |||
248 | * IPython/iplib.py (InteractiveShell.__init__): Add has_readline |
|
259 | * IPython/iplib.py (InteractiveShell.__init__): Add has_readline | |
249 | attribute to self, which was missing. Before, it was set by a |
|
260 | attribute to self, which was missing. Before, it was set by a | |
250 | routine which in certain cases wasn't being called, so the |
|
261 | routine which in certain cases wasn't being called, so the | |
251 | instance could end up missing the attribute. This caused a crash. |
|
262 | instance could end up missing the attribute. This caused a crash. | |
252 | Closes http://www.scipy.net/roundup/ipython/issue40. |
|
263 | Closes http://www.scipy.net/roundup/ipython/issue40. | |
253 |
|
264 | |||
254 | 2005-08-16 Fernando Perez <fperez@colorado.edu> |
|
265 | 2005-08-16 Fernando Perez <fperez@colorado.edu> | |
255 |
|
266 | |||
256 | * IPython/ultraTB.py (VerboseTB.text): don't crash if object |
|
267 | * IPython/ultraTB.py (VerboseTB.text): don't crash if object | |
257 | contains non-string attribute. Closes |
|
268 | contains non-string attribute. Closes | |
258 | http://www.scipy.net/roundup/ipython/issue38. |
|
269 | http://www.scipy.net/roundup/ipython/issue38. | |
259 |
|
270 | |||
260 | 2005-08-14 Fernando Perez <fperez@colorado.edu> |
|
271 | 2005-08-14 Fernando Perez <fperez@colorado.edu> | |
261 |
|
272 | |||
262 | * tools/ipsvnc: Minor improvements, to add changeset info. |
|
273 | * tools/ipsvnc: Minor improvements, to add changeset info. | |
263 |
|
274 | |||
264 | 2005-08-12 Fernando Perez <fperez@colorado.edu> |
|
275 | 2005-08-12 Fernando Perez <fperez@colorado.edu> | |
265 |
|
276 | |||
266 | * IPython/iplib.py (runsource): remove self.code_to_run_src |
|
277 | * IPython/iplib.py (runsource): remove self.code_to_run_src | |
267 | attribute. I realized this is nothing more than |
|
278 | attribute. I realized this is nothing more than | |
268 | '\n'.join(self.buffer), and having the same data in two different |
|
279 | '\n'.join(self.buffer), and having the same data in two different | |
269 | places is just asking for synchronization bugs. This may impact |
|
280 | places is just asking for synchronization bugs. This may impact | |
270 | people who have custom exception handlers, so I need to warn |
|
281 | people who have custom exception handlers, so I need to warn | |
271 | ipython-dev about it (F. Mantegazza may use them). |
|
282 | ipython-dev about it (F. Mantegazza may use them). | |
272 |
|
283 | |||
273 | 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu> |
|
284 | 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu> | |
274 |
|
285 | |||
275 | * IPython/genutils.py: fix 2.2 compatibility (generators) |
|
286 | * IPython/genutils.py: fix 2.2 compatibility (generators) | |
276 |
|
287 | |||
277 | 2005-07-18 Fernando Perez <fperez@colorado.edu> |
|
288 | 2005-07-18 Fernando Perez <fperez@colorado.edu> | |
278 |
|
289 | |||
279 | * IPython/genutils.py (get_home_dir): fix to help users with |
|
290 | * IPython/genutils.py (get_home_dir): fix to help users with | |
280 | invalid $HOME under win32. |
|
291 | invalid $HOME under win32. | |
281 |
|
292 | |||
282 | 2005-07-17 Fernando Perez <fperez@colorado.edu> |
|
293 | 2005-07-17 Fernando Perez <fperez@colorado.edu> | |
283 |
|
294 | |||
284 | * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove |
|
295 | * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove | |
285 | some old hacks and clean up a bit other routines; code should be |
|
296 | some old hacks and clean up a bit other routines; code should be | |
286 | simpler and a bit faster. |
|
297 | simpler and a bit faster. | |
287 |
|
298 | |||
288 | * IPython/iplib.py (interact): removed some last-resort attempts |
|
299 | * IPython/iplib.py (interact): removed some last-resort attempts | |
289 | to survive broken stdout/stderr. That code was only making it |
|
300 | to survive broken stdout/stderr. That code was only making it | |
290 | harder to abstract out the i/o (necessary for gui integration), |
|
301 | harder to abstract out the i/o (necessary for gui integration), | |
291 | and the crashes it could prevent were extremely rare in practice |
|
302 | and the crashes it could prevent were extremely rare in practice | |
292 | (besides being fully user-induced in a pretty violent manner). |
|
303 | (besides being fully user-induced in a pretty violent manner). | |
293 |
|
304 | |||
294 | * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff. |
|
305 | * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff. | |
295 | Nothing major yet, but the code is simpler to read; this should |
|
306 | Nothing major yet, but the code is simpler to read; this should | |
296 | make it easier to do more serious modifications in the future. |
|
307 | make it easier to do more serious modifications in the future. | |
297 |
|
308 | |||
298 | * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh, |
|
309 | * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh, | |
299 | which broke in .15 (thanks to a report by Ville). |
|
310 | which broke in .15 (thanks to a report by Ville). | |
300 |
|
311 | |||
301 | * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not |
|
312 | * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not | |
302 | be quite correct, I know next to nothing about unicode). This |
|
313 | be quite correct, I know next to nothing about unicode). This | |
303 | will allow unicode strings to be used in prompts, amongst other |
|
314 | will allow unicode strings to be used in prompts, amongst other | |
304 | cases. It also will prevent ipython from crashing when unicode |
|
315 | cases. It also will prevent ipython from crashing when unicode | |
305 | shows up unexpectedly in many places. If ascii encoding fails, we |
|
316 | shows up unexpectedly in many places. If ascii encoding fails, we | |
306 | assume utf_8. Currently the encoding is not a user-visible |
|
317 | assume utf_8. Currently the encoding is not a user-visible | |
307 | setting, though it could be made so if there is demand for it. |
|
318 | setting, though it could be made so if there is demand for it. | |
308 |
|
319 | |||
309 | * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack. |
|
320 | * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack. | |
310 |
|
321 | |||
311 | * IPython/Struct.py (Struct.merge): switch keys() to iterator. |
|
322 | * IPython/Struct.py (Struct.merge): switch keys() to iterator. | |
312 |
|
323 | |||
313 | * IPython/background_jobs.py: moved 2.2 compatibility to genutils. |
|
324 | * IPython/background_jobs.py: moved 2.2 compatibility to genutils. | |
314 |
|
325 | |||
315 | * IPython/genutils.py: Add 2.2 compatibility here, so all other |
|
326 | * IPython/genutils.py: Add 2.2 compatibility here, so all other | |
316 | code can work transparently for 2.2/2.3. |
|
327 | code can work transparently for 2.2/2.3. | |
317 |
|
328 | |||
318 | 2005-07-16 Fernando Perez <fperez@colorado.edu> |
|
329 | 2005-07-16 Fernando Perez <fperez@colorado.edu> | |
319 |
|
330 | |||
320 | * IPython/ultraTB.py (ExceptionColors): Make a global variable |
|
331 | * IPython/ultraTB.py (ExceptionColors): Make a global variable | |
321 | out of the color scheme table used for coloring exception |
|
332 | out of the color scheme table used for coloring exception | |
322 | tracebacks. This allows user code to add new schemes at runtime. |
|
333 | tracebacks. This allows user code to add new schemes at runtime. | |
323 | This is a minimally modified version of the patch at |
|
334 | This is a minimally modified version of the patch at | |
324 | http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw |
|
335 | http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw | |
325 | for the contribution. |
|
336 | for the contribution. | |
326 |
|
337 | |||
327 | * IPython/FlexCompleter.py (Completer.attr_matches): Add a |
|
338 | * IPython/FlexCompleter.py (Completer.attr_matches): Add a | |
328 | slightly modified version of the patch in |
|
339 | slightly modified version of the patch in | |
329 | http://www.scipy.net/roundup/ipython/issue34, which also allows me |
|
340 | http://www.scipy.net/roundup/ipython/issue34, which also allows me | |
330 | to remove the previous try/except solution (which was costlier). |
|
341 | to remove the previous try/except solution (which was costlier). | |
331 | Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix. |
|
342 | Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix. | |
332 |
|
343 | |||
333 | 2005-06-08 Fernando Perez <fperez@colorado.edu> |
|
344 | 2005-06-08 Fernando Perez <fperez@colorado.edu> | |
334 |
|
345 | |||
335 | * IPython/iplib.py (write/write_err): Add methods to abstract all |
|
346 | * IPython/iplib.py (write/write_err): Add methods to abstract all | |
336 | I/O a bit more. |
|
347 | I/O a bit more. | |
337 |
|
348 | |||
338 | * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation |
|
349 | * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation | |
339 | warning, reported by Aric Hagberg, fix by JD Hunter. |
|
350 | warning, reported by Aric Hagberg, fix by JD Hunter. | |
340 |
|
351 | |||
341 | 2005-06-02 *** Released version 0.6.15 |
|
352 | 2005-06-02 *** Released version 0.6.15 | |
342 |
|
353 | |||
343 | 2005-06-01 Fernando Perez <fperez@colorado.edu> |
|
354 | 2005-06-01 Fernando Perez <fperez@colorado.edu> | |
344 |
|
355 | |||
345 | * IPython/iplib.py (MagicCompleter.file_matches): Fix |
|
356 | * IPython/iplib.py (MagicCompleter.file_matches): Fix | |
346 | tab-completion of filenames within open-quoted strings. Note that |
|
357 | tab-completion of filenames within open-quoted strings. Note that | |
347 | this requires that in ~/.ipython/ipythonrc, users change the |
|
358 | this requires that in ~/.ipython/ipythonrc, users change the | |
348 | readline delimiters configuration to read: |
|
359 | readline delimiters configuration to read: | |
349 |
|
360 | |||
350 | readline_remove_delims -/~ |
|
361 | readline_remove_delims -/~ | |
351 |
|
362 | |||
352 |
|
363 | |||
353 | 2005-05-31 *** Released version 0.6.14 |
|
364 | 2005-05-31 *** Released version 0.6.14 | |
354 |
|
365 | |||
355 | 2005-05-29 Fernando Perez <fperez@colorado.edu> |
|
366 | 2005-05-29 Fernando Perez <fperez@colorado.edu> | |
356 |
|
367 | |||
357 | * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks |
|
368 | * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks | |
358 | with files not on the filesystem. Reported by Eliyahu Sandler |
|
369 | with files not on the filesystem. Reported by Eliyahu Sandler | |
359 | <eli@gondolin.net> |
|
370 | <eli@gondolin.net> | |
360 |
|
371 | |||
361 | 2005-05-22 Fernando Perez <fperez@colorado.edu> |
|
372 | 2005-05-22 Fernando Perez <fperez@colorado.edu> | |
362 |
|
373 | |||
363 | * IPython/iplib.py: Fix a few crashes in the --upgrade option. |
|
374 | * IPython/iplib.py: Fix a few crashes in the --upgrade option. | |
364 | After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>. |
|
375 | After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>. | |
365 |
|
376 | |||
366 | 2005-05-19 Fernando Perez <fperez@colorado.edu> |
|
377 | 2005-05-19 Fernando Perez <fperez@colorado.edu> | |
367 |
|
378 | |||
368 | * IPython/iplib.py (safe_execfile): close a file which could be |
|
379 | * IPython/iplib.py (safe_execfile): close a file which could be | |
369 | left open (causing problems in win32, which locks open files). |
|
380 | left open (causing problems in win32, which locks open files). | |
370 | Thanks to a bug report by D Brown <dbrown2@yahoo.com>. |
|
381 | Thanks to a bug report by D Brown <dbrown2@yahoo.com>. | |
371 |
|
382 | |||
372 | 2005-05-18 Fernando Perez <fperez@colorado.edu> |
|
383 | 2005-05-18 Fernando Perez <fperez@colorado.edu> | |
373 |
|
384 | |||
374 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all |
|
385 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all | |
375 | keyword arguments correctly to safe_execfile(). |
|
386 | keyword arguments correctly to safe_execfile(). | |
376 |
|
387 | |||
377 | 2005-05-13 Fernando Perez <fperez@colorado.edu> |
|
388 | 2005-05-13 Fernando Perez <fperez@colorado.edu> | |
378 |
|
389 | |||
379 | * ipython.1: Added info about Qt to manpage, and threads warning |
|
390 | * ipython.1: Added info about Qt to manpage, and threads warning | |
380 | to usage page (invoked with --help). |
|
391 | to usage page (invoked with --help). | |
381 |
|
392 | |||
382 | * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added |
|
393 | * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added | |
383 | new matcher (it goes at the end of the priority list) to do |
|
394 | new matcher (it goes at the end of the priority list) to do | |
384 | tab-completion on named function arguments. Submitted by George |
|
395 | tab-completion on named function arguments. Submitted by George | |
385 | Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at |
|
396 | Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at | |
386 | http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html |
|
397 | http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html | |
387 | for more details. |
|
398 | for more details. | |
388 |
|
399 | |||
389 | * IPython/Magic.py (magic_run): Added new -e flag to ignore |
|
400 | * IPython/Magic.py (magic_run): Added new -e flag to ignore | |
390 | SystemExit exceptions in the script being run. Thanks to a report |
|
401 | SystemExit exceptions in the script being run. Thanks to a report | |
391 | by danny shevitz <danny_shevitz-AT-yahoo.com>, about this |
|
402 | by danny shevitz <danny_shevitz-AT-yahoo.com>, about this | |
392 | producing very annoying behavior when running unit tests. |
|
403 | producing very annoying behavior when running unit tests. | |
393 |
|
404 | |||
394 | 2005-05-12 Fernando Perez <fperez@colorado.edu> |
|
405 | 2005-05-12 Fernando Perez <fperez@colorado.edu> | |
395 |
|
406 | |||
396 | * IPython/iplib.py (handle_auto): fixed auto-quoting and parens, |
|
407 | * IPython/iplib.py (handle_auto): fixed auto-quoting and parens, | |
397 | which I'd broken (again) due to a changed regexp. In the process, |
|
408 | which I'd broken (again) due to a changed regexp. In the process, | |
398 | added ';' as an escape to auto-quote the whole line without |
|
409 | added ';' as an escape to auto-quote the whole line without | |
399 | splitting its arguments. Thanks to a report by Jerry McRae |
|
410 | splitting its arguments. Thanks to a report by Jerry McRae | |
400 | <qrs0xyc02-AT-sneakemail.com>. |
|
411 | <qrs0xyc02-AT-sneakemail.com>. | |
401 |
|
412 | |||
402 | * IPython/ultraTB.py (VerboseTB.text): protect against rare but |
|
413 | * IPython/ultraTB.py (VerboseTB.text): protect against rare but | |
403 | possible crashes caused by a TokenError. Reported by Ed Schofield |
|
414 | possible crashes caused by a TokenError. Reported by Ed Schofield | |
404 | <schofield-AT-ftw.at>. |
|
415 | <schofield-AT-ftw.at>. | |
405 |
|
416 | |||
406 | 2005-05-06 Fernando Perez <fperez@colorado.edu> |
|
417 | 2005-05-06 Fernando Perez <fperez@colorado.edu> | |
407 |
|
418 | |||
408 | * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6. |
|
419 | * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6. | |
409 |
|
420 | |||
410 | 2005-04-29 Fernando Perez <fperez@colorado.edu> |
|
421 | 2005-04-29 Fernando Perez <fperez@colorado.edu> | |
411 |
|
422 | |||
412 | * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière |
|
423 | * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière | |
413 | <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin |
|
424 | <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin | |
414 | Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option |
|
425 | Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option | |
415 | which provides support for Qt interactive usage (similar to the |
|
426 | which provides support for Qt interactive usage (similar to the | |
416 | existing one for WX and GTK). This had been often requested. |
|
427 | existing one for WX and GTK). This had been often requested. | |
417 |
|
428 | |||
418 | 2005-04-14 *** Released version 0.6.13 |
|
429 | 2005-04-14 *** Released version 0.6.13 | |
419 |
|
430 | |||
420 | 2005-04-08 Fernando Perez <fperez@colorado.edu> |
|
431 | 2005-04-08 Fernando Perez <fperez@colorado.edu> | |
421 |
|
432 | |||
422 | * IPython/Magic.py (Magic._ofind): remove docstring evaluation |
|
433 | * IPython/Magic.py (Magic._ofind): remove docstring evaluation | |
423 | from _ofind, which gets called on almost every input line. Now, |
|
434 | from _ofind, which gets called on almost every input line. Now, | |
424 | we only try to get docstrings if they are actually going to be |
|
435 | we only try to get docstrings if they are actually going to be | |
425 | used (the overhead of fetching unnecessary docstrings can be |
|
436 | used (the overhead of fetching unnecessary docstrings can be | |
426 | noticeable for certain objects, such as Pyro proxies). |
|
437 | noticeable for certain objects, such as Pyro proxies). | |
427 |
|
438 | |||
428 | * IPython/iplib.py (MagicCompleter.python_matches): Change the API |
|
439 | * IPython/iplib.py (MagicCompleter.python_matches): Change the API | |
429 | for completers. For some reason I had been passing them the state |
|
440 | for completers. For some reason I had been passing them the state | |
430 | variable, which completers never actually need, and was in |
|
441 | variable, which completers never actually need, and was in | |
431 | conflict with the rlcompleter API. Custom completers ONLY need to |
|
442 | conflict with the rlcompleter API. Custom completers ONLY need to | |
432 | take the text parameter. |
|
443 | take the text parameter. | |
433 |
|
444 | |||
434 | * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics |
|
445 | * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics | |
435 | work correctly in pysh. I've also moved all the logic which used |
|
446 | work correctly in pysh. I've also moved all the logic which used | |
436 | to be in pysh.py here, which will prevent problems with future |
|
447 | to be in pysh.py here, which will prevent problems with future | |
437 | upgrades. However, this time I must warn users to update their |
|
448 | upgrades. However, this time I must warn users to update their | |
438 | pysh profile to include the line |
|
449 | pysh profile to include the line | |
439 |
|
450 | |||
440 | import_all IPython.Extensions.InterpreterExec |
|
451 | import_all IPython.Extensions.InterpreterExec | |
441 |
|
452 | |||
442 | because otherwise things won't work for them. They MUST also |
|
453 | because otherwise things won't work for them. They MUST also | |
443 | delete pysh.py and the line |
|
454 | delete pysh.py and the line | |
444 |
|
455 | |||
445 | execfile pysh.py |
|
456 | execfile pysh.py | |
446 |
|
457 | |||
447 | from their ipythonrc-pysh. |
|
458 | from their ipythonrc-pysh. | |
448 |
|
459 | |||
449 | * IPython/FlexCompleter.py (Completer.attr_matches): Make more |
|
460 | * IPython/FlexCompleter.py (Completer.attr_matches): Make more | |
450 | robust in the face of objects whose dir() returns non-strings |
|
461 | robust in the face of objects whose dir() returns non-strings | |
451 | (which it shouldn't, but some broken libs like ITK do). Thanks to |
|
462 | (which it shouldn't, but some broken libs like ITK do). Thanks to | |
452 | a patch by John Hunter (implemented differently, though). Also |
|
463 | a patch by John Hunter (implemented differently, though). Also | |
453 | minor improvements by using .extend instead of + on lists. |
|
464 | minor improvements by using .extend instead of + on lists. | |
454 |
|
465 | |||
455 | * pysh.py: |
|
466 | * pysh.py: | |
456 |
|
467 | |||
457 | 2005-04-06 Fernando Perez <fperez@colorado.edu> |
|
468 | 2005-04-06 Fernando Perez <fperez@colorado.edu> | |
458 |
|
469 | |||
459 | * IPython/ipmaker.py (make_IPython): Make multi_line_specials on |
|
470 | * IPython/ipmaker.py (make_IPython): Make multi_line_specials on | |
460 | by default, so that all users benefit from it. Those who don't |
|
471 | by default, so that all users benefit from it. Those who don't | |
461 | want it can still turn it off. |
|
472 | want it can still turn it off. | |
462 |
|
473 | |||
463 | * IPython/UserConfig/ipythonrc: Add multi_line_specials to the |
|
474 | * IPython/UserConfig/ipythonrc: Add multi_line_specials to the | |
464 | config file, I'd forgotten about this, so users were getting it |
|
475 | config file, I'd forgotten about this, so users were getting it | |
465 | off by default. |
|
476 | off by default. | |
466 |
|
477 | |||
467 | * IPython/iplib.py (ipmagic): big overhaul of the magic system for |
|
478 | * IPython/iplib.py (ipmagic): big overhaul of the magic system for | |
468 | consistency. Now magics can be called in multiline statements, |
|
479 | consistency. Now magics can be called in multiline statements, | |
469 | and python variables can be expanded in magic calls via $var. |
|
480 | and python variables can be expanded in magic calls via $var. | |
470 | This makes the magic system behave just like aliases or !system |
|
481 | This makes the magic system behave just like aliases or !system | |
471 | calls. |
|
482 | calls. | |
472 |
|
483 | |||
473 | 2005-03-28 Fernando Perez <fperez@colorado.edu> |
|
484 | 2005-03-28 Fernando Perez <fperez@colorado.edu> | |
474 |
|
485 | |||
475 | * IPython/iplib.py (handle_auto): cleanup to use %s instead of |
|
486 | * IPython/iplib.py (handle_auto): cleanup to use %s instead of | |
476 | expensive string additions for building command. Add support for |
|
487 | expensive string additions for building command. Add support for | |
477 | trailing ';' when autocall is used. |
|
488 | trailing ';' when autocall is used. | |
478 |
|
489 | |||
479 | 2005-03-26 Fernando Perez <fperez@colorado.edu> |
|
490 | 2005-03-26 Fernando Perez <fperez@colorado.edu> | |
480 |
|
491 | |||
481 | * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31. |
|
492 | * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31. | |
482 | Bugfix by A. Schmolck, the ipython.el maintainer. Also make |
|
493 | Bugfix by A. Schmolck, the ipython.el maintainer. Also make | |
483 | ipython.el robust against prompts with any number of spaces |
|
494 | ipython.el robust against prompts with any number of spaces | |
484 | (including 0) after the ':' character. |
|
495 | (including 0) after the ':' character. | |
485 |
|
496 | |||
486 | * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in |
|
497 | * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in | |
487 | continuation prompt, which misled users to think the line was |
|
498 | continuation prompt, which misled users to think the line was | |
488 | already indented. Closes debian Bug#300847, reported to me by |
|
499 | already indented. Closes debian Bug#300847, reported to me by | |
489 | Norbert Tretkowski <tretkowski-AT-inittab.de>. |
|
500 | Norbert Tretkowski <tretkowski-AT-inittab.de>. | |
490 |
|
501 | |||
491 | 2005-03-23 Fernando Perez <fperez@colorado.edu> |
|
502 | 2005-03-23 Fernando Perez <fperez@colorado.edu> | |
492 |
|
503 | |||
493 | * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are |
|
504 | * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are | |
494 | properly aligned if they have embedded newlines. |
|
505 | properly aligned if they have embedded newlines. | |
495 |
|
506 | |||
496 | * IPython/iplib.py (runlines): Add a public method to expose |
|
507 | * IPython/iplib.py (runlines): Add a public method to expose | |
497 | IPython's code execution machinery, so that users can run strings |
|
508 | IPython's code execution machinery, so that users can run strings | |
498 | as if they had been typed at the prompt interactively. |
|
509 | as if they had been typed at the prompt interactively. | |
499 | (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__ |
|
510 | (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__ | |
500 | methods which can call the system shell, but with python variable |
|
511 | methods which can call the system shell, but with python variable | |
501 | expansion. The three such methods are: __IPYTHON__.system, |
|
512 | expansion. The three such methods are: __IPYTHON__.system, | |
502 | .getoutput and .getoutputerror. These need to be documented in a |
|
513 | .getoutput and .getoutputerror. These need to be documented in a | |
503 | 'public API' section (to be written) of the manual. |
|
514 | 'public API' section (to be written) of the manual. | |
504 |
|
515 | |||
505 | 2005-03-20 Fernando Perez <fperez@colorado.edu> |
|
516 | 2005-03-20 Fernando Perez <fperez@colorado.edu> | |
506 |
|
517 | |||
507 | * IPython/iplib.py (InteractiveShell.set_custom_exc): new system |
|
518 | * IPython/iplib.py (InteractiveShell.set_custom_exc): new system | |
508 | for custom exception handling. This is quite powerful, and it |
|
519 | for custom exception handling. This is quite powerful, and it | |
509 | allows for user-installable exception handlers which can trap |
|
520 | allows for user-installable exception handlers which can trap | |
510 | custom exceptions at runtime and treat them separately from |
|
521 | custom exceptions at runtime and treat them separately from | |
511 | IPython's default mechanisms. At the request of FrΓ©dΓ©ric |
|
522 | IPython's default mechanisms. At the request of FrΓ©dΓ©ric | |
512 | Mantegazza <mantegazza-AT-ill.fr>. |
|
523 | Mantegazza <mantegazza-AT-ill.fr>. | |
513 | (InteractiveShell.set_custom_completer): public API function to |
|
524 | (InteractiveShell.set_custom_completer): public API function to | |
514 | add new completers at runtime. |
|
525 | add new completers at runtime. | |
515 |
|
526 | |||
516 | 2005-03-19 Fernando Perez <fperez@colorado.edu> |
|
527 | 2005-03-19 Fernando Perez <fperez@colorado.edu> | |
517 |
|
528 | |||
518 | * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to |
|
529 | * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to | |
519 | allow objects which provide their docstrings via non-standard |
|
530 | allow objects which provide their docstrings via non-standard | |
520 | mechanisms (like Pyro proxies) to still be inspected by ipython's |
|
531 | mechanisms (like Pyro proxies) to still be inspected by ipython's | |
521 | ? system. |
|
532 | ? system. | |
522 |
|
533 | |||
523 | * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e |
|
534 | * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e | |
524 | automatic capture system. I tried quite hard to make it work |
|
535 | automatic capture system. I tried quite hard to make it work | |
525 | reliably, and simply failed. I tried many combinations with the |
|
536 | reliably, and simply failed. I tried many combinations with the | |
526 | subprocess module, but eventually nothing worked in all needed |
|
537 | subprocess module, but eventually nothing worked in all needed | |
527 | cases (not blocking stdin for the child, duplicating stdout |
|
538 | cases (not blocking stdin for the child, duplicating stdout | |
528 | without blocking, etc). The new %sc/%sx still do capture to these |
|
539 | without blocking, etc). The new %sc/%sx still do capture to these | |
529 | magical list/string objects which make shell use much more |
|
540 | magical list/string objects which make shell use much more | |
530 | conveninent, so not all is lost. |
|
541 | conveninent, so not all is lost. | |
531 |
|
542 | |||
532 | XXX - FIX MANUAL for the change above! |
|
543 | XXX - FIX MANUAL for the change above! | |
533 |
|
544 | |||
534 | (runsource): I copied code.py's runsource() into ipython to modify |
|
545 | (runsource): I copied code.py's runsource() into ipython to modify | |
535 | it a bit. Now the code object and source to be executed are |
|
546 | it a bit. Now the code object and source to be executed are | |
536 | stored in ipython. This makes this info accessible to third-party |
|
547 | stored in ipython. This makes this info accessible to third-party | |
537 | tools, like custom exception handlers. After a request by FrΓ©dΓ©ric |
|
548 | tools, like custom exception handlers. After a request by FrΓ©dΓ©ric | |
538 | Mantegazza <mantegazza-AT-ill.fr>. |
|
549 | Mantegazza <mantegazza-AT-ill.fr>. | |
539 |
|
550 | |||
540 | * IPython/UserConfig/ipythonrc: Add up/down arrow keys to |
|
551 | * IPython/UserConfig/ipythonrc: Add up/down arrow keys to | |
541 | history-search via readline (like C-p/C-n). I'd wanted this for a |
|
552 | history-search via readline (like C-p/C-n). I'd wanted this for a | |
542 | long time, but only recently found out how to do it. For users |
|
553 | long time, but only recently found out how to do it. For users | |
543 | who already have their ipythonrc files made and want this, just |
|
554 | who already have their ipythonrc files made and want this, just | |
544 | add: |
|
555 | add: | |
545 |
|
556 | |||
546 | readline_parse_and_bind "\e[A": history-search-backward |
|
557 | readline_parse_and_bind "\e[A": history-search-backward | |
547 | readline_parse_and_bind "\e[B": history-search-forward |
|
558 | readline_parse_and_bind "\e[B": history-search-forward | |
548 |
|
559 | |||
549 | 2005-03-18 Fernando Perez <fperez@colorado.edu> |
|
560 | 2005-03-18 Fernando Perez <fperez@colorado.edu> | |
550 |
|
561 | |||
551 | * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy |
|
562 | * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy | |
552 | LSString and SList classes which allow transparent conversions |
|
563 | LSString and SList classes which allow transparent conversions | |
553 | between list mode and whitespace-separated string. |
|
564 | between list mode and whitespace-separated string. | |
554 | (magic_r): Fix recursion problem in %r. |
|
565 | (magic_r): Fix recursion problem in %r. | |
555 |
|
566 | |||
556 | * IPython/genutils.py (LSString): New class to be used for |
|
567 | * IPython/genutils.py (LSString): New class to be used for | |
557 | automatic storage of the results of all alias/system calls in _o |
|
568 | automatic storage of the results of all alias/system calls in _o | |
558 | and _e (stdout/err). These provide a .l/.list attribute which |
|
569 | and _e (stdout/err). These provide a .l/.list attribute which | |
559 | does automatic splitting on newlines. This means that for most |
|
570 | does automatic splitting on newlines. This means that for most | |
560 | uses, you'll never need to do capturing of output with %sc/%sx |
|
571 | uses, you'll never need to do capturing of output with %sc/%sx | |
561 | anymore, since ipython keeps this always done for you. Note that |
|
572 | anymore, since ipython keeps this always done for you. Note that | |
562 | only the LAST results are stored, the _o/e variables are |
|
573 | only the LAST results are stored, the _o/e variables are | |
563 | overwritten on each call. If you need to save their contents |
|
574 | overwritten on each call. If you need to save their contents | |
564 | further, simply bind them to any other name. |
|
575 | further, simply bind them to any other name. | |
565 |
|
576 | |||
566 | 2005-03-17 Fernando Perez <fperez@colorado.edu> |
|
577 | 2005-03-17 Fernando Perez <fperez@colorado.edu> | |
567 |
|
578 | |||
568 | * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for |
|
579 | * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for | |
569 | prompt namespace handling. |
|
580 | prompt namespace handling. | |
570 |
|
581 | |||
571 | 2005-03-16 Fernando Perez <fperez@colorado.edu> |
|
582 | 2005-03-16 Fernando Perez <fperez@colorado.edu> | |
572 |
|
583 | |||
573 | * IPython/Prompts.py (CachedOutput.__init__): Fix default and |
|
584 | * IPython/Prompts.py (CachedOutput.__init__): Fix default and | |
574 | classic prompts to be '>>> ' (final space was missing, and it |
|
585 | classic prompts to be '>>> ' (final space was missing, and it | |
575 | trips the emacs python mode). |
|
586 | trips the emacs python mode). | |
576 | (BasePrompt.__str__): Added safe support for dynamic prompt |
|
587 | (BasePrompt.__str__): Added safe support for dynamic prompt | |
577 | strings. Now you can set your prompt string to be '$x', and the |
|
588 | strings. Now you can set your prompt string to be '$x', and the | |
578 | value of x will be printed from your interactive namespace. The |
|
589 | value of x will be printed from your interactive namespace. The | |
579 | interpolation syntax includes the full Itpl support, so |
|
590 | interpolation syntax includes the full Itpl support, so | |
580 | ${foo()+x+bar()} is a valid prompt string now, and the function |
|
591 | ${foo()+x+bar()} is a valid prompt string now, and the function | |
581 | calls will be made at runtime. |
|
592 | calls will be made at runtime. | |
582 |
|
593 | |||
583 | 2005-03-15 Fernando Perez <fperez@colorado.edu> |
|
594 | 2005-03-15 Fernando Perez <fperez@colorado.edu> | |
584 |
|
595 | |||
585 | * IPython/Magic.py (magic_history): renamed %hist to %history, to |
|
596 | * IPython/Magic.py (magic_history): renamed %hist to %history, to | |
586 | avoid name clashes in pylab. %hist still works, it just forwards |
|
597 | avoid name clashes in pylab. %hist still works, it just forwards | |
587 | the call to %history. |
|
598 | the call to %history. | |
588 |
|
599 | |||
589 | 2005-03-02 *** Released version 0.6.12 |
|
600 | 2005-03-02 *** Released version 0.6.12 | |
590 |
|
601 | |||
591 | 2005-03-02 Fernando Perez <fperez@colorado.edu> |
|
602 | 2005-03-02 Fernando Perez <fperez@colorado.edu> | |
592 |
|
603 | |||
593 | * IPython/iplib.py (handle_magic): log magic calls properly as |
|
604 | * IPython/iplib.py (handle_magic): log magic calls properly as | |
594 | ipmagic() function calls. |
|
605 | ipmagic() function calls. | |
595 |
|
606 | |||
596 | * IPython/Magic.py (magic_time): Improved %time to support |
|
607 | * IPython/Magic.py (magic_time): Improved %time to support | |
597 | statements and provide wall-clock as well as CPU time. |
|
608 | statements and provide wall-clock as well as CPU time. | |
598 |
|
609 | |||
599 | 2005-02-27 Fernando Perez <fperez@colorado.edu> |
|
610 | 2005-02-27 Fernando Perez <fperez@colorado.edu> | |
600 |
|
611 | |||
601 | * IPython/hooks.py: New hooks module, to expose user-modifiable |
|
612 | * IPython/hooks.py: New hooks module, to expose user-modifiable | |
602 | IPython functionality in a clean manner. For now only the editor |
|
613 | IPython functionality in a clean manner. For now only the editor | |
603 | hook is actually written, and other thigns which I intend to turn |
|
614 | hook is actually written, and other thigns which I intend to turn | |
604 | into proper hooks aren't yet there. The display and prefilter |
|
615 | into proper hooks aren't yet there. The display and prefilter | |
605 | stuff, for example, should be hooks. But at least now the |
|
616 | stuff, for example, should be hooks. But at least now the | |
606 | framework is in place, and the rest can be moved here with more |
|
617 | framework is in place, and the rest can be moved here with more | |
607 | time later. IPython had had a .hooks variable for a long time for |
|
618 | time later. IPython had had a .hooks variable for a long time for | |
608 | this purpose, but I'd never actually used it for anything. |
|
619 | this purpose, but I'd never actually used it for anything. | |
609 |
|
620 | |||
610 | 2005-02-26 Fernando Perez <fperez@colorado.edu> |
|
621 | 2005-02-26 Fernando Perez <fperez@colorado.edu> | |
611 |
|
622 | |||
612 | * IPython/ipmaker.py (make_IPython): make the default ipython |
|
623 | * IPython/ipmaker.py (make_IPython): make the default ipython | |
613 | directory be called _ipython under win32, to follow more the |
|
624 | directory be called _ipython under win32, to follow more the | |
614 | naming peculiarities of that platform (where buggy software like |
|
625 | naming peculiarities of that platform (where buggy software like | |
615 | Visual Sourcesafe breaks with .named directories). Reported by |
|
626 | Visual Sourcesafe breaks with .named directories). Reported by | |
616 | Ville Vainio. |
|
627 | Ville Vainio. | |
617 |
|
628 | |||
618 | 2005-02-23 Fernando Perez <fperez@colorado.edu> |
|
629 | 2005-02-23 Fernando Perez <fperez@colorado.edu> | |
619 |
|
630 | |||
620 | * IPython/iplib.py (InteractiveShell.__init__): removed a few |
|
631 | * IPython/iplib.py (InteractiveShell.__init__): removed a few | |
621 | auto_aliases for win32 which were causing problems. Users can |
|
632 | auto_aliases for win32 which were causing problems. Users can | |
622 | define the ones they personally like. |
|
633 | define the ones they personally like. | |
623 |
|
634 | |||
624 | 2005-02-21 Fernando Perez <fperez@colorado.edu> |
|
635 | 2005-02-21 Fernando Perez <fperez@colorado.edu> | |
625 |
|
636 | |||
626 | * IPython/Magic.py (magic_time): new magic to time execution of |
|
637 | * IPython/Magic.py (magic_time): new magic to time execution of | |
627 | expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>. |
|
638 | expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>. | |
628 |
|
639 | |||
629 | 2005-02-19 Fernando Perez <fperez@colorado.edu> |
|
640 | 2005-02-19 Fernando Perez <fperez@colorado.edu> | |
630 |
|
641 | |||
631 | * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings |
|
642 | * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings | |
632 | into keys (for prompts, for example). |
|
643 | into keys (for prompts, for example). | |
633 |
|
644 | |||
634 | * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty |
|
645 | * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty | |
635 | prompts in case users want them. This introduces a small behavior |
|
646 | prompts in case users want them. This introduces a small behavior | |
636 | change: ipython does not automatically add a space to all prompts |
|
647 | change: ipython does not automatically add a space to all prompts | |
637 | anymore. To get the old prompts with a space, users should add it |
|
648 | anymore. To get the old prompts with a space, users should add it | |
638 | manually to their ipythonrc file, so for example prompt_in1 should |
|
649 | manually to their ipythonrc file, so for example prompt_in1 should | |
639 | now read 'In [\#]: ' instead of 'In [\#]:'. |
|
650 | now read 'In [\#]: ' instead of 'In [\#]:'. | |
640 | (BasePrompt.__init__): New option prompts_pad_left (only in rc |
|
651 | (BasePrompt.__init__): New option prompts_pad_left (only in rc | |
641 | file) to control left-padding of secondary prompts. |
|
652 | file) to control left-padding of secondary prompts. | |
642 |
|
653 | |||
643 | * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if |
|
654 | * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if | |
644 | the profiler can't be imported. Fix for Debian, which removed |
|
655 | the profiler can't be imported. Fix for Debian, which removed | |
645 | profile.py because of License issues. I applied a slightly |
|
656 | profile.py because of License issues. I applied a slightly | |
646 | modified version of the original Debian patch at |
|
657 | modified version of the original Debian patch at | |
647 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500. |
|
658 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500. | |
648 |
|
659 | |||
649 | 2005-02-17 Fernando Perez <fperez@colorado.edu> |
|
660 | 2005-02-17 Fernando Perez <fperez@colorado.edu> | |
650 |
|
661 | |||
651 | * IPython/genutils.py (native_line_ends): Fix bug which would |
|
662 | * IPython/genutils.py (native_line_ends): Fix bug which would | |
652 | cause improper line-ends under win32 b/c I was not opening files |
|
663 | cause improper line-ends under win32 b/c I was not opening files | |
653 | in binary mode. Bug report and fix thanks to Ville. |
|
664 | in binary mode. Bug report and fix thanks to Ville. | |
654 |
|
665 | |||
655 | * IPython/iplib.py (handle_auto): Fix bug which I introduced when |
|
666 | * IPython/iplib.py (handle_auto): Fix bug which I introduced when | |
656 | trying to catch spurious foo[1] autocalls. My fix actually broke |
|
667 | trying to catch spurious foo[1] autocalls. My fix actually broke | |
657 | ',/' autoquote/call with explicit escape (bad regexp). |
|
668 | ',/' autoquote/call with explicit escape (bad regexp). | |
658 |
|
669 | |||
659 | 2005-02-15 *** Released version 0.6.11 |
|
670 | 2005-02-15 *** Released version 0.6.11 | |
660 |
|
671 | |||
661 | 2005-02-14 Fernando Perez <fperez@colorado.edu> |
|
672 | 2005-02-14 Fernando Perez <fperez@colorado.edu> | |
662 |
|
673 | |||
663 | * IPython/background_jobs.py: New background job management |
|
674 | * IPython/background_jobs.py: New background job management | |
664 | subsystem. This is implemented via a new set of classes, and |
|
675 | subsystem. This is implemented via a new set of classes, and | |
665 | IPython now provides a builtin 'jobs' object for background job |
|
676 | IPython now provides a builtin 'jobs' object for background job | |
666 | execution. A convenience %bg magic serves as a lightweight |
|
677 | execution. A convenience %bg magic serves as a lightweight | |
667 | frontend for starting the more common type of calls. This was |
|
678 | frontend for starting the more common type of calls. This was | |
668 | inspired by discussions with B. Granger and the BackgroundCommand |
|
679 | inspired by discussions with B. Granger and the BackgroundCommand | |
669 | class described in the book Python Scripting for Computational |
|
680 | class described in the book Python Scripting for Computational | |
670 | Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting |
|
681 | Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting | |
671 | (although ultimately no code from this text was used, as IPython's |
|
682 | (although ultimately no code from this text was used, as IPython's | |
672 | system is a separate implementation). |
|
683 | system is a separate implementation). | |
673 |
|
684 | |||
674 | * IPython/iplib.py (MagicCompleter.python_matches): add new option |
|
685 | * IPython/iplib.py (MagicCompleter.python_matches): add new option | |
675 | to control the completion of single/double underscore names |
|
686 | to control the completion of single/double underscore names | |
676 | separately. As documented in the example ipytonrc file, the |
|
687 | separately. As documented in the example ipytonrc file, the | |
677 | readline_omit__names variable can now be set to 2, to omit even |
|
688 | readline_omit__names variable can now be set to 2, to omit even | |
678 | single underscore names. Thanks to a patch by Brian Wong |
|
689 | single underscore names. Thanks to a patch by Brian Wong | |
679 | <BrianWong-AT-AirgoNetworks.Com>. |
|
690 | <BrianWong-AT-AirgoNetworks.Com>. | |
680 | (InteractiveShell.__init__): Fix bug which would cause foo[1] to |
|
691 | (InteractiveShell.__init__): Fix bug which would cause foo[1] to | |
681 | be autocalled as foo([1]) if foo were callable. A problem for |
|
692 | be autocalled as foo([1]) if foo were callable. A problem for | |
682 | things which are both callable and implement __getitem__. |
|
693 | things which are both callable and implement __getitem__. | |
683 | (init_readline): Fix autoindentation for win32. Thanks to a patch |
|
694 | (init_readline): Fix autoindentation for win32. Thanks to a patch | |
684 | by Vivian De Smedt <vivian-AT-vdesmedt.com>. |
|
695 | by Vivian De Smedt <vivian-AT-vdesmedt.com>. | |
685 |
|
696 | |||
686 | 2005-02-12 Fernando Perez <fperez@colorado.edu> |
|
697 | 2005-02-12 Fernando Perez <fperez@colorado.edu> | |
687 |
|
698 | |||
688 | * IPython/ipmaker.py (make_IPython): Disabled the stout traps |
|
699 | * IPython/ipmaker.py (make_IPython): Disabled the stout traps | |
689 | which I had written long ago to sort out user error messages which |
|
700 | which I had written long ago to sort out user error messages which | |
690 | may occur during startup. This seemed like a good idea initially, |
|
701 | may occur during startup. This seemed like a good idea initially, | |
691 | but it has proven a disaster in retrospect. I don't want to |
|
702 | but it has proven a disaster in retrospect. I don't want to | |
692 | change much code for now, so my fix is to set the internal 'debug' |
|
703 | change much code for now, so my fix is to set the internal 'debug' | |
693 | flag to true everywhere, whose only job was precisely to control |
|
704 | flag to true everywhere, whose only job was precisely to control | |
694 | this subsystem. This closes issue 28 (as well as avoiding all |
|
705 | this subsystem. This closes issue 28 (as well as avoiding all | |
695 | sorts of strange hangups which occur from time to time). |
|
706 | sorts of strange hangups which occur from time to time). | |
696 |
|
707 | |||
697 | 2005-02-07 Fernando Perez <fperez@colorado.edu> |
|
708 | 2005-02-07 Fernando Perez <fperez@colorado.edu> | |
698 |
|
709 | |||
699 | * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the |
|
710 | * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the | |
700 | previous call produced a syntax error. |
|
711 | previous call produced a syntax error. | |
701 |
|
712 | |||
702 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting |
|
713 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting | |
703 | classes without constructor. |
|
714 | classes without constructor. | |
704 |
|
715 | |||
705 | 2005-02-06 Fernando Perez <fperez@colorado.edu> |
|
716 | 2005-02-06 Fernando Perez <fperez@colorado.edu> | |
706 |
|
717 | |||
707 | * IPython/iplib.py (MagicCompleter.complete): Extend the list of |
|
718 | * IPython/iplib.py (MagicCompleter.complete): Extend the list of | |
708 | completions with the results of each matcher, so we return results |
|
719 | completions with the results of each matcher, so we return results | |
709 | to the user from all namespaces. This breaks with ipython |
|
720 | to the user from all namespaces. This breaks with ipython | |
710 | tradition, but I think it's a nicer behavior. Now you get all |
|
721 | tradition, but I think it's a nicer behavior. Now you get all | |
711 | possible completions listed, from all possible namespaces (python, |
|
722 | possible completions listed, from all possible namespaces (python, | |
712 | filesystem, magics...) After a request by John Hunter |
|
723 | filesystem, magics...) After a request by John Hunter | |
713 | <jdhunter-AT-nitace.bsd.uchicago.edu>. |
|
724 | <jdhunter-AT-nitace.bsd.uchicago.edu>. | |
714 |
|
725 | |||
715 | 2005-02-05 Fernando Perez <fperez@colorado.edu> |
|
726 | 2005-02-05 Fernando Perez <fperez@colorado.edu> | |
716 |
|
727 | |||
717 | * IPython/Magic.py (magic_prun): Fix bug where prun would fail if |
|
728 | * IPython/Magic.py (magic_prun): Fix bug where prun would fail if | |
718 | the call had quote characters in it (the quotes were stripped). |
|
729 | the call had quote characters in it (the quotes were stripped). | |
719 |
|
730 | |||
720 | 2005-01-31 Fernando Perez <fperez@colorado.edu> |
|
731 | 2005-01-31 Fernando Perez <fperez@colorado.edu> | |
721 |
|
732 | |||
722 | * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on |
|
733 | * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on | |
723 | Itpl.itpl() to make the code more robust against psyco |
|
734 | Itpl.itpl() to make the code more robust against psyco | |
724 | optimizations. |
|
735 | optimizations. | |
725 |
|
736 | |||
726 | * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead |
|
737 | * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead | |
727 | of causing an exception. Quicker, cleaner. |
|
738 | of causing an exception. Quicker, cleaner. | |
728 |
|
739 | |||
729 | 2005-01-28 Fernando Perez <fperez@colorado.edu> |
|
740 | 2005-01-28 Fernando Perez <fperez@colorado.edu> | |
730 |
|
741 | |||
731 | * scripts/ipython_win_post_install.py (install): hardcode |
|
742 | * scripts/ipython_win_post_install.py (install): hardcode | |
732 | sys.prefix+'python.exe' as the executable path. It turns out that |
|
743 | sys.prefix+'python.exe' as the executable path. It turns out that | |
733 | during the post-installation run, sys.executable resolves to the |
|
744 | during the post-installation run, sys.executable resolves to the | |
734 | name of the binary installer! I should report this as a distutils |
|
745 | name of the binary installer! I should report this as a distutils | |
735 | bug, I think. I updated the .10 release with this tiny fix, to |
|
746 | bug, I think. I updated the .10 release with this tiny fix, to | |
736 | avoid annoying the lists further. |
|
747 | avoid annoying the lists further. | |
737 |
|
748 | |||
738 | 2005-01-27 *** Released version 0.6.10 |
|
749 | 2005-01-27 *** Released version 0.6.10 | |
739 |
|
750 | |||
740 | 2005-01-27 Fernando Perez <fperez@colorado.edu> |
|
751 | 2005-01-27 Fernando Perez <fperez@colorado.edu> | |
741 |
|
752 | |||
742 | * IPython/numutils.py (norm): Added 'inf' as optional name for |
|
753 | * IPython/numutils.py (norm): Added 'inf' as optional name for | |
743 | L-infinity norm, included references to mathworld.com for vector |
|
754 | L-infinity norm, included references to mathworld.com for vector | |
744 | norm definitions. |
|
755 | norm definitions. | |
745 | (amin/amax): added amin/amax for array min/max. Similar to what |
|
756 | (amin/amax): added amin/amax for array min/max. Similar to what | |
746 | pylab ships with after the recent reorganization of names. |
|
757 | pylab ships with after the recent reorganization of names. | |
747 | (spike/spike_odd): removed deprecated spike/spike_odd functions. |
|
758 | (spike/spike_odd): removed deprecated spike/spike_odd functions. | |
748 |
|
759 | |||
749 | * ipython.el: committed Alex's recent fixes and improvements. |
|
760 | * ipython.el: committed Alex's recent fixes and improvements. | |
750 | Tested with python-mode from CVS, and it looks excellent. Since |
|
761 | Tested with python-mode from CVS, and it looks excellent. Since | |
751 | python-mode hasn't released anything in a while, I'm temporarily |
|
762 | python-mode hasn't released anything in a while, I'm temporarily | |
752 | putting a copy of today's CVS (v 4.70) of python-mode in: |
|
763 | putting a copy of today's CVS (v 4.70) of python-mode in: | |
753 | http://ipython.scipy.org/tmp/python-mode.el |
|
764 | http://ipython.scipy.org/tmp/python-mode.el | |
754 |
|
765 | |||
755 | * scripts/ipython_win_post_install.py (install): Win32 fix to use |
|
766 | * scripts/ipython_win_post_install.py (install): Win32 fix to use | |
756 | sys.executable for the executable name, instead of assuming it's |
|
767 | sys.executable for the executable name, instead of assuming it's | |
757 | called 'python.exe' (the post-installer would have produced broken |
|
768 | called 'python.exe' (the post-installer would have produced broken | |
758 | setups on systems with a differently named python binary). |
|
769 | setups on systems with a differently named python binary). | |
759 |
|
770 | |||
760 | * IPython/PyColorize.py (Parser.__call__): change explicit '\n' |
|
771 | * IPython/PyColorize.py (Parser.__call__): change explicit '\n' | |
761 | references to os.linesep, to make the code more |
|
772 | references to os.linesep, to make the code more | |
762 | platform-independent. This is also part of the win32 coloring |
|
773 | platform-independent. This is also part of the win32 coloring | |
763 | fixes. |
|
774 | fixes. | |
764 |
|
775 | |||
765 | * IPython/genutils.py (page_dumb): Remove attempts to chop long |
|
776 | * IPython/genutils.py (page_dumb): Remove attempts to chop long | |
766 | lines, which actually cause coloring bugs because the length of |
|
777 | lines, which actually cause coloring bugs because the length of | |
767 | the line is very difficult to correctly compute with embedded |
|
778 | the line is very difficult to correctly compute with embedded | |
768 | escapes. This was the source of all the coloring problems under |
|
779 | escapes. This was the source of all the coloring problems under | |
769 | Win32. I think that _finally_, Win32 users have a properly |
|
780 | Win32. I think that _finally_, Win32 users have a properly | |
770 | working ipython in all respects. This would never have happened |
|
781 | working ipython in all respects. This would never have happened | |
771 | if not for Gary Bishop and Viktor Ransmayr's great help and work. |
|
782 | if not for Gary Bishop and Viktor Ransmayr's great help and work. | |
772 |
|
783 | |||
773 | 2005-01-26 *** Released version 0.6.9 |
|
784 | 2005-01-26 *** Released version 0.6.9 | |
774 |
|
785 | |||
775 | 2005-01-25 Fernando Perez <fperez@colorado.edu> |
|
786 | 2005-01-25 Fernando Perez <fperez@colorado.edu> | |
776 |
|
787 | |||
777 | * setup.py: finally, we have a true Windows installer, thanks to |
|
788 | * setup.py: finally, we have a true Windows installer, thanks to | |
778 | the excellent work of Viktor Ransmayr |
|
789 | the excellent work of Viktor Ransmayr | |
779 | <viktor.ransmayr-AT-t-online.de>. The docs have been updated for |
|
790 | <viktor.ransmayr-AT-t-online.de>. The docs have been updated for | |
780 | Windows users. The setup routine is quite a bit cleaner thanks to |
|
791 | Windows users. The setup routine is quite a bit cleaner thanks to | |
781 | this, and the post-install script uses the proper functions to |
|
792 | this, and the post-install script uses the proper functions to | |
782 | allow a clean de-installation using the standard Windows Control |
|
793 | allow a clean de-installation using the standard Windows Control | |
783 | Panel. |
|
794 | Panel. | |
784 |
|
795 | |||
785 | * IPython/genutils.py (get_home_dir): changed to use the $HOME |
|
796 | * IPython/genutils.py (get_home_dir): changed to use the $HOME | |
786 | environment variable under all OSes (including win32) if |
|
797 | environment variable under all OSes (including win32) if | |
787 | available. This will give consistency to win32 users who have set |
|
798 | available. This will give consistency to win32 users who have set | |
788 | this variable for any reason. If os.environ['HOME'] fails, the |
|
799 | this variable for any reason. If os.environ['HOME'] fails, the | |
789 | previous policy of using HOMEDRIVE\HOMEPATH kicks in. |
|
800 | previous policy of using HOMEDRIVE\HOMEPATH kicks in. | |
790 |
|
801 | |||
791 | 2005-01-24 Fernando Perez <fperez@colorado.edu> |
|
802 | 2005-01-24 Fernando Perez <fperez@colorado.edu> | |
792 |
|
803 | |||
793 | * IPython/numutils.py (empty_like): add empty_like(), similar to |
|
804 | * IPython/numutils.py (empty_like): add empty_like(), similar to | |
794 | zeros_like() but taking advantage of the new empty() Numeric routine. |
|
805 | zeros_like() but taking advantage of the new empty() Numeric routine. | |
795 |
|
806 | |||
796 | 2005-01-23 *** Released version 0.6.8 |
|
807 | 2005-01-23 *** Released version 0.6.8 | |
797 |
|
808 | |||
798 | 2005-01-22 Fernando Perez <fperez@colorado.edu> |
|
809 | 2005-01-22 Fernando Perez <fperez@colorado.edu> | |
799 |
|
810 | |||
800 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the |
|
811 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the | |
801 | automatic show() calls. After discussing things with JDH, it |
|
812 | automatic show() calls. After discussing things with JDH, it | |
802 | turns out there are too many corner cases where this can go wrong. |
|
813 | turns out there are too many corner cases where this can go wrong. | |
803 | It's best not to try to be 'too smart', and simply have ipython |
|
814 | It's best not to try to be 'too smart', and simply have ipython | |
804 | reproduce as much as possible the default behavior of a normal |
|
815 | reproduce as much as possible the default behavior of a normal | |
805 | python shell. |
|
816 | python shell. | |
806 |
|
817 | |||
807 | * IPython/iplib.py (InteractiveShell.__init__): Modified the |
|
818 | * IPython/iplib.py (InteractiveShell.__init__): Modified the | |
808 | line-splitting regexp and _prefilter() to avoid calling getattr() |
|
819 | line-splitting regexp and _prefilter() to avoid calling getattr() | |
809 | on assignments. This closes |
|
820 | on assignments. This closes | |
810 | http://www.scipy.net/roundup/ipython/issue24. Note that Python's |
|
821 | http://www.scipy.net/roundup/ipython/issue24. Note that Python's | |
811 | readline uses getattr(), so a simple <TAB> keypress is still |
|
822 | readline uses getattr(), so a simple <TAB> keypress is still | |
812 | enough to trigger getattr() calls on an object. |
|
823 | enough to trigger getattr() calls on an object. | |
813 |
|
824 | |||
814 | 2005-01-21 Fernando Perez <fperez@colorado.edu> |
|
825 | 2005-01-21 Fernando Perez <fperez@colorado.edu> | |
815 |
|
826 | |||
816 | * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run |
|
827 | * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run | |
817 | docstring under pylab so it doesn't mask the original. |
|
828 | docstring under pylab so it doesn't mask the original. | |
818 |
|
829 | |||
819 | 2005-01-21 *** Released version 0.6.7 |
|
830 | 2005-01-21 *** Released version 0.6.7 | |
820 |
|
831 | |||
821 | 2005-01-21 Fernando Perez <fperez@colorado.edu> |
|
832 | 2005-01-21 Fernando Perez <fperez@colorado.edu> | |
822 |
|
833 | |||
823 | * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with |
|
834 | * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with | |
824 | signal handling for win32 users in multithreaded mode. |
|
835 | signal handling for win32 users in multithreaded mode. | |
825 |
|
836 | |||
826 | 2005-01-17 Fernando Perez <fperez@colorado.edu> |
|
837 | 2005-01-17 Fernando Perez <fperez@colorado.edu> | |
827 |
|
838 | |||
828 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting |
|
839 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting | |
829 | instances with no __init__. After a crash report by Norbert Nemec |
|
840 | instances with no __init__. After a crash report by Norbert Nemec | |
830 | <Norbert-AT-nemec-online.de>. |
|
841 | <Norbert-AT-nemec-online.de>. | |
831 |
|
842 | |||
832 | 2005-01-14 Fernando Perez <fperez@colorado.edu> |
|
843 | 2005-01-14 Fernando Perez <fperez@colorado.edu> | |
833 |
|
844 | |||
834 | * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of |
|
845 | * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of | |
835 | names for verbose exceptions, when multiple dotted names and the |
|
846 | names for verbose exceptions, when multiple dotted names and the | |
836 | 'parent' object were present on the same line. |
|
847 | 'parent' object were present on the same line. | |
837 |
|
848 | |||
838 | 2005-01-11 Fernando Perez <fperez@colorado.edu> |
|
849 | 2005-01-11 Fernando Perez <fperez@colorado.edu> | |
839 |
|
850 | |||
840 | * IPython/genutils.py (flag_calls): new utility to trap and flag |
|
851 | * IPython/genutils.py (flag_calls): new utility to trap and flag | |
841 | calls in functions. I need it to clean up matplotlib support. |
|
852 | calls in functions. I need it to clean up matplotlib support. | |
842 | Also removed some deprecated code in genutils. |
|
853 | Also removed some deprecated code in genutils. | |
843 |
|
854 | |||
844 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so |
|
855 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so | |
845 | that matplotlib scripts called with %run, which don't call show() |
|
856 | that matplotlib scripts called with %run, which don't call show() | |
846 | themselves, still have their plotting windows open. |
|
857 | themselves, still have their plotting windows open. | |
847 |
|
858 | |||
848 | 2005-01-05 Fernando Perez <fperez@colorado.edu> |
|
859 | 2005-01-05 Fernando Perez <fperez@colorado.edu> | |
849 |
|
860 | |||
850 | * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw |
|
861 | * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw | |
851 | <astraw-AT-caltech.edu>, to fix gtk deprecation warnings. |
|
862 | <astraw-AT-caltech.edu>, to fix gtk deprecation warnings. | |
852 |
|
863 | |||
853 | 2004-12-19 Fernando Perez <fperez@colorado.edu> |
|
864 | 2004-12-19 Fernando Perez <fperez@colorado.edu> | |
854 |
|
865 | |||
855 | * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of |
|
866 | * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of | |
856 | parent_runcode, which was an eyesore. The same result can be |
|
867 | parent_runcode, which was an eyesore. The same result can be | |
857 | obtained with Python's regular superclass mechanisms. |
|
868 | obtained with Python's regular superclass mechanisms. | |
858 |
|
869 | |||
859 | 2004-12-17 Fernando Perez <fperez@colorado.edu> |
|
870 | 2004-12-17 Fernando Perez <fperez@colorado.edu> | |
860 |
|
871 | |||
861 | * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem |
|
872 | * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem | |
862 | reported by Prabhu. |
|
873 | reported by Prabhu. | |
863 | (Magic.magic_sx): direct all errors to Term.cerr (defaults to |
|
874 | (Magic.magic_sx): direct all errors to Term.cerr (defaults to | |
864 | sys.stderr) instead of explicitly calling sys.stderr. This helps |
|
875 | sys.stderr) instead of explicitly calling sys.stderr. This helps | |
865 | maintain our I/O abstractions clean, for future GUI embeddings. |
|
876 | maintain our I/O abstractions clean, for future GUI embeddings. | |
866 |
|
877 | |||
867 | * IPython/genutils.py (info): added new utility for sys.stderr |
|
878 | * IPython/genutils.py (info): added new utility for sys.stderr | |
868 | unified info message handling (thin wrapper around warn()). |
|
879 | unified info message handling (thin wrapper around warn()). | |
869 |
|
880 | |||
870 | * IPython/ultraTB.py (VerboseTB.text): Fix misreported global |
|
881 | * IPython/ultraTB.py (VerboseTB.text): Fix misreported global | |
871 | composite (dotted) names on verbose exceptions. |
|
882 | composite (dotted) names on verbose exceptions. | |
872 | (VerboseTB.nullrepr): harden against another kind of errors which |
|
883 | (VerboseTB.nullrepr): harden against another kind of errors which | |
873 | Python's inspect module can trigger, and which were crashing |
|
884 | Python's inspect module can trigger, and which were crashing | |
874 | IPython. Thanks to a report by Marco Lombardi |
|
885 | IPython. Thanks to a report by Marco Lombardi | |
875 | <mlombard-AT-ma010192.hq.eso.org>. |
|
886 | <mlombard-AT-ma010192.hq.eso.org>. | |
876 |
|
887 | |||
877 | 2004-12-13 *** Released version 0.6.6 |
|
888 | 2004-12-13 *** Released version 0.6.6 | |
878 |
|
889 | |||
879 | 2004-12-12 Fernando Perez <fperez@colorado.edu> |
|
890 | 2004-12-12 Fernando Perez <fperez@colorado.edu> | |
880 |
|
891 | |||
881 | * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors |
|
892 | * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors | |
882 | generated by pygtk upon initialization if it was built without |
|
893 | generated by pygtk upon initialization if it was built without | |
883 | threads (for matplotlib users). After a crash reported by |
|
894 | threads (for matplotlib users). After a crash reported by | |
884 | Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>. |
|
895 | Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>. | |
885 |
|
896 | |||
886 | * IPython/ipmaker.py (make_IPython): fix small bug in the |
|
897 | * IPython/ipmaker.py (make_IPython): fix small bug in the | |
887 | import_some parameter for multiple imports. |
|
898 | import_some parameter for multiple imports. | |
888 |
|
899 | |||
889 | * IPython/iplib.py (ipmagic): simplified the interface of |
|
900 | * IPython/iplib.py (ipmagic): simplified the interface of | |
890 | ipmagic() to take a single string argument, just as it would be |
|
901 | ipmagic() to take a single string argument, just as it would be | |
891 | typed at the IPython cmd line. |
|
902 | typed at the IPython cmd line. | |
892 | (ipalias): Added new ipalias() with an interface identical to |
|
903 | (ipalias): Added new ipalias() with an interface identical to | |
893 | ipmagic(). This completes exposing a pure python interface to the |
|
904 | ipmagic(). This completes exposing a pure python interface to the | |
894 | alias and magic system, which can be used in loops or more complex |
|
905 | alias and magic system, which can be used in loops or more complex | |
895 | code where IPython's automatic line mangling is not active. |
|
906 | code where IPython's automatic line mangling is not active. | |
896 |
|
907 | |||
897 | * IPython/genutils.py (timing): changed interface of timing to |
|
908 | * IPython/genutils.py (timing): changed interface of timing to | |
898 | simply run code once, which is the most common case. timings() |
|
909 | simply run code once, which is the most common case. timings() | |
899 | remains unchanged, for the cases where you want multiple runs. |
|
910 | remains unchanged, for the cases where you want multiple runs. | |
900 |
|
911 | |||
901 | * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a |
|
912 | * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a | |
902 | bug where Python2.2 crashes with exec'ing code which does not end |
|
913 | bug where Python2.2 crashes with exec'ing code which does not end | |
903 | in a single newline. Python 2.3 is OK, so I hadn't noticed this |
|
914 | in a single newline. Python 2.3 is OK, so I hadn't noticed this | |
904 | before. |
|
915 | before. | |
905 |
|
916 | |||
906 | 2004-12-10 Fernando Perez <fperez@colorado.edu> |
|
917 | 2004-12-10 Fernando Perez <fperez@colorado.edu> | |
907 |
|
918 | |||
908 | * IPython/Magic.py (Magic.magic_prun): changed name of option from |
|
919 | * IPython/Magic.py (Magic.magic_prun): changed name of option from | |
909 | -t to -T, to accomodate the new -t flag in %run (the %run and |
|
920 | -t to -T, to accomodate the new -t flag in %run (the %run and | |
910 | %prun options are kind of intermixed, and it's not easy to change |
|
921 | %prun options are kind of intermixed, and it's not easy to change | |
911 | this with the limitations of python's getopt). |
|
922 | this with the limitations of python's getopt). | |
912 |
|
923 | |||
913 | * IPython/Magic.py (Magic.magic_run): Added new -t option to time |
|
924 | * IPython/Magic.py (Magic.magic_run): Added new -t option to time | |
914 | the execution of scripts. It's not as fine-tuned as timeit.py, |
|
925 | the execution of scripts. It's not as fine-tuned as timeit.py, | |
915 | but it works from inside ipython (and under 2.2, which lacks |
|
926 | but it works from inside ipython (and under 2.2, which lacks | |
916 | timeit.py). Optionally a number of runs > 1 can be given for |
|
927 | timeit.py). Optionally a number of runs > 1 can be given for | |
917 | timing very short-running code. |
|
928 | timing very short-running code. | |
918 |
|
929 | |||
919 | * IPython/genutils.py (uniq_stable): new routine which returns a |
|
930 | * IPython/genutils.py (uniq_stable): new routine which returns a | |
920 | list of unique elements in any iterable, but in stable order of |
|
931 | list of unique elements in any iterable, but in stable order of | |
921 | appearance. I needed this for the ultraTB fixes, and it's a handy |
|
932 | appearance. I needed this for the ultraTB fixes, and it's a handy | |
922 | utility. |
|
933 | utility. | |
923 |
|
934 | |||
924 | * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of |
|
935 | * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of | |
925 | dotted names in Verbose exceptions. This had been broken since |
|
936 | dotted names in Verbose exceptions. This had been broken since | |
926 | the very start, now x.y will properly be printed in a Verbose |
|
937 | the very start, now x.y will properly be printed in a Verbose | |
927 | traceback, instead of x being shown and y appearing always as an |
|
938 | traceback, instead of x being shown and y appearing always as an | |
928 | 'undefined global'. Getting this to work was a bit tricky, |
|
939 | 'undefined global'. Getting this to work was a bit tricky, | |
929 | because by default python tokenizers are stateless. Saved by |
|
940 | because by default python tokenizers are stateless. Saved by | |
930 | python's ability to easily add a bit of state to an arbitrary |
|
941 | python's ability to easily add a bit of state to an arbitrary | |
931 | function (without needing to build a full-blown callable object). |
|
942 | function (without needing to build a full-blown callable object). | |
932 |
|
943 | |||
933 | Also big cleanup of this code, which had horrendous runtime |
|
944 | Also big cleanup of this code, which had horrendous runtime | |
934 | lookups of zillions of attributes for colorization. Moved all |
|
945 | lookups of zillions of attributes for colorization. Moved all | |
935 | this code into a few templates, which make it cleaner and quicker. |
|
946 | this code into a few templates, which make it cleaner and quicker. | |
936 |
|
947 | |||
937 | Printout quality was also improved for Verbose exceptions: one |
|
948 | Printout quality was also improved for Verbose exceptions: one | |
938 | variable per line, and memory addresses are printed (this can be |
|
949 | variable per line, and memory addresses are printed (this can be | |
939 | quite handy in nasty debugging situations, which is what Verbose |
|
950 | quite handy in nasty debugging situations, which is what Verbose | |
940 | is for). |
|
951 | is for). | |
941 |
|
952 | |||
942 | * IPython/ipmaker.py (make_IPython): Do NOT execute files named in |
|
953 | * IPython/ipmaker.py (make_IPython): Do NOT execute files named in | |
943 | the command line as scripts to be loaded by embedded instances. |
|
954 | the command line as scripts to be loaded by embedded instances. | |
944 | Doing so has the potential for an infinite recursion if there are |
|
955 | Doing so has the potential for an infinite recursion if there are | |
945 | exceptions thrown in the process. This fixes a strange crash |
|
956 | exceptions thrown in the process. This fixes a strange crash | |
946 | reported by Philippe MULLER <muller-AT-irit.fr>. |
|
957 | reported by Philippe MULLER <muller-AT-irit.fr>. | |
947 |
|
958 | |||
948 | 2004-12-09 Fernando Perez <fperez@colorado.edu> |
|
959 | 2004-12-09 Fernando Perez <fperez@colorado.edu> | |
949 |
|
960 | |||
950 | * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support |
|
961 | * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support | |
951 | to reflect new names in matplotlib, which now expose the |
|
962 | to reflect new names in matplotlib, which now expose the | |
952 | matlab-compatible interface via a pylab module instead of the |
|
963 | matlab-compatible interface via a pylab module instead of the | |
953 | 'matlab' name. The new code is backwards compatible, so users of |
|
964 | 'matlab' name. The new code is backwards compatible, so users of | |
954 | all matplotlib versions are OK. Patch by J. Hunter. |
|
965 | all matplotlib versions are OK. Patch by J. Hunter. | |
955 |
|
966 | |||
956 | * IPython/OInspect.py (Inspector.pinfo): Add to object? printing |
|
967 | * IPython/OInspect.py (Inspector.pinfo): Add to object? printing | |
957 | of __init__ docstrings for instances (class docstrings are already |
|
968 | of __init__ docstrings for instances (class docstrings are already | |
958 | automatically printed). Instances with customized docstrings |
|
969 | automatically printed). Instances with customized docstrings | |
959 | (indep. of the class) are also recognized and all 3 separate |
|
970 | (indep. of the class) are also recognized and all 3 separate | |
960 | docstrings are printed (instance, class, constructor). After some |
|
971 | docstrings are printed (instance, class, constructor). After some | |
961 | comments/suggestions by J. Hunter. |
|
972 | comments/suggestions by J. Hunter. | |
962 |
|
973 | |||
963 | 2004-12-05 Fernando Perez <fperez@colorado.edu> |
|
974 | 2004-12-05 Fernando Perez <fperez@colorado.edu> | |
964 |
|
975 | |||
965 | * IPython/iplib.py (MagicCompleter.complete): Remove annoying |
|
976 | * IPython/iplib.py (MagicCompleter.complete): Remove annoying | |
966 | warnings when tab-completion fails and triggers an exception. |
|
977 | warnings when tab-completion fails and triggers an exception. | |
967 |
|
978 | |||
968 | 2004-12-03 Fernando Perez <fperez@colorado.edu> |
|
979 | 2004-12-03 Fernando Perez <fperez@colorado.edu> | |
969 |
|
980 | |||
970 | * IPython/Magic.py (magic_prun): Fix bug where an exception would |
|
981 | * IPython/Magic.py (magic_prun): Fix bug where an exception would | |
971 | be triggered when using 'run -p'. An incorrect option flag was |
|
982 | be triggered when using 'run -p'. An incorrect option flag was | |
972 | being set ('d' instead of 'D'). |
|
983 | being set ('d' instead of 'D'). | |
973 | (manpage): fix missing escaped \- sign. |
|
984 | (manpage): fix missing escaped \- sign. | |
974 |
|
985 | |||
975 | 2004-11-30 *** Released version 0.6.5 |
|
986 | 2004-11-30 *** Released version 0.6.5 | |
976 |
|
987 | |||
977 | 2004-11-30 Fernando Perez <fperez@colorado.edu> |
|
988 | 2004-11-30 Fernando Perez <fperez@colorado.edu> | |
978 |
|
989 | |||
979 | * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint |
|
990 | * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint | |
980 | setting with -d option. |
|
991 | setting with -d option. | |
981 |
|
992 | |||
982 | * setup.py (docfiles): Fix problem where the doc glob I was using |
|
993 | * setup.py (docfiles): Fix problem where the doc glob I was using | |
983 | was COMPLETELY BROKEN. It was giving the right files by pure |
|
994 | was COMPLETELY BROKEN. It was giving the right files by pure | |
984 | accident, but failed once I tried to include ipython.el. Note: |
|
995 | accident, but failed once I tried to include ipython.el. Note: | |
985 | glob() does NOT allow you to do exclusion on multiple endings! |
|
996 | glob() does NOT allow you to do exclusion on multiple endings! | |
986 |
|
997 | |||
987 | 2004-11-29 Fernando Perez <fperez@colorado.edu> |
|
998 | 2004-11-29 Fernando Perez <fperez@colorado.edu> | |
988 |
|
999 | |||
989 | * IPython/usage.py (__doc__): cleaned up usage docstring, by using |
|
1000 | * IPython/usage.py (__doc__): cleaned up usage docstring, by using | |
990 | the manpage as the source. Better formatting & consistency. |
|
1001 | the manpage as the source. Better formatting & consistency. | |
991 |
|
1002 | |||
992 | * IPython/Magic.py (magic_run): Added new -d option, to run |
|
1003 | * IPython/Magic.py (magic_run): Added new -d option, to run | |
993 | scripts under the control of the python pdb debugger. Note that |
|
1004 | scripts under the control of the python pdb debugger. Note that | |
994 | this required changing the %prun option -d to -D, to avoid a clash |
|
1005 | this required changing the %prun option -d to -D, to avoid a clash | |
995 | (since %run must pass options to %prun, and getopt is too dumb to |
|
1006 | (since %run must pass options to %prun, and getopt is too dumb to | |
996 | handle options with string values with embedded spaces). Thanks |
|
1007 | handle options with string values with embedded spaces). Thanks | |
997 | to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>. |
|
1008 | to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>. | |
998 | (magic_who_ls): added type matching to %who and %whos, so that one |
|
1009 | (magic_who_ls): added type matching to %who and %whos, so that one | |
999 | can filter their output to only include variables of certain |
|
1010 | can filter their output to only include variables of certain | |
1000 | types. Another suggestion by Matthew. |
|
1011 | types. Another suggestion by Matthew. | |
1001 | (magic_whos): Added memory summaries in kb and Mb for arrays. |
|
1012 | (magic_whos): Added memory summaries in kb and Mb for arrays. | |
1002 | (magic_who): Improve formatting (break lines every 9 vars). |
|
1013 | (magic_who): Improve formatting (break lines every 9 vars). | |
1003 |
|
1014 | |||
1004 | 2004-11-28 Fernando Perez <fperez@colorado.edu> |
|
1015 | 2004-11-28 Fernando Perez <fperez@colorado.edu> | |
1005 |
|
1016 | |||
1006 | * IPython/Logger.py (Logger.log): Fix bug in syncing the input |
|
1017 | * IPython/Logger.py (Logger.log): Fix bug in syncing the input | |
1007 | cache when empty lines were present. |
|
1018 | cache when empty lines were present. | |
1008 |
|
1019 | |||
1009 | 2004-11-24 Fernando Perez <fperez@colorado.edu> |
|
1020 | 2004-11-24 Fernando Perez <fperez@colorado.edu> | |
1010 |
|
1021 | |||
1011 | * IPython/usage.py (__doc__): document the re-activated threading |
|
1022 | * IPython/usage.py (__doc__): document the re-activated threading | |
1012 | options for WX and GTK. |
|
1023 | options for WX and GTK. | |
1013 |
|
1024 | |||
1014 | 2004-11-23 Fernando Perez <fperez@colorado.edu> |
|
1025 | 2004-11-23 Fernando Perez <fperez@colorado.edu> | |
1015 |
|
1026 | |||
1016 | * IPython/Shell.py (start): Added Prabhu's big patch to reactivate |
|
1027 | * IPython/Shell.py (start): Added Prabhu's big patch to reactivate | |
1017 | the -wthread and -gthread options, along with a new -tk one to try |
|
1028 | the -wthread and -gthread options, along with a new -tk one to try | |
1018 | and coordinate Tk threading with wx/gtk. The tk support is very |
|
1029 | and coordinate Tk threading with wx/gtk. The tk support is very | |
1019 | platform dependent, since it seems to require Tcl and Tk to be |
|
1030 | platform dependent, since it seems to require Tcl and Tk to be | |
1020 | built with threads (Fedora1/2 appears NOT to have it, but in |
|
1031 | built with threads (Fedora1/2 appears NOT to have it, but in | |
1021 | Prabhu's Debian boxes it works OK). But even with some Tk |
|
1032 | Prabhu's Debian boxes it works OK). But even with some Tk | |
1022 | limitations, this is a great improvement. |
|
1033 | limitations, this is a great improvement. | |
1023 |
|
1034 | |||
1024 | * IPython/Prompts.py (prompt_specials_color): Added \t for time |
|
1035 | * IPython/Prompts.py (prompt_specials_color): Added \t for time | |
1025 | info in user prompts. Patch by Prabhu. |
|
1036 | info in user prompts. Patch by Prabhu. | |
1026 |
|
1037 | |||
1027 | 2004-11-18 Fernando Perez <fperez@colorado.edu> |
|
1038 | 2004-11-18 Fernando Perez <fperez@colorado.edu> | |
1028 |
|
1039 | |||
1029 | * IPython/genutils.py (ask_yes_no): Add check for a max of 20 |
|
1040 | * IPython/genutils.py (ask_yes_no): Add check for a max of 20 | |
1030 | EOFErrors and bail, to avoid infinite loops if a non-terminating |
|
1041 | EOFErrors and bail, to avoid infinite loops if a non-terminating | |
1031 | file is fed into ipython. Patch submitted in issue 19 by user, |
|
1042 | file is fed into ipython. Patch submitted in issue 19 by user, | |
1032 | many thanks. |
|
1043 | many thanks. | |
1033 |
|
1044 | |||
1034 | * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger |
|
1045 | * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger | |
1035 | autoquote/parens in continuation prompts, which can cause lots of |
|
1046 | autoquote/parens in continuation prompts, which can cause lots of | |
1036 | problems. Closes roundup issue 20. |
|
1047 | problems. Closes roundup issue 20. | |
1037 |
|
1048 | |||
1038 | 2004-11-17 Fernando Perez <fperez@colorado.edu> |
|
1049 | 2004-11-17 Fernando Perez <fperez@colorado.edu> | |
1039 |
|
1050 | |||
1040 | * debian/control (Build-Depends-Indep): Fix dpatch dependency, |
|
1051 | * debian/control (Build-Depends-Indep): Fix dpatch dependency, | |
1041 | reported as debian bug #280505. I'm not sure my local changelog |
|
1052 | reported as debian bug #280505. I'm not sure my local changelog | |
1042 | entry has the proper debian format (Jack?). |
|
1053 | entry has the proper debian format (Jack?). | |
1043 |
|
1054 | |||
1044 | 2004-11-08 *** Released version 0.6.4 |
|
1055 | 2004-11-08 *** Released version 0.6.4 | |
1045 |
|
1056 | |||
1046 | 2004-11-08 Fernando Perez <fperez@colorado.edu> |
|
1057 | 2004-11-08 Fernando Perez <fperez@colorado.edu> | |
1047 |
|
1058 | |||
1048 | * IPython/iplib.py (init_readline): Fix exit message for Windows |
|
1059 | * IPython/iplib.py (init_readline): Fix exit message for Windows | |
1049 | when readline is active. Thanks to a report by Eric Jones |
|
1060 | when readline is active. Thanks to a report by Eric Jones | |
1050 | <eric-AT-enthought.com>. |
|
1061 | <eric-AT-enthought.com>. | |
1051 |
|
1062 | |||
1052 | 2004-11-07 Fernando Perez <fperez@colorado.edu> |
|
1063 | 2004-11-07 Fernando Perez <fperez@colorado.edu> | |
1053 |
|
1064 | |||
1054 | * IPython/genutils.py (page): Add a trap for OSError exceptions, |
|
1065 | * IPython/genutils.py (page): Add a trap for OSError exceptions, | |
1055 | sometimes seen by win2k/cygwin users. |
|
1066 | sometimes seen by win2k/cygwin users. | |
1056 |
|
1067 | |||
1057 | 2004-11-06 Fernando Perez <fperez@colorado.edu> |
|
1068 | 2004-11-06 Fernando Perez <fperez@colorado.edu> | |
1058 |
|
1069 | |||
1059 | * IPython/iplib.py (interact): Change the handling of %Exit from |
|
1070 | * IPython/iplib.py (interact): Change the handling of %Exit from | |
1060 | trying to propagate a SystemExit to an internal ipython flag. |
|
1071 | trying to propagate a SystemExit to an internal ipython flag. | |
1061 | This is less elegant than using Python's exception mechanism, but |
|
1072 | This is less elegant than using Python's exception mechanism, but | |
1062 | I can't get that to work reliably with threads, so under -pylab |
|
1073 | I can't get that to work reliably with threads, so under -pylab | |
1063 | %Exit was hanging IPython. Cross-thread exception handling is |
|
1074 | %Exit was hanging IPython. Cross-thread exception handling is | |
1064 | really a bitch. Thaks to a bug report by Stephen Walton |
|
1075 | really a bitch. Thaks to a bug report by Stephen Walton | |
1065 | <stephen.walton-AT-csun.edu>. |
|
1076 | <stephen.walton-AT-csun.edu>. | |
1066 |
|
1077 | |||
1067 | 2004-11-04 Fernando Perez <fperez@colorado.edu> |
|
1078 | 2004-11-04 Fernando Perez <fperez@colorado.edu> | |
1068 |
|
1079 | |||
1069 | * IPython/iplib.py (raw_input_original): store a pointer to the |
|
1080 | * IPython/iplib.py (raw_input_original): store a pointer to the | |
1070 | true raw_input to harden against code which can modify it |
|
1081 | true raw_input to harden against code which can modify it | |
1071 | (wx.py.PyShell does this and would otherwise crash ipython). |
|
1082 | (wx.py.PyShell does this and would otherwise crash ipython). | |
1072 | Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>. |
|
1083 | Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>. | |
1073 |
|
1084 | |||
1074 | * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for |
|
1085 | * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for | |
1075 | Ctrl-C problem, which does not mess up the input line. |
|
1086 | Ctrl-C problem, which does not mess up the input line. | |
1076 |
|
1087 | |||
1077 | 2004-11-03 Fernando Perez <fperez@colorado.edu> |
|
1088 | 2004-11-03 Fernando Perez <fperez@colorado.edu> | |
1078 |
|
1089 | |||
1079 | * IPython/Release.py: Changed licensing to BSD, in all files. |
|
1090 | * IPython/Release.py: Changed licensing to BSD, in all files. | |
1080 | (name): lowercase name for tarball/RPM release. |
|
1091 | (name): lowercase name for tarball/RPM release. | |
1081 |
|
1092 | |||
1082 | * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for |
|
1093 | * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for | |
1083 | use throughout ipython. |
|
1094 | use throughout ipython. | |
1084 |
|
1095 | |||
1085 | * IPython/Magic.py (Magic._ofind): Switch to using the new |
|
1096 | * IPython/Magic.py (Magic._ofind): Switch to using the new | |
1086 | OInspect.getdoc() function. |
|
1097 | OInspect.getdoc() function. | |
1087 |
|
1098 | |||
1088 | * IPython/Shell.py (sigint_handler): Hack to ignore the execution |
|
1099 | * IPython/Shell.py (sigint_handler): Hack to ignore the execution | |
1089 | of the line currently being canceled via Ctrl-C. It's extremely |
|
1100 | of the line currently being canceled via Ctrl-C. It's extremely | |
1090 | ugly, but I don't know how to do it better (the problem is one of |
|
1101 | ugly, but I don't know how to do it better (the problem is one of | |
1091 | handling cross-thread exceptions). |
|
1102 | handling cross-thread exceptions). | |
1092 |
|
1103 | |||
1093 | 2004-10-28 Fernando Perez <fperez@colorado.edu> |
|
1104 | 2004-10-28 Fernando Perez <fperez@colorado.edu> | |
1094 |
|
1105 | |||
1095 | * IPython/Shell.py (signal_handler): add signal handlers to trap |
|
1106 | * IPython/Shell.py (signal_handler): add signal handlers to trap | |
1096 | SIGINT and SIGSEGV in threaded code properly. Thanks to a bug |
|
1107 | SIGINT and SIGSEGV in threaded code properly. Thanks to a bug | |
1097 | report by Francesc Alted. |
|
1108 | report by Francesc Alted. | |
1098 |
|
1109 | |||
1099 | 2004-10-21 Fernando Perez <fperez@colorado.edu> |
|
1110 | 2004-10-21 Fernando Perez <fperez@colorado.edu> | |
1100 |
|
1111 | |||
1101 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @ |
|
1112 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @ | |
1102 | to % for pysh syntax extensions. |
|
1113 | to % for pysh syntax extensions. | |
1103 |
|
1114 | |||
1104 | 2004-10-09 Fernando Perez <fperez@colorado.edu> |
|
1115 | 2004-10-09 Fernando Perez <fperez@colorado.edu> | |
1105 |
|
1116 | |||
1106 | * IPython/Magic.py (Magic.magic_whos): modify output of Numeric |
|
1117 | * IPython/Magic.py (Magic.magic_whos): modify output of Numeric | |
1107 | arrays to print a more useful summary, without calling str(arr). |
|
1118 | arrays to print a more useful summary, without calling str(arr). | |
1108 | This avoids the problem of extremely lengthy computations which |
|
1119 | This avoids the problem of extremely lengthy computations which | |
1109 | occur if arr is large, and appear to the user as a system lockup |
|
1120 | occur if arr is large, and appear to the user as a system lockup | |
1110 | with 100% cpu activity. After a suggestion by Kristian Sandberg |
|
1121 | with 100% cpu activity. After a suggestion by Kristian Sandberg | |
1111 | <Kristian.Sandberg@colorado.edu>. |
|
1122 | <Kristian.Sandberg@colorado.edu>. | |
1112 | (Magic.__init__): fix bug in global magic escapes not being |
|
1123 | (Magic.__init__): fix bug in global magic escapes not being | |
1113 | correctly set. |
|
1124 | correctly set. | |
1114 |
|
1125 | |||
1115 | 2004-10-08 Fernando Perez <fperez@colorado.edu> |
|
1126 | 2004-10-08 Fernando Perez <fperez@colorado.edu> | |
1116 |
|
1127 | |||
1117 | * IPython/Magic.py (__license__): change to absolute imports of |
|
1128 | * IPython/Magic.py (__license__): change to absolute imports of | |
1118 | ipython's own internal packages, to start adapting to the absolute |
|
1129 | ipython's own internal packages, to start adapting to the absolute | |
1119 | import requirement of PEP-328. |
|
1130 | import requirement of PEP-328. | |
1120 |
|
1131 | |||
1121 | * IPython/genutils.py (__author__): Fix coding to utf-8 on all |
|
1132 | * IPython/genutils.py (__author__): Fix coding to utf-8 on all | |
1122 | files, and standardize author/license marks through the Release |
|
1133 | files, and standardize author/license marks through the Release | |
1123 | module instead of having per/file stuff (except for files with |
|
1134 | module instead of having per/file stuff (except for files with | |
1124 | particular licenses, like the MIT/PSF-licensed codes). |
|
1135 | particular licenses, like the MIT/PSF-licensed codes). | |
1125 |
|
1136 | |||
1126 | * IPython/Debugger.py: remove dead code for python 2.1 |
|
1137 | * IPython/Debugger.py: remove dead code for python 2.1 | |
1127 |
|
1138 | |||
1128 | 2004-10-04 Fernando Perez <fperez@colorado.edu> |
|
1139 | 2004-10-04 Fernando Perez <fperez@colorado.edu> | |
1129 |
|
1140 | |||
1130 | * IPython/iplib.py (ipmagic): New function for accessing magics |
|
1141 | * IPython/iplib.py (ipmagic): New function for accessing magics | |
1131 | via a normal python function call. |
|
1142 | via a normal python function call. | |
1132 |
|
1143 | |||
1133 | * IPython/Magic.py (Magic.magic_magic): Change the magic escape |
|
1144 | * IPython/Magic.py (Magic.magic_magic): Change the magic escape | |
1134 | from '@' to '%', to accomodate the new @decorator syntax of python |
|
1145 | from '@' to '%', to accomodate the new @decorator syntax of python | |
1135 | 2.4. |
|
1146 | 2.4. | |
1136 |
|
1147 | |||
1137 | 2004-09-29 Fernando Perez <fperez@colorado.edu> |
|
1148 | 2004-09-29 Fernando Perez <fperez@colorado.edu> | |
1138 |
|
1149 | |||
1139 | * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to |
|
1150 | * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to | |
1140 | matplotlib.use to prevent running scripts which try to switch |
|
1151 | matplotlib.use to prevent running scripts which try to switch | |
1141 | interactive backends from within ipython. This will just crash |
|
1152 | interactive backends from within ipython. This will just crash | |
1142 | the python interpreter, so we can't allow it (but a detailed error |
|
1153 | the python interpreter, so we can't allow it (but a detailed error | |
1143 | is given to the user). |
|
1154 | is given to the user). | |
1144 |
|
1155 | |||
1145 | 2004-09-28 Fernando Perez <fperez@colorado.edu> |
|
1156 | 2004-09-28 Fernando Perez <fperez@colorado.edu> | |
1146 |
|
1157 | |||
1147 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): |
|
1158 | * IPython/Shell.py (MatplotlibShellBase.mplot_exec): | |
1148 | matplotlib-related fixes so that using @run with non-matplotlib |
|
1159 | matplotlib-related fixes so that using @run with non-matplotlib | |
1149 | scripts doesn't pop up spurious plot windows. This requires |
|
1160 | scripts doesn't pop up spurious plot windows. This requires | |
1150 | matplotlib >= 0.63, where I had to make some changes as well. |
|
1161 | matplotlib >= 0.63, where I had to make some changes as well. | |
1151 |
|
1162 | |||
1152 | * IPython/ipmaker.py (make_IPython): update version requirement to |
|
1163 | * IPython/ipmaker.py (make_IPython): update version requirement to | |
1153 | python 2.2. |
|
1164 | python 2.2. | |
1154 |
|
1165 | |||
1155 | * IPython/iplib.py (InteractiveShell.mainloop): Add an optional |
|
1166 | * IPython/iplib.py (InteractiveShell.mainloop): Add an optional | |
1156 | banner arg for embedded customization. |
|
1167 | banner arg for embedded customization. | |
1157 |
|
1168 | |||
1158 | * IPython/Magic.py (Magic.__init__): big cleanup to remove all |
|
1169 | * IPython/Magic.py (Magic.__init__): big cleanup to remove all | |
1159 | explicit uses of __IP as the IPython's instance name. Now things |
|
1170 | explicit uses of __IP as the IPython's instance name. Now things | |
1160 | are properly handled via the shell.name value. The actual code |
|
1171 | are properly handled via the shell.name value. The actual code | |
1161 | is a bit ugly b/c I'm doing it via a global in Magic.py, but this |
|
1172 | is a bit ugly b/c I'm doing it via a global in Magic.py, but this | |
1162 | is much better than before. I'll clean things completely when the |
|
1173 | is much better than before. I'll clean things completely when the | |
1163 | magic stuff gets a real overhaul. |
|
1174 | magic stuff gets a real overhaul. | |
1164 |
|
1175 | |||
1165 | * ipython.1: small fixes, sent in by Jack Moffit. He also sent in |
|
1176 | * ipython.1: small fixes, sent in by Jack Moffit. He also sent in | |
1166 | minor changes to debian dir. |
|
1177 | minor changes to debian dir. | |
1167 |
|
1178 | |||
1168 | * IPython/iplib.py (InteractiveShell.__init__): Fix adding a |
|
1179 | * IPython/iplib.py (InteractiveShell.__init__): Fix adding a | |
1169 | pointer to the shell itself in the interactive namespace even when |
|
1180 | pointer to the shell itself in the interactive namespace even when | |
1170 | a user-supplied dict is provided. This is needed for embedding |
|
1181 | a user-supplied dict is provided. This is needed for embedding | |
1171 | purposes (found by tests with Michel Sanner). |
|
1182 | purposes (found by tests with Michel Sanner). | |
1172 |
|
1183 | |||
1173 | 2004-09-27 Fernando Perez <fperez@colorado.edu> |
|
1184 | 2004-09-27 Fernando Perez <fperez@colorado.edu> | |
1174 |
|
1185 | |||
1175 | * IPython/UserConfig/ipythonrc: remove []{} from |
|
1186 | * IPython/UserConfig/ipythonrc: remove []{} from | |
1176 | readline_remove_delims, so that things like [modname.<TAB> do |
|
1187 | readline_remove_delims, so that things like [modname.<TAB> do | |
1177 | proper completion. This disables [].TAB, but that's a less common |
|
1188 | proper completion. This disables [].TAB, but that's a less common | |
1178 | case than module names in list comprehensions, for example. |
|
1189 | case than module names in list comprehensions, for example. | |
1179 | Thanks to a report by Andrea Riciputi. |
|
1190 | Thanks to a report by Andrea Riciputi. | |
1180 |
|
1191 | |||
1181 | 2004-09-09 Fernando Perez <fperez@colorado.edu> |
|
1192 | 2004-09-09 Fernando Perez <fperez@colorado.edu> | |
1182 |
|
1193 | |||
1183 | * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid |
|
1194 | * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid | |
1184 | blocking problems in win32 and osx. Fix by John. |
|
1195 | blocking problems in win32 and osx. Fix by John. | |
1185 |
|
1196 | |||
1186 | 2004-09-08 Fernando Perez <fperez@colorado.edu> |
|
1197 | 2004-09-08 Fernando Perez <fperez@colorado.edu> | |
1187 |
|
1198 | |||
1188 | * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug |
|
1199 | * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug | |
1189 | for Win32 and OSX. Fix by John Hunter. |
|
1200 | for Win32 and OSX. Fix by John Hunter. | |
1190 |
|
1201 | |||
1191 | 2004-08-30 *** Released version 0.6.3 |
|
1202 | 2004-08-30 *** Released version 0.6.3 | |
1192 |
|
1203 | |||
1193 | 2004-08-30 Fernando Perez <fperez@colorado.edu> |
|
1204 | 2004-08-30 Fernando Perez <fperez@colorado.edu> | |
1194 |
|
1205 | |||
1195 | * setup.py (isfile): Add manpages to list of dependent files to be |
|
1206 | * setup.py (isfile): Add manpages to list of dependent files to be | |
1196 | updated. |
|
1207 | updated. | |
1197 |
|
1208 | |||
1198 | 2004-08-27 Fernando Perez <fperez@colorado.edu> |
|
1209 | 2004-08-27 Fernando Perez <fperez@colorado.edu> | |
1199 |
|
1210 | |||
1200 | * IPython/Shell.py (start): I've disabled -wthread and -gthread |
|
1211 | * IPython/Shell.py (start): I've disabled -wthread and -gthread | |
1201 | for now. They don't really work with standalone WX/GTK code |
|
1212 | for now. They don't really work with standalone WX/GTK code | |
1202 | (though matplotlib IS working fine with both of those backends). |
|
1213 | (though matplotlib IS working fine with both of those backends). | |
1203 | This will neeed much more testing. I disabled most things with |
|
1214 | This will neeed much more testing. I disabled most things with | |
1204 | comments, so turning it back on later should be pretty easy. |
|
1215 | comments, so turning it back on later should be pretty easy. | |
1205 |
|
1216 | |||
1206 | * IPython/iplib.py (InteractiveShell.__init__): Fix accidental |
|
1217 | * IPython/iplib.py (InteractiveShell.__init__): Fix accidental | |
1207 | autocalling of expressions like r'foo', by modifying the line |
|
1218 | autocalling of expressions like r'foo', by modifying the line | |
1208 | split regexp. Closes |
|
1219 | split regexp. Closes | |
1209 | http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas |
|
1220 | http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas | |
1210 | Riley <ipythonbugs-AT-sabi.net>. |
|
1221 | Riley <ipythonbugs-AT-sabi.net>. | |
1211 | (InteractiveShell.mainloop): honor --nobanner with banner |
|
1222 | (InteractiveShell.mainloop): honor --nobanner with banner | |
1212 | extensions. |
|
1223 | extensions. | |
1213 |
|
1224 | |||
1214 | * IPython/Shell.py: Significant refactoring of all classes, so |
|
1225 | * IPython/Shell.py: Significant refactoring of all classes, so | |
1215 | that we can really support ALL matplotlib backends and threading |
|
1226 | that we can really support ALL matplotlib backends and threading | |
1216 | models (John spotted a bug with Tk which required this). Now we |
|
1227 | models (John spotted a bug with Tk which required this). Now we | |
1217 | should support single-threaded, WX-threads and GTK-threads, both |
|
1228 | should support single-threaded, WX-threads and GTK-threads, both | |
1218 | for generic code and for matplotlib. |
|
1229 | for generic code and for matplotlib. | |
1219 |
|
1230 | |||
1220 | * IPython/ipmaker.py (__call__): Changed -mpthread option to |
|
1231 | * IPython/ipmaker.py (__call__): Changed -mpthread option to | |
1221 | -pylab, to simplify things for users. Will also remove the pylab |
|
1232 | -pylab, to simplify things for users. Will also remove the pylab | |
1222 | profile, since now all of matplotlib configuration is directly |
|
1233 | profile, since now all of matplotlib configuration is directly | |
1223 | handled here. This also reduces startup time. |
|
1234 | handled here. This also reduces startup time. | |
1224 |
|
1235 | |||
1225 | * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of |
|
1236 | * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of | |
1226 | shell wasn't being correctly called. Also in IPShellWX. |
|
1237 | shell wasn't being correctly called. Also in IPShellWX. | |
1227 |
|
1238 | |||
1228 | * IPython/iplib.py (InteractiveShell.__init__): Added option to |
|
1239 | * IPython/iplib.py (InteractiveShell.__init__): Added option to | |
1229 | fine-tune banner. |
|
1240 | fine-tune banner. | |
1230 |
|
1241 | |||
1231 | * IPython/numutils.py (spike): Deprecate these spike functions, |
|
1242 | * IPython/numutils.py (spike): Deprecate these spike functions, | |
1232 | delete (long deprecated) gnuplot_exec handler. |
|
1243 | delete (long deprecated) gnuplot_exec handler. | |
1233 |
|
1244 | |||
1234 | 2004-08-26 Fernando Perez <fperez@colorado.edu> |
|
1245 | 2004-08-26 Fernando Perez <fperez@colorado.edu> | |
1235 |
|
1246 | |||
1236 | * ipython.1: Update for threading options, plus some others which |
|
1247 | * ipython.1: Update for threading options, plus some others which | |
1237 | were missing. |
|
1248 | were missing. | |
1238 |
|
1249 | |||
1239 | * IPython/ipmaker.py (__call__): Added -wthread option for |
|
1250 | * IPython/ipmaker.py (__call__): Added -wthread option for | |
1240 | wxpython thread handling. Make sure threading options are only |
|
1251 | wxpython thread handling. Make sure threading options are only | |
1241 | valid at the command line. |
|
1252 | valid at the command line. | |
1242 |
|
1253 | |||
1243 | * scripts/ipython: moved shell selection into a factory function |
|
1254 | * scripts/ipython: moved shell selection into a factory function | |
1244 | in Shell.py, to keep the starter script to a minimum. |
|
1255 | in Shell.py, to keep the starter script to a minimum. | |
1245 |
|
1256 | |||
1246 | 2004-08-25 Fernando Perez <fperez@colorado.edu> |
|
1257 | 2004-08-25 Fernando Perez <fperez@colorado.edu> | |
1247 |
|
1258 | |||
1248 | * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by |
|
1259 | * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by | |
1249 | John. Along with some recent changes he made to matplotlib, the |
|
1260 | John. Along with some recent changes he made to matplotlib, the | |
1250 | next versions of both systems should work very well together. |
|
1261 | next versions of both systems should work very well together. | |
1251 |
|
1262 | |||
1252 | 2004-08-24 Fernando Perez <fperez@colorado.edu> |
|
1263 | 2004-08-24 Fernando Perez <fperez@colorado.edu> | |
1253 |
|
1264 | |||
1254 | * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I |
|
1265 | * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I | |
1255 | tried to switch the profiling to using hotshot, but I'm getting |
|
1266 | tried to switch the profiling to using hotshot, but I'm getting | |
1256 | strange errors from prof.runctx() there. I may be misreading the |
|
1267 | strange errors from prof.runctx() there. I may be misreading the | |
1257 | docs, but it looks weird. For now the profiling code will |
|
1268 | docs, but it looks weird. For now the profiling code will | |
1258 | continue to use the standard profiler. |
|
1269 | continue to use the standard profiler. | |
1259 |
|
1270 | |||
1260 | 2004-08-23 Fernando Perez <fperez@colorado.edu> |
|
1271 | 2004-08-23 Fernando Perez <fperez@colorado.edu> | |
1261 |
|
1272 | |||
1262 | * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX |
|
1273 | * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX | |
1263 | threaded shell, by John Hunter. It's not quite ready yet, but |
|
1274 | threaded shell, by John Hunter. It's not quite ready yet, but | |
1264 | close. |
|
1275 | close. | |
1265 |
|
1276 | |||
1266 | 2004-08-22 Fernando Perez <fperez@colorado.edu> |
|
1277 | 2004-08-22 Fernando Perez <fperez@colorado.edu> | |
1267 |
|
1278 | |||
1268 | * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also |
|
1279 | * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also | |
1269 | in Magic and ultraTB. |
|
1280 | in Magic and ultraTB. | |
1270 |
|
1281 | |||
1271 | * ipython.1: document threading options in manpage. |
|
1282 | * ipython.1: document threading options in manpage. | |
1272 |
|
1283 | |||
1273 | * scripts/ipython: Changed name of -thread option to -gthread, |
|
1284 | * scripts/ipython: Changed name of -thread option to -gthread, | |
1274 | since this is GTK specific. I want to leave the door open for a |
|
1285 | since this is GTK specific. I want to leave the door open for a | |
1275 | -wthread option for WX, which will most likely be necessary. This |
|
1286 | -wthread option for WX, which will most likely be necessary. This | |
1276 | change affects usage and ipmaker as well. |
|
1287 | change affects usage and ipmaker as well. | |
1277 |
|
1288 | |||
1278 | * IPython/Shell.py (matplotlib_shell): Add a factory function to |
|
1289 | * IPython/Shell.py (matplotlib_shell): Add a factory function to | |
1279 | handle the matplotlib shell issues. Code by John Hunter |
|
1290 | handle the matplotlib shell issues. Code by John Hunter | |
1280 | <jdhunter-AT-nitace.bsd.uchicago.edu>. |
|
1291 | <jdhunter-AT-nitace.bsd.uchicago.edu>. | |
1281 | (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's |
|
1292 | (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's | |
1282 | broken (and disabled for end users) for now, but it puts the |
|
1293 | broken (and disabled for end users) for now, but it puts the | |
1283 | infrastructure in place. |
|
1294 | infrastructure in place. | |
1284 |
|
1295 | |||
1285 | 2004-08-21 Fernando Perez <fperez@colorado.edu> |
|
1296 | 2004-08-21 Fernando Perez <fperez@colorado.edu> | |
1286 |
|
1297 | |||
1287 | * ipythonrc-pylab: Add matplotlib support. |
|
1298 | * ipythonrc-pylab: Add matplotlib support. | |
1288 |
|
1299 | |||
1289 | * matplotlib_config.py: new files for matplotlib support, part of |
|
1300 | * matplotlib_config.py: new files for matplotlib support, part of | |
1290 | the pylab profile. |
|
1301 | the pylab profile. | |
1291 |
|
1302 | |||
1292 | * IPython/usage.py (__doc__): documented the threading options. |
|
1303 | * IPython/usage.py (__doc__): documented the threading options. | |
1293 |
|
1304 | |||
1294 | 2004-08-20 Fernando Perez <fperez@colorado.edu> |
|
1305 | 2004-08-20 Fernando Perez <fperez@colorado.edu> | |
1295 |
|
1306 | |||
1296 | * ipython: Modified the main calling routine to handle the -thread |
|
1307 | * ipython: Modified the main calling routine to handle the -thread | |
1297 | and -mpthread options. This needs to be done as a top-level hack, |
|
1308 | and -mpthread options. This needs to be done as a top-level hack, | |
1298 | because it determines which class to instantiate for IPython |
|
1309 | because it determines which class to instantiate for IPython | |
1299 | itself. |
|
1310 | itself. | |
1300 |
|
1311 | |||
1301 | * IPython/Shell.py (MTInteractiveShell.__init__): New set of |
|
1312 | * IPython/Shell.py (MTInteractiveShell.__init__): New set of | |
1302 | classes to support multithreaded GTK operation without blocking, |
|
1313 | classes to support multithreaded GTK operation without blocking, | |
1303 | and matplotlib with all backends. This is a lot of still very |
|
1314 | and matplotlib with all backends. This is a lot of still very | |
1304 | experimental code, and threads are tricky. So it may still have a |
|
1315 | experimental code, and threads are tricky. So it may still have a | |
1305 | few rough edges... This code owes a lot to |
|
1316 | few rough edges... This code owes a lot to | |
1306 | http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by |
|
1317 | http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by | |
1307 | Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and |
|
1318 | Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and | |
1308 | to John Hunter for all the matplotlib work. |
|
1319 | to John Hunter for all the matplotlib work. | |
1309 |
|
1320 | |||
1310 | * IPython/ipmaker.py (__call__): Added -thread and -mpthread |
|
1321 | * IPython/ipmaker.py (__call__): Added -thread and -mpthread | |
1311 | options for gtk thread and matplotlib support. |
|
1322 | options for gtk thread and matplotlib support. | |
1312 |
|
1323 | |||
1313 | 2004-08-16 Fernando Perez <fperez@colorado.edu> |
|
1324 | 2004-08-16 Fernando Perez <fperez@colorado.edu> | |
1314 |
|
1325 | |||
1315 | * IPython/iplib.py (InteractiveShell.__init__): don't trigger |
|
1326 | * IPython/iplib.py (InteractiveShell.__init__): don't trigger | |
1316 | autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug |
|
1327 | autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug | |
1317 | reported by Stephen Walton <stephen.walton-AT-csun.edu>. |
|
1328 | reported by Stephen Walton <stephen.walton-AT-csun.edu>. | |
1318 |
|
1329 | |||
1319 | 2004-08-11 Fernando Perez <fperez@colorado.edu> |
|
1330 | 2004-08-11 Fernando Perez <fperez@colorado.edu> | |
1320 |
|
1331 | |||
1321 | * setup.py (isfile): Fix build so documentation gets updated for |
|
1332 | * setup.py (isfile): Fix build so documentation gets updated for | |
1322 | rpms (it was only done for .tgz builds). |
|
1333 | rpms (it was only done for .tgz builds). | |
1323 |
|
1334 | |||
1324 | 2004-08-10 Fernando Perez <fperez@colorado.edu> |
|
1335 | 2004-08-10 Fernando Perez <fperez@colorado.edu> | |
1325 |
|
1336 | |||
1326 | * genutils.py (Term): Fix misspell of stdin stream (sin->cin). |
|
1337 | * genutils.py (Term): Fix misspell of stdin stream (sin->cin). | |
1327 |
|
1338 | |||
1328 | * iplib.py : Silence syntax error exceptions in tab-completion. |
|
1339 | * iplib.py : Silence syntax error exceptions in tab-completion. | |
1329 |
|
1340 | |||
1330 | 2004-08-05 Fernando Perez <fperez@colorado.edu> |
|
1341 | 2004-08-05 Fernando Perez <fperez@colorado.edu> | |
1331 |
|
1342 | |||
1332 | * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set |
|
1343 | * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set | |
1333 | 'color off' mark for continuation prompts. This was causing long |
|
1344 | 'color off' mark for continuation prompts. This was causing long | |
1334 | continuation lines to mis-wrap. |
|
1345 | continuation lines to mis-wrap. | |
1335 |
|
1346 | |||
1336 | 2004-08-01 Fernando Perez <fperez@colorado.edu> |
|
1347 | 2004-08-01 Fernando Perez <fperez@colorado.edu> | |
1337 |
|
1348 | |||
1338 | * IPython/ipmaker.py (make_IPython): Allow the shell class used |
|
1349 | * IPython/ipmaker.py (make_IPython): Allow the shell class used | |
1339 | for building ipython to be a parameter. All this is necessary |
|
1350 | for building ipython to be a parameter. All this is necessary | |
1340 | right now to have a multithreaded version, but this insane |
|
1351 | right now to have a multithreaded version, but this insane | |
1341 | non-design will be cleaned up soon. For now, it's a hack that |
|
1352 | non-design will be cleaned up soon. For now, it's a hack that | |
1342 | works. |
|
1353 | works. | |
1343 |
|
1354 | |||
1344 | * IPython/Shell.py (IPShell.__init__): Stop using mutable default |
|
1355 | * IPython/Shell.py (IPShell.__init__): Stop using mutable default | |
1345 | args in various places. No bugs so far, but it's a dangerous |
|
1356 | args in various places. No bugs so far, but it's a dangerous | |
1346 | practice. |
|
1357 | practice. | |
1347 |
|
1358 | |||
1348 | 2004-07-31 Fernando Perez <fperez@colorado.edu> |
|
1359 | 2004-07-31 Fernando Perez <fperez@colorado.edu> | |
1349 |
|
1360 | |||
1350 | * IPython/iplib.py (complete): ignore SyntaxError exceptions to |
|
1361 | * IPython/iplib.py (complete): ignore SyntaxError exceptions to | |
1351 | fix completion of files with dots in their names under most |
|
1362 | fix completion of files with dots in their names under most | |
1352 | profiles (pysh was OK because the completion order is different). |
|
1363 | profiles (pysh was OK because the completion order is different). | |
1353 |
|
1364 | |||
1354 | 2004-07-27 Fernando Perez <fperez@colorado.edu> |
|
1365 | 2004-07-27 Fernando Perez <fperez@colorado.edu> | |
1355 |
|
1366 | |||
1356 | * IPython/iplib.py (InteractiveShell.__init__): build dict of |
|
1367 | * IPython/iplib.py (InteractiveShell.__init__): build dict of | |
1357 | keywords manually, b/c the one in keyword.py was removed in python |
|
1368 | keywords manually, b/c the one in keyword.py was removed in python | |
1358 | 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>. |
|
1369 | 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>. | |
1359 | This is NOT a bug under python 2.3 and earlier. |
|
1370 | This is NOT a bug under python 2.3 and earlier. | |
1360 |
|
1371 | |||
1361 | 2004-07-26 Fernando Perez <fperez@colorado.edu> |
|
1372 | 2004-07-26 Fernando Perez <fperez@colorado.edu> | |
1362 |
|
1373 | |||
1363 | * IPython/ultraTB.py (VerboseTB.text): Add another |
|
1374 | * IPython/ultraTB.py (VerboseTB.text): Add another | |
1364 | linecache.checkcache() call to try to prevent inspect.py from |
|
1375 | linecache.checkcache() call to try to prevent inspect.py from | |
1365 | crashing under python 2.3. I think this fixes |
|
1376 | crashing under python 2.3. I think this fixes | |
1366 | http://www.scipy.net/roundup/ipython/issue17. |
|
1377 | http://www.scipy.net/roundup/ipython/issue17. | |
1367 |
|
1378 | |||
1368 | 2004-07-26 *** Released version 0.6.2 |
|
1379 | 2004-07-26 *** Released version 0.6.2 | |
1369 |
|
1380 | |||
1370 | 2004-07-26 Fernando Perez <fperez@colorado.edu> |
|
1381 | 2004-07-26 Fernando Perez <fperez@colorado.edu> | |
1371 |
|
1382 | |||
1372 | * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would |
|
1383 | * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would | |
1373 | fail for any number. |
|
1384 | fail for any number. | |
1374 | (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for |
|
1385 | (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for | |
1375 | empty bookmarks. |
|
1386 | empty bookmarks. | |
1376 |
|
1387 | |||
1377 | 2004-07-26 *** Released version 0.6.1 |
|
1388 | 2004-07-26 *** Released version 0.6.1 | |
1378 |
|
1389 | |||
1379 | 2004-07-26 Fernando Perez <fperez@colorado.edu> |
|
1390 | 2004-07-26 Fernando Perez <fperez@colorado.edu> | |
1380 |
|
1391 | |||
1381 | * ipython_win_post_install.py (run): Added pysh shortcut for Windows. |
|
1392 | * ipython_win_post_install.py (run): Added pysh shortcut for Windows. | |
1382 |
|
1393 | |||
1383 | * IPython/iplib.py (protect_filename): Applied Ville's patch for |
|
1394 | * IPython/iplib.py (protect_filename): Applied Ville's patch for | |
1384 | escaping '()[]{}' in filenames. |
|
1395 | escaping '()[]{}' in filenames. | |
1385 |
|
1396 | |||
1386 | * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for |
|
1397 | * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for | |
1387 | Python 2.2 users who lack a proper shlex.split. |
|
1398 | Python 2.2 users who lack a proper shlex.split. | |
1388 |
|
1399 | |||
1389 | 2004-07-19 Fernando Perez <fperez@colorado.edu> |
|
1400 | 2004-07-19 Fernando Perez <fperez@colorado.edu> | |
1390 |
|
1401 | |||
1391 | * IPython/iplib.py (InteractiveShell.init_readline): Add support |
|
1402 | * IPython/iplib.py (InteractiveShell.init_readline): Add support | |
1392 | for reading readline's init file. I follow the normal chain: |
|
1403 | for reading readline's init file. I follow the normal chain: | |
1393 | $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a |
|
1404 | $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a | |
1394 | report by Mike Heeter. This closes |
|
1405 | report by Mike Heeter. This closes | |
1395 | http://www.scipy.net/roundup/ipython/issue16. |
|
1406 | http://www.scipy.net/roundup/ipython/issue16. | |
1396 |
|
1407 | |||
1397 | 2004-07-18 Fernando Perez <fperez@colorado.edu> |
|
1408 | 2004-07-18 Fernando Perez <fperez@colorado.edu> | |
1398 |
|
1409 | |||
1399 | * IPython/iplib.py (__init__): Add better handling of '\' under |
|
1410 | * IPython/iplib.py (__init__): Add better handling of '\' under | |
1400 | Win32 for filenames. After a patch by Ville. |
|
1411 | Win32 for filenames. After a patch by Ville. | |
1401 |
|
1412 | |||
1402 | 2004-07-17 Fernando Perez <fperez@colorado.edu> |
|
1413 | 2004-07-17 Fernando Perez <fperez@colorado.edu> | |
1403 |
|
1414 | |||
1404 | * IPython/iplib.py (InteractiveShell._prefilter): fix bug where |
|
1415 | * IPython/iplib.py (InteractiveShell._prefilter): fix bug where | |
1405 | autocalling would be triggered for 'foo is bar' if foo is |
|
1416 | autocalling would be triggered for 'foo is bar' if foo is | |
1406 | callable. I also cleaned up the autocall detection code to use a |
|
1417 | callable. I also cleaned up the autocall detection code to use a | |
1407 | regexp, which is faster. Bug reported by Alexander Schmolck. |
|
1418 | regexp, which is faster. Bug reported by Alexander Schmolck. | |
1408 |
|
1419 | |||
1409 | * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with |
|
1420 | * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with | |
1410 | '?' in them would confuse the help system. Reported by Alex |
|
1421 | '?' in them would confuse the help system. Reported by Alex | |
1411 | Schmolck. |
|
1422 | Schmolck. | |
1412 |
|
1423 | |||
1413 | 2004-07-16 Fernando Perez <fperez@colorado.edu> |
|
1424 | 2004-07-16 Fernando Perez <fperez@colorado.edu> | |
1414 |
|
1425 | |||
1415 | * IPython/GnuplotInteractive.py (__all__): added plot2. |
|
1426 | * IPython/GnuplotInteractive.py (__all__): added plot2. | |
1416 |
|
1427 | |||
1417 | * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for |
|
1428 | * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for | |
1418 | plotting dictionaries, lists or tuples of 1d arrays. |
|
1429 | plotting dictionaries, lists or tuples of 1d arrays. | |
1419 |
|
1430 | |||
1420 | * IPython/Magic.py (Magic.magic_hist): small clenaups and |
|
1431 | * IPython/Magic.py (Magic.magic_hist): small clenaups and | |
1421 | optimizations. |
|
1432 | optimizations. | |
1422 |
|
1433 | |||
1423 | * IPython/iplib.py:Remove old Changelog info for cleanup. This is |
|
1434 | * IPython/iplib.py:Remove old Changelog info for cleanup. This is | |
1424 | the information which was there from Janko's original IPP code: |
|
1435 | the information which was there from Janko's original IPP code: | |
1425 |
|
1436 | |||
1426 | 03.05.99 20:53 porto.ifm.uni-kiel.de |
|
1437 | 03.05.99 20:53 porto.ifm.uni-kiel.de | |
1427 | --Started changelog. |
|
1438 | --Started changelog. | |
1428 | --make clear do what it say it does |
|
1439 | --make clear do what it say it does | |
1429 | --added pretty output of lines from inputcache |
|
1440 | --added pretty output of lines from inputcache | |
1430 | --Made Logger a mixin class, simplifies handling of switches |
|
1441 | --Made Logger a mixin class, simplifies handling of switches | |
1431 | --Added own completer class. .string<TAB> expands to last history |
|
1442 | --Added own completer class. .string<TAB> expands to last history | |
1432 | line which starts with string. The new expansion is also present |
|
1443 | line which starts with string. The new expansion is also present | |
1433 | with Ctrl-r from the readline library. But this shows, who this |
|
1444 | with Ctrl-r from the readline library. But this shows, who this | |
1434 | can be done for other cases. |
|
1445 | can be done for other cases. | |
1435 | --Added convention that all shell functions should accept a |
|
1446 | --Added convention that all shell functions should accept a | |
1436 | parameter_string This opens the door for different behaviour for |
|
1447 | parameter_string This opens the door for different behaviour for | |
1437 | each function. @cd is a good example of this. |
|
1448 | each function. @cd is a good example of this. | |
1438 |
|
1449 | |||
1439 | 04.05.99 12:12 porto.ifm.uni-kiel.de |
|
1450 | 04.05.99 12:12 porto.ifm.uni-kiel.de | |
1440 | --added logfile rotation |
|
1451 | --added logfile rotation | |
1441 | --added new mainloop method which freezes first the namespace |
|
1452 | --added new mainloop method which freezes first the namespace | |
1442 |
|
1453 | |||
1443 | 07.05.99 21:24 porto.ifm.uni-kiel.de |
|
1454 | 07.05.99 21:24 porto.ifm.uni-kiel.de | |
1444 | --added the docreader classes. Now there is a help system. |
|
1455 | --added the docreader classes. Now there is a help system. | |
1445 | -This is only a first try. Currently it's not easy to put new |
|
1456 | -This is only a first try. Currently it's not easy to put new | |
1446 | stuff in the indices. But this is the way to go. Info would be |
|
1457 | stuff in the indices. But this is the way to go. Info would be | |
1447 | better, but HTML is every where and not everybody has an info |
|
1458 | better, but HTML is every where and not everybody has an info | |
1448 | system installed and it's not so easy to change html-docs to info. |
|
1459 | system installed and it's not so easy to change html-docs to info. | |
1449 | --added global logfile option |
|
1460 | --added global logfile option | |
1450 | --there is now a hook for object inspection method pinfo needs to |
|
1461 | --there is now a hook for object inspection method pinfo needs to | |
1451 | be provided for this. Can be reached by two '??'. |
|
1462 | be provided for this. Can be reached by two '??'. | |
1452 |
|
1463 | |||
1453 | 08.05.99 20:51 porto.ifm.uni-kiel.de |
|
1464 | 08.05.99 20:51 porto.ifm.uni-kiel.de | |
1454 | --added a README |
|
1465 | --added a README | |
1455 | --bug in rc file. Something has changed so functions in the rc |
|
1466 | --bug in rc file. Something has changed so functions in the rc | |
1456 | file need to reference the shell and not self. Not clear if it's a |
|
1467 | file need to reference the shell and not self. Not clear if it's a | |
1457 | bug or feature. |
|
1468 | bug or feature. | |
1458 | --changed rc file for new behavior |
|
1469 | --changed rc file for new behavior | |
1459 |
|
1470 | |||
1460 | 2004-07-15 Fernando Perez <fperez@colorado.edu> |
|
1471 | 2004-07-15 Fernando Perez <fperez@colorado.edu> | |
1461 |
|
1472 | |||
1462 | * IPython/Logger.py (Logger.log): fixed recent bug where the input |
|
1473 | * IPython/Logger.py (Logger.log): fixed recent bug where the input | |
1463 | cache was falling out of sync in bizarre manners when multi-line |
|
1474 | cache was falling out of sync in bizarre manners when multi-line | |
1464 | input was present. Minor optimizations and cleanup. |
|
1475 | input was present. Minor optimizations and cleanup. | |
1465 |
|
1476 | |||
1466 | (Logger): Remove old Changelog info for cleanup. This is the |
|
1477 | (Logger): Remove old Changelog info for cleanup. This is the | |
1467 | information which was there from Janko's original code: |
|
1478 | information which was there from Janko's original code: | |
1468 |
|
1479 | |||
1469 | Changes to Logger: - made the default log filename a parameter |
|
1480 | Changes to Logger: - made the default log filename a parameter | |
1470 |
|
1481 | |||
1471 | - put a check for lines beginning with !@? in log(). Needed |
|
1482 | - put a check for lines beginning with !@? in log(). Needed | |
1472 | (even if the handlers properly log their lines) for mid-session |
|
1483 | (even if the handlers properly log their lines) for mid-session | |
1473 | logging activation to work properly. Without this, lines logged |
|
1484 | logging activation to work properly. Without this, lines logged | |
1474 | in mid session, which get read from the cache, would end up |
|
1485 | in mid session, which get read from the cache, would end up | |
1475 | 'bare' (with !@? in the open) in the log. Now they are caught |
|
1486 | 'bare' (with !@? in the open) in the log. Now they are caught | |
1476 | and prepended with a #. |
|
1487 | and prepended with a #. | |
1477 |
|
1488 | |||
1478 | * IPython/iplib.py (InteractiveShell.init_readline): added check |
|
1489 | * IPython/iplib.py (InteractiveShell.init_readline): added check | |
1479 | in case MagicCompleter fails to be defined, so we don't crash. |
|
1490 | in case MagicCompleter fails to be defined, so we don't crash. | |
1480 |
|
1491 | |||
1481 | 2004-07-13 Fernando Perez <fperez@colorado.edu> |
|
1492 | 2004-07-13 Fernando Perez <fperez@colorado.edu> | |
1482 |
|
1493 | |||
1483 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation |
|
1494 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation | |
1484 | of EPS if the requested filename ends in '.eps'. |
|
1495 | of EPS if the requested filename ends in '.eps'. | |
1485 |
|
1496 | |||
1486 | 2004-07-04 Fernando Perez <fperez@colorado.edu> |
|
1497 | 2004-07-04 Fernando Perez <fperez@colorado.edu> | |
1487 |
|
1498 | |||
1488 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix |
|
1499 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix | |
1489 | escaping of quotes when calling the shell. |
|
1500 | escaping of quotes when calling the shell. | |
1490 |
|
1501 | |||
1491 | 2004-07-02 Fernando Perez <fperez@colorado.edu> |
|
1502 | 2004-07-02 Fernando Perez <fperez@colorado.edu> | |
1492 |
|
1503 | |||
1493 | * IPython/Prompts.py (CachedOutput.update): Fix problem with |
|
1504 | * IPython/Prompts.py (CachedOutput.update): Fix problem with | |
1494 | gettext not working because we were clobbering '_'. Fixes |
|
1505 | gettext not working because we were clobbering '_'. Fixes | |
1495 | http://www.scipy.net/roundup/ipython/issue6. |
|
1506 | http://www.scipy.net/roundup/ipython/issue6. | |
1496 |
|
1507 | |||
1497 | 2004-07-01 Fernando Perez <fperez@colorado.edu> |
|
1508 | 2004-07-01 Fernando Perez <fperez@colorado.edu> | |
1498 |
|
1509 | |||
1499 | * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling |
|
1510 | * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling | |
1500 | into @cd. Patch by Ville. |
|
1511 | into @cd. Patch by Ville. | |
1501 |
|
1512 | |||
1502 | * IPython/iplib.py (InteractiveShell.post_config_initialization): |
|
1513 | * IPython/iplib.py (InteractiveShell.post_config_initialization): | |
1503 | new function to store things after ipmaker runs. Patch by Ville. |
|
1514 | new function to store things after ipmaker runs. Patch by Ville. | |
1504 | Eventually this will go away once ipmaker is removed and the class |
|
1515 | Eventually this will go away once ipmaker is removed and the class | |
1505 | gets cleaned up, but for now it's ok. Key functionality here is |
|
1516 | gets cleaned up, but for now it's ok. Key functionality here is | |
1506 | the addition of the persistent storage mechanism, a dict for |
|
1517 | the addition of the persistent storage mechanism, a dict for | |
1507 | keeping data across sessions (for now just bookmarks, but more can |
|
1518 | keeping data across sessions (for now just bookmarks, but more can | |
1508 | be implemented later). |
|
1519 | be implemented later). | |
1509 |
|
1520 | |||
1510 | * IPython/Magic.py (Magic.magic_bookmark): New bookmark system, |
|
1521 | * IPython/Magic.py (Magic.magic_bookmark): New bookmark system, | |
1511 | persistent across sections. Patch by Ville, I modified it |
|
1522 | persistent across sections. Patch by Ville, I modified it | |
1512 | soemwhat to allow bookmarking arbitrary dirs other than CWD. Also |
|
1523 | soemwhat to allow bookmarking arbitrary dirs other than CWD. Also | |
1513 | added a '-l' option to list all bookmarks. |
|
1524 | added a '-l' option to list all bookmarks. | |
1514 |
|
1525 | |||
1515 | * IPython/iplib.py (InteractiveShell.atexit_operations): new |
|
1526 | * IPython/iplib.py (InteractiveShell.atexit_operations): new | |
1516 | center for cleanup. Registered with atexit.register(). I moved |
|
1527 | center for cleanup. Registered with atexit.register(). I moved | |
1517 | here the old exit_cleanup(). After a patch by Ville. |
|
1528 | here the old exit_cleanup(). After a patch by Ville. | |
1518 |
|
1529 | |||
1519 | * IPython/Magic.py (get_py_filename): added '~' to the accepted |
|
1530 | * IPython/Magic.py (get_py_filename): added '~' to the accepted | |
1520 | characters in the hacked shlex_split for python 2.2. |
|
1531 | characters in the hacked shlex_split for python 2.2. | |
1521 |
|
1532 | |||
1522 | * IPython/iplib.py (file_matches): more fixes to filenames with |
|
1533 | * IPython/iplib.py (file_matches): more fixes to filenames with | |
1523 | whitespace in them. It's not perfect, but limitations in python's |
|
1534 | whitespace in them. It's not perfect, but limitations in python's | |
1524 | readline make it impossible to go further. |
|
1535 | readline make it impossible to go further. | |
1525 |
|
1536 | |||
1526 | 2004-06-29 Fernando Perez <fperez@colorado.edu> |
|
1537 | 2004-06-29 Fernando Perez <fperez@colorado.edu> | |
1527 |
|
1538 | |||
1528 | * IPython/iplib.py (file_matches): escape whitespace correctly in |
|
1539 | * IPython/iplib.py (file_matches): escape whitespace correctly in | |
1529 | filename completions. Bug reported by Ville. |
|
1540 | filename completions. Bug reported by Ville. | |
1530 |
|
1541 | |||
1531 | 2004-06-28 Fernando Perez <fperez@colorado.edu> |
|
1542 | 2004-06-28 Fernando Perez <fperez@colorado.edu> | |
1532 |
|
1543 | |||
1533 | * IPython/ipmaker.py (__call__): Added per-profile histories. Now |
|
1544 | * IPython/ipmaker.py (__call__): Added per-profile histories. Now | |
1534 | the history file will be called 'history-PROFNAME' (or just |
|
1545 | the history file will be called 'history-PROFNAME' (or just | |
1535 | 'history' if no profile is loaded). I was getting annoyed at |
|
1546 | 'history' if no profile is loaded). I was getting annoyed at | |
1536 | getting my Numerical work history clobbered by pysh sessions. |
|
1547 | getting my Numerical work history clobbered by pysh sessions. | |
1537 |
|
1548 | |||
1538 | * IPython/iplib.py (InteractiveShell.__init__): Internal |
|
1549 | * IPython/iplib.py (InteractiveShell.__init__): Internal | |
1539 | getoutputerror() function so that we can honor the system_verbose |
|
1550 | getoutputerror() function so that we can honor the system_verbose | |
1540 | flag for _all_ system calls. I also added escaping of # |
|
1551 | flag for _all_ system calls. I also added escaping of # | |
1541 | characters here to avoid confusing Itpl. |
|
1552 | characters here to avoid confusing Itpl. | |
1542 |
|
1553 | |||
1543 | * IPython/Magic.py (shlex_split): removed call to shell in |
|
1554 | * IPython/Magic.py (shlex_split): removed call to shell in | |
1544 | parse_options and replaced it with shlex.split(). The annoying |
|
1555 | parse_options and replaced it with shlex.split(). The annoying | |
1545 | part was that in Python 2.2, shlex.split() doesn't exist, so I had |
|
1556 | part was that in Python 2.2, shlex.split() doesn't exist, so I had | |
1546 | to backport it from 2.3, with several frail hacks (the shlex |
|
1557 | to backport it from 2.3, with several frail hacks (the shlex | |
1547 | module is rather limited in 2.2). Thanks to a suggestion by Ville |
|
1558 | module is rather limited in 2.2). Thanks to a suggestion by Ville | |
1548 | Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no |
|
1559 | Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no | |
1549 | problem. |
|
1560 | problem. | |
1550 |
|
1561 | |||
1551 | (Magic.magic_system_verbose): new toggle to print the actual |
|
1562 | (Magic.magic_system_verbose): new toggle to print the actual | |
1552 | system calls made by ipython. Mainly for debugging purposes. |
|
1563 | system calls made by ipython. Mainly for debugging purposes. | |
1553 |
|
1564 | |||
1554 | * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which |
|
1565 | * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which | |
1555 | doesn't support persistence. Reported (and fix suggested) by |
|
1566 | doesn't support persistence. Reported (and fix suggested) by | |
1556 | Travis Caldwell <travis_caldwell2000@yahoo.com>. |
|
1567 | Travis Caldwell <travis_caldwell2000@yahoo.com>. | |
1557 |
|
1568 | |||
1558 | 2004-06-26 Fernando Perez <fperez@colorado.edu> |
|
1569 | 2004-06-26 Fernando Perez <fperez@colorado.edu> | |
1559 |
|
1570 | |||
1560 | * IPython/Logger.py (Logger.log): fix to handle correctly empty |
|
1571 | * IPython/Logger.py (Logger.log): fix to handle correctly empty | |
1561 | continue prompts. |
|
1572 | continue prompts. | |
1562 |
|
1573 | |||
1563 | * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh() |
|
1574 | * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh() | |
1564 | function (basically a big docstring) and a few more things here to |
|
1575 | function (basically a big docstring) and a few more things here to | |
1565 | speedup startup. pysh.py is now very lightweight. We want because |
|
1576 | speedup startup. pysh.py is now very lightweight. We want because | |
1566 | it gets execfile'd, while InterpreterExec gets imported, so |
|
1577 | it gets execfile'd, while InterpreterExec gets imported, so | |
1567 | byte-compilation saves time. |
|
1578 | byte-compilation saves time. | |
1568 |
|
1579 | |||
1569 | 2004-06-25 Fernando Perez <fperez@colorado.edu> |
|
1580 | 2004-06-25 Fernando Perez <fperez@colorado.edu> | |
1570 |
|
1581 | |||
1571 | * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd |
|
1582 | * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd | |
1572 | -NUM', which was recently broken. |
|
1583 | -NUM', which was recently broken. | |
1573 |
|
1584 | |||
1574 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow ! |
|
1585 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow ! | |
1575 | in multi-line input (but not !!, which doesn't make sense there). |
|
1586 | in multi-line input (but not !!, which doesn't make sense there). | |
1576 |
|
1587 | |||
1577 | * IPython/UserConfig/ipythonrc: made autoindent on by default. |
|
1588 | * IPython/UserConfig/ipythonrc: made autoindent on by default. | |
1578 | It's just too useful, and people can turn it off in the less |
|
1589 | It's just too useful, and people can turn it off in the less | |
1579 | common cases where it's a problem. |
|
1590 | common cases where it's a problem. | |
1580 |
|
1591 | |||
1581 | 2004-06-24 Fernando Perez <fperez@colorado.edu> |
|
1592 | 2004-06-24 Fernando Perez <fperez@colorado.edu> | |
1582 |
|
1593 | |||
1583 | * IPython/iplib.py (InteractiveShell._prefilter): big change - |
|
1594 | * IPython/iplib.py (InteractiveShell._prefilter): big change - | |
1584 | special syntaxes (like alias calling) is now allied in multi-line |
|
1595 | special syntaxes (like alias calling) is now allied in multi-line | |
1585 | input. This is still _very_ experimental, but it's necessary for |
|
1596 | input. This is still _very_ experimental, but it's necessary for | |
1586 | efficient shell usage combining python looping syntax with system |
|
1597 | efficient shell usage combining python looping syntax with system | |
1587 | calls. For now it's restricted to aliases, I don't think it |
|
1598 | calls. For now it's restricted to aliases, I don't think it | |
1588 | really even makes sense to have this for magics. |
|
1599 | really even makes sense to have this for magics. | |
1589 |
|
1600 | |||
1590 | 2004-06-23 Fernando Perez <fperez@colorado.edu> |
|
1601 | 2004-06-23 Fernando Perez <fperez@colorado.edu> | |
1591 |
|
1602 | |||
1592 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added |
|
1603 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added | |
1593 | $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd. |
|
1604 | $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd. | |
1594 |
|
1605 | |||
1595 | * IPython/Magic.py (Magic.magic_rehashx): modified to handle |
|
1606 | * IPython/Magic.py (Magic.magic_rehashx): modified to handle | |
1596 | extensions under Windows (after code sent by Gary Bishop). The |
|
1607 | extensions under Windows (after code sent by Gary Bishop). The | |
1597 | extensions considered 'executable' are stored in IPython's rc |
|
1608 | extensions considered 'executable' are stored in IPython's rc | |
1598 | structure as win_exec_ext. |
|
1609 | structure as win_exec_ext. | |
1599 |
|
1610 | |||
1600 | * IPython/genutils.py (shell): new function, like system() but |
|
1611 | * IPython/genutils.py (shell): new function, like system() but | |
1601 | without return value. Very useful for interactive shell work. |
|
1612 | without return value. Very useful for interactive shell work. | |
1602 |
|
1613 | |||
1603 | * IPython/Magic.py (Magic.magic_unalias): New @unalias function to |
|
1614 | * IPython/Magic.py (Magic.magic_unalias): New @unalias function to | |
1604 | delete aliases. |
|
1615 | delete aliases. | |
1605 |
|
1616 | |||
1606 | * IPython/iplib.py (InteractiveShell.alias_table_update): make |
|
1617 | * IPython/iplib.py (InteractiveShell.alias_table_update): make | |
1607 | sure that the alias table doesn't contain python keywords. |
|
1618 | sure that the alias table doesn't contain python keywords. | |
1608 |
|
1619 | |||
1609 | 2004-06-21 Fernando Perez <fperez@colorado.edu> |
|
1620 | 2004-06-21 Fernando Perez <fperez@colorado.edu> | |
1610 |
|
1621 | |||
1611 | * IPython/Magic.py (Magic.magic_rehash): Fix crash when |
|
1622 | * IPython/Magic.py (Magic.magic_rehash): Fix crash when | |
1612 | non-existent items are found in $PATH. Reported by Thorsten. |
|
1623 | non-existent items are found in $PATH. Reported by Thorsten. | |
1613 |
|
1624 | |||
1614 | 2004-06-20 Fernando Perez <fperez@colorado.edu> |
|
1625 | 2004-06-20 Fernando Perez <fperez@colorado.edu> | |
1615 |
|
1626 | |||
1616 | * IPython/iplib.py (complete): modified the completer so that the |
|
1627 | * IPython/iplib.py (complete): modified the completer so that the | |
1617 | order of priorities can be easily changed at runtime. |
|
1628 | order of priorities can be easily changed at runtime. | |
1618 |
|
1629 | |||
1619 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): |
|
1630 | * IPython/Extensions/InterpreterExec.py (prefilter_shell): | |
1620 | Modified to auto-execute all lines beginning with '~', '/' or '.'. |
|
1631 | Modified to auto-execute all lines beginning with '~', '/' or '.'. | |
1621 |
|
1632 | |||
1622 | * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to |
|
1633 | * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to | |
1623 | expand Python variables prepended with $ in all system calls. The |
|
1634 | expand Python variables prepended with $ in all system calls. The | |
1624 | same was done to InteractiveShell.handle_shell_escape. Now all |
|
1635 | same was done to InteractiveShell.handle_shell_escape. Now all | |
1625 | system access mechanisms (!, !!, @sc, @sx and aliases) allow the |
|
1636 | system access mechanisms (!, !!, @sc, @sx and aliases) allow the | |
1626 | expansion of python variables and expressions according to the |
|
1637 | expansion of python variables and expressions according to the | |
1627 | syntax of PEP-215 - http://www.python.org/peps/pep-0215.html. |
|
1638 | syntax of PEP-215 - http://www.python.org/peps/pep-0215.html. | |
1628 |
|
1639 | |||
1629 | Though PEP-215 has been rejected, a similar (but simpler) one |
|
1640 | Though PEP-215 has been rejected, a similar (but simpler) one | |
1630 | seems like it will go into Python 2.4, PEP-292 - |
|
1641 | seems like it will go into Python 2.4, PEP-292 - | |
1631 | http://www.python.org/peps/pep-0292.html. |
|
1642 | http://www.python.org/peps/pep-0292.html. | |
1632 |
|
1643 | |||
1633 | I'll keep the full syntax of PEP-215, since IPython has since the |
|
1644 | I'll keep the full syntax of PEP-215, since IPython has since the | |
1634 | start used Ka-Ping Yee's reference implementation discussed there |
|
1645 | start used Ka-Ping Yee's reference implementation discussed there | |
1635 | (Itpl), and I actually like the powerful semantics it offers. |
|
1646 | (Itpl), and I actually like the powerful semantics it offers. | |
1636 |
|
1647 | |||
1637 | In order to access normal shell variables, the $ has to be escaped |
|
1648 | In order to access normal shell variables, the $ has to be escaped | |
1638 | via an extra $. For example: |
|
1649 | via an extra $. For example: | |
1639 |
|
1650 | |||
1640 | In [7]: PATH='a python variable' |
|
1651 | In [7]: PATH='a python variable' | |
1641 |
|
1652 | |||
1642 | In [8]: !echo $PATH |
|
1653 | In [8]: !echo $PATH | |
1643 | a python variable |
|
1654 | a python variable | |
1644 |
|
1655 | |||
1645 | In [9]: !echo $$PATH |
|
1656 | In [9]: !echo $$PATH | |
1646 | /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:... |
|
1657 | /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:... | |
1647 |
|
1658 | |||
1648 | (Magic.parse_options): escape $ so the shell doesn't evaluate |
|
1659 | (Magic.parse_options): escape $ so the shell doesn't evaluate | |
1649 | things prematurely. |
|
1660 | things prematurely. | |
1650 |
|
1661 | |||
1651 | * IPython/iplib.py (InteractiveShell.call_alias): added the |
|
1662 | * IPython/iplib.py (InteractiveShell.call_alias): added the | |
1652 | ability for aliases to expand python variables via $. |
|
1663 | ability for aliases to expand python variables via $. | |
1653 |
|
1664 | |||
1654 | * IPython/Magic.py (Magic.magic_rehash): based on the new alias |
|
1665 | * IPython/Magic.py (Magic.magic_rehash): based on the new alias | |
1655 | system, now there's a @rehash/@rehashx pair of magics. These work |
|
1666 | system, now there's a @rehash/@rehashx pair of magics. These work | |
1656 | like the csh rehash command, and can be invoked at any time. They |
|
1667 | like the csh rehash command, and can be invoked at any time. They | |
1657 | build a table of aliases to everything in the user's $PATH |
|
1668 | build a table of aliases to everything in the user's $PATH | |
1658 | (@rehash uses everything, @rehashx is slower but only adds |
|
1669 | (@rehash uses everything, @rehashx is slower but only adds | |
1659 | executable files). With this, the pysh.py-based shell profile can |
|
1670 | executable files). With this, the pysh.py-based shell profile can | |
1660 | now simply call rehash upon startup, and full access to all |
|
1671 | now simply call rehash upon startup, and full access to all | |
1661 | programs in the user's path is obtained. |
|
1672 | programs in the user's path is obtained. | |
1662 |
|
1673 | |||
1663 | * IPython/iplib.py (InteractiveShell.call_alias): The new alias |
|
1674 | * IPython/iplib.py (InteractiveShell.call_alias): The new alias | |
1664 | functionality is now fully in place. I removed the old dynamic |
|
1675 | functionality is now fully in place. I removed the old dynamic | |
1665 | code generation based approach, in favor of a much lighter one |
|
1676 | code generation based approach, in favor of a much lighter one | |
1666 | based on a simple dict. The advantage is that this allows me to |
|
1677 | based on a simple dict. The advantage is that this allows me to | |
1667 | now have thousands of aliases with negligible cost (unthinkable |
|
1678 | now have thousands of aliases with negligible cost (unthinkable | |
1668 | with the old system). |
|
1679 | with the old system). | |
1669 |
|
1680 | |||
1670 | 2004-06-19 Fernando Perez <fperez@colorado.edu> |
|
1681 | 2004-06-19 Fernando Perez <fperez@colorado.edu> | |
1671 |
|
1682 | |||
1672 | * IPython/iplib.py (__init__): extended MagicCompleter class to |
|
1683 | * IPython/iplib.py (__init__): extended MagicCompleter class to | |
1673 | also complete (last in priority) on user aliases. |
|
1684 | also complete (last in priority) on user aliases. | |
1674 |
|
1685 | |||
1675 | * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in |
|
1686 | * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in | |
1676 | call to eval. |
|
1687 | call to eval. | |
1677 | (ItplNS.__init__): Added a new class which functions like Itpl, |
|
1688 | (ItplNS.__init__): Added a new class which functions like Itpl, | |
1678 | but allows configuring the namespace for the evaluation to occur |
|
1689 | but allows configuring the namespace for the evaluation to occur | |
1679 | in. |
|
1690 | in. | |
1680 |
|
1691 | |||
1681 | 2004-06-18 Fernando Perez <fperez@colorado.edu> |
|
1692 | 2004-06-18 Fernando Perez <fperez@colorado.edu> | |
1682 |
|
1693 | |||
1683 | * IPython/iplib.py (InteractiveShell.runcode): modify to print a |
|
1694 | * IPython/iplib.py (InteractiveShell.runcode): modify to print a | |
1684 | better message when 'exit' or 'quit' are typed (a common newbie |
|
1695 | better message when 'exit' or 'quit' are typed (a common newbie | |
1685 | confusion). |
|
1696 | confusion). | |
1686 |
|
1697 | |||
1687 | * IPython/Magic.py (Magic.magic_colors): Added the runtime color |
|
1698 | * IPython/Magic.py (Magic.magic_colors): Added the runtime color | |
1688 | check for Windows users. |
|
1699 | check for Windows users. | |
1689 |
|
1700 | |||
1690 | * IPython/iplib.py (InteractiveShell.user_setup): removed |
|
1701 | * IPython/iplib.py (InteractiveShell.user_setup): removed | |
1691 | disabling of colors for Windows. I'll test at runtime and issue a |
|
1702 | disabling of colors for Windows. I'll test at runtime and issue a | |
1692 | warning if Gary's readline isn't found, as to nudge users to |
|
1703 | warning if Gary's readline isn't found, as to nudge users to | |
1693 | download it. |
|
1704 | download it. | |
1694 |
|
1705 | |||
1695 | 2004-06-16 Fernando Perez <fperez@colorado.edu> |
|
1706 | 2004-06-16 Fernando Perez <fperez@colorado.edu> | |
1696 |
|
1707 | |||
1697 | * IPython/genutils.py (Stream.__init__): changed to print errors |
|
1708 | * IPython/genutils.py (Stream.__init__): changed to print errors | |
1698 | to sys.stderr. I had a circular dependency here. Now it's |
|
1709 | to sys.stderr. I had a circular dependency here. Now it's | |
1699 | possible to run ipython as IDLE's shell (consider this pre-alpha, |
|
1710 | possible to run ipython as IDLE's shell (consider this pre-alpha, | |
1700 | since true stdout things end up in the starting terminal instead |
|
1711 | since true stdout things end up in the starting terminal instead | |
1701 | of IDLE's out). |
|
1712 | of IDLE's out). | |
1702 |
|
1713 | |||
1703 | * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for |
|
1714 | * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for | |
1704 | users who haven't # updated their prompt_in2 definitions. Remove |
|
1715 | users who haven't # updated their prompt_in2 definitions. Remove | |
1705 | eventually. |
|
1716 | eventually. | |
1706 | (multiple_replace): added credit to original ASPN recipe. |
|
1717 | (multiple_replace): added credit to original ASPN recipe. | |
1707 |
|
1718 | |||
1708 | 2004-06-15 Fernando Perez <fperez@colorado.edu> |
|
1719 | 2004-06-15 Fernando Perez <fperez@colorado.edu> | |
1709 |
|
1720 | |||
1710 | * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the |
|
1721 | * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the | |
1711 | list of auto-defined aliases. |
|
1722 | list of auto-defined aliases. | |
1712 |
|
1723 | |||
1713 | 2004-06-13 Fernando Perez <fperez@colorado.edu> |
|
1724 | 2004-06-13 Fernando Perez <fperez@colorado.edu> | |
1714 |
|
1725 | |||
1715 | * setup.py (scriptfiles): Don't trigger win_post_install unless an |
|
1726 | * setup.py (scriptfiles): Don't trigger win_post_install unless an | |
1716 | install was really requested (so setup.py can be used for other |
|
1727 | install was really requested (so setup.py can be used for other | |
1717 | things under Windows). |
|
1728 | things under Windows). | |
1718 |
|
1729 | |||
1719 | 2004-06-10 Fernando Perez <fperez@colorado.edu> |
|
1730 | 2004-06-10 Fernando Perez <fperez@colorado.edu> | |
1720 |
|
1731 | |||
1721 | * IPython/Logger.py (Logger.create_log): Manually remove any old |
|
1732 | * IPython/Logger.py (Logger.create_log): Manually remove any old | |
1722 | backup, since os.remove may fail under Windows. Fixes bug |
|
1733 | backup, since os.remove may fail under Windows. Fixes bug | |
1723 | reported by Thorsten. |
|
1734 | reported by Thorsten. | |
1724 |
|
1735 | |||
1725 | 2004-06-09 Fernando Perez <fperez@colorado.edu> |
|
1736 | 2004-06-09 Fernando Perez <fperez@colorado.edu> | |
1726 |
|
1737 | |||
1727 | * examples/example-embed.py: fixed all references to %n (replaced |
|
1738 | * examples/example-embed.py: fixed all references to %n (replaced | |
1728 | with \\# for ps1/out prompts and with \\D for ps2 prompts). Done |
|
1739 | with \\# for ps1/out prompts and with \\D for ps2 prompts). Done | |
1729 | for all examples and the manual as well. |
|
1740 | for all examples and the manual as well. | |
1730 |
|
1741 | |||
1731 | 2004-06-08 Fernando Perez <fperez@colorado.edu> |
|
1742 | 2004-06-08 Fernando Perez <fperez@colorado.edu> | |
1732 |
|
1743 | |||
1733 | * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt |
|
1744 | * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt | |
1734 | alignment and color management. All 3 prompt subsystems now |
|
1745 | alignment and color management. All 3 prompt subsystems now | |
1735 | inherit from BasePrompt. |
|
1746 | inherit from BasePrompt. | |
1736 |
|
1747 | |||
1737 | * tools/release: updates for windows installer build and tag rpms |
|
1748 | * tools/release: updates for windows installer build and tag rpms | |
1738 | with python version (since paths are fixed). |
|
1749 | with python version (since paths are fixed). | |
1739 |
|
1750 | |||
1740 | * IPython/UserConfig/ipythonrc: modified to use \# instead of %n, |
|
1751 | * IPython/UserConfig/ipythonrc: modified to use \# instead of %n, | |
1741 | which will become eventually obsolete. Also fixed the default |
|
1752 | which will become eventually obsolete. Also fixed the default | |
1742 | prompt_in2 to use \D, so at least new users start with the correct |
|
1753 | prompt_in2 to use \D, so at least new users start with the correct | |
1743 | defaults. |
|
1754 | defaults. | |
1744 | WARNING: Users with existing ipythonrc files will need to apply |
|
1755 | WARNING: Users with existing ipythonrc files will need to apply | |
1745 | this fix manually! |
|
1756 | this fix manually! | |
1746 |
|
1757 | |||
1747 | * setup.py: make windows installer (.exe). This is finally the |
|
1758 | * setup.py: make windows installer (.exe). This is finally the | |
1748 | integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>, |
|
1759 | integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>, | |
1749 | which I hadn't included because it required Python 2.3 (or recent |
|
1760 | which I hadn't included because it required Python 2.3 (or recent | |
1750 | distutils). |
|
1761 | distutils). | |
1751 |
|
1762 | |||
1752 | * IPython/usage.py (__doc__): update docs (and manpage) to reflect |
|
1763 | * IPython/usage.py (__doc__): update docs (and manpage) to reflect | |
1753 | usage of new '\D' escape. |
|
1764 | usage of new '\D' escape. | |
1754 |
|
1765 | |||
1755 | * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which |
|
1766 | * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which | |
1756 | lacks os.getuid()) |
|
1767 | lacks os.getuid()) | |
1757 | (CachedOutput.set_colors): Added the ability to turn coloring |
|
1768 | (CachedOutput.set_colors): Added the ability to turn coloring | |
1758 | on/off with @colors even for manually defined prompt colors. It |
|
1769 | on/off with @colors even for manually defined prompt colors. It | |
1759 | uses a nasty global, but it works safely and via the generic color |
|
1770 | uses a nasty global, but it works safely and via the generic color | |
1760 | handling mechanism. |
|
1771 | handling mechanism. | |
1761 | (Prompt2.__init__): Introduced new escape '\D' for continuation |
|
1772 | (Prompt2.__init__): Introduced new escape '\D' for continuation | |
1762 | prompts. It represents the counter ('\#') as dots. |
|
1773 | prompts. It represents the counter ('\#') as dots. | |
1763 | *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will |
|
1774 | *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will | |
1764 | need to update their ipythonrc files and replace '%n' with '\D' in |
|
1775 | need to update their ipythonrc files and replace '%n' with '\D' in | |
1765 | their prompt_in2 settings everywhere. Sorry, but there's |
|
1776 | their prompt_in2 settings everywhere. Sorry, but there's | |
1766 | otherwise no clean way to get all prompts to properly align. The |
|
1777 | otherwise no clean way to get all prompts to properly align. The | |
1767 | ipythonrc shipped with IPython has been updated. |
|
1778 | ipythonrc shipped with IPython has been updated. | |
1768 |
|
1779 | |||
1769 | 2004-06-07 Fernando Perez <fperez@colorado.edu> |
|
1780 | 2004-06-07 Fernando Perez <fperez@colorado.edu> | |
1770 |
|
1781 | |||
1771 | * setup.py (isfile): Pass local_icons option to latex2html, so the |
|
1782 | * setup.py (isfile): Pass local_icons option to latex2html, so the | |
1772 | resulting HTML file is self-contained. Thanks to |
|
1783 | resulting HTML file is self-contained. Thanks to | |
1773 | dryice-AT-liu.com.cn for the tip. |
|
1784 | dryice-AT-liu.com.cn for the tip. | |
1774 |
|
1785 | |||
1775 | * pysh.py: I created a new profile 'shell', which implements a |
|
1786 | * pysh.py: I created a new profile 'shell', which implements a | |
1776 | _rudimentary_ IPython-based shell. This is in NO WAY a realy |
|
1787 | _rudimentary_ IPython-based shell. This is in NO WAY a realy | |
1777 | system shell, nor will it become one anytime soon. It's mainly |
|
1788 | system shell, nor will it become one anytime soon. It's mainly | |
1778 | meant to illustrate the use of the new flexible bash-like prompts. |
|
1789 | meant to illustrate the use of the new flexible bash-like prompts. | |
1779 | I guess it could be used by hardy souls for true shell management, |
|
1790 | I guess it could be used by hardy souls for true shell management, | |
1780 | but it's no tcsh/bash... pysh.py is loaded by the 'shell' |
|
1791 | but it's no tcsh/bash... pysh.py is loaded by the 'shell' | |
1781 | profile. This uses the InterpreterExec extension provided by |
|
1792 | profile. This uses the InterpreterExec extension provided by | |
1782 | W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl> |
|
1793 | W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl> | |
1783 |
|
1794 | |||
1784 | * IPython/Prompts.py (PromptOut.__str__): now it will correctly |
|
1795 | * IPython/Prompts.py (PromptOut.__str__): now it will correctly | |
1785 | auto-align itself with the length of the previous input prompt |
|
1796 | auto-align itself with the length of the previous input prompt | |
1786 | (taking into account the invisible color escapes). |
|
1797 | (taking into account the invisible color escapes). | |
1787 | (CachedOutput.__init__): Large restructuring of this class. Now |
|
1798 | (CachedOutput.__init__): Large restructuring of this class. Now | |
1788 | all three prompts (primary1, primary2, output) are proper objects, |
|
1799 | all three prompts (primary1, primary2, output) are proper objects, | |
1789 | managed by the 'parent' CachedOutput class. The code is still a |
|
1800 | managed by the 'parent' CachedOutput class. The code is still a | |
1790 | bit hackish (all prompts share state via a pointer to the cache), |
|
1801 | bit hackish (all prompts share state via a pointer to the cache), | |
1791 | but it's overall far cleaner than before. |
|
1802 | but it's overall far cleaner than before. | |
1792 |
|
1803 | |||
1793 | * IPython/genutils.py (getoutputerror): modified to add verbose, |
|
1804 | * IPython/genutils.py (getoutputerror): modified to add verbose, | |
1794 | debug and header options. This makes the interface of all getout* |
|
1805 | debug and header options. This makes the interface of all getout* | |
1795 | functions uniform. |
|
1806 | functions uniform. | |
1796 | (SystemExec.getoutputerror): added getoutputerror to SystemExec. |
|
1807 | (SystemExec.getoutputerror): added getoutputerror to SystemExec. | |
1797 |
|
1808 | |||
1798 | * IPython/Magic.py (Magic.default_option): added a function to |
|
1809 | * IPython/Magic.py (Magic.default_option): added a function to | |
1799 | allow registering default options for any magic command. This |
|
1810 | allow registering default options for any magic command. This | |
1800 | makes it easy to have profiles which customize the magics globally |
|
1811 | makes it easy to have profiles which customize the magics globally | |
1801 | for a certain use. The values set through this function are |
|
1812 | for a certain use. The values set through this function are | |
1802 | picked up by the parse_options() method, which all magics should |
|
1813 | picked up by the parse_options() method, which all magics should | |
1803 | use to parse their options. |
|
1814 | use to parse their options. | |
1804 |
|
1815 | |||
1805 | * IPython/genutils.py (warn): modified the warnings framework to |
|
1816 | * IPython/genutils.py (warn): modified the warnings framework to | |
1806 | use the Term I/O class. I'm trying to slowly unify all of |
|
1817 | use the Term I/O class. I'm trying to slowly unify all of | |
1807 | IPython's I/O operations to pass through Term. |
|
1818 | IPython's I/O operations to pass through Term. | |
1808 |
|
1819 | |||
1809 | * IPython/Prompts.py (Prompt2._str_other): Added functionality in |
|
1820 | * IPython/Prompts.py (Prompt2._str_other): Added functionality in | |
1810 | the secondary prompt to correctly match the length of the primary |
|
1821 | the secondary prompt to correctly match the length of the primary | |
1811 | one for any prompt. Now multi-line code will properly line up |
|
1822 | one for any prompt. Now multi-line code will properly line up | |
1812 | even for path dependent prompts, such as the new ones available |
|
1823 | even for path dependent prompts, such as the new ones available | |
1813 | via the prompt_specials. |
|
1824 | via the prompt_specials. | |
1814 |
|
1825 | |||
1815 | 2004-06-06 Fernando Perez <fperez@colorado.edu> |
|
1826 | 2004-06-06 Fernando Perez <fperez@colorado.edu> | |
1816 |
|
1827 | |||
1817 | * IPython/Prompts.py (prompt_specials): Added the ability to have |
|
1828 | * IPython/Prompts.py (prompt_specials): Added the ability to have | |
1818 | bash-like special sequences in the prompts, which get |
|
1829 | bash-like special sequences in the prompts, which get | |
1819 | automatically expanded. Things like hostname, current working |
|
1830 | automatically expanded. Things like hostname, current working | |
1820 | directory and username are implemented already, but it's easy to |
|
1831 | directory and username are implemented already, but it's easy to | |
1821 | add more in the future. Thanks to a patch by W.J. van der Laan |
|
1832 | add more in the future. Thanks to a patch by W.J. van der Laan | |
1822 | <gnufnork-AT-hetdigitalegat.nl> |
|
1833 | <gnufnork-AT-hetdigitalegat.nl> | |
1823 | (prompt_specials): Added color support for prompt strings, so |
|
1834 | (prompt_specials): Added color support for prompt strings, so | |
1824 | users can define arbitrary color setups for their prompts. |
|
1835 | users can define arbitrary color setups for their prompts. | |
1825 |
|
1836 | |||
1826 | 2004-06-05 Fernando Perez <fperez@colorado.edu> |
|
1837 | 2004-06-05 Fernando Perez <fperez@colorado.edu> | |
1827 |
|
1838 | |||
1828 | * IPython/genutils.py (Term.reopen_all): Added Windows-specific |
|
1839 | * IPython/genutils.py (Term.reopen_all): Added Windows-specific | |
1829 | code to load Gary Bishop's readline and configure it |
|
1840 | code to load Gary Bishop's readline and configure it | |
1830 | automatically. Thanks to Gary for help on this. |
|
1841 | automatically. Thanks to Gary for help on this. | |
1831 |
|
1842 | |||
1832 | 2004-06-01 Fernando Perez <fperez@colorado.edu> |
|
1843 | 2004-06-01 Fernando Perez <fperez@colorado.edu> | |
1833 |
|
1844 | |||
1834 | * IPython/Logger.py (Logger.create_log): fix bug for logging |
|
1845 | * IPython/Logger.py (Logger.create_log): fix bug for logging | |
1835 | with no filename (previous fix was incomplete). |
|
1846 | with no filename (previous fix was incomplete). | |
1836 |
|
1847 | |||
1837 | 2004-05-25 Fernando Perez <fperez@colorado.edu> |
|
1848 | 2004-05-25 Fernando Perez <fperez@colorado.edu> | |
1838 |
|
1849 | |||
1839 | * IPython/Magic.py (Magic.parse_options): fix bug where naked |
|
1850 | * IPython/Magic.py (Magic.parse_options): fix bug where naked | |
1840 | parens would get passed to the shell. |
|
1851 | parens would get passed to the shell. | |
1841 |
|
1852 | |||
1842 | 2004-05-20 Fernando Perez <fperez@colorado.edu> |
|
1853 | 2004-05-20 Fernando Perez <fperez@colorado.edu> | |
1843 |
|
1854 | |||
1844 | * IPython/Magic.py (Magic.magic_prun): changed default profile |
|
1855 | * IPython/Magic.py (Magic.magic_prun): changed default profile | |
1845 | sort order to 'time' (the more common profiling need). |
|
1856 | sort order to 'time' (the more common profiling need). | |
1846 |
|
1857 | |||
1847 | * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache |
|
1858 | * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache | |
1848 | so that source code shown is guaranteed in sync with the file on |
|
1859 | so that source code shown is guaranteed in sync with the file on | |
1849 | disk (also changed in psource). Similar fix to the one for |
|
1860 | disk (also changed in psource). Similar fix to the one for | |
1850 | ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du |
|
1861 | ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du | |
1851 | <yann.ledu-AT-noos.fr>. |
|
1862 | <yann.ledu-AT-noos.fr>. | |
1852 |
|
1863 | |||
1853 | * IPython/Magic.py (Magic.parse_options): Fixed bug where commands |
|
1864 | * IPython/Magic.py (Magic.parse_options): Fixed bug where commands | |
1854 | with a single option would not be correctly parsed. Closes |
|
1865 | with a single option would not be correctly parsed. Closes | |
1855 | http://www.scipy.net/roundup/ipython/issue14. This bug had been |
|
1866 | http://www.scipy.net/roundup/ipython/issue14. This bug had been | |
1856 | introduced in 0.6.0 (on 2004-05-06). |
|
1867 | introduced in 0.6.0 (on 2004-05-06). | |
1857 |
|
1868 | |||
1858 | 2004-05-13 *** Released version 0.6.0 |
|
1869 | 2004-05-13 *** Released version 0.6.0 | |
1859 |
|
1870 | |||
1860 | 2004-05-13 Fernando Perez <fperez@colorado.edu> |
|
1871 | 2004-05-13 Fernando Perez <fperez@colorado.edu> | |
1861 |
|
1872 | |||
1862 | * debian/: Added debian/ directory to CVS, so that debian support |
|
1873 | * debian/: Added debian/ directory to CVS, so that debian support | |
1863 | is publicly accessible. The debian package is maintained by Jack |
|
1874 | is publicly accessible. The debian package is maintained by Jack | |
1864 | Moffit <jack-AT-xiph.org>. |
|
1875 | Moffit <jack-AT-xiph.org>. | |
1865 |
|
1876 | |||
1866 | * Documentation: included the notes about an ipython-based system |
|
1877 | * Documentation: included the notes about an ipython-based system | |
1867 | shell (the hypothetical 'pysh') into the new_design.pdf document, |
|
1878 | shell (the hypothetical 'pysh') into the new_design.pdf document, | |
1868 | so that these ideas get distributed to users along with the |
|
1879 | so that these ideas get distributed to users along with the | |
1869 | official documentation. |
|
1880 | official documentation. | |
1870 |
|
1881 | |||
1871 | 2004-05-10 Fernando Perez <fperez@colorado.edu> |
|
1882 | 2004-05-10 Fernando Perez <fperez@colorado.edu> | |
1872 |
|
1883 | |||
1873 | * IPython/Logger.py (Logger.create_log): fix recently introduced |
|
1884 | * IPython/Logger.py (Logger.create_log): fix recently introduced | |
1874 | bug (misindented line) where logstart would fail when not given an |
|
1885 | bug (misindented line) where logstart would fail when not given an | |
1875 | explicit filename. |
|
1886 | explicit filename. | |
1876 |
|
1887 | |||
1877 | 2004-05-09 Fernando Perez <fperez@colorado.edu> |
|
1888 | 2004-05-09 Fernando Perez <fperez@colorado.edu> | |
1878 |
|
1889 | |||
1879 | * IPython/Magic.py (Magic.parse_options): skip system call when |
|
1890 | * IPython/Magic.py (Magic.parse_options): skip system call when | |
1880 | there are no options to look for. Faster, cleaner for the common |
|
1891 | there are no options to look for. Faster, cleaner for the common | |
1881 | case. |
|
1892 | case. | |
1882 |
|
1893 | |||
1883 | * Documentation: many updates to the manual: describing Windows |
|
1894 | * Documentation: many updates to the manual: describing Windows | |
1884 | support better, Gnuplot updates, credits, misc small stuff. Also |
|
1895 | support better, Gnuplot updates, credits, misc small stuff. Also | |
1885 | updated the new_design doc a bit. |
|
1896 | updated the new_design doc a bit. | |
1886 |
|
1897 | |||
1887 | 2004-05-06 *** Released version 0.6.0.rc1 |
|
1898 | 2004-05-06 *** Released version 0.6.0.rc1 | |
1888 |
|
1899 | |||
1889 | 2004-05-06 Fernando Perez <fperez@colorado.edu> |
|
1900 | 2004-05-06 Fernando Perez <fperez@colorado.edu> | |
1890 |
|
1901 | |||
1891 | * IPython/ultraTB.py (ListTB.text): modified a ton of string += |
|
1902 | * IPython/ultraTB.py (ListTB.text): modified a ton of string += | |
1892 | operations to use the vastly more efficient list/''.join() method. |
|
1903 | operations to use the vastly more efficient list/''.join() method. | |
1893 | (FormattedTB.text): Fix |
|
1904 | (FormattedTB.text): Fix | |
1894 | http://www.scipy.net/roundup/ipython/issue12 - exception source |
|
1905 | http://www.scipy.net/roundup/ipython/issue12 - exception source | |
1895 | extract not updated after reload. Thanks to Mike Salib |
|
1906 | extract not updated after reload. Thanks to Mike Salib | |
1896 | <msalib-AT-mit.edu> for pinning the source of the problem. |
|
1907 | <msalib-AT-mit.edu> for pinning the source of the problem. | |
1897 | Fortunately, the solution works inside ipython and doesn't require |
|
1908 | Fortunately, the solution works inside ipython and doesn't require | |
1898 | any changes to python proper. |
|
1909 | any changes to python proper. | |
1899 |
|
1910 | |||
1900 | * IPython/Magic.py (Magic.parse_options): Improved to process the |
|
1911 | * IPython/Magic.py (Magic.parse_options): Improved to process the | |
1901 | argument list as a true shell would (by actually using the |
|
1912 | argument list as a true shell would (by actually using the | |
1902 | underlying system shell). This way, all @magics automatically get |
|
1913 | underlying system shell). This way, all @magics automatically get | |
1903 | shell expansion for variables. Thanks to a comment by Alex |
|
1914 | shell expansion for variables. Thanks to a comment by Alex | |
1904 | Schmolck. |
|
1915 | Schmolck. | |
1905 |
|
1916 | |||
1906 | 2004-04-04 Fernando Perez <fperez@colorado.edu> |
|
1917 | 2004-04-04 Fernando Perez <fperez@colorado.edu> | |
1907 |
|
1918 | |||
1908 | * IPython/iplib.py (InteractiveShell.interact): Added a special |
|
1919 | * IPython/iplib.py (InteractiveShell.interact): Added a special | |
1909 | trap for a debugger quit exception, which is basically impossible |
|
1920 | trap for a debugger quit exception, which is basically impossible | |
1910 | to handle by normal mechanisms, given what pdb does to the stack. |
|
1921 | to handle by normal mechanisms, given what pdb does to the stack. | |
1911 | This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>. |
|
1922 | This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>. | |
1912 |
|
1923 | |||
1913 | 2004-04-03 Fernando Perez <fperez@colorado.edu> |
|
1924 | 2004-04-03 Fernando Perez <fperez@colorado.edu> | |
1914 |
|
1925 | |||
1915 | * IPython/genutils.py (Term): Standardized the names of the Term |
|
1926 | * IPython/genutils.py (Term): Standardized the names of the Term | |
1916 | class streams to cin/cout/cerr, following C++ naming conventions |
|
1927 | class streams to cin/cout/cerr, following C++ naming conventions | |
1917 | (I can't use in/out/err because 'in' is not a valid attribute |
|
1928 | (I can't use in/out/err because 'in' is not a valid attribute | |
1918 | name). |
|
1929 | name). | |
1919 |
|
1930 | |||
1920 | * IPython/iplib.py (InteractiveShell.interact): don't increment |
|
1931 | * IPython/iplib.py (InteractiveShell.interact): don't increment | |
1921 | the prompt if there's no user input. By Daniel 'Dang' Griffith |
|
1932 | the prompt if there's no user input. By Daniel 'Dang' Griffith | |
1922 | <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from |
|
1933 | <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from | |
1923 | Francois Pinard. |
|
1934 | Francois Pinard. | |
1924 |
|
1935 | |||
1925 | 2004-04-02 Fernando Perez <fperez@colorado.edu> |
|
1936 | 2004-04-02 Fernando Perez <fperez@colorado.edu> | |
1926 |
|
1937 | |||
1927 | * IPython/genutils.py (Stream.__init__): Modified to survive at |
|
1938 | * IPython/genutils.py (Stream.__init__): Modified to survive at | |
1928 | least importing in contexts where stdin/out/err aren't true file |
|
1939 | least importing in contexts where stdin/out/err aren't true file | |
1929 | objects, such as PyCrust (they lack fileno() and mode). However, |
|
1940 | objects, such as PyCrust (they lack fileno() and mode). However, | |
1930 | the recovery facilities which rely on these things existing will |
|
1941 | the recovery facilities which rely on these things existing will | |
1931 | not work. |
|
1942 | not work. | |
1932 |
|
1943 | |||
1933 | 2004-04-01 Fernando Perez <fperez@colorado.edu> |
|
1944 | 2004-04-01 Fernando Perez <fperez@colorado.edu> | |
1934 |
|
1945 | |||
1935 | * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to |
|
1946 | * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to | |
1936 | use the new getoutputerror() function, so it properly |
|
1947 | use the new getoutputerror() function, so it properly | |
1937 | distinguishes stdout/err. |
|
1948 | distinguishes stdout/err. | |
1938 |
|
1949 | |||
1939 | * IPython/genutils.py (getoutputerror): added a function to |
|
1950 | * IPython/genutils.py (getoutputerror): added a function to | |
1940 | capture separately the standard output and error of a command. |
|
1951 | capture separately the standard output and error of a command. | |
1941 | After a comment from dang on the mailing lists. This code is |
|
1952 | After a comment from dang on the mailing lists. This code is | |
1942 | basically a modified version of commands.getstatusoutput(), from |
|
1953 | basically a modified version of commands.getstatusoutput(), from | |
1943 | the standard library. |
|
1954 | the standard library. | |
1944 |
|
1955 | |||
1945 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): added |
|
1956 | * IPython/iplib.py (InteractiveShell.handle_shell_escape): added | |
1946 | '!!' as a special syntax (shorthand) to access @sx. |
|
1957 | '!!' as a special syntax (shorthand) to access @sx. | |
1947 |
|
1958 | |||
1948 | * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell |
|
1959 | * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell | |
1949 | command and return its output as a list split on '\n'. |
|
1960 | command and return its output as a list split on '\n'. | |
1950 |
|
1961 | |||
1951 | 2004-03-31 Fernando Perez <fperez@colorado.edu> |
|
1962 | 2004-03-31 Fernando Perez <fperez@colorado.edu> | |
1952 |
|
1963 | |||
1953 | * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__ |
|
1964 | * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__ | |
1954 | method to dictionaries used as FakeModule instances if they lack |
|
1965 | method to dictionaries used as FakeModule instances if they lack | |
1955 | it. At least pydoc in python2.3 breaks for runtime-defined |
|
1966 | it. At least pydoc in python2.3 breaks for runtime-defined | |
1956 | functions without this hack. At some point I need to _really_ |
|
1967 | functions without this hack. At some point I need to _really_ | |
1957 | understand what FakeModule is doing, because it's a gross hack. |
|
1968 | understand what FakeModule is doing, because it's a gross hack. | |
1958 | But it solves Arnd's problem for now... |
|
1969 | But it solves Arnd's problem for now... | |
1959 |
|
1970 | |||
1960 | 2004-02-27 Fernando Perez <fperez@colorado.edu> |
|
1971 | 2004-02-27 Fernando Perez <fperez@colorado.edu> | |
1961 |
|
1972 | |||
1962 | * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate' |
|
1973 | * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate' | |
1963 | mode would behave erratically. Also increased the number of |
|
1974 | mode would behave erratically. Also increased the number of | |
1964 | possible logs in rotate mod to 999. Thanks to Rod Holland |
|
1975 | possible logs in rotate mod to 999. Thanks to Rod Holland | |
1965 | <rhh@StructureLABS.com> for the report and fixes. |
|
1976 | <rhh@StructureLABS.com> for the report and fixes. | |
1966 |
|
1977 | |||
1967 | 2004-02-26 Fernando Perez <fperez@colorado.edu> |
|
1978 | 2004-02-26 Fernando Perez <fperez@colorado.edu> | |
1968 |
|
1979 | |||
1969 | * IPython/genutils.py (page): Check that the curses module really |
|
1980 | * IPython/genutils.py (page): Check that the curses module really | |
1970 | has the initscr attribute before trying to use it. For some |
|
1981 | has the initscr attribute before trying to use it. For some | |
1971 | reason, the Solaris curses module is missing this. I think this |
|
1982 | reason, the Solaris curses module is missing this. I think this | |
1972 | should be considered a Solaris python bug, but I'm not sure. |
|
1983 | should be considered a Solaris python bug, but I'm not sure. | |
1973 |
|
1984 | |||
1974 | 2004-01-17 Fernando Perez <fperez@colorado.edu> |
|
1985 | 2004-01-17 Fernando Perez <fperez@colorado.edu> | |
1975 |
|
1986 | |||
1976 | * IPython/genutils.py (Stream.__init__): Changes to try to make |
|
1987 | * IPython/genutils.py (Stream.__init__): Changes to try to make | |
1977 | ipython robust against stdin/out/err being closed by the user. |
|
1988 | ipython robust against stdin/out/err being closed by the user. | |
1978 | This is 'user error' (and blocks a normal python session, at least |
|
1989 | This is 'user error' (and blocks a normal python session, at least | |
1979 | the stdout case). However, Ipython should be able to survive such |
|
1990 | the stdout case). However, Ipython should be able to survive such | |
1980 | instances of abuse as gracefully as possible. To simplify the |
|
1991 | instances of abuse as gracefully as possible. To simplify the | |
1981 | coding and maintain compatibility with Gary Bishop's Term |
|
1992 | coding and maintain compatibility with Gary Bishop's Term | |
1982 | contributions, I've made use of classmethods for this. I think |
|
1993 | contributions, I've made use of classmethods for this. I think | |
1983 | this introduces a dependency on python 2.2. |
|
1994 | this introduces a dependency on python 2.2. | |
1984 |
|
1995 | |||
1985 | 2004-01-13 Fernando Perez <fperez@colorado.edu> |
|
1996 | 2004-01-13 Fernando Perez <fperez@colorado.edu> | |
1986 |
|
1997 | |||
1987 | * IPython/numutils.py (exp_safe): simplified the code a bit and |
|
1998 | * IPython/numutils.py (exp_safe): simplified the code a bit and | |
1988 | removed the need for importing the kinds module altogether. |
|
1999 | removed the need for importing the kinds module altogether. | |
1989 |
|
2000 | |||
1990 | 2004-01-06 Fernando Perez <fperez@colorado.edu> |
|
2001 | 2004-01-06 Fernando Perez <fperez@colorado.edu> | |
1991 |
|
2002 | |||
1992 | * IPython/Magic.py (Magic.magic_sc): Made the shell capture system |
|
2003 | * IPython/Magic.py (Magic.magic_sc): Made the shell capture system | |
1993 | a magic function instead, after some community feedback. No |
|
2004 | a magic function instead, after some community feedback. No | |
1994 | special syntax will exist for it, but its name is deliberately |
|
2005 | special syntax will exist for it, but its name is deliberately | |
1995 | very short. |
|
2006 | very short. | |
1996 |
|
2007 | |||
1997 | 2003-12-20 Fernando Perez <fperez@colorado.edu> |
|
2008 | 2003-12-20 Fernando Perez <fperez@colorado.edu> | |
1998 |
|
2009 | |||
1999 | * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added |
|
2010 | * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added | |
2000 | new functionality, to automagically assign the result of a shell |
|
2011 | new functionality, to automagically assign the result of a shell | |
2001 | command to a variable. I'll solicit some community feedback on |
|
2012 | command to a variable. I'll solicit some community feedback on | |
2002 | this before making it permanent. |
|
2013 | this before making it permanent. | |
2003 |
|
2014 | |||
2004 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was |
|
2015 | * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was | |
2005 | requested about callables for which inspect couldn't obtain a |
|
2016 | requested about callables for which inspect couldn't obtain a | |
2006 | proper argspec. Thanks to a crash report sent by Etienne |
|
2017 | proper argspec. Thanks to a crash report sent by Etienne | |
2007 | Posthumus <etienne-AT-apple01.cs.vu.nl>. |
|
2018 | Posthumus <etienne-AT-apple01.cs.vu.nl>. | |
2008 |
|
2019 | |||
2009 | 2003-12-09 Fernando Perez <fperez@colorado.edu> |
|
2020 | 2003-12-09 Fernando Perez <fperez@colorado.edu> | |
2010 |
|
2021 | |||
2011 | * IPython/genutils.py (page): patch for the pager to work across |
|
2022 | * IPython/genutils.py (page): patch for the pager to work across | |
2012 | various versions of Windows. By Gary Bishop. |
|
2023 | various versions of Windows. By Gary Bishop. | |
2013 |
|
2024 | |||
2014 | 2003-12-04 Fernando Perez <fperez@colorado.edu> |
|
2025 | 2003-12-04 Fernando Perez <fperez@colorado.edu> | |
2015 |
|
2026 | |||
2016 | * IPython/Gnuplot2.py (PlotItems): Fixes for working with |
|
2027 | * IPython/Gnuplot2.py (PlotItems): Fixes for working with | |
2017 | Gnuplot.py version 1.7, whose internal names changed quite a bit. |
|
2028 | Gnuplot.py version 1.7, whose internal names changed quite a bit. | |
2018 | While I tested this and it looks ok, there may still be corner |
|
2029 | While I tested this and it looks ok, there may still be corner | |
2019 | cases I've missed. |
|
2030 | cases I've missed. | |
2020 |
|
2031 | |||
2021 | 2003-12-01 Fernando Perez <fperez@colorado.edu> |
|
2032 | 2003-12-01 Fernando Perez <fperez@colorado.edu> | |
2022 |
|
2033 | |||
2023 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug |
|
2034 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug | |
2024 | where a line like 'p,q=1,2' would fail because the automagic |
|
2035 | where a line like 'p,q=1,2' would fail because the automagic | |
2025 | system would be triggered for @p. |
|
2036 | system would be triggered for @p. | |
2026 |
|
2037 | |||
2027 | * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related |
|
2038 | * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related | |
2028 | cleanups, code unmodified. |
|
2039 | cleanups, code unmodified. | |
2029 |
|
2040 | |||
2030 | * IPython/genutils.py (Term): added a class for IPython to handle |
|
2041 | * IPython/genutils.py (Term): added a class for IPython to handle | |
2031 | output. In most cases it will just be a proxy for stdout/err, but |
|
2042 | output. In most cases it will just be a proxy for stdout/err, but | |
2032 | having this allows modifications to be made for some platforms, |
|
2043 | having this allows modifications to be made for some platforms, | |
2033 | such as handling color escapes under Windows. All of this code |
|
2044 | such as handling color escapes under Windows. All of this code | |
2034 | was contributed by Gary Bishop, with minor modifications by me. |
|
2045 | was contributed by Gary Bishop, with minor modifications by me. | |
2035 | The actual changes affect many files. |
|
2046 | The actual changes affect many files. | |
2036 |
|
2047 | |||
2037 | 2003-11-30 Fernando Perez <fperez@colorado.edu> |
|
2048 | 2003-11-30 Fernando Perez <fperez@colorado.edu> | |
2038 |
|
2049 | |||
2039 | * IPython/iplib.py (file_matches): new completion code, courtesy |
|
2050 | * IPython/iplib.py (file_matches): new completion code, courtesy | |
2040 | of Jeff Collins. This enables filename completion again under |
|
2051 | of Jeff Collins. This enables filename completion again under | |
2041 | python 2.3, which disabled it at the C level. |
|
2052 | python 2.3, which disabled it at the C level. | |
2042 |
|
2053 | |||
2043 | 2003-11-11 Fernando Perez <fperez@colorado.edu> |
|
2054 | 2003-11-11 Fernando Perez <fperez@colorado.edu> | |
2044 |
|
2055 | |||
2045 | * IPython/numutils.py (amap): Added amap() fn. Simple shorthand |
|
2056 | * IPython/numutils.py (amap): Added amap() fn. Simple shorthand | |
2046 | for Numeric.array(map(...)), but often convenient. |
|
2057 | for Numeric.array(map(...)), but often convenient. | |
2047 |
|
2058 | |||
2048 | 2003-11-05 Fernando Perez <fperez@colorado.edu> |
|
2059 | 2003-11-05 Fernando Perez <fperez@colorado.edu> | |
2049 |
|
2060 | |||
2050 | * IPython/numutils.py (frange): Changed a call from int() to |
|
2061 | * IPython/numutils.py (frange): Changed a call from int() to | |
2051 | int(round()) to prevent a problem reported with arange() in the |
|
2062 | int(round()) to prevent a problem reported with arange() in the | |
2052 | numpy list. |
|
2063 | numpy list. | |
2053 |
|
2064 | |||
2054 | 2003-10-06 Fernando Perez <fperez@colorado.edu> |
|
2065 | 2003-10-06 Fernando Perez <fperez@colorado.edu> | |
2055 |
|
2066 | |||
2056 | * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to |
|
2067 | * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to | |
2057 | prevent crashes if sys lacks an argv attribute (it happens with |
|
2068 | prevent crashes if sys lacks an argv attribute (it happens with | |
2058 | embedded interpreters which build a bare-bones sys module). |
|
2069 | embedded interpreters which build a bare-bones sys module). | |
2059 | Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>. |
|
2070 | Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>. | |
2060 |
|
2071 | |||
2061 | 2003-09-24 Fernando Perez <fperez@colorado.edu> |
|
2072 | 2003-09-24 Fernando Perez <fperez@colorado.edu> | |
2062 |
|
2073 | |||
2063 | * IPython/Magic.py (Magic._ofind): blanket except around getattr() |
|
2074 | * IPython/Magic.py (Magic._ofind): blanket except around getattr() | |
2064 | to protect against poorly written user objects where __getattr__ |
|
2075 | to protect against poorly written user objects where __getattr__ | |
2065 | raises exceptions other than AttributeError. Thanks to a bug |
|
2076 | raises exceptions other than AttributeError. Thanks to a bug | |
2066 | report by Oliver Sander <osander-AT-gmx.de>. |
|
2077 | report by Oliver Sander <osander-AT-gmx.de>. | |
2067 |
|
2078 | |||
2068 | * IPython/FakeModule.py (FakeModule.__repr__): this method was |
|
2079 | * IPython/FakeModule.py (FakeModule.__repr__): this method was | |
2069 | missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>. |
|
2080 | missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>. | |
2070 |
|
2081 | |||
2071 | 2003-09-09 Fernando Perez <fperez@colorado.edu> |
|
2082 | 2003-09-09 Fernando Perez <fperez@colorado.edu> | |
2072 |
|
2083 | |||
2073 | * IPython/iplib.py (InteractiveShell._prefilter): fix bug where |
|
2084 | * IPython/iplib.py (InteractiveShell._prefilter): fix bug where | |
2074 | unpacking a list whith a callable as first element would |
|
2085 | unpacking a list whith a callable as first element would | |
2075 | mistakenly trigger autocalling. Thanks to a bug report by Jeffery |
|
2086 | mistakenly trigger autocalling. Thanks to a bug report by Jeffery | |
2076 | Collins. |
|
2087 | Collins. | |
2077 |
|
2088 | |||
2078 | 2003-08-25 *** Released version 0.5.0 |
|
2089 | 2003-08-25 *** Released version 0.5.0 | |
2079 |
|
2090 | |||
2080 | 2003-08-22 Fernando Perez <fperez@colorado.edu> |
|
2091 | 2003-08-22 Fernando Perez <fperez@colorado.edu> | |
2081 |
|
2092 | |||
2082 | * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of |
|
2093 | * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of | |
2083 | improperly defined user exceptions. Thanks to feedback from Mark |
|
2094 | improperly defined user exceptions. Thanks to feedback from Mark | |
2084 | Russell <mrussell-AT-verio.net>. |
|
2095 | Russell <mrussell-AT-verio.net>. | |
2085 |
|
2096 | |||
2086 | 2003-08-20 Fernando Perez <fperez@colorado.edu> |
|
2097 | 2003-08-20 Fernando Perez <fperez@colorado.edu> | |
2087 |
|
2098 | |||
2088 | * IPython/OInspect.py (Inspector.pinfo): changed String Form |
|
2099 | * IPython/OInspect.py (Inspector.pinfo): changed String Form | |
2089 | printing so that it would print multi-line string forms starting |
|
2100 | printing so that it would print multi-line string forms starting | |
2090 | with a new line. This way the formatting is better respected for |
|
2101 | with a new line. This way the formatting is better respected for | |
2091 | objects which work hard to make nice string forms. |
|
2102 | objects which work hard to make nice string forms. | |
2092 |
|
2103 | |||
2093 | * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where |
|
2104 | * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where | |
2094 | autocall would overtake data access for objects with both |
|
2105 | autocall would overtake data access for objects with both | |
2095 | __getitem__ and __call__. |
|
2106 | __getitem__ and __call__. | |
2096 |
|
2107 | |||
2097 | 2003-08-19 *** Released version 0.5.0-rc1 |
|
2108 | 2003-08-19 *** Released version 0.5.0-rc1 | |
2098 |
|
2109 | |||
2099 | 2003-08-19 Fernando Perez <fperez@colorado.edu> |
|
2110 | 2003-08-19 Fernando Perez <fperez@colorado.edu> | |
2100 |
|
2111 | |||
2101 | * IPython/deep_reload.py (load_tail): single tiny change here |
|
2112 | * IPython/deep_reload.py (load_tail): single tiny change here | |
2102 | seems to fix the long-standing bug of dreload() failing to work |
|
2113 | seems to fix the long-standing bug of dreload() failing to work | |
2103 | for dotted names. But this module is pretty tricky, so I may have |
|
2114 | for dotted names. But this module is pretty tricky, so I may have | |
2104 | missed some subtlety. Needs more testing!. |
|
2115 | missed some subtlety. Needs more testing!. | |
2105 |
|
2116 | |||
2106 | * IPython/ultraTB.py (VerboseTB.linereader): harden against user |
|
2117 | * IPython/ultraTB.py (VerboseTB.linereader): harden against user | |
2107 | exceptions which have badly implemented __str__ methods. |
|
2118 | exceptions which have badly implemented __str__ methods. | |
2108 | (VerboseTB.text): harden against inspect.getinnerframes crashing, |
|
2119 | (VerboseTB.text): harden against inspect.getinnerframes crashing, | |
2109 | which I've been getting reports about from Python 2.3 users. I |
|
2120 | which I've been getting reports about from Python 2.3 users. I | |
2110 | wish I had a simple test case to reproduce the problem, so I could |
|
2121 | wish I had a simple test case to reproduce the problem, so I could | |
2111 | either write a cleaner workaround or file a bug report if |
|
2122 | either write a cleaner workaround or file a bug report if | |
2112 | necessary. |
|
2123 | necessary. | |
2113 |
|
2124 | |||
2114 | * IPython/Magic.py (Magic.magic_edit): fixed bug where after |
|
2125 | * IPython/Magic.py (Magic.magic_edit): fixed bug where after | |
2115 | making a class 'foo', file 'foo.py' couldn't be edited. Thanks to |
|
2126 | making a class 'foo', file 'foo.py' couldn't be edited. Thanks to | |
2116 | a bug report by Tjabo Kloppenburg. |
|
2127 | a bug report by Tjabo Kloppenburg. | |
2117 |
|
2128 | |||
2118 | * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb |
|
2129 | * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb | |
2119 | crashes. Wrapped the pdb call in a blanket try/except, since pdb |
|
2130 | crashes. Wrapped the pdb call in a blanket try/except, since pdb | |
2120 | seems rather unstable. Thanks to a bug report by Tjabo |
|
2131 | seems rather unstable. Thanks to a bug report by Tjabo | |
2121 | Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>. |
|
2132 | Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>. | |
2122 |
|
2133 | |||
2123 | * IPython/Release.py (version): release 0.5.0-rc1. I want to put |
|
2134 | * IPython/Release.py (version): release 0.5.0-rc1. I want to put | |
2124 | this out soon because of the critical fixes in the inner loop for |
|
2135 | this out soon because of the critical fixes in the inner loop for | |
2125 | generators. |
|
2136 | generators. | |
2126 |
|
2137 | |||
2127 | * IPython/Magic.py (Magic.getargspec): removed. This (and |
|
2138 | * IPython/Magic.py (Magic.getargspec): removed. This (and | |
2128 | _get_def) have been obsoleted by OInspect for a long time, I |
|
2139 | _get_def) have been obsoleted by OInspect for a long time, I | |
2129 | hadn't noticed that they were dead code. |
|
2140 | hadn't noticed that they were dead code. | |
2130 | (Magic._ofind): restored _ofind functionality for a few literals |
|
2141 | (Magic._ofind): restored _ofind functionality for a few literals | |
2131 | (those in ["''",'""','[]','{}','()']). But it won't work anymore |
|
2142 | (those in ["''",'""','[]','{}','()']). But it won't work anymore | |
2132 | for things like "hello".capitalize?, since that would require a |
|
2143 | for things like "hello".capitalize?, since that would require a | |
2133 | potentially dangerous eval() again. |
|
2144 | potentially dangerous eval() again. | |
2134 |
|
2145 | |||
2135 | * IPython/iplib.py (InteractiveShell._prefilter): reorganized the |
|
2146 | * IPython/iplib.py (InteractiveShell._prefilter): reorganized the | |
2136 | logic a bit more to clean up the escapes handling and minimize the |
|
2147 | logic a bit more to clean up the escapes handling and minimize the | |
2137 | use of _ofind to only necessary cases. The interactive 'feel' of |
|
2148 | use of _ofind to only necessary cases. The interactive 'feel' of | |
2138 | IPython should have improved quite a bit with the changes in |
|
2149 | IPython should have improved quite a bit with the changes in | |
2139 | _prefilter and _ofind (besides being far safer than before). |
|
2150 | _prefilter and _ofind (besides being far safer than before). | |
2140 |
|
2151 | |||
2141 | * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather |
|
2152 | * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather | |
2142 | obscure, never reported). Edit would fail to find the object to |
|
2153 | obscure, never reported). Edit would fail to find the object to | |
2143 | edit under some circumstances. |
|
2154 | edit under some circumstances. | |
2144 | (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls |
|
2155 | (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls | |
2145 | which were causing double-calling of generators. Those eval calls |
|
2156 | which were causing double-calling of generators. Those eval calls | |
2146 | were _very_ dangerous, since code with side effects could be |
|
2157 | were _very_ dangerous, since code with side effects could be | |
2147 | triggered. As they say, 'eval is evil'... These were the |
|
2158 | triggered. As they say, 'eval is evil'... These were the | |
2148 | nastiest evals in IPython. Besides, _ofind is now far simpler, |
|
2159 | nastiest evals in IPython. Besides, _ofind is now far simpler, | |
2149 | and it should also be quite a bit faster. Its use of inspect is |
|
2160 | and it should also be quite a bit faster. Its use of inspect is | |
2150 | also safer, so perhaps some of the inspect-related crashes I've |
|
2161 | also safer, so perhaps some of the inspect-related crashes I've | |
2151 | seen lately with Python 2.3 might be taken care of. That will |
|
2162 | seen lately with Python 2.3 might be taken care of. That will | |
2152 | need more testing. |
|
2163 | need more testing. | |
2153 |
|
2164 | |||
2154 | 2003-08-17 Fernando Perez <fperez@colorado.edu> |
|
2165 | 2003-08-17 Fernando Perez <fperez@colorado.edu> | |
2155 |
|
2166 | |||
2156 | * IPython/iplib.py (InteractiveShell._prefilter): significant |
|
2167 | * IPython/iplib.py (InteractiveShell._prefilter): significant | |
2157 | simplifications to the logic for handling user escapes. Faster |
|
2168 | simplifications to the logic for handling user escapes. Faster | |
2158 | and simpler code. |
|
2169 | and simpler code. | |
2159 |
|
2170 | |||
2160 | 2003-08-14 Fernando Perez <fperez@colorado.edu> |
|
2171 | 2003-08-14 Fernando Perez <fperez@colorado.edu> | |
2161 |
|
2172 | |||
2162 | * IPython/numutils.py (sum_flat): rewrote to be non-recursive. |
|
2173 | * IPython/numutils.py (sum_flat): rewrote to be non-recursive. | |
2163 | Now it requires O(N) storage (N=size(a)) for non-contiguous input, |
|
2174 | Now it requires O(N) storage (N=size(a)) for non-contiguous input, | |
2164 | but it should be quite a bit faster. And the recursive version |
|
2175 | but it should be quite a bit faster. And the recursive version | |
2165 | generated O(log N) intermediate storage for all rank>1 arrays, |
|
2176 | generated O(log N) intermediate storage for all rank>1 arrays, | |
2166 | even if they were contiguous. |
|
2177 | even if they were contiguous. | |
2167 | (l1norm): Added this function. |
|
2178 | (l1norm): Added this function. | |
2168 | (norm): Added this function for arbitrary norms (including |
|
2179 | (norm): Added this function for arbitrary norms (including | |
2169 | l-infinity). l1 and l2 are still special cases for convenience |
|
2180 | l-infinity). l1 and l2 are still special cases for convenience | |
2170 | and speed. |
|
2181 | and speed. | |
2171 |
|
2182 | |||
2172 | 2003-08-03 Fernando Perez <fperez@colorado.edu> |
|
2183 | 2003-08-03 Fernando Perez <fperez@colorado.edu> | |
2173 |
|
2184 | |||
2174 | * IPython/Magic.py (Magic.magic_edit): Removed all remaining string |
|
2185 | * IPython/Magic.py (Magic.magic_edit): Removed all remaining string | |
2175 | exceptions, which now raise PendingDeprecationWarnings in Python |
|
2186 | exceptions, which now raise PendingDeprecationWarnings in Python | |
2176 | 2.3. There were some in Magic and some in Gnuplot2. |
|
2187 | 2.3. There were some in Magic and some in Gnuplot2. | |
2177 |
|
2188 | |||
2178 | 2003-06-30 Fernando Perez <fperez@colorado.edu> |
|
2189 | 2003-06-30 Fernando Perez <fperez@colorado.edu> | |
2179 |
|
2190 | |||
2180 | * IPython/genutils.py (page): modified to call curses only for |
|
2191 | * IPython/genutils.py (page): modified to call curses only for | |
2181 | terminals where TERM=='xterm'. After problems under many other |
|
2192 | terminals where TERM=='xterm'. After problems under many other | |
2182 | terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>. |
|
2193 | terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>. | |
2183 |
|
2194 | |||
2184 | * IPython/iplib.py (complete): removed spurious 'print "IE"' which |
|
2195 | * IPython/iplib.py (complete): removed spurious 'print "IE"' which | |
2185 | would be triggered when readline was absent. This was just an old |
|
2196 | would be triggered when readline was absent. This was just an old | |
2186 | debugging statement I'd forgotten to take out. |
|
2197 | debugging statement I'd forgotten to take out. | |
2187 |
|
2198 | |||
2188 | 2003-06-20 Fernando Perez <fperez@colorado.edu> |
|
2199 | 2003-06-20 Fernando Perez <fperez@colorado.edu> | |
2189 |
|
2200 | |||
2190 | * IPython/genutils.py (clock): modified to return only user time |
|
2201 | * IPython/genutils.py (clock): modified to return only user time | |
2191 | (not counting system time), after a discussion on scipy. While |
|
2202 | (not counting system time), after a discussion on scipy. While | |
2192 | system time may be a useful quantity occasionally, it may much |
|
2203 | system time may be a useful quantity occasionally, it may much | |
2193 | more easily be skewed by occasional swapping or other similar |
|
2204 | more easily be skewed by occasional swapping or other similar | |
2194 | activity. |
|
2205 | activity. | |
2195 |
|
2206 | |||
2196 | 2003-06-05 Fernando Perez <fperez@colorado.edu> |
|
2207 | 2003-06-05 Fernando Perez <fperez@colorado.edu> | |
2197 |
|
2208 | |||
2198 | * IPython/numutils.py (identity): new function, for building |
|
2209 | * IPython/numutils.py (identity): new function, for building | |
2199 | arbitrary rank Kronecker deltas (mostly backwards compatible with |
|
2210 | arbitrary rank Kronecker deltas (mostly backwards compatible with | |
2200 | Numeric.identity) |
|
2211 | Numeric.identity) | |
2201 |
|
2212 | |||
2202 | 2003-06-03 Fernando Perez <fperez@colorado.edu> |
|
2213 | 2003-06-03 Fernando Perez <fperez@colorado.edu> | |
2203 |
|
2214 | |||
2204 | * IPython/iplib.py (InteractiveShell.handle_magic): protect |
|
2215 | * IPython/iplib.py (InteractiveShell.handle_magic): protect | |
2205 | arguments passed to magics with spaces, to allow trailing '\' to |
|
2216 | arguments passed to magics with spaces, to allow trailing '\' to | |
2206 | work normally (mainly for Windows users). |
|
2217 | work normally (mainly for Windows users). | |
2207 |
|
2218 | |||
2208 | 2003-05-29 Fernando Perez <fperez@colorado.edu> |
|
2219 | 2003-05-29 Fernando Perez <fperez@colorado.edu> | |
2209 |
|
2220 | |||
2210 | * IPython/ipmaker.py (make_IPython): Load site._Helper() as help |
|
2221 | * IPython/ipmaker.py (make_IPython): Load site._Helper() as help | |
2211 | instead of pydoc.help. This fixes a bizarre behavior where |
|
2222 | instead of pydoc.help. This fixes a bizarre behavior where | |
2212 | printing '%s' % locals() would trigger the help system. Now |
|
2223 | printing '%s' % locals() would trigger the help system. Now | |
2213 | ipython behaves like normal python does. |
|
2224 | ipython behaves like normal python does. | |
2214 |
|
2225 | |||
2215 | Note that if one does 'from pydoc import help', the bizarre |
|
2226 | Note that if one does 'from pydoc import help', the bizarre | |
2216 | behavior returns, but this will also happen in normal python, so |
|
2227 | behavior returns, but this will also happen in normal python, so | |
2217 | it's not an ipython bug anymore (it has to do with how pydoc.help |
|
2228 | it's not an ipython bug anymore (it has to do with how pydoc.help | |
2218 | is implemented). |
|
2229 | is implemented). | |
2219 |
|
2230 | |||
2220 | 2003-05-22 Fernando Perez <fperez@colorado.edu> |
|
2231 | 2003-05-22 Fernando Perez <fperez@colorado.edu> | |
2221 |
|
2232 | |||
2222 | * IPython/FlexCompleter.py (Completer.attr_matches): fixed to |
|
2233 | * IPython/FlexCompleter.py (Completer.attr_matches): fixed to | |
2223 | return [] instead of None when nothing matches, also match to end |
|
2234 | return [] instead of None when nothing matches, also match to end | |
2224 | of line. Patch by Gary Bishop. |
|
2235 | of line. Patch by Gary Bishop. | |
2225 |
|
2236 | |||
2226 | * IPython/ipmaker.py (make_IPython): Added same sys.excepthook |
|
2237 | * IPython/ipmaker.py (make_IPython): Added same sys.excepthook | |
2227 | protection as before, for files passed on the command line. This |
|
2238 | protection as before, for files passed on the command line. This | |
2228 | prevents the CrashHandler from kicking in if user files call into |
|
2239 | prevents the CrashHandler from kicking in if user files call into | |
2229 | sys.excepthook (such as PyQt and WxWindows have a nasty habit of |
|
2240 | sys.excepthook (such as PyQt and WxWindows have a nasty habit of | |
2230 | doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr> |
|
2241 | doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr> | |
2231 |
|
2242 | |||
2232 | 2003-05-20 *** Released version 0.4.0 |
|
2243 | 2003-05-20 *** Released version 0.4.0 | |
2233 |
|
2244 | |||
2234 | 2003-05-20 Fernando Perez <fperez@colorado.edu> |
|
2245 | 2003-05-20 Fernando Perez <fperez@colorado.edu> | |
2235 |
|
2246 | |||
2236 | * setup.py: added support for manpages. It's a bit hackish b/c of |
|
2247 | * setup.py: added support for manpages. It's a bit hackish b/c of | |
2237 | a bug in the way the bdist_rpm distutils target handles gzipped |
|
2248 | a bug in the way the bdist_rpm distutils target handles gzipped | |
2238 | manpages, but it works. After a patch by Jack. |
|
2249 | manpages, but it works. After a patch by Jack. | |
2239 |
|
2250 | |||
2240 | 2003-05-19 Fernando Perez <fperez@colorado.edu> |
|
2251 | 2003-05-19 Fernando Perez <fperez@colorado.edu> | |
2241 |
|
2252 | |||
2242 | * IPython/numutils.py: added a mockup of the kinds module, since |
|
2253 | * IPython/numutils.py: added a mockup of the kinds module, since | |
2243 | it was recently removed from Numeric. This way, numutils will |
|
2254 | it was recently removed from Numeric. This way, numutils will | |
2244 | work for all users even if they are missing kinds. |
|
2255 | work for all users even if they are missing kinds. | |
2245 |
|
2256 | |||
2246 | * IPython/Magic.py (Magic._ofind): Harden against an inspect |
|
2257 | * IPython/Magic.py (Magic._ofind): Harden against an inspect | |
2247 | failure, which can occur with SWIG-wrapped extensions. After a |
|
2258 | failure, which can occur with SWIG-wrapped extensions. After a | |
2248 | crash report from Prabhu. |
|
2259 | crash report from Prabhu. | |
2249 |
|
2260 | |||
2250 | 2003-05-16 Fernando Perez <fperez@colorado.edu> |
|
2261 | 2003-05-16 Fernando Perez <fperez@colorado.edu> | |
2251 |
|
2262 | |||
2252 | * IPython/iplib.py (InteractiveShell.excepthook): New method to |
|
2263 | * IPython/iplib.py (InteractiveShell.excepthook): New method to | |
2253 | protect ipython from user code which may call directly |
|
2264 | protect ipython from user code which may call directly | |
2254 | sys.excepthook (this looks like an ipython crash to the user, even |
|
2265 | sys.excepthook (this looks like an ipython crash to the user, even | |
2255 | when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>. |
|
2266 | when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>. | |
2256 | This is especially important to help users of WxWindows, but may |
|
2267 | This is especially important to help users of WxWindows, but may | |
2257 | also be useful in other cases. |
|
2268 | also be useful in other cases. | |
2258 |
|
2269 | |||
2259 | * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow |
|
2270 | * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow | |
2260 | an optional tb_offset to be specified, and to preserve exception |
|
2271 | an optional tb_offset to be specified, and to preserve exception | |
2261 | info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>. |
|
2272 | info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>. | |
2262 |
|
2273 | |||
2263 | * ipython.1 (Default): Thanks to Jack's work, we now have manpages! |
|
2274 | * ipython.1 (Default): Thanks to Jack's work, we now have manpages! | |
2264 |
|
2275 | |||
2265 | 2003-05-15 Fernando Perez <fperez@colorado.edu> |
|
2276 | 2003-05-15 Fernando Perez <fperez@colorado.edu> | |
2266 |
|
2277 | |||
2267 | * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when |
|
2278 | * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when | |
2268 | installing for a new user under Windows. |
|
2279 | installing for a new user under Windows. | |
2269 |
|
2280 | |||
2270 | 2003-05-12 Fernando Perez <fperez@colorado.edu> |
|
2281 | 2003-05-12 Fernando Perez <fperez@colorado.edu> | |
2271 |
|
2282 | |||
2272 | * IPython/iplib.py (InteractiveShell.handle_emacs): New line |
|
2283 | * IPython/iplib.py (InteractiveShell.handle_emacs): New line | |
2273 | handler for Emacs comint-based lines. Currently it doesn't do |
|
2284 | handler for Emacs comint-based lines. Currently it doesn't do | |
2274 | much (but importantly, it doesn't update the history cache). In |
|
2285 | much (but importantly, it doesn't update the history cache). In | |
2275 | the future it may be expanded if Alex needs more functionality |
|
2286 | the future it may be expanded if Alex needs more functionality | |
2276 | there. |
|
2287 | there. | |
2277 |
|
2288 | |||
2278 | * IPython/CrashHandler.py (CrashHandler.__call__): Added platform |
|
2289 | * IPython/CrashHandler.py (CrashHandler.__call__): Added platform | |
2279 | info to crash reports. |
|
2290 | info to crash reports. | |
2280 |
|
2291 | |||
2281 | * IPython/iplib.py (InteractiveShell.mainloop): Added -c option, |
|
2292 | * IPython/iplib.py (InteractiveShell.mainloop): Added -c option, | |
2282 | just like Python's -c. Also fixed crash with invalid -color |
|
2293 | just like Python's -c. Also fixed crash with invalid -color | |
2283 | option value at startup. Thanks to Will French |
|
2294 | option value at startup. Thanks to Will French | |
2284 | <wfrench-AT-bestweb.net> for the bug report. |
|
2295 | <wfrench-AT-bestweb.net> for the bug report. | |
2285 |
|
2296 | |||
2286 | 2003-05-09 Fernando Perez <fperez@colorado.edu> |
|
2297 | 2003-05-09 Fernando Perez <fperez@colorado.edu> | |
2287 |
|
2298 | |||
2288 | * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString |
|
2299 | * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString | |
2289 | to EvalDict (it's a mapping, after all) and simplified its code |
|
2300 | to EvalDict (it's a mapping, after all) and simplified its code | |
2290 | quite a bit, after a nice discussion on c.l.py where Gustavo |
|
2301 | quite a bit, after a nice discussion on c.l.py where Gustavo | |
2291 | CΓ³rdova <gcordova-AT-sismex.com> suggested the new version. |
|
2302 | CΓ³rdova <gcordova-AT-sismex.com> suggested the new version. | |
2292 |
|
2303 | |||
2293 | 2003-04-30 Fernando Perez <fperez@colorado.edu> |
|
2304 | 2003-04-30 Fernando Perez <fperez@colorado.edu> | |
2294 |
|
2305 | |||
2295 | * IPython/genutils.py (timings_out): modified it to reduce its |
|
2306 | * IPython/genutils.py (timings_out): modified it to reduce its | |
2296 | overhead in the common reps==1 case. |
|
2307 | overhead in the common reps==1 case. | |
2297 |
|
2308 | |||
2298 | 2003-04-29 Fernando Perez <fperez@colorado.edu> |
|
2309 | 2003-04-29 Fernando Perez <fperez@colorado.edu> | |
2299 |
|
2310 | |||
2300 | * IPython/genutils.py (timings_out): Modified to use the resource |
|
2311 | * IPython/genutils.py (timings_out): Modified to use the resource | |
2301 | module, which avoids the wraparound problems of time.clock(). |
|
2312 | module, which avoids the wraparound problems of time.clock(). | |
2302 |
|
2313 | |||
2303 | 2003-04-17 *** Released version 0.2.15pre4 |
|
2314 | 2003-04-17 *** Released version 0.2.15pre4 | |
2304 |
|
2315 | |||
2305 | 2003-04-17 Fernando Perez <fperez@colorado.edu> |
|
2316 | 2003-04-17 Fernando Perez <fperez@colorado.edu> | |
2306 |
|
2317 | |||
2307 | * setup.py (scriptfiles): Split windows-specific stuff over to a |
|
2318 | * setup.py (scriptfiles): Split windows-specific stuff over to a | |
2308 | separate file, in an attempt to have a Windows GUI installer. |
|
2319 | separate file, in an attempt to have a Windows GUI installer. | |
2309 | That didn't work, but part of the groundwork is done. |
|
2320 | That didn't work, but part of the groundwork is done. | |
2310 |
|
2321 | |||
2311 | * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for |
|
2322 | * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for | |
2312 | indent/unindent with 4 spaces. Particularly useful in combination |
|
2323 | indent/unindent with 4 spaces. Particularly useful in combination | |
2313 | with the new auto-indent option. |
|
2324 | with the new auto-indent option. | |
2314 |
|
2325 | |||
2315 | 2003-04-16 Fernando Perez <fperez@colorado.edu> |
|
2326 | 2003-04-16 Fernando Perez <fperez@colorado.edu> | |
2316 |
|
2327 | |||
2317 | * IPython/Magic.py: various replacements of self.rc for |
|
2328 | * IPython/Magic.py: various replacements of self.rc for | |
2318 | self.shell.rc. A lot more remains to be done to fully disentangle |
|
2329 | self.shell.rc. A lot more remains to be done to fully disentangle | |
2319 | this class from the main Shell class. |
|
2330 | this class from the main Shell class. | |
2320 |
|
2331 | |||
2321 | * IPython/GnuplotRuntime.py: added checks for mouse support so |
|
2332 | * IPython/GnuplotRuntime.py: added checks for mouse support so | |
2322 | that we don't try to enable it if the current gnuplot doesn't |
|
2333 | that we don't try to enable it if the current gnuplot doesn't | |
2323 | really support it. Also added checks so that we don't try to |
|
2334 | really support it. Also added checks so that we don't try to | |
2324 | enable persist under Windows (where Gnuplot doesn't recognize the |
|
2335 | enable persist under Windows (where Gnuplot doesn't recognize the | |
2325 | option). |
|
2336 | option). | |
2326 |
|
2337 | |||
2327 | * IPython/iplib.py (InteractiveShell.interact): Added optional |
|
2338 | * IPython/iplib.py (InteractiveShell.interact): Added optional | |
2328 | auto-indenting code, after a patch by King C. Shu |
|
2339 | auto-indenting code, after a patch by King C. Shu | |
2329 | <kingshu-AT-myrealbox.com>. It's off by default because it doesn't |
|
2340 | <kingshu-AT-myrealbox.com>. It's off by default because it doesn't | |
2330 | get along well with pasting indented code. If I ever figure out |
|
2341 | get along well with pasting indented code. If I ever figure out | |
2331 | how to make that part go well, it will become on by default. |
|
2342 | how to make that part go well, it will become on by default. | |
2332 |
|
2343 | |||
2333 | * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would |
|
2344 | * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would | |
2334 | crash ipython if there was an unmatched '%' in the user's prompt |
|
2345 | crash ipython if there was an unmatched '%' in the user's prompt | |
2335 | string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>. |
|
2346 | string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>. | |
2336 |
|
2347 | |||
2337 | * IPython/iplib.py (InteractiveShell.interact): removed the |
|
2348 | * IPython/iplib.py (InteractiveShell.interact): removed the | |
2338 | ability to ask the user whether he wants to crash or not at the |
|
2349 | ability to ask the user whether he wants to crash or not at the | |
2339 | 'last line' exception handler. Calling functions at that point |
|
2350 | 'last line' exception handler. Calling functions at that point | |
2340 | changes the stack, and the error reports would have incorrect |
|
2351 | changes the stack, and the error reports would have incorrect | |
2341 | tracebacks. |
|
2352 | tracebacks. | |
2342 |
|
2353 | |||
2343 | * IPython/Magic.py (Magic.magic_page): Added new @page magic, to |
|
2354 | * IPython/Magic.py (Magic.magic_page): Added new @page magic, to | |
2344 | pass through a peger a pretty-printed form of any object. After a |
|
2355 | pass through a peger a pretty-printed form of any object. After a | |
2345 | contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr> |
|
2356 | contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr> | |
2346 |
|
2357 | |||
2347 | 2003-04-14 Fernando Perez <fperez@colorado.edu> |
|
2358 | 2003-04-14 Fernando Perez <fperez@colorado.edu> | |
2348 |
|
2359 | |||
2349 | * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where |
|
2360 | * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where | |
2350 | all files in ~ would be modified at first install (instead of |
|
2361 | all files in ~ would be modified at first install (instead of | |
2351 | ~/.ipython). This could be potentially disastrous, as the |
|
2362 | ~/.ipython). This could be potentially disastrous, as the | |
2352 | modification (make line-endings native) could damage binary files. |
|
2363 | modification (make line-endings native) could damage binary files. | |
2353 |
|
2364 | |||
2354 | 2003-04-10 Fernando Perez <fperez@colorado.edu> |
|
2365 | 2003-04-10 Fernando Perez <fperez@colorado.edu> | |
2355 |
|
2366 | |||
2356 | * IPython/iplib.py (InteractiveShell.handle_help): Modified to |
|
2367 | * IPython/iplib.py (InteractiveShell.handle_help): Modified to | |
2357 | handle only lines which are invalid python. This now means that |
|
2368 | handle only lines which are invalid python. This now means that | |
2358 | lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins |
|
2369 | lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins | |
2359 | for the bug report. |
|
2370 | for the bug report. | |
2360 |
|
2371 | |||
2361 | 2003-04-01 Fernando Perez <fperez@colorado.edu> |
|
2372 | 2003-04-01 Fernando Perez <fperez@colorado.edu> | |
2362 |
|
2373 | |||
2363 | * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug |
|
2374 | * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug | |
2364 | where failing to set sys.last_traceback would crash pdb.pm(). |
|
2375 | where failing to set sys.last_traceback would crash pdb.pm(). | |
2365 | Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug |
|
2376 | Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug | |
2366 | report. |
|
2377 | report. | |
2367 |
|
2378 | |||
2368 | 2003-03-25 Fernando Perez <fperez@colorado.edu> |
|
2379 | 2003-03-25 Fernando Perez <fperez@colorado.edu> | |
2369 |
|
2380 | |||
2370 | * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler |
|
2381 | * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler | |
2371 | before printing it (it had a lot of spurious blank lines at the |
|
2382 | before printing it (it had a lot of spurious blank lines at the | |
2372 | end). |
|
2383 | end). | |
2373 |
|
2384 | |||
2374 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr |
|
2385 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr | |
2375 | output would be sent 21 times! Obviously people don't use this |
|
2386 | output would be sent 21 times! Obviously people don't use this | |
2376 | too often, or I would have heard about it. |
|
2387 | too often, or I would have heard about it. | |
2377 |
|
2388 | |||
2378 | 2003-03-24 Fernando Perez <fperez@colorado.edu> |
|
2389 | 2003-03-24 Fernando Perez <fperez@colorado.edu> | |
2379 |
|
2390 | |||
2380 | * setup.py (scriptfiles): renamed the data_files parameter from |
|
2391 | * setup.py (scriptfiles): renamed the data_files parameter from | |
2381 | 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink |
|
2392 | 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink | |
2382 | for the patch. |
|
2393 | for the patch. | |
2383 |
|
2394 | |||
2384 | 2003-03-20 Fernando Perez <fperez@colorado.edu> |
|
2395 | 2003-03-20 Fernando Perez <fperez@colorado.edu> | |
2385 |
|
2396 | |||
2386 | * IPython/genutils.py (error): added error() and fatal() |
|
2397 | * IPython/genutils.py (error): added error() and fatal() | |
2387 | functions. |
|
2398 | functions. | |
2388 |
|
2399 | |||
2389 | 2003-03-18 *** Released version 0.2.15pre3 |
|
2400 | 2003-03-18 *** Released version 0.2.15pre3 | |
2390 |
|
2401 | |||
2391 | 2003-03-18 Fernando Perez <fperez@colorado.edu> |
|
2402 | 2003-03-18 Fernando Perez <fperez@colorado.edu> | |
2392 |
|
2403 | |||
2393 | * setupext/install_data_ext.py |
|
2404 | * setupext/install_data_ext.py | |
2394 | (install_data_ext.initialize_options): Class contributed by Jack |
|
2405 | (install_data_ext.initialize_options): Class contributed by Jack | |
2395 | Moffit for fixing the old distutils hack. He is sending this to |
|
2406 | Moffit for fixing the old distutils hack. He is sending this to | |
2396 | the distutils folks so in the future we may not need it as a |
|
2407 | the distutils folks so in the future we may not need it as a | |
2397 | private fix. |
|
2408 | private fix. | |
2398 |
|
2409 | |||
2399 | * MANIFEST.in: Extensive reorganization, based on Jack Moffit's |
|
2410 | * MANIFEST.in: Extensive reorganization, based on Jack Moffit's | |
2400 | changes for Debian packaging. See his patch for full details. |
|
2411 | changes for Debian packaging. See his patch for full details. | |
2401 | The old distutils hack of making the ipythonrc* files carry a |
|
2412 | The old distutils hack of making the ipythonrc* files carry a | |
2402 | bogus .py extension is gone, at last. Examples were moved to a |
|
2413 | bogus .py extension is gone, at last. Examples were moved to a | |
2403 | separate subdir under doc/, and the separate executable scripts |
|
2414 | separate subdir under doc/, and the separate executable scripts | |
2404 | now live in their own directory. Overall a great cleanup. The |
|
2415 | now live in their own directory. Overall a great cleanup. The | |
2405 | manual was updated to use the new files, and setup.py has been |
|
2416 | manual was updated to use the new files, and setup.py has been | |
2406 | fixed for this setup. |
|
2417 | fixed for this setup. | |
2407 |
|
2418 | |||
2408 | * IPython/PyColorize.py (Parser.usage): made non-executable and |
|
2419 | * IPython/PyColorize.py (Parser.usage): made non-executable and | |
2409 | created a pycolor wrapper around it to be included as a script. |
|
2420 | created a pycolor wrapper around it to be included as a script. | |
2410 |
|
2421 | |||
2411 | 2003-03-12 *** Released version 0.2.15pre2 |
|
2422 | 2003-03-12 *** Released version 0.2.15pre2 | |
2412 |
|
2423 | |||
2413 | 2003-03-12 Fernando Perez <fperez@colorado.edu> |
|
2424 | 2003-03-12 Fernando Perez <fperez@colorado.edu> | |
2414 |
|
2425 | |||
2415 | * IPython/ColorANSI.py (make_color_table): Finally fixed the |
|
2426 | * IPython/ColorANSI.py (make_color_table): Finally fixed the | |
2416 | long-standing problem with garbage characters in some terminals. |
|
2427 | long-standing problem with garbage characters in some terminals. | |
2417 | The issue was really that the \001 and \002 escapes must _only_ be |
|
2428 | The issue was really that the \001 and \002 escapes must _only_ be | |
2418 | passed to input prompts (which call readline), but _never_ to |
|
2429 | passed to input prompts (which call readline), but _never_ to | |
2419 | normal text to be printed on screen. I changed ColorANSI to have |
|
2430 | normal text to be printed on screen. I changed ColorANSI to have | |
2420 | two classes: TermColors and InputTermColors, each with the |
|
2431 | two classes: TermColors and InputTermColors, each with the | |
2421 | appropriate escapes for input prompts or normal text. The code in |
|
2432 | appropriate escapes for input prompts or normal text. The code in | |
2422 | Prompts.py got slightly more complicated, but this very old and |
|
2433 | Prompts.py got slightly more complicated, but this very old and | |
2423 | annoying bug is finally fixed. |
|
2434 | annoying bug is finally fixed. | |
2424 |
|
2435 | |||
2425 | All the credit for nailing down the real origin of this problem |
|
2436 | All the credit for nailing down the real origin of this problem | |
2426 | and the correct solution goes to Jack Moffit <jack-AT-xiph.org>. |
|
2437 | and the correct solution goes to Jack Moffit <jack-AT-xiph.org>. | |
2427 | *Many* thanks to him for spending quite a bit of effort on this. |
|
2438 | *Many* thanks to him for spending quite a bit of effort on this. | |
2428 |
|
2439 | |||
2429 | 2003-03-05 *** Released version 0.2.15pre1 |
|
2440 | 2003-03-05 *** Released version 0.2.15pre1 | |
2430 |
|
2441 | |||
2431 | 2003-03-03 Fernando Perez <fperez@colorado.edu> |
|
2442 | 2003-03-03 Fernando Perez <fperez@colorado.edu> | |
2432 |
|
2443 | |||
2433 | * IPython/FakeModule.py: Moved the former _FakeModule to a |
|
2444 | * IPython/FakeModule.py: Moved the former _FakeModule to a | |
2434 | separate file, because it's also needed by Magic (to fix a similar |
|
2445 | separate file, because it's also needed by Magic (to fix a similar | |
2435 | pickle-related issue in @run). |
|
2446 | pickle-related issue in @run). | |
2436 |
|
2447 | |||
2437 | 2003-03-02 Fernando Perez <fperez@colorado.edu> |
|
2448 | 2003-03-02 Fernando Perez <fperez@colorado.edu> | |
2438 |
|
2449 | |||
2439 | * IPython/Magic.py (Magic.magic_autocall): new magic to control |
|
2450 | * IPython/Magic.py (Magic.magic_autocall): new magic to control | |
2440 | the autocall option at runtime. |
|
2451 | the autocall option at runtime. | |
2441 | (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns |
|
2452 | (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns | |
2442 | across Magic.py to start separating Magic from InteractiveShell. |
|
2453 | across Magic.py to start separating Magic from InteractiveShell. | |
2443 | (Magic._ofind): Fixed to return proper namespace for dotted |
|
2454 | (Magic._ofind): Fixed to return proper namespace for dotted | |
2444 | names. Before, a dotted name would always return 'not currently |
|
2455 | names. Before, a dotted name would always return 'not currently | |
2445 | defined', because it would find the 'parent'. s.x would be found, |
|
2456 | defined', because it would find the 'parent'. s.x would be found, | |
2446 | but since 'x' isn't defined by itself, it would get confused. |
|
2457 | but since 'x' isn't defined by itself, it would get confused. | |
2447 | (Magic.magic_run): Fixed pickling problems reported by Ralf |
|
2458 | (Magic.magic_run): Fixed pickling problems reported by Ralf | |
2448 | Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to |
|
2459 | Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to | |
2449 | that I'd used when Mike Heeter reported similar issues at the |
|
2460 | that I'd used when Mike Heeter reported similar issues at the | |
2450 | top-level, but now for @run. It boils down to injecting the |
|
2461 | top-level, but now for @run. It boils down to injecting the | |
2451 | namespace where code is being executed with something that looks |
|
2462 | namespace where code is being executed with something that looks | |
2452 | enough like a module to fool pickle.dump(). Since a pickle stores |
|
2463 | enough like a module to fool pickle.dump(). Since a pickle stores | |
2453 | a named reference to the importing module, we need this for |
|
2464 | a named reference to the importing module, we need this for | |
2454 | pickles to save something sensible. |
|
2465 | pickles to save something sensible. | |
2455 |
|
2466 | |||
2456 | * IPython/ipmaker.py (make_IPython): added an autocall option. |
|
2467 | * IPython/ipmaker.py (make_IPython): added an autocall option. | |
2457 |
|
2468 | |||
2458 | * IPython/iplib.py (InteractiveShell._prefilter): reordered all of |
|
2469 | * IPython/iplib.py (InteractiveShell._prefilter): reordered all of | |
2459 | the auto-eval code. Now autocalling is an option, and the code is |
|
2470 | the auto-eval code. Now autocalling is an option, and the code is | |
2460 | also vastly safer. There is no more eval() involved at all. |
|
2471 | also vastly safer. There is no more eval() involved at all. | |
2461 |
|
2472 | |||
2462 | 2003-03-01 Fernando Perez <fperez@colorado.edu> |
|
2473 | 2003-03-01 Fernando Perez <fperez@colorado.edu> | |
2463 |
|
2474 | |||
2464 | * IPython/Magic.py (Magic._ofind): Changed interface to return a |
|
2475 | * IPython/Magic.py (Magic._ofind): Changed interface to return a | |
2465 | dict with named keys instead of a tuple. |
|
2476 | dict with named keys instead of a tuple. | |
2466 |
|
2477 | |||
2467 | * IPython: Started using CVS for IPython as of 0.2.15pre1. |
|
2478 | * IPython: Started using CVS for IPython as of 0.2.15pre1. | |
2468 |
|
2479 | |||
2469 | * setup.py (make_shortcut): Fixed message about directories |
|
2480 | * setup.py (make_shortcut): Fixed message about directories | |
2470 | created during Windows installation (the directories were ok, just |
|
2481 | created during Windows installation (the directories were ok, just | |
2471 | the printed message was misleading). Thanks to Chris Liechti |
|
2482 | the printed message was misleading). Thanks to Chris Liechti | |
2472 | <cliechti-AT-gmx.net> for the heads up. |
|
2483 | <cliechti-AT-gmx.net> for the heads up. | |
2473 |
|
2484 | |||
2474 | 2003-02-21 Fernando Perez <fperez@colorado.edu> |
|
2485 | 2003-02-21 Fernando Perez <fperez@colorado.edu> | |
2475 |
|
2486 | |||
2476 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching |
|
2487 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching | |
2477 | of ValueError exception when checking for auto-execution. This |
|
2488 | of ValueError exception when checking for auto-execution. This | |
2478 | one is raised by things like Numeric arrays arr.flat when the |
|
2489 | one is raised by things like Numeric arrays arr.flat when the | |
2479 | array is non-contiguous. |
|
2490 | array is non-contiguous. | |
2480 |
|
2491 | |||
2481 | 2003-01-31 Fernando Perez <fperez@colorado.edu> |
|
2492 | 2003-01-31 Fernando Perez <fperez@colorado.edu> | |
2482 |
|
2493 | |||
2483 | * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would |
|
2494 | * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would | |
2484 | not return any value at all (even though the command would get |
|
2495 | not return any value at all (even though the command would get | |
2485 | executed). |
|
2496 | executed). | |
2486 | (xsys): Flush stdout right after printing the command to ensure |
|
2497 | (xsys): Flush stdout right after printing the command to ensure | |
2487 | proper ordering of commands and command output in the total |
|
2498 | proper ordering of commands and command output in the total | |
2488 | output. |
|
2499 | output. | |
2489 | (SystemExec/xsys/bq): Switched the names of xsys/bq and |
|
2500 | (SystemExec/xsys/bq): Switched the names of xsys/bq and | |
2490 | system/getoutput as defaults. The old ones are kept for |
|
2501 | system/getoutput as defaults. The old ones are kept for | |
2491 | compatibility reasons, so no code which uses this library needs |
|
2502 | compatibility reasons, so no code which uses this library needs | |
2492 | changing. |
|
2503 | changing. | |
2493 |
|
2504 | |||
2494 | 2003-01-27 *** Released version 0.2.14 |
|
2505 | 2003-01-27 *** Released version 0.2.14 | |
2495 |
|
2506 | |||
2496 | 2003-01-25 Fernando Perez <fperez@colorado.edu> |
|
2507 | 2003-01-25 Fernando Perez <fperez@colorado.edu> | |
2497 |
|
2508 | |||
2498 | * IPython/Magic.py (Magic.magic_edit): Fixed problem where |
|
2509 | * IPython/Magic.py (Magic.magic_edit): Fixed problem where | |
2499 | functions defined in previous edit sessions could not be re-edited |
|
2510 | functions defined in previous edit sessions could not be re-edited | |
2500 | (because the temp files were immediately removed). Now temp files |
|
2511 | (because the temp files were immediately removed). Now temp files | |
2501 | are removed only at IPython's exit. |
|
2512 | are removed only at IPython's exit. | |
2502 | (Magic.magic_run): Improved @run to perform shell-like expansions |
|
2513 | (Magic.magic_run): Improved @run to perform shell-like expansions | |
2503 | on its arguments (~users and $VARS). With this, @run becomes more |
|
2514 | on its arguments (~users and $VARS). With this, @run becomes more | |
2504 | like a normal command-line. |
|
2515 | like a normal command-line. | |
2505 |
|
2516 | |||
2506 | * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small |
|
2517 | * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small | |
2507 | bugs related to embedding and cleaned up that code. A fairly |
|
2518 | bugs related to embedding and cleaned up that code. A fairly | |
2508 | important one was the impossibility to access the global namespace |
|
2519 | important one was the impossibility to access the global namespace | |
2509 | through the embedded IPython (only local variables were visible). |
|
2520 | through the embedded IPython (only local variables were visible). | |
2510 |
|
2521 | |||
2511 | 2003-01-14 Fernando Perez <fperez@colorado.edu> |
|
2522 | 2003-01-14 Fernando Perez <fperez@colorado.edu> | |
2512 |
|
2523 | |||
2513 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed |
|
2524 | * IPython/iplib.py (InteractiveShell._prefilter): Fixed | |
2514 | auto-calling to be a bit more conservative. Now it doesn't get |
|
2525 | auto-calling to be a bit more conservative. Now it doesn't get | |
2515 | triggered if any of '!=()<>' are in the rest of the input line, to |
|
2526 | triggered if any of '!=()<>' are in the rest of the input line, to | |
2516 | allow comparing callables. Thanks to Alex for the heads up. |
|
2527 | allow comparing callables. Thanks to Alex for the heads up. | |
2517 |
|
2528 | |||
2518 | 2003-01-07 Fernando Perez <fperez@colorado.edu> |
|
2529 | 2003-01-07 Fernando Perez <fperez@colorado.edu> | |
2519 |
|
2530 | |||
2520 | * IPython/genutils.py (page): fixed estimation of the number of |
|
2531 | * IPython/genutils.py (page): fixed estimation of the number of | |
2521 | lines in a string to be paged to simply count newlines. This |
|
2532 | lines in a string to be paged to simply count newlines. This | |
2522 | prevents over-guessing due to embedded escape sequences. A better |
|
2533 | prevents over-guessing due to embedded escape sequences. A better | |
2523 | long-term solution would involve stripping out the control chars |
|
2534 | long-term solution would involve stripping out the control chars | |
2524 | for the count, but it's potentially so expensive I just don't |
|
2535 | for the count, but it's potentially so expensive I just don't | |
2525 | think it's worth doing. |
|
2536 | think it's worth doing. | |
2526 |
|
2537 | |||
2527 | 2002-12-19 *** Released version 0.2.14pre50 |
|
2538 | 2002-12-19 *** Released version 0.2.14pre50 | |
2528 |
|
2539 | |||
2529 | 2002-12-19 Fernando Perez <fperez@colorado.edu> |
|
2540 | 2002-12-19 Fernando Perez <fperez@colorado.edu> | |
2530 |
|
2541 | |||
2531 | * tools/release (version): Changed release scripts to inform |
|
2542 | * tools/release (version): Changed release scripts to inform | |
2532 | Andrea and build a NEWS file with a list of recent changes. |
|
2543 | Andrea and build a NEWS file with a list of recent changes. | |
2533 |
|
2544 | |||
2534 | * IPython/ColorANSI.py (__all__): changed terminal detection |
|
2545 | * IPython/ColorANSI.py (__all__): changed terminal detection | |
2535 | code. Seems to work better for xterms without breaking |
|
2546 | code. Seems to work better for xterms without breaking | |
2536 | konsole. Will need more testing to determine if WinXP and Mac OSX |
|
2547 | konsole. Will need more testing to determine if WinXP and Mac OSX | |
2537 | also work ok. |
|
2548 | also work ok. | |
2538 |
|
2549 | |||
2539 | 2002-12-18 *** Released version 0.2.14pre49 |
|
2550 | 2002-12-18 *** Released version 0.2.14pre49 | |
2540 |
|
2551 | |||
2541 | 2002-12-18 Fernando Perez <fperez@colorado.edu> |
|
2552 | 2002-12-18 Fernando Perez <fperez@colorado.edu> | |
2542 |
|
2553 | |||
2543 | * Docs: added new info about Mac OSX, from Andrea. |
|
2554 | * Docs: added new info about Mac OSX, from Andrea. | |
2544 |
|
2555 | |||
2545 | * IPython/Gnuplot2.py (String): Added a String PlotItem class to |
|
2556 | * IPython/Gnuplot2.py (String): Added a String PlotItem class to | |
2546 | allow direct plotting of python strings whose format is the same |
|
2557 | allow direct plotting of python strings whose format is the same | |
2547 | of gnuplot data files. |
|
2558 | of gnuplot data files. | |
2548 |
|
2559 | |||
2549 | 2002-12-16 Fernando Perez <fperez@colorado.edu> |
|
2560 | 2002-12-16 Fernando Perez <fperez@colorado.edu> | |
2550 |
|
2561 | |||
2551 | * IPython/iplib.py (InteractiveShell.interact): fixed default (y) |
|
2562 | * IPython/iplib.py (InteractiveShell.interact): fixed default (y) | |
2552 | value of exit question to be acknowledged. |
|
2563 | value of exit question to be acknowledged. | |
2553 |
|
2564 | |||
2554 | 2002-12-03 Fernando Perez <fperez@colorado.edu> |
|
2565 | 2002-12-03 Fernando Perez <fperez@colorado.edu> | |
2555 |
|
2566 | |||
2556 | * IPython/ipmaker.py: removed generators, which had been added |
|
2567 | * IPython/ipmaker.py: removed generators, which had been added | |
2557 | by mistake in an earlier debugging run. This was causing trouble |
|
2568 | by mistake in an earlier debugging run. This was causing trouble | |
2558 | to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu> |
|
2569 | to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu> | |
2559 | for pointing this out. |
|
2570 | for pointing this out. | |
2560 |
|
2571 | |||
2561 | 2002-11-17 Fernando Perez <fperez@colorado.edu> |
|
2572 | 2002-11-17 Fernando Perez <fperez@colorado.edu> | |
2562 |
|
2573 | |||
2563 | * Manual: updated the Gnuplot section. |
|
2574 | * Manual: updated the Gnuplot section. | |
2564 |
|
2575 | |||
2565 | * IPython/GnuplotRuntime.py: refactored a lot all this code, with |
|
2576 | * IPython/GnuplotRuntime.py: refactored a lot all this code, with | |
2566 | a much better split of what goes in Runtime and what goes in |
|
2577 | a much better split of what goes in Runtime and what goes in | |
2567 | Interactive. |
|
2578 | Interactive. | |
2568 |
|
2579 | |||
2569 | * IPython/ipmaker.py: fixed bug where import_fail_info wasn't |
|
2580 | * IPython/ipmaker.py: fixed bug where import_fail_info wasn't | |
2570 | being imported from iplib. |
|
2581 | being imported from iplib. | |
2571 |
|
2582 | |||
2572 | * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc |
|
2583 | * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc | |
2573 | for command-passing. Now the global Gnuplot instance is called |
|
2584 | for command-passing. Now the global Gnuplot instance is called | |
2574 | 'gp' instead of 'g', which was really a far too fragile and |
|
2585 | 'gp' instead of 'g', which was really a far too fragile and | |
2575 | common name. |
|
2586 | common name. | |
2576 |
|
2587 | |||
2577 | * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken |
|
2588 | * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken | |
2578 | bounding boxes generated by Gnuplot for square plots. |
|
2589 | bounding boxes generated by Gnuplot for square plots. | |
2579 |
|
2590 | |||
2580 | * IPython/genutils.py (popkey): new function added. I should |
|
2591 | * IPython/genutils.py (popkey): new function added. I should | |
2581 | suggest this on c.l.py as a dict method, it seems useful. |
|
2592 | suggest this on c.l.py as a dict method, it seems useful. | |
2582 |
|
2593 | |||
2583 | * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot |
|
2594 | * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot | |
2584 | to transparently handle PostScript generation. MUCH better than |
|
2595 | to transparently handle PostScript generation. MUCH better than | |
2585 | the previous plot_eps/replot_eps (which I removed now). The code |
|
2596 | the previous plot_eps/replot_eps (which I removed now). The code | |
2586 | is also fairly clean and well documented now (including |
|
2597 | is also fairly clean and well documented now (including | |
2587 | docstrings). |
|
2598 | docstrings). | |
2588 |
|
2599 | |||
2589 | 2002-11-13 Fernando Perez <fperez@colorado.edu> |
|
2600 | 2002-11-13 Fernando Perez <fperez@colorado.edu> | |
2590 |
|
2601 | |||
2591 | * IPython/Magic.py (Magic.magic_edit): fixed docstring |
|
2602 | * IPython/Magic.py (Magic.magic_edit): fixed docstring | |
2592 | (inconsistent with options). |
|
2603 | (inconsistent with options). | |
2593 |
|
2604 | |||
2594 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been |
|
2605 | * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been | |
2595 | manually disabled, I don't know why. Fixed it. |
|
2606 | manually disabled, I don't know why. Fixed it. | |
2596 | (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly |
|
2607 | (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly | |
2597 | eps output. |
|
2608 | eps output. | |
2598 |
|
2609 | |||
2599 | 2002-11-12 Fernando Perez <fperez@colorado.edu> |
|
2610 | 2002-11-12 Fernando Perez <fperez@colorado.edu> | |
2600 |
|
2611 | |||
2601 | * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they |
|
2612 | * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they | |
2602 | don't propagate up to caller. Fixes crash reported by François |
|
2613 | don't propagate up to caller. Fixes crash reported by François | |
2603 | Pinard. |
|
2614 | Pinard. | |
2604 |
|
2615 | |||
2605 | 2002-11-09 Fernando Perez <fperez@colorado.edu> |
|
2616 | 2002-11-09 Fernando Perez <fperez@colorado.edu> | |
2606 |
|
2617 | |||
2607 | * IPython/ipmaker.py (make_IPython): fixed problem with writing |
|
2618 | * IPython/ipmaker.py (make_IPython): fixed problem with writing | |
2608 | history file for new users. |
|
2619 | history file for new users. | |
2609 | (make_IPython): fixed bug where initial install would leave the |
|
2620 | (make_IPython): fixed bug where initial install would leave the | |
2610 | user running in the .ipython dir. |
|
2621 | user running in the .ipython dir. | |
2611 | (make_IPython): fixed bug where config dir .ipython would be |
|
2622 | (make_IPython): fixed bug where config dir .ipython would be | |
2612 | created regardless of the given -ipythondir option. Thanks to Cory |
|
2623 | created regardless of the given -ipythondir option. Thanks to Cory | |
2613 | Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report. |
|
2624 | Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report. | |
2614 |
|
2625 | |||
2615 | * IPython/genutils.py (ask_yes_no): new function for asking yes/no |
|
2626 | * IPython/genutils.py (ask_yes_no): new function for asking yes/no | |
2616 | type confirmations. Will need to use it in all of IPython's code |
|
2627 | type confirmations. Will need to use it in all of IPython's code | |
2617 | consistently. |
|
2628 | consistently. | |
2618 |
|
2629 | |||
2619 | * IPython/CrashHandler.py (CrashHandler.__call__): changed the |
|
2630 | * IPython/CrashHandler.py (CrashHandler.__call__): changed the | |
2620 | context to print 31 lines instead of the default 5. This will make |
|
2631 | context to print 31 lines instead of the default 5. This will make | |
2621 | the crash reports extremely detailed in case the problem is in |
|
2632 | the crash reports extremely detailed in case the problem is in | |
2622 | libraries I don't have access to. |
|
2633 | libraries I don't have access to. | |
2623 |
|
2634 | |||
2624 | * IPython/iplib.py (InteractiveShell.interact): changed the 'last |
|
2635 | * IPython/iplib.py (InteractiveShell.interact): changed the 'last | |
2625 | line of defense' code to still crash, but giving users fair |
|
2636 | line of defense' code to still crash, but giving users fair | |
2626 | warning. I don't want internal errors to go unreported: if there's |
|
2637 | warning. I don't want internal errors to go unreported: if there's | |
2627 | an internal problem, IPython should crash and generate a full |
|
2638 | an internal problem, IPython should crash and generate a full | |
2628 | report. |
|
2639 | report. | |
2629 |
|
2640 | |||
2630 | 2002-11-08 Fernando Perez <fperez@colorado.edu> |
|
2641 | 2002-11-08 Fernando Perez <fperez@colorado.edu> | |
2631 |
|
2642 | |||
2632 | * IPython/iplib.py (InteractiveShell.interact): added code to trap |
|
2643 | * IPython/iplib.py (InteractiveShell.interact): added code to trap | |
2633 | otherwise uncaught exceptions which can appear if people set |
|
2644 | otherwise uncaught exceptions which can appear if people set | |
2634 | sys.stdout to something badly broken. Thanks to a crash report |
|
2645 | sys.stdout to something badly broken. Thanks to a crash report | |
2635 | from henni-AT-mail.brainbot.com. |
|
2646 | from henni-AT-mail.brainbot.com. | |
2636 |
|
2647 | |||
2637 | 2002-11-04 Fernando Perez <fperez@colorado.edu> |
|
2648 | 2002-11-04 Fernando Perez <fperez@colorado.edu> | |
2638 |
|
2649 | |||
2639 | * IPython/iplib.py (InteractiveShell.interact): added |
|
2650 | * IPython/iplib.py (InteractiveShell.interact): added | |
2640 | __IPYTHON__active to the builtins. It's a flag which goes on when |
|
2651 | __IPYTHON__active to the builtins. It's a flag which goes on when | |
2641 | the interaction starts and goes off again when it stops. This |
|
2652 | the interaction starts and goes off again when it stops. This | |
2642 | allows embedding code to detect being inside IPython. Before this |
|
2653 | allows embedding code to detect being inside IPython. Before this | |
2643 | was done via __IPYTHON__, but that only shows that an IPython |
|
2654 | was done via __IPYTHON__, but that only shows that an IPython | |
2644 | instance has been created. |
|
2655 | instance has been created. | |
2645 |
|
2656 | |||
2646 | * IPython/Magic.py (Magic.magic_env): I realized that in a |
|
2657 | * IPython/Magic.py (Magic.magic_env): I realized that in a | |
2647 | UserDict, instance.data holds the data as a normal dict. So I |
|
2658 | UserDict, instance.data holds the data as a normal dict. So I | |
2648 | modified @env to return os.environ.data instead of rebuilding a |
|
2659 | modified @env to return os.environ.data instead of rebuilding a | |
2649 | dict by hand. |
|
2660 | dict by hand. | |
2650 |
|
2661 | |||
2651 | 2002-11-02 Fernando Perez <fperez@colorado.edu> |
|
2662 | 2002-11-02 Fernando Perez <fperez@colorado.edu> | |
2652 |
|
2663 | |||
2653 | * IPython/genutils.py (warn): changed so that level 1 prints no |
|
2664 | * IPython/genutils.py (warn): changed so that level 1 prints no | |
2654 | header. Level 2 is now the default (with 'WARNING' header, as |
|
2665 | header. Level 2 is now the default (with 'WARNING' header, as | |
2655 | before). I think I tracked all places where changes were needed in |
|
2666 | before). I think I tracked all places where changes were needed in | |
2656 | IPython, but outside code using the old level numbering may have |
|
2667 | IPython, but outside code using the old level numbering may have | |
2657 | broken. |
|
2668 | broken. | |
2658 |
|
2669 | |||
2659 | * IPython/iplib.py (InteractiveShell.runcode): added this to |
|
2670 | * IPython/iplib.py (InteractiveShell.runcode): added this to | |
2660 | handle the tracebacks in SystemExit traps correctly. The previous |
|
2671 | handle the tracebacks in SystemExit traps correctly. The previous | |
2661 | code (through interact) was printing more of the stack than |
|
2672 | code (through interact) was printing more of the stack than | |
2662 | necessary, showing IPython internal code to the user. |
|
2673 | necessary, showing IPython internal code to the user. | |
2663 |
|
2674 | |||
2664 | * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by |
|
2675 | * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by | |
2665 | default. Now that the default at the confirmation prompt is yes, |
|
2676 | default. Now that the default at the confirmation prompt is yes, | |
2666 | it's not so intrusive. François' argument that ipython sessions |
|
2677 | it's not so intrusive. François' argument that ipython sessions | |
2667 | tend to be complex enough not to lose them from an accidental C-d, |
|
2678 | tend to be complex enough not to lose them from an accidental C-d, | |
2668 | is a valid one. |
|
2679 | is a valid one. | |
2669 |
|
2680 | |||
2670 | * IPython/iplib.py (InteractiveShell.interact): added a |
|
2681 | * IPython/iplib.py (InteractiveShell.interact): added a | |
2671 | showtraceback() call to the SystemExit trap, and modified the exit |
|
2682 | showtraceback() call to the SystemExit trap, and modified the exit | |
2672 | confirmation to have yes as the default. |
|
2683 | confirmation to have yes as the default. | |
2673 |
|
2684 | |||
2674 | * IPython/UserConfig/ipythonrc.py: removed 'session' option from |
|
2685 | * IPython/UserConfig/ipythonrc.py: removed 'session' option from | |
2675 | this file. It's been gone from the code for a long time, this was |
|
2686 | this file. It's been gone from the code for a long time, this was | |
2676 | simply leftover junk. |
|
2687 | simply leftover junk. | |
2677 |
|
2688 | |||
2678 | 2002-11-01 Fernando Perez <fperez@colorado.edu> |
|
2689 | 2002-11-01 Fernando Perez <fperez@colorado.edu> | |
2679 |
|
2690 | |||
2680 | * IPython/UserConfig/ipythonrc.py: new confirm_exit option |
|
2691 | * IPython/UserConfig/ipythonrc.py: new confirm_exit option | |
2681 | added. If set, IPython now traps EOF and asks for |
|
2692 | added. If set, IPython now traps EOF and asks for | |
2682 | confirmation. After a request by François Pinard. |
|
2693 | confirmation. After a request by François Pinard. | |
2683 |
|
2694 | |||
2684 | * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead |
|
2695 | * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead | |
2685 | of @abort, and with a new (better) mechanism for handling the |
|
2696 | of @abort, and with a new (better) mechanism for handling the | |
2686 | exceptions. |
|
2697 | exceptions. | |
2687 |
|
2698 | |||
2688 | 2002-10-27 Fernando Perez <fperez@colorado.edu> |
|
2699 | 2002-10-27 Fernando Perez <fperez@colorado.edu> | |
2689 |
|
2700 | |||
2690 | * IPython/usage.py (__doc__): updated the --help information and |
|
2701 | * IPython/usage.py (__doc__): updated the --help information and | |
2691 | the ipythonrc file to indicate that -log generates |
|
2702 | the ipythonrc file to indicate that -log generates | |
2692 | ./ipython.log. Also fixed the corresponding info in @logstart. |
|
2703 | ./ipython.log. Also fixed the corresponding info in @logstart. | |
2693 | This and several other fixes in the manuals thanks to reports by |
|
2704 | This and several other fixes in the manuals thanks to reports by | |
2694 | François Pinard <pinard-AT-iro.umontreal.ca>. |
|
2705 | François Pinard <pinard-AT-iro.umontreal.ca>. | |
2695 |
|
2706 | |||
2696 | * IPython/Logger.py (Logger.switch_log): Fixed error message to |
|
2707 | * IPython/Logger.py (Logger.switch_log): Fixed error message to | |
2697 | refer to @logstart (instead of @log, which doesn't exist). |
|
2708 | refer to @logstart (instead of @log, which doesn't exist). | |
2698 |
|
2709 | |||
2699 | * IPython/iplib.py (InteractiveShell._prefilter): fixed |
|
2710 | * IPython/iplib.py (InteractiveShell._prefilter): fixed | |
2700 | AttributeError crash. Thanks to Christopher Armstrong |
|
2711 | AttributeError crash. Thanks to Christopher Armstrong | |
2701 | <radix-AT-twistedmatrix.com> for the report/fix. This bug had been |
|
2712 | <radix-AT-twistedmatrix.com> for the report/fix. This bug had been | |
2702 | introduced recently (in 0.2.14pre37) with the fix to the eval |
|
2713 | introduced recently (in 0.2.14pre37) with the fix to the eval | |
2703 | problem mentioned below. |
|
2714 | problem mentioned below. | |
2704 |
|
2715 | |||
2705 | 2002-10-17 Fernando Perez <fperez@colorado.edu> |
|
2716 | 2002-10-17 Fernando Perez <fperez@colorado.edu> | |
2706 |
|
2717 | |||
2707 | * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows |
|
2718 | * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows | |
2708 | installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>. |
|
2719 | installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>. | |
2709 |
|
2720 | |||
2710 | * IPython/iplib.py (InteractiveShell._prefilter): Many changes to |
|
2721 | * IPython/iplib.py (InteractiveShell._prefilter): Many changes to | |
2711 | this function to fix a problem reported by Alex Schmolck. He saw |
|
2722 | this function to fix a problem reported by Alex Schmolck. He saw | |
2712 | it with list comprehensions and generators, which were getting |
|
2723 | it with list comprehensions and generators, which were getting | |
2713 | called twice. The real problem was an 'eval' call in testing for |
|
2724 | called twice. The real problem was an 'eval' call in testing for | |
2714 | automagic which was evaluating the input line silently. |
|
2725 | automagic which was evaluating the input line silently. | |
2715 |
|
2726 | |||
2716 | This is a potentially very nasty bug, if the input has side |
|
2727 | This is a potentially very nasty bug, if the input has side | |
2717 | effects which must not be repeated. The code is much cleaner now, |
|
2728 | effects which must not be repeated. The code is much cleaner now, | |
2718 | without any blanket 'except' left and with a regexp test for |
|
2729 | without any blanket 'except' left and with a regexp test for | |
2719 | actual function names. |
|
2730 | actual function names. | |
2720 |
|
2731 | |||
2721 | But an eval remains, which I'm not fully comfortable with. I just |
|
2732 | But an eval remains, which I'm not fully comfortable with. I just | |
2722 | don't know how to find out if an expression could be a callable in |
|
2733 | don't know how to find out if an expression could be a callable in | |
2723 | the user's namespace without doing an eval on the string. However |
|
2734 | the user's namespace without doing an eval on the string. However | |
2724 | that string is now much more strictly checked so that no code |
|
2735 | that string is now much more strictly checked so that no code | |
2725 | slips by, so the eval should only happen for things that can |
|
2736 | slips by, so the eval should only happen for things that can | |
2726 | really be only function/method names. |
|
2737 | really be only function/method names. | |
2727 |
|
2738 | |||
2728 | 2002-10-15 Fernando Perez <fperez@colorado.edu> |
|
2739 | 2002-10-15 Fernando Perez <fperez@colorado.edu> | |
2729 |
|
2740 | |||
2730 | * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac |
|
2741 | * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac | |
2731 | OSX information to main manual, removed README_Mac_OSX file from |
|
2742 | OSX information to main manual, removed README_Mac_OSX file from | |
2732 | distribution. Also updated credits for recent additions. |
|
2743 | distribution. Also updated credits for recent additions. | |
2733 |
|
2744 | |||
2734 | 2002-10-10 Fernando Perez <fperez@colorado.edu> |
|
2745 | 2002-10-10 Fernando Perez <fperez@colorado.edu> | |
2735 |
|
2746 | |||
2736 | * README_Mac_OSX: Added a README for Mac OSX users for fixing |
|
2747 | * README_Mac_OSX: Added a README for Mac OSX users for fixing | |
2737 | terminal-related issues. Many thanks to Andrea Riciputi |
|
2748 | terminal-related issues. Many thanks to Andrea Riciputi | |
2738 | <andrea.riciputi-AT-libero.it> for writing it. |
|
2749 | <andrea.riciputi-AT-libero.it> for writing it. | |
2739 |
|
2750 | |||
2740 | * IPython/UserConfig/ipythonrc.py: Fixes to various small issues, |
|
2751 | * IPython/UserConfig/ipythonrc.py: Fixes to various small issues, | |
2741 | thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>. |
|
2752 | thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>. | |
2742 |
|
2753 | |||
2743 | * setup.py (make_shortcut): Fixes for Windows installation. Thanks |
|
2754 | * setup.py (make_shortcut): Fixes for Windows installation. Thanks | |
2744 | to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad |
|
2755 | to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad | |
2745 | <syver-en-AT-online.no> who both submitted patches for this problem. |
|
2756 | <syver-en-AT-online.no> who both submitted patches for this problem. | |
2746 |
|
2757 | |||
2747 | * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for |
|
2758 | * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for | |
2748 | global embedding to make sure that things don't overwrite user |
|
2759 | global embedding to make sure that things don't overwrite user | |
2749 | globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com> |
|
2760 | globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com> | |
2750 |
|
2761 | |||
2751 | * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6 |
|
2762 | * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6 | |
2752 | compatibility. Thanks to Hayden Callow |
|
2763 | compatibility. Thanks to Hayden Callow | |
2753 | <h.callow-AT-elec.canterbury.ac.nz> |
|
2764 | <h.callow-AT-elec.canterbury.ac.nz> | |
2754 |
|
2765 | |||
2755 | 2002-10-04 Fernando Perez <fperez@colorado.edu> |
|
2766 | 2002-10-04 Fernando Perez <fperez@colorado.edu> | |
2756 |
|
2767 | |||
2757 | * IPython/Gnuplot2.py (PlotItem): Added 'index' option for |
|
2768 | * IPython/Gnuplot2.py (PlotItem): Added 'index' option for | |
2758 | Gnuplot.File objects. |
|
2769 | Gnuplot.File objects. | |
2759 |
|
2770 | |||
2760 | 2002-07-23 Fernando Perez <fperez@colorado.edu> |
|
2771 | 2002-07-23 Fernando Perez <fperez@colorado.edu> | |
2761 |
|
2772 | |||
2762 | * IPython/genutils.py (timing): Added timings() and timing() for |
|
2773 | * IPython/genutils.py (timing): Added timings() and timing() for | |
2763 | quick access to the most commonly needed data, the execution |
|
2774 | quick access to the most commonly needed data, the execution | |
2764 | times. Old timing() renamed to timings_out(). |
|
2775 | times. Old timing() renamed to timings_out(). | |
2765 |
|
2776 | |||
2766 | 2002-07-18 Fernando Perez <fperez@colorado.edu> |
|
2777 | 2002-07-18 Fernando Perez <fperez@colorado.edu> | |
2767 |
|
2778 | |||
2768 | * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed |
|
2779 | * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed | |
2769 | bug with nested instances disrupting the parent's tab completion. |
|
2780 | bug with nested instances disrupting the parent's tab completion. | |
2770 |
|
2781 | |||
2771 | * IPython/iplib.py (all_completions): Added Alex Schmolck's |
|
2782 | * IPython/iplib.py (all_completions): Added Alex Schmolck's | |
2772 | all_completions code to begin the emacs integration. |
|
2783 | all_completions code to begin the emacs integration. | |
2773 |
|
2784 | |||
2774 | * IPython/Gnuplot2.py (zip_items): Added optional 'titles' |
|
2785 | * IPython/Gnuplot2.py (zip_items): Added optional 'titles' | |
2775 | argument to allow titling individual arrays when plotting. |
|
2786 | argument to allow titling individual arrays when plotting. | |
2776 |
|
2787 | |||
2777 | 2002-07-15 Fernando Perez <fperez@colorado.edu> |
|
2788 | 2002-07-15 Fernando Perez <fperez@colorado.edu> | |
2778 |
|
2789 | |||
2779 | * setup.py (make_shortcut): changed to retrieve the value of |
|
2790 | * setup.py (make_shortcut): changed to retrieve the value of | |
2780 | 'Program Files' directory from the registry (this value changes in |
|
2791 | 'Program Files' directory from the registry (this value changes in | |
2781 | non-english versions of Windows). Thanks to Thomas Fanslau |
|
2792 | non-english versions of Windows). Thanks to Thomas Fanslau | |
2782 | <tfanslau-AT-gmx.de> for the report. |
|
2793 | <tfanslau-AT-gmx.de> for the report. | |
2783 |
|
2794 | |||
2784 | 2002-07-10 Fernando Perez <fperez@colorado.edu> |
|
2795 | 2002-07-10 Fernando Perez <fperez@colorado.edu> | |
2785 |
|
2796 | |||
2786 | * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for |
|
2797 | * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for | |
2787 | a bug in pdb, which crashes if a line with only whitespace is |
|
2798 | a bug in pdb, which crashes if a line with only whitespace is | |
2788 | entered. Bug report submitted to sourceforge. |
|
2799 | entered. Bug report submitted to sourceforge. | |
2789 |
|
2800 | |||
2790 | 2002-07-09 Fernando Perez <fperez@colorado.edu> |
|
2801 | 2002-07-09 Fernando Perez <fperez@colorado.edu> | |
2791 |
|
2802 | |||
2792 | * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when |
|
2803 | * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when | |
2793 | reporting exceptions (it's a bug in inspect.py, I just set a |
|
2804 | reporting exceptions (it's a bug in inspect.py, I just set a | |
2794 | workaround). |
|
2805 | workaround). | |
2795 |
|
2806 | |||
2796 | 2002-07-08 Fernando Perez <fperez@colorado.edu> |
|
2807 | 2002-07-08 Fernando Perez <fperez@colorado.edu> | |
2797 |
|
2808 | |||
2798 | * IPython/iplib.py (InteractiveShell.__init__): fixed reference to |
|
2809 | * IPython/iplib.py (InteractiveShell.__init__): fixed reference to | |
2799 | __IPYTHON__ in __builtins__ to show up in user_ns. |
|
2810 | __IPYTHON__ in __builtins__ to show up in user_ns. | |
2800 |
|
2811 | |||
2801 | 2002-07-03 Fernando Perez <fperez@colorado.edu> |
|
2812 | 2002-07-03 Fernando Perez <fperez@colorado.edu> | |
2802 |
|
2813 | |||
2803 | * IPython/GnuplotInteractive.py (magic_gp_set_default): changed |
|
2814 | * IPython/GnuplotInteractive.py (magic_gp_set_default): changed | |
2804 | name from @gp_set_instance to @gp_set_default. |
|
2815 | name from @gp_set_instance to @gp_set_default. | |
2805 |
|
2816 | |||
2806 | * IPython/ipmaker.py (make_IPython): default editor value set to |
|
2817 | * IPython/ipmaker.py (make_IPython): default editor value set to | |
2807 | '0' (a string), to match the rc file. Otherwise will crash when |
|
2818 | '0' (a string), to match the rc file. Otherwise will crash when | |
2808 | .strip() is called on it. |
|
2819 | .strip() is called on it. | |
2809 |
|
2820 | |||
2810 |
|
2821 | |||
2811 | 2002-06-28 Fernando Perez <fperez@colorado.edu> |
|
2822 | 2002-06-28 Fernando Perez <fperez@colorado.edu> | |
2812 |
|
2823 | |||
2813 | * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing |
|
2824 | * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing | |
2814 | of files in current directory when a file is executed via |
|
2825 | of files in current directory when a file is executed via | |
2815 | @run. Patch also by RA <ralf_ahlbrink-AT-web.de>. |
|
2826 | @run. Patch also by RA <ralf_ahlbrink-AT-web.de>. | |
2816 |
|
2827 | |||
2817 | * setup.py (manfiles): fix for rpm builds, submitted by RA |
|
2828 | * setup.py (manfiles): fix for rpm builds, submitted by RA | |
2818 | <ralf_ahlbrink-AT-web.de>. Now we have RPMs! |
|
2829 | <ralf_ahlbrink-AT-web.de>. Now we have RPMs! | |
2819 |
|
2830 | |||
2820 | * IPython/ipmaker.py (make_IPython): fixed lookup of default |
|
2831 | * IPython/ipmaker.py (make_IPython): fixed lookup of default | |
2821 | editor when set to '0'. Problem was, '0' evaluates to True (it's a |
|
2832 | editor when set to '0'. Problem was, '0' evaluates to True (it's a | |
2822 | string!). A. Schmolck caught this one. |
|
2833 | string!). A. Schmolck caught this one. | |
2823 |
|
2834 | |||
2824 | 2002-06-27 Fernando Perez <fperez@colorado.edu> |
|
2835 | 2002-06-27 Fernando Perez <fperez@colorado.edu> | |
2825 |
|
2836 | |||
2826 | * IPython/ipmaker.py (make_IPython): fixed bug when running user |
|
2837 | * IPython/ipmaker.py (make_IPython): fixed bug when running user | |
2827 | defined files at the cmd line. __name__ wasn't being set to |
|
2838 | defined files at the cmd line. __name__ wasn't being set to | |
2828 | __main__. |
|
2839 | __main__. | |
2829 |
|
2840 | |||
2830 | * IPython/Gnuplot2.py (zip_items): improved it so it can plot also |
|
2841 | * IPython/Gnuplot2.py (zip_items): improved it so it can plot also | |
2831 | regular lists and tuples besides Numeric arrays. |
|
2842 | regular lists and tuples besides Numeric arrays. | |
2832 |
|
2843 | |||
2833 | * IPython/Prompts.py (CachedOutput.__call__): Added output |
|
2844 | * IPython/Prompts.py (CachedOutput.__call__): Added output | |
2834 | supression for input ending with ';'. Similar to Mathematica and |
|
2845 | supression for input ending with ';'. Similar to Mathematica and | |
2835 | Matlab. The _* vars and Out[] list are still updated, just like |
|
2846 | Matlab. The _* vars and Out[] list are still updated, just like | |
2836 | Mathematica behaves. |
|
2847 | Mathematica behaves. | |
2837 |
|
2848 | |||
2838 | 2002-06-25 Fernando Perez <fperez@colorado.edu> |
|
2849 | 2002-06-25 Fernando Perez <fperez@colorado.edu> | |
2839 |
|
2850 | |||
2840 | * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of |
|
2851 | * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of | |
2841 | .ini extensions for profiels under Windows. |
|
2852 | .ini extensions for profiels under Windows. | |
2842 |
|
2853 | |||
2843 | * IPython/OInspect.py (Inspector.pinfo): improved alignment of |
|
2854 | * IPython/OInspect.py (Inspector.pinfo): improved alignment of | |
2844 | string form. Fix contributed by Alexander Schmolck |
|
2855 | string form. Fix contributed by Alexander Schmolck | |
2845 | <a.schmolck-AT-gmx.net> |
|
2856 | <a.schmolck-AT-gmx.net> | |
2846 |
|
2857 | |||
2847 | * IPython/GnuplotRuntime.py (gp_new): new function. Returns a |
|
2858 | * IPython/GnuplotRuntime.py (gp_new): new function. Returns a | |
2848 | pre-configured Gnuplot instance. |
|
2859 | pre-configured Gnuplot instance. | |
2849 |
|
2860 | |||
2850 | 2002-06-21 Fernando Perez <fperez@colorado.edu> |
|
2861 | 2002-06-21 Fernando Perez <fperez@colorado.edu> | |
2851 |
|
2862 | |||
2852 | * IPython/numutils.py (exp_safe): new function, works around the |
|
2863 | * IPython/numutils.py (exp_safe): new function, works around the | |
2853 | underflow problems in Numeric. |
|
2864 | underflow problems in Numeric. | |
2854 | (log2): New fn. Safe log in base 2: returns exact integer answer |
|
2865 | (log2): New fn. Safe log in base 2: returns exact integer answer | |
2855 | for exact integer powers of 2. |
|
2866 | for exact integer powers of 2. | |
2856 |
|
2867 | |||
2857 | * IPython/Magic.py (get_py_filename): fixed it not expanding '~' |
|
2868 | * IPython/Magic.py (get_py_filename): fixed it not expanding '~' | |
2858 | properly. |
|
2869 | properly. | |
2859 |
|
2870 | |||
2860 | 2002-06-20 Fernando Perez <fperez@colorado.edu> |
|
2871 | 2002-06-20 Fernando Perez <fperez@colorado.edu> | |
2861 |
|
2872 | |||
2862 | * IPython/genutils.py (timing): new function like |
|
2873 | * IPython/genutils.py (timing): new function like | |
2863 | Mathematica's. Similar to time_test, but returns more info. |
|
2874 | Mathematica's. Similar to time_test, but returns more info. | |
2864 |
|
2875 | |||
2865 | 2002-06-18 Fernando Perez <fperez@colorado.edu> |
|
2876 | 2002-06-18 Fernando Perez <fperez@colorado.edu> | |
2866 |
|
2877 | |||
2867 | * IPython/Magic.py (Magic.magic_save): modified @save and @r |
|
2878 | * IPython/Magic.py (Magic.magic_save): modified @save and @r | |
2868 | according to Mike Heeter's suggestions. |
|
2879 | according to Mike Heeter's suggestions. | |
2869 |
|
2880 | |||
2870 | 2002-06-16 Fernando Perez <fperez@colorado.edu> |
|
2881 | 2002-06-16 Fernando Perez <fperez@colorado.edu> | |
2871 |
|
2882 | |||
2872 | * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot |
|
2883 | * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot | |
2873 | system. GnuplotMagic is gone as a user-directory option. New files |
|
2884 | system. GnuplotMagic is gone as a user-directory option. New files | |
2874 | make it easier to use all the gnuplot stuff both from external |
|
2885 | make it easier to use all the gnuplot stuff both from external | |
2875 | programs as well as from IPython. Had to rewrite part of |
|
2886 | programs as well as from IPython. Had to rewrite part of | |
2876 | hardcopy() b/c of a strange bug: often the ps files simply don't |
|
2887 | hardcopy() b/c of a strange bug: often the ps files simply don't | |
2877 | get created, and require a repeat of the command (often several |
|
2888 | get created, and require a repeat of the command (often several | |
2878 | times). |
|
2889 | times). | |
2879 |
|
2890 | |||
2880 | * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to |
|
2891 | * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to | |
2881 | resolve output channel at call time, so that if sys.stderr has |
|
2892 | resolve output channel at call time, so that if sys.stderr has | |
2882 | been redirected by user this gets honored. |
|
2893 | been redirected by user this gets honored. | |
2883 |
|
2894 | |||
2884 | 2002-06-13 Fernando Perez <fperez@colorado.edu> |
|
2895 | 2002-06-13 Fernando Perez <fperez@colorado.edu> | |
2885 |
|
2896 | |||
2886 | * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to |
|
2897 | * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to | |
2887 | IPShell. Kept a copy with the old names to avoid breaking people's |
|
2898 | IPShell. Kept a copy with the old names to avoid breaking people's | |
2888 | embedded code. |
|
2899 | embedded code. | |
2889 |
|
2900 | |||
2890 | * IPython/ipython: simplified it to the bare minimum after |
|
2901 | * IPython/ipython: simplified it to the bare minimum after | |
2891 | Holger's suggestions. Added info about how to use it in |
|
2902 | Holger's suggestions. Added info about how to use it in | |
2892 | PYTHONSTARTUP. |
|
2903 | PYTHONSTARTUP. | |
2893 |
|
2904 | |||
2894 | * IPython/Shell.py (IPythonShell): changed the options passing |
|
2905 | * IPython/Shell.py (IPythonShell): changed the options passing | |
2895 | from a string with funky %s replacements to a straight list. Maybe |
|
2906 | from a string with funky %s replacements to a straight list. Maybe | |
2896 | a bit more typing, but it follows sys.argv conventions, so there's |
|
2907 | a bit more typing, but it follows sys.argv conventions, so there's | |
2897 | less special-casing to remember. |
|
2908 | less special-casing to remember. | |
2898 |
|
2909 | |||
2899 | 2002-06-12 Fernando Perez <fperez@colorado.edu> |
|
2910 | 2002-06-12 Fernando Perez <fperez@colorado.edu> | |
2900 |
|
2911 | |||
2901 | * IPython/Magic.py (Magic.magic_r): new magic auto-repeat |
|
2912 | * IPython/Magic.py (Magic.magic_r): new magic auto-repeat | |
2902 | command. Thanks to a suggestion by Mike Heeter. |
|
2913 | command. Thanks to a suggestion by Mike Heeter. | |
2903 | (Magic.magic_pfile): added behavior to look at filenames if given |
|
2914 | (Magic.magic_pfile): added behavior to look at filenames if given | |
2904 | arg is not a defined object. |
|
2915 | arg is not a defined object. | |
2905 | (Magic.magic_save): New @save function to save code snippets. Also |
|
2916 | (Magic.magic_save): New @save function to save code snippets. Also | |
2906 | a Mike Heeter idea. |
|
2917 | a Mike Heeter idea. | |
2907 |
|
2918 | |||
2908 | * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to |
|
2919 | * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to | |
2909 | plot() and replot(). Much more convenient now, especially for |
|
2920 | plot() and replot(). Much more convenient now, especially for | |
2910 | interactive use. |
|
2921 | interactive use. | |
2911 |
|
2922 | |||
2912 | * IPython/Magic.py (Magic.magic_run): Added .py automatically to |
|
2923 | * IPython/Magic.py (Magic.magic_run): Added .py automatically to | |
2913 | filenames. |
|
2924 | filenames. | |
2914 |
|
2925 | |||
2915 | 2002-06-02 Fernando Perez <fperez@colorado.edu> |
|
2926 | 2002-06-02 Fernando Perez <fperez@colorado.edu> | |
2916 |
|
2927 | |||
2917 | * IPython/Struct.py (Struct.__init__): modified to admit |
|
2928 | * IPython/Struct.py (Struct.__init__): modified to admit | |
2918 | initialization via another struct. |
|
2929 | initialization via another struct. | |
2919 |
|
2930 | |||
2920 | * IPython/genutils.py (SystemExec.__init__): New stateful |
|
2931 | * IPython/genutils.py (SystemExec.__init__): New stateful | |
2921 | interface to xsys and bq. Useful for writing system scripts. |
|
2932 | interface to xsys and bq. Useful for writing system scripts. | |
2922 |
|
2933 | |||
2923 | 2002-05-30 Fernando Perez <fperez@colorado.edu> |
|
2934 | 2002-05-30 Fernando Perez <fperez@colorado.edu> | |
2924 |
|
2935 | |||
2925 | * MANIFEST.in: Changed docfile selection to exclude all the lyx |
|
2936 | * MANIFEST.in: Changed docfile selection to exclude all the lyx | |
2926 | documents. This will make the user download smaller (it's getting |
|
2937 | documents. This will make the user download smaller (it's getting | |
2927 | too big). |
|
2938 | too big). | |
2928 |
|
2939 | |||
2929 | 2002-05-29 Fernando Perez <fperez@colorado.edu> |
|
2940 | 2002-05-29 Fernando Perez <fperez@colorado.edu> | |
2930 |
|
2941 | |||
2931 | * IPython/iplib.py (_FakeModule.__init__): New class introduced to |
|
2942 | * IPython/iplib.py (_FakeModule.__init__): New class introduced to | |
2932 | fix problems with shelve and pickle. Seems to work, but I don't |
|
2943 | fix problems with shelve and pickle. Seems to work, but I don't | |
2933 | know if corner cases break it. Thanks to Mike Heeter |
|
2944 | know if corner cases break it. Thanks to Mike Heeter | |
2934 | <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases. |
|
2945 | <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases. | |
2935 |
|
2946 | |||
2936 | 2002-05-24 Fernando Perez <fperez@colorado.edu> |
|
2947 | 2002-05-24 Fernando Perez <fperez@colorado.edu> | |
2937 |
|
2948 | |||
2938 | * IPython/Magic.py (Macro.__init__): fixed magics embedded in |
|
2949 | * IPython/Magic.py (Macro.__init__): fixed magics embedded in | |
2939 | macros having broken. |
|
2950 | macros having broken. | |
2940 |
|
2951 | |||
2941 | 2002-05-21 Fernando Perez <fperez@colorado.edu> |
|
2952 | 2002-05-21 Fernando Perez <fperez@colorado.edu> | |
2942 |
|
2953 | |||
2943 | * IPython/Magic.py (Magic.magic_logstart): fixed recently |
|
2954 | * IPython/Magic.py (Magic.magic_logstart): fixed recently | |
2944 | introduced logging bug: all history before logging started was |
|
2955 | introduced logging bug: all history before logging started was | |
2945 | being written one character per line! This came from the redesign |
|
2956 | being written one character per line! This came from the redesign | |
2946 | of the input history as a special list which slices to strings, |
|
2957 | of the input history as a special list which slices to strings, | |
2947 | not to lists. |
|
2958 | not to lists. | |
2948 |
|
2959 | |||
2949 | 2002-05-20 Fernando Perez <fperez@colorado.edu> |
|
2960 | 2002-05-20 Fernando Perez <fperez@colorado.edu> | |
2950 |
|
2961 | |||
2951 | * IPython/Prompts.py (CachedOutput.__init__): made the color table |
|
2962 | * IPython/Prompts.py (CachedOutput.__init__): made the color table | |
2952 | be an attribute of all classes in this module. The design of these |
|
2963 | be an attribute of all classes in this module. The design of these | |
2953 | classes needs some serious overhauling. |
|
2964 | classes needs some serious overhauling. | |
2954 |
|
2965 | |||
2955 | * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug |
|
2966 | * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug | |
2956 | which was ignoring '_' in option names. |
|
2967 | which was ignoring '_' in option names. | |
2957 |
|
2968 | |||
2958 | * IPython/ultraTB.py (FormattedTB.__init__): Changed |
|
2969 | * IPython/ultraTB.py (FormattedTB.__init__): Changed | |
2959 | 'Verbose_novars' to 'Context' and made it the new default. It's a |
|
2970 | 'Verbose_novars' to 'Context' and made it the new default. It's a | |
2960 | bit more readable and also safer than verbose. |
|
2971 | bit more readable and also safer than verbose. | |
2961 |
|
2972 | |||
2962 | * IPython/PyColorize.py (Parser.__call__): Fixed coloring of |
|
2973 | * IPython/PyColorize.py (Parser.__call__): Fixed coloring of | |
2963 | triple-quoted strings. |
|
2974 | triple-quoted strings. | |
2964 |
|
2975 | |||
2965 | * IPython/OInspect.py (__all__): new module exposing the object |
|
2976 | * IPython/OInspect.py (__all__): new module exposing the object | |
2966 | introspection facilities. Now the corresponding magics are dummy |
|
2977 | introspection facilities. Now the corresponding magics are dummy | |
2967 | wrappers around this. Having this module will make it much easier |
|
2978 | wrappers around this. Having this module will make it much easier | |
2968 | to put these functions into our modified pdb. |
|
2979 | to put these functions into our modified pdb. | |
2969 | This new object inspector system uses the new colorizing module, |
|
2980 | This new object inspector system uses the new colorizing module, | |
2970 | so source code and other things are nicely syntax highlighted. |
|
2981 | so source code and other things are nicely syntax highlighted. | |
2971 |
|
2982 | |||
2972 | 2002-05-18 Fernando Perez <fperez@colorado.edu> |
|
2983 | 2002-05-18 Fernando Perez <fperez@colorado.edu> | |
2973 |
|
2984 | |||
2974 | * IPython/ColorANSI.py: Split the coloring tools into a separate |
|
2985 | * IPython/ColorANSI.py: Split the coloring tools into a separate | |
2975 | module so I can use them in other code easier (they were part of |
|
2986 | module so I can use them in other code easier (they were part of | |
2976 | ultraTB). |
|
2987 | ultraTB). | |
2977 |
|
2988 | |||
2978 | 2002-05-17 Fernando Perez <fperez@colorado.edu> |
|
2989 | 2002-05-17 Fernando Perez <fperez@colorado.edu> | |
2979 |
|
2990 | |||
2980 | * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance): |
|
2991 | * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance): | |
2981 | fixed it to set the global 'g' also to the called instance, as |
|
2992 | fixed it to set the global 'g' also to the called instance, as | |
2982 | long as 'g' was still a gnuplot instance (so it doesn't overwrite |
|
2993 | long as 'g' was still a gnuplot instance (so it doesn't overwrite | |
2983 | user's 'g' variables). |
|
2994 | user's 'g' variables). | |
2984 |
|
2995 | |||
2985 | * IPython/iplib.py (InteractiveShell.__init__): Added In/Out |
|
2996 | * IPython/iplib.py (InteractiveShell.__init__): Added In/Out | |
2986 | global variables (aliases to _ih,_oh) so that users which expect |
|
2997 | global variables (aliases to _ih,_oh) so that users which expect | |
2987 | In[5] or Out[7] to work aren't unpleasantly surprised. |
|
2998 | In[5] or Out[7] to work aren't unpleasantly surprised. | |
2988 | (InputList.__getslice__): new class to allow executing slices of |
|
2999 | (InputList.__getslice__): new class to allow executing slices of | |
2989 | input history directly. Very simple class, complements the use of |
|
3000 | input history directly. Very simple class, complements the use of | |
2990 | macros. |
|
3001 | macros. | |
2991 |
|
3002 | |||
2992 | 2002-05-16 Fernando Perez <fperez@colorado.edu> |
|
3003 | 2002-05-16 Fernando Perez <fperez@colorado.edu> | |
2993 |
|
3004 | |||
2994 | * setup.py (docdirbase): make doc directory be just doc/IPython |
|
3005 | * setup.py (docdirbase): make doc directory be just doc/IPython | |
2995 | without version numbers, it will reduce clutter for users. |
|
3006 | without version numbers, it will reduce clutter for users. | |
2996 |
|
3007 | |||
2997 | * IPython/Magic.py (Magic.magic_run): Add explicit local dict to |
|
3008 | * IPython/Magic.py (Magic.magic_run): Add explicit local dict to | |
2998 | execfile call to prevent possible memory leak. See for details: |
|
3009 | execfile call to prevent possible memory leak. See for details: | |
2999 | http://mail.python.org/pipermail/python-list/2002-February/088476.html |
|
3010 | http://mail.python.org/pipermail/python-list/2002-February/088476.html | |
3000 |
|
3011 | |||
3001 | 2002-05-15 Fernando Perez <fperez@colorado.edu> |
|
3012 | 2002-05-15 Fernando Perez <fperez@colorado.edu> | |
3002 |
|
3013 | |||
3003 | * IPython/Magic.py (Magic.magic_psource): made the object |
|
3014 | * IPython/Magic.py (Magic.magic_psource): made the object | |
3004 | introspection names be more standard: pdoc, pdef, pfile and |
|
3015 | introspection names be more standard: pdoc, pdef, pfile and | |
3005 | psource. They all print/page their output, and it makes |
|
3016 | psource. They all print/page their output, and it makes | |
3006 | remembering them easier. Kept old names for compatibility as |
|
3017 | remembering them easier. Kept old names for compatibility as | |
3007 | aliases. |
|
3018 | aliases. | |
3008 |
|
3019 | |||
3009 | 2002-05-14 Fernando Perez <fperez@colorado.edu> |
|
3020 | 2002-05-14 Fernando Perez <fperez@colorado.edu> | |
3010 |
|
3021 | |||
3011 | * IPython/UserConfig/GnuplotMagic.py: I think I finally understood |
|
3022 | * IPython/UserConfig/GnuplotMagic.py: I think I finally understood | |
3012 | what the mouse problem was. The trick is to use gnuplot with temp |
|
3023 | what the mouse problem was. The trick is to use gnuplot with temp | |
3013 | files and NOT with pipes (for data communication), because having |
|
3024 | files and NOT with pipes (for data communication), because having | |
3014 | both pipes and the mouse on is bad news. |
|
3025 | both pipes and the mouse on is bad news. | |
3015 |
|
3026 | |||
3016 | 2002-05-13 Fernando Perez <fperez@colorado.edu> |
|
3027 | 2002-05-13 Fernando Perez <fperez@colorado.edu> | |
3017 |
|
3028 | |||
3018 | * IPython/Magic.py (Magic._ofind): fixed namespace order search |
|
3029 | * IPython/Magic.py (Magic._ofind): fixed namespace order search | |
3019 | bug. Information would be reported about builtins even when |
|
3030 | bug. Information would be reported about builtins even when | |
3020 | user-defined functions overrode them. |
|
3031 | user-defined functions overrode them. | |
3021 |
|
3032 | |||
3022 | 2002-05-11 Fernando Perez <fperez@colorado.edu> |
|
3033 | 2002-05-11 Fernando Perez <fperez@colorado.edu> | |
3023 |
|
3034 | |||
3024 | * IPython/__init__.py (__all__): removed FlexCompleter from |
|
3035 | * IPython/__init__.py (__all__): removed FlexCompleter from | |
3025 | __all__ so that things don't fail in platforms without readline. |
|
3036 | __all__ so that things don't fail in platforms without readline. | |
3026 |
|
3037 | |||
3027 | 2002-05-10 Fernando Perez <fperez@colorado.edu> |
|
3038 | 2002-05-10 Fernando Perez <fperez@colorado.edu> | |
3028 |
|
3039 | |||
3029 | * IPython/__init__.py (__all__): removed numutils from __all__ b/c |
|
3040 | * IPython/__init__.py (__all__): removed numutils from __all__ b/c | |
3030 | it requires Numeric, effectively making Numeric a dependency for |
|
3041 | it requires Numeric, effectively making Numeric a dependency for | |
3031 | IPython. |
|
3042 | IPython. | |
3032 |
|
3043 | |||
3033 | * Released 0.2.13 |
|
3044 | * Released 0.2.13 | |
3034 |
|
3045 | |||
3035 | * IPython/Magic.py (Magic.magic_prun): big overhaul to the |
|
3046 | * IPython/Magic.py (Magic.magic_prun): big overhaul to the | |
3036 | profiler interface. Now all the major options from the profiler |
|
3047 | profiler interface. Now all the major options from the profiler | |
3037 | module are directly supported in IPython, both for single |
|
3048 | module are directly supported in IPython, both for single | |
3038 | expressions (@prun) and for full programs (@run -p). |
|
3049 | expressions (@prun) and for full programs (@run -p). | |
3039 |
|
3050 | |||
3040 | 2002-05-09 Fernando Perez <fperez@colorado.edu> |
|
3051 | 2002-05-09 Fernando Perez <fperez@colorado.edu> | |
3041 |
|
3052 | |||
3042 | * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of |
|
3053 | * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of | |
3043 | magic properly formatted for screen. |
|
3054 | magic properly formatted for screen. | |
3044 |
|
3055 | |||
3045 | * setup.py (make_shortcut): Changed things to put pdf version in |
|
3056 | * setup.py (make_shortcut): Changed things to put pdf version in | |
3046 | doc/ instead of doc/manual (had to change lyxport a bit). |
|
3057 | doc/ instead of doc/manual (had to change lyxport a bit). | |
3047 |
|
3058 | |||
3048 | * IPython/Magic.py (Profile.string_stats): made profile runs go |
|
3059 | * IPython/Magic.py (Profile.string_stats): made profile runs go | |
3049 | through pager (they are long and a pager allows searching, saving, |
|
3060 | through pager (they are long and a pager allows searching, saving, | |
3050 | etc.) |
|
3061 | etc.) | |
3051 |
|
3062 | |||
3052 | 2002-05-08 Fernando Perez <fperez@colorado.edu> |
|
3063 | 2002-05-08 Fernando Perez <fperez@colorado.edu> | |
3053 |
|
3064 | |||
3054 | * Released 0.2.12 |
|
3065 | * Released 0.2.12 | |
3055 |
|
3066 | |||
3056 | 2002-05-06 Fernando Perez <fperez@colorado.edu> |
|
3067 | 2002-05-06 Fernando Perez <fperez@colorado.edu> | |
3057 |
|
3068 | |||
3058 | * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently |
|
3069 | * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently | |
3059 | introduced); 'hist n1 n2' was broken. |
|
3070 | introduced); 'hist n1 n2' was broken. | |
3060 | (Magic.magic_pdb): added optional on/off arguments to @pdb |
|
3071 | (Magic.magic_pdb): added optional on/off arguments to @pdb | |
3061 | (Magic.magic_run): added option -i to @run, which executes code in |
|
3072 | (Magic.magic_run): added option -i to @run, which executes code in | |
3062 | the IPython namespace instead of a clean one. Also added @irun as |
|
3073 | the IPython namespace instead of a clean one. Also added @irun as | |
3063 | an alias to @run -i. |
|
3074 | an alias to @run -i. | |
3064 |
|
3075 | |||
3065 | * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance): |
|
3076 | * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance): | |
3066 | fixed (it didn't really do anything, the namespaces were wrong). |
|
3077 | fixed (it didn't really do anything, the namespaces were wrong). | |
3067 |
|
3078 | |||
3068 | * IPython/Debugger.py (__init__): Added workaround for python 2.1 |
|
3079 | * IPython/Debugger.py (__init__): Added workaround for python 2.1 | |
3069 |
|
3080 | |||
3070 | * IPython/__init__.py (__all__): Fixed package namespace, now |
|
3081 | * IPython/__init__.py (__all__): Fixed package namespace, now | |
3071 | 'import IPython' does give access to IPython.<all> as |
|
3082 | 'import IPython' does give access to IPython.<all> as | |
3072 | expected. Also renamed __release__ to Release. |
|
3083 | expected. Also renamed __release__ to Release. | |
3073 |
|
3084 | |||
3074 | * IPython/Debugger.py (__license__): created new Pdb class which |
|
3085 | * IPython/Debugger.py (__license__): created new Pdb class which | |
3075 | functions like a drop-in for the normal pdb.Pdb but does NOT |
|
3086 | functions like a drop-in for the normal pdb.Pdb but does NOT | |
3076 | import readline by default. This way it doesn't muck up IPython's |
|
3087 | import readline by default. This way it doesn't muck up IPython's | |
3077 | readline handling, and now tab-completion finally works in the |
|
3088 | readline handling, and now tab-completion finally works in the | |
3078 | debugger -- sort of. It completes things globally visible, but the |
|
3089 | debugger -- sort of. It completes things globally visible, but the | |
3079 | completer doesn't track the stack as pdb walks it. That's a bit |
|
3090 | completer doesn't track the stack as pdb walks it. That's a bit | |
3080 | tricky, and I'll have to implement it later. |
|
3091 | tricky, and I'll have to implement it later. | |
3081 |
|
3092 | |||
3082 | 2002-05-05 Fernando Perez <fperez@colorado.edu> |
|
3093 | 2002-05-05 Fernando Perez <fperez@colorado.edu> | |
3083 |
|
3094 | |||
3084 | * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for |
|
3095 | * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for | |
3085 | magic docstrings when printed via ? (explicit \'s were being |
|
3096 | magic docstrings when printed via ? (explicit \'s were being | |
3086 | printed). |
|
3097 | printed). | |
3087 |
|
3098 | |||
3088 | * IPython/ipmaker.py (make_IPython): fixed namespace |
|
3099 | * IPython/ipmaker.py (make_IPython): fixed namespace | |
3089 | identification bug. Now variables loaded via logs or command-line |
|
3100 | identification bug. Now variables loaded via logs or command-line | |
3090 | files are recognized in the interactive namespace by @who. |
|
3101 | files are recognized in the interactive namespace by @who. | |
3091 |
|
3102 | |||
3092 | * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in |
|
3103 | * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in | |
3093 | log replay system stemming from the string form of Structs. |
|
3104 | log replay system stemming from the string form of Structs. | |
3094 |
|
3105 | |||
3095 | * IPython/Magic.py (Macro.__init__): improved macros to properly |
|
3106 | * IPython/Magic.py (Macro.__init__): improved macros to properly | |
3096 | handle magic commands in them. |
|
3107 | handle magic commands in them. | |
3097 | (Magic.magic_logstart): usernames are now expanded so 'logstart |
|
3108 | (Magic.magic_logstart): usernames are now expanded so 'logstart | |
3098 | ~/mylog' now works. |
|
3109 | ~/mylog' now works. | |
3099 |
|
3110 | |||
3100 | * IPython/iplib.py (complete): fixed bug where paths starting with |
|
3111 | * IPython/iplib.py (complete): fixed bug where paths starting with | |
3101 | '/' would be completed as magic names. |
|
3112 | '/' would be completed as magic names. | |
3102 |
|
3113 | |||
3103 | 2002-05-04 Fernando Perez <fperez@colorado.edu> |
|
3114 | 2002-05-04 Fernando Perez <fperez@colorado.edu> | |
3104 |
|
3115 | |||
3105 | * IPython/Magic.py (Magic.magic_run): added options -p and -f to |
|
3116 | * IPython/Magic.py (Magic.magic_run): added options -p and -f to | |
3106 | allow running full programs under the profiler's control. |
|
3117 | allow running full programs under the profiler's control. | |
3107 |
|
3118 | |||
3108 | * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars |
|
3119 | * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars | |
3109 | mode to report exceptions verbosely but without formatting |
|
3120 | mode to report exceptions verbosely but without formatting | |
3110 | variables. This addresses the issue of ipython 'freezing' (it's |
|
3121 | variables. This addresses the issue of ipython 'freezing' (it's | |
3111 | not frozen, but caught in an expensive formatting loop) when huge |
|
3122 | not frozen, but caught in an expensive formatting loop) when huge | |
3112 | variables are in the context of an exception. |
|
3123 | variables are in the context of an exception. | |
3113 | (VerboseTB.text): Added '--->' markers at line where exception was |
|
3124 | (VerboseTB.text): Added '--->' markers at line where exception was | |
3114 | triggered. Much clearer to read, especially in NoColor modes. |
|
3125 | triggered. Much clearer to read, especially in NoColor modes. | |
3115 |
|
3126 | |||
3116 | * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been |
|
3127 | * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been | |
3117 | implemented in reverse when changing to the new parse_options(). |
|
3128 | implemented in reverse when changing to the new parse_options(). | |
3118 |
|
3129 | |||
3119 | 2002-05-03 Fernando Perez <fperez@colorado.edu> |
|
3130 | 2002-05-03 Fernando Perez <fperez@colorado.edu> | |
3120 |
|
3131 | |||
3121 | * IPython/Magic.py (Magic.parse_options): new function so that |
|
3132 | * IPython/Magic.py (Magic.parse_options): new function so that | |
3122 | magics can parse options easier. |
|
3133 | magics can parse options easier. | |
3123 | (Magic.magic_prun): new function similar to profile.run(), |
|
3134 | (Magic.magic_prun): new function similar to profile.run(), | |
3124 | suggested by Chris Hart. |
|
3135 | suggested by Chris Hart. | |
3125 | (Magic.magic_cd): fixed behavior so that it only changes if |
|
3136 | (Magic.magic_cd): fixed behavior so that it only changes if | |
3126 | directory actually is in history. |
|
3137 | directory actually is in history. | |
3127 |
|
3138 | |||
3128 | * IPython/usage.py (__doc__): added information about potential |
|
3139 | * IPython/usage.py (__doc__): added information about potential | |
3129 | slowness of Verbose exception mode when there are huge data |
|
3140 | slowness of Verbose exception mode when there are huge data | |
3130 | structures to be formatted (thanks to Archie Paulson). |
|
3141 | structures to be formatted (thanks to Archie Paulson). | |
3131 |
|
3142 | |||
3132 | * IPython/ipmaker.py (make_IPython): Changed default logging |
|
3143 | * IPython/ipmaker.py (make_IPython): Changed default logging | |
3133 | (when simply called with -log) to use curr_dir/ipython.log in |
|
3144 | (when simply called with -log) to use curr_dir/ipython.log in | |
3134 | rotate mode. Fixed crash which was occuring with -log before |
|
3145 | rotate mode. Fixed crash which was occuring with -log before | |
3135 | (thanks to Jim Boyle). |
|
3146 | (thanks to Jim Boyle). | |
3136 |
|
3147 | |||
3137 | 2002-05-01 Fernando Perez <fperez@colorado.edu> |
|
3148 | 2002-05-01 Fernando Perez <fperez@colorado.edu> | |
3138 |
|
3149 | |||
3139 | * Released 0.2.11 for these fixes (mainly the ultraTB one which |
|
3150 | * Released 0.2.11 for these fixes (mainly the ultraTB one which | |
3140 | was nasty -- though somewhat of a corner case). |
|
3151 | was nasty -- though somewhat of a corner case). | |
3141 |
|
3152 | |||
3142 | * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to |
|
3153 | * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to | |
3143 | text (was a bug). |
|
3154 | text (was a bug). | |
3144 |
|
3155 | |||
3145 | 2002-04-30 Fernando Perez <fperez@colorado.edu> |
|
3156 | 2002-04-30 Fernando Perez <fperez@colorado.edu> | |
3146 |
|
3157 | |||
3147 | * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add |
|
3158 | * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add | |
3148 | a print after ^D or ^C from the user so that the In[] prompt |
|
3159 | a print after ^D or ^C from the user so that the In[] prompt | |
3149 | doesn't over-run the gnuplot one. |
|
3160 | doesn't over-run the gnuplot one. | |
3150 |
|
3161 | |||
3151 | 2002-04-29 Fernando Perez <fperez@colorado.edu> |
|
3162 | 2002-04-29 Fernando Perez <fperez@colorado.edu> | |
3152 |
|
3163 | |||
3153 | * Released 0.2.10 |
|
3164 | * Released 0.2.10 | |
3154 |
|
3165 | |||
3155 | * IPython/__release__.py (version): get date dynamically. |
|
3166 | * IPython/__release__.py (version): get date dynamically. | |
3156 |
|
3167 | |||
3157 | * Misc. documentation updates thanks to Arnd's comments. Also ran |
|
3168 | * Misc. documentation updates thanks to Arnd's comments. Also ran | |
3158 | a full spellcheck on the manual (hadn't been done in a while). |
|
3169 | a full spellcheck on the manual (hadn't been done in a while). | |
3159 |
|
3170 | |||
3160 | 2002-04-27 Fernando Perez <fperez@colorado.edu> |
|
3171 | 2002-04-27 Fernando Perez <fperez@colorado.edu> | |
3161 |
|
3172 | |||
3162 | * IPython/Magic.py (Magic.magic_logstart): Fixed bug where |
|
3173 | * IPython/Magic.py (Magic.magic_logstart): Fixed bug where | |
3163 | starting a log in mid-session would reset the input history list. |
|
3174 | starting a log in mid-session would reset the input history list. | |
3164 |
|
3175 | |||
3165 | 2002-04-26 Fernando Perez <fperez@colorado.edu> |
|
3176 | 2002-04-26 Fernando Perez <fperez@colorado.edu> | |
3166 |
|
3177 | |||
3167 | * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not |
|
3178 | * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not | |
3168 | all files were being included in an update. Now anything in |
|
3179 | all files were being included in an update. Now anything in | |
3169 | UserConfig that matches [A-Za-z]*.py will go (this excludes |
|
3180 | UserConfig that matches [A-Za-z]*.py will go (this excludes | |
3170 | __init__.py) |
|
3181 | __init__.py) | |
3171 |
|
3182 | |||
3172 | 2002-04-25 Fernando Perez <fperez@colorado.edu> |
|
3183 | 2002-04-25 Fernando Perez <fperez@colorado.edu> | |
3173 |
|
3184 | |||
3174 | * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__ |
|
3185 | * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__ | |
3175 | to __builtins__ so that any form of embedded or imported code can |
|
3186 | to __builtins__ so that any form of embedded or imported code can | |
3176 | test for being inside IPython. |
|
3187 | test for being inside IPython. | |
3177 |
|
3188 | |||
3178 | * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance): |
|
3189 | * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance): | |
3179 | changed to GnuplotMagic because it's now an importable module, |
|
3190 | changed to GnuplotMagic because it's now an importable module, | |
3180 | this makes the name follow that of the standard Gnuplot module. |
|
3191 | this makes the name follow that of the standard Gnuplot module. | |
3181 | GnuplotMagic can now be loaded at any time in mid-session. |
|
3192 | GnuplotMagic can now be loaded at any time in mid-session. | |
3182 |
|
3193 | |||
3183 | 2002-04-24 Fernando Perez <fperez@colorado.edu> |
|
3194 | 2002-04-24 Fernando Perez <fperez@colorado.edu> | |
3184 |
|
3195 | |||
3185 | * IPython/numutils.py: removed SIUnits. It doesn't properly set |
|
3196 | * IPython/numutils.py: removed SIUnits. It doesn't properly set | |
3186 | the globals (IPython has its own namespace) and the |
|
3197 | the globals (IPython has its own namespace) and the | |
3187 | PhysicalQuantity stuff is much better anyway. |
|
3198 | PhysicalQuantity stuff is much better anyway. | |
3188 |
|
3199 | |||
3189 | * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot |
|
3200 | * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot | |
3190 | embedding example to standard user directory for |
|
3201 | embedding example to standard user directory for | |
3191 | distribution. Also put it in the manual. |
|
3202 | distribution. Also put it in the manual. | |
3192 |
|
3203 | |||
3193 | * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot |
|
3204 | * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot | |
3194 | instance as first argument (so it doesn't rely on some obscure |
|
3205 | instance as first argument (so it doesn't rely on some obscure | |
3195 | hidden global). |
|
3206 | hidden global). | |
3196 |
|
3207 | |||
3197 | * IPython/UserConfig/ipythonrc.py: put () back in accepted |
|
3208 | * IPython/UserConfig/ipythonrc.py: put () back in accepted | |
3198 | delimiters. While it prevents ().TAB from working, it allows |
|
3209 | delimiters. While it prevents ().TAB from working, it allows | |
3199 | completions in open (... expressions. This is by far a more common |
|
3210 | completions in open (... expressions. This is by far a more common | |
3200 | case. |
|
3211 | case. | |
3201 |
|
3212 | |||
3202 | 2002-04-23 Fernando Perez <fperez@colorado.edu> |
|
3213 | 2002-04-23 Fernando Perez <fperez@colorado.edu> | |
3203 |
|
3214 | |||
3204 | * IPython/Extensions/InterpreterPasteInput.py: new |
|
3215 | * IPython/Extensions/InterpreterPasteInput.py: new | |
3205 | syntax-processing module for pasting lines with >>> or ... at the |
|
3216 | syntax-processing module for pasting lines with >>> or ... at the | |
3206 | start. |
|
3217 | start. | |
3207 |
|
3218 | |||
3208 | * IPython/Extensions/PhysicalQ_Interactive.py |
|
3219 | * IPython/Extensions/PhysicalQ_Interactive.py | |
3209 | (PhysicalQuantityInteractive.__int__): fixed to work with either |
|
3220 | (PhysicalQuantityInteractive.__int__): fixed to work with either | |
3210 | Numeric or math. |
|
3221 | Numeric or math. | |
3211 |
|
3222 | |||
3212 | * IPython/UserConfig/ipythonrc-numeric.py: reorganized the |
|
3223 | * IPython/UserConfig/ipythonrc-numeric.py: reorganized the | |
3213 | provided profiles. Now we have: |
|
3224 | provided profiles. Now we have: | |
3214 | -math -> math module as * and cmath with its own namespace. |
|
3225 | -math -> math module as * and cmath with its own namespace. | |
3215 | -numeric -> Numeric as *, plus gnuplot & grace |
|
3226 | -numeric -> Numeric as *, plus gnuplot & grace | |
3216 | -physics -> same as before |
|
3227 | -physics -> same as before | |
3217 |
|
3228 | |||
3218 | * IPython/Magic.py (Magic.magic_magic): Fixed bug where |
|
3229 | * IPython/Magic.py (Magic.magic_magic): Fixed bug where | |
3219 | user-defined magics wouldn't be found by @magic if they were |
|
3230 | user-defined magics wouldn't be found by @magic if they were | |
3220 | defined as class methods. Also cleaned up the namespace search |
|
3231 | defined as class methods. Also cleaned up the namespace search | |
3221 | logic and the string building (to use %s instead of many repeated |
|
3232 | logic and the string building (to use %s instead of many repeated | |
3222 | string adds). |
|
3233 | string adds). | |
3223 |
|
3234 | |||
3224 | * IPython/UserConfig/example-magic.py (magic_foo): updated example |
|
3235 | * IPython/UserConfig/example-magic.py (magic_foo): updated example | |
3225 | of user-defined magics to operate with class methods (cleaner, in |
|
3236 | of user-defined magics to operate with class methods (cleaner, in | |
3226 | line with the gnuplot code). |
|
3237 | line with the gnuplot code). | |
3227 |
|
3238 | |||
3228 | 2002-04-22 Fernando Perez <fperez@colorado.edu> |
|
3239 | 2002-04-22 Fernando Perez <fperez@colorado.edu> | |
3229 |
|
3240 | |||
3230 | * setup.py: updated dependency list so that manual is updated when |
|
3241 | * setup.py: updated dependency list so that manual is updated when | |
3231 | all included files change. |
|
3242 | all included files change. | |
3232 |
|
3243 | |||
3233 | * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring |
|
3244 | * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring | |
3234 | the delimiter removal option (the fix is ugly right now). |
|
3245 | the delimiter removal option (the fix is ugly right now). | |
3235 |
|
3246 | |||
3236 | * IPython/UserConfig/ipythonrc-physics.py: simplified not to load |
|
3247 | * IPython/UserConfig/ipythonrc-physics.py: simplified not to load | |
3237 | all of the math profile (quicker loading, no conflict between |
|
3248 | all of the math profile (quicker loading, no conflict between | |
3238 | g-9.8 and g-gnuplot). |
|
3249 | g-9.8 and g-gnuplot). | |
3239 |
|
3250 | |||
3240 | * IPython/CrashHandler.py (CrashHandler.__call__): changed default |
|
3251 | * IPython/CrashHandler.py (CrashHandler.__call__): changed default | |
3241 | name of post-mortem files to IPython_crash_report.txt. |
|
3252 | name of post-mortem files to IPython_crash_report.txt. | |
3242 |
|
3253 | |||
3243 | * Cleanup/update of the docs. Added all the new readline info and |
|
3254 | * Cleanup/update of the docs. Added all the new readline info and | |
3244 | formatted all lists as 'real lists'. |
|
3255 | formatted all lists as 'real lists'. | |
3245 |
|
3256 | |||
3246 | * IPython/ipmaker.py (make_IPython): removed now-obsolete |
|
3257 | * IPython/ipmaker.py (make_IPython): removed now-obsolete | |
3247 | tab-completion options, since the full readline parse_and_bind is |
|
3258 | tab-completion options, since the full readline parse_and_bind is | |
3248 | now accessible. |
|
3259 | now accessible. | |
3249 |
|
3260 | |||
3250 | * IPython/iplib.py (InteractiveShell.init_readline): Changed |
|
3261 | * IPython/iplib.py (InteractiveShell.init_readline): Changed | |
3251 | handling of readline options. Now users can specify any string to |
|
3262 | handling of readline options. Now users can specify any string to | |
3252 | be passed to parse_and_bind(), as well as the delimiters to be |
|
3263 | be passed to parse_and_bind(), as well as the delimiters to be | |
3253 | removed. |
|
3264 | removed. | |
3254 | (InteractiveShell.__init__): Added __name__ to the global |
|
3265 | (InteractiveShell.__init__): Added __name__ to the global | |
3255 | namespace so that things like Itpl which rely on its existence |
|
3266 | namespace so that things like Itpl which rely on its existence | |
3256 | don't crash. |
|
3267 | don't crash. | |
3257 | (InteractiveShell._prefilter): Defined the default with a _ so |
|
3268 | (InteractiveShell._prefilter): Defined the default with a _ so | |
3258 | that prefilter() is easier to override, while the default one |
|
3269 | that prefilter() is easier to override, while the default one | |
3259 | remains available. |
|
3270 | remains available. | |
3260 |
|
3271 | |||
3261 | 2002-04-18 Fernando Perez <fperez@colorado.edu> |
|
3272 | 2002-04-18 Fernando Perez <fperez@colorado.edu> | |
3262 |
|
3273 | |||
3263 | * Added information about pdb in the docs. |
|
3274 | * Added information about pdb in the docs. | |
3264 |
|
3275 | |||
3265 | 2002-04-17 Fernando Perez <fperez@colorado.edu> |
|
3276 | 2002-04-17 Fernando Perez <fperez@colorado.edu> | |
3266 |
|
3277 | |||
3267 | * IPython/ipmaker.py (make_IPython): added rc_override option to |
|
3278 | * IPython/ipmaker.py (make_IPython): added rc_override option to | |
3268 | allow passing config options at creation time which may override |
|
3279 | allow passing config options at creation time which may override | |
3269 | anything set in the config files or command line. This is |
|
3280 | anything set in the config files or command line. This is | |
3270 | particularly useful for configuring embedded instances. |
|
3281 | particularly useful for configuring embedded instances. | |
3271 |
|
3282 | |||
3272 | 2002-04-15 Fernando Perez <fperez@colorado.edu> |
|
3283 | 2002-04-15 Fernando Perez <fperez@colorado.edu> | |
3273 |
|
3284 | |||
3274 | * IPython/Logger.py (Logger.log): Fixed a nasty bug which could |
|
3285 | * IPython/Logger.py (Logger.log): Fixed a nasty bug which could | |
3275 | crash embedded instances because of the input cache falling out of |
|
3286 | crash embedded instances because of the input cache falling out of | |
3276 | sync with the output counter. |
|
3287 | sync with the output counter. | |
3277 |
|
3288 | |||
3278 | * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug |
|
3289 | * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug | |
3279 | mode which calls pdb after an uncaught exception in IPython itself. |
|
3290 | mode which calls pdb after an uncaught exception in IPython itself. | |
3280 |
|
3291 | |||
3281 | 2002-04-14 Fernando Perez <fperez@colorado.edu> |
|
3292 | 2002-04-14 Fernando Perez <fperez@colorado.edu> | |
3282 |
|
3293 | |||
3283 | * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up |
|
3294 | * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up | |
3284 | readline, fix it back after each call. |
|
3295 | readline, fix it back after each call. | |
3285 |
|
3296 | |||
3286 | * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private |
|
3297 | * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private | |
3287 | method to force all access via __call__(), which guarantees that |
|
3298 | method to force all access via __call__(), which guarantees that | |
3288 | traceback references are properly deleted. |
|
3299 | traceback references are properly deleted. | |
3289 |
|
3300 | |||
3290 | * IPython/Prompts.py (CachedOutput._display): minor fixes to |
|
3301 | * IPython/Prompts.py (CachedOutput._display): minor fixes to | |
3291 | improve printing when pprint is in use. |
|
3302 | improve printing when pprint is in use. | |
3292 |
|
3303 | |||
3293 | 2002-04-13 Fernando Perez <fperez@colorado.edu> |
|
3304 | 2002-04-13 Fernando Perez <fperez@colorado.edu> | |
3294 |
|
3305 | |||
3295 | * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit |
|
3306 | * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit | |
3296 | exceptions aren't caught anymore. If the user triggers one, he |
|
3307 | exceptions aren't caught anymore. If the user triggers one, he | |
3297 | should know why he's doing it and it should go all the way up, |
|
3308 | should know why he's doing it and it should go all the way up, | |
3298 | just like any other exception. So now @abort will fully kill the |
|
3309 | just like any other exception. So now @abort will fully kill the | |
3299 | embedded interpreter and the embedding code (unless that happens |
|
3310 | embedded interpreter and the embedding code (unless that happens | |
3300 | to catch SystemExit). |
|
3311 | to catch SystemExit). | |
3301 |
|
3312 | |||
3302 | * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag |
|
3313 | * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag | |
3303 | and a debugger() method to invoke the interactive pdb debugger |
|
3314 | and a debugger() method to invoke the interactive pdb debugger | |
3304 | after printing exception information. Also added the corresponding |
|
3315 | after printing exception information. Also added the corresponding | |
3305 | -pdb option and @pdb magic to control this feature, and updated |
|
3316 | -pdb option and @pdb magic to control this feature, and updated | |
3306 | the docs. After a suggestion from Christopher Hart |
|
3317 | the docs. After a suggestion from Christopher Hart | |
3307 | (hart-AT-caltech.edu). |
|
3318 | (hart-AT-caltech.edu). | |
3308 |
|
3319 | |||
3309 | 2002-04-12 Fernando Perez <fperez@colorado.edu> |
|
3320 | 2002-04-12 Fernando Perez <fperez@colorado.edu> | |
3310 |
|
3321 | |||
3311 | * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use |
|
3322 | * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use | |
3312 | the exception handlers defined by the user (not the CrashHandler) |
|
3323 | the exception handlers defined by the user (not the CrashHandler) | |
3313 | so that user exceptions don't trigger an ipython bug report. |
|
3324 | so that user exceptions don't trigger an ipython bug report. | |
3314 |
|
3325 | |||
3315 | * IPython/ultraTB.py (ColorTB.__init__): made the color scheme |
|
3326 | * IPython/ultraTB.py (ColorTB.__init__): made the color scheme | |
3316 | configurable (it should have always been so). |
|
3327 | configurable (it should have always been so). | |
3317 |
|
3328 | |||
3318 | 2002-03-26 Fernando Perez <fperez@colorado.edu> |
|
3329 | 2002-03-26 Fernando Perez <fperez@colorado.edu> | |
3319 |
|
3330 | |||
3320 | * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here |
|
3331 | * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here | |
3321 | and there to fix embedding namespace issues. This should all be |
|
3332 | and there to fix embedding namespace issues. This should all be | |
3322 | done in a more elegant way. |
|
3333 | done in a more elegant way. | |
3323 |
|
3334 | |||
3324 | 2002-03-25 Fernando Perez <fperez@colorado.edu> |
|
3335 | 2002-03-25 Fernando Perez <fperez@colorado.edu> | |
3325 |
|
3336 | |||
3326 | * IPython/genutils.py (get_home_dir): Try to make it work under |
|
3337 | * IPython/genutils.py (get_home_dir): Try to make it work under | |
3327 | win9x also. |
|
3338 | win9x also. | |
3328 |
|
3339 | |||
3329 | 2002-03-20 Fernando Perez <fperez@colorado.edu> |
|
3340 | 2002-03-20 Fernando Perez <fperez@colorado.edu> | |
3330 |
|
3341 | |||
3331 | * IPython/Shell.py (IPythonShellEmbed.__init__): leave |
|
3342 | * IPython/Shell.py (IPythonShellEmbed.__init__): leave | |
3332 | sys.displayhook untouched upon __init__. |
|
3343 | sys.displayhook untouched upon __init__. | |
3333 |
|
3344 | |||
3334 | 2002-03-19 Fernando Perez <fperez@colorado.edu> |
|
3345 | 2002-03-19 Fernando Perez <fperez@colorado.edu> | |
3335 |
|
3346 | |||
3336 | * Released 0.2.9 (for embedding bug, basically). |
|
3347 | * Released 0.2.9 (for embedding bug, basically). | |
3337 |
|
3348 | |||
3338 | * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit |
|
3349 | * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit | |
3339 | exceptions so that enclosing shell's state can be restored. |
|
3350 | exceptions so that enclosing shell's state can be restored. | |
3340 |
|
3351 | |||
3341 | * Changed magic_gnuplot.py to magic-gnuplot.py to standardize |
|
3352 | * Changed magic_gnuplot.py to magic-gnuplot.py to standardize | |
3342 | naming conventions in the .ipython/ dir. |
|
3353 | naming conventions in the .ipython/ dir. | |
3343 |
|
3354 | |||
3344 | * IPython/iplib.py (InteractiveShell.init_readline): removed '-' |
|
3355 | * IPython/iplib.py (InteractiveShell.init_readline): removed '-' | |
3345 | from delimiters list so filenames with - in them get expanded. |
|
3356 | from delimiters list so filenames with - in them get expanded. | |
3346 |
|
3357 | |||
3347 | * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with |
|
3358 | * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with | |
3348 | sys.displayhook not being properly restored after an embedded call. |
|
3359 | sys.displayhook not being properly restored after an embedded call. | |
3349 |
|
3360 | |||
3350 | 2002-03-18 Fernando Perez <fperez@colorado.edu> |
|
3361 | 2002-03-18 Fernando Perez <fperez@colorado.edu> | |
3351 |
|
3362 | |||
3352 | * Released 0.2.8 |
|
3363 | * Released 0.2.8 | |
3353 |
|
3364 | |||
3354 | * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where |
|
3365 | * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where | |
3355 | some files weren't being included in a -upgrade. |
|
3366 | some files weren't being included in a -upgrade. | |
3356 | (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous |
|
3367 | (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous | |
3357 | on' so that the first tab completes. |
|
3368 | on' so that the first tab completes. | |
3358 | (InteractiveShell.handle_magic): fixed bug with spaces around |
|
3369 | (InteractiveShell.handle_magic): fixed bug with spaces around | |
3359 | quotes breaking many magic commands. |
|
3370 | quotes breaking many magic commands. | |
3360 |
|
3371 | |||
3361 | * setup.py: added note about ignoring the syntax error messages at |
|
3372 | * setup.py: added note about ignoring the syntax error messages at | |
3362 | installation. |
|
3373 | installation. | |
3363 |
|
3374 | |||
3364 | * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished |
|
3375 | * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished | |
3365 | streamlining the gnuplot interface, now there's only one magic @gp. |
|
3376 | streamlining the gnuplot interface, now there's only one magic @gp. | |
3366 |
|
3377 | |||
3367 | 2002-03-17 Fernando Perez <fperez@colorado.edu> |
|
3378 | 2002-03-17 Fernando Perez <fperez@colorado.edu> | |
3368 |
|
3379 | |||
3369 | * IPython/UserConfig/magic_gnuplot.py: new name for the |
|
3380 | * IPython/UserConfig/magic_gnuplot.py: new name for the | |
3370 | example-magic_pm.py file. Much enhanced system, now with a shell |
|
3381 | example-magic_pm.py file. Much enhanced system, now with a shell | |
3371 | for communicating directly with gnuplot, one command at a time. |
|
3382 | for communicating directly with gnuplot, one command at a time. | |
3372 |
|
3383 | |||
3373 | * IPython/Magic.py (Magic.magic_run): added option -n to prevent |
|
3384 | * IPython/Magic.py (Magic.magic_run): added option -n to prevent | |
3374 | setting __name__=='__main__'. |
|
3385 | setting __name__=='__main__'. | |
3375 |
|
3386 | |||
3376 | * IPython/UserConfig/example-magic_pm.py (magic_pm): Added |
|
3387 | * IPython/UserConfig/example-magic_pm.py (magic_pm): Added | |
3377 | mini-shell for accessing gnuplot from inside ipython. Should |
|
3388 | mini-shell for accessing gnuplot from inside ipython. Should | |
3378 | extend it later for grace access too. Inspired by Arnd's |
|
3389 | extend it later for grace access too. Inspired by Arnd's | |
3379 | suggestion. |
|
3390 | suggestion. | |
3380 |
|
3391 | |||
3381 | * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when |
|
3392 | * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when | |
3382 | calling magic functions with () in their arguments. Thanks to Arnd |
|
3393 | calling magic functions with () in their arguments. Thanks to Arnd | |
3383 | Baecker for pointing this to me. |
|
3394 | Baecker for pointing this to me. | |
3384 |
|
3395 | |||
3385 | * IPython/numutils.py (sum_flat): fixed bug. Would recurse |
|
3396 | * IPython/numutils.py (sum_flat): fixed bug. Would recurse | |
3386 | infinitely for integer or complex arrays (only worked with floats). |
|
3397 | infinitely for integer or complex arrays (only worked with floats). | |
3387 |
|
3398 | |||
3388 | 2002-03-16 Fernando Perez <fperez@colorado.edu> |
|
3399 | 2002-03-16 Fernando Perez <fperez@colorado.edu> | |
3389 |
|
3400 | |||
3390 | * setup.py: Merged setup and setup_windows into a single script |
|
3401 | * setup.py: Merged setup and setup_windows into a single script | |
3391 | which properly handles things for windows users. |
|
3402 | which properly handles things for windows users. | |
3392 |
|
3403 | |||
3393 | 2002-03-15 Fernando Perez <fperez@colorado.edu> |
|
3404 | 2002-03-15 Fernando Perez <fperez@colorado.edu> | |
3394 |
|
3405 | |||
3395 | * Big change to the manual: now the magics are all automatically |
|
3406 | * Big change to the manual: now the magics are all automatically | |
3396 | documented. This information is generated from their docstrings |
|
3407 | documented. This information is generated from their docstrings | |
3397 | and put in a latex file included by the manual lyx file. This way |
|
3408 | and put in a latex file included by the manual lyx file. This way | |
3398 | we get always up to date information for the magics. The manual |
|
3409 | we get always up to date information for the magics. The manual | |
3399 | now also has proper version information, also auto-synced. |
|
3410 | now also has proper version information, also auto-synced. | |
3400 |
|
3411 | |||
3401 | For this to work, an undocumented --magic_docstrings option was added. |
|
3412 | For this to work, an undocumented --magic_docstrings option was added. | |
3402 |
|
3413 | |||
3403 | 2002-03-13 Fernando Perez <fperez@colorado.edu> |
|
3414 | 2002-03-13 Fernando Perez <fperez@colorado.edu> | |
3404 |
|
3415 | |||
3405 | * IPython/ultraTB.py (TermColors): fixed problem with dark colors |
|
3416 | * IPython/ultraTB.py (TermColors): fixed problem with dark colors | |
3406 | under CDE terminals. An explicit ;2 color reset is needed in the escapes. |
|
3417 | under CDE terminals. An explicit ;2 color reset is needed in the escapes. | |
3407 |
|
3418 | |||
3408 | 2002-03-12 Fernando Perez <fperez@colorado.edu> |
|
3419 | 2002-03-12 Fernando Perez <fperez@colorado.edu> | |
3409 |
|
3420 | |||
3410 | * IPython/ultraTB.py (TermColors): changed color escapes again to |
|
3421 | * IPython/ultraTB.py (TermColors): changed color escapes again to | |
3411 | fix the (old, reintroduced) line-wrapping bug. Basically, if |
|
3422 | fix the (old, reintroduced) line-wrapping bug. Basically, if | |
3412 | \001..\002 aren't given in the color escapes, lines get wrapped |
|
3423 | \001..\002 aren't given in the color escapes, lines get wrapped | |
3413 | weirdly. But giving those screws up old xterms and emacs terms. So |
|
3424 | weirdly. But giving those screws up old xterms and emacs terms. So | |
3414 | I added some logic for emacs terms to be ok, but I can't identify old |
|
3425 | I added some logic for emacs terms to be ok, but I can't identify old | |
3415 | xterms separately ($TERM=='xterm' for many terminals, like konsole). |
|
3426 | xterms separately ($TERM=='xterm' for many terminals, like konsole). | |
3416 |
|
3427 | |||
3417 | 2002-03-10 Fernando Perez <fperez@colorado.edu> |
|
3428 | 2002-03-10 Fernando Perez <fperez@colorado.edu> | |
3418 |
|
3429 | |||
3419 | * IPython/usage.py (__doc__): Various documentation cleanups and |
|
3430 | * IPython/usage.py (__doc__): Various documentation cleanups and | |
3420 | updates, both in usage docstrings and in the manual. |
|
3431 | updates, both in usage docstrings and in the manual. | |
3421 |
|
3432 | |||
3422 | * IPython/Prompts.py (CachedOutput.set_colors): cleanups for |
|
3433 | * IPython/Prompts.py (CachedOutput.set_colors): cleanups for | |
3423 | handling of caching. Set minimum acceptabe value for having a |
|
3434 | handling of caching. Set minimum acceptabe value for having a | |
3424 | cache at 20 values. |
|
3435 | cache at 20 values. | |
3425 |
|
3436 | |||
3426 | * IPython/iplib.py (InteractiveShell.user_setup): moved the |
|
3437 | * IPython/iplib.py (InteractiveShell.user_setup): moved the | |
3427 | install_first_time function to a method, renamed it and added an |
|
3438 | install_first_time function to a method, renamed it and added an | |
3428 | 'upgrade' mode. Now people can update their config directory with |
|
3439 | 'upgrade' mode. Now people can update their config directory with | |
3429 | a simple command line switch (-upgrade, also new). |
|
3440 | a simple command line switch (-upgrade, also new). | |
3430 |
|
3441 | |||
3431 | * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to |
|
3442 | * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to | |
3432 | @file (convenient for automagic users under Python >= 2.2). |
|
3443 | @file (convenient for automagic users under Python >= 2.2). | |
3433 | Removed @files (it seemed more like a plural than an abbrev. of |
|
3444 | Removed @files (it seemed more like a plural than an abbrev. of | |
3434 | 'file show'). |
|
3445 | 'file show'). | |
3435 |
|
3446 | |||
3436 | * IPython/iplib.py (install_first_time): Fixed crash if there were |
|
3447 | * IPython/iplib.py (install_first_time): Fixed crash if there were | |
3437 | backup files ('~') in .ipython/ install directory. |
|
3448 | backup files ('~') in .ipython/ install directory. | |
3438 |
|
3449 | |||
3439 | * IPython/ipmaker.py (make_IPython): fixes for new prompt |
|
3450 | * IPython/ipmaker.py (make_IPython): fixes for new prompt | |
3440 | system. Things look fine, but these changes are fairly |
|
3451 | system. Things look fine, but these changes are fairly | |
3441 | intrusive. Test them for a few days. |
|
3452 | intrusive. Test them for a few days. | |
3442 |
|
3453 | |||
3443 | * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of |
|
3454 | * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of | |
3444 | the prompts system. Now all in/out prompt strings are user |
|
3455 | the prompts system. Now all in/out prompt strings are user | |
3445 | controllable. This is particularly useful for embedding, as one |
|
3456 | controllable. This is particularly useful for embedding, as one | |
3446 | can tag embedded instances with particular prompts. |
|
3457 | can tag embedded instances with particular prompts. | |
3447 |
|
3458 | |||
3448 | Also removed global use of sys.ps1/2, which now allows nested |
|
3459 | Also removed global use of sys.ps1/2, which now allows nested | |
3449 | embeddings without any problems. Added command-line options for |
|
3460 | embeddings without any problems. Added command-line options for | |
3450 | the prompt strings. |
|
3461 | the prompt strings. | |
3451 |
|
3462 | |||
3452 | 2002-03-08 Fernando Perez <fperez@colorado.edu> |
|
3463 | 2002-03-08 Fernando Perez <fperez@colorado.edu> | |
3453 |
|
3464 | |||
3454 | * IPython/UserConfig/example-embed-short.py (ipshell): added |
|
3465 | * IPython/UserConfig/example-embed-short.py (ipshell): added | |
3455 | example file with the bare minimum code for embedding. |
|
3466 | example file with the bare minimum code for embedding. | |
3456 |
|
3467 | |||
3457 | * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added |
|
3468 | * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added | |
3458 | functionality for the embeddable shell to be activated/deactivated |
|
3469 | functionality for the embeddable shell to be activated/deactivated | |
3459 | either globally or at each call. |
|
3470 | either globally or at each call. | |
3460 |
|
3471 | |||
3461 | * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of |
|
3472 | * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of | |
3462 | rewriting the prompt with '--->' for auto-inputs with proper |
|
3473 | rewriting the prompt with '--->' for auto-inputs with proper | |
3463 | coloring. Now the previous UGLY hack in handle_auto() is gone, and |
|
3474 | coloring. Now the previous UGLY hack in handle_auto() is gone, and | |
3464 | this is handled by the prompts class itself, as it should. |
|
3475 | this is handled by the prompts class itself, as it should. | |
3465 |
|
3476 | |||
3466 | 2002-03-05 Fernando Perez <fperez@colorado.edu> |
|
3477 | 2002-03-05 Fernando Perez <fperez@colorado.edu> | |
3467 |
|
3478 | |||
3468 | * IPython/Magic.py (Magic.magic_logstart): Changed @log to |
|
3479 | * IPython/Magic.py (Magic.magic_logstart): Changed @log to | |
3469 | @logstart to avoid name clashes with the math log function. |
|
3480 | @logstart to avoid name clashes with the math log function. | |
3470 |
|
3481 | |||
3471 | * Big updates to X/Emacs section of the manual. |
|
3482 | * Big updates to X/Emacs section of the manual. | |
3472 |
|
3483 | |||
3473 | * Removed ipython_emacs. Milan explained to me how to pass |
|
3484 | * Removed ipython_emacs. Milan explained to me how to pass | |
3474 | arguments to ipython through Emacs. Some day I'm going to end up |
|
3485 | arguments to ipython through Emacs. Some day I'm going to end up | |
3475 | learning some lisp... |
|
3486 | learning some lisp... | |
3476 |
|
3487 | |||
3477 | 2002-03-04 Fernando Perez <fperez@colorado.edu> |
|
3488 | 2002-03-04 Fernando Perez <fperez@colorado.edu> | |
3478 |
|
3489 | |||
3479 | * IPython/ipython_emacs: Created script to be used as the |
|
3490 | * IPython/ipython_emacs: Created script to be used as the | |
3480 | py-python-command Emacs variable so we can pass IPython |
|
3491 | py-python-command Emacs variable so we can pass IPython | |
3481 | parameters. I can't figure out how to tell Emacs directly to pass |
|
3492 | parameters. I can't figure out how to tell Emacs directly to pass | |
3482 | parameters to IPython, so a dummy shell script will do it. |
|
3493 | parameters to IPython, so a dummy shell script will do it. | |
3483 |
|
3494 | |||
3484 | Other enhancements made for things to work better under Emacs' |
|
3495 | Other enhancements made for things to work better under Emacs' | |
3485 | various types of terminals. Many thanks to Milan Zamazal |
|
3496 | various types of terminals. Many thanks to Milan Zamazal | |
3486 | <pdm-AT-zamazal.org> for all the suggestions and pointers. |
|
3497 | <pdm-AT-zamazal.org> for all the suggestions and pointers. | |
3487 |
|
3498 | |||
3488 | 2002-03-01 Fernando Perez <fperez@colorado.edu> |
|
3499 | 2002-03-01 Fernando Perez <fperez@colorado.edu> | |
3489 |
|
3500 | |||
3490 | * IPython/ipmaker.py (make_IPython): added a --readline! option so |
|
3501 | * IPython/ipmaker.py (make_IPython): added a --readline! option so | |
3491 | that loading of readline is now optional. This gives better |
|
3502 | that loading of readline is now optional. This gives better | |
3492 | control to emacs users. |
|
3503 | control to emacs users. | |
3493 |
|
3504 | |||
3494 | * IPython/ultraTB.py (__date__): Modified color escape sequences |
|
3505 | * IPython/ultraTB.py (__date__): Modified color escape sequences | |
3495 | and now things work fine under xterm and in Emacs' term buffers |
|
3506 | and now things work fine under xterm and in Emacs' term buffers | |
3496 | (though not shell ones). Well, in emacs you get colors, but all |
|
3507 | (though not shell ones). Well, in emacs you get colors, but all | |
3497 | seem to be 'light' colors (no difference between dark and light |
|
3508 | seem to be 'light' colors (no difference between dark and light | |
3498 | ones). But the garbage chars are gone, and also in xterms. It |
|
3509 | ones). But the garbage chars are gone, and also in xterms. It | |
3499 | seems that now I'm using 'cleaner' ansi sequences. |
|
3510 | seems that now I'm using 'cleaner' ansi sequences. | |
3500 |
|
3511 | |||
3501 | 2002-02-21 Fernando Perez <fperez@colorado.edu> |
|
3512 | 2002-02-21 Fernando Perez <fperez@colorado.edu> | |
3502 |
|
3513 | |||
3503 | * Released 0.2.7 (mainly to publish the scoping fix). |
|
3514 | * Released 0.2.7 (mainly to publish the scoping fix). | |
3504 |
|
3515 | |||
3505 | * IPython/Logger.py (Logger.logstate): added. A corresponding |
|
3516 | * IPython/Logger.py (Logger.logstate): added. A corresponding | |
3506 | @logstate magic was created. |
|
3517 | @logstate magic was created. | |
3507 |
|
3518 | |||
3508 | * IPython/Magic.py: fixed nested scoping problem under Python |
|
3519 | * IPython/Magic.py: fixed nested scoping problem under Python | |
3509 | 2.1.x (automagic wasn't working). |
|
3520 | 2.1.x (automagic wasn't working). | |
3510 |
|
3521 | |||
3511 | 2002-02-20 Fernando Perez <fperez@colorado.edu> |
|
3522 | 2002-02-20 Fernando Perez <fperez@colorado.edu> | |
3512 |
|
3523 | |||
3513 | * Released 0.2.6. |
|
3524 | * Released 0.2.6. | |
3514 |
|
3525 | |||
3515 | * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet' |
|
3526 | * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet' | |
3516 | option so that logs can come out without any headers at all. |
|
3527 | option so that logs can come out without any headers at all. | |
3517 |
|
3528 | |||
3518 | * IPython/UserConfig/ipythonrc-scipy.py: created a profile for |
|
3529 | * IPython/UserConfig/ipythonrc-scipy.py: created a profile for | |
3519 | SciPy. |
|
3530 | SciPy. | |
3520 |
|
3531 | |||
3521 | * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so |
|
3532 | * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so | |
3522 | that embedded IPython calls don't require vars() to be explicitly |
|
3533 | that embedded IPython calls don't require vars() to be explicitly | |
3523 | passed. Now they are extracted from the caller's frame (code |
|
3534 | passed. Now they are extracted from the caller's frame (code | |
3524 | snatched from Eric Jones' weave). Added better documentation to |
|
3535 | snatched from Eric Jones' weave). Added better documentation to | |
3525 | the section on embedding and the example file. |
|
3536 | the section on embedding and the example file. | |
3526 |
|
3537 | |||
3527 | * IPython/genutils.py (page): Changed so that under emacs, it just |
|
3538 | * IPython/genutils.py (page): Changed so that under emacs, it just | |
3528 | prints the string. You can then page up and down in the emacs |
|
3539 | prints the string. You can then page up and down in the emacs | |
3529 | buffer itself. This is how the builtin help() works. |
|
3540 | buffer itself. This is how the builtin help() works. | |
3530 |
|
3541 | |||
3531 | * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with |
|
3542 | * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with | |
3532 | macro scoping: macros need to be executed in the user's namespace |
|
3543 | macro scoping: macros need to be executed in the user's namespace | |
3533 | to work as if they had been typed by the user. |
|
3544 | to work as if they had been typed by the user. | |
3534 |
|
3545 | |||
3535 | * IPython/Magic.py (Magic.magic_macro): Changed macros so they |
|
3546 | * IPython/Magic.py (Magic.magic_macro): Changed macros so they | |
3536 | execute automatically (no need to type 'exec...'). They then |
|
3547 | execute automatically (no need to type 'exec...'). They then | |
3537 | behave like 'true macros'. The printing system was also modified |
|
3548 | behave like 'true macros'. The printing system was also modified | |
3538 | for this to work. |
|
3549 | for this to work. | |
3539 |
|
3550 | |||
3540 | 2002-02-19 Fernando Perez <fperez@colorado.edu> |
|
3551 | 2002-02-19 Fernando Perez <fperez@colorado.edu> | |
3541 |
|
3552 | |||
3542 | * IPython/genutils.py (page_file): new function for paging files |
|
3553 | * IPython/genutils.py (page_file): new function for paging files | |
3543 | in an OS-independent way. Also necessary for file viewing to work |
|
3554 | in an OS-independent way. Also necessary for file viewing to work | |
3544 | well inside Emacs buffers. |
|
3555 | well inside Emacs buffers. | |
3545 | (page): Added checks for being in an emacs buffer. |
|
3556 | (page): Added checks for being in an emacs buffer. | |
3546 | (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed |
|
3557 | (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed | |
3547 | same bug in iplib. |
|
3558 | same bug in iplib. | |
3548 |
|
3559 | |||
3549 | 2002-02-18 Fernando Perez <fperez@colorado.edu> |
|
3560 | 2002-02-18 Fernando Perez <fperez@colorado.edu> | |
3550 |
|
3561 | |||
3551 | * IPython/iplib.py (InteractiveShell.init_readline): modified use |
|
3562 | * IPython/iplib.py (InteractiveShell.init_readline): modified use | |
3552 | of readline so that IPython can work inside an Emacs buffer. |
|
3563 | of readline so that IPython can work inside an Emacs buffer. | |
3553 |
|
3564 | |||
3554 | * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to |
|
3565 | * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to | |
3555 | method signatures (they weren't really bugs, but it looks cleaner |
|
3566 | method signatures (they weren't really bugs, but it looks cleaner | |
3556 | and keeps PyChecker happy). |
|
3567 | and keeps PyChecker happy). | |
3557 |
|
3568 | |||
3558 | * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP |
|
3569 | * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP | |
3559 | for implementing various user-defined hooks. Currently only |
|
3570 | for implementing various user-defined hooks. Currently only | |
3560 | display is done. |
|
3571 | display is done. | |
3561 |
|
3572 | |||
3562 | * IPython/Prompts.py (CachedOutput._display): changed display |
|
3573 | * IPython/Prompts.py (CachedOutput._display): changed display | |
3563 | functions so that they can be dynamically changed by users easily. |
|
3574 | functions so that they can be dynamically changed by users easily. | |
3564 |
|
3575 | |||
3565 | * IPython/Extensions/numeric_formats.py (num_display): added an |
|
3576 | * IPython/Extensions/numeric_formats.py (num_display): added an | |
3566 | extension for printing NumPy arrays in flexible manners. It |
|
3577 | extension for printing NumPy arrays in flexible manners. It | |
3567 | doesn't do anything yet, but all the structure is in |
|
3578 | doesn't do anything yet, but all the structure is in | |
3568 | place. Ultimately the plan is to implement output format control |
|
3579 | place. Ultimately the plan is to implement output format control | |
3569 | like in Octave. |
|
3580 | like in Octave. | |
3570 |
|
3581 | |||
3571 | * IPython/Magic.py (Magic.lsmagic): changed so that bound magic |
|
3582 | * IPython/Magic.py (Magic.lsmagic): changed so that bound magic | |
3572 | methods are found at run-time by all the automatic machinery. |
|
3583 | methods are found at run-time by all the automatic machinery. | |
3573 |
|
3584 | |||
3574 | 2002-02-17 Fernando Perez <fperez@colorado.edu> |
|
3585 | 2002-02-17 Fernando Perez <fperez@colorado.edu> | |
3575 |
|
3586 | |||
3576 | * setup_Windows.py (make_shortcut): documented. Cleaned up the |
|
3587 | * setup_Windows.py (make_shortcut): documented. Cleaned up the | |
3577 | whole file a little. |
|
3588 | whole file a little. | |
3578 |
|
3589 | |||
3579 | * ToDo: closed this document. Now there's a new_design.lyx |
|
3590 | * ToDo: closed this document. Now there's a new_design.lyx | |
3580 | document for all new ideas. Added making a pdf of it for the |
|
3591 | document for all new ideas. Added making a pdf of it for the | |
3581 | end-user distro. |
|
3592 | end-user distro. | |
3582 |
|
3593 | |||
3583 | * IPython/Logger.py (Logger.switch_log): Created this to replace |
|
3594 | * IPython/Logger.py (Logger.switch_log): Created this to replace | |
3584 | logon() and logoff(). It also fixes a nasty crash reported by |
|
3595 | logon() and logoff(). It also fixes a nasty crash reported by | |
3585 | Philip Hisley <compsys-AT-starpower.net>. Many thanks to him. |
|
3596 | Philip Hisley <compsys-AT-starpower.net>. Many thanks to him. | |
3586 |
|
3597 | |||
3587 | * IPython/iplib.py (complete): got auto-completion to work with |
|
3598 | * IPython/iplib.py (complete): got auto-completion to work with | |
3588 | automagic (I had wanted this for a long time). |
|
3599 | automagic (I had wanted this for a long time). | |
3589 |
|
3600 | |||
3590 | * IPython/Magic.py (Magic.magic_files): Added @files as an alias |
|
3601 | * IPython/Magic.py (Magic.magic_files): Added @files as an alias | |
3591 | to @file, since file() is now a builtin and clashes with automagic |
|
3602 | to @file, since file() is now a builtin and clashes with automagic | |
3592 | for @file. |
|
3603 | for @file. | |
3593 |
|
3604 | |||
3594 | * Made some new files: Prompts, CrashHandler, Magic, Logger. All |
|
3605 | * Made some new files: Prompts, CrashHandler, Magic, Logger. All | |
3595 | of this was previously in iplib, which had grown to more than 2000 |
|
3606 | of this was previously in iplib, which had grown to more than 2000 | |
3596 | lines, way too long. No new functionality, but it makes managing |
|
3607 | lines, way too long. No new functionality, but it makes managing | |
3597 | the code a bit easier. |
|
3608 | the code a bit easier. | |
3598 |
|
3609 | |||
3599 | * IPython/iplib.py (IPythonCrashHandler.__call__): Added version |
|
3610 | * IPython/iplib.py (IPythonCrashHandler.__call__): Added version | |
3600 | information to crash reports. |
|
3611 | information to crash reports. | |
3601 |
|
3612 | |||
3602 | 2002-02-12 Fernando Perez <fperez@colorado.edu> |
|
3613 | 2002-02-12 Fernando Perez <fperez@colorado.edu> | |
3603 |
|
3614 | |||
3604 | * Released 0.2.5. |
|
3615 | * Released 0.2.5. | |
3605 |
|
3616 | |||
3606 | 2002-02-11 Fernando Perez <fperez@colorado.edu> |
|
3617 | 2002-02-11 Fernando Perez <fperez@colorado.edu> | |
3607 |
|
3618 | |||
3608 | * Wrote a relatively complete Windows installer. It puts |
|
3619 | * Wrote a relatively complete Windows installer. It puts | |
3609 | everything in place, creates Start Menu entries and fixes the |
|
3620 | everything in place, creates Start Menu entries and fixes the | |
3610 | color issues. Nothing fancy, but it works. |
|
3621 | color issues. Nothing fancy, but it works. | |
3611 |
|
3622 | |||
3612 | 2002-02-10 Fernando Perez <fperez@colorado.edu> |
|
3623 | 2002-02-10 Fernando Perez <fperez@colorado.edu> | |
3613 |
|
3624 | |||
3614 | * IPython/iplib.py (InteractiveShell.safe_execfile): added an |
|
3625 | * IPython/iplib.py (InteractiveShell.safe_execfile): added an | |
3615 | os.path.expanduser() call so that we can type @run ~/myfile.py and |
|
3626 | os.path.expanduser() call so that we can type @run ~/myfile.py and | |
3616 | have thigs work as expected. |
|
3627 | have thigs work as expected. | |
3617 |
|
3628 | |||
3618 | * IPython/genutils.py (page): fixed exception handling so things |
|
3629 | * IPython/genutils.py (page): fixed exception handling so things | |
3619 | work both in Unix and Windows correctly. Quitting a pager triggers |
|
3630 | work both in Unix and Windows correctly. Quitting a pager triggers | |
3620 | an IOError/broken pipe in Unix, and in windows not finding a pager |
|
3631 | an IOError/broken pipe in Unix, and in windows not finding a pager | |
3621 | is also an IOError, so I had to actually look at the return value |
|
3632 | is also an IOError, so I had to actually look at the return value | |
3622 | of the exception, not just the exception itself. Should be ok now. |
|
3633 | of the exception, not just the exception itself. Should be ok now. | |
3623 |
|
3634 | |||
3624 | * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme): |
|
3635 | * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme): | |
3625 | modified to allow case-insensitive color scheme changes. |
|
3636 | modified to allow case-insensitive color scheme changes. | |
3626 |
|
3637 | |||
3627 | 2002-02-09 Fernando Perez <fperez@colorado.edu> |
|
3638 | 2002-02-09 Fernando Perez <fperez@colorado.edu> | |
3628 |
|
3639 | |||
3629 | * IPython/genutils.py (native_line_ends): new function to leave |
|
3640 | * IPython/genutils.py (native_line_ends): new function to leave | |
3630 | user config files with os-native line-endings. |
|
3641 | user config files with os-native line-endings. | |
3631 |
|
3642 | |||
3632 | * README and manual updates. |
|
3643 | * README and manual updates. | |
3633 |
|
3644 | |||
3634 | * IPython/genutils.py: fixed unicode bug: use types.StringTypes |
|
3645 | * IPython/genutils.py: fixed unicode bug: use types.StringTypes | |
3635 | instead of StringType to catch Unicode strings. |
|
3646 | instead of StringType to catch Unicode strings. | |
3636 |
|
3647 | |||
3637 | * IPython/genutils.py (filefind): fixed bug for paths with |
|
3648 | * IPython/genutils.py (filefind): fixed bug for paths with | |
3638 | embedded spaces (very common in Windows). |
|
3649 | embedded spaces (very common in Windows). | |
3639 |
|
3650 | |||
3640 | * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc |
|
3651 | * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc | |
3641 | files under Windows, so that they get automatically associated |
|
3652 | files under Windows, so that they get automatically associated | |
3642 | with a text editor. Windows makes it a pain to handle |
|
3653 | with a text editor. Windows makes it a pain to handle | |
3643 | extension-less files. |
|
3654 | extension-less files. | |
3644 |
|
3655 | |||
3645 | * IPython/iplib.py (InteractiveShell.init_readline): Made the |
|
3656 | * IPython/iplib.py (InteractiveShell.init_readline): Made the | |
3646 | warning about readline only occur for Posix. In Windows there's no |
|
3657 | warning about readline only occur for Posix. In Windows there's no | |
3647 | way to get readline, so why bother with the warning. |
|
3658 | way to get readline, so why bother with the warning. | |
3648 |
|
3659 | |||
3649 | * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__ |
|
3660 | * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__ | |
3650 | for __str__ instead of dir(self), since dir() changed in 2.2. |
|
3661 | for __str__ instead of dir(self), since dir() changed in 2.2. | |
3651 |
|
3662 | |||
3652 | * Ported to Windows! Tested on XP, I suspect it should work fine |
|
3663 | * Ported to Windows! Tested on XP, I suspect it should work fine | |
3653 | on NT/2000, but I don't think it will work on 98 et al. That |
|
3664 | on NT/2000, but I don't think it will work on 98 et al. That | |
3654 | series of Windows is such a piece of junk anyway that I won't try |
|
3665 | series of Windows is such a piece of junk anyway that I won't try | |
3655 | porting it there. The XP port was straightforward, showed a few |
|
3666 | porting it there. The XP port was straightforward, showed a few | |
3656 | bugs here and there (fixed all), in particular some string |
|
3667 | bugs here and there (fixed all), in particular some string | |
3657 | handling stuff which required considering Unicode strings (which |
|
3668 | handling stuff which required considering Unicode strings (which | |
3658 | Windows uses). This is good, but hasn't been too tested :) No |
|
3669 | Windows uses). This is good, but hasn't been too tested :) No | |
3659 | fancy installer yet, I'll put a note in the manual so people at |
|
3670 | fancy installer yet, I'll put a note in the manual so people at | |
3660 | least make manually a shortcut. |
|
3671 | least make manually a shortcut. | |
3661 |
|
3672 | |||
3662 | * IPython/iplib.py (Magic.magic_colors): Unified the color options |
|
3673 | * IPython/iplib.py (Magic.magic_colors): Unified the color options | |
3663 | into a single one, "colors". This now controls both prompt and |
|
3674 | into a single one, "colors". This now controls both prompt and | |
3664 | exception color schemes, and can be changed both at startup |
|
3675 | exception color schemes, and can be changed both at startup | |
3665 | (either via command-line switches or via ipythonrc files) and at |
|
3676 | (either via command-line switches or via ipythonrc files) and at | |
3666 | runtime, with @colors. |
|
3677 | runtime, with @colors. | |
3667 | (Magic.magic_run): renamed @prun to @run and removed the old |
|
3678 | (Magic.magic_run): renamed @prun to @run and removed the old | |
3668 | @run. The two were too similar to warrant keeping both. |
|
3679 | @run. The two were too similar to warrant keeping both. | |
3669 |
|
3680 | |||
3670 | 2002-02-03 Fernando Perez <fperez@colorado.edu> |
|
3681 | 2002-02-03 Fernando Perez <fperez@colorado.edu> | |
3671 |
|
3682 | |||
3672 | * IPython/iplib.py (install_first_time): Added comment on how to |
|
3683 | * IPython/iplib.py (install_first_time): Added comment on how to | |
3673 | configure the color options for first-time users. Put a <return> |
|
3684 | configure the color options for first-time users. Put a <return> | |
3674 | request at the end so that small-terminal users get a chance to |
|
3685 | request at the end so that small-terminal users get a chance to | |
3675 | read the startup info. |
|
3686 | read the startup info. | |
3676 |
|
3687 | |||
3677 | 2002-01-23 Fernando Perez <fperez@colorado.edu> |
|
3688 | 2002-01-23 Fernando Perez <fperez@colorado.edu> | |
3678 |
|
3689 | |||
3679 | * IPython/iplib.py (CachedOutput.update): Changed output memory |
|
3690 | * IPython/iplib.py (CachedOutput.update): Changed output memory | |
3680 | variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For |
|
3691 | variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For | |
3681 | input history we still use _i. Did this b/c these variable are |
|
3692 | input history we still use _i. Did this b/c these variable are | |
3682 | very commonly used in interactive work, so the less we need to |
|
3693 | very commonly used in interactive work, so the less we need to | |
3683 | type the better off we are. |
|
3694 | type the better off we are. | |
3684 | (Magic.magic_prun): updated @prun to better handle the namespaces |
|
3695 | (Magic.magic_prun): updated @prun to better handle the namespaces | |
3685 | the file will run in, including a fix for __name__ not being set |
|
3696 | the file will run in, including a fix for __name__ not being set | |
3686 | before. |
|
3697 | before. | |
3687 |
|
3698 | |||
3688 | 2002-01-20 Fernando Perez <fperez@colorado.edu> |
|
3699 | 2002-01-20 Fernando Perez <fperez@colorado.edu> | |
3689 |
|
3700 | |||
3690 | * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of |
|
3701 | * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of | |
3691 | extra garbage for Python 2.2. Need to look more carefully into |
|
3702 | extra garbage for Python 2.2. Need to look more carefully into | |
3692 | this later. |
|
3703 | this later. | |
3693 |
|
3704 | |||
3694 | 2002-01-19 Fernando Perez <fperez@colorado.edu> |
|
3705 | 2002-01-19 Fernando Perez <fperez@colorado.edu> | |
3695 |
|
3706 | |||
3696 | * IPython/iplib.py (InteractiveShell.showtraceback): fixed to |
|
3707 | * IPython/iplib.py (InteractiveShell.showtraceback): fixed to | |
3697 | display SyntaxError exceptions properly formatted when they occur |
|
3708 | display SyntaxError exceptions properly formatted when they occur | |
3698 | (they can be triggered by imported code). |
|
3709 | (they can be triggered by imported code). | |
3699 |
|
3710 | |||
3700 | 2002-01-18 Fernando Perez <fperez@colorado.edu> |
|
3711 | 2002-01-18 Fernando Perez <fperez@colorado.edu> | |
3701 |
|
3712 | |||
3702 | * IPython/iplib.py (InteractiveShell.safe_execfile): now |
|
3713 | * IPython/iplib.py (InteractiveShell.safe_execfile): now | |
3703 | SyntaxError exceptions are reported nicely formatted, instead of |
|
3714 | SyntaxError exceptions are reported nicely formatted, instead of | |
3704 | spitting out only offset information as before. |
|
3715 | spitting out only offset information as before. | |
3705 | (Magic.magic_prun): Added the @prun function for executing |
|
3716 | (Magic.magic_prun): Added the @prun function for executing | |
3706 | programs with command line args inside IPython. |
|
3717 | programs with command line args inside IPython. | |
3707 |
|
3718 | |||
3708 | 2002-01-16 Fernando Perez <fperez@colorado.edu> |
|
3719 | 2002-01-16 Fernando Perez <fperez@colorado.edu> | |
3709 |
|
3720 | |||
3710 | * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist |
|
3721 | * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist | |
3711 | to *not* include the last item given in a range. This brings their |
|
3722 | to *not* include the last item given in a range. This brings their | |
3712 | behavior in line with Python's slicing: |
|
3723 | behavior in line with Python's slicing: | |
3713 | a[n1:n2] -> a[n1]...a[n2-1] |
|
3724 | a[n1:n2] -> a[n1]...a[n2-1] | |
3714 | It may be a bit less convenient, but I prefer to stick to Python's |
|
3725 | It may be a bit less convenient, but I prefer to stick to Python's | |
3715 | conventions *everywhere*, so users never have to wonder. |
|
3726 | conventions *everywhere*, so users never have to wonder. | |
3716 | (Magic.magic_macro): Added @macro function to ease the creation of |
|
3727 | (Magic.magic_macro): Added @macro function to ease the creation of | |
3717 | macros. |
|
3728 | macros. | |
3718 |
|
3729 | |||
3719 | 2002-01-05 Fernando Perez <fperez@colorado.edu> |
|
3730 | 2002-01-05 Fernando Perez <fperez@colorado.edu> | |
3720 |
|
3731 | |||
3721 | * Released 0.2.4. |
|
3732 | * Released 0.2.4. | |
3722 |
|
3733 | |||
3723 | * IPython/iplib.py (Magic.magic_pdef): |
|
3734 | * IPython/iplib.py (Magic.magic_pdef): | |
3724 | (InteractiveShell.safe_execfile): report magic lines and error |
|
3735 | (InteractiveShell.safe_execfile): report magic lines and error | |
3725 | lines without line numbers so one can easily copy/paste them for |
|
3736 | lines without line numbers so one can easily copy/paste them for | |
3726 | re-execution. |
|
3737 | re-execution. | |
3727 |
|
3738 | |||
3728 | * Updated manual with recent changes. |
|
3739 | * Updated manual with recent changes. | |
3729 |
|
3740 | |||
3730 | * IPython/iplib.py (Magic.magic_oinfo): added constructor |
|
3741 | * IPython/iplib.py (Magic.magic_oinfo): added constructor | |
3731 | docstring printing when class? is called. Very handy for knowing |
|
3742 | docstring printing when class? is called. Very handy for knowing | |
3732 | how to create class instances (as long as __init__ is well |
|
3743 | how to create class instances (as long as __init__ is well | |
3733 | documented, of course :) |
|
3744 | documented, of course :) | |
3734 | (Magic.magic_doc): print both class and constructor docstrings. |
|
3745 | (Magic.magic_doc): print both class and constructor docstrings. | |
3735 | (Magic.magic_pdef): give constructor info if passed a class and |
|
3746 | (Magic.magic_pdef): give constructor info if passed a class and | |
3736 | __call__ info for callable object instances. |
|
3747 | __call__ info for callable object instances. | |
3737 |
|
3748 | |||
3738 | 2002-01-04 Fernando Perez <fperez@colorado.edu> |
|
3749 | 2002-01-04 Fernando Perez <fperez@colorado.edu> | |
3739 |
|
3750 | |||
3740 | * Made deep_reload() off by default. It doesn't always work |
|
3751 | * Made deep_reload() off by default. It doesn't always work | |
3741 | exactly as intended, so it's probably safer to have it off. It's |
|
3752 | exactly as intended, so it's probably safer to have it off. It's | |
3742 | still available as dreload() anyway, so nothing is lost. |
|
3753 | still available as dreload() anyway, so nothing is lost. | |
3743 |
|
3754 | |||
3744 | 2002-01-02 Fernando Perez <fperez@colorado.edu> |
|
3755 | 2002-01-02 Fernando Perez <fperez@colorado.edu> | |
3745 |
|
3756 | |||
3746 | * Released 0.2.3 (contacted R.Singh at CU about biopython course, |
|
3757 | * Released 0.2.3 (contacted R.Singh at CU about biopython course, | |
3747 | so I wanted an updated release). |
|
3758 | so I wanted an updated release). | |
3748 |
|
3759 | |||
3749 | 2001-12-27 Fernando Perez <fperez@colorado.edu> |
|
3760 | 2001-12-27 Fernando Perez <fperez@colorado.edu> | |
3750 |
|
3761 | |||
3751 | * IPython/iplib.py (InteractiveShell.interact): Added the original |
|
3762 | * IPython/iplib.py (InteractiveShell.interact): Added the original | |
3752 | code from 'code.py' for this module in order to change the |
|
3763 | code from 'code.py' for this module in order to change the | |
3753 | handling of a KeyboardInterrupt. This was necessary b/c otherwise |
|
3764 | handling of a KeyboardInterrupt. This was necessary b/c otherwise | |
3754 | the history cache would break when the user hit Ctrl-C, and |
|
3765 | the history cache would break when the user hit Ctrl-C, and | |
3755 | interact() offers no way to add any hooks to it. |
|
3766 | interact() offers no way to add any hooks to it. | |
3756 |
|
3767 | |||
3757 | 2001-12-23 Fernando Perez <fperez@colorado.edu> |
|
3768 | 2001-12-23 Fernando Perez <fperez@colorado.edu> | |
3758 |
|
3769 | |||
3759 | * setup.py: added check for 'MANIFEST' before trying to remove |
|
3770 | * setup.py: added check for 'MANIFEST' before trying to remove | |
3760 | it. Thanks to Sean Reifschneider. |
|
3771 | it. Thanks to Sean Reifschneider. | |
3761 |
|
3772 | |||
3762 | 2001-12-22 Fernando Perez <fperez@colorado.edu> |
|
3773 | 2001-12-22 Fernando Perez <fperez@colorado.edu> | |
3763 |
|
3774 | |||
3764 | * Released 0.2.2. |
|
3775 | * Released 0.2.2. | |
3765 |
|
3776 | |||
3766 | * Finished (reasonably) writing the manual. Later will add the |
|
3777 | * Finished (reasonably) writing the manual. Later will add the | |
3767 | python-standard navigation stylesheets, but for the time being |
|
3778 | python-standard navigation stylesheets, but for the time being | |
3768 | it's fairly complete. Distribution will include html and pdf |
|
3779 | it's fairly complete. Distribution will include html and pdf | |
3769 | versions. |
|
3780 | versions. | |
3770 |
|
3781 | |||
3771 | * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu |
|
3782 | * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu | |
3772 | (MayaVi author). |
|
3783 | (MayaVi author). | |
3773 |
|
3784 | |||
3774 | 2001-12-21 Fernando Perez <fperez@colorado.edu> |
|
3785 | 2001-12-21 Fernando Perez <fperez@colorado.edu> | |
3775 |
|
3786 | |||
3776 | * Released 0.2.1. Barring any nasty bugs, this is it as far as a |
|
3787 | * Released 0.2.1. Barring any nasty bugs, this is it as far as a | |
3777 | good public release, I think (with the manual and the distutils |
|
3788 | good public release, I think (with the manual and the distutils | |
3778 | installer). The manual can use some work, but that can go |
|
3789 | installer). The manual can use some work, but that can go | |
3779 | slowly. Otherwise I think it's quite nice for end users. Next |
|
3790 | slowly. Otherwise I think it's quite nice for end users. Next | |
3780 | summer, rewrite the guts of it... |
|
3791 | summer, rewrite the guts of it... | |
3781 |
|
3792 | |||
3782 | * Changed format of ipythonrc files to use whitespace as the |
|
3793 | * Changed format of ipythonrc files to use whitespace as the | |
3783 | separator instead of an explicit '='. Cleaner. |
|
3794 | separator instead of an explicit '='. Cleaner. | |
3784 |
|
3795 | |||
3785 | 2001-12-20 Fernando Perez <fperez@colorado.edu> |
|
3796 | 2001-12-20 Fernando Perez <fperez@colorado.edu> | |
3786 |
|
3797 | |||
3787 | * Started a manual in LyX. For now it's just a quick merge of the |
|
3798 | * Started a manual in LyX. For now it's just a quick merge of the | |
3788 | various internal docstrings and READMEs. Later it may grow into a |
|
3799 | various internal docstrings and READMEs. Later it may grow into a | |
3789 | nice, full-blown manual. |
|
3800 | nice, full-blown manual. | |
3790 |
|
3801 | |||
3791 | * Set up a distutils based installer. Installation should now be |
|
3802 | * Set up a distutils based installer. Installation should now be | |
3792 | trivially simple for end-users. |
|
3803 | trivially simple for end-users. | |
3793 |
|
3804 | |||
3794 | 2001-12-11 Fernando Perez <fperez@colorado.edu> |
|
3805 | 2001-12-11 Fernando Perez <fperez@colorado.edu> | |
3795 |
|
3806 | |||
3796 | * Released 0.2.0. First public release, announced it at |
|
3807 | * Released 0.2.0. First public release, announced it at | |
3797 | comp.lang.python. From now on, just bugfixes... |
|
3808 | comp.lang.python. From now on, just bugfixes... | |
3798 |
|
3809 | |||
3799 | * Went through all the files, set copyright/license notices and |
|
3810 | * Went through all the files, set copyright/license notices and | |
3800 | cleaned up things. Ready for release. |
|
3811 | cleaned up things. Ready for release. | |
3801 |
|
3812 | |||
3802 | 2001-12-10 Fernando Perez <fperez@colorado.edu> |
|
3813 | 2001-12-10 Fernando Perez <fperez@colorado.edu> | |
3803 |
|
3814 | |||
3804 | * Changed the first-time installer not to use tarfiles. It's more |
|
3815 | * Changed the first-time installer not to use tarfiles. It's more | |
3805 | robust now and less unix-dependent. Also makes it easier for |
|
3816 | robust now and less unix-dependent. Also makes it easier for | |
3806 | people to later upgrade versions. |
|
3817 | people to later upgrade versions. | |
3807 |
|
3818 | |||
3808 | * Changed @exit to @abort to reflect the fact that it's pretty |
|
3819 | * Changed @exit to @abort to reflect the fact that it's pretty | |
3809 | brutal (a sys.exit()). The difference between @abort and Ctrl-D |
|
3820 | brutal (a sys.exit()). The difference between @abort and Ctrl-D | |
3810 | becomes significant only when IPyhton is embedded: in that case, |
|
3821 | becomes significant only when IPyhton is embedded: in that case, | |
3811 | C-D closes IPython only, but @abort kills the enclosing program |
|
3822 | C-D closes IPython only, but @abort kills the enclosing program | |
3812 | too (unless it had called IPython inside a try catching |
|
3823 | too (unless it had called IPython inside a try catching | |
3813 | SystemExit). |
|
3824 | SystemExit). | |
3814 |
|
3825 | |||
3815 | * Created Shell module which exposes the actuall IPython Shell |
|
3826 | * Created Shell module which exposes the actuall IPython Shell | |
3816 | classes, currently the normal and the embeddable one. This at |
|
3827 | classes, currently the normal and the embeddable one. This at | |
3817 | least offers a stable interface we won't need to change when |
|
3828 | least offers a stable interface we won't need to change when | |
3818 | (later) the internals are rewritten. That rewrite will be confined |
|
3829 | (later) the internals are rewritten. That rewrite will be confined | |
3819 | to iplib and ipmaker, but the Shell interface should remain as is. |
|
3830 | to iplib and ipmaker, but the Shell interface should remain as is. | |
3820 |
|
3831 | |||
3821 | * Added embed module which offers an embeddable IPShell object, |
|
3832 | * Added embed module which offers an embeddable IPShell object, | |
3822 | useful to fire up IPython *inside* a running program. Great for |
|
3833 | useful to fire up IPython *inside* a running program. Great for | |
3823 | debugging or dynamical data analysis. |
|
3834 | debugging or dynamical data analysis. | |
3824 |
|
3835 | |||
3825 | 2001-12-08 Fernando Perez <fperez@colorado.edu> |
|
3836 | 2001-12-08 Fernando Perez <fperez@colorado.edu> | |
3826 |
|
3837 | |||
3827 | * Fixed small bug preventing seeing info from methods of defined |
|
3838 | * Fixed small bug preventing seeing info from methods of defined | |
3828 | objects (incorrect namespace in _ofind()). |
|
3839 | objects (incorrect namespace in _ofind()). | |
3829 |
|
3840 | |||
3830 | * Documentation cleanup. Moved the main usage docstrings to a |
|
3841 | * Documentation cleanup. Moved the main usage docstrings to a | |
3831 | separate file, usage.py (cleaner to maintain, and hopefully in the |
|
3842 | separate file, usage.py (cleaner to maintain, and hopefully in the | |
3832 | future some perlpod-like way of producing interactive, man and |
|
3843 | future some perlpod-like way of producing interactive, man and | |
3833 | html docs out of it will be found). |
|
3844 | html docs out of it will be found). | |
3834 |
|
3845 | |||
3835 | * Added @profile to see your profile at any time. |
|
3846 | * Added @profile to see your profile at any time. | |
3836 |
|
3847 | |||
3837 | * Added @p as an alias for 'print'. It's especially convenient if |
|
3848 | * Added @p as an alias for 'print'. It's especially convenient if | |
3838 | using automagic ('p x' prints x). |
|
3849 | using automagic ('p x' prints x). | |
3839 |
|
3850 | |||
3840 | * Small cleanups and fixes after a pychecker run. |
|
3851 | * Small cleanups and fixes after a pychecker run. | |
3841 |
|
3852 | |||
3842 | * Changed the @cd command to handle @cd - and @cd -<n> for |
|
3853 | * Changed the @cd command to handle @cd - and @cd -<n> for | |
3843 | visiting any directory in _dh. |
|
3854 | visiting any directory in _dh. | |
3844 |
|
3855 | |||
3845 | * Introduced _dh, a history of visited directories. @dhist prints |
|
3856 | * Introduced _dh, a history of visited directories. @dhist prints | |
3846 | it out with numbers. |
|
3857 | it out with numbers. | |
3847 |
|
3858 | |||
3848 | 2001-12-07 Fernando Perez <fperez@colorado.edu> |
|
3859 | 2001-12-07 Fernando Perez <fperez@colorado.edu> | |
3849 |
|
3860 | |||
3850 | * Released 0.1.22 |
|
3861 | * Released 0.1.22 | |
3851 |
|
3862 | |||
3852 | * Made initialization a bit more robust against invalid color |
|
3863 | * Made initialization a bit more robust against invalid color | |
3853 | options in user input (exit, not traceback-crash). |
|
3864 | options in user input (exit, not traceback-crash). | |
3854 |
|
3865 | |||
3855 | * Changed the bug crash reporter to write the report only in the |
|
3866 | * Changed the bug crash reporter to write the report only in the | |
3856 | user's .ipython directory. That way IPython won't litter people's |
|
3867 | user's .ipython directory. That way IPython won't litter people's | |
3857 | hard disks with crash files all over the place. Also print on |
|
3868 | hard disks with crash files all over the place. Also print on | |
3858 | screen the necessary mail command. |
|
3869 | screen the necessary mail command. | |
3859 |
|
3870 | |||
3860 | * With the new ultraTB, implemented LightBG color scheme for light |
|
3871 | * With the new ultraTB, implemented LightBG color scheme for light | |
3861 | background terminals. A lot of people like white backgrounds, so I |
|
3872 | background terminals. A lot of people like white backgrounds, so I | |
3862 | guess we should at least give them something readable. |
|
3873 | guess we should at least give them something readable. | |
3863 |
|
3874 | |||
3864 | 2001-12-06 Fernando Perez <fperez@colorado.edu> |
|
3875 | 2001-12-06 Fernando Perez <fperez@colorado.edu> | |
3865 |
|
3876 | |||
3866 | * Modified the structure of ultraTB. Now there's a proper class |
|
3877 | * Modified the structure of ultraTB. Now there's a proper class | |
3867 | for tables of color schemes which allow adding schemes easily and |
|
3878 | for tables of color schemes which allow adding schemes easily and | |
3868 | switching the active scheme without creating a new instance every |
|
3879 | switching the active scheme without creating a new instance every | |
3869 | time (which was ridiculous). The syntax for creating new schemes |
|
3880 | time (which was ridiculous). The syntax for creating new schemes | |
3870 | is also cleaner. I think ultraTB is finally done, with a clean |
|
3881 | is also cleaner. I think ultraTB is finally done, with a clean | |
3871 | class structure. Names are also much cleaner (now there's proper |
|
3882 | class structure. Names are also much cleaner (now there's proper | |
3872 | color tables, no need for every variable to also have 'color' in |
|
3883 | color tables, no need for every variable to also have 'color' in | |
3873 | its name). |
|
3884 | its name). | |
3874 |
|
3885 | |||
3875 | * Broke down genutils into separate files. Now genutils only |
|
3886 | * Broke down genutils into separate files. Now genutils only | |
3876 | contains utility functions, and classes have been moved to their |
|
3887 | contains utility functions, and classes have been moved to their | |
3877 | own files (they had enough independent functionality to warrant |
|
3888 | own files (they had enough independent functionality to warrant | |
3878 | it): ConfigLoader, OutputTrap, Struct. |
|
3889 | it): ConfigLoader, OutputTrap, Struct. | |
3879 |
|
3890 | |||
3880 | 2001-12-05 Fernando Perez <fperez@colorado.edu> |
|
3891 | 2001-12-05 Fernando Perez <fperez@colorado.edu> | |
3881 |
|
3892 | |||
3882 | * IPython turns 21! Released version 0.1.21, as a candidate for |
|
3893 | * IPython turns 21! Released version 0.1.21, as a candidate for | |
3883 | public consumption. If all goes well, release in a few days. |
|
3894 | public consumption. If all goes well, release in a few days. | |
3884 |
|
3895 | |||
3885 | * Fixed path bug (files in Extensions/ directory wouldn't be found |
|
3896 | * Fixed path bug (files in Extensions/ directory wouldn't be found | |
3886 | unless IPython/ was explicitly in sys.path). |
|
3897 | unless IPython/ was explicitly in sys.path). | |
3887 |
|
3898 | |||
3888 | * Extended the FlexCompleter class as MagicCompleter to allow |
|
3899 | * Extended the FlexCompleter class as MagicCompleter to allow | |
3889 | completion of @-starting lines. |
|
3900 | completion of @-starting lines. | |
3890 |
|
3901 | |||
3891 | * Created __release__.py file as a central repository for release |
|
3902 | * Created __release__.py file as a central repository for release | |
3892 | info that other files can read from. |
|
3903 | info that other files can read from. | |
3893 |
|
3904 | |||
3894 | * Fixed small bug in logging: when logging was turned on in |
|
3905 | * Fixed small bug in logging: when logging was turned on in | |
3895 | mid-session, old lines with special meanings (!@?) were being |
|
3906 | mid-session, old lines with special meanings (!@?) were being | |
3896 | logged without the prepended comment, which is necessary since |
|
3907 | logged without the prepended comment, which is necessary since | |
3897 | they are not truly valid python syntax. This should make session |
|
3908 | they are not truly valid python syntax. This should make session | |
3898 | restores produce less errors. |
|
3909 | restores produce less errors. | |
3899 |
|
3910 | |||
3900 | * The namespace cleanup forced me to make a FlexCompleter class |
|
3911 | * The namespace cleanup forced me to make a FlexCompleter class | |
3901 | which is nothing but a ripoff of rlcompleter, but with selectable |
|
3912 | which is nothing but a ripoff of rlcompleter, but with selectable | |
3902 | namespace (rlcompleter only works in __main__.__dict__). I'll try |
|
3913 | namespace (rlcompleter only works in __main__.__dict__). I'll try | |
3903 | to submit a note to the authors to see if this change can be |
|
3914 | to submit a note to the authors to see if this change can be | |
3904 | incorporated in future rlcompleter releases (Dec.6: done) |
|
3915 | incorporated in future rlcompleter releases (Dec.6: done) | |
3905 |
|
3916 | |||
3906 | * More fixes to namespace handling. It was a mess! Now all |
|
3917 | * More fixes to namespace handling. It was a mess! Now all | |
3907 | explicit references to __main__.__dict__ are gone (except when |
|
3918 | explicit references to __main__.__dict__ are gone (except when | |
3908 | really needed) and everything is handled through the namespace |
|
3919 | really needed) and everything is handled through the namespace | |
3909 | dicts in the IPython instance. We seem to be getting somewhere |
|
3920 | dicts in the IPython instance. We seem to be getting somewhere | |
3910 | with this, finally... |
|
3921 | with this, finally... | |
3911 |
|
3922 | |||
3912 | * Small documentation updates. |
|
3923 | * Small documentation updates. | |
3913 |
|
3924 | |||
3914 | * Created the Extensions directory under IPython (with an |
|
3925 | * Created the Extensions directory under IPython (with an | |
3915 | __init__.py). Put the PhysicalQ stuff there. This directory should |
|
3926 | __init__.py). Put the PhysicalQ stuff there. This directory should | |
3916 | be used for all special-purpose extensions. |
|
3927 | be used for all special-purpose extensions. | |
3917 |
|
3928 | |||
3918 | * File renaming: |
|
3929 | * File renaming: | |
3919 | ipythonlib --> ipmaker |
|
3930 | ipythonlib --> ipmaker | |
3920 | ipplib --> iplib |
|
3931 | ipplib --> iplib | |
3921 | This makes a bit more sense in terms of what these files actually do. |
|
3932 | This makes a bit more sense in terms of what these files actually do. | |
3922 |
|
3933 | |||
3923 | * Moved all the classes and functions in ipythonlib to ipplib, so |
|
3934 | * Moved all the classes and functions in ipythonlib to ipplib, so | |
3924 | now ipythonlib only has make_IPython(). This will ease up its |
|
3935 | now ipythonlib only has make_IPython(). This will ease up its | |
3925 | splitting in smaller functional chunks later. |
|
3936 | splitting in smaller functional chunks later. | |
3926 |
|
3937 | |||
3927 | * Cleaned up (done, I think) output of @whos. Better column |
|
3938 | * Cleaned up (done, I think) output of @whos. Better column | |
3928 | formatting, and now shows str(var) for as much as it can, which is |
|
3939 | formatting, and now shows str(var) for as much as it can, which is | |
3929 | typically what one gets with a 'print var'. |
|
3940 | typically what one gets with a 'print var'. | |
3930 |
|
3941 | |||
3931 | 2001-12-04 Fernando Perez <fperez@colorado.edu> |
|
3942 | 2001-12-04 Fernando Perez <fperez@colorado.edu> | |
3932 |
|
3943 | |||
3933 | * Fixed namespace problems. Now builtin/IPyhton/user names get |
|
3944 | * Fixed namespace problems. Now builtin/IPyhton/user names get | |
3934 | properly reported in their namespace. Internal namespace handling |
|
3945 | properly reported in their namespace. Internal namespace handling | |
3935 | is finally getting decent (not perfect yet, but much better than |
|
3946 | is finally getting decent (not perfect yet, but much better than | |
3936 | the ad-hoc mess we had). |
|
3947 | the ad-hoc mess we had). | |
3937 |
|
3948 | |||
3938 | * Removed -exit option. If people just want to run a python |
|
3949 | * Removed -exit option. If people just want to run a python | |
3939 | script, that's what the normal interpreter is for. Less |
|
3950 | script, that's what the normal interpreter is for. Less | |
3940 | unnecessary options, less chances for bugs. |
|
3951 | unnecessary options, less chances for bugs. | |
3941 |
|
3952 | |||
3942 | * Added a crash handler which generates a complete post-mortem if |
|
3953 | * Added a crash handler which generates a complete post-mortem if | |
3943 | IPython crashes. This will help a lot in tracking bugs down the |
|
3954 | IPython crashes. This will help a lot in tracking bugs down the | |
3944 | road. |
|
3955 | road. | |
3945 |
|
3956 | |||
3946 | * Fixed nasty bug in auto-evaluation part of prefilter(). Names |
|
3957 | * Fixed nasty bug in auto-evaluation part of prefilter(). Names | |
3947 | which were boud to functions being reassigned would bypass the |
|
3958 | which were boud to functions being reassigned would bypass the | |
3948 | logger, breaking the sync of _il with the prompt counter. This |
|
3959 | logger, breaking the sync of _il with the prompt counter. This | |
3949 | would then crash IPython later when a new line was logged. |
|
3960 | would then crash IPython later when a new line was logged. | |
3950 |
|
3961 | |||
3951 | 2001-12-02 Fernando Perez <fperez@colorado.edu> |
|
3962 | 2001-12-02 Fernando Perez <fperez@colorado.edu> | |
3952 |
|
3963 | |||
3953 | * Made IPython a package. This means people don't have to clutter |
|
3964 | * Made IPython a package. This means people don't have to clutter | |
3954 | their sys.path with yet another directory. Changed the INSTALL |
|
3965 | their sys.path with yet another directory. Changed the INSTALL | |
3955 | file accordingly. |
|
3966 | file accordingly. | |
3956 |
|
3967 | |||
3957 | * Cleaned up the output of @who_ls, @who and @whos. @who_ls now |
|
3968 | * Cleaned up the output of @who_ls, @who and @whos. @who_ls now | |
3958 | sorts its output (so @who shows it sorted) and @whos formats the |
|
3969 | sorts its output (so @who shows it sorted) and @whos formats the | |
3959 | table according to the width of the first column. Nicer, easier to |
|
3970 | table according to the width of the first column. Nicer, easier to | |
3960 | read. Todo: write a generic table_format() which takes a list of |
|
3971 | read. Todo: write a generic table_format() which takes a list of | |
3961 | lists and prints it nicely formatted, with optional row/column |
|
3972 | lists and prints it nicely formatted, with optional row/column | |
3962 | separators and proper padding and justification. |
|
3973 | separators and proper padding and justification. | |
3963 |
|
3974 | |||
3964 | * Released 0.1.20 |
|
3975 | * Released 0.1.20 | |
3965 |
|
3976 | |||
3966 | * Fixed bug in @log which would reverse the inputcache list (a |
|
3977 | * Fixed bug in @log which would reverse the inputcache list (a | |
3967 | copy operation was missing). |
|
3978 | copy operation was missing). | |
3968 |
|
3979 | |||
3969 | * Code cleanup. @config was changed to use page(). Better, since |
|
3980 | * Code cleanup. @config was changed to use page(). Better, since | |
3970 | its output is always quite long. |
|
3981 | its output is always quite long. | |
3971 |
|
3982 | |||
3972 | * Itpl is back as a dependency. I was having too many problems |
|
3983 | * Itpl is back as a dependency. I was having too many problems | |
3973 | getting the parametric aliases to work reliably, and it's just |
|
3984 | getting the parametric aliases to work reliably, and it's just | |
3974 | easier to code weird string operations with it than playing %()s |
|
3985 | easier to code weird string operations with it than playing %()s | |
3975 | games. It's only ~6k, so I don't think it's too big a deal. |
|
3986 | games. It's only ~6k, so I don't think it's too big a deal. | |
3976 |
|
3987 | |||
3977 | * Found (and fixed) a very nasty bug with history. !lines weren't |
|
3988 | * Found (and fixed) a very nasty bug with history. !lines weren't | |
3978 | getting cached, and the out of sync caches would crash |
|
3989 | getting cached, and the out of sync caches would crash | |
3979 | IPython. Fixed it by reorganizing the prefilter/handlers/logger |
|
3990 | IPython. Fixed it by reorganizing the prefilter/handlers/logger | |
3980 | division of labor a bit better. Bug fixed, cleaner structure. |
|
3991 | division of labor a bit better. Bug fixed, cleaner structure. | |
3981 |
|
3992 | |||
3982 | 2001-12-01 Fernando Perez <fperez@colorado.edu> |
|
3993 | 2001-12-01 Fernando Perez <fperez@colorado.edu> | |
3983 |
|
3994 | |||
3984 | * Released 0.1.19 |
|
3995 | * Released 0.1.19 | |
3985 |
|
3996 | |||
3986 | * Added option -n to @hist to prevent line number printing. Much |
|
3997 | * Added option -n to @hist to prevent line number printing. Much | |
3987 | easier to copy/paste code this way. |
|
3998 | easier to copy/paste code this way. | |
3988 |
|
3999 | |||
3989 | * Created global _il to hold the input list. Allows easy |
|
4000 | * Created global _il to hold the input list. Allows easy | |
3990 | re-execution of blocks of code by slicing it (inspired by Janko's |
|
4001 | re-execution of blocks of code by slicing it (inspired by Janko's | |
3991 | comment on 'macros'). |
|
4002 | comment on 'macros'). | |
3992 |
|
4003 | |||
3993 | * Small fixes and doc updates. |
|
4004 | * Small fixes and doc updates. | |
3994 |
|
4005 | |||
3995 | * Rewrote @history function (was @h). Renamed it to @hist, @h is |
|
4006 | * Rewrote @history function (was @h). Renamed it to @hist, @h is | |
3996 | much too fragile with automagic. Handles properly multi-line |
|
4007 | much too fragile with automagic. Handles properly multi-line | |
3997 | statements and takes parameters. |
|
4008 | statements and takes parameters. | |
3998 |
|
4009 | |||
3999 | 2001-11-30 Fernando Perez <fperez@colorado.edu> |
|
4010 | 2001-11-30 Fernando Perez <fperez@colorado.edu> | |
4000 |
|
4011 | |||
4001 | * Version 0.1.18 released. |
|
4012 | * Version 0.1.18 released. | |
4002 |
|
4013 | |||
4003 | * Fixed nasty namespace bug in initial module imports. |
|
4014 | * Fixed nasty namespace bug in initial module imports. | |
4004 |
|
4015 | |||
4005 | * Added copyright/license notes to all code files (except |
|
4016 | * Added copyright/license notes to all code files (except | |
4006 | DPyGetOpt). For the time being, LGPL. That could change. |
|
4017 | DPyGetOpt). For the time being, LGPL. That could change. | |
4007 |
|
4018 | |||
4008 | * Rewrote a much nicer README, updated INSTALL, cleaned up |
|
4019 | * Rewrote a much nicer README, updated INSTALL, cleaned up | |
4009 | ipythonrc-* samples. |
|
4020 | ipythonrc-* samples. | |
4010 |
|
4021 | |||
4011 | * Overall code/documentation cleanup. Basically ready for |
|
4022 | * Overall code/documentation cleanup. Basically ready for | |
4012 | release. Only remaining thing: licence decision (LGPL?). |
|
4023 | release. Only remaining thing: licence decision (LGPL?). | |
4013 |
|
4024 | |||
4014 | * Converted load_config to a class, ConfigLoader. Now recursion |
|
4025 | * Converted load_config to a class, ConfigLoader. Now recursion | |
4015 | control is better organized. Doesn't include the same file twice. |
|
4026 | control is better organized. Doesn't include the same file twice. | |
4016 |
|
4027 | |||
4017 | 2001-11-29 Fernando Perez <fperez@colorado.edu> |
|
4028 | 2001-11-29 Fernando Perez <fperez@colorado.edu> | |
4018 |
|
4029 | |||
4019 | * Got input history working. Changed output history variables from |
|
4030 | * Got input history working. Changed output history variables from | |
4020 | _p to _o so that _i is for input and _o for output. Just cleaner |
|
4031 | _p to _o so that _i is for input and _o for output. Just cleaner | |
4021 | convention. |
|
4032 | convention. | |
4022 |
|
4033 | |||
4023 | * Implemented parametric aliases. This pretty much allows the |
|
4034 | * Implemented parametric aliases. This pretty much allows the | |
4024 | alias system to offer full-blown shell convenience, I think. |
|
4035 | alias system to offer full-blown shell convenience, I think. | |
4025 |
|
4036 | |||
4026 | * Version 0.1.17 released, 0.1.18 opened. |
|
4037 | * Version 0.1.17 released, 0.1.18 opened. | |
4027 |
|
4038 | |||
4028 | * dot_ipython/ipythonrc (alias): added documentation. |
|
4039 | * dot_ipython/ipythonrc (alias): added documentation. | |
4029 | (xcolor): Fixed small bug (xcolors -> xcolor) |
|
4040 | (xcolor): Fixed small bug (xcolors -> xcolor) | |
4030 |
|
4041 | |||
4031 | * Changed the alias system. Now alias is a magic command to define |
|
4042 | * Changed the alias system. Now alias is a magic command to define | |
4032 | aliases just like the shell. Rationale: the builtin magics should |
|
4043 | aliases just like the shell. Rationale: the builtin magics should | |
4033 | be there for things deeply connected to IPython's |
|
4044 | be there for things deeply connected to IPython's | |
4034 | architecture. And this is a much lighter system for what I think |
|
4045 | architecture. And this is a much lighter system for what I think | |
4035 | is the really important feature: allowing users to define quickly |
|
4046 | is the really important feature: allowing users to define quickly | |
4036 | magics that will do shell things for them, so they can customize |
|
4047 | magics that will do shell things for them, so they can customize | |
4037 | IPython easily to match their work habits. If someone is really |
|
4048 | IPython easily to match their work habits. If someone is really | |
4038 | desperate to have another name for a builtin alias, they can |
|
4049 | desperate to have another name for a builtin alias, they can | |
4039 | always use __IP.magic_newname = __IP.magic_oldname. Hackish but |
|
4050 | always use __IP.magic_newname = __IP.magic_oldname. Hackish but | |
4040 | works. |
|
4051 | works. | |
4041 |
|
4052 | |||
4042 | 2001-11-28 Fernando Perez <fperez@colorado.edu> |
|
4053 | 2001-11-28 Fernando Perez <fperez@colorado.edu> | |
4043 |
|
4054 | |||
4044 | * Changed @file so that it opens the source file at the proper |
|
4055 | * Changed @file so that it opens the source file at the proper | |
4045 | line. Since it uses less, if your EDITOR environment is |
|
4056 | line. Since it uses less, if your EDITOR environment is | |
4046 | configured, typing v will immediately open your editor of choice |
|
4057 | configured, typing v will immediately open your editor of choice | |
4047 | right at the line where the object is defined. Not as quick as |
|
4058 | right at the line where the object is defined. Not as quick as | |
4048 | having a direct @edit command, but for all intents and purposes it |
|
4059 | having a direct @edit command, but for all intents and purposes it | |
4049 | works. And I don't have to worry about writing @edit to deal with |
|
4060 | works. And I don't have to worry about writing @edit to deal with | |
4050 | all the editors, less does that. |
|
4061 | all the editors, less does that. | |
4051 |
|
4062 | |||
4052 | * Version 0.1.16 released, 0.1.17 opened. |
|
4063 | * Version 0.1.16 released, 0.1.17 opened. | |
4053 |
|
4064 | |||
4054 | * Fixed some nasty bugs in the page/page_dumb combo that could |
|
4065 | * Fixed some nasty bugs in the page/page_dumb combo that could | |
4055 | crash IPython. |
|
4066 | crash IPython. | |
4056 |
|
4067 | |||
4057 | 2001-11-27 Fernando Perez <fperez@colorado.edu> |
|
4068 | 2001-11-27 Fernando Perez <fperez@colorado.edu> | |
4058 |
|
4069 | |||
4059 | * Version 0.1.15 released, 0.1.16 opened. |
|
4070 | * Version 0.1.15 released, 0.1.16 opened. | |
4060 |
|
4071 | |||
4061 | * Finally got ? and ?? to work for undefined things: now it's |
|
4072 | * Finally got ? and ?? to work for undefined things: now it's | |
4062 | possible to type {}.get? and get information about the get method |
|
4073 | possible to type {}.get? and get information about the get method | |
4063 | of dicts, or os.path? even if only os is defined (so technically |
|
4074 | of dicts, or os.path? even if only os is defined (so technically | |
4064 | os.path isn't). Works at any level. For example, after import os, |
|
4075 | os.path isn't). Works at any level. For example, after import os, | |
4065 | os?, os.path?, os.path.abspath? all work. This is great, took some |
|
4076 | os?, os.path?, os.path.abspath? all work. This is great, took some | |
4066 | work in _ofind. |
|
4077 | work in _ofind. | |
4067 |
|
4078 | |||
4068 | * Fixed more bugs with logging. The sanest way to do it was to add |
|
4079 | * Fixed more bugs with logging. The sanest way to do it was to add | |
4069 | to @log a 'mode' parameter. Killed two in one shot (this mode |
|
4080 | to @log a 'mode' parameter. Killed two in one shot (this mode | |
4070 | option was a request of Janko's). I think it's finally clean |
|
4081 | option was a request of Janko's). I think it's finally clean | |
4071 | (famous last words). |
|
4082 | (famous last words). | |
4072 |
|
4083 | |||
4073 | * Added a page_dumb() pager which does a decent job of paging on |
|
4084 | * Added a page_dumb() pager which does a decent job of paging on | |
4074 | screen, if better things (like less) aren't available. One less |
|
4085 | screen, if better things (like less) aren't available. One less | |
4075 | unix dependency (someday maybe somebody will port this to |
|
4086 | unix dependency (someday maybe somebody will port this to | |
4076 | windows). |
|
4087 | windows). | |
4077 |
|
4088 | |||
4078 | * Fixed problem in magic_log: would lock of logging out if log |
|
4089 | * Fixed problem in magic_log: would lock of logging out if log | |
4079 | creation failed (because it would still think it had succeeded). |
|
4090 | creation failed (because it would still think it had succeeded). | |
4080 |
|
4091 | |||
4081 | * Improved the page() function using curses to auto-detect screen |
|
4092 | * Improved the page() function using curses to auto-detect screen | |
4082 | size. Now it can make a much better decision on whether to print |
|
4093 | size. Now it can make a much better decision on whether to print | |
4083 | or page a string. Option screen_length was modified: a value 0 |
|
4094 | or page a string. Option screen_length was modified: a value 0 | |
4084 | means auto-detect, and that's the default now. |
|
4095 | means auto-detect, and that's the default now. | |
4085 |
|
4096 | |||
4086 | * Version 0.1.14 released, 0.1.15 opened. I think this is ready to |
|
4097 | * Version 0.1.14 released, 0.1.15 opened. I think this is ready to | |
4087 | go out. I'll test it for a few days, then talk to Janko about |
|
4098 | go out. I'll test it for a few days, then talk to Janko about | |
4088 | licences and announce it. |
|
4099 | licences and announce it. | |
4089 |
|
4100 | |||
4090 | * Fixed the length of the auto-generated ---> prompt which appears |
|
4101 | * Fixed the length of the auto-generated ---> prompt which appears | |
4091 | for auto-parens and auto-quotes. Getting this right isn't trivial, |
|
4102 | for auto-parens and auto-quotes. Getting this right isn't trivial, | |
4092 | with all the color escapes, different prompt types and optional |
|
4103 | with all the color escapes, different prompt types and optional | |
4093 | separators. But it seems to be working in all the combinations. |
|
4104 | separators. But it seems to be working in all the combinations. | |
4094 |
|
4105 | |||
4095 | 2001-11-26 Fernando Perez <fperez@colorado.edu> |
|
4106 | 2001-11-26 Fernando Perez <fperez@colorado.edu> | |
4096 |
|
4107 | |||
4097 | * Wrote a regexp filter to get option types from the option names |
|
4108 | * Wrote a regexp filter to get option types from the option names | |
4098 | string. This eliminates the need to manually keep two duplicate |
|
4109 | string. This eliminates the need to manually keep two duplicate | |
4099 | lists. |
|
4110 | lists. | |
4100 |
|
4111 | |||
4101 | * Removed the unneeded check_option_names. Now options are handled |
|
4112 | * Removed the unneeded check_option_names. Now options are handled | |
4102 | in a much saner manner and it's easy to visually check that things |
|
4113 | in a much saner manner and it's easy to visually check that things | |
4103 | are ok. |
|
4114 | are ok. | |
4104 |
|
4115 | |||
4105 | * Updated version numbers on all files I modified to carry a |
|
4116 | * Updated version numbers on all files I modified to carry a | |
4106 | notice so Janko and Nathan have clear version markers. |
|
4117 | notice so Janko and Nathan have clear version markers. | |
4107 |
|
4118 | |||
4108 | * Updated docstring for ultraTB with my changes. I should send |
|
4119 | * Updated docstring for ultraTB with my changes. I should send | |
4109 | this to Nathan. |
|
4120 | this to Nathan. | |
4110 |
|
4121 | |||
4111 | * Lots of small fixes. Ran everything through pychecker again. |
|
4122 | * Lots of small fixes. Ran everything through pychecker again. | |
4112 |
|
4123 | |||
4113 | * Made loading of deep_reload an cmd line option. If it's not too |
|
4124 | * Made loading of deep_reload an cmd line option. If it's not too | |
4114 | kosher, now people can just disable it. With -nodeep_reload it's |
|
4125 | kosher, now people can just disable it. With -nodeep_reload it's | |
4115 | still available as dreload(), it just won't overwrite reload(). |
|
4126 | still available as dreload(), it just won't overwrite reload(). | |
4116 |
|
4127 | |||
4117 | * Moved many options to the no| form (-opt and -noopt |
|
4128 | * Moved many options to the no| form (-opt and -noopt | |
4118 | accepted). Cleaner. |
|
4129 | accepted). Cleaner. | |
4119 |
|
4130 | |||
4120 | * Changed magic_log so that if called with no parameters, it uses |
|
4131 | * Changed magic_log so that if called with no parameters, it uses | |
4121 | 'rotate' mode. That way auto-generated logs aren't automatically |
|
4132 | 'rotate' mode. That way auto-generated logs aren't automatically | |
4122 | over-written. For normal logs, now a backup is made if it exists |
|
4133 | over-written. For normal logs, now a backup is made if it exists | |
4123 | (only 1 level of backups). A new 'backup' mode was added to the |
|
4134 | (only 1 level of backups). A new 'backup' mode was added to the | |
4124 | Logger class to support this. This was a request by Janko. |
|
4135 | Logger class to support this. This was a request by Janko. | |
4125 |
|
4136 | |||
4126 | * Added @logoff/@logon to stop/restart an active log. |
|
4137 | * Added @logoff/@logon to stop/restart an active log. | |
4127 |
|
4138 | |||
4128 | * Fixed a lot of bugs in log saving/replay. It was pretty |
|
4139 | * Fixed a lot of bugs in log saving/replay. It was pretty | |
4129 | broken. Now special lines (!@,/) appear properly in the command |
|
4140 | broken. Now special lines (!@,/) appear properly in the command | |
4130 | history after a log replay. |
|
4141 | history after a log replay. | |
4131 |
|
4142 | |||
4132 | * Tried and failed to implement full session saving via pickle. My |
|
4143 | * Tried and failed to implement full session saving via pickle. My | |
4133 | idea was to pickle __main__.__dict__, but modules can't be |
|
4144 | idea was to pickle __main__.__dict__, but modules can't be | |
4134 | pickled. This would be a better alternative to replaying logs, but |
|
4145 | pickled. This would be a better alternative to replaying logs, but | |
4135 | seems quite tricky to get to work. Changed -session to be called |
|
4146 | seems quite tricky to get to work. Changed -session to be called | |
4136 | -logplay, which more accurately reflects what it does. And if we |
|
4147 | -logplay, which more accurately reflects what it does. And if we | |
4137 | ever get real session saving working, -session is now available. |
|
4148 | ever get real session saving working, -session is now available. | |
4138 |
|
4149 | |||
4139 | * Implemented color schemes for prompts also. As for tracebacks, |
|
4150 | * Implemented color schemes for prompts also. As for tracebacks, | |
4140 | currently only NoColor and Linux are supported. But now the |
|
4151 | currently only NoColor and Linux are supported. But now the | |
4141 | infrastructure is in place, based on a generic ColorScheme |
|
4152 | infrastructure is in place, based on a generic ColorScheme | |
4142 | class. So writing and activating new schemes both for the prompts |
|
4153 | class. So writing and activating new schemes both for the prompts | |
4143 | and the tracebacks should be straightforward. |
|
4154 | and the tracebacks should be straightforward. | |
4144 |
|
4155 | |||
4145 | * Version 0.1.13 released, 0.1.14 opened. |
|
4156 | * Version 0.1.13 released, 0.1.14 opened. | |
4146 |
|
4157 | |||
4147 | * Changed handling of options for output cache. Now counter is |
|
4158 | * Changed handling of options for output cache. Now counter is | |
4148 | hardwired starting at 1 and one specifies the maximum number of |
|
4159 | hardwired starting at 1 and one specifies the maximum number of | |
4149 | entries *in the outcache* (not the max prompt counter). This is |
|
4160 | entries *in the outcache* (not the max prompt counter). This is | |
4150 | much better, since many statements won't increase the cache |
|
4161 | much better, since many statements won't increase the cache | |
4151 | count. It also eliminated some confusing options, now there's only |
|
4162 | count. It also eliminated some confusing options, now there's only | |
4152 | one: cache_size. |
|
4163 | one: cache_size. | |
4153 |
|
4164 | |||
4154 | * Added 'alias' magic function and magic_alias option in the |
|
4165 | * Added 'alias' magic function and magic_alias option in the | |
4155 | ipythonrc file. Now the user can easily define whatever names he |
|
4166 | ipythonrc file. Now the user can easily define whatever names he | |
4156 | wants for the magic functions without having to play weird |
|
4167 | wants for the magic functions without having to play weird | |
4157 | namespace games. This gives IPython a real shell-like feel. |
|
4168 | namespace games. This gives IPython a real shell-like feel. | |
4158 |
|
4169 | |||
4159 | * Fixed doc/?/?? for magics. Now all work, in all forms (explicit |
|
4170 | * Fixed doc/?/?? for magics. Now all work, in all forms (explicit | |
4160 | @ or not). |
|
4171 | @ or not). | |
4161 |
|
4172 | |||
4162 | This was one of the last remaining 'visible' bugs (that I know |
|
4173 | This was one of the last remaining 'visible' bugs (that I know | |
4163 | of). I think if I can clean up the session loading so it works |
|
4174 | of). I think if I can clean up the session loading so it works | |
4164 | 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first |
|
4175 | 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first | |
4165 | about licensing). |
|
4176 | about licensing). | |
4166 |
|
4177 | |||
4167 | 2001-11-25 Fernando Perez <fperez@colorado.edu> |
|
4178 | 2001-11-25 Fernando Perez <fperez@colorado.edu> | |
4168 |
|
4179 | |||
4169 | * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and |
|
4180 | * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and | |
4170 | there's a cleaner distinction between what ? and ?? show. |
|
4181 | there's a cleaner distinction between what ? and ?? show. | |
4171 |
|
4182 | |||
4172 | * Added screen_length option. Now the user can define his own |
|
4183 | * Added screen_length option. Now the user can define his own | |
4173 | screen size for page() operations. |
|
4184 | screen size for page() operations. | |
4174 |
|
4185 | |||
4175 | * Implemented magic shell-like functions with automatic code |
|
4186 | * Implemented magic shell-like functions with automatic code | |
4176 | generation. Now adding another function is just a matter of adding |
|
4187 | generation. Now adding another function is just a matter of adding | |
4177 | an entry to a dict, and the function is dynamically generated at |
|
4188 | an entry to a dict, and the function is dynamically generated at | |
4178 | run-time. Python has some really cool features! |
|
4189 | run-time. Python has some really cool features! | |
4179 |
|
4190 | |||
4180 | * Renamed many options to cleanup conventions a little. Now all |
|
4191 | * Renamed many options to cleanup conventions a little. Now all | |
4181 | are lowercase, and only underscores where needed. Also in the code |
|
4192 | are lowercase, and only underscores where needed. Also in the code | |
4182 | option name tables are clearer. |
|
4193 | option name tables are clearer. | |
4183 |
|
4194 | |||
4184 | * Changed prompts a little. Now input is 'In [n]:' instead of |
|
4195 | * Changed prompts a little. Now input is 'In [n]:' instead of | |
4185 | 'In[n]:='. This allows it the numbers to be aligned with the |
|
4196 | 'In[n]:='. This allows it the numbers to be aligned with the | |
4186 | Out[n] numbers, and removes usage of ':=' which doesn't exist in |
|
4197 | Out[n] numbers, and removes usage of ':=' which doesn't exist in | |
4187 | Python (it was a Mathematica thing). The '...' continuation prompt |
|
4198 | Python (it was a Mathematica thing). The '...' continuation prompt | |
4188 | was also changed a little to align better. |
|
4199 | was also changed a little to align better. | |
4189 |
|
4200 | |||
4190 | * Fixed bug when flushing output cache. Not all _p<n> variables |
|
4201 | * Fixed bug when flushing output cache. Not all _p<n> variables | |
4191 | exist, so their deletion needs to be wrapped in a try: |
|
4202 | exist, so their deletion needs to be wrapped in a try: | |
4192 |
|
4203 | |||
4193 | * Figured out how to properly use inspect.formatargspec() (it |
|
4204 | * Figured out how to properly use inspect.formatargspec() (it | |
4194 | requires the args preceded by *). So I removed all the code from |
|
4205 | requires the args preceded by *). So I removed all the code from | |
4195 | _get_pdef in Magic, which was just replicating that. |
|
4206 | _get_pdef in Magic, which was just replicating that. | |
4196 |
|
4207 | |||
4197 | * Added test to prefilter to allow redefining magic function names |
|
4208 | * Added test to prefilter to allow redefining magic function names | |
4198 | as variables. This is ok, since the @ form is always available, |
|
4209 | as variables. This is ok, since the @ form is always available, | |
4199 | but whe should allow the user to define a variable called 'ls' if |
|
4210 | but whe should allow the user to define a variable called 'ls' if | |
4200 | he needs it. |
|
4211 | he needs it. | |
4201 |
|
4212 | |||
4202 | * Moved the ToDo information from README into a separate ToDo. |
|
4213 | * Moved the ToDo information from README into a separate ToDo. | |
4203 |
|
4214 | |||
4204 | * General code cleanup and small bugfixes. I think it's close to a |
|
4215 | * General code cleanup and small bugfixes. I think it's close to a | |
4205 | state where it can be released, obviously with a big 'beta' |
|
4216 | state where it can be released, obviously with a big 'beta' | |
4206 | warning on it. |
|
4217 | warning on it. | |
4207 |
|
4218 | |||
4208 | * Got the magic function split to work. Now all magics are defined |
|
4219 | * Got the magic function split to work. Now all magics are defined | |
4209 | in a separate class. It just organizes things a bit, and now |
|
4220 | in a separate class. It just organizes things a bit, and now | |
4210 | Xemacs behaves nicer (it was choking on InteractiveShell b/c it |
|
4221 | Xemacs behaves nicer (it was choking on InteractiveShell b/c it | |
4211 | was too long). |
|
4222 | was too long). | |
4212 |
|
4223 | |||
4213 | * Changed @clear to @reset to avoid potential confusions with |
|
4224 | * Changed @clear to @reset to avoid potential confusions with | |
4214 | the shell command clear. Also renamed @cl to @clear, which does |
|
4225 | the shell command clear. Also renamed @cl to @clear, which does | |
4215 | exactly what people expect it to from their shell experience. |
|
4226 | exactly what people expect it to from their shell experience. | |
4216 |
|
4227 | |||
4217 | Added a check to the @reset command (since it's so |
|
4228 | Added a check to the @reset command (since it's so | |
4218 | destructive, it's probably a good idea to ask for confirmation). |
|
4229 | destructive, it's probably a good idea to ask for confirmation). | |
4219 | But now reset only works for full namespace resetting. Since the |
|
4230 | But now reset only works for full namespace resetting. Since the | |
4220 | del keyword is already there for deleting a few specific |
|
4231 | del keyword is already there for deleting a few specific | |
4221 | variables, I don't see the point of having a redundant magic |
|
4232 | variables, I don't see the point of having a redundant magic | |
4222 | function for the same task. |
|
4233 | function for the same task. | |
4223 |
|
4234 | |||
4224 | 2001-11-24 Fernando Perez <fperez@colorado.edu> |
|
4235 | 2001-11-24 Fernando Perez <fperez@colorado.edu> | |
4225 |
|
4236 | |||
4226 | * Updated the builtin docs (esp. the ? ones). |
|
4237 | * Updated the builtin docs (esp. the ? ones). | |
4227 |
|
4238 | |||
4228 | * Ran all the code through pychecker. Not terribly impressed with |
|
4239 | * Ran all the code through pychecker. Not terribly impressed with | |
4229 | it: lots of spurious warnings and didn't really find anything of |
|
4240 | it: lots of spurious warnings and didn't really find anything of | |
4230 | substance (just a few modules being imported and not used). |
|
4241 | substance (just a few modules being imported and not used). | |
4231 |
|
4242 | |||
4232 | * Implemented the new ultraTB functionality into IPython. New |
|
4243 | * Implemented the new ultraTB functionality into IPython. New | |
4233 | option: xcolors. This chooses color scheme. xmode now only selects |
|
4244 | option: xcolors. This chooses color scheme. xmode now only selects | |
4234 | between Plain and Verbose. Better orthogonality. |
|
4245 | between Plain and Verbose. Better orthogonality. | |
4235 |
|
4246 | |||
4236 | * Large rewrite of ultraTB. Much cleaner now, with a separation of |
|
4247 | * Large rewrite of ultraTB. Much cleaner now, with a separation of | |
4237 | mode and color scheme for the exception handlers. Now it's |
|
4248 | mode and color scheme for the exception handlers. Now it's | |
4238 | possible to have the verbose traceback with no coloring. |
|
4249 | possible to have the verbose traceback with no coloring. | |
4239 |
|
4250 | |||
4240 | 2001-11-23 Fernando Perez <fperez@colorado.edu> |
|
4251 | 2001-11-23 Fernando Perez <fperez@colorado.edu> | |
4241 |
|
4252 | |||
4242 | * Version 0.1.12 released, 0.1.13 opened. |
|
4253 | * Version 0.1.12 released, 0.1.13 opened. | |
4243 |
|
4254 | |||
4244 | * Removed option to set auto-quote and auto-paren escapes by |
|
4255 | * Removed option to set auto-quote and auto-paren escapes by | |
4245 | user. The chances of breaking valid syntax are just too high. If |
|
4256 | user. The chances of breaking valid syntax are just too high. If | |
4246 | someone *really* wants, they can always dig into the code. |
|
4257 | someone *really* wants, they can always dig into the code. | |
4247 |
|
4258 | |||
4248 | * Made prompt separators configurable. |
|
4259 | * Made prompt separators configurable. | |
4249 |
|
4260 | |||
4250 | 2001-11-22 Fernando Perez <fperez@colorado.edu> |
|
4261 | 2001-11-22 Fernando Perez <fperez@colorado.edu> | |
4251 |
|
4262 | |||
4252 | * Small bugfixes in many places. |
|
4263 | * Small bugfixes in many places. | |
4253 |
|
4264 | |||
4254 | * Removed the MyCompleter class from ipplib. It seemed redundant |
|
4265 | * Removed the MyCompleter class from ipplib. It seemed redundant | |
4255 | with the C-p,C-n history search functionality. Less code to |
|
4266 | with the C-p,C-n history search functionality. Less code to | |
4256 | maintain. |
|
4267 | maintain. | |
4257 |
|
4268 | |||
4258 | * Moved all the original ipython.py code into ipythonlib.py. Right |
|
4269 | * Moved all the original ipython.py code into ipythonlib.py. Right | |
4259 | now it's just one big dump into a function called make_IPython, so |
|
4270 | now it's just one big dump into a function called make_IPython, so | |
4260 | no real modularity has been gained. But at least it makes the |
|
4271 | no real modularity has been gained. But at least it makes the | |
4261 | wrapper script tiny, and since ipythonlib is a module, it gets |
|
4272 | wrapper script tiny, and since ipythonlib is a module, it gets | |
4262 | compiled and startup is much faster. |
|
4273 | compiled and startup is much faster. | |
4263 |
|
4274 | |||
4264 | This is a reasobably 'deep' change, so we should test it for a |
|
4275 | This is a reasobably 'deep' change, so we should test it for a | |
4265 | while without messing too much more with the code. |
|
4276 | while without messing too much more with the code. | |
4266 |
|
4277 | |||
4267 | 2001-11-21 Fernando Perez <fperez@colorado.edu> |
|
4278 | 2001-11-21 Fernando Perez <fperez@colorado.edu> | |
4268 |
|
4279 | |||
4269 | * Version 0.1.11 released, 0.1.12 opened for further work. |
|
4280 | * Version 0.1.11 released, 0.1.12 opened for further work. | |
4270 |
|
4281 | |||
4271 | * Removed dependency on Itpl. It was only needed in one place. It |
|
4282 | * Removed dependency on Itpl. It was only needed in one place. It | |
4272 | would be nice if this became part of python, though. It makes life |
|
4283 | would be nice if this became part of python, though. It makes life | |
4273 | *a lot* easier in some cases. |
|
4284 | *a lot* easier in some cases. | |
4274 |
|
4285 | |||
4275 | * Simplified the prefilter code a bit. Now all handlers are |
|
4286 | * Simplified the prefilter code a bit. Now all handlers are | |
4276 | expected to explicitly return a value (at least a blank string). |
|
4287 | expected to explicitly return a value (at least a blank string). | |
4277 |
|
4288 | |||
4278 | * Heavy edits in ipplib. Removed the help system altogether. Now |
|
4289 | * Heavy edits in ipplib. Removed the help system altogether. Now | |
4279 | obj?/?? is used for inspecting objects, a magic @doc prints |
|
4290 | obj?/?? is used for inspecting objects, a magic @doc prints | |
4280 | docstrings, and full-blown Python help is accessed via the 'help' |
|
4291 | docstrings, and full-blown Python help is accessed via the 'help' | |
4281 | keyword. This cleans up a lot of code (less to maintain) and does |
|
4292 | keyword. This cleans up a lot of code (less to maintain) and does | |
4282 | the job. Since 'help' is now a standard Python component, might as |
|
4293 | the job. Since 'help' is now a standard Python component, might as | |
4283 | well use it and remove duplicate functionality. |
|
4294 | well use it and remove duplicate functionality. | |
4284 |
|
4295 | |||
4285 | Also removed the option to use ipplib as a standalone program. By |
|
4296 | Also removed the option to use ipplib as a standalone program. By | |
4286 | now it's too dependent on other parts of IPython to function alone. |
|
4297 | now it's too dependent on other parts of IPython to function alone. | |
4287 |
|
4298 | |||
4288 | * Fixed bug in genutils.pager. It would crash if the pager was |
|
4299 | * Fixed bug in genutils.pager. It would crash if the pager was | |
4289 | exited immediately after opening (broken pipe). |
|
4300 | exited immediately after opening (broken pipe). | |
4290 |
|
4301 | |||
4291 | * Trimmed down the VerboseTB reporting a little. The header is |
|
4302 | * Trimmed down the VerboseTB reporting a little. The header is | |
4292 | much shorter now and the repeated exception arguments at the end |
|
4303 | much shorter now and the repeated exception arguments at the end | |
4293 | have been removed. For interactive use the old header seemed a bit |
|
4304 | have been removed. For interactive use the old header seemed a bit | |
4294 | excessive. |
|
4305 | excessive. | |
4295 |
|
4306 | |||
4296 | * Fixed small bug in output of @whos for variables with multi-word |
|
4307 | * Fixed small bug in output of @whos for variables with multi-word | |
4297 | types (only first word was displayed). |
|
4308 | types (only first word was displayed). | |
4298 |
|
4309 | |||
4299 | 2001-11-17 Fernando Perez <fperez@colorado.edu> |
|
4310 | 2001-11-17 Fernando Perez <fperez@colorado.edu> | |
4300 |
|
4311 | |||
4301 | * Version 0.1.10 released, 0.1.11 opened for further work. |
|
4312 | * Version 0.1.10 released, 0.1.11 opened for further work. | |
4302 |
|
4313 | |||
4303 | * Modified dirs and friends. dirs now *returns* the stack (not |
|
4314 | * Modified dirs and friends. dirs now *returns* the stack (not | |
4304 | prints), so one can manipulate it as a variable. Convenient to |
|
4315 | prints), so one can manipulate it as a variable. Convenient to | |
4305 | travel along many directories. |
|
4316 | travel along many directories. | |
4306 |
|
4317 | |||
4307 | * Fixed bug in magic_pdef: would only work with functions with |
|
4318 | * Fixed bug in magic_pdef: would only work with functions with | |
4308 | arguments with default values. |
|
4319 | arguments with default values. | |
4309 |
|
4320 | |||
4310 | 2001-11-14 Fernando Perez <fperez@colorado.edu> |
|
4321 | 2001-11-14 Fernando Perez <fperez@colorado.edu> | |
4311 |
|
4322 | |||
4312 | * Added the PhysicsInput stuff to dot_ipython so it ships as an |
|
4323 | * Added the PhysicsInput stuff to dot_ipython so it ships as an | |
4313 | example with IPython. Various other minor fixes and cleanups. |
|
4324 | example with IPython. Various other minor fixes and cleanups. | |
4314 |
|
4325 | |||
4315 | * Version 0.1.9 released, 0.1.10 opened for further work. |
|
4326 | * Version 0.1.9 released, 0.1.10 opened for further work. | |
4316 |
|
4327 | |||
4317 | * Added sys.path to the list of directories searched in the |
|
4328 | * Added sys.path to the list of directories searched in the | |
4318 | execfile= option. It used to be the current directory and the |
|
4329 | execfile= option. It used to be the current directory and the | |
4319 | user's IPYTHONDIR only. |
|
4330 | user's IPYTHONDIR only. | |
4320 |
|
4331 | |||
4321 | 2001-11-13 Fernando Perez <fperez@colorado.edu> |
|
4332 | 2001-11-13 Fernando Perez <fperez@colorado.edu> | |
4322 |
|
4333 | |||
4323 | * Reinstated the raw_input/prefilter separation that Janko had |
|
4334 | * Reinstated the raw_input/prefilter separation that Janko had | |
4324 | initially. This gives a more convenient setup for extending the |
|
4335 | initially. This gives a more convenient setup for extending the | |
4325 | pre-processor from the outside: raw_input always gets a string, |
|
4336 | pre-processor from the outside: raw_input always gets a string, | |
4326 | and prefilter has to process it. We can then redefine prefilter |
|
4337 | and prefilter has to process it. We can then redefine prefilter | |
4327 | from the outside and implement extensions for special |
|
4338 | from the outside and implement extensions for special | |
4328 | purposes. |
|
4339 | purposes. | |
4329 |
|
4340 | |||
4330 | Today I got one for inputting PhysicalQuantity objects |
|
4341 | Today I got one for inputting PhysicalQuantity objects | |
4331 | (from Scientific) without needing any function calls at |
|
4342 | (from Scientific) without needing any function calls at | |
4332 | all. Extremely convenient, and it's all done as a user-level |
|
4343 | all. Extremely convenient, and it's all done as a user-level | |
4333 | extension (no IPython code was touched). Now instead of: |
|
4344 | extension (no IPython code was touched). Now instead of: | |
4334 | a = PhysicalQuantity(4.2,'m/s**2') |
|
4345 | a = PhysicalQuantity(4.2,'m/s**2') | |
4335 | one can simply say |
|
4346 | one can simply say | |
4336 | a = 4.2 m/s**2 |
|
4347 | a = 4.2 m/s**2 | |
4337 | or even |
|
4348 | or even | |
4338 | a = 4.2 m/s^2 |
|
4349 | a = 4.2 m/s^2 | |
4339 |
|
4350 | |||
4340 | I use this, but it's also a proof of concept: IPython really is |
|
4351 | I use this, but it's also a proof of concept: IPython really is | |
4341 | fully user-extensible, even at the level of the parsing of the |
|
4352 | fully user-extensible, even at the level of the parsing of the | |
4342 | command line. It's not trivial, but it's perfectly doable. |
|
4353 | command line. It's not trivial, but it's perfectly doable. | |
4343 |
|
4354 | |||
4344 | * Added 'add_flip' method to inclusion conflict resolver. Fixes |
|
4355 | * Added 'add_flip' method to inclusion conflict resolver. Fixes | |
4345 | the problem of modules being loaded in the inverse order in which |
|
4356 | the problem of modules being loaded in the inverse order in which | |
4346 | they were defined in |
|
4357 | they were defined in | |
4347 |
|
4358 | |||
4348 | * Version 0.1.8 released, 0.1.9 opened for further work. |
|
4359 | * Version 0.1.8 released, 0.1.9 opened for further work. | |
4349 |
|
4360 | |||
4350 | * Added magics pdef, source and file. They respectively show the |
|
4361 | * Added magics pdef, source and file. They respectively show the | |
4351 | definition line ('prototype' in C), source code and full python |
|
4362 | definition line ('prototype' in C), source code and full python | |
4352 | file for any callable object. The object inspector oinfo uses |
|
4363 | file for any callable object. The object inspector oinfo uses | |
4353 | these to show the same information. |
|
4364 | these to show the same information. | |
4354 |
|
4365 | |||
4355 | * Version 0.1.7 released, 0.1.8 opened for further work. |
|
4366 | * Version 0.1.7 released, 0.1.8 opened for further work. | |
4356 |
|
4367 | |||
4357 | * Separated all the magic functions into a class called Magic. The |
|
4368 | * Separated all the magic functions into a class called Magic. The | |
4358 | InteractiveShell class was becoming too big for Xemacs to handle |
|
4369 | InteractiveShell class was becoming too big for Xemacs to handle | |
4359 | (de-indenting a line would lock it up for 10 seconds while it |
|
4370 | (de-indenting a line would lock it up for 10 seconds while it | |
4360 | backtracked on the whole class!) |
|
4371 | backtracked on the whole class!) | |
4361 |
|
4372 | |||
4362 | FIXME: didn't work. It can be done, but right now namespaces are |
|
4373 | FIXME: didn't work. It can be done, but right now namespaces are | |
4363 | all messed up. Do it later (reverted it for now, so at least |
|
4374 | all messed up. Do it later (reverted it for now, so at least | |
4364 | everything works as before). |
|
4375 | everything works as before). | |
4365 |
|
4376 | |||
4366 | * Got the object introspection system (magic_oinfo) working! I |
|
4377 | * Got the object introspection system (magic_oinfo) working! I | |
4367 | think this is pretty much ready for release to Janko, so he can |
|
4378 | think this is pretty much ready for release to Janko, so he can | |
4368 | test it for a while and then announce it. Pretty much 100% of what |
|
4379 | test it for a while and then announce it. Pretty much 100% of what | |
4369 | I wanted for the 'phase 1' release is ready. Happy, tired. |
|
4380 | I wanted for the 'phase 1' release is ready. Happy, tired. | |
4370 |
|
4381 | |||
4371 | 2001-11-12 Fernando Perez <fperez@colorado.edu> |
|
4382 | 2001-11-12 Fernando Perez <fperez@colorado.edu> | |
4372 |
|
4383 | |||
4373 | * Version 0.1.6 released, 0.1.7 opened for further work. |
|
4384 | * Version 0.1.6 released, 0.1.7 opened for further work. | |
4374 |
|
4385 | |||
4375 | * Fixed bug in printing: it used to test for truth before |
|
4386 | * Fixed bug in printing: it used to test for truth before | |
4376 | printing, so 0 wouldn't print. Now checks for None. |
|
4387 | printing, so 0 wouldn't print. Now checks for None. | |
4377 |
|
4388 | |||
4378 | * Fixed bug where auto-execs increase the prompt counter by 2 (b/c |
|
4389 | * Fixed bug where auto-execs increase the prompt counter by 2 (b/c | |
4379 | they have to call len(str(sys.ps1)) ). But the fix is ugly, it |
|
4390 | they have to call len(str(sys.ps1)) ). But the fix is ugly, it | |
4380 | reaches by hand into the outputcache. Think of a better way to do |
|
4391 | reaches by hand into the outputcache. Think of a better way to do | |
4381 | this later. |
|
4392 | this later. | |
4382 |
|
4393 | |||
4383 | * Various small fixes thanks to Nathan's comments. |
|
4394 | * Various small fixes thanks to Nathan's comments. | |
4384 |
|
4395 | |||
4385 | * Changed magic_pprint to magic_Pprint. This way it doesn't |
|
4396 | * Changed magic_pprint to magic_Pprint. This way it doesn't | |
4386 | collide with pprint() and the name is consistent with the command |
|
4397 | collide with pprint() and the name is consistent with the command | |
4387 | line option. |
|
4398 | line option. | |
4388 |
|
4399 | |||
4389 | * Changed prompt counter behavior to be fully like |
|
4400 | * Changed prompt counter behavior to be fully like | |
4390 | Mathematica's. That is, even input that doesn't return a result |
|
4401 | Mathematica's. That is, even input that doesn't return a result | |
4391 | raises the prompt counter. The old behavior was kind of confusing |
|
4402 | raises the prompt counter. The old behavior was kind of confusing | |
4392 | (getting the same prompt number several times if the operation |
|
4403 | (getting the same prompt number several times if the operation | |
4393 | didn't return a result). |
|
4404 | didn't return a result). | |
4394 |
|
4405 | |||
4395 | * Fixed Nathan's last name in a couple of places (Gray, not Graham). |
|
4406 | * Fixed Nathan's last name in a couple of places (Gray, not Graham). | |
4396 |
|
4407 | |||
4397 | * Fixed -Classic mode (wasn't working anymore). |
|
4408 | * Fixed -Classic mode (wasn't working anymore). | |
4398 |
|
4409 | |||
4399 | * Added colored prompts using Nathan's new code. Colors are |
|
4410 | * Added colored prompts using Nathan's new code. Colors are | |
4400 | currently hardwired, they can be user-configurable. For |
|
4411 | currently hardwired, they can be user-configurable. For | |
4401 | developers, they can be chosen in file ipythonlib.py, at the |
|
4412 | developers, they can be chosen in file ipythonlib.py, at the | |
4402 | beginning of the CachedOutput class def. |
|
4413 | beginning of the CachedOutput class def. | |
4403 |
|
4414 | |||
4404 | 2001-11-11 Fernando Perez <fperez@colorado.edu> |
|
4415 | 2001-11-11 Fernando Perez <fperez@colorado.edu> | |
4405 |
|
4416 | |||
4406 | * Version 0.1.5 released, 0.1.6 opened for further work. |
|
4417 | * Version 0.1.5 released, 0.1.6 opened for further work. | |
4407 |
|
4418 | |||
4408 | * Changed magic_env to *return* the environment as a dict (not to |
|
4419 | * Changed magic_env to *return* the environment as a dict (not to | |
4409 | print it). This way it prints, but it can also be processed. |
|
4420 | print it). This way it prints, but it can also be processed. | |
4410 |
|
4421 | |||
4411 | * Added Verbose exception reporting to interactive |
|
4422 | * Added Verbose exception reporting to interactive | |
4412 | exceptions. Very nice, now even 1/0 at the prompt gives a verbose |
|
4423 | exceptions. Very nice, now even 1/0 at the prompt gives a verbose | |
4413 | traceback. Had to make some changes to the ultraTB file. This is |
|
4424 | traceback. Had to make some changes to the ultraTB file. This is | |
4414 | probably the last 'big' thing in my mental todo list. This ties |
|
4425 | probably the last 'big' thing in my mental todo list. This ties | |
4415 | in with the next entry: |
|
4426 | in with the next entry: | |
4416 |
|
4427 | |||
4417 | * Changed -Xi and -Xf to a single -xmode option. Now all the user |
|
4428 | * Changed -Xi and -Xf to a single -xmode option. Now all the user | |
4418 | has to specify is Plain, Color or Verbose for all exception |
|
4429 | has to specify is Plain, Color or Verbose for all exception | |
4419 | handling. |
|
4430 | handling. | |
4420 |
|
4431 | |||
4421 | * Removed ShellServices option. All this can really be done via |
|
4432 | * Removed ShellServices option. All this can really be done via | |
4422 | the magic system. It's easier to extend, cleaner and has automatic |
|
4433 | the magic system. It's easier to extend, cleaner and has automatic | |
4423 | namespace protection and documentation. |
|
4434 | namespace protection and documentation. | |
4424 |
|
4435 | |||
4425 | 2001-11-09 Fernando Perez <fperez@colorado.edu> |
|
4436 | 2001-11-09 Fernando Perez <fperez@colorado.edu> | |
4426 |
|
4437 | |||
4427 | * Fixed bug in output cache flushing (missing parameter to |
|
4438 | * Fixed bug in output cache flushing (missing parameter to | |
4428 | __init__). Other small bugs fixed (found using pychecker). |
|
4439 | __init__). Other small bugs fixed (found using pychecker). | |
4429 |
|
4440 | |||
4430 | * Version 0.1.4 opened for bugfixing. |
|
4441 | * Version 0.1.4 opened for bugfixing. | |
4431 |
|
4442 | |||
4432 | 2001-11-07 Fernando Perez <fperez@colorado.edu> |
|
4443 | 2001-11-07 Fernando Perez <fperez@colorado.edu> | |
4433 |
|
4444 | |||
4434 | * Version 0.1.3 released, mainly because of the raw_input bug. |
|
4445 | * Version 0.1.3 released, mainly because of the raw_input bug. | |
4435 |
|
4446 | |||
4436 | * Fixed NASTY bug in raw_input: input line wasn't properly parsed |
|
4447 | * Fixed NASTY bug in raw_input: input line wasn't properly parsed | |
4437 | and when testing for whether things were callable, a call could |
|
4448 | and when testing for whether things were callable, a call could | |
4438 | actually be made to certain functions. They would get called again |
|
4449 | actually be made to certain functions. They would get called again | |
4439 | once 'really' executed, with a resulting double call. A disaster |
|
4450 | once 'really' executed, with a resulting double call. A disaster | |
4440 | in many cases (list.reverse() would never work!). |
|
4451 | in many cases (list.reverse() would never work!). | |
4441 |
|
4452 | |||
4442 | * Removed prefilter() function, moved its code to raw_input (which |
|
4453 | * Removed prefilter() function, moved its code to raw_input (which | |
4443 | after all was just a near-empty caller for prefilter). This saves |
|
4454 | after all was just a near-empty caller for prefilter). This saves | |
4444 | a function call on every prompt, and simplifies the class a tiny bit. |
|
4455 | a function call on every prompt, and simplifies the class a tiny bit. | |
4445 |
|
4456 | |||
4446 | * Fix _ip to __ip name in magic example file. |
|
4457 | * Fix _ip to __ip name in magic example file. | |
4447 |
|
4458 | |||
4448 | * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should |
|
4459 | * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should | |
4449 | work with non-gnu versions of tar. |
|
4460 | work with non-gnu versions of tar. | |
4450 |
|
4461 | |||
4451 | 2001-11-06 Fernando Perez <fperez@colorado.edu> |
|
4462 | 2001-11-06 Fernando Perez <fperez@colorado.edu> | |
4452 |
|
4463 | |||
4453 | * Version 0.1.2. Just to keep track of the recent changes. |
|
4464 | * Version 0.1.2. Just to keep track of the recent changes. | |
4454 |
|
4465 | |||
4455 | * Fixed nasty bug in output prompt routine. It used to check 'if |
|
4466 | * Fixed nasty bug in output prompt routine. It used to check 'if | |
4456 | arg != None...'. Problem is, this fails if arg implements a |
|
4467 | arg != None...'. Problem is, this fails if arg implements a | |
4457 | special comparison (__cmp__) which disallows comparing to |
|
4468 | special comparison (__cmp__) which disallows comparing to | |
4458 | None. Found it when trying to use the PhysicalQuantity module from |
|
4469 | None. Found it when trying to use the PhysicalQuantity module from | |
4459 | ScientificPython. |
|
4470 | ScientificPython. | |
4460 |
|
4471 | |||
4461 | 2001-11-05 Fernando Perez <fperez@colorado.edu> |
|
4472 | 2001-11-05 Fernando Perez <fperez@colorado.edu> | |
4462 |
|
4473 | |||
4463 | * Also added dirs. Now the pushd/popd/dirs family functions |
|
4474 | * Also added dirs. Now the pushd/popd/dirs family functions | |
4464 | basically like the shell, with the added convenience of going home |
|
4475 | basically like the shell, with the added convenience of going home | |
4465 | when called with no args. |
|
4476 | when called with no args. | |
4466 |
|
4477 | |||
4467 | * pushd/popd slightly modified to mimic shell behavior more |
|
4478 | * pushd/popd slightly modified to mimic shell behavior more | |
4468 | closely. |
|
4479 | closely. | |
4469 |
|
4480 | |||
4470 | * Added env,pushd,popd from ShellServices as magic functions. I |
|
4481 | * Added env,pushd,popd from ShellServices as magic functions. I | |
4471 | think the cleanest will be to port all desired functions from |
|
4482 | think the cleanest will be to port all desired functions from | |
4472 | ShellServices as magics and remove ShellServices altogether. This |
|
4483 | ShellServices as magics and remove ShellServices altogether. This | |
4473 | will provide a single, clean way of adding functionality |
|
4484 | will provide a single, clean way of adding functionality | |
4474 | (shell-type or otherwise) to IP. |
|
4485 | (shell-type or otherwise) to IP. | |
4475 |
|
4486 | |||
4476 | 2001-11-04 Fernando Perez <fperez@colorado.edu> |
|
4487 | 2001-11-04 Fernando Perez <fperez@colorado.edu> | |
4477 |
|
4488 | |||
4478 | * Added .ipython/ directory to sys.path. This way users can keep |
|
4489 | * Added .ipython/ directory to sys.path. This way users can keep | |
4479 | customizations there and access them via import. |
|
4490 | customizations there and access them via import. | |
4480 |
|
4491 | |||
4481 | 2001-11-03 Fernando Perez <fperez@colorado.edu> |
|
4492 | 2001-11-03 Fernando Perez <fperez@colorado.edu> | |
4482 |
|
4493 | |||
4483 | * Opened version 0.1.1 for new changes. |
|
4494 | * Opened version 0.1.1 for new changes. | |
4484 |
|
4495 | |||
4485 | * Changed version number to 0.1.0: first 'public' release, sent to |
|
4496 | * Changed version number to 0.1.0: first 'public' release, sent to | |
4486 | Nathan and Janko. |
|
4497 | Nathan and Janko. | |
4487 |
|
4498 | |||
4488 | * Lots of small fixes and tweaks. |
|
4499 | * Lots of small fixes and tweaks. | |
4489 |
|
4500 | |||
4490 | * Minor changes to whos format. Now strings are shown, snipped if |
|
4501 | * Minor changes to whos format. Now strings are shown, snipped if | |
4491 | too long. |
|
4502 | too long. | |
4492 |
|
4503 | |||
4493 | * Changed ShellServices to work on __main__ so they show up in @who |
|
4504 | * Changed ShellServices to work on __main__ so they show up in @who | |
4494 |
|
4505 | |||
4495 | * Help also works with ? at the end of a line: |
|
4506 | * Help also works with ? at the end of a line: | |
4496 | ?sin and sin? |
|
4507 | ?sin and sin? | |
4497 | both produce the same effect. This is nice, as often I use the |
|
4508 | both produce the same effect. This is nice, as often I use the | |
4498 | tab-complete to find the name of a method, but I used to then have |
|
4509 | tab-complete to find the name of a method, but I used to then have | |
4499 | to go to the beginning of the line to put a ? if I wanted more |
|
4510 | to go to the beginning of the line to put a ? if I wanted more | |
4500 | info. Now I can just add the ? and hit return. Convenient. |
|
4511 | info. Now I can just add the ? and hit return. Convenient. | |
4501 |
|
4512 | |||
4502 | 2001-11-02 Fernando Perez <fperez@colorado.edu> |
|
4513 | 2001-11-02 Fernando Perez <fperez@colorado.edu> | |
4503 |
|
4514 | |||
4504 | * Python version check (>=2.1) added. |
|
4515 | * Python version check (>=2.1) added. | |
4505 |
|
4516 | |||
4506 | * Added LazyPython documentation. At this point the docs are quite |
|
4517 | * Added LazyPython documentation. At this point the docs are quite | |
4507 | a mess. A cleanup is in order. |
|
4518 | a mess. A cleanup is in order. | |
4508 |
|
4519 | |||
4509 | * Auto-installer created. For some bizarre reason, the zipfiles |
|
4520 | * Auto-installer created. For some bizarre reason, the zipfiles | |
4510 | module isn't working on my system. So I made a tar version |
|
4521 | module isn't working on my system. So I made a tar version | |
4511 | (hopefully the command line options in various systems won't kill |
|
4522 | (hopefully the command line options in various systems won't kill | |
4512 | me). |
|
4523 | me). | |
4513 |
|
4524 | |||
4514 | * Fixes to Struct in genutils. Now all dictionary-like methods are |
|
4525 | * Fixes to Struct in genutils. Now all dictionary-like methods are | |
4515 | protected (reasonably). |
|
4526 | protected (reasonably). | |
4516 |
|
4527 | |||
4517 | * Added pager function to genutils and changed ? to print usage |
|
4528 | * Added pager function to genutils and changed ? to print usage | |
4518 | note through it (it was too long). |
|
4529 | note through it (it was too long). | |
4519 |
|
4530 | |||
4520 | * Added the LazyPython functionality. Works great! I changed the |
|
4531 | * Added the LazyPython functionality. Works great! I changed the | |
4521 | auto-quote escape to ';', it's on home row and next to '. But |
|
4532 | auto-quote escape to ';', it's on home row and next to '. But | |
4522 | both auto-quote and auto-paren (still /) escapes are command-line |
|
4533 | both auto-quote and auto-paren (still /) escapes are command-line | |
4523 | parameters. |
|
4534 | parameters. | |
4524 |
|
4535 | |||
4525 |
|
4536 | |||
4526 | 2001-11-01 Fernando Perez <fperez@colorado.edu> |
|
4537 | 2001-11-01 Fernando Perez <fperez@colorado.edu> | |
4527 |
|
4538 | |||
4528 | * Version changed to 0.0.7. Fairly large change: configuration now |
|
4539 | * Version changed to 0.0.7. Fairly large change: configuration now | |
4529 | is all stored in a directory, by default .ipython. There, all |
|
4540 | is all stored in a directory, by default .ipython. There, all | |
4530 | config files have normal looking names (not .names) |
|
4541 | config files have normal looking names (not .names) | |
4531 |
|
4542 | |||
4532 | * Version 0.0.6 Released first to Lucas and Archie as a test |
|
4543 | * Version 0.0.6 Released first to Lucas and Archie as a test | |
4533 | run. Since it's the first 'semi-public' release, change version to |
|
4544 | run. Since it's the first 'semi-public' release, change version to | |
4534 | > 0.0.6 for any changes now. |
|
4545 | > 0.0.6 for any changes now. | |
4535 |
|
4546 | |||
4536 | * Stuff I had put in the ipplib.py changelog: |
|
4547 | * Stuff I had put in the ipplib.py changelog: | |
4537 |
|
4548 | |||
4538 | Changes to InteractiveShell: |
|
4549 | Changes to InteractiveShell: | |
4539 |
|
4550 | |||
4540 | - Made the usage message a parameter. |
|
4551 | - Made the usage message a parameter. | |
4541 |
|
4552 | |||
4542 | - Require the name of the shell variable to be given. It's a bit |
|
4553 | - Require the name of the shell variable to be given. It's a bit | |
4543 | of a hack, but allows the name 'shell' not to be hardwire in the |
|
4554 | of a hack, but allows the name 'shell' not to be hardwire in the | |
4544 | magic (@) handler, which is problematic b/c it requires |
|
4555 | magic (@) handler, which is problematic b/c it requires | |
4545 | polluting the global namespace with 'shell'. This in turn is |
|
4556 | polluting the global namespace with 'shell'. This in turn is | |
4546 | fragile: if a user redefines a variable called shell, things |
|
4557 | fragile: if a user redefines a variable called shell, things | |
4547 | break. |
|
4558 | break. | |
4548 |
|
4559 | |||
4549 | - magic @: all functions available through @ need to be defined |
|
4560 | - magic @: all functions available through @ need to be defined | |
4550 | as magic_<name>, even though they can be called simply as |
|
4561 | as magic_<name>, even though they can be called simply as | |
4551 | @<name>. This allows the special command @magic to gather |
|
4562 | @<name>. This allows the special command @magic to gather | |
4552 | information automatically about all existing magic functions, |
|
4563 | information automatically about all existing magic functions, | |
4553 | even if they are run-time user extensions, by parsing the shell |
|
4564 | even if they are run-time user extensions, by parsing the shell | |
4554 | instance __dict__ looking for special magic_ names. |
|
4565 | instance __dict__ looking for special magic_ names. | |
4555 |
|
4566 | |||
4556 | - mainloop: added *two* local namespace parameters. This allows |
|
4567 | - mainloop: added *two* local namespace parameters. This allows | |
4557 | the class to differentiate between parameters which were there |
|
4568 | the class to differentiate between parameters which were there | |
4558 | before and after command line initialization was processed. This |
|
4569 | before and after command line initialization was processed. This | |
4559 | way, later @who can show things loaded at startup by the |
|
4570 | way, later @who can show things loaded at startup by the | |
4560 | user. This trick was necessary to make session saving/reloading |
|
4571 | user. This trick was necessary to make session saving/reloading | |
4561 | really work: ideally after saving/exiting/reloading a session, |
|
4572 | really work: ideally after saving/exiting/reloading a session, | |
4562 | *everythin* should look the same, including the output of @who. I |
|
4573 | *everythin* should look the same, including the output of @who. I | |
4563 | was only able to make this work with this double namespace |
|
4574 | was only able to make this work with this double namespace | |
4564 | trick. |
|
4575 | trick. | |
4565 |
|
4576 | |||
4566 | - added a header to the logfile which allows (almost) full |
|
4577 | - added a header to the logfile which allows (almost) full | |
4567 | session restoring. |
|
4578 | session restoring. | |
4568 |
|
4579 | |||
4569 | - prepend lines beginning with @ or !, with a and log |
|
4580 | - prepend lines beginning with @ or !, with a and log | |
4570 | them. Why? !lines: may be useful to know what you did @lines: |
|
4581 | them. Why? !lines: may be useful to know what you did @lines: | |
4571 | they may affect session state. So when restoring a session, at |
|
4582 | they may affect session state. So when restoring a session, at | |
4572 | least inform the user of their presence. I couldn't quite get |
|
4583 | least inform the user of their presence. I couldn't quite get | |
4573 | them to properly re-execute, but at least the user is warned. |
|
4584 | them to properly re-execute, but at least the user is warned. | |
4574 |
|
4585 | |||
4575 | * Started ChangeLog. |
|
4586 | * Started ChangeLog. |
General Comments 0
You need to be logged in to leave comments.
Login now