From walter at livinglogic.de  Wed Mar  1 05:05:41 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 11:05:41 +0100
Subject: [IPython-dev] ipipe news
Message-ID: <440571F5.60900@livinglogic.de>

I've uploaded a new version of ipipe to 
http://styx.livinglogic.de/~walter/IPython/ipipe.py

This should work with the current SVN HEAD of IPython.

The most important changes since the last published version are:

Objects in the curses browser can now be "entered". For example when 
browsing a directory (via "ils"), pressing RETURN on a directory 
displays the content of this directory, pressing RETURN on a file 
displays the text content of that file. Pressing BACKSPACE goes back to 
the previous display. Objects can provide different enter modes (via the 
__xiter__() method), pressing "e" will display a menu of available modes 
(if the object provides any, otherwise it's the same as RETURN).

ipipe now tries to figure out the best way to iterate an object (i.e. 
for dictionaries, modules and multi-line strings it does "the right thing").

Other features added to the browser are: A detail view for the object 
under the cursor, a help screen, customizable key mapping, picking 
current or marked attributes, sorting and entering attributes. (Pressing 
"h" brings up a help screen with the list of all commands.)

One example that shows these new features is browsing sys.modules:

 >>> from ipipe import *
 >>> import sys
 >>> sys.modules | ibrowse

This displays a listing of all loaded modules. Moving the cursor over a 
module (i.e. moving it to the "value" column over e.g. "<module 
'exceptions' (built-in)>") brings up the content of this module, then 
moving the cursor to the value of the __doc__ attribute brings up a 
properly formatted doc string etc.


I think the basic API for this should be pretty stable, so IMHO ipipe 
could go into the current SVN version of IPython, so that people can 
play with it. But of course that's for Fernando and Ville to decide.

Naturally there are probably bugs remaining in the code and of course 
there's always more documentation to write, and I guess a tutorial would 
be pretty useful. And there's probably a whole list of features that 
could be added to the browser (e.g. incremental search would be pretty 
handy) and the pipeline classes.

Anyway, feedback is greatly appreciated!

Bye,
    Walter D?rwald



From arnd.baecker at web.de  Wed Mar  1 06:07:46 2006
From: arnd.baecker at web.de (Arnd Baecker)
Date: Wed, 1 Mar 2006 12:07:46 +0100 (CET)
Subject: [IPython-dev] ipipe news
In-Reply-To: <440571F5.60900@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
Message-ID: <Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>

Hi,

that sounds cool!

On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:

> I've uploaded a new version of ipipe to
> http://styx.livinglogic.de/~walter/IPython/ipipe.py
>
> This should work with the current SVN HEAD of IPython.

Should it also work from a normal python prompt?

For this I get:
>>> from ipipe import *
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "ipipe.py", line 246
    return (XAttr(item, name) for name in xattrs(item, mode))
                                ^
SyntaxError: invalid syntax

Converting this to
    return [XAttr(item, name) for name in xattrs(item, mode)]
shows another problem in l. 292

Best, Arnd



From vivainio at gmail.com  Wed Mar  1 06:54:10 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Wed, 1 Mar 2006 13:54:10 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
Message-ID: <46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>

On 3/1/06, Arnd Baecker <arnd.baecker at web.de> wrote:

> Should it also work from a normal python prompt?
>
> For this I get:
> >>> from ipipe import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "ipipe.py", line 246
>     return (XAttr(item, name) for name in xattrs(item, mode))
>                                 ^
> SyntaxError: invalid syntax
>
> Converting this to
>     return [XAttr(item, name) for name in xattrs(item, mode)]
> shows another problem in l. 292

Yeah, we're trying to avoid 2.4 syntax where applicable. I can see why
this can be a problem when you want generators though... you'd have to
implement a custom generator instead of genexp.

One extra problem:

when curses in not available (which is the case on win32), I get

[environmentswitch]|1> from ipipe import *
---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most recent call
 last)

C:\opt\environmentswitch\<ipython console>

AttributeError: 'module' object has no attribute 'ibrowse'
[environmentswitch]|2>

The import should also work without curses.

Once these problems are fixed (and the indentation is converted to 4
spaces), I have no issues shipping this in IPython/Extensions.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From walter at livinglogic.de  Wed Mar  1 07:51:15 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 13:51:15 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
Message-ID: <440598C3.50201@livinglogic.de>

Arnd Baecker wrote:

> Hi,
> 
> that sounds cool!
> 
> On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> 
>> I've uploaded a new version of ipipe to
>> http://styx.livinglogic.de/~walter/IPython/ipipe.py
>>
>> This should work with the current SVN HEAD of IPython.
> 
> Should it also work from a normal python prompt?

I've uploaded a new version that does. You just have to "from ipipe 
import *"

> [...]

Bye,
    Walter D?rwald



From walter at livinglogic.de  Wed Mar  1 08:00:53 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 14:00:53 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
Message-ID: <44059B05.9010903@livinglogic.de>

Ville Vainio wrote:

> On 3/1/06, Arnd Baecker <arnd.baecker at web.de> wrote:
> 
>> Should it also work from a normal python prompt?
>>
>> For this I get:
>>>>> from ipipe import *
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>>   File "ipipe.py", line 246
>>     return (XAttr(item, name) for name in xattrs(item, mode))
>>                                 ^
>> SyntaxError: invalid syntax
>>
>> Converting this to
>>     return [XAttr(item, name) for name in xattrs(item, mode)]
>> shows another problem in l. 292
> 
> Yeah, we're trying to avoid 2.4 syntax where applicable. I can see why
> this can be a problem when you want generators though... you'd have to
> implement a custom generator instead of genexp.

OK, done, instead of a generator expression, a local generator function 
is used. (And collections.deque is replaced by list on 2.3 and sorted is 
reimplemented if neccessary.)

> One extra problem:
> 
> when curses in not available (which is the case on win32), I get
> 
> [environmentswitch]|1> from ipipe import *
> ---------------------------------------------------------------------------
> exceptions.AttributeError                            Traceback (most recent call
>  last)
> 
> C:\opt\environmentswitch\<ipython console>
> 
> AttributeError: 'module' object has no attribute 'ibrowse'

Fixed, ibrowse is now only added to __all__ if it exists.

> [environmentswitch]|2>
> 
> The import should also work without curses.

It should work now. If curses isn't available idump is used as the 
default browser. Please retry!

> Once these problems are fixed (and the indentation is converted to 4
> spaces),

I've reindented it to four spaces.

> I have no issues shipping this in IPython/Extensions.

Great!

How do we handle maintenance? Do I upload patches to the tracker or can 
I have repository write access? I promise I won't touch anything except 
ipipe. ;)

Bye,
    Walter D?rwald



From arnd.baecker at web.de  Wed Mar  1 08:05:51 2006
From: arnd.baecker at web.de (Arnd Baecker)
Date: Wed, 1 Mar 2006 14:05:51 +0100 (CET)
Subject: [IPython-dev] ipipe news
In-Reply-To: <440598C3.50201@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<440598C3.50201@livinglogic.de>
Message-ID: <Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>

Hi,

On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:

> Arnd Baecker wrote:
>
> > Hi,
> >
> > that sounds cool!
> >
> > On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> >
> >> I've uploaded a new version of ipipe to
> >> http://styx.livinglogic.de/~walter/IPython/ipipe.py
> >>
> >> This should work with the current SVN HEAD of IPython.
> >
> > Should it also work from a normal python prompt?
>
> I've uploaded a new version that does. You just have to "from ipipe
> import *"

thanks for the rapid fix.
Now the example you mailed works in as much I get a list
with # key value.
Moving on the value field and pressing <enter> (that's what
one is supposed to do, or?) gives
  "TypeError: iteration over non-sequence"
Could this be another 2.3 vs. 2.4 thing?

Many thanks,

Arnd




From vivainio at gmail.com  Wed Mar  1 08:15:46 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Wed, 1 Mar 2006 15:15:46 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <44059B05.9010903@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
Message-ID: <46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>

On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:

> How do we handle maintenance? Do I upload patches to the tracker or can
> I have repository write access? I promise I won't touch anything except
> ipipe. ;)

That's Fernando's call, but I think this level of maintenance can be
managed by just sending me the patches directly. It doesn't take too
much of my time to commit everything blindly, which I can do with good
conscience because it's a standalone extension, as opposed to "core"
code which could break stuff elsewhere (and would require some thought
on my part).

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From walter at livinglogic.de  Wed Mar  1 08:40:30 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 14:40:30 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<440598C3.50201@livinglogic.de>
	<Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>
Message-ID: <4405A44E.3050700@livinglogic.de>

Arnd Baecker wrote:
> Hi,
> 
> On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> 
>> Arnd Baecker wrote:
>>
>>> Hi,
>>>
>>> that sounds cool!
>>>
>>> On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
>>>
>>>> I've uploaded a new version of ipipe to
>>>> http://styx.livinglogic.de/~walter/IPython/ipipe.py
>>>>
>>>> This should work with the current SVN HEAD of IPython.
>>> Should it also work from a normal python prompt?
>> I've uploaded a new version that does. You just have to "from ipipe
>> import *"
> 
> thanks for the rapid fix.
> Now the example you mailed works in as much I get a list
> with # key value.
> Moving on the value field and pressing <enter> (that's what
> one is supposed to do, or?) gives
>   "TypeError: iteration over non-sequence"
> Could this be another 2.3 vs. 2.4 thing?

No, pressing <enter> enters the object itself (i.e. the key value pair 
(which doesn't work this case)), you have to press E (i.e. shift-e).

Bye,
    Walter D?rwald



From arnd.baecker at web.de  Wed Mar  1 08:52:38 2006
From: arnd.baecker at web.de (Arnd Baecker)
Date: Wed, 1 Mar 2006 14:52:38 +0100 (CET)
Subject: [IPython-dev] ipipe news
In-Reply-To: <4405A44E.3050700@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>
	<4405A44E.3050700@livinglogic.de>
Message-ID: <Pine.LNX.4.51.0603011449330.28609@ptpcp8.phy.tu-dresden.de>

On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:

> Arnd Baecker wrote:
> > Hi,
> >
> > On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> >
> >> Arnd Baecker wrote:
> >>
> >>> Hi,
> >>>
> >>> that sounds cool!
> >>>
> >>> On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> >>>
> >>>> I've uploaded a new version of ipipe to
> >>>> http://styx.livinglogic.de/~walter/IPython/ipipe.py
> >>>>
> >>>> This should work with the current SVN HEAD of IPython.
> >>> Should it also work from a normal python prompt?
> >> I've uploaded a new version that does. You just have to "from ipipe
> >> import *"
> >
> > thanks for the rapid fix.
> > Now the example you mailed works in as much I get a list
> > with # key value.
> > Moving on the value field and pressing <enter> (that's what
> > one is supposed to do, or?) gives
> >   "TypeError: iteration over non-sequence"
> > Could this be another 2.3 vs. 2.4 thing?
>
> No, pressing <enter> enters the object itself (i.e. the key value pair
> (which doesn't work this case)), you have to press E (i.e. shift-e).

Thanks - and "h" does give a nice overview of all possibilities.
(I should have had a look at the source ;-) -  BTW: there are several
lines >80 chars which makes it hard to read when they get wrapped).

Very nice to have this tool, many thanks,

Arnd



From walter at livinglogic.de  Wed Mar  1 08:56:51 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 14:56:51 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
Message-ID: <4405A823.5000206@livinglogic.de>

Ville Vainio wrote:

> On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> How do we handle maintenance? Do I upload patches to the tracker or can
>> I have repository write access? I promise I won't touch anything except
>> ipipe. ;)
> 
> That's Fernando's call, but I think this level of maintenance can be
> managed by just sending me the patches directly.

OK!

> It doesn't take too
> much of my time to commit everything blindly, which I can do with good
> conscience because it's a standalone extension, as opposed to "core"
> code which could break stuff elsewhere (and would require some thought
> on my part).

OK, so just tell me when ipipe is checked in and I'll mail patches from 
then on.

Bye,
    Walter D?rwald



From walter at livinglogic.de  Wed Mar  1 09:00:48 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 15:00:48 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <Pine.LNX.4.51.0603011449330.28609@ptpcp8.phy.tu-dresden.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<440598C3.50201@livinglogic.de>
	<Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>
	<4405A44E.3050700@livinglogic.de>
	<Pine.LNX.4.51.0603011449330.28609@ptpcp8.phy.tu-dresden.de>
Message-ID: <4405A910.2000507@livinglogic.de>

Arnd Baecker wrote:

> On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
> 
>> Arnd Baecker wrote:
>>> Hi,
>>> [...]
>>> thanks for the rapid fix.
>>> Now the example you mailed works in as much I get a list
>>> with # key value.
>>> Moving on the value field and pressing <enter> (that's what
>>> one is supposed to do, or?) gives
>>>   "TypeError: iteration over non-sequence"
>>> Could this be another 2.3 vs. 2.4 thing?
>> No, pressing <enter> enters the object itself (i.e. the key value pair
>> (which doesn't work this case)), you have to press E (i.e. shift-e).
> 
> Thanks - and "h" does give a nice overview of all possibilities.
> (I should have had a look at the source ;-)

The two most important commands are listed in the lower right corner
(quit and help).

> -  BTW: there are several
> lines >80 chars which makes it hard to read when they get wrapped).

In the source, or in the help screen?

> Very nice to have this tool, many thanks,

Bye,
    Walter D?rwald



From arnd.baecker at web.de  Wed Mar  1 09:15:48 2006
From: arnd.baecker at web.de (Arnd Baecker)
Date: Wed, 1 Mar 2006 15:15:48 +0100 (CET)
Subject: [IPython-dev] ipipe news
In-Reply-To: <4405A910.2000507@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<Pine.LNX.4.51.0603011403330.28609@ptpcp8.phy.tu-dresden.de>
	<Pine.LNX.4.51.0603011449330.28609@ptpcp8.phy.tu-dresden.de>
	<4405A910.2000507@livinglogic.de>
Message-ID: <Pine.LNX.4.51.0603011505390.28609@ptpcp8.phy.tu-dresden.de>

On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:

> Arnd Baecker wrote:
>
> > On Wed, 1 Mar 2006, [ISO-8859-1] Walter D?rwald wrote:
[...]
> >> No, pressing <enter> enters the object itself (i.e. the key value pair
> >> (which doesn't work this case)), you have to press E (i.e. shift-e).
> >
> > Thanks - and "h" does give a nice overview of all possibilities.
> > (I should have had a look at the source ;-)
>
> The two most important commands are listed in the lower right corner
> (quit and help).

"blush" ...

> > -  BTW: there are several
> > lines >80 chars which makes it hard to read when they get wrapped).
>
> In the source, or in the help screen?

Actually both. To be precise:
for the help screen there are lines which are longer than 80
characters, but these don't wrapped so one can just scroll.

Best, Arnd



From vivainio at gmail.com  Wed Mar  1 11:09:02 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Wed, 1 Mar 2006 18:09:02 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <4405A823.5000206@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
Message-ID: <46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>

On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:

> OK, so just tell me when ipipe is checked in and I'll mail patches from
> then on.

It's checked in now.

You might start by shortening the lines in main docstring (ipipe?
causes some wrappage) and adding some docstrings (minimal is ok), so
users can get up to speed by using the ? operator.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From hgamboa at gmail.com  Wed Mar  1 11:24:07 2006
From: hgamboa at gmail.com (Hugo Gamboa)
Date: Wed, 1 Mar 2006 16:24:07 +0000
Subject: [IPython-dev] Balancing code execution in ipython1
Message-ID: <86522b1a0603010824j55647939m69c2c2a8b91f5a3a@mail.gmail.com>

Hi,

I've started to work with the parallel ipython and feeling that this is a
fantastic and promising tool.

I want to run some of the tasks in parallel, but I'm not comfortable with
the scatter way, that equally divides a set of tasks.
I would like to balance the code execution between computers for two
reasons: I have computers with distinct speed and the code may be completed
earlier in some cases.

I would like to know when a computer have ended a task and assign a new one.


I've considered a solution similar to pylinda tuple spaces but (as far as I
know) the the kernel does not have access to the kernel client other than in
a form of answering. The kernel cannot take the iniciative and change a
cluster common data, that could be a way of solving my needs.

What is the best direction? Should I derive from a resultgatherer to monitor
the end of code execution or there is a better way?

Thanks in advance for your time.

Hugo Gamboa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060301/1cb5d7b5/attachment.html>

From vivainio at gmail.com  Wed Mar  1 12:24:56 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Wed, 1 Mar 2006 09:24:56 -0800
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
Message-ID: <46cb515a0603010924vf5df9b0qdc87425b5dd667e8@mail.gmail.com>

Is there an easy way to create a Table "casually", without declaring
any classes?

I'm thinking of api like

t = Table('name','address')

t.add(name='foo',address = 'bar')
t.add(name='hello',address = 'world')

or perhaps even create it with list/tuple of dicts/arbitrary objects
and try to do __getitem__, and failing that, getattr for 'name' and
'address' for every object in sequence.



From walter at livinglogic.de  Wed Mar  1 13:20:51 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 19:20:51 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603010924vf5df9b0qdc87425b5dd667e8@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<46cb515a0603010924vf5df9b0qdc87425b5dd667e8@mail.gmail.com>
Message-ID: <4405E603.2090608@livinglogic.de>

Ville Vainio wrote:

> Is there an easy way to create a Table "casually", without declaring
> any classes?
> 
> I'm thinking of api like
> 
> t = Table('name','address')
> 
> t.add(name='foo',address = 'bar')
> t.add(name='hello',address = 'world')
> 
> or perhaps even create it with list/tuple of dicts/arbitrary objects
> and try to do __getitem__, and failing that, getattr for 'name' and
> 'address' for every object in sequence.

If the object is a list or tuple, this already works:

     [("foo", "bar"), ("hello", "world")] | ibrowse

but if it isn't a sequence __xattr__() has to be implemented to get the 
list of attributes for the object, so you'd have to use a class that 
looks like this:

     class idict(dict):
         def __xattrs__(self, mode):
             return self.keys()
          def __getattr__(self, key):
             try:
                 return self[key]
             except KeyError:
                 raise AttributeError

With this you can do:

[idict(foo="foo", bar="bar"), idict(foo="hello", bar="world")] | ibrowse

But unfortunately with this the column order is undefined. But you can 
do something like this:

     class OnTheFlyTable(object):
         def __init__(self, *attrs):
             self.attrs = attrs

         def __call__(self, **kwargs):
             return idict(**kwargs)

     class idict(dict):
         def __init__(self, table, **kwargs):
             self.table = table
             dict.__init__(**kwargs)

         def __xattrs__(self, mode):
             return self.table.attrs

         def __getattr__(self, key):
             try:
                 return self[key]
             except KeyError:
                 raise AttributeError

Then you can do:

     t = OnTheFlyTable("foo", "bar")
     [t(foo="foo", bar="bar"), t(foo="hello", bar="world")] | ibrowse

If we add something like this to ipipe, we need better names for 
OnTheFlyTable and idict.

Bye,
    Walter D?rwald



From antont at kyperjokki.fi  Wed Mar  1 13:35:28 2006
From: antont at kyperjokki.fi (Toni Alatalo)
Date: Wed, 1 Mar 2006 19:35:28 +0100
Subject: [IPython-dev] notebook wiki gone?
Message-ID: <200603011935.28062.antont@kyperjokki.fi>

http://www.scipy.org/wikis/featurerequests/NoteBook

that http://projects.scipy.org/ipython/ipython/wiki/NoteBook
calls "Main notebook wiki at Scipy"

.. is gone.

seems that scipy.org has updated things - i was unable to relocate it with a 
quick search there. no biggie, just noticed when saw the talk about 
http://summerofcode.xwiki.com/xwiki/bin/view/Wiki/WebHome

~Toni
(who otherwise should read the new mails on this list)



From vivainio at gmail.com  Wed Mar  1 13:35:54 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Wed, 1 Mar 2006 10:35:54 -0800
Subject: [IPython-dev] ipipe news
In-Reply-To: <4405E603.2090608@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<46cb515a0603010924vf5df9b0qdc87425b5dd667e8@mail.gmail.com>
	<4405E603.2090608@livinglogic.de>
Message-ID: <46cb515a0603011035n1cd1fc89g59c1961be2d06029@mail.gmail.com>

On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:

> Then you can do:
>
>      t = OnTheFlyTable("foo", "bar")
>      [t(foo="foo", bar="bar"), t(foo="hello", bar="world")] | ibrowse

I'd like the Table to hold the sequence, so that ibrowse would be
launched automatically (which doesn't happen with plain lists and
tuples).

For example, I might change %alias, when called w/o args, to return a
Table, with name & target fields. That way the user would be thrown
into ibrowse without having to invoke it manually.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From walter at livinglogic.de  Wed Mar  1 15:25:03 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 21:25:03 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603011035n1cd1fc89g59c1961be2d06029@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<46cb515a0603010924vf5df9b0qdc87425b5dd667e8@mail.gmail.com>
	<4405E603.2090608@livinglogic.de>
	<46cb515a0603011035n1cd1fc89g59c1961be2d06029@mail.gmail.com>
Message-ID: <4406031F.6040109@livinglogic.de>

Ville Vainio wrote:
> On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> Then you can do:
>>
>>      t = OnTheFlyTable("foo", "bar")
>>      [t(foo="foo", bar="bar"), t(foo="hello", bar="world")] | ibrowse
> 
> I'd like the Table to hold the sequence, so that ibrowse would be
> launched automatically (which doesn't happen with plain lists and
> tuples).
> 
> For example, I might change %alias, when called w/o args, to return a
> Table, with name & target fields. That way the user would be thrown
> into ibrowse without having to invoke it manually.

OK, understood.

Try something like this:

from IPython.Extensions import ipipe

class Fields(object):
     def __init__(self, table, **fields):
         self.__table = table
         for (key, value) in fields.iteritems():
             setattr(self, key, value)

     def __xattrs__(self, mode):
         return self.__table.fields


class FieldTable(ipipe.Table, list):
      def __init__(self, *fields):
          ipipe.Table.__init__(self)
          list.__init__(self)
          self.fields = fields

      def add(self, **fields):
          self.append(Fields(self, **fields))

      def __xiter__(self, mode):
          return list.__iter__(self)

      def __xrepr__(self, mode):
          if mode == "header" or mode == "footer":
              return "FieldTable(%r)" % ", ".join(map(repr, self.fields))
          return repr(self)

Then you can do what you requested:

 >>> f = FieldTable("name", "table")
 >>> f.add(foo="foo", bar="bar")
 >>> f.add(foo="hello", bar="world")
 >>> f

I'll something like this to ipipe.py

Bye,
    Walter D?rwald




From jdhunter at ace.bsd.uchicago.edu  Wed Mar  1 15:50:14 2006
From: jdhunter at ace.bsd.uchicago.edu (John Hunter)
Date: Wed, 01 Mar 2006 14:50:14 -0600
Subject: [IPython-dev] ipipe news
In-Reply-To: <440571F5.60900@livinglogic.de> (Walter
	=?iso-8859-1?q?D=F6rwald's?= message of "Wed,
	01 Mar 2006 11:05:41 +0100")
References: <440571F5.60900@livinglogic.de>
Message-ID: <87acc9yjnd.fsf@peds-pc311.bsd.uchicago.edu>

>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:

    Walter> I've uploaded a new version of ipipe to
    Walter> http://styx.livinglogic.de/~walter/IPython/ipipe.py

This is very cool.  Nice work!

I like the CSV functionality :-)

I've figured out how to browse a CSV file and pick a row, but am
having trouble picking a column.  The ability to mark and pick
multiple rows is very nice.  It would also be nice to select a range
or rows.  Eg, after sorting, one might like to select a range of rows
for further analysis.

Thanks!
JDH



From walter at livinglogic.de  Wed Mar  1 15:54:47 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 21:54:47 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <87acc9yjnd.fsf@peds-pc311.bsd.uchicago.edu>
References: <440571F5.60900@livinglogic.de>
	<87acc9yjnd.fsf@peds-pc311.bsd.uchicago.edu>
Message-ID: <44060A17.5050009@livinglogic.de>

John Hunter wrote:
>>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
> 
>     Walter> I've uploaded a new version of ipipe to
>     Walter> http://styx.livinglogic.de/~walter/IPython/ipipe.py
> 
> This is very cool.  Nice work!
> 
> I like the CSV functionality :-)
> 
> I've figured out how to browse a CSV file and pick a row, but am
> having trouble picking a column.

Currently there's no key to pick a complete column. There's only P which 
picks one cell and M which picks the column value of all marked objects.

But this should be simple to add.

> The ability to mark and pick
> multiple rows is very nice.  It would also be nice to select a range
> or rows.  Eg, after sorting, one might like to select a range of rows
> for further analysis.

Hmm, this might require some kind of dialog box (or you mark the first 
object, go to the last object and press the key for "mark from first 
marked to here").

Bye,
    Walter D?rwald



From jdhunter at ace.bsd.uchicago.edu  Wed Mar  1 16:08:34 2006
From: jdhunter at ace.bsd.uchicago.edu (John Hunter)
Date: Wed, 01 Mar 2006 15:08:34 -0600
Subject: [IPython-dev] ipipe news
In-Reply-To: <44060A17.5050009@livinglogic.de> (Walter
	=?iso-8859-1?q?D=F6rwald's?= message of "Wed,
	01 Mar 2006 21:54:47 +0100")
References: <440571F5.60900@livinglogic.de>
	<87acc9yjnd.fsf@peds-pc311.bsd.uchicago.edu>
	<44060A17.5050009@livinglogic.de>
Message-ID: <87oe0px48d.fsf@peds-pc311.bsd.uchicago.edu>

>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
    Walter> Hmm, this might require some kind of dialog box (or you
    Walter> mark the first object, go to the last object and press the
    Walter> key for "mark from first marked to here").

The latter is what I had in mind...

Here's a problem I ran into trying to filter all the methods that
start with 'set' on a matplotlib line object

In [17]: len([k.startswith('set') for k in line.__dict__.keys()])
Out[17]: 37

In [18]: line.__dict__|ifilter("key.startswith('set')")|ibrowse
------------------------------------------------------------
Traceback (most recent call last):
  File "<ipython console>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/IPython/Prompts.py", line
  517, in __call__
    manipulated_val = self.display(arg)
  File "/usr/lib/python2.4/site-packages/IPython/Prompts.py", line
  541, in _display
    return self.shell.hooks.result_display(arg)
  File "/usr/lib/python2.4/site-packages/IPython/hooks.py", line 126,
  in __call__
    ret = cmd(*args, **kw)
  File "/usr/lib/python2.4/site-packages/IPython/Extensions/ipipe.py",
  line 1995, in displayhook
    return obj.display()
  File "/usr/lib/python2.4/site-packages/IPython/Extensions/ipipe.py",
  line 1971, in display
    return curses.wrapper(self._dodisplay)
  File "/usr/lib/python2.4/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python2.4/site-packages/IPython/Extensions/ipipe.py",
  line 1813, in _dodisplay
    for posy in xrange(posy+1, self.scrsizey-2):
UnboundLocalError: local variable 'posy' referenced before assignment






From jorgen.stenarson at bostream.nu  Wed Mar  1 16:14:26 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Wed, 01 Mar 2006 22:14:26 +0100
Subject: [IPython-dev] Two small patches
Message-ID: <44060EB2.5090003@bostream.nu>

hi,

I have attached a patchfile containing to small oneline changes.

The first change is in Magic.py and it adds & as a character that should 
be escaped by \ when generating latex output.

The other change is in eggsetup.py that currently does not work in 
develop mode. Because it deletes the ipython.egg-info file.

/J?rgen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch20060301
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060301/92155ed0/attachment.ksh>

From walter at livinglogic.de  Wed Mar  1 16:40:02 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 22:40:02 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <87oe0px48d.fsf@peds-pc311.bsd.uchicago.edu>
References: <440571F5.60900@livinglogic.de>
	<87acc9yjnd.fsf@peds-pc311.bsd.uchicago.edu>	<44060A17.5050009@livinglogic.de>
	<87oe0px48d.fsf@peds-pc311.bsd.uchicago.edu>
Message-ID: <440614B2.3080709@livinglogic.de>

John Hunter wrote:

>>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
>     Walter> Hmm, this might require some kind of dialog box (or you
>     Walter> mark the first object, go to the last object and press the
>     Walter> key for "mark from first marked to here").
> 
> The latter is what I had in mind...

Hmm, should be simple.

> Here's a problem I ran into trying to filter all the methods that
> start with 'set' on a matplotlib line object
> 
> In [17]: len([k.startswith('set') for k in line.__dict__.keys()])
> Out[17]: 37
> 
> In [18]: line.__dict__|ifilter("key.startswith('set')")|ibrowse
 > [...]
> UnboundLocalError: local variable 'posy' referenced before assignment

This is a bug when the input is empty. I'm working on a fix.

Bye,
    Walter D?rwald



From walter at livinglogic.de  Wed Mar  1 17:14:08 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 01 Mar 2006 23:14:08 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
Message-ID: <44061CB0.6090005@livinglogic.de>

Ville Vainio wrote:

> On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> OK, so just tell me when ipipe is checked in and I'll mail patches from
>> then on.
> 
> It's checked in now.

Here's the first patch:
http://styx.livinglogic.de/~walter/IPython/ipipe.diff

> You might start by shortening the lines in main docstring (ipipe?
> causes some wrappage)

Done!

> and adding some docstrings (minimal is ok), so
> users can get up to speed by using the ? operator.

I hope I can find time for this over the weekend.

Here's the complete list of changes:

"""
Rewrapped docstrings, comments and code to try to get the line length 
below 80 characters.

Added two commands to ibrowse: "pickallattrs" picks a complete column, 
"markrange" marks all objects from the last marked before the cursor to 
the cursor.

Renamed ibrowse commands "sortcolumnasc"/"sortcolumndesc" to 
"sortattrasc"/"sortattrdesc"

Fixed NameError when input in ibrowse is empty.

Added classes FieldTable and Fields: This simplifies generating 
browsable input. Use those classes where appropriate.

Moved the ibrowse help to a global string that gets split and rewrapped 
automatically.
"""

BTW, I you can't type the umlaut-o from my name (e.g. in doc/ChangeLog) 
you should transliterate "D?rwald" as "Doerwald" not as "Dorwald". Thanks!

Bye,
    Walter D?rwald



From robert.kern at gmail.com  Wed Mar  1 18:58:10 2006
From: robert.kern at gmail.com (Robert Kern)
Date: Wed, 01 Mar 2006 17:58:10 -0600
Subject: [IPython-dev] notebook wiki gone?
In-Reply-To: <200603011935.28062.antont@kyperjokki.fi>
References: <200603011935.28062.antont@kyperjokki.fi>
Message-ID: <du5cej$u83$1@sea.gmane.org>

Toni Alatalo wrote:
> http://www.scipy.org/wikis/featurerequests/NoteBook
> 
> that http://projects.scipy.org/ipython/ipython/wiki/NoteBook
> calls "Main notebook wiki at Scipy"
> 
> .. is gone.
> 
> seems that scipy.org has updated things - i was unable to relocate it with a 
> quick search there. no biggie, just noticed when saw the talk about 
> http://summerofcode.xwiki.com/xwiki/bin/view/Wiki/WebHome

http://old.scipy.org/wikis/featurerequests/NoteBook

-- 
Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter



From vivainio at gmail.com  Thu Mar  2 11:04:01 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Thu, 2 Mar 2006 18:04:01 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <44061CB0.6090005@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
Message-ID: <46cb515a0603020804w237aa10ndb76f88982ac61c5@mail.gmail.com>

On 3/2/06, Walter D?rwald <walter at livinglogic.de> wrote:

> Here's the first patch:
> http://styx.livinglogic.de/~walter/IPython/ipipe.diff

Applied. In the future, feel free to send the patches directly to me
as attachments.

> BTW, I you can't type the umlaut-o from my name (e.g. in doc/ChangeLog)
> you should transliterate "D?rwald" as "Doerwald" not as "Dorwald". Thanks!

I can (I'm Finnish),  I just prefer to avoid "weird" characters as
much as possible. I'll use Doerwald.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From jdhunter at ace.bsd.uchicago.edu  Thu Mar  2 11:59:12 2006
From: jdhunter at ace.bsd.uchicago.edu (John Hunter)
Date: Thu, 02 Mar 2006 10:59:12 -0600
Subject: [IPython-dev] ipipe news
In-Reply-To: <44061CB0.6090005@livinglogic.de> (Walter
	=?iso-8859-1?q?D=F6rwald's?= message of "Wed,
	01 Mar 2006 23:14:08 +0100")
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
Message-ID: <87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>

>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
    Walter> Here's the first patch:
    Walter> http://styx.livinglogic.de/~walter/IPython/ipipe.diff

This morning I was thinking about the usefulness of an object browser
class "iobj", that does a dir on an object and reports the attribute
names in the first class and the attribute values in the right.
Something like

  myobj | ifilter("not attr.startswith('_')") | ibrowse

In the browser, you would want to be able to enter the object as an
object.  Eg, if you have an array attribute, pressing "E" browses the
array as a sequence and pressing "o" would browse it as an object,
listing the array attributes.

Or does something like this already exist?

JDH



From walter at livinglogic.de  Thu Mar  2 13:10:23 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 19:10:23 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
Message-ID: <4407350F.3000500@livinglogic.de>

John Hunter wrote:

>>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
>     Walter> Here's the first patch:
>     Walter> http://styx.livinglogic.de/~walter/IPython/ipipe.diff
> 
> This morning I was thinking about the usefulness of an object browser
> class "iobj", that does a dir on an object and reports the attribute
> names in the first class and the attribute values in the right.
> Something like
> 
>   myobj | ifilter("not attr.startswith('_')") | ibrowse

You should be able to do:
myobj.__dict__ | ifilter("not key.startswith('_')") | ibrowse

Unfortunately this is currently broken, but I sent a patch to Ville a 
few minutes ago that fixes this problem.

> In the browser, you would want to be able to enter the object as an
> object.  Eg, if you have an array attribute, pressing "E" browses the
> array as a sequence and pressing "o" would browse it as an object,
> listing the array attributes.

In theory there are already different enter modes, but none of the 
objects implemented in ipipe use this yet.

How an object is entered is defined in the global function xiter(). 
There's hardcoded handling for dicts, modules and multi-line strings, 
for everything else the __xiter__() method of the object is called, if 
this doesn't exist, it falls back to __iter__(). If this doesn't exist 
either, you'll get the "Iteration over non-sequence" exception.

I guess I really need to document the existing extension points.

> Or does something like this already exist?

Not really, but you could implement an iobj class that provides two 
enter modes in __xiter__() when mode is None: one for "enter as 
sequence" and one for "enter object attributes". The problem is, that 
you don't have those iobj objects as attributes in an existing listing. 
Maybe this treatment should be the default fallback handling in xiter()?

Bye,
    Walter D?rwald



From vivainio at gmail.com  Thu Mar  2 13:29:18 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Thu, 2 Mar 2006 10:29:18 -0800
Subject: [IPython-dev] ipipe news
In-Reply-To: <4407350F.3000500@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
Message-ID: <46cb515a0603021029gcb74c69t1996c5dcd9f7269a@mail.gmail.com>

On 3/2/06, Walter D?rwald <walter at livinglogic.de> wrote:

> Unfortunately this is currently broken, but I sent a patch to Ville a
> few minutes ago that fixes this problem.

Applied.

It's a shame that ibrowse doesn't work w/o curses. Could you perhaps
implement a "stupid" version of ibrowse that dumped the table to
screen like with just doing "ils"?

Also, I'd like the output of ils and iwalk to have the filename as
first column, that's the most important part anyway.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From jdhunter at ace.bsd.uchicago.edu  Thu Mar  2 13:59:21 2006
From: jdhunter at ace.bsd.uchicago.edu (John Hunter)
Date: Thu, 02 Mar 2006 12:59:21 -0600
Subject: [IPython-dev] ipipe news
In-Reply-To: <4407350F.3000500@livinglogic.de> (Walter
	=?iso-8859-1?q?D=F6rwald's?= message of "Thu,
	02 Mar 2006 19:10:23 +0100")
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
Message-ID: <87wtfcvfjq.fsf@peds-pc311.bsd.uchicago.edu>

>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
    >> This morning I was thinking about the usefulness of an object
    >> browser class "iobj", that does a dir on an object and reports
    >> the attribute names in the first class and the attribute values
    >> in the right.  Something like myobj | ifilter("not
    >> attr.startswith('_')") | ibrowse

    Walter> You should be able to do: myobj.__dict__ | ifilter("not
    Walter> key.startswith('_')") | ibrowse

    Walter> Unfortunately this is currently broken, but I sent a patch
    Walter> to Ville a few minutes ago that fixes this problem.

Yep, that patch was in response to me playing with o.__dict__|ibrowse,
I think.

I was looking for something a bit broader than __dict__ though, namely
something that uses dir(obj) combined with getattr.

The motivation is that matplotlib has an object introspection
mechanism by doing a dir on objects and looking for names that have
set_something or get_something, where something is a property (we
basically have our own hacked up version of python properties).  A
custom ifilter could be written to browse these properties, by
filtering on callable attrs that start with 'set_'

Here's a little example of using setp, the object inspector, in
pylab.  I was hoping to hack up a ipipe version...

In [4]: line, = plot(rand(10))

In [5]: [a for a in dir(line) if a.startswith('set_') and callable(getattr(line, a))]
Out[5]:
['set_aa', 'set_alpha', 'set_animated', 'set_antialiased', 'set_c',
 'set_clip_box', 'set_clip_on', 'set_color', 'set_dash_capstyle',
 'set_dash_joinstyle', 'set_dashes', 'set_data', 'set_figure',
 'set_label', 'set_linestyle', 'set_linewidth', 'set_lod', 'set_ls',
 'set_lw', 'set_marker', 'set_markeredgecolor', 'set_markeredgewidth',
 'set_markerfacecolor', 'set_markersize', 'set_mec', 'set_mew',
 'set_mfc', 'set_ms', 'set_solid_capstyle', 'set_solid_joinstyle',
 'set_transform', 'set_visible', 'set_xdata', 'set_ydata',
 'set_zorder']


In [6]: setp(line)
    alpha: float
    animated: [True | False]
    antialiased or aa: [True | False]
    clip_box: a matplotlib.transform.Bbox instance
    clip_on: [True | False]
    color or c: any matplotlib color - see help(colors)
    dash_capstyle: ['butt' | 'round' | 'projecting']
    dash_joinstyle: ['miter' | 'round' | 'bevel']
    dashes: sequence of on/off ink in points
    data: (array xdata, array ydata)
    figure: a matplotlib.figure.Figure instance
    label: any string
    linestyle or ls: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
    linewidth or lw: float value in points
    lod: [True | False]
    marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' |
    'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' |
    '|' ]
    markeredgecolor or mec: any matplotlib color - see help(colors)
    markeredgewidth or mew: float value in points
    markerfacecolor or mfc: any matplotlib color - see help(colors)
    markersize or ms: float
    solid_capstyle: ['butt' | 'round' |  'projecting']
    solid_joinstyle: ['miter' | 'round' | 'bevel']
    transform: a matplotlib.transform transformation instance
    visible: [True | False]
    xdata: array
    ydata: array
    zorder: any number



From walter at livinglogic.de  Thu Mar  2 14:26:21 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 20:26:21 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603021029gcb74c69t1996c5dcd9f7269a@mail.gmail.com>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
	<46cb515a0603021029gcb74c69t1996c5dcd9f7269a@mail.gmail.com>
Message-ID: <440746DD.8040202@livinglogic.de>

Ville Vainio wrote:

> On 3/2/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> Unfortunately this is currently broken, but I sent a patch to Ville a
>> few minutes ago that fixes this problem.
> 
> Applied.
> 
> It's a shame that ibrowse doesn't work w/o curses. Could you perhaps
> implement a "stupid" version of ibrowse that dumped the table to
> screen like with just doing "ils"?

There already is "idump" as the maximally stupid Display object and 
"iless", which pipes the output through less. To switch the default 
display simply assign to the defaultdisplay variable:

[1]>>> from IPython.Extensions import ipipe

[2]>>> ipipe.defaultdisplay = ipipe.idump

[3]>>> igrp
[3]=== name           |passwd|gid|mem
nobody         |      | -2|[]
nogroup        |      | -1|[]
wheel          |      |  0|['root']
...

Seems that a "\n" should be printed at the start.

And I guess it would make sense to use IPython's pager for iless, 
instead of a hardcoded command line.

> Also, I'd like the output of ils and iwalk to have the filename as
> first column, that's the most important part anyway.

The output was modelled after the "ls -l" output. I guess the output in 
"ls -l" is done this way because the filename is the only variable 
length part.

Switching the output format for ils/iwalk/iglob is simple: Just change 
ifile.__xattrs__(). Maybe we should put the default attributes into a 
class attribute, so that everybody can choose his/her own file listing 
format?

Servus,
    Walter



From vivainio at gmail.com  Thu Mar  2 14:36:30 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Thu, 2 Mar 2006 11:36:30 -0800
Subject: [IPython-dev] ipipe news
In-Reply-To: <440746DD.8040202@livinglogic.de>
References: <440571F5.60900@livinglogic.de> <44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
	<46cb515a0603021029gcb74c69t1996c5dcd9f7269a@mail.gmail.com>
	<440746DD.8040202@livinglogic.de>
Message-ID: <46cb515a0603021136u2cd7528m4d04f4464d0d960b@mail.gmail.com>

On 3/2/06, Walter D?rwald <walter at livinglogic.de> wrote:

> [1]>>> from IPython.Extensions import ipipe

Note - you can just do "import ipipe" when IPython is running,
Extensions is on sys.path.

> ifile.__xattrs__(). Maybe we should put the default attributes into a
> class attribute, so that everybody can choose his/her own file listing
> format?

I think one sensible format (with file name as first colums) should be
enough for most uses...

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From walter at livinglogic.de  Thu Mar  2 15:30:07 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 21:30:07 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603021136u2cd7528m4d04f4464d0d960b@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
	<46cb515a0603021029gcb74c69t1996c5dcd9f7269a@mail.gmail.com>
	<440746DD.8040202@livinglogic.de>
	<46cb515a0603021136u2cd7528m4d04f4464d0d960b@mail.gmail.com>
Message-ID: <440755CF.6000403@livinglogic.de>

Ville Vainio wrote:

> On 3/2/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> [1]>>> from IPython.Extensions import ipipe
> 
> Note - you can just do "import ipipe" when IPython is running,
> Extensions is on sys.path.

OK, thanks for the tip.

>> ifile.__xattrs__(). Maybe we should put the default attributes into a
>> class attribute, so that everybody can choose his/her own file listing
>> format?
> 
> I think one sensible format (with file name as first colums) should be
> enough for most uses...

OK, so go ahead change it and check it in.

Servus,
    Walter



From walter at livinglogic.de  Thu Mar  2 15:45:22 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 21:45:22 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <87wtfcvfjq.fsf@peds-pc311.bsd.uchicago.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
	<87wtfcvfjq.fsf@peds-pc311.bsd.uchicago.edu>
Message-ID: <44075962.5050101@livinglogic.de>

John Hunter wrote:
>>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
>     >> This morning I was thinking about the usefulness of an object
>     >> browser class "iobj", that does a dir on an object and reports
>     >> the attribute names in the first class and the attribute values
>     >> in the right.  Something like myobj | ifilter("not
>     >> attr.startswith('_')") | ibrowse
> 
>     Walter> You should be able to do: myobj.__dict__ | ifilter("not
>     Walter> key.startswith('_')") | ibrowse
> 
>     Walter> Unfortunately this is currently broken, but I sent a patch
>     Walter> to Ville a few minutes ago that fixes this problem.
> 
> Yep, that patch was in response to me playing with o.__dict__|ibrowse,
> I think.

Indeed!

> I was looking for something a bit broader than __dict__ though, namely
> something that uses dir(obj) combined with getattr.

How about something like this:
import ipipe

class iinspect(ipipe.Pipe):
     def __xiter__(self, mode):
         fields = ("key", "value")
         for key in dir(self.input):
             yield ipipe.Fields(
                fields,
                key=key,
                value=getattr(self.input, key)
             )

With this you can do:
 >>> 42 | iinspect

(Although this isn't a real pipe any more, as the input isn't really 
iterable)

> The motivation is that matplotlib has an object introspection
> mechanism by doing a dir on objects and looking for names that have
> set_something or get_something, where something is a property (we
> basically have our own hacked up version of python properties).  A
> custom ifilter could be written to browse these properties, by
> filtering on callable attrs that start with 'set_'

You can hack the iinspect class from above, to give you something like that.

> Here's a little example of using setp, the object inspector, in
> pylab.  I was hoping to hack up a ipipe version...
> 
> In [4]: line, = plot(rand(10))
> 
> In [5]: [a for a in dir(line) if a.startswith('set_') and callable(getattr(line, a))]
> Out[5]:
> ['set_aa', 'set_alpha', 'set_animated', 'set_antialiased', 'set_c',
>  'set_clip_box', 'set_clip_on', 'set_color', 'set_dash_capstyle',
>  'set_dash_joinstyle', 'set_dashes', 'set_data', 'set_figure',
>  'set_label', 'set_linestyle', 'set_linewidth', 'set_lod', 'set_ls',
>  'set_lw', 'set_marker', 'set_markeredgecolor', 'set_markeredgewidth',
>  'set_markerfacecolor', 'set_markersize', 'set_mec', 'set_mew',
>  'set_mfc', 'set_ms', 'set_solid_capstyle', 'set_solid_joinstyle',
>  'set_transform', 'set_visible', 'set_xdata', 'set_ydata',
>  'set_zorder']

The following should do it:

class iinspect(ipipe.Pipe):
     def __xiter__(self, mode):
         fields = ("key", "value")
         for key in dir(self.input):
            if key.startswith("set_"):
                value = getattr(self.input, key)
                    if callable(value):
                        yield ipipe.Fields(fields, key=key, value=value)

> In [6]: setp(line)
>     alpha: float
>     animated: [True | False]
>     antialiased or aa: [True | False]
>     clip_box: a matplotlib.transform.Bbox instance
>     clip_on: [True | False]
>     color or c: any matplotlib color - see help(colors)
>     dash_capstyle: ['butt' | 'round' | 'projecting']
>     dash_joinstyle: ['miter' | 'round' | 'bevel']
>     dashes: sequence of on/off ink in points
>     data: (array xdata, array ydata)
>     figure: a matplotlib.figure.Figure instance
>     label: any string
>     linestyle or ls: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
>     linewidth or lw: float value in points
>     lod: [True | False]
>     marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4' | '<' | '>' |
>     'D' | 'H' | '^' | '_' | 'd' | 'h' | 'o' | 'p' | 's' | 'v' | 'x' |
>     '|' ]
>     markeredgecolor or mec: any matplotlib color - see help(colors)
>     markeredgewidth or mew: float value in points
>     markerfacecolor or mfc: any matplotlib color - see help(colors)
>     markersize or ms: float
>     solid_capstyle: ['butt' | 'round' |  'projecting']
>     solid_joinstyle: ['miter' | 'round' | 'bevel']
>     transform: a matplotlib.transform transformation instance
>     visible: [True | False]
>     xdata: array
>     ydata: array
>     zorder: any number

I don't know where this comes from, are these the docstrings of the 
properties?

Servus,
    Walter



From jdhunter at ace.bsd.uchicago.edu  Thu Mar  2 16:29:14 2006
From: jdhunter at ace.bsd.uchicago.edu (John Hunter)
Date: Thu, 02 Mar 2006 15:29:14 -0600
Subject: [IPython-dev] ipipe news
In-Reply-To: <44075962.5050101@livinglogic.de> (Walter
	=?iso-8859-1?q?D=F6rwald's?= message of "Thu,
	02 Mar 2006 21:45:22 +0100")
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>
	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>
	<87wtfcvfjq.fsf@peds-pc311.bsd.uchicago.edu>
	<44075962.5050101@livinglogic.de>
Message-ID: <87wtfc1qol.fsf@peds-pc311.bsd.uchicago.edu>

>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
    Walter> How about something like this: import ipipe

    Walter> class iinspect(ipipe.Pipe): def __xiter__(self, mode):
    Walter> fields = ("key", "value") for key in dir(self.input):
    Walter> yield ipipe.Fields( fields, key=key,
    Walter> value=getattr(self.input, key) )

OK, great, that is enough to get me started

    Walter> I don't know where this comes from, are these the
    Walter> docstrings of the properties?

Yes, the docstring has a standard formatting convention, eg

    def set_linewidth(self, w):
        """
        Set the line width in points

        ACCEPTS: float value in points
        """
        self._linewidth = w


The inspector will look for lines starting with ACCEPTS: to generate
the property list.  I can hack your example to do the same.

Thanks for the head start!
JDH



From Fernando.Perez at colorado.edu  Thu Mar  2 16:46:15 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Thu, 02 Mar 2006 14:46:15 -0700
Subject: [IPython-dev] notebook wiki gone?
In-Reply-To: <du5cej$u83$1@sea.gmane.org>
References: <200603011935.28062.antont@kyperjokki.fi>
	<du5cej$u83$1@sea.gmane.org>
Message-ID: <440767A7.6020906@colorado.edu>

Robert Kern wrote:
> Toni Alatalo wrote:
> 
>>http://www.scipy.org/wikis/featurerequests/NoteBook
>>
>>that http://projects.scipy.org/ipython/ipython/wiki/NoteBook
>>calls "Main notebook wiki at Scipy"
>>
>>.. is gone.
>>
>>seems that scipy.org has updated things - i was unable to relocate it with a 
>>quick search there. no biggie, just noticed when saw the talk about 
>>http://summerofcode.xwiki.com/xwiki/bin/view/Wiki/WebHome
> 
> 
> http://old.scipy.org/wikis/featurerequests/NoteBook

Thanks.

I've now moved over all the content we had at the old site over to the trac 
wiki.  The notebook pages are linked from here:

http://projects.scipy.org/ipython/ipython/wiki/NoteBook

The move was totally raw, just to ensure we have all the content.  We'll deal 
with formatting later, once moin is set up.

We need to set up a user-editable wiki though.  Let us know when a good time 
would be to ping again enthought on the issue of having the moin setup that 
scipy.org uses available for the other projects.  I pinged Joe but there was 
no reply on this.

cheers,

f



From Fernando.Perez at colorado.edu  Thu Mar  2 16:59:49 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Thu, 02 Mar 2006 14:59:49 -0700
Subject: [IPython-dev] ipipe news
In-Reply-To: <4405A823.5000206@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
Message-ID: <44076AD5.6030002@colorado.edu>

Walter D?rwald wrote:
> Ville Vainio wrote:
> 
> 
>>On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:
>>
>>
>>>How do we handle maintenance? Do I upload patches to the tracker or can
>>>I have repository write access? I promise I won't touch anything except
>>>ipipe. ;)
>>
>>That's Fernando's call, but I think this level of maintenance can be
>>managed by just sending me the patches directly.
> 
> 
> OK!

Well, if Ville is OK with patches, I'd say let's stick to that for now.  If we 
find over time that this becomes a significant bottleneck, we'll revisit the 
issue.  It's not that I don't trust you, but simply that I don't want to add a 
committer for every subcomponent, and having a few core developers who go over 
patches also helps ensure a little in the way of coding consistency.

But again, if it becomes a problem, we'll take care of it as needed.

And many thanks for this contribution!

I'd like to ask though, if I'm doing something wrong in trying to use it.  I 
simply read the 'ipipe?' docstring and typed the first example:

In [1]: from ipipe import *

In [2]: iwalk | ifilter("name.endswith('.py')") | isort("size")


It all seems to work (I saw a lot of network traffic, consistent with a 
directory traversal on our NFS-mounted filesystem).  But the curses browser 
doesn't show anything at all when it opens, and no error is printed.  It lists 
'0 objects' in the status line.  Am I missing something here?

Cheers,

f



From walter at livinglogic.de  Thu Mar  2 17:21:57 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 23:21:57 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <87wtfc1qol.fsf@peds-pc311.bsd.uchicago.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de>
	<46cb515a0603010809s6e457d03u23d70dfcf40199c4@mail.gmail.com>
	<44061CB0.6090005@livinglogic.de>	<87fym0rden.fsf@peds-pc311.bsd.uchicago.edu>
	<4407350F.3000500@livinglogic.de>	<87wtfcvfjq.fsf@peds-pc311.bsd.uchicago.edu>
	<44075962.5050101@livinglogic.de>
	<87wtfc1qol.fsf@peds-pc311.bsd.uchicago.edu>
Message-ID: <44077005.9010805@livinglogic.de>

John Hunter wrote:

>>>>>> "Walter" == Walter D?rwald <walter at livinglogic.de> writes:
>     Walter> How about something like this: import ipipe
> 
>     Walter> class iinspect(ipipe.Pipe): def __xiter__(self, mode):
>     Walter> fields = ("key", "value") for key in dir(self.input):
>     Walter> yield ipipe.Fields( fields, key=key,
>     Walter> value=getattr(self.input, key) )
> 
> OK, great, that is enough to get me started

Basically you need a subclass/instance of ipipe.Table so the browser 
kicks in automatically. But I'm thinking of changing this, so that the 
existance of an __xiter__ attribute is enough to trigger the browser. 
This would make it possible to add ipipe support without even having to 
check if ipipe is available, and changing baseclasses if it isn't.

This Table/Pipe has to implement __xiter__() and the objects returned 
from the iterator should implement __xattrs__() (which Fields does in a 
standard way).

>     Walter> I don't know where this comes from, are these the
>     Walter> docstrings of the properties?
> 
> Yes, the docstring has a standard formatting convention, eg
> 
>     def set_linewidth(self, w):
>         """
>         Set the line width in points
> 
>         ACCEPTS: float value in points
>         """
>         self._linewidth = w
> 
> 
> The inspector will look for lines starting with ACCEPTS: to generate
> the property list.  I can hack your example to do the same.
> 
> Thanks for the head start!

I'm looking forward to what you come up with.

Servus,
    Walter



From walter at livinglogic.de  Thu Mar  2 17:47:47 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Thu, 02 Mar 2006 23:47:47 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <44076AD5.6030002@colorado.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
Message-ID: <44077613.8040302@livinglogic.de>

Fernando Perez wrote:

> Walter D?rwald wrote:
>> Ville Vainio wrote:
>>
>>> On 3/1/06, Walter D?rwald <walter at livinglogic.de> wrote:
>>>
>>>> How do we handle maintenance? Do I upload patches to the tracker or can
>>>> I have repository write access? I promise I won't touch anything except
>>>> ipipe. ;)
>>>
>>> That's Fernando's call, but I think this level of maintenance can be
>>> managed by just sending me the patches directly.
>>
>> OK!
> 
> Well, if Ville is OK with patches, I'd say let's stick to that for now.  
> If we find over time that this becomes a significant bottleneck, we'll 
> revisit the issue.  It's not that I don't trust you, but simply that I 
> don't want to add a committer for every subcomponent, and having a few 
> core developers who go over patches also helps ensure a little in the 
> way of coding consistency.
> 
> But again, if it becomes a problem, we'll take care of it as needed.

No problem with that, I'll try to let various changes stack up, before I 
send patches to Ville, so he won't get overwhelmed with them (but I 
guess he can apply them faster than I can produce them ;))

> And many thanks for this contribution!
> 
> I'd like to ask though, if I'm doing something wrong in trying to use 
> it.  I simply read the 'ipipe?' docstring and typed the first example:
> 
> In [1]: from ipipe import *
> 
> In [2]: iwalk | ifilter("name.endswith('.py')") | isort("size")
> 
> 
> It all seems to work (I saw a lot of network traffic, consistent with a 
> directory traversal on our NFS-mounted filesystem).  But the curses 
> browser doesn't show anything at all when it opens, and no error is 
> printed.  It lists '0 objects' in the status line.  Am I missing 
> something here?

isort() of course first has to fetch the complete input, before it can 
sort the objects, so this might take longer. Dropping the sort 
expression should speed up the initial display.

But as you get '0 objects' this probably means that you don't have any 
Python source files in your current directory.

What happens if you do a simple "iwalk"?

Servus,
    Walter



From Fernando.Perez at colorado.edu  Thu Mar  2 18:57:08 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Thu, 02 Mar 2006 16:57:08 -0700
Subject: [IPython-dev] ipipe news
In-Reply-To: <44077613.8040302@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de>
Message-ID: <44078654.1010806@colorado.edu>

Walter D?rwald wrote:

>>I'd like to ask though, if I'm doing something wrong in trying to use 
>>it.  I simply read the 'ipipe?' docstring and typed the first example:
>>
>>In [1]: from ipipe import *
>>
>>In [2]: iwalk | ifilter("name.endswith('.py')") | isort("size")
>>
>>
>>It all seems to work (I saw a lot of network traffic, consistent with a 
>>directory traversal on our NFS-mounted filesystem).  But the curses 
>>browser doesn't show anything at all when it opens, and no error is 
>>printed.  It lists '0 objects' in the status line.  Am I missing 
>>something here?
> 
> 
> isort() of course first has to fetch the complete input, before it can 
> sort the objects, so this might take longer. Dropping the sort 
> expression should speed up the initial display.
> 
> But as you get '0 objects' this probably means that you don't have any 
> Python source files in your current directory.

No, that's not the case:

In [4]: ls *.py
argv.py*  cf.py   env.py*    exit2.py*     sciweave.py  vars.py
avg.py*   die.py  error.py*  exit.py*      scopes.py*   xplot.py*
bar.py    div.py  err.py     ramptest.py*  strings.py

And in addition, I thought it was recursive, so I thought it would work even 
if the parent directory had no .py files (as long as subdirs had them).

> What happens if you do a simple "iwalk"?

That works fine.  But

iwalk | ifilter("name.endswith('.py')")

gives an empty browser, and

iwalk | isort("size")

produces a lovely traceback (here's just the end of it, let me know if you 
want a full one in verbose mode, I'll attach it).

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
_dodisplay(self, scr)
    1854             self.levels = []
    1855             # enter the first level
-> 1856             self.enter(self.input, xiter(self.input, "default"), 
*self.attrs)
    1857
    1858             self._calcheaderlines(None)

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
enter(self, item, mode, *attrs)
    1799                     item,
    1800                     iterator,
-> 1801                     self.scrsizey-1-self._headerlines-2,
    1802                     *attrs
    1803                 )

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
__init__(self, browser, input, iterator, mainsizey, *attrs)
    1399             self.colwidths = {} # Maps attribute names to column widths
    1400
-> 1401             self.fetch(mainsizey)
    1402             self.calcdisplayattrs()
    1403             # formatted attributes for the items on screen

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
fetch(self, count)
    1414                 except StopIteration:
    1415                     self.exhausted = True
-> 1416                     break
    1417                 else:
    1418                     have += 1

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
__xiter__(self, mode)
     988                 xiter(self.input, mode),
     989                 key=key,
--> 990                 reverse=self.reverse
     991             )
     992         for item in items:

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
sorted(iterator, key, reverse)
      56         items = list(iterator)
      57         if key is not None:
---> 58             items.sort(lambda i1, i2: cmp(key(i1), key(i2)))
      59         else:
      60             items.sort()

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
<lambda>(i1, i2)
      56         items = list(iterator)
      57         if key is not None:
---> 58             items.sort(lambda i1, i2: cmp(key(i1), key(i2)))
      59         else:
      60             items.sort()

/home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py in 
key(item)
     984         else:
     985             def key(item):
--> 986                 return eval(self.key, globals(), _AttrNamespace(item))
     987             items = sorted(
     988                 xiter(self.input, mode),

TypeError: eval() argument 3 must be dict, not _AttrNamespace


Cheers,

f



From walter at livinglogic.de  Fri Mar  3 03:34:38 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Fri, 03 Mar 2006 09:34:38 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <44078654.1010806@colorado.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
Message-ID: <4407FF9E.7050608@livinglogic.de>

Fernando Perez wrote:
> Walter D?rwald wrote:
> 
>> [...]
>> But as you get '0 objects' this probably means that you don't have any 
>> Python source files in your current directory.
> 
> No, that's not the case:
> 
> In [4]: ls *.py
> argv.py*  cf.py   env.py*    exit2.py*     sciweave.py  vars.py
> avg.py*   die.py  error.py*  exit.py*      scopes.py*   xplot.py*
> bar.py    div.py  err.py     ramptest.py*  strings.py
> 
> And in addition, I thought it was recursive, so I thought it would work 
> even if the parent directory had no .py files (as long as subdirs had 
> them).

It does.

>> What happens if you do a simple "iwalk"?
> 
> That works fine.  But
> 
> iwalk | ifilter("name.endswith('.py')")
> 
> gives an empty browser, and
> 
> iwalk | isort("size")
> 
> produces a lovely traceback (here's just the end of it, let me know if 
> you want a full one in verbose mode, I'll attach it).
> 
> [...] 
> /home/fperez/usr/lib/python2.3/site-packages/IPython/Extensions/ipipe.py 
> in key(item)
>     984         else:
>     985             def key(item):
> --> 986                 return eval(self.key, globals(), 
> _AttrNamespace(item))
>     987             items = sorted(
>     988                 xiter(self.input, mode),
> 
> TypeError: eval() argument 3 must be dict, not _AttrNamespace

I see: ipipe uses a new feature of eval() that makes it possible to pass 
a custom (non-dict) namespace. This makes it possible to directly 
reference the attributes of the object. For 2.3 compatibility I see 
several options:

1) Simply don't allow expression strings. This would only allow 
callables and
    iwalk | ifilter("name.endswith('.py')") | isort("size")
would turn into
    iwalk | ifilter(lambda _:_.name.endswith('.py')) | isort(lambda _:_size)
IMHO not so nice.

2) Pass a simple dictionary to eval() that just contains the object 
itself. The call would then look like this
    iwalk | ifilter("_.name.endswith('.py')") | isort("_.size")

3) Pass a dictionary that contains all the attributes from the list. 
This has the disadvantage that (for iwalk etc.) there will be many 
os.stat() calls, even if the result is never used (and you can't 
reference attributes that are not in the field list).

BTW, the reason why you got an empty browser was, because ifilter 
ignores all objects where evaluating the expression raises and 
Exception. And then the expression for isort never fails, because 
there's nothing left to sort.

Anyway, IMHO we should implement 2) and document the possibility to 
directly reference attributes as a "2.4 goodie".

Servus,
    Walter



From Fernando.Perez at colorado.edu  Fri Mar  3 11:52:44 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Fri, 03 Mar 2006 09:52:44 -0700
Subject: [IPython-dev] ipipe news
In-Reply-To: <4407FF9E.7050608@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de>
Message-ID: <4408745C.2000405@colorado.edu>

Walter D?rwald wrote:

> I see: ipipe uses a new feature of eval() that makes it possible to pass 
> a custom (non-dict) namespace. This makes it possible to directly 
> reference the attributes of the object. For 2.3 compatibility I see 
> several options:
> 
> 1) Simply don't allow expression strings. This would only allow 
> callables and
>     iwalk | ifilter("name.endswith('.py')") | isort("size")
> would turn into
>     iwalk | ifilter(lambda _:_.name.endswith('.py')) | isort(lambda _:_size)
> IMHO not so nice.
> 
> 2) Pass a simple dictionary to eval() that just contains the object 
> itself. The call would then look like this
>     iwalk | ifilter("_.name.endswith('.py')") | isort("_.size")
> 
> 3) Pass a dictionary that contains all the attributes from the list. 
> This has the disadvantage that (for iwalk etc.) there will be many 
> os.stat() calls, even if the result is never used (and you can't 
> reference attributes that are not in the field list).
> 
> BTW, the reason why you got an empty browser was, because ifilter 
> ignores all objects where evaluating the expression raises and 
> Exception. And then the expression for isort never fails, because 
> there's nothing left to sort.
> 
> Anyway, IMHO we should implement 2) and document the possibility to 
> directly reference attributes as a "2.4 goodie".

