[IPython-dev] pyreadline refactoring

Laurent Dufréchou laurent.dufrechou at gmail.com
Thu Jun 26 09:05:51 EDT 2008


Hi Jorgen,

Good news :)
When i wrote ipython0 wx frontend i ran into some problem with readline.
(And perhaps I ran in these problems because I don't enter enough in
pyreadline code who knows...)
- History (the biggest one):
It was not that easy to get these information:
HistoryBack and HistoryForward, and history current length.
So if you could add some simple and direct method that permit to load a
history from file, and manage an history pointer I'll be very very happy.
If you don't understand what I mean just have a look at line 300 of
ipshell_nonblocking.py in /gui/wx I think you'll see what I didn't found in
pyreadline.
I fact should be good to have some simple function to get easily an history.
Currently to get history I use....:
IP.input_hist_raw[self._history_level].strip('\n')
That is far from ideal...

- In my code I used pyreadline capabilities to get ascii colored outputted
datas.
Do you think it could be possible to add some other output formatter like
for example an xml formatter or html for example. Perhaps just a method to
bypass classical readline formatter and people could add their formatter
(thus we could step by step add new formatter to readline code)
Just an idea...

- Can it be possible to use readline only for history and output formating?
I mean without key handling and cursor management? (If for example I want
for any reason manage them myself)

Laurent

> -----Message d'origine-----
> De : ipython-dev-bounces at scipy.org [mailto:ipython-dev-
> bounces at scipy.org] De la part de Barry Wark
> Envoyé : mercredi 25 juin 2008 00:37
> À : Jörgen Stenarson
> Cc : IPython-dev List
> Objet : Re: [IPython-dev] pyreadline refactoring
> 
> On Tue, Jun 24, 2008 at 12:42 PM, Jörgen Stenarson
> <jorgen.stenarson at bostream.nu> wrote:
> > Hi,
> >
> > I have started to work on a refactoring of pyreadline with the goal
> to
> > untangle the class interactions that have made it difficult to reuse
> > pyreadline in other circumstances than a shell on win32.
> >
> > The basic idea is that it should be possible to call a readline
> object
> > with keypress events containing (control, shift, meta, char, keyname)
> > where keyname is for special keys like space, f1, return etc.
> >
> > The readline object would be responsible for keeping track of current
> > prompt, line_buffer, cursor_position and selection_position. But the
> > caller of the object will have to render the buffer.
> >
> > I have also merged the callback branch I worked on a few months back.
> > The branch is at lp:~jorgen-stenarson/pyreadline/pyreadline-refactor
> >
> > If anyone has any ideas or suggestions on how things should work
> please
> > let me know.
> 
> Jörgen,
> 
> Wow, this is an exciting move in view of the plans to separate
> ipython0's core from the terminal/readline. I am still learning about
> pyreadline, but your description above makes me think that you, me,
> and Gaël should think about using the new (refactored) pyreadline in
> developing a base class for front ends that are based on a
> line-oriented interface (i.e. mimicking the terminal interface).
> 
> Barry
> 
> >
> > /Jörgen
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev
> >
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev




More information about the IPython-dev mailing list