[IPython-dev] [IPython-user] IPython 0.8.2 and PyReadline 1.5, getting ready for release...

Fernando Perez fperez.net@gmail....
Sat Nov 24 14:00:19 CST 2007


On Nov 24, 2007 12:51 PM, Noah Gift <noah.gift@gmail.com> wrote:

> It appears auto-indention is not working for me.  Here is a default session:
>
>
> [ngift@Macintosh-6 ][H:10426][J:0]> ipython
> Leopard libedit detected.

Ah.

Could you please try

import readline
readline.<TAB>

and paste in the output?

With GNU readline, we get:


In [2]: readline.
readline.__builtins__                readline.get_current_history_length
readline.__class__                   readline.get_endidx
readline.__delattr__                 readline.get_history_item
readline.__dict__                    readline.get_history_length
readline.__doc__                     readline.get_line_buffer
readline.__file__                    readline.have_readline
readline.__getattribute__            readline.insert_text
readline.__hash__                    readline.parse_and_bind
readline.__init__                    readline.read_history_file
readline.__name__                    readline.read_init_file
readline.__new__                     readline.redisplay
readline.__reduce__                  readline.remove_history_item
readline.__reduce_ex__               readline.replace_history_item
readline.__repr__                    readline.set_completer
readline.__setattr__                 readline.set_completer_delims
readline.__str__                     readline.set_history_length
readline._rl                         readline.set_pre_input_hook
readline.add_history                 readline.set_startup_hook
readline.clear_history               readline.sys
readline.get_begidx                  readline.uses_libedit
readline.get_completer               readline.write_history_file
readline.get_completer_delims


And the critical one is

readline.insert_text

which we use to rewrite the new line you're about to type into via the
pre_readline method:

http://projects.scipy.org/ipython/ipython/browser/ipython/trunk/IPython/iplib.py#L1281

If that function doesn't exist, or is a no-op, we're stuck without
auto-indent in Leopard.  If it does work, then we may be doing
something else incorrectly though.  I unfortunately don't have a
leopard box to test on yet (waiting for my wife's laptop to
arrrive...).

Cheers,

f


More information about the IPython-dev mailing list