That sounds like  a good plan.  2.3 compatibility is important because a large 
number of installed users still have that (Mac OSX and the 'enterprise' 
versions of RedHat, amongst others) in their 'out of the box' configs.  But 
it's OK if a few extra conveniences are only available for 2.4 when they they 
can't be implemented in a backport, as long as the basic functionality (like 
the example in the docstring :)  work with 2.3.

Cheers,

f



From walter at livinglogic.de  Fri Mar  3 13:43:13 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Fri, 03 Mar 2006 19:43:13 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <4408745C.2000405@colorado.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
Message-ID: <44088E41.80404@livinglogic.de>

Fernando Perez wrote:

> Walter D?rwald wrote:
> 
>> [...]
>> Anyway, IMHO we should implement 2) and document the possibility to 
>> directly reference attributes as a "2.4 goodie".
> 
> That sounds like  a good plan.  2.3 compatibility is important because a 
> large number of installed users still have that (Mac OSX and the 
> 'enterprise' versions of RedHat, amongst others) in their 'out of the 
> box' configs.  But it's OK if a few extra conveniences are only 
> available for 2.4 when they they can't be implemented in a backport, as 
> long as the basic functionality (like the example in the docstring :)  
> work with 2.3.

OK!

And I think the docstring should probably start with a "safer" example, 
i.e. one that doesn't take ages to complete.

