Re: [Zope-dev] Re: Zope 3 ZPTs in Zope 2: Nearly done

2006-05-23 Thread Wichert Akkerman
Previously Tres Seaver wrote:
 Zope2 uses them at the beginning of a path to indicate traversal from
 the root.  -1 to dropping that case (it is the one which makes
 '/foo/bar' behave orthagonally).  Havinng blank elements work as no-ops
 also makes them behave predictably:  this is what command shells (sane
 ones, anyway) do with them.  E.g.:
 
   $ ls /path/to//foo
 
 yiels the same results as:
 
   $ ls /path/to/foo

That actually does not need to be true and POSIX does not dictate that.
There have been some discussions to use // as a marker for a different
kind of traversal for some filesystems.

Wichert.

-- 
Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope 3 ZPTs in Zope 2: Nearly done

2006-05-23 Thread Chris Withers

Philipp von Weitershausen wrote:

So, even though Chris Withers and you like the parallels to a Unix
shell, they're not even reality as of Zope 2.9.


Sorry, you're completely right and I'm mistaken, my apologies.

In TALES you always start from an object, so I'm +1 on banning empty 
segments in all places in a path :-)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope 3 ZPTs in Zope 2: Nearly done

2006-05-22 Thread Chris Withers

Tres Seaver wrote:

Zope2 uses them at the beginning of a path to indicate traversal from
the root.  -1 to dropping that case (it is the one which makes
'/foo/bar' behave orthagonally).  


Yeah, I'm actually about -10 to this ;-)

...think about trying to explain why:

context.restrictedTraverse('/plonesite/folder/document').absolute_url()

...works, while the following barfs at you:

tal:attributes=href /plonesite/folder/document/absolue_url

...which would mean you could no longer use Zope 2's catalog uids as 
paths for traversal, which would be a shame :-/



Havinng blank elements work as no-ops
also makes them behave predictably:  this is what command shells (sane
ones, anyway) do with them.  E.g.:

  $ ls /path/to//foo

yiels the same results as:

  $ ls /path/to/foo

So -0 to dropping the current blank traversal behavior at all.


Then again, I'm +0.1 on dropping empty path elements anywhere but the 
start of the path...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope 3 ZPTs in Zope 2: Nearly done

2006-05-22 Thread Paul Winkler
On Mon, May 22, 2006 at 03:41:21AM +0200, Philipp von Weitershausen wrote:
 Philipp von Weitershausen wrote:
  http://svn.zope.org/Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testDTMLTests.py?rev=68229view=auto
  http://svn.zope.org/Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py?rev=68230view=log
 
 I meant
 
 http://svn.zope.org/Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py?rev=68230view=log
 http://svn.zope.org/Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testExpressions.py?rev=68229view=auto
 
 instead.

Re. one of your questions:

#there are ways to make code compatible with 2.9 and 2.10:
#Add a nocall: before the python: expression (if that's
#possible?!?). 


Yes, it's possible. This works fine in 2.9:

  p tal:define=blah nocall:python:int tal:content=python:blah('1')+2
  /p

-- 

Paul Winkler
http://www.slinkp.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )