[IPython-dev] Brand new refactored version for linux users!

Laurent Dufréchou laurent.dufrechou at gmail.com
Sun Jan 13 17:03:34 EST 2008


Ok got the screenshot.
For syntax highlighting, it is for history only (look the little text
written in blue ;) )
Sadly I couldn't activate it for Ipython shell widget because it messed up
the colors of In[,Out[ and ipython ouput (which still colored as normal
ipython shell indeed).
Parhaps will add it to my todo list, but I was so happy to have a similar
working behavior on liux and windows that I let the things like this :)
For the ESC bell etc...
Ouch this is a big bug!
ls,cd works well here under liux and windows.

Please can you tell wich version of wx you use?
Sudo synaptic, search wx: I've got python-wxgtk-2.8.4.0-0ubunutu3


I suspect a locales error.
Can you do this?:

Around line 424 in ipython_view.py:
Replace line 
result =
stdout.read()#.decode('cp437').encode(locale.getpreferredencoding())
by            
result = stdout.read()
#we use print command because the shell command is called inside IPython
instance and thus is
#redirected to thread cout
#"\x01\x1b[1;36m\x02" <-- add colour to the text...
print "\x01\x1b[1;36m\x02"+result
            
I suspect that your terminal is not cp437 encoded.
If it doesn't works try also to remove 
print "\x01\x1b[1;36m\x02"+result
by:
print result

by the way I'm upgrading my ubuntu gutsy or gusty perhaps I will have same
bug as yours :)
Laurent

-----Message d'origine-----
De : Fernando Perez [mailto:fperez.net at gmail.com] 
Envoyé : dimanche 13 janvier 2008 22:13
À : Laurent Dufréchou
Cc : IPython-dev at scipy.org
Objet : Re: [IPython-dev] Brand new refactored version for linux users!

On Jan 13, 2008 2:01 PM, Laurent Dufréchou <laurent.dufrechou at gmail.com>
wrote:
> Hi Fernando,
>
> Ok got the problem with 'magic'
> In fact the problem I got with ipython is that every time a call to pager
is
> done depending from where it is called it can appear that I haven't
> redirected the function.
>
> I had to do this weird thing in my code...:
>
> #we replace the ipython default pager by our pager
> #FIXME: add a pager callback to IPython
> IPython.OInspect.page = self._pager
> IPython.genutils.page = self._pager
> IPython.iplib.page = self._pager
> (any better idea welcome!!)

Mmh, I can't recall at the moment, but we should have a cleaner API for
this...

> So 'magic' function is one of these function that need to be redirected,
to
> my pager.
> Fernando, do you think it could be possible to add a hook to ipython to
> avoid this bad coding method??

Certaily we should :)

> For the syntax highlighting problem can you send a private mail @gmail? +
> tell me witch linux distrib you use and the version of wx too. Will take a
> look at it and add Experimental warning inside it :).

I'm on ubuntu gutsy, up to date.  I'll send you the screenshot off-list.

>
> By the way, can you give me the commands that didn't work as expected??
> (should only be ipython one...)

ls
cd

They worked, but produced junk.  You'll see it in the screenshot.

Cheers,
f




More information about the IPython-dev mailing list