Servus,
    Walter



From Fernando.Perez at colorado.edu  Fri Mar  3 13:45:17 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Fri, 03 Mar 2006 11:45:17 -0700
Subject: [IPython-dev] ipipe news
In-Reply-To: <44088E41.80404@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
	<44088E41.80404@livinglogic.de>
Message-ID: <44088EBD.1000800@colorado.edu>

Walter D?rwald wrote:

> And I think the docstring should probably start with a "safer" example, 
> i.e. one that doesn't take ages to complete.

Agreed.  A recursive walk on a network-mounted drive can take forever.

Thanks!

f



From walter at livinglogic.de  Tue Mar  7 04:02:06 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Tue, 07 Mar 2006 10:02:06 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <44088EBD.1000800@colorado.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
	<44088E41.80404@livinglogic.de> <44088EBD.1000800@colorado.edu>
Message-ID: <440D4C0E.30506@livinglogic.de>

Fernando Perez wrote:
> Walter D?rwald wrote:
> 
>> And I think the docstring should probably start with a "safer" 
>> example, i.e. one that doesn't take ages to complete.
> 
> Agreed.  A recursive walk on a network-mounted drive can take forever.

Done! The next step will probably be trying to merge path.path and 
ipipe.ifile.

Servus,
    Walter



From vivainio at gmail.com  Tue Mar  7 04:50:50 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Tue, 7 Mar 2006 11:50:50 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <440D4C0E.30506@livinglogic.de>
References: <440571F5.60900@livinglogic.de> <4405A823.5000206@livinglogic.de>
	<44076AD5.6030002@colorado.edu> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <44088E41.80404@livinglogic.de>
	<44088EBD.1000800@colorado.edu> <440D4C0E.30506@livinglogic.de>
