##// END OF EJS Templates
Finish up demo api/docs, manual improvements, other fixes. Manual work...
Finish up demo api/docs, manual improvements, other fixes. Manual work still in progress (html doesn't build right now)

File last commit:

Show More
4406 lines | 173.6 KiB | text/plain | TextLexer
2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/demo.py: finish demo module, fully documented now.
* IPython/genutils.py (file_read): simple little utility to read a
file and ensure it's closed afterwards.
2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/demo.py (Demo.__init__): added support for individually
tagging blocks for automatic execution.
* IPython/Magic.py (magic_pycat): new %pycat magic for showing
syntax-highlighted python sources, requested by John.
2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/demo.py (Demo.again): fix bug where again() blocks after
* IPython/genutils.py (shlex_split): moved from Magic to here,
where all 2.2 compatibility stuff lives. I needed it for demo.py.
* IPython/demo.py (Demo.__init__): added support for silent
blocks, improved marks as regexps, docstrings written.
(Demo.__init__): better docstring, added support for sys.argv.
* IPython/genutils.py (marquee): little utility used by the demo
code, handy in general.
* IPython/demo.py (Demo.__init__): new class for interactive
demos. Not documented yet, I just wrote it in a hurry for
scipy'05. Will docstring later.
2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/Shell.py (sigint_handler): Drastic simplification which
also seems to make Ctrl-C work correctly across threads! This is
so simple, that I can't beleive I'd missed it before. Needs more
testing, though.
(KBINT): Never mind, revert changes. I'm sure I'd tried something
like this before...
* IPython/genutils.py (get_home_dir): add protection against
non-dirs in win32 registry.
* IPython/iplib.py (InteractiveShell.alias_table_validate): fix
bug where dict was mutated while iterating (pysh crash).
2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/iplib.py (handle_auto): Fix inconsistency arising from
spurious newlines added by this routine. After a report by
F. Mantegazza.
2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
calls. These were a leftover from the GTK 1.x days, and can cause
problems in certain cases (after a report by John Hunter).
* IPython/iplib.py (InteractiveShell.__init__): Trap exception if
os.getcwd() fails at init time. Thanks to patch from David Remahl
<chmod007 AT mac.com>.
(InteractiveShell.__init__): prevent certain special magics from
being shadowed by aliases. Closes
2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/iplib.py (InteractiveShell.complete): Added new
top-level completion method to expose the completion mechanism
beyond readline-based environments.
2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
* tools/ipsvnc (svnversion): fix svnversion capture.
* IPython/iplib.py (InteractiveShell.__init__): Add has_readline
attribute to self, which was missing. Before, it was set by a
routine which in certain cases wasn't being called, so the
instance could end up missing the attribute. This caused a crash.
Closes http://www.scipy.net/roundup/ipython/issue40.
2005-08-16 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (VerboseTB.text): don't crash if object
contains non-string attribute. Closes
2005-08-14 Fernando Perez <fperez@colorado.edu>
* tools/ipsvnc: Minor improvements, to add changeset info.
2005-08-12 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (runsource): remove self.code_to_run_src
attribute. I realized this is nothing more than
'\n'.join(self.buffer), and having the same data in two different
places is just asking for synchronization bugs. This may impact
people who have custom exception handlers, so I need to warn
ipython-dev about it (F. Mantegazza may use them).
2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
* IPython/genutils.py: fix 2.2 compatibility (generators)
2005-07-18 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (get_home_dir): fix to help users with
invalid $HOME under win32.
2005-07-17 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
some old hacks and clean up a bit other routines; code should be
simpler and a bit faster.
* IPython/iplib.py (interact): removed some last-resort attempts
to survive broken stdout/stderr. That code was only making it
harder to abstract out the i/o (necessary for gui integration),
and the crashes it could prevent were extremely rare in practice
(besides being fully user-induced in a pretty violent manner).
* IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
Nothing major yet, but the code is simpler to read; this should
make it easier to do more serious modifications in the future.
* IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
which broke in .15 (thanks to a report by Ville).
* IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
be quite correct, I know next to nothing about unicode). This
will allow unicode strings to be used in prompts, amongst other
cases. It also will prevent ipython from crashing when unicode
shows up unexpectedly in many places. If ascii encoding fails, we
assume utf_8. Currently the encoding is not a user-visible
setting, though it could be made so if there is demand for it.
* IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
* IPython/Struct.py (Struct.merge): switch keys() to iterator.
* IPython/background_jobs.py: moved 2.2 compatibility to genutils.
* IPython/genutils.py: Add 2.2 compatibility here, so all other
code can work transparently for 2.2/2.3.
2005-07-16 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (ExceptionColors): Make a global variable
out of the color scheme table used for coloring exception
tracebacks. This allows user code to add new schemes at runtime.
This is a minimally modified version of the patch at
http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
for the contribution.
* IPython/FlexCompleter.py (Completer.attr_matches): Add a
slightly modified version of the patch in
http://www.scipy.net/roundup/ipython/issue34, which also allows me
to remove the previous try/except solution (which was costlier).
Thanks to Gaetan Lehmann <gaetan.lehmann AT jouy.inra.fr> for the fix.
2005-06-08 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (write/write_err): Add methods to abstract all
I/O a bit more.
* IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
warning, reported by Aric Hagberg, fix by JD Hunter.
2005-06-02 *** Released version 0.6.15
2005-06-01 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (MagicCompleter.file_matches): Fix
tab-completion of filenames within open-quoted strings. Note that
this requires that in ~/.ipython/ipythonrc, users change the
readline delimiters configuration to read:
readline_remove_delims -/~
2005-05-31 *** Released version 0.6.14
2005-05-29 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
with files not on the filesystem. Reported by Eliyahu Sandler
2005-05-22 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py: Fix a few crashes in the --upgrade option.
After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2005-05-19 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (safe_execfile): close a file which could be
left open (causing problems in win32, which locks open files).
Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2005-05-18 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
keyword arguments correctly to safe_execfile().
2005-05-13 Fernando Perez <fperez@colorado.edu>
* ipython.1: Added info about Qt to manpage, and threads warning
to usage page (invoked with --help).
* IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
new matcher (it goes at the end of the priority list) to do
tab-completion on named function arguments. Submitted by George
Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
for more details.
* IPython/Magic.py (magic_run): Added new -e flag to ignore
SystemExit exceptions in the script being run. Thanks to a report
by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
producing very annoying behavior when running unit tests.
2005-05-12 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
which I'd broken (again) due to a changed regexp. In the process,
added ';' as an escape to auto-quote the whole line without
splitting its arguments. Thanks to a report by Jerry McRae
* IPython/ultraTB.py (VerboseTB.text): protect against rare but
possible crashes caused by a TokenError. Reported by Ed Schofield
2005-05-06 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2005-04-29 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
<nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
which provides support for Qt interactive usage (similar to the
existing one for WX and GTK). This had been often requested.
2005-04-14 *** Released version 0.6.13
2005-04-08 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic._ofind): remove docstring evaluation
from _ofind, which gets called on almost every input line. Now,
we only try to get docstrings if they are actually going to be
used (the overhead of fetching unnecessary docstrings can be
noticeable for certain objects, such as Pyro proxies).
* IPython/iplib.py (MagicCompleter.python_matches): Change the API
for completers. For some reason I had been passing them the state
variable, which completers never actually need, and was in
conflict with the rlcompleter API. Custom completers ONLY need to
take the text parameter.
* IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
work correctly in pysh. I've also moved all the logic which used
to be in pysh.py here, which will prevent problems with future
upgrades. However, this time I must warn users to update their
pysh profile to include the line
import_all IPython.Extensions.InterpreterExec
because otherwise things won't work for them. They MUST also
delete pysh.py and the line
execfile pysh.py
from their ipythonrc-pysh.
* IPython/FlexCompleter.py (Completer.attr_matches): Make more
robust in the face of objects whose dir() returns non-strings
(which it shouldn't, but some broken libs like ITK do). Thanks to
a patch by John Hunter (implemented differently, though). Also
minor improvements by using .extend instead of + on lists.
* pysh.py:
2005-04-06 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (make_IPython): Make multi_line_specials on
by default, so that all users benefit from it. Those who don't
want it can still turn it off.
* IPython/UserConfig/ipythonrc: Add multi_line_specials to the
config file, I'd forgotten about this, so users were getting it
off by default.
* IPython/iplib.py (ipmagic): big overhaul of the magic system for
consistency. Now magics can be called in multiline statements,
and python variables can be expanded in magic calls via $var.
This makes the magic system behave just like aliases or !system
2005-03-28 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (handle_auto): cleanup to use %s instead of
expensive string additions for building command. Add support for
trailing ';' when autocall is used.
2005-03-26 Fernando Perez <fperez@colorado.edu>
* ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
Bugfix by A. Schmolck, the ipython.el maintainer. Also make
ipython.el robust against prompts with any number of spaces
(including 0) after the ':' character.
* IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
continuation prompt, which misled users to think the line was
already indented. Closes debian Bug#300847, reported to me by
Norbert Tretkowski <tretkowski-AT-inittab.de>.
2005-03-23 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
properly aligned if they have embedded newlines.
* IPython/iplib.py (runlines): Add a public method to expose
IPython's code execution machinery, so that users can run strings
as if they had been typed at the prompt interactively.
(InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
methods which can call the system shell, but with python variable
expansion. The three such methods are: __IPYTHON__.system,
.getoutput and .getoutputerror. These need to be documented in a
'public API' section (to be written) of the manual.
2005-03-20 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.set_custom_exc): new system
for custom exception handling. This is quite powerful, and it
allows for user-installable exception handlers which can trap
custom exceptions at runtime and treat them separately from
IPython's default mechanisms. At the request of Frédéric
Mantegazza <mantegazza-AT-ill.fr>.
(InteractiveShell.set_custom_completer): public API function to
add new completers at runtime.
2005-03-19 Fernando Perez <fperez@colorado.edu>
* IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
allow objects which provide their docstrings via non-standard
mechanisms (like Pyro proxies) to still be inspected by ipython's
? system.
* IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
automatic capture system. I tried quite hard to make it work
reliably, and simply failed. I tried many combinations with the
subprocess module, but eventually nothing worked in all needed
cases (not blocking stdin for the child, duplicating stdout
without blocking, etc). The new %sc/%sx still do capture to these
magical list/string objects which make shell use much more
conveninent, so not all is lost.
XXX - FIX MANUAL for the change above!
(runsource): I copied code.py's runsource() into ipython to modify
it a bit. Now the code object and source to be executed are
stored in ipython. This makes this info accessible to third-party
tools, like custom exception handlers. After a request by Frédéric
Mantegazza <mantegazza-AT-ill.fr>.
* IPython/UserConfig/ipythonrc: Add up/down arrow keys to
history-search via readline (like C-p/C-n). I'd wanted this for a
long time, but only recently found out how to do it. For users
who already have their ipythonrc files made and want this, just
readline_parse_and_bind "\e[A": history-search-backward
readline_parse_and_bind "\e[B": history-search-forward
2005-03-18 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
LSString and SList classes which allow transparent conversions
between list mode and whitespace-separated string.
(magic_r): Fix recursion problem in %r.
* IPython/genutils.py (LSString): New class to be used for
automatic storage of the results of all alias/system calls in _o
and _e (stdout/err). These provide a .l/.list attribute which
does automatic splitting on newlines. This means that for most
uses, you'll never need to do capturing of output with %sc/%sx
anymore, since ipython keeps this always done for you. Note that
only the LAST results are stored, the _o/e variables are
overwritten on each call. If you need to save their contents
further, simply bind them to any other name.
2005-03-17 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
prompt namespace handling.
2005-03-16 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (CachedOutput.__init__): Fix default and
classic prompts to be '>>> ' (final space was missing, and it
trips the emacs python mode).
(BasePrompt.__str__): Added safe support for dynamic prompt
strings. Now you can set your prompt string to be '$x', and the
value of x will be printed from your interactive namespace. The
interpolation syntax includes the full Itpl support, so
${foo()+x+bar()} is a valid prompt string now, and the function
calls will be made at runtime.
2005-03-15 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_history): renamed %hist to %history, to
avoid name clashes in pylab. %hist still works, it just forwards
the call to %history.
2005-03-02 *** Released version 0.6.12
2005-03-02 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (handle_magic): log magic calls properly as
ipmagic() function calls.
* IPython/Magic.py (magic_time): Improved %time to support
statements and provide wall-clock as well as CPU time.
2005-02-27 Fernando Perez <fperez@colorado.edu>
* IPython/hooks.py: New hooks module, to expose user-modifiable
IPython functionality in a clean manner. For now only the editor
hook is actually written, and other thigns which I intend to turn
into proper hooks aren't yet there. The display and prefilter
stuff, for example, should be hooks. But at least now the
framework is in place, and the rest can be moved here with more
time later. IPython had had a .hooks variable for a long time for
this purpose, but I'd never actually used it for anything.
2005-02-26 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (make_IPython): make the default ipython
directory be called _ipython under win32, to follow more the
naming peculiarities of that platform (where buggy software like
Visual Sourcesafe breaks with .named directories). Reported by
Ville Vainio.
2005-02-23 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.__init__): removed a few
auto_aliases for win32 which were causing problems. Users can
define the ones they personally like.
2005-02-21 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_time): new magic to time execution of
expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2005-02-19 Fernando Perez <fperez@colorado.edu>
* IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
into keys (for prompts, for example).
* IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
prompts in case users want them. This introduces a small behavior
change: ipython does not automatically add a space to all prompts
anymore. To get the old prompts with a space, users should add it
manually to their ipythonrc file, so for example prompt_in1 should
now read 'In [\#]: ' instead of 'In [\#]:'.
(BasePrompt.__init__): New option prompts_pad_left (only in rc
file) to control left-padding of secondary prompts.
* IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
the profiler can't be imported. Fix for Debian, which removed
profile.py because of License issues. I applied a slightly
modified version of the original Debian patch at
2005-02-17 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (native_line_ends): Fix bug which would
cause improper line-ends under win32 b/c I was not opening files
in binary mode. Bug report and fix thanks to Ville.
* IPython/iplib.py (handle_auto): Fix bug which I introduced when
trying to catch spurious foo[1] autocalls. My fix actually broke
',/' autoquote/call with explicit escape (bad regexp).
2005-02-15 *** Released version 0.6.11
2005-02-14 Fernando Perez <fperez@colorado.edu>
* IPython/background_jobs.py: New background job management
subsystem. This is implemented via a new set of classes, and
IPython now provides a builtin 'jobs' object for background job
execution. A convenience %bg magic serves as a lightweight
frontend for starting the more common type of calls. This was
inspired by discussions with B. Granger and the BackgroundCommand
class described in the book Python Scripting for Computational
Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
(although ultimately no code from this text was used, as IPython's
system is a separate implementation).
* IPython/iplib.py (MagicCompleter.python_matches): add new option
to control the completion of single/double underscore names
separately. As documented in the example ipytonrc file, the
readline_omit__names variable can now be set to 2, to omit even
single underscore names. Thanks to a patch by Brian Wong
(InteractiveShell.__init__): Fix bug which would cause foo[1] to
be autocalled as foo([1]) if foo were callable. A problem for
things which are both callable and implement __getitem__.
(init_readline): Fix autoindentation for win32. Thanks to a patch
by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2005-02-12 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (make_IPython): Disabled the stout traps
which I had written long ago to sort out user error messages which
may occur during startup. This seemed like a good idea initially,
but it has proven a disaster in retrospect. I don't want to
change much code for now, so my fix is to set the internal 'debug'
flag to true everywhere, whose only job was precisely to control
this subsystem. This closes issue 28 (as well as avoiding all
sorts of strange hangups which occur from time to time).
2005-02-07 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
previous call produced a syntax error.
* IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
classes without constructor.
2005-02-06 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (MagicCompleter.complete): Extend the list of
completions with the results of each matcher, so we return results
to the user from all namespaces. This breaks with ipython
tradition, but I think it's a nicer behavior. Now you get all
possible completions listed, from all possible namespaces (python,
filesystem, magics...) After a request by John Hunter
2005-02-05 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_prun): Fix bug where prun would fail if
the call had quote characters in it (the quotes were stripped).
2005-01-31 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
Itpl.itpl() to make the code more robust against psyco
* IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
of causing an exception. Quicker, cleaner.
2005-01-28 Fernando Perez <fperez@colorado.edu>
* scripts/ipython_win_post_install.py (install): hardcode
sys.prefix+'python.exe' as the executable path. It turns out that
during the post-installation run, sys.executable resolves to the
name of the binary installer! I should report this as a distutils
bug, I think. I updated the .10 release with this tiny fix, to
avoid annoying the lists further.
2005-01-27 *** Released version 0.6.10
2005-01-27 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (norm): Added 'inf' as optional name for
L-infinity norm, included references to mathworld.com for vector
norm definitions.
(amin/amax): added amin/amax for array min/max. Similar to what
pylab ships with after the recent reorganization of names.
(spike/spike_odd): removed deprecated spike/spike_odd functions.
* ipython.el: committed Alex's recent fixes and improvements.
Tested with python-mode from CVS, and it looks excellent. Since
python-mode hasn't released anything in a while, I'm temporarily
putting a copy of today's CVS (v 4.70) of python-mode in:
* scripts/ipython_win_post_install.py (install): Win32 fix to use
sys.executable for the executable name, instead of assuming it's
called 'python.exe' (the post-installer would have produced broken
setups on systems with a differently named python binary).
* IPython/PyColorize.py (Parser.__call__): change explicit '\n'
references to os.linesep, to make the code more
platform-independent. This is also part of the win32 coloring
* IPython/genutils.py (page_dumb): Remove attempts to chop long
lines, which actually cause coloring bugs because the length of
the line is very difficult to correctly compute with embedded
escapes. This was the source of all the coloring problems under
Win32. I think that _finally_, Win32 users have a properly
working ipython in all respects. This would never have happened
if not for Gary Bishop and Viktor Ransmayr's great help and work.
2005-01-26 *** Released version 0.6.9
2005-01-25 Fernando Perez <fperez@colorado.edu>
* setup.py: finally, we have a true Windows installer, thanks to
the excellent work of Viktor Ransmayr
<viktor.ransmayr-AT-t-online.de>. The docs have been updated for
Windows users. The setup routine is quite a bit cleaner thanks to
this, and the post-install script uses the proper functions to
allow a clean de-installation using the standard Windows Control
* IPython/genutils.py (get_home_dir): changed to use the $HOME
environment variable under all OSes (including win32) if
available. This will give consistency to win32 users who have set
this variable for any reason. If os.environ['HOME'] fails, the
previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2005-01-24 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (empty_like): add empty_like(), similar to
zeros_like() but taking advantage of the new empty() Numeric routine.
2005-01-23 *** Released version 0.6.8
2005-01-22 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
automatic show() calls. After discussing things with JDH, it
turns out there are too many corner cases where this can go wrong.
It's best not to try to be 'too smart', and simply have ipython
reproduce as much as possible the default behavior of a normal
python shell.
* IPython/iplib.py (InteractiveShell.__init__): Modified the
line-splitting regexp and _prefilter() to avoid calling getattr()
on assignments. This closes
http://www.scipy.net/roundup/ipython/issue24. Note that Python's
readline uses getattr(), so a simple <TAB> keypress is still
enough to trigger getattr() calls on an object.
2005-01-21 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
docstring under pylab so it doesn't mask the original.
2005-01-21 *** Released version 0.6.7
2005-01-21 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
signal handling for win32 users in multithreaded mode.
2005-01-17 Fernando Perez <fperez@colorado.edu>
* IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
instances with no __init__. After a crash report by Norbert Nemec
2005-01-14 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
names for verbose exceptions, when multiple dotted names and the
'parent' object were present on the same line.
2005-01-11 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (flag_calls): new utility to trap and flag
calls in functions. I need it to clean up matplotlib support.
Also removed some deprecated code in genutils.
* IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
that matplotlib scripts called with %run, which don't call show()
themselves, still have their plotting windows open.
2005-01-05 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
<astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2004-12-19 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
parent_runcode, which was an eyesore. The same result can be
obtained with Python's regular superclass mechanisms.
2004-12-17 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
reported by Prabhu.
(Magic.magic_sx): direct all errors to Term.cerr (defaults to
sys.stderr) instead of explicitly calling sys.stderr. This helps
maintain our I/O abstractions clean, for future GUI embeddings.
* IPython/genutils.py (info): added new utility for sys.stderr
unified info message handling (thin wrapper around warn()).
* IPython/ultraTB.py (VerboseTB.text): Fix misreported global
composite (dotted) names on verbose exceptions.
(VerboseTB.nullrepr): harden against another kind of errors which
Python's inspect module can trigger, and which were crashing
IPython. Thanks to a report by Marco Lombardi
2004-12-13 *** Released version 0.6.6
2004-12-12 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
generated by pygtk upon initialization if it was built without
threads (for matplotlib users). After a crash reported by
Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
* IPython/ipmaker.py (make_IPython): fix small bug in the
import_some parameter for multiple imports.
* IPython/iplib.py (ipmagic): simplified the interface of
ipmagic() to take a single string argument, just as it would be
typed at the IPython cmd line.
(ipalias): Added new ipalias() with an interface identical to
ipmagic(). This completes exposing a pure python interface to the
alias and magic system, which can be used in loops or more complex
code where IPython's automatic line mangling is not active.
* IPython/genutils.py (timing): changed interface of timing to
simply run code once, which is the most common case. timings()
remains unchanged, for the cases where you want multiple runs.
* IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
bug where Python2.2 crashes with exec'ing code which does not end
in a single newline. Python 2.3 is OK, so I hadn't noticed this
2004-12-10 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_prun): changed name of option from
-t to -T, to accomodate the new -t flag in %run (the %run and
%prun options are kind of intermixed, and it's not easy to change
this with the limitations of python's getopt).
* IPython/Magic.py (Magic.magic_run): Added new -t option to time
the execution of scripts. It's not as fine-tuned as timeit.py,
but it works from inside ipython (and under 2.2, which lacks
timeit.py). Optionally a number of runs > 1 can be given for
timing very short-running code.
* IPython/genutils.py (uniq_stable): new routine which returns a
list of unique elements in any iterable, but in stable order of
appearance. I needed this for the ultraTB fixes, and it's a handy
* IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
dotted names in Verbose exceptions. This had been broken since
the very start, now x.y will properly be printed in a Verbose
traceback, instead of x being shown and y appearing always as an
'undefined global'. Getting this to work was a bit tricky,
because by default python tokenizers are stateless. Saved by
python's ability to easily add a bit of state to an arbitrary
function (without needing to build a full-blown callable object).
Also big cleanup of this code, which had horrendous runtime
lookups of zillions of attributes for colorization. Moved all
this code into a few templates, which make it cleaner and quicker.
Printout quality was also improved for Verbose exceptions: one
variable per line, and memory addresses are printed (this can be
quite handy in nasty debugging situations, which is what Verbose
is for).
* IPython/ipmaker.py (make_IPython): Do NOT execute files named in
the command line as scripts to be loaded by embedded instances.
Doing so has the potential for an infinite recursion if there are
exceptions thrown in the process. This fixes a strange crash
reported by Philippe MULLER <muller-AT-irit.fr>.
2004-12-09 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
to reflect new names in matplotlib, which now expose the
matlab-compatible interface via a pylab module instead of the
'matlab' name. The new code is backwards compatible, so users of
all matplotlib versions are OK. Patch by J. Hunter.
* IPython/OInspect.py (Inspector.pinfo): Add to object? printing
of __init__ docstrings for instances (class docstrings are already
automatically printed). Instances with customized docstrings
(indep. of the class) are also recognized and all 3 separate
docstrings are printed (instance, class, constructor). After some
comments/suggestions by J. Hunter.
2004-12-05 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (MagicCompleter.complete): Remove annoying
warnings when tab-completion fails and triggers an exception.
2004-12-03 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (magic_prun): Fix bug where an exception would
be triggered when using 'run -p'. An incorrect option flag was
being set ('d' instead of 'D').
(manpage): fix missing escaped \- sign.
2004-11-30 *** Released version 0.6.5
2004-11-30 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
setting with -d option.
* setup.py (docfiles): Fix problem where the doc glob I was using
was COMPLETELY BROKEN. It was giving the right files by pure
accident, but failed once I tried to include ipython.el. Note:
glob() does NOT allow you to do exclusion on multiple endings!
2004-11-29 Fernando Perez <fperez@colorado.edu>
* IPython/usage.py (__doc__): cleaned up usage docstring, by using
the manpage as the source. Better formatting & consistency.
* IPython/Magic.py (magic_run): Added new -d option, to run
scripts under the control of the python pdb debugger. Note that
this required changing the %prun option -d to -D, to avoid a clash
(since %run must pass options to %prun, and getopt is too dumb to
handle options with string values with embedded spaces). Thanks
to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
(magic_who_ls): added type matching to %who and %whos, so that one
can filter their output to only include variables of certain
types. Another suggestion by Matthew.
(magic_whos): Added memory summaries in kb and Mb for arrays.
(magic_who): Improve formatting (break lines every 9 vars).
2004-11-28 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.log): Fix bug in syncing the input
cache when empty lines were present.
2004-11-24 Fernando Perez <fperez@colorado.edu>
* IPython/usage.py (__doc__): document the re-activated threading
options for WX and GTK.
2004-11-23 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (start): Added Prabhu's big patch to reactivate
the -wthread and -gthread options, along with a new -tk one to try
and coordinate Tk threading with wx/gtk. The tk support is very
platform dependent, since it seems to require Tcl and Tk to be
built with threads (Fedora1/2 appears NOT to have it, but in
Prabhu's Debian boxes it works OK). But even with some Tk
limitations, this is a great improvement.
* IPython/Prompts.py (prompt_specials_color): Added \t for time
info in user prompts. Patch by Prabhu.
2004-11-18 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (ask_yes_no): Add check for a max of 20
EOFErrors and bail, to avoid infinite loops if a non-terminating
file is fed into ipython. Patch submitted in issue 19 by user,
many thanks.
* IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
autoquote/parens in continuation prompts, which can cause lots of
problems. Closes roundup issue 20.
2004-11-17 Fernando Perez <fperez@colorado.edu>
* debian/control (Build-Depends-Indep): Fix dpatch dependency,
reported as debian bug #280505. I'm not sure my local changelog
entry has the proper debian format (Jack?).
2004-11-08 *** Released version 0.6.4
2004-11-08 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (init_readline): Fix exit message for Windows
when readline is active. Thanks to a report by Eric Jones
2004-11-07 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (page): Add a trap for OSError exceptions,
sometimes seen by win2k/cygwin users.
2004-11-06 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (interact): Change the handling of %Exit from
trying to propagate a SystemExit to an internal ipython flag.
This is less elegant than using Python's exception mechanism, but
I can't get that to work reliably with threads, so under -pylab
%Exit was hanging IPython. Cross-thread exception handling is
really a bitch. Thaks to a bug report by Stephen Walton
2004-11-04 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (raw_input_original): store a pointer to the
true raw_input to harden against code which can modify it
(wx.py.PyShell does this and would otherwise crash ipython).
Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
* IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
Ctrl-C problem, which does not mess up the input line.
2004-11-03 Fernando Perez <fperez@colorado.edu>
* IPython/Release.py: Changed licensing to BSD, in all files.
(name): lowercase name for tarball/RPM release.
* IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
use throughout ipython.
* IPython/Magic.py (Magic._ofind): Switch to using the new
OInspect.getdoc() function.
* IPython/Shell.py (sigint_handler): Hack to ignore the execution
of the line currently being canceled via Ctrl-C. It's extremely
ugly, but I don't know how to do it better (the problem is one of
handling cross-thread exceptions).
2004-10-28 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (signal_handler): add signal handlers to trap
SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
report by Francesc Alted.
2004-10-21 Fernando Perez <fperez@colorado.edu>
* IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
to % for pysh syntax extensions.
2004-10-09 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_whos): modify output of Numeric
arrays to print a more useful summary, without calling str(arr).
This avoids the problem of extremely lengthy computations which
occur if arr is large, and appear to the user as a system lockup
with 100% cpu activity. After a suggestion by Kristian Sandberg
(Magic.__init__): fix bug in global magic escapes not being
correctly set.
2004-10-08 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (__license__): change to absolute imports of
ipython's own internal packages, to start adapting to the absolute
import requirement of PEP-328.
* IPython/genutils.py (__author__): Fix coding to utf-8 on all
files, and standardize author/license marks through the Release
module instead of having per/file stuff (except for files with
particular licenses, like the MIT/PSF-licensed codes).
* IPython/Debugger.py: remove dead code for python 2.1
2004-10-04 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (ipmagic): New function for accessing magics
via a normal python function call.
* IPython/Magic.py (Magic.magic_magic): Change the magic escape
from '@' to '%', to accomodate the new @decorator syntax of python
2004-09-29 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
matplotlib.use to prevent running scripts which try to switch
interactive backends from within ipython. This will just crash
the python interpreter, so we can't allow it (but a detailed error
is given to the user).
2004-09-28 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (MatplotlibShellBase.mplot_exec):
matplotlib-related fixes so that using @run with non-matplotlib
scripts doesn't pop up spurious plot windows. This requires
matplotlib >= 0.63, where I had to make some changes as well.
* IPython/ipmaker.py (make_IPython): update version requirement to
python 2.2.
* IPython/iplib.py (InteractiveShell.mainloop): Add an optional
banner arg for embedded customization.
* IPython/Magic.py (Magic.__init__): big cleanup to remove all
explicit uses of __IP as the IPython's instance name. Now things
are properly handled via the shell.name value. The actual code
is a bit ugly b/c I'm doing it via a global in Magic.py, but this
is much better than before. I'll clean things completely when the
magic stuff gets a real overhaul.
* ipython.1: small fixes, sent in by Jack Moffit. He also sent in
minor changes to debian dir.
* IPython/iplib.py (InteractiveShell.__init__): Fix adding a
pointer to the shell itself in the interactive namespace even when
a user-supplied dict is provided. This is needed for embedding
purposes (found by tests with Michel Sanner).
2004-09-27 Fernando Perez <fperez@colorado.edu>
* IPython/UserConfig/ipythonrc: remove []{} from
readline_remove_delims, so that things like [modname.<TAB> do
proper completion. This disables [].TAB, but that's a less common
case than module names in list comprehensions, for example.
Thanks to a report by Andrea Riciputi.
2004-09-09 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
blocking problems in win32 and osx. Fix by John.
2004-09-08 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
for Win32 and OSX. Fix by John Hunter.
2004-08-30 *** Released version 0.6.3
2004-08-30 Fernando Perez <fperez@colorado.edu>
* setup.py (isfile): Add manpages to list of dependent files to be
2004-08-27 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (start): I've disabled -wthread and -gthread
for now. They don't really work with standalone WX/GTK code
(though matplotlib IS working fine with both of those backends).
This will neeed much more testing. I disabled most things with
comments, so turning it back on later should be pretty easy.
* IPython/iplib.py (InteractiveShell.__init__): Fix accidental
autocalling of expressions like r'foo', by modifying the line
split regexp. Closes
http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
Riley <ipythonbugs-AT-sabi.net>.
(InteractiveShell.mainloop): honor --nobanner with banner
* IPython/Shell.py: Significant refactoring of all classes, so
that we can really support ALL matplotlib backends and threading
models (John spotted a bug with Tk which required this). Now we
should support single-threaded, WX-threads and GTK-threads, both
for generic code and for matplotlib.
* IPython/ipmaker.py (__call__): Changed -mpthread option to
-pylab, to simplify things for users. Will also remove the pylab
profile, since now all of matplotlib configuration is directly
handled here. This also reduces startup time.
* IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
shell wasn't being correctly called. Also in IPShellWX.
* IPython/iplib.py (InteractiveShell.__init__): Added option to
fine-tune banner.
* IPython/numutils.py (spike): Deprecate these spike functions,
delete (long deprecated) gnuplot_exec handler.
2004-08-26 Fernando Perez <fperez@colorado.edu>
* ipython.1: Update for threading options, plus some others which
were missing.
* IPython/ipmaker.py (__call__): Added -wthread option for
wxpython thread handling. Make sure threading options are only
valid at the command line.
* scripts/ipython: moved shell selection into a factory function
in Shell.py, to keep the starter script to a minimum.
2004-08-25 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
John. Along with some recent changes he made to matplotlib, the
next versions of both systems should work very well together.
2004-08-24 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
tried to switch the profiling to using hotshot, but I'm getting
strange errors from prof.runctx() there. I may be misreading the
docs, but it looks weird. For now the profiling code will
continue to use the standard profiler.
2004-08-23 Fernando Perez <fperez@colorado.edu>
* IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
threaded shell, by John Hunter. It's not quite ready yet, but
2004-08-22 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
in Magic and ultraTB.
* ipython.1: document threading options in manpage.
* scripts/ipython: Changed name of -thread option to -gthread,
since this is GTK specific. I want to leave the door open for a
-wthread option for WX, which will most likely be necessary. This
change affects usage and ipmaker as well.
* IPython/Shell.py (matplotlib_shell): Add a factory function to
handle the matplotlib shell issues. Code by John Hunter
(IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
broken (and disabled for end users) for now, but it puts the
infrastructure in place.
2004-08-21 Fernando Perez <fperez@colorado.edu>
* ipythonrc-pylab: Add matplotlib support.
* matplotlib_config.py: new files for matplotlib support, part of
the pylab profile.
* IPython/usage.py (__doc__): documented the threading options.
2004-08-20 Fernando Perez <fperez@colorado.edu>
* ipython: Modified the main calling routine to handle the -thread
and -mpthread options. This needs to be done as a top-level hack,
because it determines which class to instantiate for IPython
* IPython/Shell.py (MTInteractiveShell.__init__): New set of
classes to support multithreaded GTK operation without blocking,
and matplotlib with all backends. This is a lot of still very
experimental code, and threads are tricky. So it may still have a
few rough edges... This code owes a lot to
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
to John Hunter for all the matplotlib work.
* IPython/ipmaker.py (__call__): Added -thread and -mpthread
options for gtk thread and matplotlib support.
2004-08-16 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.__init__): don't trigger
autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2004-08-11 Fernando Perez <fperez@colorado.edu>
* setup.py (isfile): Fix build so documentation gets updated for
rpms (it was only done for .tgz builds).
2004-08-10 Fernando Perez <fperez@colorado.edu>
* genutils.py (Term): Fix misspell of stdin stream (sin->cin).
* iplib.py : Silence syntax error exceptions in tab-completion.
2004-08-05 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
'color off' mark for continuation prompts. This was causing long
continuation lines to mis-wrap.
2004-08-01 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (make_IPython): Allow the shell class used
for building ipython to be a parameter. All this is necessary
right now to have a multithreaded version, but this insane
non-design will be cleaned up soon. For now, it's a hack that
* IPython/Shell.py (IPShell.__init__): Stop using mutable default
args in various places. No bugs so far, but it's a dangerous
2004-07-31 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (complete): ignore SyntaxError exceptions to
fix completion of files with dots in their names under most
profiles (pysh was OK because the completion order is different).
2004-07-27 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.__init__): build dict of
keywords manually, b/c the one in keyword.py was removed in python
2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
This is NOT a bug under python 2.3 and earlier.
2004-07-26 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (VerboseTB.text): Add another
linecache.checkcache() call to try to prevent inspect.py from
crashing under python 2.3. I think this fixes
2004-07-26 *** Released version 0.6.2
2004-07-26 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
fail for any number.
(Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
empty bookmarks.
2004-07-26 *** Released version 0.6.1
2004-07-26 Fernando Perez <fperez@colorado.edu>
* ipython_win_post_install.py (run): Added pysh shortcut for Windows.
* IPython/iplib.py (protect_filename): Applied Ville's patch for
escaping '()[]{}' in filenames.
* IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
Python 2.2 users who lack a proper shlex.split.
2004-07-19 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.init_readline): Add support
for reading readline's init file. I follow the normal chain:
$INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
report by Mike Heeter. This closes
2004-07-18 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (__init__): Add better handling of '\' under
Win32 for filenames. After a patch by Ville.
2004-07-17 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell._prefilter): fix bug where
autocalling would be triggered for 'foo is bar' if foo is
callable. I also cleaned up the autocall detection code to use a
regexp, which is faster. Bug reported by Alexander Schmolck.
* IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
'?' in them would confuse the help system. Reported by Alex
2004-07-16 Fernando Perez <fperez@colorado.edu>
* IPython/GnuplotInteractive.py (__all__): added plot2.
* IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
plotting dictionaries, lists or tuples of 1d arrays.
* IPython/Magic.py (Magic.magic_hist): small clenaups and
* IPython/iplib.py:Remove old Changelog info for cleanup. This is
the information which was there from Janko's original IPP code:
03.05.99 20:53 porto.ifm.uni-kiel.de
--Started changelog.
--make clear do what it say it does
--added pretty output of lines from inputcache
--Made Logger a mixin class, simplifies handling of switches
--Added own completer class. .string<TAB> expands to last history
line which starts with string. The new expansion is also present
with Ctrl-r from the readline library. But this shows, who this
can be done for other cases.
--Added convention that all shell functions should accept a
parameter_string This opens the door for different behaviour for
each function. @cd is a good example of this.
04.05.99 12:12 porto.ifm.uni-kiel.de
--added logfile rotation
--added new mainloop method which freezes first the namespace
07.05.99 21:24 porto.ifm.uni-kiel.de
--added the docreader classes. Now there is a help system.
-This is only a first try. Currently it's not easy to put new
stuff in the indices. But this is the way to go. Info would be
better, but HTML is every where and not everybody has an info
system installed and it's not so easy to change html-docs to info.
--added global logfile option
--there is now a hook for object inspection method pinfo needs to
be provided for this. Can be reached by two '??'.
08.05.99 20:51 porto.ifm.uni-kiel.de
--added a README
--bug in rc file. Something has changed so functions in the rc
file need to reference the shell and not self. Not clear if it's a
bug or feature.
--changed rc file for new behavior
2004-07-15 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.log): fixed recent bug where the input
cache was falling out of sync in bizarre manners when multi-line
input was present. Minor optimizations and cleanup.
(Logger): Remove old Changelog info for cleanup. This is the
information which was there from Janko's original code:
Changes to Logger: - made the default log filename a parameter
- put a check for lines beginning with !@? in log(). Needed
(even if the handlers properly log their lines) for mid-session
logging activation to work properly. Without this, lines logged
in mid session, which get read from the cache, would end up
'bare' (with !@? in the open) in the log. Now they are caught
and prepended with a #.
* IPython/iplib.py (InteractiveShell.init_readline): added check
in case MagicCompleter fails to be defined, so we don't crash.
2004-07-13 Fernando Perez <fperez@colorado.edu>
* IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
of EPS if the requested filename ends in '.eps'.
2004-07-04 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
escaping of quotes when calling the shell.
2004-07-02 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (CachedOutput.update): Fix problem with
gettext not working because we were clobbering '_'. Fixes
2004-07-01 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
into @cd. Patch by Ville.
* IPython/iplib.py (InteractiveShell.post_config_initialization):
new function to store things after ipmaker runs. Patch by Ville.
Eventually this will go away once ipmaker is removed and the class
gets cleaned up, but for now it's ok. Key functionality here is
the addition of the persistent storage mechanism, a dict for
keeping data across sessions (for now just bookmarks, but more can
be implemented later).
* IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
persistent across sections. Patch by Ville, I modified it
soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
added a '-l' option to list all bookmarks.
* IPython/iplib.py (InteractiveShell.atexit_operations): new
center for cleanup. Registered with atexit.register(). I moved
here the old exit_cleanup(). After a patch by Ville.
* IPython/Magic.py (get_py_filename): added '~' to the accepted
characters in the hacked shlex_split for python 2.2.
* IPython/iplib.py (file_matches): more fixes to filenames with
whitespace in them. It's not perfect, but limitations in python's
readline make it impossible to go further.
2004-06-29 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (file_matches): escape whitespace correctly in
filename completions. Bug reported by Ville.
2004-06-28 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (__call__): Added per-profile histories. Now
the history file will be called 'history-PROFNAME' (or just
'history' if no profile is loaded). I was getting annoyed at
getting my Numerical work history clobbered by pysh sessions.
* IPython/iplib.py (InteractiveShell.__init__): Internal
getoutputerror() function so that we can honor the system_verbose
flag for _all_ system calls. I also added escaping of #
characters here to avoid confusing Itpl.
* IPython/Magic.py (shlex_split): removed call to shell in
parse_options and replaced it with shlex.split(). The annoying
part was that in Python 2.2, shlex.split() doesn't exist, so I had
to backport it from 2.3, with several frail hacks (the shlex
module is rather limited in 2.2). Thanks to a suggestion by Ville
Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
(Magic.magic_system_verbose): new toggle to print the actual
system calls made by ipython. Mainly for debugging purposes.
* IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
doesn't support persistence. Reported (and fix suggested) by
Travis Caldwell <travis_caldwell2000@yahoo.com>.
2004-06-26 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.log): fix to handle correctly empty
continue prompts.
* IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
function (basically a big docstring) and a few more things here to
speedup startup. pysh.py is now very lightweight. We want because
it gets execfile'd, while InterpreterExec gets imported, so
byte-compilation saves time.
2004-06-25 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
-NUM', which was recently broken.
* IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
in multi-line input (but not !!, which doesn't make sense there).
* IPython/UserConfig/ipythonrc: made autoindent on by default.
It's just too useful, and people can turn it off in the less
common cases where it's a problem.
2004-06-24 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell._prefilter): big change -
special syntaxes (like alias calling) is now allied in multi-line
input. This is still _very_ experimental, but it's necessary for
efficient shell usage combining python looping syntax with system
calls. For now it's restricted to aliases, I don't think it
really even makes sense to have this for magics.
2004-06-23 Fernando Perez <fperez@colorado.edu>
* IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
$var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
* IPython/Magic.py (Magic.magic_rehashx): modified to handle
extensions under Windows (after code sent by Gary Bishop). The
extensions considered 'executable' are stored in IPython's rc
structure as win_exec_ext.
* IPython/genutils.py (shell): new function, like system() but
without return value. Very useful for interactive shell work.
* IPython/Magic.py (Magic.magic_unalias): New @unalias function to
delete aliases.
* IPython/iplib.py (InteractiveShell.alias_table_update): make
sure that the alias table doesn't contain python keywords.
2004-06-21 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_rehash): Fix crash when
non-existent items are found in $PATH. Reported by Thorsten.
2004-06-20 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (complete): modified the completer so that the
order of priorities can be easily changed at runtime.
* IPython/Extensions/InterpreterExec.py (prefilter_shell):
Modified to auto-execute all lines beginning with '~', '/' or '.'.
* IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
expand Python variables prepended with $ in all system calls. The
same was done to InteractiveShell.handle_shell_escape. Now all
system access mechanisms (!, !!, @sc, @sx and aliases) allow the
expansion of python variables and expressions according to the
syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
Though PEP-215 has been rejected, a similar (but simpler) one
seems like it will go into Python 2.4, PEP-292 -
I'll keep the full syntax of PEP-215, since IPython has since the
start used Ka-Ping Yee's reference implementation discussed there
(Itpl), and I actually like the powerful semantics it offers.
In order to access normal shell variables, the $ has to be escaped
via an extra $. For example:
In [7]: PATH='a python variable'
In [8]: !echo $PATH
a python variable
In [9]: !echo $$PATH
(Magic.parse_options): escape $ so the shell doesn't evaluate
things prematurely.
* IPython/iplib.py (InteractiveShell.call_alias): added the
ability for aliases to expand python variables via $.
* IPython/Magic.py (Magic.magic_rehash): based on the new alias
system, now there's a @rehash/@rehashx pair of magics. These work
like the csh rehash command, and can be invoked at any time. They
build a table of aliases to everything in the user's $PATH
(@rehash uses everything, @rehashx is slower but only adds
executable files). With this, the pysh.py-based shell profile can
now simply call rehash upon startup, and full access to all
programs in the user's path is obtained.
* IPython/iplib.py (InteractiveShell.call_alias): The new alias
functionality is now fully in place. I removed the old dynamic
code generation based approach, in favor of a much lighter one
based on a simple dict. The advantage is that this allows me to
now have thousands of aliases with negligible cost (unthinkable
with the old system).
2004-06-19 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (__init__): extended MagicCompleter class to
also complete (last in priority) on user aliases.
* IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
call to eval.
(ItplNS.__init__): Added a new class which functions like Itpl,
but allows configuring the namespace for the evaluation to occur
2004-06-18 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.runcode): modify to print a
better message when 'exit' or 'quit' are typed (a common newbie
* IPython/Magic.py (Magic.magic_colors): Added the runtime color
check for Windows users.
* IPython/iplib.py (InteractiveShell.user_setup): removed
disabling of colors for Windows. I'll test at runtime and issue a
warning if Gary's readline isn't found, as to nudge users to
download it.
2004-06-16 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (Stream.__init__): changed to print errors
to sys.stderr. I had a circular dependency here. Now it's
possible to run ipython as IDLE's shell (consider this pre-alpha,
since true stdout things end up in the starting terminal instead
of IDLE's out).
* IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
users who haven't # updated their prompt_in2 definitions. Remove
(multiple_replace): added credit to original ASPN recipe.
2004-06-15 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
list of auto-defined aliases.
2004-06-13 Fernando Perez <fperez@colorado.edu>
* setup.py (scriptfiles): Don't trigger win_post_install unless an
install was really requested (so setup.py can be used for other
things under Windows).
2004-06-10 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.create_log): Manually remove any old
backup, since os.remove may fail under Windows. Fixes bug
reported by Thorsten.
2004-06-09 Fernando Perez <fperez@colorado.edu>
* examples/example-embed.py: fixed all references to %n (replaced
with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
for all examples and the manual as well.
2004-06-08 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
alignment and color management. All 3 prompt subsystems now
inherit from BasePrompt.
* tools/release: updates for windows installer build and tag rpms
with python version (since paths are fixed).
* IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
which will become eventually obsolete. Also fixed the default
prompt_in2 to use \D, so at least new users start with the correct
WARNING: Users with existing ipythonrc files will need to apply
this fix manually!
* setup.py: make windows installer (.exe). This is finally the
integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
which I hadn't included because it required Python 2.3 (or recent
* IPython/usage.py (__doc__): update docs (and manpage) to reflect
usage of new '\D' escape.
* IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
lacks os.getuid())
(CachedOutput.set_colors): Added the ability to turn coloring
on/off with @colors even for manually defined prompt colors. It
uses a nasty global, but it works safely and via the generic color
handling mechanism.
(Prompt2.__init__): Introduced new escape '\D' for continuation
prompts. It represents the counter ('\#') as dots.
need to update their ipythonrc files and replace '%n' with '\D' in
their prompt_in2 settings everywhere. Sorry, but there's
otherwise no clean way to get all prompts to properly align. The
ipythonrc shipped with IPython has been updated.
2004-06-07 Fernando Perez <fperez@colorado.edu>
* setup.py (isfile): Pass local_icons option to latex2html, so the
resulting HTML file is self-contained. Thanks to
dryice-AT-liu.com.cn for the tip.
* pysh.py: I created a new profile 'shell', which implements a
_rudimentary_ IPython-based shell. This is in NO WAY a realy
system shell, nor will it become one anytime soon. It's mainly
meant to illustrate the use of the new flexible bash-like prompts.
I guess it could be used by hardy souls for true shell management,
but it's no tcsh/bash... pysh.py is loaded by the 'shell'
profile. This uses the InterpreterExec extension provided by
W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
* IPython/Prompts.py (PromptOut.__str__): now it will correctly
auto-align itself with the length of the previous input prompt
(taking into account the invisible color escapes).
(CachedOutput.__init__): Large restructuring of this class. Now
all three prompts (primary1, primary2, output) are proper objects,
managed by the 'parent' CachedOutput class. The code is still a
bit hackish (all prompts share state via a pointer to the cache),
but it's overall far cleaner than before.
* IPython/genutils.py (getoutputerror): modified to add verbose,
debug and header options. This makes the interface of all getout*
functions uniform.
(SystemExec.getoutputerror): added getoutputerror to SystemExec.
* IPython/Magic.py (Magic.default_option): added a function to
allow registering default options for any magic command. This
makes it easy to have profiles which customize the magics globally
for a certain use. The values set through this function are
picked up by the parse_options() method, which all magics should
use to parse their options.
* IPython/genutils.py (warn): modified the warnings framework to
use the Term I/O class. I'm trying to slowly unify all of
IPython's I/O operations to pass through Term.
* IPython/Prompts.py (Prompt2._str_other): Added functionality in
the secondary prompt to correctly match the length of the primary
one for any prompt. Now multi-line code will properly line up
even for path dependent prompts, such as the new ones available
via the prompt_specials.
2004-06-06 Fernando Perez <fperez@colorado.edu>
* IPython/Prompts.py (prompt_specials): Added the ability to have
bash-like special sequences in the prompts, which get
automatically expanded. Things like hostname, current working
directory and username are implemented already, but it's easy to
add more in the future. Thanks to a patch by W.J. van der Laan
(prompt_specials): Added color support for prompt strings, so
users can define arbitrary color setups for their prompts.
2004-06-05 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (Term.reopen_all): Added Windows-specific
code to load Gary Bishop's readline and configure it
automatically. Thanks to Gary for help on this.
2004-06-01 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.create_log): fix bug for logging
with no filename (previous fix was incomplete).
2004-05-25 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.parse_options): fix bug where naked
parens would get passed to the shell.
2004-05-20 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_prun): changed default profile
sort order to 'time' (the more common profiling need).
* IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
so that source code shown is guaranteed in sync with the file on
disk (also changed in psource). Similar fix to the one for
ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
* IPython/Magic.py (Magic.parse_options): Fixed bug where commands
with a single option would not be correctly parsed. Closes
http://www.scipy.net/roundup/ipython/issue14. This bug had been
introduced in 0.6.0 (on 2004-05-06).
2004-05-13 *** Released version 0.6.0
2004-05-13 Fernando Perez <fperez@colorado.edu>
* debian/: Added debian/ directory to CVS, so that debian support
is publicly accessible. The debian package is maintained by Jack
Moffit <jack-AT-xiph.org>.
* Documentation: included the notes about an ipython-based system
shell (the hypothetical 'pysh') into the new_design.pdf document,
so that these ideas get distributed to users along with the
official documentation.
2004-05-10 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.create_log): fix recently introduced
bug (misindented line) where logstart would fail when not given an
explicit filename.
2004-05-09 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.parse_options): skip system call when
there are no options to look for. Faster, cleaner for the common
* Documentation: many updates to the manual: describing Windows
support better, Gnuplot updates, credits, misc small stuff. Also
updated the new_design doc a bit.
2004-05-06 *** Released version 0.6.0.rc1
2004-05-06 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (ListTB.text): modified a ton of string +=
operations to use the vastly more efficient list/''.join() method.
(FormattedTB.text): Fix
http://www.scipy.net/roundup/ipython/issue12 - exception source
extract not updated after reload. Thanks to Mike Salib
<msalib-AT-mit.edu> for pinning the source of the problem.
Fortunately, the solution works inside ipython and doesn't require
any changes to python proper.
* IPython/Magic.py (Magic.parse_options): Improved to process the
argument list as a true shell would (by actually using the
underlying system shell). This way, all @magics automatically get
shell expansion for variables. Thanks to a comment by Alex
2004-04-04 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.interact): Added a special
trap for a debugger quit exception, which is basically impossible
to handle by normal mechanisms, given what pdb does to the stack.
This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2004-04-03 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (Term): Standardized the names of the Term
class streams to cin/cout/cerr, following C++ naming conventions
(I can't use in/out/err because 'in' is not a valid attribute
* IPython/iplib.py (InteractiveShell.interact): don't increment
the prompt if there's no user input. By Daniel 'Dang' Griffith
<pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
Francois Pinard.
2004-04-02 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (Stream.__init__): Modified to survive at
least importing in contexts where stdin/out/err aren't true file
objects, such as PyCrust (they lack fileno() and mode). However,
the recovery facilities which rely on these things existing will
not work.
2004-04-01 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
use the new getoutputerror() function, so it properly
distinguishes stdout/err.
* IPython/genutils.py (getoutputerror): added a function to
capture separately the standard output and error of a command.
After a comment from dang on the mailing lists. This code is
basically a modified version of commands.getstatusoutput(), from
the standard library.
* IPython/iplib.py (InteractiveShell.handle_shell_escape): added
'!!' as a special syntax (shorthand) to access @sx.
* IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
command and return its output as a list split on '\n'.
2004-03-31 Fernando Perez <fperez@colorado.edu>
* IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
method to dictionaries used as FakeModule instances if they lack
it. At least pydoc in python2.3 breaks for runtime-defined
functions without this hack. At some point I need to _really_
understand what FakeModule is doing, because it's a gross hack.
But it solves Arnd's problem for now...
2004-02-27 Fernando Perez <fperez@colorado.edu>
* IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
mode would behave erratically. Also increased the number of
possible logs in rotate mod to 999. Thanks to Rod Holland
<rhh@StructureLABS.com> for the report and fixes.
2004-02-26 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (page): Check that the curses module really
has the initscr attribute before trying to use it. For some
reason, the Solaris curses module is missing this. I think this
should be considered a Solaris python bug, but I'm not sure.
2004-01-17 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (Stream.__init__): Changes to try to make
ipython robust against stdin/out/err being closed by the user.
This is 'user error' (and blocks a normal python session, at least
the stdout case). However, Ipython should be able to survive such
instances of abuse as gracefully as possible. To simplify the
coding and maintain compatibility with Gary Bishop's Term
contributions, I've made use of classmethods for this. I think
this introduces a dependency on python 2.2.
2004-01-13 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (exp_safe): simplified the code a bit and
removed the need for importing the kinds module altogether.
2004-01-06 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_sc): Made the shell capture system
a magic function instead, after some community feedback. No
special syntax will exist for it, but its name is deliberately
very short.
2003-12-20 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
new functionality, to automagically assign the result of a shell
command to a variable. I'll solicit some community feedback on
this before making it permanent.
* IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
requested about callables for which inspect couldn't obtain a
proper argspec. Thanks to a crash report sent by Etienne
Posthumus <etienne-AT-apple01.cs.vu.nl>.
2003-12-09 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (page): patch for the pager to work across
various versions of Windows. By Gary Bishop.
2003-12-04 Fernando Perez <fperez@colorado.edu>
* IPython/Gnuplot2.py (PlotItems): Fixes for working with
Gnuplot.py version 1.7, whose internal names changed quite a bit.
While I tested this and it looks ok, there may still be corner
cases I've missed.
2003-12-01 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
where a line like 'p,q=1,2' would fail because the automagic
system would be triggered for @p.
* IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
cleanups, code unmodified.
* IPython/genutils.py (Term): added a class for IPython to handle
output. In most cases it will just be a proxy for stdout/err, but
having this allows modifications to be made for some platforms,
such as handling color escapes under Windows. All of this code
was contributed by Gary Bishop, with minor modifications by me.
The actual changes affect many files.
2003-11-30 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (file_matches): new completion code, courtesy
of Jeff Collins. This enables filename completion again under
python 2.3, which disabled it at the C level.
2003-11-11 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (amap): Added amap() fn. Simple shorthand
for Numeric.array(map(...)), but often convenient.
2003-11-05 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (frange): Changed a call from int() to
int(round()) to prevent a problem reported with arange() in the
numpy list.
2003-10-06 Fernando Perez <fperez@colorado.edu>
* IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
prevent crashes if sys lacks an argv attribute (it happens with
embedded interpreters which build a bare-bones sys module).
Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2003-09-24 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic._ofind): blanket except around getattr()
to protect against poorly written user objects where __getattr__
raises exceptions other than AttributeError. Thanks to a bug
report by Oliver Sander <osander-AT-gmx.de>.
* IPython/FakeModule.py (FakeModule.__repr__): this method was
missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2003-09-09 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell._prefilter): fix bug where
unpacking a list whith a callable as first element would
mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2003-08-25 *** Released version 0.5.0
2003-08-22 Fernando Perez <fperez@colorado.edu>
* IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
improperly defined user exceptions. Thanks to feedback from Mark
Russell <mrussell-AT-verio.net>.
2003-08-20 Fernando Perez <fperez@colorado.edu>
* IPython/OInspect.py (Inspector.pinfo): changed String Form
printing so that it would print multi-line string forms starting
with a new line. This way the formatting is better respected for
objects which work hard to make nice string forms.
* IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
autocall would overtake data access for objects with both
__getitem__ and __call__.
2003-08-19 *** Released version 0.5.0-rc1
2003-08-19 Fernando Perez <fperez@colorado.edu>
* IPython/deep_reload.py (load_tail): single tiny change here
seems to fix the long-standing bug of dreload() failing to work
for dotted names. But this module is pretty tricky, so I may have
missed some subtlety. Needs more testing!.
* IPython/ultraTB.py (VerboseTB.linereader): harden against user
exceptions which have badly implemented __str__ methods.
(VerboseTB.text): harden against inspect.getinnerframes crashing,
which I've been getting reports about from Python 2.3 users. I
wish I had a simple test case to reproduce the problem, so I could
either write a cleaner workaround or file a bug report if
* IPython/Magic.py (Magic.magic_edit): fixed bug where after
making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
a bug report by Tjabo Kloppenburg.
* IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
crashes. Wrapped the pdb call in a blanket try/except, since pdb
seems rather unstable. Thanks to a bug report by Tjabo
Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
* IPython/Release.py (version): release 0.5.0-rc1. I want to put
this out soon because of the critical fixes in the inner loop for
* IPython/Magic.py (Magic.getargspec): removed. This (and
_get_def) have been obsoleted by OInspect for a long time, I
hadn't noticed that they were dead code.
(Magic._ofind): restored _ofind functionality for a few literals
(those in ["''",'""','[]','{}','()']). But it won't work anymore
for things like "hello".capitalize?, since that would require a
potentially dangerous eval() again.
* IPython/iplib.py (InteractiveShell._prefilter): reorganized the
logic a bit more to clean up the escapes handling and minimize the
use of _ofind to only necessary cases. The interactive 'feel' of
IPython should have improved quite a bit with the changes in
_prefilter and _ofind (besides being far safer than before).
* IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
obscure, never reported). Edit would fail to find the object to
edit under some circumstances.
(Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
which were causing double-calling of generators. Those eval calls
were _very_ dangerous, since code with side effects could be
triggered. As they say, 'eval is evil'... These were the
nastiest evals in IPython. Besides, _ofind is now far simpler,
and it should also be quite a bit faster. Its use of inspect is
also safer, so perhaps some of the inspect-related crashes I've
seen lately with Python 2.3 might be taken care of. That will
need more testing.
2003-08-17 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell._prefilter): significant
simplifications to the logic for handling user escapes. Faster
and simpler code.
2003-08-14 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (sum_flat): rewrote to be non-recursive.
Now it requires O(N) storage (N=size(a)) for non-contiguous input,
but it should be quite a bit faster. And the recursive version
generated O(log N) intermediate storage for all rank>1 arrays,
even if they were contiguous.
(l1norm): Added this function.
(norm): Added this function for arbitrary norms (including
l-infinity). l1 and l2 are still special cases for convenience
and speed.
2003-08-03 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_edit): Removed all remaining string
exceptions, which now raise PendingDeprecationWarnings in Python
2.3. There were some in Magic and some in Gnuplot2.
2003-06-30 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (page): modified to call curses only for
terminals where TERM=='xterm'. After problems under many other
terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
* IPython/iplib.py (complete): removed spurious 'print "IE"' which
would be triggered when readline was absent. This was just an old
debugging statement I'd forgotten to take out.
2003-06-20 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (clock): modified to return only user time
(not counting system time), after a discussion on scipy. While
system time may be a useful quantity occasionally, it may much
more easily be skewed by occasional swapping or other similar
2003-06-05 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py (identity): new function, for building
arbitrary rank Kronecker deltas (mostly backwards compatible with
2003-06-03 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.handle_magic): protect
arguments passed to magics with spaces, to allow trailing '\' to
work normally (mainly for Windows users).
2003-05-29 Fernando Perez <fperez@colorado.edu>
* IPython/ipmaker.py (make_IPython): Load site._Helper() as help
instead of pydoc.help. This fixes a bizarre behavior where
printing '%s' % locals() would trigger the help system. Now
ipython behaves like normal python does.
Note that if one does 'from pydoc import help', the bizarre
behavior returns, but this will also happen in normal python, so
it's not an ipython bug anymore (it has to do with how pydoc.help
is implemented).
2003-05-22 Fernando Perez <fperez@colorado.edu>
* IPython/FlexCompleter.py (Completer.attr_matches): fixed to
return [] instead of None when nothing matches, also match to end
of line. Patch by Gary Bishop.
* IPython/ipmaker.py (make_IPython): Added same sys.excepthook
protection as before, for files passed on the command line. This
prevents the CrashHandler from kicking in if user files call into
sys.excepthook (such as PyQt and WxWindows have a nasty habit of
doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2003-05-20 *** Released version 0.4.0
2003-05-20 Fernando Perez <fperez@colorado.edu>
* setup.py: added support for manpages. It's a bit hackish b/c of
a bug in the way the bdist_rpm distutils target handles gzipped
manpages, but it works. After a patch by Jack.
2003-05-19 Fernando Perez <fperez@colorado.edu>
* IPython/numutils.py: added a mockup of the kinds module, since
it was recently removed from Numeric. This way, numutils will
work for all users even if they are missing kinds.
* IPython/Magic.py (Magic._ofind): Harden against an inspect
failure, which can occur with SWIG-wrapped extensions. After a
crash report from Prabhu.
2003-05-16 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.excepthook): New method to
protect ipython from user code which may call directly
sys.excepthook (this looks like an ipython crash to the user, even
when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
This is especially important to help users of WxWindows, but may
also be useful in other cases.
* IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
an optional tb_offset to be specified, and to preserve exception
info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
* ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2003-05-15 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
installing for a new user under Windows.
2003-05-12 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.handle_emacs): New line
handler for Emacs comint-based lines. Currently it doesn't do
much (but importantly, it doesn't update the history cache). In
the future it may be expanded if Alex needs more functionality
* IPython/CrashHandler.py (CrashHandler.__call__): Added platform
info to crash reports.
* IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
just like Python's -c. Also fixed crash with invalid -color
option value at startup. Thanks to Will French
<wfrench-AT-bestweb.net> for the bug report.
2003-05-09 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
to EvalDict (it's a mapping, after all) and simplified its code
quite a bit, after a nice discussion on c.l.py where Gustavo
Córdova <gcordova-AT-sismex.com> suggested the new version.
2003-04-30 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (timings_out): modified it to reduce its
overhead in the common reps==1 case.
2003-04-29 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (timings_out): Modified to use the resource
module, which avoids the wraparound problems of time.clock().
2003-04-17 *** Released version 0.2.15pre4
2003-04-17 Fernando Perez <fperez@colorado.edu>
* setup.py (scriptfiles): Split windows-specific stuff over to a
separate file, in an attempt to have a Windows GUI installer.
That didn't work, but part of the groundwork is done.
* IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
indent/unindent with 4 spaces. Particularly useful in combination
with the new auto-indent option.
2003-04-16 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py: various replacements of self.rc for
self.shell.rc. A lot more remains to be done to fully disentangle
this class from the main Shell class.
* IPython/GnuplotRuntime.py: added checks for mouse support so
that we don't try to enable it if the current gnuplot doesn't
really support it. Also added checks so that we don't try to
enable persist under Windows (where Gnuplot doesn't recognize the
* IPython/iplib.py (InteractiveShell.interact): Added optional
auto-indenting code, after a patch by King C. Shu
<kingshu-AT-myrealbox.com>. It's off by default because it doesn't
get along well with pasting indented code. If I ever figure out
how to make that part go well, it will become on by default.
* IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
crash ipython if there was an unmatched '%' in the user's prompt
string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
* IPython/iplib.py (InteractiveShell.interact): removed the
ability to ask the user whether he wants to crash or not at the
'last line' exception handler. Calling functions at that point
changes the stack, and the error reports would have incorrect
* IPython/Magic.py (Magic.magic_page): Added new @page magic, to
pass through a peger a pretty-printed form of any object. After a
contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2003-04-14 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
all files in ~ would be modified at first install (instead of
~/.ipython). This could be potentially disastrous, as the
modification (make line-endings native) could damage binary files.
2003-04-10 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.handle_help): Modified to
handle only lines which are invalid python. This now means that
lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
for the bug report.
2003-04-01 Fernando Perez <fperez@colorado.edu>
* IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
where failing to set sys.last_traceback would crash pdb.pm().
Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2003-03-25 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
before printing it (it had a lot of spurious blank lines at the
* IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
output would be sent 21 times! Obviously people don't use this
too often, or I would have heard about it.
2003-03-24 Fernando Perez <fperez@colorado.edu>
* setup.py (scriptfiles): renamed the data_files parameter from
'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
for the patch.
2003-03-20 Fernando Perez <fperez@colorado.edu>
* IPython/genutils.py (error): added error() and fatal()
2003-03-18 *** Released version 0.2.15pre3
2003-03-18 Fernando Perez <fperez@colorado.edu>
* setupext/install_data_ext.py
(install_data_ext.initialize_options): Class contributed by Jack
Moffit for fixing the old distutils hack. He is sending this to
the distutils folks so in the future we may not need it as a
private fix.
* MANIFEST.in: Extensive reorganization, based on Jack Moffit's
changes for Debian packaging. See his patch for full details.
The old distutils hack of making the ipythonrc* files carry a
bogus .py extension is gone, at last. Examples were moved to a
separate subdir under doc/, and the separate executable scripts
now live in their own directory. Overall a great cleanup. The
manual was updated to use the new files, and setup.py has been
fixed for this setup.
* IPython/PyColorize.py (Parser.usage): made non-executable and
created a pycolor wrapper around it to be included as a script.
2003-03-12 *** Released version 0.2.15pre2
2003-03-12 Fernando Perez <fperez@colorado.edu>
* IPython/ColorANSI.py (make_color_table): Finally fixed the
long-standing problem with garbage characters in some terminals.
The issue was really that the \001 and \002 escapes must _only_ be
passed to input prompts (which call readline), but _never_ to
normal text to be printed on screen. I changed ColorANSI to have
two classes: TermColors and InputTermColors, each with the
appropriate escapes for input prompts or normal text. The code in
Prompts.py got slightly more complicated, but this very old and
annoying bug is finally fixed.
All the credit for nailing down the real origin of this problem
and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
*Many* thanks to him for spending quite a bit of effort on this.
2003-03-05 *** Released version 0.2.15pre1
2003-03-03 Fernando Perez <fperez@colorado.edu>
* IPython/FakeModule.py: Moved the former _FakeModule to a
separate file, because it's also needed by Magic (to fix a similar
pickle-related issue in @run).
2003-03-02 Fernando Perez <fperez@colorado.edu>
* IPython/Magic.py (Magic.magic_autocall): new magic to control
the autocall option at runtime.
(Magic.magic_dhist): c