[Zope3-dev] comments on Guido's diary

Florent Guillaume fg@nuxeo.com
Tue, 10 Dec 2002 19:02:55 +0100


In article <3DF49FE9.4060101@cat-box.net> you write:
>  > Subproblem one: how to find this content object, given the
>  > Registration Utility object itself.  Several suggestions from SteveA:
>  > get the location (a tuple of strings) and look for '++etc++Services',
>  > or at least an item starting with '++etc++';
> 
> After checking with Jim, I can confirm that looking for 
> '++etc++Services' is the best thing to do here.

How about using lowercase here BTW? Do we really need a cap?
++etc++services looks a bit better to me.


>  > A bit about locations: there are several different ways to represent a
>  > location, and in general functions/methods that take a location accept
>  > them all.  One form is a unicode string containing slashes for
>  > separators; a leading slash means an absolute path.  Another form is a
>  > sequence of unicode strings that don't contain slashes; a leading
>  > empty string means an absolute path.  The root is represented by ['']
>  > or ('',); an empty list or tuple is not a path (I guess it means an
>  > empty relative path :-).
> 
> Look in Zope/App/Traversing/tests/testConvenienceFunctions.py
> You'll find the class attributes _good_locations and _bad_locations that 
> have the examples of valid and invalid locations used to test the 
> functions that convert between formats for locations.
> 
> According to this, a list is not a valid location.
> 
> The empty tuple is not a valid location. Perhaps it should be. I'd 
> welcome discussion and suggestions from people who have read through 
> this unit-test.

As Guido says, I'd suggest making () be valid and the equivalent of '.'
in Unix paths. I think that's the natural semantics. It will certainly
make code regular, and there's currently no way to express '.' in tuple
form.

Florent


-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com