Message-ID: <46cb515a0603070150n65db5268x2b46375f12d1b1fd@mail.gmail.com>

On 3/7/06, Walter D?rwald <walter at livinglogic.de> wrote:

> Done! The next step will probably be trying to merge path.path and
> ipipe.ifile.

I'm of course assuming you mean modifying ipipe, an opposed to
modifying both path.py and ipipe...

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From walter at livinglogic.de  Tue Mar  7 04:58:43 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Tue, 07 Mar 2006 10:58:43 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603070150n65db5268x2b46375f12d1b1fd@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <4405A823.5000206@livinglogic.de>
	<44076AD5.6030002@colorado.edu> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <44088E41.80404@livinglogic.de>
	<44088EBD.1000800@colorado.edu> <440D4C0E.30506@livinglogic.de>
	<46cb515a0603070150n65db5268x2b46375f12d1b1fd@mail.gmail.com>
Message-ID: <440D5953.5020905@livinglogic.de>

Ville Vainio wrote:
> On 3/7/06, Walter D?rwald <walter at livinglogic.de> wrote:
> 
>> Done! The next step will probably be trying to merge path.path and
>> ipipe.ifile.
> 
> I'm of course assuming you mean modifying ipipe, an opposed to
> modifying both path.py and ipipe...

Exactly: ipipe.ifile would subclass path.path and add the methods and 
attributes required for the browser.

Servus,
    Walter



From shlomme at gmx.net  Wed Mar  8 11:56:07 2006
From: shlomme at gmx.net (Torsten Marek)
Date: Wed, 08 Mar 2006 17:56:07 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <4408745C.2000405@colorado.edu>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
Message-ID: <440F0CA7.4090106@gmx.net>

Fernando Perez schrieb:
> Walter D?rwald wrote:
> 
> 
>>I see: ipipe uses a new feature of eval() that makes it possible to pass 
>>a custom (non-dict) namespace. This makes it possible to directly 
>>reference the attributes of the object. For 2.3 compatibility I see 
>>several options:
>>
>>1) Simply don't allow expression strings. This would only allow 
>>callables and
>>    iwalk | ifilter("name.endswith('.py')") | isort("size")
>>would turn into
>>    iwalk | ifilter(lambda _:_.name.endswith('.py')) | isort(lambda _:_size)
>>IMHO not so nice.
>>
>>2) Pass a simple dictionary to eval() that just contains the object 
>>itself. The call would then look like this
>>    iwalk | ifilter("_.name.endswith('.py')") | isort("_.size")
>>
>>3) Pass a dictionary that contains all the attributes from the list. 
>>This has the disadvantage that (for iwalk etc.) there will be many 
>>os.stat() calls, even if the result is never used (and you can't 
>>reference attributes that are not in the field list).
>>
>>BTW, the reason why you got an empty browser was, because ifilter 
>>ignores all objects where evaluating the expression raises and 
>>Exception. And then the expression for isort never fails, because 
>>there's nothing left to sort.
>>
>>Anyway, IMHO we should implement 2) and document the possibility to 
>>directly reference attributes as a "2.4 goodie".
> 
> 
> That sounds like  a good plan.  2.3 compatibility is important because a large 
> number of installed users still have that (Mac OSX and the 'enterprise' 
> versions of RedHat, amongst others) in their 'out of the box' configs.  But 
> it's OK if a few extra conveniences are only available for 2.4 when they they 
> can't be implemented in a backport, as long as the basic functionality (like 
> the example in the docstring :)  work with 2.3.
> 

Hi,

here's a patch for ipipe that works around the shortcomings of Python 2.3. I
don't know whether is satisfies the constraint in 3, but it works for the
examples mentioned here on the list.

best regards

Torsten

-- 
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: python2.3-eval-workaround.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060308/98b812eb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060308/98b812eb/attachment.sig>

From walter at livinglogic.de  Wed Mar  8 13:37:51 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Wed, 08 Mar 2006 19:37:51 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <440F0CA7.4090106@gmx.net>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
	<440F0CA7.4090106@gmx.net>
Message-ID: <440F247F.8060106@livinglogic.de>

Torsten Marek wrote:

> Fernando Perez schrieb:
>> Walter D?rwald wrote:
>>> [...]
>>> 3) Pass a dictionary that contains all the attributes from the list. 
>>> This has the disadvantage that (for iwalk etc.) there will be many 
>>> os.stat() calls, even if the result is never used (and you can't 
>>> reference attributes that are not in the field list).
>>>
>>> BTW, the reason why you got an empty browser was, because ifilter 
>>> ignores all objects where evaluating the expression raises and 
>>> Exception. And then the expression for isort never fails, because 
>>> there's nothing left to sort.
>>>
>>> Anyway, IMHO we should implement 2) and document the possibility to 
>>> directly reference attributes as a "2.4 goodie".
>>
>> That sounds like  a good plan.  2.3 compatibility is important because a large 
>> number of installed users still have that (Mac OSX and the 'enterprise' 
>> versions of RedHat, amongst others) in their 'out of the box' configs.  But 
>> it's OK if a few extra conveniences are only available for 2.4 when they they 
>> can't be implemented in a backport, as long as the basic functionality (like 
>> the example in the docstring :)  work with 2.3.
> 
> Hi,
> 
> here's a patch for ipipe that works around the shortcomings of Python 2.3. I
> don't know whether is satisfies the constraint in 3,

It does. Only the attributes mentioned in the expression are copied. But 
of course evil expressions like ifilter("locals()['value'] is not None") 
won't work, because the attribute is only referenced indirectly.

Nevertheless it's still better than only supporting "_".

> but it works for the
> examples mentioned here on the list.

The patch looks good to me (But the comments and docstrings should be 
updated of course).

Servus,
    Walter



From jorgen.stenarson at bostream.nu  Wed Mar  8 14:27:01 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Wed, 08 Mar 2006 20:27:01 +0100
Subject: [IPython-dev] pyreadline
Message-ID: <440F3005.30306@bostream.nu>

Hi,

