[Zope] Am I doing right?

Paul Winkler pw_lists@slinkp.com
Sun, 15 Dec 2002 15:25:37 -0800


On Sun, Dec 15, 2002 at 08:06:59PM +0100, catonano wrote:
> Still, reading it a little better, I understood it uses a string as a 
> stack with the dot as a distinction point ('my.String.htm'.split(.) 

oops, don't forget the quotes around the dot.

> should give back a stack made like this:
> 
> htm
> String
> my
> 
> right?

You can think of it that way... technically, some_string.split()
returns a list:
['my', 'String', 'htm']

Lists can be treated like stacks in some respects; they have
a pop() method which removes and returns the last element in
the list.

> I was disappointed when I saw I haven't got the string API reference in 
> Zope but I have to connect to the Internet to read it. Too bad I don't 
> always have a net connection at my disposal.

you should grab the python documentation from python.org,
very good to have around.

> Back to us, I had to do a small modification to the 4 lines script; it 
> was
> 
> 
>    import string
>    name = context.getId()
>    splitname = id.split('.')  // where's 'id' defined?

oops, my mistake... should have been
splitname = name.split('.')

> The one thing I can't still do is search files in my catalog whose 
> names CONTAINS a substring.

don't really know, sorry.


-- 

Paul Winkler
http://www.slinkp.com
"Welcome to Muppet Labs, where the future is made - today!"