pyreadline (for windows) is now possible to use from svn. Either 
download directly and do the standard setup.py install or use 
easy_install (instructions can be found on 
http://projects.scipy.org/ipython/ipython/wiki/PyReadline/Intro)

Unfortunately you have to uninstall any module named readline.

Please try it out and let us know any bugs you find or feature requests.

/J?rgen



From shlomme at gmx.net  Fri Mar 10 04:02:08 2006
From: shlomme at gmx.net (Torsten Marek)
Date: Fri, 10 Mar 2006 10:02:08 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <440F247F.8060106@livinglogic.de>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
	<440F0CA7.4090106@gmx.net> <440F247F.8060106@livinglogic.de>
Message-ID: <44114090.5060204@gmx.net>

[snip]
>> here's a patch for ipipe that works around the shortcomings of Python
>> 2.3. I
>> don't know whether is satisfies the constraint in 3,
> 
> 
> It does. Only the attributes mentioned in the expression are copied. But
> of course evil expressions like ifilter("locals()['value'] is not None")
> won't work, because the attribute is only referenced indirectly.
> 
> Nevertheless it's still better than only supporting "_".
> 
>> but it works for the
>> examples mentioned here on the list.
> 
> 
> The patch looks good to me (But the comments and docstrings should be
> updated of course).
> 

Hi,

I've got an updated version - just the comments and the docstrings.

best regards

Torsten
-- 
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: python2.3-eval-workaround.patch
Type: text/x-patch
Size: 1912 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/c34adade/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/c34adade/attachment.sig>

From shlomme at gmx.net  Fri Mar 10 04:05:10 2006
From: shlomme at gmx.net (Torsten Marek)
Date: Fri, 10 Mar 2006 10:05:10 +0100
Subject: [IPython-dev] %timeit
Message-ID: <44114146.4010808@gmx.net>

Hi,

I've got a patch that introduces a new magic %timeit function, which resembles
the behaviour of timeit.py. Unfortunately, I had to duplicate some code in order
to let the timed statement be executed in the shell namespace, maybe there is a
better version.

best regards

Torsten
-- 
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: timeit-magic.patch
Type: text/x-patch
Size: 4152 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/1fd20b13/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/1fd20b13/attachment.sig>

From vivainio at gmail.com  Fri Mar 10 04:45:08 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Fri, 10 Mar 2006 11:45:08 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <44114090.5060204@gmx.net>
References: <440571F5.60900@livinglogic.de> <4405A823.5000206@livinglogic.de>
	<44076AD5.6030002@colorado.edu> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <440F0CA7.4090106@gmx.net>
	<440F247F.8060106@livinglogic.de> <44114090.5060204@gmx.net>
Message-ID: <46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>

On 3/10/06, Torsten Marek <shlomme at gmx.net> wrote:

> Hi,
>
> I've got an updated version - just the comments and the docstrings.

Walter, am I correct in expecting that you (as the ipipe maintainer)
will evaluate/apply this and submit a patch for me, as opposed to me
applying this directly?

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From shlomme at gmx.net  Fri Mar 10 05:06:03 2006
From: shlomme at gmx.net (Torsten Marek)
Date: Fri, 10 Mar 2006 11:06:03 +0100
Subject: [IPython-dev] %timeit
In-Reply-To: <44114146.4010808@gmx.net>
References: <44114146.4010808@gmx.net>
Message-ID: <44114F8B.9090100@gmx.net>

Hi again,

there was a little bug in the patch resulting from my late-night tests - should
have tested it again this morning.

Here's the updated patch.

best regards

Torsten
--
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: timeit-magic.patch
Type: text/x-patch
Size: 4133 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/4ad81f69/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060310/4ad81f69/attachment.sig>

From walter at livinglogic.de  Fri Mar 10 06:28:19 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Fri, 10 Mar 2006 12:28:19 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <44114090.5060204@gmx.net>
References: <440571F5.60900@livinglogic.de>
	<Pine.LNX.4.51.0603011205100.28609@ptpcp8.phy.tu-dresden.de>
	<46cb515a0603010354s58cfc65bt6afc88223aa01ed1@mail.gmail.com>
	<44059B05.9010903@livinglogic.de>
	<46cb515a0603010515s6123773j2a410c5cccff3b41@mail.gmail.com>
	<4405A823.5000206@livinglogic.de> <44076AD5.6030002@colorado.edu>
	<44077613.8040302@livinglogic.de> <44078654.1010806@colorado.edu>
	<4407FF9E.7050608@livinglogic.de> <4408745C.2000405@colorado.edu>
	<440F0CA7.4090106@gmx.net> <440F247F.8060106@livinglogic.de>
	<44114090.5060204@gmx.net>
Message-ID: <441162D3.7050302@livinglogic.de>

Torsten Marek wrote:

> [snip]
>>> here's a patch for ipipe that works around the shortcomings of Python
>>> 2.3. I
>>> don't know whether is satisfies the constraint in 3,
>>
>> It does. Only the attributes mentioned in the expression are copied. But
>> of course evil expressions like ifilter("locals()['value'] is not None")
>> won't work, because the attribute is only referenced indirectly.
>>
>> Nevertheless it's still better than only supporting "_".
>>
>>> but it works for the
>>> examples mentioned here on the list.
>>
>> The patch looks good to me (But the comments and docstrings should be
>> updated of course).
> 
> Hi,
> 
> I've got an updated version - just the comments and the docstrings.

OK, I'll look into it over the weekend.

Servus,
    Walter



From walter at livinglogic.de  Fri Mar 10 06:30:16 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Fri, 10 Mar 2006 12:30:16 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <4405A823.5000206@livinglogic.de>
	<44076AD5.6030002@colorado.edu> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <440F0CA7.4090106@gmx.net>
	<440F247F.8060106@livinglogic.de> <44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
Message-ID: <44116348.9070207@livinglogic.de>

Ville Vainio wrote:

> On 3/10/06, Torsten Marek <shlomme at gmx.net> wrote:
> 
>> Hi,
>>
>> I've got an updated version - just the comments and the docstrings.
> 
> Walter, am I correct in expecting that you (as the ipipe maintainer)
> will evaluate/apply this and submit a patch for me, as opposed to me
> applying this directly?

Exactly. I'll review it and will probably send another patch in the next 
few days that will include other changes. (Mostly speed enhances, but 
I'm thinking about rewriting the attribute formatting in ibrowse so that 
objects can return multicolored strings.)

Servus,
    Walter



From jorgen.stenarson at bostream.nu  Fri Mar 10 13:38:40 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Fri, 10 Mar 2006 19:38:40 +0100
Subject: [IPython-dev] Bug fixes in pyreadline
Message-ID: <4411C7B0.8080103@bostream.nu>

Hi,

There was a bug in pyreadline that made it crash if read_history could 
not find ~/.history this is fixed. I have also added config options for 
history_filename which sets the filename used for the history file and 
history_length which sets the number of entries in the history file. 
There will now also be an errormessage printed if the config file raises 
an exception and not just a silent failure.

/J?rgen



From Fernando.Perez at colorado.edu  Fri Mar 10 13:43:21 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Fri, 10 Mar 2006 11:43:21 -0700
Subject: [IPython-dev] Bug fixes in pyreadline
In-Reply-To: <4411C7B0.8080103@bostream.nu>
References: <4411C7B0.8080103@bostream.nu>
Message-ID: <4411C8C9.9060407@colorado.edu>

J?rgen Stenarson wrote:
> Hi,
> 
> There was a bug in pyreadline that made it crash if read_history could 
> not find ~/.history this is fixed. I have also added config options for 
> history_filename which sets the filename used for the history file and 
> history_length which sets the number of entries in the history file. 
> There will now also be an errormessage printed if the config file raises 
> an exception and not just a silent failure.

Thanks, Jorgen.  Note that I added a 'pyreadline' component in the Trac ticket 
page, with you as the owner, so that bugs for pyreadline can be filed and 
appropriately dealt with in Trac.  I set all the necessary permissions for 
you, let me know if I missed anything.

Cheers,


f



From Fernando.Perez at colorado.edu  Sun Mar 12 04:22:01 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Sun, 12 Mar 2006 02:22:01 -0700
Subject: [IPython-dev] previous line gives strange results
In-Reply-To: <20060216090308.GB11280@alpha>
References: <20060216002752.GA4641@alpha>
	<46cb515a0602152204k6547c563y83e95c92a2ac28f8@mail.gmail.com>
	<20060216090308.GB11280@alpha>
Message-ID: <4413E839.5020108@colorado.edu>

Stefan van der Walt wrote:
> On Thu, Feb 16, 2006 at 08:04:55AM +0200, Ville Vainio wrote:
> 
>>On 2/16/06, Stefan van der Walt <stefan at sun.ac.za> wrote:
>>
>>
>>>I am used to pressing "Alt-P" (from Emacs) in ipython to get the
>>>previous line.  However, with my current version (0.7.2.svn), Alt-P
>>>causes havoc.
>>
>>Do you mean ctrl+p?
> 
> 
> No, I mean Alt-p (causes the bug),  while ctrl-P (but not ctrl-p) does
> what I want.

Mmh, Ctrl-p should do what you want, since the default config executes:

readline_parse_and_bind "\C-p": history-search-backward
readline_parse_and_bind "\C-n": history-search-forward


You can also get Alt-p (at least I can on this ubuntu laptop) to do the same 
by adding to your ipythonrc file these two lines:

readline_parse_and_bind "\M-p": history-search-backward
readline_parse_and_bind "\M-n": history-search-forward

Let me know how it goes (and sorry for the super-delayed reply!)

Cheers,

f



From vivainio at gmail.com  Sun Mar 12 14:29:59 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Sun, 12 Mar 2006 21:29:59 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <44116348.9070207@livinglogic.de>
References: <440571F5.60900@livinglogic.de> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <440F0CA7.4090106@gmx.net>
	<440F247F.8060106@livinglogic.de> <44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
	<44116348.9070207@livinglogic.de>
Message-ID: <46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>

Just a heads up - I corrected a minor glitch in ipipe.FieldTable in svn.

As far as documentation goes, there was some garbage characters that I
corrected. I guess this is a result of `` (double backtick) being
translated to accented characters by your keyboard layout.



From walter at livinglogic.de  Sun Mar 12 17:54:30 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Sun, 12 Mar 2006 23:54:30 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <44077613.8040302@livinglogic.de>
	<44078654.1010806@colorado.edu> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <440F0CA7.4090106@gmx.net>
	<440F247F.8060106@livinglogic.de> <44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
	<44116348.9070207@livinglogic.de>
	<46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>
Message-ID: <4414A6A6.5090000@livinglogic.de>

Ville Vainio wrote:

> Just a heads up - I corrected a minor glitch in ipipe.FieldTable in svn.

Thanks!

> As far as documentation goes, there was some garbage characters that I
> corrected. I guess this is a result of `` (double backtick) being
> translated to accented characters by your keyboard layout.

Exactly! I have to press backtick space backtick space to get ``, which 
is really annoying and error prone.

BTW, I've nearly finished a patch that should speed up the display of 
large data structures tremendously (this problem was reported by Hans 
Meine). As a side effect object can now output colored attributes.

This changes the API for __xrepr__(), but I guess as long as we don't 
have a releaase this should be no problem.

Servus,
    Walter



From vivainio at gmail.com  Mon Mar 13 02:59:52 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Mon, 13 Mar 2006 09:59:52 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <4414A6A6.5090000@livinglogic.de>
References: <440571F5.60900@livinglogic.de> <4407FF9E.7050608@livinglogic.de>
	<4408745C.2000405@colorado.edu> <440F0CA7.4090106@gmx.net>
	<440F247F.8060106@livinglogic.de> <44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
	<44116348.9070207@livinglogic.de>
	<46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>
	<4414A6A6.5090000@livinglogic.de>
Message-ID: <46cb515a0603122359x2688d796s2479bbcc92af50c4@mail.gmail.com>

On 3/13/06, Walter D?rwald <walter at livinglogic.de> wrote:

> Exactly! I have to press backtick space backtick space to get ``, which
> is really annoying and error prone.

This is one of the reasons I used US keyboard layout for coding in the
past - no annoying "dead" characters, often used characters are in
their proper place etc. And you almost never need ??? when writing
code.

I don't use it anymore though, I went all the way and switched to my
own variant of Dvorak. :-)

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From vivainio at gmail.com  Mon Mar 13 06:47:33 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Mon, 13 Mar 2006 13:47:33 +0200
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603122359x2688d796s2479bbcc92af50c4@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <4408745C.2000405@colorado.edu>
	<440F0CA7.4090106@gmx.net> <440F247F.8060106@livinglogic.de>
	<44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
	<44116348.9070207@livinglogic.de>
	<46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>
	<4414A6A6.5090000@livinglogic.de>
	<46cb515a0603122359x2688d796s2479bbcc92af50c4@mail.gmail.com>
Message-ID: <46cb515a0603130347s7fb7008dq2958cfb4c6604b52@mail.gmail.com>

As it stands, ifilter can raise an exception and the user won't know
what happened. It would at least be useful to know about the exception
if the yielded sequence is empty (i.e. the filter never matched), it
may well have been a programming error.



From walter at livinglogic.de  Mon Mar 13 09:19:23 2006
From: walter at livinglogic.de (=?ISO-8859-1?Q?Walter_D=F6rwald?=)
Date: Mon, 13 Mar 2006 15:19:23 +0100
Subject: [IPython-dev] ipipe news
In-Reply-To: <46cb515a0603130347s7fb7008dq2958cfb4c6604b52@mail.gmail.com>
References: <440571F5.60900@livinglogic.de> <4408745C.2000405@colorado.edu>
	<440F0CA7.4090106@gmx.net> <440F247F.8060106@livinglogic.de>
	<44114090.5060204@gmx.net>
	<46cb515a0603100145r70c4a190j13fff494c4f7f420@mail.gmail.com>
	<44116348.9070207@livinglogic.de>
	<46cb515a0603121129m1c790395q47e60b1874d35784@mail.gmail.com>
	<4414A6A6.5090000@livinglogic.de>
	<46cb515a0603122359x2688d796s2479bbcc92af50c4@mail.gmail.com>
	<46cb515a0603130347s7fb7008dq2958cfb4c6604b52@mail.gmail.com>
Message-ID: <44157F6B.1070002@livinglogic.de>

Ville Vainio wrote:

> As it stands, ifilter can raise an exception and the user won't know
> what happened. It would at least be useful to know about the exception
> if the yielded sequence is empty (i.e. the filter never matched), it
> may well have been a programming error.

We could add an argument to the ifilter() constructor:
  ifilter(foo, errors="raise")
or
  ifilter(foo, errors="drop")
or
  ifilter(foo, errors="keep")
or
  ifilter(foo, errors="keeperror")

Servus,
   Walter



From mgraz at mnsgraz.plus.com  Mon Mar 13 18:40:41 2006
From: mgraz at mnsgraz.plus.com (Michael Graz)
Date: Mon, 13 Mar 2006 23:40:41 -0000
Subject: [IPython-dev] windows readline vi mode
Message-ID: <001601c646f7$8a699700$0301a8c0@red>

Greetings.  Not sure how to proceed here but I have finished extending Gary
Bishop's UNC python readline package to support vi command line editing.
Previously it only supported emacs mode.  Now the mode can be selected in
the standard way via a .inpurc file (ie "set editing-mode vi").

 

It contains all the goodies vi users rely on such as jump to next word, find
character, compound commands with multipliers, dot command, yank buffer,
history search and so on.  It also contains a redo feature (ctrl-r) like vim
which reverses an undo.

 

Gary has agreed to this extension.  Is there anyone willing to test, give
feedback on or merge in the changes?  Or else let me know what I can do.  I
tried sending an earlier email with notes on how to download this new code
but it seems the mailer blocked the message - perhaps since it contained
links?

 

Thanks,

-Michael

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060313/372b5dcc/attachment.html>

From Fernando.Perez at colorado.edu  Mon Mar 13 18:45:45 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Mon, 13 Mar 2006 16:45:45 -0700
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <001601c646f7$8a699700$0301a8c0@red>
References: <001601c646f7$8a699700$0301a8c0@red>
Message-ID: <44160429.8080209@colorado.edu>

Hi Michael,

Michael Graz wrote:
> Greetings.  Not sure how to proceed here but I have finished extending Gary
> Bishop's UNC python readline package to support vi command line editing.
> Previously it only supported emacs mode.  Now the mode can be selected in
> the standard way via a .inpurc file (ie "set editing-mode vi").

This is certainly the right place, given how Jorgen (the current developer for 
pyreadline, the continuation of UNC readline) is here.

> It contains all the goodies vi users rely on such as jump to next word, find
> character, compound commands with multipliers, dot command, yank buffer,
> history search and so on.  It also contains a redo feature (ctrl-r) like vim
> which reverses an undo.
> 
>  
> 
> Gary has agreed to this extension.  Is there anyone willing to test, give
> feedback on or merge in the changes?  Or else let me know what I can do.  I
> tried sending an earlier email with notes on how to download this new code
> but it seems the mailer blocked the message - perhaps since it contained
> links?

No, links should be OK:

http://ipython.scipy.org/

for example.  Can you try reposting with the links?  I saw a bounced message 
from you, but it was (I think) because you weren't subscribed yet.

Cheers,

f



From vivainio at gmail.com  Tue Mar 14 02:28:23 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Tue, 14 Mar 2006 09:28:23 +0200
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <001601c646f7$8a699700$0301a8c0@red>
References: <001601c646f7$8a699700$0301a8c0@red>
Message-ID: <46cb515a0603132328o69cc296fl61530d3a5c53b8c0@mail.gmail.com>

On 3/14/06, Michael Graz <mgraz at mnsgraz.plus.com> wrote:

> Gary has agreed to this extension.  Is there anyone willing to test, give
> feedback on or merge in the changes?  Or else let me know what I can do.  I

pyreadline svn repo is at:

http://ipython.scipy.org/svn/ipython/pyreadline/trunk/

I think Jorgen would appreciate if you could provide patches against
those sources.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From jorgen.stenarson at bostream.nu  Tue Mar 14 14:40:13 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Tue, 14 Mar 2006 20:40:13 +0100
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <001601c646f7$8a699700$0301a8c0@red>
References: <001601c646f7$8a699700$0301a8c0@red>
Message-ID: <44171C1D.3010206@bostream.nu>

Michael Graz skrev:
> Greetings.  Not sure how to proceed here but I have finished extending Gary
> Bishop's UNC python readline package to support vi command line editing.
> Previously it only supported emacs mode.  Now the mode can be selected in
> the standard way via a .inpurc file (ie "set editing-mode vi").
> 
>  
> 
> It contains all the goodies vi users rely on such as jump to next word, find
> character, compound commands with multipliers, dot command, yank buffer,
> history search and so on.  It also contains a redo feature (ctrl-r) like vim
> which reverses an undo.
> 
>  
> 
> Gary has agreed to this extension.  Is there anyone willing to test, give
> feedback on or merge in the changes?  Or else let me know what I can do.  I
> tried sending an earlier email with notes on how to download this new code
> but it seems the mailer blocked the message - perhaps since it contained
> links?
> 
>  

Michael,
I'm interested to integrate it into pyreadline. Could you send me the 
download info so I can take a look?

I'm also working on a refactoring of the code base and it may be better 
to merge your work there instead of in trunk.

/J?rgen



From mgraz at mnsgraz.plus.com  Tue Mar 14 16:37:07 2006
From: mgraz at mnsgraz.plus.com (Michael Graz)
Date: Tue, 14 Mar 2006 21:37:07 -0000
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <44171C1D.3010206@bostream.nu>
Message-ID: <001701c647af$71cfcad0$0201a8c0@red>

Okay, thanks for the info.  Here are my current changes:
http://www.plan10.com/readline/readline-1.12a.zip 

This contains files that are a direct replacement for the standard UNC
python readline package from sourceforge.  After installing readline-1.12
unzip the above into the Python24\Lib\site-packages directory.  It will
overwrite files in the readline subdirectory.  The vi mode is activated by
editing the file %home%\.inputrc or %homedrive%%homepath%\.inputrc and
adding the line "set editing-mode vi".

Notes:
- The readline vi mode is compatible with the standard python.exe
interpreter, the debugger (pdb.py) and also IPython.
- It has been developed and tested with Python 2.4
- To verify that everything is installed and working try the following:
    => python
    Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
win32
    Type "help", "copyright", "credits" or "license" for more information.
    readline installed (vi)
    >>> import readline
    >>> readline.mode()
    'vi from $HOME/.inputrc'
- The new module functions readline.vi() and readline.emacs() can be used to
toggle the mode.

There is also a test_vi subdirectory.  The file PyReadline_test.py contains
a suite of unit tests.

-Michael


-----Original Message-----
From: J?rgen Stenarson [mailto:jorgen.stenarson at bostream.nu] 
Sent: Tuesday, March 14, 2006 7:40 PM
To: Michael Graz; ipython-dev at scipy.net
Subject: Re: [IPython-dev] windows readline vi mode


Michael,
I'm interested to integrate it into pyreadline. Could you send me the 
download info so I can take a look?

I'm also working on a refactoring of the code base and it may be better 
to merge your work there instead of in trunk.

/J?rgen



From Fernando.Perez at colorado.edu  Wed Mar 15 19:32:21 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Wed, 15 Mar 2006 17:32:21 -0700
Subject: [IPython-dev] [Fwd: ipython crash report]
Message-ID: <4418B215.9040606@colorado.edu>

Ville,

this crash originates in the stuff you recently introduced.  Can you please 
look into it?

Zach, in the meantime, try renaming ~/.ipython to something else and 
restarting: that module ipy_user_conf.py is a new thing which is most likely 
causing problems.

You should be able to copy back your ~/.ipython/ipythonrc file back to the 
freshly created ~/.ipython directory, which hopefully be a consistent one.

Cheers,

f

-------- Original Message --------
Subject: ipython crash report
Date: Wed, 15 Mar 2006 16:24:27 -0800
From: Zachary Pincus <zpincus at stanford.edu>
To: fperez at colorado.edu

Hi Fernando -

I just checked out the latest ipython from SVN, and now it's crashing
on launch. Any thoughts? (Python 2.4.2.)

Zach Pincus


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IPython_crash_report.txt
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060315/4cc205c7/attachment.txt>

From Tfetherston at aol.com  Wed Mar 15 21:57:51 2006
From: Tfetherston at aol.com (Tfetherston at aol.com)
Date: Wed, 15 Mar 2006 21:57:51 EST
Subject: [IPython-dev] Can I do thie?
Message-ID: <1e2.4ee6fd0f.314a2e2f@aol.com>

I use IPython to start a Python app, then I run a script inside that app to  
embed IPython.  The shell is locked until I run the script, afterwards I  get 
an input prompt in the shell window.
 
This app lets me have text structured in book format, (right now I'm  playing 
with "Dive into Python"), and also have python scripts that I can run  within 
the App, sending output to the IPython shell.  
 
Now that is pretty cool, but I'd like to know if it would be possible to do  
the following; "auto-type" into the input of the shell (and then pop the shell 
 topmost) so a return would run that command, and also, to cause a shell run 
of  script (sort of like what is done with edit), but transfering the small 
program  to be run via a mechanism other than writting out to a file, (via a 
file-like  object in the App?).
 
Looking at this to make exploring and learning Python easier.
 
Tom
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060315/5fe04791/attachment.html>

From hans_meine at gmx.net  Thu Mar 16 03:10:16 2006
From: hans_meine at gmx.net (Hans Meine)
Date: Thu, 16 Mar 2006 09:10:16 +0100
Subject: [IPython-dev] [Fwd: ipython crash report]
In-Reply-To: <4418B215.9040606@colorado.edu>
References: <4418B215.9040606@colorado.edu>
Message-ID: <200603160910.18668.hans_meine@gmx.net>

On Thursday 16 March 2006 01:32, Fernando Perez wrote:
> You should be able to copy back your ~/.ipython/ipythonrc file back to the
> freshly created ~/.ipython directory, which hopefully be a consistent one.

Anyways, I have an old ~/.ipython which does not contain that user-config 
file, and SVN IPython complains about that at every start.  This does not 
make for a nice upgrade experience, or what do you think?

IMHO it should either be quiet about the optional file, or verbosely put a 
default one in place which I can then adapt to my needs whenever I want.

Ciao, /  /
     /--/
    /  / ANS



From vivainio at gmail.com  Thu Mar 16 08:26:29 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Thu, 16 Mar 2006 15:26:29 +0200
Subject: [IPython-dev] [Fwd: ipython crash report]
In-Reply-To: <200603160910.18668.hans_meine@gmx.net>
References: <4418B215.9040606@colorado.edu>
	<200603160910.18668.hans_meine@gmx.net>
Message-ID: <46cb515a0603160526s4017761u48afcddd903a4b38@mail.gmail.com>

On 3/16/06, Hans Meine <hans_meine at gmx.net> wrote:

> Anyways, I have an old ~/.ipython which does not contain that user-config
> file, and SVN IPython complains about that at every start.  This does not
> make for a nice upgrade experience, or what do you think?
>
> IMHO it should either be quiet about the optional file, or verbosely put a
> default one in place which I can then adapt to my needs whenever I want.

There is the new %upgrade magic, I'll add the suggestion to run it in
the error message.

%upgrade needs some fixing (it doesn't work if path.py is not on
pythonpath) but I'll try fix  both of these thing today.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From vivainio at gmail.com  Thu Mar 16 08:47:23 2006
From: vivainio at gmail.com (Ville Vainio)
Date: Thu, 16 Mar 2006 15:47:23 +0200
Subject: [IPython-dev] [Fwd: ipython crash report]
In-Reply-To: <46cb515a0603160526s4017761u48afcddd903a4b38@mail.gmail.com>
References: <4418B215.9040606@colorado.edu>
	<200603160910.18668.hans_meine@gmx.net>
	<46cb515a0603160526s4017761u48afcddd903a4b38@mail.gmail.com>
Message-ID: <46cb515a0603160547l21bb3022v3f28455e9e0d5056@mail.gmail.com>

On 3/16/06, Ville Vainio <vivainio at gmail.com> wrote:

> %upgrade needs some fixing (it doesn't work if path.py is not on
> pythonpath) but I'll try fix  both of these thing today.

Fixed now, pleasy try the new SVN.

--
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



From jorgen.stenarson at bostream.nu  Thu Mar 16 16:58:28 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Thu, 16 Mar 2006 22:58:28 +0100
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <001701c647af$71cfcad0$0201a8c0@red>
References: <001701c647af$71cfcad0$0201a8c0@red>
Message-ID: <4419DF84.4010605@bostream.nu>

Michael Graz skrev:
> Okay, thanks for the info.  Here are my current changes:
> http://www.plan10.com/readline/readline-1.12a.zip 
> 

Thanks for the link. It looks like your patch is a bit heavy to include 
in the trunk version. I'm also working on a refactored version where it 
will be easier to add new modes as plugins. I think we should 
concentrate on merging your work there. Perhaps you can have a look and 
see if you understand the code well enough to do the merge yourself.

I'm happy to see you have added tests, something I have not worked on yet.

You will probably see this but I have changed the indenting from 2 to 4 
spaces from UNC readline.


you can get it with svn:
"svn co 
http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor 
pyreadline-refactor"

The layout is as below:

pyreadline
	rlmain      #contains Readline class
	clipboard   #clipboard functions
	console     #console interface
	keysyms     #key symbol mappings
	logger      #logging
	release     #release info
	
	lineeditor
		history     #implement history buffer
		lineobj     #implement lineeditor interface (so
                             #movements etc doesn't have to be
                             #duplicated in all modes)
		wordmatcher #functions for finding word boundaries

	modes             #editor modes
		emacs     #emacs mode
		notemacs  #crippled emacs for testing of mode
			  #selection functionality


/J?rgen



From Fernando.Perez at colorado.edu  Fri Mar 17 02:43:19 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Fri, 17 Mar 2006 00:43:19 -0700
Subject: [IPython-dev] cluster file syntax [redirect from ipy-user]
In-Reply-To: <fa8579a40603161454o625ec102pbb52807de8d707e6@mail.gmail.com>
References: <4419237B.4050007@stanford.edu> <4419AE77.7060204@colorado.edu>
	<fa8579a40603161034g2b5b1a0dv37945c891b745054@mail.gmail.com>
	<4419B2A8.1020304@colorado.edu>
	<fa8579a40603161049t61fb8ff8v6834670089a59700@mail.gmail.com>
	<4419B845.6060302@colorado.edu>
	<fa8579a40603161156x3017d482j1f6843ad797837f7@mail.gmail.com>
	<4419D680.4000605@colorado.edu>
	<fa8579a40603161454o625ec102pbb52807de8d707e6@mail.gmail.com>
Message-ID: <441A6897.4070800@colorado.edu>

[redirecting to ipython-dev, where this is more on-topic]

Brian Granger wrote:
> I would say we should use python for this.  I am not worried about
> security in the config files.  It there is security critical
> information (like passwords to remote machines) we can come up with a
> secre way of storing them alone.  So let's go with the python file
> option.

Well, let's think about it just a little longer: the issue is not only 
passwords, it's also the execution of arbitrary code upon loading.  A simple 
key/value format is not executable, so short of gross bugs in the parser, 
there's no room for hostile code injection.  OTOH, a python format means 
executing it with something like execfile() or import, point at which the 
whole thing can do anything it wants (including os.system('rm -rf ~')).

It is a minor concern, but I do worry that for the audience this can be 
pitched to, it may be better to nip in the bud any fears that the config files 
(needed to start the clusters) can have potential security implications of 
that nature.  What do you think?

> Have you standardized on how IPython will do this exactly?  I will
> probably begin to look through ipython trunk to see how it is being
> done currently.  If you any other implementation ideas, let me know.

As I was writing this, I saw Ville's message on ipython-user, so there's 
already something in that direction in place.  I need to look at this code to 
see exactly if it does everything we need in the long run, but it whatever we 
do we'll evolve from there.

> Brian

[ leaving for context on ipython-dev ]

> On 3/16/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> 
>>Brian Granger wrote:
>>
>>>Fernando,
>>>
>>>While we are making this change, do we want to also change the format
>>>of this file?  It would be nice to have it be human readable/editable.
>>> My preference would have it be a valid python file, but I am not sure
>>>of the best way of doing this.  You have thought a lot more about
>>>config files than I have.  Any thoughts?
>>
>>Well, the big question with config files is whether to use python itself as
>>the language, or something else and parse it.  Brief comparison:
>>
>>1. Use python.
>>
>>Pros: no parsing required (well, we get it for free from python itself),
>>extremely flexible for the users, they can put any logic they want.
>>
>>Cons: security, mostly: arbitrary code can execute there.  And a little bit of
>>potential complexity, as variables need to be declared in the file.
>>
>>
>>2. Use something else.
>>
>>The easiest in terms of dependencies is the basic ConfigParser format:
>>
>>http://docs.python.org/lib/module-ConfigParser.html
>>
>>Pros: safe, easy to read and write.  Security is really the big plus.
>>
>>Cons: more parsing involved, and more work to transform values defined in the
>>file into python objects we need.  Less flexibility for users (it's a
>>key/value file, not a programming language, so no logic allowed).
>>
>>
>>In this particular case, I'm not sure the security issue is that big of a
>>deal, since this is a system to execute arbitrary python code anyway.  But
>>given how paranoid one may want to be...
>>
>>For ipython itself, I'm /definitely/ going with (1) in the future, but that's
>>an easy one.  People load arbitrary code in their rc file anyway, it's just
>>that today's system makes it inconvenient; I want it to be easy.
>>
>>For the cluster config format, we could certainly go with (2) if you prefer to
>>play it safe, even though it will be a tiny bit more work for us, and less
>>flexible for users.
>>
>>Thoughts?
>>
>>f
>>
>>This message scanned for viruses and SPAM by GWGuardian at SCU (MGW1)
>>
> 
> 
> 
> --
> Brian Granger
> Santa Clara University
> ellisonbg at gmail.com



From jorgen.stenarson at bostream.nu  Tue Mar 21 12:36:11 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Tue, 21 Mar 2006 18:36:11 +0100
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <000901c64c65$218b8f40$0201a8c0@red>
References: <000901c64c65$218b8f40$0201a8c0@red>
Message-ID: <4420398B.6000802@bostream.nu>

Hi Michael,

I'm about to commit some changes to the modes directory. Yesterday I did 
some hacking to start integration of your vi patch. So far I can type 
text, and some of the deletion commands works but there is a lot of work 
left. As you suggest I have also started to move common things to a 
separate file. I will commit this in an hour or so (I'll post to let you 
know when it's done).

/J?rgen

Michael Graz skrev:
> Hi J?rgen,
> I looked at the refactoring branch a little.  The vi mode shares some code
> with pyreadline\modes\emacs.py.  So it seems that file should be split up a
> little bit.  One question: are things in a generally functional state?  If I
> start change emacs.py into something like common.py, emacs.py and vi.py will
> things be working enough for me to test?  Or are you still doing deep
> refactoring.
> 
> I also want to add a test_vi directory somewhere, perhaps as a subdirectory
> of pyreadline\modes.  Let me know.
> -Michael
> 
> -----Original Message-----
> From: J?rgen Stenarson [mailto:jorgen.stenarson at bostream.nu] 
> Sent: Thursday, March 16, 2006 9:58 PM
> To: Michael Graz; ipython-dev at scipy.net
> Subject: Re: [IPython-dev] windows readline vi mode
> 
> Michael Graz skrev:
>> Okay, thanks for the info.  Here are my current changes:
>> http://www.plan10.com/readline/readline-1.12a.zip 
>>
> 
> Thanks for the link. It looks like your patch is a bit heavy to include 
> in the trunk version. I'm also working on a refactored version where it 
> will be easier to add new modes as plugins. I think we should 
> concentrate on merging your work there. Perhaps you can have a look and 
> see if you understand the code well enough to do the merge yourself.
> 
> I'm happy to see you have added tests, something I have not worked on yet.
> 
> You will probably see this but I have changed the indenting from 2 to 4 
> spaces from UNC readline.
> 
> 
> you can get it with svn:
> "svn co 
> http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor 
> pyreadline-refactor"
> 
> The layout is as below:
> 
> pyreadline
> 	rlmain      #contains Readline class
> 	clipboard   #clipboard functions
> 	console     #console interface
> 	keysyms     #key symbol mappings
> 	logger      #logging
> 	release     #release info
> 	
> 	lineeditor
> 		history     #implement history buffer
> 		lineobj     #implement lineeditor interface (so
>                              #movements etc doesn't have to be
>                              #duplicated in all modes)
> 		wordmatcher #functions for finding word boundaries
> 
> 	modes             #editor modes
> 		emacs     #emacs mode
> 		notemacs  #crippled emacs for testing of mode
> 			  #selection functionality
> 
> 
> /J?rgen
> 
> 



From jorgen.stenarson at bostream.nu  Tue Mar 21 13:33:47 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Tue, 21 Mar 2006 19:33:47 +0100
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <4420398B.6000802@bostream.nu>
References: <000901c64c65$218b8f40$0201a8c0@red> <4420398B.6000802@bostream.nu>
Message-ID: <4420470B.3050105@bostream.nu>

Hi again,

now I have commited yesterdays work on the vi-mode. I created a 
directory called test on the same level as modes,lineeditor, etc. lets 
keep all tests there until we feel the need for more structure. I have 
not added the tests you had in your patch.

/J?rgen

J?rgen Stenarson skrev:
> Hi Michael,
> 
> I'm about to commit some changes to the modes directory. Yesterday I did 
> some hacking to start integration of your vi patch. So far I can type 
> text, and some of the deletion commands works but there is a lot of work 
> left. As you suggest I have also started to move common things to a 
> separate file. I will commit this in an hour or so (I'll post to let you 
> know when it's done).
> 
> /J?rgen
> 
> Michael Graz skrev:
>> Hi J?rgen,
>> I looked at the refactoring branch a little.  The vi mode shares some code
>> with pyreadline\modes\emacs.py.  So it seems that file should be split up a
>> little bit.  One question: are things in a generally functional state?  If I
>> start change emacs.py into something like common.py, emacs.py and vi.py will
>> things be working enough for me to test?  Or are you still doing deep
>> refactoring.
>>
>> I also want to add a test_vi directory somewhere, perhaps as a subdirectory
>> of pyreadline\modes.  Let me know.
>> -Michael
>>
>> -----Original Message-----
>> From: J?rgen Stenarson [mailto:jorgen.stenarson at bostream.nu] 
>> Sent: Thursday, March 16, 2006 9:58 PM
>> To: Michael Graz; ipython-dev at scipy.net
>> Subject: Re: [IPython-dev] windows readline vi mode
>>
>> Michael Graz skrev:
>>> Okay, thanks for the info.  Here are my current changes:
>>> http://www.plan10.com/readline/readline-1.12a.zip 
>>>
>> Thanks for the link. It looks like your patch is a bit heavy to include 
>> in the trunk version. I'm also working on a refactored version where it 
>> will be easier to add new modes as plugins. I think we should 
>> concentrate on merging your work there. Perhaps you can have a look and 
>> see if you understand the code well enough to do the merge yourself.
>>
>> I'm happy to see you have added tests, something I have not worked on yet.
>>
>> You will probably see this but I have changed the indenting from 2 to 4 
>> spaces from UNC readline.
>>
>>
>> you can get it with svn:
>> "svn co 
>> http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor 
>> pyreadline-refactor"
>>
>> The layout is as below:
>>
>> pyreadline
>> 	rlmain      #contains Readline class
>> 	clipboard   #clipboard functions
>> 	console     #console interface
>> 	keysyms     #key symbol mappings
>> 	logger      #logging
>> 	release     #release info
>> 	
>> 	lineeditor
>> 		history     #implement history buffer
>> 		lineobj     #implement lineeditor interface (so
>>                              #movements etc doesn't have to be
>>                              #duplicated in all modes)
>> 		wordmatcher #functions for finding word boundaries
>>
>> 	modes             #editor modes
>> 		emacs     #emacs mode
>> 		notemacs  #crippled emacs for testing of mode
>> 			  #selection functionality
>>
>>
>> /J?rgen
>>
>>
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.net
> http://scipy.net/mailman/listinfo/ipython-dev
> 



From jorgen.stenarson at bostream.nu  Tue Mar 21 17:05:06 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Tue, 21 Mar 2006 23:05:06 +0100
Subject: [IPython-dev] windows readline vi mode
In-Reply-To: <4420470B.3050105@bostream.nu>
References: <000901c64c65$218b8f40$0201a8c0@red>
	<4420398B.6000802@bostream.nu> <4420470B.3050105@bostream.nu>
Message-ID: <44207892.8080303@bostream.nu>

hi,

I added a visible selection mode to the refactor branch, i.e. inverse 
video shows the current selection and it can be cut and pasted, it will 
also be deleted if any input is given. If we want ctrl-c as copy I need 
to figure out a way to disable the KeyboardInterupt for ctrl-c, but it 
should probably not be disabled completely but only during line editing.

/J?rgen

J?rgen Stenarson skrev:
> Hi again,
> 
> now I have commited yesterdays work on the vi-mode. I created a 
> directory called test on the same level as modes,lineeditor, etc. lets 
> keep all tests there until we feel the need for more structure. I have 
> not added the tests you had in your patch.
> 
> /J?rgen
> 
> J?rgen Stenarson skrev:
>> Hi Michael,
>>
>> I'm about to commit some changes to the modes directory. Yesterday I did 
>> some hacking to start integration of your vi patch. So far I can type 
>> text, and some of the deletion commands works but there is a lot of work 
>> left. As you suggest I have also started to move common things to a 
>> separate file. I will commit this in an hour or so (I'll post to let you 
>> know when it's done).
>>
>> /J?rgen
>>
>> Michael Graz skrev:
>>> Hi J?rgen,
>>> I looked at the refactoring branch a little.  The vi mode shares some code
>>> with pyreadline\modes\emacs.py.  So it seems that file should be split up a
>>> little bit.  One question: are things in a generally functional state?  If I
>>> start change emacs.py into something like common.py, emacs.py and vi.py will
>>> things be working enough for me to test?  Or are you still doing deep
>>> refactoring.
>>>
>>> I also want to add a test_vi directory somewhere, perhaps as a subdirectory
>>> of pyreadline\modes.  Let me know.
>>> -Michael
>>>
>>> -----Original Message-----
>>> From: J?rgen Stenarson [mailto:jorgen.stenarson at bostream.nu] 
>>> Sent: Thursday, March 16, 2006 9:58 PM
>>> To: Michael Graz; ipython-dev at scipy.net
>>> Subject: Re: [IPython-dev] windows readline vi mode
>>>
>>> Michael Graz skrev:
>>>> Okay, thanks for the info.  Here are my current changes:
>>>> http://www.plan10.com/readline/readline-1.12a.zip 
>>>>
>>> Thanks for the link. It looks like your patch is a bit heavy to include 
>>> in the trunk version. I'm also working on a refactored version where it 
>>> will be easier to add new modes as plugins. I think we should 
>>> concentrate on merging your work there. Perhaps you can have a look and 
>>> see if you understand the code well enough to do the merge yourself.
>>>
>>> I'm happy to see you have added tests, something I have not worked on yet.
>>>
>>> You will probably see this but I have changed the indenting from 2 to 4 
>>> spaces from UNC readline.
>>>
>>>
>>> you can get it with svn:
>>> "svn co 
>>> http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor 
>>> pyreadline-refactor"
>>>
>>> The layout is as below:
>>>
>>> pyreadline
>>> 	rlmain      #contains Readline class
>>> 	clipboard   #clipboard functions
>>> 	console     #console interface
>>> 	keysyms     #key symbol mappings
>>> 	logger      #logging
>>> 	release     #release info
>>> 	
>>> 	lineeditor
>>> 		history     #implement history buffer
>>> 		lineobj     #implement lineeditor interface (so
>>>                              #movements etc doesn't have to be
>>>                              #duplicated in all modes)
>>> 		wordmatcher #functions for finding word boundaries
>>>
>>> 	modes             #editor modes
>>> 		emacs     #emacs mode
>>> 		notemacs  #crippled emacs for testing of mode
>>> 			  #selection functionality
>>>
>>>
>>> /J?rgen
>>>
>>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.net
>> http://scipy.net/mailman/listinfo/ipython-dev
>>
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.net
> http://scipy.net/mailman/listinfo/ipython-dev
> 



From mgraz at mnsgraz.plus.com  Sun Mar 26 10:26:00 2006
From: mgraz at mnsgraz.plus.com (Michael Graz)
Date: Sun, 26 Mar 2006 16:26:00 +0100
Subject: [IPython-dev] pyreadline vi mode
Message-ID: <000001c650e9$96447a30$0401a8c0@red>

I have been working on integrating the vi mode for pyreadline.  The latest
changes are here: http://www.plan10.com/readline/readline-1.13a.zip 

 

There are new versions of:

    pyreadline-refactor/pyreadline/modes/vi.py

    pyreadline-refactor/pyreadline/lineeditor/lineobj.py

 

And also the beginning of the vi tests:

    pyreadline-refactor/pyreadline/test/vi_test.py

 

The vi mode undo is not working yet, and there are still many tests to
merge.  I think I need a login and password to commit the changes directly
to svn.

 

A couple of thoughts:

 

- It would be nice to be compatible by default with existing .inputrc files
for readline configuration.  In that way if a user is a unix shell user then
their readline settings will automatically work with IPython.  Otherwise
they will have to go thru a conversion process to change their settings from
~/.inputrc to ~/pyreadlineconfig.ini.  And then any config changes will have
to be made in two different files.

 

- Not sure about using ctrl-c for copy operations.  Typically for a shell
that would mean interrupt or break.  Perhaps the ctrl-c could have special
modes so that if there is a selection then it behaves as the copy, as was
mentioned.  For windows cmd.exe the typical copy operation is select text
with the mouse, and the press enter to copy (assuming cmd.exe QuickEdit mode
is enabled).  It is at that point that the selected text makes it into the
clipboard.  This is different from the unix xterm convention where once text
is selected then it automatically is in the clipboard.  This approach may be
an interested feature to implement for win32 pyreadline.  That is once the
selection is enabled, the copy to clipboard happens automatically.

 

-Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060326/77a84a66/attachment.html>

From Fernando.Perez at colorado.edu  Mon Mar 27 14:49:59 2006
From: Fernando.Perez at colorado.edu (Fernando Perez)
Date: Mon, 27 Mar 2006 12:49:59 -0700
Subject: [IPython-dev] Semi-offline for a while
Message-ID: <442841E7.4070700@colorado.edu>

Hi all,

just a quick note to let you know that I'll be doing a fair bit of travel over 
the next 4 weeks.  While I'll have some net access, my lag time will 
inevitably increase.  Given that Ville and others have normal commit access, 
this shouldn't be a major issue for anyone.

We should soon have a Moin site set up for ipython, which will let us manage 
the main site also as a wiki, removing me from being the bottleneck for 
information on the main site (and in general allowing more community 
contributions there).  I'll drop you a line once this is active (Enthought is 
doing this for us).

Best to all,

f



From mgraz at mnsgraz.plus.com  Fri Mar 31 04:18:32 2006
From: mgraz at mnsgraz.plus.com (Michael Graz)
Date: Fri, 31 Mar 2006 10:18:32 +0100
Subject: [IPython-dev] pyreadline vi mode (2)
Message-ID: <001001c654a4$150b9c50$0301a8c0@red>

Here are the latest changes for the vi mode:

http://www.plan10.com/readline/readline-1.13b.zip 

 

All hundred plus unit tests for vi editing mode are now passing.  I like the
direction being taken in creating a lineobj class.  However I had to back
out some of the changes in order to get the unit tests working again.  Now
that all of the tests are in place, the refactoring using lineobj can
continue.  It would be cool if lineobj itself had a suite of tests.

 

So my changes are done for now.  BTW I am off now for the next few weeks on
vacation so if there is anything needed from me I will reply upon my return.

 

Regards,

-Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20060331/dc79f0f0/attachment.html>

From jorgen.stenarson at bostream.nu  Fri Mar 31 10:27:55 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Fri, 31 Mar 2006 17:27:55 +0200
Subject: [IPython-dev] pyreadline vi mode (2)
In-Reply-To: <001001c654a4$150b9c50$0301a8c0@red>
References: <001001c654a4$150b9c50$0301a8c0@red>
Message-ID: <442D4A7B.6040300@bostream.nu>

Hi,

I'll merge this over the weekend. I agree we should have tests for the 
lineobj as well. Perhaps I can use your tests for the vi mode as a base 
for this.

/J?rgen

Michael Graz skrev:
> Here are the latest changes for the vi mode:
> 
> http://www.plan10.com/readline/readline-1.13b.zip 
> 
>  
> 
> All hundred plus unit tests for vi editing mode are now passing.  I like the
> direction being taken in creating a lineobj class.  However I had to back
> out some of the changes in order to get the unit tests working again.  Now
> that all of the tests are in place, the refactoring using lineobj can
> continue.  It would be cool if lineobj itself had a suite of tests.
> 
>  
> 
> So my changes are done for now.  BTW I am off now for the next few weeks on
> vacation so if there is anything needed from me I will reply upon my return.
> 
>  
> 
> Regards,
> 
> -Michael
> 
> 



From jorgen.stenarson at bostream.nu  Fri Mar 31 15:47:24 2006
From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=)
Date: Fri, 31 Mar 2006 22:47:24 +0200
Subject: [IPython-dev] pyreadline vi mode (2)
In-Reply-To: <001001c654a4$150b9c50$0301a8c0@red>
References: <001001c654a4$150b9c50$0301a8c0@red>
Message-ID: <442D955C.4030204@bostream.nu>

Michael Graz skrev:
> Here are the latest changes for the vi mode:
> 
> http://www.plan10.com/readline/readline-1.13b.zip 
> 
>  
> 
> All hundred plus unit tests for vi editing mode are now passing.  I like the
> direction being taken in creating a lineobj class.  However I had to back
> out some of the changes in order to get the unit tests working again.  Now
> that all of the tests are in place, the refactoring using lineobj can
> continue.  It would be cool if lineobj itself had a suite of tests.
> 
>  
> 
> So my changes are done for now.  BTW I am off now for the next few weeks on
> vacation so if there is anything needed from me I will reply upon my return.
> 
>  
> 
> Regards,
> 
> -Michael
> 
> 
I have merged and comitted your patch.

So anyone interested in taking the new vi mode for a spin can check out 
from:
http://ipython.scipy.org/svn/ipython/pyreadline/branches/refactor

installation should be the same as standard pyreadline. Activate vi-mode 
by adding set_mode("vi") last in your pyreadlineconfig.ini

/J?rgen